@anthropic-ai/claude-code 1.0.85 → 1.0.86
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/cli.js +852 -850
- package/package.json +1 -1
- package/sdk-tools.d.ts +4 -1
- package/sdk.d.ts +17 -11
- package/sdk.mjs +546 -179
- package/vendor/claude-code.vsix +0 -0
package/package.json
CHANGED
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
|
};
|
|
@@ -139,24 +140,31 @@ export type Options = {
|
|
|
139
140
|
strictMcpConfig?: boolean;
|
|
140
141
|
};
|
|
141
142
|
export type PermissionMode = 'default' | 'acceptEdits' | 'bypassPermissions' | 'plan';
|
|
142
|
-
|
|
143
|
+
type SDKMessageBase = {
|
|
144
|
+
uuid: UUID;
|
|
145
|
+
session_id: string;
|
|
146
|
+
};
|
|
147
|
+
type SDKUserMessageContent = {
|
|
143
148
|
type: 'user';
|
|
144
149
|
message: APIUserMessage;
|
|
145
150
|
parent_tool_use_id: string | null;
|
|
151
|
+
};
|
|
152
|
+
export type SDKUserMessage = SDKUserMessageContent & {
|
|
153
|
+
uuid?: UUID;
|
|
146
154
|
session_id: string;
|
|
147
155
|
};
|
|
148
|
-
export type
|
|
156
|
+
export type SDKUserMessageReplay = SDKMessageBase & SDKUserMessageContent;
|
|
157
|
+
export type SDKAssistantMessage = SDKMessageBase & {
|
|
149
158
|
type: 'assistant';
|
|
150
159
|
message: APIAssistantMessage;
|
|
151
160
|
parent_tool_use_id: string | null;
|
|
152
|
-
session_id: string;
|
|
153
161
|
};
|
|
154
162
|
export type SDKPermissionDenial = {
|
|
155
163
|
tool_name: string;
|
|
156
164
|
tool_use_id: string;
|
|
157
165
|
tool_input: Record<string, unknown>;
|
|
158
166
|
};
|
|
159
|
-
export type SDKResultMessage = {
|
|
167
|
+
export type SDKResultMessage = (SDKMessageBase & {
|
|
160
168
|
type: 'result';
|
|
161
169
|
subtype: 'success';
|
|
162
170
|
duration_ms: number;
|
|
@@ -164,28 +172,25 @@ export type SDKResultMessage = {
|
|
|
164
172
|
is_error: boolean;
|
|
165
173
|
num_turns: number;
|
|
166
174
|
result: string;
|
|
167
|
-
session_id: string;
|
|
168
175
|
total_cost_usd: number;
|
|
169
176
|
usage: NonNullableUsage;
|
|
170
177
|
permission_denials: SDKPermissionDenial[];
|
|
171
|
-
} | {
|
|
178
|
+
}) | (SDKMessageBase & {
|
|
172
179
|
type: 'result';
|
|
173
180
|
subtype: 'error_max_turns' | 'error_during_execution';
|
|
174
181
|
duration_ms: number;
|
|
175
182
|
duration_api_ms: number;
|
|
176
183
|
is_error: boolean;
|
|
177
184
|
num_turns: number;
|
|
178
|
-
session_id: string;
|
|
179
185
|
total_cost_usd: number;
|
|
180
186
|
usage: NonNullableUsage;
|
|
181
187
|
permission_denials: SDKPermissionDenial[];
|
|
182
|
-
};
|
|
183
|
-
export type SDKSystemMessage = {
|
|
188
|
+
});
|
|
189
|
+
export type SDKSystemMessage = SDKMessageBase & {
|
|
184
190
|
type: 'system';
|
|
185
191
|
subtype: 'init';
|
|
186
192
|
apiKeySource: ApiKeySource;
|
|
187
193
|
cwd: string;
|
|
188
|
-
session_id: string;
|
|
189
194
|
tools: string[];
|
|
190
195
|
mcp_servers: {
|
|
191
196
|
name: string;
|
|
@@ -196,7 +201,7 @@ export type SDKSystemMessage = {
|
|
|
196
201
|
slash_commands: string[];
|
|
197
202
|
output_style: string;
|
|
198
203
|
};
|
|
199
|
-
export type SDKMessage = SDKAssistantMessage | SDKUserMessage | SDKResultMessage | SDKSystemMessage;
|
|
204
|
+
export type SDKMessage = SDKAssistantMessage | SDKUserMessage | SDKUserMessageReplay | SDKResultMessage | SDKSystemMessage;
|
|
200
205
|
export interface Query extends AsyncGenerator<SDKMessage, void> {
|
|
201
206
|
/**
|
|
202
207
|
* Interrupt the query.
|
|
@@ -230,3 +235,4 @@ export declare function query({ prompt, options, }: {
|
|
|
230
235
|
}): Query;
|
|
231
236
|
export declare class AbortError extends Error {
|
|
232
237
|
}
|
|
238
|
+
export {};
|