@ai-sdk/anthropic 2.0.71 → 2.0.73
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/CHANGELOG.md +14 -0
- package/dist/index.d.mts +137 -0
- package/dist/index.d.ts +137 -0
- package/dist/index.js +216 -91
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +218 -89
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +140 -0
- package/dist/internal/index.d.ts +140 -0
- package/dist/internal/index.js +209 -84
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +217 -88
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -196,6 +196,143 @@ declare const anthropicTools: {
|
|
|
196
196
|
old_lines: number | null;
|
|
197
197
|
old_start: number | null;
|
|
198
198
|
}>;
|
|
199
|
+
/**
|
|
200
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
201
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
202
|
+
* the API conversation.
|
|
203
|
+
*
|
|
204
|
+
* The code execution tool allows Claude to run both Python and Bash commands and manipulate files,
|
|
205
|
+
* including writing code, in a secure, sandboxed environment.
|
|
206
|
+
*
|
|
207
|
+
* This is the recommended version. Does not require a beta header.
|
|
208
|
+
*
|
|
209
|
+
* Supported models: Claude Opus 4.6, Sonnet 4.6, Sonnet 4.5, Opus 4.5
|
|
210
|
+
*/
|
|
211
|
+
codeExecution_20260120: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
|
|
212
|
+
type: "programmatic-tool-call";
|
|
213
|
+
code: string;
|
|
214
|
+
} | {
|
|
215
|
+
type: "bash_code_execution";
|
|
216
|
+
command: string;
|
|
217
|
+
} | {
|
|
218
|
+
type: "text_editor_code_execution";
|
|
219
|
+
command: "view";
|
|
220
|
+
path: string;
|
|
221
|
+
} | {
|
|
222
|
+
type: "text_editor_code_execution";
|
|
223
|
+
command: "create";
|
|
224
|
+
path: string;
|
|
225
|
+
file_text?: string | null;
|
|
226
|
+
} | {
|
|
227
|
+
type: "text_editor_code_execution";
|
|
228
|
+
command: "str_replace";
|
|
229
|
+
path: string;
|
|
230
|
+
old_str: string;
|
|
231
|
+
new_str: string;
|
|
232
|
+
}, {
|
|
233
|
+
type: "code_execution_result";
|
|
234
|
+
stdout: string;
|
|
235
|
+
stderr: string;
|
|
236
|
+
return_code: number;
|
|
237
|
+
content: Array<{
|
|
238
|
+
type: "code_execution_output";
|
|
239
|
+
file_id: string;
|
|
240
|
+
}>;
|
|
241
|
+
} | {
|
|
242
|
+
type: "bash_code_execution_result";
|
|
243
|
+
content: Array<{
|
|
244
|
+
type: "bash_code_execution_output";
|
|
245
|
+
file_id: string;
|
|
246
|
+
}>;
|
|
247
|
+
stdout: string;
|
|
248
|
+
stderr: string;
|
|
249
|
+
return_code: number;
|
|
250
|
+
} | {
|
|
251
|
+
type: "bash_code_execution_tool_result_error";
|
|
252
|
+
error_code: string;
|
|
253
|
+
} | {
|
|
254
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
255
|
+
error_code: string;
|
|
256
|
+
} | {
|
|
257
|
+
type: "text_editor_code_execution_view_result";
|
|
258
|
+
content: string;
|
|
259
|
+
file_type: string;
|
|
260
|
+
num_lines: number | null;
|
|
261
|
+
start_line: number | null;
|
|
262
|
+
total_lines: number | null;
|
|
263
|
+
} | {
|
|
264
|
+
type: "text_editor_code_execution_create_result";
|
|
265
|
+
is_file_update: boolean;
|
|
266
|
+
} | {
|
|
267
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
268
|
+
lines: string[] | null;
|
|
269
|
+
new_lines: number | null;
|
|
270
|
+
new_start: number | null;
|
|
271
|
+
old_lines: number | null;
|
|
272
|
+
old_start: number | null;
|
|
273
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
274
|
+
type: "programmatic-tool-call";
|
|
275
|
+
code: string;
|
|
276
|
+
} | {
|
|
277
|
+
type: "bash_code_execution";
|
|
278
|
+
command: string;
|
|
279
|
+
} | {
|
|
280
|
+
type: "text_editor_code_execution";
|
|
281
|
+
command: "view";
|
|
282
|
+
path: string;
|
|
283
|
+
} | {
|
|
284
|
+
type: "text_editor_code_execution";
|
|
285
|
+
command: "create";
|
|
286
|
+
path: string;
|
|
287
|
+
file_text?: string | null;
|
|
288
|
+
} | {
|
|
289
|
+
type: "text_editor_code_execution";
|
|
290
|
+
command: "str_replace";
|
|
291
|
+
path: string;
|
|
292
|
+
old_str: string;
|
|
293
|
+
new_str: string;
|
|
294
|
+
}, {
|
|
295
|
+
type: "code_execution_result";
|
|
296
|
+
stdout: string;
|
|
297
|
+
stderr: string;
|
|
298
|
+
return_code: number;
|
|
299
|
+
content: Array<{
|
|
300
|
+
type: "code_execution_output";
|
|
301
|
+
file_id: string;
|
|
302
|
+
}>;
|
|
303
|
+
} | {
|
|
304
|
+
type: "bash_code_execution_result";
|
|
305
|
+
content: Array<{
|
|
306
|
+
type: "bash_code_execution_output";
|
|
307
|
+
file_id: string;
|
|
308
|
+
}>;
|
|
309
|
+
stdout: string;
|
|
310
|
+
stderr: string;
|
|
311
|
+
return_code: number;
|
|
312
|
+
} | {
|
|
313
|
+
type: "bash_code_execution_tool_result_error";
|
|
314
|
+
error_code: string;
|
|
315
|
+
} | {
|
|
316
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
317
|
+
error_code: string;
|
|
318
|
+
} | {
|
|
319
|
+
type: "text_editor_code_execution_view_result";
|
|
320
|
+
content: string;
|
|
321
|
+
file_type: string;
|
|
322
|
+
num_lines: number | null;
|
|
323
|
+
start_line: number | null;
|
|
324
|
+
total_lines: number | null;
|
|
325
|
+
} | {
|
|
326
|
+
type: "text_editor_code_execution_create_result";
|
|
327
|
+
is_file_update: boolean;
|
|
328
|
+
} | {
|
|
329
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
330
|
+
lines: string[] | null;
|
|
331
|
+
new_lines: number | null;
|
|
332
|
+
new_start: number | null;
|
|
333
|
+
old_lines: number | null;
|
|
334
|
+
old_start: number | null;
|
|
335
|
+
}>;
|
|
199
336
|
/**
|
|
200
337
|
* Claude can interact with computer environments through the computer use tool, which
|
|
201
338
|
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
@@ -487,6 +624,9 @@ type AnthropicTool = {
|
|
|
487
624
|
} | {
|
|
488
625
|
type: 'code_execution_20250825';
|
|
489
626
|
name: string;
|
|
627
|
+
} | {
|
|
628
|
+
type: 'code_execution_20260120';
|
|
629
|
+
name: string;
|
|
490
630
|
} | {
|
|
491
631
|
name: string;
|
|
492
632
|
type: 'computer_20250124' | 'computer_20241022';
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -196,6 +196,143 @@ declare const anthropicTools: {
|
|
|
196
196
|
old_lines: number | null;
|
|
197
197
|
old_start: number | null;
|
|
198
198
|
}>;
|
|
199
|
+
/**
|
|
200
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
201
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
202
|
+
* the API conversation.
|
|
203
|
+
*
|
|
204
|
+
* The code execution tool allows Claude to run both Python and Bash commands and manipulate files,
|
|
205
|
+
* including writing code, in a secure, sandboxed environment.
|
|
206
|
+
*
|
|
207
|
+
* This is the recommended version. Does not require a beta header.
|
|
208
|
+
*
|
|
209
|
+
* Supported models: Claude Opus 4.6, Sonnet 4.6, Sonnet 4.5, Opus 4.5
|
|
210
|
+
*/
|
|
211
|
+
codeExecution_20260120: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
|
|
212
|
+
type: "programmatic-tool-call";
|
|
213
|
+
code: string;
|
|
214
|
+
} | {
|
|
215
|
+
type: "bash_code_execution";
|
|
216
|
+
command: string;
|
|
217
|
+
} | {
|
|
218
|
+
type: "text_editor_code_execution";
|
|
219
|
+
command: "view";
|
|
220
|
+
path: string;
|
|
221
|
+
} | {
|
|
222
|
+
type: "text_editor_code_execution";
|
|
223
|
+
command: "create";
|
|
224
|
+
path: string;
|
|
225
|
+
file_text?: string | null;
|
|
226
|
+
} | {
|
|
227
|
+
type: "text_editor_code_execution";
|
|
228
|
+
command: "str_replace";
|
|
229
|
+
path: string;
|
|
230
|
+
old_str: string;
|
|
231
|
+
new_str: string;
|
|
232
|
+
}, {
|
|
233
|
+
type: "code_execution_result";
|
|
234
|
+
stdout: string;
|
|
235
|
+
stderr: string;
|
|
236
|
+
return_code: number;
|
|
237
|
+
content: Array<{
|
|
238
|
+
type: "code_execution_output";
|
|
239
|
+
file_id: string;
|
|
240
|
+
}>;
|
|
241
|
+
} | {
|
|
242
|
+
type: "bash_code_execution_result";
|
|
243
|
+
content: Array<{
|
|
244
|
+
type: "bash_code_execution_output";
|
|
245
|
+
file_id: string;
|
|
246
|
+
}>;
|
|
247
|
+
stdout: string;
|
|
248
|
+
stderr: string;
|
|
249
|
+
return_code: number;
|
|
250
|
+
} | {
|
|
251
|
+
type: "bash_code_execution_tool_result_error";
|
|
252
|
+
error_code: string;
|
|
253
|
+
} | {
|
|
254
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
255
|
+
error_code: string;
|
|
256
|
+
} | {
|
|
257
|
+
type: "text_editor_code_execution_view_result";
|
|
258
|
+
content: string;
|
|
259
|
+
file_type: string;
|
|
260
|
+
num_lines: number | null;
|
|
261
|
+
start_line: number | null;
|
|
262
|
+
total_lines: number | null;
|
|
263
|
+
} | {
|
|
264
|
+
type: "text_editor_code_execution_create_result";
|
|
265
|
+
is_file_update: boolean;
|
|
266
|
+
} | {
|
|
267
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
268
|
+
lines: string[] | null;
|
|
269
|
+
new_lines: number | null;
|
|
270
|
+
new_start: number | null;
|
|
271
|
+
old_lines: number | null;
|
|
272
|
+
old_start: number | null;
|
|
273
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
274
|
+
type: "programmatic-tool-call";
|
|
275
|
+
code: string;
|
|
276
|
+
} | {
|
|
277
|
+
type: "bash_code_execution";
|
|
278
|
+
command: string;
|
|
279
|
+
} | {
|
|
280
|
+
type: "text_editor_code_execution";
|
|
281
|
+
command: "view";
|
|
282
|
+
path: string;
|
|
283
|
+
} | {
|
|
284
|
+
type: "text_editor_code_execution";
|
|
285
|
+
command: "create";
|
|
286
|
+
path: string;
|
|
287
|
+
file_text?: string | null;
|
|
288
|
+
} | {
|
|
289
|
+
type: "text_editor_code_execution";
|
|
290
|
+
command: "str_replace";
|
|
291
|
+
path: string;
|
|
292
|
+
old_str: string;
|
|
293
|
+
new_str: string;
|
|
294
|
+
}, {
|
|
295
|
+
type: "code_execution_result";
|
|
296
|
+
stdout: string;
|
|
297
|
+
stderr: string;
|
|
298
|
+
return_code: number;
|
|
299
|
+
content: Array<{
|
|
300
|
+
type: "code_execution_output";
|
|
301
|
+
file_id: string;
|
|
302
|
+
}>;
|
|
303
|
+
} | {
|
|
304
|
+
type: "bash_code_execution_result";
|
|
305
|
+
content: Array<{
|
|
306
|
+
type: "bash_code_execution_output";
|
|
307
|
+
file_id: string;
|
|
308
|
+
}>;
|
|
309
|
+
stdout: string;
|
|
310
|
+
stderr: string;
|
|
311
|
+
return_code: number;
|
|
312
|
+
} | {
|
|
313
|
+
type: "bash_code_execution_tool_result_error";
|
|
314
|
+
error_code: string;
|
|
315
|
+
} | {
|
|
316
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
317
|
+
error_code: string;
|
|
318
|
+
} | {
|
|
319
|
+
type: "text_editor_code_execution_view_result";
|
|
320
|
+
content: string;
|
|
321
|
+
file_type: string;
|
|
322
|
+
num_lines: number | null;
|
|
323
|
+
start_line: number | null;
|
|
324
|
+
total_lines: number | null;
|
|
325
|
+
} | {
|
|
326
|
+
type: "text_editor_code_execution_create_result";
|
|
327
|
+
is_file_update: boolean;
|
|
328
|
+
} | {
|
|
329
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
330
|
+
lines: string[] | null;
|
|
331
|
+
new_lines: number | null;
|
|
332
|
+
new_start: number | null;
|
|
333
|
+
old_lines: number | null;
|
|
334
|
+
old_start: number | null;
|
|
335
|
+
}>;
|
|
199
336
|
/**
|
|
200
337
|
* Claude can interact with computer environments through the computer use tool, which
|
|
201
338
|
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
@@ -487,6 +624,9 @@ type AnthropicTool = {
|
|
|
487
624
|
} | {
|
|
488
625
|
type: 'code_execution_20250825';
|
|
489
626
|
name: string;
|
|
627
|
+
} | {
|
|
628
|
+
type: 'code_execution_20260120';
|
|
629
|
+
name: string;
|
|
490
630
|
} | {
|
|
491
631
|
name: string;
|
|
492
632
|
type: 'computer_20250124' | 'computer_20241022';
|