@ai-sdk/anthropic 2.0.27 → 2.0.29

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/dist/index.mjs CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  } from "@ai-sdk/provider-utils";
11
11
 
12
12
  // src/version.ts
13
- var VERSION = true ? "2.0.27" : "0.0.0-test";
13
+ var VERSION = true ? "2.0.29" : "0.0.0-test";
14
14
 
15
15
  // src/anthropic-messages-language-model.ts
16
16
  import {
@@ -156,6 +156,7 @@ var anthropicMessagesResponseSchema = lazySchema2(
156
156
  })
157
157
  ])
158
158
  }),
159
+ // code execution results for code_execution_20250522 tool:
159
160
  z2.object({
160
161
  type: z2.literal("code_execution_tool_result"),
161
162
  tool_use_id: z2.string(),
@@ -171,6 +172,62 @@ var anthropicMessagesResponseSchema = lazySchema2(
171
172
  error_code: z2.string()
172
173
  })
173
174
  ])
175
+ }),
176
+ // bash code execution results for code_execution_20250825 tool:
177
+ z2.object({
178
+ type: z2.literal("bash_code_execution_tool_result"),
179
+ tool_use_id: z2.string(),
180
+ content: z2.discriminatedUnion("type", [
181
+ z2.object({
182
+ type: z2.literal("bash_code_execution_result"),
183
+ content: z2.array(
184
+ z2.object({
185
+ type: z2.literal("bash_code_execution_output"),
186
+ file_id: z2.string()
187
+ })
188
+ ),
189
+ stdout: z2.string(),
190
+ stderr: z2.string(),
191
+ return_code: z2.number()
192
+ }),
193
+ z2.object({
194
+ type: z2.literal("bash_code_execution_tool_result_error"),
195
+ error_code: z2.string()
196
+ })
197
+ ])
198
+ }),
199
+ // text editor code execution results for code_execution_20250825 tool:
200
+ z2.object({
201
+ type: z2.literal("text_editor_code_execution_tool_result"),
202
+ tool_use_id: z2.string(),
203
+ content: z2.discriminatedUnion("type", [
204
+ z2.object({
205
+ type: z2.literal("text_editor_code_execution_tool_result_error"),
206
+ error_code: z2.string()
207
+ }),
208
+ z2.object({
209
+ type: z2.literal("text_editor_code_execution_view_result"),
210
+ content: z2.string(),
211
+ file_type: z2.string(),
212
+ num_lines: z2.number().nullable(),
213
+ start_line: z2.number().nullable(),
214
+ total_lines: z2.number().nullable()
215
+ }),
216
+ z2.object({
217
+ type: z2.literal("text_editor_code_execution_create_result"),
218
+ is_file_update: z2.boolean()
219
+ }),
220
+ z2.object({
221
+ type: z2.literal(
222
+ "text_editor_code_execution_str_replace_result"
223
+ ),
224
+ lines: z2.array(z2.string()).nullable(),
225
+ new_lines: z2.number().nullable(),
226
+ new_start: z2.number().nullable(),
227
+ old_lines: z2.number().nullable(),
228
+ old_start: z2.number().nullable()
229
+ })
230
+ ])
174
231
  })
175
232
  ])
176
233
  ),
@@ -271,6 +328,7 @@ var anthropicMessagesChunkSchema = lazySchema2(
271
328
  })
272
329
  ])
273
330
  }),
331
+ // code execution results for code_execution_20250522 tool:
274
332
  z2.object({
275
333
  type: z2.literal("code_execution_tool_result"),
276
334
  tool_use_id: z2.string(),
@@ -286,6 +344,62 @@ var anthropicMessagesChunkSchema = lazySchema2(
286
344
  error_code: z2.string()
287
345
  })
288
346
  ])
347
+ }),
348
+ // bash code execution results for code_execution_20250825 tool:
349
+ z2.object({
350
+ type: z2.literal("bash_code_execution_tool_result"),
351
+ tool_use_id: z2.string(),
352
+ content: z2.discriminatedUnion("type", [
353
+ z2.object({
354
+ type: z2.literal("bash_code_execution_result"),
355
+ content: z2.array(
356
+ z2.object({
357
+ type: z2.literal("bash_code_execution_output"),
358
+ file_id: z2.string()
359
+ })
360
+ ),
361
+ stdout: z2.string(),
362
+ stderr: z2.string(),
363
+ return_code: z2.number()
364
+ }),
365
+ z2.object({
366
+ type: z2.literal("bash_code_execution_tool_result_error"),
367
+ error_code: z2.string()
368
+ })
369
+ ])
370
+ }),
371
+ // text editor code execution results for code_execution_20250825 tool:
372
+ z2.object({
373
+ type: z2.literal("text_editor_code_execution_tool_result"),
374
+ tool_use_id: z2.string(),
375
+ content: z2.discriminatedUnion("type", [
376
+ z2.object({
377
+ type: z2.literal("text_editor_code_execution_tool_result_error"),
378
+ error_code: z2.string()
379
+ }),
380
+ z2.object({
381
+ type: z2.literal("text_editor_code_execution_view_result"),
382
+ content: z2.string(),
383
+ file_type: z2.string(),
384
+ num_lines: z2.number().nullable(),
385
+ start_line: z2.number().nullable(),
386
+ total_lines: z2.number().nullable()
387
+ }),
388
+ z2.object({
389
+ type: z2.literal("text_editor_code_execution_create_result"),
390
+ is_file_update: z2.boolean()
391
+ }),
392
+ z2.object({
393
+ type: z2.literal(
394
+ "text_editor_code_execution_str_replace_result"
395
+ ),
396
+ lines: z2.array(z2.string()).nullable(),
397
+ new_lines: z2.number().nullable(),
398
+ new_start: z2.number().nullable(),
399
+ old_lines: z2.number().nullable(),
400
+ old_start: z2.number().nullable()
401
+ })
402
+ ])
289
403
  })
290
404
  ])
291
405
  }),
@@ -621,6 +735,14 @@ async function prepareTools({
621
735
  });
622
736
  break;
623
737
  }
738
+ case "anthropic.code_execution_20250825": {
739
+ betas.add("code-execution-2025-08-25");
740
+ anthropicTools2.push({
741
+ type: "code_execution_20250825",
742
+ name: "code_execution"
743
+ });
744
+ break;
745
+ }
624
746
  case "anthropic.computer_20250124": {
625
747
  betas.add("computer-use-2025-01-24");
626
748
  anthropicTools2.push({
@@ -695,6 +817,14 @@ async function prepareTools({
695
817
  });
696
818
  break;
697
819
  }
820
+ case "anthropic.memory_20250818": {
821
+ betas.add("context-management-2025-06-27");
822
+ anthropicTools2.push({
823
+ name: "memory",
824
+ type: "memory_20250818"
825
+ });
826
+ break;
827
+ }
698
828
  case "anthropic.web_fetch_20250910": {
699
829
  betas.add("web-fetch-2025-09-10");
700
830
  const args = await validateTypes({
@@ -836,6 +966,99 @@ var codeExecution_20250522 = (args = {}) => {
836
966
  return factory4(args);
837
967
  };
838
968
 
969
+ // src/tool/code-execution_20250825.ts
970
+ import {
971
+ createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema4,
972
+ lazySchema as lazySchema7,
973
+ zodSchema as zodSchema7
974
+ } from "@ai-sdk/provider-utils";
975
+ import { z as z8 } from "zod/v4";
976
+ var codeExecution_20250825OutputSchema = lazySchema7(
977
+ () => zodSchema7(
978
+ z8.discriminatedUnion("type", [
979
+ z8.object({
980
+ type: z8.literal("bash_code_execution_result"),
981
+ content: z8.array(
982
+ z8.object({
983
+ type: z8.literal("bash_code_execution_output"),
984
+ file_id: z8.string()
985
+ })
986
+ ),
987
+ stdout: z8.string(),
988
+ stderr: z8.string(),
989
+ return_code: z8.number()
990
+ }),
991
+ z8.object({
992
+ type: z8.literal("bash_code_execution_tool_result_error"),
993
+ error_code: z8.string()
994
+ }),
995
+ z8.object({
996
+ type: z8.literal("text_editor_code_execution_tool_result_error"),
997
+ error_code: z8.string()
998
+ }),
999
+ z8.object({
1000
+ type: z8.literal("text_editor_code_execution_view_result"),
1001
+ content: z8.string(),
1002
+ file_type: z8.string(),
1003
+ num_lines: z8.number().nullable(),
1004
+ start_line: z8.number().nullable(),
1005
+ total_lines: z8.number().nullable()
1006
+ }),
1007
+ z8.object({
1008
+ type: z8.literal("text_editor_code_execution_create_result"),
1009
+ is_file_update: z8.boolean()
1010
+ }),
1011
+ z8.object({
1012
+ type: z8.literal("text_editor_code_execution_str_replace_result"),
1013
+ lines: z8.array(z8.string()).nullable(),
1014
+ new_lines: z8.number().nullable(),
1015
+ new_start: z8.number().nullable(),
1016
+ old_lines: z8.number().nullable(),
1017
+ old_start: z8.number().nullable()
1018
+ })
1019
+ ])
1020
+ )
1021
+ );
1022
+ var codeExecution_20250825InputSchema = lazySchema7(
1023
+ () => zodSchema7(
1024
+ z8.discriminatedUnion("type", [
1025
+ z8.object({
1026
+ type: z8.literal("bash_code_execution"),
1027
+ command: z8.string()
1028
+ }),
1029
+ z8.discriminatedUnion("command", [
1030
+ z8.object({
1031
+ type: z8.literal("text_editor_code_execution"),
1032
+ command: z8.literal("view"),
1033
+ path: z8.string()
1034
+ }),
1035
+ z8.object({
1036
+ type: z8.literal("text_editor_code_execution"),
1037
+ command: z8.literal("create"),
1038
+ path: z8.string(),
1039
+ file_text: z8.string().nullish()
1040
+ }),
1041
+ z8.object({
1042
+ type: z8.literal("text_editor_code_execution"),
1043
+ command: z8.literal("str_replace"),
1044
+ path: z8.string(),
1045
+ old_str: z8.string(),
1046
+ new_str: z8.string()
1047
+ })
1048
+ ])
1049
+ ])
1050
+ )
1051
+ );
1052
+ var factory5 = createProviderDefinedToolFactoryWithOutputSchema4({
1053
+ id: "anthropic.code_execution_20250825",
1054
+ name: "code_execution",
1055
+ inputSchema: codeExecution_20250825InputSchema,
1056
+ outputSchema: codeExecution_20250825OutputSchema
1057
+ });
1058
+ var codeExecution_20250825 = (args = {}) => {
1059
+ return factory5(args);
1060
+ };
1061
+
839
1062
  // src/convert-to-anthropic-messages-prompt.ts
840
1063
  function convertToString(data) {
841
1064
  if (typeof data === "string") {
@@ -1138,7 +1361,17 @@ async function convertToAnthropicMessagesPrompt({
1138
1361
  }
1139
1362
  case "tool-call": {
1140
1363
  if (part.providerExecuted) {
1141
- if (part.toolName === "code_execution" || part.toolName === "web_fetch" || part.toolName === "web_search") {
1364
+ 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")) {
1365
+ anthropicContent.push({
1366
+ type: "server_tool_use",
1367
+ id: part.toolCallId,
1368
+ name: part.input.type,
1369
+ // map back to subtool name
1370
+ input: part.input,
1371
+ cache_control: cacheControl
1372
+ });
1373
+ } else if (part.toolName === "code_execution" || // code execution 20250522
1374
+ part.toolName === "web_fetch" || part.toolName === "web_search") {
1142
1375
  anthropicContent.push({
1143
1376
  type: "server_tool_use",
1144
1377
  id: part.toolCallId,
@@ -1173,21 +1406,48 @@ async function convertToAnthropicMessagesPrompt({
1173
1406
  });
1174
1407
  break;
1175
1408
  }
1176
- const codeExecutionOutput = await validateTypes2({
1177
- value: output.value,
1178
- schema: codeExecution_20250522OutputSchema
1179
- });
1180
- anthropicContent.push({
1181
- type: "code_execution_tool_result",
1182
- tool_use_id: part.toolCallId,
1183
- content: {
1184
- type: codeExecutionOutput.type,
1185
- stdout: codeExecutionOutput.stdout,
1186
- stderr: codeExecutionOutput.stderr,
1187
- return_code: codeExecutionOutput.return_code
1188
- },
1189
- cache_control: cacheControl
1190
- });
1409
+ if (output.value == null || typeof output.value !== "object" || !("type" in output.value) || typeof output.value.type !== "string") {
1410
+ warnings.push({
1411
+ type: "other",
1412
+ message: `provider executed tool result output value is not a valid code execution result for tool ${part.toolName}`
1413
+ });
1414
+ break;
1415
+ }
1416
+ if (output.value.type === "code_execution_result") {
1417
+ const codeExecutionOutput = await validateTypes2({
1418
+ value: output.value,
1419
+ schema: codeExecution_20250522OutputSchema
1420
+ });
1421
+ anthropicContent.push({
1422
+ type: "code_execution_tool_result",
1423
+ tool_use_id: part.toolCallId,
1424
+ content: {
1425
+ type: codeExecutionOutput.type,
1426
+ stdout: codeExecutionOutput.stdout,
1427
+ stderr: codeExecutionOutput.stderr,
1428
+ return_code: codeExecutionOutput.return_code
1429
+ },
1430
+ cache_control: cacheControl
1431
+ });
1432
+ } else {
1433
+ const codeExecutionOutput = await validateTypes2({
1434
+ value: output.value,
1435
+ schema: codeExecution_20250825OutputSchema
1436
+ });
1437
+ anthropicContent.push(
1438
+ codeExecutionOutput.type === "bash_code_execution_result" || codeExecutionOutput.type === "bash_code_execution_tool_result_error" ? {
1439
+ type: "bash_code_execution_tool_result",
1440
+ tool_use_id: part.toolCallId,
1441
+ cache_control: cacheControl,
1442
+ content: codeExecutionOutput
1443
+ } : {
1444
+ type: "text_editor_code_execution_tool_result",
1445
+ tool_use_id: part.toolCallId,
1446
+ cache_control: cacheControl,
1447
+ content: codeExecutionOutput
1448
+ }
1449
+ );
1450
+ }
1191
1451
  break;
1192
1452
  }
1193
1453
  if (part.toolName === "web_fetch") {
@@ -1657,7 +1917,15 @@ var AnthropicMessagesLanguageModel = class {
1657
1917
  break;
1658
1918
  }
1659
1919
  case "server_tool_use": {
1660
- if (part.name === "web_search" || part.name === "code_execution" || part.name === "web_fetch") {
1920
+ if (part.name === "text_editor_code_execution" || part.name === "bash_code_execution") {
1921
+ content.push({
1922
+ type: "tool-call",
1923
+ toolCallId: part.id,
1924
+ toolName: "code_execution",
1925
+ input: JSON.stringify({ type: part.name, ...part.input }),
1926
+ providerExecuted: true
1927
+ });
1928
+ } else if (part.name === "web_search" || part.name === "code_execution" || part.name === "web_fetch") {
1661
1929
  content.push({
1662
1930
  type: "tool-call",
1663
1931
  toolCallId: part.id,
@@ -1753,6 +2021,7 @@ var AnthropicMessagesLanguageModel = class {
1753
2021
  }
1754
2022
  break;
1755
2023
  }
2024
+ // code execution 20250522:
1756
2025
  case "code_execution_tool_result": {
1757
2026
  if (part.content.type === "code_execution_result") {
1758
2027
  content.push({
@@ -1782,6 +2051,18 @@ var AnthropicMessagesLanguageModel = class {
1782
2051
  }
1783
2052
  break;
1784
2053
  }
2054
+ // code execution 20250825:
2055
+ case "bash_code_execution_tool_result":
2056
+ case "text_editor_code_execution_tool_result": {
2057
+ content.push({
2058
+ type: "tool-result",
2059
+ toolCallId: part.tool_use_id,
2060
+ toolName: "code_execution",
2061
+ result: part.content,
2062
+ providerExecuted: true
2063
+ });
2064
+ break;
2065
+ }
1785
2066
  }
1786
2067
  }
1787
2068
  return {
@@ -1898,7 +2179,8 @@ var AnthropicMessagesLanguageModel = class {
1898
2179
  type: "tool-call",
1899
2180
  toolCallId: value.content_block.id,
1900
2181
  toolName: value.content_block.name,
1901
- input: ""
2182
+ input: "",
2183
+ firstDelta: true
1902
2184
  };
1903
2185
  controller.enqueue(
1904
2186
  usesJsonResponseTool ? { type: "text-start", id: String(value.index) } : {
@@ -1910,18 +2192,29 @@ var AnthropicMessagesLanguageModel = class {
1910
2192
  return;
1911
2193
  }
1912
2194
  case "server_tool_use": {
1913
- if (value.content_block.name === "web_fetch" || value.content_block.name === "web_search" || value.content_block.name === "code_execution") {
2195
+ if ([
2196
+ "web_fetch",
2197
+ "web_search",
2198
+ // code execution 20250825:
2199
+ "code_execution",
2200
+ // code execution 20250825 text editor:
2201
+ "text_editor_code_execution",
2202
+ // code execution 20250825 bash:
2203
+ "bash_code_execution"
2204
+ ].includes(value.content_block.name)) {
1914
2205
  contentBlocks[value.index] = {
1915
2206
  type: "tool-call",
1916
2207
  toolCallId: value.content_block.id,
1917
2208
  toolName: value.content_block.name,
1918
2209
  input: "",
1919
- providerExecuted: true
2210
+ providerExecuted: true,
2211
+ firstDelta: true
1920
2212
  };
2213
+ const mappedToolName = value.content_block.name === "text_editor_code_execution" || value.content_block.name === "bash_code_execution" ? "code_execution" : value.content_block.name;
1921
2214
  controller.enqueue({
1922
2215
  type: "tool-input-start",
1923
2216
  id: value.content_block.id,
1924
- toolName: value.content_block.name,
2217
+ toolName: mappedToolName,
1925
2218
  providerExecuted: true
1926
2219
  });
1927
2220
  }
@@ -2013,6 +2306,7 @@ var AnthropicMessagesLanguageModel = class {
2013
2306
  }
2014
2307
  return;
2015
2308
  }
2309
+ // code execution 20250522:
2016
2310
  case "code_execution_tool_result": {
2017
2311
  const part = value.content_block;
2018
2312
  if (part.content.type === "code_execution_result") {
@@ -2043,6 +2337,19 @@ var AnthropicMessagesLanguageModel = class {
2043
2337
  }
2044
2338
  return;
2045
2339
  }
2340
+ // code execution 20250825:
2341
+ case "bash_code_execution_tool_result":
2342
+ case "text_editor_code_execution_tool_result": {
2343
+ const part = value.content_block;
2344
+ controller.enqueue({
2345
+ type: "tool-result",
2346
+ toolCallId: part.tool_use_id,
2347
+ toolName: "code_execution",
2348
+ result: part.content,
2349
+ providerExecuted: true
2350
+ });
2351
+ return;
2352
+ }
2046
2353
  default: {
2047
2354
  const _exhaustiveCheck = contentBlockType;
2048
2355
  throw new Error(
@@ -2075,7 +2382,14 @@ var AnthropicMessagesLanguageModel = class {
2075
2382
  type: "tool-input-end",
2076
2383
  id: contentBlock.toolCallId
2077
2384
  });
2078
- controller.enqueue(contentBlock);
2385
+ const toolName = contentBlock.toolName === "text_editor_code_execution" || contentBlock.toolName === "bash_code_execution" ? "code_execution" : contentBlock.toolName;
2386
+ controller.enqueue({
2387
+ type: "tool-call",
2388
+ toolCallId: contentBlock.toolCallId,
2389
+ toolName,
2390
+ input: contentBlock.input,
2391
+ providerExecuted: contentBlock.providerExecuted
2392
+ });
2079
2393
  }
2080
2394
  break;
2081
2395
  }
@@ -2123,7 +2437,10 @@ var AnthropicMessagesLanguageModel = class {
2123
2437
  }
2124
2438
  case "input_json_delta": {
2125
2439
  const contentBlock = contentBlocks[value.index];
2126
- const delta = value.delta.partial_json;
2440
+ let delta = value.delta.partial_json;
2441
+ if (delta.length === 0) {
2442
+ return;
2443
+ }
2127
2444
  if (usesJsonResponseTool) {
2128
2445
  if ((contentBlock == null ? void 0 : contentBlock.type) !== "text") {
2129
2446
  return;
@@ -2137,12 +2454,16 @@ var AnthropicMessagesLanguageModel = class {
2137
2454
  if ((contentBlock == null ? void 0 : contentBlock.type) !== "tool-call") {
2138
2455
  return;
2139
2456
  }
2457
+ if (contentBlock.firstDelta && (contentBlock.toolName === "bash_code_execution" || contentBlock.toolName === "text_editor_code_execution")) {
2458
+ delta = `{"type": "${contentBlock.toolName}",${delta.substring(1)}`;
2459
+ }
2140
2460
  controller.enqueue({
2141
2461
  type: "tool-input-delta",
2142
2462
  id: contentBlock.toolCallId,
2143
2463
  delta
2144
2464
  });
2145
2465
  contentBlock.input += delta;
2466
+ contentBlock.firstDelta = false;
2146
2467
  }
2147
2468
  return;
2148
2469
  }
@@ -2230,15 +2551,15 @@ var AnthropicMessagesLanguageModel = class {
2230
2551
  // src/tool/bash_20241022.ts
2231
2552
  import {
2232
2553
  createProviderDefinedToolFactory as createProviderDefinedToolFactory2,
2233
- lazySchema as lazySchema7,
2234
- zodSchema as zodSchema7
2554
+ lazySchema as lazySchema8,
2555
+ zodSchema as zodSchema8
2235
2556
  } from "@ai-sdk/provider-utils";
2236
- import { z as z8 } from "zod/v4";
2237
- var bash_20241022InputSchema = lazySchema7(
2238
- () => zodSchema7(
2239
- z8.object({
2240
- command: z8.string(),
2241
- restart: z8.boolean().optional()
2557
+ import { z as z9 } from "zod/v4";
2558
+ var bash_20241022InputSchema = lazySchema8(
2559
+ () => zodSchema8(
2560
+ z9.object({
2561
+ command: z9.string(),
2562
+ restart: z9.boolean().optional()
2242
2563
  })
2243
2564
  )
2244
2565
  );
@@ -2251,15 +2572,15 @@ var bash_20241022 = createProviderDefinedToolFactory2({
2251
2572
  // src/tool/bash_20250124.ts
2252
2573
  import {
2253
2574
  createProviderDefinedToolFactory as createProviderDefinedToolFactory3,
2254
- lazySchema as lazySchema8,
2255
- zodSchema as zodSchema8
2575
+ lazySchema as lazySchema9,
2576
+ zodSchema as zodSchema9
2256
2577
  } from "@ai-sdk/provider-utils";
2257
- import { z as z9 } from "zod/v4";
2258
- var bash_20250124InputSchema = lazySchema8(
2259
- () => zodSchema8(
2260
- z9.object({
2261
- command: z9.string(),
2262
- restart: z9.boolean().optional()
2578
+ import { z as z10 } from "zod/v4";
2579
+ var bash_20250124InputSchema = lazySchema9(
2580
+ () => zodSchema9(
2581
+ z10.object({
2582
+ command: z10.string(),
2583
+ restart: z10.boolean().optional()
2263
2584
  })
2264
2585
  )
2265
2586
  );
@@ -2272,14 +2593,14 @@ var bash_20250124 = createProviderDefinedToolFactory3({
2272
2593
  // src/tool/computer_20241022.ts
2273
2594
  import {
2274
2595
  createProviderDefinedToolFactory as createProviderDefinedToolFactory4,
2275
- lazySchema as lazySchema9,
2276
- zodSchema as zodSchema9
2596
+ lazySchema as lazySchema10,
2597
+ zodSchema as zodSchema10
2277
2598
  } from "@ai-sdk/provider-utils";
2278
- import { z as z10 } from "zod/v4";
2279
- var computer_20241022InputSchema = lazySchema9(
2280
- () => zodSchema9(
2281
- z10.object({
2282
- action: z10.enum([
2599
+ import { z as z11 } from "zod/v4";
2600
+ var computer_20241022InputSchema = lazySchema10(
2601
+ () => zodSchema10(
2602
+ z11.object({
2603
+ action: z11.enum([
2283
2604
  "key",
2284
2605
  "type",
2285
2606
  "mouse_move",
@@ -2291,8 +2612,8 @@ var computer_20241022InputSchema = lazySchema9(
2291
2612
  "screenshot",
2292
2613
  "cursor_position"
2293
2614
  ]),
2294
- coordinate: z10.array(z10.number().int()).optional(),
2295
- text: z10.string().optional()
2615
+ coordinate: z11.array(z11.number().int()).optional(),
2616
+ text: z11.string().optional()
2296
2617
  })
2297
2618
  )
2298
2619
  );
@@ -2305,14 +2626,14 @@ var computer_20241022 = createProviderDefinedToolFactory4({
2305
2626
  // src/tool/computer_20250124.ts
2306
2627
  import {
2307
2628
  createProviderDefinedToolFactory as createProviderDefinedToolFactory5,
2308
- lazySchema as lazySchema10,
2309
- zodSchema as zodSchema10
2629
+ lazySchema as lazySchema11,
2630
+ zodSchema as zodSchema11
2310
2631
  } from "@ai-sdk/provider-utils";
2311
- import { z as z11 } from "zod/v4";
2312
- var computer_20250124InputSchema = lazySchema10(
2313
- () => zodSchema10(
2314
- z11.object({
2315
- action: z11.enum([
2632
+ import { z as z12 } from "zod/v4";
2633
+ var computer_20250124InputSchema = lazySchema11(
2634
+ () => zodSchema11(
2635
+ z12.object({
2636
+ action: z12.enum([
2316
2637
  "key",
2317
2638
  "hold_key",
2318
2639
  "type",
@@ -2330,12 +2651,12 @@ var computer_20250124InputSchema = lazySchema10(
2330
2651
  "wait",
2331
2652
  "screenshot"
2332
2653
  ]),
2333
- coordinate: z11.tuple([z11.number().int(), z11.number().int()]).optional(),
2334
- duration: z11.number().optional(),
2335
- scroll_amount: z11.number().optional(),
2336
- scroll_direction: z11.enum(["up", "down", "left", "right"]).optional(),
2337
- start_coordinate: z11.tuple([z11.number().int(), z11.number().int()]).optional(),
2338
- text: z11.string().optional()
2654
+ coordinate: z12.tuple([z12.number().int(), z12.number().int()]).optional(),
2655
+ duration: z12.number().optional(),
2656
+ scroll_amount: z12.number().optional(),
2657
+ scroll_direction: z12.enum(["up", "down", "left", "right"]).optional(),
2658
+ start_coordinate: z12.tuple([z12.number().int(), z12.number().int()]).optional(),
2659
+ text: z12.string().optional()
2339
2660
  })
2340
2661
  )
2341
2662
  );
@@ -2345,27 +2666,77 @@ var computer_20250124 = createProviderDefinedToolFactory5({
2345
2666
  inputSchema: computer_20250124InputSchema
2346
2667
  });
2347
2668
 
2348
- // src/tool/text-editor_20241022.ts
2669
+ // src/tool/memory_20250818.ts
2349
2670
  import {
2350
2671
  createProviderDefinedToolFactory as createProviderDefinedToolFactory6,
2351
- lazySchema as lazySchema11,
2352
- zodSchema as zodSchema11
2672
+ lazySchema as lazySchema12,
2673
+ zodSchema as zodSchema12
2353
2674
  } from "@ai-sdk/provider-utils";
2354
- import { z as z12 } from "zod/v4";
2355
- var textEditor_20241022InputSchema = lazySchema11(
2356
- () => zodSchema11(
2357
- z12.object({
2358
- command: z12.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
2359
- path: z12.string(),
2360
- file_text: z12.string().optional(),
2361
- insert_line: z12.number().int().optional(),
2362
- new_str: z12.string().optional(),
2363
- old_str: z12.string().optional(),
2364
- view_range: z12.array(z12.number().int()).optional()
2675
+ import { z as z13 } from "zod/v4";
2676
+ var memory_20250818InputSchema = lazySchema12(
2677
+ () => zodSchema12(
2678
+ z13.discriminatedUnion("command", [
2679
+ z13.object({
2680
+ command: z13.literal("view"),
2681
+ path: z13.string(),
2682
+ view_range: z13.tuple([z13.number(), z13.number()]).optional()
2683
+ }),
2684
+ z13.object({
2685
+ command: z13.literal("create"),
2686
+ path: z13.string(),
2687
+ file_text: z13.string()
2688
+ }),
2689
+ z13.object({
2690
+ command: z13.literal("str_replace"),
2691
+ path: z13.string(),
2692
+ old_str: z13.string(),
2693
+ new_str: z13.string()
2694
+ }),
2695
+ z13.object({
2696
+ command: z13.literal("insert"),
2697
+ path: z13.string(),
2698
+ insert_line: z13.number(),
2699
+ insert_text: z13.string()
2700
+ }),
2701
+ z13.object({
2702
+ command: z13.literal("delete"),
2703
+ path: z13.string()
2704
+ }),
2705
+ z13.object({
2706
+ command: z13.literal("rename"),
2707
+ old_path: z13.string(),
2708
+ new_path: z13.string()
2709
+ })
2710
+ ])
2711
+ )
2712
+ );
2713
+ var memory_20250818 = createProviderDefinedToolFactory6({
2714
+ id: "anthropic.memory_20250818",
2715
+ name: "memory",
2716
+ inputSchema: memory_20250818InputSchema
2717
+ });
2718
+
2719
+ // src/tool/text-editor_20241022.ts
2720
+ import {
2721
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory7,
2722
+ lazySchema as lazySchema13,
2723
+ zodSchema as zodSchema13
2724
+ } from "@ai-sdk/provider-utils";
2725
+ import { z as z14 } from "zod/v4";
2726
+ var textEditor_20241022InputSchema = lazySchema13(
2727
+ () => zodSchema13(
2728
+ z14.object({
2729
+ command: z14.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
2730
+ path: z14.string(),
2731
+ file_text: z14.string().optional(),
2732
+ insert_line: z14.number().int().optional(),
2733
+ new_str: z14.string().optional(),
2734
+ old_str: z14.string().optional(),
2735
+ view_range: z14.array(z14.number().int()).optional()
2365
2736
  })
2366
2737
  )
2367
2738
  );
2368
- var textEditor_20241022 = createProviderDefinedToolFactory6({
2739
+ var textEditor_20241022 = createProviderDefinedToolFactory7({
2369
2740
  id: "anthropic.text_editor_20241022",
2370
2741
  name: "str_replace_editor",
2371
2742
  inputSchema: textEditor_20241022InputSchema
@@ -2373,25 +2744,25 @@ var textEditor_20241022 = createProviderDefinedToolFactory6({
2373
2744
 
2374
2745
  // src/tool/text-editor_20250124.ts
2375
2746
  import {
2376
- createProviderDefinedToolFactory as createProviderDefinedToolFactory7,
2377
- lazySchema as lazySchema12,
2378
- zodSchema as zodSchema12
2747
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory8,
2748
+ lazySchema as lazySchema14,
2749
+ zodSchema as zodSchema14
2379
2750
  } from "@ai-sdk/provider-utils";
2380
- import { z as z13 } from "zod/v4";
2381
- var textEditor_20250124InputSchema = lazySchema12(
2382
- () => zodSchema12(
2383
- z13.object({
2384
- command: z13.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
2385
- path: z13.string(),
2386
- file_text: z13.string().optional(),
2387
- insert_line: z13.number().int().optional(),
2388
- new_str: z13.string().optional(),
2389
- old_str: z13.string().optional(),
2390
- view_range: z13.array(z13.number().int()).optional()
2751
+ import { z as z15 } from "zod/v4";
2752
+ var textEditor_20250124InputSchema = lazySchema14(
2753
+ () => zodSchema14(
2754
+ z15.object({
2755
+ command: z15.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
2756
+ path: z15.string(),
2757
+ file_text: z15.string().optional(),
2758
+ insert_line: z15.number().int().optional(),
2759
+ new_str: z15.string().optional(),
2760
+ old_str: z15.string().optional(),
2761
+ view_range: z15.array(z15.number().int()).optional()
2391
2762
  })
2392
2763
  )
2393
2764
  );
2394
- var textEditor_20250124 = createProviderDefinedToolFactory7({
2765
+ var textEditor_20250124 = createProviderDefinedToolFactory8({
2395
2766
  id: "anthropic.text_editor_20250124",
2396
2767
  name: "str_replace_editor",
2397
2768
  inputSchema: textEditor_20250124InputSchema
@@ -2399,25 +2770,25 @@ var textEditor_20250124 = createProviderDefinedToolFactory7({
2399
2770
 
2400
2771
  // src/tool/text-editor_20250429.ts
2401
2772
  import {
2402
- createProviderDefinedToolFactory as createProviderDefinedToolFactory8,
2403
- lazySchema as lazySchema13,
2404
- zodSchema as zodSchema13
2773
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory9,
2774
+ lazySchema as lazySchema15,
2775
+ zodSchema as zodSchema15
2405
2776
  } from "@ai-sdk/provider-utils";
2406
- import { z as z14 } from "zod/v4";
2407
- var textEditor_20250429InputSchema = lazySchema13(
2408
- () => zodSchema13(
2409
- z14.object({
2410
- command: z14.enum(["view", "create", "str_replace", "insert"]),
2411
- path: z14.string(),
2412
- file_text: z14.string().optional(),
2413
- insert_line: z14.number().int().optional(),
2414
- new_str: z14.string().optional(),
2415
- old_str: z14.string().optional(),
2416
- view_range: z14.array(z14.number().int()).optional()
2777
+ import { z as z16 } from "zod/v4";
2778
+ var textEditor_20250429InputSchema = lazySchema15(
2779
+ () => zodSchema15(
2780
+ z16.object({
2781
+ command: z16.enum(["view", "create", "str_replace", "insert"]),
2782
+ path: z16.string(),
2783
+ file_text: z16.string().optional(),
2784
+ insert_line: z16.number().int().optional(),
2785
+ new_str: z16.string().optional(),
2786
+ old_str: z16.string().optional(),
2787
+ view_range: z16.array(z16.number().int()).optional()
2417
2788
  })
2418
2789
  )
2419
2790
  );
2420
- var textEditor_20250429 = createProviderDefinedToolFactory8({
2791
+ var textEditor_20250429 = createProviderDefinedToolFactory9({
2421
2792
  id: "anthropic.text_editor_20250429",
2422
2793
  name: "str_replace_based_edit_tool",
2423
2794
  inputSchema: textEditor_20250429InputSchema
@@ -2454,6 +2825,19 @@ var anthropicTools = {
2454
2825
  * Tool name must be `code_execution`.
2455
2826
  */
2456
2827
  codeExecution_20250522,
2828
+ /**
2829
+ * Claude can analyze data, create visualizations, perform complex calculations,
2830
+ * run system commands, create and edit files, and process uploaded files directly within
2831
+ * the API conversation.
2832
+ *
2833
+ * The code execution tool allows Claude to run both Python and Bash commands and manipulate files,
2834
+ * including writing code, in a secure, sandboxed environment.
2835
+ *
2836
+ * This is the latest version with enhanced Bash support and file operations.
2837
+ *
2838
+ * Tool name must be `code_execution`.
2839
+ */
2840
+ codeExecution_20250825,
2457
2841
  /**
2458
2842
  * Claude can interact with computer environments through the computer use tool, which
2459
2843
  * provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
@@ -2480,6 +2864,17 @@ var anthropicTools = {
2480
2864
  * @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
2481
2865
  */
2482
2866
  computer_20250124,
2867
+ /**
2868
+ * The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
2869
+ * Claude can create, read, update, and delete files that persist between sessions,
2870
+ * allowing it to build knowledge over time without keeping everything in the context window.
2871
+ * The memory tool operates client-side—you control where and how the data is stored through your own infrastructure.
2872
+ *
2873
+ * Supported models: Claude Sonnet 4.5, Claude Sonnet 4, Claude Opus 4.1, Claude Opus 4.
2874
+ *
2875
+ * Tool name must be `memory`.
2876
+ */
2877
+ memory_20250818,
2483
2878
  /**
2484
2879
  * Claude can use an Anthropic-defined text editor tool to view and modify text files,
2485
2880
  * helping you debug, fix, and improve your code or other text documents. This allows Claude