claude-code-acp-ts 0.63.0-beta.1 → 0.65.0-beta.1

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.
@@ -1,5 +1,5 @@
1
1
  import { AuthenticateRequest, CancelNotification, ClientCapabilities, CompleteElicitationNotification, CreateElicitationRequest, CreateElicitationResponse, DisableProviderRequest, DisableProviderResponse, ForkSessionRequest, ForkSessionResponse, InitializeRequest, InitializeResponse, ListProvidersRequest, ListProvidersResponse, LlmProtocol, ListSessionsRequest, ListSessionsResponse, LoadSessionRequest, LoadSessionResponse, LogoutRequest, NewSessionRequest, NewSessionResponse, PromptRequest, PromptResponse, ReadTextFileRequest, ReadTextFileResponse, SetProviderRequest, SetProviderResponse, RequestPermissionRequest, RequestPermissionResponse, ResumeSessionRequest, ResumeSessionResponse, SessionConfigOption, SessionModeState, SessionNotification, SetSessionConfigOptionRequest, SetSessionConfigOptionResponse, SetSessionModeRequest, SetSessionModeResponse, CloseSessionRequest, CloseSessionResponse, DeleteSessionRequest, DeleteSessionResponse, WriteTextFileRequest, WriteTextFileResponse } from "@agentclientprotocol/sdk";
2
- import { AgentInfo, CanUseTool, FastModeDisabledReason, FastModeState, ModelInfo, Options, PermissionMode, PermissionUpdate, Query, SDKMessageOrigin, SDKPartialAssistantMessage, SDKUserMessage } from "@anthropic-ai/claude-agent-sdk";
2
+ import { AgentInfo, CanUseTool, FastModeDisabledReason, FastModeState, ModelInfo, Options, PermissionMode, Query, SDKMessageOrigin, SDKPartialAssistantMessage, SDKUserMessage } from "@anthropic-ai/claude-agent-sdk";
3
3
  import { ContentBlockParam } from "@anthropic-ai/sdk/resources";
4
4
  import { BetaContentBlock, BetaRawContentBlockDelta } from "@anthropic-ai/sdk/resources/beta.mjs";
5
5
  import { SettingsManager } from "./settings.js";
@@ -19,6 +19,14 @@ type AccumulatedUsage = {
19
19
  cachedReadTokens: number;
20
20
  cachedWriteTokens: number;
21
21
  };
22
+ /** Request-level steering options. `promptRequired` is opt-in so existing Hosts
23
+ * keep the established idle fallback behavior. */
24
+ type SteerMeta = {
25
+ [key: string]: unknown;
26
+ steering?: {
27
+ idleBehavior?: "promptRequired";
28
+ };
29
+ };
22
30
  /** Params of a {@link STEER_METHOD} request. Shaped like the relevant subset of
23
31
  * a `PromptRequest` so the same `promptToClaude` conversion applies. Delivery
24
32
  * priority is deliberately NOT exposed here — it's an internal detail the agent
@@ -26,20 +34,18 @@ type AccumulatedUsage = {
26
34
  export type SteerRequest = {
27
35
  sessionId: string;
28
36
  prompt: PromptRequest["prompt"];
37
+ _meta?: SteerMeta | null;
29
38
  };
30
- /** Where a steering message was accepted, per the wire protocol's two
31
- * successful outcomes:
32
- * - `injected`: a turn was still running and the message was applied to it;
33
- * - `startedNewTurn`: the turn we meant to steer had already finished (an
34
- * unavoidable race), so the message began a fresh turn instead of being
35
- * dropped.
36
- * Both are success results — never a JSON-RPC error — and tell the client
37
- * where the message landed. */
38
- type SteerOutcome = "injected" | "startedNewTurn";
39
- /** Result of a {@link STEER_METHOD} request: the single required `outcome`
40
- * field the client reads to learn where its steering message was accepted. */
39
+ /** Result of a {@link STEER_METHOD} request. The legacy `startedNewTurn` result
40
+ * remains the default idle behavior; `promptRequired` is returned only when the
41
+ * Host explicitly opts into the host-owned fallback in request `_meta`. */
41
42
  export type SteerResponse = {
42
- outcome: SteerOutcome;
43
+ outcome: "injected";
44
+ } | {
45
+ outcome: "startedNewTurn";
46
+ } | {
47
+ outcome: "promptRequired";
48
+ reason: "noRunningTurn";
43
49
  };
44
50
  /** Internal model-selection state. Mirrors the shape the ACP SDK exposed as
45
51
  * `SessionModelState` before model selection moved entirely into
@@ -103,6 +109,27 @@ type Turn = {
103
109
  * is attributed to the holder — extending that hold behind a foreign
104
110
  * chain. Bounded: the hold still ends at drain, hand-off, or cancel. */
105
111
  spawnedTaskIds?: Set<string>;
112
+ /** tool_use ids of Agent/Task (subagent) calls this turn emitted whose
113
+ * `task_started` has not yet arrived — an early signal that a subagent
114
+ * spawn is in flight, used to hold settlement open when the terminal
115
+ * result races ahead of `task_started` (observed with fast-responding
116
+ * models that end_turn immediately after dispatching a background
117
+ * subagent). Without it, a result that wins the race settles the turn
118
+ * before `task_started` can add the task_id to `spawnedTaskIds`,
119
+ * orphaning the subagent: its output, permission requests, and the
120
+ * model's followup summary all land outside any turn.
121
+ *
122
+ * Populated when this turn's top-level assistant message's Agent/Task
123
+ * tool_use blocks are consumed (always before result — the model emits
124
+ * tool_use, then the SDK executes the tool and emits `task_started`,
125
+ * then the result). Cleared by `task_started` (which carries the
126
+ * matching `tool_use_id`) and, as defense-in-depth, by
127
+ * `task_notification`. If neither arrives (the call failed before
128
+ * registering a task, or both messages were lost), the id stays and the
129
+ * held turn parks until `session/cancel` or the next prompt's echo
130
+ * hand-off — the same rescue contract as `deferredSettle`'s Known
131
+ * residual #1. */
132
+ pendingSubagentToolUseIds?: Set<string>;
106
133
  /** Set instead of settling when the turn's terminal result arrives while
107
134
  * subagents it spawned are still live (`spawnedTaskIds` ∩
108
135
  * `session.liveBackgroundTasks`). The turn is held open — its
@@ -140,6 +167,26 @@ type Turn = {
140
167
  * pre-hold behavior (pending wakes are not countable: notifications can
141
168
  * batch into one followup). */
142
169
  deferredSettle?: PromptResponse;
170
+ /** Uuids of `steer()`-injected messages the SDK has not replayed back yet.
171
+ *
172
+ * A steer is delivered at {@link STEER_PRIORITY} (`now`), so the CLI ABORTS
173
+ * the running cycle: it emits its own human-origin `result` —
174
+ * indistinguishable from a turn's terminal one — and the steered message runs
175
+ * as a SECOND cycle. Settling at that result would answer `session/prompt`
176
+ * mid-work, so a steered turn's results only RECORD their outcome
177
+ * (`steeredSettle`) and it settles at the SDK's `idle`, the only signal
178
+ * spanning both cycles (CLI 2.1.220).
179
+ *
180
+ * A non-empty set at an idle means the steered cycle hasn't started — the CLI
181
+ * replays a message only when it picks it up, always after the interrupted
182
+ * cycle's result — so that idle is swallowed. Drained by the replay handler.
183
+ *
184
+ * Residual: a message the CLI drops unreplayed parks the turn until
185
+ * `session/cancel` or the next prompt (both settle it). */
186
+ steeredEchoes?: Set<string>;
187
+ /** What a steered turn settles with once its steered work has run: the outcome
188
+ * of its latest result, so its usage covers every cycle the turn ran. */
189
+ steeredSettle?: PromptResponse;
143
190
  resolve: (response: PromptResponse) => void;
144
191
  reject: (error: unknown) => void;
145
192
  };
@@ -580,13 +627,6 @@ export declare function isLocalCommandMetadata(content: unknown): boolean;
580
627
  */
581
628
  export declare function isSyntheticLoginMessage(apiMessage: unknown): boolean;
582
629
  export declare function resolvePermissionMode(defaultMode?: unknown, logger?: Logger): PermissionMode;
583
- /**
584
- * Builds the label for the "Always Allow" permission option so the user can see
585
- * the exact scope they are committing to. Uses the SDK-provided suggestions
586
- * when available (e.g. `Bash(npm test:*)`) and falls back to naming the whole
587
- * tool so "Always Allow" is never a blank check without disclosure.
588
- */
589
- export declare function describeAlwaysAllow(suggestions: PermissionUpdate[] | undefined, toolName: string): string;
590
630
  /**
591
631
  * Client-facing surface the agent calls back into. This is the subset of ACP
592
632
  * client methods the agent actually uses, expressed as a narrow interface so
@@ -670,11 +710,10 @@ export declare class ClaudeAcpAgent {
670
710
  resolveProviderConfig(): ProviderConfig | null;
671
711
  logout(_params: LogoutRequest): Promise<void>;
672
712
  prompt(params: PromptRequest): Promise<PromptResponse>;
673
- /** Steer the session per the ACP steering wire protocol: apply a follow-up
674
- * message to the turn that is currently running, or — if that turn already
675
- * finished — start a fresh turn with it. Never drops the message and never
676
- * returns a JSON-RPC error for the "arrived too late" race; both paths are
677
- * success outcomes (see {@link SteerOutcome}).
713
+ /** Steer the session per the ACP steering wire protocol: inject a follow-up
714
+ * message into the turn that is currently running. If that turn already
715
+ * settled, the established default starts a new detached turn; Hosts may opt
716
+ * into the host-owned `promptRequired` fallback through request `_meta`.
678
717
  *
679
718
  * When a turn is in flight this injects (returns `injected`): unlike
680
719
  * `prompt()`, it does NOT create a Turn or enqueue on `turnQueue`; it pushes
@@ -687,12 +726,15 @@ export declare class ClaudeAcpAgent {
687
726
  * calls). The steered message's own output streams via `session/update`, not
688
727
  * this response.
689
728
  *
690
- * When the session is idle (no unsettled turn — the turn we meant to steer
691
- * raced ahead and finished), this starts a normal new turn with the message
692
- * and returns `startedNewTurn`. That turn is fire-and-forget from the steer
693
- * request's view: its `PromptResponse` and output flow through the usual
694
- * `prompt()`/`session/update` path, so we return the outcome immediately
695
- * rather than awaiting turn completion. */
729
+ * Pre-empting means ABORTING: the interrupted cycle emits a `result` of its
730
+ * own and the steered message runs as a second one, so the turn is marked
731
+ * (`Turn.steeredEchoes`) to settle at the SDK's `idle` instead of that result.
732
+ *
733
+ * When the session is idle, the opt-in path returns `promptRequired` WITHOUT
734
+ * calling `prompt()`, pushing SDK input, or mutating `turnQueue`: the content
735
+ * stays Host-owned so the Host can submit it through a standard
736
+ * `session/prompt`. Without the opt-in, the existing detached `prompt()` and
737
+ * `startedNewTurn` result are preserved for compatibility. */
696
738
  steer(params: SteerRequest): Promise<SteerResponse>;
697
739
  /** Lazily start the per-session consumer that drains the SDK query stream for
698
740
  * the session's whole life. Idempotent: only the first `prompt()` starts it. */
@@ -1 +1 @@
1
- {"version":3,"file":"acp-agent.d.ts","sourceRoot":"","sources":["../src/acp-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,mBAAmB,EAGnB,kBAAkB,EAClB,kBAAkB,EAClB,+BAA+B,EAC/B,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EAGb,iBAAiB,EACjB,kBAAkB,EAElB,aAAa,EACb,cAAc,EAEd,mBAAmB,EACnB,oBAAoB,EAEpB,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,oB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CAAC;IACb,SAAS,CAAC,EAAE,SAAS,CAAC;IAOtB,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAM/B,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,aAAa,CAAC,EAAE,OAAO,CAAC;IAIxB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,GACA,mBAAmB,EAAE,CAiXvB;AAED,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,0BAA0B,EACnC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;IACR,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,sBAAsB,CAAC;CAC7C,GACA,mBAAmB,EAAE,CAgIvB;AAED;;;;;;;;;;;oEAWoE;AACpE,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC,EAC3D,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,cAAc,CAAC,CAczB;AAED,wBAAgB,MAAM;;;EA2CrB"}
package/dist/acp-agent.js CHANGED
@@ -99,16 +99,24 @@ function parseSteerRequest(params) {
99
99
  if (!params || typeof params !== "object") {
100
100
  throw RequestError.invalidParams(undefined, "steer params must be an object");
101
101
  }
102
- const { sessionId, prompt } = params;
102
+ const { sessionId, prompt, _meta } = params;
103
103
  if (typeof sessionId !== "string" || sessionId.length === 0) {
104
104
  throw RequestError.invalidParams(undefined, "steer params require a non-empty sessionId");
105
105
  }
106
106
  if (!Array.isArray(prompt) || prompt.length === 0) {
107
107
  throw RequestError.invalidParams(undefined, "steer params require a non-empty prompt array");
108
108
  }
109
+ const steering = _meta && typeof _meta === "object" ? _meta.steering : undefined;
110
+ const idleBehavior = steering && typeof steering === "object"
111
+ ? steering.idleBehavior
112
+ : undefined;
113
+ if (idleBehavior !== undefined && idleBehavior !== "promptRequired") {
114
+ throw RequestError.invalidParams(undefined, "unsupported steering idleBehavior");
115
+ }
109
116
  return {
110
117
  sessionId,
111
118
  prompt: prompt,
119
+ _meta: _meta,
112
120
  };
113
121
  }
114
122
  /** Result-message origin kinds that mark an AUTONOMOUS cycle — work the
@@ -141,6 +149,11 @@ const AUTONOMOUS_RESULT_ORIGINS = new Set([
141
149
  function isHeldOpen(turn) {
142
150
  return turn != null && turn.deferredSettle !== undefined && !turn.settled;
143
151
  }
152
+ /** Whether a steer moved this turn's settlement off the next result and onto the
153
+ * SDK's `idle` (see Turn.steeredEchoes). Shared by the consumer's settle lanes. */
154
+ function isSteering(turn) {
155
+ return turn != null && turn.steeredEchoes !== undefined && !turn.settled;
156
+ }
144
157
  /** Disarm the force-cancel backstop (see Session.forceCancelTimer). Every
145
158
  * path that settles the active turn must run this so a timer can never fire
146
159
  * on an already-settled turn — and must leave the field undefined, or the
@@ -447,39 +460,110 @@ export function resolvePermissionMode(defaultMode, logger = console) {
447
460
  }
448
461
  return mapped;
449
462
  }
450
- /**
451
- * Builds the label for the "Always Allow" permission option so the user can see
452
- * the exact scope they are committing to. Uses the SDK-provided suggestions
453
- * when available (e.g. `Bash(npm test:*)`) and falls back to naming the whole
454
- * tool so "Always Allow" is never a blank check without disclosure.
455
- */
456
- export function describeAlwaysAllow(suggestions, toolName) {
457
- if (!suggestions || suggestions.length === 0) {
458
- return `Always Allow all ${toolName}`;
459
- }
460
- const ruleLabels = [];
461
- const directories = [];
462
- for (const update of suggestions) {
463
- if (update.type === "addRules" && update.behavior === "allow") {
464
- for (const rule of update.rules) {
465
- ruleLabels.push(rule.ruleContent ? `${rule.toolName}(${rule.ruleContent})` : `all ${rule.toolName}`);
463
+ function permissionLifetime(destination) {
464
+ switch (destination) {
465
+ case "session":
466
+ return { scope: "session" };
467
+ case "cliArg":
468
+ return { scope: "process", storage: "cli_argument" };
469
+ case "userSettings":
470
+ return { scope: "persistent", storage: "user" };
471
+ case "projectSettings":
472
+ return { scope: "persistent", storage: "project" };
473
+ case "localSettings":
474
+ return { scope: "persistent", storage: "project_local" };
475
+ default:
476
+ return { scope: "unknown" };
477
+ }
478
+ }
479
+ function permissionMetadataForAlwaysAllow(suggestions, toolName) {
480
+ const effectiveSuggestions = suggestions && suggestions.length > 0
481
+ ? suggestions
482
+ : [
483
+ {
484
+ type: "addRules",
485
+ rules: [{ toolName }],
486
+ behavior: "allow",
487
+ destination: "session",
488
+ },
489
+ ];
490
+ const changes = [];
491
+ for (const update of effectiveSuggestions) {
492
+ switch (update.type) {
493
+ case "addRules":
494
+ case "removeRules":
495
+ case "replaceRules": {
496
+ const operation = update.type === "addRules" ? "add" : update.type === "removeRules" ? "remove" : "replace";
497
+ const targets = update.rules.map((rule) => ({
498
+ type: "tool",
499
+ toolName: rule.toolName,
500
+ ...(rule.ruleContent
501
+ ? {
502
+ matcher: {
503
+ type: "provider_rule",
504
+ provider: "claudeCode",
505
+ value: rule.ruleContent,
506
+ },
507
+ }
508
+ : {}),
509
+ }));
510
+ const renderedRules = update.rules
511
+ .map((rule) => rule.ruleContent
512
+ ? `${rule.toolName} calls matching ${rule.ruleContent}`
513
+ : `all ${rule.toolName} calls`)
514
+ .join(", ");
515
+ const verb = operation === "add"
516
+ ? update.behavior === "allow"
517
+ ? "Allow"
518
+ : update.behavior === "deny"
519
+ ? "Deny"
520
+ : "Ask before"
521
+ : operation === "remove"
522
+ ? `Remove ${update.behavior} rules for`
523
+ : `Replace ${update.behavior} rules with`;
524
+ changes.push({
525
+ type: "policy_rule",
526
+ operation,
527
+ ruleBehavior: update.behavior,
528
+ description: `${verb} ${renderedRules}`,
529
+ lifetime: permissionLifetime(update.destination),
530
+ targets,
531
+ });
532
+ break;
466
533
  }
534
+ case "addDirectories":
535
+ case "removeDirectories": {
536
+ const operation = update.type === "addDirectories" ? "add" : "remove";
537
+ changes.push({
538
+ type: "policy_rule",
539
+ operation,
540
+ ruleBehavior: "allow",
541
+ description: operation === "add"
542
+ ? `Allow filesystem access under ${update.directories.join(", ")}`
543
+ : `Remove additional filesystem access under ${update.directories.join(", ")}`,
544
+ lifetime: permissionLifetime(update.destination),
545
+ targets: update.directories.map((path) => ({
546
+ type: "filesystem",
547
+ matcher: { type: "directory", path },
548
+ })),
549
+ });
550
+ break;
551
+ }
552
+ case "setMode":
553
+ changes.push({
554
+ type: "permission_mode",
555
+ operation: "set",
556
+ provider: "claudeCode",
557
+ mode: update.mode,
558
+ description: `Set Claude Code permission mode to ${update.mode}`,
559
+ lifetime: permissionLifetime(update.destination),
560
+ });
561
+ break;
562
+ default:
563
+ break;
467
564
  }
468
- else if (update.type === "addDirectories") {
469
- directories.push(...update.directories);
470
- }
471
- }
472
- const parts = [];
473
- if (ruleLabels.length > 0) {
474
- parts.push(ruleLabels.join(", "));
475
- }
476
- if (directories.length > 0) {
477
- parts.push(`access to ${directories.join(", ")}`);
478
565
  }
479
- if (parts.length === 0) {
480
- return `Always Allow all ${toolName}`;
481
- }
482
- return `Always Allow ${parts.join(" and ")}`;
566
+ return { version: 1, changes };
483
567
  }
484
568
  /**
485
569
  * Bridges {@link AcpClient} to the connection-scoped {@link AgentContext}
@@ -676,10 +760,9 @@ export class ClaudeAcpAgent {
676
760
  ...terminalAuthMethods,
677
761
  ...(supportsGatewayAuth ? [gatewayAuthMethod, gatewayBedrockAuthMethod] : []),
678
762
  ],
679
- // Top-level `_meta` (sibling of `agentCapabilities`), per the ACP steering
680
- // wire protocol: advertises the `_session/steering` extension request so
681
- // clients know they may inject a follow-up into the running turn (see
682
- // STEER_METHOD) instead of queuing it as a separate `session/prompt`.
763
+ // Top-level `_meta` (sibling of `agentCapabilities`), per the existing ACP
764
+ // steering extension contract: advertises the `_session/steering` request
765
+ // so clients know they may inject a follow-up into a running turn.
683
766
  _meta: {
684
767
  steering: {
685
768
  supported: true,
@@ -936,11 +1019,10 @@ export class ClaudeAcpAgent {
936
1019
  this.ensureConsumer(session, params.sessionId);
937
1020
  return response;
938
1021
  }
939
- /** Steer the session per the ACP steering wire protocol: apply a follow-up
940
- * message to the turn that is currently running, or — if that turn already
941
- * finished — start a fresh turn with it. Never drops the message and never
942
- * returns a JSON-RPC error for the "arrived too late" race; both paths are
943
- * success outcomes (see {@link SteerOutcome}).
1022
+ /** Steer the session per the ACP steering wire protocol: inject a follow-up
1023
+ * message into the turn that is currently running. If that turn already
1024
+ * settled, the established default starts a new detached turn; Hosts may opt
1025
+ * into the host-owned `promptRequired` fallback through request `_meta`.
944
1026
  *
945
1027
  * When a turn is in flight this injects (returns `injected`): unlike
946
1028
  * `prompt()`, it does NOT create a Turn or enqueue on `turnQueue`; it pushes
@@ -953,15 +1035,17 @@ export class ClaudeAcpAgent {
953
1035
  * calls). The steered message's own output streams via `session/update`, not
954
1036
  * this response.
955
1037
  *
956
- * When the session is idle (no unsettled turn — the turn we meant to steer
957
- * raced ahead and finished), this starts a normal new turn with the message
958
- * and returns `startedNewTurn`. That turn is fire-and-forget from the steer
959
- * request's view: its `PromptResponse` and output flow through the usual
960
- * `prompt()`/`session/update` path, so we return the outcome immediately
961
- * rather than awaiting turn completion. */
1038
+ * Pre-empting means ABORTING: the interrupted cycle emits a `result` of its
1039
+ * own and the steered message runs as a second one, so the turn is marked
1040
+ * (`Turn.steeredEchoes`) to settle at the SDK's `idle` instead of that result.
1041
+ *
1042
+ * When the session is idle, the opt-in path returns `promptRequired` WITHOUT
1043
+ * calling `prompt()`, pushing SDK input, or mutating `turnQueue`: the content
1044
+ * stays Host-owned so the Host can submit it through a standard
1045
+ * `session/prompt`. Without the opt-in, the existing detached `prompt()` and
1046
+ * `startedNewTurn` result are preserved for compatibility. */
962
1047
  async steer(params) {
963
1048
  const sessionId = params.sessionId;
964
- const prompt = params.prompt;
965
1049
  const session = this.sessions[sessionId];
966
1050
  if (!session) {
967
1051
  throw new Error("Session not found");
@@ -971,29 +1055,49 @@ export class ClaudeAcpAgent {
971
1055
  }
972
1056
  // "A turn is running" = the queue holds an unsettled turn. This covers both
973
1057
  // the activated turn and one just submitted but not yet echoed/activated,
974
- // which is exactly the window in which steering is meaningful.
975
- const turnInFlight = (session.turnQueue ?? []).some((t) => !t.settled);
976
- const promptRequest = {
977
- sessionId: sessionId,
978
- prompt: prompt,
979
- };
1058
+ // which is exactly the window in which steering is meaningful. This check
1059
+ // and the active-path push below stay in one synchronous section so the
1060
+ // turn cannot settle in the gap between deciding to inject and enqueueing.
1061
+ const turnInFlight = (session.turnQueue ?? []).find((turn) => !turn.settled);
980
1062
  if (!turnInFlight) {
981
- // Race: the turn we meant to steer already finished. Per the protocol the
982
- // message must not be dropped nor surfaced as an error — start a fresh
983
- // turn with it. Don't await: the new turn streams via session/update and
984
- // its PromptResponse is consumed by the normal prompt() path; we only owe
985
- // the client the outcome. `.catch` keeps the detached promise from
986
- // becoming an unhandled rejection.
1063
+ const promptRequest = {
1064
+ sessionId,
1065
+ prompt: params.prompt,
1066
+ };
1067
+ if (params._meta?.steering?.idleBehavior === "promptRequired") {
1068
+ // The opt-in path leaves the content untouched so the Host can retry via
1069
+ // a normal session/prompt whose lifecycle owns the continuation result.
1070
+ return { outcome: "promptRequired", reason: "noRunningTurn" };
1071
+ }
1072
+ // Preserve the established default for Hosts that do not opt in. This is
1073
+ // intentionally detached for compatibility with the existing contract.
987
1074
  this.prompt(promptRequest).catch((error) => {
988
1075
  this.logger.error(`Session ${sessionId}: steered new turn failed: ${error}`);
989
1076
  });
990
1077
  return { outcome: "startedNewTurn" };
991
1078
  }
1079
+ const promptRequest = {
1080
+ sessionId,
1081
+ prompt: params.prompt,
1082
+ };
992
1083
  const userMessage = promptToClaude(promptRequest);
993
- userMessage.uuid = randomUUID();
1084
+ const steeredUuid = randomUUID();
1085
+ userMessage.uuid = steeredUuid;
994
1086
  // Deliver into the running turn rather than queuing behind it as a fresh
995
1087
  // prompt would.
996
1088
  userMessage.priority = STEER_PRIORITY;
1089
+ // Mark before the push and in the same synchronous section as the in-flight
1090
+ // check: the interrupt can have the CLI finalizing the aborted cycle by the
1091
+ // time the consumer next runs, and an unmarked result would settle the turn
1092
+ // (see Turn.steeredEchoes).
1093
+ (turnInFlight.steeredEchoes ??= new Set()).add(steeredUuid);
1094
+ // A turn already held for background subagents has a recorded outcome the
1095
+ // steer supersedes: move it into the steer lane so one lane owns settlement.
1096
+ // The idle handler re-applies the hold through the subagent gate.
1097
+ if (turnInFlight.deferredSettle !== undefined) {
1098
+ turnInFlight.steeredSettle = turnInFlight.deferredSettle;
1099
+ turnInFlight.deferredSettle = undefined;
1100
+ }
997
1101
  session.input.push(userMessage);
998
1102
  return { outcome: "injected" };
999
1103
  }
@@ -1304,7 +1408,9 @@ export class ClaudeAcpAgent {
1304
1408
  * followup-result and idle settle sites, so the two lanes can't drift. */
1305
1409
  const settleDeferredIfDrained = () => {
1306
1410
  const turn = session.activeTurn;
1307
- if (isHeldOpen(turn) && !turnAwaitingSubagents(turn)) {
1411
+ if (isHeldOpen(turn) &&
1412
+ !turnAwaitingSubagents(turn) &&
1413
+ !turn.pendingSubagentToolUseIds?.size) {
1308
1414
  settleActive(turn.deferredSettle);
1309
1415
  }
1310
1416
  };
@@ -1315,9 +1421,18 @@ export class ClaudeAcpAgent {
1315
1421
  * calling settleActive directly bypasses the hold and re-opens the
1316
1422
  * out-of-turn permission deadlock (issue #866) through its lane. */
1317
1423
  const settleOrDefer = (outcome) => {
1424
+ // No result ends a steered turn: the steer aborted the cycle this result
1425
+ // may belong to, and the steered one is still to come. Record the outcome
1426
+ // for the idle lane (see Turn.steeredEchoes); later cycles overwrite it,
1427
+ // so the last result and its usage win.
1428
+ if (isSteering(session.activeTurn)) {
1429
+ session.activeTurn.steeredSettle = outcome;
1430
+ return;
1431
+ }
1318
1432
  if (session.activeTurn &&
1319
1433
  !session.activeTurn.settled &&
1320
- turnAwaitingSubagents(session.activeTurn)) {
1434
+ (turnAwaitingSubagents(session.activeTurn) ||
1435
+ !!session.activeTurn.pendingSubagentToolUseIds?.size)) {
1321
1436
  session.activeTurn.deferredSettle = outcome;
1322
1437
  }
1323
1438
  else {
@@ -1808,8 +1923,33 @@ export class ClaudeAcpAgent {
1808
1923
  // this lagged idle (no active turn to settle): the idle
1809
1924
  // still belongs to that settled turn, and skipping the
1810
1925
  // decrement would leak the debt permanently.
1926
+ // Deliberately BEFORE the steer lane below: an owed idle
1927
+ // belongs to an earlier turn, and reading it as the steered
1928
+ // sequence's turn-over signal would settle a turn whose
1929
+ // steered cycle is still running. Steered results owe none.
1811
1930
  session.owedTrailingIdles--;
1812
1931
  }
1932
+ else if (isSteering(session.activeTurn)) {
1933
+ // A steered turn settles here, not at a result: this idle is
1934
+ // the only signal spanning the interrupted and steered cycles
1935
+ // (see Turn.steeredEchoes). An idle before the steered echo,
1936
+ // or before any result was recorded, means the answer is
1937
+ // still ahead — swallow it, and never let it reach the #825
1938
+ // fail below, which would reject a prompt about to answer.
1939
+ //
1940
+ // Plain Turn so the fields can be cleared below; isSteering
1941
+ // narrows steeredEchoes to non-optional.
1942
+ const steered = session.activeTurn;
1943
+ if (steered.steeredEchoes?.size === 0 && steered.steeredSettle !== undefined) {
1944
+ // Via the subagent gate, not settleActive: a steered turn
1945
+ // can also have spawned background subagents, which own it
1946
+ // from here (settles now if none is live, holds otherwise).
1947
+ steered.deferredSettle = steered.steeredSettle;
1948
+ steered.steeredEchoes = undefined;
1949
+ steered.steeredSettle = undefined;
1950
+ settleDeferredIfDrained();
1951
+ }
1952
+ }
1813
1953
  else if (!session.cancelled &&
1814
1954
  session.activeTurn &&
1815
1955
  !session.activeTurn.settled) {
@@ -2003,12 +2143,28 @@ export class ClaudeAcpAgent {
2003
2143
  });
2004
2144
  if (message.subagent_type && session.activeTurn && !session.activeTurn.settled) {
2005
2145
  (session.activeTurn.spawnedTaskIds ??= new Set()).add(message.task_id);
2146
+ // The tool_use_id's in-flight tracking is complete: the spawn
2147
+ // is now tracked by task_id in spawnedTaskIds. This also
2148
+ // converts a pending-only hold — one held on
2149
+ // pendingSubagentToolUseIds alone because task_started lost
2150
+ // the race with the result (see Turn.pendingSubagentToolUseIds)
2151
+ // — so the drain rule can settle once the subagent finishes.
2152
+ if (message.tool_use_id) {
2153
+ session.activeTurn.pendingSubagentToolUseIds?.delete(message.tool_use_id);
2154
+ }
2006
2155
  }
2007
2156
  break;
2008
2157
  case "task_notification":
2009
2158
  // The task settled — no further tool calls can originate
2010
2159
  // from it, so its registry entry can be dropped.
2011
2160
  session.liveBackgroundTasks.delete(message.task_id);
2161
+ // Defense-in-depth: task_notification carries the spawning
2162
+ // tool_use_id, so if task_started was lost this clears the
2163
+ // pending entry too — a task_started-less spawn can't park the
2164
+ // turn forever once the task itself has settled.
2165
+ if (message.tool_use_id && session.activeTurn) {
2166
+ session.activeTurn.pendingSubagentToolUseIds?.delete(message.tool_use_id);
2167
+ }
2012
2168
  break;
2013
2169
  case "task_updated":
2014
2170
  // terminal-status task_updated patch and a (deduplicated)
@@ -2229,7 +2385,14 @@ export class ClaudeAcpAgent {
2229
2385
  // turn's OWN result — a followup result arriving inside the
2230
2386
  // cancel window still gets its own trailer and must be counted,
2231
2387
  // or that idle would later false-fail the next prompt.
2232
- if (isAutonomousResult || !session.cancelled || !session.activeTurn) {
2388
+ // A second exclusion: a steered turn's own results (see
2389
+ // Turn.steeredEchoes). One idle covers the whole interrupted +
2390
+ // steered sequence and that idle settles the turn, so counting
2391
+ // either result would leave a debt that swallows it. Autonomous
2392
+ // results inside a steered turn keep their own trailers.
2393
+ const owesTrailingIdle = isAutonomousResult || !isSteering(session.activeTurn);
2394
+ if (owesTrailingIdle &&
2395
+ (isAutonomousResult || !session.cancelled || !session.activeTurn)) {
2233
2396
  session.owedTrailingIdles++;
2234
2397
  }
2235
2398
  // Accumulate usage into the user turn's tally. Skip autonomous
@@ -2633,6 +2796,22 @@ export class ClaudeAcpAgent {
2633
2796
  // when the drain idle eventually arrives.
2634
2797
  settleActive(session.activeTurn.deferredSettle);
2635
2798
  }
2799
+ else if (isSteering(session.activeTurn) &&
2800
+ session.activeTurn.steeredSettle !== undefined) {
2801
+ // Same for a turn with an open steer (see
2802
+ // Turn.steeredEchoes): the user moving on outranks the
2803
+ // steered continuation, but its last result's stop reason
2804
+ // stands. With no result yet it falls through to the
2805
+ // end_turn hand-off below, owing nothing there.
2806
+ //
2807
+ // The steer lane normally pays for that result's trailing
2808
+ // idle by settling on it; this hand-off settles instead,
2809
+ // so count it here or it arrives un-owed against the fresh
2810
+ // turn and false-fails it (issue #825). Harmless if it
2811
+ // never comes: the debt absorbs one future idle.
2812
+ session.owedTrailingIdles++;
2813
+ settleActive(session.activeTurn.steeredSettle);
2814
+ }
2636
2815
  else {
2637
2816
  settleActive({ stopReason: "end_turn", usage: sessionUsage(session) });
2638
2817
  }
@@ -2649,6 +2828,13 @@ export class ClaudeAcpAgent {
2649
2828
  break;
2650
2829
  }
2651
2830
  if ("isReplay" in message && message.isReplay) {
2831
+ // A steered message's echo matches no turn (steer() creates
2832
+ // none), but it marks the steered cycle as running — how the idle
2833
+ // lane tells "the answer is still ahead" from "the turn is over"
2834
+ // (see Turn.steeredEchoes).
2835
+ if (isSteering(session.activeTurn)) {
2836
+ session.activeTurn.steeredEchoes.delete(message.uuid);
2837
+ }
2652
2838
  // Unrelated replay (e.g. the echo of an already-settled turn).
2653
2839
  break;
2654
2840
  }
@@ -2798,6 +2984,28 @@ export class ClaudeAcpAgent {
2798
2984
  else {
2799
2985
  content = message.message.content;
2800
2986
  }
2987
+ // Record Agent/Task tool_use ids as an early "subagent spawn in
2988
+ // flight" signal: a tool_use block always precedes its
2989
+ // task_started and the turn's result in stream order, so this is
2990
+ // the earliest point that can hold settlement when task_started
2991
+ // races past the result (see Turn.pendingSubagentToolUseIds).
2992
+ // Top-level only (parent_tool_use_id === null): a subagent's own
2993
+ // Agent/Task calls must not seed the parent turn's pending set.
2994
+ if (message.type === "assistant" &&
2995
+ message.parent_tool_use_id === null &&
2996
+ !("isReplay" in message && message.isReplay) &&
2997
+ session.activeTurn &&
2998
+ !session.activeTurn.settled) {
2999
+ for (const item of message.message.content) {
3000
+ if ((item.type === "tool_use" ||
3001
+ item.type === "server_tool_use" ||
3002
+ item.type === "mcp_tool_use") &&
3003
+ (item.name === "Agent" || item.name === "Task")) {
3004
+ (session.activeTurn.pendingSubagentToolUseIds ??=
3005
+ new Set()).add(item.id);
3006
+ }
3007
+ }
3008
+ }
2801
3009
  for (const notification of toAcpNotifications(content, message.message.role, params.sessionId, session.toolUseCache, this.client, this.logger, {
2802
3010
  clientCapabilities: this.clientCapabilities,
2803
3011
  parentToolUseId: message.parent_tool_use_id,
@@ -3077,6 +3285,15 @@ export class ClaudeAcpAgent {
3077
3285
  active.resolve({ stopReason: "cancelled", usage: active.deferredSettle.usage });
3078
3286
  }
3079
3287
  }
3288
+ // A steered active turn (see Turn.steeredEchoes) settles "cancelled" in the
3289
+ // consumer at the interrupt's trailing idle, like any live turn. But the
3290
+ // steer lane pays for its last result's trailer by settling on it, which
3291
+ // this cancel pre-empts, so count that trailer here or it arrives un-owed
3292
+ // against the next prompt and false-fails it (issue #825). Over-counting
3293
+ // when only one trailer comes absorbs a future idle.
3294
+ if (isSteering(session.activeTurn) && session.activeTurn.steeredSettle !== undefined) {
3295
+ session.owedTrailingIdles++;
3296
+ }
3080
3297
  // Arm a backstop before interrupting: if a turn is actively consuming the
3081
3298
  // query and interrupt() doesn't make the SDK yield (e.g. a wedged TaskOutput
3082
3299
  // block — issue #680), force the consumer to settle the active turn
@@ -3470,7 +3687,6 @@ export class ClaudeAcpAgent {
3470
3687
  }
3471
3688
  canUseTool(sessionId) {
3472
3689
  return async (toolName, toolInput, { signal, suggestions, toolUseID, agentID, matchedAskRule }) => {
3473
- const alwaysAllowLabel = describeAlwaysAllow(suggestions, toolName);
3474
3690
  const supportsTerminalOutput = this.clientCapabilities?._meta?.["terminal_output"] === true;
3475
3691
  const session = this.sessions[sessionId];
3476
3692
  if (!session) {
@@ -3595,13 +3811,16 @@ export class ClaudeAcpAgent {
3595
3811
  }
3596
3812
  const response = await this.requestPermissionFromClient({
3597
3813
  options: [
3814
+ { kind: "reject_once", name: "Deny", optionId: "reject" },
3815
+ { kind: "allow_once", name: "Allow Once", optionId: "allow" },
3598
3816
  {
3599
3817
  kind: "allow_always",
3600
- name: alwaysAllowLabel,
3818
+ name: "Always Allow",
3601
3819
  optionId: "allow_always",
3820
+ _meta: {
3821
+ permission: permissionMetadataForAlwaysAllow(suggestions, toolName),
3822
+ },
3602
3823
  },
3603
- { kind: "allow_once", name: "Allow", optionId: "allow" },
3604
- { kind: "reject_once", name: "Reject", optionId: "reject" },
3605
3824
  ],
3606
3825
  sessionId,
3607
3826
  toolCall: {
@@ -1 +1 @@
1
- {"version":3,"file":"elicitation.d.ts","sourceRoot":"","sources":["../src/elicitation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EACV,wBAAwB,EAKzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAC5F,OAAO,KAAK,EACV,oBAAoB,EAErB,MAAM,6CAA6C,CAAC;AAErD;;;;;;;;;;;;;GAaG;AAEH,yDAAyD;AACzD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,OAAO,CAAC;CACd,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,GAChB,wBAAwB,GAAG,IAAI,CAyBjC;AAgBD;;;GAGG;AACH,wBAAgB,uCAAuC,CACrD,QAAQ,EAAE,yBAAyB,GAClC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MAAM,MAAM,sBAAsB,GAChC;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEvF;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,yBAAyB,EACnC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,SAAS,EAAE,eAAe,EAAE,GAC3B,sBAAsB,CAkCxB;AAgBD;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AAEtE;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,qBAAqB,GAAG,IAAI,CAW9B;AAYD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,qBAAqB,EAC7B,SAAS,EAAE,MAAM,GAChB,wBAAwB,CA+B1B;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,yBAAyB,GAAG,MAAM,CAG7F"}
@@ -89,6 +89,13 @@ function questionCustomFieldKey(index) {
89
89
  * extensions (`_claude/...`).
90
90
  */
91
91
  const OPTION_META_KEY = "_claude/askUserQuestionOption";
92
+ /**
93
+ * Shared `_meta` key for marking a per-question free-text field as the custom
94
+ * answer companion for a select question. This intentionally has no
95
+ * agent-specific namespace so ACP clients can recognize the same marker across
96
+ * Codex, Claude, and other AskUserQuestion bridges.
97
+ */
98
+ const CUSTOM_ANSWER_META_KEY = "_askUserQuestionCustomAnswer";
92
99
  /**
93
100
  * Render the AskUserQuestion tool's questions as an ACP form elicitation.
94
101
  *
@@ -137,6 +144,12 @@ export function askUserQuestionsToCreateRequest(questions, sessionId, toolCallId
137
144
  type: "string",
138
145
  title: "Other",
139
146
  description: "Type your own answer instead of choosing an option above (optional).",
147
+ _meta: {
148
+ [CUSTOM_ANSWER_META_KEY]: {
149
+ questionId: questionFieldKey(index),
150
+ isCustomAnswer: true,
151
+ },
152
+ },
140
153
  };
141
154
  });
142
155
  const requestedSchema = {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.63.0-beta.1",
6
+ "version": "0.65.0-beta.1",
7
7
  "description": "An ACP-compatible coding agent powered by the Claude Agent SDK (TypeScript)",
8
8
  "main": "dist/lib.js",
9
9
  "types": "dist/lib.d.ts",
@@ -29,6 +29,7 @@
29
29
  "build": "tsc",
30
30
  "start": "node dist/index.js",
31
31
  "dev": "npm run build && npm run start",
32
+ "example:simple-client": "node --experimental-strip-types --disable-warning=ExperimentalWarning examples/simple-client.ts",
32
33
  "lint": "eslint src --ext .ts",
33
34
  "lint:fix": "eslint src --ext .ts --fix",
34
35
  "format": "prettier --write .",
@@ -76,7 +77,7 @@
76
77
  "@typescript-eslint/parser": "8.65.0",
77
78
  "eslint": "10.8.0",
78
79
  "eslint-config-prettier": "10.1.8",
79
- "globals": "17.8.0",
80
+ "globals": "17.9.0",
80
81
  "prettier": "3.9.6",
81
82
  "ts-node": "10.9.2",
82
83
  "typescript": "6.0.3",