@anthropic-ai/claude-agent-sdk 0.3.161 → 0.3.162

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/manifest.json CHANGED
@@ -1,47 +1,47 @@
1
1
  {
2
- "version": "2.1.161",
3
- "commit": "6a550aea7c747b1b0ddd8bb61dbe199c4ad41320",
4
- "buildDate": "2026-06-02T01:55:49Z",
2
+ "version": "2.1.162",
3
+ "commit": "9c0de1e1ecc1b4636e146d2df5dc663afd3c810c",
4
+ "buildDate": "2026-06-03T07:10:21Z",
5
5
  "platforms": {
6
6
  "darwin-arm64": {
7
7
  "binary": "claude",
8
- "checksum": "5b4dc79eab05f9756c252c71deb339efa4429dffc1967dd8392cf87fcde4867f",
9
- "size": 218040864
8
+ "checksum": "2d407dd2a63243ac900f64331589b9fcd29a2159a73289070af685f4085a17d2",
9
+ "size": 218602272
10
10
  },
11
11
  "darwin-x64": {
12
12
  "binary": "claude",
13
- "checksum": "6f874fecac8a951f5f1991dc1470bc85a5e24f2588859b89cca0f1b6b5592310",
14
- "size": 220555024
13
+ "checksum": "53f2749bf24e5a80b23b017d0877f61c9894a3c06222141515b37a94c6051d41",
14
+ "size": 221116432
15
15
  },
16
16
  "linux-arm64": {
17
17
  "binary": "claude",
18
- "checksum": "7dfa0a79a2fc9f332057cdc0302f808cba63df7b75e2ccb5a7c1ab62639804e3",
19
- "size": 243316360
18
+ "checksum": "eca2a603dfebc3426a8469cbe797f9df95245738bc1c20ec842fc8f80af4010d",
19
+ "size": 243906184
20
20
  },
21
21
  "linux-x64": {
22
22
  "binary": "claude",
23
- "checksum": "1f6a22f387a3bce496b6d869389a35dffb5a69c97d9831833f3bd6dc0e6c6c28",
24
- "size": 243439312
23
+ "checksum": "947a49b0de8688f6a74a6e753c24771ff3ddd17b2a6dae85f36304ec514e61d1",
24
+ "size": 244000464
25
25
  },
26
26
  "linux-arm64-musl": {
27
27
  "binary": "claude",
28
- "checksum": "8318d4039c60fbb21a53e81f93e46a3b1dcdb9b07462f6fee72d99c9d2b93f83",
29
- "size": 236171096
28
+ "checksum": "fb86f490f854dd36846771c38b80de7cbcc6804bca838a581eed2792cc58c445",
29
+ "size": 236760920
30
30
  },
31
31
  "linux-x64-musl": {
32
32
  "binary": "claude",
33
- "checksum": "f8e09e0b16502c277ca8a296245eb59f421e424763a99fd132551b701a713bcf",
34
- "size": 237833264
33
+ "checksum": "be80745855476f1f1b283e739b721a38952accaad4609d69736cde38095fdb78",
34
+ "size": 238394416
35
35
  },
36
36
  "win32-x64": {
37
37
  "binary": "claude.exe",
38
- "checksum": "3b0b64caf3428fac3751bd1903c350870b34f9e7a4390ac7c2fdb3a711656a04",
39
- "size": 239007904
38
+ "checksum": "ac4e1319f6ac0c9e04336d0ae5845acc5dd317bf9e6f26ca47e63df06d91f8bc",
39
+ "size": 239551648
40
40
  },
41
41
  "win32-arm64": {
42
42
  "binary": "claude.exe",
43
- "checksum": "f4a7d910fc5a8b46afc14c36108c46c8b0deeb8f316c6b7e4ede77868ce70acf",
44
- "size": 234972832
43
+ "checksum": "3e8c5c55b8c6d1348842e78d17d2eb41d5b30a8aaaae05a6f906360911a6936b",
44
+ "size": 235516576
45
45
  }
46
46
  }
47
47
  }
package/manifest.zst.json CHANGED
@@ -1,55 +1,55 @@
1
1
  {
2
- "version": "2.1.161",
3
- "commit": "6a550aea7c747b1b0ddd8bb61dbe199c4ad41320",
4
- "buildDate": "2026-06-02T02:02:00Z",
2
+ "version": "2.1.162",
3
+ "commit": "9c0de1e1ecc1b4636e146d2df5dc663afd3c810c",
4
+ "buildDate": "2026-06-03T07:12:09Z",
5
5
  "platforms": {
6
6
  "darwin-arm64": {
7
7
  "binary": "claude.zst",
8
- "checksum": "dbcf5e80cca576a2128e65625b1950f91d2b98bacfa6e939f597c75bd0b5602a",
9
- "size": 44863384,
8
+ "checksum": "8e053bf397765cd1dd50fd8e68ef40f9a42a62a589008eab8b42590e00f8df80",
9
+ "size": 44978781,
10
10
  "bundle": {
11
- "checksum": "ea3ad78ffc34f6700f489b3dd2a1e2e35c722d489ca54d62b63afcacb8911b5e",
12
- "size": 44871367
11
+ "checksum": "695847eb827c9257c2d403590424e78f83330822e1ebc3b16b96968e5a1100fa",
12
+ "size": 44976743
13
13
  }
14
14
  },
15
15
  "darwin-x64": {
16
16
  "binary": "claude.zst",
17
- "checksum": "227bcd6d41ed94d6ad6186fa9075f39aae9675ea480e47d5b09a9ea691a0a0a0",
18
- "size": 46783803,
17
+ "checksum": "b48f6331e003f761d6b658c12e13a1435714452e6f3c3f5c630cd1cbbe5adaf3",
18
+ "size": 46876164,
19
19
  "bundle": {
20
- "checksum": "baba937aa2b5f2fee497bbce09bb84f76fd5a076f49aebee32b46e771bbf9b10",
21
- "size": 46791947
20
+ "checksum": "17c0b3ee43e0c4dd28759e073d4f1b592cdd24a5918543ce255544e3d5970194",
21
+ "size": 46885327
22
22
  }
23
23
  },
24
24
  "linux-arm64": {
25
25
  "binary": "claude.zst",
26
- "checksum": "d46ca4ec38fe511d55357dedb9a437a6502627844370f0b548a124d6a1b436d0",
27
- "size": 52578824
26
+ "checksum": "601fe3241200ecdae03c8a6de235d34a2bb88984ac75794d621bee7497304c1d",
27
+ "size": 52651979
28
28
  },
29
29
  "linux-x64": {
30
30
  "binary": "claude.zst",
31
- "checksum": "65faa42998853bdff28b48f6857627335eb42dddb14c9b3d40fd769352d8f285",
32
- "size": 53186973
31
+ "checksum": "8af5e2f052793a18cc3448e308f018ad08183ddc580d2478a131ad0e323267d0",
32
+ "size": 53260193
33
33
  },
34
34
  "linux-arm64-musl": {
35
35
  "binary": "claude.zst",
36
- "checksum": "f08efd1c7dcb0af9fcf94c62401307263c8fb17a6ac376b9563b9add74ff0f25",
37
- "size": 51204872
36
+ "checksum": "eceb861978c15812379a4a595f0c0d77b25b2e629612e80253be872becc4db16",
37
+ "size": 51283192
38
38
  },
39
39
  "linux-x64-musl": {
40
40
  "binary": "claude.zst",
41
- "checksum": "277891cd44e6f35050bce322cc99e13753acdc2d5bb41664d6de9ccfaf161239",
42
- "size": 51901930
41
+ "checksum": "8ca6fa22c2245ac45b596e07215e391165622a671d7bfc995cb65dd208df0226",
42
+ "size": 51981254
43
43
  },
44
44
  "win32-x64": {
45
45
  "binary": "claude.exe.zst",
46
- "checksum": "7a53001a2a895dfd019ff275134e2cd4332ad21b3016e997c554775bb5737ab3",
47
- "size": 53917556
46
+ "checksum": "116068b7058d90423025411faa206d0a6c89155e1f9b07288052f882d3da00a9",
47
+ "size": 53982456
48
48
  },
49
49
  "win32-arm64": {
50
50
  "binary": "claude.exe.zst",
51
- "checksum": "47051d39f2d78603437d5cba03ef2885e9448d84160497b3d2890e7ada96a4ad",
52
- "size": 52194218
51
+ "checksum": "7c1c8b3d5a330a9e12b2f3ca4e2c3e0f308e7ccf0d5401dce1b1c09cc4ac941c",
52
+ "size": 52271058
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.161",
3
+ "version": "0.3.162",
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.161",
65
- "@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.161",
66
- "@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.161",
67
- "@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.161",
68
- "@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.161",
69
- "@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.161",
70
- "@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.161",
71
- "@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.161"
64
+ "@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.162",
65
+ "@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.162",
66
+ "@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.162",
67
+ "@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.162",
68
+ "@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.162",
69
+ "@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.162",
70
+ "@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.162",
71
+ "@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.162"
72
72
  },
73
73
  "files": [
74
74
  "sdk.mjs",
@@ -86,5 +86,5 @@
86
86
  "manifest.json",
87
87
  "manifest.zst.json"
88
88
  ],
89
- "claudeCodeVersion": "2.1.161"
89
+ "claudeCodeVersion": "2.1.162"
90
90
  }
package/sdk.d.ts CHANGED
@@ -1000,7 +1000,7 @@ export declare type McpClaudeAIProxyServerConfig = {
1000
1000
  url: string;
1001
1001
  id: string;
1002
1002
  /**
1003
- * Per-server tool-call timeout in milliseconds. Overrides the MCP_TOOL_TIMEOUT environment variable for this server. Hard wall-clock limit per call; progress notifications do not extend it. Floored at 1000ms.
1003
+ * Per-server tool-call timeout in milliseconds. Overrides the MCP_TOOL_TIMEOUT environment variable for this server. Hard wall-clock limit per call; progress notifications do not extend it. Values below 1000ms are ignored (falls through to MCP_TOOL_TIMEOUT or the default).
1004
1004
  */
1005
1005
  timeout?: number;
1006
1006
  };
@@ -1011,7 +1011,7 @@ export declare type McpHttpServerConfig = {
1011
1011
  headers?: Record<string, string>;
1012
1012
  tools?: McpServerToolPolicy[];
1013
1013
  /**
1014
- * Per-server tool-call timeout in milliseconds. Overrides the MCP_TOOL_TIMEOUT environment variable for this server. Hard wall-clock limit per call; progress notifications do not extend it. Floored at 1000ms.
1014
+ * Per-server tool-call timeout in milliseconds. Overrides the MCP_TOOL_TIMEOUT environment variable for this server. Hard wall-clock limit per call; progress notifications do not extend it. Values below 1000ms are ignored (falls through to MCP_TOOL_TIMEOUT or the default).
1015
1015
  */
1016
1016
  timeout?: number;
1017
1017
  /**
@@ -1121,7 +1121,7 @@ export declare type McpSSEServerConfig = {
1121
1121
  headers?: Record<string, string>;
1122
1122
  tools?: McpServerToolPolicy[];
1123
1123
  /**
1124
- * Per-server tool-call timeout in milliseconds. Overrides the MCP_TOOL_TIMEOUT environment variable for this server. Hard wall-clock limit per call; progress notifications do not extend it. Floored at 1000ms.
1124
+ * Per-server tool-call timeout in milliseconds. Overrides the MCP_TOOL_TIMEOUT environment variable for this server. Hard wall-clock limit per call; progress notifications do not extend it. Values below 1000ms are ignored (falls through to MCP_TOOL_TIMEOUT or the default).
1125
1125
  */
1126
1126
  timeout?: number;
1127
1127
  /**
@@ -1137,7 +1137,7 @@ export declare type McpStdioServerConfig = {
1137
1137
  args?: string[];
1138
1138
  env?: Record<string, string>;
1139
1139
  /**
1140
- * Per-server tool-call timeout in milliseconds. Overrides the MCP_TOOL_TIMEOUT environment variable for this server. Hard wall-clock limit per call; progress notifications do not extend it. Floored at 1000ms.
1140
+ * Per-server tool-call timeout in milliseconds. Overrides the MCP_TOOL_TIMEOUT environment variable for this server. Hard wall-clock limit per call; progress notifications do not extend it. Values below 1000ms are ignored (falls through to MCP_TOOL_TIMEOUT or the default).
1141
1141
  */
1142
1142
  timeout?: number;
1143
1143
  /**
@@ -1258,6 +1258,16 @@ export declare type OnElicitation = (request: ElicitationRequest, options: {
1258
1258
  signal: AbortSignal;
1259
1259
  }) => Promise<ElicitationResult>;
1260
1260
 
1261
+ /**
1262
+ * Callback for handling `request_user_dialog` control requests.
1263
+ * Called when the CLI asks the host to render a blocking dialog.
1264
+ * If not provided, dialogs are answered as cancelled and the CLI applies
1265
+ * each dialog's default behavior.
1266
+ */
1267
+ export declare type OnUserDialog = (request: UserDialogRequest, options: {
1268
+ signal: AbortSignal;
1269
+ }) => Promise<UserDialogResult>;
1270
+
1261
1271
  /**
1262
1272
  * Options for the query function.
1263
1273
  * Contains callbacks and other non-serializable fields.
@@ -1367,6 +1377,9 @@ export declare type Options = {
1367
1377
  * - `string[]` - Array of specific tool names (e.g., `['Bash', 'Read', 'Edit']`)
1368
1378
  * - `[]` (empty array) - Disable all built-in tools
1369
1379
  * - `{ type: 'preset'; preset: 'claude_code' }` - Use all default Claude Code tools
1380
+ *
1381
+ * Note: native builds may provide search via Bash `find`/`grep` instead of the
1382
+ * dedicated Grep/Glob tools. List Grep/Glob here or in `allowedTools` to get them.
1370
1383
  */
1371
1384
  tools?: string[] | {
1372
1385
  type: 'preset';
@@ -1480,6 +1493,16 @@ export declare type Options = {
1480
1493
  * ```
1481
1494
  */
1482
1495
  onElicitation?: OnElicitation;
1496
+ /**
1497
+ * Callback for handling `request_user_dialog` control requests — blocking
1498
+ * dialogs the CLI asks the host to render. Each `dialogKind` defines its
1499
+ * own payload and result shape.
1500
+ *
1501
+ * If not provided — or when the host answers `{behavior: 'cancelled'}`,
1502
+ * which is the required answer for an unrecognized `dialogKind` — the CLI
1503
+ * applies the dialog's default behavior.
1504
+ */
1505
+ onUserDialog?: OnUserDialog;
1483
1506
  /**
1484
1507
  * When false, disables session persistence to disk. Sessions will not be
1485
1508
  * saved to ~/.claude/projects/ and cannot be resumed later. Useful for
@@ -2935,6 +2958,7 @@ export declare type SDKControlInitializeResponse = {
2935
2958
  account: coreTypes.AccountInfo;
2936
2959
 
2937
2960
  fast_mode_state?: coreTypes.FastModeState;
2961
+
2938
2962
  };
2939
2963
 
2940
2964
  /**
@@ -3092,7 +3116,7 @@ declare type SDKControlRequestInner = SDKControlInterruptRequest | SDKControlPer
3092
3116
  declare type SDKControlRequestUserDialogRequest = {
3093
3117
  subtype: 'request_user_dialog';
3094
3118
  /**
3095
- * Identifier for the dialog the host should render. Open string union — known kinds include "it2_setup", "computer_use_approval", and "refusal_fallback_prompt"; new kinds may be added without bumping the protocol.
3119
+ * Identifier for the dialog the host should render. Open string union — new kinds may be added without bumping the protocol; hosts must answer unrecognized kinds with {behavior: "cancelled"}.
3096
3120
  */
3097
3121
  dialog_kind: string;
3098
3122
  /**
@@ -3506,6 +3530,8 @@ export declare type SDKResultSuccess = {
3506
3530
  duration_ms: number;
3507
3531
  duration_api_ms: number;
3508
3532
  ttft_ms?: number;
3533
+ time_to_request_ms?: number;
3534
+ time_to_request_from_spawn_ms?: number;
3509
3535
  is_error: boolean;
3510
3536
  api_error_status?: number | null;
3511
3537
  num_turns: number;
@@ -5176,9 +5202,10 @@ export declare interface Settings {
5176
5202
  */
5177
5203
  pluginSuggestionMarketplaces?: string[];
5178
5204
  /**
5179
- * Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing
5205
+ * Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing, "gateway" for the Cloud gateway OIDC device flow
5180
5206
  */
5181
- forceLoginMethod?: 'claudeai' | 'console';
5207
+ forceLoginMethod?: 'claudeai' | 'console' | 'gateway';
5208
+
5182
5209
  /**
5183
5210
  * Controls whether the SDK parent tier (Options.managedSettings / --managed-settings) layers under this admin tier. "first-wins" (default): parent is dropped — admin tiers are the only policy source. "merge": parent's restrictive-only-filtered settings union under the admin winner. Has no effect when no admin tier exists (parent applies as the sole policy tier, still filtered restrictive-only).
5184
5211
  */
@@ -5951,6 +5978,39 @@ export declare interface Transport {
5951
5978
  [Symbol.dispose]?(): void;
5952
5979
  }
5953
5980
 
5981
+ /**
5982
+ * A `request_user_dialog` control request from the CLI, asking the SDK
5983
+ * consumer to render a blocking dialog and return the user's choice.
5984
+ * Each `dialogKind` defines its own payload and result shape; the protocol
5985
+ * transports both opaquely.
5986
+ */
5987
+ export declare type UserDialogRequest = {
5988
+ /**
5989
+ * Identifier for the dialog the host should render. Open string union —
5990
+ * new kinds may be added without a protocol bump, so hosts must answer
5991
+ * unrecognized kinds with `{behavior: 'cancelled'}`.
5992
+ */
5993
+ dialogKind: string;
5994
+ /** Dialog-specific data for the host renderer; shape is defined per dialogKind. */
5995
+ payload: Record<string, unknown>;
5996
+ /**
5997
+ * Present when the dialog is tied to a specific tool invocation. Same
5998
+ * value as the `toolUseID` passed to `canUseTool`.
5999
+ */
6000
+ toolUseID?: string;
6001
+ };
6002
+
6003
+ /**
6004
+ * The host's answer to a {@link UserDialogRequest}. On `cancelled`, the CLI
6005
+ * applies the dialog's default behavior.
6006
+ */
6007
+ export declare type UserDialogResult = {
6008
+ behavior: 'completed';
6009
+ result: unknown;
6010
+ } | {
6011
+ behavior: 'cancelled';
6012
+ };
6013
+
5954
6014
  export declare type UserPromptExpansionHookInput = BaseHookInput & {
5955
6015
  hook_event_name: 'UserPromptExpansion';
5956
6016
  expansion_type: 'slash_command' | 'mcp_prompt';