@anthropic-ai/claude-agent-sdk 0.3.278 → 0.3.281
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/bridge.d.ts +11 -1
- package/bridge.mjs +100 -159
- package/browser-sdk.js +54 -94
- package/manifest.json +23 -23
- package/manifest.zst.json +27 -27
- package/package.json +10 -10
- package/sdk-tools.d.ts +6 -6
- package/sdk.d.ts +139 -12
- package/sdk.mjs +85 -161
package/manifest.json
CHANGED
|
@@ -1,55 +1,53 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.1.
|
|
2
|
+
"version": "2.1.281",
|
|
3
3
|
"manifestSignatureEnforcement": "flag",
|
|
4
|
-
"commit": "
|
|
5
|
-
"modsCommit": "
|
|
6
|
-
"buildDate": "2026-09-
|
|
4
|
+
"commit": "3e320108de6831eb996e9a3f7795152073cc0d0c",
|
|
5
|
+
"modsCommit": "56f36532530f88b572854538d685fcf781141e8c",
|
|
6
|
+
"buildDate": "2026-09-23T02:33:18Z",
|
|
7
7
|
"platforms": {
|
|
8
8
|
"darwin-arm64": {
|
|
9
9
|
"binary": "claude",
|
|
10
|
-
"checksum": "
|
|
11
|
-
"size":
|
|
10
|
+
"checksum": "a922981f6f3b55a251ef9f9dbaa0621a5f99cbcb5ca67f8a797476ccfc83f626",
|
|
11
|
+
"size": 220931760
|
|
12
12
|
},
|
|
13
13
|
"darwin-x64": {
|
|
14
14
|
"binary": "claude",
|
|
15
|
-
"checksum": "
|
|
16
|
-
"size":
|
|
15
|
+
"checksum": "a9355cbb0d291ce948efcf61a6ef397401672f64fa5e5e67bca092fed6cd9088",
|
|
16
|
+
"size": 229263712
|
|
17
17
|
},
|
|
18
18
|
"linux-arm64": {
|
|
19
19
|
"binary": "claude",
|
|
20
|
-
"checksum": "
|
|
21
|
-
"size":
|
|
20
|
+
"checksum": "dd27b36438a4fed1670cd29bad2fda6a73b628b6da55443e5c2f647fe6ed328f",
|
|
21
|
+
"size": 236773368
|
|
22
22
|
},
|
|
23
23
|
"linux-x64": {
|
|
24
24
|
"binary": "claude",
|
|
25
|
-
"checksum": "
|
|
26
|
-
"size":
|
|
25
|
+
"checksum": "56fe3da88458465fb27d7e9299dddb3fead55750fb9c2de795f233b5eea6dce1",
|
|
26
|
+
"size": 237375560
|
|
27
27
|
},
|
|
28
28
|
"linux-arm64-musl": {
|
|
29
29
|
"binary": "claude",
|
|
30
|
-
"checksum": "
|
|
31
|
-
"size":
|
|
30
|
+
"checksum": "4f72ebbb08706651e7a2204303793700698f4046bc31f3e7e65b381063b7c210",
|
|
31
|
+
"size": 229128008
|
|
32
32
|
},
|
|
33
33
|
"linux-x64-musl": {
|
|
34
34
|
"binary": "claude",
|
|
35
|
-
"checksum": "
|
|
36
|
-
"size":
|
|
35
|
+
"checksum": "30220a5cf0628634599e0ede13a5cc814d21880116abf762f0598a33636f7bca",
|
|
36
|
+
"size": 231137376
|
|
37
37
|
},
|
|
38
38
|
"win32-x64": {
|
|
39
39
|
"binary": "claude.exe",
|
|
40
|
-
"checksum": "
|
|
41
|
-
"size":
|
|
40
|
+
"checksum": "39be063c2512b43347fe7b0ab18c46f1596141701c9c5fc895ddfca9a051067c",
|
|
41
|
+
"size": 240767648
|
|
42
42
|
},
|
|
43
43
|
"win32-arm64": {
|
|
44
44
|
"binary": "claude.exe",
|
|
45
|
-
"checksum": "
|
|
46
|
-
"size":
|
|
45
|
+
"checksum": "103730182fe4dd36b8ff7791a408ac6144b2c40e35ab7b56b3561ce1d385ecbb",
|
|
46
|
+
"size": 228774560
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
"sdkCompat": {
|
|
50
50
|
"testedWrapperVersions": [
|
|
51
|
-
"0.3.239",
|
|
52
|
-
"0.3.240",
|
|
53
51
|
"0.3.241",
|
|
54
52
|
"0.3.242",
|
|
55
53
|
"0.3.243",
|
|
@@ -77,7 +75,9 @@
|
|
|
77
75
|
"0.3.274",
|
|
78
76
|
"0.3.275",
|
|
79
77
|
"0.3.276",
|
|
80
|
-
"0.3.277"
|
|
78
|
+
"0.3.277",
|
|
79
|
+
"0.3.278",
|
|
80
|
+
"0.3.280"
|
|
81
81
|
],
|
|
82
82
|
"harnessSchema": 1
|
|
83
83
|
}
|
package/manifest.zst.json
CHANGED
|
@@ -1,63 +1,61 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.1.
|
|
2
|
+
"version": "2.1.281",
|
|
3
3
|
"manifestSignatureEnforcement": "flag",
|
|
4
|
-
"commit": "
|
|
5
|
-
"modsCommit": "
|
|
6
|
-
"buildDate": "2026-09-
|
|
4
|
+
"commit": "3e320108de6831eb996e9a3f7795152073cc0d0c",
|
|
5
|
+
"modsCommit": "56f36532530f88b572854538d685fcf781141e8c",
|
|
6
|
+
"buildDate": "2026-09-23T02:34:19Z",
|
|
7
7
|
"platforms": {
|
|
8
8
|
"darwin-arm64": {
|
|
9
9
|
"binary": "claude.zst",
|
|
10
|
-
"checksum": "
|
|
11
|
-
"size":
|
|
10
|
+
"checksum": "056662a4e3a5ca37770730a59345d1b5796ef65444c32b97d236651ab68f3fa1",
|
|
11
|
+
"size": 74110572,
|
|
12
12
|
"bundle": {
|
|
13
|
-
"checksum": "
|
|
14
|
-
"size":
|
|
13
|
+
"checksum": "01c192d55a6fa8fcc84557bbd913dfb43ae65f15c39bd1fba9161fc4ff7de175",
|
|
14
|
+
"size": 74115578
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"darwin-x64": {
|
|
18
18
|
"binary": "claude.zst",
|
|
19
|
-
"checksum": "
|
|
20
|
-
"size":
|
|
19
|
+
"checksum": "085dd9952999c742cf262d0fed571c3bcd749d5127eb7dd455bc5be0948c7b9d",
|
|
20
|
+
"size": 78229557,
|
|
21
21
|
"bundle": {
|
|
22
|
-
"checksum": "
|
|
23
|
-
"size":
|
|
22
|
+
"checksum": "05e821e3c9f1178b603c6f7fcb3e05b1a038f885cb55eed42ad8df9bbfc7fdad",
|
|
23
|
+
"size": 78233701
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"linux-arm64": {
|
|
27
27
|
"binary": "claude.zst",
|
|
28
|
-
"checksum": "
|
|
29
|
-
"size":
|
|
28
|
+
"checksum": "7583b65585561c714e18caca45e0e0fb9bdba6d7ed6ee5d5171834d5c657aea6",
|
|
29
|
+
"size": 83227605
|
|
30
30
|
},
|
|
31
31
|
"linux-x64": {
|
|
32
32
|
"binary": "claude.zst",
|
|
33
|
-
"checksum": "
|
|
34
|
-
"size":
|
|
33
|
+
"checksum": "4ffb9f6baada4d88bbd8c586773efd0605c524c7a31cc3833eeda229717a7b25",
|
|
34
|
+
"size": 83964259
|
|
35
35
|
},
|
|
36
36
|
"linux-arm64-musl": {
|
|
37
37
|
"binary": "claude.zst",
|
|
38
|
-
"checksum": "
|
|
39
|
-
"size":
|
|
38
|
+
"checksum": "b5400b7f787e78f6c206c1adf70c65b5b6835f2899b61edfa83a117be92111d5",
|
|
39
|
+
"size": 81645720
|
|
40
40
|
},
|
|
41
41
|
"linux-x64-musl": {
|
|
42
42
|
"binary": "claude.zst",
|
|
43
|
-
"checksum": "
|
|
44
|
-
"size":
|
|
43
|
+
"checksum": "3921fd07a12e93f858c8b706eca0e4d7b12af14f4af5378d3b87254b4231def5",
|
|
44
|
+
"size": 82393109
|
|
45
45
|
},
|
|
46
46
|
"win32-x64": {
|
|
47
47
|
"binary": "claude.exe.zst",
|
|
48
|
-
"checksum": "
|
|
49
|
-
"size":
|
|
48
|
+
"checksum": "62f544612ca7e31cdc197bdf8651abcc529bd716964d2517e101177c6b94c70a",
|
|
49
|
+
"size": 86264937
|
|
50
50
|
},
|
|
51
51
|
"win32-arm64": {
|
|
52
52
|
"binary": "claude.exe.zst",
|
|
53
|
-
"checksum": "
|
|
54
|
-
"size":
|
|
53
|
+
"checksum": "41b632497a440de03904c03483d000b4004b908a5f3eb71f139de6dbd40cd685",
|
|
54
|
+
"size": 82711371
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
"sdkCompat": {
|
|
58
58
|
"testedWrapperVersions": [
|
|
59
|
-
"0.3.239",
|
|
60
|
-
"0.3.240",
|
|
61
59
|
"0.3.241",
|
|
62
60
|
"0.3.242",
|
|
63
61
|
"0.3.243",
|
|
@@ -85,7 +83,9 @@
|
|
|
85
83
|
"0.3.274",
|
|
86
84
|
"0.3.275",
|
|
87
85
|
"0.3.276",
|
|
88
|
-
"0.3.277"
|
|
86
|
+
"0.3.277",
|
|
87
|
+
"0.3.278",
|
|
88
|
+
"0.3.280"
|
|
89
89
|
],
|
|
90
90
|
"harnessSchema": 1
|
|
91
91
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anthropic-ai/claude-agent-sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.281",
|
|
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.
|
|
61
|
-
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.
|
|
62
|
-
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.
|
|
63
|
-
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.
|
|
64
|
-
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.
|
|
65
|
-
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.
|
|
66
|
-
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.
|
|
67
|
-
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.
|
|
60
|
+
"@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.281",
|
|
61
|
+
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.281",
|
|
62
|
+
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.281",
|
|
63
|
+
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.281",
|
|
64
|
+
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.281",
|
|
65
|
+
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.281",
|
|
66
|
+
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.281",
|
|
67
|
+
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.281"
|
|
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.
|
|
83
|
+
"claudeCodeVersion": "2.1.281"
|
|
84
84
|
}
|
package/sdk-tools.d.ts
CHANGED
|
@@ -2964,7 +2964,7 @@ export interface ProposeSkillsInput {
|
|
|
2964
2964
|
| [
|
|
2965
2965
|
{
|
|
2966
2966
|
/**
|
|
2967
|
-
* kebab-case skill slug
|
|
2967
|
+
* kebab-case skill slug; must not contain "claude" or "anthropic"; at most 64 characters for a new skill
|
|
2968
2968
|
*/
|
|
2969
2969
|
name: string;
|
|
2970
2970
|
kind: "new" | "improvement";
|
|
@@ -2989,7 +2989,7 @@ export interface ProposeSkillsInput {
|
|
|
2989
2989
|
| [
|
|
2990
2990
|
{
|
|
2991
2991
|
/**
|
|
2992
|
-
* kebab-case skill slug
|
|
2992
|
+
* kebab-case skill slug; must not contain "claude" or "anthropic"; at most 64 characters for a new skill
|
|
2993
2993
|
*/
|
|
2994
2994
|
name: string;
|
|
2995
2995
|
kind: "new" | "improvement";
|
|
@@ -3012,7 +3012,7 @@ export interface ProposeSkillsInput {
|
|
|
3012
3012
|
},
|
|
3013
3013
|
{
|
|
3014
3014
|
/**
|
|
3015
|
-
* kebab-case skill slug
|
|
3015
|
+
* kebab-case skill slug; must not contain "claude" or "anthropic"; at most 64 characters for a new skill
|
|
3016
3016
|
*/
|
|
3017
3017
|
name: string;
|
|
3018
3018
|
kind: "new" | "improvement";
|
|
@@ -3037,7 +3037,7 @@ export interface ProposeSkillsInput {
|
|
|
3037
3037
|
| [
|
|
3038
3038
|
{
|
|
3039
3039
|
/**
|
|
3040
|
-
* kebab-case skill slug
|
|
3040
|
+
* kebab-case skill slug; must not contain "claude" or "anthropic"; at most 64 characters for a new skill
|
|
3041
3041
|
*/
|
|
3042
3042
|
name: string;
|
|
3043
3043
|
kind: "new" | "improvement";
|
|
@@ -3060,7 +3060,7 @@ export interface ProposeSkillsInput {
|
|
|
3060
3060
|
},
|
|
3061
3061
|
{
|
|
3062
3062
|
/**
|
|
3063
|
-
* kebab-case skill slug
|
|
3063
|
+
* kebab-case skill slug; must not contain "claude" or "anthropic"; at most 64 characters for a new skill
|
|
3064
3064
|
*/
|
|
3065
3065
|
name: string;
|
|
3066
3066
|
kind: "new" | "improvement";
|
|
@@ -3083,7 +3083,7 @@ export interface ProposeSkillsInput {
|
|
|
3083
3083
|
},
|
|
3084
3084
|
{
|
|
3085
3085
|
/**
|
|
3086
|
-
* kebab-case skill slug
|
|
3086
|
+
* kebab-case skill slug; must not contain "claude" or "anthropic"; at most 64 characters for a new skill
|
|
3087
3087
|
*/
|
|
3088
3088
|
name: string;
|
|
3089
3089
|
kind: "new" | "improvement";
|
package/sdk.d.ts
CHANGED
|
@@ -295,6 +295,9 @@ export declare type CanUseTool = (toolName: string, input: Record<string, unknow
|
|
|
295
295
|
toolName: string;
|
|
296
296
|
ruleContent?: string;
|
|
297
297
|
};
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
298
301
|
}) => Promise<PermissionResult | null>;
|
|
299
302
|
|
|
300
303
|
export declare type ConfigChangeHookInput = BaseHookInput & {
|
|
@@ -321,6 +324,7 @@ declare type ControlErrorResponse = {
|
|
|
321
324
|
* Human-readable failure description.
|
|
322
325
|
*/
|
|
323
326
|
error: string;
|
|
327
|
+
|
|
324
328
|
/**
|
|
325
329
|
* can_use_tool requests this CLI process has issued and not yet resolved, so a client joining an already-initialized session learns about in-flight prompts. Always present (possibly empty) on a success `initialize` response from Claude Code v2.1.268 or later; earlier versions could omit it, so treat absence as an older CLI rather than as "nothing pending". A prompt inherited from a previous worker of the same session can remain answerable without appearing here and without a control_cancel_request; session_state "requires_action" on the same reply signals one the CLI is holding, but not every inherited prompt is signalled.
|
|
326
330
|
*/
|
|
@@ -1206,6 +1210,10 @@ export declare type McpServerStatus = {
|
|
|
1206
1210
|
destructive?: boolean;
|
|
1207
1211
|
openWorld?: boolean;
|
|
1208
1212
|
};
|
|
1213
|
+
/**
|
|
1214
|
+
* 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`.
|
|
1215
|
+
*/
|
|
1216
|
+
_meta?: Record<string, unknown>;
|
|
1209
1217
|
}[];
|
|
1210
1218
|
|
|
1211
1219
|
};
|
|
@@ -1795,6 +1803,30 @@ export declare type Options = {
|
|
|
1795
1803
|
* subagent conversation is forwarded so consumers can render a nested transcript.
|
|
1796
1804
|
*/
|
|
1797
1805
|
forwardSubagentText?: boolean;
|
|
1806
|
+
/**
|
|
1807
|
+
* Send every user message with `client_composed: true`, so the CLI delivers
|
|
1808
|
+
* the prompt text as written: no `@path` file-mention expansion and no
|
|
1809
|
+
* slash-command dispatch. Use when prompt text is assembled from content
|
|
1810
|
+
* the end user did not type. Covers string prompts, streamed messages and
|
|
1811
|
+
* `Query.streamInput()`. While the option is on there is no per-message
|
|
1812
|
+
* opt-out; for per-turn control, leave it off and set `client_composed: true`
|
|
1813
|
+
* on individual streamed messages instead.
|
|
1814
|
+
*
|
|
1815
|
+
* On current CLIs a turn delivered this way also skips the CLI's turn-start
|
|
1816
|
+
* attachment pass as a whole: `@server:resource` MCP mentions are not
|
|
1817
|
+
* expanded either, and the prompt is sent without the context the CLI
|
|
1818
|
+
* normally attaches alongside it (nested `CLAUDE.md` and rules files, skill
|
|
1819
|
+
* and tool listings, and the CLI's other per-turn reminders). The pass the
|
|
1820
|
+
* CLI runs between tool calls is unaffected, so most of that context arrives
|
|
1821
|
+
* after the turn's first tool call rather than with the prompt. Narrowing
|
|
1822
|
+
* the skip to `@path` expansion and slash-command dispatch alone is
|
|
1823
|
+
* CLI-side follow-up work.
|
|
1824
|
+
*
|
|
1825
|
+
* Requires Claude Code 2.1.248 or later; older CLIs ignore the field.
|
|
1826
|
+
*
|
|
1827
|
+
* @default false
|
|
1828
|
+
*/
|
|
1829
|
+
verbatimPrompts?: boolean;
|
|
1798
1830
|
/**
|
|
1799
1831
|
* Controls Claude's thinking/reasoning behavior.
|
|
1800
1832
|
*
|
|
@@ -2119,7 +2151,9 @@ export declare type Options = {
|
|
|
2119
2151
|
* IT-controlled managed-settings tier (server / MDM / managed-settings.json)
|
|
2120
2152
|
* exists on the user's machine, these are **dropped by default** — they only
|
|
2121
2153
|
* layer in if that admin opts in via `parentSettingsBehavior: 'merge'` in
|
|
2122
|
-
* their managed settings
|
|
2154
|
+
* their managed settings (a gateway-mode session that Claude Desktop's Code
|
|
2155
|
+
* tab launches merges them by default; `'first-wins'` in the highest-priority
|
|
2156
|
+
* managed source turns that off). Even when opted in, the value is filtered
|
|
2123
2157
|
* restrictive-only: permissive arrays (`permissions.allow`,
|
|
2124
2158
|
* `additionalDirectories`, `allowedMcpServers`, …) that would widen an
|
|
2125
2159
|
* existing admin lock are silently dropped. With no admin tier present,
|
|
@@ -2711,6 +2745,7 @@ export declare interface Query extends AsyncGenerator<SDKMessage, void> {
|
|
|
2711
2745
|
}>;
|
|
2712
2746
|
|
|
2713
2747
|
|
|
2748
|
+
|
|
2714
2749
|
/**
|
|
2715
2750
|
* Change the model used for subsequent responses.
|
|
2716
2751
|
* Only available in streaming input mode.
|
|
@@ -2873,6 +2908,13 @@ export declare interface Query extends AsyncGenerator<SDKMessage, void> {
|
|
|
2873
2908
|
skipBehaviors?: boolean;
|
|
2874
2909
|
}): Promise<SDKControlGetUsageResponse>;
|
|
2875
2910
|
|
|
2911
|
+
|
|
2912
|
+
|
|
2913
|
+
|
|
2914
|
+
|
|
2915
|
+
|
|
2916
|
+
|
|
2917
|
+
|
|
2876
2918
|
/**
|
|
2877
2919
|
* Read a file from the session's filesystem for the remote sidebar
|
|
2878
2920
|
* viewer. Path is resolved against cwd and gated by the same
|
|
@@ -2887,6 +2929,7 @@ export declare interface Query extends AsyncGenerator<SDKMessage, void> {
|
|
|
2887
2929
|
maxBytes?: number;
|
|
2888
2930
|
encoding?: 'utf-8' | 'base64';
|
|
2889
2931
|
}): Promise<SDKControlReadFileResponse | null>;
|
|
2932
|
+
|
|
2890
2933
|
/**
|
|
2891
2934
|
* Reload plugins from disk and return the refreshed commands, agents,
|
|
2892
2935
|
* plugins, and MCP server status.
|
|
@@ -2955,6 +2998,7 @@ export declare interface Query extends AsyncGenerator<SDKMessage, void> {
|
|
|
2955
2998
|
|
|
2956
2999
|
|
|
2957
3000
|
|
|
3001
|
+
|
|
2958
3002
|
/**
|
|
2959
3003
|
* Reconnect an MCP server by name.
|
|
2960
3004
|
* Throws on failure.
|
|
@@ -2970,6 +3014,19 @@ export declare interface Query extends AsyncGenerator<SDKMessage, void> {
|
|
|
2970
3014
|
* @param enabled - Whether the server should be enabled
|
|
2971
3015
|
*/
|
|
2972
3016
|
toggleMcpServer(serverName: string, enabled: boolean): Promise<void>;
|
|
3017
|
+
/**
|
|
3018
|
+
* Read one MCP Apps (SEP-1865) UI resource from a connected MCP server the
|
|
3019
|
+
* CLI itself dialed, so the host can render a tool's widget. `uri` must use
|
|
3020
|
+
* the `ui://` scheme, typically the `_meta.ui.resourceUri` a tool
|
|
3021
|
+
* declares. The contents are untrusted third-party HTML: render them
|
|
3022
|
+
* sandboxed. Requires a CLI that advertises `mcp_read_resource_v1` in
|
|
3023
|
+
* `system/init.capabilities`. Throws on failure.
|
|
3024
|
+
*
|
|
3025
|
+
* @param serverName - The server's name, as `mcpServerStatus()` reports it
|
|
3026
|
+
* @param uri - A `ui://` resource URI
|
|
3027
|
+
* @alpha
|
|
3028
|
+
*/
|
|
3029
|
+
readMcpResource(serverName: string, uri: string): Promise<SDKControlMcpReadResourceResponse>;
|
|
2973
3030
|
|
|
2974
3031
|
|
|
2975
3032
|
|
|
@@ -3448,6 +3505,7 @@ export declare type SDKAssistantMessage = {
|
|
|
3448
3505
|
task_description?: string;
|
|
3449
3506
|
|
|
3450
3507
|
|
|
3508
|
+
|
|
3451
3509
|
/**
|
|
3452
3510
|
* 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.
|
|
3453
3511
|
*/
|
|
@@ -3479,6 +3537,7 @@ export declare type SDKAssistantMessage = {
|
|
|
3479
3537
|
|
|
3480
3538
|
|
|
3481
3539
|
|
|
3540
|
+
|
|
3482
3541
|
};
|
|
3483
3542
|
|
|
3484
3543
|
export declare type SDKAssistantMessageError = 'authentication_failed' | 'oauth_org_not_allowed' | 'account_on_hold' | 'verification_required' | 'billing_error' | 'rate_limit' | 'overloaded' | 'invalid_request' | 'model_not_found' | 'server_error' | 'unknown' | 'max_output_tokens' | 'cloud_credential_error';
|
|
@@ -4296,6 +4355,7 @@ declare type SDKControlInitializeRequest = {
|
|
|
4296
4355
|
plugins?: coreTypes.SdkPluginConfig[];
|
|
4297
4356
|
|
|
4298
4357
|
|
|
4358
|
+
|
|
4299
4359
|
};
|
|
4300
4360
|
|
|
4301
4361
|
/**
|
|
@@ -4453,6 +4513,40 @@ declare type SDKControlMcpMessageRequest = {
|
|
|
4453
4513
|
message: JSONRPCMessage;
|
|
4454
4514
|
};
|
|
4455
4515
|
|
|
4516
|
+
/**
|
|
4517
|
+
* Reads one MCP Apps (SEP-1865) UI resource — a `ui://` URI, typically the `_meta.ui.resourceUri` a tool declares — from a connected MCP server the CLI itself dialed, with `resources/read`, for a host that renders it. Read-only and no model turn. The reply is untrusted third-party content (HTML): render it sandboxed. SDK-type MCP servers (config.type === "sdk") are rejected — they are caller-provided, so the caller can read them directly. Errors name the cause: a non-ui:// URI, an unknown server, a server that managed policy blocks, that is disabled or that the project has not approved (the refusals mcp_reconnect gives), a server that is not connected (failed, pending or needs-auth: send mcp_reconnect; a connected server, or one still listed from the discovery cache, is read through the same connect path a tool call takes), a response over the size limit, or the server's own resources/read error. Refused on a lane that redacts what it persists (a Remote Control bridge worker, a tenant worker) and by the client of a cloud-hosted session. Advertised as `mcp_read_resource_v1` in system/init.capabilities.
|
|
4518
|
+
*/
|
|
4519
|
+
declare type SDKControlMcpReadResourceRequest = {
|
|
4520
|
+
subtype: 'mcp_read_resource';
|
|
4521
|
+
/**
|
|
4522
|
+
* Server name, as mcp_status reports it (not normalized).
|
|
4523
|
+
*/
|
|
4524
|
+
serverName: string;
|
|
4525
|
+
/**
|
|
4526
|
+
* The resource to read. Must use the ui:// scheme; any other URI is refused.
|
|
4527
|
+
*/
|
|
4528
|
+
uri: string;
|
|
4529
|
+
};
|
|
4530
|
+
|
|
4531
|
+
/**
|
|
4532
|
+
* The server's resources/read result for an mcp_read_resource request.
|
|
4533
|
+
*/
|
|
4534
|
+
export declare type SDKControlMcpReadResourceResponse = {
|
|
4535
|
+
contents: {
|
|
4536
|
+
uri: string;
|
|
4537
|
+
mimeType?: string;
|
|
4538
|
+
text?: string;
|
|
4539
|
+
/**
|
|
4540
|
+
* Base64, for a binary item.
|
|
4541
|
+
*/
|
|
4542
|
+
blob?: string;
|
|
4543
|
+
/**
|
|
4544
|
+
* The content item's own `_meta`, as the server sent it (MCP Apps puts the resource's `ui.csp` and `ui.permissions` here).
|
|
4545
|
+
*/
|
|
4546
|
+
_meta?: Record<string, unknown>;
|
|
4547
|
+
}[];
|
|
4548
|
+
};
|
|
4549
|
+
|
|
4456
4550
|
/**
|
|
4457
4551
|
* Reconnects a disconnected or failed MCP server.
|
|
4458
4552
|
*/
|
|
@@ -4537,6 +4631,8 @@ declare type SDKControlPermissionRequest = {
|
|
|
4537
4631
|
*/
|
|
4538
4632
|
requires_user_interaction?: boolean;
|
|
4539
4633
|
|
|
4634
|
+
|
|
4635
|
+
|
|
4540
4636
|
};
|
|
4541
4637
|
|
|
4542
4638
|
/**
|
|
@@ -4696,7 +4792,7 @@ export declare type SDKControlRequest = {
|
|
|
4696
4792
|
|
|
4697
4793
|
};
|
|
4698
4794
|
|
|
4699
|
-
declare type SDKControlRequestInner = SDKControlInterruptRequest | SDKControlPermissionRequest | SDKControlInitializeRequest | SDKControlSetPermissionModeRequest | SDKControlSetModelRequest | SDKControlSetMaxThinkingTokensRequest | SDKControlRenameSessionRequest | SDKControlSetColorRequest | SDKControlMcpStatusRequest | SDKControlGetContextUsageRequest | SDKControlGetSessionCostRequest | SDKControlListModelsRequest | SDKControlGetUsageRequest | SDKControlGetBinaryVersionRequest | SDKControlMcpCallRequest | SDKControlFileSuggestionsRequest | SDKHookCallbackRequest | SDKControlMcpMessageRequest | SDKControlRewindFilesRequest | SDKControlCancelAsyncMessageRequest | SDKControlReadFileRequest | SDKControlSeedReadStateRequest | SDKControlMcpSetServersRequest | SDKControlRegisterRepoRootRequest | SDKControlReloadPluginsRequest | SDKControlReloadSkillsRequest | SDKControlReloadOutputStylesRequest | SDKControlMcpReconnectRequest | SDKControlMcpToggleRequest | SDKControlStopTaskRequest | SDKControlBackgroundTasksRequest | SDKControlApplyFlagSettingsRequest | SDKControlGetSettingsRequest | SDKControlGetHooksListingRequest | SDKControlUpdateSettingsRequest | SDKControlElicitationRequest | SDKControlRequestUserDialogRequest | SDKControlListPermissionRulesRequest;
|
|
4795
|
+
declare type SDKControlRequestInner = SDKControlInterruptRequest | SDKControlPermissionRequest | SDKControlInitializeRequest | SDKControlSetPermissionModeRequest | SDKControlSetModelRequest | SDKControlSetMaxThinkingTokensRequest | SDKControlRenameSessionRequest | SDKControlSetColorRequest | SDKControlMcpStatusRequest | SDKControlGetContextUsageRequest | SDKControlGetSessionCostRequest | SDKControlListModelsRequest | SDKControlGetUsageRequest | SDKControlGetBinaryVersionRequest | SDKControlMcpCallRequest | SDKControlFileSuggestionsRequest | SDKHookCallbackRequest | SDKControlMcpMessageRequest | SDKControlRewindFilesRequest | SDKControlCancelAsyncMessageRequest | SDKControlReadFileRequest | SDKControlSeedReadStateRequest | SDKControlMcpSetServersRequest | SDKControlRegisterRepoRootRequest | SDKControlReloadPluginsRequest | SDKControlReloadSkillsRequest | SDKControlReloadOutputStylesRequest | SDKControlMcpReconnectRequest | SDKControlMcpToggleRequest | SDKControlStopTaskRequest | SDKControlBackgroundTasksRequest | SDKControlApplyFlagSettingsRequest | SDKControlGetSettingsRequest | SDKControlGetHooksListingRequest | SDKControlUpdateSettingsRequest | SDKControlElicitationRequest | SDKControlRequestUserDialogRequest | SDKControlListPermissionRulesRequest | SDKControlMcpReadResourceRequest;
|
|
4700
4796
|
|
|
4701
4797
|
/**
|
|
4702
4798
|
* Progress for a long-running client-originated control_request (currently only side_question), correlated by request_id. status 'started' means the worker accepted the request and launched the work; 'api_retry' carries the same retry counters as SDKAPIRetryMessage and is present only for that status.
|
|
@@ -4824,13 +4920,25 @@ declare type SDKControlUpdateSettingsRequest = {
|
|
|
4824
4920
|
};
|
|
4825
4921
|
|
|
4826
4922
|
/**
|
|
4827
|
-
* Emitted by /clear, plan-mode exit,
|
|
4923
|
+
* Emitted by /clear, plan-mode exit, fresh-session, and onboarding flows. The surface should mount a fresh transcript under new_conversation_id and reset any cached session title. From internal QueryEvent 'conversation_reset'.
|
|
4828
4924
|
*/
|
|
4829
4925
|
export declare type SDKConversationResetMessage = {
|
|
4830
4926
|
type: 'conversation_reset';
|
|
4831
4927
|
new_conversation_id: UUID;
|
|
4832
4928
|
uuid: UUID;
|
|
4833
4929
|
session_id: string;
|
|
4930
|
+
/**
|
|
4931
|
+
* What discarded the conversation: 'clear' is the /clear command (or its /reset and /new aliases), 'plan_mode_exit' is leaving plan mode with the clear-context option, 'fresh_session' is a flow that starts a fresh session to implement an approved plan, 'onboarding' is an onboarding flow re-run inside an existing session. Informational: a consumer should reset on every conversation_reset frame whatever this says, and treat an absent (older emitter) or unrecognized value as an unspecified reset.
|
|
4932
|
+
*/
|
|
4933
|
+
trigger?: 'clear' | 'plan_mode_exit' | 'fresh_session' | 'onboarding';
|
|
4934
|
+
/**
|
|
4935
|
+
* Only with trigger 'clear': the uuid of the user message whose /clear was executed (the client's own uuid for that message when it came from a Remote Control or stream-json client, otherwise the uuid the CLI assigned to the typed command). Lets a consumer match this frame to a /clear message it has already seen, wiping once whichever arrives first, instead of relying on arrival order. Absent for the other triggers, when that uuid is not a canonical UUID, and from older emitters.
|
|
4936
|
+
*/
|
|
4937
|
+
user_message_uuid?: string;
|
|
4938
|
+
/**
|
|
4939
|
+
* When the reset happened, as an ISO 8601 string in UTC read from the clock of the process that performed it. Meant for display, such as the time on a "conversation cleared" row, not for ordering frames. Absent from older emitters; a consumer can fall back to the time it received the frame.
|
|
4940
|
+
*/
|
|
4941
|
+
timestamp?: string;
|
|
4834
4942
|
};
|
|
4835
4943
|
|
|
4836
4944
|
export declare type SDKDeferredToolUse = {
|
|
@@ -5063,9 +5171,13 @@ export declare type SDKMessageOrigin = {
|
|
|
5063
5171
|
} | {
|
|
5064
5172
|
kind: 'task-notification';
|
|
5065
5173
|
/**
|
|
5066
|
-
* Present when the delivery is the fired stored prompt of a scheduled task/routine ('scheduled-trigger', stamped from server-asserted provenance; the schedule attests storage, not authorship) or a coordinator co-member SendMessage delivery ('peer-send-message': model-authored text from another of the same user's sessions, verified by the server-stamped receiver co-membership — task-notification for prompt authority, but distinguishable so the receive-side crossSessionInbound setting can apply to it). The harness frames a scheduled-trigger delivery as the session's assigned task instead of the generic background-notification frame. Absent on webhook, PR-steward, plugin, and background-event deliveries.
|
|
5174
|
+
* Present when the delivery is the fired stored prompt of a scheduled task/routine ('scheduled-trigger', stamped from server-asserted provenance, or declared by a local host for its own scheduled runs; the schedule attests storage, not authorship) or a coordinator co-member SendMessage delivery ('peer-send-message': model-authored text from another of the same user's sessions, verified by the server-stamped receiver co-membership — task-notification for prompt authority, but distinguishable so the receive-side crossSessionInbound setting can apply to it). The harness frames a scheduled-trigger delivery as the session's assigned task instead of the generic background-notification frame. Absent on webhook, PR-steward, plugin, and background-event deliveries.
|
|
5067
5175
|
*/
|
|
5068
5176
|
subkind?: 'scheduled-trigger' | 'peer-send-message' | 'projects-relay';
|
|
5177
|
+
/**
|
|
5178
|
+
* On a 'scheduled-trigger' delivery, why it fired: a short lowercase token such as 'scheduled', 'manual', 'retry', 'catch_up' or 'api'. Set by the server for cloud routines, or declared by a local host for its own scheduled runs, which is honored only in a process the host started with CLAUDE_CODE_HOST_SCHEDULED_RUN=1 (a local host's value is kept only if it is 1 to 32 lowercase letters or underscores); absent when neither sent one.
|
|
5179
|
+
*/
|
|
5180
|
+
fireReason?: string;
|
|
5069
5181
|
} | {
|
|
5070
5182
|
kind: 'coordinator';
|
|
5071
5183
|
} | {
|
|
@@ -5629,6 +5741,11 @@ export declare type SDKSystemMessage = {
|
|
|
5629
5741
|
* The effort level the session will send on its next request — after env overrides, session state, org caps and model-support downgrades; the same value get_settings reports as applied.effort. null when no effort parameter will be sent (a model without effort, CLAUDE_CODE_EFFORT_LEVEL=unset, or an internal numeric budget). Present on Remote Control bridge init frames (terminal- and Desktop/VS Code-hosted sessions); absent on hosts that do not publish it and on CLIs that predate the field. Re-emitted inits carry the current value — the newest frame wins.
|
|
5630
5742
|
*/
|
|
5631
5743
|
effort?: ('low' | 'medium' | 'high' | 'xhigh' | 'max') | null;
|
|
5744
|
+
|
|
5745
|
+
/**
|
|
5746
|
+
* Whether the session's transcript is in focus view ('focus': the model is told the user sees only its final message per turn, so clients may collapse each turn to the prompt and the final response; 'default' otherwise). Toggled by /focus, including over Remote Control. Present on Remote Control bridge init frames and on the per-turn init of headless stream-json runs (`claude rc` workers, -p, the SDK's subprocess transport); absent on hosts that do not publish it (the in-process engine) and on CLIs that predate the field. Re-emitted inits carry the current value — the newest frame wins.
|
|
5747
|
+
*/
|
|
5748
|
+
view_mode?: 'focus' | 'default';
|
|
5632
5749
|
/**
|
|
5633
5750
|
* Protocol capabilities this CLI supports, so SDK consumers can feature-detect instead of version-sniffing. Open set — ignore unknown values; check each capability for exactly the behavior you use. 'interrupt_receipt_v1' = the interrupt control_response success payload carries still_queued (uuids of async user messages that survive the interrupt). 'interrupt_cancel_queued_v1' = the interrupt control_request honors cancel_queued:true (queued and pending-dispatch commands are cancelled alongside the abort, listed on the response's cancelled field; still_queued is then empty — including any uuid that was mid-fold at the interrupt instant, since this request also aborts and the fold never delivers it — except that a client driving a hosted session lists there what it can no longer recall: a send already in flight to that session, or the first prompt the session was created with). 'queued_notifications' = the CLI accepts inbound queued_notification stream messages and drains them via ReadNotifications (the cloud session backend reads this from the persisted init event to decide whether it may send them). Absent on older CLIs.
|
|
5634
5751
|
*/
|
|
@@ -5926,7 +6043,10 @@ export declare type SDKUserMessage = {
|
|
|
5926
6043
|
timestamp?: string;
|
|
5927
6044
|
|
|
5928
6045
|
|
|
5929
|
-
|
|
6046
|
+
/**
|
|
6047
|
+
* The client composed this turn from content the user did not type; the CLI delivers its text as written, with no `@path` file-mention expansion and no slash-command dispatch. On current CLIs the turn-start attachment pass is skipped as a whole: `@server:resource` MCP mentions are not expanded either, and the prompt is sent without the context the CLI normally attaches alongside it (nested `CLAUDE.md` and rules files, skill and tool listings, reminders); the pass the CLI runs between tool calls is unaffected.
|
|
6048
|
+
*/
|
|
6049
|
+
client_composed?: true;
|
|
5930
6050
|
|
|
5931
6051
|
|
|
5932
6052
|
|
|
@@ -5945,6 +6065,10 @@ export declare type SDKUserMessage = {
|
|
|
5945
6065
|
* Content the user pasted into the prompt rather than typed: each entry a string or an array of content blocks. The CLI appends the text of each entry after the typed text, in order, and may wrap it in `<pasted_content>` tags. Blocks other than text are ignored; send images and documents in `message.content`.
|
|
5946
6066
|
*/
|
|
5947
6067
|
pasted_content?: MessageParam['content'][];
|
|
6068
|
+
/**
|
|
6069
|
+
* Text the user pasted that is still in `message.content` where they put it: each entry one paste. The prompt is not changed by the host; the CLI may wrap each entry in `<pasted_content>` tags where it still stands in the last text block. For a paste the host took out of `message`, use `pasted_content` instead.
|
|
6070
|
+
*/
|
|
6071
|
+
inline_pastes?: string[];
|
|
5948
6072
|
session_id?: string;
|
|
5949
6073
|
/**
|
|
5950
6074
|
* Subagent type that produced this message.
|
|
@@ -6007,7 +6131,10 @@ export declare type SDKUserMessageReplay = {
|
|
|
6007
6131
|
timestamp?: string;
|
|
6008
6132
|
|
|
6009
6133
|
|
|
6010
|
-
|
|
6134
|
+
/**
|
|
6135
|
+
* The client composed this turn from content the user did not type; the CLI delivers its text as written, with no `@path` file-mention expansion and no slash-command dispatch. On current CLIs the turn-start attachment pass is skipped as a whole: `@server:resource` MCP mentions are not expanded either, and the prompt is sent without the context the CLI normally attaches alongside it (nested `CLAUDE.md` and rules files, skill and tool listings, reminders); the pass the CLI runs between tool calls is unaffected.
|
|
6136
|
+
*/
|
|
6137
|
+
client_composed?: true;
|
|
6011
6138
|
|
|
6012
6139
|
|
|
6013
6140
|
|
|
@@ -6403,9 +6530,9 @@ export declare interface Settings {
|
|
|
6403
6530
|
[k: string]: string;
|
|
6404
6531
|
};
|
|
6405
6532
|
/**
|
|
6406
|
-
* Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set.
|
|
6533
|
+
* Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set. Set to false to hide all attribution, the same as { "commit": "", "pr": "", "sessionUrl": false }. Setting it to true is the same as leaving it out. Older Claude Code versions reject true or false here, so use the object form in settings files shared across versions.
|
|
6407
6534
|
*/
|
|
6408
|
-
attribution?: {
|
|
6535
|
+
attribution?: boolean | {
|
|
6409
6536
|
/**
|
|
6410
6537
|
* Attribution text for git commits, including any trailers. Empty string hides attribution.
|
|
6411
6538
|
*/
|
|
@@ -6818,7 +6945,7 @@ export declare interface Settings {
|
|
|
6818
6945
|
location?: string;
|
|
6819
6946
|
};
|
|
6820
6947
|
/**
|
|
6821
|
-
* Disable all hooks and statusLine execution
|
|
6948
|
+
* Disable all hooks and statusLine execution: the hooks defined in settings files and by installed plugins. Features built into Claude Code are not hooks in this sense and keep working; each has its own switch.
|
|
6822
6949
|
*/
|
|
6823
6950
|
disableAllHooks?: boolean;
|
|
6824
6951
|
/**
|
|
@@ -6878,7 +7005,7 @@ export declare interface Settings {
|
|
|
6878
7005
|
*/
|
|
6879
7006
|
respondToBashCommands?: boolean;
|
|
6880
7007
|
/**
|
|
6881
|
-
* When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored.
|
|
7008
|
+
* When true (and set in managed settings), only hooks from managed settings and from plugins that managed settings enable run. User, project, and local hooks and the hooks of plugins the user installed are ignored. Features built into Claude Code are not hooks in this sense and keep working.
|
|
6882
7009
|
*/
|
|
6883
7010
|
allowManagedHooksOnly?: boolean;
|
|
6884
7011
|
/**
|
|
@@ -8216,7 +8343,7 @@ export declare interface Settings {
|
|
|
8216
8343
|
*/
|
|
8217
8344
|
gatewayInternalNetworks?: string[];
|
|
8218
8345
|
/**
|
|
8219
|
-
* Controls whether the SDK parent tier (Options.managedSettings / --managed-settings) layers under this admin tier. "first-wins" (default): parent is dropped — admin tiers are the only policy source. "merge": parent's restrictive-only-filtered settings union under the admin winner. Has no effect when no admin tier exists (parent applies as the sole policy tier, still filtered restrictive-only).
|
|
8346
|
+
* Controls whether the SDK parent tier (Options.managedSettings / --managed-settings) layers under this admin tier. "first-wins" (the default, except in a gateway session Claude Desktop's Code tab launched, where "merge" is): parent is dropped — admin tiers are the only policy source. "merge": parent's restrictive-only-filtered settings union under the admin winner. Has no effect when no admin tier exists (parent applies as the sole policy tier, still filtered restrictive-only).
|
|
8220
8347
|
*/
|
|
8221
8348
|
parentSettingsBehavior?: 'first-wins' | 'merge';
|
|
8222
8349
|
/**
|
|
@@ -9146,7 +9273,7 @@ export declare type SyncHookJSONOutput = {
|
|
|
9146
9273
|
* element of a `string[]` `systemPrompt`, or as a line of its own in a
|
|
9147
9274
|
* `--system-prompt` string, to opt in; content before it gets global
|
|
9148
9275
|
* cache scope, content after does not. See `splitSysPromptPrefix` in
|
|
9149
|
-
* `src/
|
|
9276
|
+
* `src/services/api/requestAttribution.ts`.
|
|
9150
9277
|
*/
|
|
9151
9278
|
export declare const SYSTEM_PROMPT_DYNAMIC_BOUNDARY = "__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__";
|
|
9152
9279
|
|