@hearsay-tools/squawk 0.18.0-dev.7779 → 0.18.0-dev.7792
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/dist/artifacts/removal-slot.d.ts +3 -0
- package/dist/artifacts/removal-slot.js +7 -0
- package/dist/artifacts/removal-slot.js.map +1 -0
- package/dist/autosave-cleanup.js +2 -1
- package/dist/autosave-cleanup.js.map +1 -1
- package/dist/autosave-git.js +1 -1
- package/dist/autosave-git.js.map +1 -1
- package/dist/autosave-holders.d.ts +1 -1
- package/dist/autosave-holders.js +2 -1
- package/dist/autosave-holders.js.map +1 -1
- package/dist/autosave-removal-slots.d.ts +6 -0
- package/dist/autosave-removal-slots.js +13 -0
- package/dist/autosave-removal-slots.js.map +1 -0
- package/dist/built-in-run-slots.d.ts +9 -0
- package/dist/built-in-run-slots.js +21 -0
- package/dist/built-in-run-slots.js.map +1 -0
- package/dist/ci-wait/controller.d.ts +46 -46
- package/dist/core/process-stat.d.ts +15 -0
- package/dist/core/process-stat.js +41 -1
- package/dist/core/process-stat.js.map +1 -1
- package/dist/delegation/family-end.js +5 -1
- package/dist/delegation/family-end.js.map +1 -1
- package/dist/delegation/process-liveness.d.ts +0 -15
- package/dist/delegation/process-liveness.js +5 -43
- package/dist/delegation/process-liveness.js.map +1 -1
- package/dist/delegation/removal-slot.d.ts +4 -0
- package/dist/delegation/removal-slot.js +20 -0
- package/dist/delegation/removal-slot.js.map +1 -0
- package/dist/delegation/routes.d.ts +79 -79
- package/dist/delegation/service.js +2 -1
- package/dist/delegation/service.js.map +1 -1
- package/dist/delegation/transport.d.ts +76 -76
- package/dist/delegation/worker-cleanup.js +1 -1
- package/dist/delegation/worker-cleanup.js.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/jobs/job.js +2 -1
- package/dist/jobs/job.js.map +1 -1
- package/dist/jobs/removal-slot.d.ts +4 -0
- package/dist/jobs/removal-slot.js +10 -0
- package/dist/jobs/removal-slot.js.map +1 -0
- package/dist/preview/chromium.js +1 -1
- package/dist/preview/chromium.js.map +1 -1
- package/dist/preview/dev-server.js +1 -1
- package/dist/preview/dev-server.js.map +1 -1
- package/dist/process-wait/supervisor.js +1 -1
- package/dist/process-wait/supervisor.js.map +1 -1
- package/dist/project-commands.js +2 -1
- package/dist/project-commands.js.map +1 -1
- package/dist/runs/arm-repo-handle.d.ts +17 -2
- package/dist/runs/arm-repo-handle.js +2 -3
- package/dist/runs/arm-repo-handle.js.map +1 -1
- package/dist/runs/auto-name.d.ts +6 -1
- package/dist/runs/auto-name.js +1 -2
- package/dist/runs/auto-name.js.map +1 -1
- package/dist/runs/owned-run-create.d.ts +4 -1
- package/dist/runs/owned-run-create.js +1 -2
- package/dist/runs/owned-run-create.js.map +1 -1
- package/dist/runs/removal-slots.d.ts +56 -0
- package/dist/runs/removal-slots.js +66 -0
- package/dist/runs/removal-slots.js.map +1 -0
- package/dist/runs/retention.d.ts +10 -7
- package/dist/runs/retention.js +8 -19
- package/dist/runs/retention.js.map +1 -1
- package/dist/runs/run-claims.js +1 -1
- package/dist/runs/run-claims.js.map +1 -1
- package/dist/runs/store.d.ts +7 -4
- package/dist/runs/store.js +21 -24
- package/dist/runs/store.js.map +1 -1
- package/dist/runs/worker-execution.d.ts +1 -1
- package/dist/runs/worker-execution.js +1 -1
- package/dist/runs/worker-execution.js.map +1 -1
- package/dist/runs/worker-resource-holders.d.ts +1 -1
- package/dist/runs/worker-resource-holders.js +1 -1
- package/dist/runs/worker-resource-holders.js.map +1 -1
- package/dist/server/live-routes.d.ts +6 -6
- package/dist/server/project-context.d.ts +1 -1
- package/dist/server/project-context.js +2 -1
- package/dist/server/project-context.js.map +1 -1
- package/dist/server/provider-sign-in-routes.d.ts +2 -2
- package/dist/server/runner-install-routes.d.ts +10 -10
- package/dist/server/server.d.ts +1595 -1595
- package/dist/server/workspace-live-routes.d.ts +6 -6
- package/dist/worker-scope/worker-scopes.d.ts +1 -1
- package/dist/workflows/run/launch-read-resolver.d.ts +3 -0
- package/dist/workflows/run/launch-read-resolver.js +2 -0
- package/dist/workflows/run/launch-read-resolver.js.map +1 -1
- package/dist/workflows/run/turn-bookkeeping.js +2 -2
- package/dist/workflows/run/turn-bookkeeping.js.map +1 -1
- package/dist/workflows/run/wait-registry.js +1 -1
- package/dist/workflows/run/wait-registry.js.map +1 -1
- package/dist/workflows/run/worker-orphans.d.ts +1 -1
- package/dist/workflows/run/worker-orphans.js +1 -1
- package/dist/workflows/run/worker-orphans.js.map +1 -1
- package/package.json +4 -4
- package/scripts/benchmark-family-reconcile.ts +4 -1
- package/scripts/benchmark-run-store.ts +2 -0
- package/scripts/benchmark-stuck-destroys.ts +4 -1
- package/scripts/benchmark-worker-lifecycle.ts +4 -1
- package/scripts/benchmark-workspace-events.ts +2 -0
- package/scripts/benchmark-worktree-retention.ts +2 -0
- package/scripts/measure-transcript-facts-health.mjs +4 -1
- package/scripts/seed-archive-profile.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-stat.js","sourceRoot":"","sources":["../../src/core/process-stat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"process-stat.js","sourceRoot":"","sources":["../../src/core/process-stat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,mFAAmF;AACnF,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,GAAG,GAAsB,OAAO,CAAC,GAAG;IAChE,OAAO,MAAM,CAAC,WAAW,CAAC,MA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,14 @@
|
|
|
5
5
|
* branch through its compare-and-swap, which deletes nothing while the branch holds commits that
|
|
6
6
|
* no other ref keeps. A deleted branch completes the worker's destroy, so the parent's slot is
|
|
7
7
|
* free again. A receipt whose run this project no longer has gets the same removal, after its
|
|
8
|
-
* directory is reclaimed if clean. The branch sweep runs this step.
|
|
8
|
+
* directory is reclaimed if clean. The branch sweep runs this step. Throws only in a process that
|
|
9
|
+
* sealed no removal slots (`runs/removal-slots.ts`), before it removes anything.
|
|
9
10
|
*/
|
|
10
11
|
import { existsSync, realpathSync } from 'node:fs';
|
|
11
12
|
import { join } from 'node:path';
|
|
12
13
|
import { projectPaths } from '../project-paths.js';
|
|
13
14
|
import { cleanupSafety, workerFamilyEnded } from '../runs/retention.js';
|
|
15
|
+
import { assertRunSlotsSealed } from '../runs/removal-slots.js';
|
|
14
16
|
import { isLiveRecord } from '../runs/run-row.js';
|
|
15
17
|
import { ownedWorkspaceReceipts } from './workspace-record.js';
|
|
16
18
|
import { releaseThenRemoveWorktree } from '../git-worktree-release.js';
|
|
@@ -28,6 +30,8 @@ export function endedWorkerBranch(run, store) {
|
|
|
28
30
|
* against Continue and other cleanup for the removal, or returns null when it is in use. `signal`
|
|
29
31
|
* stops the step before its next workspace. Returns the worker ids whose branch went. */
|
|
30
32
|
export async function releaseEndedWorkerBranches(repoRoot, store, claim, signal) {
|
|
33
|
+
// Outside every catch below, so a process that sealed no slots removes no orphan directory or branch.
|
|
34
|
+
assertRunSlotsSealed();
|
|
31
35
|
// Without its runs every receipt would look orphaned.
|
|
32
36
|
if (store.unavailable)
|
|
33
37
|
return [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"family-end.js","sourceRoot":"","sources":["../../src/delegation/family-end.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"family-end.js","sourceRoot":"","sources":["../../src/delegation/family-end.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,UAAU,EAAE,YAA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
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
import { type RecordedProcess } from '../core/process-stat.ts';
|
|
2
|
-
/**
|
|
3
|
-
* Synchronous process evidence: recorded-process liveness for worker recovery, and the cwd scan
|
|
4
|
-
* that autosave cleanup still uses. Worker ownership never comes from the scan (ADR 0032).
|
|
5
|
-
* Unreadable cwd is no evidence; other uncertainty stays alive or unknown, never proven gone.
|
|
6
|
-
*/
|
|
7
|
-
export { parseProcStat, processStartToken, recordedProcessLive, type RecordedProcess } from '../core/process-stat.ts';
|
|
8
|
-
export type WorkerProcessRecord = {
|
|
9
|
-
generation: string;
|
|
10
|
-
controller: RecordedProcess;
|
|
11
|
-
processes: RecordedProcess[];
|
|
12
|
-
};
|
|
13
2
|
/** A different recorded Linux boot proves every original process group ended. */
|
|
14
3
|
export declare function processPredatesCurrentBoot(entry: RecordedProcess): boolean;
|
|
15
|
-
export declare function isCurrentProcess(entry: RecordedProcess): boolean;
|
|
16
4
|
/** The `/proc` reads the Linux scan makes; injectable for platform/error boundary coverage. */
|
|
17
5
|
export type ProcReader = {
|
|
18
6
|
readdir: () => string[];
|
|
@@ -38,6 +26,3 @@ export declare function scanProcessCwds(platform?: NodeJS.Platform, proc?: ProcR
|
|
|
38
26
|
* Squawk's own short-lived git children in a worktree make this read "alive" briefly:
|
|
39
27
|
* conservative, and a retry self-heals. */
|
|
40
28
|
export declare function processesWithCwdUnder(dirs: string | readonly string[], platform?: NodeJS.Platform, proc?: ProcReader, darwin?: DarwinReader): number[] | 'unknown';
|
|
41
|
-
/** Holder pids with their executable names, `123 (sleep), 456`, so a refusal tells a test server from
|
|
42
|
-
* an agent's leftover (hearsay-tools/squawk#914). At most 8 are named. */
|
|
43
|
-
export declare function describeProcesses(pids: readonly number[]): string;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process';
|
|
2
|
-
import { readdirSync,
|
|
3
|
-
import {
|
|
4
|
-
import { linuxBootId
|
|
2
|
+
import { readdirSync, realpathSync, readlinkSync } from 'node:fs';
|
|
3
|
+
import { resolve, sep } from 'node:path';
|
|
4
|
+
import { linuxBootId } from '../core/process-stat.js';
|
|
5
5
|
/**
|
|
6
|
-
* Synchronous process evidence:
|
|
7
|
-
*
|
|
6
|
+
* Synchronous process evidence: the boot check for recorded processes, and the cwd scan that
|
|
7
|
+
* autosave cleanup still uses. Worker ownership never comes from the scan (ADR 0032).
|
|
8
8
|
* Unreadable cwd is no evidence; other uncertainty stays alive or unknown, never proven gone.
|
|
9
9
|
*/
|
|
10
|
-
export { parseProcStat, processStartToken, recordedProcessLive } from '../core/process-stat.js';
|
|
11
10
|
const LINUX_BOOT_ID = /^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/;
|
|
12
11
|
/** A known different boot proves that no descendant of this controller can still exist. */
|
|
13
12
|
function controllerPredatesBoot(token, boot) {
|
|
@@ -18,12 +17,6 @@ function controllerPredatesBoot(token, boot) {
|
|
|
18
17
|
export function processPredatesCurrentBoot(entry) {
|
|
19
18
|
return process.platform === 'linux' && controllerPredatesBoot(entry.startToken, linuxBootId());
|
|
20
19
|
}
|
|
21
|
-
export function isCurrentProcess(entry) {
|
|
22
|
-
if (entry.pid !== process.pid)
|
|
23
|
-
return false;
|
|
24
|
-
const own = processStartToken(process.pid);
|
|
25
|
-
return entry.startToken === undefined || own === undefined || sameIncarnation(entry.startToken, own);
|
|
26
|
-
}
|
|
27
20
|
const lsofCwd = (args, timeout) => {
|
|
28
21
|
const lsof = spawnSync('lsof', [...args, '-d', 'cwd', '-Fpn'], { encoding: 'utf8', timeout, maxBuffer: 16 * 1024 * 1024 });
|
|
29
22
|
// Status 1 is ordinary: some process was unreadable, and an unreadable cwd is no evidence.
|
|
@@ -94,35 +87,4 @@ export function processesWithCwdUnder(dirs, platform = process.platform, proc =
|
|
|
94
87
|
const under = (cwd) => { const path = cwd.replace(/ \(deleted\)$/, ''); return targets.some(target => path === target || path.startsWith(target + sep)); };
|
|
95
88
|
return [...snapshot].filter(([, cwd]) => under(cwd)).map(([pid]) => pid);
|
|
96
89
|
}
|
|
97
|
-
/** One process's executable name, never its arguments: destroy errors are persisted and returned by
|
|
98
|
-
* the API, and any argument may carry a secret. Undefined when it cannot be read. For a refusal a
|
|
99
|
-
* human reads, never for a decision. */
|
|
100
|
-
function processName(pid) {
|
|
101
|
-
let name;
|
|
102
|
-
if (process.platform === 'linux') {
|
|
103
|
-
// The executable file; `comm` is a thread name the process may change (Node's is `node-MainThread`).
|
|
104
|
-
try {
|
|
105
|
-
name = basename(readlinkSync(`/proc/${pid}/exe`));
|
|
106
|
-
}
|
|
107
|
-
catch {
|
|
108
|
-
try {
|
|
109
|
-
name = readFileSync(`/proc/${pid}/comm`, 'utf8');
|
|
110
|
-
}
|
|
111
|
-
catch {
|
|
112
|
-
return undefined;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
else if (process.platform === 'darwin') {
|
|
117
|
-
const ps = spawnSync('ps', ['-o', 'comm=', '-p', String(pid)], { encoding: 'utf8', timeout: 2_000 });
|
|
118
|
-
name = ps.status === 0 ? basename(ps.stdout.trim()) : undefined;
|
|
119
|
-
}
|
|
120
|
-
return name?.trim() || undefined;
|
|
121
|
-
}
|
|
122
|
-
/** Holder pids with their executable names, `123 (sleep), 456`, so a refusal tells a test server from
|
|
123
|
-
* an agent's leftover (hearsay-tools/squawk#914). At most 8 are named. */
|
|
124
|
-
export function describeProcesses(pids) {
|
|
125
|
-
const named = pids.slice(0, 8).map(pid => { const name = processName(pid); return name ? `${pid} (${name})` : String(pid); });
|
|
126
|
-
return named.join(', ') + (pids.length > 8 ? ', …' : '');
|
|
127
|
-
}
|
|
128
90
|
//# sourceMappingURL=process-liveness.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-liveness.js","sourceRoot":"","sources":["../../src/delegation/process-liveness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oB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C,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC;QAAC,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;IAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5I,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,EAAE,GAAG,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnK,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ReclaimPreparation } from '../runs/removal-slots.ts';
|
|
2
|
+
/** The reclaim preparation of workers: an owned worker's evidence is saved before its worktree goes.
|
|
3
|
+
* A worker whose evidence could not be saved keeps its worktree until the next pass. */
|
|
4
|
+
export declare const workerEvidencePreparation: ReclaimPreparation;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { collectWorkerEvidence } from './results.js';
|
|
2
|
+
/** Snapshot parent-owned worker evidence before the checkout goes. A collect/commit failure
|
|
3
|
+
* returns false so the directory is left for the next pass. */
|
|
4
|
+
async function preserveWorkerResult(repoRoot, store, run) {
|
|
5
|
+
if (run.delegation?.role !== 'worker')
|
|
6
|
+
return true;
|
|
7
|
+
const evidence = await collectWorkerEvidence(repoRoot, store, run);
|
|
8
|
+
store.commitWorkerResult(run.delegation.parentRunId, evidence.result, evidence.diffSnapshot);
|
|
9
|
+
return evidence.diffSnapshot !== undefined || evidence.result.diff.state === 'available';
|
|
10
|
+
}
|
|
11
|
+
/** The reclaim preparation of workers: an owned worker's evidence is saved before its worktree goes.
|
|
12
|
+
* A worker whose evidence could not be saved keeps its worktree until the next pass. */
|
|
13
|
+
export const workerEvidencePreparation = {
|
|
14
|
+
name: 'worker evidence',
|
|
15
|
+
async prepare(run, { repoRoot, store }) {
|
|
16
|
+
if (!(await preserveWorkerResult(repoRoot, store, run)))
|
|
17
|
+
throw new Error('Worker evidence was not saved');
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=removal-slot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removal-slot.js","sourceRoot":"","sources":["../../src/delegation/removal-slot.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAErD;gEACgE;AAChE,KAAK,UAAU,oBAAoB,CAAC,QAAgB,EAAE,KAAoB,EAAE,GAAc;IACxF,IAAI,GAAG,CAAC,UAAU,EAAE,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACnD,MAAM,QAAQ,GAAG,MAAM,qBAAqB,CAAC,QAAQ,EAAE,KAAiB,EAAE,GAAG,CAAC,CAAC;IAC/E,KAAK,CAAC,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC;IAC7F,OAAO,QAAQ,CAAC,YAAY,KAAK,SAAS,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,KAAK,WAAW,CAAC;AAC3F,CAAC;AAED;yFACyF;AACzF,MAAM,CAAC,MAAM,yBAAyB,GAAuB;IAC3D,IAAI,EAAE,iBAAiB;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE;QACpC,IAAI,CAAC,CAAC,MAAM,oBAAoB,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAC5G,CAAC;CACF,CAAC"}
|
|
@@ -27,6 +27,18 @@ export declare function delegationFailure(error: unknown): {
|
|
|
27
27
|
export declare function createDelegationRoutes(service: DelegationService, credentials: CredentialRegistry): import("hono/hono-base").HonoBase<Env, {
|
|
28
28
|
"/list": {
|
|
29
29
|
$get: {
|
|
30
|
+
output: {
|
|
31
|
+
error: string;
|
|
32
|
+
code?: "invalid_input" | undefined;
|
|
33
|
+
};
|
|
34
|
+
outputFormat: "json";
|
|
35
|
+
status: 400;
|
|
36
|
+
input: {
|
|
37
|
+
query: {
|
|
38
|
+
offset?: string | undefined;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
} | {
|
|
30
42
|
output: {
|
|
31
43
|
workers: {
|
|
32
44
|
workerId: string;
|
|
@@ -73,24 +85,22 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
73
85
|
offset?: string | undefined;
|
|
74
86
|
};
|
|
75
87
|
};
|
|
76
|
-
} | {
|
|
77
|
-
output: {
|
|
78
|
-
error: string;
|
|
79
|
-
code?: "invalid_input" | undefined;
|
|
80
|
-
};
|
|
81
|
-
outputFormat: "json";
|
|
82
|
-
status: 400;
|
|
83
|
-
input: {
|
|
84
|
-
query: {
|
|
85
|
-
offset?: string | undefined;
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
90
|
} & {
|
|
91
91
|
"/discover": {
|
|
92
92
|
$post: {
|
|
93
93
|
output: {
|
|
94
|
+
scope: "host-default-account";
|
|
95
|
+
runners: {
|
|
96
|
+
requiresAccountHome?: boolean | undefined;
|
|
97
|
+
status: "connected" | "disconnected" | "not-installed" | "unknown";
|
|
98
|
+
enabled?: boolean | undefined;
|
|
99
|
+
hint?: string | undefined;
|
|
100
|
+
authFailureId?: string | undefined;
|
|
101
|
+
runner: string;
|
|
102
|
+
}[];
|
|
103
|
+
} | {
|
|
94
104
|
runner: string;
|
|
95
105
|
models: {
|
|
96
106
|
id: string;
|
|
@@ -101,16 +111,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
101
111
|
source: "cache" | "live" | "unavailable";
|
|
102
112
|
stale: boolean;
|
|
103
113
|
reason?: string | undefined;
|
|
104
|
-
} | {
|
|
105
|
-
scope: "host-default-account";
|
|
106
|
-
runners: {
|
|
107
|
-
requiresAccountHome?: boolean | undefined;
|
|
108
|
-
status: "connected" | "disconnected" | "not-installed" | "unknown";
|
|
109
|
-
enabled?: boolean | undefined;
|
|
110
|
-
hint?: string | undefined;
|
|
111
|
-
authFailureId?: string | undefined;
|
|
112
|
-
runner: string;
|
|
113
|
-
}[];
|
|
114
114
|
} | {
|
|
115
115
|
tasks: {
|
|
116
116
|
id: string;
|
|
@@ -232,13 +232,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
232
232
|
status: 200;
|
|
233
233
|
input: {
|
|
234
234
|
json: {
|
|
235
|
-
requestIds: string[];
|
|
236
|
-
mode?: "all" | "any" | "one" | undefined;
|
|
237
|
-
timeoutSeconds?: number | undefined;
|
|
238
|
-
} | {
|
|
239
235
|
workerIds: string[];
|
|
240
236
|
timeoutSeconds?: number | undefined;
|
|
241
237
|
mode?: "all" | "any" | "one" | undefined;
|
|
238
|
+
} | {
|
|
239
|
+
requestIds: string[];
|
|
240
|
+
mode?: "all" | "any" | "one" | undefined;
|
|
241
|
+
timeoutSeconds?: number | undefined;
|
|
242
242
|
} | {
|
|
243
243
|
peerIds: string[];
|
|
244
244
|
timeoutSeconds?: number | undefined;
|
|
@@ -629,6 +629,18 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
629
629
|
} & {
|
|
630
630
|
"/:workerId": {
|
|
631
631
|
$get: {
|
|
632
|
+
output: {
|
|
633
|
+
error: string;
|
|
634
|
+
code?: "invalid_input" | undefined;
|
|
635
|
+
};
|
|
636
|
+
outputFormat: "json";
|
|
637
|
+
status: 400;
|
|
638
|
+
input: {
|
|
639
|
+
param: {
|
|
640
|
+
workerId: string;
|
|
641
|
+
};
|
|
642
|
+
};
|
|
643
|
+
} | {
|
|
632
644
|
output: {
|
|
633
645
|
workerId: string;
|
|
634
646
|
settled: boolean;
|
|
@@ -746,7 +758,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
746
758
|
workerId: string;
|
|
747
759
|
};
|
|
748
760
|
};
|
|
749
|
-
}
|
|
761
|
+
};
|
|
762
|
+
};
|
|
763
|
+
} & {
|
|
764
|
+
"/:workerId/collect": {
|
|
765
|
+
$post: {
|
|
750
766
|
output: {
|
|
751
767
|
error: string;
|
|
752
768
|
code?: "invalid_input" | undefined;
|
|
@@ -757,12 +773,10 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
757
773
|
param: {
|
|
758
774
|
workerId: string;
|
|
759
775
|
};
|
|
776
|
+
} & {
|
|
777
|
+
json: Record<string, never>;
|
|
760
778
|
};
|
|
761
|
-
}
|
|
762
|
-
};
|
|
763
|
-
} & {
|
|
764
|
-
"/:workerId/collect": {
|
|
765
|
-
$post: {
|
|
779
|
+
} | {
|
|
766
780
|
output: {
|
|
767
781
|
workerId: string;
|
|
768
782
|
parentRunId: string;
|
|
@@ -885,7 +899,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
885
899
|
} & {
|
|
886
900
|
json: Record<string, never>;
|
|
887
901
|
};
|
|
888
|
-
}
|
|
902
|
+
};
|
|
903
|
+
};
|
|
904
|
+
} & {
|
|
905
|
+
"/:workerId/steer": {
|
|
906
|
+
$post: {
|
|
889
907
|
output: {
|
|
890
908
|
error: string;
|
|
891
909
|
code?: "invalid_input" | undefined;
|
|
@@ -897,13 +915,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
897
915
|
workerId: string;
|
|
898
916
|
};
|
|
899
917
|
} & {
|
|
900
|
-
json:
|
|
918
|
+
json: {
|
|
919
|
+
text: string;
|
|
920
|
+
};
|
|
901
921
|
};
|
|
902
|
-
}
|
|
903
|
-
};
|
|
904
|
-
} & {
|
|
905
|
-
"/:workerId/steer": {
|
|
906
|
-
$post: {
|
|
922
|
+
} | {
|
|
907
923
|
output: {
|
|
908
924
|
workerId: string;
|
|
909
925
|
state: "delivered" | "queued";
|
|
@@ -919,7 +935,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
919
935
|
text: string;
|
|
920
936
|
};
|
|
921
937
|
};
|
|
922
|
-
}
|
|
938
|
+
};
|
|
939
|
+
};
|
|
940
|
+
} & {
|
|
941
|
+
"/:workerId/stop": {
|
|
942
|
+
$post: {
|
|
923
943
|
output: {
|
|
924
944
|
error: string;
|
|
925
945
|
code?: "invalid_input" | undefined;
|
|
@@ -931,15 +951,9 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
931
951
|
workerId: string;
|
|
932
952
|
};
|
|
933
953
|
} & {
|
|
934
|
-
json:
|
|
935
|
-
text: string;
|
|
936
|
-
};
|
|
954
|
+
json: Record<string, never>;
|
|
937
955
|
};
|
|
938
|
-
}
|
|
939
|
-
};
|
|
940
|
-
} & {
|
|
941
|
-
"/:workerId/stop": {
|
|
942
|
-
$post: {
|
|
956
|
+
} | {
|
|
943
957
|
output: {
|
|
944
958
|
workerId: string;
|
|
945
959
|
state: "stopping" | "terminated";
|
|
@@ -953,7 +967,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
953
967
|
} & {
|
|
954
968
|
json: Record<string, never>;
|
|
955
969
|
};
|
|
956
|
-
}
|
|
970
|
+
};
|
|
971
|
+
};
|
|
972
|
+
} & {
|
|
973
|
+
"/:workerId/destroy": {
|
|
974
|
+
$post: {
|
|
957
975
|
output: {
|
|
958
976
|
error: string;
|
|
959
977
|
code?: "invalid_input" | undefined;
|
|
@@ -965,13 +983,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
965
983
|
workerId: string;
|
|
966
984
|
};
|
|
967
985
|
} & {
|
|
968
|
-
json:
|
|
986
|
+
json: {
|
|
987
|
+
discardWork?: true | undefined;
|
|
988
|
+
};
|
|
969
989
|
};
|
|
970
|
-
}
|
|
971
|
-
};
|
|
972
|
-
} & {
|
|
973
|
-
"/:workerId/destroy": {
|
|
974
|
-
$post: {
|
|
990
|
+
} | {
|
|
975
991
|
output: {
|
|
976
992
|
workerId: string;
|
|
977
993
|
state: "complete" | "incomplete";
|
|
@@ -1000,22 +1016,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1000
1016
|
discardWork?: true | undefined;
|
|
1001
1017
|
};
|
|
1002
1018
|
};
|
|
1003
|
-
} | {
|
|
1004
|
-
output: {
|
|
1005
|
-
error: string;
|
|
1006
|
-
code?: "invalid_input" | undefined;
|
|
1007
|
-
};
|
|
1008
|
-
outputFormat: "json";
|
|
1009
|
-
status: 400;
|
|
1010
|
-
input: {
|
|
1011
|
-
param: {
|
|
1012
|
-
workerId: string;
|
|
1013
|
-
};
|
|
1014
|
-
} & {
|
|
1015
|
-
json: {
|
|
1016
|
-
discardWork?: true | undefined;
|
|
1017
|
-
};
|
|
1018
|
-
};
|
|
1019
1019
|
} | {
|
|
1020
1020
|
output: {
|
|
1021
1021
|
workerId: string;
|
|
@@ -1051,13 +1051,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1051
1051
|
"/:workerId/diff": {
|
|
1052
1052
|
$get: {
|
|
1053
1053
|
output: {
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
diff: string;
|
|
1057
|
-
truncated: boolean;
|
|
1054
|
+
error: string;
|
|
1055
|
+
code?: "invalid_input" | undefined;
|
|
1058
1056
|
};
|
|
1059
1057
|
outputFormat: "json";
|
|
1060
|
-
status:
|
|
1058
|
+
status: 400;
|
|
1061
1059
|
input: {
|
|
1062
1060
|
param: {
|
|
1063
1061
|
workerId: string;
|
|
@@ -1065,11 +1063,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1065
1063
|
};
|
|
1066
1064
|
} | {
|
|
1067
1065
|
output: {
|
|
1068
|
-
|
|
1069
|
-
|
|
1066
|
+
workerId: string;
|
|
1067
|
+
baselineSha: string;
|
|
1068
|
+
diff: string;
|
|
1069
|
+
truncated: boolean;
|
|
1070
1070
|
};
|
|
1071
1071
|
outputFormat: "json";
|
|
1072
|
-
status:
|
|
1072
|
+
status: 200;
|
|
1073
1073
|
input: {
|
|
1074
1074
|
param: {
|
|
1075
1075
|
workerId: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { spawnCapacityRefusal } from './capacity.js';
|
|
1
2
|
import { commandText } from '../home/command.js';
|
|
2
3
|
import { WAIT_KINDS } from '../workflows/run/wait-kinds.js';
|
|
3
4
|
import { projectPaths } from '../project-paths.js';
|
|
@@ -149,7 +150,7 @@ async function acceptSpawnedWorker(args) {
|
|
|
149
150
|
autonomous: parent.autonomous,
|
|
150
151
|
steps: workflowDef.steps.map(step => ({ id: step.id, name: step.name ?? step.id, kind: stepKind(step) })),
|
|
151
152
|
}, family.id, request.requestId, { role: 'worker', permissions: [...DEFAULT_GRANTS.worker.operate], ...(spawnGrant ? { spawnGrant } : {}),
|
|
152
|
-
parentRunId: family.id, ...(parent.id === family.id ? {} : { supervisorRunId: parent.id }), workspace, ...(context ? { context } : {}) }, requestHash, {
|
|
153
|
+
parentRunId: family.id, ...(parent.id === family.id ? {} : { supervisorRunId: parent.id }), workspace, ...(context ? { context } : {}) }, requestHash, spawnCapacityRefusal, {
|
|
153
154
|
...identity, ...(context ? { contextHash: workerContextHash(context) } : {}),
|
|
154
155
|
// A named catalog chain or skill is bound like the context recipe; the default quick-task leaves the identity as before.
|
|
155
156
|
...(request.workflow === undefined && request.skill === undefined ? {} : { workflowHash: workerWorkflowHash(workflowDef) }),
|