@anthropic-ai/claude-agent-sdk 0.2.91 → 0.2.94

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.
@@ -13,8 +13,8 @@ import {
13
13
  renameSync,
14
14
  writeFileSync,
15
15
  } from 'fs'
16
- import { tmpdir } from 'os'
17
16
  import { join } from 'path'
17
+ import { tmpdir } from './tempfile.js'
18
18
 
19
19
  /**
20
20
  * If `embeddedPath` is inside Bun's $bunfs virtual filesystem, extract it to a
package/manifest.json CHANGED
@@ -1,46 +1,46 @@
1
1
  {
2
- "version": "2.1.91",
3
- "buildDate": "2026-04-02T22:04:30Z",
2
+ "version": "2.1.94",
3
+ "buildDate": "2026-04-07T20:31:15Z",
4
4
  "platforms": {
5
5
  "darwin-arm64": {
6
6
  "binary": "claude",
7
- "checksum": "7433d76d3ec5d223a340e21d7a05f3d481d89999f228113168ad5d64c66fd376",
8
- "size": 198092944
7
+ "checksum": "cf1c5db5e87610eca1e8f06dc2b2a2a9c0c04c179c55c7e1fcdfc9a2c014b31c",
8
+ "size": 199397456
9
9
  },
10
10
  "darwin-x64": {
11
11
  "binary": "claude",
12
- "checksum": "47409dc476c199711d5c776cf359773f75cb9dc72ce7494a4e4cb100520e8ab4",
13
- "size": 199574608
12
+ "checksum": "e3d29d0febf982112e977b7d732adf3167f229521c8697e5253c90a6d2d4a332",
13
+ "size": 200870864
14
14
  },
15
15
  "linux-arm64": {
16
16
  "binary": "claude",
17
- "checksum": "dddba100b352ea6d06aa7e036d5afe49749edddd1309a4aa22e47049fafcadf9",
18
- "size": 230427200
17
+ "checksum": "b3524791b50b314b17dac9978cb9568fa2e11a46562ae6f798d0dac453a0604a",
18
+ "size": 231672384
19
19
  },
20
20
  "linux-x64": {
21
21
  "binary": "claude",
22
- "checksum": "01b74e1b02e3330940b3526d2f6e00bf32f7fd9e6b3861be6a61e01cfd7296e6",
23
- "size": 230161024
22
+ "checksum": "7cbc939cb52e09d49fd82092061543d21100b04c321e19fecf06f087dc908667",
23
+ "size": 231434880
24
24
  },
25
25
  "linux-arm64-musl": {
26
26
  "binary": "claude",
27
- "checksum": "3dcaacefb510f6aee3573d35fe65f5dccbbbf4b6fdcca9a5a5455c03556a2f8b",
28
- "size": 223480256
27
+ "checksum": "2ab810a4cecec5ca1d141cadd132afdfc4b49d214156e83d9317c69d1688dd73",
28
+ "size": 224790976
29
29
  },
30
30
  "linux-x64-musl": {
31
31
  "binary": "claude",
32
- "checksum": "b05d9447b7d9a4fa92f936b2275ca87db3bada52d8589bf4e4c49d437366942a",
33
- "size": 224459200
32
+ "checksum": "a841044e81d09b03b844cf231037430416befdc5e50c74df7d71d72c362db542",
33
+ "size": 225749440
34
34
  },
35
35
  "win32-x64": {
36
36
  "binary": "claude.exe",
37
- "checksum": "12f69849f6774749718520f41fb94f6fc30779b55d8f9b0acaaf20c755e6b55d",
38
- "size": 239873184
37
+ "checksum": "08d0a5abf80510f1539d242214fdfe16f8b40866875f4ab44e8a5f86f2409aa4",
38
+ "size": 241112736
39
39
  },
40
40
  "win32-arm64": {
41
41
  "binary": "claude.exe",
42
- "checksum": "389de7f1f2b979cb4098f7752ca0099275cedabcfe3908a9886d143ef594972b",
43
- "size": 236586144
42
+ "checksum": "1bc64b539ab98661305ffffe17a005d86d895da8be4de45895f371096d078ab2",
43
+ "size": 237823136
44
44
  }
45
45
  }
46
46
  }
package/manifest.zst.json CHANGED
@@ -1,54 +1,54 @@
1
1
  {
2
- "version": "2.1.91",
3
- "buildDate": "2026-04-02T22:04:31Z",
2
+ "version": "2.1.94",
3
+ "buildDate": "2026-04-07T20:31:16Z",
4
4
  "platforms": {
5
5
  "darwin-arm64": {
6
6
  "binary": "claude.zst",
7
- "checksum": "3cbce93101acbf4af55025efc443ed38c3605e48d67b93eff79e8feaeb646ee6",
8
- "size": 40979083,
7
+ "checksum": "369163ad5c903eec187d12b208275c0cc034b932efe124dbfa64d0703d07441d",
8
+ "size": 41242270,
9
9
  "bundle": {
10
- "checksum": "67979609f28865b77c37a57da948d352f23013afe261c3e06668e28f8957f21c",
11
- "size": 40975507
10
+ "checksum": "1540988376cc72774eb0f5b5451ddcdf2053794459c9ba6301c44e38e0a0cc48",
11
+ "size": 41246676
12
12
  }
13
13
  },
14
14
  "darwin-x64": {
15
15
  "binary": "claude.zst",
16
- "checksum": "f14816b97af313694ee025a9398e184b5c10b1f83e4b95279c4e9c7e9852650c",
17
- "size": 42669756,
16
+ "checksum": "8255afacbf9d4d62d14aa8bafdab697a4e8e1458cbb4c6dc81e9533244d8f681",
17
+ "size": 42927007,
18
18
  "bundle": {
19
- "checksum": "04b781dd2d84c67f399d93d6430b58757f8b71bbc2548ea6117c6b246cf98436",
20
- "size": 42671616
19
+ "checksum": "5fbe707fd6b751ceebc1a8b8a51b42d8c94e9351abe498c8beff15eaa2384dbf",
20
+ "size": 42916836
21
21
  }
22
22
  },
23
23
  "linux-arm64": {
24
24
  "binary": "claude.zst",
25
- "checksum": "787c1311934930180f0b4f06dc879c9727cfb12e350f879a62b5d38fc93a0576",
26
- "size": 50673837
25
+ "checksum": "15a44c976954008731f8156fc558fd65a4e589ba1a742e6e7b1270c291fd6c79",
26
+ "size": 50915013
27
27
  },
28
28
  "linux-x64": {
29
29
  "binary": "claude.zst",
30
- "checksum": "3fe7f8bd1ec9318d90e497fee3c8a9d24390f70efe199cee6b2853b3f4f4b388",
31
- "size": 51210881
30
+ "checksum": "efd242158c50d2aee32c95ed17777a5ce83b56988b0cc4884252dad9e1e0067d",
31
+ "size": 51482748
32
32
  },
33
33
  "linux-arm64-musl": {
34
34
  "binary": "claude.zst",
35
- "checksum": "28a3bd81a6025594397a6defd32aaab09add5d8113e170bd8b8189a019471776",
36
- "size": 49318919
35
+ "checksum": "fd8dc9488d570826dccbfbac2546ea3e2e2568b473e9db2e1dee2704400ab1d8",
36
+ "size": 49578715
37
37
  },
38
38
  "linux-x64-musl": {
39
39
  "binary": "claude.zst",
40
- "checksum": "67a921d74c572f2b673209c3eae8a54c73844a496b719f7ad413427c679e6097",
41
- "size": 49931358
40
+ "checksum": "beabe8b9f2108752964f616ff6395e9c0e9576d067c19b3dc64ed1639b80fec4",
41
+ "size": 50143733
42
42
  },
43
43
  "win32-x64": {
44
44
  "binary": "claude.exe.zst",
45
- "checksum": "fcafda7aa8e8d1b29fd188698d4919d99213fbe3a39561679292d5a3e797b480",
46
- "size": 52880797
45
+ "checksum": "98e3585e5b9b9d7c41ac1f0a22f77e9b0f53da4f06d45d5269939173e30e2d0d",
46
+ "size": 53117708
47
47
  },
48
48
  "win32-arm64": {
49
49
  "binary": "claude.exe.zst",
50
- "checksum": "88af689a81ddb34cdda26be335350afec720de6e41b87180c94ebaaf07059793",
51
- "size": 51050547
50
+ "checksum": "6312426659d67d5d770101aa1346c53618af702e5848be2751405ab16a5304a7",
51
+ "size": 51266876
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.91",
3
+ "version": "0.2.94",
4
4
  "main": "sdk.mjs",
5
5
  "types": "sdk.d.ts",
6
6
  "exports": {
@@ -20,6 +20,10 @@
20
20
  "types": "./bridge.d.ts",
21
21
  "default": "./bridge.mjs"
22
22
  },
23
+ "./assistant": {
24
+ "types": "./assistant.d.ts",
25
+ "default": "./assistant.mjs"
26
+ },
23
27
  "./sdk-tools": {
24
28
  "types": "./sdk-tools.d.ts"
25
29
  },
@@ -73,6 +77,8 @@
73
77
  "agentSdkTypes.d.ts",
74
78
  "bridge.mjs",
75
79
  "bridge.d.ts",
80
+ "assistant.mjs",
81
+ "assistant.d.ts",
76
82
  "browser-sdk.js",
77
83
  "browser-sdk.d.ts",
78
84
  "embed.js",
@@ -84,5 +90,5 @@
84
90
  "vendor/ripgrep/",
85
91
  "vendor/audio-capture/"
86
92
  ],
87
- "claudeCodeVersion": "2.1.91"
93
+ "claudeCodeVersion": "2.1.94"
88
94
  }
package/sdk.d.ts CHANGED
@@ -29,7 +29,7 @@ export declare type AccountInfo = {
29
29
  /**
30
30
  * Active API backend. Anthropic OAuth login only applies when "firstParty"; for 3P providers the other fields are absent and auth is external (AWS creds, gcloud ADC, etc.).
31
31
  */
32
- apiProvider?: 'firstParty' | 'bedrock' | 'vertex' | 'foundry' | 'anthropicAws';
32
+ apiProvider?: 'firstParty' | 'bedrock' | 'vertex' | 'foundry' | 'anthropicAws' | 'mantle';
33
33
  };
34
34
 
35
35
  /**
@@ -198,6 +198,56 @@ export declare type ConfigChangeHookInput = BaseHookInput & {
198
198
  */
199
199
  export declare type ConfigScope = 'local' | 'user' | 'project';
200
200
 
201
+ /**
202
+ * Structured failure from connectRemoteControl.
203
+ * @alpha
204
+ */
205
+ export declare type ConnectRemoteControlError = {
206
+ kind: 'conflict' | 'auth' | 'network' | 'unknown';
207
+ detail: string;
208
+ };
209
+
210
+ /**
211
+ * Options for connectRemoteControl.
212
+ * @alpha
213
+ */
214
+ export declare type ConnectRemoteControlOptions = {
215
+ dir: string;
216
+ /** Override directory sent to backend for env registration. */
217
+ registrationDir?: string;
218
+ name?: string;
219
+ workerType?: string;
220
+ branch?: string;
221
+ gitRepoUrl?: string | null;
222
+ getAccessToken: () => string | undefined;
223
+ baseUrl: string;
224
+ orgUUID: string;
225
+ model: string;
226
+ /** Reuse env+session across restarts (reads bridge-pointer.json). */
227
+ perpetual?: boolean;
228
+ /** SSE high-water mark so reconnect sends from_sequence_num. */
229
+ initialSSESequenceNum?: number;
230
+ /** Called on 401; return true after refreshing token to retry. */
231
+ onAuth401?: (staleAccessToken: string) => Promise<boolean>;
232
+ /** Called on 409 conflict; return 'takeover' to deregister + retry. */
233
+ onConflict?: (detail: {
234
+ machineName: string;
235
+ message: string;
236
+ }) => Promise<'takeover' | 'abort'>;
237
+ };
238
+
239
+ /**
240
+ * Discriminated result from connectRemoteControl.
241
+ * @alpha
242
+ */
243
+ export declare type ConnectRemoteControlResult = {
244
+ ok: true;
245
+ handle: RemoteControlHandle;
246
+ } | {
247
+ ok: false;
248
+ error: ConnectRemoteControlError;
249
+ };
250
+
201
251
  declare type ControlErrorResponse = {
202
252
  subtype: 'error';
203
253
  request_id: string;
@@ -307,6 +357,7 @@ declare namespace coreTypes {
307
357
  SDKResultSuccess,
308
358
  SDKSessionInfo,
309
359
  SDKSessionStateChangedMessage,
360
+ SDKSettingsParseError,
310
361
  SDKStatusMessage,
311
362
  SDKStatus,
312
363
  SDKSystemMessage,
@@ -421,6 +472,12 @@ export declare type ElicitationRequest = {
421
472
  elicitationId?: string;
422
473
  /** JSON Schema for the requested input (only for 'form' mode) */
423
474
  requestedSchema?: Record<string, unknown>;
475
+ /** Permission-display title from MCP `_meta['anthropic/permissionDisplay']` — header for elicitation-driven permission prompts */
476
+ title?: string;
477
+ /** Short tool/server label from MCP `_meta['anthropic/permissionDisplay'].displayName` */
478
+ displayName?: string;
479
+ /** Permission-display subtitle from MCP `_meta['anthropic/permissionDisplay'].description` */
480
+ description?: string;
424
481
  };
425
482
 
426
483
  /**
@@ -609,6 +666,15 @@ export declare type HookJSONOutput = AsyncHookJSONOutput | SyncHookJSONOutput;
609
666
 
610
667
  export declare type HookPermissionDecision = 'allow' | 'deny' | 'ask' | 'defer';
611
668
 
669
+ /**
670
+ * A user message typed on claude.ai, extracted from the bridge WS.
671
+ * @alpha
672
+ */
673
+ export declare type InboundPrompt = {
674
+ content: string | unknown[];
675
+ uuid?: string;
676
+ };
677
+
612
678
  export declare type InferShape<T extends AnyZodRawShape> = {
613
679
  [K in keyof T]: T[K] extends {
614
680
  _output: infer O;
@@ -1968,6 +2034,18 @@ declare type SDKControlElicitationRequest = {
1968
2034
  url?: string;
1969
2035
  elicitation_id?: string;
1970
2036
  requested_schema?: Record<string, unknown>;
2037
+ /**
2038
+ * 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`.
2039
+ */
2040
+ title?: string;
2041
+ /**
2042
+ * Short tool/server label from _meta['anthropic/permissionDisplay'].displayName. Mirrors can_use_tool.display_name.
2043
+ */
2044
+ display_name?: string;
2045
+ /**
2046
+ * Permission-display subtitle from _meta['anthropic/permissionDisplay'].description. Mirrors can_use_tool.description.
2047
+ */
2048
+ description?: string;
1971
2049
  };
1972
2050
 
1973
2051
  /**
@@ -2219,7 +2297,7 @@ declare type SDKControlRewindFilesRequest = {
2219
2297
  };
2220
2298
 
2221
2299
  /**
2222
- * Seeds the readFileState cache with a path+mtime entry. Use when a prior Read was removed from context (e.g. by snip) so Edit validation would fail despite the client having observed the Read. The mtime lets the CLI detect if the file changed since the seeded Read — same staleness check as the normal path.
2300
+ * Seeds the readFileState cache with a path+mtime entry. Use when a prior Read was removed from context so Edit validation would fail despite the client having observed the Read. The mtime lets the CLI detect if the file changed since the seeded Read — same staleness check as the normal path.
2223
2301
  */
2224
2302
  declare type SDKControlSeedReadStateRequest = {
2225
2303
  subtype: 'seed_read_state';
@@ -2629,6 +2707,24 @@ export declare type SDKSessionStateChangedMessage = {
2629
2707
  session_id: string;
2630
2708
  };
2631
2709
 
2710
+ /**
2711
+ * A settings file parse or validation error. When a settings.json file fails to parse (invalid JSON, JSON comments, schema mismatch), the file is skipped and any rules it contained — including permission allow/deny lists — are not applied.
2712
+ */
2713
+ export declare type SDKSettingsParseError = {
2714
+ /**
2715
+ * Path to the settings file that failed to parse or validate.
2716
+ */
2717
+ file?: string;
2718
+ /**
2719
+ * Dot-notation path to the field with the error, or empty string for whole-file errors.
2720
+ */
2721
+ path: string;
2722
+ /**
2723
+ * Human-readable error message.
2724
+ */
2725
+ message: string;
2726
+ };
2727
+
2632
2728
  export declare type SDKStatus = 'compacting' | null;
2633
2729
 
2634
2730
  export declare type SDKStatusMessage = {
@@ -3790,6 +3886,10 @@ export declare interface Settings {
3790
3886
  * Organization UUID to require for OAuth login. Accepts a single UUID string or an array of UUIDs (any one is permitted). When set in managed settings, login fails if the authenticated account does not belong to a listed organization.
3791
3887
  */
3792
3888
  forceLoginOrgUUID?: string | string[];
3889
+ /**
3890
+ * When set in managed settings, the CLI blocks startup until remote managed settings are freshly fetched, and exits if the fetch fails
3891
+ */
3892
+ forceRemoteSettingsRefresh?: boolean;
3793
3893
  /**
3794
3894
  * Path to a script that outputs OpenTelemetry headers
3795
3895
  */
@@ -3987,6 +4087,16 @@ export declare interface Settings {
3987
4087
  * Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/
3988
4088
  */
3989
4089
  plansDirectory?: string;
4090
+ /**
4091
+ * Autonomous background operation configuration
4092
+ */
4093
+ proactive?: {
4094
+ /**
4095
+ * When true, autonomous background operation is activated automatically at launch (if entitled). When false or null, the user must opt in via the /proactive command or --proactive flag. Existing entitlement gates (GrowthBook flag, ZDR, managed-settings) still apply.
4096
+ */
4097
+ autoEnable?: boolean | null;
4098
+ };
4099
+
3990
4100
  /**
3991
4101
  * Teams/Enterprise opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). Default off. Set true to allow; users then select servers via --channels.
3992
4102
  */
@@ -4176,6 +4286,8 @@ export declare type StopHookInput = BaseHookInput & {
4176
4286
  * Text content of the last assistant message before stopping. Avoids the need to read and parse the transcript file.
4177
4287
  */
4178
4288
  last_assistant_message?: string;
4289
+
4290
+
4179
4291
  };
4180
4292
 
4181
4293
  export declare type SubagentStartHookInput = BaseHookInput & {
@@ -4199,6 +4311,8 @@ export declare type SubagentStopHookInput = BaseHookInput & {
4199
4311
  * Text content of the last assistant message before stopping. Avoids the need to read and parse the transcript file.
4200
4312
  */
4201
4313
  last_assistant_message?: string;
4314
+
4315
+
4202
4316
  };
4203
4317
 
4204
4318
  export declare type SyncHookJSONOutput = {
@@ -4254,6 +4368,7 @@ export declare type TerminalReason = 'blocking_limit' | 'rapid_refill_breaker' |
4254
4368
  */
4255
4369
  export declare type ThinkingAdaptive = {
4256
4370
  type: 'adaptive';
4371
+ display?: 'summarized' | 'omitted';
4257
4372
  };
4258
4373
 
4259
4374
  /**
@@ -4274,6 +4389,7 @@ export declare type ThinkingDisabled = {
4274
4389
  export declare type ThinkingEnabled = {
4275
4390
  type: 'enabled';
4276
4391
  budgetTokens?: number;
4392
+ display?: 'summarized' | 'omitted';
4277
4393
  };
4278
4394
 
4279
4395
  export declare function tool<Schema extends AnyZodRawShape>(_name: string, _description: string, _inputSchema: Schema, _handler: (args: InferShape<Schema>, extra: unknown) => Promise<CallToolResult>, _extras?: {
@@ -4363,11 +4479,13 @@ export declare function unstable_v2_resumeSession(_sessionId: string, _options:
4363
4479
  export declare type UserPromptSubmitHookInput = BaseHookInput & {
4364
4480
  hook_event_name: 'UserPromptSubmit';
4365
4481
  prompt: string;
4482
+ session_title?: string;
4366
4483
  };
4367
4484
 
4368
4485
  export declare type UserPromptSubmitHookSpecificOutput = {
4369
4486
  hookEventName: 'UserPromptSubmit';
4370
4487
  additionalContext?: string;
4488
+ sessionTitle?: string;
4371
4489
  };
4372
4490
 
4373
4491
  export declare type WorktreeCreateHookInput = BaseHookInput & {