@anthropic-ai/claude-agent-sdk 0.2.96 → 0.2.97
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/assistant.mjs +82 -82
- package/bridge.d.ts +10 -1
- package/bridge.mjs +97 -85
- package/browser-sdk.js +4 -4
- package/cli.js +6018 -6316
- package/manifest.json +18 -18
- package/manifest.zst.json +22 -22
- package/package.json +2 -2
- package/sdk-tools.d.ts +10 -1
- package/sdk.d.ts +43 -1
- package/sdk.mjs +33 -32
package/manifest.json
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.1.
|
|
3
|
-
"buildDate": "2026-04-
|
|
2
|
+
"version": "2.1.97",
|
|
3
|
+
"buildDate": "2026-04-08T20:52:51Z",
|
|
4
4
|
"platforms": {
|
|
5
5
|
"darwin-arm64": {
|
|
6
6
|
"binary": "claude",
|
|
7
|
-
"checksum": "
|
|
8
|
-
"size":
|
|
7
|
+
"checksum": "9104eba60ca82c590ababc5eee0d01f2dc5440d7cf2d668e4c48d6485e41cfeb",
|
|
8
|
+
"size": 199579088
|
|
9
9
|
},
|
|
10
10
|
"darwin-x64": {
|
|
11
11
|
"binary": "claude",
|
|
12
|
-
"checksum": "
|
|
13
|
-
"size":
|
|
12
|
+
"checksum": "d6e6ee329dbf1cd0222cd710039086aab9621bc85d65d314adee421446dda08c",
|
|
13
|
+
"size": 201052496
|
|
14
14
|
},
|
|
15
15
|
"linux-arm64": {
|
|
16
16
|
"binary": "claude",
|
|
17
|
-
"checksum": "
|
|
18
|
-
"size":
|
|
17
|
+
"checksum": "85167cb721655fdd90b002012a28eca273c89dc2fd709be49afe2a7724c365a0",
|
|
18
|
+
"size": 231868992
|
|
19
19
|
},
|
|
20
20
|
"linux-x64": {
|
|
21
21
|
"binary": "claude",
|
|
22
|
-
"checksum": "
|
|
23
|
-
"size":
|
|
22
|
+
"checksum": "0d43fcd11d29206563eeef3a1f787f0615c21cd703cc91f3a180915fd5797ef6",
|
|
23
|
+
"size": 231615104
|
|
24
24
|
},
|
|
25
25
|
"linux-arm64-musl": {
|
|
26
26
|
"binary": "claude",
|
|
27
|
-
"checksum": "
|
|
28
|
-
"size":
|
|
27
|
+
"checksum": "b0cfda67d7dbfadb37c0f2f8714a2694958f988e29785d5bcf00d6f3968ab611",
|
|
28
|
+
"size": 224987584
|
|
29
29
|
},
|
|
30
30
|
"linux-x64-musl": {
|
|
31
31
|
"binary": "claude",
|
|
32
|
-
"checksum": "
|
|
33
|
-
"size":
|
|
32
|
+
"checksum": "ab1e66323397e1687ca6a074d471af44ba3cee7ac839632e6b3dbf55dfa75f0d",
|
|
33
|
+
"size": 225929664
|
|
34
34
|
},
|
|
35
35
|
"win32-x64": {
|
|
36
36
|
"binary": "claude.exe",
|
|
37
|
-
"checksum": "
|
|
38
|
-
"size":
|
|
37
|
+
"checksum": "b678e7827fdcfcd9ac9b0eb7c7b1dda4f06b7ecbff4fd89c7fd22be3578f79ea",
|
|
38
|
+
"size": 241307296
|
|
39
39
|
},
|
|
40
40
|
"win32-arm64": {
|
|
41
41
|
"binary": "claude.exe",
|
|
42
|
-
"checksum": "
|
|
43
|
-
"size":
|
|
42
|
+
"checksum": "78db7edd6de917d733bdcb55560d0f8f7543666254ea3a66b05053a45c549f3b",
|
|
43
|
+
"size": 238017696
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
}
|
package/manifest.zst.json
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.1.
|
|
3
|
-
"buildDate": "2026-04-
|
|
2
|
+
"version": "2.1.97",
|
|
3
|
+
"buildDate": "2026-04-08T20:52:52Z",
|
|
4
4
|
"platforms": {
|
|
5
5
|
"darwin-arm64": {
|
|
6
6
|
"binary": "claude.zst",
|
|
7
|
-
"checksum": "
|
|
8
|
-
"size":
|
|
7
|
+
"checksum": "6b837fd78aba5651f91837229160d314bb631f9417e15d06825b444ead5d820e",
|
|
8
|
+
"size": 41265456,
|
|
9
9
|
"bundle": {
|
|
10
|
-
"checksum": "
|
|
11
|
-
"size":
|
|
10
|
+
"checksum": "e181dd9d3ab1a3811fbcf2557e4050ffd8a65e5bd95f8fae9f84880794927d1a",
|
|
11
|
+
"size": 41269433
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"darwin-x64": {
|
|
15
15
|
"binary": "claude.zst",
|
|
16
|
-
"checksum": "
|
|
17
|
-
"size":
|
|
16
|
+
"checksum": "09402b9404720fbefdadd217a97a6bdb1adda727f7ce88b4ac6e83a8d34cdda5",
|
|
17
|
+
"size": 42909357,
|
|
18
18
|
"bundle": {
|
|
19
|
-
"checksum": "
|
|
20
|
-
"size":
|
|
19
|
+
"checksum": "fad27030988c9661f7aada299f385fd3ddccaa2b872b424e9038c7d552f00c15",
|
|
20
|
+
"size": 42903159
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"linux-arm64": {
|
|
24
24
|
"binary": "claude.zst",
|
|
25
|
-
"checksum": "
|
|
26
|
-
"size":
|
|
25
|
+
"checksum": "c279887ac0487995c2de36bc9671b1c8ac33e7e9491869b47f10b73a8bd3c7fb",
|
|
26
|
+
"size": 50940314
|
|
27
27
|
},
|
|
28
28
|
"linux-x64": {
|
|
29
29
|
"binary": "claude.zst",
|
|
30
|
-
"checksum": "
|
|
31
|
-
"size":
|
|
30
|
+
"checksum": "828d7849d7da4c0bcd5d0f7bf1193ad4e1058b8a42ea2543630fff55272bc2c4",
|
|
31
|
+
"size": 51505208
|
|
32
32
|
},
|
|
33
33
|
"linux-arm64-musl": {
|
|
34
34
|
"binary": "claude.zst",
|
|
35
|
-
"checksum": "
|
|
36
|
-
"size":
|
|
35
|
+
"checksum": "4a1f5e67ab363ffc7a6983bf9f6b96a3441f75e4307340d8a5c48ee90c9c38b8",
|
|
36
|
+
"size": 49583713
|
|
37
37
|
},
|
|
38
38
|
"linux-x64-musl": {
|
|
39
39
|
"binary": "claude.zst",
|
|
40
|
-
"checksum": "
|
|
41
|
-
"size":
|
|
40
|
+
"checksum": "4a6696cfeefc7f7dc5390847206169493180d71b7609c21dc5a285f303ba9e16",
|
|
41
|
+
"size": 50195927
|
|
42
42
|
},
|
|
43
43
|
"win32-x64": {
|
|
44
44
|
"binary": "claude.exe.zst",
|
|
45
|
-
"checksum": "
|
|
46
|
-
"size":
|
|
45
|
+
"checksum": "8e880cc9adc0bb1f380318421783aa40e4482429f76d232839d4ef0fcc95d34d",
|
|
46
|
+
"size": 53133673
|
|
47
47
|
},
|
|
48
48
|
"win32-arm64": {
|
|
49
49
|
"binary": "claude.exe.zst",
|
|
50
|
-
"checksum": "
|
|
51
|
-
"size":
|
|
50
|
+
"checksum": "0ccbabbb66937a97002610508abade12d7d699879488bf2bc74fdd824bdf8f42",
|
|
51
|
+
"size": 51309267
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anthropic-ai/claude-agent-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.97",
|
|
4
4
|
"main": "sdk.mjs",
|
|
5
5
|
"types": "sdk.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"vendor/ripgrep/",
|
|
91
91
|
"vendor/audio-capture/"
|
|
92
92
|
],
|
|
93
|
-
"claudeCodeVersion": "2.1.
|
|
93
|
+
"claudeCodeVersion": "2.1.97"
|
|
94
94
|
}
|
package/sdk-tools.d.ts
CHANGED
|
@@ -78,6 +78,15 @@ export type AgentOutput =
|
|
|
78
78
|
ephemeral_5m_input_tokens: number;
|
|
79
79
|
} | null;
|
|
80
80
|
};
|
|
81
|
+
toolStats?: {
|
|
82
|
+
readCount: number;
|
|
83
|
+
searchCount: number;
|
|
84
|
+
bashCount: number;
|
|
85
|
+
editFileCount: number;
|
|
86
|
+
linesAdded: number;
|
|
87
|
+
linesRemoved: number;
|
|
88
|
+
otherToolCount: number;
|
|
89
|
+
};
|
|
81
90
|
status: "completed";
|
|
82
91
|
prompt: string;
|
|
83
92
|
}
|
|
@@ -2262,7 +2271,7 @@ export interface FileEditOutput {
|
|
|
2262
2271
|
/**
|
|
2263
2272
|
* The original file contents before editing
|
|
2264
2273
|
*/
|
|
2265
|
-
originalFile: string;
|
|
2274
|
+
originalFile: string | null;
|
|
2266
2275
|
/**
|
|
2267
2276
|
* Diff patch showing the changes
|
|
2268
2277
|
*/
|
package/sdk.d.ts
CHANGED
|
@@ -1420,6 +1420,19 @@ export declare type Options = {
|
|
|
1420
1420
|
* - `string` - Use a custom system prompt
|
|
1421
1421
|
* - `{ type: 'preset', preset: 'claude_code' }` - Use Claude Code's default system prompt
|
|
1422
1422
|
* - `{ type: 'preset', preset: 'claude_code', append: '...' }` - Use default prompt with appended instructions
|
|
1423
|
+
* - `{ type: 'preset', preset: 'claude_code', excludeDynamicSections: true }` -
|
|
1424
|
+
* Strip per-user dynamic sections (working directory, auto-memory, git
|
|
1425
|
+
* status) from the system prompt so it stays static and cacheable across
|
|
1426
|
+
* users. The stripped content is re-injected as the first user message so
|
|
1427
|
+
* the model still has access to it.
|
|
1428
|
+
*
|
|
1429
|
+
* Use this when many users in your fleet share the same system prompt and
|
|
1430
|
+
* you want the prompt-caching prefix to hit cross-user. Tradeoffs:
|
|
1431
|
+
* - The working-directory, memory-path, and git-status context is
|
|
1432
|
+
* marginally less authoritative for steering the model (it appears in
|
|
1433
|
+
* a user message instead of the system prompt).
|
|
1434
|
+
* - The first user message becomes slightly larger.
|
|
1435
|
+
* - Has no effect when `systemPrompt` is a string (custom prompt).
|
|
1423
1436
|
*
|
|
1424
1437
|
* @example Custom prompt
|
|
1425
1438
|
* ```typescript
|
|
@@ -1434,11 +1447,21 @@ export declare type Options = {
|
|
|
1434
1447
|
* append: 'Always explain your reasoning.'
|
|
1435
1448
|
* }
|
|
1436
1449
|
* ```
|
|
1450
|
+
*
|
|
1451
|
+
* @example Cacheable prompt for multi-user fleets
|
|
1452
|
+
* ```typescript
|
|
1453
|
+
* systemPrompt: {
|
|
1454
|
+
* type: 'preset',
|
|
1455
|
+
* preset: 'claude_code',
|
|
1456
|
+
* excludeDynamicSections: true,
|
|
1457
|
+
* }
|
|
1458
|
+
* ```
|
|
1437
1459
|
*/
|
|
1438
1460
|
systemPrompt?: string | {
|
|
1439
1461
|
type: 'preset';
|
|
1440
1462
|
preset: 'claude_code';
|
|
1441
1463
|
append?: string;
|
|
1464
|
+
excludeDynamicSections?: boolean;
|
|
1442
1465
|
};
|
|
1443
1466
|
/**
|
|
1444
1467
|
* Custom function to spawn the Claude Code process.
|
|
@@ -1903,6 +1926,7 @@ declare const SandboxNetworkConfigSchema: () => z.ZodOptional<z.ZodObject<{
|
|
|
1903
1926
|
allowUnixSockets: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1904
1927
|
allowAllUnixSockets: z.ZodOptional<z.ZodBoolean>;
|
|
1905
1928
|
allowLocalBinding: z.ZodOptional<z.ZodBoolean>;
|
|
1929
|
+
allowMachLookup: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1906
1930
|
httpProxyPort: z.ZodOptional<z.ZodNumber>;
|
|
1907
1931
|
socksProxyPort: z.ZodOptional<z.ZodNumber>;
|
|
1908
1932
|
}, z.core.$strip>>;
|
|
@@ -1923,6 +1947,7 @@ declare const SandboxSettingsSchema: () => z.ZodObject<{
|
|
|
1923
1947
|
allowUnixSockets: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1924
1948
|
allowAllUnixSockets: z.ZodOptional<z.ZodBoolean>;
|
|
1925
1949
|
allowLocalBinding: z.ZodOptional<z.ZodBoolean>;
|
|
1950
|
+
allowMachLookup: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1926
1951
|
httpProxyPort: z.ZodOptional<z.ZodNumber>;
|
|
1927
1952
|
socksProxyPort: z.ZodOptional<z.ZodNumber>;
|
|
1928
1953
|
}, z.core.$strip>>;
|
|
@@ -2130,6 +2155,7 @@ export declare type SDKControlGetContextUsageResponse = {
|
|
|
2130
2155
|
attachmentTokens: number;
|
|
2131
2156
|
assistantMessageTokens: number;
|
|
2132
2157
|
userMessageTokens: number;
|
|
2158
|
+
redirectedContextTokens: number;
|
|
2133
2159
|
toolCallsByType: {
|
|
2134
2160
|
name: string;
|
|
2135
2161
|
callTokens: number;
|
|
@@ -2165,6 +2191,10 @@ declare type SDKControlInitializeRequest = {
|
|
|
2165
2191
|
jsonSchema?: Record<string, unknown>;
|
|
2166
2192
|
systemPrompt?: string;
|
|
2167
2193
|
appendSystemPrompt?: string;
|
|
2194
|
+
/**
|
|
2195
|
+
* When true, omit per-user dynamic sections (working directory, auto-memory path) from the cached system prompt and re-inject them as the first user message. Lets cross-user prompt caching hit on a static system prompt prefix. Tradeoff: the model sees this context slightly later in the prompt, so steering on the working directory and memory location is marginally less authoritative. Has no effect when a custom (non-preset) system prompt is in use.
|
|
2196
|
+
*/
|
|
2197
|
+
excludeDynamicSections?: boolean;
|
|
2168
2198
|
agents?: Record<string, coreTypes.AgentDefinition>;
|
|
2169
2199
|
promptSuggestions?: boolean;
|
|
2170
2200
|
agentProgressSummaries?: boolean;
|
|
@@ -3278,6 +3308,10 @@ export declare interface Settings {
|
|
|
3278
3308
|
type: 'command';
|
|
3279
3309
|
command: string;
|
|
3280
3310
|
padding?: number;
|
|
3311
|
+
/**
|
|
3312
|
+
* Re-run the status line command every N seconds in addition to event-driven updates
|
|
3313
|
+
*/
|
|
3314
|
+
refreshInterval?: number;
|
|
3281
3315
|
};
|
|
3282
3316
|
/**
|
|
3283
3317
|
* Enabled plugins using plugin-id\@marketplace-id format. Example: { "formatter\@anthropic-tools": true }. Also supports extended format with version constraints.
|
|
@@ -3898,6 +3932,10 @@ export declare interface Settings {
|
|
|
3898
3932
|
* Controls the output style for assistant responses
|
|
3899
3933
|
*/
|
|
3900
3934
|
outputStyle?: string;
|
|
3935
|
+
/**
|
|
3936
|
+
* Default transcript view mode on startup
|
|
3937
|
+
*/
|
|
3938
|
+
viewMode?: 'default' | 'verbose' | 'focus';
|
|
3901
3939
|
/**
|
|
3902
3940
|
* Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")
|
|
3903
3941
|
*/
|
|
@@ -3932,6 +3970,10 @@ export declare interface Settings {
|
|
|
3932
3970
|
*/
|
|
3933
3971
|
allowAllUnixSockets?: boolean;
|
|
3934
3972
|
allowLocalBinding?: boolean;
|
|
3973
|
+
/**
|
|
3974
|
+
* macOS only: Additional XPC/Mach service names to allow looking up. Supports trailing-wildcard prefix matching (e.g., "com.apple.coresimulator.*"). Needed for tools that communicate via XPC such as the iOS Simulator or Playwright.
|
|
3975
|
+
*/
|
|
3976
|
+
allowMachLookup?: string[];
|
|
3935
3977
|
httpProxyPort?: number;
|
|
3936
3978
|
socksProxyPort?: number;
|
|
3937
3979
|
};
|
|
@@ -4270,7 +4312,7 @@ export declare interface SpawnOptions {
|
|
|
4270
4312
|
signal: AbortSignal;
|
|
4271
4313
|
}
|
|
4272
4314
|
|
|
4273
|
-
declare type StdoutMessage = coreTypes.SDKMessage | coreTypes.SDKPostTurnSummaryMessage | SDKControlResponse | SDKControlRequest | SDKControlCancelRequest | SDKKeepAliveMessage;
|
|
4315
|
+
declare type StdoutMessage = coreTypes.SDKMessage | coreTypes.SDKPostTurnSummaryMessage | coreTypes.SDKTranscriptMirrorMessage | SDKControlResponse | SDKControlRequest | SDKControlCancelRequest | SDKKeepAliveMessage;
|
|
4274
4316
|
|
|
4275
4317
|
export declare type StopFailureHookInput = BaseHookInput & {
|
|
4276
4318
|
hook_event_name: 'StopFailure';
|