@ai-sdk/anthropic 2.0.0-beta.2 → 2.0.0-beta.3

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.
@@ -38,16 +38,16 @@ module.exports = __toCommonJS(internal_exports);
38
38
  // src/anthropic-messages-language-model.ts
39
39
  var import_provider3 = require("@ai-sdk/provider");
40
40
  var import_provider_utils4 = require("@ai-sdk/provider-utils");
41
- var import_zod3 = require("zod");
41
+ var import_v44 = require("zod/v4");
42
42
 
43
43
  // src/anthropic-error.ts
44
44
  var import_provider_utils = require("@ai-sdk/provider-utils");
45
- var import_zod = require("zod");
46
- var anthropicErrorDataSchema = import_zod.z.object({
47
- type: import_zod.z.literal("error"),
48
- error: import_zod.z.object({
49
- type: import_zod.z.string(),
50
- message: import_zod.z.string()
45
+ var import_v4 = require("zod/v4");
46
+ var anthropicErrorDataSchema = import_v4.z.object({
47
+ type: import_v4.z.literal("error"),
48
+ error: import_v4.z.object({
49
+ type: import_v4.z.string(),
50
+ message: import_v4.z.string()
51
51
  })
52
52
  });
53
53
  var anthropicFailedResponseHandler = (0, import_provider_utils.createJsonErrorResponseHandler)({
@@ -56,35 +56,35 @@ var anthropicFailedResponseHandler = (0, import_provider_utils.createJsonErrorRe
56
56
  });
57
57
 
58
58
  // src/anthropic-messages-options.ts
59
- var import_zod2 = require("zod");
60
- var anthropicFilePartProviderOptions = import_zod2.z.object({
59
+ var import_v42 = require("zod/v4");
60
+ var anthropicFilePartProviderOptions = import_v42.z.object({
61
61
  /**
62
62
  * Citation configuration for this document.
63
63
  * When enabled, this document will generate citations in the response.
64
64
  */
65
- citations: import_zod2.z.object({
65
+ citations: import_v42.z.object({
66
66
  /**
67
67
  * Enable citations for this document
68
68
  */
69
- enabled: import_zod2.z.boolean()
69
+ enabled: import_v42.z.boolean()
70
70
  }).optional(),
71
71
  /**
72
72
  * Custom title for the document.
73
73
  * If not provided, the filename will be used.
74
74
  */
75
- title: import_zod2.z.string().optional(),
75
+ title: import_v42.z.string().optional(),
76
76
  /**
77
77
  * Context about the document that will be passed to the model
78
78
  * but not used towards cited content.
79
79
  * Useful for storing document metadata as text or stringified JSON.
80
80
  */
81
- context: import_zod2.z.string().optional()
81
+ context: import_v42.z.string().optional()
82
82
  });
83
- var anthropicProviderOptions = import_zod2.z.object({
84
- sendReasoning: import_zod2.z.boolean().optional(),
85
- thinking: import_zod2.z.object({
86
- type: import_zod2.z.union([import_zod2.z.literal("enabled"), import_zod2.z.literal("disabled")]),
87
- budgetTokens: import_zod2.z.number().optional()
83
+ var anthropicProviderOptions = import_v42.z.object({
84
+ sendReasoning: import_v42.z.boolean().optional(),
85
+ thinking: import_v42.z.object({
86
+ type: import_v42.z.union([import_v42.z.literal("enabled"), import_v42.z.literal("disabled")]),
87
+ budgetTokens: import_v42.z.number().optional()
88
88
  }).optional()
89
89
  });
90
90
 
@@ -93,45 +93,45 @@ var import_provider = require("@ai-sdk/provider");
93
93
 
94
94
  // src/tool/web-search_20250305.ts
95
95
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
96
- var import_v4 = require("zod/v4");
97
- var webSearch_20250305ArgsSchema = import_v4.z.object({
96
+ var import_v43 = require("zod/v4");
97
+ var webSearch_20250305ArgsSchema = import_v43.z.object({
98
98
  /**
99
99
  * Maximum number of web searches Claude can perform during the conversation.
100
100
  */
101
- maxUses: import_v4.z.number().optional(),
101
+ maxUses: import_v43.z.number().optional(),
102
102
  /**
103
103
  * Optional list of domains that Claude is allowed to search.
104
104
  */
105
- allowedDomains: import_v4.z.array(import_v4.z.string()).optional(),
105
+ allowedDomains: import_v43.z.array(import_v43.z.string()).optional(),
106
106
  /**
107
107
  * Optional list of domains that Claude should avoid when searching.
108
108
  */
109
- blockedDomains: import_v4.z.array(import_v4.z.string()).optional(),
109
+ blockedDomains: import_v43.z.array(import_v43.z.string()).optional(),
110
110
  /**
111
111
  * Optional user location information to provide geographically relevant search results.
112
112
  */
113
- userLocation: import_v4.z.object({
114
- type: import_v4.z.literal("approximate"),
115
- city: import_v4.z.string().optional(),
116
- region: import_v4.z.string().optional(),
117
- country: import_v4.z.string().optional(),
118
- timezone: import_v4.z.string().optional()
113
+ userLocation: import_v43.z.object({
114
+ type: import_v43.z.literal("approximate"),
115
+ city: import_v43.z.string().optional(),
116
+ region: import_v43.z.string().optional(),
117
+ country: import_v43.z.string().optional(),
118
+ timezone: import_v43.z.string().optional()
119
119
  }).optional()
120
120
  });
121
- var webSearch_20250305OutputSchema = import_v4.z.array(
122
- import_v4.z.object({
123
- url: import_v4.z.string(),
124
- title: import_v4.z.string(),
125
- pageAge: import_v4.z.string().nullable(),
126
- encryptedContent: import_v4.z.string(),
127
- type: import_v4.z.string()
121
+ var webSearch_20250305OutputSchema = import_v43.z.array(
122
+ import_v43.z.object({
123
+ url: import_v43.z.string(),
124
+ title: import_v43.z.string(),
125
+ pageAge: import_v43.z.string().nullable(),
126
+ encryptedContent: import_v43.z.string(),
127
+ type: import_v43.z.string()
128
128
  })
129
129
  );
130
130
  var factory = (0, import_provider_utils2.createProviderDefinedToolFactoryWithOutputSchema)({
131
131
  id: "anthropic.web_search_20250305",
132
132
  name: "web_search",
133
- inputSchema: import_v4.z.object({
134
- query: import_v4.z.string()
133
+ inputSchema: import_v43.z.object({
134
+ query: import_v43.z.string()
135
135
  }),
136
136
  outputSchema: webSearch_20250305OutputSchema
137
137
  });
@@ -721,36 +721,36 @@ function mapAnthropicStopReason({
721
721
 
722
722
  // src/anthropic-messages-language-model.ts
723
723
  var citationSchemas = {
724
- webSearchResult: import_zod3.z.object({
725
- type: import_zod3.z.literal("web_search_result_location"),
726
- cited_text: import_zod3.z.string(),
727
- url: import_zod3.z.string(),
728
- title: import_zod3.z.string(),
729
- encrypted_index: import_zod3.z.string()
724
+ webSearchResult: import_v44.z.object({
725
+ type: import_v44.z.literal("web_search_result_location"),
726
+ cited_text: import_v44.z.string(),
727
+ url: import_v44.z.string(),
728
+ title: import_v44.z.string(),
729
+ encrypted_index: import_v44.z.string()
730
730
  }),
731
- pageLocation: import_zod3.z.object({
732
- type: import_zod3.z.literal("page_location"),
733
- cited_text: import_zod3.z.string(),
734
- document_index: import_zod3.z.number(),
735
- document_title: import_zod3.z.string().nullable(),
736
- start_page_number: import_zod3.z.number(),
737
- end_page_number: import_zod3.z.number()
731
+ pageLocation: import_v44.z.object({
732
+ type: import_v44.z.literal("page_location"),
733
+ cited_text: import_v44.z.string(),
734
+ document_index: import_v44.z.number(),
735
+ document_title: import_v44.z.string().nullable(),
736
+ start_page_number: import_v44.z.number(),
737
+ end_page_number: import_v44.z.number()
738
738
  }),
739
- charLocation: import_zod3.z.object({
740
- type: import_zod3.z.literal("char_location"),
741
- cited_text: import_zod3.z.string(),
742
- document_index: import_zod3.z.number(),
743
- document_title: import_zod3.z.string().nullable(),
744
- start_char_index: import_zod3.z.number(),
745
- end_char_index: import_zod3.z.number()
739
+ charLocation: import_v44.z.object({
740
+ type: import_v44.z.literal("char_location"),
741
+ cited_text: import_v44.z.string(),
742
+ document_index: import_v44.z.number(),
743
+ document_title: import_v44.z.string().nullable(),
744
+ start_char_index: import_v44.z.number(),
745
+ end_char_index: import_v44.z.number()
746
746
  })
747
747
  };
748
- var citationSchema = import_zod3.z.discriminatedUnion("type", [
748
+ var citationSchema = import_v44.z.discriminatedUnion("type", [
749
749
  citationSchemas.webSearchResult,
750
750
  citationSchemas.pageLocation,
751
751
  citationSchemas.charLocation
752
752
  ]);
753
- var documentCitationSchema = import_zod3.z.discriminatedUnion("type", [
753
+ var documentCitationSchema = import_v44.z.discriminatedUnion("type", [
754
754
  citationSchemas.pageLocation,
755
755
  citationSchemas.charLocation
756
756
  ]);
@@ -947,8 +947,12 @@ var AnthropicMessagesLanguageModel = class {
947
947
  tool_choice: anthropicToolChoice
948
948
  },
949
949
  warnings: [...warnings, ...toolWarnings],
950
- betas: /* @__PURE__ */ new Set([...messagesBetas, ...toolsBetas]),
951
- jsonResponseTool
950
+ betas: /* @__PURE__ */ new Set([
951
+ "fine-grained-tool-streaming-2025-05-14",
952
+ ...messagesBetas,
953
+ ...toolsBetas
954
+ ]),
955
+ usesJsonResponseTool: jsonResponseTool != null
952
956
  };
953
957
  }
954
958
  async getHeaders({
@@ -994,7 +998,7 @@ var AnthropicMessagesLanguageModel = class {
994
998
  }
995
999
  async doGenerate(options) {
996
1000
  var _a, _b, _c, _d, _e;
997
- const { args, warnings, betas, jsonResponseTool } = await this.getArgs(options);
1001
+ const { args, warnings, betas, usesJsonResponseTool } = await this.getArgs(options);
998
1002
  const citationDocuments = this.extractCitationDocuments(options.prompt);
999
1003
  const {
1000
1004
  responseHeaders,
@@ -1015,7 +1019,7 @@ var AnthropicMessagesLanguageModel = class {
1015
1019
  for (const part of response.content) {
1016
1020
  switch (part.type) {
1017
1021
  case "text": {
1018
- if (jsonResponseTool == null) {
1022
+ if (!usesJsonResponseTool) {
1019
1023
  content.push({ type: "text", text: part.text });
1020
1024
  if (part.citations) {
1021
1025
  for (const citation of part.citations) {
@@ -1057,7 +1061,7 @@ var AnthropicMessagesLanguageModel = class {
1057
1061
  case "tool_use": {
1058
1062
  content.push(
1059
1063
  // when a json response tool is used, the tool call becomes the text:
1060
- jsonResponseTool != null ? {
1064
+ usesJsonResponseTool ? {
1061
1065
  type: "text",
1062
1066
  text: JSON.stringify(part.input)
1063
1067
  } : {
@@ -1134,7 +1138,7 @@ var AnthropicMessagesLanguageModel = class {
1134
1138
  content,
1135
1139
  finishReason: mapAnthropicStopReason({
1136
1140
  finishReason: response.stop_reason,
1137
- isJsonResponseFromTool: jsonResponseTool != null
1141
+ isJsonResponseFromTool: usesJsonResponseTool
1138
1142
  }),
1139
1143
  usage: {
1140
1144
  inputTokens: response.usage.input_tokens,
@@ -1158,7 +1162,7 @@ var AnthropicMessagesLanguageModel = class {
1158
1162
  };
1159
1163
  }
1160
1164
  async doStream(options) {
1161
- const { args, warnings, betas, jsonResponseTool } = await this.getArgs(options);
1165
+ const { args, warnings, betas, usesJsonResponseTool } = await this.getArgs(options);
1162
1166
  const citationDocuments = this.extractCitationDocuments(options.prompt);
1163
1167
  const body = { ...args, stream: true };
1164
1168
  const { responseHeaders, value: response } = await (0, import_provider_utils4.postJsonToApi)({
@@ -1236,14 +1240,14 @@ var AnthropicMessagesLanguageModel = class {
1236
1240
  return;
1237
1241
  }
1238
1242
  case "tool_use": {
1239
- contentBlocks[value.index] = jsonResponseTool != null ? { type: "text" } : {
1243
+ contentBlocks[value.index] = usesJsonResponseTool ? { type: "text" } : {
1240
1244
  type: "tool-call",
1241
1245
  toolCallId: value.content_block.id,
1242
1246
  toolName: value.content_block.name,
1243
1247
  input: ""
1244
1248
  };
1245
1249
  controller.enqueue(
1246
- jsonResponseTool != null ? { type: "text-start", id: String(value.index) } : {
1250
+ usesJsonResponseTool ? { type: "text-start", id: String(value.index) } : {
1247
1251
  type: "tool-input-start",
1248
1252
  id: value.content_block.id,
1249
1253
  toolName: value.content_block.name
@@ -1344,7 +1348,7 @@ var AnthropicMessagesLanguageModel = class {
1344
1348
  break;
1345
1349
  }
1346
1350
  case "tool-call":
1347
- if (jsonResponseTool == null) {
1351
+ if (!usesJsonResponseTool) {
1348
1352
  controller.enqueue({
1349
1353
  type: "tool-input-end",
1350
1354
  id: contentBlock.toolCallId
@@ -1362,7 +1366,7 @@ var AnthropicMessagesLanguageModel = class {
1362
1366
  const deltaType = value.delta.type;
1363
1367
  switch (deltaType) {
1364
1368
  case "text_delta": {
1365
- if (jsonResponseTool != null) {
1369
+ if (usesJsonResponseTool) {
1366
1370
  return;
1367
1371
  }
1368
1372
  controller.enqueue({
@@ -1398,16 +1402,15 @@ var AnthropicMessagesLanguageModel = class {
1398
1402
  case "input_json_delta": {
1399
1403
  const contentBlock = contentBlocks[value.index];
1400
1404
  const delta = value.delta.partial_json;
1401
- if (jsonResponseTool == null) {
1402
- if ((contentBlock == null ? void 0 : contentBlock.type) !== "tool-call") {
1405
+ if (usesJsonResponseTool) {
1406
+ if ((contentBlock == null ? void 0 : contentBlock.type) !== "text") {
1403
1407
  return;
1404
1408
  }
1405
1409
  controller.enqueue({
1406
- type: "tool-input-delta",
1407
- id: contentBlock.toolCallId,
1410
+ type: "text-delta",
1411
+ id: String(value.index),
1408
1412
  delta
1409
1413
  });
1410
- contentBlock.input += delta;
1411
1414
  } else {
1412
1415
  if ((contentBlock == null ? void 0 : contentBlock.type) !== "tool-call") {
1413
1416
  return;
@@ -1417,6 +1420,7 @@ var AnthropicMessagesLanguageModel = class {
1417
1420
  id: contentBlock.toolCallId,
1418
1421
  delta
1419
1422
  });
1423
+ contentBlock.input += delta;
1420
1424
  }
1421
1425
  return;
1422
1426
  }
@@ -1458,7 +1462,7 @@ var AnthropicMessagesLanguageModel = class {
1458
1462
  usage.totalTokens = ((_f = usage.inputTokens) != null ? _f : 0) + ((_g = value.usage.output_tokens) != null ? _g : 0);
1459
1463
  finishReason = mapAnthropicStopReason({
1460
1464
  finishReason: value.delta.stop_reason,
1461
- isJsonResponseFromTool: jsonResponseTool != null
1465
+ isJsonResponseFromTool: usesJsonResponseTool
1462
1466
  });
1463
1467
  return;
1464
1468
  }
@@ -1488,218 +1492,218 @@ var AnthropicMessagesLanguageModel = class {
1488
1492
  };
1489
1493
  }
1490
1494
  };
1491
- var anthropicMessagesResponseSchema = import_zod3.z.object({
1492
- type: import_zod3.z.literal("message"),
1493
- id: import_zod3.z.string().nullish(),
1494
- model: import_zod3.z.string().nullish(),
1495
- content: import_zod3.z.array(
1496
- import_zod3.z.discriminatedUnion("type", [
1497
- import_zod3.z.object({
1498
- type: import_zod3.z.literal("text"),
1499
- text: import_zod3.z.string(),
1500
- citations: import_zod3.z.array(citationSchema).optional()
1495
+ var anthropicMessagesResponseSchema = import_v44.z.object({
1496
+ type: import_v44.z.literal("message"),
1497
+ id: import_v44.z.string().nullish(),
1498
+ model: import_v44.z.string().nullish(),
1499
+ content: import_v44.z.array(
1500
+ import_v44.z.discriminatedUnion("type", [
1501
+ import_v44.z.object({
1502
+ type: import_v44.z.literal("text"),
1503
+ text: import_v44.z.string(),
1504
+ citations: import_v44.z.array(citationSchema).optional()
1501
1505
  }),
1502
- import_zod3.z.object({
1503
- type: import_zod3.z.literal("thinking"),
1504
- thinking: import_zod3.z.string(),
1505
- signature: import_zod3.z.string()
1506
+ import_v44.z.object({
1507
+ type: import_v44.z.literal("thinking"),
1508
+ thinking: import_v44.z.string(),
1509
+ signature: import_v44.z.string()
1506
1510
  }),
1507
- import_zod3.z.object({
1508
- type: import_zod3.z.literal("redacted_thinking"),
1509
- data: import_zod3.z.string()
1511
+ import_v44.z.object({
1512
+ type: import_v44.z.literal("redacted_thinking"),
1513
+ data: import_v44.z.string()
1510
1514
  }),
1511
- import_zod3.z.object({
1512
- type: import_zod3.z.literal("tool_use"),
1513
- id: import_zod3.z.string(),
1514
- name: import_zod3.z.string(),
1515
- input: import_zod3.z.unknown()
1515
+ import_v44.z.object({
1516
+ type: import_v44.z.literal("tool_use"),
1517
+ id: import_v44.z.string(),
1518
+ name: import_v44.z.string(),
1519
+ input: import_v44.z.unknown()
1516
1520
  }),
1517
- import_zod3.z.object({
1518
- type: import_zod3.z.literal("server_tool_use"),
1519
- id: import_zod3.z.string(),
1520
- name: import_zod3.z.string(),
1521
- input: import_zod3.z.record(import_zod3.z.unknown()).nullish()
1521
+ import_v44.z.object({
1522
+ type: import_v44.z.literal("server_tool_use"),
1523
+ id: import_v44.z.string(),
1524
+ name: import_v44.z.string(),
1525
+ input: import_v44.z.record(import_v44.z.string(), import_v44.z.unknown()).nullish()
1522
1526
  }),
1523
- import_zod3.z.object({
1524
- type: import_zod3.z.literal("web_search_tool_result"),
1525
- tool_use_id: import_zod3.z.string(),
1526
- content: import_zod3.z.union([
1527
- import_zod3.z.array(
1528
- import_zod3.z.object({
1529
- type: import_zod3.z.literal("web_search_result"),
1530
- url: import_zod3.z.string(),
1531
- title: import_zod3.z.string(),
1532
- encrypted_content: import_zod3.z.string(),
1533
- page_age: import_zod3.z.string().nullish()
1527
+ import_v44.z.object({
1528
+ type: import_v44.z.literal("web_search_tool_result"),
1529
+ tool_use_id: import_v44.z.string(),
1530
+ content: import_v44.z.union([
1531
+ import_v44.z.array(
1532
+ import_v44.z.object({
1533
+ type: import_v44.z.literal("web_search_result"),
1534
+ url: import_v44.z.string(),
1535
+ title: import_v44.z.string(),
1536
+ encrypted_content: import_v44.z.string(),
1537
+ page_age: import_v44.z.string().nullish()
1534
1538
  })
1535
1539
  ),
1536
- import_zod3.z.object({
1537
- type: import_zod3.z.literal("web_search_tool_result_error"),
1538
- error_code: import_zod3.z.string()
1540
+ import_v44.z.object({
1541
+ type: import_v44.z.literal("web_search_tool_result_error"),
1542
+ error_code: import_v44.z.string()
1539
1543
  })
1540
1544
  ])
1541
1545
  })
1542
1546
  ])
1543
1547
  ),
1544
- stop_reason: import_zod3.z.string().nullish(),
1545
- usage: import_zod3.z.object({
1546
- input_tokens: import_zod3.z.number(),
1547
- output_tokens: import_zod3.z.number(),
1548
- cache_creation_input_tokens: import_zod3.z.number().nullish(),
1549
- cache_read_input_tokens: import_zod3.z.number().nullish(),
1550
- server_tool_use: import_zod3.z.object({
1551
- web_search_requests: import_zod3.z.number()
1548
+ stop_reason: import_v44.z.string().nullish(),
1549
+ usage: import_v44.z.object({
1550
+ input_tokens: import_v44.z.number(),
1551
+ output_tokens: import_v44.z.number(),
1552
+ cache_creation_input_tokens: import_v44.z.number().nullish(),
1553
+ cache_read_input_tokens: import_v44.z.number().nullish(),
1554
+ server_tool_use: import_v44.z.object({
1555
+ web_search_requests: import_v44.z.number()
1552
1556
  }).nullish()
1553
1557
  })
1554
1558
  });
1555
- var anthropicMessagesChunkSchema = import_zod3.z.discriminatedUnion("type", [
1556
- import_zod3.z.object({
1557
- type: import_zod3.z.literal("message_start"),
1558
- message: import_zod3.z.object({
1559
- id: import_zod3.z.string().nullish(),
1560
- model: import_zod3.z.string().nullish(),
1561
- usage: import_zod3.z.object({
1562
- input_tokens: import_zod3.z.number(),
1563
- output_tokens: import_zod3.z.number(),
1564
- cache_creation_input_tokens: import_zod3.z.number().nullish(),
1565
- cache_read_input_tokens: import_zod3.z.number().nullish()
1559
+ var anthropicMessagesChunkSchema = import_v44.z.discriminatedUnion("type", [
1560
+ import_v44.z.object({
1561
+ type: import_v44.z.literal("message_start"),
1562
+ message: import_v44.z.object({
1563
+ id: import_v44.z.string().nullish(),
1564
+ model: import_v44.z.string().nullish(),
1565
+ usage: import_v44.z.object({
1566
+ input_tokens: import_v44.z.number(),
1567
+ output_tokens: import_v44.z.number(),
1568
+ cache_creation_input_tokens: import_v44.z.number().nullish(),
1569
+ cache_read_input_tokens: import_v44.z.number().nullish()
1566
1570
  })
1567
1571
  })
1568
1572
  }),
1569
- import_zod3.z.object({
1570
- type: import_zod3.z.literal("content_block_start"),
1571
- index: import_zod3.z.number(),
1572
- content_block: import_zod3.z.discriminatedUnion("type", [
1573
- import_zod3.z.object({
1574
- type: import_zod3.z.literal("text"),
1575
- text: import_zod3.z.string()
1573
+ import_v44.z.object({
1574
+ type: import_v44.z.literal("content_block_start"),
1575
+ index: import_v44.z.number(),
1576
+ content_block: import_v44.z.discriminatedUnion("type", [
1577
+ import_v44.z.object({
1578
+ type: import_v44.z.literal("text"),
1579
+ text: import_v44.z.string()
1576
1580
  }),
1577
- import_zod3.z.object({
1578
- type: import_zod3.z.literal("thinking"),
1579
- thinking: import_zod3.z.string()
1581
+ import_v44.z.object({
1582
+ type: import_v44.z.literal("thinking"),
1583
+ thinking: import_v44.z.string()
1580
1584
  }),
1581
- import_zod3.z.object({
1582
- type: import_zod3.z.literal("tool_use"),
1583
- id: import_zod3.z.string(),
1584
- name: import_zod3.z.string()
1585
+ import_v44.z.object({
1586
+ type: import_v44.z.literal("tool_use"),
1587
+ id: import_v44.z.string(),
1588
+ name: import_v44.z.string()
1585
1589
  }),
1586
- import_zod3.z.object({
1587
- type: import_zod3.z.literal("redacted_thinking"),
1588
- data: import_zod3.z.string()
1590
+ import_v44.z.object({
1591
+ type: import_v44.z.literal("redacted_thinking"),
1592
+ data: import_v44.z.string()
1589
1593
  }),
1590
- import_zod3.z.object({
1591
- type: import_zod3.z.literal("server_tool_use"),
1592
- id: import_zod3.z.string(),
1593
- name: import_zod3.z.string(),
1594
- input: import_zod3.z.record(import_zod3.z.unknown()).nullish()
1594
+ import_v44.z.object({
1595
+ type: import_v44.z.literal("server_tool_use"),
1596
+ id: import_v44.z.string(),
1597
+ name: import_v44.z.string(),
1598
+ input: import_v44.z.record(import_v44.z.string(), import_v44.z.unknown()).nullish()
1595
1599
  }),
1596
- import_zod3.z.object({
1597
- type: import_zod3.z.literal("web_search_tool_result"),
1598
- tool_use_id: import_zod3.z.string(),
1599
- content: import_zod3.z.union([
1600
- import_zod3.z.array(
1601
- import_zod3.z.object({
1602
- type: import_zod3.z.literal("web_search_result"),
1603
- url: import_zod3.z.string(),
1604
- title: import_zod3.z.string(),
1605
- encrypted_content: import_zod3.z.string(),
1606
- page_age: import_zod3.z.string().nullish()
1600
+ import_v44.z.object({
1601
+ type: import_v44.z.literal("web_search_tool_result"),
1602
+ tool_use_id: import_v44.z.string(),
1603
+ content: import_v44.z.union([
1604
+ import_v44.z.array(
1605
+ import_v44.z.object({
1606
+ type: import_v44.z.literal("web_search_result"),
1607
+ url: import_v44.z.string(),
1608
+ title: import_v44.z.string(),
1609
+ encrypted_content: import_v44.z.string(),
1610
+ page_age: import_v44.z.string().nullish()
1607
1611
  })
1608
1612
  ),
1609
- import_zod3.z.object({
1610
- type: import_zod3.z.literal("web_search_tool_result_error"),
1611
- error_code: import_zod3.z.string()
1613
+ import_v44.z.object({
1614
+ type: import_v44.z.literal("web_search_tool_result_error"),
1615
+ error_code: import_v44.z.string()
1612
1616
  })
1613
1617
  ])
1614
1618
  })
1615
1619
  ])
1616
1620
  }),
1617
- import_zod3.z.object({
1618
- type: import_zod3.z.literal("content_block_delta"),
1619
- index: import_zod3.z.number(),
1620
- delta: import_zod3.z.discriminatedUnion("type", [
1621
- import_zod3.z.object({
1622
- type: import_zod3.z.literal("input_json_delta"),
1623
- partial_json: import_zod3.z.string()
1621
+ import_v44.z.object({
1622
+ type: import_v44.z.literal("content_block_delta"),
1623
+ index: import_v44.z.number(),
1624
+ delta: import_v44.z.discriminatedUnion("type", [
1625
+ import_v44.z.object({
1626
+ type: import_v44.z.literal("input_json_delta"),
1627
+ partial_json: import_v44.z.string()
1624
1628
  }),
1625
- import_zod3.z.object({
1626
- type: import_zod3.z.literal("text_delta"),
1627
- text: import_zod3.z.string()
1629
+ import_v44.z.object({
1630
+ type: import_v44.z.literal("text_delta"),
1631
+ text: import_v44.z.string()
1628
1632
  }),
1629
- import_zod3.z.object({
1630
- type: import_zod3.z.literal("thinking_delta"),
1631
- thinking: import_zod3.z.string()
1633
+ import_v44.z.object({
1634
+ type: import_v44.z.literal("thinking_delta"),
1635
+ thinking: import_v44.z.string()
1632
1636
  }),
1633
- import_zod3.z.object({
1634
- type: import_zod3.z.literal("signature_delta"),
1635
- signature: import_zod3.z.string()
1637
+ import_v44.z.object({
1638
+ type: import_v44.z.literal("signature_delta"),
1639
+ signature: import_v44.z.string()
1636
1640
  }),
1637
- import_zod3.z.object({
1638
- type: import_zod3.z.literal("citations_delta"),
1641
+ import_v44.z.object({
1642
+ type: import_v44.z.literal("citations_delta"),
1639
1643
  citation: citationSchema
1640
1644
  })
1641
1645
  ])
1642
1646
  }),
1643
- import_zod3.z.object({
1644
- type: import_zod3.z.literal("content_block_stop"),
1645
- index: import_zod3.z.number()
1647
+ import_v44.z.object({
1648
+ type: import_v44.z.literal("content_block_stop"),
1649
+ index: import_v44.z.number()
1646
1650
  }),
1647
- import_zod3.z.object({
1648
- type: import_zod3.z.literal("error"),
1649
- error: import_zod3.z.object({
1650
- type: import_zod3.z.string(),
1651
- message: import_zod3.z.string()
1651
+ import_v44.z.object({
1652
+ type: import_v44.z.literal("error"),
1653
+ error: import_v44.z.object({
1654
+ type: import_v44.z.string(),
1655
+ message: import_v44.z.string()
1652
1656
  })
1653
1657
  }),
1654
- import_zod3.z.object({
1655
- type: import_zod3.z.literal("message_delta"),
1656
- delta: import_zod3.z.object({ stop_reason: import_zod3.z.string().nullish() }),
1657
- usage: import_zod3.z.object({ output_tokens: import_zod3.z.number() })
1658
+ import_v44.z.object({
1659
+ type: import_v44.z.literal("message_delta"),
1660
+ delta: import_v44.z.object({ stop_reason: import_v44.z.string().nullish() }),
1661
+ usage: import_v44.z.object({ output_tokens: import_v44.z.number() })
1658
1662
  }),
1659
- import_zod3.z.object({
1660
- type: import_zod3.z.literal("message_stop")
1663
+ import_v44.z.object({
1664
+ type: import_v44.z.literal("message_stop")
1661
1665
  }),
1662
- import_zod3.z.object({
1663
- type: import_zod3.z.literal("ping")
1666
+ import_v44.z.object({
1667
+ type: import_v44.z.literal("ping")
1664
1668
  })
1665
1669
  ]);
1666
- var anthropicReasoningMetadataSchema = import_zod3.z.object({
1667
- signature: import_zod3.z.string().optional(),
1668
- redactedData: import_zod3.z.string().optional()
1670
+ var anthropicReasoningMetadataSchema = import_v44.z.object({
1671
+ signature: import_v44.z.string().optional(),
1672
+ redactedData: import_v44.z.string().optional()
1669
1673
  });
1670
1674
 
1671
1675
  // src/tool/bash_20241022.ts
1672
1676
  var import_provider_utils5 = require("@ai-sdk/provider-utils");
1673
- var import_v42 = __toESM(require("zod/v4"));
1677
+ var import_v45 = __toESM(require("zod/v4"));
1674
1678
  var bash_20241022 = (0, import_provider_utils5.createProviderDefinedToolFactory)({
1675
1679
  id: "anthropic.bash_20241022",
1676
1680
  name: "bash",
1677
- inputSchema: import_v42.default.object({
1678
- command: import_v42.default.string(),
1679
- restart: import_v42.default.boolean().optional()
1681
+ inputSchema: import_v45.default.object({
1682
+ command: import_v45.default.string(),
1683
+ restart: import_v45.default.boolean().optional()
1680
1684
  })
1681
1685
  });
1682
1686
 
1683
1687
  // src/tool/bash_20250124.ts
1684
1688
  var import_provider_utils6 = require("@ai-sdk/provider-utils");
1685
- var import_v43 = __toESM(require("zod/v4"));
1689
+ var import_v46 = __toESM(require("zod/v4"));
1686
1690
  var bash_20250124 = (0, import_provider_utils6.createProviderDefinedToolFactory)({
1687
1691
  id: "anthropic.bashTool_20250124",
1688
1692
  name: "bash",
1689
- inputSchema: import_v43.default.object({
1690
- command: import_v43.default.string(),
1691
- restart: import_v43.default.boolean().optional()
1693
+ inputSchema: import_v46.default.object({
1694
+ command: import_v46.default.string(),
1695
+ restart: import_v46.default.boolean().optional()
1692
1696
  })
1693
1697
  });
1694
1698
 
1695
1699
  // src/tool/computer_20241022.ts
1696
1700
  var import_provider_utils7 = require("@ai-sdk/provider-utils");
1697
- var import_v44 = require("zod/v4");
1701
+ var import_v47 = require("zod/v4");
1698
1702
  var computer_20241022 = (0, import_provider_utils7.createProviderDefinedToolFactory)({
1699
1703
  id: "anthropic.computer_20241022",
1700
1704
  name: "computer",
1701
- inputSchema: import_v44.z.object({
1702
- action: import_v44.z.enum([
1705
+ inputSchema: import_v47.z.object({
1706
+ action: import_v47.z.enum([
1703
1707
  "key",
1704
1708
  "type",
1705
1709
  "mouse_move",
@@ -1711,19 +1715,19 @@ var computer_20241022 = (0, import_provider_utils7.createProviderDefinedToolFact
1711
1715
  "screenshot",
1712
1716
  "cursor_position"
1713
1717
  ]),
1714
- coordinate: import_v44.z.array(import_v44.z.number().int()).optional(),
1715
- text: import_v44.z.string().optional()
1718
+ coordinate: import_v47.z.array(import_v47.z.number().int()).optional(),
1719
+ text: import_v47.z.string().optional()
1716
1720
  })
1717
1721
  });
1718
1722
 
1719
1723
  // src/tool/computer_20250124.ts
1720
1724
  var import_provider_utils8 = require("@ai-sdk/provider-utils");
1721
- var import_v45 = require("zod/v4");
1725
+ var import_v48 = require("zod/v4");
1722
1726
  var computer_20250124 = (0, import_provider_utils8.createProviderDefinedToolFactory)({
1723
1727
  id: "anthropic.computer_20250124",
1724
1728
  name: "computer",
1725
- inputSchema: import_v45.z.object({
1726
- action: import_v45.z.enum([
1729
+ inputSchema: import_v48.z.object({
1730
+ action: import_v48.z.enum([
1727
1731
  "key",
1728
1732
  "hold_key",
1729
1733
  "type",
@@ -1741,46 +1745,46 @@ var computer_20250124 = (0, import_provider_utils8.createProviderDefinedToolFact
1741
1745
  "wait",
1742
1746
  "screenshot"
1743
1747
  ]),
1744
- coordinate: import_v45.z.tuple([import_v45.z.number().int(), import_v45.z.number().int()]).optional(),
1745
- duration: import_v45.z.number().optional(),
1746
- scroll_amount: import_v45.z.number().optional(),
1747
- scroll_direction: import_v45.z.enum(["up", "down", "left", "right"]).optional(),
1748
- start_coordinate: import_v45.z.tuple([import_v45.z.number().int(), import_v45.z.number().int()]).optional(),
1749
- text: import_v45.z.string().optional()
1748
+ coordinate: import_v48.z.tuple([import_v48.z.number().int(), import_v48.z.number().int()]).optional(),
1749
+ duration: import_v48.z.number().optional(),
1750
+ scroll_amount: import_v48.z.number().optional(),
1751
+ scroll_direction: import_v48.z.enum(["up", "down", "left", "right"]).optional(),
1752
+ start_coordinate: import_v48.z.tuple([import_v48.z.number().int(), import_v48.z.number().int()]).optional(),
1753
+ text: import_v48.z.string().optional()
1750
1754
  })
1751
1755
  });
1752
1756
 
1753
1757
  // src/tool/text-editor_20241022.ts
1754
1758
  var import_provider_utils9 = require("@ai-sdk/provider-utils");
1755
- var import_v46 = require("zod/v4");
1759
+ var import_v49 = require("zod/v4");
1756
1760
  var textEditor_20241022 = (0, import_provider_utils9.createProviderDefinedToolFactory)({
1757
1761
  id: "anthropic.text_editor_20241022",
1758
1762
  name: "str_replace_editor",
1759
- inputSchema: import_v46.z.object({
1760
- command: import_v46.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
1761
- path: import_v46.z.string(),
1762
- file_text: import_v46.z.string().optional(),
1763
- insert_line: import_v46.z.number().int().optional(),
1764
- new_str: import_v46.z.string().optional(),
1765
- old_str: import_v46.z.string().optional(),
1766
- view_range: import_v46.z.array(import_v46.z.number().int()).optional()
1763
+ inputSchema: import_v49.z.object({
1764
+ command: import_v49.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
1765
+ path: import_v49.z.string(),
1766
+ file_text: import_v49.z.string().optional(),
1767
+ insert_line: import_v49.z.number().int().optional(),
1768
+ new_str: import_v49.z.string().optional(),
1769
+ old_str: import_v49.z.string().optional(),
1770
+ view_range: import_v49.z.array(import_v49.z.number().int()).optional()
1767
1771
  })
1768
1772
  });
1769
1773
 
1770
1774
  // src/tool/text-editor_20250124.ts
1771
1775
  var import_provider_utils10 = require("@ai-sdk/provider-utils");
1772
- var import_v47 = require("zod/v4");
1776
+ var import_v410 = require("zod/v4");
1773
1777
  var textEditor_20250124 = (0, import_provider_utils10.createProviderDefinedToolFactory)({
1774
1778
  id: "anthropic.text_editor_20250124",
1775
1779
  name: "str_replace_editor",
1776
- inputSchema: import_v47.z.object({
1777
- command: import_v47.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
1778
- path: import_v47.z.string(),
1779
- file_text: import_v47.z.string().optional(),
1780
- insert_line: import_v47.z.number().int().optional(),
1781
- new_str: import_v47.z.string().optional(),
1782
- old_str: import_v47.z.string().optional(),
1783
- view_range: import_v47.z.array(import_v47.z.number().int()).optional()
1780
+ inputSchema: import_v410.z.object({
1781
+ command: import_v410.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
1782
+ path: import_v410.z.string(),
1783
+ file_text: import_v410.z.string().optional(),
1784
+ insert_line: import_v410.z.number().int().optional(),
1785
+ new_str: import_v410.z.string().optional(),
1786
+ old_str: import_v410.z.string().optional(),
1787
+ view_range: import_v410.z.array(import_v410.z.number().int()).optional()
1784
1788
  })
1785
1789
  });
1786
1790