@ai-sdk/anthropic 3.0.0-beta.19 → 3.0.0-beta.20

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
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
 
30
20
  // src/index.ts
@@ -41,7 +31,7 @@ var import_provider4 = require("@ai-sdk/provider");
41
31
  var import_provider_utils18 = require("@ai-sdk/provider-utils");
42
32
 
43
33
  // src/version.ts
44
- var VERSION = true ? "3.0.0-beta.19" : "0.0.0-test";
34
+ var VERSION = true ? "3.0.0-beta.20" : "0.0.0-test";
45
35
 
46
36
  // src/anthropic-messages-language-model.ts
47
37
  var import_provider3 = require("@ai-sdk/provider");
@@ -49,14 +39,14 @@ var import_provider_utils10 = require("@ai-sdk/provider-utils");
49
39
 
50
40
  // src/anthropic-error.ts
51
41
  var import_provider_utils = require("@ai-sdk/provider-utils");
52
- var z = __toESM(require("zod/v4"));
42
+ var import_v4 = require("zod/v4");
53
43
  var anthropicErrorDataSchema = (0, import_provider_utils.lazySchema)(
54
44
  () => (0, import_provider_utils.zodSchema)(
55
- z.object({
56
- type: z.literal("error"),
57
- error: z.object({
58
- type: z.string(),
59
- message: z.string()
45
+ import_v4.z.object({
46
+ type: import_v4.z.literal("error"),
47
+ error: import_v4.z.object({
48
+ type: import_v4.z.string(),
49
+ message: import_v4.z.string()
60
50
  })
61
51
  })
62
52
  )
@@ -68,377 +58,377 @@ var anthropicFailedResponseHandler = (0, import_provider_utils.createJsonErrorRe
68
58
 
69
59
  // src/anthropic-messages-api.ts
70
60
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
71
- var z2 = __toESM(require("zod/v4"));
61
+ var import_v42 = require("zod/v4");
72
62
  var anthropicMessagesResponseSchema = (0, import_provider_utils2.lazySchema)(
73
63
  () => (0, import_provider_utils2.zodSchema)(
74
- z2.object({
75
- type: z2.literal("message"),
76
- id: z2.string().nullish(),
77
- model: z2.string().nullish(),
78
- content: z2.array(
79
- z2.discriminatedUnion("type", [
80
- z2.object({
81
- type: z2.literal("text"),
82
- text: z2.string(),
83
- citations: z2.array(
84
- z2.discriminatedUnion("type", [
85
- z2.object({
86
- type: z2.literal("web_search_result_location"),
87
- cited_text: z2.string(),
88
- url: z2.string(),
89
- title: z2.string(),
90
- encrypted_index: z2.string()
64
+ import_v42.z.object({
65
+ type: import_v42.z.literal("message"),
66
+ id: import_v42.z.string().nullish(),
67
+ model: import_v42.z.string().nullish(),
68
+ content: import_v42.z.array(
69
+ import_v42.z.discriminatedUnion("type", [
70
+ import_v42.z.object({
71
+ type: import_v42.z.literal("text"),
72
+ text: import_v42.z.string(),
73
+ citations: import_v42.z.array(
74
+ import_v42.z.discriminatedUnion("type", [
75
+ import_v42.z.object({
76
+ type: import_v42.z.literal("web_search_result_location"),
77
+ cited_text: import_v42.z.string(),
78
+ url: import_v42.z.string(),
79
+ title: import_v42.z.string(),
80
+ encrypted_index: import_v42.z.string()
91
81
  }),
92
- z2.object({
93
- type: z2.literal("page_location"),
94
- cited_text: z2.string(),
95
- document_index: z2.number(),
96
- document_title: z2.string().nullable(),
97
- start_page_number: z2.number(),
98
- end_page_number: z2.number()
82
+ import_v42.z.object({
83
+ type: import_v42.z.literal("page_location"),
84
+ cited_text: import_v42.z.string(),
85
+ document_index: import_v42.z.number(),
86
+ document_title: import_v42.z.string().nullable(),
87
+ start_page_number: import_v42.z.number(),
88
+ end_page_number: import_v42.z.number()
99
89
  }),
100
- z2.object({
101
- type: z2.literal("char_location"),
102
- cited_text: z2.string(),
103
- document_index: z2.number(),
104
- document_title: z2.string().nullable(),
105
- start_char_index: z2.number(),
106
- end_char_index: z2.number()
90
+ import_v42.z.object({
91
+ type: import_v42.z.literal("char_location"),
92
+ cited_text: import_v42.z.string(),
93
+ document_index: import_v42.z.number(),
94
+ document_title: import_v42.z.string().nullable(),
95
+ start_char_index: import_v42.z.number(),
96
+ end_char_index: import_v42.z.number()
107
97
  })
108
98
  ])
109
99
  ).optional()
110
100
  }),
111
- z2.object({
112
- type: z2.literal("thinking"),
113
- thinking: z2.string(),
114
- signature: z2.string()
101
+ import_v42.z.object({
102
+ type: import_v42.z.literal("thinking"),
103
+ thinking: import_v42.z.string(),
104
+ signature: import_v42.z.string()
115
105
  }),
116
- z2.object({
117
- type: z2.literal("redacted_thinking"),
118
- data: z2.string()
106
+ import_v42.z.object({
107
+ type: import_v42.z.literal("redacted_thinking"),
108
+ data: import_v42.z.string()
119
109
  }),
120
- z2.object({
121
- type: z2.literal("tool_use"),
122
- id: z2.string(),
123
- name: z2.string(),
124
- input: z2.unknown()
110
+ import_v42.z.object({
111
+ type: import_v42.z.literal("tool_use"),
112
+ id: import_v42.z.string(),
113
+ name: import_v42.z.string(),
114
+ input: import_v42.z.unknown()
125
115
  }),
126
- z2.object({
127
- type: z2.literal("server_tool_use"),
128
- id: z2.string(),
129
- name: z2.string(),
130
- input: z2.record(z2.string(), z2.unknown()).nullish()
116
+ import_v42.z.object({
117
+ type: import_v42.z.literal("server_tool_use"),
118
+ id: import_v42.z.string(),
119
+ name: import_v42.z.string(),
120
+ input: import_v42.z.record(import_v42.z.string(), import_v42.z.unknown()).nullish()
131
121
  }),
132
- z2.object({
133
- type: z2.literal("web_fetch_tool_result"),
134
- tool_use_id: z2.string(),
135
- content: z2.union([
136
- z2.object({
137
- type: z2.literal("web_fetch_result"),
138
- url: z2.string(),
139
- retrieved_at: z2.string(),
140
- content: z2.object({
141
- type: z2.literal("document"),
142
- title: z2.string().nullable(),
143
- citations: z2.object({ enabled: z2.boolean() }).optional(),
144
- source: z2.object({
145
- type: z2.literal("text"),
146
- media_type: z2.string(),
147
- data: z2.string()
122
+ import_v42.z.object({
123
+ type: import_v42.z.literal("web_fetch_tool_result"),
124
+ tool_use_id: import_v42.z.string(),
125
+ content: import_v42.z.union([
126
+ import_v42.z.object({
127
+ type: import_v42.z.literal("web_fetch_result"),
128
+ url: import_v42.z.string(),
129
+ retrieved_at: import_v42.z.string(),
130
+ content: import_v42.z.object({
131
+ type: import_v42.z.literal("document"),
132
+ title: import_v42.z.string().nullable(),
133
+ citations: import_v42.z.object({ enabled: import_v42.z.boolean() }).optional(),
134
+ source: import_v42.z.object({
135
+ type: import_v42.z.literal("text"),
136
+ media_type: import_v42.z.string(),
137
+ data: import_v42.z.string()
148
138
  })
149
139
  })
150
140
  }),
151
- z2.object({
152
- type: z2.literal("web_fetch_tool_result_error"),
153
- error_code: z2.string()
141
+ import_v42.z.object({
142
+ type: import_v42.z.literal("web_fetch_tool_result_error"),
143
+ error_code: import_v42.z.string()
154
144
  })
155
145
  ])
156
146
  }),
157
- z2.object({
158
- type: z2.literal("web_search_tool_result"),
159
- tool_use_id: z2.string(),
160
- content: z2.union([
161
- z2.array(
162
- z2.object({
163
- type: z2.literal("web_search_result"),
164
- url: z2.string(),
165
- title: z2.string(),
166
- encrypted_content: z2.string(),
167
- page_age: z2.string().nullish()
147
+ import_v42.z.object({
148
+ type: import_v42.z.literal("web_search_tool_result"),
149
+ tool_use_id: import_v42.z.string(),
150
+ content: import_v42.z.union([
151
+ import_v42.z.array(
152
+ import_v42.z.object({
153
+ type: import_v42.z.literal("web_search_result"),
154
+ url: import_v42.z.string(),
155
+ title: import_v42.z.string(),
156
+ encrypted_content: import_v42.z.string(),
157
+ page_age: import_v42.z.string().nullish()
168
158
  })
169
159
  ),
170
- z2.object({
171
- type: z2.literal("web_search_tool_result_error"),
172
- error_code: z2.string()
160
+ import_v42.z.object({
161
+ type: import_v42.z.literal("web_search_tool_result_error"),
162
+ error_code: import_v42.z.string()
173
163
  })
174
164
  ])
175
165
  }),
176
- z2.object({
177
- type: z2.literal("code_execution_tool_result"),
178
- tool_use_id: z2.string(),
179
- content: z2.union([
180
- z2.object({
181
- type: z2.literal("code_execution_result"),
182
- stdout: z2.string(),
183
- stderr: z2.string(),
184
- return_code: z2.number()
166
+ import_v42.z.object({
167
+ type: import_v42.z.literal("code_execution_tool_result"),
168
+ tool_use_id: import_v42.z.string(),
169
+ content: import_v42.z.union([
170
+ import_v42.z.object({
171
+ type: import_v42.z.literal("code_execution_result"),
172
+ stdout: import_v42.z.string(),
173
+ stderr: import_v42.z.string(),
174
+ return_code: import_v42.z.number()
185
175
  }),
186
- z2.object({
187
- type: z2.literal("code_execution_tool_result_error"),
188
- error_code: z2.string()
176
+ import_v42.z.object({
177
+ type: import_v42.z.literal("code_execution_tool_result_error"),
178
+ error_code: import_v42.z.string()
189
179
  })
190
180
  ])
191
181
  })
192
182
  ])
193
183
  ),
194
- stop_reason: z2.string().nullish(),
195
- stop_sequence: z2.string().nullish(),
196
- usage: z2.looseObject({
197
- input_tokens: z2.number(),
198
- output_tokens: z2.number(),
199
- cache_creation_input_tokens: z2.number().nullish(),
200
- cache_read_input_tokens: z2.number().nullish()
184
+ stop_reason: import_v42.z.string().nullish(),
185
+ stop_sequence: import_v42.z.string().nullish(),
186
+ usage: import_v42.z.looseObject({
187
+ input_tokens: import_v42.z.number(),
188
+ output_tokens: import_v42.z.number(),
189
+ cache_creation_input_tokens: import_v42.z.number().nullish(),
190
+ cache_read_input_tokens: import_v42.z.number().nullish()
201
191
  })
202
192
  })
203
193
  )
204
194
  );
205
195
  var anthropicMessagesChunkSchema = (0, import_provider_utils2.lazySchema)(
206
196
  () => (0, import_provider_utils2.zodSchema)(
207
- z2.discriminatedUnion("type", [
208
- z2.object({
209
- type: z2.literal("message_start"),
210
- message: z2.object({
211
- id: z2.string().nullish(),
212
- model: z2.string().nullish(),
213
- usage: z2.looseObject({
214
- input_tokens: z2.number(),
215
- cache_creation_input_tokens: z2.number().nullish(),
216
- cache_read_input_tokens: z2.number().nullish()
197
+ import_v42.z.discriminatedUnion("type", [
198
+ import_v42.z.object({
199
+ type: import_v42.z.literal("message_start"),
200
+ message: import_v42.z.object({
201
+ id: import_v42.z.string().nullish(),
202
+ model: import_v42.z.string().nullish(),
203
+ usage: import_v42.z.looseObject({
204
+ input_tokens: import_v42.z.number(),
205
+ cache_creation_input_tokens: import_v42.z.number().nullish(),
206
+ cache_read_input_tokens: import_v42.z.number().nullish()
217
207
  })
218
208
  })
219
209
  }),
220
- z2.object({
221
- type: z2.literal("content_block_start"),
222
- index: z2.number(),
223
- content_block: z2.discriminatedUnion("type", [
224
- z2.object({
225
- type: z2.literal("text"),
226
- text: z2.string()
210
+ import_v42.z.object({
211
+ type: import_v42.z.literal("content_block_start"),
212
+ index: import_v42.z.number(),
213
+ content_block: import_v42.z.discriminatedUnion("type", [
214
+ import_v42.z.object({
215
+ type: import_v42.z.literal("text"),
216
+ text: import_v42.z.string()
227
217
  }),
228
- z2.object({
229
- type: z2.literal("thinking"),
230
- thinking: z2.string()
218
+ import_v42.z.object({
219
+ type: import_v42.z.literal("thinking"),
220
+ thinking: import_v42.z.string()
231
221
  }),
232
- z2.object({
233
- type: z2.literal("tool_use"),
234
- id: z2.string(),
235
- name: z2.string()
222
+ import_v42.z.object({
223
+ type: import_v42.z.literal("tool_use"),
224
+ id: import_v42.z.string(),
225
+ name: import_v42.z.string()
236
226
  }),
237
- z2.object({
238
- type: z2.literal("redacted_thinking"),
239
- data: z2.string()
227
+ import_v42.z.object({
228
+ type: import_v42.z.literal("redacted_thinking"),
229
+ data: import_v42.z.string()
240
230
  }),
241
- z2.object({
242
- type: z2.literal("server_tool_use"),
243
- id: z2.string(),
244
- name: z2.string(),
245
- input: z2.record(z2.string(), z2.unknown()).nullish()
231
+ import_v42.z.object({
232
+ type: import_v42.z.literal("server_tool_use"),
233
+ id: import_v42.z.string(),
234
+ name: import_v42.z.string(),
235
+ input: import_v42.z.record(import_v42.z.string(), import_v42.z.unknown()).nullish()
246
236
  }),
247
- z2.object({
248
- type: z2.literal("web_fetch_tool_result"),
249
- tool_use_id: z2.string(),
250
- content: z2.union([
251
- z2.object({
252
- type: z2.literal("web_fetch_result"),
253
- url: z2.string(),
254
- retrieved_at: z2.string(),
255
- content: z2.object({
256
- type: z2.literal("document"),
257
- title: z2.string().nullable(),
258
- citations: z2.object({ enabled: z2.boolean() }).optional(),
259
- source: z2.object({
260
- type: z2.literal("text"),
261
- media_type: z2.string(),
262
- data: z2.string()
237
+ import_v42.z.object({
238
+ type: import_v42.z.literal("web_fetch_tool_result"),
239
+ tool_use_id: import_v42.z.string(),
240
+ content: import_v42.z.union([
241
+ import_v42.z.object({
242
+ type: import_v42.z.literal("web_fetch_result"),
243
+ url: import_v42.z.string(),
244
+ retrieved_at: import_v42.z.string(),
245
+ content: import_v42.z.object({
246
+ type: import_v42.z.literal("document"),
247
+ title: import_v42.z.string().nullable(),
248
+ citations: import_v42.z.object({ enabled: import_v42.z.boolean() }).optional(),
249
+ source: import_v42.z.object({
250
+ type: import_v42.z.literal("text"),
251
+ media_type: import_v42.z.string(),
252
+ data: import_v42.z.string()
263
253
  })
264
254
  })
265
255
  }),
266
- z2.object({
267
- type: z2.literal("web_fetch_tool_result_error"),
268
- error_code: z2.string()
256
+ import_v42.z.object({
257
+ type: import_v42.z.literal("web_fetch_tool_result_error"),
258
+ error_code: import_v42.z.string()
269
259
  })
270
260
  ])
271
261
  }),
272
- z2.object({
273
- type: z2.literal("web_search_tool_result"),
274
- tool_use_id: z2.string(),
275
- content: z2.union([
276
- z2.array(
277
- z2.object({
278
- type: z2.literal("web_search_result"),
279
- url: z2.string(),
280
- title: z2.string(),
281
- encrypted_content: z2.string(),
282
- page_age: z2.string().nullish()
262
+ import_v42.z.object({
263
+ type: import_v42.z.literal("web_search_tool_result"),
264
+ tool_use_id: import_v42.z.string(),
265
+ content: import_v42.z.union([
266
+ import_v42.z.array(
267
+ import_v42.z.object({
268
+ type: import_v42.z.literal("web_search_result"),
269
+ url: import_v42.z.string(),
270
+ title: import_v42.z.string(),
271
+ encrypted_content: import_v42.z.string(),
272
+ page_age: import_v42.z.string().nullish()
283
273
  })
284
274
  ),
285
- z2.object({
286
- type: z2.literal("web_search_tool_result_error"),
287
- error_code: z2.string()
275
+ import_v42.z.object({
276
+ type: import_v42.z.literal("web_search_tool_result_error"),
277
+ error_code: import_v42.z.string()
288
278
  })
289
279
  ])
290
280
  }),
291
- z2.object({
292
- type: z2.literal("code_execution_tool_result"),
293
- tool_use_id: z2.string(),
294
- content: z2.union([
295
- z2.object({
296
- type: z2.literal("code_execution_result"),
297
- stdout: z2.string(),
298
- stderr: z2.string(),
299
- return_code: z2.number()
281
+ import_v42.z.object({
282
+ type: import_v42.z.literal("code_execution_tool_result"),
283
+ tool_use_id: import_v42.z.string(),
284
+ content: import_v42.z.union([
285
+ import_v42.z.object({
286
+ type: import_v42.z.literal("code_execution_result"),
287
+ stdout: import_v42.z.string(),
288
+ stderr: import_v42.z.string(),
289
+ return_code: import_v42.z.number()
300
290
  }),
301
- z2.object({
302
- type: z2.literal("code_execution_tool_result_error"),
303
- error_code: z2.string()
291
+ import_v42.z.object({
292
+ type: import_v42.z.literal("code_execution_tool_result_error"),
293
+ error_code: import_v42.z.string()
304
294
  })
305
295
  ])
306
296
  })
307
297
  ])
308
298
  }),
309
- z2.object({
310
- type: z2.literal("content_block_delta"),
311
- index: z2.number(),
312
- delta: z2.discriminatedUnion("type", [
313
- z2.object({
314
- type: z2.literal("input_json_delta"),
315
- partial_json: z2.string()
299
+ import_v42.z.object({
300
+ type: import_v42.z.literal("content_block_delta"),
301
+ index: import_v42.z.number(),
302
+ delta: import_v42.z.discriminatedUnion("type", [
303
+ import_v42.z.object({
304
+ type: import_v42.z.literal("input_json_delta"),
305
+ partial_json: import_v42.z.string()
316
306
  }),
317
- z2.object({
318
- type: z2.literal("text_delta"),
319
- text: z2.string()
307
+ import_v42.z.object({
308
+ type: import_v42.z.literal("text_delta"),
309
+ text: import_v42.z.string()
320
310
  }),
321
- z2.object({
322
- type: z2.literal("thinking_delta"),
323
- thinking: z2.string()
311
+ import_v42.z.object({
312
+ type: import_v42.z.literal("thinking_delta"),
313
+ thinking: import_v42.z.string()
324
314
  }),
325
- z2.object({
326
- type: z2.literal("signature_delta"),
327
- signature: z2.string()
315
+ import_v42.z.object({
316
+ type: import_v42.z.literal("signature_delta"),
317
+ signature: import_v42.z.string()
328
318
  }),
329
- z2.object({
330
- type: z2.literal("citations_delta"),
331
- citation: z2.discriminatedUnion("type", [
332
- z2.object({
333
- type: z2.literal("web_search_result_location"),
334
- cited_text: z2.string(),
335
- url: z2.string(),
336
- title: z2.string(),
337
- encrypted_index: z2.string()
319
+ import_v42.z.object({
320
+ type: import_v42.z.literal("citations_delta"),
321
+ citation: import_v42.z.discriminatedUnion("type", [
322
+ import_v42.z.object({
323
+ type: import_v42.z.literal("web_search_result_location"),
324
+ cited_text: import_v42.z.string(),
325
+ url: import_v42.z.string(),
326
+ title: import_v42.z.string(),
327
+ encrypted_index: import_v42.z.string()
338
328
  }),
339
- z2.object({
340
- type: z2.literal("page_location"),
341
- cited_text: z2.string(),
342
- document_index: z2.number(),
343
- document_title: z2.string().nullable(),
344
- start_page_number: z2.number(),
345
- end_page_number: z2.number()
329
+ import_v42.z.object({
330
+ type: import_v42.z.literal("page_location"),
331
+ cited_text: import_v42.z.string(),
332
+ document_index: import_v42.z.number(),
333
+ document_title: import_v42.z.string().nullable(),
334
+ start_page_number: import_v42.z.number(),
335
+ end_page_number: import_v42.z.number()
346
336
  }),
347
- z2.object({
348
- type: z2.literal("char_location"),
349
- cited_text: z2.string(),
350
- document_index: z2.number(),
351
- document_title: z2.string().nullable(),
352
- start_char_index: z2.number(),
353
- end_char_index: z2.number()
337
+ import_v42.z.object({
338
+ type: import_v42.z.literal("char_location"),
339
+ cited_text: import_v42.z.string(),
340
+ document_index: import_v42.z.number(),
341
+ document_title: import_v42.z.string().nullable(),
342
+ start_char_index: import_v42.z.number(),
343
+ end_char_index: import_v42.z.number()
354
344
  })
355
345
  ])
356
346
  })
357
347
  ])
358
348
  }),
359
- z2.object({
360
- type: z2.literal("content_block_stop"),
361
- index: z2.number()
349
+ import_v42.z.object({
350
+ type: import_v42.z.literal("content_block_stop"),
351
+ index: import_v42.z.number()
362
352
  }),
363
- z2.object({
364
- type: z2.literal("error"),
365
- error: z2.object({
366
- type: z2.string(),
367
- message: z2.string()
353
+ import_v42.z.object({
354
+ type: import_v42.z.literal("error"),
355
+ error: import_v42.z.object({
356
+ type: import_v42.z.string(),
357
+ message: import_v42.z.string()
368
358
  })
369
359
  }),
370
- z2.object({
371
- type: z2.literal("message_delta"),
372
- delta: z2.object({
373
- stop_reason: z2.string().nullish(),
374
- stop_sequence: z2.string().nullish()
360
+ import_v42.z.object({
361
+ type: import_v42.z.literal("message_delta"),
362
+ delta: import_v42.z.object({
363
+ stop_reason: import_v42.z.string().nullish(),
364
+ stop_sequence: import_v42.z.string().nullish()
375
365
  }),
376
- usage: z2.looseObject({
377
- output_tokens: z2.number(),
378
- cache_creation_input_tokens: z2.number().nullish()
366
+ usage: import_v42.z.looseObject({
367
+ output_tokens: import_v42.z.number(),
368
+ cache_creation_input_tokens: import_v42.z.number().nullish()
379
369
  })
380
370
  }),
381
- z2.object({
382
- type: z2.literal("message_stop")
371
+ import_v42.z.object({
372
+ type: import_v42.z.literal("message_stop")
383
373
  }),
384
- z2.object({
385
- type: z2.literal("ping")
374
+ import_v42.z.object({
375
+ type: import_v42.z.literal("ping")
386
376
  })
387
377
  ])
388
378
  )
389
379
  );
390
380
  var anthropicReasoningMetadataSchema = (0, import_provider_utils2.lazySchema)(
391
381
  () => (0, import_provider_utils2.zodSchema)(
392
- z2.object({
393
- signature: z2.string().optional(),
394
- redactedData: z2.string().optional()
382
+ import_v42.z.object({
383
+ signature: import_v42.z.string().optional(),
384
+ redactedData: import_v42.z.string().optional()
395
385
  })
396
386
  )
397
387
  );
398
388
 
399
389
  // src/anthropic-messages-options.ts
400
- var z3 = __toESM(require("zod/v4"));
401
- var anthropicFilePartProviderOptions = z3.object({
390
+ var import_v43 = require("zod/v4");
391
+ var anthropicFilePartProviderOptions = import_v43.z.object({
402
392
  /**
403
393
  * Citation configuration for this document.
404
394
  * When enabled, this document will generate citations in the response.
405
395
  */
406
- citations: z3.object({
396
+ citations: import_v43.z.object({
407
397
  /**
408
398
  * Enable citations for this document
409
399
  */
410
- enabled: z3.boolean()
400
+ enabled: import_v43.z.boolean()
411
401
  }).optional(),
412
402
  /**
413
403
  * Custom title for the document.
414
404
  * If not provided, the filename will be used.
415
405
  */
416
- title: z3.string().optional(),
406
+ title: import_v43.z.string().optional(),
417
407
  /**
418
408
  * Context about the document that will be passed to the model
419
409
  * but not used towards cited content.
420
410
  * Useful for storing document metadata as text or stringified JSON.
421
411
  */
422
- context: z3.string().optional()
412
+ context: import_v43.z.string().optional()
423
413
  });
424
- var anthropicProviderOptions = z3.object({
425
- sendReasoning: z3.boolean().optional(),
426
- thinking: z3.object({
427
- type: z3.union([z3.literal("enabled"), z3.literal("disabled")]),
428
- budgetTokens: z3.number().optional()
414
+ var anthropicProviderOptions = import_v43.z.object({
415
+ sendReasoning: import_v43.z.boolean().optional(),
416
+ thinking: import_v43.z.object({
417
+ type: import_v43.z.union([import_v43.z.literal("enabled"), import_v43.z.literal("disabled")]),
418
+ budgetTokens: import_v43.z.number().optional()
429
419
  }).optional(),
430
420
  /**
431
421
  * Whether to disable parallel function calling during tool use. Default is false.
432
422
  * When set to true, Claude will use at most one tool per response.
433
423
  */
434
- disableParallelToolUse: z3.boolean().optional(),
424
+ disableParallelToolUse: import_v43.z.boolean().optional(),
435
425
  /**
436
426
  * Cache control settings for this message.
437
427
  * See https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching
438
428
  */
439
- cacheControl: z3.object({
440
- type: z3.literal("ephemeral"),
441
- ttl: z3.union([z3.literal("5m"), z3.literal("1h")]).optional()
429
+ cacheControl: import_v43.z.object({
430
+ type: import_v43.z.literal("ephemeral"),
431
+ ttl: import_v43.z.union([import_v43.z.literal("5m"), import_v43.z.literal("1h")]).optional()
442
432
  }).optional()
443
433
  });
444
434
 
@@ -455,25 +445,25 @@ function getCacheControl(providerMetadata) {
455
445
 
456
446
  // src/tool/text-editor_20250728.ts
457
447
  var import_provider_utils3 = require("@ai-sdk/provider-utils");
458
- var z4 = __toESM(require("zod/v4"));
448
+ var import_v44 = require("zod/v4");
459
449
  var import_provider_utils4 = require("@ai-sdk/provider-utils");
460
450
  var textEditor_20250728ArgsSchema = (0, import_provider_utils4.lazySchema)(
461
451
  () => (0, import_provider_utils4.zodSchema)(
462
- z4.object({
463
- maxCharacters: z4.number().optional()
452
+ import_v44.z.object({
453
+ maxCharacters: import_v44.z.number().optional()
464
454
  })
465
455
  )
466
456
  );
467
457
  var textEditor_20250728InputSchema = (0, import_provider_utils4.lazySchema)(
468
458
  () => (0, import_provider_utils4.zodSchema)(
469
- z4.object({
470
- command: z4.enum(["view", "create", "str_replace", "insert"]),
471
- path: z4.string(),
472
- file_text: z4.string().optional(),
473
- insert_line: z4.number().int().optional(),
474
- new_str: z4.string().optional(),
475
- old_str: z4.string().optional(),
476
- view_range: z4.array(z4.number().int()).optional()
459
+ import_v44.z.object({
460
+ command: import_v44.z.enum(["view", "create", "str_replace", "insert"]),
461
+ path: import_v44.z.string(),
462
+ file_text: import_v44.z.string().optional(),
463
+ insert_line: import_v44.z.number().int().optional(),
464
+ new_str: import_v44.z.string().optional(),
465
+ old_str: import_v44.z.string().optional(),
466
+ view_range: import_v44.z.array(import_v44.z.number().int()).optional()
477
467
  })
478
468
  )
479
469
  );
@@ -488,40 +478,40 @@ var textEditor_20250728 = (args = {}) => {
488
478
 
489
479
  // src/tool/web-search_20250305.ts
490
480
  var import_provider_utils5 = require("@ai-sdk/provider-utils");
491
- var z5 = __toESM(require("zod/v4"));
481
+ var import_v45 = require("zod/v4");
492
482
  var webSearch_20250305ArgsSchema = (0, import_provider_utils5.lazySchema)(
493
483
  () => (0, import_provider_utils5.zodSchema)(
494
- z5.object({
495
- maxUses: z5.number().optional(),
496
- allowedDomains: z5.array(z5.string()).optional(),
497
- blockedDomains: z5.array(z5.string()).optional(),
498
- userLocation: z5.object({
499
- type: z5.literal("approximate"),
500
- city: z5.string().optional(),
501
- region: z5.string().optional(),
502
- country: z5.string().optional(),
503
- timezone: z5.string().optional()
484
+ import_v45.z.object({
485
+ maxUses: import_v45.z.number().optional(),
486
+ allowedDomains: import_v45.z.array(import_v45.z.string()).optional(),
487
+ blockedDomains: import_v45.z.array(import_v45.z.string()).optional(),
488
+ userLocation: import_v45.z.object({
489
+ type: import_v45.z.literal("approximate"),
490
+ city: import_v45.z.string().optional(),
491
+ region: import_v45.z.string().optional(),
492
+ country: import_v45.z.string().optional(),
493
+ timezone: import_v45.z.string().optional()
504
494
  }).optional()
505
495
  })
506
496
  )
507
497
  );
508
498
  var webSearch_20250305OutputSchema = (0, import_provider_utils5.lazySchema)(
509
499
  () => (0, import_provider_utils5.zodSchema)(
510
- z5.array(
511
- z5.object({
512
- url: z5.string(),
513
- title: z5.string(),
514
- pageAge: z5.string().nullable(),
515
- encryptedContent: z5.string(),
516
- type: z5.literal("web_search_result")
500
+ import_v45.z.array(
501
+ import_v45.z.object({
502
+ url: import_v45.z.string(),
503
+ title: import_v45.z.string(),
504
+ pageAge: import_v45.z.string().nullable(),
505
+ encryptedContent: import_v45.z.string(),
506
+ type: import_v45.z.literal("web_search_result")
517
507
  })
518
508
  )
519
509
  )
520
510
  );
521
511
  var webSearch_20250305InputSchema = (0, import_provider_utils5.lazySchema)(
522
512
  () => (0, import_provider_utils5.zodSchema)(
523
- z5.object({
524
- query: z5.string()
513
+ import_v45.z.object({
514
+ query: import_v45.z.string()
525
515
  })
526
516
  )
527
517
  );
@@ -537,48 +527,48 @@ var webSearch_20250305 = (args = {}) => {
537
527
 
538
528
  // src/tool/web-fetch-20250910.ts
539
529
  var import_provider_utils6 = require("@ai-sdk/provider-utils");
540
- var z6 = __toESM(require("zod/v4"));
530
+ var import_v46 = require("zod/v4");
541
531
  var webFetch_20250910ArgsSchema = (0, import_provider_utils6.lazySchema)(
542
532
  () => (0, import_provider_utils6.zodSchema)(
543
- z6.object({
544
- maxUses: z6.number().optional(),
545
- allowedDomains: z6.array(z6.string()).optional(),
546
- blockedDomains: z6.array(z6.string()).optional(),
547
- citations: z6.object({ enabled: z6.boolean() }).optional(),
548
- maxContentTokens: z6.number().optional()
533
+ import_v46.z.object({
534
+ maxUses: import_v46.z.number().optional(),
535
+ allowedDomains: import_v46.z.array(import_v46.z.string()).optional(),
536
+ blockedDomains: import_v46.z.array(import_v46.z.string()).optional(),
537
+ citations: import_v46.z.object({ enabled: import_v46.z.boolean() }).optional(),
538
+ maxContentTokens: import_v46.z.number().optional()
549
539
  })
550
540
  )
551
541
  );
552
542
  var webFetch_20250910OutputSchema = (0, import_provider_utils6.lazySchema)(
553
543
  () => (0, import_provider_utils6.zodSchema)(
554
- z6.object({
555
- type: z6.literal("web_fetch_result"),
556
- url: z6.string(),
557
- content: z6.object({
558
- type: z6.literal("document"),
559
- title: z6.string(),
560
- citations: z6.object({ enabled: z6.boolean() }).optional(),
561
- source: z6.union([
562
- z6.object({
563
- type: z6.literal("base64"),
564
- mediaType: z6.literal("application/pdf"),
565
- data: z6.string()
544
+ import_v46.z.object({
545
+ type: import_v46.z.literal("web_fetch_result"),
546
+ url: import_v46.z.string(),
547
+ content: import_v46.z.object({
548
+ type: import_v46.z.literal("document"),
549
+ title: import_v46.z.string(),
550
+ citations: import_v46.z.object({ enabled: import_v46.z.boolean() }).optional(),
551
+ source: import_v46.z.union([
552
+ import_v46.z.object({
553
+ type: import_v46.z.literal("base64"),
554
+ mediaType: import_v46.z.literal("application/pdf"),
555
+ data: import_v46.z.string()
566
556
  }),
567
- z6.object({
568
- type: z6.literal("text"),
569
- mediaType: z6.literal("text/plain"),
570
- data: z6.string()
557
+ import_v46.z.object({
558
+ type: import_v46.z.literal("text"),
559
+ mediaType: import_v46.z.literal("text/plain"),
560
+ data: import_v46.z.string()
571
561
  })
572
562
  ])
573
563
  }),
574
- retrievedAt: z6.string().nullable()
564
+ retrievedAt: import_v46.z.string().nullable()
575
565
  })
576
566
  )
577
567
  );
578
568
  var webFetch_20250910InputSchema = (0, import_provider_utils6.lazySchema)(
579
569
  () => (0, import_provider_utils6.zodSchema)(
580
- z6.object({
581
- url: z6.string()
570
+ import_v46.z.object({
571
+ url: import_v46.z.string()
582
572
  })
583
573
  )
584
574
  );
@@ -805,21 +795,21 @@ var import_provider_utils9 = require("@ai-sdk/provider-utils");
805
795
 
806
796
  // src/tool/code-execution_20250522.ts
807
797
  var import_provider_utils8 = require("@ai-sdk/provider-utils");
808
- var z7 = __toESM(require("zod/v4"));
798
+ var import_v47 = require("zod/v4");
809
799
  var codeExecution_20250522OutputSchema = (0, import_provider_utils8.lazySchema)(
810
800
  () => (0, import_provider_utils8.zodSchema)(
811
- z7.object({
812
- type: z7.literal("code_execution_result"),
813
- stdout: z7.string(),
814
- stderr: z7.string(),
815
- return_code: z7.number()
801
+ import_v47.z.object({
802
+ type: import_v47.z.literal("code_execution_result"),
803
+ stdout: import_v47.z.string(),
804
+ stderr: import_v47.z.string(),
805
+ return_code: import_v47.z.number()
816
806
  })
817
807
  )
818
808
  );
819
809
  var codeExecution_20250522InputSchema = (0, import_provider_utils8.lazySchema)(
820
810
  () => (0, import_provider_utils8.zodSchema)(
821
- z7.object({
822
- code: z7.string()
811
+ import_v47.z.object({
812
+ code: import_v47.z.string()
823
813
  })
824
814
  )
825
815
  );
@@ -2217,12 +2207,12 @@ var AnthropicMessagesLanguageModel = class {
2217
2207
 
2218
2208
  // src/tool/bash_20241022.ts
2219
2209
  var import_provider_utils11 = require("@ai-sdk/provider-utils");
2220
- var z8 = __toESM(require("zod/v4"));
2210
+ var import_v48 = require("zod/v4");
2221
2211
  var bash_20241022InputSchema = (0, import_provider_utils11.lazySchema)(
2222
2212
  () => (0, import_provider_utils11.zodSchema)(
2223
- z8.object({
2224
- command: z8.string(),
2225
- restart: z8.boolean().optional()
2213
+ import_v48.z.object({
2214
+ command: import_v48.z.string(),
2215
+ restart: import_v48.z.boolean().optional()
2226
2216
  })
2227
2217
  )
2228
2218
  );
@@ -2234,12 +2224,12 @@ var bash_20241022 = (0, import_provider_utils11.createProviderDefinedToolFactory
2234
2224
 
2235
2225
  // src/tool/bash_20250124.ts
2236
2226
  var import_provider_utils12 = require("@ai-sdk/provider-utils");
2237
- var z9 = __toESM(require("zod/v4"));
2227
+ var import_v49 = require("zod/v4");
2238
2228
  var bash_20250124InputSchema = (0, import_provider_utils12.lazySchema)(
2239
2229
  () => (0, import_provider_utils12.zodSchema)(
2240
- z9.object({
2241
- command: z9.string(),
2242
- restart: z9.boolean().optional()
2230
+ import_v49.z.object({
2231
+ command: import_v49.z.string(),
2232
+ restart: import_v49.z.boolean().optional()
2243
2233
  })
2244
2234
  )
2245
2235
  );
@@ -2251,11 +2241,11 @@ var bash_20250124 = (0, import_provider_utils12.createProviderDefinedToolFactory
2251
2241
 
2252
2242
  // src/tool/computer_20241022.ts
2253
2243
  var import_provider_utils13 = require("@ai-sdk/provider-utils");
2254
- var z10 = __toESM(require("zod/v4"));
2244
+ var import_v410 = require("zod/v4");
2255
2245
  var computer_20241022InputSchema = (0, import_provider_utils13.lazySchema)(
2256
2246
  () => (0, import_provider_utils13.zodSchema)(
2257
- z10.object({
2258
- action: z10.enum([
2247
+ import_v410.z.object({
2248
+ action: import_v410.z.enum([
2259
2249
  "key",
2260
2250
  "type",
2261
2251
  "mouse_move",
@@ -2267,8 +2257,8 @@ var computer_20241022InputSchema = (0, import_provider_utils13.lazySchema)(
2267
2257
  "screenshot",
2268
2258
  "cursor_position"
2269
2259
  ]),
2270
- coordinate: z10.array(z10.number().int()).optional(),
2271
- text: z10.string().optional()
2260
+ coordinate: import_v410.z.array(import_v410.z.number().int()).optional(),
2261
+ text: import_v410.z.string().optional()
2272
2262
  })
2273
2263
  )
2274
2264
  );
@@ -2280,11 +2270,11 @@ var computer_20241022 = (0, import_provider_utils13.createProviderDefinedToolFac
2280
2270
 
2281
2271
  // src/tool/computer_20250124.ts
2282
2272
  var import_provider_utils14 = require("@ai-sdk/provider-utils");
2283
- var z11 = __toESM(require("zod/v4"));
2273
+ var import_v411 = require("zod/v4");
2284
2274
  var computer_20250124InputSchema = (0, import_provider_utils14.lazySchema)(
2285
2275
  () => (0, import_provider_utils14.zodSchema)(
2286
- z11.object({
2287
- action: z11.enum([
2276
+ import_v411.z.object({
2277
+ action: import_v411.z.enum([
2288
2278
  "key",
2289
2279
  "hold_key",
2290
2280
  "type",
@@ -2302,12 +2292,12 @@ var computer_20250124InputSchema = (0, import_provider_utils14.lazySchema)(
2302
2292
  "wait",
2303
2293
  "screenshot"
2304
2294
  ]),
2305
- coordinate: z11.tuple([z11.number().int(), z11.number().int()]).optional(),
2306
- duration: z11.number().optional(),
2307
- scroll_amount: z11.number().optional(),
2308
- scroll_direction: z11.enum(["up", "down", "left", "right"]).optional(),
2309
- start_coordinate: z11.tuple([z11.number().int(), z11.number().int()]).optional(),
2310
- text: z11.string().optional()
2295
+ coordinate: import_v411.z.tuple([import_v411.z.number().int(), import_v411.z.number().int()]).optional(),
2296
+ duration: import_v411.z.number().optional(),
2297
+ scroll_amount: import_v411.z.number().optional(),
2298
+ scroll_direction: import_v411.z.enum(["up", "down", "left", "right"]).optional(),
2299
+ start_coordinate: import_v411.z.tuple([import_v411.z.number().int(), import_v411.z.number().int()]).optional(),
2300
+ text: import_v411.z.string().optional()
2311
2301
  })
2312
2302
  )
2313
2303
  );
@@ -2319,17 +2309,17 @@ var computer_20250124 = (0, import_provider_utils14.createProviderDefinedToolFac
2319
2309
 
2320
2310
  // src/tool/text-editor_20241022.ts
2321
2311
  var import_provider_utils15 = require("@ai-sdk/provider-utils");
2322
- var z12 = __toESM(require("zod/v4"));
2312
+ var import_v412 = require("zod/v4");
2323
2313
  var textEditor_20241022InputSchema = (0, import_provider_utils15.lazySchema)(
2324
2314
  () => (0, import_provider_utils15.zodSchema)(
2325
- z12.object({
2326
- command: z12.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
2327
- path: z12.string(),
2328
- file_text: z12.string().optional(),
2329
- insert_line: z12.number().int().optional(),
2330
- new_str: z12.string().optional(),
2331
- old_str: z12.string().optional(),
2332
- view_range: z12.array(z12.number().int()).optional()
2315
+ import_v412.z.object({
2316
+ command: import_v412.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
2317
+ path: import_v412.z.string(),
2318
+ file_text: import_v412.z.string().optional(),
2319
+ insert_line: import_v412.z.number().int().optional(),
2320
+ new_str: import_v412.z.string().optional(),
2321
+ old_str: import_v412.z.string().optional(),
2322
+ view_range: import_v412.z.array(import_v412.z.number().int()).optional()
2333
2323
  })
2334
2324
  )
2335
2325
  );
@@ -2341,17 +2331,17 @@ var textEditor_20241022 = (0, import_provider_utils15.createProviderDefinedToolF
2341
2331
 
2342
2332
  // src/tool/text-editor_20250124.ts
2343
2333
  var import_provider_utils16 = require("@ai-sdk/provider-utils");
2344
- var z13 = __toESM(require("zod/v4"));
2334
+ var import_v413 = require("zod/v4");
2345
2335
  var textEditor_20250124InputSchema = (0, import_provider_utils16.lazySchema)(
2346
2336
  () => (0, import_provider_utils16.zodSchema)(
2347
- z13.object({
2348
- command: z13.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
2349
- path: z13.string(),
2350
- file_text: z13.string().optional(),
2351
- insert_line: z13.number().int().optional(),
2352
- new_str: z13.string().optional(),
2353
- old_str: z13.string().optional(),
2354
- view_range: z13.array(z13.number().int()).optional()
2337
+ import_v413.z.object({
2338
+ command: import_v413.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
2339
+ path: import_v413.z.string(),
2340
+ file_text: import_v413.z.string().optional(),
2341
+ insert_line: import_v413.z.number().int().optional(),
2342
+ new_str: import_v413.z.string().optional(),
2343
+ old_str: import_v413.z.string().optional(),
2344
+ view_range: import_v413.z.array(import_v413.z.number().int()).optional()
2355
2345
  })
2356
2346
  )
2357
2347
  );
@@ -2363,17 +2353,17 @@ var textEditor_20250124 = (0, import_provider_utils16.createProviderDefinedToolF
2363
2353
 
2364
2354
  // src/tool/text-editor_20250429.ts
2365
2355
  var import_provider_utils17 = require("@ai-sdk/provider-utils");
2366
- var z14 = __toESM(require("zod/v4"));
2356
+ var import_v414 = require("zod/v4");
2367
2357
  var textEditor_20250429InputSchema = (0, import_provider_utils17.lazySchema)(
2368
2358
  () => (0, import_provider_utils17.zodSchema)(
2369
- z14.object({
2370
- command: z14.enum(["view", "create", "str_replace", "insert"]),
2371
- path: z14.string(),
2372
- file_text: z14.string().optional(),
2373
- insert_line: z14.number().int().optional(),
2374
- new_str: z14.string().optional(),
2375
- old_str: z14.string().optional(),
2376
- view_range: z14.array(z14.number().int()).optional()
2359
+ import_v414.z.object({
2360
+ command: import_v414.z.enum(["view", "create", "str_replace", "insert"]),
2361
+ path: import_v414.z.string(),
2362
+ file_text: import_v414.z.string().optional(),
2363
+ insert_line: import_v414.z.number().int().optional(),
2364
+ new_str: import_v414.z.string().optional(),
2365
+ old_str: import_v414.z.string().optional(),
2366
+ view_range: import_v414.z.array(import_v414.z.number().int()).optional()
2377
2367
  })
2378
2368
  )
2379
2369
  );