@ai-sdk/anthropic 4.0.0-beta.26 → 4.0.0-beta.28

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.
@@ -1,368 +1,361 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/internal/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- AnthropicMessagesLanguageModel: () => AnthropicMessagesLanguageModel,
24
- anthropicTools: () => anthropicTools,
25
- getModelCapabilities: () => getModelCapabilities,
26
- prepareTools: () => prepareTools
27
- });
28
- module.exports = __toCommonJS(index_exports);
29
-
30
1
  // src/anthropic-messages-language-model.ts
31
- var import_provider3 = require("@ai-sdk/provider");
32
- var import_provider_utils15 = require("@ai-sdk/provider-utils");
2
+ import {
3
+ APICallError
4
+ } from "@ai-sdk/provider";
5
+ import {
6
+ combineHeaders,
7
+ createEventSourceResponseHandler,
8
+ createJsonResponseHandler,
9
+ createToolNameMapping,
10
+ generateId,
11
+ isCustomReasoning,
12
+ mapReasoningToProviderBudget,
13
+ mapReasoningToProviderEffort,
14
+ parseProviderOptions as parseProviderOptions2,
15
+ postJsonToApi,
16
+ resolve,
17
+ resolveProviderReference as resolveProviderReference2,
18
+ serializeModelOptions,
19
+ WORKFLOW_SERIALIZE,
20
+ WORKFLOW_DESERIALIZE
21
+ } from "@ai-sdk/provider-utils";
33
22
 
34
23
  // src/anthropic-error.ts
35
- var import_provider_utils = require("@ai-sdk/provider-utils");
36
- var import_v4 = require("zod/v4");
37
- var anthropicErrorDataSchema = (0, import_provider_utils.lazySchema)(
38
- () => (0, import_provider_utils.zodSchema)(
39
- import_v4.z.object({
40
- type: import_v4.z.literal("error"),
41
- error: import_v4.z.object({
42
- type: import_v4.z.string(),
43
- message: import_v4.z.string()
24
+ import {
25
+ createJsonErrorResponseHandler,
26
+ lazySchema,
27
+ zodSchema
28
+ } from "@ai-sdk/provider-utils";
29
+ import { z } from "zod/v4";
30
+ var anthropicErrorDataSchema = lazySchema(
31
+ () => zodSchema(
32
+ z.object({
33
+ type: z.literal("error"),
34
+ error: z.object({
35
+ type: z.string(),
36
+ message: z.string()
44
37
  })
45
38
  })
46
39
  )
47
40
  );
48
- var anthropicFailedResponseHandler = (0, import_provider_utils.createJsonErrorResponseHandler)({
41
+ var anthropicFailedResponseHandler = createJsonErrorResponseHandler({
49
42
  errorSchema: anthropicErrorDataSchema,
50
43
  errorToMessage: (data) => data.error.message
51
44
  });
52
45
 
53
46
  // src/anthropic-messages-api.ts
54
- var import_provider_utils2 = require("@ai-sdk/provider-utils");
55
- var import_v42 = require("zod/v4");
56
- var anthropicMessagesResponseSchema = (0, import_provider_utils2.lazySchema)(
57
- () => (0, import_provider_utils2.zodSchema)(
58
- import_v42.z.object({
59
- type: import_v42.z.literal("message"),
60
- id: import_v42.z.string().nullish(),
61
- model: import_v42.z.string().nullish(),
62
- content: import_v42.z.array(
63
- import_v42.z.discriminatedUnion("type", [
64
- import_v42.z.object({
65
- type: import_v42.z.literal("text"),
66
- text: import_v42.z.string(),
67
- citations: import_v42.z.array(
68
- import_v42.z.discriminatedUnion("type", [
69
- import_v42.z.object({
70
- type: import_v42.z.literal("web_search_result_location"),
71
- cited_text: import_v42.z.string(),
72
- url: import_v42.z.string(),
73
- title: import_v42.z.string(),
74
- encrypted_index: import_v42.z.string()
47
+ import { lazySchema as lazySchema2, zodSchema as zodSchema2 } from "@ai-sdk/provider-utils";
48
+ import { z as z2 } from "zod/v4";
49
+ var anthropicMessagesResponseSchema = lazySchema2(
50
+ () => zodSchema2(
51
+ z2.object({
52
+ type: z2.literal("message"),
53
+ id: z2.string().nullish(),
54
+ model: z2.string().nullish(),
55
+ content: z2.array(
56
+ z2.discriminatedUnion("type", [
57
+ z2.object({
58
+ type: z2.literal("text"),
59
+ text: z2.string(),
60
+ citations: z2.array(
61
+ z2.discriminatedUnion("type", [
62
+ z2.object({
63
+ type: z2.literal("web_search_result_location"),
64
+ cited_text: z2.string(),
65
+ url: z2.string(),
66
+ title: z2.string(),
67
+ encrypted_index: z2.string()
75
68
  }),
76
- import_v42.z.object({
77
- type: import_v42.z.literal("page_location"),
78
- cited_text: import_v42.z.string(),
79
- document_index: import_v42.z.number(),
80
- document_title: import_v42.z.string().nullable(),
81
- start_page_number: import_v42.z.number(),
82
- end_page_number: import_v42.z.number()
69
+ z2.object({
70
+ type: z2.literal("page_location"),
71
+ cited_text: z2.string(),
72
+ document_index: z2.number(),
73
+ document_title: z2.string().nullable(),
74
+ start_page_number: z2.number(),
75
+ end_page_number: z2.number()
83
76
  }),
84
- import_v42.z.object({
85
- type: import_v42.z.literal("char_location"),
86
- cited_text: import_v42.z.string(),
87
- document_index: import_v42.z.number(),
88
- document_title: import_v42.z.string().nullable(),
89
- start_char_index: import_v42.z.number(),
90
- end_char_index: import_v42.z.number()
77
+ z2.object({
78
+ type: z2.literal("char_location"),
79
+ cited_text: z2.string(),
80
+ document_index: z2.number(),
81
+ document_title: z2.string().nullable(),
82
+ start_char_index: z2.number(),
83
+ end_char_index: z2.number()
91
84
  })
92
85
  ])
93
86
  ).optional()
94
87
  }),
95
- import_v42.z.object({
96
- type: import_v42.z.literal("thinking"),
97
- thinking: import_v42.z.string(),
98
- signature: import_v42.z.string()
88
+ z2.object({
89
+ type: z2.literal("thinking"),
90
+ thinking: z2.string(),
91
+ signature: z2.string()
99
92
  }),
100
- import_v42.z.object({
101
- type: import_v42.z.literal("redacted_thinking"),
102
- data: import_v42.z.string()
93
+ z2.object({
94
+ type: z2.literal("redacted_thinking"),
95
+ data: z2.string()
103
96
  }),
104
- import_v42.z.object({
105
- type: import_v42.z.literal("compaction"),
106
- content: import_v42.z.string()
97
+ z2.object({
98
+ type: z2.literal("compaction"),
99
+ content: z2.string()
107
100
  }),
108
- import_v42.z.object({
109
- type: import_v42.z.literal("tool_use"),
110
- id: import_v42.z.string(),
111
- name: import_v42.z.string(),
112
- input: import_v42.z.unknown(),
101
+ z2.object({
102
+ type: z2.literal("tool_use"),
103
+ id: z2.string(),
104
+ name: z2.string(),
105
+ input: z2.unknown(),
113
106
  // Programmatic tool calling: caller info when triggered from code execution
114
- caller: import_v42.z.union([
115
- import_v42.z.object({
116
- type: import_v42.z.literal("code_execution_20250825"),
117
- tool_id: import_v42.z.string()
107
+ caller: z2.union([
108
+ z2.object({
109
+ type: z2.literal("code_execution_20250825"),
110
+ tool_id: z2.string()
118
111
  }),
119
- import_v42.z.object({
120
- type: import_v42.z.literal("code_execution_20260120"),
121
- tool_id: import_v42.z.string()
112
+ z2.object({
113
+ type: z2.literal("code_execution_20260120"),
114
+ tool_id: z2.string()
122
115
  }),
123
- import_v42.z.object({
124
- type: import_v42.z.literal("direct")
116
+ z2.object({
117
+ type: z2.literal("direct")
125
118
  })
126
119
  ]).optional()
127
120
  }),
128
- import_v42.z.object({
129
- type: import_v42.z.literal("server_tool_use"),
130
- id: import_v42.z.string(),
131
- name: import_v42.z.string(),
132
- input: import_v42.z.record(import_v42.z.string(), import_v42.z.unknown()).nullish(),
133
- caller: import_v42.z.union([
134
- import_v42.z.object({
135
- type: import_v42.z.literal("code_execution_20260120"),
136
- tool_id: import_v42.z.string()
121
+ z2.object({
122
+ type: z2.literal("server_tool_use"),
123
+ id: z2.string(),
124
+ name: z2.string(),
125
+ input: z2.record(z2.string(), z2.unknown()).nullish(),
126
+ caller: z2.union([
127
+ z2.object({
128
+ type: z2.literal("code_execution_20260120"),
129
+ tool_id: z2.string()
137
130
  }),
138
- import_v42.z.object({
139
- type: import_v42.z.literal("direct")
131
+ z2.object({
132
+ type: z2.literal("direct")
140
133
  })
141
134
  ]).optional()
142
135
  }),
143
- import_v42.z.object({
144
- type: import_v42.z.literal("mcp_tool_use"),
145
- id: import_v42.z.string(),
146
- name: import_v42.z.string(),
147
- input: import_v42.z.unknown(),
148
- server_name: import_v42.z.string()
136
+ z2.object({
137
+ type: z2.literal("mcp_tool_use"),
138
+ id: z2.string(),
139
+ name: z2.string(),
140
+ input: z2.unknown(),
141
+ server_name: z2.string()
149
142
  }),
150
- import_v42.z.object({
151
- type: import_v42.z.literal("mcp_tool_result"),
152
- tool_use_id: import_v42.z.string(),
153
- is_error: import_v42.z.boolean(),
154
- content: import_v42.z.array(
155
- import_v42.z.union([
156
- import_v42.z.string(),
157
- import_v42.z.object({ type: import_v42.z.literal("text"), text: import_v42.z.string() })
143
+ z2.object({
144
+ type: z2.literal("mcp_tool_result"),
145
+ tool_use_id: z2.string(),
146
+ is_error: z2.boolean(),
147
+ content: z2.array(
148
+ z2.union([
149
+ z2.string(),
150
+ z2.object({ type: z2.literal("text"), text: z2.string() })
158
151
  ])
159
152
  )
160
153
  }),
161
- import_v42.z.object({
162
- type: import_v42.z.literal("web_fetch_tool_result"),
163
- tool_use_id: import_v42.z.string(),
164
- content: import_v42.z.union([
165
- import_v42.z.object({
166
- type: import_v42.z.literal("web_fetch_result"),
167
- url: import_v42.z.string(),
168
- retrieved_at: import_v42.z.string(),
169
- content: import_v42.z.object({
170
- type: import_v42.z.literal("document"),
171
- title: import_v42.z.string().nullable(),
172
- citations: import_v42.z.object({ enabled: import_v42.z.boolean() }).optional(),
173
- source: import_v42.z.union([
174
- import_v42.z.object({
175
- type: import_v42.z.literal("base64"),
176
- media_type: import_v42.z.literal("application/pdf"),
177
- data: import_v42.z.string()
154
+ z2.object({
155
+ type: z2.literal("web_fetch_tool_result"),
156
+ tool_use_id: z2.string(),
157
+ content: z2.union([
158
+ z2.object({
159
+ type: z2.literal("web_fetch_result"),
160
+ url: z2.string(),
161
+ retrieved_at: z2.string(),
162
+ content: z2.object({
163
+ type: z2.literal("document"),
164
+ title: z2.string().nullable(),
165
+ citations: z2.object({ enabled: z2.boolean() }).optional(),
166
+ source: z2.union([
167
+ z2.object({
168
+ type: z2.literal("base64"),
169
+ media_type: z2.literal("application/pdf"),
170
+ data: z2.string()
178
171
  }),
179
- import_v42.z.object({
180
- type: import_v42.z.literal("text"),
181
- media_type: import_v42.z.literal("text/plain"),
182
- data: import_v42.z.string()
172
+ z2.object({
173
+ type: z2.literal("text"),
174
+ media_type: z2.literal("text/plain"),
175
+ data: z2.string()
183
176
  })
184
177
  ])
185
178
  })
186
179
  }),
187
- import_v42.z.object({
188
- type: import_v42.z.literal("web_fetch_tool_result_error"),
189
- error_code: import_v42.z.string()
180
+ z2.object({
181
+ type: z2.literal("web_fetch_tool_result_error"),
182
+ error_code: z2.string()
190
183
  })
191
184
  ])
192
185
  }),
193
- import_v42.z.object({
194
- type: import_v42.z.literal("web_search_tool_result"),
195
- tool_use_id: import_v42.z.string(),
196
- content: import_v42.z.union([
197
- import_v42.z.array(
198
- import_v42.z.object({
199
- type: import_v42.z.literal("web_search_result"),
200
- url: import_v42.z.string(),
201
- title: import_v42.z.string(),
202
- encrypted_content: import_v42.z.string(),
203
- page_age: import_v42.z.string().nullish()
186
+ z2.object({
187
+ type: z2.literal("web_search_tool_result"),
188
+ tool_use_id: z2.string(),
189
+ content: z2.union([
190
+ z2.array(
191
+ z2.object({
192
+ type: z2.literal("web_search_result"),
193
+ url: z2.string(),
194
+ title: z2.string(),
195
+ encrypted_content: z2.string(),
196
+ page_age: z2.string().nullish()
204
197
  })
205
198
  ),
206
- import_v42.z.object({
207
- type: import_v42.z.literal("web_search_tool_result_error"),
208
- error_code: import_v42.z.string()
199
+ z2.object({
200
+ type: z2.literal("web_search_tool_result_error"),
201
+ error_code: z2.string()
209
202
  })
210
203
  ])
211
204
  }),
212
205
  // code execution results for code_execution_20250522 tool:
213
- import_v42.z.object({
214
- type: import_v42.z.literal("code_execution_tool_result"),
215
- tool_use_id: import_v42.z.string(),
216
- content: import_v42.z.union([
217
- import_v42.z.object({
218
- type: import_v42.z.literal("code_execution_result"),
219
- stdout: import_v42.z.string(),
220
- stderr: import_v42.z.string(),
221
- return_code: import_v42.z.number(),
222
- content: import_v42.z.array(
223
- import_v42.z.object({
224
- type: import_v42.z.literal("code_execution_output"),
225
- file_id: import_v42.z.string()
206
+ z2.object({
207
+ type: z2.literal("code_execution_tool_result"),
208
+ tool_use_id: z2.string(),
209
+ content: z2.union([
210
+ z2.object({
211
+ type: z2.literal("code_execution_result"),
212
+ stdout: z2.string(),
213
+ stderr: z2.string(),
214
+ return_code: z2.number(),
215
+ content: z2.array(
216
+ z2.object({
217
+ type: z2.literal("code_execution_output"),
218
+ file_id: z2.string()
226
219
  })
227
220
  ).optional().default([])
228
221
  }),
229
- import_v42.z.object({
230
- type: import_v42.z.literal("encrypted_code_execution_result"),
231
- encrypted_stdout: import_v42.z.string(),
232
- stderr: import_v42.z.string(),
233
- return_code: import_v42.z.number(),
234
- content: import_v42.z.array(
235
- import_v42.z.object({
236
- type: import_v42.z.literal("code_execution_output"),
237
- file_id: import_v42.z.string()
222
+ z2.object({
223
+ type: z2.literal("encrypted_code_execution_result"),
224
+ encrypted_stdout: z2.string(),
225
+ stderr: z2.string(),
226
+ return_code: z2.number(),
227
+ content: z2.array(
228
+ z2.object({
229
+ type: z2.literal("code_execution_output"),
230
+ file_id: z2.string()
238
231
  })
239
232
  ).optional().default([])
240
233
  }),
241
- import_v42.z.object({
242
- type: import_v42.z.literal("code_execution_tool_result_error"),
243
- error_code: import_v42.z.string()
234
+ z2.object({
235
+ type: z2.literal("code_execution_tool_result_error"),
236
+ error_code: z2.string()
244
237
  })
245
238
  ])
246
239
  }),
247
240
  // bash code execution results for code_execution_20250825 tool:
248
- import_v42.z.object({
249
- type: import_v42.z.literal("bash_code_execution_tool_result"),
250
- tool_use_id: import_v42.z.string(),
251
- content: import_v42.z.discriminatedUnion("type", [
252
- import_v42.z.object({
253
- type: import_v42.z.literal("bash_code_execution_result"),
254
- content: import_v42.z.array(
255
- import_v42.z.object({
256
- type: import_v42.z.literal("bash_code_execution_output"),
257
- file_id: import_v42.z.string()
241
+ z2.object({
242
+ type: z2.literal("bash_code_execution_tool_result"),
243
+ tool_use_id: z2.string(),
244
+ content: z2.discriminatedUnion("type", [
245
+ z2.object({
246
+ type: z2.literal("bash_code_execution_result"),
247
+ content: z2.array(
248
+ z2.object({
249
+ type: z2.literal("bash_code_execution_output"),
250
+ file_id: z2.string()
258
251
  })
259
252
  ),
260
- stdout: import_v42.z.string(),
261
- stderr: import_v42.z.string(),
262
- return_code: import_v42.z.number()
253
+ stdout: z2.string(),
254
+ stderr: z2.string(),
255
+ return_code: z2.number()
263
256
  }),
264
- import_v42.z.object({
265
- type: import_v42.z.literal("bash_code_execution_tool_result_error"),
266
- error_code: import_v42.z.string()
257
+ z2.object({
258
+ type: z2.literal("bash_code_execution_tool_result_error"),
259
+ error_code: z2.string()
267
260
  })
268
261
  ])
269
262
  }),
270
263
  // text editor code execution results for code_execution_20250825 tool:
271
- import_v42.z.object({
272
- type: import_v42.z.literal("text_editor_code_execution_tool_result"),
273
- tool_use_id: import_v42.z.string(),
274
- content: import_v42.z.discriminatedUnion("type", [
275
- import_v42.z.object({
276
- type: import_v42.z.literal("text_editor_code_execution_tool_result_error"),
277
- error_code: import_v42.z.string()
264
+ z2.object({
265
+ type: z2.literal("text_editor_code_execution_tool_result"),
266
+ tool_use_id: z2.string(),
267
+ content: z2.discriminatedUnion("type", [
268
+ z2.object({
269
+ type: z2.literal("text_editor_code_execution_tool_result_error"),
270
+ error_code: z2.string()
278
271
  }),
279
- import_v42.z.object({
280
- type: import_v42.z.literal("text_editor_code_execution_view_result"),
281
- content: import_v42.z.string(),
282
- file_type: import_v42.z.string(),
283
- num_lines: import_v42.z.number().nullable(),
284
- start_line: import_v42.z.number().nullable(),
285
- total_lines: import_v42.z.number().nullable()
272
+ z2.object({
273
+ type: z2.literal("text_editor_code_execution_view_result"),
274
+ content: z2.string(),
275
+ file_type: z2.string(),
276
+ num_lines: z2.number().nullable(),
277
+ start_line: z2.number().nullable(),
278
+ total_lines: z2.number().nullable()
286
279
  }),
287
- import_v42.z.object({
288
- type: import_v42.z.literal("text_editor_code_execution_create_result"),
289
- is_file_update: import_v42.z.boolean()
280
+ z2.object({
281
+ type: z2.literal("text_editor_code_execution_create_result"),
282
+ is_file_update: z2.boolean()
290
283
  }),
291
- import_v42.z.object({
292
- type: import_v42.z.literal(
284
+ z2.object({
285
+ type: z2.literal(
293
286
  "text_editor_code_execution_str_replace_result"
294
287
  ),
295
- lines: import_v42.z.array(import_v42.z.string()).nullable(),
296
- new_lines: import_v42.z.number().nullable(),
297
- new_start: import_v42.z.number().nullable(),
298
- old_lines: import_v42.z.number().nullable(),
299
- old_start: import_v42.z.number().nullable()
288
+ lines: z2.array(z2.string()).nullable(),
289
+ new_lines: z2.number().nullable(),
290
+ new_start: z2.number().nullable(),
291
+ old_lines: z2.number().nullable(),
292
+ old_start: z2.number().nullable()
300
293
  })
301
294
  ])
302
295
  }),
303
296
  // tool search tool results for tool_search_tool_regex_20251119 and tool_search_tool_bm25_20251119:
304
- import_v42.z.object({
305
- type: import_v42.z.literal("tool_search_tool_result"),
306
- tool_use_id: import_v42.z.string(),
307
- content: import_v42.z.union([
308
- import_v42.z.object({
309
- type: import_v42.z.literal("tool_search_tool_search_result"),
310
- tool_references: import_v42.z.array(
311
- import_v42.z.object({
312
- type: import_v42.z.literal("tool_reference"),
313
- tool_name: import_v42.z.string()
297
+ z2.object({
298
+ type: z2.literal("tool_search_tool_result"),
299
+ tool_use_id: z2.string(),
300
+ content: z2.union([
301
+ z2.object({
302
+ type: z2.literal("tool_search_tool_search_result"),
303
+ tool_references: z2.array(
304
+ z2.object({
305
+ type: z2.literal("tool_reference"),
306
+ tool_name: z2.string()
314
307
  })
315
308
  )
316
309
  }),
317
- import_v42.z.object({
318
- type: import_v42.z.literal("tool_search_tool_result_error"),
319
- error_code: import_v42.z.string()
310
+ z2.object({
311
+ type: z2.literal("tool_search_tool_result_error"),
312
+ error_code: z2.string()
320
313
  })
321
314
  ])
322
315
  })
323
316
  ])
324
317
  ),
325
- stop_reason: import_v42.z.string().nullish(),
326
- stop_sequence: import_v42.z.string().nullish(),
327
- usage: import_v42.z.looseObject({
328
- input_tokens: import_v42.z.number(),
329
- output_tokens: import_v42.z.number(),
330
- cache_creation_input_tokens: import_v42.z.number().nullish(),
331
- cache_read_input_tokens: import_v42.z.number().nullish(),
332
- iterations: import_v42.z.array(
333
- import_v42.z.object({
334
- type: import_v42.z.union([import_v42.z.literal("compaction"), import_v42.z.literal("message")]),
335
- input_tokens: import_v42.z.number(),
336
- output_tokens: import_v42.z.number()
318
+ stop_reason: z2.string().nullish(),
319
+ stop_sequence: z2.string().nullish(),
320
+ usage: z2.looseObject({
321
+ input_tokens: z2.number(),
322
+ output_tokens: z2.number(),
323
+ cache_creation_input_tokens: z2.number().nullish(),
324
+ cache_read_input_tokens: z2.number().nullish(),
325
+ iterations: z2.array(
326
+ z2.object({
327
+ type: z2.union([z2.literal("compaction"), z2.literal("message")]),
328
+ input_tokens: z2.number(),
329
+ output_tokens: z2.number()
337
330
  })
338
331
  ).nullish()
339
332
  }),
340
- container: import_v42.z.object({
341
- expires_at: import_v42.z.string(),
342
- id: import_v42.z.string(),
343
- skills: import_v42.z.array(
344
- import_v42.z.object({
345
- type: import_v42.z.union([import_v42.z.literal("anthropic"), import_v42.z.literal("custom")]),
346
- skill_id: import_v42.z.string(),
347
- version: import_v42.z.string()
333
+ container: z2.object({
334
+ expires_at: z2.string(),
335
+ id: z2.string(),
336
+ skills: z2.array(
337
+ z2.object({
338
+ type: z2.union([z2.literal("anthropic"), z2.literal("custom")]),
339
+ skill_id: z2.string(),
340
+ version: z2.string()
348
341
  })
349
342
  ).nullish()
350
343
  }).nullish(),
351
- context_management: import_v42.z.object({
352
- applied_edits: import_v42.z.array(
353
- import_v42.z.union([
354
- import_v42.z.object({
355
- type: import_v42.z.literal("clear_tool_uses_20250919"),
356
- cleared_tool_uses: import_v42.z.number(),
357
- cleared_input_tokens: import_v42.z.number()
344
+ context_management: z2.object({
345
+ applied_edits: z2.array(
346
+ z2.union([
347
+ z2.object({
348
+ type: z2.literal("clear_tool_uses_20250919"),
349
+ cleared_tool_uses: z2.number(),
350
+ cleared_input_tokens: z2.number()
358
351
  }),
359
- import_v42.z.object({
360
- type: import_v42.z.literal("clear_thinking_20251015"),
361
- cleared_thinking_turns: import_v42.z.number(),
362
- cleared_input_tokens: import_v42.z.number()
352
+ z2.object({
353
+ type: z2.literal("clear_thinking_20251015"),
354
+ cleared_thinking_turns: z2.number(),
355
+ cleared_input_tokens: z2.number()
363
356
  }),
364
- import_v42.z.object({
365
- type: import_v42.z.literal("compact_20260112")
357
+ z2.object({
358
+ type: z2.literal("compact_20260112")
366
359
  })
367
360
  ])
368
361
  )
@@ -370,457 +363,457 @@ var anthropicMessagesResponseSchema = (0, import_provider_utils2.lazySchema)(
370
363
  })
371
364
  )
372
365
  );
373
- var anthropicMessagesChunkSchema = (0, import_provider_utils2.lazySchema)(
374
- () => (0, import_provider_utils2.zodSchema)(
375
- import_v42.z.discriminatedUnion("type", [
376
- import_v42.z.object({
377
- type: import_v42.z.literal("message_start"),
378
- message: import_v42.z.object({
379
- id: import_v42.z.string().nullish(),
380
- model: import_v42.z.string().nullish(),
381
- role: import_v42.z.string().nullish(),
382
- usage: import_v42.z.looseObject({
383
- input_tokens: import_v42.z.number(),
384
- cache_creation_input_tokens: import_v42.z.number().nullish(),
385
- cache_read_input_tokens: import_v42.z.number().nullish()
366
+ var anthropicMessagesChunkSchema = lazySchema2(
367
+ () => zodSchema2(
368
+ z2.discriminatedUnion("type", [
369
+ z2.object({
370
+ type: z2.literal("message_start"),
371
+ message: z2.object({
372
+ id: z2.string().nullish(),
373
+ model: z2.string().nullish(),
374
+ role: z2.string().nullish(),
375
+ usage: z2.looseObject({
376
+ input_tokens: z2.number(),
377
+ cache_creation_input_tokens: z2.number().nullish(),
378
+ cache_read_input_tokens: z2.number().nullish()
386
379
  }),
387
380
  // Programmatic tool calling: content may be pre-populated for deferred tool calls
388
- content: import_v42.z.array(
389
- import_v42.z.discriminatedUnion("type", [
390
- import_v42.z.object({
391
- type: import_v42.z.literal("tool_use"),
392
- id: import_v42.z.string(),
393
- name: import_v42.z.string(),
394
- input: import_v42.z.unknown(),
395
- caller: import_v42.z.union([
396
- import_v42.z.object({
397
- type: import_v42.z.literal("code_execution_20250825"),
398
- tool_id: import_v42.z.string()
381
+ content: z2.array(
382
+ z2.discriminatedUnion("type", [
383
+ z2.object({
384
+ type: z2.literal("tool_use"),
385
+ id: z2.string(),
386
+ name: z2.string(),
387
+ input: z2.unknown(),
388
+ caller: z2.union([
389
+ z2.object({
390
+ type: z2.literal("code_execution_20250825"),
391
+ tool_id: z2.string()
399
392
  }),
400
- import_v42.z.object({
401
- type: import_v42.z.literal("code_execution_20260120"),
402
- tool_id: import_v42.z.string()
393
+ z2.object({
394
+ type: z2.literal("code_execution_20260120"),
395
+ tool_id: z2.string()
403
396
  }),
404
- import_v42.z.object({
405
- type: import_v42.z.literal("direct")
397
+ z2.object({
398
+ type: z2.literal("direct")
406
399
  })
407
400
  ]).optional()
408
401
  })
409
402
  ])
410
403
  ).nullish(),
411
- stop_reason: import_v42.z.string().nullish(),
412
- container: import_v42.z.object({
413
- expires_at: import_v42.z.string(),
414
- id: import_v42.z.string()
404
+ stop_reason: z2.string().nullish(),
405
+ container: z2.object({
406
+ expires_at: z2.string(),
407
+ id: z2.string()
415
408
  }).nullish()
416
409
  })
417
410
  }),
418
- import_v42.z.object({
419
- type: import_v42.z.literal("content_block_start"),
420
- index: import_v42.z.number(),
421
- content_block: import_v42.z.discriminatedUnion("type", [
422
- import_v42.z.object({
423
- type: import_v42.z.literal("text"),
424
- text: import_v42.z.string()
411
+ z2.object({
412
+ type: z2.literal("content_block_start"),
413
+ index: z2.number(),
414
+ content_block: z2.discriminatedUnion("type", [
415
+ z2.object({
416
+ type: z2.literal("text"),
417
+ text: z2.string()
425
418
  }),
426
- import_v42.z.object({
427
- type: import_v42.z.literal("thinking"),
428
- thinking: import_v42.z.string()
419
+ z2.object({
420
+ type: z2.literal("thinking"),
421
+ thinking: z2.string()
429
422
  }),
430
- import_v42.z.object({
431
- type: import_v42.z.literal("tool_use"),
432
- id: import_v42.z.string(),
433
- name: import_v42.z.string(),
423
+ z2.object({
424
+ type: z2.literal("tool_use"),
425
+ id: z2.string(),
426
+ name: z2.string(),
434
427
  // Programmatic tool calling: input may be present directly for deferred tool calls
435
- input: import_v42.z.record(import_v42.z.string(), import_v42.z.unknown()).optional(),
428
+ input: z2.record(z2.string(), z2.unknown()).optional(),
436
429
  // Programmatic tool calling: caller info when triggered from code execution
437
- caller: import_v42.z.union([
438
- import_v42.z.object({
439
- type: import_v42.z.literal("code_execution_20250825"),
440
- tool_id: import_v42.z.string()
430
+ caller: z2.union([
431
+ z2.object({
432
+ type: z2.literal("code_execution_20250825"),
433
+ tool_id: z2.string()
441
434
  }),
442
- import_v42.z.object({
443
- type: import_v42.z.literal("code_execution_20260120"),
444
- tool_id: import_v42.z.string()
435
+ z2.object({
436
+ type: z2.literal("code_execution_20260120"),
437
+ tool_id: z2.string()
445
438
  }),
446
- import_v42.z.object({
447
- type: import_v42.z.literal("direct")
439
+ z2.object({
440
+ type: z2.literal("direct")
448
441
  })
449
442
  ]).optional()
450
443
  }),
451
- import_v42.z.object({
452
- type: import_v42.z.literal("redacted_thinking"),
453
- data: import_v42.z.string()
444
+ z2.object({
445
+ type: z2.literal("redacted_thinking"),
446
+ data: z2.string()
454
447
  }),
455
- import_v42.z.object({
456
- type: import_v42.z.literal("compaction"),
457
- content: import_v42.z.string().nullish()
448
+ z2.object({
449
+ type: z2.literal("compaction"),
450
+ content: z2.string().nullish()
458
451
  }),
459
- import_v42.z.object({
460
- type: import_v42.z.literal("server_tool_use"),
461
- id: import_v42.z.string(),
462
- name: import_v42.z.string(),
463
- input: import_v42.z.record(import_v42.z.string(), import_v42.z.unknown()).nullish(),
464
- caller: import_v42.z.union([
465
- import_v42.z.object({
466
- type: import_v42.z.literal("code_execution_20260120"),
467
- tool_id: import_v42.z.string()
452
+ z2.object({
453
+ type: z2.literal("server_tool_use"),
454
+ id: z2.string(),
455
+ name: z2.string(),
456
+ input: z2.record(z2.string(), z2.unknown()).nullish(),
457
+ caller: z2.union([
458
+ z2.object({
459
+ type: z2.literal("code_execution_20260120"),
460
+ tool_id: z2.string()
468
461
  }),
469
- import_v42.z.object({
470
- type: import_v42.z.literal("direct")
462
+ z2.object({
463
+ type: z2.literal("direct")
471
464
  })
472
465
  ]).optional()
473
466
  }),
474
- import_v42.z.object({
475
- type: import_v42.z.literal("mcp_tool_use"),
476
- id: import_v42.z.string(),
477
- name: import_v42.z.string(),
478
- input: import_v42.z.unknown(),
479
- server_name: import_v42.z.string()
467
+ z2.object({
468
+ type: z2.literal("mcp_tool_use"),
469
+ id: z2.string(),
470
+ name: z2.string(),
471
+ input: z2.unknown(),
472
+ server_name: z2.string()
480
473
  }),
481
- import_v42.z.object({
482
- type: import_v42.z.literal("mcp_tool_result"),
483
- tool_use_id: import_v42.z.string(),
484
- is_error: import_v42.z.boolean(),
485
- content: import_v42.z.array(
486
- import_v42.z.union([
487
- import_v42.z.string(),
488
- import_v42.z.object({ type: import_v42.z.literal("text"), text: import_v42.z.string() })
474
+ z2.object({
475
+ type: z2.literal("mcp_tool_result"),
476
+ tool_use_id: z2.string(),
477
+ is_error: z2.boolean(),
478
+ content: z2.array(
479
+ z2.union([
480
+ z2.string(),
481
+ z2.object({ type: z2.literal("text"), text: z2.string() })
489
482
  ])
490
483
  )
491
484
  }),
492
- import_v42.z.object({
493
- type: import_v42.z.literal("web_fetch_tool_result"),
494
- tool_use_id: import_v42.z.string(),
495
- content: import_v42.z.union([
496
- import_v42.z.object({
497
- type: import_v42.z.literal("web_fetch_result"),
498
- url: import_v42.z.string(),
499
- retrieved_at: import_v42.z.string(),
500
- content: import_v42.z.object({
501
- type: import_v42.z.literal("document"),
502
- title: import_v42.z.string().nullable(),
503
- citations: import_v42.z.object({ enabled: import_v42.z.boolean() }).optional(),
504
- source: import_v42.z.union([
505
- import_v42.z.object({
506
- type: import_v42.z.literal("base64"),
507
- media_type: import_v42.z.literal("application/pdf"),
508
- data: import_v42.z.string()
485
+ z2.object({
486
+ type: z2.literal("web_fetch_tool_result"),
487
+ tool_use_id: z2.string(),
488
+ content: z2.union([
489
+ z2.object({
490
+ type: z2.literal("web_fetch_result"),
491
+ url: z2.string(),
492
+ retrieved_at: z2.string(),
493
+ content: z2.object({
494
+ type: z2.literal("document"),
495
+ title: z2.string().nullable(),
496
+ citations: z2.object({ enabled: z2.boolean() }).optional(),
497
+ source: z2.union([
498
+ z2.object({
499
+ type: z2.literal("base64"),
500
+ media_type: z2.literal("application/pdf"),
501
+ data: z2.string()
509
502
  }),
510
- import_v42.z.object({
511
- type: import_v42.z.literal("text"),
512
- media_type: import_v42.z.literal("text/plain"),
513
- data: import_v42.z.string()
503
+ z2.object({
504
+ type: z2.literal("text"),
505
+ media_type: z2.literal("text/plain"),
506
+ data: z2.string()
514
507
  })
515
508
  ])
516
509
  })
517
510
  }),
518
- import_v42.z.object({
519
- type: import_v42.z.literal("web_fetch_tool_result_error"),
520
- error_code: import_v42.z.string()
511
+ z2.object({
512
+ type: z2.literal("web_fetch_tool_result_error"),
513
+ error_code: z2.string()
521
514
  })
522
515
  ])
523
516
  }),
524
- import_v42.z.object({
525
- type: import_v42.z.literal("web_search_tool_result"),
526
- tool_use_id: import_v42.z.string(),
527
- content: import_v42.z.union([
528
- import_v42.z.array(
529
- import_v42.z.object({
530
- type: import_v42.z.literal("web_search_result"),
531
- url: import_v42.z.string(),
532
- title: import_v42.z.string(),
533
- encrypted_content: import_v42.z.string(),
534
- page_age: import_v42.z.string().nullish()
517
+ z2.object({
518
+ type: z2.literal("web_search_tool_result"),
519
+ tool_use_id: z2.string(),
520
+ content: z2.union([
521
+ z2.array(
522
+ z2.object({
523
+ type: z2.literal("web_search_result"),
524
+ url: z2.string(),
525
+ title: z2.string(),
526
+ encrypted_content: z2.string(),
527
+ page_age: z2.string().nullish()
535
528
  })
536
529
  ),
537
- import_v42.z.object({
538
- type: import_v42.z.literal("web_search_tool_result_error"),
539
- error_code: import_v42.z.string()
530
+ z2.object({
531
+ type: z2.literal("web_search_tool_result_error"),
532
+ error_code: z2.string()
540
533
  })
541
534
  ])
542
535
  }),
543
536
  // code execution results for code_execution_20250522 tool:
544
- import_v42.z.object({
545
- type: import_v42.z.literal("code_execution_tool_result"),
546
- tool_use_id: import_v42.z.string(),
547
- content: import_v42.z.union([
548
- import_v42.z.object({
549
- type: import_v42.z.literal("code_execution_result"),
550
- stdout: import_v42.z.string(),
551
- stderr: import_v42.z.string(),
552
- return_code: import_v42.z.number(),
553
- content: import_v42.z.array(
554
- import_v42.z.object({
555
- type: import_v42.z.literal("code_execution_output"),
556
- file_id: import_v42.z.string()
537
+ z2.object({
538
+ type: z2.literal("code_execution_tool_result"),
539
+ tool_use_id: z2.string(),
540
+ content: z2.union([
541
+ z2.object({
542
+ type: z2.literal("code_execution_result"),
543
+ stdout: z2.string(),
544
+ stderr: z2.string(),
545
+ return_code: z2.number(),
546
+ content: z2.array(
547
+ z2.object({
548
+ type: z2.literal("code_execution_output"),
549
+ file_id: z2.string()
557
550
  })
558
551
  ).optional().default([])
559
552
  }),
560
- import_v42.z.object({
561
- type: import_v42.z.literal("encrypted_code_execution_result"),
562
- encrypted_stdout: import_v42.z.string(),
563
- stderr: import_v42.z.string(),
564
- return_code: import_v42.z.number(),
565
- content: import_v42.z.array(
566
- import_v42.z.object({
567
- type: import_v42.z.literal("code_execution_output"),
568
- file_id: import_v42.z.string()
553
+ z2.object({
554
+ type: z2.literal("encrypted_code_execution_result"),
555
+ encrypted_stdout: z2.string(),
556
+ stderr: z2.string(),
557
+ return_code: z2.number(),
558
+ content: z2.array(
559
+ z2.object({
560
+ type: z2.literal("code_execution_output"),
561
+ file_id: z2.string()
569
562
  })
570
563
  ).optional().default([])
571
564
  }),
572
- import_v42.z.object({
573
- type: import_v42.z.literal("code_execution_tool_result_error"),
574
- error_code: import_v42.z.string()
565
+ z2.object({
566
+ type: z2.literal("code_execution_tool_result_error"),
567
+ error_code: z2.string()
575
568
  })
576
569
  ])
577
570
  }),
578
571
  // bash code execution results for code_execution_20250825 tool:
579
- import_v42.z.object({
580
- type: import_v42.z.literal("bash_code_execution_tool_result"),
581
- tool_use_id: import_v42.z.string(),
582
- content: import_v42.z.discriminatedUnion("type", [
583
- import_v42.z.object({
584
- type: import_v42.z.literal("bash_code_execution_result"),
585
- content: import_v42.z.array(
586
- import_v42.z.object({
587
- type: import_v42.z.literal("bash_code_execution_output"),
588
- file_id: import_v42.z.string()
572
+ z2.object({
573
+ type: z2.literal("bash_code_execution_tool_result"),
574
+ tool_use_id: z2.string(),
575
+ content: z2.discriminatedUnion("type", [
576
+ z2.object({
577
+ type: z2.literal("bash_code_execution_result"),
578
+ content: z2.array(
579
+ z2.object({
580
+ type: z2.literal("bash_code_execution_output"),
581
+ file_id: z2.string()
589
582
  })
590
583
  ),
591
- stdout: import_v42.z.string(),
592
- stderr: import_v42.z.string(),
593
- return_code: import_v42.z.number()
584
+ stdout: z2.string(),
585
+ stderr: z2.string(),
586
+ return_code: z2.number()
594
587
  }),
595
- import_v42.z.object({
596
- type: import_v42.z.literal("bash_code_execution_tool_result_error"),
597
- error_code: import_v42.z.string()
588
+ z2.object({
589
+ type: z2.literal("bash_code_execution_tool_result_error"),
590
+ error_code: z2.string()
598
591
  })
599
592
  ])
600
593
  }),
601
594
  // text editor code execution results for code_execution_20250825 tool:
602
- import_v42.z.object({
603
- type: import_v42.z.literal("text_editor_code_execution_tool_result"),
604
- tool_use_id: import_v42.z.string(),
605
- content: import_v42.z.discriminatedUnion("type", [
606
- import_v42.z.object({
607
- type: import_v42.z.literal("text_editor_code_execution_tool_result_error"),
608
- error_code: import_v42.z.string()
595
+ z2.object({
596
+ type: z2.literal("text_editor_code_execution_tool_result"),
597
+ tool_use_id: z2.string(),
598
+ content: z2.discriminatedUnion("type", [
599
+ z2.object({
600
+ type: z2.literal("text_editor_code_execution_tool_result_error"),
601
+ error_code: z2.string()
609
602
  }),
610
- import_v42.z.object({
611
- type: import_v42.z.literal("text_editor_code_execution_view_result"),
612
- content: import_v42.z.string(),
613
- file_type: import_v42.z.string(),
614
- num_lines: import_v42.z.number().nullable(),
615
- start_line: import_v42.z.number().nullable(),
616
- total_lines: import_v42.z.number().nullable()
603
+ z2.object({
604
+ type: z2.literal("text_editor_code_execution_view_result"),
605
+ content: z2.string(),
606
+ file_type: z2.string(),
607
+ num_lines: z2.number().nullable(),
608
+ start_line: z2.number().nullable(),
609
+ total_lines: z2.number().nullable()
617
610
  }),
618
- import_v42.z.object({
619
- type: import_v42.z.literal("text_editor_code_execution_create_result"),
620
- is_file_update: import_v42.z.boolean()
611
+ z2.object({
612
+ type: z2.literal("text_editor_code_execution_create_result"),
613
+ is_file_update: z2.boolean()
621
614
  }),
622
- import_v42.z.object({
623
- type: import_v42.z.literal(
615
+ z2.object({
616
+ type: z2.literal(
624
617
  "text_editor_code_execution_str_replace_result"
625
618
  ),
626
- lines: import_v42.z.array(import_v42.z.string()).nullable(),
627
- new_lines: import_v42.z.number().nullable(),
628
- new_start: import_v42.z.number().nullable(),
629
- old_lines: import_v42.z.number().nullable(),
630
- old_start: import_v42.z.number().nullable()
619
+ lines: z2.array(z2.string()).nullable(),
620
+ new_lines: z2.number().nullable(),
621
+ new_start: z2.number().nullable(),
622
+ old_lines: z2.number().nullable(),
623
+ old_start: z2.number().nullable()
631
624
  })
632
625
  ])
633
626
  }),
634
627
  // tool search tool results for tool_search_tool_regex_20251119 and tool_search_tool_bm25_20251119:
635
- import_v42.z.object({
636
- type: import_v42.z.literal("tool_search_tool_result"),
637
- tool_use_id: import_v42.z.string(),
638
- content: import_v42.z.union([
639
- import_v42.z.object({
640
- type: import_v42.z.literal("tool_search_tool_search_result"),
641
- tool_references: import_v42.z.array(
642
- import_v42.z.object({
643
- type: import_v42.z.literal("tool_reference"),
644
- tool_name: import_v42.z.string()
628
+ z2.object({
629
+ type: z2.literal("tool_search_tool_result"),
630
+ tool_use_id: z2.string(),
631
+ content: z2.union([
632
+ z2.object({
633
+ type: z2.literal("tool_search_tool_search_result"),
634
+ tool_references: z2.array(
635
+ z2.object({
636
+ type: z2.literal("tool_reference"),
637
+ tool_name: z2.string()
645
638
  })
646
639
  )
647
640
  }),
648
- import_v42.z.object({
649
- type: import_v42.z.literal("tool_search_tool_result_error"),
650
- error_code: import_v42.z.string()
641
+ z2.object({
642
+ type: z2.literal("tool_search_tool_result_error"),
643
+ error_code: z2.string()
651
644
  })
652
645
  ])
653
646
  })
654
647
  ])
655
648
  }),
656
- import_v42.z.object({
657
- type: import_v42.z.literal("content_block_delta"),
658
- index: import_v42.z.number(),
659
- delta: import_v42.z.discriminatedUnion("type", [
660
- import_v42.z.object({
661
- type: import_v42.z.literal("input_json_delta"),
662
- partial_json: import_v42.z.string()
649
+ z2.object({
650
+ type: z2.literal("content_block_delta"),
651
+ index: z2.number(),
652
+ delta: z2.discriminatedUnion("type", [
653
+ z2.object({
654
+ type: z2.literal("input_json_delta"),
655
+ partial_json: z2.string()
663
656
  }),
664
- import_v42.z.object({
665
- type: import_v42.z.literal("text_delta"),
666
- text: import_v42.z.string()
657
+ z2.object({
658
+ type: z2.literal("text_delta"),
659
+ text: z2.string()
667
660
  }),
668
- import_v42.z.object({
669
- type: import_v42.z.literal("thinking_delta"),
670
- thinking: import_v42.z.string()
661
+ z2.object({
662
+ type: z2.literal("thinking_delta"),
663
+ thinking: z2.string()
671
664
  }),
672
- import_v42.z.object({
673
- type: import_v42.z.literal("signature_delta"),
674
- signature: import_v42.z.string()
665
+ z2.object({
666
+ type: z2.literal("signature_delta"),
667
+ signature: z2.string()
675
668
  }),
676
- import_v42.z.object({
677
- type: import_v42.z.literal("compaction_delta"),
678
- content: import_v42.z.string().nullish()
669
+ z2.object({
670
+ type: z2.literal("compaction_delta"),
671
+ content: z2.string().nullish()
679
672
  }),
680
- import_v42.z.object({
681
- type: import_v42.z.literal("citations_delta"),
682
- citation: import_v42.z.discriminatedUnion("type", [
683
- import_v42.z.object({
684
- type: import_v42.z.literal("web_search_result_location"),
685
- cited_text: import_v42.z.string(),
686
- url: import_v42.z.string(),
687
- title: import_v42.z.string(),
688
- encrypted_index: import_v42.z.string()
673
+ z2.object({
674
+ type: z2.literal("citations_delta"),
675
+ citation: z2.discriminatedUnion("type", [
676
+ z2.object({
677
+ type: z2.literal("web_search_result_location"),
678
+ cited_text: z2.string(),
679
+ url: z2.string(),
680
+ title: z2.string(),
681
+ encrypted_index: z2.string()
689
682
  }),
690
- import_v42.z.object({
691
- type: import_v42.z.literal("page_location"),
692
- cited_text: import_v42.z.string(),
693
- document_index: import_v42.z.number(),
694
- document_title: import_v42.z.string().nullable(),
695
- start_page_number: import_v42.z.number(),
696
- end_page_number: import_v42.z.number()
683
+ z2.object({
684
+ type: z2.literal("page_location"),
685
+ cited_text: z2.string(),
686
+ document_index: z2.number(),
687
+ document_title: z2.string().nullable(),
688
+ start_page_number: z2.number(),
689
+ end_page_number: z2.number()
697
690
  }),
698
- import_v42.z.object({
699
- type: import_v42.z.literal("char_location"),
700
- cited_text: import_v42.z.string(),
701
- document_index: import_v42.z.number(),
702
- document_title: import_v42.z.string().nullable(),
703
- start_char_index: import_v42.z.number(),
704
- end_char_index: import_v42.z.number()
691
+ z2.object({
692
+ type: z2.literal("char_location"),
693
+ cited_text: z2.string(),
694
+ document_index: z2.number(),
695
+ document_title: z2.string().nullable(),
696
+ start_char_index: z2.number(),
697
+ end_char_index: z2.number()
705
698
  })
706
699
  ])
707
700
  })
708
701
  ])
709
702
  }),
710
- import_v42.z.object({
711
- type: import_v42.z.literal("content_block_stop"),
712
- index: import_v42.z.number()
703
+ z2.object({
704
+ type: z2.literal("content_block_stop"),
705
+ index: z2.number()
713
706
  }),
714
- import_v42.z.object({
715
- type: import_v42.z.literal("error"),
716
- error: import_v42.z.object({
717
- type: import_v42.z.string(),
718
- message: import_v42.z.string()
707
+ z2.object({
708
+ type: z2.literal("error"),
709
+ error: z2.object({
710
+ type: z2.string(),
711
+ message: z2.string()
719
712
  })
720
713
  }),
721
- import_v42.z.object({
722
- type: import_v42.z.literal("message_delta"),
723
- delta: import_v42.z.object({
724
- stop_reason: import_v42.z.string().nullish(),
725
- stop_sequence: import_v42.z.string().nullish(),
726
- container: import_v42.z.object({
727
- expires_at: import_v42.z.string(),
728
- id: import_v42.z.string(),
729
- skills: import_v42.z.array(
730
- import_v42.z.object({
731
- type: import_v42.z.union([
732
- import_v42.z.literal("anthropic"),
733
- import_v42.z.literal("custom")
714
+ z2.object({
715
+ type: z2.literal("message_delta"),
716
+ delta: z2.object({
717
+ stop_reason: z2.string().nullish(),
718
+ stop_sequence: z2.string().nullish(),
719
+ container: z2.object({
720
+ expires_at: z2.string(),
721
+ id: z2.string(),
722
+ skills: z2.array(
723
+ z2.object({
724
+ type: z2.union([
725
+ z2.literal("anthropic"),
726
+ z2.literal("custom")
734
727
  ]),
735
- skill_id: import_v42.z.string(),
736
- version: import_v42.z.string()
728
+ skill_id: z2.string(),
729
+ version: z2.string()
737
730
  })
738
731
  ).nullish()
739
732
  }).nullish()
740
733
  }),
741
- usage: import_v42.z.looseObject({
742
- input_tokens: import_v42.z.number().nullish(),
743
- output_tokens: import_v42.z.number(),
744
- cache_creation_input_tokens: import_v42.z.number().nullish(),
745
- cache_read_input_tokens: import_v42.z.number().nullish(),
746
- iterations: import_v42.z.array(
747
- import_v42.z.object({
748
- type: import_v42.z.union([import_v42.z.literal("compaction"), import_v42.z.literal("message")]),
749
- input_tokens: import_v42.z.number(),
750
- output_tokens: import_v42.z.number()
734
+ usage: z2.looseObject({
735
+ input_tokens: z2.number().nullish(),
736
+ output_tokens: z2.number(),
737
+ cache_creation_input_tokens: z2.number().nullish(),
738
+ cache_read_input_tokens: z2.number().nullish(),
739
+ iterations: z2.array(
740
+ z2.object({
741
+ type: z2.union([z2.literal("compaction"), z2.literal("message")]),
742
+ input_tokens: z2.number(),
743
+ output_tokens: z2.number()
751
744
  })
752
745
  ).nullish()
753
746
  }),
754
- context_management: import_v42.z.object({
755
- applied_edits: import_v42.z.array(
756
- import_v42.z.union([
757
- import_v42.z.object({
758
- type: import_v42.z.literal("clear_tool_uses_20250919"),
759
- cleared_tool_uses: import_v42.z.number(),
760
- cleared_input_tokens: import_v42.z.number()
747
+ context_management: z2.object({
748
+ applied_edits: z2.array(
749
+ z2.union([
750
+ z2.object({
751
+ type: z2.literal("clear_tool_uses_20250919"),
752
+ cleared_tool_uses: z2.number(),
753
+ cleared_input_tokens: z2.number()
761
754
  }),
762
- import_v42.z.object({
763
- type: import_v42.z.literal("clear_thinking_20251015"),
764
- cleared_thinking_turns: import_v42.z.number(),
765
- cleared_input_tokens: import_v42.z.number()
755
+ z2.object({
756
+ type: z2.literal("clear_thinking_20251015"),
757
+ cleared_thinking_turns: z2.number(),
758
+ cleared_input_tokens: z2.number()
766
759
  }),
767
- import_v42.z.object({
768
- type: import_v42.z.literal("compact_20260112")
760
+ z2.object({
761
+ type: z2.literal("compact_20260112")
769
762
  })
770
763
  ])
771
764
  )
772
765
  }).nullish()
773
766
  }),
774
- import_v42.z.object({
775
- type: import_v42.z.literal("message_stop")
767
+ z2.object({
768
+ type: z2.literal("message_stop")
776
769
  }),
777
- import_v42.z.object({
778
- type: import_v42.z.literal("ping")
770
+ z2.object({
771
+ type: z2.literal("ping")
779
772
  })
780
773
  ])
781
774
  )
782
775
  );
783
- var anthropicReasoningMetadataSchema = (0, import_provider_utils2.lazySchema)(
784
- () => (0, import_provider_utils2.zodSchema)(
785
- import_v42.z.object({
786
- signature: import_v42.z.string().optional(),
787
- redactedData: import_v42.z.string().optional()
776
+ var anthropicReasoningMetadataSchema = lazySchema2(
777
+ () => zodSchema2(
778
+ z2.object({
779
+ signature: z2.string().optional(),
780
+ redactedData: z2.string().optional()
788
781
  })
789
782
  )
790
783
  );
791
784
 
792
785
  // src/anthropic-messages-options.ts
793
- var import_v43 = require("zod/v4");
794
- var anthropicFilePartProviderOptions = import_v43.z.object({
786
+ import { z as z3 } from "zod/v4";
787
+ var anthropicFilePartProviderOptions = z3.object({
795
788
  /**
796
789
  * Citation configuration for this document.
797
790
  * When enabled, this document will generate citations in the response.
798
791
  */
799
- citations: import_v43.z.object({
792
+ citations: z3.object({
800
793
  /**
801
794
  * Enable citations for this document
802
795
  */
803
- enabled: import_v43.z.boolean()
796
+ enabled: z3.boolean()
804
797
  }).optional(),
805
798
  /**
806
799
  * Custom title for the document.
807
800
  * If not provided, the filename will be used.
808
801
  */
809
- title: import_v43.z.string().optional(),
802
+ title: z3.string().optional(),
810
803
  /**
811
804
  * Context about the document that will be passed to the model
812
805
  * but not used towards cited content.
813
806
  * Useful for storing document metadata as text or stringified JSON.
814
807
  */
815
- context: import_v43.z.string().optional()
808
+ context: z3.string().optional()
816
809
  });
817
- var anthropicLanguageModelOptions = import_v43.z.object({
810
+ var anthropicLanguageModelOptions = z3.object({
818
811
  /**
819
812
  * Whether to send reasoning to the model.
820
813
  *
821
814
  * This allows you to deactivate reasoning inputs for models that do not support them.
822
815
  */
823
- sendReasoning: import_v43.z.boolean().optional(),
816
+ sendReasoning: z3.boolean().optional(),
824
817
  /**
825
818
  * Determines how structured outputs are generated.
826
819
  *
@@ -828,66 +821,66 @@ var anthropicLanguageModelOptions = import_v43.z.object({
828
821
  * - `jsonTool`: Use a special 'json' tool to specify the structured output format.
829
822
  * - `auto`: Use 'outputFormat' when supported, otherwise use 'jsonTool' (default).
830
823
  */
831
- structuredOutputMode: import_v43.z.enum(["outputFormat", "jsonTool", "auto"]).optional(),
824
+ structuredOutputMode: z3.enum(["outputFormat", "jsonTool", "auto"]).optional(),
832
825
  /**
833
826
  * Configuration for enabling Claude's extended thinking.
834
827
  *
835
828
  * When enabled, responses include thinking content blocks showing Claude's thinking process before the final answer.
836
829
  * Requires a minimum budget of 1,024 tokens and counts towards the `max_tokens` limit.
837
830
  */
838
- thinking: import_v43.z.discriminatedUnion("type", [
839
- import_v43.z.object({
831
+ thinking: z3.discriminatedUnion("type", [
832
+ z3.object({
840
833
  /** for Sonnet 4.6, Opus 4.6, and newer models */
841
- type: import_v43.z.literal("adaptive")
834
+ type: z3.literal("adaptive")
842
835
  }),
843
- import_v43.z.object({
836
+ z3.object({
844
837
  /** for models before Opus 4.6, except Sonnet 4.6 still supports it */
845
- type: import_v43.z.literal("enabled"),
846
- budgetTokens: import_v43.z.number().optional()
838
+ type: z3.literal("enabled"),
839
+ budgetTokens: z3.number().optional()
847
840
  }),
848
- import_v43.z.object({
849
- type: import_v43.z.literal("disabled")
841
+ z3.object({
842
+ type: z3.literal("disabled")
850
843
  })
851
844
  ]).optional(),
852
845
  /**
853
846
  * Whether to disable parallel function calling during tool use. Default is false.
854
847
  * When set to true, Claude will use at most one tool per response.
855
848
  */
856
- disableParallelToolUse: import_v43.z.boolean().optional(),
849
+ disableParallelToolUse: z3.boolean().optional(),
857
850
  /**
858
851
  * Cache control settings for this message.
859
852
  * See https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching
860
853
  */
861
- cacheControl: import_v43.z.object({
862
- type: import_v43.z.literal("ephemeral"),
863
- ttl: import_v43.z.union([import_v43.z.literal("5m"), import_v43.z.literal("1h")]).optional()
854
+ cacheControl: z3.object({
855
+ type: z3.literal("ephemeral"),
856
+ ttl: z3.union([z3.literal("5m"), z3.literal("1h")]).optional()
864
857
  }).optional(),
865
858
  /**
866
859
  * Metadata to include with the request.
867
860
  *
868
861
  * See https://platform.claude.com/docs/en/api/messages/create for details.
869
862
  */
870
- metadata: import_v43.z.object({
863
+ metadata: z3.object({
871
864
  /**
872
865
  * An external identifier for the user associated with the request.
873
866
  *
874
867
  * Should be a UUID, hash value, or other opaque identifier.
875
868
  * Must not contain PII (name, email, phone number, etc.).
876
869
  */
877
- userId: import_v43.z.string().optional()
870
+ userId: z3.string().optional()
878
871
  }).optional(),
879
872
  /**
880
873
  * MCP servers to be utilized in this request.
881
874
  */
882
- mcpServers: import_v43.z.array(
883
- import_v43.z.object({
884
- type: import_v43.z.literal("url"),
885
- name: import_v43.z.string(),
886
- url: import_v43.z.string(),
887
- authorizationToken: import_v43.z.string().nullish(),
888
- toolConfiguration: import_v43.z.object({
889
- enabled: import_v43.z.boolean().nullish(),
890
- allowedTools: import_v43.z.array(import_v43.z.string()).nullish()
875
+ mcpServers: z3.array(
876
+ z3.object({
877
+ type: z3.literal("url"),
878
+ name: z3.string(),
879
+ url: z3.string(),
880
+ authorizationToken: z3.string().nullish(),
881
+ toolConfiguration: z3.object({
882
+ enabled: z3.boolean().nullish(),
883
+ allowedTools: z3.array(z3.string()).nullish()
891
884
  }).nullish()
892
885
  })
893
886
  ).optional(),
@@ -896,19 +889,19 @@ var anthropicLanguageModelOptions = import_v43.z.object({
896
889
  * like document processing (PPTX, DOCX, PDF, XLSX) and data analysis.
897
890
  * Requires code execution tool to be enabled.
898
891
  */
899
- container: import_v43.z.object({
900
- id: import_v43.z.string().optional(),
901
- skills: import_v43.z.array(
902
- import_v43.z.discriminatedUnion("type", [
903
- import_v43.z.object({
904
- type: import_v43.z.literal("anthropic"),
905
- skillId: import_v43.z.string(),
906
- version: import_v43.z.string().optional()
892
+ container: z3.object({
893
+ id: z3.string().optional(),
894
+ skills: z3.array(
895
+ z3.discriminatedUnion("type", [
896
+ z3.object({
897
+ type: z3.literal("anthropic"),
898
+ skillId: z3.string(),
899
+ version: z3.string().optional()
907
900
  }),
908
- import_v43.z.object({
909
- type: import_v43.z.literal("custom"),
910
- providerReference: import_v43.z.record(import_v43.z.string(), import_v43.z.string()),
911
- version: import_v43.z.string().optional()
901
+ z3.object({
902
+ type: z3.literal("custom"),
903
+ providerReference: z3.record(z3.string(), z3.string()),
904
+ version: z3.string().optional()
912
905
  })
913
906
  ])
914
907
  ).optional()
@@ -921,16 +914,16 @@ var anthropicLanguageModelOptions = import_v43.z.object({
921
914
  *
922
915
  * @default true
923
916
  */
924
- toolStreaming: import_v43.z.boolean().optional(),
917
+ toolStreaming: z3.boolean().optional(),
925
918
  /**
926
919
  * @default 'high'
927
920
  */
928
- effort: import_v43.z.enum(["low", "medium", "high", "max"]).optional(),
921
+ effort: z3.enum(["low", "medium", "high", "max"]).optional(),
929
922
  /**
930
923
  * Enable fast mode for faster inference (2.5x faster output token speeds).
931
924
  * Only supported with claude-opus-4-6.
932
925
  */
933
- speed: import_v43.z.enum(["fast", "standard"]).optional(),
926
+ speed: z3.enum(["fast", "standard"]).optional(),
934
927
  /**
935
928
  * Controls where model inference runs for this request.
936
929
  *
@@ -939,56 +932,56 @@ var anthropicLanguageModelOptions = import_v43.z.object({
939
932
  *
940
933
  * See https://platform.claude.com/docs/en/build-with-claude/data-residency
941
934
  */
942
- inferenceGeo: import_v43.z.enum(["us", "global"]).optional(),
935
+ inferenceGeo: z3.enum(["us", "global"]).optional(),
943
936
  /**
944
937
  * A set of beta features to enable.
945
938
  * Allow a provider to receive the full `betas` set if it needs it.
946
939
  */
947
- anthropicBeta: import_v43.z.array(import_v43.z.string()).optional(),
948
- contextManagement: import_v43.z.object({
949
- edits: import_v43.z.array(
950
- import_v43.z.discriminatedUnion("type", [
951
- import_v43.z.object({
952
- type: import_v43.z.literal("clear_tool_uses_20250919"),
953
- trigger: import_v43.z.discriminatedUnion("type", [
954
- import_v43.z.object({
955
- type: import_v43.z.literal("input_tokens"),
956
- value: import_v43.z.number()
940
+ anthropicBeta: z3.array(z3.string()).optional(),
941
+ contextManagement: z3.object({
942
+ edits: z3.array(
943
+ z3.discriminatedUnion("type", [
944
+ z3.object({
945
+ type: z3.literal("clear_tool_uses_20250919"),
946
+ trigger: z3.discriminatedUnion("type", [
947
+ z3.object({
948
+ type: z3.literal("input_tokens"),
949
+ value: z3.number()
957
950
  }),
958
- import_v43.z.object({
959
- type: import_v43.z.literal("tool_uses"),
960
- value: import_v43.z.number()
951
+ z3.object({
952
+ type: z3.literal("tool_uses"),
953
+ value: z3.number()
961
954
  })
962
955
  ]).optional(),
963
- keep: import_v43.z.object({
964
- type: import_v43.z.literal("tool_uses"),
965
- value: import_v43.z.number()
956
+ keep: z3.object({
957
+ type: z3.literal("tool_uses"),
958
+ value: z3.number()
966
959
  }).optional(),
967
- clearAtLeast: import_v43.z.object({
968
- type: import_v43.z.literal("input_tokens"),
969
- value: import_v43.z.number()
960
+ clearAtLeast: z3.object({
961
+ type: z3.literal("input_tokens"),
962
+ value: z3.number()
970
963
  }).optional(),
971
- clearToolInputs: import_v43.z.boolean().optional(),
972
- excludeTools: import_v43.z.array(import_v43.z.string()).optional()
964
+ clearToolInputs: z3.boolean().optional(),
965
+ excludeTools: z3.array(z3.string()).optional()
973
966
  }),
974
- import_v43.z.object({
975
- type: import_v43.z.literal("clear_thinking_20251015"),
976
- keep: import_v43.z.union([
977
- import_v43.z.literal("all"),
978
- import_v43.z.object({
979
- type: import_v43.z.literal("thinking_turns"),
980
- value: import_v43.z.number()
967
+ z3.object({
968
+ type: z3.literal("clear_thinking_20251015"),
969
+ keep: z3.union([
970
+ z3.literal("all"),
971
+ z3.object({
972
+ type: z3.literal("thinking_turns"),
973
+ value: z3.number()
981
974
  })
982
975
  ]).optional()
983
976
  }),
984
- import_v43.z.object({
985
- type: import_v43.z.literal("compact_20260112"),
986
- trigger: import_v43.z.object({
987
- type: import_v43.z.literal("input_tokens"),
988
- value: import_v43.z.number()
977
+ z3.object({
978
+ type: z3.literal("compact_20260112"),
979
+ trigger: z3.object({
980
+ type: z3.literal("input_tokens"),
981
+ value: z3.number()
989
982
  }).optional(),
990
- pauseAfterCompaction: import_v43.z.boolean().optional(),
991
- instructions: import_v43.z.string().optional()
983
+ pauseAfterCompaction: z3.boolean().optional(),
984
+ instructions: z3.string().optional()
992
985
  })
993
986
  ])
994
987
  )
@@ -996,7 +989,9 @@ var anthropicLanguageModelOptions = import_v43.z.object({
996
989
  });
997
990
 
998
991
  // src/anthropic-prepare-tools.ts
999
- var import_provider = require("@ai-sdk/provider");
992
+ import {
993
+ UnsupportedFunctionalityError
994
+ } from "@ai-sdk/provider";
1000
995
 
1001
996
  // src/get-cache-control.ts
1002
997
  var MAX_CACHE_BREAKPOINTS = 4;
@@ -1041,31 +1036,31 @@ var CacheControlValidator = class {
1041
1036
  };
1042
1037
 
1043
1038
  // src/tool/text-editor_20250728.ts
1044
- var import_provider_utils3 = require("@ai-sdk/provider-utils");
1045
- var import_v44 = require("zod/v4");
1046
- var import_provider_utils4 = require("@ai-sdk/provider-utils");
1047
- var textEditor_20250728ArgsSchema = (0, import_provider_utils4.lazySchema)(
1048
- () => (0, import_provider_utils4.zodSchema)(
1049
- import_v44.z.object({
1050
- maxCharacters: import_v44.z.number().optional()
1039
+ import { createProviderToolFactory } from "@ai-sdk/provider-utils";
1040
+ import { z as z4 } from "zod/v4";
1041
+ import { lazySchema as lazySchema3, zodSchema as zodSchema3 } from "@ai-sdk/provider-utils";
1042
+ var textEditor_20250728ArgsSchema = lazySchema3(
1043
+ () => zodSchema3(
1044
+ z4.object({
1045
+ maxCharacters: z4.number().optional()
1051
1046
  })
1052
1047
  )
1053
1048
  );
1054
- var textEditor_20250728InputSchema = (0, import_provider_utils4.lazySchema)(
1055
- () => (0, import_provider_utils4.zodSchema)(
1056
- import_v44.z.object({
1057
- command: import_v44.z.enum(["view", "create", "str_replace", "insert"]),
1058
- path: import_v44.z.string(),
1059
- file_text: import_v44.z.string().optional(),
1060
- insert_line: import_v44.z.number().int().optional(),
1061
- new_str: import_v44.z.string().optional(),
1062
- insert_text: import_v44.z.string().optional(),
1063
- old_str: import_v44.z.string().optional(),
1064
- view_range: import_v44.z.array(import_v44.z.number().int()).optional()
1049
+ var textEditor_20250728InputSchema = lazySchema3(
1050
+ () => zodSchema3(
1051
+ z4.object({
1052
+ command: z4.enum(["view", "create", "str_replace", "insert"]),
1053
+ path: z4.string(),
1054
+ file_text: z4.string().optional(),
1055
+ insert_line: z4.number().int().optional(),
1056
+ new_str: z4.string().optional(),
1057
+ insert_text: z4.string().optional(),
1058
+ old_str: z4.string().optional(),
1059
+ view_range: z4.array(z4.number().int()).optional()
1065
1060
  })
1066
1061
  )
1067
1062
  );
1068
- var factory = (0, import_provider_utils3.createProviderToolFactory)({
1063
+ var factory = createProviderToolFactory({
1069
1064
  id: "anthropic.text_editor_20250728",
1070
1065
  inputSchema: textEditor_20250728InputSchema
1071
1066
  });
@@ -1074,45 +1069,49 @@ var textEditor_20250728 = (args = {}) => {
1074
1069
  };
1075
1070
 
1076
1071
  // src/tool/web-search_20260209.ts
1077
- var import_provider_utils5 = require("@ai-sdk/provider-utils");
1078
- var import_v45 = require("zod/v4");
1079
- var webSearch_20260209ArgsSchema = (0, import_provider_utils5.lazySchema)(
1080
- () => (0, import_provider_utils5.zodSchema)(
1081
- import_v45.z.object({
1082
- maxUses: import_v45.z.number().optional(),
1083
- allowedDomains: import_v45.z.array(import_v45.z.string()).optional(),
1084
- blockedDomains: import_v45.z.array(import_v45.z.string()).optional(),
1085
- userLocation: import_v45.z.object({
1086
- type: import_v45.z.literal("approximate"),
1087
- city: import_v45.z.string().optional(),
1088
- region: import_v45.z.string().optional(),
1089
- country: import_v45.z.string().optional(),
1090
- timezone: import_v45.z.string().optional()
1072
+ import {
1073
+ createProviderToolFactoryWithOutputSchema,
1074
+ lazySchema as lazySchema4,
1075
+ zodSchema as zodSchema4
1076
+ } from "@ai-sdk/provider-utils";
1077
+ import { z as z5 } from "zod/v4";
1078
+ var webSearch_20260209ArgsSchema = lazySchema4(
1079
+ () => zodSchema4(
1080
+ z5.object({
1081
+ maxUses: z5.number().optional(),
1082
+ allowedDomains: z5.array(z5.string()).optional(),
1083
+ blockedDomains: z5.array(z5.string()).optional(),
1084
+ userLocation: z5.object({
1085
+ type: z5.literal("approximate"),
1086
+ city: z5.string().optional(),
1087
+ region: z5.string().optional(),
1088
+ country: z5.string().optional(),
1089
+ timezone: z5.string().optional()
1091
1090
  }).optional()
1092
1091
  })
1093
1092
  )
1094
1093
  );
1095
- var webSearch_20260209OutputSchema = (0, import_provider_utils5.lazySchema)(
1096
- () => (0, import_provider_utils5.zodSchema)(
1097
- import_v45.z.array(
1098
- import_v45.z.object({
1099
- url: import_v45.z.string(),
1100
- title: import_v45.z.string().nullable(),
1101
- pageAge: import_v45.z.string().nullable(),
1102
- encryptedContent: import_v45.z.string(),
1103
- type: import_v45.z.literal("web_search_result")
1094
+ var webSearch_20260209OutputSchema = lazySchema4(
1095
+ () => zodSchema4(
1096
+ z5.array(
1097
+ z5.object({
1098
+ url: z5.string(),
1099
+ title: z5.string().nullable(),
1100
+ pageAge: z5.string().nullable(),
1101
+ encryptedContent: z5.string(),
1102
+ type: z5.literal("web_search_result")
1104
1103
  })
1105
1104
  )
1106
1105
  )
1107
1106
  );
1108
- var webSearch_20260209InputSchema = (0, import_provider_utils5.lazySchema)(
1109
- () => (0, import_provider_utils5.zodSchema)(
1110
- import_v45.z.object({
1111
- query: import_v45.z.string()
1107
+ var webSearch_20260209InputSchema = lazySchema4(
1108
+ () => zodSchema4(
1109
+ z5.object({
1110
+ query: z5.string()
1112
1111
  })
1113
1112
  )
1114
1113
  );
1115
- var factory2 = (0, import_provider_utils5.createProviderToolFactoryWithOutputSchema)({
1114
+ var factory2 = createProviderToolFactoryWithOutputSchema({
1116
1115
  id: "anthropic.web_search_20260209",
1117
1116
  inputSchema: webSearch_20260209InputSchema,
1118
1117
  outputSchema: webSearch_20260209OutputSchema,
@@ -1123,45 +1122,49 @@ var webSearch_20260209 = (args = {}) => {
1123
1122
  };
1124
1123
 
1125
1124
  // src/tool/web-search_20250305.ts
1126
- var import_provider_utils6 = require("@ai-sdk/provider-utils");
1127
- var import_v46 = require("zod/v4");
1128
- var webSearch_20250305ArgsSchema = (0, import_provider_utils6.lazySchema)(
1129
- () => (0, import_provider_utils6.zodSchema)(
1130
- import_v46.z.object({
1131
- maxUses: import_v46.z.number().optional(),
1132
- allowedDomains: import_v46.z.array(import_v46.z.string()).optional(),
1133
- blockedDomains: import_v46.z.array(import_v46.z.string()).optional(),
1134
- userLocation: import_v46.z.object({
1135
- type: import_v46.z.literal("approximate"),
1136
- city: import_v46.z.string().optional(),
1137
- region: import_v46.z.string().optional(),
1138
- country: import_v46.z.string().optional(),
1139
- timezone: import_v46.z.string().optional()
1125
+ import {
1126
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,
1127
+ lazySchema as lazySchema5,
1128
+ zodSchema as zodSchema5
1129
+ } from "@ai-sdk/provider-utils";
1130
+ import { z as z6 } from "zod/v4";
1131
+ var webSearch_20250305ArgsSchema = lazySchema5(
1132
+ () => zodSchema5(
1133
+ z6.object({
1134
+ maxUses: z6.number().optional(),
1135
+ allowedDomains: z6.array(z6.string()).optional(),
1136
+ blockedDomains: z6.array(z6.string()).optional(),
1137
+ userLocation: z6.object({
1138
+ type: z6.literal("approximate"),
1139
+ city: z6.string().optional(),
1140
+ region: z6.string().optional(),
1141
+ country: z6.string().optional(),
1142
+ timezone: z6.string().optional()
1140
1143
  }).optional()
1141
1144
  })
1142
1145
  )
1143
1146
  );
1144
- var webSearch_20250305OutputSchema = (0, import_provider_utils6.lazySchema)(
1145
- () => (0, import_provider_utils6.zodSchema)(
1146
- import_v46.z.array(
1147
- import_v46.z.object({
1148
- url: import_v46.z.string(),
1149
- title: import_v46.z.string().nullable(),
1150
- pageAge: import_v46.z.string().nullable(),
1151
- encryptedContent: import_v46.z.string(),
1152
- type: import_v46.z.literal("web_search_result")
1147
+ var webSearch_20250305OutputSchema = lazySchema5(
1148
+ () => zodSchema5(
1149
+ z6.array(
1150
+ z6.object({
1151
+ url: z6.string(),
1152
+ title: z6.string().nullable(),
1153
+ pageAge: z6.string().nullable(),
1154
+ encryptedContent: z6.string(),
1155
+ type: z6.literal("web_search_result")
1153
1156
  })
1154
1157
  )
1155
1158
  )
1156
1159
  );
1157
- var webSearch_20250305InputSchema = (0, import_provider_utils6.lazySchema)(
1158
- () => (0, import_provider_utils6.zodSchema)(
1159
- import_v46.z.object({
1160
- query: import_v46.z.string()
1160
+ var webSearch_20250305InputSchema = lazySchema5(
1161
+ () => zodSchema5(
1162
+ z6.object({
1163
+ query: z6.string()
1161
1164
  })
1162
1165
  )
1163
1166
  );
1164
- var factory3 = (0, import_provider_utils6.createProviderToolFactoryWithOutputSchema)({
1167
+ var factory3 = createProviderToolFactoryWithOutputSchema2({
1165
1168
  id: "anthropic.web_search_20250305",
1166
1169
  inputSchema: webSearch_20250305InputSchema,
1167
1170
  outputSchema: webSearch_20250305OutputSchema,
@@ -1172,53 +1175,57 @@ var webSearch_20250305 = (args = {}) => {
1172
1175
  };
1173
1176
 
1174
1177
  // src/tool/web-fetch-20260209.ts
1175
- var import_provider_utils7 = require("@ai-sdk/provider-utils");
1176
- var import_v47 = require("zod/v4");
1177
- var webFetch_20260209ArgsSchema = (0, import_provider_utils7.lazySchema)(
1178
- () => (0, import_provider_utils7.zodSchema)(
1179
- import_v47.z.object({
1180
- maxUses: import_v47.z.number().optional(),
1181
- allowedDomains: import_v47.z.array(import_v47.z.string()).optional(),
1182
- blockedDomains: import_v47.z.array(import_v47.z.string()).optional(),
1183
- citations: import_v47.z.object({ enabled: import_v47.z.boolean() }).optional(),
1184
- maxContentTokens: import_v47.z.number().optional()
1178
+ import {
1179
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,
1180
+ lazySchema as lazySchema6,
1181
+ zodSchema as zodSchema6
1182
+ } from "@ai-sdk/provider-utils";
1183
+ import { z as z7 } from "zod/v4";
1184
+ var webFetch_20260209ArgsSchema = lazySchema6(
1185
+ () => zodSchema6(
1186
+ z7.object({
1187
+ maxUses: z7.number().optional(),
1188
+ allowedDomains: z7.array(z7.string()).optional(),
1189
+ blockedDomains: z7.array(z7.string()).optional(),
1190
+ citations: z7.object({ enabled: z7.boolean() }).optional(),
1191
+ maxContentTokens: z7.number().optional()
1185
1192
  })
1186
1193
  )
1187
1194
  );
1188
- var webFetch_20260209OutputSchema = (0, import_provider_utils7.lazySchema)(
1189
- () => (0, import_provider_utils7.zodSchema)(
1190
- import_v47.z.object({
1191
- type: import_v47.z.literal("web_fetch_result"),
1192
- url: import_v47.z.string(),
1193
- content: import_v47.z.object({
1194
- type: import_v47.z.literal("document"),
1195
- title: import_v47.z.string().nullable(),
1196
- citations: import_v47.z.object({ enabled: import_v47.z.boolean() }).optional(),
1197
- source: import_v47.z.union([
1198
- import_v47.z.object({
1199
- type: import_v47.z.literal("base64"),
1200
- mediaType: import_v47.z.literal("application/pdf"),
1201
- data: import_v47.z.string()
1195
+ var webFetch_20260209OutputSchema = lazySchema6(
1196
+ () => zodSchema6(
1197
+ z7.object({
1198
+ type: z7.literal("web_fetch_result"),
1199
+ url: z7.string(),
1200
+ content: z7.object({
1201
+ type: z7.literal("document"),
1202
+ title: z7.string().nullable(),
1203
+ citations: z7.object({ enabled: z7.boolean() }).optional(),
1204
+ source: z7.union([
1205
+ z7.object({
1206
+ type: z7.literal("base64"),
1207
+ mediaType: z7.literal("application/pdf"),
1208
+ data: z7.string()
1202
1209
  }),
1203
- import_v47.z.object({
1204
- type: import_v47.z.literal("text"),
1205
- mediaType: import_v47.z.literal("text/plain"),
1206
- data: import_v47.z.string()
1210
+ z7.object({
1211
+ type: z7.literal("text"),
1212
+ mediaType: z7.literal("text/plain"),
1213
+ data: z7.string()
1207
1214
  })
1208
1215
  ])
1209
1216
  }),
1210
- retrievedAt: import_v47.z.string().nullable()
1217
+ retrievedAt: z7.string().nullable()
1211
1218
  })
1212
1219
  )
1213
1220
  );
1214
- var webFetch_20260209InputSchema = (0, import_provider_utils7.lazySchema)(
1215
- () => (0, import_provider_utils7.zodSchema)(
1216
- import_v47.z.object({
1217
- url: import_v47.z.string()
1221
+ var webFetch_20260209InputSchema = lazySchema6(
1222
+ () => zodSchema6(
1223
+ z7.object({
1224
+ url: z7.string()
1218
1225
  })
1219
1226
  )
1220
1227
  );
1221
- var factory4 = (0, import_provider_utils7.createProviderToolFactoryWithOutputSchema)({
1228
+ var factory4 = createProviderToolFactoryWithOutputSchema3({
1222
1229
  id: "anthropic.web_fetch_20260209",
1223
1230
  inputSchema: webFetch_20260209InputSchema,
1224
1231
  outputSchema: webFetch_20260209OutputSchema,
@@ -1229,53 +1236,57 @@ var webFetch_20260209 = (args = {}) => {
1229
1236
  };
1230
1237
 
1231
1238
  // src/tool/web-fetch-20250910.ts
1232
- var import_provider_utils8 = require("@ai-sdk/provider-utils");
1233
- var import_v48 = require("zod/v4");
1234
- var webFetch_20250910ArgsSchema = (0, import_provider_utils8.lazySchema)(
1235
- () => (0, import_provider_utils8.zodSchema)(
1236
- import_v48.z.object({
1237
- maxUses: import_v48.z.number().optional(),
1238
- allowedDomains: import_v48.z.array(import_v48.z.string()).optional(),
1239
- blockedDomains: import_v48.z.array(import_v48.z.string()).optional(),
1240
- citations: import_v48.z.object({ enabled: import_v48.z.boolean() }).optional(),
1241
- maxContentTokens: import_v48.z.number().optional()
1239
+ import {
1240
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
1241
+ lazySchema as lazySchema7,
1242
+ zodSchema as zodSchema7
1243
+ } from "@ai-sdk/provider-utils";
1244
+ import { z as z8 } from "zod/v4";
1245
+ var webFetch_20250910ArgsSchema = lazySchema7(
1246
+ () => zodSchema7(
1247
+ z8.object({
1248
+ maxUses: z8.number().optional(),
1249
+ allowedDomains: z8.array(z8.string()).optional(),
1250
+ blockedDomains: z8.array(z8.string()).optional(),
1251
+ citations: z8.object({ enabled: z8.boolean() }).optional(),
1252
+ maxContentTokens: z8.number().optional()
1242
1253
  })
1243
1254
  )
1244
1255
  );
1245
- var webFetch_20250910OutputSchema = (0, import_provider_utils8.lazySchema)(
1246
- () => (0, import_provider_utils8.zodSchema)(
1247
- import_v48.z.object({
1248
- type: import_v48.z.literal("web_fetch_result"),
1249
- url: import_v48.z.string(),
1250
- content: import_v48.z.object({
1251
- type: import_v48.z.literal("document"),
1252
- title: import_v48.z.string().nullable(),
1253
- citations: import_v48.z.object({ enabled: import_v48.z.boolean() }).optional(),
1254
- source: import_v48.z.union([
1255
- import_v48.z.object({
1256
- type: import_v48.z.literal("base64"),
1257
- mediaType: import_v48.z.literal("application/pdf"),
1258
- data: import_v48.z.string()
1256
+ var webFetch_20250910OutputSchema = lazySchema7(
1257
+ () => zodSchema7(
1258
+ z8.object({
1259
+ type: z8.literal("web_fetch_result"),
1260
+ url: z8.string(),
1261
+ content: z8.object({
1262
+ type: z8.literal("document"),
1263
+ title: z8.string().nullable(),
1264
+ citations: z8.object({ enabled: z8.boolean() }).optional(),
1265
+ source: z8.union([
1266
+ z8.object({
1267
+ type: z8.literal("base64"),
1268
+ mediaType: z8.literal("application/pdf"),
1269
+ data: z8.string()
1259
1270
  }),
1260
- import_v48.z.object({
1261
- type: import_v48.z.literal("text"),
1262
- mediaType: import_v48.z.literal("text/plain"),
1263
- data: import_v48.z.string()
1271
+ z8.object({
1272
+ type: z8.literal("text"),
1273
+ mediaType: z8.literal("text/plain"),
1274
+ data: z8.string()
1264
1275
  })
1265
1276
  ])
1266
1277
  }),
1267
- retrievedAt: import_v48.z.string().nullable()
1278
+ retrievedAt: z8.string().nullable()
1268
1279
  })
1269
1280
  )
1270
1281
  );
1271
- var webFetch_20250910InputSchema = (0, import_provider_utils8.lazySchema)(
1272
- () => (0, import_provider_utils8.zodSchema)(
1273
- import_v48.z.object({
1274
- url: import_v48.z.string()
1282
+ var webFetch_20250910InputSchema = lazySchema7(
1283
+ () => zodSchema7(
1284
+ z8.object({
1285
+ url: z8.string()
1275
1286
  })
1276
1287
  )
1277
1288
  );
1278
- var factory5 = (0, import_provider_utils8.createProviderToolFactoryWithOutputSchema)({
1289
+ var factory5 = createProviderToolFactoryWithOutputSchema4({
1279
1290
  id: "anthropic.web_fetch_20250910",
1280
1291
  inputSchema: webFetch_20250910InputSchema,
1281
1292
  outputSchema: webFetch_20250910OutputSchema,
@@ -1286,7 +1297,7 @@ var webFetch_20250910 = (args = {}) => {
1286
1297
  };
1287
1298
 
1288
1299
  // src/anthropic-prepare-tools.ts
1289
- var import_provider_utils9 = require("@ai-sdk/provider-utils");
1300
+ import { validateTypes } from "@ai-sdk/provider-utils";
1290
1301
  async function prepareTools({
1291
1302
  tools,
1292
1303
  toolChoice,
@@ -1436,7 +1447,7 @@ async function prepareTools({
1436
1447
  break;
1437
1448
  }
1438
1449
  case "anthropic.text_editor_20250728": {
1439
- const args = await (0, import_provider_utils9.validateTypes)({
1450
+ const args = await validateTypes({
1440
1451
  value: tool.args,
1441
1452
  schema: textEditor_20250728ArgsSchema
1442
1453
  });
@@ -1476,7 +1487,7 @@ async function prepareTools({
1476
1487
  }
1477
1488
  case "anthropic.web_fetch_20250910": {
1478
1489
  betas.add("web-fetch-2025-09-10");
1479
- const args = await (0, import_provider_utils9.validateTypes)({
1490
+ const args = await validateTypes({
1480
1491
  value: tool.args,
1481
1492
  schema: webFetch_20250910ArgsSchema
1482
1493
  });
@@ -1494,7 +1505,7 @@ async function prepareTools({
1494
1505
  }
1495
1506
  case "anthropic.web_fetch_20260209": {
1496
1507
  betas.add("code-execution-web-tools-2026-02-09");
1497
- const args = await (0, import_provider_utils9.validateTypes)({
1508
+ const args = await validateTypes({
1498
1509
  value: tool.args,
1499
1510
  schema: webFetch_20260209ArgsSchema
1500
1511
  });
@@ -1511,7 +1522,7 @@ async function prepareTools({
1511
1522
  break;
1512
1523
  }
1513
1524
  case "anthropic.web_search_20250305": {
1514
- const args = await (0, import_provider_utils9.validateTypes)({
1525
+ const args = await validateTypes({
1515
1526
  value: tool.args,
1516
1527
  schema: webSearch_20250305ArgsSchema
1517
1528
  });
@@ -1528,7 +1539,7 @@ async function prepareTools({
1528
1539
  }
1529
1540
  case "anthropic.web_search_20260209": {
1530
1541
  betas.add("code-execution-web-tools-2026-02-09");
1531
- const args = await (0, import_provider_utils9.validateTypes)({
1542
+ const args = await validateTypes({
1532
1543
  value: tool.args,
1533
1544
  schema: webSearch_20260209ArgsSchema
1534
1545
  });
@@ -1621,7 +1632,7 @@ async function prepareTools({
1621
1632
  };
1622
1633
  default: {
1623
1634
  const _exhaustiveCheck = type;
1624
- throw new import_provider.UnsupportedFunctionalityError({
1635
+ throw new UnsupportedFunctionalityError({
1625
1636
  functionality: `tool choice type: ${_exhaustiveCheck}`
1626
1637
  });
1627
1638
  }
@@ -1669,36 +1680,50 @@ function convertAnthropicMessagesUsage({
1669
1680
  }
1670
1681
 
1671
1682
  // src/convert-to-anthropic-messages-prompt.ts
1672
- var import_provider2 = require("@ai-sdk/provider");
1673
- var import_provider_utils14 = require("@ai-sdk/provider-utils");
1683
+ import {
1684
+ UnsupportedFunctionalityError as UnsupportedFunctionalityError2
1685
+ } from "@ai-sdk/provider";
1686
+ import {
1687
+ convertBase64ToUint8Array,
1688
+ convertToBase64,
1689
+ isProviderReference,
1690
+ parseProviderOptions,
1691
+ resolveProviderReference,
1692
+ validateTypes as validateTypes2,
1693
+ isNonNullable
1694
+ } from "@ai-sdk/provider-utils";
1674
1695
 
1675
1696
  // src/tool/code-execution_20250522.ts
1676
- var import_provider_utils10 = require("@ai-sdk/provider-utils");
1677
- var import_v49 = require("zod/v4");
1678
- var codeExecution_20250522OutputSchema = (0, import_provider_utils10.lazySchema)(
1679
- () => (0, import_provider_utils10.zodSchema)(
1680
- import_v49.z.object({
1681
- type: import_v49.z.literal("code_execution_result"),
1682
- stdout: import_v49.z.string(),
1683
- stderr: import_v49.z.string(),
1684
- return_code: import_v49.z.number(),
1685
- content: import_v49.z.array(
1686
- import_v49.z.object({
1687
- type: import_v49.z.literal("code_execution_output"),
1688
- file_id: import_v49.z.string()
1697
+ import {
1698
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
1699
+ lazySchema as lazySchema8,
1700
+ zodSchema as zodSchema8
1701
+ } from "@ai-sdk/provider-utils";
1702
+ import { z as z9 } from "zod/v4";
1703
+ var codeExecution_20250522OutputSchema = lazySchema8(
1704
+ () => zodSchema8(
1705
+ z9.object({
1706
+ type: z9.literal("code_execution_result"),
1707
+ stdout: z9.string(),
1708
+ stderr: z9.string(),
1709
+ return_code: z9.number(),
1710
+ content: z9.array(
1711
+ z9.object({
1712
+ type: z9.literal("code_execution_output"),
1713
+ file_id: z9.string()
1689
1714
  })
1690
1715
  ).optional().default([])
1691
1716
  })
1692
1717
  )
1693
1718
  );
1694
- var codeExecution_20250522InputSchema = (0, import_provider_utils10.lazySchema)(
1695
- () => (0, import_provider_utils10.zodSchema)(
1696
- import_v49.z.object({
1697
- code: import_v49.z.string()
1719
+ var codeExecution_20250522InputSchema = lazySchema8(
1720
+ () => zodSchema8(
1721
+ z9.object({
1722
+ code: z9.string()
1698
1723
  })
1699
1724
  )
1700
1725
  );
1701
- var factory6 = (0, import_provider_utils10.createProviderToolFactoryWithOutputSchema)({
1726
+ var factory6 = createProviderToolFactoryWithOutputSchema5({
1702
1727
  id: "anthropic.code_execution_20250522",
1703
1728
  inputSchema: codeExecution_20250522InputSchema,
1704
1729
  outputSchema: codeExecution_20250522OutputSchema
@@ -1708,102 +1733,106 @@ var codeExecution_20250522 = (args = {}) => {
1708
1733
  };
1709
1734
 
1710
1735
  // src/tool/code-execution_20250825.ts
1711
- var import_provider_utils11 = require("@ai-sdk/provider-utils");
1712
- var import_v410 = require("zod/v4");
1713
- var codeExecution_20250825OutputSchema = (0, import_provider_utils11.lazySchema)(
1714
- () => (0, import_provider_utils11.zodSchema)(
1715
- import_v410.z.discriminatedUnion("type", [
1716
- import_v410.z.object({
1717
- type: import_v410.z.literal("code_execution_result"),
1718
- stdout: import_v410.z.string(),
1719
- stderr: import_v410.z.string(),
1720
- return_code: import_v410.z.number(),
1721
- content: import_v410.z.array(
1722
- import_v410.z.object({
1723
- type: import_v410.z.literal("code_execution_output"),
1724
- file_id: import_v410.z.string()
1736
+ import {
1737
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
1738
+ lazySchema as lazySchema9,
1739
+ zodSchema as zodSchema9
1740
+ } from "@ai-sdk/provider-utils";
1741
+ import { z as z10 } from "zod/v4";
1742
+ var codeExecution_20250825OutputSchema = lazySchema9(
1743
+ () => zodSchema9(
1744
+ z10.discriminatedUnion("type", [
1745
+ z10.object({
1746
+ type: z10.literal("code_execution_result"),
1747
+ stdout: z10.string(),
1748
+ stderr: z10.string(),
1749
+ return_code: z10.number(),
1750
+ content: z10.array(
1751
+ z10.object({
1752
+ type: z10.literal("code_execution_output"),
1753
+ file_id: z10.string()
1725
1754
  })
1726
1755
  ).optional().default([])
1727
1756
  }),
1728
- import_v410.z.object({
1729
- type: import_v410.z.literal("bash_code_execution_result"),
1730
- content: import_v410.z.array(
1731
- import_v410.z.object({
1732
- type: import_v410.z.literal("bash_code_execution_output"),
1733
- file_id: import_v410.z.string()
1757
+ z10.object({
1758
+ type: z10.literal("bash_code_execution_result"),
1759
+ content: z10.array(
1760
+ z10.object({
1761
+ type: z10.literal("bash_code_execution_output"),
1762
+ file_id: z10.string()
1734
1763
  })
1735
1764
  ),
1736
- stdout: import_v410.z.string(),
1737
- stderr: import_v410.z.string(),
1738
- return_code: import_v410.z.number()
1765
+ stdout: z10.string(),
1766
+ stderr: z10.string(),
1767
+ return_code: z10.number()
1739
1768
  }),
1740
- import_v410.z.object({
1741
- type: import_v410.z.literal("bash_code_execution_tool_result_error"),
1742
- error_code: import_v410.z.string()
1769
+ z10.object({
1770
+ type: z10.literal("bash_code_execution_tool_result_error"),
1771
+ error_code: z10.string()
1743
1772
  }),
1744
- import_v410.z.object({
1745
- type: import_v410.z.literal("text_editor_code_execution_tool_result_error"),
1746
- error_code: import_v410.z.string()
1773
+ z10.object({
1774
+ type: z10.literal("text_editor_code_execution_tool_result_error"),
1775
+ error_code: z10.string()
1747
1776
  }),
1748
- import_v410.z.object({
1749
- type: import_v410.z.literal("text_editor_code_execution_view_result"),
1750
- content: import_v410.z.string(),
1751
- file_type: import_v410.z.string(),
1752
- num_lines: import_v410.z.number().nullable(),
1753
- start_line: import_v410.z.number().nullable(),
1754
- total_lines: import_v410.z.number().nullable()
1777
+ z10.object({
1778
+ type: z10.literal("text_editor_code_execution_view_result"),
1779
+ content: z10.string(),
1780
+ file_type: z10.string(),
1781
+ num_lines: z10.number().nullable(),
1782
+ start_line: z10.number().nullable(),
1783
+ total_lines: z10.number().nullable()
1755
1784
  }),
1756
- import_v410.z.object({
1757
- type: import_v410.z.literal("text_editor_code_execution_create_result"),
1758
- is_file_update: import_v410.z.boolean()
1785
+ z10.object({
1786
+ type: z10.literal("text_editor_code_execution_create_result"),
1787
+ is_file_update: z10.boolean()
1759
1788
  }),
1760
- import_v410.z.object({
1761
- type: import_v410.z.literal("text_editor_code_execution_str_replace_result"),
1762
- lines: import_v410.z.array(import_v410.z.string()).nullable(),
1763
- new_lines: import_v410.z.number().nullable(),
1764
- new_start: import_v410.z.number().nullable(),
1765
- old_lines: import_v410.z.number().nullable(),
1766
- old_start: import_v410.z.number().nullable()
1789
+ z10.object({
1790
+ type: z10.literal("text_editor_code_execution_str_replace_result"),
1791
+ lines: z10.array(z10.string()).nullable(),
1792
+ new_lines: z10.number().nullable(),
1793
+ new_start: z10.number().nullable(),
1794
+ old_lines: z10.number().nullable(),
1795
+ old_start: z10.number().nullable()
1767
1796
  })
1768
1797
  ])
1769
1798
  )
1770
1799
  );
1771
- var codeExecution_20250825InputSchema = (0, import_provider_utils11.lazySchema)(
1772
- () => (0, import_provider_utils11.zodSchema)(
1773
- import_v410.z.discriminatedUnion("type", [
1800
+ var codeExecution_20250825InputSchema = lazySchema9(
1801
+ () => zodSchema9(
1802
+ z10.discriminatedUnion("type", [
1774
1803
  // Programmatic tool calling format (mapped from { code } by AI SDK)
1775
- import_v410.z.object({
1776
- type: import_v410.z.literal("programmatic-tool-call"),
1777
- code: import_v410.z.string()
1804
+ z10.object({
1805
+ type: z10.literal("programmatic-tool-call"),
1806
+ code: z10.string()
1778
1807
  }),
1779
- import_v410.z.object({
1780
- type: import_v410.z.literal("bash_code_execution"),
1781
- command: import_v410.z.string()
1808
+ z10.object({
1809
+ type: z10.literal("bash_code_execution"),
1810
+ command: z10.string()
1782
1811
  }),
1783
- import_v410.z.discriminatedUnion("command", [
1784
- import_v410.z.object({
1785
- type: import_v410.z.literal("text_editor_code_execution"),
1786
- command: import_v410.z.literal("view"),
1787
- path: import_v410.z.string()
1812
+ z10.discriminatedUnion("command", [
1813
+ z10.object({
1814
+ type: z10.literal("text_editor_code_execution"),
1815
+ command: z10.literal("view"),
1816
+ path: z10.string()
1788
1817
  }),
1789
- import_v410.z.object({
1790
- type: import_v410.z.literal("text_editor_code_execution"),
1791
- command: import_v410.z.literal("create"),
1792
- path: import_v410.z.string(),
1793
- file_text: import_v410.z.string().nullish()
1818
+ z10.object({
1819
+ type: z10.literal("text_editor_code_execution"),
1820
+ command: z10.literal("create"),
1821
+ path: z10.string(),
1822
+ file_text: z10.string().nullish()
1794
1823
  }),
1795
- import_v410.z.object({
1796
- type: import_v410.z.literal("text_editor_code_execution"),
1797
- command: import_v410.z.literal("str_replace"),
1798
- path: import_v410.z.string(),
1799
- old_str: import_v410.z.string(),
1800
- new_str: import_v410.z.string()
1824
+ z10.object({
1825
+ type: z10.literal("text_editor_code_execution"),
1826
+ command: z10.literal("str_replace"),
1827
+ path: z10.string(),
1828
+ old_str: z10.string(),
1829
+ new_str: z10.string()
1801
1830
  })
1802
1831
  ])
1803
1832
  ])
1804
1833
  )
1805
1834
  );
1806
- var factory7 = (0, import_provider_utils11.createProviderToolFactoryWithOutputSchema)({
1835
+ var factory7 = createProviderToolFactoryWithOutputSchema6({
1807
1836
  id: "anthropic.code_execution_20250825",
1808
1837
  inputSchema: codeExecution_20250825InputSchema,
1809
1838
  outputSchema: codeExecution_20250825OutputSchema,
@@ -1817,113 +1846,117 @@ var codeExecution_20250825 = (args = {}) => {
1817
1846
  };
1818
1847
 
1819
1848
  // src/tool/code-execution_20260120.ts
1820
- var import_provider_utils12 = require("@ai-sdk/provider-utils");
1821
- var import_v411 = require("zod/v4");
1822
- var codeExecution_20260120OutputSchema = (0, import_provider_utils12.lazySchema)(
1823
- () => (0, import_provider_utils12.zodSchema)(
1824
- import_v411.z.discriminatedUnion("type", [
1825
- import_v411.z.object({
1826
- type: import_v411.z.literal("code_execution_result"),
1827
- stdout: import_v411.z.string(),
1828
- stderr: import_v411.z.string(),
1829
- return_code: import_v411.z.number(),
1830
- content: import_v411.z.array(
1831
- import_v411.z.object({
1832
- type: import_v411.z.literal("code_execution_output"),
1833
- file_id: import_v411.z.string()
1849
+ import {
1850
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,
1851
+ lazySchema as lazySchema10,
1852
+ zodSchema as zodSchema10
1853
+ } from "@ai-sdk/provider-utils";
1854
+ import { z as z11 } from "zod/v4";
1855
+ var codeExecution_20260120OutputSchema = lazySchema10(
1856
+ () => zodSchema10(
1857
+ z11.discriminatedUnion("type", [
1858
+ z11.object({
1859
+ type: z11.literal("code_execution_result"),
1860
+ stdout: z11.string(),
1861
+ stderr: z11.string(),
1862
+ return_code: z11.number(),
1863
+ content: z11.array(
1864
+ z11.object({
1865
+ type: z11.literal("code_execution_output"),
1866
+ file_id: z11.string()
1834
1867
  })
1835
1868
  ).optional().default([])
1836
1869
  }),
1837
- import_v411.z.object({
1838
- type: import_v411.z.literal("encrypted_code_execution_result"),
1839
- encrypted_stdout: import_v411.z.string(),
1840
- stderr: import_v411.z.string(),
1841
- return_code: import_v411.z.number(),
1842
- content: import_v411.z.array(
1843
- import_v411.z.object({
1844
- type: import_v411.z.literal("code_execution_output"),
1845
- file_id: import_v411.z.string()
1870
+ z11.object({
1871
+ type: z11.literal("encrypted_code_execution_result"),
1872
+ encrypted_stdout: z11.string(),
1873
+ stderr: z11.string(),
1874
+ return_code: z11.number(),
1875
+ content: z11.array(
1876
+ z11.object({
1877
+ type: z11.literal("code_execution_output"),
1878
+ file_id: z11.string()
1846
1879
  })
1847
1880
  ).optional().default([])
1848
1881
  }),
1849
- import_v411.z.object({
1850
- type: import_v411.z.literal("bash_code_execution_result"),
1851
- content: import_v411.z.array(
1852
- import_v411.z.object({
1853
- type: import_v411.z.literal("bash_code_execution_output"),
1854
- file_id: import_v411.z.string()
1882
+ z11.object({
1883
+ type: z11.literal("bash_code_execution_result"),
1884
+ content: z11.array(
1885
+ z11.object({
1886
+ type: z11.literal("bash_code_execution_output"),
1887
+ file_id: z11.string()
1855
1888
  })
1856
1889
  ),
1857
- stdout: import_v411.z.string(),
1858
- stderr: import_v411.z.string(),
1859
- return_code: import_v411.z.number()
1890
+ stdout: z11.string(),
1891
+ stderr: z11.string(),
1892
+ return_code: z11.number()
1860
1893
  }),
1861
- import_v411.z.object({
1862
- type: import_v411.z.literal("bash_code_execution_tool_result_error"),
1863
- error_code: import_v411.z.string()
1894
+ z11.object({
1895
+ type: z11.literal("bash_code_execution_tool_result_error"),
1896
+ error_code: z11.string()
1864
1897
  }),
1865
- import_v411.z.object({
1866
- type: import_v411.z.literal("text_editor_code_execution_tool_result_error"),
1867
- error_code: import_v411.z.string()
1898
+ z11.object({
1899
+ type: z11.literal("text_editor_code_execution_tool_result_error"),
1900
+ error_code: z11.string()
1868
1901
  }),
1869
- import_v411.z.object({
1870
- type: import_v411.z.literal("text_editor_code_execution_view_result"),
1871
- content: import_v411.z.string(),
1872
- file_type: import_v411.z.string(),
1873
- num_lines: import_v411.z.number().nullable(),
1874
- start_line: import_v411.z.number().nullable(),
1875
- total_lines: import_v411.z.number().nullable()
1902
+ z11.object({
1903
+ type: z11.literal("text_editor_code_execution_view_result"),
1904
+ content: z11.string(),
1905
+ file_type: z11.string(),
1906
+ num_lines: z11.number().nullable(),
1907
+ start_line: z11.number().nullable(),
1908
+ total_lines: z11.number().nullable()
1876
1909
  }),
1877
- import_v411.z.object({
1878
- type: import_v411.z.literal("text_editor_code_execution_create_result"),
1879
- is_file_update: import_v411.z.boolean()
1910
+ z11.object({
1911
+ type: z11.literal("text_editor_code_execution_create_result"),
1912
+ is_file_update: z11.boolean()
1880
1913
  }),
1881
- import_v411.z.object({
1882
- type: import_v411.z.literal("text_editor_code_execution_str_replace_result"),
1883
- lines: import_v411.z.array(import_v411.z.string()).nullable(),
1884
- new_lines: import_v411.z.number().nullable(),
1885
- new_start: import_v411.z.number().nullable(),
1886
- old_lines: import_v411.z.number().nullable(),
1887
- old_start: import_v411.z.number().nullable()
1914
+ z11.object({
1915
+ type: z11.literal("text_editor_code_execution_str_replace_result"),
1916
+ lines: z11.array(z11.string()).nullable(),
1917
+ new_lines: z11.number().nullable(),
1918
+ new_start: z11.number().nullable(),
1919
+ old_lines: z11.number().nullable(),
1920
+ old_start: z11.number().nullable()
1888
1921
  })
1889
1922
  ])
1890
1923
  )
1891
1924
  );
1892
- var codeExecution_20260120InputSchema = (0, import_provider_utils12.lazySchema)(
1893
- () => (0, import_provider_utils12.zodSchema)(
1894
- import_v411.z.discriminatedUnion("type", [
1895
- import_v411.z.object({
1896
- type: import_v411.z.literal("programmatic-tool-call"),
1897
- code: import_v411.z.string()
1925
+ var codeExecution_20260120InputSchema = lazySchema10(
1926
+ () => zodSchema10(
1927
+ z11.discriminatedUnion("type", [
1928
+ z11.object({
1929
+ type: z11.literal("programmatic-tool-call"),
1930
+ code: z11.string()
1898
1931
  }),
1899
- import_v411.z.object({
1900
- type: import_v411.z.literal("bash_code_execution"),
1901
- command: import_v411.z.string()
1932
+ z11.object({
1933
+ type: z11.literal("bash_code_execution"),
1934
+ command: z11.string()
1902
1935
  }),
1903
- import_v411.z.discriminatedUnion("command", [
1904
- import_v411.z.object({
1905
- type: import_v411.z.literal("text_editor_code_execution"),
1906
- command: import_v411.z.literal("view"),
1907
- path: import_v411.z.string()
1936
+ z11.discriminatedUnion("command", [
1937
+ z11.object({
1938
+ type: z11.literal("text_editor_code_execution"),
1939
+ command: z11.literal("view"),
1940
+ path: z11.string()
1908
1941
  }),
1909
- import_v411.z.object({
1910
- type: import_v411.z.literal("text_editor_code_execution"),
1911
- command: import_v411.z.literal("create"),
1912
- path: import_v411.z.string(),
1913
- file_text: import_v411.z.string().nullish()
1942
+ z11.object({
1943
+ type: z11.literal("text_editor_code_execution"),
1944
+ command: z11.literal("create"),
1945
+ path: z11.string(),
1946
+ file_text: z11.string().nullish()
1914
1947
  }),
1915
- import_v411.z.object({
1916
- type: import_v411.z.literal("text_editor_code_execution"),
1917
- command: import_v411.z.literal("str_replace"),
1918
- path: import_v411.z.string(),
1919
- old_str: import_v411.z.string(),
1920
- new_str: import_v411.z.string()
1948
+ z11.object({
1949
+ type: z11.literal("text_editor_code_execution"),
1950
+ command: z11.literal("str_replace"),
1951
+ path: z11.string(),
1952
+ old_str: z11.string(),
1953
+ new_str: z11.string()
1921
1954
  })
1922
1955
  ])
1923
1956
  ])
1924
1957
  )
1925
1958
  );
1926
- var factory8 = (0, import_provider_utils12.createProviderToolFactoryWithOutputSchema)({
1959
+ var factory8 = createProviderToolFactoryWithOutputSchema7({
1927
1960
  id: "anthropic.code_execution_20260120",
1928
1961
  inputSchema: codeExecution_20260120InputSchema,
1929
1962
  outputSchema: codeExecution_20260120OutputSchema,
@@ -1934,21 +1967,25 @@ var codeExecution_20260120 = (args = {}) => {
1934
1967
  };
1935
1968
 
1936
1969
  // src/tool/tool-search-regex_20251119.ts
1937
- var import_provider_utils13 = require("@ai-sdk/provider-utils");
1938
- var import_v412 = require("zod/v4");
1939
- var toolSearchRegex_20251119OutputSchema = (0, import_provider_utils13.lazySchema)(
1940
- () => (0, import_provider_utils13.zodSchema)(
1941
- import_v412.z.array(
1942
- import_v412.z.object({
1943
- type: import_v412.z.literal("tool_reference"),
1944
- toolName: import_v412.z.string()
1970
+ import {
1971
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
1972
+ lazySchema as lazySchema11,
1973
+ zodSchema as zodSchema11
1974
+ } from "@ai-sdk/provider-utils";
1975
+ import { z as z12 } from "zod/v4";
1976
+ var toolSearchRegex_20251119OutputSchema = lazySchema11(
1977
+ () => zodSchema11(
1978
+ z12.array(
1979
+ z12.object({
1980
+ type: z12.literal("tool_reference"),
1981
+ toolName: z12.string()
1945
1982
  })
1946
1983
  )
1947
1984
  )
1948
1985
  );
1949
- var toolSearchRegex_20251119InputSchema = (0, import_provider_utils13.lazySchema)(
1950
- () => (0, import_provider_utils13.zodSchema)(
1951
- import_v412.z.object({
1986
+ var toolSearchRegex_20251119InputSchema = lazySchema11(
1987
+ () => zodSchema11(
1988
+ z12.object({
1952
1989
  /**
1953
1990
  * A regex pattern to search for tools.
1954
1991
  * Uses Python re.search() syntax. Maximum 200 characters.
@@ -1959,15 +1996,15 @@ var toolSearchRegex_20251119InputSchema = (0, import_provider_utils13.lazySchema
1959
1996
  * - "database.*query|query.*database" - OR patterns for flexibility
1960
1997
  * - "(?i)slack" - case-insensitive search
1961
1998
  */
1962
- pattern: import_v412.z.string(),
1999
+ pattern: z12.string(),
1963
2000
  /**
1964
2001
  * Maximum number of tools to return. Optional.
1965
2002
  */
1966
- limit: import_v412.z.number().optional()
2003
+ limit: z12.number().optional()
1967
2004
  })
1968
2005
  )
1969
2006
  );
1970
- var factory9 = (0, import_provider_utils13.createProviderToolFactoryWithOutputSchema)({
2007
+ var factory9 = createProviderToolFactoryWithOutputSchema8({
1971
2008
  id: "anthropic.tool_search_regex_20251119",
1972
2009
  inputSchema: toolSearchRegex_20251119InputSchema,
1973
2010
  outputSchema: toolSearchRegex_20251119OutputSchema,
@@ -1980,17 +2017,17 @@ var toolSearchRegex_20251119 = (args = {}) => {
1980
2017
  // src/convert-to-anthropic-messages-prompt.ts
1981
2018
  function convertToString(data) {
1982
2019
  if (typeof data === "string") {
1983
- return new TextDecoder().decode((0, import_provider_utils14.convertBase64ToUint8Array)(data));
2020
+ return new TextDecoder().decode(convertBase64ToUint8Array(data));
1984
2021
  }
1985
2022
  if (data instanceof Uint8Array) {
1986
2023
  return new TextDecoder().decode(data);
1987
2024
  }
1988
2025
  if (data instanceof URL) {
1989
- throw new import_provider2.UnsupportedFunctionalityError({
2026
+ throw new UnsupportedFunctionalityError2({
1990
2027
  functionality: "URL-based text documents are not supported for citations"
1991
2028
  });
1992
2029
  }
1993
- throw new import_provider2.UnsupportedFunctionalityError({
2030
+ throw new UnsupportedFunctionalityError2({
1994
2031
  functionality: `unsupported data type for text documents: ${typeof data}`
1995
2032
  });
1996
2033
  }
@@ -2018,7 +2055,7 @@ async function convertToAnthropicMessagesPrompt({
2018
2055
  const messages = [];
2019
2056
  async function shouldEnableCitations(providerMetadata) {
2020
2057
  var _a2, _b2;
2021
- const anthropicOptions = await (0, import_provider_utils14.parseProviderOptions)({
2058
+ const anthropicOptions = await parseProviderOptions({
2022
2059
  provider: "anthropic",
2023
2060
  providerOptions: providerMetadata,
2024
2061
  schema: anthropicFilePartProviderOptions
@@ -2026,7 +2063,7 @@ async function convertToAnthropicMessagesPrompt({
2026
2063
  return (_b2 = (_a2 = anthropicOptions == null ? void 0 : anthropicOptions.citations) == null ? void 0 : _a2.enabled) != null ? _b2 : false;
2027
2064
  }
2028
2065
  async function getDocumentMetadata(providerMetadata) {
2029
- const anthropicOptions = await (0, import_provider_utils14.parseProviderOptions)({
2066
+ const anthropicOptions = await parseProviderOptions({
2030
2067
  provider: "anthropic",
2031
2068
  providerOptions: providerMetadata,
2032
2069
  schema: anthropicFilePartProviderOptions
@@ -2043,7 +2080,7 @@ async function convertToAnthropicMessagesPrompt({
2043
2080
  switch (type) {
2044
2081
  case "system": {
2045
2082
  if (system != null) {
2046
- throw new import_provider2.UnsupportedFunctionalityError({
2083
+ throw new UnsupportedFunctionalityError2({
2047
2084
  functionality: "Multiple system messages that are separated by user/assistant messages"
2048
2085
  });
2049
2086
  }
@@ -2083,8 +2120,8 @@ async function convertToAnthropicMessagesPrompt({
2083
2120
  break;
2084
2121
  }
2085
2122
  case "file": {
2086
- if ((0, import_provider_utils14.isProviderReference)(part.data)) {
2087
- const fileId = (0, import_provider_utils14.resolveProviderReference)({
2123
+ if (isProviderReference(part.data)) {
2124
+ const fileId = resolveProviderReference({
2088
2125
  reference: part.data,
2089
2126
  provider: "anthropic"
2090
2127
  });
@@ -2111,7 +2148,7 @@ async function convertToAnthropicMessagesPrompt({
2111
2148
  } : {
2112
2149
  type: "base64",
2113
2150
  media_type: part.mediaType === "image/*" ? "image/jpeg" : part.mediaType,
2114
- data: (0, import_provider_utils14.convertToBase64)(part.data)
2151
+ data: convertToBase64(part.data)
2115
2152
  },
2116
2153
  cache_control: cacheControl
2117
2154
  });
@@ -2131,7 +2168,7 @@ async function convertToAnthropicMessagesPrompt({
2131
2168
  } : {
2132
2169
  type: "base64",
2133
2170
  media_type: "application/pdf",
2134
- data: (0, import_provider_utils14.convertToBase64)(part.data)
2171
+ data: convertToBase64(part.data)
2135
2172
  },
2136
2173
  title: (_b = metadata.title) != null ? _b : part.filename,
2137
2174
  ...metadata.context && { context: metadata.context },
@@ -2165,7 +2202,7 @@ async function convertToAnthropicMessagesPrompt({
2165
2202
  cache_control: cacheControl
2166
2203
  });
2167
2204
  } else {
2168
- throw new import_provider2.UnsupportedFunctionalityError({
2205
+ throw new UnsupportedFunctionalityError2({
2169
2206
  functionality: `media type: ${part.mediaType}`
2170
2207
  });
2171
2208
  }
@@ -2201,26 +2238,16 @@ async function convertToAnthropicMessagesPrompt({
2201
2238
  type: "text",
2202
2239
  text: contentPart.text
2203
2240
  };
2204
- case "image-data": {
2205
- return {
2206
- type: "image",
2207
- source: {
2208
- type: "base64",
2209
- media_type: contentPart.mediaType,
2210
- data: contentPart.data
2211
- }
2212
- };
2213
- }
2214
- case "image-url": {
2215
- return {
2216
- type: "image",
2217
- source: {
2218
- type: "url",
2219
- url: contentPart.url
2220
- }
2221
- };
2222
- }
2223
2241
  case "file-url": {
2242
+ if (contentPart.mediaType.startsWith("image/")) {
2243
+ return {
2244
+ type: "image",
2245
+ source: {
2246
+ type: "url",
2247
+ url: contentPart.url
2248
+ }
2249
+ };
2250
+ }
2224
2251
  return {
2225
2252
  type: "document",
2226
2253
  source: {
@@ -2230,6 +2257,16 @@ async function convertToAnthropicMessagesPrompt({
2230
2257
  };
2231
2258
  }
2232
2259
  case "file-data": {
2260
+ if (contentPart.mediaType.startsWith("image/")) {
2261
+ return {
2262
+ type: "image",
2263
+ source: {
2264
+ type: "base64",
2265
+ media_type: contentPart.mediaType,
2266
+ data: contentPart.data
2267
+ }
2268
+ };
2269
+ }
2233
2270
  if (contentPart.mediaType === "application/pdf") {
2234
2271
  betas.add("pdfs-2024-09-25");
2235
2272
  return {
@@ -2269,7 +2306,7 @@ async function convertToAnthropicMessagesPrompt({
2269
2306
  return void 0;
2270
2307
  }
2271
2308
  }
2272
- }).filter(import_provider_utils14.isNonNullable);
2309
+ }).filter(isNonNullable);
2273
2310
  break;
2274
2311
  case "text":
2275
2312
  case "error-text":
@@ -2345,7 +2382,7 @@ async function convertToAnthropicMessagesPrompt({
2345
2382
  }
2346
2383
  case "reasoning": {
2347
2384
  if (sendReasoning) {
2348
- const reasoningMetadata = await (0, import_provider_utils14.parseProviderOptions)({
2385
+ const reasoningMetadata = await parseProviderOptions({
2349
2386
  provider: "anthropic",
2350
2387
  providerOptions: part.providerOptions,
2351
2388
  schema: anthropicReasoningMetadataSchema
@@ -2551,7 +2588,7 @@ async function convertToAnthropicMessagesPrompt({
2551
2588
  break;
2552
2589
  }
2553
2590
  if (output.value.type === "code_execution_result") {
2554
- const codeExecutionOutput = await (0, import_provider_utils14.validateTypes)({
2591
+ const codeExecutionOutput = await validateTypes2({
2555
2592
  value: output.value,
2556
2593
  schema: codeExecution_20250522OutputSchema
2557
2594
  });
@@ -2568,7 +2605,7 @@ async function convertToAnthropicMessagesPrompt({
2568
2605
  cache_control: cacheControl
2569
2606
  });
2570
2607
  } else if (output.value.type === "encrypted_code_execution_result") {
2571
- const codeExecutionOutput = await (0, import_provider_utils14.validateTypes)({
2608
+ const codeExecutionOutput = await validateTypes2({
2572
2609
  value: output.value,
2573
2610
  schema: codeExecution_20260120OutputSchema
2574
2611
  });
@@ -2587,7 +2624,7 @@ async function convertToAnthropicMessagesPrompt({
2587
2624
  });
2588
2625
  }
2589
2626
  } else {
2590
- const codeExecutionOutput = await (0, import_provider_utils14.validateTypes)({
2627
+ const codeExecutionOutput = await validateTypes2({
2591
2628
  value: output.value,
2592
2629
  schema: codeExecution_20250825OutputSchema
2593
2630
  });
@@ -2656,7 +2693,7 @@ async function convertToAnthropicMessagesPrompt({
2656
2693
  });
2657
2694
  break;
2658
2695
  }
2659
- const webFetchOutput = await (0, import_provider_utils14.validateTypes)({
2696
+ const webFetchOutput = await validateTypes2({
2660
2697
  value: output.value,
2661
2698
  schema: webFetch_20250910OutputSchema
2662
2699
  });
@@ -2691,7 +2728,7 @@ async function convertToAnthropicMessagesPrompt({
2691
2728
  });
2692
2729
  break;
2693
2730
  }
2694
- const webSearchOutput = await (0, import_provider_utils14.validateTypes)({
2731
+ const webSearchOutput = await validateTypes2({
2695
2732
  value: output.value,
2696
2733
  schema: webSearch_20250305OutputSchema
2697
2734
  });
@@ -2718,7 +2755,7 @@ async function convertToAnthropicMessagesPrompt({
2718
2755
  });
2719
2756
  break;
2720
2757
  }
2721
- const toolSearchOutput = await (0, import_provider_utils14.validateTypes)({
2758
+ const toolSearchOutput = await validateTypes2({
2722
2759
  value: output.value,
2723
2760
  schema: toolSearchRegex_20251119OutputSchema
2724
2761
  });
@@ -2876,13 +2913,22 @@ function createCitationSource(citation, citationDocuments, generateId2) {
2876
2913
  }
2877
2914
  };
2878
2915
  }
2879
- var AnthropicMessagesLanguageModel = class {
2916
+ var AnthropicMessagesLanguageModel = class _AnthropicMessagesLanguageModel {
2880
2917
  constructor(modelId, config) {
2881
2918
  this.specificationVersion = "v4";
2882
2919
  var _a;
2883
2920
  this.modelId = modelId;
2884
2921
  this.config = config;
2885
- this.generateId = (_a = config.generateId) != null ? _a : import_provider_utils15.generateId;
2922
+ this.generateId = (_a = config.generateId) != null ? _a : generateId;
2923
+ }
2924
+ static [WORKFLOW_SERIALIZE](model) {
2925
+ return serializeModelOptions({
2926
+ modelId: model.modelId,
2927
+ config: model.config
2928
+ });
2929
+ }
2930
+ static [WORKFLOW_DESERIALIZE](options) {
2931
+ return new _AnthropicMessagesLanguageModel(options.modelId, options.config);
2886
2932
  }
2887
2933
  supportsUrl(url) {
2888
2934
  return url.protocol === "https:";
@@ -2957,12 +3003,12 @@ var AnthropicMessagesLanguageModel = class {
2957
3003
  }
2958
3004
  }
2959
3005
  const providerOptionsName = this.providerOptionsName;
2960
- const canonicalOptions = await (0, import_provider_utils15.parseProviderOptions)({
3006
+ const canonicalOptions = await parseProviderOptions2({
2961
3007
  provider: "anthropic",
2962
3008
  providerOptions,
2963
3009
  schema: anthropicLanguageModelOptions
2964
3010
  });
2965
- const customProviderOptions = providerOptionsName !== "anthropic" ? await (0, import_provider_utils15.parseProviderOptions)({
3011
+ const customProviderOptions = providerOptionsName !== "anthropic" ? await parseProviderOptions2({
2966
3012
  provider: providerOptionsName,
2967
3013
  providerOptions,
2968
3014
  schema: anthropicLanguageModelOptions
@@ -2992,7 +3038,7 @@ var AnthropicMessagesLanguageModel = class {
2992
3038
  } : void 0;
2993
3039
  const contextManagement = anthropicOptions == null ? void 0 : anthropicOptions.contextManagement;
2994
3040
  const cacheControlValidator = new CacheControlValidator();
2995
- const toolNameMapping = (0, import_provider_utils15.createToolNameMapping)({
3041
+ const toolNameMapping = createToolNameMapping({
2996
3042
  tools,
2997
3043
  providerToolNames: {
2998
3044
  "anthropic.code_execution_20250522": "code_execution",
@@ -3022,7 +3068,7 @@ var AnthropicMessagesLanguageModel = class {
3022
3068
  cacheControlValidator,
3023
3069
  toolNameMapping
3024
3070
  });
3025
- if ((0, import_provider_utils15.isCustomReasoning)(reasoning) && (anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null && (anthropicOptions == null ? void 0 : anthropicOptions.effort) == null) {
3071
+ if (isCustomReasoning(reasoning) && (anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null && (anthropicOptions == null ? void 0 : anthropicOptions.effort) == null) {
3026
3072
  const reasoningConfig = resolveAnthropicReasoningConfig({
3027
3073
  reasoning,
3028
3074
  supportsAdaptiveThinking,
@@ -3102,7 +3148,7 @@ var AnthropicMessagesLanguageModel = class {
3102
3148
  id: anthropicOptions.container.id,
3103
3149
  skills: anthropicOptions.container.skills.map((skill) => ({
3104
3150
  type: skill.type,
3105
- skill_id: skill.type === "custom" ? (0, import_provider_utils15.resolveProviderReference)({
3151
+ skill_id: skill.type === "custom" ? resolveProviderReference2({
3106
3152
  reference: skill.providerReference,
3107
3153
  provider: "anthropic"
3108
3154
  }) : skill.skillId,
@@ -3305,16 +3351,16 @@ var AnthropicMessagesLanguageModel = class {
3305
3351
  betas,
3306
3352
  headers
3307
3353
  }) {
3308
- return (0, import_provider_utils15.combineHeaders)(
3309
- await (0, import_provider_utils15.resolve)(this.config.headers),
3354
+ return combineHeaders(
3355
+ this.config.headers ? await resolve(this.config.headers) : void 0,
3310
3356
  headers,
3311
3357
  betas.size > 0 ? { "anthropic-beta": Array.from(betas).join(",") } : {}
3312
3358
  );
3313
3359
  }
3314
3360
  async getBetasFromHeaders(requestHeaders) {
3315
3361
  var _a, _b;
3316
- const configHeaders = await (0, import_provider_utils15.resolve)(this.config.headers);
3317
- const configBetaHeader = (_a = configHeaders["anthropic-beta"]) != null ? _a : "";
3362
+ const configHeaders = this.config.headers ? await resolve(this.config.headers) : void 0;
3363
+ const configBetaHeader = (_a = configHeaders == null ? void 0 : configHeaders["anthropic-beta"]) != null ? _a : "";
3318
3364
  const requestBetaHeader = (_b = requestHeaders == null ? void 0 : requestHeaders["anthropic-beta"]) != null ? _b : "";
3319
3365
  return new Set(
3320
3366
  [
@@ -3379,12 +3425,12 @@ var AnthropicMessagesLanguageModel = class {
3379
3425
  responseHeaders,
3380
3426
  value: response,
3381
3427
  rawValue: rawResponse
3382
- } = await (0, import_provider_utils15.postJsonToApi)({
3428
+ } = await postJsonToApi({
3383
3429
  url: this.buildRequestUrl(false),
3384
3430
  headers: await this.getHeaders({ betas, headers: options.headers }),
3385
3431
  body: this.transformRequestBody(args, betas),
3386
3432
  failedResponseHandler: anthropicFailedResponseHandler,
3387
- successfulResponseHandler: (0, import_provider_utils15.createJsonResponseHandler)(
3433
+ successfulResponseHandler: createJsonResponseHandler(
3388
3434
  anthropicMessagesResponseSchema
3389
3435
  ),
3390
3436
  abortSignal: options.abortSignal,
@@ -3778,6 +3824,7 @@ var AnthropicMessagesLanguageModel = class {
3778
3824
  };
3779
3825
  }
3780
3826
  async doStream(options) {
3827
+ "use step";
3781
3828
  var _a, _b;
3782
3829
  const {
3783
3830
  args: body,
@@ -3799,12 +3846,12 @@ var AnthropicMessagesLanguageModel = class {
3799
3846
  body.tools
3800
3847
  );
3801
3848
  const url = this.buildRequestUrl(true);
3802
- const { responseHeaders, value: response } = await (0, import_provider_utils15.postJsonToApi)({
3849
+ const { responseHeaders, value: response } = await postJsonToApi({
3803
3850
  url,
3804
3851
  headers: await this.getHeaders({ betas, headers: options.headers }),
3805
3852
  body: this.transformRequestBody(body, betas),
3806
3853
  failedResponseHandler: anthropicFailedResponseHandler,
3807
- successfulResponseHandler: (0, import_provider_utils15.createEventSourceResponseHandler)(
3854
+ successfulResponseHandler: createEventSourceResponseHandler(
3808
3855
  anthropicMessagesChunkSchema
3809
3856
  ),
3810
3857
  abortSignal: options.abortSignal,
@@ -4529,7 +4576,7 @@ var AnthropicMessagesLanguageModel = class {
4529
4576
  }
4530
4577
  if (((_b = result.value) == null ? void 0 : _b.type) === "error") {
4531
4578
  const error = result.value.error;
4532
- throw new import_provider3.APICallError({
4579
+ throw new APICallError({
4533
4580
  message: error.message,
4534
4581
  url,
4535
4582
  requestBodyValues: body,
@@ -4627,14 +4674,14 @@ function resolveAnthropicReasoningConfig({
4627
4674
  maxOutputTokensForModel,
4628
4675
  warnings
4629
4676
  }) {
4630
- if (!(0, import_provider_utils15.isCustomReasoning)(reasoning)) {
4677
+ if (!isCustomReasoning(reasoning)) {
4631
4678
  return void 0;
4632
4679
  }
4633
4680
  if (reasoning === "none") {
4634
4681
  return { thinking: { type: "disabled" } };
4635
4682
  }
4636
4683
  if (supportsAdaptiveThinking) {
4637
- const effort = (0, import_provider_utils15.mapReasoningToProviderEffort)({
4684
+ const effort = mapReasoningToProviderEffort({
4638
4685
  reasoning,
4639
4686
  effortMap: {
4640
4687
  minimal: "low",
@@ -4647,7 +4694,7 @@ function resolveAnthropicReasoningConfig({
4647
4694
  });
4648
4695
  return { thinking: { type: "adaptive" }, effort };
4649
4696
  }
4650
- const budgetTokens = (0, import_provider_utils15.mapReasoningToProviderBudget)({
4697
+ const budgetTokens = mapReasoningToProviderBudget({
4651
4698
  reasoning,
4652
4699
  maxOutputTokens: maxOutputTokensForModel,
4653
4700
  maxReasoningBudget: maxOutputTokensForModel,
@@ -4685,44 +4732,56 @@ function mapAnthropicResponseContextManagement(contextManagement) {
4685
4732
  }
4686
4733
 
4687
4734
  // src/tool/bash_20241022.ts
4688
- var import_provider_utils16 = require("@ai-sdk/provider-utils");
4689
- var import_v413 = require("zod/v4");
4690
- var bash_20241022InputSchema = (0, import_provider_utils16.lazySchema)(
4691
- () => (0, import_provider_utils16.zodSchema)(
4692
- import_v413.z.object({
4693
- command: import_v413.z.string(),
4694
- restart: import_v413.z.boolean().optional()
4735
+ import {
4736
+ createProviderToolFactory as createProviderToolFactory2,
4737
+ lazySchema as lazySchema12,
4738
+ zodSchema as zodSchema12
4739
+ } from "@ai-sdk/provider-utils";
4740
+ import { z as z13 } from "zod/v4";
4741
+ var bash_20241022InputSchema = lazySchema12(
4742
+ () => zodSchema12(
4743
+ z13.object({
4744
+ command: z13.string(),
4745
+ restart: z13.boolean().optional()
4695
4746
  })
4696
4747
  )
4697
4748
  );
4698
- var bash_20241022 = (0, import_provider_utils16.createProviderToolFactory)({
4749
+ var bash_20241022 = createProviderToolFactory2({
4699
4750
  id: "anthropic.bash_20241022",
4700
4751
  inputSchema: bash_20241022InputSchema
4701
4752
  });
4702
4753
 
4703
4754
  // src/tool/bash_20250124.ts
4704
- var import_provider_utils17 = require("@ai-sdk/provider-utils");
4705
- var import_v414 = require("zod/v4");
4706
- var bash_20250124InputSchema = (0, import_provider_utils17.lazySchema)(
4707
- () => (0, import_provider_utils17.zodSchema)(
4708
- import_v414.z.object({
4709
- command: import_v414.z.string(),
4710
- restart: import_v414.z.boolean().optional()
4755
+ import {
4756
+ createProviderToolFactory as createProviderToolFactory3,
4757
+ lazySchema as lazySchema13,
4758
+ zodSchema as zodSchema13
4759
+ } from "@ai-sdk/provider-utils";
4760
+ import { z as z14 } from "zod/v4";
4761
+ var bash_20250124InputSchema = lazySchema13(
4762
+ () => zodSchema13(
4763
+ z14.object({
4764
+ command: z14.string(),
4765
+ restart: z14.boolean().optional()
4711
4766
  })
4712
4767
  )
4713
4768
  );
4714
- var bash_20250124 = (0, import_provider_utils17.createProviderToolFactory)({
4769
+ var bash_20250124 = createProviderToolFactory3({
4715
4770
  id: "anthropic.bash_20250124",
4716
4771
  inputSchema: bash_20250124InputSchema
4717
4772
  });
4718
4773
 
4719
4774
  // src/tool/computer_20241022.ts
4720
- var import_provider_utils18 = require("@ai-sdk/provider-utils");
4721
- var import_v415 = require("zod/v4");
4722
- var computer_20241022InputSchema = (0, import_provider_utils18.lazySchema)(
4723
- () => (0, import_provider_utils18.zodSchema)(
4724
- import_v415.z.object({
4725
- action: import_v415.z.enum([
4775
+ import {
4776
+ createProviderToolFactory as createProviderToolFactory4,
4777
+ lazySchema as lazySchema14,
4778
+ zodSchema as zodSchema14
4779
+ } from "@ai-sdk/provider-utils";
4780
+ import { z as z15 } from "zod/v4";
4781
+ var computer_20241022InputSchema = lazySchema14(
4782
+ () => zodSchema14(
4783
+ z15.object({
4784
+ action: z15.enum([
4726
4785
  "key",
4727
4786
  "type",
4728
4787
  "mouse_move",
@@ -4734,23 +4793,27 @@ var computer_20241022InputSchema = (0, import_provider_utils18.lazySchema)(
4734
4793
  "screenshot",
4735
4794
  "cursor_position"
4736
4795
  ]),
4737
- coordinate: import_v415.z.array(import_v415.z.number().int()).optional(),
4738
- text: import_v415.z.string().optional()
4796
+ coordinate: z15.array(z15.number().int()).optional(),
4797
+ text: z15.string().optional()
4739
4798
  })
4740
4799
  )
4741
4800
  );
4742
- var computer_20241022 = (0, import_provider_utils18.createProviderToolFactory)({
4801
+ var computer_20241022 = createProviderToolFactory4({
4743
4802
  id: "anthropic.computer_20241022",
4744
4803
  inputSchema: computer_20241022InputSchema
4745
4804
  });
4746
4805
 
4747
4806
  // src/tool/computer_20250124.ts
4748
- var import_provider_utils19 = require("@ai-sdk/provider-utils");
4749
- var import_v416 = require("zod/v4");
4750
- var computer_20250124InputSchema = (0, import_provider_utils19.lazySchema)(
4751
- () => (0, import_provider_utils19.zodSchema)(
4752
- import_v416.z.object({
4753
- action: import_v416.z.enum([
4807
+ import {
4808
+ createProviderToolFactory as createProviderToolFactory5,
4809
+ lazySchema as lazySchema15,
4810
+ zodSchema as zodSchema15
4811
+ } from "@ai-sdk/provider-utils";
4812
+ import { z as z16 } from "zod/v4";
4813
+ var computer_20250124InputSchema = lazySchema15(
4814
+ () => zodSchema15(
4815
+ z16.object({
4816
+ action: z16.enum([
4754
4817
  "key",
4755
4818
  "hold_key",
4756
4819
  "type",
@@ -4768,27 +4831,31 @@ var computer_20250124InputSchema = (0, import_provider_utils19.lazySchema)(
4768
4831
  "wait",
4769
4832
  "screenshot"
4770
4833
  ]),
4771
- coordinate: import_v416.z.tuple([import_v416.z.number().int(), import_v416.z.number().int()]).optional(),
4772
- duration: import_v416.z.number().optional(),
4773
- scroll_amount: import_v416.z.number().optional(),
4774
- scroll_direction: import_v416.z.enum(["up", "down", "left", "right"]).optional(),
4775
- start_coordinate: import_v416.z.tuple([import_v416.z.number().int(), import_v416.z.number().int()]).optional(),
4776
- text: import_v416.z.string().optional()
4834
+ coordinate: z16.tuple([z16.number().int(), z16.number().int()]).optional(),
4835
+ duration: z16.number().optional(),
4836
+ scroll_amount: z16.number().optional(),
4837
+ scroll_direction: z16.enum(["up", "down", "left", "right"]).optional(),
4838
+ start_coordinate: z16.tuple([z16.number().int(), z16.number().int()]).optional(),
4839
+ text: z16.string().optional()
4777
4840
  })
4778
4841
  )
4779
4842
  );
4780
- var computer_20250124 = (0, import_provider_utils19.createProviderToolFactory)({
4843
+ var computer_20250124 = createProviderToolFactory5({
4781
4844
  id: "anthropic.computer_20250124",
4782
4845
  inputSchema: computer_20250124InputSchema
4783
4846
  });
4784
4847
 
4785
4848
  // src/tool/computer_20251124.ts
4786
- var import_provider_utils20 = require("@ai-sdk/provider-utils");
4787
- var import_v417 = require("zod/v4");
4788
- var computer_20251124InputSchema = (0, import_provider_utils20.lazySchema)(
4789
- () => (0, import_provider_utils20.zodSchema)(
4790
- import_v417.z.object({
4791
- action: import_v417.z.enum([
4849
+ import {
4850
+ createProviderToolFactory as createProviderToolFactory6,
4851
+ lazySchema as lazySchema16,
4852
+ zodSchema as zodSchema16
4853
+ } from "@ai-sdk/provider-utils";
4854
+ import { z as z17 } from "zod/v4";
4855
+ var computer_20251124InputSchema = lazySchema16(
4856
+ () => zodSchema16(
4857
+ z17.object({
4858
+ action: z17.enum([
4792
4859
  "key",
4793
4860
  "hold_key",
4794
4861
  "type",
@@ -4807,166 +4874,186 @@ var computer_20251124InputSchema = (0, import_provider_utils20.lazySchema)(
4807
4874
  "screenshot",
4808
4875
  "zoom"
4809
4876
  ]),
4810
- coordinate: import_v417.z.tuple([import_v417.z.number().int(), import_v417.z.number().int()]).optional(),
4811
- duration: import_v417.z.number().optional(),
4812
- region: import_v417.z.tuple([
4813
- import_v417.z.number().int(),
4814
- import_v417.z.number().int(),
4815
- import_v417.z.number().int(),
4816
- import_v417.z.number().int()
4877
+ coordinate: z17.tuple([z17.number().int(), z17.number().int()]).optional(),
4878
+ duration: z17.number().optional(),
4879
+ region: z17.tuple([
4880
+ z17.number().int(),
4881
+ z17.number().int(),
4882
+ z17.number().int(),
4883
+ z17.number().int()
4817
4884
  ]).optional(),
4818
- scroll_amount: import_v417.z.number().optional(),
4819
- scroll_direction: import_v417.z.enum(["up", "down", "left", "right"]).optional(),
4820
- start_coordinate: import_v417.z.tuple([import_v417.z.number().int(), import_v417.z.number().int()]).optional(),
4821
- text: import_v417.z.string().optional()
4885
+ scroll_amount: z17.number().optional(),
4886
+ scroll_direction: z17.enum(["up", "down", "left", "right"]).optional(),
4887
+ start_coordinate: z17.tuple([z17.number().int(), z17.number().int()]).optional(),
4888
+ text: z17.string().optional()
4822
4889
  })
4823
4890
  )
4824
4891
  );
4825
- var computer_20251124 = (0, import_provider_utils20.createProviderToolFactory)({
4892
+ var computer_20251124 = createProviderToolFactory6({
4826
4893
  id: "anthropic.computer_20251124",
4827
4894
  inputSchema: computer_20251124InputSchema
4828
4895
  });
4829
4896
 
4830
4897
  // src/tool/memory_20250818.ts
4831
- var import_provider_utils21 = require("@ai-sdk/provider-utils");
4832
- var import_v418 = require("zod/v4");
4833
- var memory_20250818InputSchema = (0, import_provider_utils21.lazySchema)(
4834
- () => (0, import_provider_utils21.zodSchema)(
4835
- import_v418.z.discriminatedUnion("command", [
4836
- import_v418.z.object({
4837
- command: import_v418.z.literal("view"),
4838
- path: import_v418.z.string(),
4839
- view_range: import_v418.z.tuple([import_v418.z.number(), import_v418.z.number()]).optional()
4898
+ import {
4899
+ createProviderToolFactory as createProviderToolFactory7,
4900
+ lazySchema as lazySchema17,
4901
+ zodSchema as zodSchema17
4902
+ } from "@ai-sdk/provider-utils";
4903
+ import { z as z18 } from "zod/v4";
4904
+ var memory_20250818InputSchema = lazySchema17(
4905
+ () => zodSchema17(
4906
+ z18.discriminatedUnion("command", [
4907
+ z18.object({
4908
+ command: z18.literal("view"),
4909
+ path: z18.string(),
4910
+ view_range: z18.tuple([z18.number(), z18.number()]).optional()
4840
4911
  }),
4841
- import_v418.z.object({
4842
- command: import_v418.z.literal("create"),
4843
- path: import_v418.z.string(),
4844
- file_text: import_v418.z.string()
4912
+ z18.object({
4913
+ command: z18.literal("create"),
4914
+ path: z18.string(),
4915
+ file_text: z18.string()
4845
4916
  }),
4846
- import_v418.z.object({
4847
- command: import_v418.z.literal("str_replace"),
4848
- path: import_v418.z.string(),
4849
- old_str: import_v418.z.string(),
4850
- new_str: import_v418.z.string()
4917
+ z18.object({
4918
+ command: z18.literal("str_replace"),
4919
+ path: z18.string(),
4920
+ old_str: z18.string(),
4921
+ new_str: z18.string()
4851
4922
  }),
4852
- import_v418.z.object({
4853
- command: import_v418.z.literal("insert"),
4854
- path: import_v418.z.string(),
4855
- insert_line: import_v418.z.number(),
4856
- insert_text: import_v418.z.string()
4923
+ z18.object({
4924
+ command: z18.literal("insert"),
4925
+ path: z18.string(),
4926
+ insert_line: z18.number(),
4927
+ insert_text: z18.string()
4857
4928
  }),
4858
- import_v418.z.object({
4859
- command: import_v418.z.literal("delete"),
4860
- path: import_v418.z.string()
4929
+ z18.object({
4930
+ command: z18.literal("delete"),
4931
+ path: z18.string()
4861
4932
  }),
4862
- import_v418.z.object({
4863
- command: import_v418.z.literal("rename"),
4864
- old_path: import_v418.z.string(),
4865
- new_path: import_v418.z.string()
4933
+ z18.object({
4934
+ command: z18.literal("rename"),
4935
+ old_path: z18.string(),
4936
+ new_path: z18.string()
4866
4937
  })
4867
4938
  ])
4868
4939
  )
4869
4940
  );
4870
- var memory_20250818 = (0, import_provider_utils21.createProviderToolFactory)({
4941
+ var memory_20250818 = createProviderToolFactory7({
4871
4942
  id: "anthropic.memory_20250818",
4872
4943
  inputSchema: memory_20250818InputSchema
4873
4944
  });
4874
4945
 
4875
4946
  // src/tool/text-editor_20241022.ts
4876
- var import_provider_utils22 = require("@ai-sdk/provider-utils");
4877
- var import_v419 = require("zod/v4");
4878
- var textEditor_20241022InputSchema = (0, import_provider_utils22.lazySchema)(
4879
- () => (0, import_provider_utils22.zodSchema)(
4880
- import_v419.z.object({
4881
- command: import_v419.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
4882
- path: import_v419.z.string(),
4883
- file_text: import_v419.z.string().optional(),
4884
- insert_line: import_v419.z.number().int().optional(),
4885
- new_str: import_v419.z.string().optional(),
4886
- insert_text: import_v419.z.string().optional(),
4887
- old_str: import_v419.z.string().optional(),
4888
- view_range: import_v419.z.array(import_v419.z.number().int()).optional()
4947
+ import {
4948
+ createProviderToolFactory as createProviderToolFactory8,
4949
+ lazySchema as lazySchema18,
4950
+ zodSchema as zodSchema18
4951
+ } from "@ai-sdk/provider-utils";
4952
+ import { z as z19 } from "zod/v4";
4953
+ var textEditor_20241022InputSchema = lazySchema18(
4954
+ () => zodSchema18(
4955
+ z19.object({
4956
+ command: z19.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
4957
+ path: z19.string(),
4958
+ file_text: z19.string().optional(),
4959
+ insert_line: z19.number().int().optional(),
4960
+ new_str: z19.string().optional(),
4961
+ insert_text: z19.string().optional(),
4962
+ old_str: z19.string().optional(),
4963
+ view_range: z19.array(z19.number().int()).optional()
4889
4964
  })
4890
4965
  )
4891
4966
  );
4892
- var textEditor_20241022 = (0, import_provider_utils22.createProviderToolFactory)({
4967
+ var textEditor_20241022 = createProviderToolFactory8({
4893
4968
  id: "anthropic.text_editor_20241022",
4894
4969
  inputSchema: textEditor_20241022InputSchema
4895
4970
  });
4896
4971
 
4897
4972
  // src/tool/text-editor_20250124.ts
4898
- var import_provider_utils23 = require("@ai-sdk/provider-utils");
4899
- var import_v420 = require("zod/v4");
4900
- var textEditor_20250124InputSchema = (0, import_provider_utils23.lazySchema)(
4901
- () => (0, import_provider_utils23.zodSchema)(
4902
- import_v420.z.object({
4903
- command: import_v420.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
4904
- path: import_v420.z.string(),
4905
- file_text: import_v420.z.string().optional(),
4906
- insert_line: import_v420.z.number().int().optional(),
4907
- new_str: import_v420.z.string().optional(),
4908
- insert_text: import_v420.z.string().optional(),
4909
- old_str: import_v420.z.string().optional(),
4910
- view_range: import_v420.z.array(import_v420.z.number().int()).optional()
4973
+ import {
4974
+ createProviderToolFactory as createProviderToolFactory9,
4975
+ lazySchema as lazySchema19,
4976
+ zodSchema as zodSchema19
4977
+ } from "@ai-sdk/provider-utils";
4978
+ import { z as z20 } from "zod/v4";
4979
+ var textEditor_20250124InputSchema = lazySchema19(
4980
+ () => zodSchema19(
4981
+ z20.object({
4982
+ command: z20.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
4983
+ path: z20.string(),
4984
+ file_text: z20.string().optional(),
4985
+ insert_line: z20.number().int().optional(),
4986
+ new_str: z20.string().optional(),
4987
+ insert_text: z20.string().optional(),
4988
+ old_str: z20.string().optional(),
4989
+ view_range: z20.array(z20.number().int()).optional()
4911
4990
  })
4912
4991
  )
4913
4992
  );
4914
- var textEditor_20250124 = (0, import_provider_utils23.createProviderToolFactory)({
4993
+ var textEditor_20250124 = createProviderToolFactory9({
4915
4994
  id: "anthropic.text_editor_20250124",
4916
4995
  inputSchema: textEditor_20250124InputSchema
4917
4996
  });
4918
4997
 
4919
4998
  // src/tool/text-editor_20250429.ts
4920
- var import_provider_utils24 = require("@ai-sdk/provider-utils");
4921
- var import_v421 = require("zod/v4");
4922
- var textEditor_20250429InputSchema = (0, import_provider_utils24.lazySchema)(
4923
- () => (0, import_provider_utils24.zodSchema)(
4924
- import_v421.z.object({
4925
- command: import_v421.z.enum(["view", "create", "str_replace", "insert"]),
4926
- path: import_v421.z.string(),
4927
- file_text: import_v421.z.string().optional(),
4928
- insert_line: import_v421.z.number().int().optional(),
4929
- new_str: import_v421.z.string().optional(),
4930
- insert_text: import_v421.z.string().optional(),
4931
- old_str: import_v421.z.string().optional(),
4932
- view_range: import_v421.z.array(import_v421.z.number().int()).optional()
4999
+ import {
5000
+ createProviderToolFactory as createProviderToolFactory10,
5001
+ lazySchema as lazySchema20,
5002
+ zodSchema as zodSchema20
5003
+ } from "@ai-sdk/provider-utils";
5004
+ import { z as z21 } from "zod/v4";
5005
+ var textEditor_20250429InputSchema = lazySchema20(
5006
+ () => zodSchema20(
5007
+ z21.object({
5008
+ command: z21.enum(["view", "create", "str_replace", "insert"]),
5009
+ path: z21.string(),
5010
+ file_text: z21.string().optional(),
5011
+ insert_line: z21.number().int().optional(),
5012
+ new_str: z21.string().optional(),
5013
+ insert_text: z21.string().optional(),
5014
+ old_str: z21.string().optional(),
5015
+ view_range: z21.array(z21.number().int()).optional()
4933
5016
  })
4934
5017
  )
4935
5018
  );
4936
- var textEditor_20250429 = (0, import_provider_utils24.createProviderToolFactory)({
5019
+ var textEditor_20250429 = createProviderToolFactory10({
4937
5020
  id: "anthropic.text_editor_20250429",
4938
5021
  inputSchema: textEditor_20250429InputSchema
4939
5022
  });
4940
5023
 
4941
5024
  // src/tool/tool-search-bm25_20251119.ts
4942
- var import_provider_utils25 = require("@ai-sdk/provider-utils");
4943
- var import_v422 = require("zod/v4");
4944
- var toolSearchBm25_20251119OutputSchema = (0, import_provider_utils25.lazySchema)(
4945
- () => (0, import_provider_utils25.zodSchema)(
4946
- import_v422.z.array(
4947
- import_v422.z.object({
4948
- type: import_v422.z.literal("tool_reference"),
4949
- toolName: import_v422.z.string()
5025
+ import {
5026
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,
5027
+ lazySchema as lazySchema21,
5028
+ zodSchema as zodSchema21
5029
+ } from "@ai-sdk/provider-utils";
5030
+ import { z as z22 } from "zod/v4";
5031
+ var toolSearchBm25_20251119OutputSchema = lazySchema21(
5032
+ () => zodSchema21(
5033
+ z22.array(
5034
+ z22.object({
5035
+ type: z22.literal("tool_reference"),
5036
+ toolName: z22.string()
4950
5037
  })
4951
5038
  )
4952
5039
  )
4953
5040
  );
4954
- var toolSearchBm25_20251119InputSchema = (0, import_provider_utils25.lazySchema)(
4955
- () => (0, import_provider_utils25.zodSchema)(
4956
- import_v422.z.object({
5041
+ var toolSearchBm25_20251119InputSchema = lazySchema21(
5042
+ () => zodSchema21(
5043
+ z22.object({
4957
5044
  /**
4958
5045
  * A natural language query to search for tools.
4959
5046
  * Claude will use BM25 text search to find relevant tools.
4960
5047
  */
4961
- query: import_v422.z.string(),
5048
+ query: z22.string(),
4962
5049
  /**
4963
5050
  * Maximum number of tools to return. Optional.
4964
5051
  */
4965
- limit: import_v422.z.number().optional()
5052
+ limit: z22.number().optional()
4966
5053
  })
4967
5054
  )
4968
5055
  );
4969
- var factory10 = (0, import_provider_utils25.createProviderToolFactoryWithOutputSchema)({
5056
+ var factory10 = createProviderToolFactoryWithOutputSchema9({
4970
5057
  id: "anthropic.tool_search_bm25_20251119",
4971
5058
  inputSchema: toolSearchBm25_20251119InputSchema,
4972
5059
  outputSchema: toolSearchBm25_20251119OutputSchema,
@@ -5177,11 +5264,10 @@ var anthropicTools = {
5177
5264
  */
5178
5265
  toolSearchBm25_20251119
5179
5266
  };
5180
- // Annotate the CommonJS export names for ESM import in node:
5181
- 0 && (module.exports = {
5267
+ export {
5182
5268
  AnthropicMessagesLanguageModel,
5183
5269
  anthropicTools,
5184
5270
  getModelCapabilities,
5185
5271
  prepareTools
5186
- });
5272
+ };
5187
5273
  //# sourceMappingURL=index.js.map