@anthropic-ai/claude-agent-sdk 0.2.20 → 0.2.22

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.
Files changed (5) hide show
  1. package/cli.js +1545 -1515
  2. package/package.json +2 -2
  3. package/sdk-tools.d.ts +5 -1
  4. package/sdk.d.ts +46 -1
  5. package/sdk.mjs +16 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anthropic-ai/claude-agent-sdk",
3
- "version": "0.2.20",
3
+ "version": "0.2.22",
4
4
  "main": "sdk.mjs",
5
5
  "types": "sdk.d.ts",
6
6
  "engines": {
@@ -37,5 +37,5 @@
37
37
  "@img/sharp-linuxmusl-x64": "^0.33.5",
38
38
  "@img/sharp-win32-x64": "^0.33.5"
39
39
  },
40
- "claudeCodeVersion": "2.1.20"
40
+ "claudeCodeVersion": "2.1.22"
41
41
  }
package/sdk-tools.d.ts CHANGED
@@ -242,9 +242,13 @@ export interface GrepInput {
242
242
  */
243
243
  "-A"?: number;
244
244
  /**
245
- * Number of lines to show before and after each match (rg -C). Requires output_mode: "content", ignored otherwise.
245
+ * Alias for context.
246
246
  */
247
247
  "-C"?: number;
248
+ /**
249
+ * Number of lines to show before and after each match (rg -C). Requires output_mode: "content", ignored otherwise.
250
+ */
251
+ context?: number;
248
252
  /**
249
253
  * Show line numbers in output (rg -n). Requires output_mode: "content", ignored otherwise. Defaults to true.
250
254
  */
package/sdk.d.ts CHANGED
@@ -158,10 +158,12 @@ declare namespace coreTypes {
158
158
  HookInput,
159
159
  HookJSONOutput,
160
160
  JsonSchemaOutputFormat,
161
+ McpClaudeAIProxyServerConfig,
161
162
  McpHttpServerConfig,
162
163
  McpSSEServerConfig,
163
164
  McpSdkServerConfig,
164
165
  McpServerConfigForProcessTransport,
166
+ McpServerStatusConfig,
165
167
  McpServerStatus,
166
168
  McpSetServersResult,
167
169
  McpStdioServerConfig,
@@ -281,6 +283,12 @@ export declare type JsonSchemaOutputFormat = {
281
283
  schema: Record<string, unknown>;
282
284
  };
283
285
 
286
+ export declare type McpClaudeAIProxyServerConfig = {
287
+ type: 'claudeai-proxy';
288
+ url: string;
289
+ id: string;
290
+ };
291
+
284
292
  export declare type McpHttpServerConfig = {
285
293
  type: 'http';
286
294
  url: string;
@@ -318,7 +326,7 @@ export declare type McpServerStatus = {
318
326
  /**
319
327
  * Current connection status
320
328
  */
321
- status: 'connected' | 'failed' | 'needs-auth' | 'pending';
329
+ status: 'connected' | 'failed' | 'needs-auth' | 'pending' | 'disabled';
322
330
  /**
323
331
  * Server information (available when connected)
324
332
  */
@@ -330,8 +338,30 @@ export declare type McpServerStatus = {
330
338
  * Error message (available when status is 'failed')
331
339
  */
332
340
  error?: string;
341
+ /**
342
+ * Server configuration (includes URL for HTTP/SSE servers)
343
+ */
344
+ config?: McpServerStatusConfig;
345
+ /**
346
+ * Configuration scope (e.g., project, user, local, claudeai, managed)
347
+ */
348
+ scope?: string;
349
+ /**
350
+ * Tools provided by this server (available when connected)
351
+ */
352
+ tools?: {
353
+ name: string;
354
+ description?: string;
355
+ annotations?: {
356
+ readOnly?: boolean;
357
+ destructive?: boolean;
358
+ openWorld?: boolean;
359
+ };
360
+ }[];
333
361
  };
334
362
 
363
+ export declare type McpServerStatusConfig = McpServerConfigForProcessTransport | McpClaudeAIProxyServerConfig;
364
+
335
365
  /**
336
366
  * Result of a setMcpServers operation.
337
367
  */
@@ -968,6 +998,21 @@ export declare interface Query extends AsyncGenerator<SDKMessage, void> {
968
998
  rewindFiles(userMessageId: string, options?: {
969
999
  dryRun?: boolean;
970
1000
  }): Promise<RewindFilesResult>;
1001
+ /**
1002
+ * Reconnect an MCP server by name.
1003
+ * Throws on failure.
1004
+ *
1005
+ * @param serverName - The name of the MCP server to reconnect
1006
+ */
1007
+ reconnectMcpServer(serverName: string): Promise<void>;
1008
+ /**
1009
+ * Enable or disable an MCP server by name.
1010
+ * Throws on failure.
1011
+ *
1012
+ * @param serverName - The name of the MCP server to toggle
1013
+ * @param enabled - Whether the server should be enabled
1014
+ */
1015
+ toggleMcpServer(serverName: string, enabled: boolean): Promise<void>;
971
1016
  /**
972
1017
  * Dynamically set the MCP servers for this session.
973
1018
  * This replaces the current set of dynamically-added MCP servers with the provided set.