@anthropic-ai/claude-code 1.0.85 → 1.0.87

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anthropic-ai/claude-code",
3
- "version": "1.0.85",
3
+ "version": "1.0.87",
4
4
  "main": "sdk.mjs",
5
5
  "types": "sdk.d.ts",
6
6
  "bin": {
package/sdk-tools.d.ts CHANGED
@@ -67,6 +67,10 @@ export interface BashInput {
67
67
  * Output: Creates directory 'foo'
68
68
  */
69
69
  description?: string;
70
+ /**
71
+ * Set to true to run this command in the background. Use BashOutput to read the output later.
72
+ */
73
+ run_in_background?: boolean;
70
74
  /**
71
75
  * whether to run this command in sandboxed mode: command run in this mode may not write to the filesystem or use the network, but they can read files, analyze data, and report back to you. When possible, run commands (e.g. grep) in this mode to present a smoother experience for the human, who isn't prompted to approve commands run in sandbox mode. If you run a command in sandbox mode and it looks like it fails because it needs write access after all, try again in non-sandbox mode
72
76
  */
@@ -299,7 +303,6 @@ export interface TodoWriteInput {
299
303
  todos: {
300
304
  content: string;
301
305
  status: "pending" | "in_progress" | "completed";
302
- id: string;
303
306
  }[];
304
307
  }
305
308
  export interface WebFetchInput {
package/sdk.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { Message as APIAssistantMessage, MessageParam as APIUserMessage, Usage } from '@anthropic-ai/sdk/resources/index.mjs';
2
+ import type { UUID } from 'crypto';
2
3
  export type NonNullableUsage = {
3
4
  [K in keyof Usage]: NonNullable<Usage[K]>;
4
5
  };
@@ -137,26 +138,37 @@ export type Options = {
137
138
  resume?: string;
138
139
  stderr?: (data: string) => void;
139
140
  strictMcpConfig?: boolean;
141
+ websocket?: {
142
+ url: string;
143
+ headers?: Record<string, string>;
144
+ };
140
145
  };
141
146
  export type PermissionMode = 'default' | 'acceptEdits' | 'bypassPermissions' | 'plan';
142
- export type SDKUserMessage = {
147
+ type SDKMessageBase = {
148
+ uuid: UUID;
149
+ session_id: string;
150
+ };
151
+ type SDKUserMessageContent = {
143
152
  type: 'user';
144
153
  message: APIUserMessage;
145
154
  parent_tool_use_id: string | null;
155
+ };
156
+ export type SDKUserMessage = SDKUserMessageContent & {
157
+ uuid?: UUID;
146
158
  session_id: string;
147
159
  };
148
- export type SDKAssistantMessage = {
160
+ export type SDKUserMessageReplay = SDKMessageBase & SDKUserMessageContent;
161
+ export type SDKAssistantMessage = SDKMessageBase & {
149
162
  type: 'assistant';
150
163
  message: APIAssistantMessage;
151
164
  parent_tool_use_id: string | null;
152
- session_id: string;
153
165
  };
154
166
  export type SDKPermissionDenial = {
155
167
  tool_name: string;
156
168
  tool_use_id: string;
157
169
  tool_input: Record<string, unknown>;
158
170
  };
159
- export type SDKResultMessage = {
171
+ export type SDKResultMessage = (SDKMessageBase & {
160
172
  type: 'result';
161
173
  subtype: 'success';
162
174
  duration_ms: number;
@@ -164,28 +176,25 @@ export type SDKResultMessage = {
164
176
  is_error: boolean;
165
177
  num_turns: number;
166
178
  result: string;
167
- session_id: string;
168
179
  total_cost_usd: number;
169
180
  usage: NonNullableUsage;
170
181
  permission_denials: SDKPermissionDenial[];
171
- } | {
182
+ }) | (SDKMessageBase & {
172
183
  type: 'result';
173
184
  subtype: 'error_max_turns' | 'error_during_execution';
174
185
  duration_ms: number;
175
186
  duration_api_ms: number;
176
187
  is_error: boolean;
177
188
  num_turns: number;
178
- session_id: string;
179
189
  total_cost_usd: number;
180
190
  usage: NonNullableUsage;
181
191
  permission_denials: SDKPermissionDenial[];
182
- };
183
- export type SDKSystemMessage = {
192
+ });
193
+ export type SDKSystemMessage = SDKMessageBase & {
184
194
  type: 'system';
185
195
  subtype: 'init';
186
196
  apiKeySource: ApiKeySource;
187
197
  cwd: string;
188
- session_id: string;
189
198
  tools: string[];
190
199
  mcp_servers: {
191
200
  name: string;
@@ -196,7 +205,7 @@ export type SDKSystemMessage = {
196
205
  slash_commands: string[];
197
206
  output_style: string;
198
207
  };
199
- export type SDKMessage = SDKAssistantMessage | SDKUserMessage | SDKResultMessage | SDKSystemMessage;
208
+ export type SDKMessage = SDKAssistantMessage | SDKUserMessage | SDKUserMessageReplay | SDKResultMessage | SDKSystemMessage;
200
209
  export interface Query extends AsyncGenerator<SDKMessage, void> {
201
210
  /**
202
211
  * Interrupt the query.
@@ -230,3 +239,4 @@ export declare function query({ prompt, options, }: {
230
239
  }): Query;
231
240
  export declare class AbortError extends Error {
232
241
  }
242
+ export {};