@anthropic-ai/claude-agent-sdk 0.2.141 → 0.3.143
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 +81 -81
- package/bridge.mjs +67 -67
- package/browser-sdk.js +22 -22
- package/manifest.json +19 -19
- package/manifest.zst.json +23 -23
- package/package.json +12 -14
- package/sdk.d.ts +68 -139
- package/sdk.mjs +47 -47
package/manifest.json
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.1.
|
|
3
|
-
"commit": "
|
|
4
|
-
"buildDate": "2026-05-
|
|
2
|
+
"version": "2.1.143",
|
|
3
|
+
"commit": "cfb8132e4c3551e2773f41a1900efd1cc93637db",
|
|
4
|
+
"buildDate": "2026-05-15T17:47:13Z",
|
|
5
5
|
"platforms": {
|
|
6
6
|
"darwin-arm64": {
|
|
7
7
|
"binary": "claude",
|
|
8
|
-
"checksum": "
|
|
9
|
-
"size":
|
|
8
|
+
"checksum": "2701c6cfd68483f8faf0316a1ba6481a1455a90645ada179f0c48d8c36d722ef",
|
|
9
|
+
"size": 207605280
|
|
10
10
|
},
|
|
11
11
|
"darwin-x64": {
|
|
12
12
|
"binary": "claude",
|
|
13
|
-
"checksum": "
|
|
14
|
-
"size":
|
|
13
|
+
"checksum": "bc8ff4ce02b765a033808fb596f9522306cbe5c50d21344ed8752c08966f362c",
|
|
14
|
+
"size": 210119440
|
|
15
15
|
},
|
|
16
16
|
"linux-arm64": {
|
|
17
17
|
"binary": "claude",
|
|
18
|
-
"checksum": "
|
|
19
|
-
"size":
|
|
18
|
+
"checksum": "32e8edc4a5c3c41d18607c75d1b8e7bec643330c03e266be46ac3b41a446c4eb",
|
|
19
|
+
"size": 232961672
|
|
20
20
|
},
|
|
21
21
|
"linux-x64": {
|
|
22
22
|
"binary": "claude",
|
|
23
|
-
"checksum": "
|
|
24
|
-
"size":
|
|
23
|
+
"checksum": "f75fdc3ff9d9cd494b86192f9e349b5c5c6d3970ed4d5cd5c7b330c5a2b1dcc4",
|
|
24
|
+
"size": 233088720
|
|
25
25
|
},
|
|
26
26
|
"linux-arm64-musl": {
|
|
27
27
|
"binary": "claude",
|
|
28
|
-
"checksum": "
|
|
29
|
-
"size":
|
|
28
|
+
"checksum": "e68903ec56ddd5560bb0820c96c8f7a4193e7eab6236ede56cb2e05f450ce44f",
|
|
29
|
+
"size": 225816408
|
|
30
30
|
},
|
|
31
31
|
"linux-x64-musl": {
|
|
32
32
|
"binary": "claude",
|
|
33
|
-
"checksum": "
|
|
34
|
-
"size":
|
|
33
|
+
"checksum": "e4cb8588ed6e38f9920bdaa2611263d4a0b0d11300f1d23945df234fdf5e278a",
|
|
34
|
+
"size": 227482672
|
|
35
35
|
},
|
|
36
36
|
"win32-x64": {
|
|
37
37
|
"binary": "claude.exe",
|
|
38
|
-
"checksum": "
|
|
39
|
-
"size":
|
|
38
|
+
"checksum": "e480244f2a4660fe76ed32442c1e3e2edda8fb5433417e73faba39f0e7f69eb6",
|
|
39
|
+
"size": 228902560
|
|
40
40
|
},
|
|
41
41
|
"win32-arm64": {
|
|
42
42
|
"binary": "claude.exe",
|
|
43
|
-
"checksum": "
|
|
44
|
-
"size":
|
|
43
|
+
"checksum": "5cbad78d2f316fedd0d621289aae558aaf259b404d0a46e0e49662ef3b397986",
|
|
44
|
+
"size": 224866976
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
}
|
package/manifest.zst.json
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.1.
|
|
3
|
-
"commit": "
|
|
4
|
-
"buildDate": "2026-05-
|
|
2
|
+
"version": "2.1.143",
|
|
3
|
+
"commit": "cfb8132e4c3551e2773f41a1900efd1cc93637db",
|
|
4
|
+
"buildDate": "2026-05-15T17:54:02Z",
|
|
5
5
|
"platforms": {
|
|
6
6
|
"darwin-arm64": {
|
|
7
7
|
"binary": "claude.zst",
|
|
8
|
-
"checksum": "
|
|
9
|
-
"size":
|
|
8
|
+
"checksum": "de2803764796c6b908c203b330c4aa152be67291b85afb11777a9705b9f3133a",
|
|
9
|
+
"size": 42998050,
|
|
10
10
|
"bundle": {
|
|
11
|
-
"checksum": "
|
|
12
|
-
"size":
|
|
11
|
+
"checksum": "ed3695422acd6338ab038aa0964b00c98d6e2cd0b17bb5b482d5f66082294038",
|
|
12
|
+
"size": 43008215
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"darwin-x64": {
|
|
16
16
|
"binary": "claude.zst",
|
|
17
|
-
"checksum": "
|
|
18
|
-
"size":
|
|
17
|
+
"checksum": "e0c65fc323f611df3d5093f8f21494a6f811f39de7f28bf93b552902f1fe9abf",
|
|
18
|
+
"size": 44914712,
|
|
19
19
|
"bundle": {
|
|
20
|
-
"checksum": "
|
|
21
|
-
"size":
|
|
20
|
+
"checksum": "f89d54e92a526eab1c1441ad716941c8c20462809d692ae5a03d29fc475913e6",
|
|
21
|
+
"size": 44916790
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"linux-arm64": {
|
|
25
25
|
"binary": "claude.zst",
|
|
26
|
-
"checksum": "
|
|
27
|
-
"size":
|
|
26
|
+
"checksum": "81e45b0efc7cf75298912cbcf953d366f1937c7573fbc3457508cb9022c21bb1",
|
|
27
|
+
"size": 50768400
|
|
28
28
|
},
|
|
29
29
|
"linux-x64": {
|
|
30
30
|
"binary": "claude.zst",
|
|
31
|
-
"checksum": "
|
|
32
|
-
"size":
|
|
31
|
+
"checksum": "6cbd2d23d9b6f8e06f8a1614f5212d13ae3b1c748b6b59df90157575b3e4f8a1",
|
|
32
|
+
"size": 51405057
|
|
33
33
|
},
|
|
34
34
|
"linux-arm64-musl": {
|
|
35
35
|
"binary": "claude.zst",
|
|
36
|
-
"checksum": "
|
|
37
|
-
"size":
|
|
36
|
+
"checksum": "53b68f1d98c2e24c100f5fc7e873cad7f0470af69c751cd5917460402277fb2f",
|
|
37
|
+
"size": 49422676
|
|
38
38
|
},
|
|
39
39
|
"linux-x64-musl": {
|
|
40
40
|
"binary": "claude.zst",
|
|
41
|
-
"checksum": "
|
|
42
|
-
"size":
|
|
41
|
+
"checksum": "fe24a7fa385ade60594375ec9fada75060bf028d6562b84461f4dd1b13abc521",
|
|
42
|
+
"size": 50119926
|
|
43
43
|
},
|
|
44
44
|
"win32-x64": {
|
|
45
45
|
"binary": "claude.exe.zst",
|
|
46
|
-
"checksum": "
|
|
47
|
-
"size":
|
|
46
|
+
"checksum": "f1070448e53ffdd83f65b2773bffa2e1136d462e2f3be72cff0f4effd0611ac4",
|
|
47
|
+
"size": 52123091
|
|
48
48
|
},
|
|
49
49
|
"win32-arm64": {
|
|
50
50
|
"binary": "claude.exe.zst",
|
|
51
|
-
"checksum": "
|
|
52
|
-
"size":
|
|
51
|
+
"checksum": "967b9e021cdc470d10478e5ff8cfe93624337a7475478658954f275489d28adb",
|
|
52
|
+
"size": 50393488
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anthropic-ai/claude-agent-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.143",
|
|
4
4
|
"main": "sdk.mjs",
|
|
5
5
|
"types": "sdk.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -47,22 +47,20 @@
|
|
|
47
47
|
"automation",
|
|
48
48
|
"code-generation"
|
|
49
49
|
],
|
|
50
|
-
"dependencies": {
|
|
51
|
-
"@anthropic-ai/sdk": "^0.93.0",
|
|
52
|
-
"@modelcontextprotocol/sdk": "^1.29.0"
|
|
53
|
-
},
|
|
54
50
|
"peerDependencies": {
|
|
51
|
+
"@anthropic-ai/sdk": ">=0.93.0",
|
|
52
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
55
53
|
"zod": "^4.0.0"
|
|
56
54
|
},
|
|
57
55
|
"optionalDependencies": {
|
|
58
|
-
"@anthropic-ai/claude-agent-sdk-linux-x64": "0.
|
|
59
|
-
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.
|
|
60
|
-
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.
|
|
61
|
-
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.
|
|
62
|
-
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.
|
|
63
|
-
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.
|
|
64
|
-
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.
|
|
65
|
-
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.
|
|
56
|
+
"@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.143",
|
|
57
|
+
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.143",
|
|
58
|
+
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.143",
|
|
59
|
+
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.143",
|
|
60
|
+
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.143",
|
|
61
|
+
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.143",
|
|
62
|
+
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.143",
|
|
63
|
+
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.143"
|
|
66
64
|
},
|
|
67
65
|
"files": [
|
|
68
66
|
"sdk.mjs",
|
|
@@ -78,5 +76,5 @@
|
|
|
78
76
|
"manifest.json",
|
|
79
77
|
"manifest.zst.json"
|
|
80
78
|
],
|
|
81
|
-
"claudeCodeVersion": "2.1.
|
|
79
|
+
"claudeCodeVersion": "2.1.143"
|
|
82
80
|
}
|
package/sdk.d.ts
CHANGED
|
@@ -635,7 +635,7 @@ export declare type ForkSessionOptions = SessionMutationOptions & {
|
|
|
635
635
|
* Result of a fork operation.
|
|
636
636
|
*/
|
|
637
637
|
export declare type ForkSessionResult = {
|
|
638
|
-
/** New session UUID. Resumable via `
|
|
638
|
+
/** New session UUID. Resumable via `query({ options: { resume: sessionId } })`. */
|
|
639
639
|
sessionId: string;
|
|
640
640
|
};
|
|
641
641
|
|
|
@@ -954,9 +954,10 @@ export declare type McpHttpServerConfig = {
|
|
|
954
954
|
headers?: Record<string, string>;
|
|
955
955
|
tools?: McpServerToolPolicy[];
|
|
956
956
|
/**
|
|
957
|
-
* When true, all tools from this server are always included in the prompt and never deferred behind tool search. Equivalent to setting defer_loading: false on the API. Default: tools are deferred when tool search is enabled. As a side effect this also blocks startup until the server is connected (capped at the standard 5s connect timeout) even
|
|
957
|
+
* When true, all tools from this server are always included in the prompt and never deferred behind tool search. Equivalent to setting defer_loading: false on the API. Default: tools are deferred when tool search is enabled. As a side effect this also blocks startup until the server is connected (capped at the standard 5s connect timeout) even though MCP startup is otherwise non-blocking by default, since the tools must be present when the turn-1 prompt is built.
|
|
958
958
|
*/
|
|
959
959
|
alwaysLoad?: boolean;
|
|
960
|
+
|
|
960
961
|
};
|
|
961
962
|
|
|
962
963
|
export declare type McpSdkServerConfig = {
|
|
@@ -1059,9 +1060,10 @@ export declare type McpSSEServerConfig = {
|
|
|
1059
1060
|
headers?: Record<string, string>;
|
|
1060
1061
|
tools?: McpServerToolPolicy[];
|
|
1061
1062
|
/**
|
|
1062
|
-
* When true, all tools from this server are always included in the prompt and never deferred behind tool search. Equivalent to setting defer_loading: false on the API. Default: tools are deferred when tool search is enabled. As a side effect this also blocks startup until the server is connected (capped at the standard 5s connect timeout) even
|
|
1063
|
+
* When true, all tools from this server are always included in the prompt and never deferred behind tool search. Equivalent to setting defer_loading: false on the API. Default: tools are deferred when tool search is enabled. As a side effect this also blocks startup until the server is connected (capped at the standard 5s connect timeout) even though MCP startup is otherwise non-blocking by default, since the tools must be present when the turn-1 prompt is built.
|
|
1063
1064
|
*/
|
|
1064
1065
|
alwaysLoad?: boolean;
|
|
1066
|
+
|
|
1065
1067
|
};
|
|
1066
1068
|
|
|
1067
1069
|
export declare type McpStdioServerConfig = {
|
|
@@ -1070,9 +1072,10 @@ export declare type McpStdioServerConfig = {
|
|
|
1070
1072
|
args?: string[];
|
|
1071
1073
|
env?: Record<string, string>;
|
|
1072
1074
|
/**
|
|
1073
|
-
* When true, all tools from this server are always included in the prompt and never deferred behind tool search. Equivalent to setting defer_loading: false on the API. Default: tools are deferred when tool search is enabled. As a side effect this also blocks startup until the server is connected (capped at the standard 5s connect timeout) even
|
|
1075
|
+
* When true, all tools from this server are always included in the prompt and never deferred behind tool search. Equivalent to setting defer_loading: false on the API. Default: tools are deferred when tool search is enabled. As a side effect this also blocks startup until the server is connected (capped at the standard 5s connect timeout) even though MCP startup is otherwise non-blocking by default, since the tools must be present when the turn-1 prompt is built.
|
|
1074
1076
|
*/
|
|
1075
1077
|
alwaysLoad?: boolean;
|
|
1078
|
+
|
|
1076
1079
|
};
|
|
1077
1080
|
|
|
1078
1081
|
/**
|
|
@@ -1226,6 +1229,32 @@ export declare type Options = {
|
|
|
1226
1229
|
* otherwise be allowed.
|
|
1227
1230
|
*/
|
|
1228
1231
|
disallowedTools?: string[];
|
|
1232
|
+
/**
|
|
1233
|
+
* Map of tool-name aliases applied before name resolution. When the
|
|
1234
|
+
* model emits a `tool_use` whose name is a key in this map, the tool
|
|
1235
|
+
* execution path resolves the mapped name instead.
|
|
1236
|
+
*
|
|
1237
|
+
* This lets SDK consumers redirect built-in tool names to their own
|
|
1238
|
+
* tools. For example, a host that runs Bash inside a remote sandbox via
|
|
1239
|
+
* an MCP tool can set `{ Bash: 'mcp__workspace__bash' }` so that if the
|
|
1240
|
+
* model emits `Bash` (e.g. because a skill document instructed it to),
|
|
1241
|
+
* the call is routed to the MCP tool instead of failing as unknown.
|
|
1242
|
+
*
|
|
1243
|
+
* The redirect is single-hop: an alias that points at another aliased
|
|
1244
|
+
* name resolves that target literally rather than following a chain, so
|
|
1245
|
+
* cycles like `{A: 'B', B: 'A'}` cannot loop.
|
|
1246
|
+
*
|
|
1247
|
+
* `toolAliases` is complementary to `disallowedTools`, not a replacement
|
|
1248
|
+
* for it: the alias only affects name-based lookup of model-emitted
|
|
1249
|
+
* `tool_use` blocks, whereas `disallowedTools` also blocks harness-internal
|
|
1250
|
+
* direct calls that hold the tool object without a name lookup.
|
|
1251
|
+
*
|
|
1252
|
+
* @example
|
|
1253
|
+
* ```typescript
|
|
1254
|
+
* toolAliases: { Bash: 'mcp__workspace__bash' }
|
|
1255
|
+
* ```
|
|
1256
|
+
*/
|
|
1257
|
+
toolAliases?: Record<string, string>;
|
|
1229
1258
|
/**
|
|
1230
1259
|
* Specify the base set of available built-in tools.
|
|
1231
1260
|
* - `string[]` - Array of specific tool names (e.g., `['Bash', 'Read', 'Edit']`)
|
|
@@ -2465,6 +2494,15 @@ export declare type SDKAssistantMessage = {
|
|
|
2465
2494
|
error?: SDKAssistantMessageError;
|
|
2466
2495
|
uuid: UUID;
|
|
2467
2496
|
session_id: string;
|
|
2497
|
+
request_id?: string;
|
|
2498
|
+
/**
|
|
2499
|
+
* Subagent type that produced this message.
|
|
2500
|
+
*/
|
|
2501
|
+
subagent_type?: string;
|
|
2502
|
+
/**
|
|
2503
|
+
* Description of the subagent task that produced this message.
|
|
2504
|
+
*/
|
|
2505
|
+
task_description?: string;
|
|
2468
2506
|
};
|
|
2469
2507
|
|
|
2470
2508
|
export declare type SDKAssistantMessageError = 'authentication_failed' | 'oauth_org_not_allowed' | 'billing_error' | 'rate_limit' | 'invalid_request' | 'server_error' | 'unknown' | 'max_output_tokens';
|
|
@@ -2714,6 +2752,10 @@ declare type SDKControlInitializeRequest = {
|
|
|
2714
2752
|
*/
|
|
2715
2753
|
planModeInstructions?: string;
|
|
2716
2754
|
|
|
2755
|
+
/**
|
|
2756
|
+
* Map of tool-name aliases applied before name resolution. When the model emits a tool_use whose name is a key in this map, the tool execution path resolves the mapped name instead. Single-hop (no chains). See Options.toolAliases.
|
|
2757
|
+
*/
|
|
2758
|
+
toolAliases?: Record<string, string>;
|
|
2717
2759
|
/**
|
|
2718
2760
|
* 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.
|
|
2719
2761
|
*/
|
|
@@ -3316,6 +3358,7 @@ export declare type SDKResultSuccess = {
|
|
|
3316
3358
|
subtype: 'success';
|
|
3317
3359
|
duration_ms: number;
|
|
3318
3360
|
duration_api_ms: number;
|
|
3361
|
+
ttft_ms?: number;
|
|
3319
3362
|
is_error: boolean;
|
|
3320
3363
|
api_error_status?: number | null;
|
|
3321
3364
|
num_turns: number;
|
|
@@ -3334,30 +3377,6 @@ export declare type SDKResultSuccess = {
|
|
|
3334
3377
|
session_id: string;
|
|
3335
3378
|
};
|
|
3336
3379
|
|
|
3337
|
-
/**
|
|
3338
|
-
* V2 API - UNSTABLE
|
|
3339
|
-
* Session interface for multi-turn conversations.
|
|
3340
|
-
* Has methods, so not serializable.
|
|
3341
|
-
* @deprecated Use `query()` instead. The V2 session API will be removed in a future release.
|
|
3342
|
-
* @alpha
|
|
3343
|
-
*/
|
|
3344
|
-
export declare interface SDKSession {
|
|
3345
|
-
/**
|
|
3346
|
-
* The session ID. Available after receiving the first message.
|
|
3347
|
-
* For resumed sessions, available immediately.
|
|
3348
|
-
* Throws if accessed before the session is initialized.
|
|
3349
|
-
*/
|
|
3350
|
-
readonly sessionId: string;
|
|
3351
|
-
/** Send a message to the agent */
|
|
3352
|
-
send(message: string | SDKUserMessage): Promise<void>;
|
|
3353
|
-
/** Stream messages from the agent */
|
|
3354
|
-
stream(): AsyncGenerator<SDKMessage, void>;
|
|
3355
|
-
/** Close the session */
|
|
3356
|
-
close(): void;
|
|
3357
|
-
/** Async disposal support (calls close if not already closed) */
|
|
3358
|
-
[Symbol.asyncDispose](): Promise<void>;
|
|
3359
|
-
}
|
|
3360
|
-
|
|
3361
3380
|
/**
|
|
3362
3381
|
* Session metadata returned by listSessions and getSessionInfo.
|
|
3363
3382
|
*/
|
|
@@ -3404,85 +3423,6 @@ export declare type SDKSessionInfo = {
|
|
|
3404
3423
|
createdAt?: number;
|
|
3405
3424
|
};
|
|
3406
3425
|
|
|
3407
|
-
/**
|
|
3408
|
-
* V2 API - UNSTABLE
|
|
3409
|
-
* Options for creating a session.
|
|
3410
|
-
* @deprecated Use `query()` instead. The V2 session API will be removed in a future release.
|
|
3411
|
-
* @alpha
|
|
3412
|
-
*/
|
|
3413
|
-
export declare type SDKSessionOptions = {
|
|
3414
|
-
/** Model to use */
|
|
3415
|
-
model: string;
|
|
3416
|
-
/** Path to Claude Code executable */
|
|
3417
|
-
pathToClaudeCodeExecutable?: string;
|
|
3418
|
-
/** Executable to use (node, bun) */
|
|
3419
|
-
executable?: 'node' | 'bun';
|
|
3420
|
-
/** Arguments to pass to executable */
|
|
3421
|
-
executableArgs?: string[];
|
|
3422
|
-
/**
|
|
3423
|
-
* Environment variables to pass to the Claude Code process.
|
|
3424
|
-
* Defaults to `process.env`.
|
|
3425
|
-
*
|
|
3426
|
-
* SDK consumers can identify their app/library to include in the User-Agent header by setting:
|
|
3427
|
-
* - `CLAUDE_AGENT_SDK_CLIENT_APP` - Your app/library identifier (e.g., "my-app/1.0.0", "my-library/2.1")
|
|
3428
|
-
*/
|
|
3429
|
-
env?: {
|
|
3430
|
-
[envVar: string]: string | undefined;
|
|
3431
|
-
};
|
|
3432
|
-
/**
|
|
3433
|
-
* Working directory for the Claude Code process. Defaults to the current
|
|
3434
|
-
* process's working directory.
|
|
3435
|
-
*/
|
|
3436
|
-
cwd?: string;
|
|
3437
|
-
/**
|
|
3438
|
-
* Which settings sources to load (CLAUDE.md, `.claude/settings.json`).
|
|
3439
|
-
* Defaults to `[]`: no project/user settings are loaded unless specified.
|
|
3440
|
-
* Note that `query()` has the opposite default and loads all sources when
|
|
3441
|
-
* this is omitted.
|
|
3442
|
-
*/
|
|
3443
|
-
settingSources?: SettingSource[];
|
|
3444
|
-
/**
|
|
3445
|
-
* Must be set to `true` when using `permissionMode: 'bypassPermissions'`.
|
|
3446
|
-
* This is a safety measure to ensure intentional bypassing of permissions.
|
|
3447
|
-
*/
|
|
3448
|
-
allowDangerouslySkipPermissions?: boolean;
|
|
3449
|
-
/**
|
|
3450
|
-
* List of tool names that are auto-allowed without prompting for permission.
|
|
3451
|
-
* These tools will execute automatically without asking the user for approval.
|
|
3452
|
-
*/
|
|
3453
|
-
allowedTools?: string[];
|
|
3454
|
-
/**
|
|
3455
|
-
* List of tool names that are disallowed. These tools will be removed
|
|
3456
|
-
* from the model's context and cannot be used.
|
|
3457
|
-
*/
|
|
3458
|
-
disallowedTools?: string[];
|
|
3459
|
-
/**
|
|
3460
|
-
* Custom permission handler for controlling tool usage. Called before each
|
|
3461
|
-
* tool execution to determine if it should be allowed, denied, or prompt the user.
|
|
3462
|
-
*/
|
|
3463
|
-
canUseTool?: CanUseTool;
|
|
3464
|
-
/**
|
|
3465
|
-
* Hook callbacks for responding to various events during execution.
|
|
3466
|
-
*/
|
|
3467
|
-
hooks?: Partial<Record<HookEvent, HookCallbackMatcher[]>>;
|
|
3468
|
-
/**
|
|
3469
|
-
* Permission mode for the session.
|
|
3470
|
-
* - `'default'` - Standard permission behavior, prompts for dangerous operations
|
|
3471
|
-
* - `'acceptEdits'` - Auto-accept file edit operations
|
|
3472
|
-
* - `'bypassPermissions'` - Bypass all permission checks (requires `allowDangerouslySkipPermissions`)
|
|
3473
|
-
* - `'plan'` - Planning mode, no execution of tools
|
|
3474
|
-
* - `'dontAsk'` - Don't prompt for permissions, deny if not pre-approved
|
|
3475
|
-
*/
|
|
3476
|
-
permissionMode?: PermissionMode;
|
|
3477
|
-
/**
|
|
3478
|
-
* Custom workflow instructions for plan mode. When `permissionMode` is
|
|
3479
|
-
* `'plan'`, this string replaces the default code-implementation workflow
|
|
3480
|
-
* body in the plan-mode system reminder. The CLI still wraps it with the
|
|
3481
|
-
* read-only enforcement preamble and the ExitPlanMode protocol footer.
|
|
3482
|
-
*/
|
|
3483
|
-
planModeInstructions?: string;
|
|
3484
|
-
};
|
|
3485
|
-
|
|
3486
3426
|
/**
|
|
3487
3427
|
* Mirrors notifySessionStateChanged. 'idle' fires after heldBackResult flushes and the bg-agent do-while exits — authoritative turn-over signal.
|
|
3488
3428
|
*/
|
|
@@ -3584,6 +3524,10 @@ export declare type SDKTaskProgressMessage = {
|
|
|
3584
3524
|
task_id: string;
|
|
3585
3525
|
tool_use_id?: string;
|
|
3586
3526
|
description: string;
|
|
3527
|
+
/**
|
|
3528
|
+
* Subagent type for Task tool subagents.
|
|
3529
|
+
*/
|
|
3530
|
+
subagent_type?: string;
|
|
3587
3531
|
usage: {
|
|
3588
3532
|
total_tokens: number;
|
|
3589
3533
|
tool_uses: number;
|
|
@@ -3602,6 +3546,10 @@ export declare type SDKTaskStartedMessage = {
|
|
|
3602
3546
|
task_id: string;
|
|
3603
3547
|
tool_use_id?: string;
|
|
3604
3548
|
description: string;
|
|
3549
|
+
/**
|
|
3550
|
+
* Subagent type for Task tool subagents.
|
|
3551
|
+
*/
|
|
3552
|
+
subagent_type?: string;
|
|
3605
3553
|
task_type?: string;
|
|
3606
3554
|
/**
|
|
3607
3555
|
* meta.name from the workflow script (e.g. 'spec'). Only set when task_type is 'local_workflow'.
|
|
@@ -3624,7 +3572,7 @@ export declare type SDKTaskUpdatedMessage = {
|
|
|
3624
3572
|
* Wire-safe subset of TaskState fields that changed. Excludes abortController, messages, result. Clients merge into their local task map.
|
|
3625
3573
|
*/
|
|
3626
3574
|
patch: {
|
|
3627
|
-
status?: 'pending' | 'running' | 'completed' | 'failed' | 'killed';
|
|
3575
|
+
status?: 'pending' | 'running' | 'completed' | 'failed' | 'killed' | 'paused';
|
|
3628
3576
|
description?: string;
|
|
3629
3577
|
end_time?: number;
|
|
3630
3578
|
total_paused_ms?: number;
|
|
@@ -3673,6 +3621,14 @@ export declare type SDKUserMessage = {
|
|
|
3673
3621
|
timestamp?: string;
|
|
3674
3622
|
uuid?: UUID;
|
|
3675
3623
|
session_id?: string;
|
|
3624
|
+
/**
|
|
3625
|
+
* Subagent type that produced this message.
|
|
3626
|
+
*/
|
|
3627
|
+
subagent_type?: string;
|
|
3628
|
+
/**
|
|
3629
|
+
* Description of the subagent task that produced this message.
|
|
3630
|
+
*/
|
|
3631
|
+
task_description?: string;
|
|
3676
3632
|
};
|
|
3677
3633
|
|
|
3678
3634
|
export declare type SDKUserMessageReplay = {
|
|
@@ -4321,6 +4277,10 @@ export declare interface Settings {
|
|
|
4321
4277
|
* Which ref new worktrees branch from. 'fresh' (default) branches from origin/<default-branch> for a clean tree. 'head' branches from your current local HEAD so unpushed commits and feature-branch state are present. Applies to --worktree, EnterWorktree, and agent isolation.
|
|
4322
4278
|
*/
|
|
4323
4279
|
baseRef?: 'fresh' | 'head';
|
|
4280
|
+
/**
|
|
4281
|
+
* Isolation mode for background sessions in this repo. 'worktree' (default) blocks Edit/Write in the main checkout until EnterWorktree is called. 'none' lets background jobs edit the working copy directly.
|
|
4282
|
+
*/
|
|
4283
|
+
bgIsolation?: 'worktree' | 'none';
|
|
4324
4284
|
};
|
|
4325
4285
|
/**
|
|
4326
4286
|
* Disable all hooks and statusLine execution
|
|
@@ -5692,37 +5652,6 @@ export declare interface Transport {
|
|
|
5692
5652
|
[Symbol.dispose]?(): void;
|
|
5693
5653
|
}
|
|
5694
5654
|
|
|
5695
|
-
/**
|
|
5696
|
-
* V2 API - UNSTABLE
|
|
5697
|
-
* Create a persistent session for multi-turn conversations.
|
|
5698
|
-
* @deprecated Use `query()` instead. The V2 session API will be removed in a future release.
|
|
5699
|
-
* @alpha
|
|
5700
|
-
*/
|
|
5701
|
-
export declare function unstable_v2_createSession(_options: SDKSessionOptions): SDKSession;
|
|
5702
|
-
|
|
5703
|
-
/**
|
|
5704
|
-
* V2 API - UNSTABLE
|
|
5705
|
-
* One-shot convenience function for single prompts.
|
|
5706
|
-
* @deprecated Use `query()` instead. The V2 session API will be removed in a future release.
|
|
5707
|
-
* @alpha
|
|
5708
|
-
*
|
|
5709
|
-
* @example
|
|
5710
|
-
* ```typescript
|
|
5711
|
-
* const result = await unstable_v2_prompt("What files are here?", {
|
|
5712
|
-
* model: 'claude-sonnet-4-6'
|
|
5713
|
-
* })
|
|
5714
|
-
* ```
|
|
5715
|
-
*/
|
|
5716
|
-
export declare function unstable_v2_prompt(_message: string, _options: SDKSessionOptions): Promise<SDKResultMessage>;
|
|
5717
|
-
|
|
5718
|
-
/**
|
|
5719
|
-
* V2 API - UNSTABLE
|
|
5720
|
-
* Resume an existing session by ID.
|
|
5721
|
-
* @deprecated Use `query()` instead. The V2 session API will be removed in a future release.
|
|
5722
|
-
* @alpha
|
|
5723
|
-
*/
|
|
5724
|
-
export declare function unstable_v2_resumeSession(_sessionId: string, _options: SDKSessionOptions): SDKSession;
|
|
5725
|
-
|
|
5726
5655
|
export declare type UserPromptExpansionHookInput = BaseHookInput & {
|
|
5727
5656
|
hook_event_name: 'UserPromptExpansion';
|
|
5728
5657
|
expansion_type: 'slash_command' | 'mcp_prompt';
|