Skip to content

@usine/orchestrator/ssh

const layer: (instanceDirectory, config, brains, options) => Layer.Layer<CursorStore | CycleBudgets | ItemProjectionReader | ItemProjectionWriter | LoopControl | RepositoryLabelProjectionReader | RepositoryLabelProjectionWriter | RunEngine | RunReader, AttemptCancellationError | CredentialUnavailableError | EnginePersistenceError | ExecutorOperationError | RunInterventionRejectedError | RunNotFoundError | RunOperationRejectedError | UnsupportedWorkerError | WorkerCapabilityError, AttemptRuntime | CredentialProvider | TriggerCondition>

The full engine composition for a local orchestrator driving SSH Workers; brains are the instance roster checked at startup, and options addresses each Worker’s machine (sshWorkerAddressesOf(config) for the ones usine.yaml declares). The caller provides the CredentialProvider that mints each Attempt’s single-repository token, the TriggerCondition that re-checks queued Events, and the AttemptRuntime that runs each Attempt’s Pi parent in this process, built before the engine so durable storage is resumed before Run recovery. Gateway admin APIs are called with fetch.

Parameter Type
instanceDirectory InstanceDirectory
config UsineConfig
brains ReadonlyArray<BrainSpec>
options SshExecutorOptions

Layer.Layer<CursorStore | CycleBudgets | ItemProjectionReader | ItemProjectionWriter | LoopControl | RepositoryLabelProjectionReader | RepositoryLabelProjectionWriter | RunEngine | RunReader, AttemptCancellationError | CredentialUnavailableError | EnginePersistenceError | ExecutorOperationError | RunInterventionRejectedError | RunNotFoundError | RunOperationRejectedError | UnsupportedWorkerError | WorkerCapabilityError, AttemptRuntime | CredentialProvider | TriggerCondition>


const sshWorkerAddressesOf: (config) => Effect.Effect<object[], WorkerCapabilityError, never>

How the executor reaches each SSH Worker usine.yaml declares, in their declared order. The admin token of a Worker’s Gateway is read here, once, from the environment variable its admin_token_env names; an unset variable fails startup with a gateway capability error naming the Worker and the variable.

Parameter Type
config UsineConfig

Effect.Effect<object[], WorkerCapabilityError, never>


const sshWorkersOf: (config) => ReadonlyArray<SshWorker>

The SSH Workers usine.yaml declares, in their declared order.

Parameter Type
config UsineConfig

ReadonlyArray<SshWorker>