Skip to content

@usine/config/factory

An exe.dev VM named after the Worker, with the number of Attempts it may run at the same time.

  • Schema.Class

new ExeDevWorker(…args): ExeDevWorker

Parameter Type
…args [props: object, options?: MakeOptions]

ExeDevWorker

readonly kind: "exe.dev"

readonly maxConcurrentAttempts: number

readonly name: string & Brand<"WorkerName">


The orchestrator’s own machine as a Worker, with the number of Attempts it may run at the same time.

  • Schema.Class

new LocalWorker(…args): LocalWorker

Parameter Type
…args [props: object, options?: MakeOptions]

LocalWorker

readonly kind: "local"

readonly maxConcurrentAttempts: number

readonly name: string & Brand<"WorkerName">


A repository the factory manages, with its selector tags and configured Board lanes.

  • Schema.Class

new ManagedRepo(…args): ManagedRepo

Parameter Type
…args [props: object, options?: MakeOptions]

ManagedRepo

readonly lanes: readonly Lane[]

readonly name: string & Brand<"RepositoryName">

readonly tags: readonly (string & Brand<"RegistryTag">)[]


Factory-wide polling, Attempt limits, and defaults for the coordinating parent.

  • Schema.Class

new Settings(…args): Settings

Parameter Type
…args [props: object, options?: MakeOptions]

Settings

readonly maxAttemptMinutes: Option<number>

Wall-clock ceiling per Attempt in minutes. Absent by default: the runaway guard’s timer is not armed.

readonly maxAttemptTokens: Option<number>

Consumed-token ceiling per Attempt across the parent and every child. Absent by default: the token guard is not armed.

readonly maxChildren: number & Brand<"ChildSessionBudget">

Total child sessions allowed over one Attempt’s lifetime, including sequential spawns; defaults to four.

readonly parentEffort: Option<"off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">

Default parent reasoning effort; if neither Agent nor factory supplies one, the child’s effort applies.

readonly parentModel: Option<string & Brand<"ModelId">>

Parent model used when the Agent has no override; an absent default leaves selection to Pi.

readonly pollInterval: number

Seconds between routine GitHub polling cycles; defaults to 60.


A Linux machine the orchestrator connects to over SSH, with the number of Attempts it may run at the same time. The orchestrator’s ssh client connects to destination, on port and with identityFile when given, and the Worker keeps its state under <root>/workers/<name> on the machine. A Worker behind a gateway has no GitHub token on its machine: the executor attaches each Attempt’s token to the Gateway instead.

  • Schema.Class

new SshWorker(…args): SshWorker

Parameter Type
…args [props: object, options?: MakeOptions]

SshWorker

readonly destination: string & Brand<"SshDestination">

readonly gateway: Option<WorkerGateway>

readonly identityFile: Option<string & Brand<"SshIdentityFile">>

readonly kind: "ssh"

readonly maxConcurrentAttempts: number

readonly name: string & Brand<"WorkerName">

readonly port: Option<number & Brand<"SshPort">>

readonly root: string & Brand<"WorkerRoot">


The factory’s repository registry, Worker capacity, labels, and operating defaults from usine.yaml.

  • Schema.Class

new UsineConfig(…args): UsineConfig

Parameter Type
…args [props: object, options?: MakeOptions]

UsineConfig

readonly labels: readonly DeclaredLabel[]

readonly operator: Option<string & Brand<"OperatorLogin">>

readonly repos: readonly ManagedRepo[]

readonly settings: Settings

readonly version: 1

readonly webhooks: { mode: "off"; } | { mode: "deliveries"; } | { mode: "endpoint"; publicUrl: URL; }

readonly workers: readonly (LocalWorker | ExeDevWorker | SshWorker)[]


The Gateway in front of an SSH Worker’s machine on a private network (ADR 0027). domain is the Gateway’s private DNS domain. adminUrl is its admin API as the orchestrator reaches it, usually a local forward through the SSH connection to the Gateway. The admin token is read at startup from the orchestrator’s environment variable adminTokenEnv, so it is never in the file. llmProviders names the providers whose credential the Gateway holds. A harness whose provider is not listed uses the operator’s login on the Worker and reaches the provider through the Gateway’s forward proxy; Codex always does.

  • Schema.Class

new WorkerGateway(…args): WorkerGateway

Parameter Type
…args [props: object, options?: MakeOptions]

WorkerGateway

readonly adminTokenEnv: string & Brand<"EnvironmentVariableName">

readonly adminUrl: URL

readonly domain: string & Brand<"GatewayDomain">

readonly llmProviders: readonly "anthropic"[]

OperatorLogin = typeof OperatorLogin.Type

GitHub login identifying the human operator for this factory.


RegistryTag = typeof RegistryTag.Type

A factory-defined repository grouping that Loops can select by tag.


Webhooks = typeof Webhooks.Type

How GitHub hints reach the factory to request earlier polling; routine polling remains the backstop.


Worker = typeof Worker.Type

A named place to execute Attempts; its kind selects the Worker adapter and the settings that adapter needs.

const OperatorLogin: Schema.brand<Schema.String, "OperatorLogin">

GitHub login identifying the human operator for this factory.


const RegistryTag: Schema.brand<Schema.String, "RegistryTag">

A factory-defined repository grouping that Loops can select by tag.


const Webhooks: Schema.Union<readonly [Schema.Struct<{ mode: Schema.Literal<"off">; }>, Schema.Struct<{ mode: Schema.Literal<"deliveries">; }>, Schema.encodeKeys<Schema.Struct<{ mode: Schema.Literal<"endpoint">; publicUrl: Schema.URLFromString; }>, { publicUrl: "public_url"; }>]>

How GitHub hints reach the factory to request earlier polling; routine polling remains the backstop.


const Worker: Schema.Union<readonly [typeof LocalWorker, typeof ExeDevWorker, typeof SshWorker]>

A named place to execute Attempts; its kind selects the Worker adapter and the settings that adapter needs.