@zvada/agent-server 0.3.28 → 0.3.30

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 (47) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/core/agents/acp/acp-agent.js +3 -1
  3. package/dist/core/agents/claude-code/claude-agent.js +2 -12
  4. package/dist/core/agents/claude-code/session.js +12 -8
  5. package/dist/core/agents/claude-code/turn.js +6 -2
  6. package/dist/core/agents/gemini/profile.js +2 -1
  7. package/dist/operator/operator.js +30 -16
  8. package/dist/operator/render.js +3 -5
  9. package/dist/protocol/config.js +4 -2
  10. package/dist/protocol/part-input.js +2 -6
  11. package/dist/protocol/text-parts.js +10 -0
  12. package/dist/types/core/agents/acp/acp-agent.d.ts.map +1 -1
  13. package/dist/types/core/agents/acp/profile.d.ts +6 -1
  14. package/dist/types/core/agents/acp/profile.d.ts.map +1 -1
  15. package/dist/types/core/agents/claude-code/claude-agent.d.ts +1 -2
  16. package/dist/types/core/agents/claude-code/claude-agent.d.ts.map +1 -1
  17. package/dist/types/core/agents/claude-code/options.d.ts +1 -1
  18. package/dist/types/core/agents/claude-code/options.d.ts.map +1 -1
  19. package/dist/types/core/agents/claude-code/session.d.ts +4 -6
  20. package/dist/types/core/agents/claude-code/session.d.ts.map +1 -1
  21. package/dist/types/core/agents/claude-code/turn.d.ts +3 -2
  22. package/dist/types/core/agents/claude-code/turn.d.ts.map +1 -1
  23. package/dist/types/core/agents/gemini/profile.d.ts.map +1 -1
  24. package/dist/types/operator/operator.d.ts.map +1 -1
  25. package/dist/types/operator/render.d.ts.map +1 -1
  26. package/dist/types/operator/types.d.ts +4 -4
  27. package/dist/types/protocol/config.d.ts +4 -2
  28. package/dist/types/protocol/config.d.ts.map +1 -1
  29. package/dist/types/protocol/part-input.d.ts.map +1 -1
  30. package/dist/types/protocol/text-parts.d.ts +10 -0
  31. package/dist/types/protocol/text-parts.d.ts.map +1 -0
  32. package/docs/consuming.md +2 -1
  33. package/docs/harnesses.md +14 -7
  34. package/package.json +1 -1
  35. package/src/core/agents/acp/acp-agent.ts +3 -1
  36. package/src/core/agents/acp/profile.ts +6 -0
  37. package/src/core/agents/claude-code/claude-agent.ts +2 -13
  38. package/src/core/agents/claude-code/options.ts +1 -1
  39. package/src/core/agents/claude-code/session.ts +12 -8
  40. package/src/core/agents/claude-code/turn.ts +7 -2
  41. package/src/core/agents/gemini/profile.ts +2 -1
  42. package/src/operator/operator.ts +27 -14
  43. package/src/operator/render.ts +3 -7
  44. package/src/operator/types.ts +4 -4
  45. package/src/protocol/config.ts +4 -2
  46. package/src/protocol/part-input.ts +2 -5
  47. package/src/protocol/text-parts.ts +10 -0
package/CHANGELOG.md CHANGED
@@ -7,6 +7,29 @@ and the measurements. Evidence lives in the LLP, not here. A release groups
7
7
  its bullets under Breaking, Added, Changed and Fixed, breaking first. The
8
8
  released sections below that predate this convention are kept as written.
9
9
 
10
+ ## 0.3.30
11
+
12
+ ### Fixed
13
+
14
+ - Dismissing a Claude tool or plan approval ends the turn `cancelled`. Steers Claude has not
15
+ read are returned in `turn.ended.undeliveredSteers` and never run later. Dismissing a question
16
+ still lets the turn continue (LLP 0001, D4 and D13).
17
+ - Operator `onError` receives unexpected write errors, including failed send attempts and
18
+ writes that reject after the call has answered. A write whose outcome is unknown still
19
+ answers `not confirmed` (LLP 0019, Errors).
20
+ - When workspace setup fails before its first task, `start_session` reports the host's
21
+ reason in its own answer (LLP 0019, One call, one message).
22
+ - Session reads and wait replies put a blank line between non-empty text parts (LLP 0019).
23
+
24
+ ## 0.3.29
25
+
26
+ ### Changed
27
+
28
+ - In `bypass_permissions`, Gemini runs outside Antigravity's terminal sandbox, as Claude and Codex do:
29
+ network, git in a worktree, writes outside the folder. A product that relied on that sandbox supplies
30
+ its own: in `default` an approved command is not sandboxed either, unless the person set
31
+ `enableTerminalSandbox`. A switch into or out of the mode restarts agy and resumes (LLP 0020).
32
+
10
33
  ## 0.3.28
11
34
 
12
35
  ### Changed
@@ -164,7 +164,9 @@ export class ProfiledAcpAgent extends SessionAgent {
164
164
  }
165
165
  async resolveSession(options, signal) {
166
166
  // A cancel ends the wait: the operator's resolution goes on for the next turn.
167
- const launch = await launchOf(this.profile, signal);
167
+ const base = await launchOf(this.profile, signal);
168
+ const modeArgs = this.profile.modeArgs?.[options.permissionMode ?? "default"];
169
+ const launch = modeArgs ? { ...base, args: [...(base.args ?? []), ...modeArgs] } : base;
168
170
  const host = await untilAborted(Promise.resolve(this.host?.lease(options.sessionId, options.cwd)), signal);
169
171
  if (host)
170
172
  refuseHostName(options.mcpServers, host.source.name);
@@ -10,11 +10,6 @@ import { ClaudeCliLogin } from "./login.js";
10
10
  import { claudeModelDescriptors, fitClaudeThinking, readClaudeModels } from "./models.js";
11
11
  import { claudeSessionConfig } from "./options.js";
12
12
  import { claudeSessionPool, } from "./session.js";
13
- /**
14
- * How long after a cancel a turn Claude has not ended has its process ended,
15
- * unless `cancelGraceMs` says otherwise (LLP 0001, D9).
16
- */
17
- const CANCEL_GRACE_MS = 10_000;
18
13
  const CAPABILITIES = {
19
14
  multiTurn: true,
20
15
  sessionResume: true,
@@ -95,12 +90,10 @@ export class ClaudeCodeAgent extends SessionAgent {
95
90
  login;
96
91
  pool;
97
92
  credentials;
98
- cancelGraceMs;
99
93
  host;
100
94
  constructor(agentOptions = {}) {
101
95
  super({ cancelConfirmMs: agentOptions.cancelConfirmMs });
102
96
  this.agentOptions = agentOptions;
103
- this.cancelGraceMs = agentOptions.cancelGraceMs ?? CANCEL_GRACE_MS;
104
97
  this.processes = agentOptions.processes ?? sharedNativeProcesses();
105
98
  this.host = hostToolSessions(agentOptions.hostTools, this.harness);
106
99
  this.pool = claudeSessionPool({ ...agentOptions, processes: this.processes, host: this.host });
@@ -193,10 +186,7 @@ export class ClaudeCodeAgent extends SessionAgent {
193
186
  await this.openSteering(options, (request) => session.steer(toClaudeContent(request.input), request.steerId)
194
187
  ? "steered"
195
188
  : "no_active_turn");
196
- removeInterrupt = onAbort(controller.signal, () => {
197
- void session.interruptTurn();
198
- void session.endUnstopped(turn, this.cancelGraceMs);
199
- });
189
+ removeInterrupt = onAbort(controller.signal, () => void session.cancelTurn(turn));
200
190
  const mcpServers = session.mcp.names;
201
191
  if (mcpServers.length)
202
192
  yield { type: "agentServer/mcpServers", names: mcpServers };
@@ -294,7 +284,7 @@ export class ClaudeCodeAgent extends SessionAgent {
294
284
  * before the SDK interrupt lands (the abort-order race that could surface
295
285
  * a clean user cancel as `error`/`end_turn`). The SDK interrupt's
296
286
  * round-trip confirms the cancel, and so does the turn's end, whoever ended
297
- * it: Claude, or the grace that ended its process (`endUnstopped`). An
287
+ * it: Claude, or the grace that ended its process (`cancelTurn`). An
298
288
  * interrupt that fails while the turn runs is unconfirmed at once.
299
289
  */
300
290
  async interrupt(session, turn, sessionId) {
@@ -12,6 +12,8 @@ import { planUsedUp } from "./outcome.js";
12
12
  import { notePairedReleases } from "./sdk-pair.js";
13
13
  import { ClaudeSpend } from "./spend.js";
14
14
  import { ClaudeTurn } from "./turn.js";
15
+ /** How long a cancelled turn has to end before its process is replaced (LLP 0001, D9). */
16
+ const CANCEL_GRACE_MS = 10_000;
15
17
  /** Claude repeats a message it was sent, where it reads it (`--replay-user-messages`). */
16
18
  function isReplay(event) {
17
19
  return event.type === "user" && "isReplay" in event && event.isReplay === true;
@@ -272,7 +274,7 @@ export class ClaudeSession {
272
274
  }
273
275
  this.state = "busy";
274
276
  const prompt = this.userMessage(content);
275
- const turn = new ClaudeTurn(start, prompt.uuid);
277
+ const turn = new ClaudeTurn(start, prompt.uuid, () => void this.cancelTurn(turn));
276
278
  this.turn = turn;
277
279
  for (const report of this.rejectedWindowReports())
278
280
  turn.events.push(report);
@@ -287,7 +289,7 @@ export class ClaudeSession {
287
289
  * False when no turn takes input.
288
290
  */
289
291
  steer(content, steerId) {
290
- if (this.state !== "busy" || !this.turn)
292
+ if (this.state !== "busy" || !this.turn || this.turn.cancelled)
291
293
  return false;
292
294
  const message = this.userMessage(content);
293
295
  this.turn.sendSteer(message.uuid, steerId);
@@ -354,13 +356,15 @@ export class ClaudeSession {
354
356
  }
355
357
  // @ref LLP 0001#d9--the-wire-is-quick-ack-json-rpc-requests-flow-one-way — cancelGraceMs: an agent that has not stopped is ended
356
358
  /**
357
- * End the process of a cancelled `turn` that has not ended within
358
- * `graceMs`: Claude did not stop it (a frozen or hung CLI), and nothing
359
- * else would. The turn's events end, so it ends cancelled, and the pool
360
- * hears `replaced` (`onSessionEnd`); the next turn resumes on a new
361
- * process. A turn that ended, and any turn after it, is left alone.
359
+ * Interrupt this turn. If Claude still hasn't stopped it at `cancelGraceMs`,
360
+ * end the process. The turn's events end and the next turn resumes on a
361
+ * new process. A request answered after its turn ended stops nothing.
362
362
  */
363
- async endUnstopped(turn, graceMs) {
363
+ async cancelTurn(turn) {
364
+ if (this.turn !== turn)
365
+ return;
366
+ void this.interruptTurn();
367
+ const graceMs = this.settings.cancelGraceMs ?? CANCEL_GRACE_MS;
364
368
  if ((await withTimeout(turn.ended, graceMs)) === undefined && this.turn === turn)
365
369
  await this.terminate("replaced");
366
370
  }
@@ -12,6 +12,7 @@ const STEER_QUERY_TIMEOUT_MS = 60_000;
12
12
  * next turn. Its methods say what the session does next.
13
13
  */
14
14
  export class ClaudeTurn {
15
+ dropUnread;
15
16
  id;
16
17
  signal;
17
18
  permissions;
@@ -47,7 +48,8 @@ export class ClaudeTurn {
47
48
  heldResult = false;
48
49
  /** Set while Claude is between queries, about to run the unread steers. */
49
50
  watchdog;
50
- constructor(start, prompt) {
51
+ constructor(start, prompt, dropUnread) {
52
+ this.dropUnread = dropUnread;
51
53
  this.id = start.turnId;
52
54
  this.signal = start.signal;
53
55
  this.permissions = start.permissions;
@@ -59,9 +61,11 @@ export class ClaudeTurn {
59
61
  this.settleEnded = resolve;
60
62
  });
61
63
  }
62
- /** A request of the turn was answered `cancelled`: Claude stops the turn, which ends cancelled. */
64
+ /** Drop unread steers before the SDK's denial lets Claude start their query. */
63
65
  cancelByRequest() {
64
66
  this.stoppedByRequest = true;
67
+ if (this.unread.size)
68
+ this.dropUnread();
65
69
  }
66
70
  /** Whether a cancelled request stopped the turn (Claude interrupts on it). */
67
71
  get cancelled() {
@@ -107,8 +107,9 @@ export function geminiProfile(options) {
107
107
  accept,
108
108
  // It takes HTTP servers, though its `initialize` says so only for `--process-per-session`.
109
109
  httpMcp: true,
110
- // Its `auto` asks only for MCP calls, which the engine allows in this mode.
110
+ // Map agy's `auto` back to `bypass_permissions` on the stream. The flag lifts its terminal sandbox.
111
111
  modeIds: { bypass_permissions: "auto" },
112
+ modeArgs: { bypass_permissions: ["--dangerously-skip-permissions"] },
112
113
  // A system prompt given again on resume is added on top: given once, at the start.
113
114
  newSession: {
114
115
  settings: ["systemPromptAppend"],
@@ -153,6 +153,8 @@ export function createOperator(host, options = {}) {
153
153
  * refusal is thrown as it is.
154
154
  */
155
155
  async function dispatched(scope, mutation) {
156
+ if (scope.report)
157
+ void mutation.catch(scope.report);
156
158
  try {
157
159
  return await within(scope, mutation);
158
160
  }
@@ -236,7 +238,7 @@ export function createOperator(host, options = {}) {
236
238
  }
237
239
  }
238
240
  // ---- references ----------------------------------------------------------------
239
- const everything = (caller, scope) => within(scope, host.list(caller, { includeArchived: true }));
241
+ const everything = async (caller, scope) => within(scope, host.list(caller, { includeArchived: true }));
240
242
  function projectNamed(name, projects, all) {
241
243
  const known = [...projects, ...all.flatMap((e) => e.project ?? [])];
242
244
  const project = known.find((p) => p.name.toLowerCase() === name.toLowerCase());
@@ -446,23 +448,26 @@ export function createOperator(host, options = {}) {
446
448
  };
447
449
  /**
448
450
  * The host's `onError` for one call: shown each unexpected failure once,
449
- * never a refusal; it cannot change the answer, and a throw in it is
450
- * swallowed.
451
+ * never a refusal. A throw or rejection in the hook is swallowed.
451
452
  */
452
453
  function reporter(tool, caller) {
453
454
  const seen = new Set();
454
- return (error) => {
455
+ const tell = async (error) => {
455
456
  const refusal = error instanceof OperatorError || error instanceof Refused || error instanceof Over;
456
- if (!options.onError || refusal || seen.has(error))
457
+ if (refusal || seen.has(error))
457
458
  return;
458
- seen.add(error);
459
- try {
460
- options.onError(error, tool, caller);
461
- }
462
- catch {
463
- // The host's hook changes nothing.
459
+ // A host that stops as the caller gives up rejects with that reason, or wraps it (`AbortError`).
460
+ const { signal } = caller;
461
+ if (signal?.aborted) {
462
+ const cause = error instanceof Error ? error.cause : undefined;
463
+ if (error === signal.reason || cause === signal.reason)
464
+ return;
464
465
  }
466
+ seen.add(error);
467
+ await options.onError?.(error, tool, caller);
465
468
  };
469
+ // Nothing awaits it, and a detached write calls it: it never throws or rejects.
470
+ return (error) => void tell(error).catch(() => { });
466
471
  }
467
472
  /** A batch's items, one line each; when every one was refused, the whole answer is a refusal. */
468
473
  async function batch(items, scope) {
@@ -945,7 +950,8 @@ export function createOperator(host, options = {}) {
945
950
  try {
946
951
  await assertMay(caller, "write", "send_message", scope);
947
952
  }
948
- catch {
953
+ catch (error) {
954
+ scope.report?.(error);
949
955
  return unconfirmed;
950
956
  }
951
957
  if (!open(caller, scope.end))
@@ -957,10 +963,15 @@ export function createOperator(host, options = {}) {
957
963
  return late;
958
964
  }
959
965
  try {
960
- await within(scope, host.send(caller, entry.id, input));
966
+ const sending = host.send(caller, entry.id, input);
967
+ if (scope.report)
968
+ void sending.catch(scope.report);
969
+ await within(scope, sending);
961
970
  sent = true;
962
971
  }
963
972
  catch (error) {
973
+ // A host that threw before it had a promise (each error is told once).
974
+ scope.report?.(error);
964
975
  const definite = error instanceof OperatorError || error instanceof Refused;
965
976
  if (definite && attempt > 0)
966
977
  return unconfirmed;
@@ -1012,8 +1023,11 @@ export function createOperator(host, options = {}) {
1012
1023
  }
1013
1024
  if (view.running === turnId)
1014
1025
  return outcomeOf(caller, { entry, ref, view, settled: view.status === "needs_input" }, scope);
1015
- if (setupFailed(view))
1016
- return outcomeOf(caller, { entry, ref, view, settled: true }, scope);
1026
+ if (setupFailed(view)) {
1027
+ const all = (await everything(caller, scope).catch(scope.report)) ?? [];
1028
+ const current = all.find((e) => e.id === entry.id) ?? entry;
1029
+ return outcomeOf(caller, { entry: current, ref, view, settled: true }, scope);
1030
+ }
1017
1031
  if (view.status === "setting_up")
1018
1032
  return `status: setting_up${line(hint("wait_for_sessions", { sessions: [ref] }))}`;
1019
1033
  if (fact.state === "running")
@@ -1207,7 +1221,7 @@ export function createOperator(host, options = {}) {
1207
1221
  // Refused for certain: nothing was made, so the minute's slot is given back.
1208
1222
  if (error instanceof OperatorError || error instanceof Refused)
1209
1223
  giveBack();
1210
- throw fromHost(error, caller, now, about, "started in it");
1224
+ throw asRefusal(fromHost(error, caller, now, about, "started in it"), scope);
1211
1225
  }
1212
1226
  });
1213
1227
  const where = into
@@ -6,6 +6,7 @@
6
6
  * name alone is ambiguous.
7
7
  */
8
8
  import { PLAN_OPTION_IDS } from "../protocol/plan.js";
9
+ import { joinTextParts } from "../protocol/text-parts.js";
9
10
  const clip = (text, limit) => text.length > limit ? `${text.slice(0, limit - 1)}…` : text;
10
11
  // @ref LLP 0014#untrusted-text — text an agent wrote or a repository holds never starts a line
11
12
  // Untrusted text (what an agent or a person wrote, a question, an option, an
@@ -36,9 +37,6 @@ export function quote(text) {
36
37
  export const quoted = (text) => JSON.stringify(oneLine(text));
37
38
  /** A label, then the untrusted text as a quoted block under it. */
38
39
  const block = (label, text) => `${label}\n${quote(text)}`;
39
- const textOf = (parts) => parts
40
- .flatMap((part) => (part.type === "text" && "text" in part ? [String(part.text)] : []))
41
- .join("");
42
40
  /**
43
41
  * The next step, as the tool call that takes it:
44
42
  * `-> answer_request(session: "voyager", answer: "<your answer>")`.
@@ -302,7 +300,7 @@ function lastReply(messages, newer) {
302
300
  break;
303
301
  if (message.nested)
304
302
  continue;
305
- const text = textOf(message.parts);
303
+ const text = joinTextParts(message.parts);
306
304
  if (text.trim())
307
305
  return { text, last: newer + messages.length - i };
308
306
  }
@@ -417,7 +415,7 @@ export function renderConversation(view, options) {
417
415
  const working = view.status === "working" || view.status === "needs_input";
418
416
  for (const { turn, messages } of shownTurns) {
419
417
  for (const message of messages) {
420
- const text = textOf(message.parts);
418
+ const text = joinTextParts(message.parts);
421
419
  if (message.role === "user") {
422
420
  lines.push(messageBlock(senderLabel(message.origin, you), text, options.full ? Number.POSITIVE_INFINITY : 800, options, selection));
423
421
  continue;
@@ -5,8 +5,10 @@ import { AgentInputSchema } from "./part-input.js";
5
5
  import { ThinkingLevelSchema } from "./thinking.js";
6
6
  import { openVocabulary } from "./vocabulary.js";
7
7
  /**
8
- * Permission posture for a turn. `bypass_permissions` auto-approves every
9
- * tool (the right default inside a sandbox); `plan` is read-only planning;
8
+ * Permission posture for a turn. In `bypass_permissions` the engine allows every call it is
9
+ * asked about and starts Claude, Codex and Gemini with their own sandbox off; another ACP
10
+ * agent's is its own (LLP 0001, D4). This is the right default inside a product's own
11
+ * sandbox. `plan` is read-only planning;
10
12
  * `dont_ask` never prompts — unapproved tools are denied, sandboxes stay at
11
13
  * their normal (non-dangerous) level. Values are snake_case (LLP 0002, Casing);
12
14
  * adapters map to provider vocabulary at the edge (Claude SDK: acceptEdits,
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { joinTextParts } from "./text-parts.js";
2
3
  /**
3
4
  * A UI-authored span over the text (mentions, pills, inline references) that
4
5
  * survives the round trip through the model, the user echo, and persistence.
@@ -85,10 +86,5 @@ export function parseAgentInput(value) {
85
86
  }
86
87
  /** Collapse an AgentInput down to the text the model sees first. */
87
88
  export function inputToText(input) {
88
- if (typeof input === "string")
89
- return input;
90
- return input
91
- .filter((p) => p.type === "text")
92
- .map((p) => p.text)
93
- .join("\n\n");
89
+ return typeof input === "string" ? input : joinTextParts(input);
94
90
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * A part boundary can fall inside a sentence (an ACP thought or tool call
3
+ * between two chunks, a mention in an input). It then shows as a break with
4
+ * no words lost: nothing on the stream tells it from two passages.
5
+ */
6
+ export function joinTextParts(parts) {
7
+ return parts
8
+ .flatMap((part) => (part.type === "text" && part.text ? [part.text] : []))
9
+ .join("\n\n");
10
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"acp-agent.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/acp/acp-agent.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACX,iBAAiB,EACjB,YAAY,EACZ,UAAU,EAEV,eAAe,EAGf,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,KAAK,eAAe,EAAyB,MAAM,qCAAqC,CAAC;AAOlG,OAAO,KAAK,EACX,mBAAmB,EAEnB,iBAAiB,EACjB,aAAa,EACb,MAAM,YAAY,CAAC;AAEpB,OAAO,EAGN,KAAK,SAAS,EAId,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAUnD,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAY1E,OAAO,EAAE,KAAK,UAAU,EAAqB,MAAM,cAAc,CAAC;AAiElE,MAAM,WAAW,eAAe;IAC/B;;;OAGG;IACH,aAAa,EAAE,MAAM,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,GAAG,SAAS,GAAG,SAAS,CAAC;IAC5E,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IACjE;;;OAGG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;I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M,GAAG,MAAM,GAAG,SAAS;IAKpE;;;;OAIG;YACW,UAAU;IAyBxB;;;;;OAKG;YACW,KAAK;IA2InB;;;;;;;;;;OAUG;YACW,WAAW;IAoCzB;;;;OAIG;IACH,OAAO,CAAC,aAAa;IASrB;;;;;;;;;;OAUG;YACW,SAAS;cA6BG,WAAW,CACpC,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,eAAe,GACzB,qBAAqB,CAAC,aAAa,CAAC;IAwHvC,qFAAqF;cAClE,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAI5C,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASxD;;;OAGG;IACH,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAIlC,iGAAiG;IACjG,wBAAwB,IAAI,IAAI;IAIjB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;CAK5C;AAED;;;GAGG;AACH,qBAAa,QAAS,SAAQ,gBAAgB;gBACjC,OAAO,EAAE,eAAe;CAIpC"}
@@ -1,5 +1,5 @@
1
1
  import type { InitializeResponse } from "@agentclientprotocol/sdk";
2
- import type { AgentCapabilities, AgentHarness, McpTool, RunConfig } from "../../../protocol/index.ts";
2
+ import type { AgentCapabilities, AgentHarness, McpTool, PermissionMode, RunConfig } from "../../../protocol/index.ts";
3
3
  import type { AgentExecuteOptions } from "../base.ts";
4
4
  import type { CliLogin } from "../login.ts";
5
5
  import type { AcpAccount } from "./account.ts";
@@ -62,6 +62,11 @@ export interface AcpProfile {
62
62
  readonly httpMcp?: boolean;
63
63
  /** The agent's own id for an engine mode, where its ids name none (`permissionModeOf`). */
64
64
  readonly modeIds?: ModeIds;
65
+ /**
66
+ * Appended after the launch's own arguments. A turn in a mode with different
67
+ * arguments gets its own process, which resumes the conversation.
68
+ */
69
+ readonly modeArgs?: Partial<Record<PermissionMode, readonly string[]>>;
65
70
  /**
66
71
  * What a new conversation starts with and keeps for its life: `meta(options)`
67
72
  * goes with `session/new`, never with a resume or a load. A later turn on
@@ -1 +1 @@
1
- {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/acp/profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EACX,iBAAiB,EACjB,YAAY,EACZ,OAAO,EACP,SAAS,EACT,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,gGAAgG;AAChG,MAAM,WAAW,WAAW;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,4FAA4F;AAC5F,MAAM,WAAW,YAAY;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG;QAAE,GAAG,CAAC,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7F;;;;;OAKG;IACH,MAAM,CAAC,CAAC,IAAI,EAAE,WAAW,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;CAC9F;AAGD;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAU;IAC1B,2FAA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C;IACjE,sHAAsH;IACtH,KAAK,CAAC,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC3C,mGAAmG;IACnG,MAAM,CAAC,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACxC,iFAAiF;IACjF,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,2FAA2F;IAC3F,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;IACvE;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE;QACrB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,MAAM,SAAS,CAAC,EAAE,CAAC;QAChD,IAAI,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;KACxE,CAAC;IACF;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IACrD,4FAA4F;IAC5F,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;IAC9B;;;OAGG;IACH,KAAK,CAAC,CAAC,OAAO,EAAE,UAAU,GAAG,QAAQ,CAAC;CACtC;AAmCD,mGAAmG;AACnG,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG,UAAU,CAE1E"}
@@ -47,7 +47,6 @@ export declare class ClaudeCodeAgent extends SessionAgent {
47
47
  readonly login: ClaudeCliLogin;
48
48
  private readonly pool;
49
49
  private readonly credentials?;
50
- private readonly cancelGraceMs;
51
50
  private readonly host?;
52
51
  constructor(agentOptions?: ClaudeCodeAgentOptions);
53
52
  /** Options on a credential the product holds, when it holds one. */
@@ -74,7 +73,7 @@ export declare class ClaudeCodeAgent extends SessionAgent {
74
73
  * before the SDK interrupt lands (the abort-order race that could surface
75
74
  * a clean user cancel as `error`/`end_turn`). The SDK interrupt's
76
75
  * round-trip confirms the cancel, and so does the turn's end, whoever ended
77
- * it: Claude, or the grace that ended its process (`endUnstopped`). An
76
+ * it: Claude, or the grace that ended its process (`cancelTurn`). An
78
77
  * interrupt that fails while the turn runs is unconfirmed at once.
79
78
  */
80
79
  private interrupt;
@@ -1 +1 @@
1
- {"version":3,"file":"claude-agent.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/claude-code/claude-agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAEX,UAAU,EACV,eAAe,EACf,eAAe,EAEf,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,KAAK,eAAe,EAAyB,MAAM,qCAAqC,CAAC;AAIlG,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,KAAK,sBAAsB,EAAuB,MAAM,cAAc,CAAC;AAShF,KAAK,aAAa,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC;AA0B1D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,aAAa,CAkChE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,GAAG,KAAK,IAAI,cAAc,CAMjF;AAED;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,YAAY;IAWpC,OAAO,CAAC,QAAQ,CAAC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Y,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;cAIR,WAAW,CACpC,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,eAAe,GACzB,qBAAqB,CAAC,cAAc,CAAC;cA0IrB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAI3D,+EAA+E;IACzE,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAmBxE;;;;;;OAMG;IACG,aAAa,CAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GACtC,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;IAI3C,yFAAyF;IACzF,wBAAwB,IAAI,IAAI;IAIhC;;;;;;;;;OASG;YACW,SAAS;IAoBR,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOzC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ5C"}
@@ -165,7 +165,7 @@ export interface ClaudeCodeAgentOptions {
165
165
  /** Embed-tier extras threaded from ClaudeCodeAgentOptions into each session. */
166
166
  export type ClaudeSessionExtras = Pick<ClaudeCodeAgentOptions, "sdkMcpServers" | "toolPolicy" | "hooks" | "sdkOptions" | "processes" | "onDiagnostic">;
167
167
  /** What every session of an agent runs with: fixed when the agent is made. */
168
- export type ClaudeSessionSettings = ClaudeSessionExtras & Pick<ClaudeCodeAgentOptions, "idleTimeoutMs" | "cancelConfirmMs"> & {
168
+ export type ClaudeSessionSettings = ClaudeSessionExtras & Pick<ClaudeCodeAgentOptions, "idleTimeoutMs" | "cancelConfirmMs" | "cancelGraceMs"> & {
169
169
  /** The agent's: where its sessions' `claude` processes start. */
170
170
  processes: NativeProcesses;
171
171
  /** The agent's: its sessions' host tools. */
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents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wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,CAe1F;AAgDD,wGAAwG;AACxG,wBAAgB,SAAS,CACxB,MAAM,EAAE,IAAI,CAAC,mBAAmB,EAAE,KAAK,GAAG,eAAe,CAAC,GACxD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAEpC;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAAC,EAC/C,aAAa,CAAC,EAAE,aAAa,EAC7B,SAAS,CAAC,EAAE,wBAAwB,EACpC,KAAK,CAAC,EAAE,WAAW,GACjB,SAAS,CA6FX"}
@@ -141,13 +141,11 @@ export declare class ClaudeSession implements PooledProcess, PooledClient {
141
141
  */
142
142
  stopTurn(turn: ClaudeTurn, timeoutMs?: number): Promise<void>;
143
143
  /**
144
- * End the process of a cancelled `turn` that has not ended within
145
- * `graceMs`: Claude did not stop it (a frozen or hung CLI), and nothing
146
- * else would. The turn's events end, so it ends cancelled, and the pool
147
- * hears `replaced` (`onSessionEnd`); the next turn resumes on a new
148
- * process. A turn that ended, and any turn after it, is left alone.
144
+ * Interrupt this turn. If Claude still hasn't stopped it at `cancelGraceMs`,
145
+ * end the process. The turn's events end and the next turn resumes on a
146
+ * new process. A request answered after its turn ended stops nothing.
149
147
  */
150
- endUnstopped(turn: ClaudeTurn, graceMs: number): Promise<void>;
148
+ cancelTurn(turn: ClaudeTurn): Promise<void>;
151
149
  private interrupt;
152
150
  /**
153
151
  * Interrupt and drop the turn's queued messages with the CLI's queue cancel
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/claude-code/session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,mBAAmB,EAMnB,cAAc,EACd,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE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ChF,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;AAE3E;;;;GAIG;AACH,wBAAgB,iBAAiB,CAChC,QAAQ,EAAE,qBAAqB,GAAG,IAAI,CAAC,sBAAsB,EAAE,cAAc,CAAC,GAC5E,iBAAiB,CAiDnB"}
@@ -27,6 +27,7 @@ export interface ClaudeTurnStart {
27
27
  * next turn. Its methods say what the session does next.
28
28
  */
29
29
  export declare class ClaudeTurn {
30
+ private readonly dropUnread;
30
31
  readonly id: string;
31
32
  readonly signal?: AbortSignal;
32
33
  readonly permissions?: PermissionRequestHandler;
@@ -62,8 +63,8 @@ export declare class ClaudeTurn {
62
63
  private heldResult;
63
64
  /** Set while Claude is between queries, about to run the unread steers. */
64
65
  private watchdog?;
65
- constructor(start: ClaudeTurnStart, prompt: string);
66
- /** A request of the turn was answered `cancelled`: Claude stops the turn, which ends cancelled. */
66
+ constructor(start: ClaudeTurnStart, prompt: string, dropUnread: () => void);
67
+ /** Drop unread steers before the SDK's denial lets Claude start their query. */
67
68
  cancelByRequest(): void;
68
69
  /** Whether a cancelled request stopped the turn (Claude interrupts on it). */
69
70
  get cancelled(): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"turn.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/claude-code/turn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AASnD,2EAA2E;AAC3E,MAAM,WAAW,eAAe;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACp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CAAC,IAAI,CAAC,EACxB,OAAO,GAAE,eAAe,CAAC,IAAI,CAAM,GACjC,QAAQ,CAAC,IAAI,CAAC,CA+oDhB"}
1
+ {"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../../../src/operator/operator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwBxB,OAAO,KAAK,EACX,SAAS,EACT,MAAM,EACN,MAAM,EAEN,SAAS,EACT,MAAM,EACN,QAAQ,EAER,YAAY,EACZ,eAAe,EAMf,QAAQ,EAER,MAAM,YAAY,CAAC;AAGpB,2GAA2G;AAC3G,wBAAgB,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC,WAAW,EAAE,IAAI,GAAG,OAAO,EAAE,GAAG,EAAE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/F,GAAG,SAAS,CAAC,IAAI,CAAC,CAElB;AAED,eAAO,MAAM,cAAc,EAAE,MAI5B,CAAC;AACF,eAAO,MAAM,aAAa,EAAE,QAG3B,CAAC;AA+FF,wBAAgB,cAAc,CAAC,IAAI,GAAG,OAAO,EAC5C,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,EACxB,OAAO,GAAE,eAAe,CAAC,IAAI,CAAM,GACjC,QAAQ,CAAC,IAAI,CAAC,CA4pDhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"render.d.ts","sourceR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aAAa,GAAG,MAAM,CAkEpF;AAED,qFAAqF;AACrF,MAAM,MAAM,MAAM,GACf;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,kBAAkB,CAAA;CAAE,GACpE;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAQvE;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAsChE"}
@@ -424,10 +424,10 @@ export interface OperatorOptions<Auth = unknown> {
424
424
  extra?: ExtraTool<Auth>[];
425
425
  clock?: OperatorClock;
426
426
  /**
427
- * Shown each unexpected failure a call answers without (a `refused (failed)`,
428
- * an outcome that could not be read), once, with the tool and the caller:
429
- * for the host's reports. Never a refusal. It cannot change the answer,
430
- * and a throw inside it is swallowed.
427
+ * Receives each unexpected failure once per call, with the tool and caller.
428
+ * This includes failed send attempts and writes that reject after the call
429
+ * has answered. Refusals, caller abort reasons (even when wrapped) and the
430
+ * call's own deadline are silent. A throw or rejection in the hook is swallowed.
431
431
  */
432
432
  onError?: (error: unknown, tool: string, caller: Caller<Auth>) => void;
433
433
  }
@@ -1,8 +1,10 @@
1
1
  import { z } from "zod";
2
2
  import { type Origin } from "./origin.ts";
3
3
  /**
4
- * Permission posture for a turn. `bypass_permissions` auto-approves every
5
- * tool (the right default inside a sandbox); `plan` is read-only planning;
4
+ * Permission posture for a turn. In `bypass_permissions` the engine allows every call it is
5
+ * asked about and starts Claude, Codex and Gemini with their own sandbox off; another ACP
6
+ * agent's is its own (LLP 0001, D4). This is the right default inside a product's own
7
+ * sandbox. `plan` is read-only planning;
6
8
  * `dont_ask` never prompts — unapproved tools are denied, sandboxes stay at
7
9
  * their normal (non-dangerous) level. Values are snake_case (LLP 0002, Casing);
8
10
  * adapters map to provider vocabulary at the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AChF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAY1D;AAED,oEAAoE;AACpE,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAErD"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * A part boundary can fall inside a sentence (an ACP thought or tool call
3
+ * between two chunks, a mention in an input). It then shows as a break with
4
+ * no words lost: nothing on the stream tells it from two passages.
5
+ */
6
+ export declare function joinTextParts(parts: readonly {
7
+ type: string;
8
+ text?: string;
9
+ }[]): string;
10
+ //# sourceMappingURL=text-parts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-parts.d.ts","sourceRoot":"","sources":["../../../src/protocol/text-parts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,MAAM,CAIvF"}
package/docs/consuming.md CHANGED
@@ -517,7 +517,8 @@ const result = await handle.steer("Use the staging database instead", steerId);
517
517
  - **Delivered means echoed.** A steer reached the agent exactly when its user
518
518
  message appears in the turn. A turn that ends first lists it in
519
519
  `turn.ended.undeliveredSteers`, and it never runs later: a cancel drops
520
- unread steers; for a turn that ended normally, send the text as a new turn.
520
+ unread steers, including when a Claude permission or plan is dismissed.
521
+ For a turn that ended normally, send the text as a new turn.
521
522
  A turn a durable server lost to a crash lists nothing it never journaled, so
522
523
  go by the echo.
523
524
  - **`no_active_turn`**: the turn is not taking input (it ended, is ending, or
package/docs/harnesses.md CHANGED
@@ -320,7 +320,7 @@ ends "(not applied: …)" is a case a harness finds as the turn runs, named in
320
320
  | `systemPromptAppend` | applied, appended to Claude Code's system prompt | another meaning: a developer message (`developerInstructions`) | applied once, at `session/new` (`_meta.antigravity.systemPrompt.append`); a later different one: not applied: `systemPromptAppend` | ignored: ACP v1 has no system prompt | ignored: `echo: "config"` says it |
321
321
  | `maxTurns` | applied (unset is 100) | ignored | ignored | ignored | ignored |
322
322
  | `subagentMode` | applied | another meaning: Codex's `multi_agent` on, an instruction to collect every sub-agent, a native cleanup at the end | refused | refused | refused |
323
- | `permissionMode` | applied (SDK modes) | another meaning: a sandbox and an approval policy (the table below) | another meaning: Antigravity's modes, `auto` for `bypass_permissions`, its `default` for `dont_ask` (the table below) | applied: the agent's own mode for it (`session/set_mode`; `default` when the turn names none), else its `default` with the engine answering its requests by the mode; `plan` there, or any mode on an agent with no `default`, is not applied (`permissionMode`) | ignored: the script says which calls ask (`ask: true`); `echo: "config"` says it |
323
+ | `permissionMode` | applied (SDK modes) | another meaning: a sandbox and an approval policy (the table below) | another meaning: Antigravity's modes, `auto` with `--dangerously-skip-permissions` for `bypass_permissions`, its `default` for `dont_ask` (the table below) | applied: the agent's own mode for it (`session/set_mode`; `default` when the turn names none), else its `default` with the engine answering its requests by the mode; `plan` there, or any mode on an agent with no `default`, is not applied (`permissionMode`) | ignored: the script says which calls ask (`ask: true`); `echo: "config"` says it |
324
324
  | `elicitation` | applied | applied | applied: the agent's form and URL requests | applied: the agent's form and URL requests (ACP v1 has no question tool) | applied: an `ask` step asks the person, else the agent is told no one can answer |
325
325
  | `requestTimeoutMs` | the engine | the engine | the engine | the engine | the engine |
326
326
  | `resumeSessionId` | applied | applied (`thread/resume`) | applied (`session/resume`) | the agent's: `session/resume`, else `session/load`; refused for an agent with neither | applied: reported as the native id, resumed |
@@ -419,20 +419,27 @@ other:
419
419
  `default`, `gpt-6-luna` did not retry: no request came, and no tool part
420
420
  reached the stream.
421
421
 
422
- The `gemini` harness puts Antigravity in its own mode for each (measured on
423
- Antigravity 1.5.13 on 2026-11-21, live through the engine; LLP 0020.000,
424
- Modes). It is not in the `permission-modes` scenario's tables.
422
+ The `gemini` modes were measured through the engine on Antigravity 1.5.13
423
+ on 2026-11-21. On that build, `auto` alone still asked for an MCP call and
424
+ the engine allowed it. The full-access row below was measured with the
425
+ start flag on 1.5.14 on 2026-11-24 (LLP 0020.000, Modes). Gemini is
426
+ not in the `permission-modes` scenario's tables. The `full-access` scenario
427
+ checks its worktree commit, network access and write outside the worktree.
425
428
 
426
429
  | Engine mode | Antigravity's | A write in the folder | A command | An MCP tool |
427
430
  | --- | --- | --- | --- | --- |
428
431
  | `default` | `default` | asks | asks | asks |
429
432
  | `accept_edits` | `accept-edits` | runs | asks | asks |
430
433
  | `plan` | `plan` | writes a plan file and stops, asking nothing | not run | not run |
431
- | `bypass_permissions` | `auto` | runs | runs | asked; the engine allows it |
434
+ | `bypass_permissions` | `auto` with `--dangerously-skip-permissions` | runs | runs outside the terminal sandbox | runs unasked |
432
435
  | `dont_ask` | `default` | refused by the engine | refused by the engine | refused by the engine |
433
436
 
434
- A later turn in another mode carries a plan out; there is no approval
435
- request for it.
437
+ A later turn in another mode carries a plan out. Switching into or out of
438
+ `bypass_permissions` resumes the conversation in a new agy process, ending
439
+ commands left in the background. With `enableTerminalSandbox` unset, an
440
+ approved command ran outside the terminal sandbox in `default` and
441
+ `accept_edits`. In `default`, enabling the setting sandboxed the approved
442
+ command.
436
443
 
437
444
  ## Model lists
438
445
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zvada/agent-server",
3
- "version": "0.3.28",
3
+ "version": "0.3.30",
4
4
  "description": "Harness-agnostic agent execution engine: run Claude Code, Codex (app-server), and any ACP agent behind one interface with a normalized event stream, multi-turn sessions, and resume. Root export is the wire contract; /core, /server, /client are the seats.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -319,7 +319,9 @@ export class ProfiledAcpAgent extends SessionAgent {
319
319
  signal: AbortSignal,
320
320
  ): Promise<AcpSession> {
321
321
  // A cancel ends the wait: the operator's resolution goes on for the next turn.
322
- const launch = await launchOf(this.profile, signal);
322
+ const base = await launchOf(this.profile, signal);
323
+ const modeArgs = this.profile.modeArgs?.[options.permissionMode ?? "default"];
324
+ const launch = modeArgs ? { ...base, args: [...(base.args ?? []), ...modeArgs] } : base;
323
325
 
324
326
  const host = await untilAborted(
325
327
  Promise.resolve(this.host?.lease(options.sessionId, options.cwd)),
@@ -3,6 +3,7 @@ import type {
3
3
  AgentCapabilities,
4
4
  AgentHarness,
5
5
  McpTool,
6
+ PermissionMode,
6
7
  RunConfig,
7
8
  } from "../../../protocol/index.ts";
8
9
  import type { AgentExecuteOptions } from "../base.ts";
@@ -64,6 +65,11 @@ export interface AcpProfile {
64
65
  readonly httpMcp?: boolean;
65
66
  /** The agent's own id for an engine mode, where its ids name none (`permissionModeOf`). */
66
67
  readonly modeIds?: ModeIds;
68
+ /**
69
+ * Appended after the launch's own arguments. A turn in a mode with different
70
+ * arguments gets its own process, which resumes the conversation.
71
+ */
72
+ readonly modeArgs?: Partial<Record<PermissionMode, readonly string[]>>;
67
73
  /**
68
74
  * What a new conversation starts with and keeps for its life: `meta(options)`
69
75
  * goes with `session/new`, never with a resume or a load. A later turn on
@@ -33,12 +33,6 @@ import type { ClaudeTurn } from "./turn.ts";
33
33
 
34
34
  type ClaudeContent = SDKUserMessage["message"]["content"];
35
35
 
36
- /**
37
- * How long after a cancel a turn Claude has not ended has its process ended,
38
- * unless `cancelGraceMs` says otherwise (LLP 0001, D9).
39
- */
40
- const CANCEL_GRACE_MS = 10_000;
41
-
42
36
  const CAPABILITIES: AgentCapabilities = {
43
37
  multiTurn: true,
44
38
  sessionResume: true,
@@ -125,12 +119,10 @@ export class ClaudeCodeAgent extends SessionAgent {
125
119
  readonly login: ClaudeCliLogin;
126
120
  private readonly pool: ClaudeSessionPool;
127
121
  private readonly credentials?: ClaudeCredentials;
128
- private readonly cancelGraceMs: number;
129
122
  private readonly host?: HostToolSessions;
130
123
 
131
124
  constructor(private readonly agentOptions: ClaudeCodeAgentOptions = {}) {
132
125
  super({ cancelConfirmMs: agentOptions.cancelConfirmMs });
133
- this.cancelGraceMs = agentOptions.cancelGraceMs ?? CANCEL_GRACE_MS;
134
126
  this.processes = agentOptions.processes ?? sharedNativeProcesses();
135
127
  this.host = hostToolSessions(agentOptions.hostTools, this.harness);
136
128
  this.pool = claudeSessionPool({ ...agentOptions, processes: this.processes, host: this.host });
@@ -241,10 +233,7 @@ export class ClaudeCodeAgent extends SessionAgent {
241
233
  ? "steered"
242
234
  : "no_active_turn",
243
235
  );
244
- removeInterrupt = onAbort(controller.signal, () => {
245
- void session.interruptTurn();
246
- void session.endUnstopped(turn, this.cancelGraceMs);
247
- });
236
+ removeInterrupt = onAbort(controller.signal, () => void session.cancelTurn(turn));
248
237
  const mcpServers = session.mcp.names;
249
238
  if (mcpServers.length) yield { type: "agentServer/mcpServers", names: mcpServers };
250
239
  let sawOutput = false;
@@ -352,7 +341,7 @@ export class ClaudeCodeAgent extends SessionAgent {
352
341
  * before the SDK interrupt lands (the abort-order race that could surface
353
342
  * a clean user cancel as `error`/`end_turn`). The SDK interrupt's
354
343
  * round-trip confirms the cancel, and so does the turn's end, whoever ended
355
- * it: Claude, or the grace that ended its process (`endUnstopped`). An
344
+ * it: Claude, or the grace that ended its process (`cancelTurn`). An
356
345
  * interrupt that fails while the turn runs is unconfirmed at once.
357
346
  */
358
347
  private async interrupt(
@@ -204,7 +204,7 @@ export type ClaudeSessionExtras = Pick<
204
204
 
205
205
  /** What every session of an agent runs with: fixed when the agent is made. */
206
206
  export type ClaudeSessionSettings = ClaudeSessionExtras &
207
- Pick<ClaudeCodeAgentOptions, "idleTimeoutMs" | "cancelConfirmMs"> & {
207
+ Pick<ClaudeCodeAgentOptions, "idleTimeoutMs" | "cancelConfirmMs" | "cancelGraceMs"> & {
208
208
  /** The agent's: where its sessions' `claude` processes start. */
209
209
  processes: NativeProcesses;
210
210
  /** The agent's: its sessions' host tools. */
@@ -42,6 +42,9 @@ import { notePairedReleases } from "./sdk-pair.ts";
42
42
  import { ClaudeSpend } from "./spend.ts";
43
43
  import { ClaudeTurn, type ClaudeTurnStart } from "./turn.ts";
44
44
 
45
+ /** How long a cancelled turn has to end before its process is replaced (LLP 0001, D9). */
46
+ const CANCEL_GRACE_MS = 10_000;
47
+
45
48
  type SessionState = "starting" | "idle" | "busy" | "terminated";
46
49
  type ClaudeContent = SDKUserMessage["message"]["content"];
47
50
 
@@ -325,7 +328,7 @@ export class ClaudeSession implements PooledProcess, PooledClient {
325
328
  }
326
329
  this.state = "busy";
327
330
  const prompt = this.userMessage(content);
328
- const turn = new ClaudeTurn(start, prompt.uuid);
331
+ const turn = new ClaudeTurn(start, prompt.uuid, () => void this.cancelTurn(turn));
329
332
  this.turn = turn;
330
333
  for (const report of this.rejectedWindowReports()) turn.events.push(report);
331
334
  this.promptQueue.push(prompt);
@@ -340,7 +343,7 @@ export class ClaudeSession implements PooledProcess, PooledClient {
340
343
  * False when no turn takes input.
341
344
  */
342
345
  steer(content: ClaudeContent, steerId: string): boolean {
343
- if (this.state !== "busy" || !this.turn) return false;
346
+ if (this.state !== "busy" || !this.turn || this.turn.cancelled) return false;
344
347
  const message = this.userMessage(content);
345
348
  this.turn.sendSteer(message.uuid, steerId);
346
349
  this.promptQueue.push(message);
@@ -406,13 +409,14 @@ export class ClaudeSession implements PooledProcess, PooledClient {
406
409
 
407
410
  // @ref LLP 0001#d9--the-wire-is-quick-ack-json-rpc-requests-flow-one-way — cancelGraceMs: an agent that has not stopped is ended
408
411
  /**
409
- * End the process of a cancelled `turn` that has not ended within
410
- * `graceMs`: Claude did not stop it (a frozen or hung CLI), and nothing
411
- * else would. The turn's events end, so it ends cancelled, and the pool
412
- * hears `replaced` (`onSessionEnd`); the next turn resumes on a new
413
- * process. A turn that ended, and any turn after it, is left alone.
412
+ * Interrupt this turn. If Claude still hasn't stopped it at `cancelGraceMs`,
413
+ * end the process. The turn's events end and the next turn resumes on a
414
+ * new process. A request answered after its turn ended stops nothing.
414
415
  */
415
- async endUnstopped(turn: ClaudeTurn, graceMs: number): Promise<void> {
416
+ async cancelTurn(turn: ClaudeTurn): Promise<void> {
417
+ if (this.turn !== turn) return;
418
+ void this.interruptTurn();
419
+ const graceMs = this.settings.cancelGraceMs ?? CANCEL_GRACE_MS;
416
420
  if ((await withTimeout(turn.ended, graceMs)) === undefined && this.turn === turn)
417
421
  await this.terminate("replaced");
418
422
  }
@@ -72,7 +72,11 @@ export class ClaudeTurn {
72
72
  /** Set while Claude is between queries, about to run the unread steers. */
73
73
  private watchdog?: ReturnType<typeof setTimeout>;
74
74
 
75
- constructor(start: ClaudeTurnStart, prompt: string) {
75
+ constructor(
76
+ start: ClaudeTurnStart,
77
+ prompt: string,
78
+ private readonly dropUnread: () => void,
79
+ ) {
76
80
  this.id = start.turnId;
77
81
  this.signal = start.signal;
78
82
  this.permissions = start.permissions;
@@ -85,9 +89,10 @@ export class ClaudeTurn {
85
89
  });
86
90
  }
87
91
 
88
- /** A request of the turn was answered `cancelled`: Claude stops the turn, which ends cancelled. */
92
+ /** Drop unread steers before the SDK's denial lets Claude start their query. */
89
93
  cancelByRequest(): void {
90
94
  this.stoppedByRequest = true;
95
+ if (this.unread.size) this.dropUnread();
91
96
  }
92
97
 
93
98
  /** Whether a cancelled request stopped the turn (Claude interrupts on it). */
@@ -128,8 +128,9 @@ export function geminiProfile(options: GeminiOptions): AcpProfile {
128
128
  accept,
129
129
  // It takes HTTP servers, though its `initialize` says so only for `--process-per-session`.
130
130
  httpMcp: true,
131
- // Its `auto` asks only for MCP calls, which the engine allows in this mode.
131
+ // Map agy's `auto` back to `bypass_permissions` on the stream. The flag lifts its terminal sandbox.
132
132
  modeIds: { bypass_permissions: "auto" },
133
+ modeArgs: { bypass_permissions: ["--dangerously-skip-permissions"] },
133
134
  // A system prompt given again on resume is added on top: given once, at the start.
134
135
  newSession: {
135
136
  settings: ["systemPromptAppend"],
@@ -275,6 +275,7 @@ export function createOperator<Auth = unknown>(
275
275
  * refusal is thrown as it is.
276
276
  */
277
277
  async function dispatched<T>(scope: Scope, mutation: Promise<T>): Promise<T | undefined> {
278
+ if (scope.report) void mutation.catch(scope.report);
278
279
  try {
279
280
  return await within(scope, mutation);
280
281
  } catch (error) {
@@ -356,7 +357,7 @@ export function createOperator<Auth = unknown>(
356
357
 
357
358
  // ---- references ----------------------------------------------------------------
358
359
 
359
- const everything = (caller: Caller<Auth>, scope: Scope) =>
360
+ const everything = async (caller: Caller<Auth>, scope: Scope) =>
360
361
  within(scope, host.list(caller, { includeArchived: true }));
361
362
 
362
363
  function projectNamed(name: string, projects: readonly ProjectRef[], all: readonly Entry[]) {
@@ -599,22 +600,25 @@ export function createOperator<Auth = unknown>(
599
600
 
600
601
  /**
601
602
  * The host's `onError` for one call: shown each unexpected failure once,
602
- * never a refusal; it cannot change the answer, and a throw in it is
603
- * swallowed.
603
+ * never a refusal. A throw or rejection in the hook is swallowed.
604
604
  */
605
605
  function reporter(tool: string, caller: Caller<Auth>) {
606
606
  const seen = new Set<unknown>();
607
- return (error: unknown) => {
607
+ const tell = async (error: unknown) => {
608
608
  const refusal =
609
609
  error instanceof OperatorError || error instanceof Refused || error instanceof Over;
610
- if (!options.onError || refusal || seen.has(error)) return;
611
- seen.add(error);
612
- try {
613
- options.onError(error, tool, caller);
614
- } catch {
615
- // The host's hook changes nothing.
610
+ if (refusal || seen.has(error)) return;
611
+ // A host that stops as the caller gives up rejects with that reason, or wraps it (`AbortError`).
612
+ const { signal } = caller;
613
+ if (signal?.aborted) {
614
+ const cause = error instanceof Error ? error.cause : undefined;
615
+ if (error === signal.reason || cause === signal.reason) return;
616
616
  }
617
+ seen.add(error);
618
+ await options.onError?.(error, tool, caller);
617
619
  };
620
+ // Nothing awaits it, and a detached write calls it: it never throws or rejects.
621
+ return (error: unknown) => void tell(error).catch(() => {});
618
622
  }
619
623
 
620
624
  /** A batch's items, one line each; when every one was refused, the whole answer is a refusal. */
@@ -1178,7 +1182,8 @@ export function createOperator<Auth = unknown>(
1178
1182
  if (!open(caller, scope.end)) return unconfirmed;
1179
1183
  try {
1180
1184
  await assertMay(caller, "write", "send_message", scope);
1181
- } catch {
1185
+ } catch (error) {
1186
+ scope.report?.(error);
1182
1187
  return unconfirmed;
1183
1188
  }
1184
1189
  if (!open(caller, scope.end)) return unconfirmed;
@@ -1187,9 +1192,13 @@ export function createOperator<Auth = unknown>(
1187
1192
  if (!open(caller, cutoff)) return late;
1188
1193
  }
1189
1194
  try {
1190
- await within(scope, host.send(caller, entry.id, input));
1195
+ const sending = host.send(caller, entry.id, input);
1196
+ if (scope.report) void sending.catch(scope.report);
1197
+ await within(scope, sending);
1191
1198
  sent = true;
1192
1199
  } catch (error) {
1200
+ // A host that threw before it had a promise (each error is told once).
1201
+ scope.report?.(error);
1193
1202
  const definite = error instanceof OperatorError || error instanceof Refused;
1194
1203
  if (definite && attempt > 0) return unconfirmed;
1195
1204
  if (definite && (error instanceof Refused ? error.refusal.code : error.code) === "busy")
@@ -1250,7 +1259,11 @@ export function createOperator<Auth = unknown>(
1250
1259
  }
1251
1260
  if (view.running === turnId)
1252
1261
  return outcomeOf(caller, { entry, ref, view, settled: view.status === "needs_input" }, scope);
1253
- if (setupFailed(view)) return outcomeOf(caller, { entry, ref, view, settled: true }, scope);
1262
+ if (setupFailed(view)) {
1263
+ const all = (await everything(caller, scope).catch(scope.report)) ?? [];
1264
+ const current = all.find((e) => e.id === entry.id) ?? entry;
1265
+ return outcomeOf(caller, { entry: current, ref, view, settled: true }, scope);
1266
+ }
1254
1267
  if (view.status === "setting_up")
1255
1268
  return `status: setting_up${line(hint("wait_for_sessions", { sessions: [ref] }))}`;
1256
1269
  if (fact.state === "running")
@@ -1464,7 +1477,7 @@ export function createOperator<Auth = unknown>(
1464
1477
  } catch (error) {
1465
1478
  // Refused for certain: nothing was made, so the minute's slot is given back.
1466
1479
  if (error instanceof OperatorError || error instanceof Refused) giveBack();
1467
- throw fromHost(error, caller, now, about, "started in it");
1480
+ throw asRefusal(fromHost(error, caller, now, about, "started in it"), scope);
1468
1481
  }
1469
1482
  });
1470
1483
  const where = into
@@ -10,6 +10,7 @@ import type { ElicitationOutcome, PermissionOutcome } from "../protocol/lifecycl
10
10
  import type { Origin, ReportedOrigin } from "../protocol/origin.ts";
11
11
  import type { Part, UnknownPart } from "../protocol/parts.ts";
12
12
  import { PLAN_OPTION_IDS } from "../protocol/plan.ts";
13
+ import { joinTextParts } from "../protocol/text-parts.ts";
13
14
  import type { Hint } from "./errors.ts";
14
15
  import type { SessionView, ViewTurn, Waiting } from "./types.ts";
15
16
  import type { DecisionRequest, ViewMessage } from "./view.ts";
@@ -54,11 +55,6 @@ export const quoted = (text: string) => JSON.stringify(oneLine(text));
54
55
  /** A label, then the untrusted text as a quoted block under it. */
55
56
  const block = (label: string, text: string) => `${label}\n${quote(text)}`;
56
57
 
57
- const textOf = (parts: readonly (Part | UnknownPart)[]) =>
58
- parts
59
- .flatMap((part) => (part.type === "text" && "text" in part ? [String(part.text)] : []))
60
- .join("");
61
-
62
58
  /**
63
59
  * The next step, as the tool call that takes it:
64
60
  * `-> answer_request(session: "voyager", answer: "<your answer>")`.
@@ -368,7 +364,7 @@ function lastReply(messages: readonly ViewMessage[], newer: number) {
368
364
  const message = messages[i];
369
365
  if (message?.role !== "assistant") break;
370
366
  if (message.nested) continue;
371
- const text = textOf(message.parts);
367
+ const text = joinTextParts(message.parts);
372
368
  if (text.trim()) return { text, last: newer + messages.length - i };
373
369
  }
374
370
  }
@@ -501,7 +497,7 @@ export function renderConversation(view: SessionView, options: RenderOptions): s
501
497
  const working = view.status === "working" || view.status === "needs_input";
502
498
  for (const { turn, messages } of shownTurns) {
503
499
  for (const message of messages) {
504
- const text = textOf(message.parts);
500
+ const text = joinTextParts(message.parts);
505
501
  if (message.role === "user") {
506
502
  lines.push(
507
503
  messageBlock(
@@ -488,10 +488,10 @@ export interface OperatorOptions<Auth = unknown> {
488
488
  extra?: ExtraTool<Auth>[];
489
489
  clock?: OperatorClock;
490
490
  /**
491
- * Shown each unexpected failure a call answers without (a `refused (failed)`,
492
- * an outcome that could not be read), once, with the tool and the caller:
493
- * for the host's reports. Never a refusal. It cannot change the answer,
494
- * and a throw inside it is swallowed.
491
+ * Receives each unexpected failure once per call, with the tool and caller.
492
+ * This includes failed send attempts and writes that reject after the call
493
+ * has answered. Refusals, caller abort reasons (even when wrapped) and the
494
+ * call's own deadline are silent. A throw or rejection in the hook is swallowed.
495
495
  */
496
496
  onError?: (error: unknown, tool: string, caller: Caller<Auth>) => void;
497
497
  }
@@ -6,8 +6,10 @@ import { ThinkingLevelSchema } from "./thinking.ts";
6
6
  import { openVocabulary } from "./vocabulary.ts";
7
7
 
8
8
  /**
9
- * Permission posture for a turn. `bypass_permissions` auto-approves every
10
- * tool (the right default inside a sandbox); `plan` is read-only planning;
9
+ * Permission posture for a turn. In `bypass_permissions` the engine allows every call it is
10
+ * asked about and starts Claude, Codex and Gemini with their own sandbox off; another ACP
11
+ * agent's is its own (LLP 0001, D4). This is the right default inside a product's own
12
+ * sandbox. `plan` is read-only planning;
11
13
  * `dont_ask` never prompts — unapproved tools are denied, sandboxes stay at
12
14
  * their normal (non-dangerous) level. Values are snake_case (LLP 0002, Casing);
13
15
  * adapters map to provider vocabulary at the edge (Claude SDK: acceptEdits,
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { joinTextParts } from "./text-parts.ts";
2
3
 
3
4
  /**
4
5
  * A UI-authored span over the text (mentions, pills, inline references) that
@@ -100,9 +101,5 @@ export function parseAgentInput(value: unknown): AgentInput {
100
101
 
101
102
  /** Collapse an AgentInput down to the text the model sees first. */
102
103
  export function inputToText(input: AgentInput): string {
103
- if (typeof input === "string") return input;
104
- return input
105
- .filter((p): p is TextPartInput => p.type === "text")
106
- .map((p) => p.text)
107
- .join("\n\n");
104
+ return typeof input === "string" ? input : joinTextParts(input);
108
105
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * A part boundary can fall inside a sentence (an ACP thought or tool call
3
+ * between two chunks, a mention in an input). It then shows as a break with
4
+ * no words lost: nothing on the stream tells it from two passages.
5
+ */
6
+ export function joinTextParts(parts: readonly { type: string; text?: string }[]): string {
7
+ return parts
8
+ .flatMap((part) => (part.type === "text" && part.text ? [part.text] : []))
9
+ .join("\n\n");
10
+ }