@anthropic-ai/claude-agent-sdk 0.3.295 → 0.3.299
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 +7 -0
- package/bridge.mjs +70 -111
- package/browser-sdk.js +60 -58
- package/core-x6a2shyd.mjs +35 -0
- package/core-xcjrj654.mjs +52 -0
- package/core.mjs +18 -18
- package/manifest.json +21 -28
- package/manifest.zst.json +25 -32
- package/package.json +12 -12
- package/sdk-tools.d.ts +17 -0
- package/sdk.d.ts +75 -21
- package/sdk.mjs +85 -71
- package/core-reghh1vn.mjs +0 -33
- package/core-tm6xdb2r.mjs +0 -40
package/manifest.json
CHANGED
|
@@ -1,61 +1,52 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.1.
|
|
2
|
+
"version": "2.1.299",
|
|
3
3
|
"manifestSignatureEnforcement": "flag",
|
|
4
|
-
"commit": "
|
|
5
|
-
"
|
|
6
|
-
"buildDate": "2026-10-08T17:09:12Z",
|
|
4
|
+
"commit": "c416f56ec7eca27e49747c35af51d5c92c856ba1",
|
|
5
|
+
"buildDate": "2026-10-13T22:05:00Z",
|
|
7
6
|
"platforms": {
|
|
8
7
|
"darwin-arm64": {
|
|
9
8
|
"binary": "claude",
|
|
10
|
-
"checksum": "
|
|
11
|
-
"size":
|
|
9
|
+
"checksum": "ba5ab7b8c195fa03ab8d5bf3915c76153b576a2c40e79a5c46e265e7ed9744b3",
|
|
10
|
+
"size": 247931696
|
|
12
11
|
},
|
|
13
12
|
"darwin-x64": {
|
|
14
13
|
"binary": "claude",
|
|
15
|
-
"checksum": "
|
|
16
|
-
"size":
|
|
14
|
+
"checksum": "099dcc53dabbbefabed8926dab25b0318775c175a7c87bb6ba6c54fde9f8ece2",
|
|
15
|
+
"size": 257765072
|
|
17
16
|
},
|
|
18
17
|
"linux-arm64": {
|
|
19
18
|
"binary": "claude",
|
|
20
|
-
"checksum": "
|
|
21
|
-
"size":
|
|
19
|
+
"checksum": "4cd5ab006b49dc12a247fed4dbc42a925ad1aea1e711d9aa24587d285ee87c2f",
|
|
20
|
+
"size": 264626168
|
|
22
21
|
},
|
|
23
22
|
"linux-x64": {
|
|
24
23
|
"binary": "claude",
|
|
25
|
-
"checksum": "
|
|
26
|
-
"size":
|
|
24
|
+
"checksum": "2d894a4b1bfaaa9aab72aeff7803e3c73bc2510f279a171f6b8f59f72d17d077",
|
|
25
|
+
"size": 265342136
|
|
27
26
|
},
|
|
28
27
|
"linux-arm64-musl": {
|
|
29
28
|
"binary": "claude",
|
|
30
|
-
"checksum": "
|
|
31
|
-
"size":
|
|
29
|
+
"checksum": "3e90af8f81cf7db932bbda3ab2ba57facb1e2a19a43f911b70536bf627472757",
|
|
30
|
+
"size": 256784472
|
|
32
31
|
},
|
|
33
32
|
"linux-x64-musl": {
|
|
34
33
|
"binary": "claude",
|
|
35
|
-
"checksum": "
|
|
36
|
-
"size":
|
|
34
|
+
"checksum": "af9b922a7a018c69eb6de3a9d401b32b6cdfba3c01bf75a5edb6b477ef17f117",
|
|
35
|
+
"size": 258953576
|
|
37
36
|
},
|
|
38
37
|
"win32-x64": {
|
|
39
38
|
"binary": "claude.exe",
|
|
40
|
-
"checksum": "
|
|
41
|
-
"size":
|
|
39
|
+
"checksum": "295b49ec092f31a7de9c6ff286d9d8f120a4f029b9ad9a5ac0b12c35cbf4df2b",
|
|
40
|
+
"size": 269231264
|
|
42
41
|
},
|
|
43
42
|
"win32-arm64": {
|
|
44
43
|
"binary": "claude.exe",
|
|
45
|
-
"checksum": "
|
|
46
|
-
"size":
|
|
44
|
+
"checksum": "a34fe98210ae38e55543e094036fea698db93bb4bba458c63d560b19ed2a56a2",
|
|
45
|
+
"size": 255381152
|
|
47
46
|
}
|
|
48
47
|
},
|
|
49
48
|
"sdkCompat": {
|
|
50
49
|
"testedWrapperVersions": [
|
|
51
|
-
"0.3.252",
|
|
52
|
-
"0.3.257",
|
|
53
|
-
"0.3.258",
|
|
54
|
-
"0.3.259",
|
|
55
|
-
"0.3.260",
|
|
56
|
-
"0.3.261",
|
|
57
|
-
"0.3.263",
|
|
58
|
-
"0.3.265",
|
|
59
50
|
"0.3.266",
|
|
60
51
|
"0.3.267",
|
|
61
52
|
"0.3.268",
|
|
@@ -72,6 +63,8 @@
|
|
|
72
63
|
"0.3.280",
|
|
73
64
|
"0.3.281",
|
|
74
65
|
"0.3.282",
|
|
66
|
+
"0.3.283",
|
|
67
|
+
"0.3.284",
|
|
75
68
|
"0.3.285"
|
|
76
69
|
],
|
|
77
70
|
"harnessSchema": 1
|
package/manifest.zst.json
CHANGED
|
@@ -1,69 +1,60 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.1.
|
|
2
|
+
"version": "2.1.299",
|
|
3
3
|
"manifestSignatureEnforcement": "flag",
|
|
4
|
-
"commit": "
|
|
5
|
-
"
|
|
6
|
-
"buildDate": "2026-10-08T17:10:20Z",
|
|
4
|
+
"commit": "c416f56ec7eca27e49747c35af51d5c92c856ba1",
|
|
5
|
+
"buildDate": "2026-10-13T22:06:14Z",
|
|
7
6
|
"platforms": {
|
|
8
7
|
"darwin-arm64": {
|
|
9
8
|
"binary": "claude.zst",
|
|
10
|
-
"checksum": "
|
|
11
|
-
"size":
|
|
9
|
+
"checksum": "b510036268e62391c50f72c846319325958289283ee2dcc2b93c48f6f3c1d0ab",
|
|
10
|
+
"size": 83064935,
|
|
12
11
|
"bundle": {
|
|
13
|
-
"checksum": "
|
|
14
|
-
"size":
|
|
12
|
+
"checksum": "4fa9694b79752a9a7e755eefa26978f0645aacfc39556267795fe45b6aa9f8fc",
|
|
13
|
+
"size": 83068622
|
|
15
14
|
}
|
|
16
15
|
},
|
|
17
16
|
"darwin-x64": {
|
|
18
17
|
"binary": "claude.zst",
|
|
19
|
-
"checksum": "
|
|
20
|
-
"size":
|
|
18
|
+
"checksum": "47d60e863db060992020f1b6add9b1342cf1808248239e920fb29a7a136cd1f6",
|
|
19
|
+
"size": 87828689,
|
|
21
20
|
"bundle": {
|
|
22
|
-
"checksum": "
|
|
23
|
-
"size":
|
|
21
|
+
"checksum": "d55abe38f7972556711bb138728a10cd4e9544cbacf0ec95f13de063debdf17b",
|
|
22
|
+
"size": 87803040
|
|
24
23
|
}
|
|
25
24
|
},
|
|
26
25
|
"linux-arm64": {
|
|
27
26
|
"binary": "claude.zst",
|
|
28
|
-
"checksum": "
|
|
29
|
-
"size":
|
|
27
|
+
"checksum": "c9c8b11eb1d5bfad71820e6bf39254b75bd75c95f9e2921332526c60fcb32587",
|
|
28
|
+
"size": 92333403
|
|
30
29
|
},
|
|
31
30
|
"linux-x64": {
|
|
32
31
|
"binary": "claude.zst",
|
|
33
|
-
"checksum": "
|
|
34
|
-
"size":
|
|
32
|
+
"checksum": "20ca25213130255bacdcae3ed5df3fc99e1d8e86cdf46e9188b7ff9c1b478fa4",
|
|
33
|
+
"size": 93164406
|
|
35
34
|
},
|
|
36
35
|
"linux-arm64-musl": {
|
|
37
36
|
"binary": "claude.zst",
|
|
38
|
-
"checksum": "
|
|
39
|
-
"size":
|
|
37
|
+
"checksum": "8aedb90a7351fba268cc3c4aaaa585d43def1a6076fcca37a37859fabc48a8ee",
|
|
38
|
+
"size": 90689368
|
|
40
39
|
},
|
|
41
40
|
"linux-x64-musl": {
|
|
42
41
|
"binary": "claude.zst",
|
|
43
|
-
"checksum": "
|
|
44
|
-
"size":
|
|
42
|
+
"checksum": "61255662f269895254de0b696558d0132e992ab868d1ea185fe07217bfd6d985",
|
|
43
|
+
"size": 91585340
|
|
45
44
|
},
|
|
46
45
|
"win32-x64": {
|
|
47
46
|
"binary": "claude.exe.zst",
|
|
48
|
-
"checksum": "
|
|
49
|
-
"size":
|
|
47
|
+
"checksum": "f0584be0fbaf0853072de7b532e6c4078f5d2c38ea70a4c711032408a78edd8a",
|
|
48
|
+
"size": 95700039
|
|
50
49
|
},
|
|
51
50
|
"win32-arm64": {
|
|
52
51
|
"binary": "claude.exe.zst",
|
|
53
|
-
"checksum": "
|
|
54
|
-
"size":
|
|
52
|
+
"checksum": "e40a912906de9dff61624b5d36a66c65e32a67d1603cc8a0174d887721bf1fed",
|
|
53
|
+
"size": 91644699
|
|
55
54
|
}
|
|
56
55
|
},
|
|
57
56
|
"sdkCompat": {
|
|
58
57
|
"testedWrapperVersions": [
|
|
59
|
-
"0.3.252",
|
|
60
|
-
"0.3.257",
|
|
61
|
-
"0.3.258",
|
|
62
|
-
"0.3.259",
|
|
63
|
-
"0.3.260",
|
|
64
|
-
"0.3.261",
|
|
65
|
-
"0.3.263",
|
|
66
|
-
"0.3.265",
|
|
67
58
|
"0.3.266",
|
|
68
59
|
"0.3.267",
|
|
69
60
|
"0.3.268",
|
|
@@ -80,6 +71,8 @@
|
|
|
80
71
|
"0.3.280",
|
|
81
72
|
"0.3.281",
|
|
82
73
|
"0.3.282",
|
|
74
|
+
"0.3.283",
|
|
75
|
+
"0.3.284",
|
|
83
76
|
"0.3.285"
|
|
84
77
|
],
|
|
85
78
|
"harnessSchema": 1
|
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.299",
|
|
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.
|
|
65
|
-
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.
|
|
66
|
-
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.
|
|
67
|
-
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.
|
|
68
|
-
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.
|
|
69
|
-
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.
|
|
70
|
-
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.
|
|
71
|
-
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.
|
|
64
|
+
"@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.299",
|
|
65
|
+
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.299",
|
|
66
|
+
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.299",
|
|
67
|
+
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.299",
|
|
68
|
+
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.299",
|
|
69
|
+
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.299",
|
|
70
|
+
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.299",
|
|
71
|
+
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.299"
|
|
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-
|
|
89
|
-
"core-
|
|
88
|
+
"core-x6a2shyd.mjs",
|
|
89
|
+
"core-xcjrj654.mjs"
|
|
90
90
|
],
|
|
91
|
-
"claudeCodeVersion": "2.1.
|
|
91
|
+
"claudeCodeVersion": "2.1.299"
|
|
92
92
|
}
|
package/sdk-tools.d.ts
CHANGED
|
@@ -447,6 +447,7 @@ export type ArtifactOutput =
|
|
|
447
447
|
publishesResetAt?: number;
|
|
448
448
|
contract?: string;
|
|
449
449
|
updated?: boolean;
|
|
450
|
+
owned?: boolean;
|
|
450
451
|
icon?: string;
|
|
451
452
|
faviconSent?: true;
|
|
452
453
|
iconDropped?: true;
|
|
@@ -484,6 +485,7 @@ export type ArtifactOutput =
|
|
|
484
485
|
durationMs: number;
|
|
485
486
|
title?: string;
|
|
486
487
|
};
|
|
488
|
+
owned?: boolean;
|
|
487
489
|
artifactRead?: {
|
|
488
490
|
slug: string;
|
|
489
491
|
ver?: string;
|
|
@@ -564,6 +566,7 @@ export type ArtifactOutput =
|
|
|
564
566
|
written?: {
|
|
565
567
|
url: string;
|
|
566
568
|
};
|
|
569
|
+
owned?: boolean;
|
|
567
570
|
asset_upload: {
|
|
568
571
|
id: string;
|
|
569
572
|
url: string;
|
|
@@ -577,6 +580,7 @@ export type ArtifactOutput =
|
|
|
577
580
|
written?: {
|
|
578
581
|
url: string;
|
|
579
582
|
};
|
|
583
|
+
owned?: boolean;
|
|
580
584
|
asset_uploads: {
|
|
581
585
|
url: string;
|
|
582
586
|
/**
|
|
@@ -667,6 +671,7 @@ export type ArtifactOutput =
|
|
|
667
671
|
written?: {
|
|
668
672
|
url: string;
|
|
669
673
|
};
|
|
674
|
+
owned?: boolean;
|
|
670
675
|
asset_delete: {
|
|
671
676
|
id: string;
|
|
672
677
|
deleted: boolean;
|
|
@@ -891,6 +896,10 @@ export interface FileReadInput {
|
|
|
891
896
|
* Page range for PDF files (e.g., "1-5", "3", "10-20"). Only applicable to PDF files. Maximum 20 pages per request.
|
|
892
897
|
*/
|
|
893
898
|
pages?: string;
|
|
899
|
+
/**
|
|
900
|
+
* Set to true to read a text file, or a line range of one, that is over the usual size limits, up to what still fits in your context. Only use this when you genuinely need all of it or the user asked for the whole file; otherwise read it in parts with offset and limit, or search it.
|
|
901
|
+
*/
|
|
902
|
+
allow_large?: boolean;
|
|
894
903
|
}
|
|
895
904
|
export interface FileWriteInput {
|
|
896
905
|
/**
|
|
@@ -4172,6 +4181,10 @@ export interface CronCreateOutput {
|
|
|
4172
4181
|
humanSchedule: string;
|
|
4173
4182
|
recurring: boolean;
|
|
4174
4183
|
durable?: boolean;
|
|
4184
|
+
/**
|
|
4185
|
+
* Epoch ms of the job's next run, the scheduler's per-job offset included
|
|
4186
|
+
*/
|
|
4187
|
+
nextFireAt?: number;
|
|
4175
4188
|
}
|
|
4176
4189
|
export interface CronDeleteOutput {
|
|
4177
4190
|
id: string;
|
|
@@ -4184,6 +4197,10 @@ export interface CronListOutput {
|
|
|
4184
4197
|
prompt: string;
|
|
4185
4198
|
recurring?: boolean;
|
|
4186
4199
|
durable?: boolean;
|
|
4200
|
+
/**
|
|
4201
|
+
* Epoch ms of the job's next run, the scheduler's per-job offset included
|
|
4202
|
+
*/
|
|
4203
|
+
nextFireAt?: number;
|
|
4187
4204
|
}[];
|
|
4188
4205
|
}
|
|
4189
4206
|
export interface PushNotificationOutput {
|
package/sdk.d.ts
CHANGED
|
@@ -73,6 +73,10 @@ export declare type AgentDefinition = {
|
|
|
73
73
|
* Maximum number of agentic turns (API round-trips) before stopping
|
|
74
74
|
*/
|
|
75
75
|
maxTurns?: number;
|
|
76
|
+
/**
|
|
77
|
+
* Token count at which this agent compacts its own conversation when it runs as a subagent. It only lowers the window the subagent would otherwise inherit. No effect on the main session agent.
|
|
78
|
+
*/
|
|
79
|
+
autoCompactWindow?: number;
|
|
76
80
|
/**
|
|
77
81
|
* Run this agent as a background task (non-blocking, fire-and-forget) when invoked
|
|
78
82
|
*/
|
|
@@ -279,6 +283,7 @@ export declare type CanUseTool = (toolName: string, input: Record<string, unknow
|
|
|
279
283
|
toolUseID: string;
|
|
280
284
|
/** If running within the context of a sub-agent, the sub-agent's ID. */
|
|
281
285
|
agentID?: string;
|
|
286
|
+
|
|
282
287
|
/**
|
|
283
288
|
* The control_request envelope's `request_id`. A control_response sent
|
|
284
289
|
* out-of-band (e.g. a signed HTTP POST instead of the SDK's WS write)
|
|
@@ -2157,19 +2162,33 @@ export declare type Options = {
|
|
|
2157
2162
|
* When enabled, commands are executed in a sandboxed environment that restricts
|
|
2158
2163
|
* filesystem and network access. This provides an additional security layer.
|
|
2159
2164
|
*
|
|
2160
|
-
*
|
|
2161
|
-
*
|
|
2162
|
-
*
|
|
2163
|
-
*
|
|
2164
|
-
*
|
|
2165
|
-
*
|
|
2166
|
-
*
|
|
2167
|
-
*
|
|
2168
|
-
*
|
|
2169
|
-
* `failIfUnavailable`
|
|
2170
|
-
*
|
|
2171
|
-
*
|
|
2172
|
-
*
|
|
2165
|
+
* Access restrictions can be set here (`filesystem`, `network`, `credentials`);
|
|
2166
|
+
* filesystem and network restrictions also come from `Read`, `Edit` and
|
|
2167
|
+
* `WebFetch` permission rules, and Claude Code applies both.
|
|
2168
|
+
*
|
|
2169
|
+
* **Dependency check:** When this option sets `enabled: true`,
|
|
2170
|
+
* `failIfUnavailable` defaults to `true` unless this option or an inline
|
|
2171
|
+
* `settings` sandbox block sets it: if sandbox dependencies are missing (e.g.
|
|
2172
|
+
* `bubblewrap` on Linux) or the platform is unsupported, `query()` emits an
|
|
2173
|
+
* error result and exits rather than silently running commands unsandboxed.
|
|
2174
|
+
* Set `failIfUnavailable: false` to allow graceful degradation.
|
|
2175
|
+
*
|
|
2176
|
+
* **With `settings`:** when `settings` is given inline (an object or JSON string,
|
|
2177
|
+
* not a file path) and has its own `sandbox` block, this option is merged into
|
|
2178
|
+
* it. A value this option sets replaces the value at the same path, and a
|
|
2179
|
+
* value it does not set is kept, with two exceptions: a
|
|
2180
|
+
* `filesystem.disabled: true` is dropped when this option sets `filesystem` or
|
|
2181
|
+
* a `credentials.files` deny entry, since it would switch those off; and a
|
|
2182
|
+
* `network.httpProxyPort` or `network.socksProxyPort` is dropped when this
|
|
2183
|
+
* option sets `network.allowedDomains`, a `network.deniedDomains` entry or
|
|
2184
|
+
* `network.strictAllowlist: true` and does not set that port itself, since
|
|
2185
|
+
* traffic through your own proxy is not checked against those lists. Nested
|
|
2186
|
+
* objects merge key by key, except `ripgrep` and
|
|
2187
|
+
* `network.tlsTerminate`, which this option replaces whole; and the restriction
|
|
2188
|
+
* lists (`filesystem.denyRead`, `filesystem.denyWrite`, `network.deniedDomains`,
|
|
2189
|
+
* `credentials.files`, `credentials.envVars`) from both are combined instead, a
|
|
2190
|
+
* `deny` from either side winning over a `mask` for the same credential path or
|
|
2191
|
+
* variable. A `settings` file path cannot be combined with this option.
|
|
2173
2192
|
*
|
|
2174
2193
|
* @example Enable sandboxing with auto-allow
|
|
2175
2194
|
* ```typescript
|
|
@@ -2179,7 +2198,7 @@ export declare type Options = {
|
|
|
2179
2198
|
* }
|
|
2180
2199
|
* ```
|
|
2181
2200
|
*
|
|
2182
|
-
* @example Configure network options
|
|
2201
|
+
* @example Configure network options
|
|
2183
2202
|
* ```typescript
|
|
2184
2203
|
* sandbox: {
|
|
2185
2204
|
* enabled: true,
|
|
@@ -2752,6 +2771,7 @@ export declare type PreToolUseHookSpecificOutput = {
|
|
|
2752
2771
|
permissionDecisionReason?: string;
|
|
2753
2772
|
updatedInput?: Record<string, unknown>;
|
|
2754
2773
|
additionalContext?: string;
|
|
2774
|
+
|
|
2755
2775
|
};
|
|
2756
2776
|
|
|
2757
2777
|
/**
|
|
@@ -3661,6 +3681,7 @@ export declare type SDKAssistantMessage = {
|
|
|
3661
3681
|
|
|
3662
3682
|
|
|
3663
3683
|
|
|
3684
|
+
|
|
3664
3685
|
/**
|
|
3665
3686
|
* 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.
|
|
3666
3687
|
*/
|
|
@@ -3693,6 +3714,7 @@ export declare type SDKAssistantMessage = {
|
|
|
3693
3714
|
|
|
3694
3715
|
|
|
3695
3716
|
|
|
3717
|
+
|
|
3696
3718
|
};
|
|
3697
3719
|
|
|
3698
3720
|
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';
|
|
@@ -3892,7 +3914,7 @@ declare type SDKControlBackgroundTasksRequest = {
|
|
|
3892
3914
|
};
|
|
3893
3915
|
|
|
3894
3916
|
/**
|
|
3895
|
-
* Drops a pending async user message from the command queue by uuid. No-op if already dequeued for execution.
|
|
3917
|
+
* Drops a pending async user message from the command queue by uuid. No-op if already dequeued for execution. Also a no-op, on a worker that recognises held messages, for the queued re-run of an interrupted turn while that re-run also answers for other client messages, which cancelling it would close though nobody withdrew them; see the response.
|
|
3896
3918
|
*/
|
|
3897
3919
|
declare type SDKControlCancelAsyncMessageRequest = {
|
|
3898
3920
|
subtype: 'cancel_async_message';
|
|
@@ -3921,6 +3943,10 @@ declare type SDKControlElicitationRequest = {
|
|
|
3921
3943
|
url?: string;
|
|
3922
3944
|
elicitation_id?: string;
|
|
3923
3945
|
requested_schema?: Record<string, unknown>;
|
|
3946
|
+
/**
|
|
3947
|
+
* requested_schema.properties' top-level keys in the order the MCP server listed them; absent for URL mode and when the schema has no properties object. For a host whose transport keeps no JSON object key order (a protobuf Struct, say). Names that look like array indices ("0", "1", …) come first, in JavaScript's object key order.
|
|
3948
|
+
*/
|
|
3949
|
+
property_order?: string[];
|
|
3924
3950
|
/**
|
|
3925
3951
|
* Permission-display title from the MCP server's _meta['anthropic/permissionDisplay']. Mirrors can_use_tool.title so SDK consumers can render elicitation-driven permission prompts with structured headers instead of parsing `message`.
|
|
3926
3952
|
*/
|
|
@@ -4379,7 +4405,7 @@ export declare type SDKControlGetUsageResponse = {
|
|
|
4379
4405
|
* Behavioral characteristics of local usage. Categories overlap — this is not a partition, so percentages do not sum to 100.
|
|
4380
4406
|
*/
|
|
4381
4407
|
behaviors: {
|
|
4382
|
-
key: 'cache_miss' | 'long_context' | 'subagent_heavy' | 'high_parallel' | 'cron';
|
|
4408
|
+
key: 'cache_miss' | 'long_context' | 'subagent_heavy' | 'high_parallel' | 'cron' | 'max_effort' | 'workflow' | 'always_on_context' | 'large_tool_results';
|
|
4383
4409
|
/**
|
|
4384
4410
|
* Share of the weighted local usage attributed to this behavior, 0-100.
|
|
4385
4411
|
*/
|
|
@@ -4434,7 +4460,7 @@ export declare type SDKControlGetUsageResponse = {
|
|
|
4434
4460
|
* Behavioral characteristics of local usage. Categories overlap — this is not a partition, so percentages do not sum to 100.
|
|
4435
4461
|
*/
|
|
4436
4462
|
behaviors: {
|
|
4437
|
-
key: 'cache_miss' | 'long_context' | 'subagent_heavy' | 'high_parallel' | 'cron';
|
|
4463
|
+
key: 'cache_miss' | 'long_context' | 'subagent_heavy' | 'high_parallel' | 'cron' | 'max_effort' | 'workflow' | 'always_on_context' | 'large_tool_results';
|
|
4438
4464
|
/**
|
|
4439
4465
|
* Share of the weighted local usage attributed to this behavior, 0-100.
|
|
4440
4466
|
*/
|
|
@@ -4591,6 +4617,7 @@ export declare type SDKControlInitializeResponse = {
|
|
|
4591
4617
|
*/
|
|
4592
4618
|
plugins_applied?: boolean;
|
|
4593
4619
|
|
|
4620
|
+
|
|
4594
4621
|
/**
|
|
4595
4622
|
* What became of each entry of this initialize's sdkMcpServerManifests, keyed by sdk server name, for the entries whose name is in sdkMcpServers. 'parked': kept for the connect that follows this reply, which answers the server's MCP initialize and first tools/list from it (a later failure to replay shows up as live mcp_message frames, as when no entry was sent). 'already_connected': this CLI already had a live client for the server. 'protocol_version_mismatch': initializeResult.protocolVersion is not the version this CLI's client requests. 'malformed': the entry is not of the documented shape, reported whether or not manifests were honoured (every name in sdkMcpServers gets this when the field itself is not an object); or an honoured entry is past the limits this CLI sets on a live answer. 'not_honoured': the CLI did not use the entry: manifests or remote manifests are switched off in this CLI, the session service has not told this remote-session worker in the last five minutes that only the account owning the session can send events to it, or the request reached such a worker other than over its session stream (nothing for the host to change in any of these cases); or this CLI had read as many tool lists as it allows in a minute (send it again later); or it came over the session stream without sdkMcpServerManifestsOrigin or on a frame too old to trust (the host's to fix). Absent when the request carried no sdkMcpServerManifests or named no sdkMcpServers, and on CLIs that predate the field.
|
|
4596
4623
|
*/
|
|
@@ -4598,6 +4625,10 @@ export declare type SDKControlInitializeResponse = {
|
|
|
4598
4625
|
|
|
4599
4626
|
|
|
4600
4627
|
|
|
4628
|
+
/**
|
|
4629
|
+
* Claude Code version of the process that runs this session's turns (the same value its system/init carries). Absent on CLIs that predate the field, and when the responder is not that process and does not know its version.
|
|
4630
|
+
*/
|
|
4631
|
+
claude_code_version?: string;
|
|
4601
4632
|
fast_mode_state?: coreTypes.FastModeState;
|
|
4602
4633
|
fast_mode_disabled_reason?: coreTypes.FastModeDisabledReason;
|
|
4603
4634
|
|
|
@@ -4635,13 +4666,13 @@ declare type SDKControlInterruptRequest = {
|
|
|
4635
4666
|
*/
|
|
4636
4667
|
export declare type SDKControlInterruptResponse = {
|
|
4637
4668
|
/**
|
|
4638
|
-
* Uuids of async user messages that survive this interrupt: commands still in the queue, plus any batch already dequeued for the imminent turn but not yet reachable by the abort. An interrupt — plain or cancel_queued:true — that lands during the FIRST-command prewait window (before the first turn of the session has armed a controller) is additionally LATCHED, scoped to the user-intent work pending at that instant — the batch already dequeued and parked for the imminent turn, plus the user-intent main-thread commands then in the queue (the work this list enumerates): the first turn to arm that carries any of that doomed work starts already aborted, exactly once, so the listed prewait batch is delivered into an immediately-aborted turn, its frames and result flowing through the normal abort path, instead of running to completion. A turn carrying none of it arms live and leaves the latch waiting: a system delivery turn (for example a replayed host event), or a prompt enqueued after the interrupt — post-interrupt work is never coalesced with the doomed work and never dies to the latch, so the Stop kills exactly what this receipt listed. The latch is released when the doomed work is retired without arming: if a parked prewait batch is entirely cancelled, the latch is released even when other queued commands remain (those arm and run normally); with nothing parked, it is released once none of the doomed commands remains queued — work enqueued after the interrupt neither holds it up nor is aborted by it. Survivors that ride any later turn run normally. These WILL run (subject to that latch) unless cancelled first (or unless the request set cancel_queued:true, in which case every uuid-stamped survivor this process holds is removed, emitted a terminal `cancelled` synchronously, and listed under `cancelled` instead — leaving here only what a client driving a hosted session can no longer recall: a send already in flight to that session, or the first prompt the session was created with; a send that client still holds on its own machine behind a send gate (it waits there until that session is ready to take it) has not gone out, so it is withdrawn and listed under `cancelled` like a queued one, and cancel_async_message can withdraw it too, while a plain interrupt leaves it held and lists it here). Cancellation granularity: uuids still in the queue are individually cancellable via cancel_async_message; once a batch is dequeued and coalesced into one turn, cancelling a NON-representative member uuid is a no-op (its content still runs), while cancelling the batch-representative uuid drops the WHOLE coalesced batch — in both cases the cancel response reports cancelled:false because the message was no longer in the queue. Coverage caveats: only uuid-STAMPED messages appear (a message enqueued without a uuid still runs but is never listed, so [] does not mean "nothing will run"); only main-thread messages are listed (subagent-addressed messages are out of scope); and the list may include internally-enqueued uuids the client never sent (cron triggers, auto-resume continuations) — ignore unknown uuids rather than treating them as an error. Ordering: on a clean interrupt this receipt is written before the interrupted turn result; a turn that crashes during interrupt handling emits its error result on a direct-write path that may precede the receipt. Snapshot is taken synchronously with abort processing — probing the queue after the interrupted result instead always loses the race against the drain loop, which starts the next queued turn immediately.
|
|
4669
|
+
* Uuids of async user messages that survive this interrupt: commands still in the queue, plus any batch already dequeued for the imminent turn but not yet reachable by the abort. An interrupt — plain or cancel_queued:true — that lands during the FIRST-command prewait window (before the first turn of the session has armed a controller) is additionally LATCHED, scoped to the user-intent work pending at that instant — the batch already dequeued and parked for the imminent turn, plus the user-intent main-thread commands then in the queue (the work this list enumerates): the first turn to arm that carries any of that doomed work starts already aborted, exactly once, so the listed prewait batch is delivered into an immediately-aborted turn, its frames and result flowing through the normal abort path, instead of running to completion. A turn carrying none of it arms live and leaves the latch waiting: a system delivery turn (for example a replayed host event), or a prompt enqueued after the interrupt — post-interrupt work is never coalesced with the doomed work and never dies to the latch, so the Stop kills exactly what this receipt listed. The latch is released when the doomed work is retired without arming: if a parked prewait batch is entirely cancelled, the latch is released even when other queued commands remain (those arm and run normally); with nothing parked, it is released once none of the doomed commands remains queued — work enqueued after the interrupt neither holds it up nor is aborted by it. Survivors that ride any later turn run normally. These WILL run (subject to that latch) unless cancelled first (or unless the request set cancel_queued:true, in which case every uuid-stamped survivor this process holds is removed, emitted a terminal `cancelled` synchronously, and listed under `cancelled` instead — leaving here only what a client driving a hosted session can no longer recall: a send already in flight to that session, or the first prompt the session was created with; a send that client still holds on its own machine behind a send gate (it waits there until that session is ready to take it) has not gone out, so it is withdrawn and listed under `cancelled` like a queued one, and cancel_async_message can withdraw it too, while a plain interrupt leaves it held and lists it here). Cancellation granularity: uuids still in the queue are individually cancellable via cancel_async_message (the re-run of an interrupted turn that also answers for other client messages only if this interrupt was for it; see the response to that request); once a batch is dequeued and coalesced into one turn, cancelling a NON-representative member uuid is a no-op (its content still runs), while cancelling the batch-representative uuid drops the WHOLE coalesced batch — in both cases the cancel response reports cancelled:false because the message was no longer in the queue. Coverage caveats: only uuid-STAMPED messages appear (a message enqueued without a uuid still runs but is never listed, so [] does not mean "nothing will run"); only main-thread messages are listed (subagent-addressed messages are out of scope); and the list may include internally-enqueued uuids the client never sent (cron triggers, auto-resume continuations) — ignore unknown uuids rather than treating them as an error. Ordering: on a clean interrupt this receipt is written before the interrupted turn result; a turn that crashes during interrupt handling emits its error result on a direct-write path that may precede the receipt. Snapshot is taken synchronously with abort processing — probing the queue after the interrupted result instead always loses the race against the drain loop, which starts the next queued turn immediately.
|
|
4639
4670
|
*/
|
|
4640
4671
|
still_queued: string[];
|
|
4641
4672
|
|
|
4642
4673
|
|
|
4643
4674
|
/**
|
|
4644
|
-
* Present only when the request set cancel_queued:true — uuids of main-thread commands cancelled by this interrupt: every survivor that would otherwise have appeared under `still_queued`, including any uuid that was mid-fold at the interrupt instant (this request also aborts, so the fold never delivers it). Each listed uuid has been removed (queue-resident) or marked cancel-pending (the first-command prewait window, closed by the drain loop's backstop) and emits a terminal 'cancelled' lifecycle synchronously at the first such interrupt (a repeat interrupt over the same parked batch re-lists the uuid idempotently without re-emitting); none will run. Same coverage caveats as `still_queued` (uuid-stamped main-thread only; internally-enqueued uuids may appear). Advertised by the `interrupt_cancel_queued_v1` capability.
|
|
4675
|
+
* Present only when the request set cancel_queued:true — uuids of main-thread commands cancelled by this interrupt: every survivor that would otherwise have appeared under `still_queued`, including any uuid that was mid-fold at the interrupt instant (this request also aborts, so the fold never delivers it). Each listed uuid has been removed (queue-resident) or marked cancel-pending (the first-command prewait window, closed by the drain loop's backstop) and emits a terminal 'cancelled' lifecycle synchronously at the first such interrupt (a repeat interrupt over the same parked batch re-lists the uuid idempotently without re-emitting); none will run. Where one of them is the re-run of an interrupted turn that also answered for other client messages whose re-sent copies had been set aside for it, those messages' uuids are listed behind the commands' too: they were in no queue and never under `still_queued`, each has its terminal 'cancelled' lifecycle, and a repeat interrupt does not list them again. Same coverage caveats as `still_queued` (uuid-stamped main-thread only; internally-enqueued uuids may appear). Advertised by the `interrupt_cancel_queued_v1` capability.
|
|
4645
4676
|
*/
|
|
4646
4677
|
cancelled?: string[];
|
|
4647
4678
|
};
|
|
@@ -4820,6 +4851,8 @@ declare type SDKControlPermissionRequest = {
|
|
|
4820
4851
|
*/
|
|
4821
4852
|
decision_reason_type?: 'rule' | 'mode' | 'subcommandResults' | 'permissionPromptTool' | 'hook' | 'asyncAgent' | 'sandboxOverride' | 'workingDir' | 'safetyCheck' | 'classifier' | 'other';
|
|
4822
4853
|
|
|
4854
|
+
|
|
4855
|
+
|
|
4823
4856
|
/**
|
|
4824
4857
|
* 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.
|
|
4825
4858
|
*/
|
|
@@ -4844,9 +4877,10 @@ declare type SDKControlPermissionRequest = {
|
|
|
4844
4877
|
display_name?: string;
|
|
4845
4878
|
tool_use_id: string;
|
|
4846
4879
|
agent_id?: string;
|
|
4880
|
+
|
|
4847
4881
|
description?: string;
|
|
4848
4882
|
/**
|
|
4849
|
-
* True when one-tap Approve/Deny must not be offered: the tool's approval card IS the user-interaction surface (Tool.requiresUserInteraction()
|
|
4883
|
+
* True when one-tap Approve/Deny must not be offered: the tool's approval card IS the user-interaction surface (Tool.requiresUserInteraction(): the user responds on the card itself), OR the pending ask is localDisplayOnly (its consent disclosure cannot ride this wire and only the local dialog renders it), OR the auto-mode classifier blocked the call and it was handed to a person (decision_reason_type 'classifier' on a person-only ask), which no stored grant or automatic approval may answer, OR the SDK host worded the ask (title and description are its consent copy, which a push cannot carry whole). In each case the user has to open the session to answer.
|
|
4850
4884
|
*/
|
|
4851
4885
|
requires_user_interaction?: boolean;
|
|
4852
4886
|
|
|
@@ -5107,6 +5141,7 @@ declare type SDKControlSetModelRequest = {
|
|
|
5107
5141
|
*/
|
|
5108
5142
|
model?: string | null;
|
|
5109
5143
|
|
|
5144
|
+
|
|
5110
5145
|
};
|
|
5111
5146
|
|
|
5112
5147
|
/**
|
|
@@ -5282,6 +5317,7 @@ export declare type SDKInformationalMessage = {
|
|
|
5282
5317
|
* Opaque feature tag on a line a host may treat specially; absent on ordinary lines. Hosts ignore values they do not know.
|
|
5283
5318
|
*/
|
|
5284
5319
|
tag?: string;
|
|
5320
|
+
|
|
5285
5321
|
uuid: UUID;
|
|
5286
5322
|
session_id: string;
|
|
5287
5323
|
};
|
|
@@ -5394,6 +5430,10 @@ export declare type SDKMessageOrigin = {
|
|
|
5394
5430
|
* Kernel-verified pid of the process that connected to this session's cross-session messaging socket, read from the connection (SO_PEERCRED / LOCAL_PEERPID) — never from the payload. This identifies the CONNECTING process, which for relayed traffic (e.g. a daemon forwarding on another session's behalf) is the relay, not the message's author. Key sender identity on this, never on `from`: `from` is sender-authored and kept only for reply routing, so it is forgeable by any same-user process. Absent when unverifiable (Windows, non-UDS ingress) — never a wrong value. Pids are recyclable: provenance, not an authentication token.
|
|
5395
5431
|
*/
|
|
5396
5432
|
verifiedPeerPid?: number;
|
|
5433
|
+
|
|
5434
|
+
|
|
5435
|
+
|
|
5436
|
+
|
|
5397
5437
|
} | {
|
|
5398
5438
|
kind: 'task-notification';
|
|
5399
5439
|
/**
|
|
@@ -5748,6 +5788,7 @@ export declare type SDKResultError = {
|
|
|
5748
5788
|
*/
|
|
5749
5789
|
resume_reason?: string;
|
|
5750
5790
|
terminal_reason?: TerminalReason;
|
|
5791
|
+
|
|
5751
5792
|
/**
|
|
5752
5793
|
* Delivery sequence of this result within the run: how many results the run numbered before this one, starting at 0, in the order the process writes them. A result held back while background work finishes is numbered when it is finally written, not when its text was produced; a result whose write fails still consumes its number, so a gap in a stream-json sequence means a result was lost. Distinct from num_turns, which counts model round-trips within one turn. Numbered by the process that hosts the run (`claude -p`, stream-json): a local client relaying a cloud session passes the cloud session's numbering through and its own locally built error results carry none; the in-process engine surface does not number yet. Absent from older producers.
|
|
5753
5794
|
*/
|
|
@@ -5780,6 +5821,16 @@ export declare type SDKResultSuccess = {
|
|
|
5780
5821
|
|
|
5781
5822
|
|
|
5782
5823
|
|
|
5824
|
+
|
|
5825
|
+
|
|
5826
|
+
|
|
5827
|
+
|
|
5828
|
+
|
|
5829
|
+
|
|
5830
|
+
|
|
5831
|
+
|
|
5832
|
+
|
|
5833
|
+
|
|
5783
5834
|
user_message_uuid?: string;
|
|
5784
5835
|
user_message_uuids?: string[];
|
|
5785
5836
|
resume_reason?: string;
|
|
@@ -5811,6 +5862,7 @@ export declare type SDKResultSuccess = {
|
|
|
5811
5862
|
api_error_status?: number | null;
|
|
5812
5863
|
|
|
5813
5864
|
|
|
5865
|
+
|
|
5814
5866
|
num_turns: number;
|
|
5815
5867
|
result: string;
|
|
5816
5868
|
stop_reason: string | null;
|
|
@@ -5836,6 +5888,7 @@ export declare type SDKResultSuccess = {
|
|
|
5836
5888
|
structured_output?: unknown;
|
|
5837
5889
|
deferred_tool_use?: SDKDeferredToolUse;
|
|
5838
5890
|
terminal_reason?: TerminalReason;
|
|
5891
|
+
|
|
5839
5892
|
/**
|
|
5840
5893
|
* Delivery sequence of this result within the run: how many results the run numbered before this one, starting at 0, in the order the process writes them. A result held back while background work finishes is numbered when it is finally written, not when its text was produced; a result whose write fails still consumes its number, so a gap in a stream-json sequence means a result was lost. Distinct from num_turns, which counts model round-trips within one turn. Numbered by the process that hosts the run (`claude -p`, stream-json): a local client relaying a cloud session passes the cloud session's numbering through and its own locally built error results carry none; the in-process engine surface does not number yet. Absent from older producers.
|
|
5841
5894
|
*/
|
|
@@ -8666,7 +8719,7 @@ export declare interface Settings {
|
|
|
8666
8719
|
*/
|
|
8667
8720
|
parentSettingsBehavior?: 'first-wins' | 'merge';
|
|
8668
8721
|
/**
|
|
8669
|
-
* Controls how the managed settings sources compose. "first-wins" (default): the highest-priority source present (server-managed > MDM (managed plist / HKLM) > managed-settings.json) is the managed tier alone. "merge": every present source deep-merges with fixed precedence server-managed > MDM > managed-settings.json — scalars take the highest source's value (a restrictive boolean or enum — the allowManaged*Only locks, the disable* switches, the sandbox lock family — takes the strictest value any source sets) and arrays union, except fallbackModel, the restriction allowlists allowedMcpServers, allowedProviders, availableModels, strictKnownMarketplaces and allowedChannelPlugins, and sandbox.credentials.awsPairs and sandbox.ripgrep (the highest source that sets one owns it whole), modelOverrides (the whole map of the highest source that sets it, dropped when that source sits below the one that sets availableModels), managedMcpServers (server names union; a name set by two sources takes the higher source's whole entry), and the keys taken from the highest source only: the auth pins forceLoginOrgUUID, forceLoginMethod, forceLoginGatewayUrl and gatewayInternalNetworks, the credential helpers apiKeyHelper, awsAuthRefresh, awsCredentialExport, gcpAuthRefresh, otelHeadersHelper and proxyAuthHelper, modelPicker, permissions.defaultMode, parentSettingsBehavior and the policyHelper configuration (env keeps its own per-key union). Honored only from the highest-priority source present; enable it only when every lower source is admin-controlled, since lower sources then contribute entries such as permissions.allow. HKCU and --managed-settings never take part in the merge.
|
|
8722
|
+
* Controls how the managed settings sources compose. "first-wins" (default): the highest-priority source present (server-managed > MDM (managed plist / HKLM) > managed-settings.json) is the managed tier alone. "merge": every present source deep-merges with fixed precedence server-managed > MDM > managed-settings.json — scalars take the highest source's value (a restrictive boolean or enum — the allowManaged*Only locks, the disable* switches, the sandbox lock family — takes the strictest value any source sets) and arrays union, except fallbackModel, the restriction allowlists allowedMcpServers, allowedProviders, availableModels, strictKnownMarketplaces and allowedChannelPlugins, and sandbox.credentials.awsPairs and sandbox.ripgrep (the highest source that sets one owns it whole), modelOverrides (the whole map of the highest source that sets it, dropped when that source sits below the one that sets availableModels), managedMcpServers (server names union; a name set by two sources takes the higher source's whole entry), and the keys taken from the highest source only: the auth pins forceLoginOrgUUID, forceLoginMethod, forceLoginGatewayUrl and gatewayInternalNetworks, the credential helpers apiKeyHelper, awsAuthRefresh, awsCredentialExport, gcpAuthRefresh, otelHeadersHelper and proxyAuthHelper, modelPicker, permissions.defaultMode, parentSettingsBehavior and the policyHelper configuration (env keeps its own per-key union). In both modes, a forceLoginOrgUUID, or a forceLoginMethod of claudeai or console, that this machine's own MDM policy or managed settings file sets applies ahead of server-managed settings. Honored only from the highest-priority source present; enable it only when every lower source is admin-controlled, since lower sources then contribute entries such as permissions.allow. HKCU and --managed-settings never take part in the merge.
|
|
8670
8723
|
*/
|
|
8671
8724
|
managedSourcesBehavior?: 'first-wins' | 'merge';
|
|
8672
8725
|
/**
|
|
@@ -9425,6 +9478,7 @@ export declare type SlashCommand = {
|
|
|
9425
9478
|
* True when the command is Claude Code's own; absent for a command defined by a user, project, plugin or MCP server. Rows can share a name: when a marked row carries it, /name runs that one, and an unmarked row is the one /name runs only when no marked row shares its name. The marker describes the row's name, not its aliases: a typed alias runs a command that has it as its name, when one exists, whatever this marker says.
|
|
9426
9479
|
*/
|
|
9427
9480
|
builtin?: boolean;
|
|
9481
|
+
|
|
9428
9482
|
};
|
|
9429
9483
|
|
|
9430
9484
|
/**
|