@usine/orchestrator 0.2.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -21
- package/README.md +174 -52
- package/dist/board/items.d.ts +22 -3
- package/dist/board/items.d.ts.map +1 -1
- package/dist/board/items.js +44 -4
- package/dist/board/items.js.map +1 -1
- package/dist/board/projection.d.ts +8 -1
- package/dist/board/projection.d.ts.map +1 -1
- package/dist/board/projection.js +63 -14
- package/dist/board/projection.js.map +1 -1
- package/dist/board/tasks.d.ts +15 -3
- package/dist/board/tasks.d.ts.map +1 -1
- package/dist/board/tasks.js +28 -9
- package/dist/board/tasks.js.map +1 -1
- package/dist/cloudflare.d.ts +32 -0
- package/dist/cloudflare.d.ts.map +1 -0
- package/dist/cloudflare.js +68 -0
- package/dist/cloudflare.js.map +1 -0
- package/dist/credentials.d.ts +5 -6
- package/dist/credentials.d.ts.map +1 -1
- package/dist/credentials.js +22 -15
- package/dist/credentials.js.map +1 -1
- package/dist/current-instance/changes.d.ts +87 -0
- package/dist/current-instance/changes.d.ts.map +1 -0
- package/dist/current-instance/changes.js +141 -0
- package/dist/current-instance/changes.js.map +1 -0
- package/dist/current-instance/current-instance.d.ts +89 -0
- package/dist/current-instance/current-instance.d.ts.map +1 -0
- package/dist/current-instance/current-instance.js +163 -0
- package/dist/current-instance/current-instance.js.map +1 -0
- package/dist/exe-dev.d.ts +6 -2
- package/dist/exe-dev.d.ts.map +1 -1
- package/dist/exe-dev.js +10 -9
- package/dist/exe-dev.js.map +1 -1
- package/dist/http-client.d.ts +8 -0
- package/dist/http-client.d.ts.map +1 -0
- package/dist/http-client.js +8 -0
- package/dist/http-client.js.map +1 -0
- package/dist/idle-triggers.d.ts +1 -1
- package/dist/idle-triggers.d.ts.map +1 -1
- package/dist/idle-triggers.js +1 -1
- package/dist/idle-triggers.js.map +1 -1
- package/dist/label-reconciler.d.ts +5 -2
- package/dist/label-reconciler.d.ts.map +1 -1
- package/dist/label-reconciler.js.map +1 -1
- package/dist/lease-order.d.ts +60 -0
- package/dist/lease-order.d.ts.map +1 -0
- package/dist/lease-order.js +76 -0
- package/dist/lease-order.js.map +1 -0
- package/dist/local.d.ts +4 -18
- package/dist/local.d.ts.map +1 -1
- package/dist/local.js +9 -45
- package/dist/local.js.map +1 -1
- package/dist/loop-matches.d.ts +28 -0
- package/dist/loop-matches.d.ts.map +1 -0
- package/dist/loop-matches.js +74 -0
- package/dist/loop-matches.js.map +1 -0
- package/dist/operator/attempt.d.ts +76 -10
- package/dist/operator/attempt.d.ts.map +1 -1
- package/dist/operator/attempt.js +69 -11
- package/dist/operator/attempt.js.map +1 -1
- package/dist/operator/board.d.ts +48 -16
- package/dist/operator/board.d.ts.map +1 -1
- package/dist/operator/board.js +48 -17
- package/dist/operator/board.js.map +1 -1
- package/dist/operator/configuration.d.ts +314 -0
- package/dist/operator/configuration.d.ts.map +1 -0
- package/dist/operator/configuration.js +490 -0
- package/dist/operator/configuration.js.map +1 -0
- package/dist/operator/desk.d.ts +206 -0
- package/dist/operator/desk.d.ts.map +1 -0
- package/dist/operator/desk.js +525 -0
- package/dist/operator/desk.js.map +1 -0
- package/dist/operator/github-changes.d.ts +88 -0
- package/dist/operator/github-changes.d.ts.map +1 -0
- package/dist/operator/github-changes.js +266 -0
- package/dist/operator/github-changes.js.map +1 -0
- package/dist/operator/http.d.ts +135 -105
- package/dist/operator/http.d.ts.map +1 -1
- package/dist/operator/http.js +155 -30
- package/dist/operator/http.js.map +1 -1
- package/dist/operator/machines.d.ts +71 -0
- package/dist/operator/machines.d.ts.map +1 -0
- package/dist/operator/machines.js +103 -0
- package/dist/operator/machines.js.map +1 -0
- package/dist/operator/need.d.ts +58 -11
- package/dist/operator/need.d.ts.map +1 -1
- package/dist/operator/need.js +61 -9
- package/dist/operator/need.js.map +1 -1
- package/dist/operator/operator.d.ts +135 -29
- package/dist/operator/operator.d.ts.map +1 -1
- package/dist/operator/operator.js +370 -63
- package/dist/operator/operator.js.map +1 -1
- package/dist/operator/overview.d.ts +7 -7
- package/dist/operator/overview.d.ts.map +1 -1
- package/dist/operator/overview.js +5 -5
- package/dist/operator/overview.js.map +1 -1
- package/dist/operator/projection.d.ts +56 -5
- package/dist/operator/projection.d.ts.map +1 -1
- package/dist/operator/projection.js +108 -9
- package/dist/operator/projection.js.map +1 -1
- package/dist/operator/run.d.ts +101 -6
- package/dist/operator/run.d.ts.map +1 -1
- package/dist/operator/run.js +100 -7
- package/dist/operator/run.js.map +1 -1
- package/dist/operator/statistics/cache.d.ts +7 -0
- package/dist/operator/statistics/cache.d.ts.map +1 -0
- package/dist/operator/statistics/cache.js +40 -0
- package/dist/operator/statistics/cache.js.map +1 -0
- package/dist/operator/statistics/runs.d.ts +36 -0
- package/dist/operator/statistics/runs.d.ts.map +1 -0
- package/dist/operator/statistics/runs.js +284 -0
- package/dist/operator/statistics/runs.js.map +1 -0
- package/dist/operator/statistics/statistics.d.ts +20 -0
- package/dist/operator/statistics/statistics.d.ts.map +1 -0
- package/dist/operator/statistics/statistics.js +138 -0
- package/dist/operator/statistics/statistics.js.map +1 -0
- package/dist/operator/statistics/tasks.d.ts +30 -0
- package/dist/operator/statistics/tasks.d.ts.map +1 -0
- package/dist/operator/statistics/tasks.js +244 -0
- package/dist/operator/statistics/tasks.js.map +1 -0
- package/dist/operator/statistics/view.d.ts +302 -0
- package/dist/operator/statistics/view.d.ts.map +1 -0
- package/dist/operator/statistics/view.js +243 -0
- package/dist/operator/statistics/view.js.map +1 -0
- package/dist/operator/statistics/window.d.ts +24 -0
- package/dist/operator/statistics/window.d.ts.map +1 -0
- package/dist/operator/statistics/window.js +47 -0
- package/dist/operator/statistics/window.js.map +1 -0
- package/dist/operator/task.d.ts +94 -0
- package/dist/operator/task.d.ts.map +1 -0
- package/dist/operator/task.js +204 -0
- package/dist/operator/task.js.map +1 -0
- package/dist/operator/transcript.d.ts +12 -12
- package/dist/operator/transcript.d.ts.map +1 -1
- package/dist/operator/transcript.js +11 -9
- package/dist/operator/transcript.js.map +1 -1
- package/dist/operator/usage.d.ts +103 -0
- package/dist/operator/usage.d.ts.map +1 -0
- package/dist/operator/usage.js +234 -0
- package/dist/operator/usage.js.map +1 -0
- package/dist/orchestrator.d.ts +8 -5
- package/dist/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator.js +4 -2
- package/dist/orchestrator.js.map +1 -1
- package/dist/polling/closed-item-asks.d.ts +8 -0
- package/dist/polling/closed-item-asks.d.ts.map +1 -0
- package/dist/polling/closed-item-asks.js +28 -0
- package/dist/polling/closed-item-asks.js.map +1 -0
- package/dist/polling/cycle.d.ts +28 -10
- package/dist/polling/cycle.d.ts.map +1 -1
- package/dist/polling/cycle.js +20 -6
- package/dist/polling/cycle.js.map +1 -1
- package/dist/polling/evaluation-failures.d.ts +42 -0
- package/dist/polling/evaluation-failures.d.ts.map +1 -0
- package/dist/polling/evaluation-failures.js +103 -0
- package/dist/polling/evaluation-failures.js.map +1 -0
- package/dist/polling/hints.d.ts +2 -2
- package/dist/polling/hints.d.ts.map +1 -1
- package/dist/polling/hints.js +2 -2
- package/dist/polling/hints.js.map +1 -1
- package/dist/polling/loop-evaluation.d.ts +21 -11
- package/dist/polling/loop-evaluation.d.ts.map +1 -1
- package/dist/polling/loop-evaluation.js +70 -27
- package/dist/polling/loop-evaluation.js.map +1 -1
- package/dist/polling/open-issues.d.ts +23 -0
- package/dist/polling/open-issues.d.ts.map +1 -0
- package/dist/polling/open-issues.js +77 -0
- package/dist/polling/open-issues.js.map +1 -0
- package/dist/polling/open-pull-requests.d.ts +28 -0
- package/dist/polling/open-pull-requests.d.ts.map +1 -0
- package/dist/polling/open-pull-requests.js +131 -0
- package/dist/polling/open-pull-requests.js.map +1 -0
- package/dist/polling/polling.d.ts +20 -11
- package/dist/polling/polling.d.ts.map +1 -1
- package/dist/polling/polling.js +215 -52
- package/dist/polling/polling.js.map +1 -1
- package/dist/polling/repository-sync.d.ts +21 -14
- package/dist/polling/repository-sync.d.ts.map +1 -1
- package/dist/polling/repository-sync.js +35 -28
- package/dist/polling/repository-sync.js.map +1 -1
- package/dist/polling-triggers.d.ts +1 -1
- package/dist/polling-triggers.d.ts.map +1 -1
- package/dist/polling-triggers.js +1 -1
- package/dist/polling-triggers.js.map +1 -1
- package/dist/reloads.d.ts +14 -0
- package/dist/reloads.d.ts.map +1 -0
- package/dist/reloads.js +7 -0
- package/dist/reloads.js.map +1 -0
- package/dist/runtime.d.ts +24 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +58 -0
- package/dist/runtime.js.map +1 -0
- package/dist/schedule-triggers.d.ts +14 -10
- package/dist/schedule-triggers.d.ts.map +1 -1
- package/dist/schedule-triggers.js +36 -31
- package/dist/schedule-triggers.js.map +1 -1
- package/dist/scheduler.d.ts +45 -5
- package/dist/scheduler.d.ts.map +1 -1
- package/dist/scheduler.js +587 -44
- package/dist/scheduler.js.map +1 -1
- package/dist/ssh.d.ts +103 -0
- package/dist/ssh.d.ts.map +1 -0
- package/dist/ssh.js +144 -0
- package/dist/ssh.js.map +1 -0
- package/dist/trigger-condition.d.ts +12 -0
- package/dist/trigger-condition.d.ts.map +1 -0
- package/dist/trigger-condition.js +88 -0
- package/dist/trigger-condition.js.map +1 -0
- package/dist/trigger-submission.d.ts +16 -13
- package/dist/trigger-submission.d.ts.map +1 -1
- package/dist/trigger-submission.js +19 -14
- package/dist/trigger-submission.js.map +1 -1
- package/dist/worker-engine.d.ts +13 -0
- package/dist/worker-engine.d.ts.map +1 -0
- package/dist/worker-engine.js +56 -0
- package/dist/worker-engine.js.map +1 -0
- package/dist/worker-status.d.ts +140 -0
- package/dist/worker-status.d.ts.map +1 -0
- package/dist/worker-status.js +76 -0
- package/dist/worker-status.js.map +1 -0
- package/package.json +47 -22
package/dist/operator/http.js
CHANGED
|
@@ -1,16 +1,27 @@
|
|
|
1
|
+
import { FileStage, InstancePath } from "@usine/config/file";
|
|
1
2
|
import { AttemptId } from "@usine/core/attempt";
|
|
2
3
|
import { AgentName } from "@usine/core/agent";
|
|
3
4
|
import { CycleBudgetAskId } from "@usine/core/cycle-budget";
|
|
4
5
|
import { ItemNumber } from "@usine/core/item";
|
|
5
6
|
import { LoopName } from "@usine/core/loop";
|
|
7
|
+
import { RepositoryName } from "@usine/core/repository";
|
|
6
8
|
import { RunId } from "@usine/core/run";
|
|
9
|
+
import { WorkerName } from "@usine/core/worker";
|
|
10
|
+
import { RunAgainResult } from "@usine/engine/engine";
|
|
7
11
|
import { TranscriptSequence } from "@usine/engine/transcript";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
12
|
+
import { ExecutorOperation, WorkerCapability } from "@usine/executor";
|
|
13
|
+
import { Effect, Match, Record, Schema, SchemaTransformation } from "effect";
|
|
14
|
+
import { HttpApi, HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware } from "effect/http-api";
|
|
15
|
+
import { InstanceReload, RestartBlock } from "../current-instance/changes.js";
|
|
10
16
|
import { BoardLaneId } from "./board.js";
|
|
11
17
|
import { ColdTranscriptRequest, EarlierTranscriptRequest, TailTranscriptRequest, } from "./transcript.js";
|
|
12
18
|
import { FactoryOverview } from "./overview.js";
|
|
13
19
|
import { RunDetailView, EditAndRetry, SessionIntervention } from "./run.js";
|
|
20
|
+
import { RunGitHubChangesView } from "./github-changes.js";
|
|
21
|
+
import { TaskView } from "./task.js";
|
|
22
|
+
import { ConfigurationView } from "./configuration.js";
|
|
23
|
+
import { DeskView } from "./desk.js";
|
|
24
|
+
import { RunStatisticsView, StatisticsView, StatisticsWindow } from "./statistics/view.js";
|
|
14
25
|
const errorStatuses = {
|
|
15
26
|
SchemaError: 400,
|
|
16
27
|
InvalidRequestError: 400,
|
|
@@ -20,11 +31,18 @@ const errorStatuses = {
|
|
|
20
31
|
BoardProjectNotFoundError: 404,
|
|
21
32
|
BoardItemNotFoundError: 404,
|
|
22
33
|
BoardLaneNotFoundError: 404,
|
|
34
|
+
GitHubItemNotFoundError: 404,
|
|
23
35
|
RunOperationRejectedError: 409,
|
|
36
|
+
RunRetryBlockedError: 409,
|
|
24
37
|
RunInterventionRejectedError: 409,
|
|
38
|
+
LeftoversDiscardRejectedError: 409,
|
|
25
39
|
RosterAgentNotFoundError: 404,
|
|
40
|
+
LoopNotFoundError: 404,
|
|
26
41
|
CycleBudgetResetRejectedError: 409,
|
|
27
42
|
BoardLaneReadOnlyError: 409,
|
|
43
|
+
RestartRequiredError: 409,
|
|
44
|
+
ReloadPreflightError: 409,
|
|
45
|
+
FactoryConfigError: 422,
|
|
28
46
|
EnginePersistenceError: 500,
|
|
29
47
|
AttemptCancellationError: 500,
|
|
30
48
|
HttpBodyError: 500,
|
|
@@ -36,31 +54,109 @@ const errorStatuses = {
|
|
|
36
54
|
GitHubRateLimitError: 503,
|
|
37
55
|
};
|
|
38
56
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* details, credentials, and defect causes never travel in this envelope.
|
|
57
|
+
* A failed operator request. `error` is the domain failure's tag and `message` is safe to show;
|
|
58
|
+
* persistence details, credentials, and defect causes are never included.
|
|
42
59
|
*/
|
|
43
60
|
export class OperatorHttpError extends Schema.Error("@usine/orchestrator/OperatorHttpError")({ error: Schema.Literals(Record.keys(errorStatuses)), message: Schema.String }) {
|
|
44
|
-
/** The
|
|
61
|
+
/** The HTTP status for this error. */
|
|
45
62
|
get status() {
|
|
46
63
|
return errorStatuses[this.error];
|
|
47
64
|
}
|
|
48
65
|
}
|
|
49
|
-
// The
|
|
50
|
-
//
|
|
66
|
+
// The envelope uses `error` as its discriminator; `Schema.Error` keeps that wire shape and gives
|
|
67
|
+
// browser callers a validated Error.
|
|
51
68
|
const errors = [...new Set(Object.values(errorStatuses))].map((status) => OperatorHttpError.check(Schema.makeFilter((error) => error.status === status)).annotate({
|
|
52
69
|
httpApiStatus: status,
|
|
53
70
|
}));
|
|
54
71
|
/**
|
|
55
|
-
* Server
|
|
56
|
-
*
|
|
57
|
-
*
|
|
72
|
+
* Server middleware for the operator API that refuses cross-site origins before decoding requests
|
|
73
|
+
* and maps failures to operator envelopes. Servers must provide it; generated clients don't need
|
|
74
|
+
* it.
|
|
58
75
|
*/
|
|
59
76
|
export class OperatorHttpPolicy extends HttpApiMiddleware.Service()("@usine/orchestrator/OperatorHttpPolicy", { error: errors }) {
|
|
60
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* The Worker preflight failure behind a refused reload. The check's observation isn't sent to the
|
|
80
|
+
* client.
|
|
81
|
+
*/
|
|
82
|
+
export const ReloadPreflightFailure = Schema.Union([
|
|
83
|
+
Schema.TaggedStruct("WorkerCapabilityError", {
|
|
84
|
+
worker: WorkerName,
|
|
85
|
+
capability: WorkerCapability,
|
|
86
|
+
message: Schema.String,
|
|
87
|
+
}),
|
|
88
|
+
Schema.TaggedStruct("ExecutorOperationError", {
|
|
89
|
+
operation: ExecutorOperation,
|
|
90
|
+
message: Schema.String,
|
|
91
|
+
}),
|
|
92
|
+
Schema.TaggedStruct("CredentialUnavailableError", {
|
|
93
|
+
repository: RepositoryName,
|
|
94
|
+
message: Schema.String,
|
|
95
|
+
}),
|
|
96
|
+
]);
|
|
97
|
+
/** A reload refused because `usine.yaml` changed in a way that needs a restart of `usine up`. */
|
|
98
|
+
export class RestartRequiredRefusal extends Schema.Error("@usine/orchestrator/RestartRequiredRefusal")({
|
|
99
|
+
error: Schema.Literal("RestartRequiredError"),
|
|
100
|
+
message: Schema.String,
|
|
101
|
+
/** The `usine.yaml` blocks that contain the changed fields. */
|
|
102
|
+
blocks: Schema.NonEmptyArray(RestartBlock),
|
|
103
|
+
/**
|
|
104
|
+
* The changed fields as paths into `usine.yaml`, such as `webhooks` or
|
|
105
|
+
* `workers.build-1.destination`.
|
|
106
|
+
*/
|
|
107
|
+
fields: Schema.NonEmptyArray(Schema.NonEmptyString),
|
|
108
|
+
}, { httpApiStatus: 409 }) {
|
|
109
|
+
}
|
|
110
|
+
/** A reload refused because Worker preflight failed for the Agents and Workers it adds. */
|
|
111
|
+
export class ReloadPreflightRefusal extends Schema.Error("@usine/orchestrator/ReloadPreflightRefusal")({
|
|
112
|
+
error: Schema.Literal("ReloadPreflightError"),
|
|
113
|
+
message: Schema.String,
|
|
114
|
+
/** The reloaded Agents whose brains preflight checked on every Worker. */
|
|
115
|
+
agents: Schema.Array(AgentName),
|
|
116
|
+
/** The Workers added or given more slots by the reload, which preflight checked. */
|
|
117
|
+
workers: Schema.Array(WorkerName),
|
|
118
|
+
cause: ReloadPreflightFailure,
|
|
119
|
+
}, { httpApiStatus: 409 }) {
|
|
120
|
+
}
|
|
121
|
+
/** A reload refused because `usine.yaml` or a file it depends on couldn't be loaded. */
|
|
122
|
+
export class FactoryConfigRefusal extends Schema.Error("@usine/orchestrator/FactoryConfigRefusal")({
|
|
123
|
+
error: Schema.Literal("FactoryConfigError"),
|
|
124
|
+
message: Schema.String,
|
|
125
|
+
file: InstancePath,
|
|
126
|
+
stage: FileStage,
|
|
127
|
+
}, { httpApiStatus: 422 }) {
|
|
128
|
+
}
|
|
129
|
+
/** Returns the reload endpoint's refusal for `error`, with `message` for the operator. */
|
|
130
|
+
export const reloadRefusal = (error, message) => Match.valueTags(error, {
|
|
131
|
+
RestartRequiredError: ({ _tag, blocks, fields }) => new RestartRequiredRefusal({ error: _tag, message, blocks, fields }),
|
|
132
|
+
ReloadPreflightError: ({ _tag, agents, workers, cause }) => new ReloadPreflightRefusal({
|
|
133
|
+
error: _tag,
|
|
134
|
+
message,
|
|
135
|
+
agents,
|
|
136
|
+
workers,
|
|
137
|
+
cause: Match.valueTags(cause, {
|
|
138
|
+
WorkerCapabilityError: (failure) => ({
|
|
139
|
+
_tag: failure._tag,
|
|
140
|
+
worker: failure.worker,
|
|
141
|
+
capability: failure.capability,
|
|
142
|
+
message: failure.message,
|
|
143
|
+
}),
|
|
144
|
+
ExecutorOperationError: (failure) => ({
|
|
145
|
+
_tag: failure._tag,
|
|
146
|
+
operation: failure.operation,
|
|
147
|
+
message: failure.message,
|
|
148
|
+
}),
|
|
149
|
+
CredentialUnavailableError: (failure) => ({
|
|
150
|
+
_tag: failure._tag,
|
|
151
|
+
repository: failure.repository,
|
|
152
|
+
message: failure.message,
|
|
153
|
+
}),
|
|
154
|
+
}),
|
|
155
|
+
}),
|
|
156
|
+
FactoryConfigError: ({ _tag, file, stage }) => new FactoryConfigRefusal({ error: _tag, message, file, stage }),
|
|
157
|
+
});
|
|
61
158
|
const absent = Schema.optionalKey(Schema.Never);
|
|
62
|
-
//
|
|
63
|
-
// Preserve that convention when HttpApi supplies repeated keys as arrays.
|
|
159
|
+
// Use the first occurrence of a repeated query key, as `URLSearchParams.get` did.
|
|
64
160
|
const queryValue = Schema.Union([
|
|
65
161
|
Schema.String,
|
|
66
162
|
Schema.NonEmptyArray(Schema.String).pipe(Schema.decodeTo(Schema.String, SchemaTransformation.transform({
|
|
@@ -69,8 +165,8 @@ const queryValue = Schema.Union([
|
|
|
69
165
|
}))),
|
|
70
166
|
]);
|
|
71
167
|
const sequence = queryValue.pipe(Schema.decodeTo(Schema.FiniteFromString), Schema.decodeTo(TranscriptSequence));
|
|
72
|
-
// Each wire variant rules out the other cursors before decoding into the
|
|
73
|
-
//
|
|
168
|
+
// Each wire variant rules out the other cursors before decoding into the domain request. Unknown
|
|
169
|
+
// search keys are ignored.
|
|
74
170
|
const transcriptQuery = Schema.Union([
|
|
75
171
|
Schema.Struct({ after: absent, before: absent, attempt: absent }).pipe(Schema.decodeTo(Schema.toType(ColdTranscriptRequest), SchemaTransformation.transform({
|
|
76
172
|
decode: () => new ColdTranscriptRequest(),
|
|
@@ -93,36 +189,43 @@ const repositoryPart = Schema.String.check(Schema.isPattern(/^[A-Za-z0-9_.-]+$/u
|
|
|
93
189
|
const acknowledged = Schema.Struct({ ok: Schema.Literal(true) });
|
|
94
190
|
const runParams = { runId: RunId };
|
|
95
191
|
const loopParams = { loop: LoopName };
|
|
192
|
+
const statisticsQuery = Schema.Struct({
|
|
193
|
+
window: queryValue.pipe(Schema.decodeTo(StatisticsWindow), Schema.withDecodingDefaultKey(Effect.succeed("30d"))),
|
|
194
|
+
});
|
|
96
195
|
/**
|
|
97
|
-
* The operator's HTTP reads and interventions
|
|
98
|
-
* clients
|
|
99
|
-
* from this contract. Action acknowledgement means the request was accepted;
|
|
100
|
-
* subsequent observation reports execution and GitHub polling progress.
|
|
101
|
-
*
|
|
102
|
-
* This capability is platform-free (ADRs 0012 and 0020). Library consumers can
|
|
103
|
-
* continue using Operator directly without an HTTP server or client.
|
|
196
|
+
* The operator's HTTP API contract for reads and interventions, shared by server handlers and
|
|
197
|
+
* generated clients. An action's acknowledgement only means the request was accepted.
|
|
104
198
|
*/
|
|
105
199
|
export const OperatorApi = HttpApi.make("OperatorApi").add(HttpApiGroup.make("operator")
|
|
106
200
|
.add(HttpApiEndpoint.get("overview", "/api/overview", { success: FactoryOverview }), HttpApiEndpoint.get("agents", "/api/agents", { success: Schema.Array(AgentName) }), HttpApiEndpoint.post("editAndRetry", "/api/runs/:runId/edit-and-retry", {
|
|
107
201
|
params: runParams,
|
|
108
|
-
payload: EditAndRetry
|
|
202
|
+
payload: EditAndRetry,
|
|
109
203
|
success: acknowledged,
|
|
204
|
+
}), HttpApiEndpoint.post("runAgain", "/api/runs/:runId/run-again", {
|
|
205
|
+
params: runParams,
|
|
206
|
+
payload: EditAndRetry,
|
|
207
|
+
success: RunAgainResult,
|
|
110
208
|
}), HttpApiEndpoint.post("intervene", "/api/runs/:runId/intervene", {
|
|
111
209
|
params: runParams,
|
|
112
|
-
payload: SessionIntervention
|
|
210
|
+
payload: SessionIntervention,
|
|
113
211
|
success: acknowledged,
|
|
114
212
|
}), HttpApiEndpoint.post("resetCycleBudget", "/api/cycle-budgets/reset", {
|
|
115
|
-
payload: Schema.Struct({ askId: CycleBudgetAskId })
|
|
116
|
-
parseOptions: { onExcessProperty: "error" },
|
|
117
|
-
}),
|
|
213
|
+
payload: Schema.Struct({ askId: CycleBudgetAskId }),
|
|
118
214
|
success: acknowledged,
|
|
119
215
|
}), HttpApiEndpoint.get("detail", "/api/runs/:runId", {
|
|
120
216
|
params: runParams,
|
|
121
217
|
query: transcriptQuery,
|
|
122
218
|
success: RunDetailView,
|
|
219
|
+
}), HttpApiEndpoint.get("githubChanges", "/api/runs/:runId/github-changes", {
|
|
220
|
+
params: runParams,
|
|
221
|
+
success: RunGitHubChangesView,
|
|
123
222
|
}), HttpApiEndpoint.post("approve", "/api/runs/:runId/approve", {
|
|
124
223
|
params: runParams,
|
|
125
224
|
success: acknowledged,
|
|
225
|
+
}), HttpApiEndpoint.post("resolveFailure", "/api/runs/:runId/resolve-failure", {
|
|
226
|
+
params: runParams,
|
|
227
|
+
payload: Schema.Struct({ attemptId: AttemptId }),
|
|
228
|
+
success: acknowledged,
|
|
126
229
|
}), HttpApiEndpoint.post("retry", "/api/runs/:runId/retry", {
|
|
127
230
|
params: runParams,
|
|
128
231
|
success: acknowledged,
|
|
@@ -135,9 +238,10 @@ export const OperatorApi = HttpApi.make("OperatorApi").add(HttpApiGroup.make("op
|
|
|
135
238
|
repository: repositoryPart,
|
|
136
239
|
item: Schema.FiniteFromString.pipe(Schema.decodeTo(ItemNumber)),
|
|
137
240
|
},
|
|
138
|
-
payload: Schema.Struct({ toLane: BoardLaneId })
|
|
139
|
-
|
|
140
|
-
|
|
241
|
+
payload: Schema.Struct({ toLane: BoardLaneId }),
|
|
242
|
+
success: acknowledged,
|
|
243
|
+
}), HttpApiEndpoint.post("discardLeftovers", "/api/workers/:worker/discard-leftovers", {
|
|
244
|
+
params: { worker: WorkerName },
|
|
141
245
|
success: acknowledged,
|
|
142
246
|
}), HttpApiEndpoint.post("pause", "/api/loops/:loop/pause", {
|
|
143
247
|
params: loopParams,
|
|
@@ -145,6 +249,27 @@ export const OperatorApi = HttpApi.make("OperatorApi").add(HttpApiGroup.make("op
|
|
|
145
249
|
}), HttpApiEndpoint.post("unpause", "/api/loops/:loop/unpause", {
|
|
146
250
|
params: loopParams,
|
|
147
251
|
success: acknowledged,
|
|
252
|
+
}), HttpApiEndpoint.post("reload", "/api/instance/reload", {
|
|
253
|
+
success: InstanceReload,
|
|
254
|
+
error: [RestartRequiredRefusal, ReloadPreflightRefusal, FactoryConfigRefusal],
|
|
255
|
+
}))
|
|
256
|
+
.add(HttpApiEndpoint.get("task", "/api/projects/:owner/:repository/tasks/:item", {
|
|
257
|
+
params: {
|
|
258
|
+
owner: repositoryPart,
|
|
259
|
+
repository: repositoryPart,
|
|
260
|
+
item: Schema.FiniteFromString.pipe(Schema.decodeTo(ItemNumber)),
|
|
261
|
+
},
|
|
262
|
+
success: TaskView,
|
|
263
|
+
}))
|
|
264
|
+
.add(HttpApiEndpoint.get("configuration", "/api/configuration", { success: ConfigurationView }))
|
|
265
|
+
.add(HttpApiEndpoint.get("desk", "/api/desk", { success: DeskView }))
|
|
266
|
+
.add(HttpApiEndpoint.get("statistics", "/api/statistics", {
|
|
267
|
+
query: statisticsQuery,
|
|
268
|
+
success: StatisticsView,
|
|
269
|
+
}), HttpApiEndpoint.get("runStatistics", "/api/statistics/runs", {
|
|
270
|
+
query: statisticsQuery,
|
|
271
|
+
success: RunStatisticsView,
|
|
148
272
|
}))
|
|
273
|
+
.annotate(HttpApi.PayloadParseOptions, { onExcessProperty: "error" })
|
|
149
274
|
.middleware(OperatorHttpPolicy));
|
|
150
275
|
//# sourceMappingURL=http.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/operator/http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OA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C,CACH;KACA,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,eAAe,EAAE,oBAAoB,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC,CAAC;KAC/F,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;KACpE,GAAG,CACF,eAAe,CAAC,GAAG,CAAC,YAAY,EAAE,iBAAiB,EAAE;IACnD,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,cAAc;CACxB,CAAC,EACF,eAAe,CAAC,GAAG,CAAC,eAAe,EAAE,sBAAsB,EAAE;IAC3D,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,iBAAiB;CAC3B,CAAC,CACH;KACA,QAAQ,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC;KACpE,UAAU,CAAC,kBAAkB,CAAC,CAClC,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { SshWorker } from "@usine/config/factory";
|
|
2
|
+
import { type MachineStatus } from "@usine/executor";
|
|
3
|
+
import { Schema } from "effect";
|
|
4
|
+
import type { ProvisioningPause } from "../worker-status.ts";
|
|
5
|
+
declare const MachineView_base: Schema.Class<MachineView, Schema.Struct<{
|
|
6
|
+
readonly worker: Schema.brand<Schema.String, "WorkerName">;
|
|
7
|
+
readonly provider: Schema.Literals<readonly ["hetzner", "boat"]>;
|
|
8
|
+
readonly state: Schema.Literals<readonly ["creating", "ready", "deleting"]>;
|
|
9
|
+
/** The provider's ID, or null until the provider accepts the creation. */
|
|
10
|
+
readonly id: Schema.NullOr<Schema.brand<Schema.String, "MachineId">>;
|
|
11
|
+
/** The Run it was created for, or null for a machine found after a restart. */
|
|
12
|
+
readonly runId: Schema.NullOr<Schema.brand<Schema.NonEmptyString, "RunId">>;
|
|
13
|
+
/** The Attempt it serves, or null until the Attempt starts. */
|
|
14
|
+
readonly attemptId: Schema.NullOr<Schema.brand<Schema.NonEmptyString, "AttemptId">>;
|
|
15
|
+
/** When its creation started, or when the provider created a machine found after a restart, as an ISO instant. */
|
|
16
|
+
readonly since: Schema.String;
|
|
17
|
+
}>, {}>;
|
|
18
|
+
/** A machine that a provisioned Worker created for one Attempt and hasn't deleted yet. */
|
|
19
|
+
export declare class MachineView extends MachineView_base {
|
|
20
|
+
}
|
|
21
|
+
declare const ProvisioningPauseView_base: Schema.Class<ProvisioningPauseView, Schema.Struct<{
|
|
22
|
+
/** Why the creation failed, or `check` if the first machine of the day failed its preflight. */
|
|
23
|
+
readonly reason: Schema.Union<readonly [Schema.Literals<readonly ["capacity", "quota", "refused", "provider", "unreachable", "timeout"]>, Schema.Literal<"check">]>;
|
|
24
|
+
readonly message: Schema.String;
|
|
25
|
+
/** The number of failed creations in a row. */
|
|
26
|
+
readonly failures: Schema.Int;
|
|
27
|
+
readonly failedAt: Schema.String;
|
|
28
|
+
readonly retryAt: Schema.String;
|
|
29
|
+
/** Whether the Worker waits for `retryAt` before it creates a machine. */
|
|
30
|
+
readonly blocked: Schema.Boolean;
|
|
31
|
+
}>, {}>;
|
|
32
|
+
/** A provisioned Worker whose last machine creation failed, and when it tries again. */
|
|
33
|
+
export declare class ProvisioningPauseView extends ProvisioningPauseView_base {
|
|
34
|
+
}
|
|
35
|
+
declare const HetznerProvisionerView_base: Schema.Class<HetznerProvisionerView, Schema.TaggedStruct<"hetzner", {
|
|
36
|
+
readonly tokenEnv: Schema.String;
|
|
37
|
+
readonly serverType: Schema.brand<Schema.String, "HetznerServerType">;
|
|
38
|
+
readonly location: Schema.brand<Schema.String, "HetznerLocation">;
|
|
39
|
+
readonly image: Schema.brand<Schema.String, "HetznerImage">;
|
|
40
|
+
readonly network: Schema.NullOr<Schema.brand<Schema.String, "HetznerResourceName">>;
|
|
41
|
+
readonly firewall: Schema.withConstructorDefault<Schema.NullOr<Schema.brand<Schema.String, "HetznerResourceName">>>;
|
|
42
|
+
readonly sshKey: Schema.brand<Schema.String, "HetznerResourceName">;
|
|
43
|
+
readonly sshUser: Schema.brand<Schema.String, "SshUser">;
|
|
44
|
+
readonly labels: Schema.$Record<Schema.String, Schema.String>;
|
|
45
|
+
/** The variable with the Anthropic API key for each Attempt, or null. */
|
|
46
|
+
readonly anthropicKeyEnv: Schema.NullOr<Schema.String>;
|
|
47
|
+
/** The variable with the OpenAI API key for each Attempt, or null. */
|
|
48
|
+
readonly openaiKeyEnv: Schema.NullOr<Schema.String>;
|
|
49
|
+
}>, {}>;
|
|
50
|
+
/** A Hetzner Cloud provisioner from `usine.yaml`, with the names of its variables only. */
|
|
51
|
+
export declare class HetznerProvisionerView extends HetznerProvisionerView_base {
|
|
52
|
+
}
|
|
53
|
+
declare const BoatProvisionerView_base: Schema.Class<BoatProvisionerView, Schema.TaggedStruct<"boat", {
|
|
54
|
+
readonly tokenEnv: Schema.String;
|
|
55
|
+
readonly size: Schema.Literals<readonly ["small", "default", "large", "xlarge"]>;
|
|
56
|
+
/** The variable with the Anthropic API key for each Attempt, or null. */
|
|
57
|
+
readonly anthropicKeyEnv: Schema.NullOr<Schema.String>;
|
|
58
|
+
/** The variable with the OpenAI API key for each Attempt, or null. */
|
|
59
|
+
readonly openaiKeyEnv: Schema.NullOr<Schema.String>;
|
|
60
|
+
}>, {}>;
|
|
61
|
+
/** A Boat provisioner from `usine.yaml`, with the names of its variables only. */
|
|
62
|
+
export declare class BoatProvisionerView extends BoatProvisionerView_base {
|
|
63
|
+
}
|
|
64
|
+
export declare const ProvisionerView: Schema.Union<readonly [typeof HetznerProvisionerView, typeof BoatProvisionerView]>;
|
|
65
|
+
export type ProvisionerView = typeof ProvisionerView.Type;
|
|
66
|
+
export declare const machineView: (machine: MachineStatus) => MachineView;
|
|
67
|
+
export declare const provisioningPauseView: (pause: ProvisioningPause) => ProvisioningPauseView;
|
|
68
|
+
/** Returns the operator view of an SSH Worker's provisioner, or null for a long-lived machine. */
|
|
69
|
+
export declare const provisionerView: (worker: SshWorker) => ProvisionerView | null;
|
|
70
|
+
export {};
|
|
71
|
+
//# sourceMappingURL=machines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"machines.d.ts","sourceRoot":"","sources":["../../src/operator/machines.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAcvD,OAAO,EAAgB,KAAK,aAAa,EAA4B,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EAA4B,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;;;;;IAO3D,0EAA0E;;IAE1E,+EAA+E;;IAE/E,+DAA+D;;IAE/D,kHAAkH;;;AAXpH,0FAA0F;AAC1F,qBAAa,WAAY,SAAQ,gBAY/B;CAAG;;IAMH,gGAAgG;;;IAGhG,+CAA+C;;;;IAI/C,0EAA0E;;;AAX5E,wFAAwF;AACxF,qBAAa,qBAAsB,SAAQ,0BAYzC;CAAG;;;;;;;;;;;IAiBH,yEAAyE;;IAEzE,sEAAsE;;;AAjBxE,2FAA2F;AAC3F,qBAAa,sBAAuB,SAAQ,2BAkB1C;CAAG;;;;IAQH,yEAAyE;;IAEzE,sEAAsE;;;AARxE,kFAAkF;AAClF,qBAAa,mBAAoB,SAAQ,wBASvC;CAAG;AAEL,eAAO,MAAM,eAAe,oFAA8D,CAAC;AAC3F,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAC;AAE1D,eAAO,MAAM,WAAW,YAAa,aAAa,KAAG,WASjD,CAAC;AAEL,eAAO,MAAM,qBAAqB,UAAW,iBAAiB,KAAG,qBAQ7D,CAAC;AAEL,kGAAkG;AAClG,eAAO,MAAM,eAAe,WAAY,SAAS,KAAG,eAAe,GAAG,IAwBlE,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { AttemptId } from "@usine/core/attempt";
|
|
2
|
+
import { RunId } from "@usine/core/run";
|
|
3
|
+
import { BoatSize, HetznerImage, HetznerLocation, HetznerResourceName, HetznerServerType, MachineId, MachineProvider, SshUser, WorkerName, } from "@usine/core/worker";
|
|
4
|
+
import { MachineState, MachineUnavailableReason } from "@usine/executor";
|
|
5
|
+
import { DateTime, Effect, Option, Schema } from "effect";
|
|
6
|
+
/** A machine that a provisioned Worker created for one Attempt and hasn't deleted yet. */
|
|
7
|
+
export class MachineView extends Schema.Class("@usine/orchestrator/MachineView")({
|
|
8
|
+
worker: WorkerName,
|
|
9
|
+
provider: MachineProvider,
|
|
10
|
+
state: MachineState,
|
|
11
|
+
/** The provider's ID, or null until the provider accepts the creation. */
|
|
12
|
+
id: Schema.NullOr(MachineId),
|
|
13
|
+
/** The Run it was created for, or null for a machine found after a restart. */
|
|
14
|
+
runId: Schema.NullOr(RunId),
|
|
15
|
+
/** The Attempt it serves, or null until the Attempt starts. */
|
|
16
|
+
attemptId: Schema.NullOr(AttemptId),
|
|
17
|
+
/** When its creation started, or when the provider created a machine found after a restart, as an ISO instant. */
|
|
18
|
+
since: Schema.String,
|
|
19
|
+
}) {
|
|
20
|
+
}
|
|
21
|
+
/** A provisioned Worker whose last machine creation failed, and when it tries again. */
|
|
22
|
+
export class ProvisioningPauseView extends Schema.Class("@usine/orchestrator/ProvisioningPauseView")({
|
|
23
|
+
/** Why the creation failed, or `check` if the first machine of the day failed its preflight. */
|
|
24
|
+
reason: Schema.Union([MachineUnavailableReason, Schema.Literal("check")]),
|
|
25
|
+
message: Schema.String,
|
|
26
|
+
/** The number of failed creations in a row. */
|
|
27
|
+
failures: Schema.Int,
|
|
28
|
+
failedAt: Schema.String,
|
|
29
|
+
retryAt: Schema.String,
|
|
30
|
+
/** Whether the Worker waits for `retryAt` before it creates a machine. */
|
|
31
|
+
blocked: Schema.Boolean,
|
|
32
|
+
}) {
|
|
33
|
+
}
|
|
34
|
+
/** A Hetzner Cloud provisioner from `usine.yaml`, with the names of its variables only. */
|
|
35
|
+
export class HetznerProvisionerView extends Schema.TaggedClass("@usine/orchestrator/HetznerProvisionerView")("hetzner", {
|
|
36
|
+
tokenEnv: Schema.String,
|
|
37
|
+
serverType: HetznerServerType,
|
|
38
|
+
location: HetznerLocation,
|
|
39
|
+
image: HetznerImage,
|
|
40
|
+
network: Schema.NullOr(HetznerResourceName),
|
|
41
|
+
firewall: Schema.NullOr(HetznerResourceName).pipe(Schema.withConstructorDefault(Effect.succeed(null))),
|
|
42
|
+
sshKey: HetznerResourceName,
|
|
43
|
+
sshUser: SshUser,
|
|
44
|
+
labels: Schema.Record(Schema.String, Schema.String),
|
|
45
|
+
/** The variable with the Anthropic API key for each Attempt, or null. */
|
|
46
|
+
anthropicKeyEnv: Schema.NullOr(Schema.String),
|
|
47
|
+
/** The variable with the OpenAI API key for each Attempt, or null. */
|
|
48
|
+
openaiKeyEnv: Schema.NullOr(Schema.String),
|
|
49
|
+
}) {
|
|
50
|
+
}
|
|
51
|
+
/** A Boat provisioner from `usine.yaml`, with the names of its variables only. */
|
|
52
|
+
export class BoatProvisionerView extends Schema.TaggedClass("@usine/orchestrator/BoatProvisionerView")("boat", {
|
|
53
|
+
tokenEnv: Schema.String,
|
|
54
|
+
size: BoatSize,
|
|
55
|
+
/** The variable with the Anthropic API key for each Attempt, or null. */
|
|
56
|
+
anthropicKeyEnv: Schema.NullOr(Schema.String),
|
|
57
|
+
/** The variable with the OpenAI API key for each Attempt, or null. */
|
|
58
|
+
openaiKeyEnv: Schema.NullOr(Schema.String),
|
|
59
|
+
}) {
|
|
60
|
+
}
|
|
61
|
+
export const ProvisionerView = Schema.Union([HetznerProvisionerView, BoatProvisionerView]);
|
|
62
|
+
export const machineView = (machine) => new MachineView({
|
|
63
|
+
worker: machine.worker,
|
|
64
|
+
provider: machine.provider,
|
|
65
|
+
state: machine.state,
|
|
66
|
+
id: Option.getOrNull(machine.id),
|
|
67
|
+
runId: Option.getOrNull(machine.runId),
|
|
68
|
+
attemptId: Option.getOrNull(machine.attemptId),
|
|
69
|
+
since: DateTime.formatIso(machine.since),
|
|
70
|
+
});
|
|
71
|
+
export const provisioningPauseView = (pause) => new ProvisioningPauseView({
|
|
72
|
+
reason: pause.reason,
|
|
73
|
+
message: pause.message,
|
|
74
|
+
failures: pause.failures,
|
|
75
|
+
failedAt: DateTime.formatIso(pause.failedAt),
|
|
76
|
+
retryAt: DateTime.formatIso(pause.retryAt),
|
|
77
|
+
blocked: pause.blocked,
|
|
78
|
+
});
|
|
79
|
+
/** Returns the operator view of an SSH Worker's provisioner, or null for a long-lived machine. */
|
|
80
|
+
export const provisionerView = (worker) => Option.match(worker.provisioner, {
|
|
81
|
+
onNone: () => null,
|
|
82
|
+
onSome: (settings) => settings.provider === "hetzner"
|
|
83
|
+
? new HetznerProvisionerView({
|
|
84
|
+
tokenEnv: settings.tokenEnv,
|
|
85
|
+
serverType: settings.serverType,
|
|
86
|
+
location: settings.location,
|
|
87
|
+
image: settings.image,
|
|
88
|
+
network: Option.getOrNull(settings.network),
|
|
89
|
+
firewall: Option.getOrNull(settings.firewall),
|
|
90
|
+
sshKey: settings.sshKey,
|
|
91
|
+
sshUser: settings.sshUser,
|
|
92
|
+
labels: settings.labels,
|
|
93
|
+
anthropicKeyEnv: Option.getOrNull(settings.apiKeys.anthropic),
|
|
94
|
+
openaiKeyEnv: Option.getOrNull(settings.apiKeys.openai),
|
|
95
|
+
})
|
|
96
|
+
: new BoatProvisionerView({
|
|
97
|
+
tokenEnv: settings.tokenEnv,
|
|
98
|
+
size: settings.size,
|
|
99
|
+
anthropicKeyEnv: Option.getOrNull(settings.apiKeys.anthropic),
|
|
100
|
+
openaiKeyEnv: Option.getOrNull(settings.apiKeys.openai),
|
|
101
|
+
}),
|
|
102
|
+
});
|
|
103
|
+
//# sourceMappingURL=machines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"machines.js","sourceRoot":"","sources":["../../src/operator/machines.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,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,QAAQ;YAC3B,UAAU,EAAE,QAAQ,CAAC,UAAU;YAC/B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC;YAC3C,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAC7C,MAAM,EAAE,QAAQ,CAAC,MAAM;YACvB,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,MAAM,EAAE,QAAQ,CAAC,MAAM;YACvB,eAAe,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC;YAC7D,YAAY,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;SACxD,CAAC;QACJ,CAAC,CAAC,IAAI,mBAAmB,CAAC;YACtB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,eAAe,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC;YAC7D,YAAY,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;SACxD,CAAC;CACT,CAAC,CAAC"}
|
package/dist/operator/need.d.ts
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
|
+
import { ConfigFileError } from "@usine/config/file";
|
|
1
2
|
import { CycleBudgetAsk } from "@usine/core/cycle-budget";
|
|
2
3
|
import { Schema } from "effect";
|
|
3
4
|
import { LabelPreflightFinding } from "../label-reconciler.ts";
|
|
4
5
|
import { RepositoryPollFailure } from "../polling-triggers.ts";
|
|
5
|
-
import { BoardProjectionError } from "./board.ts";
|
|
6
|
+
import { BoardItemLink, BoardProjectionError } from "./board.ts";
|
|
6
7
|
declare const ApprovalNeed_base: Schema.Class<ApprovalNeed, Schema.TaggedStruct<"ApprovalNeed", {
|
|
7
8
|
readonly id: Schema.String;
|
|
8
9
|
readonly repository: Schema.brand<Schema.String, "RepositoryName">;
|
|
9
10
|
readonly runId: Schema.brand<Schema.NonEmptyString, "RunId">;
|
|
10
11
|
readonly loop: Schema.brand<Schema.NonEmptyString, "LoopName">;
|
|
12
|
+
/**
|
|
13
|
+
* The Run's Item as its Board card shows it, or null if no card on the Board has that Item, such
|
|
14
|
+
* as for a schedule Run.
|
|
15
|
+
*/
|
|
16
|
+
readonly item: Schema.NullOr<typeof BoardItemLink>;
|
|
11
17
|
}>, {}>;
|
|
12
|
-
/**
|
|
18
|
+
/** A Run that needs operator approval before it can proceed. */
|
|
13
19
|
export declare class ApprovalNeed extends ApprovalNeed_base {
|
|
14
20
|
}
|
|
15
21
|
declare const RunFailureNeed_base: Schema.Class<RunFailureNeed, Schema.TaggedStruct<"RunFailureNeed", {
|
|
@@ -17,50 +23,91 @@ declare const RunFailureNeed_base: Schema.Class<RunFailureNeed, Schema.TaggedStr
|
|
|
17
23
|
readonly repository: Schema.brand<Schema.String, "RepositoryName">;
|
|
18
24
|
readonly runId: Schema.brand<Schema.NonEmptyString, "RunId">;
|
|
19
25
|
readonly loop: Schema.brand<Schema.NonEmptyString, "LoopName">;
|
|
20
|
-
readonly failure: Schema.Union<readonly [typeof import("./attempt.ts").InfraFailureView, typeof import("./attempt.ts").DefectFailureView, typeof import("./attempt.ts").AgentFailureView, typeof import("./attempt.ts").RunawayFailureView, typeof import("./attempt.ts").ChildSessionBudgetFailureView]>;
|
|
26
|
+
readonly failure: Schema.Union<readonly [typeof import("./attempt.ts").InfraFailureView, typeof import("./attempt.ts").DefectFailureView, typeof import("./attempt.ts").AgentFailureView, typeof import("./attempt.ts").BlockedFailureView, typeof import("./attempt.ts").QuestionFailureView, typeof import("./attempt.ts").RunawayFailureView, typeof import("./attempt.ts").ChildSessionBudgetFailureView]>;
|
|
21
27
|
}>, {}>;
|
|
22
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* A failed Run that needs an operator decision. After a `QuestionFailure` or `BlockedFailure`, the
|
|
30
|
+
* Item's next state opens no Run of the Loop (ADR 0017).
|
|
31
|
+
*/
|
|
23
32
|
export declare class RunFailureNeed extends RunFailureNeed_base {
|
|
24
33
|
}
|
|
25
34
|
declare const PollFailureNeed_base: Schema.Class<PollFailureNeed, Schema.TaggedStruct<"PollFailureNeed", {
|
|
26
35
|
readonly id: Schema.String;
|
|
27
36
|
readonly failure: typeof RepositoryPollFailure;
|
|
28
37
|
}>, {}>;
|
|
29
|
-
/**
|
|
38
|
+
/** A repository poll failure that needs operator attention. */
|
|
30
39
|
export declare class PollFailureNeed extends PollFailureNeed_base {
|
|
31
40
|
}
|
|
32
41
|
declare const PreflightFindingNeed_base: Schema.Class<PreflightFindingNeed, Schema.TaggedStruct<"PreflightFindingNeed", {
|
|
33
42
|
readonly id: Schema.String;
|
|
34
43
|
readonly finding: typeof LabelPreflightFinding;
|
|
35
44
|
}>, {}>;
|
|
36
|
-
/** A declared repository label
|
|
45
|
+
/** A declared repository label that couldn't be created or confirmed. */
|
|
37
46
|
export declare class PreflightFindingNeed extends PreflightFindingNeed_base {
|
|
38
47
|
}
|
|
39
48
|
declare const BoardProjectionNeed_base: Schema.Class<BoardProjectionNeed, Schema.TaggedStruct<"BoardProjectionNeed", {
|
|
40
49
|
readonly id: Schema.String;
|
|
41
50
|
readonly failure: typeof BoardProjectionError;
|
|
42
51
|
}>, {}>;
|
|
43
|
-
/** An Item
|
|
52
|
+
/** An Item that couldn't be shown on its Board. */
|
|
44
53
|
export declare class BoardProjectionNeed extends BoardProjectionNeed_base {
|
|
45
54
|
}
|
|
46
55
|
declare const ScheduleFailureNeed_base: Schema.Class<ScheduleFailureNeed, Schema.TaggedStruct<"ScheduleFailureNeed", {
|
|
47
56
|
readonly id: Schema.String;
|
|
48
57
|
readonly failure: Schema.Union<readonly [typeof import("../schedule-triggers.ts").ScheduleAgentFailure, typeof import("../schedule-triggers.ts").ScheduleCronFailure, typeof import("../schedule-triggers.ts").ScheduleTickFailure]>;
|
|
49
58
|
}>, {}>;
|
|
50
|
-
/** A
|
|
59
|
+
/** A schedule Loop that couldn't evaluate or submit its work. */
|
|
51
60
|
export declare class ScheduleFailureNeed extends ScheduleFailureNeed_base {
|
|
52
61
|
}
|
|
62
|
+
declare const ConfigFileNeed_base: Schema.Class<ConfigFileNeed, Schema.TaggedStruct<"ConfigFileNeed", {
|
|
63
|
+
readonly id: Schema.String;
|
|
64
|
+
readonly kind: Schema.Literals<readonly ["loop", "agent"]>;
|
|
65
|
+
readonly error: typeof ConfigFileError;
|
|
66
|
+
}>, {}>;
|
|
67
|
+
/**
|
|
68
|
+
* An authored file that failed to load at startup and was left out: a quarantined Loop opens no
|
|
69
|
+
* Runs, and an invalid Agent isn't in the roster. A fix takes effect at the next `usine up`.
|
|
70
|
+
*/
|
|
71
|
+
export declare class ConfigFileNeed extends ConfigFileNeed_base {
|
|
72
|
+
}
|
|
73
|
+
declare const UnconfiguredWorkerNeed_base: Schema.Class<UnconfiguredWorkerNeed, Schema.Struct<{
|
|
74
|
+
readonly _tag: Schema.tag<"UnconfiguredWorkerNeed">;
|
|
75
|
+
readonly id: Schema.String;
|
|
76
|
+
readonly worker: Schema.brand<Schema.String, "WorkerName">;
|
|
77
|
+
readonly attempts: Schema.Int;
|
|
78
|
+
readonly running: Schema.Int;
|
|
79
|
+
}>, {}>;
|
|
80
|
+
/**
|
|
81
|
+
* Attempts recorded on a Worker that `usine.yaml` no longer declares, which startup doesn't
|
|
82
|
+
* reconcile. Discarding their leftovers fails while `running` is above 0.
|
|
83
|
+
*/
|
|
84
|
+
export declare class UnconfiguredWorkerNeed extends UnconfiguredWorkerNeed_base {
|
|
85
|
+
}
|
|
86
|
+
declare const UnconfirmedStopNeed_base: Schema.Class<UnconfirmedStopNeed, Schema.TaggedStruct<"UnconfirmedStopNeed", {
|
|
87
|
+
readonly id: Schema.String;
|
|
88
|
+
readonly repository: Schema.brand<Schema.String, "RepositoryName">;
|
|
89
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "RunId">;
|
|
90
|
+
readonly loop: Schema.brand<Schema.NonEmptyString, "LoopName">;
|
|
91
|
+
readonly attemptNumber: Schema.brand<Schema.Int, "AttemptNumber">;
|
|
92
|
+
readonly worker: Schema.brand<Schema.String, "WorkerName">;
|
|
93
|
+
}>, {}>;
|
|
94
|
+
/**
|
|
95
|
+
* A closed Attempt whose parent task couldn't be confirmed stopped. It is still ending on `worker`
|
|
96
|
+
* and takes one of its slots until a retried stop succeeds (#475).
|
|
97
|
+
*/
|
|
98
|
+
export declare class UnconfirmedStopNeed extends UnconfirmedStopNeed_base {
|
|
99
|
+
}
|
|
53
100
|
declare const CycleBudgetNeed_base: Schema.Class<CycleBudgetNeed, Schema.TaggedStruct<"CycleBudgetNeed", {
|
|
54
101
|
readonly id: Schema.String;
|
|
55
102
|
readonly ask: typeof CycleBudgetAsk;
|
|
56
103
|
readonly itemLabel: Schema.String;
|
|
57
104
|
readonly itemUrl: Schema.NullOr<Schema.String>;
|
|
58
105
|
}>, {}>;
|
|
59
|
-
/** An Item stopped opening Runs
|
|
106
|
+
/** An Item that stopped opening Runs until the operator resets its cycle budget. */
|
|
60
107
|
export declare class CycleBudgetNeed extends CycleBudgetNeed_base {
|
|
61
108
|
}
|
|
62
|
-
/** One reason the
|
|
63
|
-
export declare const NeedView: Schema.Union<readonly [typeof CycleBudgetNeed, typeof ApprovalNeed, typeof BoardProjectionNeed, typeof RunFailureNeed, typeof PollFailureNeed, typeof PreflightFindingNeed, typeof ScheduleFailureNeed]>;
|
|
109
|
+
/** One reason the overview asks for operator attention. */
|
|
110
|
+
export declare const NeedView: Schema.Union<readonly [typeof CycleBudgetNeed, typeof ApprovalNeed, typeof BoardProjectionNeed, typeof RunFailureNeed, typeof PollFailureNeed, typeof PreflightFindingNeed, typeof ScheduleFailureNeed, typeof ConfigFileNeed, typeof UnconfiguredWorkerNeed, typeof UnconfirmedStopNeed]>;
|
|
64
111
|
export type NeedView = typeof NeedView.Type;
|
|
65
112
|
export {};
|
|
66
113
|
//# sourceMappingURL=need.d.ts.map
|