@anthropic-ai/claude-agent-sdk 0.3.205 → 0.3.206
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.mjs +84 -83
- package/browser-sdk.js +29 -29
- package/extractFromBunfs.js +2 -2
- package/manifest.json +19 -19
- package/manifest.zst.json +23 -23
- package/package.json +10 -10
- package/sdk-tools.d.ts +4 -0
- package/sdk.d.ts +43 -5
- package/sdk.mjs +42 -42
package/extractFromBunfs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* oxlint-disable custom-rules/no-sync-fs */
|
|
2
2
|
// Extracts a file from Bun's $bunfs virtual filesystem to a real temp directory
|
|
3
3
|
// so it can be spawned as a subprocess (child processes cannot access $bunfs).
|
|
4
4
|
//
|
|
@@ -28,7 +28,7 @@ function tmpdir() {
|
|
|
28
28
|
return process.env.CLAUDE_CODE_TMPDIR
|
|
29
29
|
}
|
|
30
30
|
if (process.platform === 'darwin') {
|
|
31
|
-
//
|
|
31
|
+
// oxlint-disable-next-line custom-rules/no-hardcoded-tmp -- mirrors tempfile.ts: macOS /tmp works fine; os.tmpdir() below is for Android-on-Linux where /tmp isn't writable.
|
|
32
32
|
return '/tmp'
|
|
33
33
|
}
|
|
34
34
|
return osTmpdir()
|
package/manifest.json
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.1.
|
|
3
|
-
"commit": "
|
|
4
|
-
"buildDate": "2026-07-
|
|
2
|
+
"version": "2.1.206",
|
|
3
|
+
"commit": "edc8ebf7f852d3abffad32a5bf8e49e439f92afb",
|
|
4
|
+
"buildDate": "2026-07-09T01:48:20Z",
|
|
5
5
|
"platforms": {
|
|
6
6
|
"darwin-arm64": {
|
|
7
7
|
"binary": "claude",
|
|
8
|
-
"checksum": "
|
|
9
|
-
"size":
|
|
8
|
+
"checksum": "3197aba4442dbd5b3df42b6f35e6d7bd03b5e48ce18b7a3c5c6f5f8c28e03b7f",
|
|
9
|
+
"size": 240395024
|
|
10
10
|
},
|
|
11
11
|
"darwin-x64": {
|
|
12
12
|
"binary": "claude",
|
|
13
|
-
"checksum": "
|
|
14
|
-
"size":
|
|
13
|
+
"checksum": "b1e1636917a12c7d4e1fa54cd13f7f76ba3779fb988180610b6ca483258c2f46",
|
|
14
|
+
"size": 248431568
|
|
15
15
|
},
|
|
16
16
|
"linux-arm64": {
|
|
17
17
|
"binary": "claude",
|
|
18
|
-
"checksum": "
|
|
19
|
-
"size":
|
|
18
|
+
"checksum": "cb8ccaf4ae6beb558747227a362010c6b32b4f4a5868c3a7e96aa9972fc6ef58",
|
|
19
|
+
"size": 255376112
|
|
20
20
|
},
|
|
21
21
|
"linux-x64": {
|
|
22
22
|
"binary": "claude",
|
|
23
|
-
"checksum": "
|
|
24
|
-
"size":
|
|
23
|
+
"checksum": "d131494be407ff56a62f4e99a96ba60102002d01e3b6b1494db16bef4b7f060f",
|
|
24
|
+
"size": 258566968
|
|
25
25
|
},
|
|
26
26
|
"linux-arm64-musl": {
|
|
27
27
|
"binary": "claude",
|
|
28
|
-
"checksum": "
|
|
29
|
-
"size":
|
|
28
|
+
"checksum": "b1920556c3b077694d52397f4e5221df2419ad9b44af641be0f49647b51f87ad",
|
|
29
|
+
"size": 248624312
|
|
30
30
|
},
|
|
31
31
|
"linux-x64-musl": {
|
|
32
32
|
"binary": "claude",
|
|
33
|
-
"checksum": "
|
|
34
|
-
"size":
|
|
33
|
+
"checksum": "b0d780783401de979024c25f14a2cae665873afbcfe718c090b73e13c4cd08a0",
|
|
34
|
+
"size": 253251968
|
|
35
35
|
},
|
|
36
36
|
"win32-x64": {
|
|
37
37
|
"binary": "claude.exe",
|
|
38
|
-
"checksum": "
|
|
39
|
-
"size":
|
|
38
|
+
"checksum": "d5072b25b9a20bffb24625d36129a05ed2be4d2eb7e35625aad6aa35596892c2",
|
|
39
|
+
"size": 248682144
|
|
40
40
|
},
|
|
41
41
|
"win32-arm64": {
|
|
42
42
|
"binary": "claude.exe",
|
|
43
|
-
"checksum": "
|
|
44
|
-
"size":
|
|
43
|
+
"checksum": "c17ac3a5a8edf5cfa658e82bd41fcf83170af21538e51cc9d4cbaeefe382aba3",
|
|
44
|
+
"size": 243149984
|
|
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-07-
|
|
2
|
+
"version": "2.1.206",
|
|
3
|
+
"commit": "edc8ebf7f852d3abffad32a5bf8e49e439f92afb",
|
|
4
|
+
"buildDate": "2026-07-09T01:50:10Z",
|
|
5
5
|
"platforms": {
|
|
6
6
|
"darwin-arm64": {
|
|
7
7
|
"binary": "claude.zst",
|
|
8
|
-
"checksum": "
|
|
9
|
-
"size":
|
|
8
|
+
"checksum": "f82b3ad6293ce2c991e63a7e5af05ad7d8b78c6a5f454838b928116ea8506b45",
|
|
9
|
+
"size": 50458380,
|
|
10
10
|
"bundle": {
|
|
11
|
-
"checksum": "
|
|
12
|
-
"size":
|
|
11
|
+
"checksum": "6a7ff1b3d4fc5739a9befc4df3a6419dedab342579f9f9fb4c26a356dddec052",
|
|
12
|
+
"size": 50456788
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"darwin-x64": {
|
|
16
16
|
"binary": "claude.zst",
|
|
17
|
-
"checksum": "
|
|
18
|
-
"size":
|
|
17
|
+
"checksum": "25419961c3d901b18b0d63bb2efe3e68c47629239f9872ac08139f8f7559216e",
|
|
18
|
+
"size": 53474125,
|
|
19
19
|
"bundle": {
|
|
20
|
-
"checksum": "
|
|
21
|
-
"size":
|
|
20
|
+
"checksum": "6cbf6ee82fedf869ccde175ae739ed8740e517a5caad1f2c5a9aa400ec5b0161",
|
|
21
|
+
"size": 53484346
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"linux-arm64": {
|
|
25
25
|
"binary": "claude.zst",
|
|
26
|
-
"checksum": "
|
|
27
|
-
"size":
|
|
26
|
+
"checksum": "a6a1698b6dc9438deab622618756e735f29e22a624bdf5d382e9a9dd835438fd",
|
|
27
|
+
"size": 58141512
|
|
28
28
|
},
|
|
29
29
|
"linux-x64": {
|
|
30
30
|
"binary": "claude.zst",
|
|
31
|
-
"checksum": "
|
|
32
|
-
"size":
|
|
31
|
+
"checksum": "a224eb404540adc8f3bbd29165ff3c070c1550c1e629e62d7effd6c673d1d79b",
|
|
32
|
+
"size": 59407746
|
|
33
33
|
},
|
|
34
34
|
"linux-arm64-musl": {
|
|
35
35
|
"binary": "claude.zst",
|
|
36
|
-
"checksum": "
|
|
37
|
-
"size":
|
|
36
|
+
"checksum": "ef98d868f5695fbd05fdf3b83f1df52e81a5024022b22fb999a1f3e48d5b3d3b",
|
|
37
|
+
"size": 56828247
|
|
38
38
|
},
|
|
39
39
|
"linux-x64-musl": {
|
|
40
40
|
"binary": "claude.zst",
|
|
41
|
-
"checksum": "
|
|
42
|
-
"size":
|
|
41
|
+
"checksum": "316fdfb584e22897aea3c6532f93f00f93b86f9af64d2422295a7a93da809758",
|
|
42
|
+
"size": 58218590
|
|
43
43
|
},
|
|
44
44
|
"win32-x64": {
|
|
45
45
|
"binary": "claude.exe.zst",
|
|
46
|
-
"checksum": "
|
|
47
|
-
"size":
|
|
46
|
+
"checksum": "a5733df130abe206b7ba95d1c1c8bcc40c661a8284b1c11409cc072eb41944bd",
|
|
47
|
+
"size": 59528232
|
|
48
48
|
},
|
|
49
49
|
"win32-arm64": {
|
|
50
50
|
"binary": "claude.exe.zst",
|
|
51
|
-
"checksum": "
|
|
52
|
-
"size":
|
|
51
|
+
"checksum": "e2f74a9b7c5bc2ba9b9650cc654c87b4a71f1df453f99ab427788bd081ba681e",
|
|
52
|
+
"size": 57558450
|
|
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.
|
|
3
|
+
"version": "0.3.206",
|
|
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.206",
|
|
61
|
+
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.206",
|
|
62
|
+
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.206",
|
|
63
|
+
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.206",
|
|
64
|
+
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.206",
|
|
65
|
+
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.206",
|
|
66
|
+
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.206",
|
|
67
|
+
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.206"
|
|
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.206"
|
|
84
84
|
}
|
package/sdk-tools.d.ts
CHANGED
|
@@ -3407,6 +3407,10 @@ export interface ScheduleWakeupOutput {
|
|
|
3407
3407
|
* True when the model ended the loop via `stop: true`
|
|
3408
3408
|
*/
|
|
3409
3409
|
stopped?: boolean;
|
|
3410
|
+
/**
|
|
3411
|
+
* How many pending dynamic-loop wakeups stop:true cancelled. 0 means nothing was pending — a recurring /loop cron is not cancelled by stop:true.
|
|
3412
|
+
*/
|
|
3413
|
+
cancelledWakeups?: number;
|
|
3410
3414
|
}
|
|
3411
3415
|
export interface MonitorOutput {
|
|
3412
3416
|
/**
|
package/sdk.d.ts
CHANGED
|
@@ -3413,15 +3413,53 @@ declare type SDKControlListModelsRequest = {
|
|
|
3413
3413
|
};
|
|
3414
3414
|
|
|
3415
3415
|
/**
|
|
3416
|
-
* Invokes an MCP tool via the subprocess MCP client without a model turn. No permission check (control channel is trusted, same as other subtypes). SDK-type MCP servers (config.type === "sdk") are rejected — they are caller-provided, so the caller can invoke them directly without the subprocess round-trip. Result content passes through the same processing as model-turn MCP calls. Session expiry is not retried automatically; callers can mcp_reconnect and retry. UrlElicitationRequired (-32042) tries Elicitation hooks; if no hook resolves, the call errors with the URL in the message — open it out-of-band, then retry mcp_call.
|
|
3416
|
+
* Invokes an MCP tool via the subprocess MCP client without a model turn. No permission check (control channel is trusted, same as other subtypes). SDK-type MCP servers (config.type === "sdk") are rejected — they are caller-provided, so the caller can invoke them directly without the subprocess round-trip. Result content passes through the same processing as model-turn MCP calls. Session expiry is not retried automatically; callers can mcp_reconnect and retry. UrlElicitationRequired (-32042) tries Elicitation hooks; if no hook resolves, the call errors with the URL in the message — open it out-of-band, then retry mcp_call. STAGED calls (input_files/output_files declared) additionally stage lane rows in/out around the call — see the input_files describe. Staged failures come back as a success-subtype response whose staging field carries a typed error_code; subtype:error is emitted only when the call could not be attempted at all (server not connected, kill switch, dispatch failure) and means nothing ran. Standard RPC semantics: a redelivered request_id supersedes the in-flight run (it is aborted and its response suppressed — exactly one response per request_id); conversion is idempotent, so re-running is safe. Cancellable via control_cancel_request.
|
|
3417
3417
|
*/
|
|
3418
3418
|
declare type SDKControlMcpCallRequest = {
|
|
3419
3419
|
subtype: 'mcp_call';
|
|
3420
3420
|
/**
|
|
3421
|
-
* Fully-qualified MCP tool name, e.g. mcp__server__tool_name.
|
|
3421
|
+
* Fully-qualified MCP tool name, e.g. mcp__server__tool_name. Plugin-hosted servers are ordinary MCP servers here — e.g. mcp__plugin_documents_docs__doc_export (server names are normalized: non-[a-zA-Z0-9_-] becomes _).
|
|
3422
3422
|
*/
|
|
3423
3423
|
tool: string;
|
|
3424
|
+
/**
|
|
3425
|
+
* Tool arguments. When input_files/output_files are declared, any string VALUE that exactly equals "{{in:NAME}}" or "{{out:NAME}}" (whole string, not a substring) is replaced with the worker-chosen absolute path of that named staged file before the call; a token naming no declared file fails the request with staging error_code=tool_error, and every declared output's "{{out:NAME}}" token must appear in arguments (the substituted path is the only way the tool learns where to write, so an unreferenced output fails the request before the tool runs). With no files declared — including expires_at/timeout_ms-only staged calls — passed through unchanged.
|
|
3426
|
+
*/
|
|
3424
3427
|
arguments?: Record<string, unknown>;
|
|
3428
|
+
/**
|
|
3429
|
+
* RFC3339 deadline, REQUIRED when output_files are declared (a stale buffered drain must not overwrite rows written since). Sending expires_at routes the call through the staging engine, same as timeout_ms — the response gains a staging result. UNDELIVERED requests buffer durably and drain after reattach; a drain past this instant is dropped with staging error_code=expired instead of executing stale. Once delivered to a live worker the request is acked immediately and never redelivered — a worker killed mid-run surfaces as a missing response (apply your own deadline), not a later drain. An unparseable value is treated as already expired (fail closed).
|
|
3430
|
+
*/
|
|
3431
|
+
expires_at?: string;
|
|
3432
|
+
/**
|
|
3433
|
+
* Tool-execution timeout (staging and collection have their own transport timeouts). Clamped to [1000, 600000]; default 120000. Sending timeout_ms routes the call through the staging engine — so it is always enforced when present and the response carries a staging result; omit it for a plain call. Staged calls are POSIX-worker-only: on a Windows worker any staged-field call fails with a typed staging refusal.
|
|
3434
|
+
*/
|
|
3435
|
+
timeout_ms?: number;
|
|
3436
|
+
/**
|
|
3437
|
+
* Declaring input_files or output_files makes this a STAGED call: rows are fetched from the synced-file lane into a private per-request temp dir the WORKER chooses (random, per-UID — the caller never sees or computes paths; it references files via tokens in arguments), the tool runs, and declared outputs are written back as lane rows (durable-at-ack PUT). The response then carries a `staging` result the caller switches on.
|
|
3438
|
+
*/
|
|
3439
|
+
input_files?: {
|
|
3440
|
+
/**
|
|
3441
|
+
* Handle referenced from arguments as "{{in:NAME}}". Unique within the request.
|
|
3442
|
+
*/
|
|
3443
|
+
name: string;
|
|
3444
|
+
/**
|
|
3445
|
+
* Synced-file lane row to stage, e.g. /working/.cowork/originals/a.docx. A missing row fails with staging error_code=input_missing; the etag actually staged is echoed back in staging.inputs_used.
|
|
3446
|
+
*/
|
|
3447
|
+
lane_path: string;
|
|
3448
|
+
}[];
|
|
3449
|
+
output_files?: {
|
|
3450
|
+
/**
|
|
3451
|
+
* Handle referenced from arguments as "{{out:NAME}}" — the tool is told (via the substituted path) where to write; the worker collects from exactly that path. Unique within the request.
|
|
3452
|
+
*/
|
|
3453
|
+
name: string;
|
|
3454
|
+
/**
|
|
3455
|
+
* Synced-file lane row to write, e.g. /working/report.cd. Unique within the request (two outputs on one row would self-conflict under CAS). Outputs over the 25 MiB lane cap fail with staging error_code=output_too_large.
|
|
3456
|
+
*/
|
|
3457
|
+
lane_path: string;
|
|
3458
|
+
/**
|
|
3459
|
+
* Opaque lane etag the output row must still carry for the write to land (CAS). Omitted = unconditional last-writer-wins (an empty string is rejected, not treated as unconditional). A row that moved since fails that output with staging error_code=output_conflict and the requested bytes are not written. Redelivery of a completed CAS write re-runs and conflicts with its own prior write — treat output_conflict on a retry as possible-prior-success and reconcile by etag.
|
|
3460
|
+
*/
|
|
3461
|
+
if_match?: string;
|
|
3462
|
+
}[];
|
|
3425
3463
|
};
|
|
3426
3464
|
|
|
3427
3465
|
/**
|
|
@@ -3956,7 +3994,7 @@ export declare type SDKModelRefusalFallbackMessage = {
|
|
|
3956
3994
|
};
|
|
3957
3995
|
|
|
3958
3996
|
/**
|
|
3959
|
-
* Emitted when the model ends the stream with stop_reason "refusal" and no fallback model is configured,
|
|
3997
|
+
* Emitted when the model ends the stream with stop_reason "refusal" and no retry runs: no fallback model is configured, or per-category routing declined the retry (the refusal category has no fallback map entry). The structured counterpart to detecting stop_reason "refusal" on the assistant error frame. Not emitted when the retry ran or the user declined the retry dialog (model_refusal_fallback covers the retry case). Absent from older CLIs.
|
|
3960
3998
|
*/
|
|
3961
3999
|
export declare type SDKModelRefusalNoFallbackMessage = {
|
|
3962
4000
|
type: 'system';
|
|
@@ -6665,9 +6703,9 @@ export declare type TeammateIdleHookInput = BaseHookInput & {
|
|
|
6665
6703
|
};
|
|
6666
6704
|
|
|
6667
6705
|
/**
|
|
6668
|
-
* Why the query loop terminated. Unset when the loop was bypassed (local slash command)
|
|
6706
|
+
* Why the query loop terminated. Unset when the loop was bypassed (local slash command).
|
|
6669
6707
|
*/
|
|
6670
|
-
export declare type TerminalReason = 'blocking_limit' | 'rapid_refill_breaker' | 'prompt_too_long' | 'image_error' | 'model_error' | 'aborted_streaming' | 'aborted_tools' | 'stop_hook_prevented' | 'hook_stopped' | 'tool_deferred' | 'max_turns' | 'background_requested' | 'completed';
|
|
6708
|
+
export declare type TerminalReason = 'blocking_limit' | 'rapid_refill_breaker' | 'prompt_too_long' | 'image_error' | 'model_error' | 'api_error' | 'malformed_tool_use_exhausted' | 'aborted_streaming' | 'aborted_tools' | 'stop_hook_prevented' | 'hook_stopped' | 'tool_deferred' | 'max_turns' | 'background_requested' | 'completed' | 'budget_exhausted' | 'structured_output_retry_exhausted' | 'tool_deferred_unavailable' | 'turn_setup_failed';
|
|
6671
6709
|
|
|
6672
6710
|
/**
|
|
6673
6711
|
* Claude decides when and how much to think (Opus 4.6+).
|