Skip to content

@usine/orchestrator/operator/http

An operator request that could not be fulfilled. error preserves the domain failure’s identity and message is safe to show to the operator; persistence details, credentials, and defect causes never travel in this envelope.

  • Schema.Class

new OperatorHttpError(…args): OperatorHttpError

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

OperatorHttpError

readonly error: "RunNotFoundError" | "RunOperationRejectedError" | "EnginePersistenceError" | "AttemptCancellationError" | "RunInterventionRejectedError" | "InstallationDiscoveryError" | "AppPermissionError" | "GitHubApiError" | "GitHubRateLimitError" | "InvalidGitHubResponseError" | "BackendUnavailableError" | "BoardItemNotFoundError" | "BoardLaneNotFoundError" | "BoardLaneReadOnlyError" | "BoardProjectNotFoundError" | "CrossSiteRequestError" | "CycleBudgetResetRejectedError" | "HttpBodyError" | "InvalidRequestError" | "RosterAgentNotFoundError" | "SchemaError" | "TranscriptAttemptNotFoundError"

readonly message: string

get status(): 400 | 403 | 404 | 409 | 500 | 502 | 503

The existing HTTP status associated with this refusal or failure.

400 | 403 | 404 | 409 | 500 | 502 | 503


Server policy for the operator transport: refuse cross-site origins before decoding or executing requests, and translate failures into operator envelopes. A server must supply this middleware; generated clients need no middleware layer.

  • HttpApiMiddleware.ServiceClass

new OperatorHttpPolicy(_): OperatorHttpPolicy

Parameter Type
_ never

OperatorHttpPolicy

const OperatorApi: HttpApi.HttpApi<"OperatorApi", HttpApiGroup.HttpApiGroup<"operator", HttpApiEndpoint.HttpApiEndpoint<"agents", "GET", "/api/agents", never, never, never, never, Schema.toCodecJson<Schema.$Array<Schema.brand<Schema.String, "AgentName">>>, never, OperatorHttpPolicy, never> | HttpApiEndpoint.HttpApiEndpoint<"pause", "POST", "/api/loops/:loop/pause", Schema.toCodecStringTree<Schema.Struct<{ loop: Schema.brand<Schema.NonEmptyString, "LoopName">; }>>, never, never, never, Schema.toCodecJson<Schema.Struct<{ ok: Schema.Literal<true>; }>>, never, OperatorHttpPolicy, never> | HttpApiEndpoint.HttpApiEndpoint<"unpause", "POST", "/api/loops/:loop/unpause", Schema.toCodecStringTree<Schema.Struct<{ loop: Schema.brand<Schema.NonEmptyString, "LoopName">; }>>, never, never, never, Schema.toCodecJson<Schema.Struct<{ ok: Schema.Literal<true>; }>>, never, OperatorHttpPolicy, never> | HttpApiEndpoint.HttpApiEndpoint<"approve", "POST", "/api/runs/:runId/approve", Schema.toCodecStringTree<Schema.Struct<{ runId: Schema.brand<Schema.NonEmptyString, "RunId">; }>>, never, never, never, Schema.toCodecJson<Schema.Struct<{ ok: Schema.Literal<true>; }>>, never, OperatorHttpPolicy, never> | HttpApiEndpoint.HttpApiEndpoint<"cancel", "POST", "/api/runs/:runId/cancel", Schema.toCodecStringTree<Schema.Struct<{ runId: Schema.brand<Schema.NonEmptyString, "RunId">; }>>, never, never, never, Schema.toCodecJson<Schema.Struct<{ ok: Schema.Literal<true>; }>>, never, OperatorHttpPolicy, never> | HttpApiEndpoint.HttpApiEndpoint<"retry", "POST", "/api/runs/:runId/retry", Schema.toCodecStringTree<Schema.Struct<{ runId: Schema.brand<Schema.NonEmptyString, "RunId">; }>>, never, never, never, Schema.toCodecJson<Schema.Struct<{ ok: Schema.Literal<true>; }>>, never, OperatorHttpPolicy, never> | HttpApiEndpoint.HttpApiEndpoint<"overview", "GET", "/api/overview", never, never, never, never, Schema.toCodecJson<Schema.Union<readonly [ReadyOverview, NeedsSetupOverview]>>, never, OperatorHttpPolicy, never> | HttpApiEndpoint.HttpApiEndpoint<"detail", "GET", "/api/runs/:runId", Schema.toCodecStringTree<Schema.Struct<{ runId: Schema.brand<Schema.NonEmptyString, "RunId">; }>>, Schema.toCodecStringTree<Schema.Union<readonly [Schema.decodeTo<Schema.toType<typeof ColdTranscriptRequest>, Schema.Struct<{ after: …; attempt: …; before: …; }>, never, never>, Schema.decodeTo<Schema.toType<typeof TailTranscriptRequest>, Schema.Struct<{ after: …; attempt: …; before: …; }>, never, never>, Schema.decodeTo<Schema.toType<typeof EarlierTranscriptRequest>, Schema.Struct<{ after: …; attempt: …; before: …; }>, never, never>]>>, never, never, Schema.toCodecJson<typeof RunDetailView>, never, OperatorHttpPolicy, never> | HttpApiEndpoint.HttpApiEndpoint<"resetCycleBudget", "POST", "/api/cycle-budgets/reset", never, never, Schema.toCodecJson<Schema.Struct<{ askId: Schema.brand<Schema.brand<Schema.NonEmptyString, "EventId">, "CycleBudgetAskId">; }>>, never, Schema.toCodecJson<Schema.Struct<{ ok: Schema.Literal<true>; }>>, never, OperatorHttpPolicy, never> | HttpApiEndpoint.HttpApiEndpoint<"resolveFailure", "POST", "/api/runs/:runId/resolve-failure", Schema.toCodecStringTree<Schema.Struct<{ runId: Schema.brand<Schema.NonEmptyString, "RunId">; }>>, never, Schema.toCodecJson<Schema.Struct<{ attemptId: Schema.brand<Schema.NonEmptyString, "AttemptId">; }>>, never, Schema.toCodecJson<Schema.Struct<{ ok: Schema.Literal<true>; }>>, never, OperatorHttpPolicy, never> | HttpApiEndpoint.HttpApiEndpoint<"moveBoardItem", "POST", "/api/projects/:owner/:repository/items/:item/lane", Schema.toCodecStringTree<Schema.Struct<{ item: Schema.compose<Schema.brand<Schema.Int, "ItemNumber">, Schema.FiniteFromString>; owner: Schema.String; repository: Schema.String; }>>, never, Schema.toCodecJson<Schema.Struct<{ toLane: Schema.brand<Schema.NonEmptyString, "BoardLaneId">; }>>, never, Schema.toCodecJson<Schema.Struct<{ ok: Schema.Literal<true>; }>>, never, OperatorHttpPolicy, never> | HttpApiEndpoint.HttpApiEndpoint<"editAndRetry", "POST", "/api/runs/:runId/edit-and-retry", Schema.toCodecStringTree<Schema.Struct<{ runId: Schema.brand<Schema.NonEmptyString, "RunId">; }>>, never, Schema.toCodecJson<Schema.decodeTo<Schema.declareConstructor<EditAndRetry, { agent: string; task: string; }, readonly [Schema.Struct<{ agent: …; task: …; }>], { agent: string & Brand; task: string & Brand; }>, Schema.Struct<{ agent: Schema.brand<Schema.String, "AgentName">; task: Schema.brand<Schema.String, "AttemptTask">; }>, never, never>>, never, Schema.toCodecJson<Schema.Struct<{ ok: Schema.Literal<true>; }>>, never, OperatorHttpPolicy, never> | HttpApiEndpoint.HttpApiEndpoint<"intervene", "POST", "/api/runs/:runId/intervene", Schema.toCodecStringTree<Schema.Struct<{ runId: Schema.brand<Schema.NonEmptyString, "RunId">; }>>, never, Schema.toCodecJson<Schema.decodeTo<Schema.declareConstructor<SessionIntervention, { action: { _tag: "Steer"; message: string; } | { _tag: "Interrupt"; } | { _tag: "OperatorMessage"; message: string; } | { _tag: "Release"; }; attemptId: string; target?: { _tag: "Parent"; } | { _tag: "Child"; sessionId: string; }; }, readonly [Schema.Struct<{ action: …; attemptId: …; target: …; }>], { action: { _tag: "Steer"; message: string; } | { _tag: "Interrupt"; } | { _tag: "OperatorMessage"; message: string; } | { _tag: "Release"; }; attemptId: string & Brand; target: { _tag: "Parent"; } | { _tag: "Child"; sessionId: … & …; }; }>, Schema.Struct<{ action: Schema.Union<readonly […, …, …, …]>; attemptId: Schema.brand<Schema.NonEmptyString, "AttemptId">; target: Schema.withDecodingDefaultKey<Schema.Union<readonly …>, never>; }>, never, never>>, never, Schema.toCodecJson<Schema.Struct<{ ok: Schema.Literal<true>; }>>, never, OperatorHttpPolicy, never>, false>>

The operator’s HTTP reads and interventions. Server handlers and generated clients derive URLs, request codecs, successful responses, and typed failures from this contract. Action acknowledgement means the request was accepted; subsequent observation reports execution and GitHub polling progress.

This capability is platform-free (ADRs 0012 and 0020). Library consumers can continue using Operator directly without an HTTP server or client.