@ai-sdk/anthropic 3.0.72 → 3.0.74

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.js CHANGED
@@ -29,14 +29,14 @@ module.exports = __toCommonJS(index_exports);
29
29
 
30
30
  // src/anthropic-provider.ts
31
31
  var import_provider4 = require("@ai-sdk/provider");
32
- var import_provider_utils26 = require("@ai-sdk/provider-utils");
32
+ var import_provider_utils25 = require("@ai-sdk/provider-utils");
33
33
 
34
34
  // src/version.ts
35
- var VERSION = true ? "3.0.72" : "0.0.0-test";
35
+ var VERSION = true ? "3.0.74" : "0.0.0-test";
36
36
 
37
37
  // src/anthropic-messages-language-model.ts
38
38
  var import_provider3 = require("@ai-sdk/provider");
39
- var import_provider_utils15 = require("@ai-sdk/provider-utils");
39
+ var import_provider_utils14 = require("@ai-sdk/provider-utils");
40
40
 
41
41
  // src/anthropic-error.ts
42
42
  var import_provider_utils = require("@ai-sdk/provider-utils");
@@ -1062,16 +1062,15 @@ var CacheControlValidator = class {
1062
1062
  // src/tool/text-editor_20250728.ts
1063
1063
  var import_provider_utils3 = require("@ai-sdk/provider-utils");
1064
1064
  var import_v44 = require("zod/v4");
1065
- var import_provider_utils4 = require("@ai-sdk/provider-utils");
1066
- var textEditor_20250728ArgsSchema = (0, import_provider_utils4.lazySchema)(
1067
- () => (0, import_provider_utils4.zodSchema)(
1065
+ var textEditor_20250728ArgsSchema = (0, import_provider_utils3.lazySchema)(
1066
+ () => (0, import_provider_utils3.zodSchema)(
1068
1067
  import_v44.z.object({
1069
1068
  maxCharacters: import_v44.z.number().optional()
1070
1069
  })
1071
1070
  )
1072
1071
  );
1073
- var textEditor_20250728InputSchema = (0, import_provider_utils4.lazySchema)(
1074
- () => (0, import_provider_utils4.zodSchema)(
1072
+ var textEditor_20250728InputSchema = (0, import_provider_utils3.lazySchema)(
1073
+ () => (0, import_provider_utils3.zodSchema)(
1075
1074
  import_v44.z.object({
1076
1075
  command: import_v44.z.enum(["view", "create", "str_replace", "insert"]),
1077
1076
  path: import_v44.z.string(),
@@ -1093,10 +1092,10 @@ var textEditor_20250728 = (args = {}) => {
1093
1092
  };
1094
1093
 
1095
1094
  // src/tool/web-search_20260209.ts
1096
- var import_provider_utils5 = require("@ai-sdk/provider-utils");
1095
+ var import_provider_utils4 = require("@ai-sdk/provider-utils");
1097
1096
  var import_v45 = require("zod/v4");
1098
- var webSearch_20260209ArgsSchema = (0, import_provider_utils5.lazySchema)(
1099
- () => (0, import_provider_utils5.zodSchema)(
1097
+ var webSearch_20260209ArgsSchema = (0, import_provider_utils4.lazySchema)(
1098
+ () => (0, import_provider_utils4.zodSchema)(
1100
1099
  import_v45.z.object({
1101
1100
  maxUses: import_v45.z.number().optional(),
1102
1101
  allowedDomains: import_v45.z.array(import_v45.z.string()).optional(),
@@ -1111,8 +1110,8 @@ var webSearch_20260209ArgsSchema = (0, import_provider_utils5.lazySchema)(
1111
1110
  })
1112
1111
  )
1113
1112
  );
1114
- var webSearch_20260209OutputSchema = (0, import_provider_utils5.lazySchema)(
1115
- () => (0, import_provider_utils5.zodSchema)(
1113
+ var webSearch_20260209OutputSchema = (0, import_provider_utils4.lazySchema)(
1114
+ () => (0, import_provider_utils4.zodSchema)(
1116
1115
  import_v45.z.array(
1117
1116
  import_v45.z.object({
1118
1117
  url: import_v45.z.string(),
@@ -1124,14 +1123,14 @@ var webSearch_20260209OutputSchema = (0, import_provider_utils5.lazySchema)(
1124
1123
  )
1125
1124
  )
1126
1125
  );
1127
- var webSearch_20260209InputSchema = (0, import_provider_utils5.lazySchema)(
1128
- () => (0, import_provider_utils5.zodSchema)(
1126
+ var webSearch_20260209InputSchema = (0, import_provider_utils4.lazySchema)(
1127
+ () => (0, import_provider_utils4.zodSchema)(
1129
1128
  import_v45.z.object({
1130
1129
  query: import_v45.z.string()
1131
1130
  })
1132
1131
  )
1133
1132
  );
1134
- var factory2 = (0, import_provider_utils5.createProviderToolFactoryWithOutputSchema)({
1133
+ var factory2 = (0, import_provider_utils4.createProviderToolFactoryWithOutputSchema)({
1135
1134
  id: "anthropic.web_search_20260209",
1136
1135
  inputSchema: webSearch_20260209InputSchema,
1137
1136
  outputSchema: webSearch_20260209OutputSchema,
@@ -1142,10 +1141,10 @@ var webSearch_20260209 = (args = {}) => {
1142
1141
  };
1143
1142
 
1144
1143
  // src/tool/web-search_20250305.ts
1145
- var import_provider_utils6 = require("@ai-sdk/provider-utils");
1144
+ var import_provider_utils5 = require("@ai-sdk/provider-utils");
1146
1145
  var import_v46 = require("zod/v4");
1147
- var webSearch_20250305ArgsSchema = (0, import_provider_utils6.lazySchema)(
1148
- () => (0, import_provider_utils6.zodSchema)(
1146
+ var webSearch_20250305ArgsSchema = (0, import_provider_utils5.lazySchema)(
1147
+ () => (0, import_provider_utils5.zodSchema)(
1149
1148
  import_v46.z.object({
1150
1149
  maxUses: import_v46.z.number().optional(),
1151
1150
  allowedDomains: import_v46.z.array(import_v46.z.string()).optional(),
@@ -1160,8 +1159,8 @@ var webSearch_20250305ArgsSchema = (0, import_provider_utils6.lazySchema)(
1160
1159
  })
1161
1160
  )
1162
1161
  );
1163
- var webSearch_20250305OutputSchema = (0, import_provider_utils6.lazySchema)(
1164
- () => (0, import_provider_utils6.zodSchema)(
1162
+ var webSearch_20250305OutputSchema = (0, import_provider_utils5.lazySchema)(
1163
+ () => (0, import_provider_utils5.zodSchema)(
1165
1164
  import_v46.z.array(
1166
1165
  import_v46.z.object({
1167
1166
  url: import_v46.z.string(),
@@ -1173,14 +1172,14 @@ var webSearch_20250305OutputSchema = (0, import_provider_utils6.lazySchema)(
1173
1172
  )
1174
1173
  )
1175
1174
  );
1176
- var webSearch_20250305InputSchema = (0, import_provider_utils6.lazySchema)(
1177
- () => (0, import_provider_utils6.zodSchema)(
1175
+ var webSearch_20250305InputSchema = (0, import_provider_utils5.lazySchema)(
1176
+ () => (0, import_provider_utils5.zodSchema)(
1178
1177
  import_v46.z.object({
1179
1178
  query: import_v46.z.string()
1180
1179
  })
1181
1180
  )
1182
1181
  );
1183
- var factory3 = (0, import_provider_utils6.createProviderToolFactoryWithOutputSchema)({
1182
+ var factory3 = (0, import_provider_utils5.createProviderToolFactoryWithOutputSchema)({
1184
1183
  id: "anthropic.web_search_20250305",
1185
1184
  inputSchema: webSearch_20250305InputSchema,
1186
1185
  outputSchema: webSearch_20250305OutputSchema,
@@ -1191,10 +1190,10 @@ var webSearch_20250305 = (args = {}) => {
1191
1190
  };
1192
1191
 
1193
1192
  // src/tool/web-fetch-20260209.ts
1194
- var import_provider_utils7 = require("@ai-sdk/provider-utils");
1193
+ var import_provider_utils6 = require("@ai-sdk/provider-utils");
1195
1194
  var import_v47 = require("zod/v4");
1196
- var webFetch_20260209ArgsSchema = (0, import_provider_utils7.lazySchema)(
1197
- () => (0, import_provider_utils7.zodSchema)(
1195
+ var webFetch_20260209ArgsSchema = (0, import_provider_utils6.lazySchema)(
1196
+ () => (0, import_provider_utils6.zodSchema)(
1198
1197
  import_v47.z.object({
1199
1198
  maxUses: import_v47.z.number().optional(),
1200
1199
  allowedDomains: import_v47.z.array(import_v47.z.string()).optional(),
@@ -1204,8 +1203,8 @@ var webFetch_20260209ArgsSchema = (0, import_provider_utils7.lazySchema)(
1204
1203
  })
1205
1204
  )
1206
1205
  );
1207
- var webFetch_20260209OutputSchema = (0, import_provider_utils7.lazySchema)(
1208
- () => (0, import_provider_utils7.zodSchema)(
1206
+ var webFetch_20260209OutputSchema = (0, import_provider_utils6.lazySchema)(
1207
+ () => (0, import_provider_utils6.zodSchema)(
1209
1208
  import_v47.z.object({
1210
1209
  type: import_v47.z.literal("web_fetch_result"),
1211
1210
  url: import_v47.z.string(),
@@ -1230,14 +1229,14 @@ var webFetch_20260209OutputSchema = (0, import_provider_utils7.lazySchema)(
1230
1229
  })
1231
1230
  )
1232
1231
  );
1233
- var webFetch_20260209InputSchema = (0, import_provider_utils7.lazySchema)(
1234
- () => (0, import_provider_utils7.zodSchema)(
1232
+ var webFetch_20260209InputSchema = (0, import_provider_utils6.lazySchema)(
1233
+ () => (0, import_provider_utils6.zodSchema)(
1235
1234
  import_v47.z.object({
1236
1235
  url: import_v47.z.string()
1237
1236
  })
1238
1237
  )
1239
1238
  );
1240
- var factory4 = (0, import_provider_utils7.createProviderToolFactoryWithOutputSchema)({
1239
+ var factory4 = (0, import_provider_utils6.createProviderToolFactoryWithOutputSchema)({
1241
1240
  id: "anthropic.web_fetch_20260209",
1242
1241
  inputSchema: webFetch_20260209InputSchema,
1243
1242
  outputSchema: webFetch_20260209OutputSchema,
@@ -1248,10 +1247,10 @@ var webFetch_20260209 = (args = {}) => {
1248
1247
  };
1249
1248
 
1250
1249
  // src/tool/web-fetch-20250910.ts
1251
- var import_provider_utils8 = require("@ai-sdk/provider-utils");
1250
+ var import_provider_utils7 = require("@ai-sdk/provider-utils");
1252
1251
  var import_v48 = require("zod/v4");
1253
- var webFetch_20250910ArgsSchema = (0, import_provider_utils8.lazySchema)(
1254
- () => (0, import_provider_utils8.zodSchema)(
1252
+ var webFetch_20250910ArgsSchema = (0, import_provider_utils7.lazySchema)(
1253
+ () => (0, import_provider_utils7.zodSchema)(
1255
1254
  import_v48.z.object({
1256
1255
  maxUses: import_v48.z.number().optional(),
1257
1256
  allowedDomains: import_v48.z.array(import_v48.z.string()).optional(),
@@ -1261,8 +1260,8 @@ var webFetch_20250910ArgsSchema = (0, import_provider_utils8.lazySchema)(
1261
1260
  })
1262
1261
  )
1263
1262
  );
1264
- var webFetch_20250910OutputSchema = (0, import_provider_utils8.lazySchema)(
1265
- () => (0, import_provider_utils8.zodSchema)(
1263
+ var webFetch_20250910OutputSchema = (0, import_provider_utils7.lazySchema)(
1264
+ () => (0, import_provider_utils7.zodSchema)(
1266
1265
  import_v48.z.object({
1267
1266
  type: import_v48.z.literal("web_fetch_result"),
1268
1267
  url: import_v48.z.string(),
@@ -1287,14 +1286,14 @@ var webFetch_20250910OutputSchema = (0, import_provider_utils8.lazySchema)(
1287
1286
  })
1288
1287
  )
1289
1288
  );
1290
- var webFetch_20250910InputSchema = (0, import_provider_utils8.lazySchema)(
1291
- () => (0, import_provider_utils8.zodSchema)(
1289
+ var webFetch_20250910InputSchema = (0, import_provider_utils7.lazySchema)(
1290
+ () => (0, import_provider_utils7.zodSchema)(
1292
1291
  import_v48.z.object({
1293
1292
  url: import_v48.z.string()
1294
1293
  })
1295
1294
  )
1296
1295
  );
1297
- var factory5 = (0, import_provider_utils8.createProviderToolFactoryWithOutputSchema)({
1296
+ var factory5 = (0, import_provider_utils7.createProviderToolFactoryWithOutputSchema)({
1298
1297
  id: "anthropic.web_fetch_20250910",
1299
1298
  inputSchema: webFetch_20250910InputSchema,
1300
1299
  outputSchema: webFetch_20250910OutputSchema,
@@ -1305,7 +1304,7 @@ var webFetch_20250910 = (args = {}) => {
1305
1304
  };
1306
1305
 
1307
1306
  // src/anthropic-prepare-tools.ts
1308
- var import_provider_utils9 = require("@ai-sdk/provider-utils");
1307
+ var import_provider_utils8 = require("@ai-sdk/provider-utils");
1309
1308
  async function prepareTools({
1310
1309
  tools,
1311
1310
  toolChoice,
@@ -1456,7 +1455,7 @@ async function prepareTools({
1456
1455
  break;
1457
1456
  }
1458
1457
  case "anthropic.text_editor_20250728": {
1459
- const args = await (0, import_provider_utils9.validateTypes)({
1458
+ const args = await (0, import_provider_utils8.validateTypes)({
1460
1459
  value: tool.args,
1461
1460
  schema: textEditor_20250728ArgsSchema
1462
1461
  });
@@ -1496,7 +1495,7 @@ async function prepareTools({
1496
1495
  }
1497
1496
  case "anthropic.web_fetch_20250910": {
1498
1497
  betas.add("web-fetch-2025-09-10");
1499
- const args = await (0, import_provider_utils9.validateTypes)({
1498
+ const args = await (0, import_provider_utils8.validateTypes)({
1500
1499
  value: tool.args,
1501
1500
  schema: webFetch_20250910ArgsSchema
1502
1501
  });
@@ -1514,7 +1513,7 @@ async function prepareTools({
1514
1513
  }
1515
1514
  case "anthropic.web_fetch_20260209": {
1516
1515
  betas.add("code-execution-web-tools-2026-02-09");
1517
- const args = await (0, import_provider_utils9.validateTypes)({
1516
+ const args = await (0, import_provider_utils8.validateTypes)({
1518
1517
  value: tool.args,
1519
1518
  schema: webFetch_20260209ArgsSchema
1520
1519
  });
@@ -1531,7 +1530,7 @@ async function prepareTools({
1531
1530
  break;
1532
1531
  }
1533
1532
  case "anthropic.web_search_20250305": {
1534
- const args = await (0, import_provider_utils9.validateTypes)({
1533
+ const args = await (0, import_provider_utils8.validateTypes)({
1535
1534
  value: tool.args,
1536
1535
  schema: webSearch_20250305ArgsSchema
1537
1536
  });
@@ -1548,7 +1547,7 @@ async function prepareTools({
1548
1547
  }
1549
1548
  case "anthropic.web_search_20260209": {
1550
1549
  betas.add("code-execution-web-tools-2026-02-09");
1551
- const args = await (0, import_provider_utils9.validateTypes)({
1550
+ const args = await (0, import_provider_utils8.validateTypes)({
1552
1551
  value: tool.args,
1553
1552
  schema: webSearch_20260209ArgsSchema
1554
1553
  });
@@ -1690,13 +1689,13 @@ function convertAnthropicMessagesUsage({
1690
1689
 
1691
1690
  // src/convert-to-anthropic-messages-prompt.ts
1692
1691
  var import_provider2 = require("@ai-sdk/provider");
1693
- var import_provider_utils14 = require("@ai-sdk/provider-utils");
1692
+ var import_provider_utils13 = require("@ai-sdk/provider-utils");
1694
1693
 
1695
1694
  // src/tool/code-execution_20250522.ts
1696
- var import_provider_utils10 = require("@ai-sdk/provider-utils");
1695
+ var import_provider_utils9 = require("@ai-sdk/provider-utils");
1697
1696
  var import_v49 = require("zod/v4");
1698
- var codeExecution_20250522OutputSchema = (0, import_provider_utils10.lazySchema)(
1699
- () => (0, import_provider_utils10.zodSchema)(
1697
+ var codeExecution_20250522OutputSchema = (0, import_provider_utils9.lazySchema)(
1698
+ () => (0, import_provider_utils9.zodSchema)(
1700
1699
  import_v49.z.object({
1701
1700
  type: import_v49.z.literal("code_execution_result"),
1702
1701
  stdout: import_v49.z.string(),
@@ -1711,14 +1710,14 @@ var codeExecution_20250522OutputSchema = (0, import_provider_utils10.lazySchema)
1711
1710
  })
1712
1711
  )
1713
1712
  );
1714
- var codeExecution_20250522InputSchema = (0, import_provider_utils10.lazySchema)(
1715
- () => (0, import_provider_utils10.zodSchema)(
1713
+ var codeExecution_20250522InputSchema = (0, import_provider_utils9.lazySchema)(
1714
+ () => (0, import_provider_utils9.zodSchema)(
1716
1715
  import_v49.z.object({
1717
1716
  code: import_v49.z.string()
1718
1717
  })
1719
1718
  )
1720
1719
  );
1721
- var factory6 = (0, import_provider_utils10.createProviderToolFactoryWithOutputSchema)({
1720
+ var factory6 = (0, import_provider_utils9.createProviderToolFactoryWithOutputSchema)({
1722
1721
  id: "anthropic.code_execution_20250522",
1723
1722
  inputSchema: codeExecution_20250522InputSchema,
1724
1723
  outputSchema: codeExecution_20250522OutputSchema
@@ -1728,10 +1727,10 @@ var codeExecution_20250522 = (args = {}) => {
1728
1727
  };
1729
1728
 
1730
1729
  // src/tool/code-execution_20250825.ts
1731
- var import_provider_utils11 = require("@ai-sdk/provider-utils");
1730
+ var import_provider_utils10 = require("@ai-sdk/provider-utils");
1732
1731
  var import_v410 = require("zod/v4");
1733
- var codeExecution_20250825OutputSchema = (0, import_provider_utils11.lazySchema)(
1734
- () => (0, import_provider_utils11.zodSchema)(
1732
+ var codeExecution_20250825OutputSchema = (0, import_provider_utils10.lazySchema)(
1733
+ () => (0, import_provider_utils10.zodSchema)(
1735
1734
  import_v410.z.discriminatedUnion("type", [
1736
1735
  import_v410.z.object({
1737
1736
  type: import_v410.z.literal("code_execution_result"),
@@ -1788,8 +1787,8 @@ var codeExecution_20250825OutputSchema = (0, import_provider_utils11.lazySchema)
1788
1787
  ])
1789
1788
  )
1790
1789
  );
1791
- var codeExecution_20250825InputSchema = (0, import_provider_utils11.lazySchema)(
1792
- () => (0, import_provider_utils11.zodSchema)(
1790
+ var codeExecution_20250825InputSchema = (0, import_provider_utils10.lazySchema)(
1791
+ () => (0, import_provider_utils10.zodSchema)(
1793
1792
  import_v410.z.discriminatedUnion("type", [
1794
1793
  // Programmatic tool calling format (mapped from { code } by AI SDK)
1795
1794
  import_v410.z.object({
@@ -1823,7 +1822,7 @@ var codeExecution_20250825InputSchema = (0, import_provider_utils11.lazySchema)(
1823
1822
  ])
1824
1823
  )
1825
1824
  );
1826
- var factory7 = (0, import_provider_utils11.createProviderToolFactoryWithOutputSchema)({
1825
+ var factory7 = (0, import_provider_utils10.createProviderToolFactoryWithOutputSchema)({
1827
1826
  id: "anthropic.code_execution_20250825",
1828
1827
  inputSchema: codeExecution_20250825InputSchema,
1829
1828
  outputSchema: codeExecution_20250825OutputSchema,
@@ -1837,10 +1836,10 @@ var codeExecution_20250825 = (args = {}) => {
1837
1836
  };
1838
1837
 
1839
1838
  // src/tool/code-execution_20260120.ts
1840
- var import_provider_utils12 = require("@ai-sdk/provider-utils");
1839
+ var import_provider_utils11 = require("@ai-sdk/provider-utils");
1841
1840
  var import_v411 = require("zod/v4");
1842
- var codeExecution_20260120OutputSchema = (0, import_provider_utils12.lazySchema)(
1843
- () => (0, import_provider_utils12.zodSchema)(
1841
+ var codeExecution_20260120OutputSchema = (0, import_provider_utils11.lazySchema)(
1842
+ () => (0, import_provider_utils11.zodSchema)(
1844
1843
  import_v411.z.discriminatedUnion("type", [
1845
1844
  import_v411.z.object({
1846
1845
  type: import_v411.z.literal("code_execution_result"),
@@ -1909,8 +1908,8 @@ var codeExecution_20260120OutputSchema = (0, import_provider_utils12.lazySchema)
1909
1908
  ])
1910
1909
  )
1911
1910
  );
1912
- var codeExecution_20260120InputSchema = (0, import_provider_utils12.lazySchema)(
1913
- () => (0, import_provider_utils12.zodSchema)(
1911
+ var codeExecution_20260120InputSchema = (0, import_provider_utils11.lazySchema)(
1912
+ () => (0, import_provider_utils11.zodSchema)(
1914
1913
  import_v411.z.discriminatedUnion("type", [
1915
1914
  import_v411.z.object({
1916
1915
  type: import_v411.z.literal("programmatic-tool-call"),
@@ -1943,7 +1942,7 @@ var codeExecution_20260120InputSchema = (0, import_provider_utils12.lazySchema)(
1943
1942
  ])
1944
1943
  )
1945
1944
  );
1946
- var factory8 = (0, import_provider_utils12.createProviderToolFactoryWithOutputSchema)({
1945
+ var factory8 = (0, import_provider_utils11.createProviderToolFactoryWithOutputSchema)({
1947
1946
  id: "anthropic.code_execution_20260120",
1948
1947
  inputSchema: codeExecution_20260120InputSchema,
1949
1948
  outputSchema: codeExecution_20260120OutputSchema,
@@ -1954,10 +1953,10 @@ var codeExecution_20260120 = (args = {}) => {
1954
1953
  };
1955
1954
 
1956
1955
  // src/tool/tool-search-regex_20251119.ts
1957
- var import_provider_utils13 = require("@ai-sdk/provider-utils");
1956
+ var import_provider_utils12 = require("@ai-sdk/provider-utils");
1958
1957
  var import_v412 = require("zod/v4");
1959
- var toolSearchRegex_20251119OutputSchema = (0, import_provider_utils13.lazySchema)(
1960
- () => (0, import_provider_utils13.zodSchema)(
1958
+ var toolSearchRegex_20251119OutputSchema = (0, import_provider_utils12.lazySchema)(
1959
+ () => (0, import_provider_utils12.zodSchema)(
1961
1960
  import_v412.z.array(
1962
1961
  import_v412.z.object({
1963
1962
  type: import_v412.z.literal("tool_reference"),
@@ -1966,8 +1965,8 @@ var toolSearchRegex_20251119OutputSchema = (0, import_provider_utils13.lazySchem
1966
1965
  )
1967
1966
  )
1968
1967
  );
1969
- var toolSearchRegex_20251119InputSchema = (0, import_provider_utils13.lazySchema)(
1970
- () => (0, import_provider_utils13.zodSchema)(
1968
+ var toolSearchRegex_20251119InputSchema = (0, import_provider_utils12.lazySchema)(
1969
+ () => (0, import_provider_utils12.zodSchema)(
1971
1970
  import_v412.z.object({
1972
1971
  /**
1973
1972
  * A regex pattern to search for tools.
@@ -1987,7 +1986,7 @@ var toolSearchRegex_20251119InputSchema = (0, import_provider_utils13.lazySchema
1987
1986
  })
1988
1987
  )
1989
1988
  );
1990
- var factory9 = (0, import_provider_utils13.createProviderToolFactoryWithOutputSchema)({
1989
+ var factory9 = (0, import_provider_utils12.createProviderToolFactoryWithOutputSchema)({
1991
1990
  id: "anthropic.tool_search_regex_20251119",
1992
1991
  inputSchema: toolSearchRegex_20251119InputSchema,
1993
1992
  outputSchema: toolSearchRegex_20251119OutputSchema,
@@ -2000,7 +1999,7 @@ var toolSearchRegex_20251119 = (args = {}) => {
2000
1999
  // src/convert-to-anthropic-messages-prompt.ts
2001
2000
  function convertToString(data) {
2002
2001
  if (typeof data === "string") {
2003
- return new TextDecoder().decode((0, import_provider_utils14.convertBase64ToUint8Array)(data));
2002
+ return new TextDecoder().decode((0, import_provider_utils13.convertBase64ToUint8Array)(data));
2004
2003
  }
2005
2004
  if (data instanceof Uint8Array) {
2006
2005
  return new TextDecoder().decode(data);
@@ -2038,7 +2037,7 @@ async function convertToAnthropicMessagesPrompt({
2038
2037
  const messages = [];
2039
2038
  async function shouldEnableCitations(providerMetadata) {
2040
2039
  var _a2, _b2;
2041
- const anthropicOptions = await (0, import_provider_utils14.parseProviderOptions)({
2040
+ const anthropicOptions = await (0, import_provider_utils13.parseProviderOptions)({
2042
2041
  provider: "anthropic",
2043
2042
  providerOptions: providerMetadata,
2044
2043
  schema: anthropicFilePartProviderOptions
@@ -2046,7 +2045,7 @@ async function convertToAnthropicMessagesPrompt({
2046
2045
  return (_b2 = (_a2 = anthropicOptions == null ? void 0 : anthropicOptions.citations) == null ? void 0 : _a2.enabled) != null ? _b2 : false;
2047
2046
  }
2048
2047
  async function getDocumentMetadata(providerMetadata) {
2049
- const anthropicOptions = await (0, import_provider_utils14.parseProviderOptions)({
2048
+ const anthropicOptions = await (0, import_provider_utils13.parseProviderOptions)({
2050
2049
  provider: "anthropic",
2051
2050
  providerOptions: providerMetadata,
2052
2051
  schema: anthropicFilePartProviderOptions
@@ -2112,7 +2111,7 @@ async function convertToAnthropicMessagesPrompt({
2112
2111
  } : {
2113
2112
  type: "base64",
2114
2113
  media_type: part.mediaType === "image/*" ? "image/jpeg" : part.mediaType,
2115
- data: (0, import_provider_utils14.convertToBase64)(part.data)
2114
+ data: (0, import_provider_utils13.convertToBase64)(part.data)
2116
2115
  },
2117
2116
  cache_control: cacheControl
2118
2117
  });
@@ -2132,7 +2131,7 @@ async function convertToAnthropicMessagesPrompt({
2132
2131
  } : {
2133
2132
  type: "base64",
2134
2133
  media_type: "application/pdf",
2135
- data: (0, import_provider_utils14.convertToBase64)(part.data)
2134
+ data: (0, import_provider_utils13.convertToBase64)(part.data)
2136
2135
  },
2137
2136
  title: (_b = metadata.title) != null ? _b : part.filename,
2138
2137
  ...metadata.context && { context: metadata.context },
@@ -2270,7 +2269,7 @@ async function convertToAnthropicMessagesPrompt({
2270
2269
  return void 0;
2271
2270
  }
2272
2271
  }
2273
- }).filter(import_provider_utils14.isNonNullable);
2272
+ }).filter(import_provider_utils13.isNonNullable);
2274
2273
  break;
2275
2274
  case "text":
2276
2275
  case "error-text":
@@ -2346,7 +2345,7 @@ async function convertToAnthropicMessagesPrompt({
2346
2345
  }
2347
2346
  case "reasoning": {
2348
2347
  if (sendReasoning) {
2349
- const reasoningMetadata = await (0, import_provider_utils14.parseProviderOptions)({
2348
+ const reasoningMetadata = await (0, import_provider_utils13.parseProviderOptions)({
2350
2349
  provider: "anthropic",
2351
2350
  providerOptions: part.providerOptions,
2352
2351
  schema: anthropicReasoningMetadataSchema
@@ -2552,7 +2551,7 @@ async function convertToAnthropicMessagesPrompt({
2552
2551
  break;
2553
2552
  }
2554
2553
  if (output.value.type === "code_execution_result") {
2555
- const codeExecutionOutput = await (0, import_provider_utils14.validateTypes)({
2554
+ const codeExecutionOutput = await (0, import_provider_utils13.validateTypes)({
2556
2555
  value: output.value,
2557
2556
  schema: codeExecution_20250522OutputSchema
2558
2557
  });
@@ -2569,7 +2568,7 @@ async function convertToAnthropicMessagesPrompt({
2569
2568
  cache_control: cacheControl
2570
2569
  });
2571
2570
  } else if (output.value.type === "encrypted_code_execution_result") {
2572
- const codeExecutionOutput = await (0, import_provider_utils14.validateTypes)({
2571
+ const codeExecutionOutput = await (0, import_provider_utils13.validateTypes)({
2573
2572
  value: output.value,
2574
2573
  schema: codeExecution_20260120OutputSchema
2575
2574
  });
@@ -2588,7 +2587,7 @@ async function convertToAnthropicMessagesPrompt({
2588
2587
  });
2589
2588
  }
2590
2589
  } else {
2591
- const codeExecutionOutput = await (0, import_provider_utils14.validateTypes)({
2590
+ const codeExecutionOutput = await (0, import_provider_utils13.validateTypes)({
2592
2591
  value: output.value,
2593
2592
  schema: codeExecution_20250825OutputSchema
2594
2593
  });
@@ -2657,7 +2656,7 @@ async function convertToAnthropicMessagesPrompt({
2657
2656
  });
2658
2657
  break;
2659
2658
  }
2660
- const webFetchOutput = await (0, import_provider_utils14.validateTypes)({
2659
+ const webFetchOutput = await (0, import_provider_utils13.validateTypes)({
2661
2660
  value: output.value,
2662
2661
  schema: webFetch_20250910OutputSchema
2663
2662
  });
@@ -2692,7 +2691,7 @@ async function convertToAnthropicMessagesPrompt({
2692
2691
  });
2693
2692
  break;
2694
2693
  }
2695
- const webSearchOutput = await (0, import_provider_utils14.validateTypes)({
2694
+ const webSearchOutput = await (0, import_provider_utils13.validateTypes)({
2696
2695
  value: output.value,
2697
2696
  schema: webSearch_20250305OutputSchema
2698
2697
  });
@@ -2719,7 +2718,7 @@ async function convertToAnthropicMessagesPrompt({
2719
2718
  });
2720
2719
  break;
2721
2720
  }
2722
- const toolSearchOutput = await (0, import_provider_utils14.validateTypes)({
2721
+ const toolSearchOutput = await (0, import_provider_utils13.validateTypes)({
2723
2722
  value: output.value,
2724
2723
  schema: toolSearchRegex_20251119OutputSchema
2725
2724
  });
@@ -2832,6 +2831,152 @@ function mapAnthropicStopReason({
2832
2831
  }
2833
2832
  }
2834
2833
 
2834
+ // src/sanitize-json-schema.ts
2835
+ var SUPPORTED_STRING_FORMATS = /* @__PURE__ */ new Set([
2836
+ "date-time",
2837
+ "time",
2838
+ "date",
2839
+ "duration",
2840
+ "email",
2841
+ "hostname",
2842
+ "uri",
2843
+ "ipv4",
2844
+ "ipv6",
2845
+ "uuid"
2846
+ ]);
2847
+ var DESCRIPTION_CONSTRAINT_KEYS = [
2848
+ "minimum",
2849
+ "maximum",
2850
+ "exclusiveMinimum",
2851
+ "exclusiveMaximum",
2852
+ "multipleOf",
2853
+ "minLength",
2854
+ "maxLength",
2855
+ "pattern",
2856
+ "minItems",
2857
+ "maxItems",
2858
+ "uniqueItems",
2859
+ "minProperties",
2860
+ "maxProperties",
2861
+ "not"
2862
+ ];
2863
+ function sanitizeJsonSchema(schema) {
2864
+ return sanitizeSchema(schema);
2865
+ }
2866
+ function sanitizeDefinition(definition) {
2867
+ if (typeof definition === "boolean" || !isPlainObject(definition)) {
2868
+ return definition;
2869
+ }
2870
+ return sanitizeSchema(definition);
2871
+ }
2872
+ function sanitizeSchema(schema) {
2873
+ const result = {};
2874
+ const schemaWithDefs = schema;
2875
+ if (schema.$ref != null) {
2876
+ return { $ref: schema.$ref };
2877
+ }
2878
+ if (schema.$schema != null) {
2879
+ result.$schema = schema.$schema;
2880
+ }
2881
+ if (schema.$id != null) {
2882
+ result.$id = schema.$id;
2883
+ }
2884
+ if (schema.title != null) {
2885
+ result.title = schema.title;
2886
+ }
2887
+ if (schema.description != null) {
2888
+ result.description = schema.description;
2889
+ }
2890
+ if (schema.default !== void 0) {
2891
+ result.default = schema.default;
2892
+ }
2893
+ if (schema.const !== void 0) {
2894
+ result.const = schema.const;
2895
+ }
2896
+ if (schema.enum != null) {
2897
+ result.enum = schema.enum;
2898
+ }
2899
+ if (schema.type != null) {
2900
+ result.type = schema.type;
2901
+ }
2902
+ if (schema.anyOf != null) {
2903
+ result.anyOf = schema.anyOf.map(sanitizeDefinition);
2904
+ } else if (schema.oneOf != null) {
2905
+ result.anyOf = schema.oneOf.map(sanitizeDefinition);
2906
+ }
2907
+ if (schema.allOf != null) {
2908
+ result.allOf = schema.allOf.map(sanitizeDefinition);
2909
+ }
2910
+ if (schema.definitions != null) {
2911
+ result.definitions = Object.fromEntries(
2912
+ Object.entries(schema.definitions).map(([name, definition]) => [
2913
+ name,
2914
+ sanitizeDefinition(definition)
2915
+ ])
2916
+ );
2917
+ }
2918
+ if (schemaWithDefs.$defs != null) {
2919
+ const resultWithDefs = result;
2920
+ resultWithDefs.$defs = Object.fromEntries(
2921
+ Object.entries(schemaWithDefs.$defs).map(([name, definition]) => [
2922
+ name,
2923
+ sanitizeDefinition(definition)
2924
+ ])
2925
+ );
2926
+ }
2927
+ if (schema.type === "object" || schema.properties != null) {
2928
+ if (schema.properties != null) {
2929
+ result.properties = Object.fromEntries(
2930
+ Object.entries(schema.properties).map(([name, definition]) => [
2931
+ name,
2932
+ sanitizeDefinition(definition)
2933
+ ])
2934
+ );
2935
+ }
2936
+ result.additionalProperties = false;
2937
+ if (schema.required != null) {
2938
+ result.required = schema.required;
2939
+ }
2940
+ }
2941
+ if (schema.items != null) {
2942
+ result.items = Array.isArray(schema.items) ? schema.items.map(sanitizeDefinition) : sanitizeDefinition(schema.items);
2943
+ }
2944
+ if (typeof schema.format === "string" && SUPPORTED_STRING_FORMATS.has(schema.format)) {
2945
+ result.format = schema.format;
2946
+ }
2947
+ const constraintDescription = getConstraintDescription(schema);
2948
+ if (constraintDescription != null) {
2949
+ result.description = result.description == null ? constraintDescription : `${result.description}
2950
+ ${constraintDescription}`;
2951
+ }
2952
+ return result;
2953
+ }
2954
+ function getConstraintDescription(schema) {
2955
+ const descriptions = DESCRIPTION_CONSTRAINT_KEYS.flatMap((key) => {
2956
+ const value = schema[key];
2957
+ if (value == null || value === false) {
2958
+ return [];
2959
+ }
2960
+ return `${formatConstraintName(key)}: ${formatConstraintValue(value)}`;
2961
+ });
2962
+ if (typeof schema.format === "string" && !SUPPORTED_STRING_FORMATS.has(schema.format)) {
2963
+ descriptions.push(`format: ${schema.format}`);
2964
+ }
2965
+ return descriptions.length === 0 ? void 0 : `${descriptions.join("; ")}.`;
2966
+ }
2967
+ function formatConstraintName(key) {
2968
+ return key.replace(/[A-Z]/g, (match) => ` ${match.toLowerCase()}`);
2969
+ }
2970
+ function formatConstraintValue(value) {
2971
+ if (typeof value === "string") {
2972
+ return value;
2973
+ }
2974
+ return JSON.stringify(value);
2975
+ }
2976
+ function isPlainObject(value) {
2977
+ return typeof value === "object" && value !== null && !Array.isArray(value);
2978
+ }
2979
+
2835
2980
  // src/anthropic-messages-language-model.ts
2836
2981
  function createCitationSource(citation, citationDocuments, generateId3) {
2837
2982
  var _a;
@@ -2883,7 +3028,7 @@ var AnthropicMessagesLanguageModel = class {
2883
3028
  var _a;
2884
3029
  this.modelId = modelId;
2885
3030
  this.config = config;
2886
- this.generateId = (_a = config.generateId) != null ? _a : import_provider_utils15.generateId;
3031
+ this.generateId = (_a = config.generateId) != null ? _a : import_provider_utils14.generateId;
2887
3032
  }
2888
3033
  supportsUrl(url) {
2889
3034
  return url.protocol === "https:";
@@ -2957,12 +3102,12 @@ var AnthropicMessagesLanguageModel = class {
2957
3102
  }
2958
3103
  }
2959
3104
  const providerOptionsName = this.providerOptionsName;
2960
- const canonicalOptions = await (0, import_provider_utils15.parseProviderOptions)({
3105
+ const canonicalOptions = await (0, import_provider_utils14.parseProviderOptions)({
2961
3106
  provider: "anthropic",
2962
3107
  providerOptions,
2963
3108
  schema: anthropicLanguageModelOptions
2964
3109
  });
2965
- const customProviderOptions = providerOptionsName !== "anthropic" ? await (0, import_provider_utils15.parseProviderOptions)({
3110
+ const customProviderOptions = providerOptionsName !== "anthropic" ? await (0, import_provider_utils14.parseProviderOptions)({
2966
3111
  provider: providerOptionsName,
2967
3112
  providerOptions,
2968
3113
  schema: anthropicLanguageModelOptions
@@ -3018,7 +3163,7 @@ var AnthropicMessagesLanguageModel = class {
3018
3163
  } : void 0;
3019
3164
  const contextManagement = anthropicOptions == null ? void 0 : anthropicOptions.contextManagement;
3020
3165
  const cacheControlValidator = new CacheControlValidator();
3021
- const toolNameMapping = (0, import_provider_utils15.createToolNameMapping)({
3166
+ const toolNameMapping = (0, import_provider_utils14.createToolNameMapping)({
3022
3167
  tools,
3023
3168
  providerToolNames: {
3024
3169
  "anthropic.code_execution_20250522": "code_execution",
@@ -3087,7 +3232,7 @@ var AnthropicMessagesLanguageModel = class {
3087
3232
  ...useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && {
3088
3233
  format: {
3089
3234
  type: "json_schema",
3090
- schema: responseFormat.schema
3235
+ schema: sanitizeJsonSchema(responseFormat.schema)
3091
3236
  }
3092
3237
  }
3093
3238
  }
@@ -3328,15 +3473,15 @@ var AnthropicMessagesLanguageModel = class {
3328
3473
  betas,
3329
3474
  headers
3330
3475
  }) {
3331
- return (0, import_provider_utils15.combineHeaders)(
3332
- await (0, import_provider_utils15.resolve)(this.config.headers),
3476
+ return (0, import_provider_utils14.combineHeaders)(
3477
+ await (0, import_provider_utils14.resolve)(this.config.headers),
3333
3478
  headers,
3334
3479
  betas.size > 0 ? { "anthropic-beta": Array.from(betas).join(",") } : {}
3335
3480
  );
3336
3481
  }
3337
3482
  async getBetasFromHeaders(requestHeaders) {
3338
3483
  var _a, _b;
3339
- const configHeaders = await (0, import_provider_utils15.resolve)(this.config.headers);
3484
+ const configHeaders = await (0, import_provider_utils14.resolve)(this.config.headers);
3340
3485
  const configBetaHeader = (_a = configHeaders["anthropic-beta"]) != null ? _a : "";
3341
3486
  const requestBetaHeader = (_b = requestHeaders == null ? void 0 : requestHeaders["anthropic-beta"]) != null ? _b : "";
3342
3487
  return new Set(
@@ -3402,12 +3547,12 @@ var AnthropicMessagesLanguageModel = class {
3402
3547
  responseHeaders,
3403
3548
  value: response,
3404
3549
  rawValue: rawResponse
3405
- } = await (0, import_provider_utils15.postJsonToApi)({
3550
+ } = await (0, import_provider_utils14.postJsonToApi)({
3406
3551
  url: this.buildRequestUrl(false),
3407
3552
  headers: await this.getHeaders({ betas, headers: options.headers }),
3408
3553
  body: this.transformRequestBody(args, betas),
3409
3554
  failedResponseHandler: anthropicFailedResponseHandler,
3410
- successfulResponseHandler: (0, import_provider_utils15.createJsonResponseHandler)(
3555
+ successfulResponseHandler: (0, import_provider_utils14.createJsonResponseHandler)(
3411
3556
  anthropicMessagesResponseSchema
3412
3557
  ),
3413
3558
  abortSignal: options.abortSignal,
@@ -3822,12 +3967,12 @@ var AnthropicMessagesLanguageModel = class {
3822
3967
  body.tools
3823
3968
  );
3824
3969
  const url = this.buildRequestUrl(true);
3825
- const { responseHeaders, value: response } = await (0, import_provider_utils15.postJsonToApi)({
3970
+ const { responseHeaders, value: response } = await (0, import_provider_utils14.postJsonToApi)({
3826
3971
  url,
3827
3972
  headers: await this.getHeaders({ betas, headers: options.headers }),
3828
3973
  body: this.transformRequestBody(body, betas),
3829
3974
  failedResponseHandler: anthropicFailedResponseHandler,
3830
- successfulResponseHandler: (0, import_provider_utils15.createEventSourceResponseHandler)(
3975
+ successfulResponseHandler: (0, import_provider_utils14.createEventSourceResponseHandler)(
3831
3976
  anthropicMessagesChunkSchema
3832
3977
  ),
3833
3978
  abortSignal: options.abortSignal,
@@ -4678,42 +4823,42 @@ function mapAnthropicResponseContextManagement(contextManagement) {
4678
4823
  }
4679
4824
 
4680
4825
  // src/tool/bash_20241022.ts
4681
- var import_provider_utils16 = require("@ai-sdk/provider-utils");
4826
+ var import_provider_utils15 = require("@ai-sdk/provider-utils");
4682
4827
  var import_v413 = require("zod/v4");
4683
- var bash_20241022InputSchema = (0, import_provider_utils16.lazySchema)(
4684
- () => (0, import_provider_utils16.zodSchema)(
4828
+ var bash_20241022InputSchema = (0, import_provider_utils15.lazySchema)(
4829
+ () => (0, import_provider_utils15.zodSchema)(
4685
4830
  import_v413.z.object({
4686
4831
  command: import_v413.z.string(),
4687
4832
  restart: import_v413.z.boolean().optional()
4688
4833
  })
4689
4834
  )
4690
4835
  );
4691
- var bash_20241022 = (0, import_provider_utils16.createProviderToolFactory)({
4836
+ var bash_20241022 = (0, import_provider_utils15.createProviderToolFactory)({
4692
4837
  id: "anthropic.bash_20241022",
4693
4838
  inputSchema: bash_20241022InputSchema
4694
4839
  });
4695
4840
 
4696
4841
  // src/tool/bash_20250124.ts
4697
- var import_provider_utils17 = require("@ai-sdk/provider-utils");
4842
+ var import_provider_utils16 = require("@ai-sdk/provider-utils");
4698
4843
  var import_v414 = require("zod/v4");
4699
- var bash_20250124InputSchema = (0, import_provider_utils17.lazySchema)(
4700
- () => (0, import_provider_utils17.zodSchema)(
4844
+ var bash_20250124InputSchema = (0, import_provider_utils16.lazySchema)(
4845
+ () => (0, import_provider_utils16.zodSchema)(
4701
4846
  import_v414.z.object({
4702
4847
  command: import_v414.z.string(),
4703
4848
  restart: import_v414.z.boolean().optional()
4704
4849
  })
4705
4850
  )
4706
4851
  );
4707
- var bash_20250124 = (0, import_provider_utils17.createProviderToolFactory)({
4852
+ var bash_20250124 = (0, import_provider_utils16.createProviderToolFactory)({
4708
4853
  id: "anthropic.bash_20250124",
4709
4854
  inputSchema: bash_20250124InputSchema
4710
4855
  });
4711
4856
 
4712
4857
  // src/tool/computer_20241022.ts
4713
- var import_provider_utils18 = require("@ai-sdk/provider-utils");
4858
+ var import_provider_utils17 = require("@ai-sdk/provider-utils");
4714
4859
  var import_v415 = require("zod/v4");
4715
- var computer_20241022InputSchema = (0, import_provider_utils18.lazySchema)(
4716
- () => (0, import_provider_utils18.zodSchema)(
4860
+ var computer_20241022InputSchema = (0, import_provider_utils17.lazySchema)(
4861
+ () => (0, import_provider_utils17.zodSchema)(
4717
4862
  import_v415.z.object({
4718
4863
  action: import_v415.z.enum([
4719
4864
  "key",
@@ -4732,16 +4877,16 @@ var computer_20241022InputSchema = (0, import_provider_utils18.lazySchema)(
4732
4877
  })
4733
4878
  )
4734
4879
  );
4735
- var computer_20241022 = (0, import_provider_utils18.createProviderToolFactory)({
4880
+ var computer_20241022 = (0, import_provider_utils17.createProviderToolFactory)({
4736
4881
  id: "anthropic.computer_20241022",
4737
4882
  inputSchema: computer_20241022InputSchema
4738
4883
  });
4739
4884
 
4740
4885
  // src/tool/computer_20250124.ts
4741
- var import_provider_utils19 = require("@ai-sdk/provider-utils");
4886
+ var import_provider_utils18 = require("@ai-sdk/provider-utils");
4742
4887
  var import_v416 = require("zod/v4");
4743
- var computer_20250124InputSchema = (0, import_provider_utils19.lazySchema)(
4744
- () => (0, import_provider_utils19.zodSchema)(
4888
+ var computer_20250124InputSchema = (0, import_provider_utils18.lazySchema)(
4889
+ () => (0, import_provider_utils18.zodSchema)(
4745
4890
  import_v416.z.object({
4746
4891
  action: import_v416.z.enum([
4747
4892
  "key",
@@ -4770,16 +4915,16 @@ var computer_20250124InputSchema = (0, import_provider_utils19.lazySchema)(
4770
4915
  })
4771
4916
  )
4772
4917
  );
4773
- var computer_20250124 = (0, import_provider_utils19.createProviderToolFactory)({
4918
+ var computer_20250124 = (0, import_provider_utils18.createProviderToolFactory)({
4774
4919
  id: "anthropic.computer_20250124",
4775
4920
  inputSchema: computer_20250124InputSchema
4776
4921
  });
4777
4922
 
4778
4923
  // src/tool/computer_20251124.ts
4779
- var import_provider_utils20 = require("@ai-sdk/provider-utils");
4924
+ var import_provider_utils19 = require("@ai-sdk/provider-utils");
4780
4925
  var import_v417 = require("zod/v4");
4781
- var computer_20251124InputSchema = (0, import_provider_utils20.lazySchema)(
4782
- () => (0, import_provider_utils20.zodSchema)(
4926
+ var computer_20251124InputSchema = (0, import_provider_utils19.lazySchema)(
4927
+ () => (0, import_provider_utils19.zodSchema)(
4783
4928
  import_v417.z.object({
4784
4929
  action: import_v417.z.enum([
4785
4930
  "key",
@@ -4815,16 +4960,16 @@ var computer_20251124InputSchema = (0, import_provider_utils20.lazySchema)(
4815
4960
  })
4816
4961
  )
4817
4962
  );
4818
- var computer_20251124 = (0, import_provider_utils20.createProviderToolFactory)({
4963
+ var computer_20251124 = (0, import_provider_utils19.createProviderToolFactory)({
4819
4964
  id: "anthropic.computer_20251124",
4820
4965
  inputSchema: computer_20251124InputSchema
4821
4966
  });
4822
4967
 
4823
4968
  // src/tool/memory_20250818.ts
4824
- var import_provider_utils21 = require("@ai-sdk/provider-utils");
4969
+ var import_provider_utils20 = require("@ai-sdk/provider-utils");
4825
4970
  var import_v418 = require("zod/v4");
4826
- var memory_20250818InputSchema = (0, import_provider_utils21.lazySchema)(
4827
- () => (0, import_provider_utils21.zodSchema)(
4971
+ var memory_20250818InputSchema = (0, import_provider_utils20.lazySchema)(
4972
+ () => (0, import_provider_utils20.zodSchema)(
4828
4973
  import_v418.z.discriminatedUnion("command", [
4829
4974
  import_v418.z.object({
4830
4975
  command: import_v418.z.literal("view"),
@@ -4860,16 +5005,16 @@ var memory_20250818InputSchema = (0, import_provider_utils21.lazySchema)(
4860
5005
  ])
4861
5006
  )
4862
5007
  );
4863
- var memory_20250818 = (0, import_provider_utils21.createProviderToolFactory)({
5008
+ var memory_20250818 = (0, import_provider_utils20.createProviderToolFactory)({
4864
5009
  id: "anthropic.memory_20250818",
4865
5010
  inputSchema: memory_20250818InputSchema
4866
5011
  });
4867
5012
 
4868
5013
  // src/tool/text-editor_20241022.ts
4869
- var import_provider_utils22 = require("@ai-sdk/provider-utils");
5014
+ var import_provider_utils21 = require("@ai-sdk/provider-utils");
4870
5015
  var import_v419 = require("zod/v4");
4871
- var textEditor_20241022InputSchema = (0, import_provider_utils22.lazySchema)(
4872
- () => (0, import_provider_utils22.zodSchema)(
5016
+ var textEditor_20241022InputSchema = (0, import_provider_utils21.lazySchema)(
5017
+ () => (0, import_provider_utils21.zodSchema)(
4873
5018
  import_v419.z.object({
4874
5019
  command: import_v419.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
4875
5020
  path: import_v419.z.string(),
@@ -4882,16 +5027,16 @@ var textEditor_20241022InputSchema = (0, import_provider_utils22.lazySchema)(
4882
5027
  })
4883
5028
  )
4884
5029
  );
4885
- var textEditor_20241022 = (0, import_provider_utils22.createProviderToolFactory)({
5030
+ var textEditor_20241022 = (0, import_provider_utils21.createProviderToolFactory)({
4886
5031
  id: "anthropic.text_editor_20241022",
4887
5032
  inputSchema: textEditor_20241022InputSchema
4888
5033
  });
4889
5034
 
4890
5035
  // src/tool/text-editor_20250124.ts
4891
- var import_provider_utils23 = require("@ai-sdk/provider-utils");
5036
+ var import_provider_utils22 = require("@ai-sdk/provider-utils");
4892
5037
  var import_v420 = require("zod/v4");
4893
- var textEditor_20250124InputSchema = (0, import_provider_utils23.lazySchema)(
4894
- () => (0, import_provider_utils23.zodSchema)(
5038
+ var textEditor_20250124InputSchema = (0, import_provider_utils22.lazySchema)(
5039
+ () => (0, import_provider_utils22.zodSchema)(
4895
5040
  import_v420.z.object({
4896
5041
  command: import_v420.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
4897
5042
  path: import_v420.z.string(),
@@ -4904,16 +5049,16 @@ var textEditor_20250124InputSchema = (0, import_provider_utils23.lazySchema)(
4904
5049
  })
4905
5050
  )
4906
5051
  );
4907
- var textEditor_20250124 = (0, import_provider_utils23.createProviderToolFactory)({
5052
+ var textEditor_20250124 = (0, import_provider_utils22.createProviderToolFactory)({
4908
5053
  id: "anthropic.text_editor_20250124",
4909
5054
  inputSchema: textEditor_20250124InputSchema
4910
5055
  });
4911
5056
 
4912
5057
  // src/tool/text-editor_20250429.ts
4913
- var import_provider_utils24 = require("@ai-sdk/provider-utils");
5058
+ var import_provider_utils23 = require("@ai-sdk/provider-utils");
4914
5059
  var import_v421 = require("zod/v4");
4915
- var textEditor_20250429InputSchema = (0, import_provider_utils24.lazySchema)(
4916
- () => (0, import_provider_utils24.zodSchema)(
5060
+ var textEditor_20250429InputSchema = (0, import_provider_utils23.lazySchema)(
5061
+ () => (0, import_provider_utils23.zodSchema)(
4917
5062
  import_v421.z.object({
4918
5063
  command: import_v421.z.enum(["view", "create", "str_replace", "insert"]),
4919
5064
  path: import_v421.z.string(),
@@ -4926,16 +5071,16 @@ var textEditor_20250429InputSchema = (0, import_provider_utils24.lazySchema)(
4926
5071
  })
4927
5072
  )
4928
5073
  );
4929
- var textEditor_20250429 = (0, import_provider_utils24.createProviderToolFactory)({
5074
+ var textEditor_20250429 = (0, import_provider_utils23.createProviderToolFactory)({
4930
5075
  id: "anthropic.text_editor_20250429",
4931
5076
  inputSchema: textEditor_20250429InputSchema
4932
5077
  });
4933
5078
 
4934
5079
  // src/tool/tool-search-bm25_20251119.ts
4935
- var import_provider_utils25 = require("@ai-sdk/provider-utils");
5080
+ var import_provider_utils24 = require("@ai-sdk/provider-utils");
4936
5081
  var import_v422 = require("zod/v4");
4937
- var toolSearchBm25_20251119OutputSchema = (0, import_provider_utils25.lazySchema)(
4938
- () => (0, import_provider_utils25.zodSchema)(
5082
+ var toolSearchBm25_20251119OutputSchema = (0, import_provider_utils24.lazySchema)(
5083
+ () => (0, import_provider_utils24.zodSchema)(
4939
5084
  import_v422.z.array(
4940
5085
  import_v422.z.object({
4941
5086
  type: import_v422.z.literal("tool_reference"),
@@ -4944,8 +5089,8 @@ var toolSearchBm25_20251119OutputSchema = (0, import_provider_utils25.lazySchema
4944
5089
  )
4945
5090
  )
4946
5091
  );
4947
- var toolSearchBm25_20251119InputSchema = (0, import_provider_utils25.lazySchema)(
4948
- () => (0, import_provider_utils25.zodSchema)(
5092
+ var toolSearchBm25_20251119InputSchema = (0, import_provider_utils24.lazySchema)(
5093
+ () => (0, import_provider_utils24.zodSchema)(
4949
5094
  import_v422.z.object({
4950
5095
  /**
4951
5096
  * A natural language query to search for tools.
@@ -4959,7 +5104,7 @@ var toolSearchBm25_20251119InputSchema = (0, import_provider_utils25.lazySchema)
4959
5104
  })
4960
5105
  )
4961
5106
  );
4962
- var factory10 = (0, import_provider_utils25.createProviderToolFactoryWithOutputSchema)({
5107
+ var factory10 = (0, import_provider_utils24.createProviderToolFactoryWithOutputSchema)({
4963
5108
  id: "anthropic.tool_search_bm25_20251119",
4964
5109
  inputSchema: toolSearchBm25_20251119InputSchema,
4965
5110
  outputSchema: toolSearchBm25_20251119OutputSchema,
@@ -5174,8 +5319,8 @@ var anthropicTools = {
5174
5319
  // src/anthropic-provider.ts
5175
5320
  function createAnthropic(options = {}) {
5176
5321
  var _a, _b;
5177
- const baseURL = (_a = (0, import_provider_utils26.withoutTrailingSlash)(
5178
- (0, import_provider_utils26.loadOptionalSetting)({
5322
+ const baseURL = (_a = (0, import_provider_utils25.withoutTrailingSlash)(
5323
+ (0, import_provider_utils25.loadOptionalSetting)({
5179
5324
  settingValue: options.baseURL,
5180
5325
  environmentVariableName: "ANTHROPIC_BASE_URL"
5181
5326
  })
@@ -5189,13 +5334,13 @@ function createAnthropic(options = {}) {
5189
5334
  }
5190
5335
  const getHeaders = () => {
5191
5336
  const authHeaders = options.authToken ? { Authorization: `Bearer ${options.authToken}` } : {
5192
- "x-api-key": (0, import_provider_utils26.loadApiKey)({
5337
+ "x-api-key": (0, import_provider_utils25.loadApiKey)({
5193
5338
  apiKey: options.apiKey,
5194
5339
  environmentVariableName: "ANTHROPIC_API_KEY",
5195
5340
  description: "Anthropic"
5196
5341
  })
5197
5342
  };
5198
- return (0, import_provider_utils26.withUserAgentSuffix)(
5343
+ return (0, import_provider_utils25.withUserAgentSuffix)(
5199
5344
  {
5200
5345
  "anthropic-version": "2023-06-01",
5201
5346
  ...authHeaders,
@@ -5211,7 +5356,7 @@ function createAnthropic(options = {}) {
5211
5356
  baseURL,
5212
5357
  headers: getHeaders,
5213
5358
  fetch: options.fetch,
5214
- generateId: (_a2 = options.generateId) != null ? _a2 : import_provider_utils26.generateId,
5359
+ generateId: (_a2 = options.generateId) != null ? _a2 : import_provider_utils25.generateId,
5215
5360
  supportedUrls: () => ({
5216
5361
  "image/*": [/^https?:\/\/.*$/],
5217
5362
  "application/pdf": [/^https?:\/\/.*$/]