claude-code-acp-ts 0.62.2 → 0.63.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.
- package/README.md +12 -0
- package/dist/acp-agent.d.ts +38 -4
- package/dist/acp-agent.d.ts.map +1 -1
- package/dist/acp-agent.js +190 -19
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +19 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -14,12 +14,24 @@ This tool implements an ACP agent by using the official [Claude Agent SDK](https
|
|
|
14
14
|
- Following
|
|
15
15
|
- Edit review
|
|
16
16
|
- TODO lists
|
|
17
|
+
- Nested subagent transcripts
|
|
17
18
|
- Interactive (and background) terminals
|
|
18
19
|
- Custom [Slash commands](https://docs.anthropic.com/en/docs/claude-code/slash-commands)
|
|
19
20
|
- Client MCP servers
|
|
20
21
|
|
|
21
22
|
Learn more about the [Agent Client Protocol](https://agentclientprotocol.com/).
|
|
22
23
|
|
|
24
|
+
### Nested subagent transcripts
|
|
25
|
+
|
|
26
|
+
ACP 1.2 has no standard subagent tool kind or nested-message relationship. Clients that can render
|
|
27
|
+
nested transcripts can opt in with `clientCapabilities._meta["subagent-transcript"] = true`.
|
|
28
|
+
The agent then forwards subagent text, thinking, and tool calls, relating nested updates to the
|
|
29
|
+
launching Agent/Task call through `_meta.claudeCode.parentToolUseId`. Agent/Task calls are marked
|
|
30
|
+
with `_meta.claudeCode.subagent = true`.
|
|
31
|
+
|
|
32
|
+
Clients that do not advertise the capability retain the legacy flattened behavior. In both modes,
|
|
33
|
+
the normal Agent/Task tool result is preserved as the protocol-compatible fallback.
|
|
34
|
+
|
|
23
35
|
## Contribution Policy
|
|
24
36
|
|
|
25
37
|
This project does not require a Contributor License Agreement (CLA). Instead, contributions are accepted under the following terms:
|
package/dist/acp-agent.d.ts
CHANGED
|
@@ -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, FastModeState, ModelInfo, Options, PermissionMode, PermissionUpdate, Query, SDKMessageOrigin, SDKPartialAssistantMessage, SDKUserMessage } from "@anthropic-ai/claude-agent-sdk";
|
|
2
|
+
import { AgentInfo, CanUseTool, FastModeDisabledReason, FastModeState, ModelInfo, Options, PermissionMode, PermissionUpdate, 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";
|
|
@@ -229,6 +229,13 @@ type Session = {
|
|
|
229
229
|
* user's intent so it persists across model switches; the Fast mode config
|
|
230
230
|
* option is only surfaced while the selected model supports it. */
|
|
231
231
|
fastModeEnabled: boolean;
|
|
232
|
+
/** Why the SDK currently can't serve Fast mode, when the reason is one worth
|
|
233
|
+
* telling the user about (see {@link FAST_MODE_UNAVAILABLE_EXPLANATIONS} —
|
|
234
|
+
* routine states like the SDK's own opt-in requirement normalize to
|
|
235
|
+
* `undefined`). Refreshed from every `fast_mode_disabled_reason` the SDK
|
|
236
|
+
* reports on `system`/init and user-turn `result`s; surfaced in the Fast mode
|
|
237
|
+
* option's description so a toggle that snaps back off explains itself. */
|
|
238
|
+
fastModeDisabledReason?: FastModeDisabledReason;
|
|
232
239
|
abortController: AbortController;
|
|
233
240
|
/** Signal the consumer races `query.next()` against. Aborted by cancel()
|
|
234
241
|
* (after a grace period) to force the active turn to settle "cancelled" when
|
|
@@ -242,6 +249,9 @@ type Session = {
|
|
|
242
249
|
* cancel. */
|
|
243
250
|
forceCancelTimer?: ReturnType<typeof setTimeout>;
|
|
244
251
|
emitRawSDKMessages: boolean | SDKMessageFilter[];
|
|
252
|
+
/** Whether nested subagent text/thinking is forwarded to the ACP client.
|
|
253
|
+
* Enabled by either the ACP capability or the pre-existing SDK option. */
|
|
254
|
+
forwardSubagentText: boolean;
|
|
245
255
|
/** Context window size of the session's current model, carried across
|
|
246
256
|
* prompts so mid-stream usage_update notifications report a correct `size`
|
|
247
257
|
* before the turn's first result message arrives. Seeded synchronously at
|
|
@@ -496,10 +506,12 @@ type ProviderConfig = {
|
|
|
496
506
|
export type ToolUpdateMeta = {
|
|
497
507
|
claudeCode?: {
|
|
498
508
|
toolName: string;
|
|
509
|
+
title?: string;
|
|
499
510
|
toolResponse?: unknown;
|
|
500
511
|
parentToolUseId?: string;
|
|
501
512
|
nonExecutionKind?: string;
|
|
502
513
|
userFeedback?: string;
|
|
514
|
+
subagent?: true;
|
|
503
515
|
};
|
|
504
516
|
terminal_info?: {
|
|
505
517
|
terminal_id: string;
|
|
@@ -819,7 +831,14 @@ export declare class ClaudeAcpAgent {
|
|
|
819
831
|
* here).
|
|
820
832
|
* - `cooldown`: a transient suspension of an already-enabled fast mode.
|
|
821
833
|
* Leave the toggle as-is rather than flapping it — and never let a stray
|
|
822
|
-
* cooldown spuriously enable a toggle the user has off.
|
|
834
|
+
* cooldown spuriously enable a toggle the user has off.
|
|
835
|
+
*
|
|
836
|
+
* `reason` is the SDK's `fast_mode_disabled_reason`, reported alongside the
|
|
837
|
+
* state. Only explainable reasons are retained (see
|
|
838
|
+
* {@link normalizeFastModeDisabledReason}), so the comparison below tracks
|
|
839
|
+
* exactly what the user can see: a routine `sdk_opt_in_required` report on
|
|
840
|
+
* every turn's result can't churn the option, while a real blocker updates
|
|
841
|
+
* the description even when the toggle's own value is unchanged. */
|
|
823
842
|
private syncFastModeState;
|
|
824
843
|
private getOrCreateSession;
|
|
825
844
|
/**
|
|
@@ -856,6 +875,12 @@ export declare const FAST_MODE_OFF = "off";
|
|
|
856
875
|
* docs) keeps the toggle on so it reflects the user's intent — only an
|
|
857
876
|
* explicit `off` clears it. */
|
|
858
877
|
export declare function fastModeStateEnabled(state: FastModeState): boolean;
|
|
878
|
+
/** Normalize an SDK-reported `fast_mode_disabled_reason` to the one we retain:
|
|
879
|
+
* a reason we have an explanation for, else `undefined`. Keeping only
|
|
880
|
+
* explainable reasons means state comparisons (see `syncFastModeState`) track
|
|
881
|
+
* exactly what the user can see, so routine reports like
|
|
882
|
+
* `sdk_opt_in_required` never churn the config option. */
|
|
883
|
+
export declare function normalizeFastModeDisabledReason(reason: FastModeDisabledReason | undefined): FastModeDisabledReason | undefined;
|
|
859
884
|
/** Whether the Client advertised support for boolean session config options
|
|
860
885
|
* (`session.configOptions.boolean`). Agents MUST only send `type: "boolean"`
|
|
861
886
|
* config options to Clients that opt in; otherwise we fall back to a `select`.
|
|
@@ -864,8 +889,14 @@ export declare function clientSupportsBooleanConfigOptions(clientCapabilities?:
|
|
|
864
889
|
/** Build the Fast mode config option. When the Client supports boolean config
|
|
865
890
|
* options we expose a native `type: "boolean"` toggle; otherwise we degrade to
|
|
866
891
|
* a two-value `select` ("on"/"off") so older Clients still get a usable
|
|
867
|
-
* control.
|
|
868
|
-
|
|
892
|
+
* control.
|
|
893
|
+
*
|
|
894
|
+
* `disabledReason` (the SDK's `fast_mode_disabled_reason`) is folded into the
|
|
895
|
+
* description while the toggle reads off, so a user whose account or provider
|
|
896
|
+
* can't serve Fast mode sees why instead of a switch that silently refuses to
|
|
897
|
+
* stay on. Ignored while enabled: a reason reported alongside an `on`/`cooldown`
|
|
898
|
+
* state isn't blocking anything right now. */
|
|
899
|
+
export declare function createFastModeConfigOption(enabled: boolean, useBooleanOption: boolean, disabledReason?: FastModeDisabledReason): SessionConfigOption;
|
|
869
900
|
/** Resolve the requested Fast mode value from a `session/set_config_option`
|
|
870
901
|
* request. Accepts a native boolean (boolean-capable Clients) or the
|
|
871
902
|
* "on"/"off" select-fallback strings. */
|
|
@@ -877,6 +908,9 @@ export type FastModeOptionState = {
|
|
|
877
908
|
enabled: boolean;
|
|
878
909
|
/** Whether the Client opted into boolean config options. */
|
|
879
910
|
useBooleanOption: boolean;
|
|
911
|
+
/** Latest explainable `fast_mode_disabled_reason`, folded into the option's
|
|
912
|
+
* description while the toggle reads off. */
|
|
913
|
+
disabledReason?: FastModeDisabledReason;
|
|
880
914
|
};
|
|
881
915
|
export declare function buildConfigOptions(modes: SessionModeState, models: SessionModelState, modelInfos: ModelInfo[], currentEffortLevel?: string, agents?: AgentInfo[], currentAgent?: string, fastMode?: FastModeOptionState): SessionConfigOption[];
|
|
882
916
|
export declare function resolveModelPreference(models: ModelInfo[], preference: string): ModelInfo | null;
|
package/dist/acp-agent.d.ts.map
CHANGED
|
@@ -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,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;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
|
@@ -171,6 +171,23 @@ const PROVIDER_ID = "main";
|
|
|
171
171
|
* env-var mappings understood by {@link createEnvForProvider}.
|
|
172
172
|
*/
|
|
173
173
|
const SUPPORTED_PROTOCOLS = ["anthropic", "bedrock", "vertex"];
|
|
174
|
+
const SUBAGENT_TRANSCRIPT_CAPABILITY = "subagent-transcript";
|
|
175
|
+
function supportsSubagentTranscript(capabilities) {
|
|
176
|
+
return capabilities?._meta?.[SUBAGENT_TRANSCRIPT_CAPABILITY] === true;
|
|
177
|
+
}
|
|
178
|
+
function parentToolUseIdOf(message) {
|
|
179
|
+
if (!("parent_tool_use_id" in message))
|
|
180
|
+
return null;
|
|
181
|
+
return typeof message.parent_tool_use_id === "string" ? message.parent_tool_use_id : null;
|
|
182
|
+
}
|
|
183
|
+
function stripSubagentTextAndThinking(content) {
|
|
184
|
+
if (!Array.isArray(content))
|
|
185
|
+
return content;
|
|
186
|
+
return content.filter((item) => !item ||
|
|
187
|
+
typeof item !== "object" ||
|
|
188
|
+
!("type" in item) ||
|
|
189
|
+
(item.type !== "text" && item.type !== "thinking"));
|
|
190
|
+
}
|
|
174
191
|
/**
|
|
175
192
|
* Advance the lexer state across the fragment appended since the last delta:
|
|
176
193
|
* just enough JSON awareness (string/escape, nesting depth) to spot commas
|
|
@@ -1616,7 +1633,7 @@ export class ClaudeAcpAgent {
|
|
|
1616
1633
|
// A fresh `system`/init (e.g. after reinitialize) can carry an
|
|
1617
1634
|
// updated Fast mode state; reconcile it with what we seeded at
|
|
1618
1635
|
// session creation.
|
|
1619
|
-
await this.syncFastModeState(message.session_id, session, message.fast_mode_state);
|
|
1636
|
+
await this.syncFastModeState(message.session_id, session, message.fast_mode_state, message.fast_mode_disabled_reason);
|
|
1620
1637
|
break;
|
|
1621
1638
|
case "status": {
|
|
1622
1639
|
// Surface compaction as a tool call so the client renders it as
|
|
@@ -1883,6 +1900,28 @@ export class ClaudeAcpAgent {
|
|
|
1883
1900
|
// already emitted as a `tool_call`, so mark it failed with the
|
|
1884
1901
|
// rejection reason — otherwise the client shows a tool call
|
|
1885
1902
|
// that silently never resolves.
|
|
1903
|
+
//
|
|
1904
|
+
// The id is the executing call's own, and the frame lands
|
|
1905
|
+
// between its `tool_use` and its `tool_result` (the SDK enqueues
|
|
1906
|
+
// it from inside canUseTool), so the call is normally in flight
|
|
1907
|
+
// here. Not always: the assistant message carrying the tool_use
|
|
1908
|
+
// is dropped by the cancelled-turn guard below, and a denial for
|
|
1909
|
+
// it can still arrive afterwards — the case the `tool_result`
|
|
1910
|
+
// fallback in `toAcpNotifications` gates on `wasEmitted` for.
|
|
1911
|
+
// Drop the update rather than reference a tool call the client
|
|
1912
|
+
// was never given (see `ensureToolCallEmitted`, issue #851).
|
|
1913
|
+
if (!session.emittedToolCalls.has(message.tool_use_id)) {
|
|
1914
|
+
break;
|
|
1915
|
+
}
|
|
1916
|
+
// A denial inside a subagent identifies the subagent by
|
|
1917
|
+
// `agent_id` (as canUseTool does with `agentID`), never by the
|
|
1918
|
+
// Agent/Task call that spawned it. Resolve it the same way so
|
|
1919
|
+
// the update lands in the subagent's transcript alongside the
|
|
1920
|
+
// `tool_call` it resolves, which carries the parent stamped from
|
|
1921
|
+
// `parent_tool_use_id` (see `liveBackgroundTasks`).
|
|
1922
|
+
const parentToolUseId = message.agent_id
|
|
1923
|
+
? session.liveBackgroundTasks.get(message.agent_id)?.parentToolUseId
|
|
1924
|
+
: undefined;
|
|
1886
1925
|
const reason = message.decision_reason ?? message.message;
|
|
1887
1926
|
await sendUpdate({
|
|
1888
1927
|
sessionId: message.session_id,
|
|
@@ -1899,6 +1938,7 @@ export class ClaudeAcpAgent {
|
|
|
1899
1938
|
_meta: {
|
|
1900
1939
|
claudeCode: {
|
|
1901
1940
|
toolName: message.tool_name,
|
|
1941
|
+
...(parentToolUseId ? { parentToolUseId } : {}),
|
|
1902
1942
|
toolResponse: {
|
|
1903
1943
|
decisionReasonType: message.decision_reason_type,
|
|
1904
1944
|
decisionReason: message.decision_reason,
|
|
@@ -2132,7 +2172,7 @@ export class ClaudeAcpAgent {
|
|
|
2132
2172
|
// an autonomous cycle's state lands on the next user turn's
|
|
2133
2173
|
// result. Runs even when the turn errors or was cancelled.
|
|
2134
2174
|
if (!isAutonomousResult) {
|
|
2135
|
-
await this.syncFastModeState(params.sessionId, session, message.fast_mode_state);
|
|
2175
|
+
await this.syncFastModeState(params.sessionId, session, message.fast_mode_state, message.fast_mode_disabled_reason);
|
|
2136
2176
|
}
|
|
2137
2177
|
// A user-turn result needs an active turn so its stop reason is
|
|
2138
2178
|
// attributed and the turn settles at idle. Local-only commands carry
|
|
@@ -2746,11 +2786,13 @@ export class ClaudeAcpAgent {
|
|
|
2746
2786
|
// the record stays bounded to the in-flight message.
|
|
2747
2787
|
streamedBlocks.length = 0;
|
|
2748
2788
|
}
|
|
2749
|
-
else if (message.type === "assistant"
|
|
2750
|
-
|
|
2751
|
-
//
|
|
2752
|
-
//
|
|
2753
|
-
// top-level
|
|
2789
|
+
else if (message.type === "assistant" &&
|
|
2790
|
+
!(session.forwardSubagentText || supportsSubagentTranscript(this.clientCapabilities))) {
|
|
2791
|
+
// Legacy clients don't understand nested transcripts. Keep the
|
|
2792
|
+
// historical behavior for them: subagent text/thinking remains
|
|
2793
|
+
// internal to the tool call instead of leaking into the top-level
|
|
2794
|
+
// feed. Capable clients opt into the branch above unchanged, with
|
|
2795
|
+
// `parentToolUseId` stamped by toAcpNotifications.
|
|
2754
2796
|
content = message.message.content.filter((item) => item.type !== "text" && item.type !== "thinking");
|
|
2755
2797
|
}
|
|
2756
2798
|
else {
|
|
@@ -2779,11 +2821,30 @@ export class ClaudeAcpAgent {
|
|
|
2779
2821
|
break;
|
|
2780
2822
|
}
|
|
2781
2823
|
case "tool_progress": {
|
|
2824
|
+
// Not every beat reports under the id of a tool call the client has
|
|
2825
|
+
// seen: heartbeats derive `<tool_use_id>-heartbeat-<n>`, and the
|
|
2826
|
+
// `agent_api_retry` beats behind `subagentRetry` report under
|
|
2827
|
+
// `agent_<assistant_message_id>`. Forwarding those verbatim leaves the
|
|
2828
|
+
// client resolving an id it has never been told about (the same trap
|
|
2829
|
+
// `ensureToolCallEmitted` documents for #851). The SDK stamps
|
|
2830
|
+
// `parent_tool_use_id` with the executing tool's real id whenever the
|
|
2831
|
+
// beat doesn't carry one of its own, so fall back to it rather than
|
|
2832
|
+
// pattern-matching each synthetic id shape. Beats that do report a real
|
|
2833
|
+
// id (a subagent's `bash_progress`, whose parent is the spawning Agent
|
|
2834
|
+
// call) keep resolving to that id.
|
|
2835
|
+
const toolCallId = session.emittedToolCalls.has(message.tool_use_id)
|
|
2836
|
+
? message.tool_use_id
|
|
2837
|
+
: message.parent_tool_use_id;
|
|
2838
|
+
// Ids leave `emittedToolCalls` at `tool_result`, so this also stops a
|
|
2839
|
+
// beat that races past completion from reopening a finished call.
|
|
2840
|
+
if (toolCallId === null || !session.emittedToolCalls.has(toolCallId)) {
|
|
2841
|
+
break;
|
|
2842
|
+
}
|
|
2782
2843
|
await sendUpdate({
|
|
2783
2844
|
sessionId: message.session_id,
|
|
2784
2845
|
update: {
|
|
2785
2846
|
sessionUpdate: "tool_call_update",
|
|
2786
|
-
toolCallId
|
|
2847
|
+
toolCallId,
|
|
2787
2848
|
status: "in_progress",
|
|
2788
2849
|
_meta: {
|
|
2789
2850
|
claudeCode: {
|
|
@@ -3294,6 +3355,8 @@ export class ClaudeAcpAgent {
|
|
|
3294
3355
|
async replaySessionHistory(sessionId) {
|
|
3295
3356
|
const toolUseCache = {};
|
|
3296
3357
|
const messages = await getSessionMessages(sessionId);
|
|
3358
|
+
const forwardSubagentText = this.sessions[sessionId]?.forwardSubagentText ??
|
|
3359
|
+
supportsSubagentTranscript(this.clientCapabilities);
|
|
3297
3360
|
for (const message of messages) {
|
|
3298
3361
|
// Backfill the ACP messageId -> SDK uuid mapping for messages we didn't
|
|
3299
3362
|
// observe live (resumed/loaded sessions), so rewind/resume can translate
|
|
@@ -3312,6 +3375,10 @@ export class ClaudeAcpAgent {
|
|
|
3312
3375
|
}
|
|
3313
3376
|
// @ts-expect-error - untyped in SDK but we handle all of these
|
|
3314
3377
|
let content = message.message.content;
|
|
3378
|
+
const parentToolUseId = parentToolUseIdOf(message);
|
|
3379
|
+
if (message.type === "assistant" && parentToolUseId && !forwardSubagentText) {
|
|
3380
|
+
content = stripSubagentTextAndThinking(content);
|
|
3381
|
+
}
|
|
3315
3382
|
// @ts-expect-error - untyped in SDK but we handle all of these
|
|
3316
3383
|
if (message.message.role === "user") {
|
|
3317
3384
|
content = stripLocalCommandMetadata(content);
|
|
@@ -3328,6 +3395,7 @@ export class ClaudeAcpAgent {
|
|
|
3328
3395
|
cwd: this.sessions[sessionId]?.cwd,
|
|
3329
3396
|
taskState: this.sessions[sessionId]?.taskState,
|
|
3330
3397
|
messageId: replayMessageId,
|
|
3398
|
+
parentToolUseId,
|
|
3331
3399
|
})) {
|
|
3332
3400
|
await this.client.sessionUpdate(notification);
|
|
3333
3401
|
}
|
|
@@ -3774,6 +3842,13 @@ export class ClaudeAcpAgent {
|
|
|
3774
3842
|
else {
|
|
3775
3843
|
session.modes = { ...session.modes, availableModes: newAvailableModes };
|
|
3776
3844
|
}
|
|
3845
|
+
// `model_not_allowed` described the model we just left, so it must not
|
|
3846
|
+
// follow us onto the new one; the remaining reasons are account- or
|
|
3847
|
+
// environment-scoped and stay true across a switch. Either way the next
|
|
3848
|
+
// init/result report refreshes this.
|
|
3849
|
+
if (session.fastModeDisabledReason === "model_not_allowed") {
|
|
3850
|
+
session.fastModeDisabledReason = undefined;
|
|
3851
|
+
}
|
|
3777
3852
|
// Rebuild config options since effort levels depend on the selected model
|
|
3778
3853
|
const effortOpt = session.configOptions.find((o) => o.id === EFFORT_CONFIG_ID);
|
|
3779
3854
|
const currentEffort = typeof effortOpt?.currentValue === "string" ? effortOpt.currentValue : undefined;
|
|
@@ -3784,6 +3859,7 @@ export class ClaudeAcpAgent {
|
|
|
3784
3859
|
supported: newModelInfo?.supportsFastMode ?? false,
|
|
3785
3860
|
enabled: session.fastModeEnabled,
|
|
3786
3861
|
useBooleanOption: clientSupportsBooleanConfigOptions(this.clientCapabilities),
|
|
3862
|
+
disabledReason: session.fastModeDisabledReason,
|
|
3787
3863
|
});
|
|
3788
3864
|
// Sync effort with the SDK if it changed after the model switch
|
|
3789
3865
|
const newEffortOpt = session.configOptions.find((o) => o.id === EFFORT_CONFIG_ID);
|
|
@@ -3865,7 +3941,7 @@ export class ClaudeAcpAgent {
|
|
|
3865
3941
|
* option isn't present, so callers must confirm the current model surfaces
|
|
3866
3942
|
* it first. */
|
|
3867
3943
|
refreshFastModeOption(session, enabled) {
|
|
3868
|
-
const refreshed = createFastModeConfigOption(enabled, clientSupportsBooleanConfigOptions(this.clientCapabilities));
|
|
3944
|
+
const refreshed = createFastModeConfigOption(enabled, clientSupportsBooleanConfigOptions(this.clientCapabilities), session.fastModeDisabledReason);
|
|
3869
3945
|
session.configOptions = session.configOptions.map((o) => o.id === FAST_MODE_CONFIG_ID ? refreshed : o);
|
|
3870
3946
|
}
|
|
3871
3947
|
/** Toggle Fast mode for a session: push the SDK flag, record the user's
|
|
@@ -3894,8 +3970,15 @@ export class ClaudeAcpAgent {
|
|
|
3894
3970
|
* here).
|
|
3895
3971
|
* - `cooldown`: a transient suspension of an already-enabled fast mode.
|
|
3896
3972
|
* Leave the toggle as-is rather than flapping it — and never let a stray
|
|
3897
|
-
* cooldown spuriously enable a toggle the user has off.
|
|
3898
|
-
|
|
3973
|
+
* cooldown spuriously enable a toggle the user has off.
|
|
3974
|
+
*
|
|
3975
|
+
* `reason` is the SDK's `fast_mode_disabled_reason`, reported alongside the
|
|
3976
|
+
* state. Only explainable reasons are retained (see
|
|
3977
|
+
* {@link normalizeFastModeDisabledReason}), so the comparison below tracks
|
|
3978
|
+
* exactly what the user can see: a routine `sdk_opt_in_required` report on
|
|
3979
|
+
* every turn's result can't churn the option, while a real blocker updates
|
|
3980
|
+
* the description even when the toggle's own value is unchanged. */
|
|
3981
|
+
async syncFastModeState(sessionId, session, state, reason) {
|
|
3899
3982
|
if (state === undefined) {
|
|
3900
3983
|
return;
|
|
3901
3984
|
}
|
|
@@ -3906,11 +3989,31 @@ export class ClaudeAcpAgent {
|
|
|
3906
3989
|
return;
|
|
3907
3990
|
}
|
|
3908
3991
|
const enabled = state === "on";
|
|
3909
|
-
|
|
3992
|
+
// A reason only describes an off state; drop any that rides an `on` report
|
|
3993
|
+
// so it can't decorate the option the next time fast mode goes off.
|
|
3994
|
+
const nextReason = enabled ? undefined : normalizeFastModeDisabledReason(reason);
|
|
3995
|
+
if (enabled === session.fastModeEnabled && nextReason === session.fastModeDisabledReason) {
|
|
3910
3996
|
return;
|
|
3911
3997
|
}
|
|
3998
|
+
// The user asked for Fast mode and the SDK is telling us it can't serve it.
|
|
3999
|
+
// The description carries the same explanation, but a toggle silently
|
|
4000
|
+
// snapping back is the case worth saying out loud once, at the flip.
|
|
4001
|
+
const explain = session.fastModeEnabled && !enabled && nextReason !== undefined;
|
|
3912
4002
|
session.fastModeEnabled = enabled;
|
|
4003
|
+
session.fastModeDisabledReason = nextReason;
|
|
3913
4004
|
this.refreshFastModeOption(session, enabled);
|
|
4005
|
+
if (explain) {
|
|
4006
|
+
await this.client.sessionUpdate({
|
|
4007
|
+
sessionId,
|
|
4008
|
+
update: {
|
|
4009
|
+
sessionUpdate: "agent_message_chunk",
|
|
4010
|
+
content: {
|
|
4011
|
+
type: "text",
|
|
4012
|
+
text: `**Fast mode turned off:** ${FAST_MODE_UNAVAILABLE_EXPLANATIONS[nextReason]}.`,
|
|
4013
|
+
},
|
|
4014
|
+
},
|
|
4015
|
+
});
|
|
4016
|
+
}
|
|
3914
4017
|
await this.client.sessionUpdate({
|
|
3915
4018
|
sessionId,
|
|
3916
4019
|
update: {
|
|
@@ -4042,6 +4145,8 @@ export class ClaudeAcpAgent {
|
|
|
4042
4145
|
// Extract options from _meta if provided
|
|
4043
4146
|
const sessionMeta = params._meta;
|
|
4044
4147
|
const userProvidedOptions = sessionMeta?.claudeCode?.options;
|
|
4148
|
+
const forwardSubagentText = supportsSubagentTranscript(this.clientCapabilities) ||
|
|
4149
|
+
userProvidedOptions?.forwardSubagentText === true;
|
|
4045
4150
|
// Configure thinking behavior from environment variable
|
|
4046
4151
|
const thinking = resolveThinkingConfig(process.env.MAX_THINKING_TOKENS, this.logger);
|
|
4047
4152
|
// Parse model configuration from environment (e.g. Bedrock model overrides)
|
|
@@ -4116,6 +4221,7 @@ export class ClaudeAcpAgent {
|
|
|
4116
4221
|
// Override certain fields that must be controlled by ACP
|
|
4117
4222
|
cwd: params.cwd,
|
|
4118
4223
|
includePartialMessages: true,
|
|
4224
|
+
forwardSubagentText,
|
|
4119
4225
|
mcpServers: { ...(userProvidedOptions?.mcpServers || {}), ...mcpServers },
|
|
4120
4226
|
// If we want bypassPermissions to be an option, we have to allow it here.
|
|
4121
4227
|
// But it doesn't work in root mode, so we only activate it if it will work.
|
|
@@ -4350,10 +4456,18 @@ export class ClaudeAcpAgent {
|
|
|
4350
4456
|
// the resolved model advertises `supportsFastMode`.
|
|
4351
4457
|
const fastModeEnabled = initializationResult.fast_mode_state !== undefined &&
|
|
4352
4458
|
fastModeStateEnabled(initializationResult.fast_mode_state);
|
|
4459
|
+
// `fast_mode_disabled_reason` reflects the post-switch model since SDK
|
|
4460
|
+
// 0.3.219 (the initialize response used to answer from the spawn-time
|
|
4461
|
+
// model). A fresh SDK session reports `sdk_opt_in_required` — the toggle IS
|
|
4462
|
+
// the opt-in — which normalizes away, so only real blockers are retained.
|
|
4463
|
+
const fastModeDisabledReason = fastModeEnabled
|
|
4464
|
+
? undefined
|
|
4465
|
+
: normalizeFastModeDisabledReason(initializationResult.fast_mode_disabled_reason);
|
|
4353
4466
|
const fastMode = {
|
|
4354
4467
|
supported: currentModelInfo?.supportsFastMode ?? false,
|
|
4355
4468
|
enabled: fastModeEnabled,
|
|
4356
4469
|
useBooleanOption: clientSupportsBooleanConfigOptions(this.clientCapabilities),
|
|
4470
|
+
disabledReason: fastModeDisabledReason,
|
|
4357
4471
|
};
|
|
4358
4472
|
const configOptions = buildConfigOptions(modes, models, modelInfos, settingsManager.getSettings().effortLevel, agents, currentAgent, fastMode);
|
|
4359
4473
|
// Apply the initial effort level to the SDK so it matches the UI default
|
|
@@ -4415,8 +4529,10 @@ export class ClaudeAcpAgent {
|
|
|
4415
4529
|
agents,
|
|
4416
4530
|
currentAgent,
|
|
4417
4531
|
fastModeEnabled,
|
|
4532
|
+
fastModeDisabledReason,
|
|
4418
4533
|
abortController,
|
|
4419
4534
|
emitRawSDKMessages: sessionMeta?.claudeCode?.emitRawSDKMessages ?? false,
|
|
4535
|
+
forwardSubagentText,
|
|
4420
4536
|
contextWindowSize: seededWindow.size,
|
|
4421
4537
|
contextWindowAuthoritative: seededWindow.authoritative,
|
|
4422
4538
|
providerCacheKey,
|
|
@@ -4674,6 +4790,32 @@ const FAST_MODE_DESCRIPTION = "Faster responses on supported models";
|
|
|
4674
4790
|
export function fastModeStateEnabled(state) {
|
|
4675
4791
|
return state !== "off";
|
|
4676
4792
|
}
|
|
4793
|
+
/** User-facing explanations for the SDK's `fast_mode_disabled_reason` values
|
|
4794
|
+
* that a user can act on (or at least wants to know about). Deliberately
|
|
4795
|
+
* partial — the omitted reasons are not worth surfacing:
|
|
4796
|
+
* - `sdk_opt_in_required`: every SDK session starts here (the toggle IS the
|
|
4797
|
+
* opt-in), so it describes the default, not a problem.
|
|
4798
|
+
* - `preference`: the user turned Fast mode off themselves.
|
|
4799
|
+
* - `pending`: eligibility is still resolving; the next report supersedes it.
|
|
4800
|
+
* - `unknown`: nothing meaningful to say.
|
|
4801
|
+
* Unknown future reasons fall through the same way (open set — the SDK's docs
|
|
4802
|
+
* say to ignore values you don't handle). */
|
|
4803
|
+
const FAST_MODE_UNAVAILABLE_EXPLANATIONS = {
|
|
4804
|
+
free: "not available on the free plan",
|
|
4805
|
+
extra_usage_disabled: "requires extra usage to be enabled for this account",
|
|
4806
|
+
model_not_allowed: "not available for the selected model",
|
|
4807
|
+
not_first_party: "not available on this API provider",
|
|
4808
|
+
disabled_by_env: "disabled by environment configuration",
|
|
4809
|
+
network_error: "eligibility could not be verified (network error)",
|
|
4810
|
+
};
|
|
4811
|
+
/** Normalize an SDK-reported `fast_mode_disabled_reason` to the one we retain:
|
|
4812
|
+
* a reason we have an explanation for, else `undefined`. Keeping only
|
|
4813
|
+
* explainable reasons means state comparisons (see `syncFastModeState`) track
|
|
4814
|
+
* exactly what the user can see, so routine reports like
|
|
4815
|
+
* `sdk_opt_in_required` never churn the config option. */
|
|
4816
|
+
export function normalizeFastModeDisabledReason(reason) {
|
|
4817
|
+
return reason && FAST_MODE_UNAVAILABLE_EXPLANATIONS[reason] ? reason : undefined;
|
|
4818
|
+
}
|
|
4677
4819
|
/** Whether the Client advertised support for boolean session config options
|
|
4678
4820
|
* (`session.configOptions.boolean`). Agents MUST only send `type: "boolean"`
|
|
4679
4821
|
* config options to Clients that opt in; otherwise we fall back to a `select`.
|
|
@@ -4684,12 +4826,21 @@ export function clientSupportsBooleanConfigOptions(clientCapabilities) {
|
|
|
4684
4826
|
/** Build the Fast mode config option. When the Client supports boolean config
|
|
4685
4827
|
* options we expose a native `type: "boolean"` toggle; otherwise we degrade to
|
|
4686
4828
|
* a two-value `select` ("on"/"off") so older Clients still get a usable
|
|
4687
|
-
* control.
|
|
4688
|
-
|
|
4829
|
+
* control.
|
|
4830
|
+
*
|
|
4831
|
+
* `disabledReason` (the SDK's `fast_mode_disabled_reason`) is folded into the
|
|
4832
|
+
* description while the toggle reads off, so a user whose account or provider
|
|
4833
|
+
* can't serve Fast mode sees why instead of a switch that silently refuses to
|
|
4834
|
+
* stay on. Ignored while enabled: a reason reported alongside an `on`/`cooldown`
|
|
4835
|
+
* state isn't blocking anything right now. */
|
|
4836
|
+
export function createFastModeConfigOption(enabled, useBooleanOption, disabledReason) {
|
|
4837
|
+
const explanation = enabled
|
|
4838
|
+
? undefined
|
|
4839
|
+
: disabledReason && FAST_MODE_UNAVAILABLE_EXPLANATIONS[disabledReason];
|
|
4689
4840
|
const base = {
|
|
4690
4841
|
id: FAST_MODE_CONFIG_ID,
|
|
4691
4842
|
name: "Fast mode",
|
|
4692
|
-
description: FAST_MODE_DESCRIPTION,
|
|
4843
|
+
description: explanation ? `${FAST_MODE_DESCRIPTION} — ${explanation}` : FAST_MODE_DESCRIPTION,
|
|
4693
4844
|
category: "model_config",
|
|
4694
4845
|
};
|
|
4695
4846
|
if (useBooleanOption) {
|
|
@@ -4782,7 +4933,7 @@ export function buildConfigOptions(modes, models, modelInfos, currentEffortLevel
|
|
|
4782
4933
|
// option renders as a native boolean toggle for Clients that opted in, and a
|
|
4783
4934
|
// two-value select otherwise.
|
|
4784
4935
|
if (fastMode?.supported) {
|
|
4785
|
-
options.push(createFastModeConfigOption(fastMode.enabled, fastMode.useBooleanOption));
|
|
4936
|
+
options.push(createFastModeConfigOption(fastMode.enabled, fastMode.useBooleanOption, fastMode.disabledReason));
|
|
4786
4937
|
}
|
|
4787
4938
|
// Only surface the Agent picker when there's a real choice — i.e. the user
|
|
4788
4939
|
// has configured at least one custom agent (built-ins are filtered out in
|
|
@@ -5365,6 +5516,24 @@ function isTaskTool(toolName) {
|
|
|
5365
5516
|
function shouldEmitToolCall(toolName) {
|
|
5366
5517
|
return toolName !== "TodoWrite" && !isTaskTool(toolName);
|
|
5367
5518
|
}
|
|
5519
|
+
/** Build the Claude Code-specific metadata for a tool call. Bash descriptions
|
|
5520
|
+
* are kept out of ACP's standard `title`, which clients may use as the shell
|
|
5521
|
+
* command preview, while still giving clients access to Claude's concise
|
|
5522
|
+
* human-readable title. */
|
|
5523
|
+
function claudeCodeMetaFromToolUse(toolUse) {
|
|
5524
|
+
const description = toolUse.name === "Bash" &&
|
|
5525
|
+
toolUse.input !== null &&
|
|
5526
|
+
typeof toolUse.input === "object" &&
|
|
5527
|
+
"description" in toolUse.input &&
|
|
5528
|
+
typeof toolUse.input.description === "string"
|
|
5529
|
+
? toolUse.input.description
|
|
5530
|
+
: undefined;
|
|
5531
|
+
return {
|
|
5532
|
+
toolName: toolUse.name,
|
|
5533
|
+
...(description ? { title: description } : {}),
|
|
5534
|
+
...((toolUse.name === "Agent" || toolUse.name === "Task") && { subagent: true }),
|
|
5535
|
+
};
|
|
5536
|
+
}
|
|
5368
5537
|
/** Build the `tool_call` (or, with `refine`, the `tool_call_update`)
|
|
5369
5538
|
* notification for a tool_use. Shared by every site that surfaces a tool call:
|
|
5370
5539
|
* the streamed tool_use path (first encounter → tool_call, later encounter →
|
|
@@ -5375,7 +5544,7 @@ function shouldEmitToolCall(toolName) {
|
|
|
5375
5544
|
function toolCallNotification(toolUse, rawInput, supportsTerminalOutput, cwd, refine = false) {
|
|
5376
5545
|
if (refine) {
|
|
5377
5546
|
return {
|
|
5378
|
-
_meta: { claudeCode:
|
|
5547
|
+
_meta: { claudeCode: claudeCodeMetaFromToolUse(toolUse) },
|
|
5379
5548
|
toolCallId: toolUse.id,
|
|
5380
5549
|
sessionUpdate: "tool_call_update",
|
|
5381
5550
|
rawInput,
|
|
@@ -5384,7 +5553,7 @@ function toolCallNotification(toolUse, rawInput, supportsTerminalOutput, cwd, re
|
|
|
5384
5553
|
}
|
|
5385
5554
|
return {
|
|
5386
5555
|
_meta: {
|
|
5387
|
-
claudeCode:
|
|
5556
|
+
claudeCode: claudeCodeMetaFromToolUse(toolUse),
|
|
5388
5557
|
...(toolUse.name === "Bash" && supportsTerminalOutput
|
|
5389
5558
|
? { terminal_info: { terminal_id: toolUse.id } }
|
|
5390
5559
|
: {}),
|
|
@@ -5409,7 +5578,9 @@ function streamedInputRefinement(toolUse, input, supportsTerminalOutput, cwd) {
|
|
|
5409
5578
|
}
|
|
5410
5579
|
const { title, kind, locations } = toolInfoFromToolUse({ ...toolUse, input }, supportsTerminalOutput, cwd);
|
|
5411
5580
|
return {
|
|
5412
|
-
_meta: {
|
|
5581
|
+
_meta: {
|
|
5582
|
+
claudeCode: claudeCodeMetaFromToolUse({ ...toolUse, input }),
|
|
5583
|
+
},
|
|
5413
5584
|
toolCallId: toolUse.id,
|
|
5414
5585
|
sessionUpdate: "tool_call_update",
|
|
5415
5586
|
rawInput: input,
|
package/dist/tools.d.ts.map
CHANGED
|
@@ -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,eAAe,EAKhB,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;IAC3B,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAChC;AAED,UAAU,UAAU;IAClB,KAAK,CAAC,E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AgB,8BAA8B,CAAC,YAAY,EAAE,OAAO,GAAG;IACrE,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAChC,CAoCA;AAcD,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,SAKF,CAAC;AAGF,eAAO,MAAM,qBAAqB,GAC/B,UAAU;IAAE,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,KAAG,YAiBtD,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
|
@@ -501,7 +501,17 @@ export function toolUpdateFromToolResult(toolResult, toolUse, supportsTerminalOu
|
|
|
501
501
|
}
|
|
502
502
|
case "Bash": {
|
|
503
503
|
const result = toolResult.content;
|
|
504
|
-
|
|
504
|
+
// The terminal was announced under the tool_use's own id (see
|
|
505
|
+
// `toolInfoFromToolUse`), so key the output/exit metas off that: it is the
|
|
506
|
+
// id the client actually created a terminal for. `toolResult.tool_use_id`
|
|
507
|
+
// is the same value whenever present — the caller looks the tool_use up by
|
|
508
|
+
// it — so preferring `toolUse.id` only adds a source for the case where the
|
|
509
|
+
// result block carries no id at all. Anything that isn't a non-empty
|
|
510
|
+
// string is no id at all: `""` matches no terminal, and stringifying a
|
|
511
|
+
// present-but-undefined field would invent the literal `"undefined"`.
|
|
512
|
+
const terminalIdOf = (id) => typeof id === "string" && id.length > 0 ? id : undefined;
|
|
513
|
+
const terminalId = terminalIdOf(toolUse?.id) ??
|
|
514
|
+
terminalIdOf("tool_use_id" in toolResult ? toolResult.tool_use_id : undefined);
|
|
505
515
|
const isError = "is_error" in toolResult && toolResult.is_error;
|
|
506
516
|
// Extract output and exit code from either format:
|
|
507
517
|
// 1. The structured BashOutput (message-level tool_use_result): its
|
|
@@ -576,7 +586,14 @@ export function toolUpdateFromToolResult(toolResult, toolUse, supportsTerminalOu
|
|
|
576
586
|
return toAcpContentUpdate(result, isError);
|
|
577
587
|
}
|
|
578
588
|
}
|
|
579
|
-
|
|
589
|
+
// Without a terminal id there is nothing the client can reconcile these
|
|
590
|
+
// metas against, and emitting them anyway strands the output: a client that
|
|
591
|
+
// buffers output/exit for terminals it has not been told about (Zed keeps
|
|
592
|
+
// them in `pending_terminal_output`/`pending_terminal_exit`, drained only on
|
|
593
|
+
// a matching create) would hold them forever behind an id that never
|
|
594
|
+
// arrives, showing an empty terminal. Fall through to the code-block
|
|
595
|
+
// rendering below instead.
|
|
596
|
+
if (supportsTerminalOutput && terminalId !== undefined) {
|
|
580
597
|
return {
|
|
581
598
|
content: [{ type: "terminal", terminalId }],
|
|
582
599
|
_meta: {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.63.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",
|
|
@@ -64,19 +64,19 @@
|
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@agentclientprotocol/sdk": "1.3.0",
|
|
67
|
-
"@anthropic-ai/claude-agent-sdk": "0.3.
|
|
67
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.220",
|
|
68
68
|
"zod": "^3.25.0 || ^4.0.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@anthropic-ai/sdk": "0.
|
|
71
|
+
"@anthropic-ai/sdk": "0.115.0",
|
|
72
72
|
"@eslint/js": "10.0.1",
|
|
73
73
|
"@tsconfig/node22": "22.0.5",
|
|
74
|
-
"@types/node": "26.1.
|
|
74
|
+
"@types/node": "26.1.2",
|
|
75
75
|
"@typescript-eslint/eslint-plugin": "8.65.0",
|
|
76
76
|
"@typescript-eslint/parser": "8.65.0",
|
|
77
|
-
"eslint": "10.
|
|
77
|
+
"eslint": "10.8.0",
|
|
78
78
|
"eslint-config-prettier": "10.1.8",
|
|
79
|
-
"globals": "17.
|
|
79
|
+
"globals": "17.8.0",
|
|
80
80
|
"prettier": "3.9.6",
|
|
81
81
|
"ts-node": "10.9.2",
|
|
82
82
|
"typescript": "6.0.3",
|