@ai-sdk/anthropic 2.0.27 → 2.0.28

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.
@@ -142,6 +142,7 @@ var anthropicMessagesResponseSchema = lazySchema2(
142
142
  })
143
143
  ])
144
144
  }),
145
+ // code execution results for code_execution_20250522 tool:
145
146
  z2.object({
146
147
  type: z2.literal("code_execution_tool_result"),
147
148
  tool_use_id: z2.string(),
@@ -157,6 +158,62 @@ var anthropicMessagesResponseSchema = lazySchema2(
157
158
  error_code: z2.string()
158
159
  })
159
160
  ])
161
+ }),
162
+ // bash code execution results for code_execution_20250825 tool:
163
+ z2.object({
164
+ type: z2.literal("bash_code_execution_tool_result"),
165
+ tool_use_id: z2.string(),
166
+ content: z2.discriminatedUnion("type", [
167
+ z2.object({
168
+ type: z2.literal("bash_code_execution_result"),
169
+ content: z2.array(
170
+ z2.object({
171
+ type: z2.literal("bash_code_execution_output"),
172
+ file_id: z2.string()
173
+ })
174
+ ),
175
+ stdout: z2.string(),
176
+ stderr: z2.string(),
177
+ return_code: z2.number()
178
+ }),
179
+ z2.object({
180
+ type: z2.literal("bash_code_execution_tool_result_error"),
181
+ error_code: z2.string()
182
+ })
183
+ ])
184
+ }),
185
+ // text editor code execution results for code_execution_20250825 tool:
186
+ z2.object({
187
+ type: z2.literal("text_editor_code_execution_tool_result"),
188
+ tool_use_id: z2.string(),
189
+ content: z2.discriminatedUnion("type", [
190
+ z2.object({
191
+ type: z2.literal("text_editor_code_execution_tool_result_error"),
192
+ error_code: z2.string()
193
+ }),
194
+ z2.object({
195
+ type: z2.literal("text_editor_code_execution_view_result"),
196
+ content: z2.string(),
197
+ file_type: z2.string(),
198
+ num_lines: z2.number().nullable(),
199
+ start_line: z2.number().nullable(),
200
+ total_lines: z2.number().nullable()
201
+ }),
202
+ z2.object({
203
+ type: z2.literal("text_editor_code_execution_create_result"),
204
+ is_file_update: z2.boolean()
205
+ }),
206
+ z2.object({
207
+ type: z2.literal(
208
+ "text_editor_code_execution_str_replace_result"
209
+ ),
210
+ lines: z2.array(z2.string()).nullable(),
211
+ new_lines: z2.number().nullable(),
212
+ new_start: z2.number().nullable(),
213
+ old_lines: z2.number().nullable(),
214
+ old_start: z2.number().nullable()
215
+ })
216
+ ])
160
217
  })
161
218
  ])
162
219
  ),
@@ -257,6 +314,7 @@ var anthropicMessagesChunkSchema = lazySchema2(
257
314
  })
258
315
  ])
259
316
  }),
317
+ // code execution results for code_execution_20250522 tool:
260
318
  z2.object({
261
319
  type: z2.literal("code_execution_tool_result"),
262
320
  tool_use_id: z2.string(),
@@ -272,6 +330,62 @@ var anthropicMessagesChunkSchema = lazySchema2(
272
330
  error_code: z2.string()
273
331
  })
274
332
  ])
333
+ }),
334
+ // bash code execution results for code_execution_20250825 tool:
335
+ z2.object({
336
+ type: z2.literal("bash_code_execution_tool_result"),
337
+ tool_use_id: z2.string(),
338
+ content: z2.discriminatedUnion("type", [
339
+ z2.object({
340
+ type: z2.literal("bash_code_execution_result"),
341
+ content: z2.array(
342
+ z2.object({
343
+ type: z2.literal("bash_code_execution_output"),
344
+ file_id: z2.string()
345
+ })
346
+ ),
347
+ stdout: z2.string(),
348
+ stderr: z2.string(),
349
+ return_code: z2.number()
350
+ }),
351
+ z2.object({
352
+ type: z2.literal("bash_code_execution_tool_result_error"),
353
+ error_code: z2.string()
354
+ })
355
+ ])
356
+ }),
357
+ // text editor code execution results for code_execution_20250825 tool:
358
+ z2.object({
359
+ type: z2.literal("text_editor_code_execution_tool_result"),
360
+ tool_use_id: z2.string(),
361
+ content: z2.discriminatedUnion("type", [
362
+ z2.object({
363
+ type: z2.literal("text_editor_code_execution_tool_result_error"),
364
+ error_code: z2.string()
365
+ }),
366
+ z2.object({
367
+ type: z2.literal("text_editor_code_execution_view_result"),
368
+ content: z2.string(),
369
+ file_type: z2.string(),
370
+ num_lines: z2.number().nullable(),
371
+ start_line: z2.number().nullable(),
372
+ total_lines: z2.number().nullable()
373
+ }),
374
+ z2.object({
375
+ type: z2.literal("text_editor_code_execution_create_result"),
376
+ is_file_update: z2.boolean()
377
+ }),
378
+ z2.object({
379
+ type: z2.literal(
380
+ "text_editor_code_execution_str_replace_result"
381
+ ),
382
+ lines: z2.array(z2.string()).nullable(),
383
+ new_lines: z2.number().nullable(),
384
+ new_start: z2.number().nullable(),
385
+ old_lines: z2.number().nullable(),
386
+ old_start: z2.number().nullable()
387
+ })
388
+ ])
275
389
  })
276
390
  ])
277
391
  }),
@@ -607,6 +721,14 @@ async function prepareTools({
607
721
  });
608
722
  break;
609
723
  }
724
+ case "anthropic.code_execution_20250825": {
725
+ betas.add("code-execution-2025-08-25");
726
+ anthropicTools2.push({
727
+ type: "code_execution_20250825",
728
+ name: "code_execution"
729
+ });
730
+ break;
731
+ }
610
732
  case "anthropic.computer_20250124": {
611
733
  betas.add("computer-use-2025-01-24");
612
734
  anthropicTools2.push({
@@ -822,6 +944,99 @@ var codeExecution_20250522 = (args = {}) => {
822
944
  return factory4(args);
823
945
  };
824
946
 
947
+ // src/tool/code-execution_20250825.ts
948
+ import {
949
+ createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema4,
950
+ lazySchema as lazySchema7,
951
+ zodSchema as zodSchema7
952
+ } from "@ai-sdk/provider-utils";
953
+ import { z as z8 } from "zod/v4";
954
+ var codeExecution_20250825OutputSchema = lazySchema7(
955
+ () => zodSchema7(
956
+ z8.discriminatedUnion("type", [
957
+ z8.object({
958
+ type: z8.literal("bash_code_execution_result"),
959
+ content: z8.array(
960
+ z8.object({
961
+ type: z8.literal("bash_code_execution_output"),
962
+ file_id: z8.string()
963
+ })
964
+ ),
965
+ stdout: z8.string(),
966
+ stderr: z8.string(),
967
+ return_code: z8.number()
968
+ }),
969
+ z8.object({
970
+ type: z8.literal("bash_code_execution_tool_result_error"),
971
+ error_code: z8.string()
972
+ }),
973
+ z8.object({
974
+ type: z8.literal("text_editor_code_execution_tool_result_error"),
975
+ error_code: z8.string()
976
+ }),
977
+ z8.object({
978
+ type: z8.literal("text_editor_code_execution_view_result"),
979
+ content: z8.string(),
980
+ file_type: z8.string(),
981
+ num_lines: z8.number().nullable(),
982
+ start_line: z8.number().nullable(),
983
+ total_lines: z8.number().nullable()
984
+ }),
985
+ z8.object({
986
+ type: z8.literal("text_editor_code_execution_create_result"),
987
+ is_file_update: z8.boolean()
988
+ }),
989
+ z8.object({
990
+ type: z8.literal("text_editor_code_execution_str_replace_result"),
991
+ lines: z8.array(z8.string()).nullable(),
992
+ new_lines: z8.number().nullable(),
993
+ new_start: z8.number().nullable(),
994
+ old_lines: z8.number().nullable(),
995
+ old_start: z8.number().nullable()
996
+ })
997
+ ])
998
+ )
999
+ );
1000
+ var codeExecution_20250825InputSchema = lazySchema7(
1001
+ () => zodSchema7(
1002
+ z8.discriminatedUnion("type", [
1003
+ z8.object({
1004
+ type: z8.literal("bash_code_execution"),
1005
+ command: z8.string()
1006
+ }),
1007
+ z8.discriminatedUnion("command", [
1008
+ z8.object({
1009
+ type: z8.literal("text_editor_code_execution"),
1010
+ command: z8.literal("view"),
1011
+ path: z8.string()
1012
+ }),
1013
+ z8.object({
1014
+ type: z8.literal("text_editor_code_execution"),
1015
+ command: z8.literal("create"),
1016
+ path: z8.string(),
1017
+ file_text: z8.string().nullish()
1018
+ }),
1019
+ z8.object({
1020
+ type: z8.literal("text_editor_code_execution"),
1021
+ command: z8.literal("str_replace"),
1022
+ path: z8.string(),
1023
+ old_str: z8.string(),
1024
+ new_str: z8.string()
1025
+ })
1026
+ ])
1027
+ ])
1028
+ )
1029
+ );
1030
+ var factory5 = createProviderDefinedToolFactoryWithOutputSchema4({
1031
+ id: "anthropic.code_execution_20250825",
1032
+ name: "code_execution",
1033
+ inputSchema: codeExecution_20250825InputSchema,
1034
+ outputSchema: codeExecution_20250825OutputSchema
1035
+ });
1036
+ var codeExecution_20250825 = (args = {}) => {
1037
+ return factory5(args);
1038
+ };
1039
+
825
1040
  // src/convert-to-anthropic-messages-prompt.ts
826
1041
  function convertToString(data) {
827
1042
  if (typeof data === "string") {
@@ -1124,7 +1339,17 @@ async function convertToAnthropicMessagesPrompt({
1124
1339
  }
1125
1340
  case "tool-call": {
1126
1341
  if (part.providerExecuted) {
1127
- if (part.toolName === "code_execution" || part.toolName === "web_fetch" || part.toolName === "web_search") {
1342
+ if (part.toolName === "code_execution" && part.input != null && typeof part.input === "object" && "type" in part.input && typeof part.input.type === "string" && (part.input.type === "bash_code_execution" || part.input.type === "text_editor_code_execution")) {
1343
+ anthropicContent.push({
1344
+ type: "server_tool_use",
1345
+ id: part.toolCallId,
1346
+ name: part.input.type,
1347
+ // map back to subtool name
1348
+ input: part.input,
1349
+ cache_control: cacheControl
1350
+ });
1351
+ } else if (part.toolName === "code_execution" || // code execution 20250522
1352
+ part.toolName === "web_fetch" || part.toolName === "web_search") {
1128
1353
  anthropicContent.push({
1129
1354
  type: "server_tool_use",
1130
1355
  id: part.toolCallId,
@@ -1159,21 +1384,48 @@ async function convertToAnthropicMessagesPrompt({
1159
1384
  });
1160
1385
  break;
1161
1386
  }
1162
- const codeExecutionOutput = await validateTypes2({
1163
- value: output.value,
1164
- schema: codeExecution_20250522OutputSchema
1165
- });
1166
- anthropicContent.push({
1167
- type: "code_execution_tool_result",
1168
- tool_use_id: part.toolCallId,
1169
- content: {
1170
- type: codeExecutionOutput.type,
1171
- stdout: codeExecutionOutput.stdout,
1172
- stderr: codeExecutionOutput.stderr,
1173
- return_code: codeExecutionOutput.return_code
1174
- },
1175
- cache_control: cacheControl
1176
- });
1387
+ if (output.value == null || typeof output.value !== "object" || !("type" in output.value) || typeof output.value.type !== "string") {
1388
+ warnings.push({
1389
+ type: "other",
1390
+ message: `provider executed tool result output value is not a valid code execution result for tool ${part.toolName}`
1391
+ });
1392
+ break;
1393
+ }
1394
+ if (output.value.type === "code_execution_result") {
1395
+ const codeExecutionOutput = await validateTypes2({
1396
+ value: output.value,
1397
+ schema: codeExecution_20250522OutputSchema
1398
+ });
1399
+ anthropicContent.push({
1400
+ type: "code_execution_tool_result",
1401
+ tool_use_id: part.toolCallId,
1402
+ content: {
1403
+ type: codeExecutionOutput.type,
1404
+ stdout: codeExecutionOutput.stdout,
1405
+ stderr: codeExecutionOutput.stderr,
1406
+ return_code: codeExecutionOutput.return_code
1407
+ },
1408
+ cache_control: cacheControl
1409
+ });
1410
+ } else {
1411
+ const codeExecutionOutput = await validateTypes2({
1412
+ value: output.value,
1413
+ schema: codeExecution_20250825OutputSchema
1414
+ });
1415
+ anthropicContent.push(
1416
+ codeExecutionOutput.type === "bash_code_execution_result" || codeExecutionOutput.type === "bash_code_execution_tool_result_error" ? {
1417
+ type: "bash_code_execution_tool_result",
1418
+ tool_use_id: part.toolCallId,
1419
+ cache_control: cacheControl,
1420
+ content: codeExecutionOutput
1421
+ } : {
1422
+ type: "text_editor_code_execution_tool_result",
1423
+ tool_use_id: part.toolCallId,
1424
+ cache_control: cacheControl,
1425
+ content: codeExecutionOutput
1426
+ }
1427
+ );
1428
+ }
1177
1429
  break;
1178
1430
  }
1179
1431
  if (part.toolName === "web_fetch") {
@@ -1643,7 +1895,15 @@ var AnthropicMessagesLanguageModel = class {
1643
1895
  break;
1644
1896
  }
1645
1897
  case "server_tool_use": {
1646
- if (part.name === "web_search" || part.name === "code_execution" || part.name === "web_fetch") {
1898
+ if (part.name === "text_editor_code_execution" || part.name === "bash_code_execution") {
1899
+ content.push({
1900
+ type: "tool-call",
1901
+ toolCallId: part.id,
1902
+ toolName: "code_execution",
1903
+ input: JSON.stringify({ type: part.name, ...part.input }),
1904
+ providerExecuted: true
1905
+ });
1906
+ } else if (part.name === "web_search" || part.name === "code_execution" || part.name === "web_fetch") {
1647
1907
  content.push({
1648
1908
  type: "tool-call",
1649
1909
  toolCallId: part.id,
@@ -1739,6 +1999,7 @@ var AnthropicMessagesLanguageModel = class {
1739
1999
  }
1740
2000
  break;
1741
2001
  }
2002
+ // code execution 20250522:
1742
2003
  case "code_execution_tool_result": {
1743
2004
  if (part.content.type === "code_execution_result") {
1744
2005
  content.push({
@@ -1768,6 +2029,18 @@ var AnthropicMessagesLanguageModel = class {
1768
2029
  }
1769
2030
  break;
1770
2031
  }
2032
+ // code execution 20250825:
2033
+ case "bash_code_execution_tool_result":
2034
+ case "text_editor_code_execution_tool_result": {
2035
+ content.push({
2036
+ type: "tool-result",
2037
+ toolCallId: part.tool_use_id,
2038
+ toolName: "code_execution",
2039
+ result: part.content,
2040
+ providerExecuted: true
2041
+ });
2042
+ break;
2043
+ }
1771
2044
  }
1772
2045
  }
1773
2046
  return {
@@ -1884,7 +2157,8 @@ var AnthropicMessagesLanguageModel = class {
1884
2157
  type: "tool-call",
1885
2158
  toolCallId: value.content_block.id,
1886
2159
  toolName: value.content_block.name,
1887
- input: ""
2160
+ input: "",
2161
+ firstDelta: true
1888
2162
  };
1889
2163
  controller.enqueue(
1890
2164
  usesJsonResponseTool ? { type: "text-start", id: String(value.index) } : {
@@ -1896,18 +2170,29 @@ var AnthropicMessagesLanguageModel = class {
1896
2170
  return;
1897
2171
  }
1898
2172
  case "server_tool_use": {
1899
- if (value.content_block.name === "web_fetch" || value.content_block.name === "web_search" || value.content_block.name === "code_execution") {
2173
+ if ([
2174
+ "web_fetch",
2175
+ "web_search",
2176
+ // code execution 20250825:
2177
+ "code_execution",
2178
+ // code execution 20250825 text editor:
2179
+ "text_editor_code_execution",
2180
+ // code execution 20250825 bash:
2181
+ "bash_code_execution"
2182
+ ].includes(value.content_block.name)) {
1900
2183
  contentBlocks[value.index] = {
1901
2184
  type: "tool-call",
1902
2185
  toolCallId: value.content_block.id,
1903
2186
  toolName: value.content_block.name,
1904
2187
  input: "",
1905
- providerExecuted: true
2188
+ providerExecuted: true,
2189
+ firstDelta: true
1906
2190
  };
2191
+ const mappedToolName = value.content_block.name === "text_editor_code_execution" || value.content_block.name === "bash_code_execution" ? "code_execution" : value.content_block.name;
1907
2192
  controller.enqueue({
1908
2193
  type: "tool-input-start",
1909
2194
  id: value.content_block.id,
1910
- toolName: value.content_block.name,
2195
+ toolName: mappedToolName,
1911
2196
  providerExecuted: true
1912
2197
  });
1913
2198
  }
@@ -1999,6 +2284,7 @@ var AnthropicMessagesLanguageModel = class {
1999
2284
  }
2000
2285
  return;
2001
2286
  }
2287
+ // code execution 20250522:
2002
2288
  case "code_execution_tool_result": {
2003
2289
  const part = value.content_block;
2004
2290
  if (part.content.type === "code_execution_result") {
@@ -2029,6 +2315,19 @@ var AnthropicMessagesLanguageModel = class {
2029
2315
  }
2030
2316
  return;
2031
2317
  }
2318
+ // code execution 20250825:
2319
+ case "bash_code_execution_tool_result":
2320
+ case "text_editor_code_execution_tool_result": {
2321
+ const part = value.content_block;
2322
+ controller.enqueue({
2323
+ type: "tool-result",
2324
+ toolCallId: part.tool_use_id,
2325
+ toolName: "code_execution",
2326
+ result: part.content,
2327
+ providerExecuted: true
2328
+ });
2329
+ return;
2330
+ }
2032
2331
  default: {
2033
2332
  const _exhaustiveCheck = contentBlockType;
2034
2333
  throw new Error(
@@ -2061,7 +2360,14 @@ var AnthropicMessagesLanguageModel = class {
2061
2360
  type: "tool-input-end",
2062
2361
  id: contentBlock.toolCallId
2063
2362
  });
2064
- controller.enqueue(contentBlock);
2363
+ const toolName = contentBlock.toolName === "text_editor_code_execution" || contentBlock.toolName === "bash_code_execution" ? "code_execution" : contentBlock.toolName;
2364
+ controller.enqueue({
2365
+ type: "tool-call",
2366
+ toolCallId: contentBlock.toolCallId,
2367
+ toolName,
2368
+ input: contentBlock.input,
2369
+ providerExecuted: contentBlock.providerExecuted
2370
+ });
2065
2371
  }
2066
2372
  break;
2067
2373
  }
@@ -2109,7 +2415,10 @@ var AnthropicMessagesLanguageModel = class {
2109
2415
  }
2110
2416
  case "input_json_delta": {
2111
2417
  const contentBlock = contentBlocks[value.index];
2112
- const delta = value.delta.partial_json;
2418
+ let delta = value.delta.partial_json;
2419
+ if (delta.length === 0) {
2420
+ return;
2421
+ }
2113
2422
  if (usesJsonResponseTool) {
2114
2423
  if ((contentBlock == null ? void 0 : contentBlock.type) !== "text") {
2115
2424
  return;
@@ -2123,12 +2432,16 @@ var AnthropicMessagesLanguageModel = class {
2123
2432
  if ((contentBlock == null ? void 0 : contentBlock.type) !== "tool-call") {
2124
2433
  return;
2125
2434
  }
2435
+ if (contentBlock.firstDelta && (contentBlock.toolName === "bash_code_execution" || contentBlock.toolName === "text_editor_code_execution")) {
2436
+ delta = `{"type": "${contentBlock.toolName}",${delta.substring(1)}`;
2437
+ }
2126
2438
  controller.enqueue({
2127
2439
  type: "tool-input-delta",
2128
2440
  id: contentBlock.toolCallId,
2129
2441
  delta
2130
2442
  });
2131
2443
  contentBlock.input += delta;
2444
+ contentBlock.firstDelta = false;
2132
2445
  }
2133
2446
  return;
2134
2447
  }
@@ -2216,15 +2529,15 @@ var AnthropicMessagesLanguageModel = class {
2216
2529
  // src/tool/bash_20241022.ts
2217
2530
  import {
2218
2531
  createProviderDefinedToolFactory as createProviderDefinedToolFactory2,
2219
- lazySchema as lazySchema7,
2220
- zodSchema as zodSchema7
2532
+ lazySchema as lazySchema8,
2533
+ zodSchema as zodSchema8
2221
2534
  } from "@ai-sdk/provider-utils";
2222
- import { z as z8 } from "zod/v4";
2223
- var bash_20241022InputSchema = lazySchema7(
2224
- () => zodSchema7(
2225
- z8.object({
2226
- command: z8.string(),
2227
- restart: z8.boolean().optional()
2535
+ import { z as z9 } from "zod/v4";
2536
+ var bash_20241022InputSchema = lazySchema8(
2537
+ () => zodSchema8(
2538
+ z9.object({
2539
+ command: z9.string(),
2540
+ restart: z9.boolean().optional()
2228
2541
  })
2229
2542
  )
2230
2543
  );
@@ -2237,15 +2550,15 @@ var bash_20241022 = createProviderDefinedToolFactory2({
2237
2550
  // src/tool/bash_20250124.ts
2238
2551
  import {
2239
2552
  createProviderDefinedToolFactory as createProviderDefinedToolFactory3,
2240
- lazySchema as lazySchema8,
2241
- zodSchema as zodSchema8
2553
+ lazySchema as lazySchema9,
2554
+ zodSchema as zodSchema9
2242
2555
  } from "@ai-sdk/provider-utils";
2243
- import { z as z9 } from "zod/v4";
2244
- var bash_20250124InputSchema = lazySchema8(
2245
- () => zodSchema8(
2246
- z9.object({
2247
- command: z9.string(),
2248
- restart: z9.boolean().optional()
2556
+ import { z as z10 } from "zod/v4";
2557
+ var bash_20250124InputSchema = lazySchema9(
2558
+ () => zodSchema9(
2559
+ z10.object({
2560
+ command: z10.string(),
2561
+ restart: z10.boolean().optional()
2249
2562
  })
2250
2563
  )
2251
2564
  );
@@ -2258,14 +2571,14 @@ var bash_20250124 = createProviderDefinedToolFactory3({
2258
2571
  // src/tool/computer_20241022.ts
2259
2572
  import {
2260
2573
  createProviderDefinedToolFactory as createProviderDefinedToolFactory4,
2261
- lazySchema as lazySchema9,
2262
- zodSchema as zodSchema9
2574
+ lazySchema as lazySchema10,
2575
+ zodSchema as zodSchema10
2263
2576
  } from "@ai-sdk/provider-utils";
2264
- import { z as z10 } from "zod/v4";
2265
- var computer_20241022InputSchema = lazySchema9(
2266
- () => zodSchema9(
2267
- z10.object({
2268
- action: z10.enum([
2577
+ import { z as z11 } from "zod/v4";
2578
+ var computer_20241022InputSchema = lazySchema10(
2579
+ () => zodSchema10(
2580
+ z11.object({
2581
+ action: z11.enum([
2269
2582
  "key",
2270
2583
  "type",
2271
2584
  "mouse_move",
@@ -2277,8 +2590,8 @@ var computer_20241022InputSchema = lazySchema9(
2277
2590
  "screenshot",
2278
2591
  "cursor_position"
2279
2592
  ]),
2280
- coordinate: z10.array(z10.number().int()).optional(),
2281
- text: z10.string().optional()
2593
+ coordinate: z11.array(z11.number().int()).optional(),
2594
+ text: z11.string().optional()
2282
2595
  })
2283
2596
  )
2284
2597
  );
@@ -2291,14 +2604,14 @@ var computer_20241022 = createProviderDefinedToolFactory4({
2291
2604
  // src/tool/computer_20250124.ts
2292
2605
  import {
2293
2606
  createProviderDefinedToolFactory as createProviderDefinedToolFactory5,
2294
- lazySchema as lazySchema10,
2295
- zodSchema as zodSchema10
2607
+ lazySchema as lazySchema11,
2608
+ zodSchema as zodSchema11
2296
2609
  } from "@ai-sdk/provider-utils";
2297
- import { z as z11 } from "zod/v4";
2298
- var computer_20250124InputSchema = lazySchema10(
2299
- () => zodSchema10(
2300
- z11.object({
2301
- action: z11.enum([
2610
+ import { z as z12 } from "zod/v4";
2611
+ var computer_20250124InputSchema = lazySchema11(
2612
+ () => zodSchema11(
2613
+ z12.object({
2614
+ action: z12.enum([
2302
2615
  "key",
2303
2616
  "hold_key",
2304
2617
  "type",
@@ -2316,12 +2629,12 @@ var computer_20250124InputSchema = lazySchema10(
2316
2629
  "wait",
2317
2630
  "screenshot"
2318
2631
  ]),
2319
- coordinate: z11.tuple([z11.number().int(), z11.number().int()]).optional(),
2320
- duration: z11.number().optional(),
2321
- scroll_amount: z11.number().optional(),
2322
- scroll_direction: z11.enum(["up", "down", "left", "right"]).optional(),
2323
- start_coordinate: z11.tuple([z11.number().int(), z11.number().int()]).optional(),
2324
- text: z11.string().optional()
2632
+ coordinate: z12.tuple([z12.number().int(), z12.number().int()]).optional(),
2633
+ duration: z12.number().optional(),
2634
+ scroll_amount: z12.number().optional(),
2635
+ scroll_direction: z12.enum(["up", "down", "left", "right"]).optional(),
2636
+ start_coordinate: z12.tuple([z12.number().int(), z12.number().int()]).optional(),
2637
+ text: z12.string().optional()
2325
2638
  })
2326
2639
  )
2327
2640
  );
@@ -2334,37 +2647,11 @@ var computer_20250124 = createProviderDefinedToolFactory5({
2334
2647
  // src/tool/text-editor_20241022.ts
2335
2648
  import {
2336
2649
  createProviderDefinedToolFactory as createProviderDefinedToolFactory6,
2337
- lazySchema as lazySchema11,
2338
- zodSchema as zodSchema11
2339
- } from "@ai-sdk/provider-utils";
2340
- import { z as z12 } from "zod/v4";
2341
- var textEditor_20241022InputSchema = lazySchema11(
2342
- () => zodSchema11(
2343
- z12.object({
2344
- command: z12.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
2345
- path: z12.string(),
2346
- file_text: z12.string().optional(),
2347
- insert_line: z12.number().int().optional(),
2348
- new_str: z12.string().optional(),
2349
- old_str: z12.string().optional(),
2350
- view_range: z12.array(z12.number().int()).optional()
2351
- })
2352
- )
2353
- );
2354
- var textEditor_20241022 = createProviderDefinedToolFactory6({
2355
- id: "anthropic.text_editor_20241022",
2356
- name: "str_replace_editor",
2357
- inputSchema: textEditor_20241022InputSchema
2358
- });
2359
-
2360
- // src/tool/text-editor_20250124.ts
2361
- import {
2362
- createProviderDefinedToolFactory as createProviderDefinedToolFactory7,
2363
2650
  lazySchema as lazySchema12,
2364
2651
  zodSchema as zodSchema12
2365
2652
  } from "@ai-sdk/provider-utils";
2366
2653
  import { z as z13 } from "zod/v4";
2367
- var textEditor_20250124InputSchema = lazySchema12(
2654
+ var textEditor_20241022InputSchema = lazySchema12(
2368
2655
  () => zodSchema12(
2369
2656
  z13.object({
2370
2657
  command: z13.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
@@ -2377,23 +2664,23 @@ var textEditor_20250124InputSchema = lazySchema12(
2377
2664
  })
2378
2665
  )
2379
2666
  );
2380
- var textEditor_20250124 = createProviderDefinedToolFactory7({
2381
- id: "anthropic.text_editor_20250124",
2667
+ var textEditor_20241022 = createProviderDefinedToolFactory6({
2668
+ id: "anthropic.text_editor_20241022",
2382
2669
  name: "str_replace_editor",
2383
- inputSchema: textEditor_20250124InputSchema
2670
+ inputSchema: textEditor_20241022InputSchema
2384
2671
  });
2385
2672
 
2386
- // src/tool/text-editor_20250429.ts
2673
+ // src/tool/text-editor_20250124.ts
2387
2674
  import {
2388
- createProviderDefinedToolFactory as createProviderDefinedToolFactory8,
2675
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory7,
2389
2676
  lazySchema as lazySchema13,
2390
2677
  zodSchema as zodSchema13
2391
2678
  } from "@ai-sdk/provider-utils";
2392
2679
  import { z as z14 } from "zod/v4";
2393
- var textEditor_20250429InputSchema = lazySchema13(
2680
+ var textEditor_20250124InputSchema = lazySchema13(
2394
2681
  () => zodSchema13(
2395
2682
  z14.object({
2396
- command: z14.enum(["view", "create", "str_replace", "insert"]),
2683
+ command: z14.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
2397
2684
  path: z14.string(),
2398
2685
  file_text: z14.string().optional(),
2399
2686
  insert_line: z14.number().int().optional(),
@@ -2403,6 +2690,32 @@ var textEditor_20250429InputSchema = lazySchema13(
2403
2690
  })
2404
2691
  )
2405
2692
  );
2693
+ var textEditor_20250124 = createProviderDefinedToolFactory7({
2694
+ id: "anthropic.text_editor_20250124",
2695
+ name: "str_replace_editor",
2696
+ inputSchema: textEditor_20250124InputSchema
2697
+ });
2698
+
2699
+ // src/tool/text-editor_20250429.ts
2700
+ import {
2701
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory8,
2702
+ lazySchema as lazySchema14,
2703
+ zodSchema as zodSchema14
2704
+ } from "@ai-sdk/provider-utils";
2705
+ import { z as z15 } from "zod/v4";
2706
+ var textEditor_20250429InputSchema = lazySchema14(
2707
+ () => zodSchema14(
2708
+ z15.object({
2709
+ command: z15.enum(["view", "create", "str_replace", "insert"]),
2710
+ path: z15.string(),
2711
+ file_text: z15.string().optional(),
2712
+ insert_line: z15.number().int().optional(),
2713
+ new_str: z15.string().optional(),
2714
+ old_str: z15.string().optional(),
2715
+ view_range: z15.array(z15.number().int()).optional()
2716
+ })
2717
+ )
2718
+ );
2406
2719
  var textEditor_20250429 = createProviderDefinedToolFactory8({
2407
2720
  id: "anthropic.text_editor_20250429",
2408
2721
  name: "str_replace_based_edit_tool",
@@ -2440,6 +2753,19 @@ var anthropicTools = {
2440
2753
  * Tool name must be `code_execution`.
2441
2754
  */
2442
2755
  codeExecution_20250522,
2756
+ /**
2757
+ * Claude can analyze data, create visualizations, perform complex calculations,
2758
+ * run system commands, create and edit files, and process uploaded files directly within
2759
+ * the API conversation.
2760
+ *
2761
+ * The code execution tool allows Claude to run both Python and Bash commands and manipulate files,
2762
+ * including writing code, in a secure, sandboxed environment.
2763
+ *
2764
+ * This is the latest version with enhanced Bash support and file operations.
2765
+ *
2766
+ * Tool name must be `code_execution`.
2767
+ */
2768
+ codeExecution_20250825,
2443
2769
  /**
2444
2770
  * Claude can interact with computer environments through the computer use tool, which
2445
2771
  * provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.