@hearsay-tools/squawk 0.18.0-pr4351.8508 → 0.18.0-pr4352.8504

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.
Files changed (68) hide show
  1. package/dist/ci-wait/controller.d.ts +7 -7
  2. package/dist/delegation/provision.d.ts +2 -1
  3. package/dist/delegation/provision.js +45 -26
  4. package/dist/delegation/provision.js.map +1 -1
  5. package/dist/delegation/routes.d.ts +65 -65
  6. package/dist/runners/antigravity/acp/events.d.ts +9 -1
  7. package/dist/runners/antigravity/acp/events.js +52 -11
  8. package/dist/runners/antigravity/acp/events.js.map +1 -1
  9. package/dist/runners/antigravity/acp/protocol.d.ts +12 -1
  10. package/dist/runners/antigravity/acp/protocol.js.map +1 -1
  11. package/dist/runners/antigravity/acp/session.d.ts +3 -0
  12. package/dist/runners/antigravity/acp/session.js +9 -0
  13. package/dist/runners/antigravity/acp/session.js.map +1 -1
  14. package/dist/runners/antigravity/antigravity-runner.d.ts +2 -2
  15. package/dist/runners/antigravity/antigravity-session.d.ts +4 -4
  16. package/dist/runners/antigravity/antigravity-session.js +48 -20
  17. package/dist/runners/antigravity/antigravity-session.js.map +1 -1
  18. package/dist/runners/antigravity/antigravity-ui-mapper.d.ts +2 -0
  19. package/dist/runners/antigravity/antigravity-ui-mapper.js +11 -3
  20. package/dist/runners/antigravity/antigravity-ui-mapper.js.map +1 -1
  21. package/dist/runners/antigravity/facts.d.ts +2 -2
  22. package/dist/runners/antigravity/facts.js +7 -5
  23. package/dist/runners/antigravity/facts.js.map +1 -1
  24. package/dist/runners/antigravity/mock.d.ts +4 -2
  25. package/dist/runners/antigravity/mock.js +3 -2
  26. package/dist/runners/antigravity/mock.js.map +1 -1
  27. package/dist/runners/antigravity/spec-support.js +1 -1
  28. package/dist/runners/antigravity/spec-support.js.map +1 -1
  29. package/dist/runners/antigravity/subagent-tracker.d.ts +50 -0
  30. package/dist/runners/antigravity/subagent-tracker.js +152 -0
  31. package/dist/runners/antigravity/subagent-tracker.js.map +1 -0
  32. package/dist/runners/antigravity/subagent-transcript.d.ts +41 -0
  33. package/dist/runners/antigravity/subagent-transcript.js +185 -0
  34. package/dist/runners/antigravity/subagent-transcript.js.map +1 -0
  35. package/dist/runners/antigravity/tool-normalization.d.ts +2 -0
  36. package/dist/runners/antigravity/tool-normalization.js +44 -2
  37. package/dist/runners/antigravity/tool-normalization.js.map +1 -1
  38. package/dist/runners/antigravity/tool-transcript.d.ts +24 -50
  39. package/dist/runners/antigravity/tool-transcript.js +88 -192
  40. package/dist/runners/antigravity/tool-transcript.js.map +1 -1
  41. package/dist/runners/antigravity/transcript-tailer.d.ts +56 -0
  42. package/dist/runners/antigravity/transcript-tailer.js +175 -0
  43. package/dist/runners/antigravity/transcript-tailer.js.map +1 -0
  44. package/dist/runners/antigravity/wire-updates.d.ts +4 -6
  45. package/dist/runners/antigravity/wire-updates.js +25 -3
  46. package/dist/runners/antigravity/wire-updates.js.map +1 -1
  47. package/dist/server/automations-routes.d.ts +150 -150
  48. package/dist/server/project-settings-routes.d.ts +107 -107
  49. package/dist/server/projects-routes.d.ts +45 -45
  50. package/dist/server/runner-install-routes.d.ts +10 -10
  51. package/dist/server/runners-routes.d.ts +10 -10
  52. package/dist/workflows/run/continuation-session.js +1 -1
  53. package/dist/workflows/run/continuation-session.js.map +1 -1
  54. package/dist/workflows/run/launch-context.d.ts +1 -1
  55. package/dist/workflows/run/launch-context.js +2 -2
  56. package/dist/workflows/run/launch-context.js.map +1 -1
  57. package/dist/workflows/run/session-events.d.ts +2 -2
  58. package/dist/workflows/run/session-events.js +2 -2
  59. package/dist/workflows/run/session-events.js.map +1 -1
  60. package/dist/workflows/run/step-session.js +1 -1
  61. package/dist/workflows/run/step-session.js.map +1 -1
  62. package/dist/workflows/run-states.js +1 -1
  63. package/dist/workflows/run-states.js.map +1 -1
  64. package/package.json +4 -4
  65. package/scripts/mock-acp.mjs +128 -15
  66. package/dist/runners/antigravity/subagent-guard.d.ts +0 -17
  67. package/dist/runners/antigravity/subagent-guard.js +0 -38
  68. package/dist/runners/antigravity/subagent-guard.js.map +0 -1
@@ -121,9 +121,12 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
121
121
  } & {
122
122
  "/api/v1/tools/:name": {
123
123
  $post: {
124
- output: never;
124
+ output: {
125
+ code: string;
126
+ message: string;
127
+ };
125
128
  outputFormat: "json";
126
- status: import("hono/utils/http-status").ContentfulStatusCode;
129
+ status: 401;
127
130
  input: {
128
131
  json: unknown;
129
132
  } & {
@@ -146,12 +149,9 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
146
149
  };
147
150
  };
148
151
  } | {
149
- output: {
150
- code: string;
151
- message: string;
152
- };
152
+ output: never;
153
153
  outputFormat: "json";
154
- status: 401;
154
+ status: import("hono/utils/http-status").ContentfulStatusCode;
155
155
  input: {
156
156
  json: unknown;
157
157
  } & {
@@ -8,7 +8,7 @@ export type DelegationSession = {
8
8
  instructions: string;
9
9
  revoke(): void;
10
10
  };
11
- export type DelegationProvisioner = (runId: string) => DelegationSession | undefined;
11
+ export type DelegationProvisioner = (runId: string, runner?: string) => DelegationSession | undefined;
12
12
  export declare function bundledWorkerInvocation(command?: 'worker' | 'discover' | 'message'): string;
13
13
  export declare function provisionDelegationSession(options: {
14
14
  projectId: string;
@@ -16,6 +16,7 @@ export declare function provisionDelegationSession(options: {
16
16
  store: RunStore;
17
17
  credentials: CredentialRegistry;
18
18
  url: string;
19
+ runner?: string;
19
20
  }): DelegationSession | undefined;
20
21
  /** Owns one invisible loopback listener in this controller, for cockpit AND headless use. */
21
22
  export declare class DelegationController {
@@ -1,6 +1,7 @@
1
1
  import { commandText } from '../home/command.js';
2
2
  import { productEnvEntries } from '../core/product-env.js';
3
- import { knownRunnerIds } from '../core/runner-registry.js';
3
+ import { RUNNER_FACTS } from '../core/runner-facts.js';
4
+ import { isRegisteredRunner, knownRunnerIds, runnersSealed } from '../core/runner-registry.js';
4
5
  import { randomUUID } from 'node:crypto';
5
6
  import { fileURLToPath } from 'node:url';
6
7
  import { CredentialRegistry } from './credentials.js';
@@ -20,6 +21,37 @@ export function bundledWorkerInvocation(command = 'worker') {
20
21
  const entry = fileURLToPath(new URL(source ? '../index.ts' : '../index.js', import.meta.url));
21
22
  return [process.execPath, ...(source ? ['--import', import.meta.resolve('tsx')] : []), entry].map(quote).join(' ') + ` ${command}`;
22
23
  }
24
+ function nativeSubagentsEnabled(runner) {
25
+ if (!runner || !runnersSealed() || !isRegisteredRunner(runner))
26
+ return true;
27
+ return RUNNER_FACTS[runner]?.nativeSubagents !== 'none';
28
+ }
29
+ function nativeSubagentCopy(allow, messaging) {
30
+ const only = allow
31
+ ? `You may use native subagents and message them with your runner's tools. No agent channel to another task exists: tell the user instead.`
32
+ : `No agent channel to another task exists: tell the user instead.`;
33
+ const channel = [
34
+ ...(allow ? [`You may message your own native subagents with your runner's tools.`] : []),
35
+ `Reach another Squawk task only through ${messaging}; never use your runner's native tools for that.`,
36
+ ].join(' ');
37
+ return { only, channel };
38
+ }
39
+ function workerSessionInstructions(run, invocation, conversationGuidance, allowNativeSubagents, subagentMessaging) {
40
+ const notice = run.delegation?.role === 'worker' ? workspaceKind(run.delegation.workspace).workerNotice : undefined;
41
+ return [
42
+ `You are an owned Squawk worker. Your parent run ID is ${supervisorIdOf(run)}.`,
43
+ ...(notice ? [notice] : []),
44
+ conversationGuidance,
45
+ `${maySpawn(run) ? `You may start one shared-workspace Squawk worker at a time; destroy it before you start the next. Run ${invocation} spawn --help first.` : `You cannot spawn Squawk workers.`} You cannot control peers, merge automatically, or accept your own review.`,
46
+ commandText(supervisedByFamilyRecord(run)
47
+ ? `Follow your assigned task and selected input context. Ask your parent with cez message request; any question you raise goes to your parent too, never to a human. Your parent answers or asks the human itself; do not wait for a human.`
48
+ : `Follow your assigned task and selected input context. Send every question to your parent as a request with cez message request and wait for its reply: no question card reaches your parent or a human. Do not wait for a human.`),
49
+ ...(allowNativeSubagents ? [`You may use native subagents for research, code reading and focused analysis.`] : []),
50
+ subagentMessaging,
51
+ `Commit reviewed work before your parent deliberately integrates it; report the summary, commits, tests and remaining concerns.`,
52
+ `When you park before finishing while your parent waits on you, Squawk tells your parent what you wait on and quotes your last message: end such a turn by saying what you wait on and what you have done.`,
53
+ ].join(' ');
54
+ }
23
55
  export function provisionDelegationSession(options) {
24
56
  delegationEndpoint(options.url);
25
57
  const run = options.store.getRun(options.runId);
@@ -27,6 +59,7 @@ export function provisionDelegationSession(options) {
27
59
  return;
28
60
  const invocation = bundledWorkerInvocation();
29
61
  const messaging = bundledWorkerInvocation('message');
62
+ const allowNativeSubagents = nativeSubagentsEnabled(options.runner ?? run.runner);
30
63
  const conversationGuidance = [
31
64
  `For task conversations, use ${messaging}. Root tasks can message peer root tasks in the same project and their owned workers; a worker may address only its parent and a worker it started. Use ${messaging} tasks [--all] [--offset <n>] to discover peers (32 per page); workers cannot list peers. Peer review/terminal tasks need their human to continue them; messages never resume a peer.`,
32
65
  `Use ${messaging} request <recipient-run-id> '<text>' --id <message-UUID> to request an explicit reply; use ${messaging} progress <recipient-run-id> '<text>' --id <message-UUID> for an update without an obligation.`,
@@ -45,12 +78,8 @@ export function provisionDelegationSession(options) {
45
78
  `Controller persistence prevents duplicate queue entries; a crash between provider acceptance and its delivery checkpoint can still make delivery ambiguous.`,
46
79
  `Credentials stay in the environment: never read, echo, forward, or persist them.`,
47
80
  ].join(' ');
48
- // hearsay-tools/cezarion#2279: native subagents are allowed; tasks talk only through cez message.
49
- const subagentOnly = `You may use native subagents and message them with your runner's tools. No agent channel to another task exists: tell the user instead.`;
50
- const subagentMessaging = [
51
- `You may message your own native subagents with your runner's tools.`,
52
- `Reach another Squawk task only through ${messaging}; never use your runner's native tools for that.`,
53
- ].join(' ');
81
+ // hearsay-tools/cezarion#2279: native subagents are allowed where the runner supports them; tasks talk only through cez message.
82
+ const { only: subagentOnly, channel: subagentMessaging } = nativeSubagentCopy(allowNativeSubagents, messaging);
54
83
  /** What the task may do only to workers it started itself: both the workers-on and the workers-off prompt say it. */
55
84
  const ownWorkersOnly = 'Message, steer and diff apply to workers you started yourself; a worker that one of your workers started is reached through that worker.';
56
85
  const worker = run.delegation?.role === 'worker';
@@ -73,11 +102,13 @@ export function provisionDelegationSession(options) {
73
102
  options.store.commitDelegation([{ id: run.id, delegation: rootDelegation() }]);
74
103
  const messagingOff = messagingOn ? [] : [`Task messaging is off for this task: you cannot list, message or wait on peer tasks; a human can turn it on in the task menu. Messages with your own workers, and replies to peer requests accepted earlier, still work.`];
75
104
  const rootInstructions = () => workersOn ? [
76
- `Use native subagents for work that needs no separate worktree: research, code reading and focused analysis.`,
77
- `For example, a subagent reads the parser and summarizes how it handles errors.`,
105
+ ...(allowNativeSubagents ? [
106
+ `Use native subagents for work that needs no separate worktree: research, code reading and focused analysis.`,
107
+ `For example, a subagent reads the parser and summarizes how it handles errors.`,
108
+ ] : []),
78
109
  `Use Squawk workers for work that needs its own worktree, its own commits or a lifecycle Squawk tracks.`,
79
110
  `Also use a Squawk worker when the task needs a model available only through another runner, even if the work is research or analysis.`,
80
- `Native subagents need no Squawk worker, worktree, collection or destruction.`,
111
+ ...(allowNativeSubagents ? [`Native subagents need no Squawk worker, worktree, collection or destruction.`] : []),
81
112
  subagentMessaging,
82
113
  `Owned workers are available through the bundled command ${invocation}.`,
83
114
  `Commands return JSON.`,
@@ -127,7 +158,7 @@ export function provisionDelegationSession(options) {
127
158
  `A worker may start one shared-workspace worker of its own at a time. ${ownWorkersOnly} Workers cannot message peers.`,
128
159
  `This is cooperative local supervision, not process isolation.`,
129
160
  ] : [
130
- `Use native subagents for research, code reading and focused analysis.`,
161
+ ...(allowNativeSubagents ? [`Use native subagents for research, code reading and focused analysis.`] : []),
131
162
  subagentMessaging,
132
163
  WORKERS_OFF,
133
164
  ...(owned ? [`You still manage the workers you own with ${invocation} list, inspect, collect, steer, stop, destroy, diff and wait. ${ownWorkersOnly} Collect the latest settled revision of every worker before completing.`] : []),
@@ -141,19 +172,7 @@ export function provisionDelegationSession(options) {
141
172
  restrictCrossSessionMessaging: true,
142
173
  env: { ...productEnvEntries('DELEGATION_URL', options.url), ...productEnvEntries('DELEGATION_TOKEN', token) },
143
174
  instructions: run.delegation?.role === 'worker'
144
- ? [
145
- `You are an owned Squawk worker. Your parent run ID is ${supervisorIdOf(run)}.`,
146
- ...(workspaceKind(run.delegation.workspace).workerNotice ? [workspaceKind(run.delegation.workspace).workerNotice] : []),
147
- conversationGuidance,
148
- `${maySpawn(run) ? `You may start one shared-workspace Squawk worker at a time; destroy it before you start the next. Run ${invocation} spawn --help first.` : `You cannot spawn Squawk workers.`} You cannot control peers, merge automatically, or accept your own review.`,
149
- commandText(supervisedByFamilyRecord(run)
150
- ? `Follow your assigned task and selected input context. Ask your parent with cez message request; any question you raise goes to your parent too, never to a human. Your parent answers or asks the human itself; do not wait for a human.`
151
- : `Follow your assigned task and selected input context. Send every question to your parent as a request with cez message request and wait for its reply: no question card reaches your parent or a human. Do not wait for a human.`),
152
- `You may use native subagents for research, code reading and focused analysis.`,
153
- subagentMessaging,
154
- `Commit reviewed work before your parent deliberately integrates it; report the summary, commits, tests and remaining concerns.`,
155
- `When you park before finishing while your parent waits on you, Squawk tells your parent what you wait on and quotes your last message: end such a turn by saying what you wait on and what you have done.`,
156
- ].join(' ')
175
+ ? workerSessionInstructions(run, invocation, conversationGuidance, allowNativeSubagents, subagentMessaging)
157
176
  : rootInstructions().join(' '),
158
177
  revoke: () => options.credentials.revoke(run.id, generation),
159
178
  };
@@ -191,11 +210,11 @@ export class DelegationController {
191
210
  return () => { };
192
211
  this.projects.get(project.id)?.detach();
193
212
  const unregister = this.service.registerProject(project);
194
- const clear = project.manager.setDelegationProvisioner(runId => {
213
+ const clear = project.manager.setDelegationProvisioner((runId, runner) => {
195
214
  if (this.closed || !this.transport)
196
215
  return;
197
216
  try {
198
- return provisionDelegationSession({ projectId: project.id, runId, store: project.store, credentials: this.credentials, url: this.transport.url });
217
+ return provisionDelegationSession({ projectId: project.id, runId, store: project.store, credentials: this.credentials, url: this.transport.url, ...(runner ? { runner } : {}) });
199
218
  }
200
219
  catch {
201
220
  this.credentials.revoke(runId);
@@ -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;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,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,EAAqD,MAAM,cAAc,CAAC;AACpH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC5F,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAI9C,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC;AACvE,MAAM,UAAU,uBAAuB,CAAC,OAAO,GAAsC,QAAQ;IAC3F,yFAAyF;IACzF,MAAM,MAAM,G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,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,18 +27,6 @@ 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
- } | {
42
30
  output: {
43
31
  workers: {
44
32
  workerId: string;
@@ -91,6 +79,18 @@ export declare function createDelegationRoutes(service: DelegationService, crede
91
79
  offset?: string | undefined;
92
80
  };
93
81
  };
82
+ } | {
83
+ output: {
84
+ error: string;
85
+ code?: "invalid_input" | undefined;
86
+ };
87
+ outputFormat: "json";
88
+ status: 400;
89
+ input: {
90
+ query: {
91
+ offset?: string | undefined;
92
+ };
93
+ };
94
94
  };
95
95
  };
96
96
  } & {
@@ -677,18 +677,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
677
677
  } & {
678
678
  "/:workerId": {
679
679
  $get: {
680
- output: {
681
- error: string;
682
- code?: "invalid_input" | undefined;
683
- };
684
- outputFormat: "json";
685
- status: 400;
686
- input: {
687
- param: {
688
- workerId: string;
689
- };
690
- };
691
- } | {
692
680
  output: {
693
681
  workerId: string;
694
682
  settled: boolean;
@@ -813,11 +801,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
813
801
  workerId: string;
814
802
  };
815
803
  };
816
- };
817
- };
818
- } & {
819
- "/:workerId/collect": {
820
- $post: {
804
+ } | {
821
805
  output: {
822
806
  error: string;
823
807
  code?: "invalid_input" | undefined;
@@ -828,10 +812,12 @@ export declare function createDelegationRoutes(service: DelegationService, crede
828
812
  param: {
829
813
  workerId: string;
830
814
  };
831
- } & {
832
- json: Record<string, never>;
833
815
  };
834
- } | {
816
+ };
817
+ };
818
+ } & {
819
+ "/:workerId/collect": {
820
+ $post: {
835
821
  output: {
836
822
  workerId: string;
837
823
  parentRunId: string;
@@ -954,11 +940,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
954
940
  } & {
955
941
  json: Record<string, never>;
956
942
  };
957
- };
958
- };
959
- } & {
960
- "/:workerId/steer": {
961
- $post: {
943
+ } | {
962
944
  output: {
963
945
  error: string;
964
946
  code?: "invalid_input" | undefined;
@@ -970,11 +952,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
970
952
  workerId: string;
971
953
  };
972
954
  } & {
973
- json: {
974
- text: string;
975
- };
955
+ json: Record<string, never>;
976
956
  };
977
- } | {
957
+ };
958
+ };
959
+ } & {
960
+ "/:workerId/steer": {
961
+ $post: {
978
962
  output: {
979
963
  workerId: string;
980
964
  state: "delivered" | "queued";
@@ -990,11 +974,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
990
974
  text: string;
991
975
  };
992
976
  };
993
- };
994
- };
995
- } & {
996
- "/:workerId/stop": {
997
- $post: {
977
+ } | {
998
978
  output: {
999
979
  error: string;
1000
980
  code?: "invalid_input" | undefined;
@@ -1006,9 +986,15 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1006
986
  workerId: string;
1007
987
  };
1008
988
  } & {
1009
- json: Record<string, never>;
989
+ json: {
990
+ text: string;
991
+ };
1010
992
  };
1011
- } | {
993
+ };
994
+ };
995
+ } & {
996
+ "/:workerId/stop": {
997
+ $post: {
1012
998
  output: {
1013
999
  workerId: string;
1014
1000
  state: "stopping" | "terminated";
@@ -1022,11 +1008,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1022
1008
  } & {
1023
1009
  json: Record<string, never>;
1024
1010
  };
1025
- };
1026
- };
1027
- } & {
1028
- "/:workerId/destroy": {
1029
- $post: {
1011
+ } | {
1030
1012
  output: {
1031
1013
  error: string;
1032
1014
  code?: "invalid_input" | undefined;
@@ -1038,11 +1020,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1038
1020
  workerId: string;
1039
1021
  };
1040
1022
  } & {
1041
- json: {
1042
- discardWork?: true | undefined;
1043
- };
1023
+ json: Record<string, never>;
1044
1024
  };
1045
- } | {
1025
+ };
1026
+ };
1027
+ } & {
1028
+ "/:workerId/destroy": {
1029
+ $post: {
1046
1030
  output: {
1047
1031
  workerId: string;
1048
1032
  state: "complete" | "incomplete";
@@ -1071,6 +1055,22 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1071
1055
  discardWork?: true | undefined;
1072
1056
  };
1073
1057
  };
1058
+ } | {
1059
+ output: {
1060
+ error: string;
1061
+ code?: "invalid_input" | undefined;
1062
+ };
1063
+ outputFormat: "json";
1064
+ status: 400;
1065
+ input: {
1066
+ param: {
1067
+ workerId: string;
1068
+ };
1069
+ } & {
1070
+ json: {
1071
+ discardWork?: true | undefined;
1072
+ };
1073
+ };
1074
1074
  } | {
1075
1075
  output: {
1076
1076
  workerId: string;
@@ -1106,11 +1106,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1106
1106
  "/:workerId/diff": {
1107
1107
  $get: {
1108
1108
  output: {
1109
- error: string;
1110
- code?: "invalid_input" | undefined;
1109
+ workerId: string;
1110
+ baselineSha: string;
1111
+ diff: string;
1112
+ truncated: boolean;
1111
1113
  };
1112
1114
  outputFormat: "json";
1113
- status: 400;
1115
+ status: 200;
1114
1116
  input: {
1115
1117
  param: {
1116
1118
  workerId: string;
@@ -1118,13 +1120,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1118
1120
  };
1119
1121
  } | {
1120
1122
  output: {
1121
- workerId: string;
1122
- baselineSha: string;
1123
- diff: string;
1124
- truncated: boolean;
1123
+ error: string;
1124
+ code?: "invalid_input" | undefined;
1125
1125
  };
1126
1126
  outputFormat: "json";
1127
- status: 200;
1127
+ status: 400;
1128
1128
  input: {
1129
1129
  param: {
1130
1130
  workerId: string;
@@ -30,13 +30,19 @@ export declare class AcpEvents {
30
30
  /** The open turn was started by the agent and no prompt carries it. */
31
31
  get agentTurn(): boolean;
32
32
  finish(stopReason: StopReason, usage?: TokenUsage): void;
33
+ /** Updates a held tool item's output while running, or amends a settled non-declined tool with `late: true`. */
34
+ updateHeldTool(id: string, output: string): void;
35
+ /** Completes a tool item that `holdToolCompletion` kept open past its wire response. */
36
+ completeHeldTool(id: string, status: 'completed' | 'failed' | 'declined', output?: string): void;
37
+ /** Assigns or repairs `parentItemId` on matching tool items once their parent is known. */
38
+ reparentTools(match: (id: string) => boolean, parentItemId: string): void;
33
39
  /** True when the update was the agent's own work inside a turn. */
34
40
  update(update: Record<string, unknown>): boolean;
35
41
  /** A late update for a tool already closed (a failed call the agent reports after cancel). */
36
42
  private closedTool;
37
43
  notice(message: string): void;
38
44
  /** A mapper can fold one frame without mutating its caller's state. */
39
- fork(sink: AcpEventSink): AcpEvents;
45
+ fork(sink: AcpEventSink, hooks?: AcpHooks): AcpEvents;
40
46
  private mapUpdate;
41
47
  private content;
42
48
  private plan;
@@ -50,5 +56,7 @@ export declare class AcpEvents {
50
56
  private finishTools;
51
57
  private usage;
52
58
  private tool;
59
+ private resolveToolItem;
60
+ private emitToolTransition;
53
61
  private toolImages;
54
62
  }
@@ -59,6 +59,8 @@ export class AcpEvents {
59
59
  const reason = this.failure ? 'error' : stopReason;
60
60
  if (this.failure)
61
61
  this.sink.event?.({ type: 'error', message: this.failure });
62
+ for (const settled of this.hooks.settleOnTurnEnd?.(reason) ?? [])
63
+ this.completeHeldTool(settled.id, settled.status, settled.output);
62
64
  this.finishTools(reason);
63
65
  // A turn-end listener sees the turn closed: it may start the next one or close the session.
64
66
  const turnId = this.turnId;
@@ -68,6 +70,37 @@ export class AcpEvents {
68
70
  this.sink.uiEvent?.({ type: 'turn.completed', turnId, stopReason: reason, ...(usage ? { usage } : {}) });
69
71
  this.sink.event?.({ type: 'turn-end' });
70
72
  }
73
+ /** Updates a held tool item's output while running, or amends a settled non-declined tool with `late: true`. */
74
+ updateHeldTool(id, output) {
75
+ const tool = this.tools.get(id);
76
+ if (!tool || tool.status === 'declined')
77
+ return;
78
+ const terminal = tool.status === 'completed' || tool.status === 'failed';
79
+ const item = { ...tool, output };
80
+ this.tools.set(id, item);
81
+ this.sink.uiEvent?.({ type: 'item.updated', item, ...(terminal ? { late: true } : {}) });
82
+ }
83
+ /** Completes a tool item that `holdToolCompletion` kept open past its wire response. */
84
+ completeHeldTool(id, status, output) {
85
+ const tool = this.tools.get(id);
86
+ if (!tool || tool.status === 'completed' || tool.status === 'failed' || tool.status === 'declined')
87
+ return;
88
+ const resolvedOutput = output ?? tool.output;
89
+ const item = { ...tool, status, ...(resolvedOutput ? { output: resolvedOutput } : {}) };
90
+ this.tools.set(id, item);
91
+ this.sink.event?.({ type: 'tool-result', toolCallId: id, result: item.output ?? '', isError: status === 'failed' });
92
+ this.sink.uiEvent?.({ type: 'item.completed', item });
93
+ }
94
+ /** Assigns or repairs `parentItemId` on matching tool items once their parent is known. */
95
+ reparentTools(match, parentItemId) {
96
+ for (const [id, tool] of this.tools) {
97
+ if (!match(id) || tool.parentItemId === parentItemId)
98
+ continue;
99
+ const item = { ...tool, parentItemId };
100
+ this.tools.set(id, item);
101
+ this.sink.uiEvent?.({ type: 'item.updated', item, late: true });
102
+ }
103
+ }
71
104
  /** True when the update was the agent's own work inside a turn. */
72
105
  update(update) {
73
106
  try {
@@ -99,15 +132,15 @@ export class AcpEvents {
99
132
  if (update.sessionUpdate !== 'tool_call' && update.sessionUpdate !== 'tool_call_update')
100
133
  return false;
101
134
  const status = this.tools.get(String(update.toolCallId))?.status;
102
- return status === 'completed' || status === 'failed';
135
+ return status === 'completed' || status === 'failed' || status === 'declined';
103
136
  }
104
137
  notice(message) {
105
138
  this.sink.event?.({ type: 'note', message });
106
139
  this.sink.uiEvent?.({ type: 'session.error', message, fatal: false });
107
140
  }
108
141
  /** A mapper can fold one frame without mutating its caller's state. */
109
- fork(sink) {
110
- const next = new AcpEvents(sink, this.hooks);
142
+ fork(sink, hooks = this.hooks) {
143
+ const next = new AcpEvents(sink, hooks);
111
144
  next.serial = this.serial;
112
145
  next.turnId = this.turnId;
113
146
  next.agentStarted = this.agentStarted;
@@ -205,7 +238,7 @@ export class AcpEvents {
205
238
  if (this.hooks.agentWorkEnds && reason !== 'cancelled' && reason !== 'error')
206
239
  return;
207
240
  for (const [id, tool] of this.tools) {
208
- if (tool.status === 'completed' || tool.status === 'failed')
241
+ if (tool.status === 'completed' || tool.status === 'failed' || tool.status === 'declined')
209
242
  continue;
210
243
  const item = { ...tool, status: 'failed', output: tool.output || (reason === 'cancelled' ? 'Cancelled' : 'Turn ended before the tool completed') };
211
244
  this.tools.set(id, item);
@@ -231,22 +264,30 @@ export class AcpEvents {
231
264
  if (wire.kind !== update.kind || wire.status !== update.status)
232
265
  this.notice('ACP normalized unknown tool metadata');
233
266
  const previous = this.tools.get(wire.toolCallId);
234
- const item = { ...toolItem(wire, previous),
235
- ...this.hooks.normalizeTool?.(update, previous),
236
- };
267
+ const item = this.resolveToolItem(update, wire, previous);
237
268
  this.tools.set(item.id, item);
238
- if (!previous)
269
+ this.emitToolTransition(previous, item);
270
+ for (const settled of this.hooks.afterToolUpdate?.(update, item) ?? [])
271
+ this.completeHeldTool(settled.id, settled.status, settled.output);
272
+ this.toolImages(wire, item.id);
273
+ }
274
+ resolveToolItem(update, wire, previous) {
275
+ const normalized = { ...toolItem(wire, previous), ...this.hooks.normalizeTool?.(update, previous) };
276
+ const wireComplete = normalized.status === 'completed' || normalized.status === 'failed';
277
+ return wireComplete && this.hooks.holdToolCompletion?.(update, normalized) === true ? { ...normalized, status: 'running' } : normalized;
278
+ }
279
+ emitToolTransition(previous, item) {
280
+ if (!previous) {
239
281
  this.sink.event?.({ type: 'tool-call', id: item.id, tool: item.name, input: item.input });
240
- const complete = item.status === 'completed' || item.status === 'failed';
241
- if (!previous)
242
282
  this.sink.uiEvent?.({ type: 'item.started', item: { ...item } });
283
+ }
284
+ const complete = item.status === 'completed' || item.status === 'failed';
243
285
  if (complete && previous?.status !== item.status) {
244
286
  this.sink.event?.({ type: 'tool-result', toolCallId: item.id, result: item.output ?? '', isError: item.status === 'failed' });
245
287
  this.sink.uiEvent?.({ type: 'item.completed', item: { ...item } });
246
288
  }
247
289
  else if (previous)
248
290
  this.sink.uiEvent?.({ type: 'item.updated', item: { ...item } });
249
- this.toolImages(wire, item.id);
250
291
  }
251
292
  toolImages(wire, itemId) {
252
293
  for (const entry of wire.content ?? []) {