@agentclientprotocol/claude-agent-acp 0.71.0 → 0.73.0

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, Query, SDKMessageOrigin, SDKPartialAssistantMessage, SDKUserMessage } from "@anthropic-ai/claude-agent-sdk";
2
+ import { AgentInfo, CanUseTool, FastModeDisabledReason, FastModeState, ModelInfo, Options, PermissionMode, Query, SDKMessageOrigin, SDKPartialAssistantMessage, SDKUserMessage, Settings } from "@anthropic-ai/claude-agent-sdk";
3
3
  import { GoalRequest, GoalControlResponse, GoalSnapshot } from "./goal-extension.js";
4
4
  import { SessionTitles } from "./session-titles.js";
5
5
  import { AcpSessionNotification } from "./acp-subagents.js";
@@ -333,6 +333,14 @@ export type Session = {
333
333
  * user's intent so it persists across model switches; the Fast mode config
334
334
  * option is only surfaced while the selected model supports it. */
335
335
  fastModeEnabled: boolean;
336
+ /** Whether the user picked a non-default effort through the ACP picker this
337
+ * session. A pin lives at the SDK's flag layer, which overrides the CLI's
338
+ * persisted effort (including the per-model `modelSettings` entries), so it
339
+ * follows the session across model switches; without one, the CLI resolves
340
+ * effort itself and the Effort option is display-only. Cleared when the
341
+ * user picks "Default" (the flag layer is cleared with it) or when a model
342
+ * switch clamps the pin away. */
343
+ effortPinnedByUser?: boolean;
336
344
  /** Why the SDK currently can't serve Fast mode, when the reason is one worth
337
345
  * telling the user about (see {@link FAST_MODE_UNAVAILABLE_EXPLANATIONS} —
338
346
  * routine states like the SDK's own opt-in requirement normalize to
@@ -734,8 +742,8 @@ export interface AcpClient {
734
742
  writeTextFile(params: WriteTextFileRequest): Promise<WriteTextFileResponse>;
735
743
  /** `signal`, when aborted, sends `$/cancel_request` for the in-flight
736
744
  * elicitation so the client can dismiss its prompt and settle our await. */
737
- unstable_createElicitation(params: CreateElicitationRequest, signal?: AbortSignal): Promise<CreateElicitationResponse>;
738
- unstable_completeElicitation(params: CompleteElicitationNotification): Promise<void>;
745
+ createElicitation(params: CreateElicitationRequest, signal?: AbortSignal): Promise<CreateElicitationResponse>;
746
+ completeElicitation(params: CompleteElicitationNotification): Promise<void>;
739
747
  /** Send a custom (extension) notification, e.g. `_claude/sdkMessage`. */
740
748
  extNotification(method: string, params: Record<string, unknown>): Promise<void>;
741
749
  }
@@ -929,13 +937,15 @@ export declare class ClaudeAcpAgent {
929
937
  private sendAvailableCommandsUpdate;
930
938
  private updateConfigOption;
931
939
  private applyConfigOptionValue;
932
- /** Reconcile adapter model state after the SDK persistently swapped the
933
- * session's model out from under us (refusal fallback). The SDK already
934
- * made the switch, so this must NOT call `query.setModel` — it only
935
- * updates our bookkeeping (currentModelId, context window, mode clamping,
936
- * effort/Fast-mode options) via the same `applyConfigOptionValue` path a
937
- * user-driven model change takes, then notifies the client. */
938
- private syncModelAfterRefusalFallback;
940
+ /** Reconcile adapter model state after the SDK switched the session's
941
+ * model out from under us — a refusal fallback, or any switch reported by
942
+ * the PostModelSwitch hook that the adapter didn't drive (e.g. a `/model`
943
+ * command typed as a prompt). The SDK already made the switch, so this
944
+ * must NOT call `query.setModel` — it only updates our bookkeeping
945
+ * (currentModelId, context window, mode clamping, effort/Fast-mode
946
+ * options) via the same `applyConfigOptionValue` path a user-driven model
947
+ * change takes, then notifies the client. */
948
+ private syncModelAfterExternalSwitch;
939
949
  /** Replace the Fast mode option in `session.configOptions` so it reflects
940
950
  * `enabled` (and the client's current boolean-capability). A no-op when the
941
951
  * option isn't present, so callers must confirm the current model surfaces
@@ -986,6 +996,16 @@ export declare class ClaudeAcpAgent {
986
996
  */
987
997
  private enqueueProviderUpdate;
988
998
  }
999
+ /** The effort level the CLI itself resolves for a model from the persisted
1000
+ * settings: the per-model entry (`modelSettings`, keyed by canonical model
1001
+ * name — the CLI persists /effort per model since 2.1.243) wins over the
1002
+ * legacy top-level `effortLevel`. Alias picker rows are looked up by their
1003
+ * resolved model id first, then the row value, then the raw config value
1004
+ * for models not in the picker. Exact keys only — the CLI's canonical-form
1005
+ * fallback matching isn't replicated, so a miss simply falls back to the
1006
+ * top-level value (best-effort display; `buildConfigOptions` still
1007
+ * validates the result against the model's supported levels). */
1008
+ export declare function settingsEffortForModel(settings: Settings, modelInfo: ModelInfo | undefined, modelId?: string): string | undefined;
989
1009
  export declare const BUILTIN_AGENT_NAMES: Set<string>;
990
1010
  /** Discover user/plugin/project-configured main-thread agents, excluding the
991
1011
  * built-in subagents and the reserved "default" sentinel. Returns an empty
@@ -1066,7 +1086,7 @@ export declare function resolveModelPreference(models: ModelInfo[], preference:
1066
1086
  * 4. `resolveModelPreference` over the picker entries.
1067
1087
  * 5. A model with no picker counterpart (e.g. excluded by an
1068
1088
  * `availableModels` allowlist) is tracked verbatim, mirroring
1069
- * `syncModelAfterRefusalFallback`: the picker shows no selection, but the
1089
+ * `syncModelAfterExternalSwitch`: the picker shows no selection, but the
1070
1090
  * model-dependent bookkeeping stays truthful to what the SDK is running. */
1071
1091
  export declare function matchResumedModel(models: ModelInfo[], liveModel: string): ModelInfo;
1072
1092
  /**
@@ -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,EAClB,aAAa,EACb,cAAc,EAEd,mBAAmB,EACnB,oBAAoB,EAEpB,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,6BAA6B,EAC7B,8BAA8B,EAC9B,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EAEtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,SAAS,EACT,UAAU,EAGV,sBAAsB,EACtB,aAAa,EAKb,SAAS,EAIT,OAAO,EACP,cAAc,EAEd,KAAK,EAKL,gBAAgB,EAChB,0BAA0B,EAC1B,cAAc,EAGf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAKL,WAAW,EACX,mBAAmB,EACnB,YAAY,EAIb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAiB,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAEL,sBAAsB,EAIvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,cAAc,EACd,qBAAqB,EACtB,MAAM,uBAAuB,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mB,EAAE,CAyavB;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,CAAC,MAAM,CAAC,EAAE,MAAM;;;EAqDrC"}
package/dist/acp-agent.js CHANGED
@@ -495,12 +495,12 @@ class ClientConnection {
495
495
  writeTextFile(params) {
496
496
  return this.ctx.request(methods.client.fs.writeTextFile, params);
497
497
  }
498
- unstable_createElicitation(params, signal) {
498
+ createElicitation(params, signal) {
499
499
  return this.ctx.request(methods.client.elicitation.create, params, {
500
500
  cancellationSignal: signal,
501
501
  });
502
502
  }
503
- unstable_completeElicitation(params) {
503
+ completeElicitation(params) {
504
504
  return this.ctx.notify(methods.client.elicitation.complete, params);
505
505
  }
506
506
  extNotification(method, params) {
@@ -594,7 +594,7 @@ async function authenticateMcpServer(host, sessionId, query, serverName) {
594
594
  abortFlow();
595
595
  try {
596
596
  const completed = waitForMcpAuthentication(host.sessions, sessionId, query, serverName, flowAbort.signal);
597
- const elicitation = host.client.unstable_createElicitation({
597
+ const elicitation = host.client.createElicitation({
598
598
  mode: "url",
599
599
  sessionId,
600
600
  message: `Authenticate with MCP server ${serverName}`,
@@ -612,7 +612,7 @@ async function authenticateMcpServer(host, sessionId, query, serverName) {
612
612
  await completed;
613
613
  }
614
614
  try {
615
- await host.client.unstable_completeElicitation({ elicitationId });
615
+ await host.client.completeElicitation({ elicitationId });
616
616
  }
617
617
  catch (error) {
618
618
  if (!flowAbort.signal.aborted) {
@@ -1546,12 +1546,20 @@ export class ClaudeAcpAgent {
1546
1546
  *
1547
1547
  * But an echo-less result can also be an ORPHAN: cancel() settles+removes a
1548
1548
  * queued turn whose user message was already pushed, so the SDK still runs
1549
- * it and emits a result with no uuid to match. Promoting the head for an
1549
+ * it and emits a result with no echo to match. Promoting the head for an
1550
1550
  * orphan would misattribute its stop reason/usage to an unrelated later
1551
1551
  * prompt. `session.pendingOrphanResults` counts exactly how many such
1552
1552
  * orphans are still expected (FIFO, they arrive before any live turn's
1553
- * result), so we skip those and only promote once the count is drained. */
1554
- const ensureActiveTurn = () => {
1553
+ * result), so we skip those and only promote once the count is drained.
1554
+ *
1555
+ * `resultUserMessageUuid` is the result's own join key (SDK 0.3.246+
1556
+ * echoes the triggering send's client uuid on results; absent on older
1557
+ * CLIs, synthetic/meta turns, and session-scoped failures). When present
1558
+ * it upgrades the map lane from positional heuristics to an exact match:
1559
+ * a stamp naming an orphaned command consumes the result outright, and a
1560
+ * stamp naming anything else positively refutes "this is a dead turn's
1561
+ * result", so the dup-over-loss one-skip must not eat it. */
1562
+ const ensureActiveTurn = (resultUserMessageUuid) => {
1555
1563
  if (session.activeTurn) {
1556
1564
  if (!isHeldOpen(session.activeTurn)) {
1557
1565
  return;
@@ -1603,8 +1611,12 @@ export class ClaudeAcpAgent {
1603
1611
  // double-consume it. The unexpected-transition logging in the frame
1604
1612
  // handler is the tripwire for that class of drift.
1605
1613
  if (session.orphanCommands?.size) {
1614
+ const stampedOrphan = resultUserMessageUuid !== undefined && session.orphanCommands.has(resultUserMessageUuid);
1606
1615
  let consumedOrphanResult = false;
1607
1616
  let oldestPending;
1617
+ // The started/zombie drain applies regardless of the stamp: commands
1618
+ // folded into the turn that emitted this result share it, and zombies'
1619
+ // late results have already passed (or never existed).
1608
1620
  for (const [uuid, state] of session.orphanCommands) {
1609
1621
  if (state === "started" || state === "zombie") {
1610
1622
  consumedOrphanResult = true;
@@ -1614,17 +1626,33 @@ export class ClaudeAcpAgent {
1614
1626
  oldestPending ??= uuid;
1615
1627
  }
1616
1628
  }
1617
- if (consumedOrphanResult) {
1629
+ if (stampedOrphan) {
1630
+ // Exact join: the result names an orphaned command. Delete the
1631
+ // matched entry even when it is still "pending" (its dispatch frame
1632
+ // was lost) and consume the result — no promotion.
1633
+ session.orphanCommands.delete(resultUserMessageUuid);
1618
1634
  return;
1619
1635
  }
1620
- if (oldestPending !== undefined) {
1621
- // No dispatch was seen before this result, so it is very likely a
1622
- // live turn's — but a lost "started" frame would mean it IS the
1623
- // orphan's (dup-over-loss: prefer one wrong skip over
1624
- // misattributing a dead turn's outcome to a live prompt). Grant
1625
- // each pending entry exactly one skip, like the count lane did.
1626
- session.orphanCommands.delete(oldestPending);
1627
- return;
1636
+ if (resultUserMessageUuid !== undefined) {
1637
+ // The stamp names a send that is NOT in the orphan map, so this is
1638
+ // a live turn's result: skip both the consumed-return (its folded
1639
+ // orphans were drained above, but the result itself still needs a
1640
+ // turn) and the dup-over-loss one-skip the stamp refutes, and fall
1641
+ // through to promote the head.
1642
+ }
1643
+ else {
1644
+ if (consumedOrphanResult) {
1645
+ return;
1646
+ }
1647
+ if (oldestPending !== undefined) {
1648
+ // No dispatch was seen before this result, so it is very likely a
1649
+ // live turn's — but a lost "started" frame would mean it IS the
1650
+ // orphan's (dup-over-loss: prefer one wrong skip over
1651
+ // misattributing a dead turn's outcome to a live prompt). Grant
1652
+ // each pending entry exactly one skip, like the count lane did.
1653
+ session.orphanCommands.delete(oldestPending);
1654
+ return;
1655
+ }
1628
1656
  }
1629
1657
  }
1630
1658
  const head = firstUnsettledQueuedTurn();
@@ -2563,7 +2591,7 @@ export class ClaudeAcpAgent {
2563
2591
  // client supports url elicitation; ignore failures otherwise.
2564
2592
  if (this.clientCapabilities?.elicitation?.url) {
2565
2593
  try {
2566
- await this.client.unstable_completeElicitation({
2594
+ await this.client.completeElicitation({
2567
2595
  elicitationId: message.elicitation_id,
2568
2596
  });
2569
2597
  }
@@ -2651,7 +2679,7 @@ export class ClaudeAcpAgent {
2651
2679
  });
2652
2680
  }
2653
2681
  if (persistent) {
2654
- await this.syncModelAfterRefusalFallback(params.sessionId, session, message.fallback_model);
2682
+ await this.syncModelAfterExternalSwitch(params.sessionId, session, message.fallback_model);
2655
2683
  }
2656
2684
  break;
2657
2685
  }
@@ -2756,7 +2784,7 @@ export class ClaudeAcpAgent {
2756
2784
  // the map in that case).
2757
2785
  if (!isAutonomousResult) {
2758
2786
  recordResultForOrphanCommands();
2759
- ensureActiveTurn();
2787
+ ensureActiveTurn(message.user_message_uuid);
2760
2788
  // Once the submitted goal command has produced its own result,
2761
2789
  // no older runtime update can still precede it in the ordered
2762
2790
  // SDK stream. Stop suppressing updates even when this runtime
@@ -2952,13 +2980,28 @@ export class ClaudeAcpAgent {
2952
2980
  if (message.is_error &&
2953
2981
  isEmptyUserInterruptionDiagnostic(message) &&
2954
2982
  (session.pendingEmptyInterruptionDiagnosticCommands?.size ?? 0) > 0) {
2955
- const commandUuid = session
2956
- .pendingEmptyInterruptionDiagnosticCommands.values()
2957
- .next().value;
2958
- if (commandUuid) {
2959
- session.pendingEmptyInterruptionDiagnosticCommands.delete(commandUuid);
2983
+ const pending = session.pendingEmptyInterruptionDiagnosticCommands;
2984
+ const stamped = message.user_message_uuid;
2985
+ if (stamped === undefined) {
2986
+ // Older producer: no join key on the result, so consume an
2987
+ // arbitrary hand-off token like before.
2988
+ const commandUuid = pending.values().next().value;
2989
+ if (commandUuid) {
2990
+ pending.delete(commandUuid);
2991
+ }
2992
+ break;
2960
2993
  }
2961
- break;
2994
+ if (pending.delete(stamped)) {
2995
+ // Exact join (SDK 0.3.246+ echoes the triggering send's
2996
+ // uuid on error results): the diagnostic names a cancelled
2997
+ // command we handed a token for — swallow it.
2998
+ break;
2999
+ }
3000
+ // Stamped but unmatched: this diagnostic belongs to a send we
3001
+ // did NOT cancel — a live turn's real failure. Don't let a
3002
+ // stale token eat it; fall through to the ordinary failure
3003
+ // lanes (the clear below retires the stale tokens, same as
3004
+ // every other non-diagnostic result path).
2962
3005
  }
2963
3006
  // Some CLI versions omit the cancelled cycle's diagnostic. Do
2964
3007
  // not let an unused hand-off token swallow a later turn's real
@@ -3799,8 +3842,10 @@ export class ClaudeAcpAgent {
3799
3842
  }
3800
3843
  // Each removed queued turn's user message was already pushed to the SDK,
3801
3844
  // which processes input FIFO and will still emit a result for it with no
3802
- // uuid to match. Track those so the consumer skips them (see
3803
- // ensureActiveTurn) rather than misattributing them to the head.
3845
+ // user echo to match (0.3.246+ CLIs do stamp results with the
3846
+ // triggering send's user_message_uuid, which ensureActiveTurn uses as
3847
+ // an exact join when present). Track those so the consumer skips them
3848
+ // (see ensureActiveTurn) rather than misattributing them to the head.
3804
3849
  // msg_lifecycle_v1 CLIs get per-uuid tracking drained by the command's
3805
3850
  // own terminal lifecycle frame — exact under command coalescing, where
3806
3851
  // N queued commands fold into ONE turn emitting one result and a plain
@@ -4690,7 +4735,7 @@ export class ClaudeAcpAgent {
4690
4735
  return { action: "decline" };
4691
4736
  }
4692
4737
  try {
4693
- const response = await this.withPendingUserInput(sessionId, () => this.client.unstable_createElicitation(createRequest, signal));
4738
+ const response = await this.withPendingUserInput(sessionId, () => this.client.createElicitation(createRequest, signal));
4694
4739
  if (signal.aborted) {
4695
4740
  return { action: "cancel" };
4696
4741
  }
@@ -4720,7 +4765,7 @@ export class ClaudeAcpAgent {
4720
4765
  const createRequest = askUserQuestionsToCreateRequest(questions, sessionId, toolUseID);
4721
4766
  let response;
4722
4767
  try {
4723
- response = await this.withPendingUserInput(sessionId, () => this.client.unstable_createElicitation(createRequest, signal));
4768
+ response = await this.withPendingUserInput(sessionId, () => this.client.createElicitation(createRequest, signal));
4724
4769
  }
4725
4770
  catch (error) {
4726
4771
  // A cancellation we requested (signal aborted) settles as an aborted tool
@@ -4760,7 +4805,7 @@ export class ClaudeAcpAgent {
4760
4805
  }
4761
4806
  let response;
4762
4807
  try {
4763
- response = await this.withPendingUserInput(sessionId, () => this.client.unstable_createElicitation(refusalFallbackToCreateRequest(prompt, sessionId), signal));
4808
+ response = await this.withPendingUserInput(sessionId, () => this.client.createElicitation(refusalFallbackToCreateRequest(prompt, sessionId), signal));
4764
4809
  }
4765
4810
  catch (error) {
4766
4811
  // A cancellation we requested (signal aborted) is expected teardown;
@@ -4840,10 +4885,21 @@ export class ClaudeAcpAgent {
4840
4885
  if (session.fastModeDisabledReason === "model_not_allowed") {
4841
4886
  session.fastModeDisabledReason = undefined;
4842
4887
  }
4843
- // Rebuild config options since effort levels depend on the selected model
4888
+ // Rebuild config options since effort levels depend on the selected
4889
+ // model. The effort seed depends on who owns the choice: a user pin
4890
+ // made through the ACP picker this session lives at the SDK's flag
4891
+ // layer and follows the session across switches, so carry it forward.
4892
+ // Otherwise the CLI resolves effort itself from the persisted settings
4893
+ // — the NEW model's `modelSettings` entry first (the CLI persists
4894
+ // /effort per model), then the legacy top-level value — so display
4895
+ // what it will actually run instead of dragging the old model's value
4896
+ // along.
4844
4897
  const effortOpt = session.configOptions.find((o) => o.id === EFFORT_CONFIG_ID);
4845
4898
  const currentEffort = typeof effortOpt?.currentValue === "string" ? effortOpt.currentValue : undefined;
4846
- session.configOptions = buildConfigOptions(session.modes, session.models, session.modelInfos, currentEffort, session.agents, session.currentAgent, {
4899
+ const seedEffort = session.effortPinnedByUser
4900
+ ? currentEffort
4901
+ : settingsEffortForModel(session.settingsManager.getSettings(), newModelInfo, value);
4902
+ session.configOptions = buildConfigOptions(session.modes, session.models, session.modelInfos, seedEffort, session.agents, session.currentAgent, {
4847
4903
  // The toggle follows the newly selected model: it disappears when the
4848
4904
  // model lacks fast support and reappears (with the retained user
4849
4905
  // intent) when a supporting model is selected again.
@@ -4852,13 +4908,24 @@ export class ClaudeAcpAgent {
4852
4908
  useBooleanOption: clientSupportsBooleanConfigOptions(this.clientCapabilities),
4853
4909
  disabledReason: session.fastModeDisabledReason,
4854
4910
  });
4855
- // Sync effort with the SDK if it changed after the model switch
4856
- const newEffortOpt = session.configOptions.find((o) => o.id === EFFORT_CONFIG_ID);
4857
- const newEffort = typeof newEffortOpt?.currentValue === "string" ? newEffortOpt.currentValue : undefined;
4858
- if (newEffort !== currentEffort) {
4859
- await session.query.applyFlagSettings({
4860
- effortLevel: toSdkEffortLevel(newEffort),
4861
- });
4911
+ // Sync effort with the SDK only when a user pin changed across the
4912
+ // switch — i.e. the new model clamped it away (buildConfigOptions
4913
+ // validated the seed against the new model's levels), where the flag
4914
+ // must be cleared too or the SDK would keep running the old pin
4915
+ // invisibly. Settings-derived seeds are display-only: the CLI resolves
4916
+ // persisted effort itself, and pinning it at the flag layer would
4917
+ // shadow the per-model values on every later switch.
4918
+ if (session.effortPinnedByUser) {
4919
+ const newEffortOpt = session.configOptions.find((o) => o.id === EFFORT_CONFIG_ID);
4920
+ const newEffort = typeof newEffortOpt?.currentValue === "string" ? newEffortOpt.currentValue : undefined;
4921
+ if (newEffort !== currentEffort) {
4922
+ await session.query.applyFlagSettings({
4923
+ effortLevel: toSdkEffortLevel(newEffort),
4924
+ });
4925
+ if (newEffort === undefined || newEffort === "default") {
4926
+ session.effortPinnedByUser = false;
4927
+ }
4928
+ }
4862
4929
  }
4863
4930
  // Emit current_mode_update only after session.modes AND
4864
4931
  // session.configOptions have been fully reconciled. This way, a failure
@@ -4888,37 +4955,43 @@ export class ClaudeAcpAgent {
4888
4955
  await session.query.applyFlagSettings({
4889
4956
  effortLevel: toSdkEffortLevel(value),
4890
4957
  });
4958
+ // "Default" clears the flag layer (toSdkEffortLevel → null), handing
4959
+ // effort back to the CLI's persisted per-model resolution — so it
4960
+ // un-pins; any other pick pins effort for the session.
4961
+ session.effortPinnedByUser = value !== "default";
4891
4962
  }
4892
4963
  }
4893
4964
  }
4894
- /** Reconcile adapter model state after the SDK persistently swapped the
4895
- * session's model out from under us (refusal fallback). The SDK already
4896
- * made the switch, so this must NOT call `query.setModel` — it only
4897
- * updates our bookkeeping (currentModelId, context window, mode clamping,
4898
- * effort/Fast-mode options) via the same `applyConfigOptionValue` path a
4899
- * user-driven model change takes, then notifies the client. */
4900
- async syncModelAfterRefusalFallback(sessionId, session, fallbackModel) {
4965
+ /** Reconcile adapter model state after the SDK switched the session's
4966
+ * model out from under us — a refusal fallback, or any switch reported by
4967
+ * the PostModelSwitch hook that the adapter didn't drive (e.g. a `/model`
4968
+ * command typed as a prompt). The SDK already made the switch, so this
4969
+ * must NOT call `query.setModel` — it only updates our bookkeeping
4970
+ * (currentModelId, context window, mode clamping, effort/Fast-mode
4971
+ * options) via the same `applyConfigOptionValue` path a user-driven model
4972
+ * change takes, then notifies the client. */
4973
+ async syncModelAfterExternalSwitch(sessionId, session, switchedModel) {
4901
4974
  // Map the SDK-reported model onto one of the session's model options
4902
- // (handles display names and `resolvedModel` ids). The fallback model may
4903
- // not be among the options — e.g. excluded by the user's
4975
+ // (handles display names and `resolvedModel` ids). The switched-to model
4976
+ // may not be among the options — e.g. excluded by the user's
4904
4977
  // `availableModels` allowlist — in which case we track the raw id: the
4905
4978
  // picker shows no selection, but the model-dependent bookkeeping and any
4906
4979
  // later `setModel` round-trip stay truthful to what the SDK is running.
4907
- const resolved = resolveModelPreference(session.modelInfos, fallbackModel);
4908
- const value = resolved?.value ?? fallbackModel;
4980
+ const resolved = resolveModelPreference(session.modelInfos, switchedModel);
4981
+ const value = resolved?.value ?? switchedModel;
4909
4982
  if (session.models.currentModelId === value)
4910
4983
  return;
4911
4984
  try {
4912
4985
  await this.updateConfigOption(sessionId, MODEL_CONFIG_ID, value);
4913
4986
  }
4914
4987
  catch (err) {
4915
- // This runs on the consumer loop: a throw here tears down the query
4916
- // stream (failAllTurns + closeQueryStream) and bricks the session —
4917
- // far worse than stale bookkeeping. The user-driven RPC path lets the
4918
- // same errors propagate to fail just that request; here we log and
4919
- // move on, matching the setPermissionMode containment inside
4920
- // applyConfigOptionValue.
4921
- this.logger.error(`Failed to reconcile model state after refusal fallback to "${fallbackModel}":`, err);
4988
+ // This runs on the consumer loop (or detached from a hook callback): a
4989
+ // throw here tears down the query stream (failAllTurns +
4990
+ // closeQueryStream) and bricks the session — far worse than stale
4991
+ // bookkeeping. The user-driven RPC path lets the same errors propagate
4992
+ // to fail just that request; here we log and move on, matching the
4993
+ // setPermissionMode containment inside applyConfigOptionValue.
4994
+ this.logger.error(`Failed to reconcile model state after external switch to "${switchedModel}":`, err);
4922
4995
  }
4923
4996
  }
4924
4997
  /** Replace the Fast mode option in `session.configOptions` so it reflects
@@ -5305,6 +5378,43 @@ export class ClaudeAcpAgent {
5305
5378
  ],
5306
5379
  },
5307
5380
  ],
5381
+ // Mirror model switches the adapter didn't drive into the ACP picker
5382
+ // and the model-dependent bookkeeping (context window, mode clamping,
5383
+ // effort/Fast-mode options). Without this, a `/model <name>` command
5384
+ // typed as a prompt — which the CLI executes as a local command —
5385
+ // switches the session's model with no refusal-fallback frame, and
5386
+ // the client's picker silently drifts. `source: 'sdk'` is the
5387
+ // adapter's own setModel (applyConfigOptionValue already synced it),
5388
+ // and 'resume' restores are read back via readResumedLiveModel, so
5389
+ // only the remaining sources sync here (CLI 2.1.251+; older CLIs
5390
+ // never fire the hook and keep the pre-hook behavior).
5391
+ PostModelSwitch: [
5392
+ ...(userProvidedOptions?.hooks?.PostModelSwitch || []),
5393
+ {
5394
+ hooks: [
5395
+ async (input) => {
5396
+ if (input.hook_event_name === "PostModelSwitch" &&
5397
+ input.source !== "sdk" &&
5398
+ input.source !== "resume") {
5399
+ // Don't run the sync before answering the hook: the sync
5400
+ // can issue applyFlagSettings (an outgoing control request)
5401
+ // while the CLI is awaiting this hook's response, and SDK
5402
+ // control requests are serialized over one channel.
5403
+ // syncModelAfterExternalSwitch contains its own errors, so
5404
+ // the detached call can't surface an unhandled rejection.
5405
+ const toModel = input.to_model;
5406
+ setImmediate(() => {
5407
+ const live = this.sessions[sessionId];
5408
+ if (!live)
5409
+ return;
5410
+ void this.syncModelAfterExternalSwitch(sessionId, live, toModel);
5411
+ });
5412
+ }
5413
+ return { continue: true };
5414
+ },
5415
+ ],
5416
+ },
5417
+ ],
5308
5418
  ...(fileChangeAuditSupport
5309
5419
  ? {
5310
5420
  Stop: [
@@ -5407,7 +5517,7 @@ export class ClaudeAcpAgent {
5407
5517
  // (current and future); the identity fields are overridden because the
5408
5518
  // fuzzy-matched sibling's resolvedModel/displayName/description can
5409
5519
  // describe a different context lane and would poison later resolvedModel
5410
- // matching (syncModelAfterRefusalFallback) and context-window inference
5520
+ // matching (syncModelAfterExternalSwitch) and context-window inference
5411
5521
  // (applyConfigOptionValue) if they traveled under this id.
5412
5522
  const modelInfos = fallbackModelInfo
5413
5523
  ? [
@@ -5456,16 +5566,15 @@ export class ClaudeAcpAgent {
5456
5566
  useBooleanOption: clientSupportsBooleanConfigOptions(this.clientCapabilities),
5457
5567
  disabledReason: fastModeDisabledReason,
5458
5568
  };
5459
- const configOptions = buildConfigOptions(modes, models, modelInfos, settingsManager.getSettings().effortLevel, agents, currentAgent, fastMode);
5460
- // Apply the initial effort level to the SDK so it matches the UI default
5461
- const initialEffort = configOptions.find((o) => o.id === EFFORT_CONFIG_ID);
5462
- if (initialEffort &&
5463
- typeof initialEffort.currentValue === "string" &&
5464
- initialEffort.currentValue !== "default") {
5465
- await q.applyFlagSettings({
5466
- effortLevel: toSdkEffortLevel(initialEffort.currentValue),
5467
- });
5468
- }
5569
+ // The Effort picker seed mirrors what the CLI itself resolves from the
5570
+ // persisted settings — the current model's `modelSettings` entry first
5571
+ // (the CLI persists /effort per model), then the legacy top-level value.
5572
+ // Display-only: no applyFlagSettings here. The CLI reads the same
5573
+ // settings, so pinning the seed at the flag layer was always redundant —
5574
+ // and it would override the CLI's own per-model restore on every later
5575
+ // model switch. Only a user's explicit ACP picker choice pins the flag
5576
+ // (see applyConfigOptionValue / Session.effortPinnedByUser).
5577
+ const configOptions = buildConfigOptions(modes, models, modelInfos, settingsEffortForModel(settingsManager.getSettings(), currentModelInfo), agents, currentAgent, fastMode);
5469
5578
  // Seed the context window WITHOUT any extra IPC on the session/new path.
5470
5579
  // On session/load, the resumed session's own `getContextUsage` report — a
5471
5580
  // response `getAvailableModels` already awaited to learn the live model
@@ -5857,6 +5966,27 @@ function isValidBaseUrl(baseUrl) {
5857
5966
  function toSdkEffortLevel(value) {
5858
5967
  return value === undefined || value === "default" ? null : value;
5859
5968
  }
5969
+ /** The effort level the CLI itself resolves for a model from the persisted
5970
+ * settings: the per-model entry (`modelSettings`, keyed by canonical model
5971
+ * name — the CLI persists /effort per model since 2.1.243) wins over the
5972
+ * legacy top-level `effortLevel`. Alias picker rows are looked up by their
5973
+ * resolved model id first, then the row value, then the raw config value
5974
+ * for models not in the picker. Exact keys only — the CLI's canonical-form
5975
+ * fallback matching isn't replicated, so a miss simply falls back to the
5976
+ * top-level value (best-effort display; `buildConfigOptions` still
5977
+ * validates the result against the model's supported levels). */
5978
+ export function settingsEffortForModel(settings, modelInfo, modelId) {
5979
+ const modelSettings = settings.modelSettings;
5980
+ if (modelSettings) {
5981
+ for (const key of [modelInfo?.resolvedModel, modelInfo?.value, modelId]) {
5982
+ const perModel = key !== undefined ? modelSettings[key]?.effortLevel : undefined;
5983
+ if (typeof perModel === "string") {
5984
+ return perModel;
5985
+ }
5986
+ }
5987
+ }
5988
+ return settings.effortLevel;
5989
+ }
5860
5990
  // `supportedAgents()` always returns Claude Code's built-in subagents — the
5861
5991
  // ones used for Task-tool delegation (Explore, Plan, etc.) — even when the user
5862
5992
  // has configured none of their own. Those aren't meaningful *main-thread*
@@ -6228,7 +6358,7 @@ export function resolveModelPreference(models, preference) {
6228
6358
  * 4. `resolveModelPreference` over the picker entries.
6229
6359
  * 5. A model with no picker counterpart (e.g. excluded by an
6230
6360
  * `availableModels` allowlist) is tracked verbatim, mirroring
6231
- * `syncModelAfterRefusalFallback`: the picker shows no selection, but the
6361
+ * `syncModelAfterExternalSwitch`: the picker shows no selection, but the
6232
6362
  * model-dependent bookkeeping stays truthful to what the SDK is running. */
6233
6363
  export function matchResumedModel(models, liveModel) {
6234
6364
  const live = canonicalizeModelId(liveModel);
@@ -6345,6 +6475,14 @@ export function applyAvailableModelsAllowlist(sdkModels, allowlist, settingsMode
6345
6475
  * #596). Best-effort: a control-request failure is logged and returns nulls
6346
6476
  * so callers keep their current choice; failing the whole session/load over
6347
6477
  * an unreadable report would be worse. */
6478
+ /** Whether a rejected `setModel` was vetoed by a user-configured
6479
+ * PreModelSwitch hook. The CLI's rejection message is the stable,
6480
+ * distinguishable marker ("Model switch blocked by a PreModelSwitch hook:
6481
+ * <reason>"); a format change makes this stop matching and the failure
6482
+ * falls back to the ordinary fail-loud path, no worse than before. */
6483
+ function isPreModelSwitchHookBlock(error) {
6484
+ return error instanceof Error && error.message.includes("blocked by a PreModelSwitch hook");
6485
+ }
6348
6486
  async function readResumedLiveModel(query, models, logger) {
6349
6487
  try {
6350
6488
  const usage = await query.getContextUsage();
@@ -6426,12 +6564,29 @@ async function getAvailableModels(query, models, sdkModels, settingsManager, log
6426
6564
  // containment in createSession). The SDK then stayed on the
6427
6565
  // transcript's model, so read that back rather than reporting the
6428
6566
  // pin the session isn't running.
6429
- if (!isResumedSession)
6430
- throw error;
6431
- logger.error(`Failed to re-assert model "${currentModel.value}" on resume:`, error);
6432
- const live = await readResumedLiveModel(query, models, logger);
6433
- currentModel = live.model ?? currentModel;
6434
- resumedContextWindow = live.contextWindow;
6567
+ //
6568
+ // One fresh-session failure is advisory, not defining: a
6569
+ // user-configured PreModelSwitch hook can veto the pin (CLI 2.1.251+;
6570
+ // 'deny', or 'ask' — which headless sessions refuse), and the SDK
6571
+ // rejects setModel with "Model switch blocked by a PreModelSwitch
6572
+ // hook: …". Terminal Claude Code never lets a hook veto its startup
6573
+ // model (the spawn model isn't a switch), so failing session/new here
6574
+ // would make the same hook config fatal only over ACP. The session
6575
+ // stays on the SDK's own default — report that. We can't read the
6576
+ // live model back on this path: getContextUsage isn't serviced on a
6577
+ // fresh session until the first prompt turn (issues #886/#880).
6578
+ if (!isResumedSession) {
6579
+ if (!isPreModelSwitchHookBlock(error))
6580
+ throw error;
6581
+ logger.error(`Model pin "${currentModel.value}" was vetoed by a PreModelSwitch hook; staying on the default model:`, error);
6582
+ currentModel = models[0];
6583
+ }
6584
+ else {
6585
+ logger.error(`Failed to re-assert model "${currentModel.value}" on resume:`, error);
6586
+ const live = await readResumedLiveModel(query, models, logger);
6587
+ currentModel = live.model ?? currentModel;
6588
+ resumedContextWindow = live.contextWindow;
6589
+ }
6435
6590
  }
6436
6591
  }
6437
6592
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACT,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAaL,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,gBAAgB,EAKjB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAGL,oBAAoB,EAEpB,6BAA6B,EAE9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,yCAAyC,EAGzC,qCAAqC,EAGrC,kCAAkC,EAGlC,+CAA+C,EAI/C,wBAAwB,EACxB,kCAAkC,EAIlC,gCAAgC,EAEhC,iCAAiC,EAClC,MAAM,sCAAsC,CAAC;AA2B9C,UAAU,QAAQ;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,eAAe,EAAE,CAAC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S,GAAG,SAAS,EAAE,CAMpE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQnD;AAuBD;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAAC,YAAY,EAAE,OAAO,GAAG;IACrE,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAChC,CAiEA;AAkBD,eAAO,MAAM,oBAAoB,GAC/B,WAAW,MAAM,EACjB,wBAEG;IACD,iBAAiB,CAAC,EAAE,CAClB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,OAAO,EAClB,YAAY,EAAE,OAAO,KAClB,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB,EACD,UAAU,MAAM,SAOjB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAI9D;AAED;8EAC8E;AAC9E,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAK5D;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAIxD;AAGD,eAAO,MAAM,qBAAqB,GAC/B,UAAU;IAAE,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,KAAG,YAoBtD,CAAC;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GACxB,SAAS;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,KAAG,YAsBpE,CAAC"}
package/dist/tools.js CHANGED
@@ -413,6 +413,45 @@ function stripAgentTrailerFromContent(content) {
413
413
  }
414
414
  return content;
415
415
  }
416
+ /** Leading model-directed note the CLI prepends to a subagent's report when
417
+ * the agent stopped at its maxTurns limit (CLI 2.1.246+); the result still
418
+ * ships as `status: "completed"`. Two body variants follow this prefix, and
419
+ * the trailing "Send the agent a message (SendMessage) …" sentence is
420
+ * omitted for some agent types — anchor only the stable prefix so a format
421
+ * change makes the replacement stop matching rather than mangle a report. */
422
+ const PARTIAL_OUTPUT_NOTE = /^NOTE: this agent stopped at its \d+-turn limit before finishing\./;
423
+ /** Client-facing replacement: the partial-output fact matters to the user,
424
+ * but the SendMessage continuation instruction is model-directed and
425
+ * meaningless over ACP. */
426
+ const PARTIAL_OUTPUT_LABEL = "[Agent stopped at its turn limit — the output below is partial]";
427
+ /** Replace a leading partial-output note paragraph with the concise
428
+ * client-facing label, leaving the report that follows intact. */
429
+ function replacePartialNoteInText(text) {
430
+ if (!PARTIAL_OUTPUT_NOTE.test(text))
431
+ return text;
432
+ const paragraphEnd = text.indexOf("\n\n");
433
+ const report = paragraphEnd === -1 ? "" : text.slice(paragraphEnd + 2).trimStart();
434
+ return report ? `${PARTIAL_OUTPUT_LABEL}\n\n${report}` : PARTIAL_OUTPUT_LABEL;
435
+ }
436
+ /** Apply {@link replacePartialNoteInText} to an Agent/Task result `content`.
437
+ * In the structured AgentOutput lane the note is its own leading text block;
438
+ * in the raw lane it is the first paragraph of the text — both reduce to
439
+ * transforming the first text block (or the plain string). */
440
+ function replacePartialOutputNote(content) {
441
+ if (typeof content === "string") {
442
+ return replacePartialNoteInText(content);
443
+ }
444
+ if (Array.isArray(content) && content.length > 0) {
445
+ const [first, ...rest] = content;
446
+ if (first !== null &&
447
+ typeof first === "object" &&
448
+ first.type === "text" &&
449
+ typeof first.text === "string") {
450
+ return [{ ...first, text: replacePartialNoteInText(first.text) }, ...rest];
451
+ }
452
+ }
453
+ return content;
454
+ }
416
455
  export function toolUpdateFromToolResult(toolResult, toolUse, supportsTerminalOutput = false, toolUseResult) {
417
456
  if ("is_error" in toolResult &&
418
457
  toolResult.is_error &&
@@ -649,7 +688,11 @@ export function toolUpdateFromToolResult(toolResult, toolUse, supportsTerminalOu
649
688
  // A completed subagent can end with zero text blocks; an empty
650
689
  // structured render would beat the raw fallback for no benefit.
651
690
  structured.content.length > 0) {
652
- return toAcpContentUpdate(structured.content, "is_error" in toolResult ? toolResult.is_error : false);
691
+ return toAcpContentUpdate(
692
+ // A maxTurns-stopped subagent still completes, with a model-directed
693
+ // partial-output note prepended to its report — swap it for a
694
+ // client-facing label (see PARTIAL_OUTPUT_NOTE).
695
+ replacePartialOutputNote(structured.content), "is_error" in toolResult ? toolResult.is_error : false);
653
696
  }
654
697
  // No structured report to render from (replayed sessions —
655
698
  // getSessionMessages doesn't expose the transcript's toolUseResult —
@@ -658,7 +701,10 @@ export function toolUpdateFromToolResult(toolResult, toolUse, supportsTerminalOu
658
701
  // tail-anchored strip is the only cleanup available; if the trailer
659
702
  // format changes it simply stops matching and the full raw text
660
703
  // renders, no worse than before.
661
- return toAcpContentUpdate(stripAgentTrailerFromContent(toolResult.content), "is_error" in toolResult ? toolResult.is_error : false);
704
+ return toAcpContentUpdate(
705
+ // Head and tail cleanups are independent: the partial-output note
706
+ // leads the raw text the same way it leads the structured content.
707
+ replacePartialOutputNote(stripAgentTrailerFromContent(toolResult.content)), "is_error" in toolResult ? toolResult.is_error : false);
662
708
  }
663
709
  case "Skill": {
664
710
  return {};
@@ -711,6 +757,15 @@ export function toolUpdateFromToolResult(toolResult, toolUse, supportsTerminalOu
711
757
  function formatWebSearchHit(hit) {
712
758
  return `${hit.title} (${hit.url})`;
713
759
  }
760
+ /** Human-readable size for the document placeholder ("312 B", "2.4 KB",
761
+ * "1.3 MB"). */
762
+ function formatByteSize(bytes) {
763
+ if (bytes < 1024)
764
+ return `${bytes} B`;
765
+ if (bytes < 1024 * 1024)
766
+ return `${(bytes / 1024).toFixed(1)} KB`;
767
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
768
+ }
714
769
  function toAcpContentUpdate(content, isError = false) {
715
770
  if (Array.isArray(content) && content.length > 0) {
716
771
  return {
@@ -768,6 +823,28 @@ function toAcpContentBlock(content, isError) {
768
823
  return wrapText(content.source.type === "url"
769
824
  ? `[image: ${content.source.url}]`
770
825
  : "[image: file reference]");
826
+ case "document": {
827
+ // A PDF Read delivers its raw `document` block inside the tool_result
828
+ // content (SDK 0.3.243 moved it here from a separate follow-up user
829
+ // message; the MultiRead documents lane always lived here). ACP has no
830
+ // document block and the base64 payload can be megabytes — render a
831
+ // compact placeholder, never the data, matching the CLI's own compact
832
+ // "Read PDF (size)" rendering.
833
+ const title = typeof content.title === "string" && content.title.length > 0 ? ` "${content.title}"` : "";
834
+ const source = content.source;
835
+ switch (source.type) {
836
+ case "url":
837
+ return wrapText(`[document${title}: ${source.url}]`);
838
+ case "base64":
839
+ case "text":
840
+ // base64 inflates the byte count by 4/3; plain text is 1:1.
841
+ return wrapText(`[document${title}: ${source.media_type}, ${formatByteSize(source.type === "base64"
842
+ ? Math.floor((source.data.length * 3) / 4)
843
+ : source.data.length)}]`);
844
+ default:
845
+ return wrapText(`[document${title}]`);
846
+ }
847
+ }
771
848
  case "tool_reference":
772
849
  return wrapText(`Tool: ${content.tool_name}`);
773
850
  case "tool_search_tool_search_result":
@@ -1033,6 +1110,32 @@ export function toolUpdateFromDiffToolResponse(toolResponse) {
1033
1110
  });
1034
1111
  }
1035
1112
  }
1113
+ // A Write `update` can arrive with an empty structuredPatch — nothing
1114
+ // changed, the diff timed out, or the previous content was too large to
1115
+ // diff (originalFile null; SDK 0.3.252 documents the lane). Returning `{}`
1116
+ // would leave Write's optimistic tool_use-time content standing, and that
1117
+ // was built with `oldText: null` — "creation" semantics — so an overwrite
1118
+ // of a large existing file would render as creating it. Emit a truthful
1119
+ // replacement instead. Gated on `type` so Edit (whose output carries no
1120
+ // `type` and whose optimistic old/new diff is already truthful) keeps the
1121
+ // empty-return behavior.
1122
+ if (content.length === 0 && response.type === "update" && typeof response.content === "string") {
1123
+ locations.push({ path: response.filePath });
1124
+ content.push(typeof response.originalFile === "string"
1125
+ ? {
1126
+ type: "diff",
1127
+ path: response.filePath,
1128
+ oldText: response.originalFile,
1129
+ newText: response.content,
1130
+ }
1131
+ : {
1132
+ type: "content",
1133
+ content: {
1134
+ type: "text",
1135
+ text: `Updated \`${response.filePath}\` (previous content too large to diff)`,
1136
+ },
1137
+ });
1138
+ }
1036
1139
  const result = {};
1037
1140
  if (content.length > 0)
1038
1141
  result.content = content;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.71.0",
6
+ "version": "0.73.0",
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",
@@ -65,20 +65,20 @@
65
65
  "node": ">=22"
66
66
  },
67
67
  "dependencies": {
68
- "@agentclientprotocol/sdk": "1.3.0",
69
- "@anthropic-ai/claude-agent-sdk": "0.3.238",
68
+ "@agentclientprotocol/sdk": "1.4.0",
69
+ "@anthropic-ai/claude-agent-sdk": "0.3.257",
70
70
  "zod": "^4.0.0"
71
71
  },
72
72
  "devDependencies": {
73
- "@anthropic-ai/sdk": "0.120.0",
73
+ "@anthropic-ai/sdk": "0.122.0",
74
74
  "@eslint/js": "10.0.1",
75
75
  "@tsconfig/node22": "22.0.6",
76
- "@types/node": "26.2.0",
77
- "@typescript-eslint/eslint-plugin": "8.67.0",
78
- "@typescript-eslint/parser": "8.67.0",
79
- "eslint": "10.8.1",
76
+ "@types/node": "26.4.0",
77
+ "@typescript-eslint/eslint-plugin": "8.69.0",
78
+ "@typescript-eslint/parser": "8.69.0",
79
+ "eslint": "10.9.1",
80
80
  "eslint-config-prettier": "10.1.8",
81
- "globals": "17.11.0",
81
+ "globals": "17.12.0",
82
82
  "prettier": "3.9.6",
83
83
  "ts-node": "10.9.2",
84
84
  "typescript": "6.0.3",