@anthropic-ai/claude-agent-sdk 0.3.300 → 0.3.301

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,48 +1,48 @@
1
1
  {
2
- "version": "2.1.300",
2
+ "version": "2.1.301",
3
3
  "manifestSignatureEnforcement": "flag",
4
- "commit": "c6733ae1276880507ca0c5b053ae18fb0df090d6",
5
- "buildDate": "2026-10-14T13:29:53Z",
4
+ "commit": "12a1baed117fbcc7e0695ab8aa6d2a4c6bd00cbb",
5
+ "buildDate": "2026-10-15T14:01:03Z",
6
6
  "platforms": {
7
7
  "darwin-arm64": {
8
8
  "binary": "claude",
9
- "checksum": "475517caa611e3318a2f298fa071287ec98955538df78c58f709ecc01e5ae2d3",
10
- "size": 249556880
9
+ "checksum": "1f04c69e1c24e4d0a716a863af0aad8fc64d49a499334c29701f073700276b99",
10
+ "size": 250541840
11
11
  },
12
12
  "darwin-x64": {
13
13
  "binary": "claude",
14
- "checksum": "5824fc36863e70bbd070491bb9359e217d3f17b38c45697c085b31a3a67356b3",
15
- "size": 259416272
14
+ "checksum": "3439427bfce962fddcf557c5a058ca914fa63e06fee894f8e12a3f10e04d1871",
15
+ "size": 260406992
16
16
  },
17
17
  "linux-arm64": {
18
18
  "binary": "claude",
19
- "checksum": "ae2295ae2da156936bf5831ab01971ce924d0c9a0af174e28d96fffa8d5fa0a6",
20
- "size": 266264568
19
+ "checksum": "1e119036a802d359ba5f9886428e031586e8796f7a858d5a8ee179ac7b8604f0",
20
+ "size": 267247608
21
21
  },
22
22
  "linux-x64": {
23
23
  "binary": "claude",
24
- "checksum": "674deba0bba9aee479f4503c438b49303b6fdd304b9a471b14977aaec5215453",
25
- "size": 266972344
24
+ "checksum": "bc1aad9982c7b59c7d889ff92595d61cf46e0a6eae074cb551d932a989bcd222",
25
+ "size": 267955384
26
26
  },
27
27
  "linux-arm64-musl": {
28
28
  "binary": "claude",
29
- "checksum": "267fecafb9df3dc1ef93f01ea936742455151d38b9bceebc4c12b531df827a2c",
30
- "size": 258422872
29
+ "checksum": "d0a6b24d157d061cd5c406eb4b8f3d4016b646c8802b47babd3625c636e4433d",
30
+ "size": 259405912
31
31
  },
32
32
  "linux-x64-musl": {
33
33
  "binary": "claude",
34
- "checksum": "426e7b0a3726d656babc943a92392eb3653377587658a240ab442d19e4eef3c9",
35
- "size": 260587880
34
+ "checksum": "081a7219cf075e5c5d2a39796517ae2fa06610d99f3498e7ee5c577f0da687fa",
35
+ "size": 261566824
36
36
  },
37
37
  "win32-x64": {
38
38
  "binary": "claude.exe",
39
- "checksum": "56810a111c01dcd218b42727c23fd8763be42320038b1adcac93cf599fac2de2",
40
- "size": 270863520
39
+ "checksum": "84d61feeb1a07e5a5b3354d68432591cac18a5d38a419a30d86d0f3ad8cba397",
40
+ "size": 271840416
41
41
  },
42
42
  "win32-arm64": {
43
43
  "binary": "claude.exe",
44
- "checksum": "fef0df9c7f72b2d7d0c26b1702f4646113be2c45a5b40eb5bbb7c93f5cbd5f8b",
45
- "size": 257010848
44
+ "checksum": "20ec11897e18c156de0be6b35a54b709c503d0b61070c98ec34dd9102423a4a2",
45
+ "size": 257987744
46
46
  }
47
47
  },
48
48
  "sdkCompat": {
package/manifest.zst.json CHANGED
@@ -1,56 +1,56 @@
1
1
  {
2
- "version": "2.1.300",
2
+ "version": "2.1.301",
3
3
  "manifestSignatureEnforcement": "flag",
4
- "commit": "c6733ae1276880507ca0c5b053ae18fb0df090d6",
5
- "buildDate": "2026-10-14T13:31:05Z",
4
+ "commit": "12a1baed117fbcc7e0695ab8aa6d2a4c6bd00cbb",
5
+ "buildDate": "2026-10-15T14:02:29Z",
6
6
  "platforms": {
7
7
  "darwin-arm64": {
8
8
  "binary": "claude.zst",
9
- "checksum": "5f19cc8fef7b1387f4b71691213b5aadc62d9157a78014287f3002ce8642cc23",
10
- "size": 83582341,
9
+ "checksum": "499703a087a5395ed31e96e5cb19a6d3257cfeffbf812e5dba97347a33c84c5a",
10
+ "size": 83877124,
11
11
  "bundle": {
12
- "checksum": "f53c2f9a3934eeebf8b7c86990e2c08b9ec046623941daea91d80a1f58a5d197",
13
- "size": 83578473
12
+ "checksum": "491300b6499480e9240856191ad45b750f2cd90d1c9d00e1d4d37ba15c7d2f41",
13
+ "size": 83879655
14
14
  }
15
15
  },
16
16
  "darwin-x64": {
17
17
  "binary": "claude.zst",
18
- "checksum": "0bf82ce30e45f97b271db94af3a6877b72f658f570cea4dfac66741708a7737d",
19
- "size": 88318346,
18
+ "checksum": "157e1ad1310d96edcbadc7308debdec4cd5a40ea92b7e6e487ba88d056c3e934",
19
+ "size": 88633774,
20
20
  "bundle": {
21
- "checksum": "5e4397e2736e9b9e40de94251d9c621e4fe8bcfc460dec98312090002db750f3",
22
- "size": 88323146
21
+ "checksum": "5a9d4ca1a59dadb842467cd863ceb8cfe453f28dea02557e7a909d4edf0b8dea",
22
+ "size": 88642019
23
23
  }
24
24
  },
25
25
  "linux-arm64": {
26
26
  "binary": "claude.zst",
27
- "checksum": "1f87b1a7838056aaf69c2b819c0b6b118ac713e0e2ba6c0a768aa531c7c5e8d0",
28
- "size": 92840828
27
+ "checksum": "b94d6bca4549db066a3ffdbdb3d0f64083aa11d4557f672fd1eb77173b665d0f",
28
+ "size": 93160808
29
29
  },
30
30
  "linux-x64": {
31
31
  "binary": "claude.zst",
32
- "checksum": "ca1608ae4e85017c5408c85a3778410add7dd796324acfd0eef3ad707268d5d6",
33
- "size": 93676652
32
+ "checksum": "7121db492db6a44a756ae9581890613d914f78abba35cd57fa3bb4ed5e873e39",
33
+ "size": 93994767
34
34
  },
35
35
  "linux-arm64-musl": {
36
36
  "binary": "claude.zst",
37
- "checksum": "f006bb2458db1d50c5c956b47864bc708823c132345d94dd8a10e8d5e0b2ffd8",
38
- "size": 91194411
37
+ "checksum": "d60d859afeb94325c2603934b8e9514227d87c1802eb6021c1d572db7456a908",
38
+ "size": 91515582
39
39
  },
40
40
  "linux-x64-musl": {
41
41
  "binary": "claude.zst",
42
- "checksum": "0f5c6b4abe1d772642f85d52a4a05c79bbe7fd83bd0a551d1d0cfabbcc30ef53",
43
- "size": 92091262
42
+ "checksum": "8b131b3cb1d9dbf753edb003e66d49c91b2e58e0411906803694d8f4b1b9ede2",
43
+ "size": 92405915
44
44
  },
45
45
  "win32-x64": {
46
46
  "binary": "claude.exe.zst",
47
- "checksum": "78ed93dd777f073ef3a5961457775091d152d17c65823c40a86fc9bf55cb113a",
48
- "size": 96203531
47
+ "checksum": "825816dcf3b81a989bfb8c931ed02485f3e2014fe954326710607f7af0f10c4d",
48
+ "size": 96514855
49
49
  },
50
50
  "win32-arm64": {
51
51
  "binary": "claude.exe.zst",
52
- "checksum": "ca0cb24c68d402e8b3caa7a0daa38992cec05ac1076a4ebf709983aa608bb665",
53
- "size": 92145199
52
+ "checksum": "e85bee152b8e0e2216a97e3494708b66935e0279f05cc00ff32fea04a19cfe4a",
53
+ "size": 92454500
54
54
  }
55
55
  },
56
56
  "sdkCompat": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anthropic-ai/claude-agent-sdk",
3
- "version": "0.3.300",
3
+ "version": "0.3.301",
4
4
  "main": "sdk.mjs",
5
5
  "types": "sdk.d.ts",
6
6
  "exports": {
@@ -61,14 +61,14 @@
61
61
  "zod": "^4.0.0"
62
62
  },
63
63
  "optionalDependencies": {
64
- "@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.300",
65
- "@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.300",
66
- "@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.300",
67
- "@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.300",
68
- "@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.300",
69
- "@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.300",
70
- "@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.300",
71
- "@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.300"
64
+ "@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.301",
65
+ "@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.301",
66
+ "@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.301",
67
+ "@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.301",
68
+ "@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.301",
69
+ "@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.301",
70
+ "@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.301",
71
+ "@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.301"
72
72
  },
73
73
  "files": [
74
74
  "sdk.mjs",
@@ -85,8 +85,8 @@
85
85
  "extractFromBunfs.d.ts",
86
86
  "manifest.json",
87
87
  "manifest.zst.json",
88
- "core-3fs8zete.mjs",
89
- "core-5kpyasem.mjs"
88
+ "core-6z7brxfa.mjs",
89
+ "core-x118ntbh.mjs"
90
90
  ],
91
- "claudeCodeVersion": "2.1.300"
91
+ "claudeCodeVersion": "2.1.301"
92
92
  }
package/sdk.d.ts CHANGED
@@ -204,6 +204,17 @@ export declare type BaseOutputFormat = {
204
204
  type: OutputFormatType;
205
205
  };
206
206
 
207
+ /**
208
+ * Names of built-in tools, as permission rules, hook matchers, `tools` and
209
+ * `disallowedTools` spell them. A name is listed even where a platform or
210
+ * setting turns its tool off. The list is not complete: the CLI has tools that
211
+ * are not on it, so it cannot stand for "every tool". What a session has is
212
+ * the `tools` field of its `system/init` message.
213
+ *
214
+ * @alpha
215
+ */
216
+ export declare const BUILTIN_TOOL_NAMES: readonly ['Agent', 'Artifact', 'AskUserQuestion', 'Bash', 'ClaudeDesign', 'CronCreate', 'CronDelete', 'CronList', 'Edit', 'EndConversation', 'EnterPlanMode', 'EnterWorktree', 'ExitPlanMode', 'ExitWorktree', 'Glob', 'Grep', 'ListAgents', 'ListMcpResourcesTool', 'LSP', 'Monitor', 'NotebookEdit', 'OfferChromeSetup', 'PowerShell', 'Projects', 'propose_skills', 'ProposeGoal', 'PushNotification', 'Read', 'ReadMcpResourceDirTool', 'ReadMcpResourceTool', 'ReadNotifications', 'RemoteTrigger', 'ReportFindings', 'ScheduleWakeup', 'SendFeedback', 'SendMessage', 'SendUserFile', 'SendUserMessage', 'ShareOnboardingGuide', 'ShowOnboardingRolePicker', 'Skill', 'SubagentHandback', 'TaskCreate', 'TaskGet', 'TaskList', 'TaskStop', 'TaskUpdate', 'TodoWrite', 'ToolSearch', 'WaitForMcpServers', 'WebFetch', 'WebSearch', 'Workflow', 'Write'];
217
+
207
218
  /**
208
219
  * Permission callback function for controlling tool usage.
209
220
  * Called before each tool execution to determine if it should be allowed.
@@ -1080,6 +1091,15 @@ export declare type JsonSchemaOutputFormat = {
1080
1091
  schema: Record<string, unknown>;
1081
1092
  };
1082
1093
 
1094
+ /**
1095
+ * Former names that permission rules, hook matchers, `tools` and
1096
+ * `disallowedTools` still accept, each mapped to the tool's current name. An
1097
+ * entry is dropped when its tool is removed.
1098
+ *
1099
+ * @alpha
1100
+ */
1101
+ export declare const LEGACY_TOOL_NAME_ALIASES: Readonly<Record<string, string>>;
1102
+
1083
1103
  /**
1084
1104
  * List sessions with metadata.
1085
1105
  *
@@ -1205,6 +1225,10 @@ export declare type McpSdkServerConfig = {
1205
1225
  */
1206
1226
  timeout?: number;
1207
1227
 
1228
+ /**
1229
+ * Per-tool permission policy the host declares for this server's tools (not the tool definitions passed to createSdkMcpServer). always_ask: the CLI asks the host (canUseTool or the permission prompt tool) before each call, even where an allow rule or allowedTools covers the tool, and under bypassPermissions outside a hosted remote session (CLAUDE_CODE_REMOTE); under dontAsk the call is denied; in auto mode the classifier decides, except that by default a tool annotated destructiveHint still asks. always_deny: calls are denied. always_allow and org_max_permission are ignored on sdk servers; grant allows with allowedTools or canUseTool. Read from initialize (sdkMcpServerConfigs) and from each mcp_set_servers entry that names the server. On the wire an entry without tools states no policy: on initialize the stored list and the rules stand; on mcp_set_servers the rules are replaced without them. The Agent SDK always re-sends the registered list. An entry whose policy is not one of the three asks; an entry without a string name is dropped and the rest apply; a value that is not a list reads as absent.
1230
+ */
1231
+ tools?: McpServerToolPolicy[];
1208
1232
  };
1209
1233
 
1210
1234
  /**
@@ -1281,7 +1305,7 @@ export declare type McpServerStatus = {
1281
1305
  openWorld?: boolean;
1282
1306
  };
1283
1307
  /**
1284
- * The MCP Apps (SEP-1865) members of the tool's `_meta`, for a host that renders the tool's `ui://` resource, under the keys the server used: `ui` (an object: `resourceUri`, a `ui://` string; `visibility`, an array of 'model' | 'app'; and any other member the server sent) and the deprecated flat `ui/resourceUri` (a `ui://` string). Validated and size-bounded; every other `_meta` key is withheld. Present only on a tool that declares one, from CLIs that advertise `mcp_tool_ui_meta_v1`.
1308
+ * The MCP Apps (SEP-1865) members of the tool's `_meta`, for a host that renders the tool's `ui://` resource, under the keys the server used: `ui` (an object: `resourceUri`, a `ui://` string; `visibility`, an array of 'model' | 'app'; and any other member the server sent) and the deprecated flat `ui/resourceUri` (a `ui://` string). Each is validated and size-bounded, and withheld if it fails. Of a `ui` that fails, only `visibility` still arrives: the 'model' and 'app' entries the server listed, or `[]` (neither audience) if `ui` is not an object or `visibility` not an array; `null` counts as absent. So a tool with no `visibility` declared none. A CLI that does not advertise `mcp_call_result_not_for_model_v1` may withhold a failed `ui` whole. Every other `_meta` key is withheld. Present only on a tool that declares one, from CLIs that advertise `mcp_tool_ui_meta_v1`.
1285
1309
  */
1286
1310
  _meta?: Record<string, unknown>;
1287
1311
  }[];
@@ -1291,7 +1315,7 @@ export declare type McpServerStatus = {
1291
1315
  export declare type McpServerStatusConfig = McpServerConfigForProcessTransport | McpClaudeAIProxyServerConfig;
1292
1316
 
1293
1317
  /**
1294
- * Per-tool permission policy carried on mcp_set_servers for remote servers.
1318
+ * Per-tool permission policy for an MCP server: carried on mcp_set_servers for remote (http/sse) servers, and on mcp_set_servers or initialize (sdkMcpServerConfigs) for host-registered sdk servers, where only always_ask and always_deny take effect.
1295
1319
  */
1296
1320
  export declare type McpServerToolPolicy = {
1297
1321
  name: string;
@@ -3112,11 +3136,16 @@ export declare interface Query extends AsyncGenerator<SDKMessage, void> {
3112
3136
  * describing what applying would change; call again without the option
3113
3137
  * to apply anyway.
3114
3138
  *
3139
+ * With `addPlugins`, the reload also loads those plugins, as if each had
3140
+ * been in the `plugins` option at launch; plugins already loaded stay. Each
3141
+ * path must be absolute.
3142
+ *
3115
3143
  * @returns The refreshed session components after plugin reload, or the
3116
3144
  * unchanged ones with `held: true` when the reload was held
3117
3145
  */
3118
3146
  reloadPlugins(options?: {
3119
3147
  holdOnCacheImpact?: boolean;
3148
+ addPlugins?: SdkPluginConfig[];
3120
3149
  }): Promise<SDKControlReloadPluginsResponse>;
3121
3150
  /**
3122
3151
  * Reload skills from disk and return the refreshed skill list.
@@ -3642,6 +3671,7 @@ export declare type SDKAssistantMessage = {
3642
3671
 
3643
3672
  session_id: string;
3644
3673
  request_id?: string;
3674
+
3645
3675
  /**
3646
3676
  * Client uuid of the user message this turn is answering (submitMessage options.uuid), stamped on an assistant message each time that send changes — the turn's FIRST top-level assistant message (which may carry only a thinking block, or be a synthetic API-error message), and then, for a turn started by a synthetic (meta) prompt, the first assistant message after each queued user message folded in mid-turn (the fold takes the echo over); with --include-partial-messages the turn's first non-ping stream event is stamped too, independently (see SDKPartialAssistantMessage), so the same uuid may appear on both — either binds the reply to the send it answers without waiting for the result; the server keeps the first stamp it sees per uuid. A turn started by a typed prompt keeps that uuid for its whole turn, so it stamps once per frame kind. A meta turn's own uuid is stamped only when the host vouches it is the client event's own (on a hosted session, the uuid the session server persisted: delivered content such as a Slack owner ping, a Slack-bot observation or a client-injected synthetic turn), never for a prompt the CLI minted itself — except that a turn carrying resume_reason, such as the boot-time rescue turn re-running a turn a worker restart interrupted mid-way, stamps the interrupted turn's own last user prompt, the send it answers, where that can be vouched for (a turn that goes on from a permission answer or from in-flight tool calls may first re-send, unstamped, the assistant message that made those calls); either way a user message folded into a meta turn takes the echo over from it (the rescue turn absorbing messages sent while the session was down; a bot-observation turn absorbing a human's post), and the first reply frame of each kind after that fold carries the folded message's uuid — the first reply that message got. Wrapper-level sibling — never inside `message.content` — so it is not replayed to the model. Absent on every other frame of the turn, on subagent frames (parent_tool_use_id set), on turns that neither had a client uuid nor folded a user message in, and from older producers.
3647
3677
  */
@@ -4511,7 +4541,7 @@ declare type SDKControlInitializeRequest = {
4511
4541
  hooks?: Partial<Record<coreTypes.HookEvent, SDKHookCallbackMatcher[]>>;
4512
4542
  sdkMcpServers?: string[];
4513
4543
  /**
4514
- * Settings for the SDK-hosted MCP servers named in sdkMcpServers, keyed by server name. Sent as a separate field so a CLI that predates it ignores it; entries whose name is not in sdkMcpServers, and values that do not match this shape, are ignored rather than rejected. Applied when the server is first registered.
4544
+ * Settings for the SDK-hosted MCP servers named in sdkMcpServers, keyed by server name. Sent as a separate field so a CLI that predates it ignores it; entries whose name is not in sdkMcpServers, and values that do not match this shape, are ignored rather than rejected. timeout and disableAutoBackground apply when the server is first registered; tools (the per-tool permission policy) adds its ask and deny rules on every initialize that names the server. An initialize never removes a rule; mcp_set_servers replaces them.
4515
4545
  */
4516
4546
  sdkMcpServerConfigs?: Record<string, {
4517
4547
  /**
@@ -4519,6 +4549,10 @@ declare type SDKControlInitializeRequest = {
4519
4549
  */
4520
4550
  timeout?: number;
4521
4551
 
4552
+ /**
4553
+ * Per-tool permission policy the host declares for this server's tools (not the tool definitions passed to createSdkMcpServer). always_ask: the CLI asks the host (canUseTool or the permission prompt tool) before each call, even where an allow rule or allowedTools covers the tool, and under bypassPermissions outside a hosted remote session (CLAUDE_CODE_REMOTE); under dontAsk the call is denied; in auto mode the classifier decides, except that by default a tool annotated destructiveHint still asks. always_deny: calls are denied. always_allow and org_max_permission are ignored on sdk servers; grant allows with allowedTools or canUseTool. Read from initialize (sdkMcpServerConfigs) and from each mcp_set_servers entry that names the server. On the wire an entry without tools states no policy: on initialize the stored list and the rules stand; on mcp_set_servers the rules are replaced without them. The Agent SDK always re-sends the registered list. An entry whose policy is not one of the three asks; an entry without a string name is dropped and the rest apply; a value that is not a list reads as absent.
4554
+ */
4555
+ tools?: coreTypes.McpServerToolPolicy[];
4522
4556
  }>;
4523
4557
  /**
4524
4558
  * Optional, keyed by sdk server name (each key should also appear in sdkMcpServers; other keys are ignored). Unlike sdkMcpServerConfigs — host-declared settings the CLI keeps for the server's lifetime, same shape inline on mcp_set_servers — this is a one-shot cache of the servers' own handshake output: sent on initialize only, consumed by the connect that follows it, never retained. MCP handshake results the host already obtained from its in-process servers by delivering initialize + notifications/initialized (+ tools/list) to them itself before writing this request. For each such server the CLI answers its own MCP client's initialize and first tools/list from these results and skips the notifications/initialized round trip, so registering N in-process servers costs no mcp_message control round trips before the first turn; tools/call and everything after the handshake still flow as mcp_message exactly as before. The host MUST keep answering mcp_message for every server as if this field were absent: a CLI that predates the field ignores it and performs the full per-server handshake over the control channel, and a newer CLI does the same for any server whose entry is missing or malformed, whose initializeResult.protocolVersion differs from the MCP protocol version the CLI's client requests, or that the CLI had already connected. Entries apply only to the connect that follows this initialize; they are never retained for later reconnects. Over a remote session transport the CLI uses the field only when sdkMcpServerManifestsOrigin is set (see that field); a host on the CLI's own stream-json stdio transport needs no marker. sdk_mcp_manifests_parked in the response reports what became of each entry. Absent (older hosts, the Python SDK, browser clients): unchanged behaviour.
@@ -4703,7 +4737,7 @@ export declare type SDKControlListPermissionRulesResponse = {
4703
4737
  };
4704
4738
 
4705
4739
  /**
4706
- * 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.
4740
+ * 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, unless result_not_for_model is set. 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.
4707
4741
  */
4708
4742
  declare type SDKControlMcpCallRequest = {
4709
4743
  subtype: 'mcp_call';
@@ -4723,6 +4757,10 @@ declare type SDKControlMcpCallRequest = {
4723
4757
  * Tool-execution timeout (staging and collection have their own transport timeouts). Clamped to [1000, 600000]; default 120000. Sending timeout_ms routes the call through the staging engine — so it is always enforced when present and the response carries a staging result; omit it for a plain call. Staged calls are POSIX-worker-only: on a Windows worker any staged-field call fails with a typed staging refusal.
4724
4758
  */
4725
4759
  timeout_ms?: number;
4760
+ /**
4761
+ * The caller hands the result to a program (a host that renders it, a script), not to a model, and bounds it itself. content is then the server's own content blocks as MCP defines them (the MCP SDK drops members it does not define), not what a model turn would be handed: no image is resized or put in the Messages API's shape, nothing is saved under tool-results, no embedded resource is flattened, and text blocks beside structuredContent stay. They are untrusted third-party data: any mimeType, images neither re-encoded nor bounded in pixels, each block's annotations and _meta unfiltered. The size check that protects a model's context is skipped too: no count_tokens request (which uploads the result), no truncation, no note in place of the content. Instead a result over 10485760 characters (content with its base64, structuredContent and _meta together) fails though the tool ran: a plain call answers the error subtype, a staged call staging.error_code tool_error with the text in detail, before its outputs are collected. A legacy toolResult still comes back as a string. Does not route the call through the staging engine. Absent or false: as before. Honoured only for a host on this process's own pipes, not over a remote transport nor on a lane that redacts what it persists. Feature-detected as `mcp_call_result_not_for_model_v1` in system/init.capabilities and in the initialize response's capabilities; where it is not said, and by a CLI without it, the member is ignored.
4762
+ */
4763
+ result_not_for_model?: boolean;
4726
4764
  /**
4727
4765
  * Declaring input_files or output_files makes this a STAGED call: rows are fetched from the synced-file lane into a private per-request temp dir the WORKER chooses (random, per-UID — the caller never sees or computes paths; it references files via tokens in arguments), the tool runs, and declared outputs are written back as lane rows (durable-at-ack PUT). The response then carries a `staging` result the caller switches on.
4728
4766
  */
@@ -4854,6 +4892,9 @@ declare type SDKControlPermissionRequest = {
4854
4892
 
4855
4893
 
4856
4894
 
4895
+
4896
+
4897
+
4857
4898
  /**
4858
4899
  * Set when a safetyCheck is present anywhere in the decision reason (including nested inside subcommandResults for compound bash). false = at least one safety check requires manual approval (e.g. Windows path bypass, dangerous rm); true = all safety checks MAY be classifier-approved (e.g. sensitive-file paths). Absent when no safetyCheck is involved.
4859
4900
  */
@@ -4972,6 +5013,10 @@ declare type SDKControlReloadPluginsRequest = {
4972
5013
  * When true, the reload is not applied if applying it would change the session's tool list while the conversation's prompt cache depends on that list (the same check the interactive /reload-plugins makes before it asks for --force): the response then carries held: true and cache_impact, and the session keeps its current plugins. Default false: apply unconditionally.
4973
5014
  */
4974
5015
  hold_on_cache_impact?: boolean;
5016
+ /**
5017
+ * Plugins for the reload to load as well, in the same shape as the SDK `plugins` option: each entry joins the session as one more --plugin-dir would (--plugin-dir-no-mcp when skipMcpDiscovery is set). Plugins already loaded stay; nothing is removed. A held or failed reload adds none of them. Refused for a malformed list or a path that is not absolute, when managed settings set disableSideloadFlags, on a connection whose frames persist server-side (any Remote Control or cloud worker), in a cloud-hosted session, and when a running sandbox cannot keep shell commands out of the folders (always on Windows).
5018
+ */
5019
+ add_plugins?: coreTypes.SdkPluginConfig[];
4975
5020
  };
4976
5021
 
4977
5022
  /**
@@ -6083,6 +6128,9 @@ export declare type SDKSystemMessage = {
6083
6128
 
6084
6129
 
6085
6130
 
6131
+
6132
+
6133
+
6086
6134
  uuid: UUID;
6087
6135
  session_id: string;
6088
6136
  };