@ai-sdk/anthropic 2.0.102 → 2.0.103

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
@@ -11,7 +11,7 @@ import {
11
11
  } from "@ai-sdk/provider-utils";
12
12
 
13
13
  // src/version.ts
14
- var VERSION = true ? "2.0.102" : "0.0.0-test";
14
+ var VERSION = true ? "2.0.103" : "0.0.0-test";
15
15
 
16
16
  // src/anthropic-messages-language-model.ts
17
17
  import {
@@ -119,7 +119,9 @@ var anthropicMessagesResponseSchema = lazySchema2(
119
119
  type: z2.literal("tool_use"),
120
120
  id: z2.string(),
121
121
  name: z2.string(),
122
- input: z2.unknown()
122
+ input: z2.unknown(),
123
+ // Toolsets (e.g. computer toolset): name of the toolset this member call belongs to
124
+ toolset_name: z2.string().nullish()
123
125
  }),
124
126
  z2.object({
125
127
  type: z2.literal("server_tool_use"),
@@ -346,7 +348,9 @@ var anthropicMessagesChunkSchema = lazySchema2(
346
348
  z2.object({
347
349
  type: z2.literal("tool_use"),
348
350
  id: z2.string(),
349
- name: z2.string()
351
+ name: z2.string(),
352
+ // Toolsets (e.g. computer toolset): name of the toolset this member call belongs to
353
+ toolset_name: z2.string().nullish()
350
354
  }),
351
355
  z2.object({
352
356
  type: z2.literal("redacted_thinking"),
@@ -673,7 +677,7 @@ var anthropicSystemMessageProviderOptions = z3.object({
673
677
  clearAt: z3.literal("next_user_message").optional(),
674
678
  /**
675
679
  * Overrides the effort for the turn following this mid-conversation system
676
- * message. The required `mid-conversation-effort-2026-08-01` beta is added
680
+ * message. The required `mid-conversation-output-config-2026-07-01` beta is added
677
681
  * automatically.
678
682
  */
679
683
  effort: z3.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
@@ -724,7 +728,7 @@ var anthropicProviderOptions = z3.object({
724
728
  *
725
729
  * - `outputFormat`: Use the `output_format` parameter to specify the structured output format.
726
730
  * - `jsonTool`: Use a special JSON response tool to specify the structured output format (default for most models).
727
- * - `auto`: Use 'outputFormat' when supported, otherwise use 'jsonTool' (default for Fable 5.1).
731
+ * - `auto`: Use 'outputFormat' when supported, otherwise use 'jsonTool' (default for Opus 5.5 and Fable 5.1).
728
732
  */
729
733
  structuredOutputMode: z3.enum(["outputFormat", "jsonTool", "auto"]).optional(),
730
734
  /**
@@ -732,6 +736,11 @@ var anthropicProviderOptions = z3.object({
732
736
  *
733
737
  * When enabled, responses include thinking content blocks showing Claude's thinking process before the final answer.
734
738
  * Requires a minimum budget of 1,024 tokens and counts towards the `max_tokens` limit.
739
+ *
740
+ * Models that always use adaptive thinking (e.g. `claude-opus-5-5`,
741
+ * `claude-fable-5-1`) reject `enabled` and `disabled`. For those models the
742
+ * provider drops the unsupported setting, emits a warning, and sends an
743
+ * adaptive thinking request. Use `effort` to control how much they think.
735
744
  */
736
745
  thinking: z3.union([
737
746
  z3.object({
@@ -979,34 +988,99 @@ var CacheControlValidator = class {
979
988
  }
980
989
  };
981
990
 
982
- // src/tool/text-editor_20250728.ts
991
+ // src/tool/computer-toolset_20260801.ts
983
992
  import {
984
993
  createProviderDefinedToolFactory,
985
994
  lazySchema as lazySchema3,
986
995
  zodSchema as zodSchema3
987
996
  } from "@ai-sdk/provider-utils";
988
997
  import { z as z4 } from "zod/v4";
989
- var textEditor_20250728ArgsSchema = lazySchema3(
998
+ var computerToolset_20260801Members = [
999
+ "screenshot",
1000
+ "zoom",
1001
+ "left_click",
1002
+ "right_click",
1003
+ "middle_click",
1004
+ "double_click",
1005
+ "triple_click",
1006
+ "left_click_drag",
1007
+ "mouse_move",
1008
+ "left_mouse_down",
1009
+ "left_mouse_up",
1010
+ "cursor_position",
1011
+ "scroll",
1012
+ "type",
1013
+ "key",
1014
+ "hold_key",
1015
+ "wait"
1016
+ ];
1017
+ var computerToolset_20260801InputSchema = lazySchema3(
990
1018
  () => zodSchema3(
991
1019
  z4.object({
992
- maxCharacters: z4.number().optional()
1020
+ action: z4.enum(computerToolset_20260801Members),
1021
+ coordinate: z4.tuple([z4.number().int(), z4.number().int()]).optional(),
1022
+ duration: z4.number().optional(),
1023
+ region: z4.tuple([
1024
+ z4.number().int(),
1025
+ z4.number().int(),
1026
+ z4.number().int(),
1027
+ z4.number().int()
1028
+ ]).optional(),
1029
+ repeat: z4.number().int().optional(),
1030
+ scroll_amount: z4.number().optional(),
1031
+ scroll_direction: z4.enum(["up", "down", "left", "right"]).optional(),
1032
+ start_coordinate: z4.tuple([z4.number().int(), z4.number().int()]).optional(),
1033
+ text: z4.string().optional()
993
1034
  })
994
1035
  )
995
1036
  );
996
- var textEditor_20250728InputSchema = lazySchema3(
1037
+ var computerToolset_20260801ArgsSchema = lazySchema3(
997
1038
  () => zodSchema3(
998
1039
  z4.object({
999
- command: z4.enum(["view", "create", "str_replace", "insert"]),
1000
- path: z4.string(),
1001
- file_text: z4.string().optional(),
1002
- insert_line: z4.number().int().optional(),
1003
- new_str: z4.string().optional(),
1004
- old_str: z4.string().optional(),
1005
- view_range: z4.array(z4.number().int()).optional()
1040
+ configs: z4.partialRecord(
1041
+ z4.enum(computerToolset_20260801Members),
1042
+ z4.object({
1043
+ enabled: z4.boolean().optional(),
1044
+ deferLoading: z4.boolean().optional()
1045
+ })
1046
+ ).optional()
1047
+ })
1048
+ )
1049
+ );
1050
+ var computerToolset_20260801 = createProviderDefinedToolFactory({
1051
+ id: "anthropic.computer_toolset_20260801",
1052
+ name: "computer",
1053
+ inputSchema: computerToolset_20260801InputSchema
1054
+ });
1055
+
1056
+ // src/tool/text-editor_20250728.ts
1057
+ import {
1058
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory2,
1059
+ lazySchema as lazySchema4,
1060
+ zodSchema as zodSchema4
1061
+ } from "@ai-sdk/provider-utils";
1062
+ import { z as z5 } from "zod/v4";
1063
+ var textEditor_20250728ArgsSchema = lazySchema4(
1064
+ () => zodSchema4(
1065
+ z5.object({
1066
+ maxCharacters: z5.number().optional()
1006
1067
  })
1007
1068
  )
1008
1069
  );
1009
- var factory = createProviderDefinedToolFactory({
1070
+ var textEditor_20250728InputSchema = lazySchema4(
1071
+ () => zodSchema4(
1072
+ z5.object({
1073
+ command: z5.enum(["view", "create", "str_replace", "insert"]),
1074
+ path: z5.string(),
1075
+ file_text: z5.string().optional(),
1076
+ insert_line: z5.number().int().optional(),
1077
+ new_str: z5.string().optional(),
1078
+ old_str: z5.string().optional(),
1079
+ view_range: z5.array(z5.number().int()).optional()
1080
+ })
1081
+ )
1082
+ );
1083
+ var factory = createProviderDefinedToolFactory2({
1010
1084
  id: "anthropic.text_editor_20250728",
1011
1085
  name: "str_replace_based_edit_tool",
1012
1086
  inputSchema: textEditor_20250728InputSchema
@@ -1018,43 +1092,43 @@ var textEditor_20250728 = (args = {}) => {
1018
1092
  // src/tool/web-search_20250305.ts
1019
1093
  import {
1020
1094
  createProviderDefinedToolFactoryWithOutputSchema,
1021
- lazySchema as lazySchema4,
1022
- zodSchema as zodSchema4
1095
+ lazySchema as lazySchema5,
1096
+ zodSchema as zodSchema5
1023
1097
  } from "@ai-sdk/provider-utils";
1024
- import { z as z5 } from "zod/v4";
1025
- var webSearch_20250305ArgsSchema = lazySchema4(
1026
- () => zodSchema4(
1027
- z5.object({
1028
- maxUses: z5.number().optional(),
1029
- allowedDomains: z5.array(z5.string()).optional(),
1030
- blockedDomains: z5.array(z5.string()).optional(),
1031
- userLocation: z5.object({
1032
- type: z5.literal("approximate"),
1033
- city: z5.string().optional(),
1034
- region: z5.string().optional(),
1035
- country: z5.string().optional(),
1036
- timezone: z5.string().optional()
1098
+ import { z as z6 } from "zod/v4";
1099
+ var webSearch_20250305ArgsSchema = lazySchema5(
1100
+ () => zodSchema5(
1101
+ z6.object({
1102
+ maxUses: z6.number().optional(),
1103
+ allowedDomains: z6.array(z6.string()).optional(),
1104
+ blockedDomains: z6.array(z6.string()).optional(),
1105
+ userLocation: z6.object({
1106
+ type: z6.literal("approximate"),
1107
+ city: z6.string().optional(),
1108
+ region: z6.string().optional(),
1109
+ country: z6.string().optional(),
1110
+ timezone: z6.string().optional()
1037
1111
  }).optional()
1038
1112
  })
1039
1113
  )
1040
1114
  );
1041
- var webSearch_20250305OutputSchema = lazySchema4(
1042
- () => zodSchema4(
1043
- z5.array(
1044
- z5.object({
1045
- url: z5.string(),
1046
- title: z5.string().nullable(),
1047
- pageAge: z5.string().nullable(),
1048
- encryptedContent: z5.string(),
1049
- type: z5.literal("web_search_result")
1115
+ var webSearch_20250305OutputSchema = lazySchema5(
1116
+ () => zodSchema5(
1117
+ z6.array(
1118
+ z6.object({
1119
+ url: z6.string(),
1120
+ title: z6.string().nullable(),
1121
+ pageAge: z6.string().nullable(),
1122
+ encryptedContent: z6.string(),
1123
+ type: z6.literal("web_search_result")
1050
1124
  })
1051
1125
  )
1052
1126
  )
1053
1127
  );
1054
- var webSearch_20250305InputSchema = lazySchema4(
1055
- () => zodSchema4(
1056
- z5.object({
1057
- query: z5.string()
1128
+ var webSearch_20250305InputSchema = lazySchema5(
1129
+ () => zodSchema5(
1130
+ z6.object({
1131
+ query: z6.string()
1058
1132
  })
1059
1133
  )
1060
1134
  );
@@ -1071,51 +1145,51 @@ var webSearch_20250305 = (args = {}) => {
1071
1145
  // src/tool/web-fetch-20250910.ts
1072
1146
  import {
1073
1147
  createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema2,
1074
- lazySchema as lazySchema5,
1075
- zodSchema as zodSchema5
1148
+ lazySchema as lazySchema6,
1149
+ zodSchema as zodSchema6
1076
1150
  } from "@ai-sdk/provider-utils";
1077
- import { z as z6 } from "zod/v4";
1078
- var webFetch_20250910ArgsSchema = lazySchema5(
1079
- () => zodSchema5(
1080
- z6.object({
1081
- maxUses: z6.number().optional(),
1082
- allowedDomains: z6.array(z6.string()).optional(),
1083
- blockedDomains: z6.array(z6.string()).optional(),
1084
- citations: z6.object({ enabled: z6.boolean() }).optional(),
1085
- maxContentTokens: z6.number().optional()
1151
+ import { z as z7 } from "zod/v4";
1152
+ var webFetch_20250910ArgsSchema = lazySchema6(
1153
+ () => zodSchema6(
1154
+ z7.object({
1155
+ maxUses: z7.number().optional(),
1156
+ allowedDomains: z7.array(z7.string()).optional(),
1157
+ blockedDomains: z7.array(z7.string()).optional(),
1158
+ citations: z7.object({ enabled: z7.boolean() }).optional(),
1159
+ maxContentTokens: z7.number().optional()
1086
1160
  })
1087
1161
  )
1088
1162
  );
1089
- var webFetch_20250910OutputSchema = lazySchema5(
1090
- () => zodSchema5(
1091
- z6.object({
1092
- type: z6.literal("web_fetch_result"),
1093
- url: z6.string(),
1094
- content: z6.object({
1095
- type: z6.literal("document"),
1096
- title: z6.string().nullable(),
1097
- citations: z6.object({ enabled: z6.boolean() }).optional(),
1098
- source: z6.union([
1099
- z6.object({
1100
- type: z6.literal("base64"),
1101
- mediaType: z6.literal("application/pdf"),
1102
- data: z6.string()
1163
+ var webFetch_20250910OutputSchema = lazySchema6(
1164
+ () => zodSchema6(
1165
+ z7.object({
1166
+ type: z7.literal("web_fetch_result"),
1167
+ url: z7.string(),
1168
+ content: z7.object({
1169
+ type: z7.literal("document"),
1170
+ title: z7.string().nullable(),
1171
+ citations: z7.object({ enabled: z7.boolean() }).optional(),
1172
+ source: z7.union([
1173
+ z7.object({
1174
+ type: z7.literal("base64"),
1175
+ mediaType: z7.literal("application/pdf"),
1176
+ data: z7.string()
1103
1177
  }),
1104
- z6.object({
1105
- type: z6.literal("text"),
1106
- mediaType: z6.literal("text/plain"),
1107
- data: z6.string()
1178
+ z7.object({
1179
+ type: z7.literal("text"),
1180
+ mediaType: z7.literal("text/plain"),
1181
+ data: z7.string()
1108
1182
  })
1109
1183
  ])
1110
1184
  }),
1111
- retrievedAt: z6.string().nullable()
1185
+ retrievedAt: z7.string().nullable()
1112
1186
  })
1113
1187
  )
1114
1188
  );
1115
- var webFetch_20250910InputSchema = lazySchema5(
1116
- () => zodSchema5(
1117
- z6.object({
1118
- url: z6.string()
1189
+ var webFetch_20250910InputSchema = lazySchema6(
1190
+ () => zodSchema6(
1191
+ z7.object({
1192
+ url: z7.string()
1119
1193
  })
1120
1194
  )
1121
1195
  );
@@ -1135,7 +1209,8 @@ async function prepareTools({
1135
1209
  tools,
1136
1210
  toolChoice,
1137
1211
  disableParallelToolUse,
1138
- cacheControlValidator
1212
+ cacheControlValidator,
1213
+ rejectsForcedToolUse = false
1139
1214
  }) {
1140
1215
  var _a;
1141
1216
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
@@ -1190,6 +1265,31 @@ async function prepareTools({
1190
1265
  });
1191
1266
  break;
1192
1267
  }
1268
+ case "anthropic.computer_toolset_20260801": {
1269
+ const args = await validateTypes({
1270
+ value: tool.args,
1271
+ schema: computerToolset_20260801ArgsSchema
1272
+ });
1273
+ const configs = args.configs != null ? Object.fromEntries(
1274
+ Object.entries(args.configs).map(([member, config]) => [
1275
+ member,
1276
+ {
1277
+ ...(config == null ? void 0 : config.enabled) != null && {
1278
+ enabled: config.enabled
1279
+ },
1280
+ ...(config == null ? void 0 : config.deferLoading) != null && {
1281
+ defer_loading: config.deferLoading
1282
+ }
1283
+ }
1284
+ ])
1285
+ ) : void 0;
1286
+ anthropicTools2.push({
1287
+ type: "computer_toolset_20260801",
1288
+ ...configs != null && { configs },
1289
+ cache_control: void 0
1290
+ });
1291
+ break;
1292
+ }
1193
1293
  case "anthropic.computer_20250124": {
1194
1294
  betas.add("computer-use-2025-01-24");
1195
1295
  anthropicTools2.push({
@@ -1348,6 +1448,22 @@ async function prepareTools({
1348
1448
  betas
1349
1449
  };
1350
1450
  case "required":
1451
+ if (rejectsForcedToolUse) {
1452
+ toolWarnings.push({
1453
+ type: "unsupported-setting",
1454
+ setting: "toolChoice",
1455
+ details: `toolChoice 'required' is not supported by this model because it rejects forced tool use. Using 'auto' instead. Instruct the model to use a tool in the prompt and verify that a tool call was made.`
1456
+ });
1457
+ return {
1458
+ tools: anthropicTools2,
1459
+ toolChoice: {
1460
+ type: "auto",
1461
+ disable_parallel_tool_use: disableParallelToolUse
1462
+ },
1463
+ toolWarnings,
1464
+ betas
1465
+ };
1466
+ }
1351
1467
  return {
1352
1468
  tools: anthropicTools2,
1353
1469
  toolChoice: {
@@ -1360,6 +1476,24 @@ async function prepareTools({
1360
1476
  case "none":
1361
1477
  return { tools: void 0, toolChoice: void 0, toolWarnings, betas };
1362
1478
  case "tool":
1479
+ if (rejectsForcedToolUse) {
1480
+ toolWarnings.push({
1481
+ type: "unsupported-setting",
1482
+ setting: "toolChoice",
1483
+ details: `toolChoice 'tool' is not supported by this model because it rejects forced tool use. Only the '${toolChoice.toolName}' tool is sent with 'auto' tool choice. Instruct the model to use the tool in the prompt and verify that a tool call was made.`
1484
+ });
1485
+ return {
1486
+ tools: anthropicTools2.filter(
1487
+ (tool) => "name" in tool && tool.name === toolChoice.toolName
1488
+ ),
1489
+ toolChoice: {
1490
+ type: "auto",
1491
+ disable_parallel_tool_use: disableParallelToolUse
1492
+ },
1493
+ toolWarnings,
1494
+ betas
1495
+ };
1496
+ }
1363
1497
  return {
1364
1498
  tools: anthropicTools2,
1365
1499
  toolChoice: {
@@ -1392,24 +1526,24 @@ import {
1392
1526
  // src/tool/code-execution_20250522.ts
1393
1527
  import {
1394
1528
  createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema3,
1395
- lazySchema as lazySchema6,
1396
- zodSchema as zodSchema6
1529
+ lazySchema as lazySchema7,
1530
+ zodSchema as zodSchema7
1397
1531
  } from "@ai-sdk/provider-utils";
1398
- import { z as z7 } from "zod/v4";
1399
- var codeExecution_20250522OutputSchema = lazySchema6(
1400
- () => zodSchema6(
1401
- z7.object({
1402
- type: z7.literal("code_execution_result"),
1403
- stdout: z7.string(),
1404
- stderr: z7.string(),
1405
- return_code: z7.number()
1532
+ import { z as z8 } from "zod/v4";
1533
+ var codeExecution_20250522OutputSchema = lazySchema7(
1534
+ () => zodSchema7(
1535
+ z8.object({
1536
+ type: z8.literal("code_execution_result"),
1537
+ stdout: z8.string(),
1538
+ stderr: z8.string(),
1539
+ return_code: z8.number()
1406
1540
  })
1407
1541
  )
1408
1542
  );
1409
- var codeExecution_20250522InputSchema = lazySchema6(
1410
- () => zodSchema6(
1411
- z7.object({
1412
- code: z7.string()
1543
+ var codeExecution_20250522InputSchema = lazySchema7(
1544
+ () => zodSchema7(
1545
+ z8.object({
1546
+ code: z8.string()
1413
1547
  })
1414
1548
  )
1415
1549
  );
@@ -1426,81 +1560,81 @@ var codeExecution_20250522 = (args = {}) => {
1426
1560
  // src/tool/code-execution_20250825.ts
1427
1561
  import {
1428
1562
  createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema4,
1429
- lazySchema as lazySchema7,
1430
- zodSchema as zodSchema7
1563
+ lazySchema as lazySchema8,
1564
+ zodSchema as zodSchema8
1431
1565
  } from "@ai-sdk/provider-utils";
1432
- import { z as z8 } from "zod/v4";
1433
- var codeExecution_20250825OutputSchema = lazySchema7(
1434
- () => zodSchema7(
1435
- z8.discriminatedUnion("type", [
1436
- z8.object({
1437
- type: z8.literal("bash_code_execution_result"),
1438
- content: z8.array(
1439
- z8.object({
1440
- type: z8.literal("bash_code_execution_output"),
1441
- file_id: z8.string()
1566
+ import { z as z9 } from "zod/v4";
1567
+ var codeExecution_20250825OutputSchema = lazySchema8(
1568
+ () => zodSchema8(
1569
+ z9.discriminatedUnion("type", [
1570
+ z9.object({
1571
+ type: z9.literal("bash_code_execution_result"),
1572
+ content: z9.array(
1573
+ z9.object({
1574
+ type: z9.literal("bash_code_execution_output"),
1575
+ file_id: z9.string()
1442
1576
  })
1443
1577
  ),
1444
- stdout: z8.string(),
1445
- stderr: z8.string(),
1446
- return_code: z8.number()
1578
+ stdout: z9.string(),
1579
+ stderr: z9.string(),
1580
+ return_code: z9.number()
1447
1581
  }),
1448
- z8.object({
1449
- type: z8.literal("bash_code_execution_tool_result_error"),
1450
- error_code: z8.string()
1582
+ z9.object({
1583
+ type: z9.literal("bash_code_execution_tool_result_error"),
1584
+ error_code: z9.string()
1451
1585
  }),
1452
- z8.object({
1453
- type: z8.literal("text_editor_code_execution_tool_result_error"),
1454
- error_code: z8.string()
1586
+ z9.object({
1587
+ type: z9.literal("text_editor_code_execution_tool_result_error"),
1588
+ error_code: z9.string()
1455
1589
  }),
1456
- z8.object({
1457
- type: z8.literal("text_editor_code_execution_view_result"),
1458
- content: z8.string(),
1459
- file_type: z8.string(),
1460
- num_lines: z8.number().nullable(),
1461
- start_line: z8.number().nullable(),
1462
- total_lines: z8.number().nullable()
1590
+ z9.object({
1591
+ type: z9.literal("text_editor_code_execution_view_result"),
1592
+ content: z9.string(),
1593
+ file_type: z9.string(),
1594
+ num_lines: z9.number().nullable(),
1595
+ start_line: z9.number().nullable(),
1596
+ total_lines: z9.number().nullable()
1463
1597
  }),
1464
- z8.object({
1465
- type: z8.literal("text_editor_code_execution_create_result"),
1466
- is_file_update: z8.boolean()
1598
+ z9.object({
1599
+ type: z9.literal("text_editor_code_execution_create_result"),
1600
+ is_file_update: z9.boolean()
1467
1601
  }),
1468
- z8.object({
1469
- type: z8.literal("text_editor_code_execution_str_replace_result"),
1470
- lines: z8.array(z8.string()).nullable(),
1471
- new_lines: z8.number().nullable(),
1472
- new_start: z8.number().nullable(),
1473
- old_lines: z8.number().nullable(),
1474
- old_start: z8.number().nullable()
1602
+ z9.object({
1603
+ type: z9.literal("text_editor_code_execution_str_replace_result"),
1604
+ lines: z9.array(z9.string()).nullable(),
1605
+ new_lines: z9.number().nullable(),
1606
+ new_start: z9.number().nullable(),
1607
+ old_lines: z9.number().nullable(),
1608
+ old_start: z9.number().nullable()
1475
1609
  })
1476
1610
  ])
1477
1611
  )
1478
1612
  );
1479
- var codeExecution_20250825InputSchema = lazySchema7(
1480
- () => zodSchema7(
1481
- z8.discriminatedUnion("type", [
1482
- z8.object({
1483
- type: z8.literal("bash_code_execution"),
1484
- command: z8.string()
1613
+ var codeExecution_20250825InputSchema = lazySchema8(
1614
+ () => zodSchema8(
1615
+ z9.discriminatedUnion("type", [
1616
+ z9.object({
1617
+ type: z9.literal("bash_code_execution"),
1618
+ command: z9.string()
1485
1619
  }),
1486
- z8.discriminatedUnion("command", [
1487
- z8.object({
1488
- type: z8.literal("text_editor_code_execution"),
1489
- command: z8.literal("view"),
1490
- path: z8.string()
1620
+ z9.discriminatedUnion("command", [
1621
+ z9.object({
1622
+ type: z9.literal("text_editor_code_execution"),
1623
+ command: z9.literal("view"),
1624
+ path: z9.string()
1491
1625
  }),
1492
- z8.object({
1493
- type: z8.literal("text_editor_code_execution"),
1494
- command: z8.literal("create"),
1495
- path: z8.string(),
1496
- file_text: z8.string().nullish()
1626
+ z9.object({
1627
+ type: z9.literal("text_editor_code_execution"),
1628
+ command: z9.literal("create"),
1629
+ path: z9.string(),
1630
+ file_text: z9.string().nullish()
1497
1631
  }),
1498
- z8.object({
1499
- type: z8.literal("text_editor_code_execution"),
1500
- command: z8.literal("str_replace"),
1501
- path: z8.string(),
1502
- old_str: z8.string(),
1503
- new_str: z8.string()
1632
+ z9.object({
1633
+ type: z9.literal("text_editor_code_execution"),
1634
+ command: z9.literal("str_replace"),
1635
+ path: z9.string(),
1636
+ old_str: z9.string(),
1637
+ new_str: z9.string()
1504
1638
  })
1505
1639
  ])
1506
1640
  ])
@@ -1537,7 +1671,8 @@ async function convertToAnthropicMessagesPrompt({
1537
1671
  prompt,
1538
1672
  sendReasoning,
1539
1673
  warnings,
1540
- cacheControlValidator
1674
+ cacheControlValidator,
1675
+ toolsetNames = {}
1541
1676
  }) {
1542
1677
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
1543
1678
  const betas = /* @__PURE__ */ new Set();
@@ -1631,7 +1766,7 @@ async function convertToAnthropicMessagesPrompt({
1631
1766
  betas.add("mid-conversation-system-clear-at-2026-08-21");
1632
1767
  }
1633
1768
  if (effort != null) {
1634
- betas.add("mid-conversation-effort-2026-08-01");
1769
+ betas.add("mid-conversation-output-config-2026-07-01");
1635
1770
  }
1636
1771
  }
1637
1772
  break;
@@ -1796,9 +1931,15 @@ async function convertToAnthropicMessagesPrompt({
1796
1931
  contentValue = JSON.stringify(output.value);
1797
1932
  break;
1798
1933
  }
1934
+ const toolsetName = getAnthropicToolsetName({
1935
+ toolName: part.toolName,
1936
+ providerOptions: part.providerOptions,
1937
+ toolsetNames
1938
+ });
1799
1939
  anthropicContent.push({
1800
1940
  type: "tool_result",
1801
1941
  tool_use_id: part.toolCallId,
1942
+ ...toolsetName != null && { toolset_name: toolsetName },
1802
1943
  content: contentValue,
1803
1944
  is_error: output.type === "error-text" || output.type === "error-json" ? true : void 0,
1804
1945
  cache_control: cacheControl
@@ -1933,6 +2074,30 @@ async function convertToAnthropicMessagesPrompt({
1933
2074
  }
1934
2075
  break;
1935
2076
  }
2077
+ const toolsetName = getAnthropicToolsetName({
2078
+ toolName: part.toolName,
2079
+ providerOptions: part.providerOptions,
2080
+ toolsetNames
2081
+ });
2082
+ if (toolsetName != null) {
2083
+ const { action, ...memberInput } = typeof part.input === "object" && part.input !== null && !Array.isArray(part.input) ? part.input : {};
2084
+ if (typeof action !== "string") {
2085
+ warnings.push({
2086
+ type: "other",
2087
+ message: `toolset tool call for tool ${part.toolName} is missing the action`
2088
+ });
2089
+ break;
2090
+ }
2091
+ anthropicContent.push({
2092
+ type: "tool_use",
2093
+ id: part.toolCallId,
2094
+ name: action,
2095
+ toolset_name: toolsetName,
2096
+ input: memberInput,
2097
+ cache_control: cacheControl
2098
+ });
2099
+ break;
2100
+ }
1936
2101
  anthropicContent.push({
1937
2102
  type: "tool_use",
1938
2103
  id: part.toolCallId,
@@ -2159,6 +2324,19 @@ function moveToolUseBlocksToEnd(content) {
2159
2324
  flushSegment();
2160
2325
  return result;
2161
2326
  }
2327
+ function getAnthropicToolsetName({
2328
+ toolName,
2329
+ providerOptions,
2330
+ toolsetNames
2331
+ }) {
2332
+ var _a;
2333
+ const fromTools = toolsetNames[toolName];
2334
+ if (fromTools != null) {
2335
+ return fromTools;
2336
+ }
2337
+ const fromMetadata = (_a = providerOptions == null ? void 0 : providerOptions.anthropic) == null ? void 0 : _a.toolsetName;
2338
+ return typeof fromMetadata === "string" ? fromMetadata : void 0;
2339
+ }
2162
2340
 
2163
2341
  // src/map-anthropic-stop-reason.ts
2164
2342
  function mapAnthropicStopReason({
@@ -2330,6 +2508,24 @@ function isPlainObject(value) {
2330
2508
  }
2331
2509
 
2332
2510
  // src/anthropic-messages-language-model.ts
2511
+ function getAnthropicToolsetNames(tools) {
2512
+ const toolsetNames = {};
2513
+ for (const tool of tools != null ? tools : []) {
2514
+ if (tool.type === "provider-defined" && tool.id === "anthropic.computer_toolset_20260801") {
2515
+ toolsetNames[tool.name] = "computer";
2516
+ }
2517
+ }
2518
+ return toolsetNames;
2519
+ }
2520
+ function toToolsetMemberInput({
2521
+ memberName,
2522
+ input
2523
+ }) {
2524
+ return {
2525
+ action: memberName,
2526
+ ...typeof input === "object" && input !== null && !Array.isArray(input) ? input : {}
2527
+ };
2528
+ }
2333
2529
  function getJsonResponseToolName(tools) {
2334
2530
  const toolNames = new Set(tools == null ? void 0 : tools.map((tool) => tool.name));
2335
2531
  let name = "json";
@@ -2456,6 +2652,8 @@ var AnthropicMessagesLanguageModel = class {
2456
2652
  supportsStructuredOutput,
2457
2653
  rejectsSamplingParameters,
2458
2654
  rejectsThinkingDisabledAboveHighEffort,
2655
+ rejectsThinkingDisabled,
2656
+ rejectsForcedToolUse,
2459
2657
  isKnownModel
2460
2658
  } = getModelCapabilities(this.modelId);
2461
2659
  if (!isKnownModel && maxOutputTokens == null) {
@@ -2491,8 +2689,16 @@ var AnthropicMessagesLanguageModel = class {
2491
2689
  }
2492
2690
  }
2493
2691
  const isAnthropicModel = isKnownModel || this.modelId.includes("claude-");
2494
- const structureOutputMode = (_a = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _a : this.modelId.includes("claude-fable-5-1") ? "auto" : "jsonTool";
2495
- const useStructuredOutput = structureOutputMode === "outputFormat" || structureOutputMode === "auto" && supportsStructuredOutput;
2692
+ const structureOutputMode = (_a = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _a : this.modelId.includes("claude-fable-5-1") || this.modelId.includes("claude-opus-5-5") ? "auto" : "jsonTool";
2693
+ let useStructuredOutput = structureOutputMode === "outputFormat" || structureOutputMode === "auto" && supportsStructuredOutput;
2694
+ if (!useStructuredOutput && rejectsForcedToolUse && supportsStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null) {
2695
+ warnings.push({
2696
+ type: "unsupported-setting",
2697
+ setting: "providerOptions.anthropic.structuredOutputMode",
2698
+ details: `structuredOutputMode 'jsonTool' is not supported by ${this.modelId} because it rejects forced tool use. Using 'outputFormat' instead.`
2699
+ });
2700
+ useStructuredOutput = true;
2701
+ }
2496
2702
  const jsonResponseToolName = getJsonResponseToolName(tools);
2497
2703
  const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !useStructuredOutput ? {
2498
2704
  type: "function",
@@ -2508,12 +2714,37 @@ var AnthropicMessagesLanguageModel = class {
2508
2714
  });
2509
2715
  }
2510
2716
  const cacheControlValidator = new CacheControlValidator();
2717
+ const toolsetNames = getAnthropicToolsetNames(tools);
2511
2718
  const { prompt: messagesPrompt, betas } = await convertToAnthropicMessagesPrompt({
2512
2719
  prompt,
2513
2720
  sendReasoning: (_b = anthropicOptions == null ? void 0 : anthropicOptions.sendReasoning) != null ? _b : true,
2514
2721
  warnings,
2515
- cacheControlValidator
2722
+ cacheControlValidator,
2723
+ toolsetNames
2516
2724
  });
2725
+ if (rejectsThinkingDisabled && (anthropicOptions == null ? void 0 : anthropicOptions.thinking) != null) {
2726
+ const thinking = anthropicOptions.thinking;
2727
+ if ("type" in thinking && thinking.type === "disabled") {
2728
+ warnings.push({
2729
+ type: "unsupported-setting",
2730
+ setting: "providerOptions.anthropic.thinking",
2731
+ details: `thinking cannot be disabled for ${this.modelId}; it always uses adaptive thinking. The thinking setting has been removed. Lower 'effort' to reduce thinking.`
2732
+ });
2733
+ anthropicOptions.thinking = void 0;
2734
+ } else if ("type" in thinking && thinking.type === "enabled") {
2735
+ warnings.push({
2736
+ type: "unsupported-setting",
2737
+ setting: "providerOptions.anthropic.thinking",
2738
+ details: `budget-based thinking is not supported by ${this.modelId}; it always uses adaptive thinking. Using adaptive thinking instead. Use 'effort' to control how much the model thinks.`
2739
+ });
2740
+ anthropicOptions.thinking = {
2741
+ type: "adaptive",
2742
+ ...thinking.blockBinding != null && {
2743
+ blockBinding: thinking.blockBinding
2744
+ }
2745
+ };
2746
+ }
2747
+ }
2517
2748
  const thinkingOptions = anthropicOptions == null ? void 0 : anthropicOptions.thinking;
2518
2749
  const thinkingType = thinkingOptions != null && "type" in thinkingOptions ? thinkingOptions.type : void 0;
2519
2750
  if (rejectsThinkingDisabledAboveHighEffort && thinkingType === "disabled" && anthropicOptions != null && (anthropicOptions.effort === "xhigh" || anthropicOptions.effort === "max")) {
@@ -2755,12 +2986,14 @@ var AnthropicMessagesLanguageModel = class {
2755
2986
  tools: [...tools != null ? tools : [], jsonResponseTool],
2756
2987
  toolChoice: tools != null && tools.length > 0 ? { type: "required" } : { type: "tool", toolName: jsonResponseTool.name },
2757
2988
  disableParallelToolUse: true,
2758
- cacheControlValidator
2989
+ cacheControlValidator,
2990
+ rejectsForcedToolUse
2759
2991
  } : {
2760
2992
  tools: tools != null ? tools : [],
2761
2993
  toolChoice,
2762
2994
  disableParallelToolUse: anthropicOptions == null ? void 0 : anthropicOptions.disableParallelToolUse,
2763
- cacheControlValidator
2995
+ cacheControlValidator,
2996
+ rejectsForcedToolUse
2764
2997
  }
2765
2998
  );
2766
2999
  const cacheWarnings = cacheControlValidator.getWarnings();
@@ -2934,6 +3167,21 @@ var AnthropicMessagesLanguageModel = class {
2934
3167
  type: "text",
2935
3168
  text: JSON.stringify(part.input)
2936
3169
  });
3170
+ } else if (part.toolset_name != null) {
3171
+ content.push({
3172
+ type: "tool-call",
3173
+ toolCallId: part.id,
3174
+ toolName: part.toolset_name,
3175
+ input: JSON.stringify(
3176
+ toToolsetMemberInput({
3177
+ memberName: part.name,
3178
+ input: part.input
3179
+ })
3180
+ ),
3181
+ providerMetadata: {
3182
+ anthropic: { toolsetName: part.toolset_name }
3183
+ }
3184
+ });
2937
3185
  } else {
2938
3186
  content.push({
2939
3187
  type: "tool-call",
@@ -3318,6 +3566,23 @@ var AnthropicMessagesLanguageModel = class {
3318
3566
  type: "text-start",
3319
3567
  id: String(value.index)
3320
3568
  });
3569
+ } else if (value.content_block.toolset_name != null) {
3570
+ contentBlocks[value.index] = {
3571
+ type: "tool-call",
3572
+ toolCallId: value.content_block.id,
3573
+ toolName: value.content_block.toolset_name,
3574
+ input: "",
3575
+ firstDelta: true,
3576
+ toolset: {
3577
+ name: value.content_block.toolset_name,
3578
+ memberName: value.content_block.name
3579
+ }
3580
+ };
3581
+ controller.enqueue({
3582
+ type: "tool-input-start",
3583
+ id: value.content_block.id,
3584
+ toolName: value.content_block.toolset_name
3585
+ });
3321
3586
  } else {
3322
3587
  contentBlocks[value.index] = {
3323
3588
  type: "tool-call",
@@ -3528,6 +3793,25 @@ var AnthropicMessagesLanguageModel = class {
3528
3793
  break;
3529
3794
  }
3530
3795
  case "tool-call": {
3796
+ if (contentBlock.toolset != null) {
3797
+ let memberInput = {};
3798
+ try {
3799
+ memberInput = contentBlock.input === "" ? {} : JSON.parse(contentBlock.input);
3800
+ } catch (e) {
3801
+ memberInput = void 0;
3802
+ }
3803
+ contentBlock.input = memberInput === void 0 ? contentBlock.input : JSON.stringify(
3804
+ toToolsetMemberInput({
3805
+ memberName: contentBlock.toolset.memberName,
3806
+ input: memberInput
3807
+ })
3808
+ );
3809
+ controller.enqueue({
3810
+ type: "tool-input-delta",
3811
+ id: contentBlock.toolCallId,
3812
+ delta: contentBlock.input
3813
+ });
3814
+ }
3531
3815
  controller.enqueue({
3532
3816
  type: "tool-input-end",
3533
3817
  id: contentBlock.toolCallId
@@ -3538,7 +3822,12 @@ var AnthropicMessagesLanguageModel = class {
3538
3822
  toolCallId: contentBlock.toolCallId,
3539
3823
  toolName,
3540
3824
  input: contentBlock.input === "" ? "{}" : contentBlock.input,
3541
- providerExecuted: contentBlock.providerExecuted
3825
+ providerExecuted: contentBlock.providerExecuted,
3826
+ ...contentBlock.toolset && {
3827
+ providerMetadata: {
3828
+ anthropic: { toolsetName: contentBlock.toolset.name }
3829
+ }
3830
+ }
3542
3831
  });
3543
3832
  break;
3544
3833
  }
@@ -3611,6 +3900,10 @@ var AnthropicMessagesLanguageModel = class {
3611
3900
  if ((contentBlock == null ? void 0 : contentBlock.type) !== "tool-call") {
3612
3901
  return;
3613
3902
  }
3903
+ if (contentBlock.toolset != null) {
3904
+ contentBlock.input += delta;
3905
+ return;
3906
+ }
3614
3907
  if (contentBlock.firstDelta && (contentBlock.toolName === "bash_code_execution" || contentBlock.toolName === "text_editor_code_execution")) {
3615
3908
  delta = `{"type": "${contentBlock.toolName}",${delta.substring(1)}`;
3616
3909
  }
@@ -3827,20 +4120,54 @@ var AnthropicMessagesLanguageModel = class {
3827
4120
  }
3828
4121
  };
3829
4122
  function getModelCapabilities(modelId) {
3830
- if (modelId.includes("claude-opus-5")) {
4123
+ if (modelId.includes("claude-opus-5-5")) {
3831
4124
  return {
3832
4125
  maxOutputTokens: 128e3,
3833
4126
  supportsStructuredOutput: true,
3834
4127
  rejectsSamplingParameters: true,
3835
4128
  rejectsThinkingDisabledAboveHighEffort: true,
4129
+ rejectsThinkingDisabled: true,
4130
+ rejectsForcedToolUse: true,
4131
+ isKnownModel: true
4132
+ };
4133
+ } else if (modelId.includes("claude-opus-5")) {
4134
+ return {
4135
+ maxOutputTokens: 128e3,
4136
+ supportsStructuredOutput: true,
4137
+ rejectsSamplingParameters: true,
4138
+ rejectsThinkingDisabledAboveHighEffort: true,
4139
+ rejectsThinkingDisabled: false,
4140
+ rejectsForcedToolUse: false,
4141
+ isKnownModel: true
4142
+ };
4143
+ } else if (modelId.includes("claude-fable-5-1")) {
4144
+ return {
4145
+ maxOutputTokens: 128e3,
4146
+ supportsStructuredOutput: true,
4147
+ rejectsSamplingParameters: true,
4148
+ rejectsThinkingDisabledAboveHighEffort: false,
4149
+ rejectsThinkingDisabled: true,
4150
+ rejectsForcedToolUse: true,
4151
+ isKnownModel: true
4152
+ };
4153
+ } else if (modelId.includes("claude-fable-5")) {
4154
+ return {
4155
+ maxOutputTokens: 128e3,
4156
+ supportsStructuredOutput: true,
4157
+ rejectsSamplingParameters: true,
4158
+ rejectsThinkingDisabledAboveHighEffort: false,
4159
+ rejectsThinkingDisabled: true,
4160
+ rejectsForcedToolUse: false,
3836
4161
  isKnownModel: true
3837
4162
  };
3838
- } else if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7") || modelId.includes("claude-fable-5-1") || modelId.includes("claude-fable-5") || modelId.includes("claude-sonnet-5")) {
4163
+ } else if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7") || modelId.includes("claude-sonnet-5")) {
3839
4164
  return {
3840
4165
  maxOutputTokens: 128e3,
3841
4166
  supportsStructuredOutput: true,
3842
4167
  rejectsSamplingParameters: true,
3843
4168
  rejectsThinkingDisabledAboveHighEffort: false,
4169
+ rejectsThinkingDisabled: false,
4170
+ rejectsForcedToolUse: false,
3844
4171
  isKnownModel: true
3845
4172
  };
3846
4173
  } else if (modelId.includes("claude-sonnet-4-6") || modelId.includes("claude-opus-4-6")) {
@@ -3849,6 +4176,8 @@ function getModelCapabilities(modelId) {
3849
4176
  supportsStructuredOutput: true,
3850
4177
  rejectsSamplingParameters: false,
3851
4178
  rejectsThinkingDisabledAboveHighEffort: false,
4179
+ rejectsThinkingDisabled: false,
4180
+ rejectsForcedToolUse: false,
3852
4181
  isKnownModel: true
3853
4182
  };
3854
4183
  } else if (modelId.includes("claude-sonnet-4-5") || modelId.includes("claude-opus-4-5") || modelId.includes("claude-haiku-4-5")) {
@@ -3857,6 +4186,8 @@ function getModelCapabilities(modelId) {
3857
4186
  supportsStructuredOutput: true,
3858
4187
  rejectsSamplingParameters: false,
3859
4188
  rejectsThinkingDisabledAboveHighEffort: false,
4189
+ rejectsThinkingDisabled: false,
4190
+ rejectsForcedToolUse: false,
3860
4191
  isKnownModel: true
3861
4192
  };
3862
4193
  } else if (modelId.includes("claude-opus-4-1")) {
@@ -3865,6 +4196,8 @@ function getModelCapabilities(modelId) {
3865
4196
  supportsStructuredOutput: true,
3866
4197
  rejectsSamplingParameters: false,
3867
4198
  rejectsThinkingDisabledAboveHighEffort: false,
4199
+ rejectsThinkingDisabled: false,
4200
+ rejectsForcedToolUse: false,
3868
4201
  isKnownModel: true
3869
4202
  };
3870
4203
  } else if (modelId.includes("claude-sonnet-4-") || modelId.includes("claude-3-7-sonnet")) {
@@ -3873,6 +4206,8 @@ function getModelCapabilities(modelId) {
3873
4206
  supportsStructuredOutput: false,
3874
4207
  rejectsSamplingParameters: false,
3875
4208
  rejectsThinkingDisabledAboveHighEffort: false,
4209
+ rejectsThinkingDisabled: false,
4210
+ rejectsForcedToolUse: false,
3876
4211
  isKnownModel: true
3877
4212
  };
3878
4213
  } else if (modelId.includes("claude-opus-4-")) {
@@ -3881,6 +4216,8 @@ function getModelCapabilities(modelId) {
3881
4216
  supportsStructuredOutput: false,
3882
4217
  rejectsSamplingParameters: false,
3883
4218
  rejectsThinkingDisabledAboveHighEffort: false,
4219
+ rejectsThinkingDisabled: false,
4220
+ rejectsForcedToolUse: false,
3884
4221
  isKnownModel: true
3885
4222
  };
3886
4223
  } else if (modelId.includes("claude-3-haiku")) {
@@ -3889,6 +4226,8 @@ function getModelCapabilities(modelId) {
3889
4226
  supportsStructuredOutput: false,
3890
4227
  rejectsSamplingParameters: false,
3891
4228
  rejectsThinkingDisabledAboveHighEffort: false,
4229
+ rejectsThinkingDisabled: false,
4230
+ rejectsForcedToolUse: false,
3892
4231
  isKnownModel: true
3893
4232
  };
3894
4233
  } else if (/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId)) {
@@ -3897,6 +4236,8 @@ function getModelCapabilities(modelId) {
3897
4236
  supportsStructuredOutput: false,
3898
4237
  rejectsSamplingParameters: false,
3899
4238
  rejectsThinkingDisabledAboveHighEffort: false,
4239
+ rejectsThinkingDisabled: false,
4240
+ rejectsForcedToolUse: false,
3900
4241
  isKnownModel: false
3901
4242
  };
3902
4243
  } else if (modelId.includes("claude-")) {
@@ -3905,6 +4246,8 @@ function getModelCapabilities(modelId) {
3905
4246
  supportsStructuredOutput: true,
3906
4247
  rejectsSamplingParameters: true,
3907
4248
  rejectsThinkingDisabledAboveHighEffort: true,
4249
+ rejectsThinkingDisabled: false,
4250
+ rejectsForcedToolUse: false,
3908
4251
  isKnownModel: false
3909
4252
  };
3910
4253
  } else {
@@ -3913,6 +4256,8 @@ function getModelCapabilities(modelId) {
3913
4256
  supportsStructuredOutput: false,
3914
4257
  rejectsSamplingParameters: false,
3915
4258
  rejectsThinkingDisabledAboveHighEffort: false,
4259
+ rejectsThinkingDisabled: false,
4260
+ rejectsForcedToolUse: false,
3916
4261
  isKnownModel: false
3917
4262
  };
3918
4263
  }
@@ -3931,20 +4276,20 @@ function mapAnthropicStopDetails(stopDetails) {
3931
4276
 
3932
4277
  // src/tool/bash_20241022.ts
3933
4278
  import {
3934
- createProviderDefinedToolFactory as createProviderDefinedToolFactory2,
3935
- lazySchema as lazySchema8,
3936
- zodSchema as zodSchema8
4279
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory3,
4280
+ lazySchema as lazySchema9,
4281
+ zodSchema as zodSchema9
3937
4282
  } from "@ai-sdk/provider-utils";
3938
- import { z as z9 } from "zod/v4";
3939
- var bash_20241022InputSchema = lazySchema8(
3940
- () => zodSchema8(
3941
- z9.object({
3942
- command: z9.string(),
3943
- restart: z9.boolean().optional()
4283
+ import { z as z10 } from "zod/v4";
4284
+ var bash_20241022InputSchema = lazySchema9(
4285
+ () => zodSchema9(
4286
+ z10.object({
4287
+ command: z10.string(),
4288
+ restart: z10.boolean().optional()
3944
4289
  })
3945
4290
  )
3946
4291
  );
3947
- var bash_20241022 = createProviderDefinedToolFactory2({
4292
+ var bash_20241022 = createProviderDefinedToolFactory3({
3948
4293
  id: "anthropic.bash_20241022",
3949
4294
  name: "bash",
3950
4295
  inputSchema: bash_20241022InputSchema
@@ -3952,20 +4297,20 @@ var bash_20241022 = createProviderDefinedToolFactory2({
3952
4297
 
3953
4298
  // src/tool/bash_20250124.ts
3954
4299
  import {
3955
- createProviderDefinedToolFactory as createProviderDefinedToolFactory3,
3956
- lazySchema as lazySchema9,
3957
- zodSchema as zodSchema9
4300
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory4,
4301
+ lazySchema as lazySchema10,
4302
+ zodSchema as zodSchema10
3958
4303
  } from "@ai-sdk/provider-utils";
3959
- import { z as z10 } from "zod/v4";
3960
- var bash_20250124InputSchema = lazySchema9(
3961
- () => zodSchema9(
3962
- z10.object({
3963
- command: z10.string(),
3964
- restart: z10.boolean().optional()
4304
+ import { z as z11 } from "zod/v4";
4305
+ var bash_20250124InputSchema = lazySchema10(
4306
+ () => zodSchema10(
4307
+ z11.object({
4308
+ command: z11.string(),
4309
+ restart: z11.boolean().optional()
3965
4310
  })
3966
4311
  )
3967
4312
  );
3968
- var bash_20250124 = createProviderDefinedToolFactory3({
4313
+ var bash_20250124 = createProviderDefinedToolFactory4({
3969
4314
  id: "anthropic.bash_20250124",
3970
4315
  name: "bash",
3971
4316
  inputSchema: bash_20250124InputSchema
@@ -3974,97 +4319,97 @@ var bash_20250124 = createProviderDefinedToolFactory3({
3974
4319
  // src/tool/code-execution_20260120.ts
3975
4320
  import {
3976
4321
  createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema5,
3977
- lazySchema as lazySchema10,
3978
- zodSchema as zodSchema10
4322
+ lazySchema as lazySchema11,
4323
+ zodSchema as zodSchema11
3979
4324
  } from "@ai-sdk/provider-utils";
3980
- import { z as z11 } from "zod/v4";
3981
- var codeExecution_20260120OutputSchema = lazySchema10(
3982
- () => zodSchema10(
3983
- z11.discriminatedUnion("type", [
3984
- z11.object({
3985
- type: z11.literal("code_execution_result"),
3986
- stdout: z11.string(),
3987
- stderr: z11.string(),
3988
- return_code: z11.number(),
3989
- content: z11.array(
3990
- z11.object({
3991
- type: z11.literal("code_execution_output"),
3992
- file_id: z11.string()
4325
+ import { z as z12 } from "zod/v4";
4326
+ var codeExecution_20260120OutputSchema = lazySchema11(
4327
+ () => zodSchema11(
4328
+ z12.discriminatedUnion("type", [
4329
+ z12.object({
4330
+ type: z12.literal("code_execution_result"),
4331
+ stdout: z12.string(),
4332
+ stderr: z12.string(),
4333
+ return_code: z12.number(),
4334
+ content: z12.array(
4335
+ z12.object({
4336
+ type: z12.literal("code_execution_output"),
4337
+ file_id: z12.string()
3993
4338
  })
3994
4339
  ).optional().default([])
3995
4340
  }),
3996
- z11.object({
3997
- type: z11.literal("bash_code_execution_result"),
3998
- content: z11.array(
3999
- z11.object({
4000
- type: z11.literal("bash_code_execution_output"),
4001
- file_id: z11.string()
4341
+ z12.object({
4342
+ type: z12.literal("bash_code_execution_result"),
4343
+ content: z12.array(
4344
+ z12.object({
4345
+ type: z12.literal("bash_code_execution_output"),
4346
+ file_id: z12.string()
4002
4347
  })
4003
4348
  ),
4004
- stdout: z11.string(),
4005
- stderr: z11.string(),
4006
- return_code: z11.number()
4349
+ stdout: z12.string(),
4350
+ stderr: z12.string(),
4351
+ return_code: z12.number()
4007
4352
  }),
4008
- z11.object({
4009
- type: z11.literal("bash_code_execution_tool_result_error"),
4010
- error_code: z11.string()
4353
+ z12.object({
4354
+ type: z12.literal("bash_code_execution_tool_result_error"),
4355
+ error_code: z12.string()
4011
4356
  }),
4012
- z11.object({
4013
- type: z11.literal("text_editor_code_execution_tool_result_error"),
4014
- error_code: z11.string()
4357
+ z12.object({
4358
+ type: z12.literal("text_editor_code_execution_tool_result_error"),
4359
+ error_code: z12.string()
4015
4360
  }),
4016
- z11.object({
4017
- type: z11.literal("text_editor_code_execution_view_result"),
4018
- content: z11.string(),
4019
- file_type: z11.string(),
4020
- num_lines: z11.number().nullable(),
4021
- start_line: z11.number().nullable(),
4022
- total_lines: z11.number().nullable()
4361
+ z12.object({
4362
+ type: z12.literal("text_editor_code_execution_view_result"),
4363
+ content: z12.string(),
4364
+ file_type: z12.string(),
4365
+ num_lines: z12.number().nullable(),
4366
+ start_line: z12.number().nullable(),
4367
+ total_lines: z12.number().nullable()
4023
4368
  }),
4024
- z11.object({
4025
- type: z11.literal("text_editor_code_execution_create_result"),
4026
- is_file_update: z11.boolean()
4369
+ z12.object({
4370
+ type: z12.literal("text_editor_code_execution_create_result"),
4371
+ is_file_update: z12.boolean()
4027
4372
  }),
4028
- z11.object({
4029
- type: z11.literal("text_editor_code_execution_str_replace_result"),
4030
- lines: z11.array(z11.string()).nullable(),
4031
- new_lines: z11.number().nullable(),
4032
- new_start: z11.number().nullable(),
4033
- old_lines: z11.number().nullable(),
4034
- old_start: z11.number().nullable()
4373
+ z12.object({
4374
+ type: z12.literal("text_editor_code_execution_str_replace_result"),
4375
+ lines: z12.array(z12.string()).nullable(),
4376
+ new_lines: z12.number().nullable(),
4377
+ new_start: z12.number().nullable(),
4378
+ old_lines: z12.number().nullable(),
4379
+ old_start: z12.number().nullable()
4035
4380
  })
4036
4381
  ])
4037
4382
  )
4038
4383
  );
4039
- var codeExecution_20260120InputSchema = lazySchema10(
4040
- () => zodSchema10(
4041
- z11.discriminatedUnion("type", [
4042
- z11.object({
4043
- type: z11.literal("programmatic-tool-call"),
4044
- code: z11.string()
4384
+ var codeExecution_20260120InputSchema = lazySchema11(
4385
+ () => zodSchema11(
4386
+ z12.discriminatedUnion("type", [
4387
+ z12.object({
4388
+ type: z12.literal("programmatic-tool-call"),
4389
+ code: z12.string()
4045
4390
  }),
4046
- z11.object({
4047
- type: z11.literal("bash_code_execution"),
4048
- command: z11.string()
4391
+ z12.object({
4392
+ type: z12.literal("bash_code_execution"),
4393
+ command: z12.string()
4049
4394
  }),
4050
- z11.discriminatedUnion("command", [
4051
- z11.object({
4052
- type: z11.literal("text_editor_code_execution"),
4053
- command: z11.literal("view"),
4054
- path: z11.string()
4395
+ z12.discriminatedUnion("command", [
4396
+ z12.object({
4397
+ type: z12.literal("text_editor_code_execution"),
4398
+ command: z12.literal("view"),
4399
+ path: z12.string()
4055
4400
  }),
4056
- z11.object({
4057
- type: z11.literal("text_editor_code_execution"),
4058
- command: z11.literal("create"),
4059
- path: z11.string(),
4060
- file_text: z11.string().nullish()
4401
+ z12.object({
4402
+ type: z12.literal("text_editor_code_execution"),
4403
+ command: z12.literal("create"),
4404
+ path: z12.string(),
4405
+ file_text: z12.string().nullish()
4061
4406
  }),
4062
- z11.object({
4063
- type: z11.literal("text_editor_code_execution"),
4064
- command: z11.literal("str_replace"),
4065
- path: z11.string(),
4066
- old_str: z11.string(),
4067
- new_str: z11.string()
4407
+ z12.object({
4408
+ type: z12.literal("text_editor_code_execution"),
4409
+ command: z12.literal("str_replace"),
4410
+ path: z12.string(),
4411
+ old_str: z12.string(),
4412
+ new_str: z12.string()
4068
4413
  })
4069
4414
  ])
4070
4415
  ])
@@ -4082,15 +4427,15 @@ var codeExecution_20260120 = (args = {}) => {
4082
4427
 
4083
4428
  // src/tool/computer_20241022.ts
4084
4429
  import {
4085
- createProviderDefinedToolFactory as createProviderDefinedToolFactory4,
4086
- lazySchema as lazySchema11,
4087
- zodSchema as zodSchema11
4430
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory5,
4431
+ lazySchema as lazySchema12,
4432
+ zodSchema as zodSchema12
4088
4433
  } from "@ai-sdk/provider-utils";
4089
- import { z as z12 } from "zod/v4";
4090
- var computer_20241022InputSchema = lazySchema11(
4091
- () => zodSchema11(
4092
- z12.object({
4093
- action: z12.enum([
4434
+ import { z as z13 } from "zod/v4";
4435
+ var computer_20241022InputSchema = lazySchema12(
4436
+ () => zodSchema12(
4437
+ z13.object({
4438
+ action: z13.enum([
4094
4439
  "key",
4095
4440
  "type",
4096
4441
  "mouse_move",
@@ -4102,12 +4447,12 @@ var computer_20241022InputSchema = lazySchema11(
4102
4447
  "screenshot",
4103
4448
  "cursor_position"
4104
4449
  ]),
4105
- coordinate: z12.array(z12.number().int()).optional(),
4106
- text: z12.string().optional()
4450
+ coordinate: z13.array(z13.number().int()).optional(),
4451
+ text: z13.string().optional()
4107
4452
  })
4108
4453
  )
4109
4454
  );
4110
- var computer_20241022 = createProviderDefinedToolFactory4({
4455
+ var computer_20241022 = createProviderDefinedToolFactory5({
4111
4456
  id: "anthropic.computer_20241022",
4112
4457
  name: "computer",
4113
4458
  inputSchema: computer_20241022InputSchema
@@ -4115,15 +4460,15 @@ var computer_20241022 = createProviderDefinedToolFactory4({
4115
4460
 
4116
4461
  // src/tool/computer_20250124.ts
4117
4462
  import {
4118
- createProviderDefinedToolFactory as createProviderDefinedToolFactory5,
4119
- lazySchema as lazySchema12,
4120
- zodSchema as zodSchema12
4463
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory6,
4464
+ lazySchema as lazySchema13,
4465
+ zodSchema as zodSchema13
4121
4466
  } from "@ai-sdk/provider-utils";
4122
- import { z as z13 } from "zod/v4";
4123
- var computer_20250124InputSchema = lazySchema12(
4124
- () => zodSchema12(
4125
- z13.object({
4126
- action: z13.enum([
4467
+ import { z as z14 } from "zod/v4";
4468
+ var computer_20250124InputSchema = lazySchema13(
4469
+ () => zodSchema13(
4470
+ z14.object({
4471
+ action: z14.enum([
4127
4472
  "key",
4128
4473
  "hold_key",
4129
4474
  "type",
@@ -4141,16 +4486,16 @@ var computer_20250124InputSchema = lazySchema12(
4141
4486
  "wait",
4142
4487
  "screenshot"
4143
4488
  ]),
4144
- coordinate: z13.tuple([z13.number().int(), z13.number().int()]).optional(),
4145
- duration: z13.number().optional(),
4146
- scroll_amount: z13.number().optional(),
4147
- scroll_direction: z13.enum(["up", "down", "left", "right"]).optional(),
4148
- start_coordinate: z13.tuple([z13.number().int(), z13.number().int()]).optional(),
4149
- text: z13.string().optional()
4489
+ coordinate: z14.tuple([z14.number().int(), z14.number().int()]).optional(),
4490
+ duration: z14.number().optional(),
4491
+ scroll_amount: z14.number().optional(),
4492
+ scroll_direction: z14.enum(["up", "down", "left", "right"]).optional(),
4493
+ start_coordinate: z14.tuple([z14.number().int(), z14.number().int()]).optional(),
4494
+ text: z14.string().optional()
4150
4495
  })
4151
4496
  )
4152
4497
  );
4153
- var computer_20250124 = createProviderDefinedToolFactory5({
4498
+ var computer_20250124 = createProviderDefinedToolFactory6({
4154
4499
  id: "anthropic.computer_20250124",
4155
4500
  name: "computer",
4156
4501
  inputSchema: computer_20250124InputSchema
@@ -4158,88 +4503,62 @@ var computer_20250124 = createProviderDefinedToolFactory5({
4158
4503
 
4159
4504
  // src/tool/memory_20250818.ts
4160
4505
  import {
4161
- createProviderDefinedToolFactory as createProviderDefinedToolFactory6,
4162
- lazySchema as lazySchema13,
4163
- zodSchema as zodSchema13
4506
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory7,
4507
+ lazySchema as lazySchema14,
4508
+ zodSchema as zodSchema14
4164
4509
  } from "@ai-sdk/provider-utils";
4165
- import { z as z14 } from "zod/v4";
4166
- var memory_20250818InputSchema = lazySchema13(
4167
- () => zodSchema13(
4168
- z14.discriminatedUnion("command", [
4169
- z14.object({
4170
- command: z14.literal("view"),
4171
- path: z14.string(),
4172
- view_range: z14.tuple([z14.number(), z14.number()]).optional()
4510
+ import { z as z15 } from "zod/v4";
4511
+ var memory_20250818InputSchema = lazySchema14(
4512
+ () => zodSchema14(
4513
+ z15.discriminatedUnion("command", [
4514
+ z15.object({
4515
+ command: z15.literal("view"),
4516
+ path: z15.string(),
4517
+ view_range: z15.tuple([z15.number(), z15.number()]).optional()
4173
4518
  }),
4174
- z14.object({
4175
- command: z14.literal("create"),
4176
- path: z14.string(),
4177
- file_text: z14.string()
4519
+ z15.object({
4520
+ command: z15.literal("create"),
4521
+ path: z15.string(),
4522
+ file_text: z15.string()
4178
4523
  }),
4179
- z14.object({
4180
- command: z14.literal("str_replace"),
4181
- path: z14.string(),
4182
- old_str: z14.string(),
4183
- new_str: z14.string()
4524
+ z15.object({
4525
+ command: z15.literal("str_replace"),
4526
+ path: z15.string(),
4527
+ old_str: z15.string(),
4528
+ new_str: z15.string()
4184
4529
  }),
4185
- z14.object({
4186
- command: z14.literal("insert"),
4187
- path: z14.string(),
4188
- insert_line: z14.number(),
4189
- insert_text: z14.string()
4530
+ z15.object({
4531
+ command: z15.literal("insert"),
4532
+ path: z15.string(),
4533
+ insert_line: z15.number(),
4534
+ insert_text: z15.string()
4190
4535
  }),
4191
- z14.object({
4192
- command: z14.literal("delete"),
4193
- path: z14.string()
4536
+ z15.object({
4537
+ command: z15.literal("delete"),
4538
+ path: z15.string()
4194
4539
  }),
4195
- z14.object({
4196
- command: z14.literal("rename"),
4197
- old_path: z14.string(),
4198
- new_path: z14.string()
4540
+ z15.object({
4541
+ command: z15.literal("rename"),
4542
+ old_path: z15.string(),
4543
+ new_path: z15.string()
4199
4544
  })
4200
4545
  ])
4201
4546
  )
4202
4547
  );
4203
- var memory_20250818 = createProviderDefinedToolFactory6({
4548
+ var memory_20250818 = createProviderDefinedToolFactory7({
4204
4549
  id: "anthropic.memory_20250818",
4205
4550
  name: "memory",
4206
4551
  inputSchema: memory_20250818InputSchema
4207
4552
  });
4208
4553
 
4209
4554
  // src/tool/text-editor_20241022.ts
4210
- import {
4211
- createProviderDefinedToolFactory as createProviderDefinedToolFactory7,
4212
- lazySchema as lazySchema14,
4213
- zodSchema as zodSchema14
4214
- } from "@ai-sdk/provider-utils";
4215
- import { z as z15 } from "zod/v4";
4216
- var textEditor_20241022InputSchema = lazySchema14(
4217
- () => zodSchema14(
4218
- z15.object({
4219
- command: z15.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
4220
- path: z15.string(),
4221
- file_text: z15.string().optional(),
4222
- insert_line: z15.number().int().optional(),
4223
- new_str: z15.string().optional(),
4224
- old_str: z15.string().optional(),
4225
- view_range: z15.array(z15.number().int()).optional()
4226
- })
4227
- )
4228
- );
4229
- var textEditor_20241022 = createProviderDefinedToolFactory7({
4230
- id: "anthropic.text_editor_20241022",
4231
- name: "str_replace_editor",
4232
- inputSchema: textEditor_20241022InputSchema
4233
- });
4234
-
4235
- // src/tool/text-editor_20250124.ts
4236
4555
  import {
4237
4556
  createProviderDefinedToolFactory as createProviderDefinedToolFactory8,
4238
4557
  lazySchema as lazySchema15,
4239
4558
  zodSchema as zodSchema15
4240
4559
  } from "@ai-sdk/provider-utils";
4241
4560
  import { z as z16 } from "zod/v4";
4242
- var textEditor_20250124InputSchema = lazySchema15(
4561
+ var textEditor_20241022InputSchema = lazySchema15(
4243
4562
  () => zodSchema15(
4244
4563
  z16.object({
4245
4564
  command: z16.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
@@ -4252,23 +4571,23 @@ var textEditor_20250124InputSchema = lazySchema15(
4252
4571
  })
4253
4572
  )
4254
4573
  );
4255
- var textEditor_20250124 = createProviderDefinedToolFactory8({
4256
- id: "anthropic.text_editor_20250124",
4574
+ var textEditor_20241022 = createProviderDefinedToolFactory8({
4575
+ id: "anthropic.text_editor_20241022",
4257
4576
  name: "str_replace_editor",
4258
- inputSchema: textEditor_20250124InputSchema
4577
+ inputSchema: textEditor_20241022InputSchema
4259
4578
  });
4260
4579
 
4261
- // src/tool/text-editor_20250429.ts
4580
+ // src/tool/text-editor_20250124.ts
4262
4581
  import {
4263
4582
  createProviderDefinedToolFactory as createProviderDefinedToolFactory9,
4264
4583
  lazySchema as lazySchema16,
4265
4584
  zodSchema as zodSchema16
4266
4585
  } from "@ai-sdk/provider-utils";
4267
4586
  import { z as z17 } from "zod/v4";
4268
- var textEditor_20250429InputSchema = lazySchema16(
4587
+ var textEditor_20250124InputSchema = lazySchema16(
4269
4588
  () => zodSchema16(
4270
4589
  z17.object({
4271
- command: z17.enum(["view", "create", "str_replace", "insert"]),
4590
+ command: z17.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
4272
4591
  path: z17.string(),
4273
4592
  file_text: z17.string().optional(),
4274
4593
  insert_line: z17.number().int().optional(),
@@ -4278,7 +4597,33 @@ var textEditor_20250429InputSchema = lazySchema16(
4278
4597
  })
4279
4598
  )
4280
4599
  );
4281
- var textEditor_20250429 = createProviderDefinedToolFactory9({
4600
+ var textEditor_20250124 = createProviderDefinedToolFactory9({
4601
+ id: "anthropic.text_editor_20250124",
4602
+ name: "str_replace_editor",
4603
+ inputSchema: textEditor_20250124InputSchema
4604
+ });
4605
+
4606
+ // src/tool/text-editor_20250429.ts
4607
+ import {
4608
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory10,
4609
+ lazySchema as lazySchema17,
4610
+ zodSchema as zodSchema17
4611
+ } from "@ai-sdk/provider-utils";
4612
+ import { z as z18 } from "zod/v4";
4613
+ var textEditor_20250429InputSchema = lazySchema17(
4614
+ () => zodSchema17(
4615
+ z18.object({
4616
+ command: z18.enum(["view", "create", "str_replace", "insert"]),
4617
+ path: z18.string(),
4618
+ file_text: z18.string().optional(),
4619
+ insert_line: z18.number().int().optional(),
4620
+ new_str: z18.string().optional(),
4621
+ old_str: z18.string().optional(),
4622
+ view_range: z18.array(z18.number().int()).optional()
4623
+ })
4624
+ )
4625
+ );
4626
+ var textEditor_20250429 = createProviderDefinedToolFactory10({
4282
4627
  id: "anthropic.text_editor_20250429",
4283
4628
  name: "str_replace_based_edit_tool",
4284
4629
  inputSchema: textEditor_20250429InputSchema
@@ -4367,6 +4712,31 @@ var anthropicTools = {
4367
4712
  * @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.
4368
4713
  */
4369
4714
  computer_20250124,
4715
+ /**
4716
+ * The computer toolset lets Claude control a computer through screenshots,
4717
+ * mouse, and keyboard. It replaces the versioned computer tools
4718
+ * (`computer_20250124` and earlier) on newer models.
4719
+ *
4720
+ * The API returns each computer action as its own `tool_use` block with
4721
+ * `toolset_name: 'computer'`. The AI SDK maps every member call to this tool
4722
+ * and exposes the member name as `action`, so `execute` receives the same
4723
+ * input shape as the older computer tools. Claude may return several actions
4724
+ * in one turn.
4725
+ *
4726
+ * Coordinates are always in the pixel space of the screenshots you return;
4727
+ * there are no display size parameters. Zoom is enabled by default.
4728
+ *
4729
+ * Does not require a beta header.
4730
+ *
4731
+ * Tool name must be `computer`.
4732
+ *
4733
+ * Supported models: Claude Opus 5.5 (required; older computer tool types
4734
+ * are rejected), Opus 5, Sonnet 5, Fable 5, Fable 5.1, Opus 4.8.
4735
+ *
4736
+ * @param configs - Per-member settings keyed by member name, e.g.
4737
+ * `{ zoom: { enabled: false } }`. Omitted members keep their defaults.
4738
+ */
4739
+ computerToolset_20260801,
4370
4740
  /**
4371
4741
  * The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
4372
4742
  * Claude can create, read, update, and delete files that persist between sessions,