@hearsay-tools/squawk 0.18.0-pr4101.7848 → 0.18.0-pr4102.7855

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 (42) hide show
  1. package/dist/ci-wait/controller.d.ts +4 -4
  2. package/dist/ci-wait/tools.d.ts +4 -4
  3. package/dist/core/runner-facts.d.ts +3 -2
  4. package/dist/core/runner-facts.js.map +1 -1
  5. package/dist/core/ui-events.d.ts +3 -0
  6. package/dist/core/usage-limit.d.ts +2 -1
  7. package/dist/core/usage-limit.js +15 -1
  8. package/dist/core/usage-limit.js.map +1 -1
  9. package/dist/delegation/routes.d.ts +81 -81
  10. package/dist/delegation/transport.d.ts +11 -11
  11. package/dist/runners/acp/events.d.ts +1 -1
  12. package/dist/runners/acp/events.js +6 -4
  13. package/dist/runners/acp/events.js.map +1 -1
  14. package/dist/runners/acp/protocol.d.ts +2 -1
  15. package/dist/runners/antigravity/antigravity-runner.d.ts +1 -1
  16. package/dist/runners/antigravity/antigravity-session.d.ts +12 -0
  17. package/dist/runners/antigravity/antigravity-session.js +65 -22
  18. package/dist/runners/antigravity/antigravity-session.js.map +1 -1
  19. package/dist/runners/antigravity/facts.d.ts +1 -1
  20. package/dist/runners/antigravity/facts.js +3 -1
  21. package/dist/runners/antigravity/facts.js.map +1 -1
  22. package/dist/runners/antigravity/mock.d.ts +2 -2
  23. package/dist/runners/antigravity/mock.js +2 -2
  24. package/dist/runners/antigravity/mock.js.map +1 -1
  25. package/dist/runners/antigravity/spec-support.js +1 -1
  26. package/dist/runners/antigravity/spec-support.js.map +1 -1
  27. package/dist/runners/antigravity/subagent-guard.d.ts +17 -0
  28. package/dist/runners/antigravity/subagent-guard.js +38 -0
  29. package/dist/runners/antigravity/subagent-guard.js.map +1 -0
  30. package/dist/runners/antigravity/tool-transcript.d.ts +98 -0
  31. package/dist/runners/antigravity/tool-transcript.js +313 -0
  32. package/dist/runners/antigravity/tool-transcript.js.map +1 -0
  33. package/dist/runners/antigravity/wire-updates.d.ts +2 -1
  34. package/dist/runners/antigravity/wire-updates.js +7 -4
  35. package/dist/runners/antigravity/wire-updates.js.map +1 -1
  36. package/dist/server/live-routes.d.ts +6 -6
  37. package/dist/server/server.d.ts +58 -58
  38. package/dist/workflows/run/turn-nudges.d.ts +11 -19
  39. package/dist/workflows/run/turn-nudges.js +4 -4
  40. package/dist/workflows/run/turn-nudges.js.map +1 -1
  41. package/package.json +4 -4
  42. package/scripts/mock-acp.mjs +33 -8
@@ -0,0 +1,313 @@
1
+ import { statSync } from 'node:fs';
2
+ import { open } from 'node:fs/promises';
3
+ import { join } from 'node:path';
4
+ import { StringDecoder } from 'node:string_decoder';
5
+ import { z } from 'zod';
6
+ import { ANTIGRAVITY_APP_DATA_DIR } from './launch-args.js';
7
+ /**
8
+ * The CLI 1.5.14 ACP wire sends no result for a read, an MCP call or a subagent tool: the completed
9
+ * update has no `content`, `rawOutput` or `_meta` (hearsay-tools/squawk#4099). The CLI's own
10
+ * transcript keeps what the agent received. It is a private format: every read is bounded, and a
11
+ * missing file or a changed format leaves the tool with no output (docs/runners/antigravity-wire.md).
12
+ */
13
+ export const TRANSCRIPT_OUTPUT_CHARS = 64 * 1024;
14
+ const READ_BYTES = 4 * 1024 * 1024;
15
+ const LINE_BYTES = 8 * 1024 * 1024;
16
+ const POLL_MS = 250;
17
+ /** How long after a tool completes the runner looks for its row. */
18
+ export const TRANSCRIPT_WAIT_MS = 10_000;
19
+ /** Rows that never hold a tool's result. */
20
+ const NOT_RESULTS = new Set(['PLANNER_RESPONSE', 'USER_INPUT', 'SYSTEM_MESSAGE', 'CHECKPOINT']);
21
+ const HEADER = /^(?:Created|Completed) At: .*$/;
22
+ const rowSchema = z.object({
23
+ step_index: z.number().int().nonnegative(), type: z.string(), status: z.string().optional(),
24
+ content: z.string().optional(), error: z.string().optional(),
25
+ tool_calls: z.array(z.object({ name: z.string(), args: z.unknown().optional() })).optional(),
26
+ });
27
+ export function antigravityTranscriptPath(geminiDir, sessionId) {
28
+ return join(geminiDir, ANTIGRAVITY_APP_DATA_DIR, 'brain', sessionId, '.system_generated', 'logs', 'transcript_full.jsonl');
29
+ }
30
+ /** A JSON value with object keys sorted, so two equal argument objects compare equal as text. */
31
+ function canonical(value) {
32
+ if (Array.isArray(value))
33
+ return `[${value.map(canonical).join(',')}]`;
34
+ if (value && typeof value === 'object') {
35
+ return `{${Object.keys(value).sort().map(key => `${JSON.stringify(key)}:${canonical(value[key])}`).join(',')}}`;
36
+ }
37
+ return JSON.stringify(value ?? null);
38
+ }
39
+ /** The text the agent received, without the CLI's `Created At:`/`Completed At:` lines, bounded. */
40
+ export function transcriptResultText(row) {
41
+ const lines = (row.content ?? '').split('\n');
42
+ let first = 0;
43
+ while (first < lines.length && HEADER.test(lines[first]))
44
+ first++;
45
+ const text = lines.slice(first).join('\n') || (row.error ?? '');
46
+ return text.length > TRANSCRIPT_OUTPUT_CHARS ? `${text.slice(0, TRANSCRIPT_OUTPUT_CHARS)}\n… (output truncated by Squawk)` : text;
47
+ }
48
+ /** Result texts held at once; the oldest goes first. */
49
+ const HELD_RESULTS = 64;
50
+ /**
51
+ * Matches tool calls to their result rows. A planner row lists the step's calls with the same
52
+ * `name` and `args` the wire sends, and the k-th call's result is the row `step_index + 1 + k`.
53
+ * Each call takes its slot when it starts, so the n-th started call with a name and arguments gets
54
+ * the n-th planned one: neither the order calls complete in nor a call that stopped waiting moves
55
+ * another call's result. Only results a waiting call can still take are held.
56
+ */
57
+ export class AntigravityTranscript {
58
+ /** Per call key: planned result steps, and started calls, that have no partner yet. */
59
+ planned = new Map();
60
+ started = new Map();
61
+ steps = new Map();
62
+ dropped = new Set();
63
+ results = new Map();
64
+ /** A call started on the wire: it takes the next planned slot of its name and arguments. */
65
+ start(call) {
66
+ const key = callKey(call.name, call.args);
67
+ this.started.set(key, [...this.started.get(key) ?? [], call.id]);
68
+ this.pair(key);
69
+ }
70
+ /** The call no longer waits (it had wire output, or its wait ended): it keeps its slot and its
71
+ * result is thrown away. */
72
+ drop(id) {
73
+ const step = this.steps.get(id);
74
+ if (step === undefined) {
75
+ this.dropped.add(id);
76
+ return;
77
+ }
78
+ this.steps.delete(id);
79
+ this.results.delete(step);
80
+ }
81
+ addRow(value) {
82
+ const row = rowSchema.safeParse(value);
83
+ if (!row.success)
84
+ return;
85
+ const { step_index: step, type, tool_calls: calls } = row.data;
86
+ if (type === 'PLANNER_RESPONSE') {
87
+ calls?.forEach((call, index) => {
88
+ const key = callKey(call.name, call.args);
89
+ this.planned.set(key, [...this.planned.get(key) ?? [], step + 1 + index]);
90
+ this.pair(key);
91
+ });
92
+ }
93
+ else if (!NOT_RESULTS.has(type) && this.wanted(step))
94
+ this.hold(step, transcriptResultText(row.data));
95
+ }
96
+ /** The call's result text once its row is read; reading it consumes it. */
97
+ output(id) {
98
+ const step = this.steps.get(id);
99
+ const text = step === undefined ? undefined : this.results.get(step);
100
+ if (text === undefined)
101
+ return undefined;
102
+ this.steps.delete(id);
103
+ this.results.delete(step);
104
+ return text;
105
+ }
106
+ pair(key) {
107
+ const planned = this.planned.get(key) ?? [];
108
+ const started = this.started.get(key) ?? [];
109
+ while (planned.length && started.length) {
110
+ const step = planned.shift();
111
+ const id = started.shift();
112
+ if (this.dropped.delete(id))
113
+ this.results.delete(step);
114
+ else
115
+ this.steps.set(id, step);
116
+ }
117
+ for (const [map, list] of [[this.planned, planned], [this.started, started]]) {
118
+ if (list.length)
119
+ map.set(key, list);
120
+ else
121
+ map.delete(key);
122
+ }
123
+ }
124
+ /** A row a call holds, or one a started call has yet to pair with. */
125
+ wanted(step) {
126
+ for (const held of this.steps.values())
127
+ if (held === step)
128
+ return true;
129
+ for (const steps of this.planned.values())
130
+ if (steps.includes(step))
131
+ return true;
132
+ return false;
133
+ }
134
+ hold(step, text) {
135
+ this.results.set(step, text);
136
+ for (const old of this.results.keys()) {
137
+ if (this.results.size <= HELD_RESULTS)
138
+ break;
139
+ this.results.delete(old);
140
+ }
141
+ }
142
+ }
143
+ function callKey(name, args) { return `${name}\u0000${canonical(args ?? {})}`; }
144
+ const wireSchema = z.object({
145
+ sessionUpdate: z.enum(['tool_call', 'tool_call_update']), toolCallId: z.string(), name: z.string(),
146
+ args: z.unknown().optional(), rawInput: z.unknown().optional(),
147
+ });
148
+ const TERMINAL = new Set(['completed', 'failed']);
149
+ function wireCall(update) {
150
+ const parsed = wireSchema.safeParse(update);
151
+ if (!parsed.success)
152
+ return undefined;
153
+ return { id: parsed.data.toolCallId, name: parsed.data.name, args: parsed.data.args ?? parsed.data.rawInput };
154
+ }
155
+ /** A terminal tool update that carries no result: its output can come only from the transcript. */
156
+ export function transcriptCall(update) {
157
+ if (update.content != null || update.rawOutput != null || !TERMINAL.has(update.status))
158
+ return undefined;
159
+ return wireCall(update);
160
+ }
161
+ /**
162
+ * Reads the session's transcript while a completed tool waits for its output, and amends the tool
163
+ * card when the row appears. The row can land after the wire's completed update, so the read polls
164
+ * up to `TRANSCRIPT_WAIT_MS`. It reads only bytes appended since the session opened.
165
+ */
166
+ export class AntigravityToolOutputs {
167
+ amend;
168
+ now;
169
+ path;
170
+ offset = 0;
171
+ tail = '';
172
+ decoder = new StringDecoder('utf8');
173
+ skippingLine = false;
174
+ broken = false;
175
+ closed = false;
176
+ timer;
177
+ reading;
178
+ transcript = new AntigravityTranscript();
179
+ pending = new Map();
180
+ seen = new Set();
181
+ constructor(amend, now = Date.now) {
182
+ this.amend = amend;
183
+ this.now = now;
184
+ }
185
+ /** The session is open: read its transcript from its current end. */
186
+ open(path) {
187
+ this.path = path;
188
+ try {
189
+ this.offset = statSync(path).size;
190
+ }
191
+ catch {
192
+ this.offset = 0;
193
+ }
194
+ }
195
+ /** A wire update. A call takes its transcript slot when it first appears; a terminal update with
196
+ * no result starts the wait for its row, and one with a result gives the slot up. */
197
+ observe(update) {
198
+ if (this.closed || this.broken || !this.path)
199
+ return;
200
+ const call = wireCall(update);
201
+ if (!call)
202
+ return;
203
+ if (!this.seen.has(call.id)) {
204
+ this.seen.add(call.id);
205
+ this.transcript.start(call);
206
+ }
207
+ if (!TERMINAL.has(update.status))
208
+ return;
209
+ if (transcriptCall(update)) {
210
+ if (!this.pending.has(call.id))
211
+ this.pending.set(call.id, { call, deadline: this.now() + TRANSCRIPT_WAIT_MS });
212
+ }
213
+ else
214
+ this.transcript.drop(call.id);
215
+ }
216
+ /** The mapped tool item closed with no output: amend it once its row is read. */
217
+ completed(item) {
218
+ const pending = this.pending.get(item.id);
219
+ if (!pending)
220
+ return;
221
+ if (item.output) {
222
+ this.pending.delete(item.id);
223
+ return;
224
+ }
225
+ pending.item = item;
226
+ this.schedule(0);
227
+ }
228
+ close() { this.closed = true; clearTimeout(this.timer); this.pending.clear(); }
229
+ /** One read of appended rows, then amend what resolved. Tests call it directly. */
230
+ poll() {
231
+ this.reading ??= this.read().catch(() => { this.broken = true; this.pending.clear(); }).finally(() => { this.reading = undefined; });
232
+ return this.reading;
233
+ }
234
+ schedule(delay) {
235
+ if (this.closed || this.timer)
236
+ return;
237
+ this.timer = setTimeout(() => { this.timer = undefined; void this.poll().then(() => this.next()); }, delay);
238
+ this.timer.unref?.();
239
+ }
240
+ next() {
241
+ this.expire();
242
+ if ([...this.pending.values()].some(pending => pending.item))
243
+ this.schedule(POLL_MS);
244
+ }
245
+ expire() {
246
+ const now = this.now();
247
+ for (const [id, pending] of this.pending)
248
+ if (pending.deadline < now) {
249
+ this.pending.delete(id);
250
+ this.transcript.drop(id);
251
+ }
252
+ }
253
+ async read() {
254
+ if (this.closed || this.broken || !this.path)
255
+ return;
256
+ this.expire();
257
+ await this.readAppended(this.path);
258
+ for (const [id, pending] of this.pending) {
259
+ if (!pending.item)
260
+ continue;
261
+ const output = this.transcript.output(id);
262
+ if (output === undefined)
263
+ continue;
264
+ this.pending.delete(id);
265
+ if (output && !this.closed)
266
+ this.amend({ ...pending.item, output });
267
+ }
268
+ }
269
+ async readAppended(path) {
270
+ let file;
271
+ try {
272
+ file = await open(path, 'r');
273
+ }
274
+ catch {
275
+ return;
276
+ }
277
+ try {
278
+ const { size } = await file.stat();
279
+ if (size <= this.offset)
280
+ return;
281
+ const length = Math.min(size - this.offset, READ_BYTES);
282
+ const buffer = Buffer.alloc(length);
283
+ const { bytesRead } = await file.read(buffer, 0, length, this.offset);
284
+ this.offset += bytesRead;
285
+ this.lines(this.decoder.write(buffer.subarray(0, bytesRead)));
286
+ }
287
+ finally {
288
+ await file.close();
289
+ }
290
+ }
291
+ lines(chunk) {
292
+ const lines = (this.tail + chunk).split('\n');
293
+ this.tail = lines.pop() ?? '';
294
+ for (const line of lines) {
295
+ if (this.skippingLine) {
296
+ this.skippingLine = false;
297
+ continue;
298
+ }
299
+ if (!line.trim())
300
+ continue;
301
+ try {
302
+ this.transcript.addRow(JSON.parse(line));
303
+ }
304
+ catch { /* A row the format no longer matches has no output. */ }
305
+ }
306
+ // A row past the bound is dropped; reading resumes at the next line.
307
+ if (this.tail.length > LINE_BYTES) {
308
+ this.tail = '';
309
+ this.skippingLine = true;
310
+ }
311
+ }
312
+ }
313
+ //# sourceMappingURL=tool-transcript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-transcript.js","sourceRoot":"","sources":["../../../src/runners/antigravity/tool-transcript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,GAAG,IAAI,CAAC;AACjD,MAAM,UAAU,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AACnC,MAAM,UAAU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I,CAAC,IAAI,GAAG,EAAE,CAAC;YAAC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QAAC,CAAC;IAClF,CAAC;CACF"}
@@ -1,5 +1,6 @@
1
1
  import { antigravityTool } from './tool-normalization.ts';
2
- /** The CLI reports a provider failure as message text, then end_turn (cli-config-options.ndjson). */
2
+ /** A chunk in the CLI's provider-failure shape. The turn fails only when this chunk is the whole
3
+ * agent message and no other agent work follows it before the turn ends (AcpEvents). */
3
4
  export declare function antigravityUpdateError(update: Record<string, unknown>): string | undefined;
4
5
  /**
5
6
  * Work after the turn (a background command or timer woke the idle session) has no end frame. A
@@ -1,14 +1,17 @@
1
1
  import { z } from 'zod';
2
2
  import { antigravityTool } from './tool-normalization.js';
3
3
  const textSchema = z.object({ text: z.string() });
4
- const ERROR_PREFIX = '⚠ agent executor error:';
5
- /** The CLI reports a provider failure as message text, then end_turn (cli-config-options.ndjson). */
4
+ /** The CLI writes an agent failure as one message chunk, "\n⚠ <error>\n" (CLI 1.5.14 format string
5
+ * `\n⚠ %s\n`). The error may or may not start "agent executor error:" (cli-config-options.ndjson,
6
+ * cli-tool-output.ndjson, the 404 of hearsay-tools/squawk#4098). */
7
+ const ERROR_SHAPE = /^\n⚠ \S[^]*\n$/u;
8
+ /** A chunk in the CLI's provider-failure shape. The turn fails only when this chunk is the whole
9
+ * agent message and no other agent work follows it before the turn ends (AcpEvents). */
6
10
  export function antigravityUpdateError(update) {
7
11
  const content = textSchema.safeParse(update.content);
8
12
  if (update.sessionUpdate !== 'agent_message_chunk' || !content.success)
9
13
  return undefined;
10
- const text = content.data.text.trimStart();
11
- return text.startsWith(ERROR_PREFIX) ? text : undefined;
14
+ return ERROR_SHAPE.test(content.data.text) ? content.data.text.trim() : undefined;
12
15
  }
13
16
  /**
14
17
  * Work after the turn (a background command or timer woke the idle session) has no end frame. A
@@ -1 +1 @@
1
- {"version":3,"file":"wire-updates.js","sourceRoot":"","sources":["../../../src/runners/antigravity/wire-updates.ts"],"names":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CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAClD;;qEAEqE;AACrE,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAEtC;yFACyF;AACzF,MAAM,UAAU,sBAAsB,CAAC,MAA+B;IACpE,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACrD,IAAI,MAAM,CAAC,aAAa,KAAK,qBAAqB,IAAI,CAAC,OAAO,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IACzF,OAAO,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACpF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAA+B,EAAE,QAA4B;IAC/F,OAAO,MAAM,CAAC,aAAa,KAAK,cAAc,IAAI,QAAQ,KAAK,qBAAqB,CAAC;AACvF,CAAC;AAED,oGAAoG;AACpG,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,sBAAsB,EAAE,aAAa,EAAE,mBAAmB;CAC5E,CAAC"}
@@ -16,6 +16,12 @@ export declare function createLiveRoutes({ resolveProject, serverGeneration, res
16
16
  output: {
17
17
  generation: string;
18
18
  results: ({
19
+ projectId: string;
20
+ runId: string;
21
+ type: "error" | "reset";
22
+ status: 400 | 404 | 409 | 413 | 503;
23
+ error: string;
24
+ } | {
19
25
  projectId: string;
20
26
  runId: string;
21
27
  type: "batch";
@@ -29,12 +35,6 @@ export declare function createLiveRoutes({ resolveProject, serverGeneration, res
29
35
  cursor: string;
30
36
  afterSeq: number;
31
37
  hasMore: boolean;
32
- } | {
33
- projectId: string;
34
- runId: string;
35
- type: "error" | "reset";
36
- status: 400 | 404 | 409 | 413 | 503;
37
- error: string;
38
38
  })[];
39
39
  };
40
40
  outputFormat: "json";
@@ -4608,6 +4608,19 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
4608
4608
  } & {
4609
4609
  "/repo/commit/:sha": {
4610
4610
  $get: {
4611
+ output: string;
4612
+ outputFormat: "text";
4613
+ status: import("hono/utils/http-status").ContentfulStatusCode;
4614
+ input: {
4615
+ query: {
4616
+ structured?: string | undefined;
4617
+ };
4618
+ } & {
4619
+ param: {
4620
+ sha: string;
4621
+ };
4622
+ };
4623
+ } | {
4611
4624
  output: {
4612
4625
  error: string;
4613
4626
  code?: "invalid_input" | undefined;
@@ -4671,19 +4684,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
4671
4684
  sha: string;
4672
4685
  };
4673
4686
  };
4674
- } | {
4675
- output: string;
4676
- outputFormat: "text";
4677
- status: import("hono/utils/http-status").ContentfulStatusCode;
4678
- input: {
4679
- query: {
4680
- structured?: string | undefined;
4681
- };
4682
- } & {
4683
- param: {
4684
- sha: string;
4685
- };
4686
- };
4687
4687
  };
4688
4688
  };
4689
4689
  } & {
@@ -18485,20 +18485,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
18485
18485
  } & {
18486
18486
  "/runs/:id/handoff": {
18487
18487
  $get: {
18488
- output: {
18489
- error: string;
18490
- };
18491
- outputFormat: "json";
18492
- status: 404;
18488
+ output: string;
18489
+ outputFormat: "text";
18490
+ status: 200;
18493
18491
  input: {
18494
18492
  param: {
18495
18493
  id: string;
18496
18494
  };
18497
18495
  };
18498
18496
  } | {
18499
- output: string;
18500
- outputFormat: "text";
18501
- status: 200;
18497
+ output: {
18498
+ error: string;
18499
+ };
18500
+ outputFormat: "json";
18501
+ status: 404;
18502
18502
  input: {
18503
18503
  param: {
18504
18504
  id: string;
@@ -18536,20 +18536,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
18536
18536
  } & {
18537
18537
  "/runs/:id/diff": {
18538
18538
  $get: {
18539
- output: {
18540
- error: string;
18541
- };
18542
- outputFormat: "json";
18543
- status: 404 | 409;
18539
+ output: string;
18540
+ outputFormat: "text";
18541
+ status: import("hono/utils/http-status").ContentfulStatusCode;
18544
18542
  input: {
18545
18543
  param: {
18546
18544
  id: string;
18547
18545
  };
18548
18546
  };
18549
18547
  } | {
18550
- output: string;
18551
- outputFormat: "text";
18552
- status: import("hono/utils/http-status").ContentfulStatusCode;
18548
+ output: {
18549
+ error: string;
18550
+ };
18551
+ outputFormat: "json";
18552
+ status: 404 | 409;
18553
18553
  input: {
18554
18554
  param: {
18555
18555
  id: string;
@@ -20567,6 +20567,19 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
20567
20567
  } & {
20568
20568
  "/repo/commit/:sha": {
20569
20569
  $get: {
20570
+ output: string;
20571
+ outputFormat: "text";
20572
+ status: import("hono/utils/http-status").ContentfulStatusCode;
20573
+ input: {
20574
+ query: {
20575
+ structured?: string | undefined;
20576
+ };
20577
+ } & {
20578
+ param: {
20579
+ sha: string;
20580
+ };
20581
+ };
20582
+ } | {
20570
20583
  output: {
20571
20584
  error: string;
20572
20585
  code?: "invalid_input" | undefined;
@@ -20630,19 +20643,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
20630
20643
  sha: string;
20631
20644
  };
20632
20645
  };
20633
- } | {
20634
- output: string;
20635
- outputFormat: "text";
20636
- status: import("hono/utils/http-status").ContentfulStatusCode;
20637
- input: {
20638
- query: {
20639
- structured?: string | undefined;
20640
- };
20641
- } & {
20642
- param: {
20643
- sha: string;
20644
- };
20645
- };
20646
20646
  };
20647
20647
  };
20648
20648
  } & {
@@ -34444,20 +34444,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
34444
34444
  } & {
34445
34445
  "/runs/:id/handoff": {
34446
34446
  $get: {
34447
- output: {
34448
- error: string;
34449
- };
34450
- outputFormat: "json";
34451
- status: 404;
34447
+ output: string;
34448
+ outputFormat: "text";
34449
+ status: 200;
34452
34450
  input: {
34453
34451
  param: {
34454
34452
  id: string;
34455
34453
  };
34456
34454
  };
34457
34455
  } | {
34458
- output: string;
34459
- outputFormat: "text";
34460
- status: 200;
34456
+ output: {
34457
+ error: string;
34458
+ };
34459
+ outputFormat: "json";
34460
+ status: 404;
34461
34461
  input: {
34462
34462
  param: {
34463
34463
  id: string;
@@ -34495,20 +34495,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
34495
34495
  } & {
34496
34496
  "/runs/:id/diff": {
34497
34497
  $get: {
34498
- output: {
34499
- error: string;
34500
- };
34501
- outputFormat: "json";
34502
- status: 404 | 409;
34498
+ output: string;
34499
+ outputFormat: "text";
34500
+ status: import("hono/utils/http-status").ContentfulStatusCode;
34503
34501
  input: {
34504
34502
  param: {
34505
34503
  id: string;
34506
34504
  };
34507
34505
  };
34508
34506
  } | {
34509
- output: string;
34510
- outputFormat: "text";
34511
- status: import("hono/utils/http-status").ContentfulStatusCode;
34507
+ output: {
34508
+ error: string;
34509
+ };
34510
+ outputFormat: "json";
34511
+ status: 404 | 409;
34512
34512
  input: {
34513
34513
  param: {
34514
34514
  id: string;
@@ -26,6 +26,13 @@ export declare function nudgeAwaitsAnswer(state: ActiveRun, session: AgentSessio
26
26
  /** A run an autonomous nudge kept running: refused, submitted and never acknowledged, or
27
27
  * acknowledged and never answered. Its idle close settles it `waiting`. */
28
28
  export declare function nudgeHeldRunning(state: ActiveRun): boolean;
29
+ type NudgeEvent = {
30
+ type: string;
31
+ item?: {
32
+ parentItemId?: string;
33
+ };
34
+ late?: true;
35
+ };
29
36
  interface TurnNudgesHost {
30
37
  active: Map<string, ActiveRun>;
31
38
  move(id: string, exit: RunExitId, patch: Omit<RunPatchInput, 'status'>): RunRecord | undefined;
@@ -119,36 +126,21 @@ export declare class TurnNudges {
119
126
  /** Model work in the nudge's own session is its reply: its bounds stop while the turn runs. A turn
120
127
  * end that still finds the acknowledgement missing arms it again. Both event paths name the session
121
128
  * that emitted the event, so a retired session's late events stop nothing (hearsay-tools/squawk#2443). */
122
- noteNudgeActivity(runId: string, state: ActiveRun, emitting: AgentSession | undefined, event: {
123
- type: string;
124
- item?: {
125
- parentItemId?: string;
126
- };
127
- }): void;
129
+ noteNudgeActivity(runId: string, state: ActiveRun, emitting: AgentSession | undefined, event: NudgeEvent): void;
128
130
  /** The nudge a turn end with no wait or done gets: one automatic turn, charged to the
129
131
  * automatic-wake budget. The autonomous wording repeats; the no-wait one is sent once and is
130
132
  * bounded by its reply timer (#544's liveness). */
131
133
  sendTurnEndNudge(runId: string, state: ActiveRun, stepId: string | undefined, text: string): boolean;
132
- /** Heartbeats and nested subagent items are not a reply. A `turn.started` counts only while the
134
+ /** Heartbeats, nested subagent items and late display updates are not a reply. A `turn.started` counts only while the
133
135
  * reply timer runs or after it expired on this session: OpenCode emits a synthetic one
134
136
  * inside `sendAgentMessage`, and a later send goes through `submitAgentInput`, which resumes. */
135
- isNoWaitNudgeReply(state: ActiveRun, event: {
136
- type: string;
137
- item?: {
138
- parentItemId?: string;
139
- };
140
- }): boolean;
137
+ isNoWaitNudgeReply(state: ActiveRun, event: NudgeEvent): boolean;
141
138
  /** A reply to the nudge clears its bound. One that arrives after the bound parked the run resumes
142
139
  * it, as the final-message nudge's did (#544); its turn end then decides, and a run still on
143
140
  * Squawk's no-wait wait parks on it again. Only the live session's own events count: one `ActiveRun`
144
141
  * spans workflow steps, so a retired step's late reply must not clear the current bound
145
142
  * (hearsay-tools/squawk#3740). */
146
- noteNoWaitNudgeContent(runId: string, state: ActiveRun, emitting: AgentSession | undefined, event: {
147
- type: string;
148
- item?: {
149
- parentItemId?: string;
150
- };
151
- }): void;
143
+ noteNoWaitNudgeContent(runId: string, state: ActiveRun, emitting: AgentSession | undefined, event: NudgeEvent): void;
152
144
  /** A no-wait nudge the harness acknowledged but never answered (an OpenCode heartbeat keeps the
153
145
  * session alive without a turn): at the bound Squawk opens the no-wait human wait and the run
154
146
  * waits for the user. A reply that arrives after it runs, and the run stays on that question. */