@usine/orchestrator 0.3.0 → 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 +32 -9
- package/dist/board/items.d.ts +14 -3
- package/dist/board/items.d.ts.map +1 -1
- package/dist/board/items.js +29 -1
- package/dist/board/items.js.map +1 -1
- package/dist/board/projection.d.ts +2 -1
- package/dist/board/projection.d.ts.map +1 -1
- package/dist/board/projection.js +20 -10
- package/dist/board/projection.js.map +1 -1
- package/dist/board/tasks.d.ts +1 -1
- package/dist/board/tasks.d.ts.map +1 -1
- package/dist/board/tasks.js +7 -3
- 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/current-instance/changes.d.ts +3 -3
- package/dist/current-instance/changes.d.ts.map +1 -1
- package/dist/current-instance/changes.js +6 -3
- package/dist/current-instance/changes.js.map +1 -1
- package/dist/current-instance/current-instance.d.ts +3 -3
- package/dist/exe-dev.d.ts +1 -1
- package/dist/exe-dev.d.ts.map +1 -1
- package/dist/exe-dev.js +3 -1
- 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/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 +1 -1
- package/dist/local.d.ts.map +1 -1
- package/dist/local.js +3 -1
- package/dist/local.js.map +1 -1
- package/dist/operator/attempt.d.ts +22 -3
- package/dist/operator/attempt.d.ts.map +1 -1
- package/dist/operator/attempt.js +22 -3
- package/dist/operator/attempt.js.map +1 -1
- package/dist/operator/board.d.ts +8 -3
- package/dist/operator/board.d.ts.map +1 -1
- package/dist/operator/board.js +8 -4
- package/dist/operator/board.js.map +1 -1
- package/dist/operator/configuration.d.ts +65 -9
- package/dist/operator/configuration.d.ts.map +1 -1
- package/dist/operator/configuration.js +90 -10
- package/dist/operator/configuration.js.map +1 -1
- package/dist/operator/desk.d.ts +33 -8
- package/dist/operator/desk.d.ts.map +1 -1
- package/dist/operator/desk.js +73 -11
- package/dist/operator/desk.js.map +1 -1
- package/dist/operator/http.d.ts +14 -79
- package/dist/operator/http.d.ts.map +1 -1
- package/dist/operator/http.js +20 -14
- 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 +15 -1
- package/dist/operator/need.d.ts.map +1 -1
- package/dist/operator/need.js +15 -0
- package/dist/operator/need.js.map +1 -1
- package/dist/operator/operator.d.ts +36 -10
- package/dist/operator/operator.d.ts.map +1 -1
- package/dist/operator/operator.js +136 -31
- package/dist/operator/operator.js.map +1 -1
- package/dist/operator/overview.d.ts +2 -2
- package/dist/operator/projection.d.ts +2 -0
- package/dist/operator/projection.d.ts.map +1 -1
- package/dist/operator/projection.js +12 -4
- package/dist/operator/projection.js.map +1 -1
- package/dist/operator/run.d.ts +30 -0
- package/dist/operator/run.d.ts.map +1 -1
- package/dist/operator/run.js +31 -1
- 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 +2 -1
- package/dist/operator/task.d.ts.map +1 -1
- package/dist/operator/task.js +3 -3
- package/dist/operator/task.js.map +1 -1
- package/dist/operator/usage.d.ts +10 -18
- package/dist/operator/usage.d.ts.map +1 -1
- package/dist/operator/usage.js +57 -42
- package/dist/operator/usage.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/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.map +1 -1
- package/dist/polling/polling.js +31 -18
- package/dist/polling/polling.js.map +1 -1
- package/dist/polling/repository-sync.d.ts +1 -0
- package/dist/polling/repository-sync.d.ts.map +1 -1
- package/dist/polling/repository-sync.js +1 -1
- package/dist/polling/repository-sync.js.map +1 -1
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +10 -10
- package/dist/runtime.js.map +1 -1
- package/dist/scheduler.d.ts +13 -4
- package/dist/scheduler.d.ts.map +1 -1
- package/dist/scheduler.js +312 -55
- package/dist/scheduler.js.map +1 -1
- package/dist/ssh.d.ts +71 -7
- package/dist/ssh.d.ts.map +1 -1
- package/dist/ssh.js +84 -15
- package/dist/ssh.js.map +1 -1
- package/dist/worker-engine.d.ts +7 -4
- package/dist/worker-engine.d.ts.map +1 -1
- package/dist/worker-engine.js +36 -5
- package/dist/worker-engine.js.map +1 -1
- package/dist/worker-status.d.ts +80 -10
- package/dist/worker-status.d.ts.map +1 -1
- package/dist/worker-status.js +31 -10
- package/dist/worker-status.js.map +1 -1
- package/package.json +29 -25
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changes.d.ts","sourceRoot":"","sources":["../../src/current-instance/changes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAKrD,OAAO,EAAS,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIvC;;;GAGG;AACH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"changes.d.ts","sourceRoot":"","sources":["../../src/current-instance/changes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAKrD,OAAO,EAAS,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIvC;;;GAGG;AACH,eAAO,MAAM,YAAY,8DAAkC,CAAC;AAE5D,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,I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6
|
import { canonicalRepositoryName, RepositoryName } from "@usine/core/repository";
|
|
7
7
|
import { WorkerName } from "@usine/core/worker";
|
|
8
8
|
import { Equal, Schema } from "effect";
|
|
9
|
-
const RESTART_BLOCKS = ["workers", "webhooks"];
|
|
9
|
+
const RESTART_BLOCKS = ["workers", "webhooks", "tracing"];
|
|
10
10
|
/**
|
|
11
11
|
* A `usine.yaml` block with changes that apply only when `usine up` starts, so a reload refuses
|
|
12
12
|
* them.
|
|
@@ -65,13 +65,16 @@ export const agentsWithNewBrains = (running, loaded) => {
|
|
|
65
65
|
return loaded.agents.filter(({ agent }) => !runningBrains.some((brain) => Equal.equals(brain, agent.brain)));
|
|
66
66
|
};
|
|
67
67
|
/**
|
|
68
|
-
* Returns the changes in `loaded` that only a restart applies: a changed `webhooks`
|
|
69
|
-
* changed `workers` block while no Worker runs Attempts, as in setup mode.
|
|
68
|
+
* Returns the changes in `loaded` that only a restart applies: a changed `webhooks` or `tracing`
|
|
69
|
+
* block, and a changed `workers` block while no Worker runs Attempts, as in setup mode.
|
|
70
70
|
*/
|
|
71
71
|
export const restartChanges = (running, loaded, workersRun) => [
|
|
72
72
|
...(Equal.equals(running.config.webhooks, loaded.config.webhooks)
|
|
73
73
|
? []
|
|
74
74
|
: [{ block: "webhooks", field: "webhooks", reason: "the webhooks block changed" }]),
|
|
75
|
+
...(Equal.equals(running.config.tracing, loaded.config.tracing)
|
|
76
|
+
? []
|
|
77
|
+
: [{ block: "tracing", field: "tracing", reason: "the tracing block changed" }]),
|
|
75
78
|
...(workersRun || Equal.equals(running.config.workers, loaded.config.workers)
|
|
76
79
|
? []
|
|
77
80
|
: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changes.js","sourceRoot":"","sources":["../../src/current-instance/changes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnE,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CA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KAAK,SAAS;YAAE,SAAS;QACpC,OAAO,CAAC,IAAI,CAAC;YACX,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,WAAW,QAAQ,CAAC,IAAI,OAAO;YACtC,MAAM,EAAE,WAAW,QAAQ,CAAC,IAAI,qBAAqB,OAAO,CAAC,IAAI,GAAG;SACrE,CAAC,CAAC;IACL,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAC9C,CAAC,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { ExecutorError } from "@usine/executor";
|
|
|
8
8
|
import { Array as EffectArray, Context, Effect, Layer, Schema, type Scope, type Stream } from "effect";
|
|
9
9
|
import { InstanceReload, type RestartChange } from "./changes.ts";
|
|
10
10
|
declare const RestartRequiredError_base: Schema.Class<RestartRequiredError, Schema.TaggedStruct<"RestartRequiredError", {
|
|
11
|
-
readonly blocks: Schema.NonEmptyArray<Schema.Literals<readonly ["workers", "webhooks"]>>;
|
|
11
|
+
readonly blocks: Schema.NonEmptyArray<Schema.Literals<readonly ["workers", "webhooks", "tracing"]>>;
|
|
12
12
|
/**
|
|
13
13
|
* The changed fields as paths into `usine.yaml`, such as `webhooks` or
|
|
14
14
|
* `workers.build-1.destination`.
|
|
@@ -65,8 +65,8 @@ declare const CurrentInstance_base: Context.ServiceClass<CurrentInstance, "@usin
|
|
|
65
65
|
readonly changes: Stream.Stream<LoadedInstance>;
|
|
66
66
|
/**
|
|
67
67
|
* Reloads the instance folder, one reload at a time, and returns what changed. Fails and keeps
|
|
68
|
-
* the running snapshot on an invalid `usine.yaml`, a changed `webhooks` block, or
|
|
69
|
-
* `workers` change.
|
|
68
|
+
* the running snapshot on an invalid `usine.yaml`, a changed `webhooks` or `tracing` block, or
|
|
69
|
+
* a rejected `workers` change.
|
|
70
70
|
*/
|
|
71
71
|
readonly reload: Effect.Effect<InstanceReload, InstanceReloadError>;
|
|
72
72
|
/**
|
package/dist/exe-dev.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ import { Layer } from "effect";
|
|
|
8
8
|
* `TriggerCondition`, `AttemptRuntime` (built before the engine), `ClaudeLoginLock`, and
|
|
9
9
|
* `CurrentInstance`.
|
|
10
10
|
*/
|
|
11
|
-
export declare const layer: (instanceDirectory: InstanceDirectory, config: UsineConfig, brains: ReadonlyArray<BrainSpec>, options: ExeDevExecutorOptions) => Layer.Layer<import("@usine/engine/board-moves").BoardMoves | import("@usine/engine/cursor").CursorStore | import("@usine/engine/cycle-budget").CycleBudgets | import("@usine/engine/item-projection").ItemProjectionReader | import("@usine/engine/item-projection").ItemProjectionWriter | import("@usine/engine/loop-control").LoopControl | import("@usine/engine/repository-label-projection").RepositoryLabelProjectionReader | import("@usine/engine/repository-label-projection").RepositoryLabelProjectionWriter | import("@usine/engine/engine").RunEngine | import("@usine/engine/run-reader").RunReader | import("@usine/engine/step-executor").StepExecutor | import("./worker-status.ts").WorkerStatus, import("@usine/engine/engine").AttemptCancellationError | import("@usine/executor").CredentialUnavailableError | import("@usine/engine/engine").EnginePersistenceError | import("@usine/executor").ExecutorOperationError | import("@usine/engine/engine").RunInterventionRejectedError | import("@usine/engine/engine").RunNotFoundError | import("@usine/engine/engine").RunOperationRejectedError | import("@usine/engine/engine").RunRetryBlockedError | import("./scheduler.ts").UnsupportedWorkerError | import("@usine/executor").WorkerCapabilityError, import("@usine/durable/attempt-runtime").AttemptRuntime | import("@usine/agents/runtime").ClaudeLoginLock | import("./current-instance/current-instance.ts").CurrentInstance | import("@usine/github/github-app").GitHubApp | import("@usine/engine/trigger-condition").TriggerCondition>;
|
|
11
|
+
export declare const layer: (instanceDirectory: InstanceDirectory, config: UsineConfig, brains: ReadonlyArray<BrainSpec>, options: ExeDevExecutorOptions) => Layer.Layer<import("@usine/engine/board-moves").BoardMoves | import("@usine/engine/cursor").CursorStore | import("@usine/engine/cycle-budget").CycleBudgets | import("@usine/engine/item-projection").ItemProjectionReader | import("@usine/engine/item-projection").ItemProjectionWriter | import("@usine/engine/loop-control").LoopControl | import("@usine/engine/repository-label-projection").RepositoryLabelProjectionReader | import("@usine/engine/repository-label-projection").RepositoryLabelProjectionWriter | import("@usine/engine/engine").RunEngine | import("@usine/engine/run-reader").RunReader | import("@usine/engine/step-executor").StepExecutor | import("@usine/engine/engine").UnconfirmedStops | import("./worker-status.ts").WorkerStatus, import("@usine/engine/engine").AttemptCancellationError | import("@usine/executor").CredentialUnavailableError | import("@usine/engine/engine").EnginePersistenceError | import("@usine/executor").ExecutorOperationError | import("@usine/engine/engine").RunInterventionRejectedError | import("@usine/engine/engine").RunNotFoundError | import("@usine/engine/engine").RunOperationRejectedError | import("@usine/engine/engine").RunRetryBlockedError | import("./scheduler.ts").UnsupportedWorkerError | import("@usine/executor").WorkerCapabilityError, import("@usine/durable/attempt-runtime").AttemptRuntime | import("@usine/agents/runtime").ClaudeLoginLock | import("./current-instance/current-instance.ts").CurrentInstance | import("@usine/github/github-app").GitHubApp | import("@usine/engine/trigger-condition").TriggerCondition>;
|
|
12
12
|
//# sourceMappingURL=exe-dev.d.ts.map
|
package/dist/exe-dev.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exe-dev.d.ts","sourceRoot":"","sources":["../src/exe-dev.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAgC,KAAK,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEnG,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"exe-dev.d.ts","sourceRoot":"","sources":["../src/exe-dev.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAgC,KAAK,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEnG,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAI/B;;;;GAIG;AACH,eAAO,MAAM,KAAK,sBACG,iBAAiB,UAC5B,WAAW,UACX,aAAa,CAAC,SAAS,CAAC,WACvB,qBAAqB,qiDAQ/B,CAAC"}
|
package/dist/exe-dev.js
CHANGED
|
@@ -3,6 +3,7 @@ import { layer as exeDevExecutorLayer } from "@usine/executor/exe-dev";
|
|
|
3
3
|
import { layer as localEngineLayer } from "@usine/engine/local-sqlite";
|
|
4
4
|
import { Layer } from "effect";
|
|
5
5
|
import { stepExecutorLayer } from "./scheduler.js";
|
|
6
|
+
import { withSshWorkerDiscard } from "./ssh.js";
|
|
6
7
|
/**
|
|
7
8
|
* Provides the full engine and `WorkerStatus` for exe.dev Workers. Requires `GitHubApp`,
|
|
8
9
|
* `TriggerCondition`, `AttemptRuntime` (built before the engine), `ClaudeLoginLock`, and
|
|
@@ -10,7 +11,8 @@ import { stepExecutorLayer } from "./scheduler.js";
|
|
|
10
11
|
*/
|
|
11
12
|
export const layer = (instanceDirectory, config, brains, options) => {
|
|
12
13
|
const executor = exeDevExecutorLayer(options).pipe(Layer.provide(NodeServices.layer));
|
|
13
|
-
|
|
14
|
+
// Discarding leftovers still removes the Codex homes on an SSH Worker that `usine.yaml` dropped.
|
|
15
|
+
const stepExecutor = withSshWorkerDiscard(instanceDirectory, (discard) => stepExecutorLayer(config, brains, { discard })).pipe(Layer.provide(executor));
|
|
14
16
|
return localEngineLayer(instanceDirectory).pipe(Layer.provideMerge(stepExecutor));
|
|
15
17
|
};
|
|
16
18
|
//# sourceMappingURL=exe-dev.js.map
|
package/dist/exe-dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exe-dev.js","sourceRoot":"","sources":["../src/exe-dev.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,KAAK,IAAI,mBAAmB,EAA8B,MAAM,yBAAyB,CAAC;AACnG,OAAO,EAAE,KAAK,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"exe-dev.js","sourceRoot":"","sources":["../src/exe-dev.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,KAAK,IAAI,mBAAmB,EAA8B,MAAM,yBAAyB,CAAC;AACnG,OAAO,EAAE,KAAK,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CACnB,iBAAoC,EACpC,MAAmB,EACnB,MAAgC,EAChC,OAA8B,EAC9B,EAAE;IACF,MAAM,QAAQ,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IACtF,iGAAiG;IACjG,MAAM,YAAY,GAAG,oBAAoB,CAAC,iBAAiB,EAAE,CAAC,OAAO,EAAE,EAAE,CACvE,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAC/C,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAChC,OAAO,gBAAgB,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC;AACpF,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Layer } from "effect";
|
|
2
|
+
import { HttpClient } from "effect/http";
|
|
3
|
+
/**
|
|
4
|
+
* The fetch HTTP client for GitHub and the Gateways' admin APIs. Each request still gets a client
|
|
5
|
+
* span, but no `traceparent` or `b3` header, because neither service joins usine's traces.
|
|
6
|
+
*/
|
|
7
|
+
export declare const externalHttpClientLayer: Layer.Layer<HttpClient.HttpClient, never, never>;
|
|
8
|
+
//# sourceMappingURL=http-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-client.d.ts","sourceRoot":"","sources":["../src/http-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAmB,UAAU,EAAE,MAAM,aAAa,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,uBAAuB,kDAQQ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Effect, Layer } from "effect";
|
|
2
|
+
import { FetchHttpClient, HttpClient } from "effect/http";
|
|
3
|
+
/**
|
|
4
|
+
* The fetch HTTP client for GitHub and the Gateways' admin APIs. Each request still gets a client
|
|
5
|
+
* span, but no `traceparent` or `b3` header, because neither service joins usine's traces.
|
|
6
|
+
*/
|
|
7
|
+
export const externalHttpClientLayer = Layer.effect(HttpClient.HttpClient, Effect.map(HttpClient.HttpClient, HttpClient.transform((send) => Effect.provideService(send, HttpClient.TracerPropagationEnabled, false)))).pipe(Layer.provide(FetchHttpClient.layer));
|
|
8
|
+
//# sourceMappingURL=http-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-client.js","sourceRoot":"","sources":["../src/http-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE1D;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,CAAC,MAAM,CACjD,UAAU,CAAC,UAAU,EACrB,MAAM,CAAC,GAAG,CACR,UAAU,CAAC,UAAU,EACrB,UAAU,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAC5B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,wBAAwB,EAAE,KAAK,CAAC,CACxE,CACF,CACF,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Lane, LaneName } from "@usine/config/board";
|
|
2
|
+
import type { LoopPriority } from "@usine/config/loop";
|
|
3
|
+
import type { WorkerName } from "@usine/core/worker";
|
|
4
|
+
import { Option, Order } from "effect";
|
|
5
|
+
/** Where a queued Run's Item is in the pipeline, which ranks the Run for a free Worker slot. */
|
|
6
|
+
export type PipelinePosition = {
|
|
7
|
+
readonly _tag: "Priority";
|
|
8
|
+
readonly priority: LoopPriority;
|
|
9
|
+
} | {
|
|
10
|
+
readonly _tag: "Lane";
|
|
11
|
+
readonly lane: LaneName;
|
|
12
|
+
/** The lane's place in the repository's `lanes`, counting from 1. */
|
|
13
|
+
readonly number: number;
|
|
14
|
+
} | {
|
|
15
|
+
readonly _tag: "Unpositioned";
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Returns the position of a Run: its Loop's `priority`, else the first of the repository's `lanes`
|
|
19
|
+
* with a label source among the Item `labels` in the Run's Event, compared ignoring case as GitHub
|
|
20
|
+
* does. While the Run runs, the Board keeps its card in that lane unless the Item's current labels
|
|
21
|
+
* match a lane.
|
|
22
|
+
*/
|
|
23
|
+
export declare const pipelinePosition: (priority: Option.Option<LoopPriority>, lanes: ReadonlyArray<Lane>, labels: ReadonlyArray<string>) => PipelinePosition;
|
|
24
|
+
/** The fields of a queued slot reservation that rank it for a free Worker slot. */
|
|
25
|
+
export interface LeaseCandidate {
|
|
26
|
+
/** If set, the only Worker the lease can come from: the Worker of the Run's reattached Attempt. */
|
|
27
|
+
readonly worker: Option.Option<WorkerName>;
|
|
28
|
+
readonly position: PipelinePosition;
|
|
29
|
+
/** When the Run's Event arrived, in epoch milliseconds. */
|
|
30
|
+
readonly eventTime: number;
|
|
31
|
+
/** The order in which the scheduler received the reservation. */
|
|
32
|
+
readonly order: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Ranks queued reservations for a free Worker slot, so that the Run that advances the
|
|
36
|
+
* furthest-along Item takes it:
|
|
37
|
+
*
|
|
38
|
+
* 1. A reservation that names a Worker, for an Attempt that already runs there (#177).
|
|
39
|
+
* 2. A Run of a Loop with a `priority`, higher first.
|
|
40
|
+
* 3. A Run positioned by lane, later lane first.
|
|
41
|
+
* 4. Any other Run.
|
|
42
|
+
*
|
|
43
|
+
* Event order ranks reservations with the same position.
|
|
44
|
+
*/
|
|
45
|
+
export declare const leaseOrder: Order.Order<LeaseCandidate>;
|
|
46
|
+
/**
|
|
47
|
+
* Returns the number of `queued` reservations whose Events arrived before the Event of `leased`, the
|
|
48
|
+
* reservation that takes the slot.
|
|
49
|
+
*/
|
|
50
|
+
export declare const passedCount: (queued: ReadonlyArray<LeaseCandidate>, leased: LeaseCandidate) => number;
|
|
51
|
+
/**
|
|
52
|
+
* Returns the fewest reservations in `earlier`, the reservations ranked before `waiting` in lease
|
|
53
|
+
* order, that take a Worker slot before `waiting`. `open` lists the Workers that take new Attempts.
|
|
54
|
+
*
|
|
55
|
+
* A reservation that names a Worker takes that Worker's next free slot. A `waiting` that names no
|
|
56
|
+
* Worker comes after every reservation in `earlier` that names none, and after every one that names
|
|
57
|
+
* the Worker in `open` that the fewest reservations name.
|
|
58
|
+
*/
|
|
59
|
+
export declare const aheadCount: (earlier: ReadonlyArray<LeaseCandidate>, waiting: LeaseCandidate, open: ReadonlyArray<WorkerName>) => number;
|
|
60
|
+
//# sourceMappingURL=lease-order.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lease-order.d.ts","sourceRoot":"","sources":["../src/lease-order.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAA+B,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEpE,gGAAgG;AAChG,MAAM,MAAM,gBAAgB,GACxB;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAA;CAAE,GAC9D;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,qEAAqE;IACrE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,aACjB,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,SAC9B,aAAa,CAAC,IAAI,CAAC,UAClB,aAAa,CAAC,MAAM,CAAC,KAC5B,gBAUF,CAAC;AAEF,mFAAmF;AACnF,MAAM,WAAW,cAAc;IAC7B,mGAAmG;IACnG,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAC3C,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,iEAAiE;IACjE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AA0BD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,cAAc,CAIjD,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,WAAW,WACd,aAAa,CAAC,cAAc,CAAC,UAC7B,cAAc,KACrB,MAA8F,CAAC;AAKlG;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,YACZ,aAAa,CAAC,cAAc,CAAC,WAC7B,cAAc,QACjB,aAAa,CAAC,UAAU,CAAC,KAC9B,MAUC,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { canonicalLabelName } from "@usine/config/label";
|
|
2
|
+
import { Array as EffectArray, Match, Option, Order } from "effect";
|
|
3
|
+
/**
|
|
4
|
+
* Returns the position of a Run: its Loop's `priority`, else the first of the repository's `lanes`
|
|
5
|
+
* with a label source among the Item `labels` in the Run's Event, compared ignoring case as GitHub
|
|
6
|
+
* does. While the Run runs, the Board keeps its card in that lane unless the Item's current labels
|
|
7
|
+
* match a lane.
|
|
8
|
+
*/
|
|
9
|
+
export const pipelinePosition = (priority, lanes, labels) => {
|
|
10
|
+
if (Option.isSome(priority))
|
|
11
|
+
return { _tag: "Priority", priority: priority.value };
|
|
12
|
+
const itemLabels = new Set(labels.map(canonicalLabelName));
|
|
13
|
+
const index = lanes.findIndex(({ sources }) => sources.some((source) => "label" in source && itemLabels.has(canonicalLabelName(source.label))));
|
|
14
|
+
const lane = lanes[index];
|
|
15
|
+
return lane === undefined
|
|
16
|
+
? { _tag: "Unpositioned" }
|
|
17
|
+
: { _tag: "Lane", lane: lane.name, number: index + 1 };
|
|
18
|
+
};
|
|
19
|
+
const TIERS = {
|
|
20
|
+
Priority: 0,
|
|
21
|
+
Lane: 1,
|
|
22
|
+
Unpositioned: 2,
|
|
23
|
+
};
|
|
24
|
+
const rankInTier = (position) => Match.valueTags(position, {
|
|
25
|
+
Priority: ({ priority }) => priority,
|
|
26
|
+
Lane: ({ number }) => number,
|
|
27
|
+
Unpositioned: () => 0,
|
|
28
|
+
});
|
|
29
|
+
const positionOrder = Order.combineAll([
|
|
30
|
+
Order.mapInput(Order.Number, (position) => TIERS[position._tag]),
|
|
31
|
+
Order.mapInput(Order.flip(Order.Number), rankInTier),
|
|
32
|
+
]);
|
|
33
|
+
/** Ranks by Event arrival, then by the order in which the scheduler received the reservations. */
|
|
34
|
+
const eventOrder = Order.combineAll([
|
|
35
|
+
Order.mapInput(Order.Number, ({ eventTime }) => eventTime),
|
|
36
|
+
Order.mapInput(Order.Number, ({ order }) => order),
|
|
37
|
+
]);
|
|
38
|
+
/**
|
|
39
|
+
* Ranks queued reservations for a free Worker slot, so that the Run that advances the
|
|
40
|
+
* furthest-along Item takes it:
|
|
41
|
+
*
|
|
42
|
+
* 1. A reservation that names a Worker, for an Attempt that already runs there (#177).
|
|
43
|
+
* 2. A Run of a Loop with a `priority`, higher first.
|
|
44
|
+
* 3. A Run positioned by lane, later lane first.
|
|
45
|
+
* 4. Any other Run.
|
|
46
|
+
*
|
|
47
|
+
* Event order ranks reservations with the same position.
|
|
48
|
+
*/
|
|
49
|
+
export const leaseOrder = Order.combineAll([
|
|
50
|
+
Order.mapInput(Order.Boolean, ({ worker }) => Option.isNone(worker)),
|
|
51
|
+
Order.mapInput(positionOrder, ({ position }) => position),
|
|
52
|
+
eventOrder,
|
|
53
|
+
]);
|
|
54
|
+
/**
|
|
55
|
+
* Returns the number of `queued` reservations whose Events arrived before the Event of `leased`, the
|
|
56
|
+
* reservation that takes the slot.
|
|
57
|
+
*/
|
|
58
|
+
export const passedCount = (queued, leased) => queued.filter((candidate) => Order.isLessThan(eventOrder)(candidate, leased)).length;
|
|
59
|
+
const namingCount = (candidates, worker) => candidates.filter((candidate) => Option.contains(candidate.worker, worker)).length;
|
|
60
|
+
/**
|
|
61
|
+
* Returns the fewest reservations in `earlier`, the reservations ranked before `waiting` in lease
|
|
62
|
+
* order, that take a Worker slot before `waiting`. `open` lists the Workers that take new Attempts.
|
|
63
|
+
*
|
|
64
|
+
* A reservation that names a Worker takes that Worker's next free slot. A `waiting` that names no
|
|
65
|
+
* Worker comes after every reservation in `earlier` that names none, and after every one that names
|
|
66
|
+
* the Worker in `open` that the fewest reservations name.
|
|
67
|
+
*/
|
|
68
|
+
export const aheadCount = (earlier, waiting, open) => Option.match(waiting.worker, {
|
|
69
|
+
onSome: (worker) => namingCount(earlier, worker),
|
|
70
|
+
onNone: () => {
|
|
71
|
+
const naming = open.map((worker) => namingCount(earlier, worker));
|
|
72
|
+
return (earlier.filter(({ worker }) => Option.isNone(worker)).length +
|
|
73
|
+
(EffectArray.isReadonlyArrayNonEmpty(naming) ? EffectArray.min(naming, Order.Number) : 0));
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
//# sourceMappingURL=lease-order.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lease-order.js","sourceRoot":"","sources":["../src/lease-order.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAapE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,QAAqC,EACrC,KAA0B,EAC1B,MAA6B,EACX,EAAE;IACpB,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC;IACnF,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC3D,MAAM,KAAK,GAAG,KAAK,C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C3B,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC;IAChD,MAAM,EAAE,GAAG,EAAE;QACX,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;QAClE,OAAO,CACL,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;YAC5D,CAAC,WAAW,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAC1F,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
package/dist/local.d.ts
CHANGED
|
@@ -7,5 +7,5 @@ import { Layer } from "effect";
|
|
|
7
7
|
* Provides the full engine and `WorkerStatus` for local Workers. Requires the credential provider,
|
|
8
8
|
* `GitHubApp`, `TriggerCondition`, `AttemptRuntime`, `ClaudeLoginLock`, and `CurrentInstance`.
|
|
9
9
|
*/
|
|
10
|
-
export declare const layer: (instanceDirectory: InstanceDirectory, config: UsineConfig, brains: ReadonlyArray<BrainSpec>, options: Omit<LocalExecutorOptions, "instanceDirectory">) => Layer.Layer<import("@usine/engine/board-moves").BoardMoves | import("@usine/engine/cursor").CursorStore | import("@usine/engine/cycle-budget").CycleBudgets | import("@usine/engine/item-projection").ItemProjectionReader | import("@usine/engine/item-projection").ItemProjectionWriter | import("@usine/engine/loop-control").LoopControl | import("@usine/engine/repository-label-projection").RepositoryLabelProjectionReader | import("@usine/engine/repository-label-projection").RepositoryLabelProjectionWriter | import("@usine/engine/engine").RunEngine | import("@usine/engine/run-reader").RunReader | import("@usine/engine/step-executor").StepExecutor | import("./worker-status.ts").WorkerStatus, import("@usine/engine/engine").AttemptCancellationError | import("@usine/executor").CredentialUnavailableError | import("@usine/engine/engine").EnginePersistenceError | import("@usine/executor").ExecutorOperationError | import("@usine/engine/engine").RunInterventionRejectedError | import("@usine/engine/engine").RunNotFoundError | import("@usine/engine/engine").RunOperationRejectedError | import("@usine/engine/engine").RunRetryBlockedError | import("./scheduler.ts").UnsupportedWorkerError | import("@usine/executor").WorkerCapabilityError, import("@usine/durable/attempt-runtime").AttemptRuntime | import("@usine/agents/runtime").ClaudeLoginLock | import("@usine/executor").CredentialProvider | import("./current-instance/current-instance.ts").CurrentInstance | import("@usine/github/github-app").GitHubApp | import("@usine/engine/trigger-condition").TriggerCondition>;
|
|
10
|
+
export declare const layer: (instanceDirectory: InstanceDirectory, config: UsineConfig, brains: ReadonlyArray<BrainSpec>, options: Omit<LocalExecutorOptions, "instanceDirectory">) => Layer.Layer<import("@usine/engine/board-moves").BoardMoves | import("@usine/engine/cursor").CursorStore | import("@usine/engine/cycle-budget").CycleBudgets | import("@usine/engine/item-projection").ItemProjectionReader | import("@usine/engine/item-projection").ItemProjectionWriter | import("@usine/engine/loop-control").LoopControl | import("@usine/engine/repository-label-projection").RepositoryLabelProjectionReader | import("@usine/engine/repository-label-projection").RepositoryLabelProjectionWriter | import("@usine/engine/engine").RunEngine | import("@usine/engine/run-reader").RunReader | import("@usine/engine/step-executor").StepExecutor | import("@usine/engine/engine").UnconfirmedStops | import("./worker-status.ts").WorkerStatus, import("@usine/engine/engine").AttemptCancellationError | import("@usine/executor").CredentialUnavailableError | import("@usine/engine/engine").EnginePersistenceError | import("@usine/executor").ExecutorOperationError | import("@usine/engine/engine").RunInterventionRejectedError | import("@usine/engine/engine").RunNotFoundError | import("@usine/engine/engine").RunOperationRejectedError | import("@usine/engine/engine").RunRetryBlockedError | import("./scheduler.ts").UnsupportedWorkerError | import("@usine/executor").WorkerCapabilityError, import("@usine/durable/attempt-runtime").AttemptRuntime | import("@usine/agents/runtime").ClaudeLoginLock | import("@usine/executor").CredentialProvider | import("./current-instance/current-instance.ts").CurrentInstance | import("@usine/github/github-app").GitHubApp | import("@usine/engine/trigger-condition").TriggerCondition>;
|
|
11
11
|
//# sourceMappingURL=local.d.ts.map
|
package/dist/local.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../src/local.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAA+B,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE/F,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../src/local.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAA+B,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE/F,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAI/B;;;GAGG;AACH,eAAO,MAAM,KAAK,sBACG,iBAAiB,UAC5B,WAAW,UACX,aAAa,CAAC,SAAS,CAAC,WACvB,IAAI,CAAC,oBAAoB,EAAE,mBAAmB,CAAC,olDAUzD,CAAC"}
|
package/dist/local.js
CHANGED
|
@@ -3,13 +3,15 @@ import { layer as localExecutorLayer } from "@usine/executor/local";
|
|
|
3
3
|
import { layer as localEngineLayer } from "@usine/engine/local-sqlite";
|
|
4
4
|
import { Layer } from "effect";
|
|
5
5
|
import { stepExecutorLayer } from "./scheduler.js";
|
|
6
|
+
import { withSshWorkerDiscard } from "./ssh.js";
|
|
6
7
|
/**
|
|
7
8
|
* Provides the full engine and `WorkerStatus` for local Workers. Requires the credential provider,
|
|
8
9
|
* `GitHubApp`, `TriggerCondition`, `AttemptRuntime`, `ClaudeLoginLock`, and `CurrentInstance`.
|
|
9
10
|
*/
|
|
10
11
|
export const layer = (instanceDirectory, config, brains, options) => {
|
|
11
12
|
const executor = localExecutorLayer({ ...options, instanceDirectory }).pipe(Layer.provide(NodeServices.layer));
|
|
12
|
-
|
|
13
|
+
// Discarding leftovers still removes the Codex homes on an SSH Worker that `usine.yaml` dropped.
|
|
14
|
+
const stepExecutor = withSshWorkerDiscard(instanceDirectory, (discard) => stepExecutorLayer(config, brains, { discard })).pipe(Layer.provide(executor));
|
|
13
15
|
return localEngineLayer(instanceDirectory).pipe(Layer.provideMerge(stepExecutor));
|
|
14
16
|
};
|
|
15
17
|
//# sourceMappingURL=local.js.map
|
package/dist/local.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local.js","sourceRoot":"","sources":["../src/local.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,KAAK,IAAI,kBAAkB,EAA6B,MAAM,uBAAuB,CAAC;AAC/F,OAAO,EAAE,KAAK,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"local.js","sourceRoot":"","sources":["../src/local.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,KAAK,IAAI,kBAAkB,EAA6B,MAAM,uBAAuB,CAAC;AAC/F,OAAO,EAAE,KAAK,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CACnB,iBAAoC,EACpC,MAAmB,EACnB,MAAgC,EAChC,OAAwD,EACxD,EAAE;IACF,MAAM,QAAQ,GAAG,kBAAkB,CAAC,EAAE,GAAG,OAAO,EAAE,iBAAiB,EAAE,CAAC,CAAC,IAAI,CACzE,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAClC,CAAC;IACF,iGAAiG;IACjG,MAAM,YAAY,GAAG,oBAAoB,CAAC,iBAAiB,EAAE,CAAC,OAAO,EAAE,EAAE,CACvE,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAC/C,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAChC,OAAO,gBAAgB,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC;AACpF,CAAC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BrainSpec } from "@usine/core/agent/brain";
|
|
2
|
+
import { OutOfMemoryKills } from "@usine/core/attempt";
|
|
2
3
|
import { Schema } from "effect";
|
|
3
4
|
declare const InfraFailureView_base: Schema.Class<InfraFailureView, Schema.TaggedStruct<"InfraFailure", {
|
|
4
5
|
readonly message: Schema.String;
|
|
@@ -83,15 +84,31 @@ declare const SshWorkerAccess_base: Schema.Class<SshWorkerAccess, Schema.TaggedS
|
|
|
83
84
|
*/
|
|
84
85
|
export declare class SshWorkerAccess extends SshWorkerAccess_base {
|
|
85
86
|
}
|
|
87
|
+
declare const ProvisionedWorkerAccess_base: Schema.Class<ProvisionedWorkerAccess, Schema.TaggedStruct<"Provisioned", {
|
|
88
|
+
readonly provider: Schema.Literals<readonly ["hetzner", "boat"]>;
|
|
89
|
+
}>, {}>;
|
|
90
|
+
/**
|
|
91
|
+
* A provisioned Worker, which created a machine for each Attempt at `provider` and deletes it
|
|
92
|
+
* once the Attempt's slot is released, so `usine.yaml` has no address for it.
|
|
93
|
+
*/
|
|
94
|
+
export declare class ProvisionedWorkerAccess extends ProvisionedWorkerAccess_base {
|
|
95
|
+
}
|
|
96
|
+
declare const SandboxWorkerAccess_base: Schema.Class<SandboxWorkerAccess, Schema.TaggedStruct<"Sandbox", {}>, {}>;
|
|
97
|
+
/**
|
|
98
|
+
* A Worker that runs each Attempt in its own Cloudflare sandbox, which accepts no operator terminal
|
|
99
|
+
* and is destroyed when the Attempt ends.
|
|
100
|
+
*/
|
|
101
|
+
export declare class SandboxWorkerAccess extends SandboxWorkerAccess_base {
|
|
102
|
+
}
|
|
86
103
|
/** How the operator accesses a Worker's machine, from its `usine.yaml` entry. */
|
|
87
|
-
export declare const WorkerAccess: Schema.Union<readonly [typeof LocalWorkerAccess, typeof SshWorkerAccess]>;
|
|
104
|
+
export declare const WorkerAccess: Schema.Union<readonly [typeof LocalWorkerAccess, typeof SshWorkerAccess, typeof ProvisionedWorkerAccess, typeof SandboxWorkerAccess]>;
|
|
88
105
|
export type WorkerAccess = typeof WorkerAccess.Type;
|
|
89
106
|
declare const AttemptView_base: Schema.Class<AttemptView, Schema.Struct<{
|
|
90
107
|
readonly id: Schema.brand<Schema.NonEmptyString, "AttemptId">;
|
|
91
108
|
readonly number: Schema.brand<Schema.Int, "AttemptNumber">;
|
|
92
109
|
readonly worker: Schema.brand<Schema.String, "WorkerName">;
|
|
93
110
|
/** How the operator accesses `worker`, or null if `usine.yaml` no longer declares it. */
|
|
94
|
-
readonly workerAccess: Schema.NullOr<Schema.Union<readonly [typeof LocalWorkerAccess, typeof SshWorkerAccess]>>;
|
|
111
|
+
readonly workerAccess: Schema.NullOr<Schema.Union<readonly [typeof LocalWorkerAccess, typeof SshWorkerAccess, typeof ProvisionedWorkerAccess, typeof SandboxWorkerAccess]>>;
|
|
95
112
|
readonly brain: typeof BrainSpec;
|
|
96
113
|
readonly task: Schema.brand<Schema.String, "AttemptTask">;
|
|
97
114
|
readonly agent: Schema.brand<Schema.String, "AgentName">;
|
|
@@ -103,11 +120,13 @@ declare const AttemptView_base: Schema.Class<AttemptView, Schema.Struct<{
|
|
|
103
120
|
* times were recorded.
|
|
104
121
|
*/
|
|
105
122
|
readonly endedAt: Schema.NullOr<Schema.String>;
|
|
106
|
-
readonly salvage: Schema.NullOr<Schema.Union<readonly [typeof import("@usine/core/attempt/salvage").SalvagePushed, typeof import("@usine/core/attempt/salvage").SalvageRetained]>>;
|
|
123
|
+
readonly salvage: Schema.NullOr<Schema.Union<readonly [typeof import("@usine/core/attempt/salvage").SalvagePushed, typeof import("@usine/core/attempt/salvage").SalvagePartlyPushed, typeof import("@usine/core/attempt/salvage").SalvageRetained, typeof import("@usine/core/attempt/salvage").SalvageRejected]>>;
|
|
107
124
|
/** Why the Attempt began, or null for a later Attempt begun before this was recorded. */
|
|
108
125
|
readonly start: Schema.withConstructorDefault<Schema.NullOr<Schema.Union<readonly [typeof import("@usine/core/attempt/start").StartedByEvent, typeof import("@usine/core/attempt/start").StartedByRetry, typeof import("@usine/core/attempt/start").StartedByEditAndRetry, typeof import("@usine/core/attempt/start").StartedByInfraRetry, typeof import("@usine/core/attempt/start").StartedAfterRestart]>>>;
|
|
109
126
|
/** When an orchestrator restart last reattached the Attempt, or null if none did. */
|
|
110
127
|
readonly reattachedAt: Schema.withConstructorDefault<Schema.NullOr<Schema.String>>;
|
|
128
|
+
/** The processes the kernel killed in the Attempt's container for memory, or null if none. */
|
|
129
|
+
readonly outOfMemory: Schema.withConstructorDefault<Schema.NullOr<typeof OutOfMemoryKills>>;
|
|
111
130
|
}>, {}>;
|
|
112
131
|
/** One Attempt with its Worker, effective brain, start, end, outcome, and salvaged work. */
|
|
113
132
|
export declare class AttemptView extends AttemptView_base {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attempt.d.ts","sourceRoot":"","sources":["../../src/operator/attempt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"attempt.d.ts","sourceRoot":"","sources":["../../src/operator/attempt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAyC,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAM9F,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;AAExC,iDAAiD;AACjD,qBAAa,gBAAiB,SAAQ,qBAEO;CAAG;;;;AAEhD,iGAAiG;AACjG,qBAAa,iBAAkB,SAAQ,sBAEO;CAAG;;;;AAEjD,qEAAqE;AACrE,qBAAa,gBAAiB,SAAQ,qBAEO;CAAG;;;;AAEhD;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,uBAEO;CAAG;;;;AAElD;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,wBAEQ;CAAG;;;;AAEpD,+DAA+D;AAC/D,qBAAa,kBAAmB,SAAQ,uBAEQ;CAAG;;;;;AAEnD,gFAAgF;AAChF,qBAAa,6BAA8B,SAAQ,kCAKjD;CAAG;AAEL,sEAAsE;AACtE,eAAO,MAAM,WAAW,6NAQtB,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAC;;AAElD,iCAAiC;AACjC,qBAAa,oBAAqB,SAAQ,yBAExB;CAAG;;;;AAErB,8BAA8B;AAC9B,qBAAa,iBAAkB,SAAQ,sBAEF;CAAG;;AAExC,gDAAgD;AAChD,qBAAa,mBAAoB,SAAQ,wBAExB;CAAG;AAEpB,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,4GAI7B,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAC,IAAI,CAAC;;AAEhE,4EAA4E;AAC5E,qBAAa,iBAAkB,SAAQ,sBAEzB;CAAG;;;;;AAEjB;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,oBAEkC;CAAG;;;;AAE1E;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,4BAEE;CAAG;;AAElD;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,wBAEzB;CAAG;AAEnB,iFAAiF;AACjF,eAAO,MAAM,YAAY,uIAKvB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAC;;;;;IAOlD,yFAAyF;;;;;;;;IAQzF;;;OAGG;;;IAGH,yFAAyF;;IAEzF,qFAAqF;;IAIrF,8FAA8F;;;AAzBhG,4FAA4F;AAC5F,qBAAa,WAAY,SAAQ,gBA4B/B;CAAG"}
|
package/dist/operator/attempt.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { BrainSpec } from "@usine/core/agent/brain";
|
|
2
2
|
import { ChildSessionBudget, ChildSessionCount } from "@usine/core/agent/session";
|
|
3
|
-
import { AttemptNumber, AttemptId, AttemptTask } from "@usine/core/attempt";
|
|
3
|
+
import { AttemptNumber, AttemptId, AttemptTask, OutOfMemoryKills } from "@usine/core/attempt";
|
|
4
4
|
import { AgentName } from "@usine/core/agent";
|
|
5
5
|
import { RunawayCeiling } from "@usine/core/attempt/failure";
|
|
6
6
|
import { AttemptSalvage } from "@usine/core/attempt/salvage";
|
|
7
7
|
import { AttemptStart } from "@usine/core/attempt/start";
|
|
8
|
-
import { SshDestination, SshPort, WorkerName } from "@usine/core/worker";
|
|
8
|
+
import { MachineProvider, SshDestination, SshPort, WorkerName } from "@usine/core/worker";
|
|
9
9
|
import { Effect, Schema } from "effect";
|
|
10
10
|
/** An infra failure without its defect cause. */
|
|
11
11
|
export class InfraFailureView extends Schema.TaggedClass("@usine/orchestrator/InfraFailureView")("InfraFailure", { message: Schema.String }) {
|
|
@@ -71,8 +71,25 @@ export class LocalWorkerAccess extends Schema.TaggedClass("@usine/orchestrator/L
|
|
|
71
71
|
*/
|
|
72
72
|
export class SshWorkerAccess extends Schema.TaggedClass("@usine/orchestrator/SshWorkerAccess")("Ssh", { destination: SshDestination, port: Schema.NullOr(SshPort) }) {
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* A provisioned Worker, which created a machine for each Attempt at `provider` and deletes it
|
|
76
|
+
* once the Attempt's slot is released, so `usine.yaml` has no address for it.
|
|
77
|
+
*/
|
|
78
|
+
export class ProvisionedWorkerAccess extends Schema.TaggedClass("@usine/orchestrator/ProvisionedWorkerAccess")("Provisioned", { provider: MachineProvider }) {
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* A Worker that runs each Attempt in its own Cloudflare sandbox, which accepts no operator terminal
|
|
82
|
+
* and is destroyed when the Attempt ends.
|
|
83
|
+
*/
|
|
84
|
+
export class SandboxWorkerAccess extends Schema.TaggedClass("@usine/orchestrator/SandboxWorkerAccess")("Sandbox", {}) {
|
|
85
|
+
}
|
|
74
86
|
/** How the operator accesses a Worker's machine, from its `usine.yaml` entry. */
|
|
75
|
-
export const WorkerAccess = Schema.Union([
|
|
87
|
+
export const WorkerAccess = Schema.Union([
|
|
88
|
+
LocalWorkerAccess,
|
|
89
|
+
SshWorkerAccess,
|
|
90
|
+
ProvisionedWorkerAccess,
|
|
91
|
+
SandboxWorkerAccess,
|
|
92
|
+
]);
|
|
76
93
|
/** One Attempt with its Worker, effective brain, start, end, outcome, and salvaged work. */
|
|
77
94
|
export class AttemptView extends Schema.Class("@usine/orchestrator/AttemptView")({
|
|
78
95
|
id: AttemptId,
|
|
@@ -96,6 +113,8 @@ export class AttemptView extends Schema.Class("@usine/orchestrator/AttemptView")
|
|
|
96
113
|
start: Schema.NullOr(AttemptStart).pipe(Schema.withConstructorDefault(Effect.succeed(null))),
|
|
97
114
|
/** When an orchestrator restart last reattached the Attempt, or null if none did. */
|
|
98
115
|
reattachedAt: Schema.NullOr(Schema.String).pipe(Schema.withConstructorDefault(Effect.succeed(null))),
|
|
116
|
+
/** The processes the kernel killed in the Attempt's container for memory, or null if none. */
|
|
117
|
+
outOfMemory: Schema.NullOr(OutOfMemoryKills).pipe(Schema.withConstructorDefault(Effect.succeed(null))),
|
|
99
118
|
}) {
|
|
100
119
|
}
|
|
101
120
|
//# sourceMappingURL=attempt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attempt.js","sourceRoot":"","sources":["../../src/operator/attempt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"attempt.js","sourceRoot":"","sources":["../../src/operator/attempt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC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AAC;CAAG"}
|
package/dist/operator/board.d.ts
CHANGED
|
@@ -13,8 +13,9 @@ declare const BoardItemLink_base: Schema.Class<BoardItemLink, Schema.Struct<{
|
|
|
13
13
|
readonly number: Schema.brand<Schema.Int, "ItemNumber">;
|
|
14
14
|
readonly title: Schema.String;
|
|
15
15
|
readonly url: Schema.NonEmptyString;
|
|
16
|
+
readonly state: Schema.Literals<readonly ["issue-open", "issue-closed", "pr-open", "pr-closed", "pr-merged"]>;
|
|
16
17
|
}>, {}>;
|
|
17
|
-
/** An Item of a Task, with its own title and GitHub
|
|
18
|
+
/** An Item of a Task, with its own title, GitHub URL, and GitHub state. */
|
|
18
19
|
export declare class BoardItemLink extends BoardItemLink_base {
|
|
19
20
|
}
|
|
20
21
|
declare const BoardPullRequestView_base: Schema.Class<BoardPullRequestView, Schema.Struct<{
|
|
@@ -41,6 +42,10 @@ declare const BoardTaskView_base: Schema.Class<BoardTaskView, Schema.Struct<{
|
|
|
41
42
|
readonly pullRequest: Schema.NullOr<typeof BoardPullRequestView>;
|
|
42
43
|
/** Every saved Run for the visible Items, earliest first. */
|
|
43
44
|
readonly runs: Schema.$Array<typeof RunView>;
|
|
45
|
+
/**
|
|
46
|
+
* The newest Run that needs the operator, else the open Run, else the newest Run, or null if
|
|
47
|
+
* there are no Runs. A failed Run on a closed or merged Item doesn't need the operator.
|
|
48
|
+
*/
|
|
44
49
|
readonly run: Schema.NullOr<typeof RunView>;
|
|
45
50
|
readonly needsYou: Schema.Boolean;
|
|
46
51
|
/** Whether the current Item is an open pull request whose branch conflicts with its base. */
|
|
@@ -55,8 +60,8 @@ declare const BoardTaskView_base: Schema.Class<BoardTaskView, Schema.Struct<{
|
|
|
55
60
|
}>, {}>;
|
|
56
61
|
/**
|
|
57
62
|
* A Board card for a Task projected from linked Items and placed by its current Item. While the
|
|
58
|
-
* Task's newest open Run is running
|
|
59
|
-
* triggered.
|
|
63
|
+
* Task's newest open Run is running and the current Item has no lane label, the card stays in the
|
|
64
|
+
* lane that matched when the Run was triggered.
|
|
60
65
|
*/
|
|
61
66
|
export declare class BoardTaskView extends BoardTaskView_base {
|
|
62
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board.d.ts","sourceRoot":"","sources":["../../src/operator/board.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,6CAA6C;AAC7C,eAAO,MAAM,WAAW,oDAA0D,CAAC;AACnF,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAC;AAElD,gFAAgF;AAChF,eAAO,MAAM,eAAe,gEAAwD,CAAC;AACrF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAC
|
|
1
|
+
{"version":3,"file":"board.d.ts","sourceRoot":"","sources":["../../src/operator/board.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,6CAA6C;AAC7C,eAAO,MAAM,WAAW,oDAA0D,CAAC;AACnF,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAC;AAElD,gFAAgF;AAChF,eAAO,MAAM,eAAe,gEAAwD,CAAC;AACrF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAC;;;;;;;;;AAE1D,2EAA2E;AAC3E,qBAAa,aAAc,SAAQ,kBASlC;CAAG;;;;;;AAEJ,6FAA6F;AAC7F,qBAAa,oBAAqB,SAAQ,yBAMxC;CAAG;;;;;;;;;;IAYD;;;OAGG;;IAEH,6DAA6D;;IAE7D;;;OAGG;;;IAGH,6FAA6F;;IAE7F;;;OAGG;;IAEH,2DAA2D;;;AA9B/D;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,kBA4BlC;CAAG;;;;;;;;;AAUJ,4FAA4F;AAC5F,qBAAa,qBAAsB,SAAQ,0BAMzC;CAAG;;;;;;;;AAEL,yDAAyD;AACzD,qBAAa,qBAAsB,SAAQ,0BAEA;CAAG;AAE9C,yEAAyE;AACzE,eAAO,MAAM,aAAa,qFAA+D,CAAC;AAC1F,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC,IAAI,CAAC;;;;;;AAEtD,sFAAsF;AACtF,qBAAa,oBAAqB,SAAQ,yBAMxC;CAAG;;;;;AAEL,2EAA2E;AAC3E,qBAAa,SAAU,SAAQ,cAG7B;CAAG;;;;;;AAEL,uFAAuF;AACvF,qBAAa,SAAU,SAAQ,cAI7B;CAAG;;;;;;AAEL,gEAAgE;AAChE,qBAAa,SAAU,SAAQ,cAI7B;CAAG;;;;AAEL,4DAA4D;AAC5D,qBAAa,yBAA0B,SAAQ,8BAI7C;CAAG;;;;;AAEL,uDAAuD;AACvD,qBAAa,sBAAuB,SAAQ,2BAK1C;CAAG;;;;;AAEL,mEAAmE;AACnE,qBAAa,sBAAuB,SAAQ,2BAK1C;CAAG;;;;;AAEL,uEAAuE;AACvE,qBAAa,sBAAuB,SAAQ,2BAK1C;CAAG"}
|
package/dist/operator/board.js
CHANGED
|
@@ -10,13 +10,14 @@ import { TaskUsageView } from "./usage.js";
|
|
|
10
10
|
export const BoardLaneId = Schema.NonEmptyString.pipe(Schema.brand("BoardLaneId"));
|
|
11
11
|
/** The source of a lane: authored settings, a proposal, or default grouping. */
|
|
12
12
|
export const BoardLaneOrigin = Schema.Literals(["authored", "proposed", "fallback"]);
|
|
13
|
-
/** An Item of a Task, with its own title and GitHub
|
|
13
|
+
/** An Item of a Task, with its own title, GitHub URL, and GitHub state. */
|
|
14
14
|
export class BoardItemLink extends Schema.Class("@usine/orchestrator/BoardItemLink")({
|
|
15
15
|
itemKey: ItemKey,
|
|
16
16
|
kind: Schema.Literals(["issue", "pr"]),
|
|
17
17
|
number: ItemNumber,
|
|
18
18
|
title: Schema.String,
|
|
19
19
|
url: Schema.NonEmptyString,
|
|
20
|
+
state: LaneItemState,
|
|
20
21
|
}) {
|
|
21
22
|
}
|
|
22
23
|
/** An open or merged pull request of a Task. Closed, unmerged pull requests are excluded. */
|
|
@@ -28,12 +29,11 @@ export class BoardPullRequestView extends Schema.Class("@usine/orchestrator/Boar
|
|
|
28
29
|
}
|
|
29
30
|
/**
|
|
30
31
|
* A Board card for a Task projected from linked Items and placed by its current Item. While the
|
|
31
|
-
* Task's newest open Run is running
|
|
32
|
-
* triggered.
|
|
32
|
+
* Task's newest open Run is running and the current Item has no lane label, the card stays in the
|
|
33
|
+
* lane that matched when the Run was triggered.
|
|
33
34
|
*/
|
|
34
35
|
export class BoardTaskView extends Schema.Class("@usine/orchestrator/BoardTaskView")({
|
|
35
36
|
...BoardItemLink.fields,
|
|
36
|
-
state: LaneItemState,
|
|
37
37
|
labels: Schema.Array(GitHubLabelName),
|
|
38
38
|
items: Schema.Array(BoardItemLink).check(Schema.isNonEmpty()),
|
|
39
39
|
/**
|
|
@@ -43,6 +43,10 @@ export class BoardTaskView extends Schema.Class("@usine/orchestrator/BoardTaskVi
|
|
|
43
43
|
pullRequest: Schema.NullOr(BoardPullRequestView),
|
|
44
44
|
/** Every saved Run for the visible Items, earliest first. */
|
|
45
45
|
runs: Schema.Array(RunView),
|
|
46
|
+
/**
|
|
47
|
+
* The newest Run that needs the operator, else the open Run, else the newest Run, or null if
|
|
48
|
+
* there are no Runs. A failed Run on a closed or merged Item doesn't need the operator.
|
|
49
|
+
*/
|
|
46
50
|
run: Schema.NullOr(RunView),
|
|
47
51
|
needsYou: Schema.Boolean,
|
|
48
52
|
/** Whether the current Item is an open pull request whose branch conflicts with its base. */
|