@anthropic-ai/claude-agent-sdk 0.3.210 → 0.3.211

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/manifest.json CHANGED
@@ -1,47 +1,47 @@
1
1
  {
2
- "version": "2.1.210",
3
- "commit": "88e9fbf39bf4efa5bca44549b7fd9461628657e6",
4
- "buildDate": "2026-07-14T15:12:31Z",
2
+ "version": "2.1.211",
3
+ "commit": "17a4b6d7b2ee1936b95e595054c7e7d38fddafb7",
4
+ "buildDate": "2026-07-15T16:42:49Z",
5
5
  "platforms": {
6
6
  "darwin-arm64": {
7
7
  "binary": "claude",
8
- "checksum": "1b471d62d1117482689d75447f5e050c640da717a5a3c91e6c13792450f8c662",
9
- "size": 241509968
8
+ "checksum": "5a728a76198b6eca7f3c7cdbff43bab44b77b48c2108f7a3107d889773382629",
9
+ "size": 242445680
10
10
  },
11
11
  "darwin-x64": {
12
12
  "binary": "claude",
13
- "checksum": "892f2c878050d8829e67119328dd9768345fba18a58c169212b70597c9175c40",
14
- "size": 251025552
13
+ "checksum": "33049eb14cf4702b992b7eda41ec077fc6e76539f7fd046e6d32538757235da4",
14
+ "size": 251966736
15
15
  },
16
16
  "linux-arm64": {
17
17
  "binary": "claude",
18
- "checksum": "84feb193c1d91f3b5eba836ed47c0e4dee953195abba950917c3e101eff174e8",
19
- "size": 257932016
18
+ "checksum": "1fff7e8f947c07b19d10b1fbf714b7e547e9536253b9b58230d8adbc4624f867",
19
+ "size": 258849520
20
20
  },
21
21
  "linux-x64": {
22
22
  "binary": "claude",
23
- "checksum": "e7d2ceb53ed4c2ced1fe7fc1c6331c98dc5f7b4c9b2722d9c5fa3dd5dff6f719",
24
- "size": 261081912
23
+ "checksum": "8272c8a474ac9ea1bc35f19b9f7c7e7dc4dc4eb6d5ad3e484b19335ac72446b2",
24
+ "size": 262023992
25
25
  },
26
26
  "linux-arm64-musl": {
27
27
  "binary": "claude",
28
- "checksum": "17f617e24a05533cea8a344f44f0a25b6fb20ee467500601c3cd8392064ec528",
29
- "size": 251180216
28
+ "checksum": "ca094a85ea464b2ebec2ecfcc9e2c056573d4ca95ebe12ffae2c7dccb722e17b",
29
+ "size": 252097720
30
30
  },
31
31
  "linux-x64-musl": {
32
32
  "binary": "claude",
33
- "checksum": "03012f856faa1a9409d9add13936794f168e530c9746c8a099dec6ce8415c32b",
34
- "size": 255742336
33
+ "checksum": "c99bd7934ac841d5be6ee7d3644cb63bccef2cd495c6c1bb982a1b1deac1b466",
34
+ "size": 256680320
35
35
  },
36
36
  "win32-x64": {
37
37
  "binary": "claude.exe",
38
- "checksum": "29aa99c436f0d4125780691123b756176d83b59cc7d492304cd4694292d3f04f",
39
- "size": 252385952
38
+ "checksum": "3d8509ae7de11d77dbdc711aa320fc6d5064ce795464a8670696611b57093caf",
39
+ "size": 253293728
40
40
  },
41
41
  "win32-arm64": {
42
42
  "binary": "claude.exe",
43
- "checksum": "4a603da0a33d49478e55938898ddd06c4ec5d1ec7f443d92dd4352665faaef05",
44
- "size": 246736544
43
+ "checksum": "a0f9bab0dbdda9b43a8765d54e329e44484d9dd7d4f40cf31db6eee27a2da41c",
44
+ "size": 247643808
45
45
  }
46
46
  },
47
47
  "sdkCompat": {
package/manifest.zst.json CHANGED
@@ -1,55 +1,55 @@
1
1
  {
2
- "version": "2.1.210",
3
- "commit": "88e9fbf39bf4efa5bca44549b7fd9461628657e6",
4
- "buildDate": "2026-07-14T15:14:20Z",
2
+ "version": "2.1.211",
3
+ "commit": "17a4b6d7b2ee1936b95e595054c7e7d38fddafb7",
4
+ "buildDate": "2026-07-15T16:44:23Z",
5
5
  "platforms": {
6
6
  "darwin-arm64": {
7
7
  "binary": "claude.zst",
8
- "checksum": "b2b98bc9d82c166f423eadb1c79a0287bf68975cbdb9fd4edb0c4a2c7605ea8b",
9
- "size": 49753745,
8
+ "checksum": "96e6bc497e39cecdb63ac449f26d3eca54870e1d73fe4664c816f5e38440112e",
9
+ "size": 49913141,
10
10
  "bundle": {
11
- "checksum": "daedd5c953c84f0ecf9f67c6bd505a5cebb11c6fb2c58380bd42a903e574cf1e",
12
- "size": 49743844
11
+ "checksum": "6d0cabcaee7f2fdc7c37a14eacd5cffaafaf6fb16d59225c464de426d4634bb4",
12
+ "size": 49917482
13
13
  }
14
14
  },
15
15
  "darwin-x64": {
16
16
  "binary": "claude.zst",
17
- "checksum": "379c3df41bd6b3262e88467f91d156bb6b6f5d4c29628726d1961fc4fd968fb3",
18
- "size": 54192491,
17
+ "checksum": "bec7a90b476f28af6d572f07dc553b75bd31215ef13ac470fec30e23636444ee",
18
+ "size": 54366611,
19
19
  "bundle": {
20
- "checksum": "19af46b5eff6d8505e33dff623f67ba58a1e4d98e352eda948161c0f9eafb38a",
21
- "size": 54195518
20
+ "checksum": "d97f221e917e337911e2b6b0897b22fd2361428627b6e0324e0561218858c6d4",
21
+ "size": 54363292
22
22
  }
23
23
  },
24
24
  "linux-arm64": {
25
25
  "binary": "claude.zst",
26
- "checksum": "7056a3eed6c5a2bb6dfad0613c55227a66acc0c9022eb3ab615f9b77b13ddef0",
27
- "size": 58807309
26
+ "checksum": "d9c04a9c1ce0e795c9e6de00bb77415fcdd291d2c9e2ef26f9c6d86cb666ddf3",
27
+ "size": 58963439
28
28
  },
29
29
  "linux-x64": {
30
30
  "binary": "claude.zst",
31
- "checksum": "4b487e778a705e992dee0056fb96f106b1417f543162b69ada6666c46404754a",
32
- "size": 60117820
31
+ "checksum": "f90ff81999ed7d0b509db2a750d1f148d4814eef44cea68ed99c315b02672b6c",
32
+ "size": 60275709
33
33
  },
34
34
  "linux-arm64-musl": {
35
35
  "binary": "claude.zst",
36
- "checksum": "0eaea6f2b355654b11baaed0c1a04c2686ac893c6ee79c366c74c486425655d5",
37
- "size": 57495755
36
+ "checksum": "4435a40b0ec723721a4f974d0afc26877576228ba40368f51f6ae7ef08221dac",
37
+ "size": 57686071
38
38
  },
39
39
  "linux-x64-musl": {
40
40
  "binary": "claude.zst",
41
- "checksum": "ff54075fd3b54c97cb7817f6e583877e8fd153620ed850fdd490d7438fdcc8ab",
42
- "size": 58895822
41
+ "checksum": "1b10c1ff37f4aa689c0d87ab929e01b4ecc945f9434767f0ec3b125e217863e3",
42
+ "size": 59054974
43
43
  },
44
44
  "win32-x64": {
45
45
  "binary": "claude.exe.zst",
46
- "checksum": "e41bb10241c11ff3cf42fe8ac53c1f923821d5f37de341c8995597baa7cb2535",
47
- "size": 60475271
46
+ "checksum": "34f136939b7df0a1eca476f58ec8ba00621926963a76f1db8aa132b21042fe2b",
47
+ "size": 60660958
48
48
  },
49
49
  "win32-arm64": {
50
50
  "binary": "claude.exe.zst",
51
- "checksum": "26f138ebc4077cfefbd6ba1eb91b41e6f63d4cc1e8049c90cc1f81d2e8caf4c5",
52
- "size": 58469872
51
+ "checksum": "c923a9f914d8667443e8f4ba9ae09c6a674dd0c27f3360cdf0082c9fa28259b3",
52
+ "size": 58633026
53
53
  }
54
54
  },
55
55
  "sdkCompat": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anthropic-ai/claude-agent-sdk",
3
- "version": "0.3.210",
3
+ "version": "0.3.211",
4
4
  "main": "sdk.mjs",
5
5
  "types": "sdk.d.ts",
6
6
  "exports": {
@@ -57,14 +57,14 @@
57
57
  "zod": "^4.0.0"
58
58
  },
59
59
  "optionalDependencies": {
60
- "@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.210",
61
- "@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.210",
62
- "@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.210",
63
- "@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.210",
64
- "@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.210",
65
- "@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.210",
66
- "@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.210",
67
- "@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.210"
60
+ "@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.211",
61
+ "@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.211",
62
+ "@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.211",
63
+ "@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.211",
64
+ "@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.211",
65
+ "@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.211",
66
+ "@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.211",
67
+ "@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.211"
68
68
  },
69
69
  "files": [
70
70
  "sdk.mjs",
@@ -80,5 +80,5 @@
80
80
  "manifest.json",
81
81
  "manifest.zst.json"
82
82
  ],
83
- "claudeCodeVersion": "2.1.210"
83
+ "claudeCodeVersion": "2.1.211"
84
84
  }
package/sdk-tools.d.ts CHANGED
@@ -20,6 +20,7 @@ export type ToolInputSchemas =
20
20
  | GrepInput
21
21
  | TaskStopInput
22
22
  | ListMcpResourcesInput
23
+ | RefreshMcpToolsInput
23
24
  | McpInput
24
25
  | NotebookEditInput
25
26
  | ReadMcpResourceDirInput
@@ -61,6 +62,7 @@ export type ToolOutputSchemas =
61
62
  | GrepOutput
62
63
  | TaskStopOutput
63
64
  | ListMcpResourcesOutput
65
+ | RefreshMcpToolsOutput
64
66
  | McpOutput
65
67
  | NotebookEditOutput
66
68
  | ReadMcpResourceDirOutput
@@ -341,6 +343,32 @@ export type ListMcpResourcesOutput = {
341
343
  */
342
344
  server: string;
343
345
  }[];
346
+ export type RefreshMcpToolsOutput = {
347
+ /**
348
+ * Server name
349
+ */
350
+ server: string;
351
+ /**
352
+ * refreshed: tool list re-queried and applied. error: the re-query failed and the previous tool set was kept. not_connected: the server has no live connection to query (this tool never dials).
353
+ */
354
+ status: "refreshed" | "error" | "not_connected";
355
+ /**
356
+ * Number of tools now available from this server
357
+ */
358
+ toolCount?: number;
359
+ /**
360
+ * Tool names this refresh added
361
+ */
362
+ added?: string[];
363
+ /**
364
+ * Tool names this refresh removed
365
+ */
366
+ removed?: string[];
367
+ /**
368
+ * Why the refresh failed or the server was unavailable
369
+ */
370
+ error?: string;
371
+ }[];
344
372
  /**
345
373
  * MCP tool execution result
346
374
  */
@@ -677,6 +705,12 @@ export interface ListMcpResourcesInput {
677
705
  */
678
706
  server?: string;
679
707
  }
708
+ export interface RefreshMcpToolsInput {
709
+ /**
710
+ * Optional server name: refresh only this server. Omit to refresh all connected servers.
711
+ */
712
+ server?: string;
713
+ }
680
714
  export interface McpInput {
681
715
  [k: string]: unknown;
682
716
  }
package/sdk.d.ts CHANGED
@@ -1463,7 +1463,7 @@ export declare type Options = {
1463
1463
  * Enable beta features. Currently supported:
1464
1464
  * - `'context-1m-2025-08-07'` - Enable 1M token context window (Sonnet 4/4.5 only)
1465
1465
  *
1466
- * @see https://docs.anthropic.com/en/api/beta-headers
1466
+ * @see https://platform.claude.com/docs/en/api/beta-headers
1467
1467
  */
1468
1468
  betas?: SdkBeta[];
1469
1469
  /**
@@ -1607,7 +1607,7 @@ export declare type Options = {
1607
1607
  *
1608
1608
  * When set, takes precedence over the deprecated `maxThinkingTokens`.
1609
1609
  *
1610
- * @see https://docs.anthropic.com/en/docs/build-with-claude/adaptive-thinking
1610
+ * @see https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking
1611
1611
  */
1612
1612
  thinking?: ThinkingConfig;
1613
1613
  /**
@@ -1620,7 +1620,7 @@ export declare type Options = {
1620
1620
  * - `'xhigh'` — Deeper than high (Fable 5, Opus 4.7+, Sonnet 5)
1621
1621
  * - `'max'` — Maximum effort (Fable 5, Opus 4.6+, Sonnet 4.6+)
1622
1622
  *
1623
- * @see https://docs.anthropic.com/en/docs/build-with-claude/effort
1623
+ * @see https://platform.claude.com/docs/en/build-with-claude/effort
1624
1624
  */
1625
1625
  effort?: EffortLevel;
1626
1626
  /**
@@ -1813,7 +1813,7 @@ export declare type Options = {
1813
1813
  * }
1814
1814
  * ```
1815
1815
  *
1816
- * @see https://docs.anthropic.com/en/docs/claude-code/settings#sandbox-settings
1816
+ * @see https://code.claude.com/docs/en/settings#sandbox-settings
1817
1817
  */
1818
1818
  sandbox?: SandboxSettings;
1819
1819
  /**
@@ -2014,6 +2014,15 @@ export declare type Options = {
2014
2014
  spawnClaudeCodeProcess?: (options: SpawnOptions) => SpawnedProcess;
2015
2015
  };
2016
2016
 
2017
+ /**
2018
+ * Emitted on the same severity:'error' path as the usage-limit bucket, but
2019
+ * the condition is an org policy, not an exhausted limit — consumers route
2020
+ * these to org-disabled presentation, never the usage-limit card.
2021
+ *
2022
+ * @alpha
2023
+ */
2024
+ export declare const ORG_POLICY_LIMIT_PREFIXES: readonly ["This service is disabled for your org"];
2025
+
2017
2026
  export declare type OutputFormat = JsonSchemaOutputFormat;
2018
2027
 
2019
2028
  export declare type OutputFormatType = 'json_schema';
@@ -2799,6 +2808,10 @@ export declare type SDKAssistantMessage = {
2799
2808
  uuid: UUID;
2800
2809
  session_id: string;
2801
2810
  request_id?: string;
2811
+ /**
2812
+ * This turn continued the preceding truncated assistant turn inside its trailing signed thinking block (max-output-tokens recovery). Its thinking signatures are cumulative over that preceding thinking-only turn, so a history replayed through the bridge must carry this flag back for the normalizer to keep the run's prefix on the wire. Wrapper-level sibling — never inside `message.content` — so it is not replayed to the model.
2813
+ */
2814
+ resumed_from_incomplete_thinking?: true;
2802
2815
  /**
2803
2816
  * Wire uuids of previously-delivered messages that this message replaces (refusal-fallback supersede). The list can include tombstoned tool_result frames from the refused leg, not only assistant frames. Evict the named messages on arrival and treat this frame as their canonical replacement. Idempotent with the end-of-turn model_refusal_fallback notice, whose retracted_message_uuids remains the complete audit record for the turn.
2804
2817
  */
@@ -2812,7 +2825,10 @@ export declare type SDKAssistantMessage = {
2812
2825
  */
2813
2826
  task_description?: string;
2814
2827
 
2815
-
2828
+ /**
2829
+ * ISO timestamp of when this content block finished on the originating process. One API assistant turn may produce several assistant messages sharing a message.id, each with its own timestamp. Uses the originating host's clock, so it's for display only; do not order messages by this field. Older emitters omit it; consumers should fall back to receive time.
2830
+ */
2831
+ timestamp?: string;
2816
2832
 
2817
2833
 
2818
2834
 
@@ -3421,7 +3437,7 @@ declare type SDKControlListModelsRequest = {
3421
3437
  };
3422
3438
 
3423
3439
  /**
3424
- * Invokes an MCP tool via the subprocess MCP client without a model turn. No permission check (control channel is trusted, same as other subtypes). SDK-type MCP servers (config.type === "sdk") are rejected — they are caller-provided, so the caller can invoke them directly without the subprocess round-trip. Result content passes through the same processing as model-turn MCP calls. Session expiry is not retried automatically; callers can mcp_reconnect and retry. UrlElicitationRequired (-32042) tries Elicitation hooks; if no hook resolves, the call errors with the URL in the message — open it out-of-band, then retry mcp_call. STAGED calls (input_files/output_files declared) additionally stage lane rows in/out around the call — see the input_files describe. Staged failures come back as a success-subtype response whose staging field carries a typed error_code; subtype:error is emitted only when the call could not be attempted at all (server not connected, kill switch, dispatch failure) and means nothing ran. Standard RPC semantics: a redelivered request_id supersedes the in-flight run (it is aborted and its response suppressed — exactly one response per request_id); conversion is idempotent, so re-running is safe. Cancellable via control_cancel_request.
3440
+ * Invokes an MCP tool via the subprocess MCP client without a model turn. No permission check (control channel is trusted, same as other subtypes). SDK-type MCP servers (config.type === "sdk") are rejected — they are caller-provided, so the caller can invoke them directly without the subprocess round-trip. Result content passes through the same processing as model-turn MCP calls. Session expiry is not retried automatically; callers can mcp_reconnect and retry. UrlElicitationRequired (-32042) tries Elicitation hooks; if no hook resolves, the call errors with the URL in the message — open it out-of-band, then retry mcp_call. STAGED calls (input_files/output_files declared) additionally stage lane rows in/out around the call — see the input_files describe. Staged failures come back as a success-subtype response whose staging field carries a typed error_code; subtype:error is emitted only when the call could not be attempted at all (server not connected, kill switch, dispatch failure) and means nothing ran. A target server that is not yet connected is brought up on demand: dispatch runs the deferred plugin/MCP startup resolution (the work a first model turn would have done) and waits up to 30s — shortened by expires_at when that is sooner — for the server to connect before answering "MCP server not connected", so a dispatch that races plugin startup (e.g. after an idle-wake reattach) succeeds instead of failing until a turn runs. Standard RPC semantics: a redelivered request_id supersedes the in-flight run (it is aborted and its response suppressed — exactly one response per request_id); conversion is idempotent, so re-running is safe. Cancellable via control_cancel_request.
3425
3441
  */
3426
3442
  declare type SDKControlMcpCallRequest = {
3427
3443
  subtype: 'mcp_call';
@@ -6505,6 +6521,12 @@ export declare interface SpawnedProcess {
6505
6521
  readonly killed: boolean;
6506
6522
  /** Exit code if the process has exited, null otherwise */
6507
6523
  readonly exitCode: number | null;
6524
+ /**
6525
+ * Signal that terminated the process, if any. Optional: ChildProcess
6526
+ * provides it; custom spawners may omit it (signal exits then read as
6527
+ * still-running until their 'exit' event delivers the signal).
6528
+ */
6529
+ readonly signalCode?: NodeJS.Signals | null;
6508
6530
  /**
6509
6531
  * Kill the process with the given signal
6510
6532
  * @param signal - The signal to send (e.g., 'SIGTERM', 'SIGKILL')
@@ -6514,6 +6536,11 @@ export declare interface SpawnedProcess {
6514
6536
  * Register a callback for when the process exits
6515
6537
  * @param event - Must be 'exit'
6516
6538
  * @param listener - Callback receiving exit code and signal
6539
+ *
6540
+ * ProcessTransport's built-in local spawn delivers this only after the
6541
+ * child's stderr has also closed (bounded by a short grace), so exit
6542
+ * consumers see a complete stderr tail in exit errors. Custom
6543
+ * `spawnClaudeCodeProcess` implementations emit plain process exit.
6517
6544
  */
6518
6545
  on(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): void;
6519
6546
  /**
@@ -6838,6 +6865,33 @@ export declare interface Transport {
6838
6865
  [Symbol.dispose]?(): void;
6839
6866
  }
6840
6867
 
6868
+ /**
6869
+ * Messages meaning "a usage limit was genuinely reached" — the error-path
6870
+ * outputs of getLimitReachedText (rateLimitMessages.ts) and
6871
+ * getFableCreditsRequiredContent (api/errors.ts).
6872
+ *
6873
+ * @alpha
6874
+ */
6875
+ export declare const USAGE_LIMIT_ERROR_PREFIXES: readonly ["You've hit your", "You've reached your", "You're out of usage credits", "Your org is out of usage · add funds to continue", "Your org is out of usage · contact your admin", "Your seat type doesn't include usage credits", "Your seat type doesn't include usage", "Your usage allocation has been disabled by your admin", "Your group's usage limit is set to $0", "Fable 5 requires usage credits", "You're out of extra usage", "Your seat type doesn't include extra usage"];
6876
+
6877
+ /**
6878
+ * Overage-transition notifications ("now drawing from credits"). Toast only;
6879
+ * these never arrive as API errors.
6880
+ *
6881
+ * @alpha
6882
+ */
6883
+ export declare const USAGE_TRANSITION_PREFIXES: readonly ["You're now using usage credits", "You're now using your usage allocation", "Now using your usage allocation", "Now using usage credits", "You're now using extra usage", "Now using extra usage"];
6884
+
6885
+ /**
6886
+ * Approaching-limit warnings (severity:'warning'). Footer/toast only; these
6887
+ * never arrive as API errors. ("Approaching …" early warnings are
6888
+ * deliberately unregistered — they render in the footer without
6889
+ * <RateLimitMessage> styling; see the generator-coverage tests.)
6890
+ *
6891
+ * @alpha
6892
+ */
6893
+ export declare const USAGE_WARNING_PREFIXES: readonly ["You've used", "You're close to"];
6894
+
6841
6895
  /**
6842
6896
  * A `request_user_dialog` control request from the CLI, asking the SDK
6843
6897
  * consumer to render a blocking dialog and return the user's choice.