@hearsay-tools/squawk 0.18.0-pr3458.6104 → 0.18.0-pr3460.6116.2
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/delegation/identity-file-store.d.ts +1 -1
- package/dist/delegation/provision.d.ts +2 -4
- package/dist/delegation/provision.js +3 -5
- package/dist/delegation/provision.js.map +1 -1
- package/dist/delegation/routes.d.ts +75 -75
- package/dist/delegation/service.d.ts +4 -13
- package/dist/delegation/service.js +7 -13
- package/dist/delegation/service.js.map +1 -1
- package/dist/delegation/transport.d.ts +9 -9
- package/dist/delegation/windows-identity-store.d.ts +1 -1
- package/dist/delegation/windows-identity-store.js +1 -1
- package/dist/delegation/windows-identity-store.js.map +1 -1
- package/dist/delegation/worker-cleanup.d.ts +1 -3
- package/dist/delegation/worker-cleanup.js +2 -7
- package/dist/delegation/worker-cleanup.js.map +1 -1
- package/dist/delegation/workspace.d.ts +28 -1
- package/dist/delegation/workspace.js +411 -7
- package/dist/delegation/workspace.js.map +1 -1
- package/dist/git-worktree-release.d.ts +9 -5
- package/dist/git-worktree-release.js +10 -5
- package/dist/git-worktree-release.js.map +1 -1
- package/dist/headless-run.d.ts +0 -3
- package/dist/headless-run.js +1 -1
- package/dist/headless-run.js.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/project-migration/containment.js +1 -1
- package/dist/project-migration/containment.js.map +1 -1
- package/dist/project-migration/plan.js +1 -1
- package/dist/project-migration/plan.js.map +1 -1
- package/dist/project-migration/steps.js +1 -1
- package/dist/project-migration/steps.js.map +1 -1
- package/dist/serve-command.d.ts +0 -3
- package/dist/serve-command.js +1 -1
- package/dist/serve-command.js.map +1 -1
- package/dist/server/server.d.ts +99 -101
- package/dist/server/server.js +1 -1
- package/dist/server/server.js.map +1 -1
- package/dist/server/workspace-live-routes.d.ts +6 -6
- package/package.json +4 -4
- package/scripts/benchmark-stuck-destroys.ts +1 -2
- package/dist/delegation/owned-workspace-release.d.ts +0 -8
- package/dist/delegation/owned-workspace-release.js +0 -9
- package/dist/delegation/owned-workspace-release.js.map +0 -1
- package/dist/delegation/workspace-git.d.ts +0 -19
- package/dist/delegation/workspace-git.js +0 -67
- package/dist/delegation/workspace-git.js.map +0 -1
- package/dist/delegation/workspace-record.d.ts +0 -63
- package/dist/delegation/workspace-record.js +0 -78
- package/dist/delegation/workspace-record.js.map +0 -1
- package/dist/delegation/workspace-removal.d.ts +0 -19
- package/dist/delegation/workspace-removal.js +0 -284
- package/dist/delegation/workspace-removal.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Where the ownership policy in `workspace
|
|
2
|
+
* Where the ownership policy in `workspace.ts` keeps its identity files: the receipt directory,
|
|
3
3
|
* receipts, cleanup checkpoints and Git administration markers. The store owns the platform's
|
|
4
4
|
* safety rules; the policy owns what the files prove (ADR 0032).
|
|
5
5
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RunManager } from '../workflows/run.ts';
|
|
2
2
|
import type { RunStore } from '../runs/store.ts';
|
|
3
3
|
import { CredentialRegistry } from './credentials.ts';
|
|
4
|
-
import { DelegationService, type DelegationProject
|
|
4
|
+
import { DelegationService, type DelegationProject } from './service.ts';
|
|
5
5
|
export type DelegationSession = {
|
|
6
6
|
restrictCrossSessionMessaging: true;
|
|
7
7
|
env: Record<string, string>;
|
|
@@ -26,10 +26,8 @@ export declare class DelegationController {
|
|
|
26
26
|
private projects;
|
|
27
27
|
private closed;
|
|
28
28
|
private warned;
|
|
29
|
-
/** `cleanup` lets the service destroy workers; the process entries pass `workerCleanups()`. */
|
|
30
|
-
constructor(cleanup?: WorkerCleanupFactory);
|
|
31
29
|
get url(): string | undefined;
|
|
32
|
-
static start(
|
|
30
|
+
static start(): Promise<DelegationController>;
|
|
33
31
|
private unavailable;
|
|
34
32
|
attachProject(project: DelegationProject & {
|
|
35
33
|
manager: Pick<RunManager, 'setDelegationProvisioner'>;
|
|
@@ -151,17 +151,15 @@ export function provisionDelegationSession(options) {
|
|
|
151
151
|
}
|
|
152
152
|
/** Owns one invisible loopback listener in this controller, for cockpit AND headless use. */
|
|
153
153
|
export class DelegationController {
|
|
154
|
-
service;
|
|
154
|
+
service = new DelegationService();
|
|
155
155
|
credentials = new CredentialRegistry();
|
|
156
156
|
transport;
|
|
157
157
|
projects = new Map();
|
|
158
158
|
closed = false;
|
|
159
159
|
warned = false;
|
|
160
|
-
/** `cleanup` lets the service destroy workers; the process entries pass `workerCleanups()`. */
|
|
161
|
-
constructor(cleanup) { this.service = new DelegationService(cleanup); }
|
|
162
160
|
get url() { return this.transport?.url; }
|
|
163
|
-
static async start(
|
|
164
|
-
const controller = new DelegationController(
|
|
161
|
+
static async start() {
|
|
162
|
+
const controller = new DelegationController();
|
|
165
163
|
// Always on since hearsay-tools/cezarion#2784: each task's switches gate workers and messaging.
|
|
166
164
|
try {
|
|
167
165
|
controller.transport = await startDelegationTransport(createDelegationApp(createDelegationRoutes(controller.service, controller.credentials)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provision.js","sourceRoot":"","sources":["../../src/delegation/provision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"provision.js","sourceRoot":"","sources":["../../src/delegation/provision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,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CAAC,CAAC;gBAAC,IAAI,CAAC,WAAW,EAAE,CAAC;gBAAC,OAAO;YAAC,CAAC;QACvE,CAAC,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,GAAG,EAAE;YAClB,KAAK,EAAE,CAAC;YAAC,UAAU,EAAE,CAAC;YACtB,sFAAsF;YACtF,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAC3C,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM;gBAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACzF,CAAC,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;QACnD,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,KAAK,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YAAE,MAAM,EAAE,CAAC;QAC/D,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACzB,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAAC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC7D,MAAM,SAAS,EAAE,KAAK,EAAE,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -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;
|
|
@@ -64,24 +76,21 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
64
76
|
offset?: string | undefined;
|
|
65
77
|
};
|
|
66
78
|
};
|
|
67
|
-
} | {
|
|
68
|
-
output: {
|
|
69
|
-
error: string;
|
|
70
|
-
code?: "invalid_input" | undefined;
|
|
71
|
-
};
|
|
72
|
-
outputFormat: "json";
|
|
73
|
-
status: 400;
|
|
74
|
-
input: {
|
|
75
|
-
query: {
|
|
76
|
-
offset?: string | undefined;
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
81
|
} & {
|
|
82
82
|
"/discover": {
|
|
83
83
|
$post: {
|
|
84
84
|
output: {
|
|
85
|
+
scope: "host-default-account";
|
|
86
|
+
runners: {
|
|
87
|
+
status: "connected" | "disconnected" | "not-installed" | "unknown";
|
|
88
|
+
enabled?: boolean | undefined;
|
|
89
|
+
hint?: string | undefined;
|
|
90
|
+
authFailureId?: string | undefined;
|
|
91
|
+
runner: "claude" | "codex" | "cursor" | "omp" | "opencode" | "pi";
|
|
92
|
+
}[];
|
|
93
|
+
} | {
|
|
85
94
|
tasks: {
|
|
86
95
|
id: string;
|
|
87
96
|
title: string;
|
|
@@ -93,15 +102,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
93
102
|
reason?: string | undefined;
|
|
94
103
|
}[];
|
|
95
104
|
nextOffset?: number | undefined;
|
|
96
|
-
} | {
|
|
97
|
-
scope: "host-default-account";
|
|
98
|
-
runners: {
|
|
99
|
-
status: "connected" | "disconnected" | "not-installed" | "unknown";
|
|
100
|
-
enabled?: boolean | undefined;
|
|
101
|
-
hint?: string | undefined;
|
|
102
|
-
authFailureId?: string | undefined;
|
|
103
|
-
runner: "claude" | "codex" | "cursor" | "omp" | "opencode" | "pi";
|
|
104
|
-
}[];
|
|
105
105
|
} | {
|
|
106
106
|
runner: "claude" | "codex" | "cursor" | "omp" | "opencode" | "pi";
|
|
107
107
|
models: {
|
|
@@ -221,13 +221,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
221
221
|
status: 200;
|
|
222
222
|
input: {
|
|
223
223
|
json: {
|
|
224
|
-
requestIds: string[];
|
|
225
|
-
mode?: "all" | "any" | "one" | undefined;
|
|
226
|
-
timeoutSeconds?: number | undefined;
|
|
227
|
-
} | {
|
|
228
224
|
workerIds: string[];
|
|
229
225
|
timeoutSeconds?: number | undefined;
|
|
230
226
|
mode?: "all" | "any" | "one" | undefined;
|
|
227
|
+
} | {
|
|
228
|
+
requestIds: string[];
|
|
229
|
+
mode?: "all" | "any" | "one" | undefined;
|
|
230
|
+
timeoutSeconds?: number | undefined;
|
|
231
231
|
} | {
|
|
232
232
|
peerIds: string[];
|
|
233
233
|
timeoutSeconds?: number | undefined;
|
|
@@ -613,6 +613,18 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
613
613
|
} & {
|
|
614
614
|
"/:workerId": {
|
|
615
615
|
$get: {
|
|
616
|
+
output: {
|
|
617
|
+
error: string;
|
|
618
|
+
code?: "invalid_input" | undefined;
|
|
619
|
+
};
|
|
620
|
+
outputFormat: "json";
|
|
621
|
+
status: 400;
|
|
622
|
+
input: {
|
|
623
|
+
param: {
|
|
624
|
+
workerId: string;
|
|
625
|
+
};
|
|
626
|
+
};
|
|
627
|
+
} | {
|
|
616
628
|
output: {
|
|
617
629
|
workerId: string;
|
|
618
630
|
parentRunId: string;
|
|
@@ -716,7 +728,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
716
728
|
workerId: string;
|
|
717
729
|
};
|
|
718
730
|
};
|
|
719
|
-
}
|
|
731
|
+
};
|
|
732
|
+
};
|
|
733
|
+
} & {
|
|
734
|
+
"/:workerId/collect": {
|
|
735
|
+
$post: {
|
|
720
736
|
output: {
|
|
721
737
|
error: string;
|
|
722
738
|
code?: "invalid_input" | undefined;
|
|
@@ -727,12 +743,10 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
727
743
|
param: {
|
|
728
744
|
workerId: string;
|
|
729
745
|
};
|
|
746
|
+
} & {
|
|
747
|
+
json: Record<string, never>;
|
|
730
748
|
};
|
|
731
|
-
}
|
|
732
|
-
};
|
|
733
|
-
} & {
|
|
734
|
-
"/:workerId/collect": {
|
|
735
|
-
$post: {
|
|
749
|
+
} | {
|
|
736
750
|
output: {
|
|
737
751
|
workerId: string;
|
|
738
752
|
parentRunId: string;
|
|
@@ -834,7 +848,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
834
848
|
} & {
|
|
835
849
|
json: Record<string, never>;
|
|
836
850
|
};
|
|
837
|
-
}
|
|
851
|
+
};
|
|
852
|
+
};
|
|
853
|
+
} & {
|
|
854
|
+
"/:workerId/steer": {
|
|
855
|
+
$post: {
|
|
838
856
|
output: {
|
|
839
857
|
error: string;
|
|
840
858
|
code?: "invalid_input" | undefined;
|
|
@@ -846,13 +864,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
846
864
|
workerId: string;
|
|
847
865
|
};
|
|
848
866
|
} & {
|
|
849
|
-
json:
|
|
867
|
+
json: {
|
|
868
|
+
text: string;
|
|
869
|
+
};
|
|
850
870
|
};
|
|
851
|
-
}
|
|
852
|
-
};
|
|
853
|
-
} & {
|
|
854
|
-
"/:workerId/steer": {
|
|
855
|
-
$post: {
|
|
871
|
+
} | {
|
|
856
872
|
output: {
|
|
857
873
|
workerId: string;
|
|
858
874
|
state: "delivered" | "queued";
|
|
@@ -868,7 +884,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
868
884
|
text: string;
|
|
869
885
|
};
|
|
870
886
|
};
|
|
871
|
-
}
|
|
887
|
+
};
|
|
888
|
+
};
|
|
889
|
+
} & {
|
|
890
|
+
"/:workerId/stop": {
|
|
891
|
+
$post: {
|
|
872
892
|
output: {
|
|
873
893
|
error: string;
|
|
874
894
|
code?: "invalid_input" | undefined;
|
|
@@ -880,15 +900,9 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
880
900
|
workerId: string;
|
|
881
901
|
};
|
|
882
902
|
} & {
|
|
883
|
-
json:
|
|
884
|
-
text: string;
|
|
885
|
-
};
|
|
903
|
+
json: Record<string, never>;
|
|
886
904
|
};
|
|
887
|
-
}
|
|
888
|
-
};
|
|
889
|
-
} & {
|
|
890
|
-
"/:workerId/stop": {
|
|
891
|
-
$post: {
|
|
905
|
+
} | {
|
|
892
906
|
output: {
|
|
893
907
|
workerId: string;
|
|
894
908
|
state: "stopping" | "terminated";
|
|
@@ -902,7 +916,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
902
916
|
} & {
|
|
903
917
|
json: Record<string, never>;
|
|
904
918
|
};
|
|
905
|
-
}
|
|
919
|
+
};
|
|
920
|
+
};
|
|
921
|
+
} & {
|
|
922
|
+
"/:workerId/destroy": {
|
|
923
|
+
$post: {
|
|
906
924
|
output: {
|
|
907
925
|
error: string;
|
|
908
926
|
code?: "invalid_input" | undefined;
|
|
@@ -916,11 +934,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
916
934
|
} & {
|
|
917
935
|
json: Record<string, never>;
|
|
918
936
|
};
|
|
919
|
-
}
|
|
920
|
-
};
|
|
921
|
-
} & {
|
|
922
|
-
"/:workerId/destroy": {
|
|
923
|
-
$post: {
|
|
937
|
+
} | {
|
|
924
938
|
output: {
|
|
925
939
|
workerId: string;
|
|
926
940
|
state: "complete" | "incomplete";
|
|
@@ -943,20 +957,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
943
957
|
} & {
|
|
944
958
|
json: Record<string, never>;
|
|
945
959
|
};
|
|
946
|
-
} | {
|
|
947
|
-
output: {
|
|
948
|
-
error: string;
|
|
949
|
-
code?: "invalid_input" | undefined;
|
|
950
|
-
};
|
|
951
|
-
outputFormat: "json";
|
|
952
|
-
status: 400;
|
|
953
|
-
input: {
|
|
954
|
-
param: {
|
|
955
|
-
workerId: string;
|
|
956
|
-
};
|
|
957
|
-
} & {
|
|
958
|
-
json: Record<string, never>;
|
|
959
|
-
};
|
|
960
960
|
} | {
|
|
961
961
|
output: {
|
|
962
962
|
workerId: string;
|
|
@@ -986,13 +986,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
986
986
|
"/:workerId/diff": {
|
|
987
987
|
$get: {
|
|
988
988
|
output: {
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
diff: string;
|
|
992
|
-
truncated: boolean;
|
|
989
|
+
error: string;
|
|
990
|
+
code?: "invalid_input" | undefined;
|
|
993
991
|
};
|
|
994
992
|
outputFormat: "json";
|
|
995
|
-
status:
|
|
993
|
+
status: 400;
|
|
996
994
|
input: {
|
|
997
995
|
param: {
|
|
998
996
|
workerId: string;
|
|
@@ -1000,11 +998,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1000
998
|
};
|
|
1001
999
|
} | {
|
|
1002
1000
|
output: {
|
|
1003
|
-
|
|
1004
|
-
|
|
1001
|
+
workerId: string;
|
|
1002
|
+
baselineSha: string;
|
|
1003
|
+
diff: string;
|
|
1004
|
+
truncated: boolean;
|
|
1005
1005
|
};
|
|
1006
1006
|
outputFormat: "json";
|
|
1007
|
-
status:
|
|
1007
|
+
status: 200;
|
|
1008
1008
|
input: {
|
|
1009
1009
|
param: {
|
|
1010
1010
|
workerId: string;
|
|
@@ -3,10 +3,11 @@ import { type HostDiscovery } from '../discovery/choices.ts';
|
|
|
3
3
|
export { rootDelegation } from './conversations.ts';
|
|
4
4
|
import { type DiscoveryRequest, type DiscoveryResponse } from '../contract/index.js';
|
|
5
5
|
import { type ConversationSendRequest, type ConversationSendResult, type ConversationInspectRequest, type ConversationInspectResult, type ConversationCancelRequest, type InboxReserveResult, type InboxReceiptRequest, type InboxReceiptResult, type RequestWaitRequest, type RequestOutcome } from '../contract/index.js';
|
|
6
|
-
import { type PeerWaitRequest, type WorkerCancelWaitRequest, type WorkerListPage, type WorkerListQuery, type WorkerCollectedResult, type WorkerInspection, type WorkerParams, type WorkerSpawnRequest, type WorkerSteerRequest, type
|
|
6
|
+
import { type PeerWaitRequest, type WorkerCancelWaitRequest, type WorkerListPage, type WorkerListQuery, type WorkerCollectedResult, type WorkerInspection, type WorkerParams, type WorkerSpawnRequest, type WorkerSteerRequest, type WorkerWaitRequest } from '../contract/index.js';
|
|
7
7
|
import type { RunStore, RunRecord } from '../runs/store.ts';
|
|
8
8
|
import type { RunManager } from '../workflows/run.ts';
|
|
9
9
|
import type { Caller } from './credentials.ts';
|
|
10
|
+
import { type WorkerCleanupOptions } from './worker-cleanup.ts';
|
|
10
11
|
export type DelegationManager = Pick<RunManager, 'acknowledgeInbox' | 'awaitRunTermination' | 'builtinSkills' | 'canClaimInboxInput' | 'cancelPeerWait' | 'cancelWorkerWait' | 'claimWorkerCleanup' | 'continueRun' | 'deliverConversationInput' | 'enqueueOwnedRun' | 'isActive' | 'pauseWorkerCleanup' | 'previewHost' | 'reconcileWorkerWaits' | 'recoverWorkerCleanup' | 'registerPeerWait' | 'registerRequestWait' | 'registerWorkerWait' | 'releaseInbox' | 'requestWorkerStop' | 'reserveInboxInputs' | 'selectDelegationExecutionSettings' | 'settleOrphanedWorkerExecution' | 'steerWorker' | 'takeWorkerTerminationBlocker'>;
|
|
11
12
|
export type DelegationProject = {
|
|
12
13
|
home: Home;
|
|
@@ -15,18 +16,9 @@ export type DelegationProject = {
|
|
|
15
16
|
store: RunStore;
|
|
16
17
|
manager: DelegationManager;
|
|
17
18
|
};
|
|
18
|
-
/** One registered project's destroy state and retry lifecycle, as `WorkerCleanup` (`worker-cleanup.ts`) implements it. */
|
|
19
|
-
export type WorkerCleanupPort = {
|
|
20
|
-
request(workerId: string, check: () => RunRecord): Promise<WorkerDestroyResult>;
|
|
21
|
-
armAfterRecovery(): void;
|
|
22
|
-
detach(): void;
|
|
23
|
-
};
|
|
24
|
-
/** Builds a project's cleanup when it registers. The process entries supply `workerCleanups()`, as they
|
|
25
|
-
* supply discovery; a service built without one refuses destroys, so it never loads the removal path. */
|
|
26
|
-
export type WorkerCleanupFactory = (project: DelegationProject, isAttached: () => boolean, serialized: <T>(key: string, operation: () => Promise<T>) => Promise<T>) => WorkerCleanupPort;
|
|
27
19
|
/** A single controller's shared policy adapter; managers retain scheduling and lifecycle ownership. */
|
|
28
20
|
export declare class DelegationService {
|
|
29
|
-
private readonly
|
|
21
|
+
private readonly cleanupOptions;
|
|
30
22
|
private discovery?;
|
|
31
23
|
setDiscovery(discovery: HostDiscovery): void;
|
|
32
24
|
discover(caller: Caller, value: DiscoveryRequest): Promise<DiscoveryResponse>;
|
|
@@ -34,13 +26,12 @@ export declare class DelegationService {
|
|
|
34
26
|
private projects;
|
|
35
27
|
private serial;
|
|
36
28
|
private cleanups;
|
|
37
|
-
constructor(
|
|
29
|
+
constructor(cleanupOptions?: WorkerCleanupOptions);
|
|
38
30
|
registerProject(project: DelegationProject): () => void;
|
|
39
31
|
/** Called only after manager recovery, when persisted destroy intents may be retried. */
|
|
40
32
|
armDestroyRetries(projectId: string): void;
|
|
41
33
|
/** The data directory of the caller's project, for the listener's migration admission. */
|
|
42
34
|
projectDataDir(caller: Caller): string | undefined;
|
|
43
|
-
private cleanupFor;
|
|
44
35
|
private context;
|
|
45
36
|
private serialized;
|
|
46
37
|
private target;
|
|
@@ -26,6 +26,7 @@ import { isAuthenticatedCaller } from './credentials.js';
|
|
|
26
26
|
import { parseDelegationEffort } from './effort.js';
|
|
27
27
|
import { authorizeWorkerList, authorizeSpawn, authorizeSpawnReplay, authorizeWorker, authorizeCancelWait, authorizeRetainedResult, DelegationPolicyError, MESSAGING_OFF, requireWorkersAllowed } from './policy.js';
|
|
28
28
|
import { planOwnedWorkspace, readOwnedDiff, resolveWorkerBaseline, verifyOwnedWorkspace } from './workspace.js';
|
|
29
|
+
import { WorkerCleanup } from './worker-cleanup.js';
|
|
29
30
|
/**
|
|
30
31
|
* Resolve an explicit workflow or skill. With neither, use the built-in quick-task constant, not
|
|
31
32
|
* a repo override. Require at least one agent step and resolve its runner/account independently.
|
|
@@ -168,7 +169,7 @@ function assertNewPeerSend(pair, request) {
|
|
|
168
169
|
}
|
|
169
170
|
/** A single controller's shared policy adapter; managers retain scheduling and lifecycle ownership. */
|
|
170
171
|
export class DelegationService {
|
|
171
|
-
|
|
172
|
+
cleanupOptions;
|
|
172
173
|
discovery;
|
|
173
174
|
setDiscovery(discovery) { this.discovery = discovery; }
|
|
174
175
|
async discover(caller, value) {
|
|
@@ -212,8 +213,8 @@ export class DelegationService {
|
|
|
212
213
|
projects = new Map();
|
|
213
214
|
serial = new Map();
|
|
214
215
|
cleanups = new Map();
|
|
215
|
-
constructor(
|
|
216
|
-
this.
|
|
216
|
+
constructor(cleanupOptions = {}) {
|
|
217
|
+
this.cleanupOptions = cleanupOptions;
|
|
217
218
|
}
|
|
218
219
|
registerProject(project) {
|
|
219
220
|
const existing = this.projects.get(project.id);
|
|
@@ -222,8 +223,7 @@ export class DelegationService {
|
|
|
222
223
|
this.cleanups.get(project.id)?.detach();
|
|
223
224
|
existing?.manager.pauseWorkerCleanup();
|
|
224
225
|
this.projects.set(project.id, project);
|
|
225
|
-
|
|
226
|
-
this.cleanups.set(project.id, this.cleanup(project, () => this.projects.get(project.id) === project, (key, operation) => this.serialized(key, operation)));
|
|
226
|
+
this.cleanups.set(project.id, new WorkerCleanup(project, () => this.projects.get(project.id) === project, (key, operation) => this.serialized(key, operation), this.cleanupOptions));
|
|
227
227
|
return () => { if (this.projects.get(project.id) === project) {
|
|
228
228
|
this.cleanups.get(project.id)?.detach();
|
|
229
229
|
project.manager.pauseWorkerCleanup();
|
|
@@ -238,12 +238,6 @@ export class DelegationService {
|
|
|
238
238
|
const project = isAuthenticatedCaller(caller) ? this.projects.get(caller.projectId) : undefined;
|
|
239
239
|
return project ? projectPaths(project.root).write : undefined;
|
|
240
240
|
}
|
|
241
|
-
cleanupFor(project) {
|
|
242
|
-
const cleanup = this.cleanups.get(project.id);
|
|
243
|
-
if (!cleanup)
|
|
244
|
-
throw new DelegationPolicyError('unavailable_transport', 'Worker cleanup is unavailable');
|
|
245
|
-
return cleanup;
|
|
246
|
-
}
|
|
247
241
|
context(caller) {
|
|
248
242
|
const project = isAuthenticatedCaller(caller) ? this.projects.get(caller.projectId) : undefined;
|
|
249
243
|
if (!project)
|
|
@@ -820,7 +814,7 @@ export class DelegationService {
|
|
|
820
814
|
}
|
|
821
815
|
async destroy(caller, params) {
|
|
822
816
|
const { project, worker } = this.target(caller, params, 'destroy');
|
|
823
|
-
return this.
|
|
817
|
+
return this.cleanups.get(project.id).request(worker.id, () => this.target(caller, params, 'destroy').worker);
|
|
824
818
|
}
|
|
825
819
|
/** Existing human HTTP authority, bound to its resolved project; never mint a pretend agent caller. */
|
|
826
820
|
async destroyForHuman(projectId, workerId) {
|
|
@@ -834,7 +828,7 @@ export class DelegationService {
|
|
|
834
828
|
return worker;
|
|
835
829
|
};
|
|
836
830
|
check();
|
|
837
|
-
return this.
|
|
831
|
+
return this.cleanups.get(project.id).request(workerId, check);
|
|
838
832
|
}
|
|
839
833
|
}
|
|
840
834
|
/** No agent session was recorded, so a resume starts a fresh one (hearsay-tools/squawk#3337). */
|