@ai-sdk/anthropic 4.0.67 → 4.0.69

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,35 +1,34 @@
1
- import * as _ai_sdk_provider from '@ai-sdk/provider';
2
- import { FilesV4, FilesV4UploadFileCallOptions, FilesV4UploadFileResult, JSONSchema7, LanguageModelV4, JSONObject, LanguageModelV4CallOptions, SharedV4Warning, LanguageModelV4GenerateResult, LanguageModelV4StreamResult, SharedV4ProviderMetadata, SkillsV4 } from '@ai-sdk/provider';
3
- import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
4
- import { FetchFunction, InferSchema, Resolvable, WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE, ToolExecuteFunction, Tool, Experimental_SandboxSession, ProviderDefinedTool } from '@ai-sdk/provider-utils';
5
- import { z } from 'zod/v4';
6
-
1
+ import { Experimental_SandboxSession, FetchFunction, InferSchema, ProviderDefinedTool, Resolvable, Tool, ToolExecuteFunction, WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE } from "@ai-sdk/provider-utils";
2
+ import { z } from "zod/v4";
3
+ import { FilesV4, FilesV4UploadFileCallOptions, FilesV4UploadFileResult, JSONObject, JSONSchema7, LanguageModelV4, LanguageModelV4CallOptions, LanguageModelV4GenerateResult, LanguageModelV4StreamResult, SharedV4ProviderMetadata, SharedV4Warning, SkillsV4 } from "@ai-sdk/provider";
4
+ //#region src/anthropic-files.d.ts
7
5
  interface AnthropicFilesConfig {
8
- provider: string;
9
- baseURL: string;
10
- headers: () => Record<string, string | undefined>;
11
- fetch?: FetchFunction;
6
+ provider: string;
7
+ baseURL: string;
8
+ headers: () => Record<string, string | undefined>;
9
+ fetch?: FetchFunction;
12
10
  }
13
- declare class AnthropicFiles implements FilesV4 {
14
- private readonly config;
15
- readonly specificationVersion = "v4";
16
- get provider(): string;
17
- constructor(config: AnthropicFilesConfig);
18
- uploadFile({ data, mediaType, filename, abortSignal, headers, }: FilesV4UploadFileCallOptions): Promise<FilesV4UploadFileResult>;
11
+ export declare class AnthropicFiles implements FilesV4 {
12
+ private readonly config;
13
+ readonly specificationVersion = "v4";
14
+ get provider(): string;
15
+ constructor(config: AnthropicFilesConfig);
16
+ uploadFile({ data, mediaType, filename, abortSignal, headers }: FilesV4UploadFileCallOptions): Promise<FilesV4UploadFileResult>;
19
17
  }
20
-
18
+ //#endregion
19
+ //#region src/anthropic-api.d.ts
21
20
  type AnthropicMessage = AnthropicUserMessage | AnthropicAssistantMessage | AnthropicSystemMessage;
22
21
  type AnthropicCacheControl = {
23
- type: 'ephemeral';
24
- ttl?: '5m' | '1h';
22
+ type: 'ephemeral';
23
+ ttl?: '5m' | '1h';
25
24
  };
26
25
  interface AnthropicSystemMessage {
27
- role: 'system';
28
- content: Array<AnthropicTextContent | AnthropicToolChangeContent>;
29
- clear_at?: 'next_user_message';
30
- output_config?: {
31
- effort: 'low' | 'medium' | 'high' | 'xhigh' | 'max';
32
- };
26
+ role: 'system';
27
+ content: Array<AnthropicTextContent | AnthropicToolChangeContent>;
28
+ clear_at?: 'next_user_message';
29
+ output_config?: {
30
+ effort: 'low' | 'medium' | 'high' | 'xhigh' | 'max';
31
+ };
33
32
  }
34
33
  /**
35
34
  * Mid-conversation tool change content block. Adds or removes a tool from the
@@ -39,932 +38,952 @@ interface AnthropicSystemMessage {
39
38
  * Requires the `mid-conversation-tool-changes-2026-07-01` beta.
40
39
  */
41
40
  interface AnthropicToolChangeContent {
42
- type: 'tool_addition' | 'tool_removal';
43
- tool: {
44
- type: 'tool_reference';
45
- name: string;
46
- };
47
- cache_control?: never;
41
+ type: 'tool_addition' | 'tool_removal';
42
+ tool: {
43
+ type: 'tool_reference';
44
+ name: string;
45
+ };
46
+ cache_control?: never;
48
47
  }
49
48
  interface AnthropicUserMessage {
50
- role: 'user';
51
- content: Array<AnthropicTextContent | AnthropicImageContent | AnthropicDocumentContent | AnthropicContainerUploadContent | AnthropicToolResultContent>;
49
+ role: 'user';
50
+ content: Array<AnthropicTextContent | AnthropicImageContent | AnthropicDocumentContent | AnthropicContainerUploadContent | AnthropicToolResultContent>;
52
51
  }
53
52
  interface AnthropicAssistantMessage {
54
- role: 'assistant';
55
- content: Array<AnthropicTextContent | AnthropicThinkingContent | AnthropicRedactedThinkingContent | AnthropicToolCallContent | AnthropicServerToolUseContent | AnthropicCodeExecutionToolResultContent | AnthropicWebFetchToolResultContent | AnthropicWebSearchToolResultContent | AnthropicToolSearchToolResultContent | AnthropicBashCodeExecutionToolResultContent | AnthropicTextEditorCodeExecutionToolResultContent | AnthropicAdvisorToolResultContent | AnthropicMcpToolUseContent | AnthropicMcpToolResultContent | AnthropicCompactionContent>;
53
+ role: 'assistant';
54
+ content: Array<AnthropicTextContent | AnthropicThinkingContent | AnthropicRedactedThinkingContent | AnthropicFallbackContent | AnthropicToolCallContent | AnthropicServerToolUseContent | AnthropicCodeExecutionToolResultContent | AnthropicWebFetchToolResultContent | AnthropicWebSearchToolResultContent | AnthropicToolSearchToolResultContent | AnthropicBashCodeExecutionToolResultContent | AnthropicTextEditorCodeExecutionToolResultContent | AnthropicAdvisorToolResultContent | AnthropicMcpToolUseContent | AnthropicMcpToolResultContent | AnthropicCompactionContent>;
56
55
  }
56
+ declare const anthropicFallbackContentSchema: z.ZodObject<{
57
+ type: z.ZodLiteral<"fallback">;
58
+ from: z.ZodObject<{
59
+ model: z.ZodString;
60
+ }, z.core.$strip>;
61
+ to: z.ZodObject<{
62
+ model: z.ZodString;
63
+ }, z.core.$strip>;
64
+ }, z.core.$strip>;
65
+ type AnthropicFallbackContent = InferSchema<typeof anthropicFallbackContentSchema> & {
66
+ cache_control?: never;
67
+ };
57
68
  interface AnthropicCompactionContent {
58
- type: 'compaction';
59
- content: string;
60
- signature?: string;
61
- cache_control?: AnthropicCacheControl;
69
+ type: 'compaction';
70
+ content: string;
71
+ signature?: string;
72
+ cache_control?: AnthropicCacheControl;
62
73
  }
63
74
  interface AnthropicTextContent {
64
- type: 'text';
65
- text: string;
66
- citations?: Citation[];
67
- cache_control: AnthropicCacheControl | undefined;
75
+ type: 'text';
76
+ text: string;
77
+ citations?: Citation[];
78
+ cache_control: AnthropicCacheControl | undefined;
68
79
  }
69
80
  interface AnthropicThinkingContent {
70
- type: 'thinking';
71
- thinking: string;
72
- signature: string;
73
- cache_control?: never;
81
+ type: 'thinking';
82
+ thinking: string;
83
+ signature: string;
84
+ cache_control?: never;
74
85
  }
75
86
  interface AnthropicRedactedThinkingContent {
76
- type: 'redacted_thinking';
77
- data: string;
78
- cache_control?: never;
87
+ type: 'redacted_thinking';
88
+ data: string;
89
+ cache_control?: never;
79
90
  }
80
91
  type AnthropicContentSource = {
81
- type: 'base64';
82
- media_type: string;
83
- data: string;
92
+ type: 'base64';
93
+ media_type: string;
94
+ data: string;
84
95
  } | {
85
- type: 'url';
86
- url: string;
96
+ type: 'url';
97
+ url: string;
87
98
  } | {
88
- type: 'text';
89
- media_type: 'text/plain';
90
- data: string;
99
+ type: 'text';
100
+ media_type: 'text/plain';
101
+ data: string;
91
102
  } | {
92
- type: 'file';
93
- file_id: string;
103
+ type: 'file';
104
+ file_id: string;
94
105
  };
95
106
  interface AnthropicImageContent {
96
- type: 'image';
97
- source: AnthropicContentSource;
98
- cache_control: AnthropicCacheControl | undefined;
107
+ type: 'image';
108
+ source: AnthropicContentSource;
109
+ cache_control: AnthropicCacheControl | undefined;
99
110
  }
100
111
  interface AnthropicDocumentContent {
101
- type: 'document';
102
- source: AnthropicContentSource;
103
- title?: string;
104
- context?: string;
105
- citations?: {
106
- enabled: boolean;
107
- };
108
- cache_control: AnthropicCacheControl | undefined;
112
+ type: 'document';
113
+ source: AnthropicContentSource;
114
+ title?: string;
115
+ context?: string;
116
+ citations?: {
117
+ enabled: boolean;
118
+ };
119
+ cache_control: AnthropicCacheControl | undefined;
109
120
  }
110
121
  interface AnthropicContainerUploadContent {
111
- type: 'container_upload';
112
- file_id: string;
113
- cache_control?: never;
122
+ type: 'container_upload';
123
+ file_id: string;
124
+ cache_control?: never;
114
125
  }
115
126
  /**
116
127
  * The caller information for programmatic tool calling.
117
128
  * Present when a tool is called from within code execution.
118
129
  */
119
130
  type AnthropicToolCallCaller = {
120
- type: 'code_execution_20250825';
121
- tool_id: string;
131
+ type: 'code_execution_20250825';
132
+ tool_id: string;
122
133
  } | {
123
- type: 'code_execution_20260120';
124
- tool_id: string;
134
+ type: 'code_execution_20260120';
135
+ tool_id: string;
125
136
  } | {
126
- type: 'direct';
137
+ type: 'direct';
127
138
  };
128
139
  interface AnthropicToolCallContent {
129
- type: 'tool_use';
130
- id: string;
131
- name: string;
132
- input: unknown;
133
- /**
134
- * Present when this tool call was triggered by a server-executed tool
135
- * (e.g., code execution calling a user-defined tool programmatically).
136
- */
137
- caller?: AnthropicToolCallCaller;
138
- /**
139
- * Present when this tool call is a member call of a toolset
140
- * (e.g. `computer` for the computer toolset). `name` is then the member name.
141
- */
142
- toolset_name?: string;
143
- cache_control: AnthropicCacheControl | undefined;
140
+ type: 'tool_use';
141
+ id: string;
142
+ name: string;
143
+ input: unknown;
144
+ /**
145
+ * Present when this tool call was triggered by a server-executed tool
146
+ * (e.g., code execution calling a user-defined tool programmatically).
147
+ */
148
+ caller?: AnthropicToolCallCaller;
149
+ /**
150
+ * Present when this tool call is a member call of a toolset
151
+ * (e.g. `computer` for the computer toolset). `name` is then the member name.
152
+ */
153
+ toolset_name?: string;
154
+ cache_control: AnthropicCacheControl | undefined;
144
155
  }
145
156
  interface AnthropicServerToolUseContent {
146
- type: 'server_tool_use';
147
- id: string;
148
- name: 'web_fetch' | 'web_search' | 'code_execution' | 'bash_code_execution' | 'text_editor_code_execution' | 'tool_search_tool_regex' | 'tool_search_tool_bm25' | 'advisor';
149
- input: unknown;
150
- caller?: AnthropicToolCallCaller;
151
- cache_control: AnthropicCacheControl | undefined;
157
+ type: 'server_tool_use';
158
+ id: string;
159
+ name: 'web_fetch' | 'web_search' | 'code_execution' | 'bash_code_execution' | 'text_editor_code_execution' | 'tool_search_tool_regex' | 'tool_search_tool_bm25' | 'advisor';
160
+ input: unknown;
161
+ caller?: AnthropicToolCallCaller;
162
+ cache_control: AnthropicCacheControl | undefined;
152
163
  }
153
164
  type AnthropicNestedTextContent = Omit<AnthropicTextContent, 'cache_control'> & {
154
- cache_control?: never;
165
+ cache_control?: never;
155
166
  };
156
167
  type AnthropicNestedImageContent = Omit<AnthropicImageContent, 'cache_control'> & {
157
- cache_control?: never;
168
+ cache_control?: never;
158
169
  };
159
170
  type AnthropicNestedDocumentContent = Omit<AnthropicDocumentContent, 'cache_control'> & {
160
- cache_control?: never;
171
+ cache_control?: never;
161
172
  };
162
173
  interface AnthropicToolReferenceContent {
163
- type: 'tool_reference';
164
- tool_name: string;
174
+ type: 'tool_reference';
175
+ tool_name: string;
165
176
  }
166
177
  interface AnthropicToolResultContent {
167
- type: 'tool_result';
168
- tool_use_id: string;
169
- /**
170
- * Required for results of toolset member calls (e.g. `computer`).
171
- */
172
- toolset_name?: string;
173
- content: string | Array<AnthropicNestedTextContent | AnthropicNestedImageContent | AnthropicNestedDocumentContent | AnthropicToolReferenceContent>;
174
- is_error: boolean | undefined;
175
- cache_control: AnthropicCacheControl | undefined;
178
+ type: 'tool_result';
179
+ tool_use_id: string;
180
+ /**
181
+ * Required for results of toolset member calls (e.g. `computer`).
182
+ */
183
+ toolset_name?: string;
184
+ content: string | Array<AnthropicNestedTextContent | AnthropicNestedImageContent | AnthropicNestedDocumentContent | AnthropicToolReferenceContent>;
185
+ is_error: boolean | undefined;
186
+ cache_control: AnthropicCacheControl | undefined;
176
187
  }
177
188
  interface AnthropicWebSearchToolResultContent {
178
- type: 'web_search_tool_result';
179
- tool_use_id: string;
180
- content: Array<{
181
- url: string;
182
- title: string | null;
183
- page_age: string | null;
184
- encrypted_content: string;
185
- type: string;
186
- }> | {
187
- type: 'web_search_tool_result_error';
188
- error_code: string;
189
- };
190
- caller?: AnthropicToolCallCaller;
191
- cache_control: AnthropicCacheControl | undefined;
189
+ type: 'web_search_tool_result';
190
+ tool_use_id: string;
191
+ content: Array<{
192
+ url: string;
193
+ title: string | null;
194
+ page_age: string | null;
195
+ encrypted_content: string;
196
+ type: string;
197
+ }> | {
198
+ type: 'web_search_tool_result_error';
199
+ error_code: string;
200
+ };
201
+ caller?: AnthropicToolCallCaller;
202
+ cache_control: AnthropicCacheControl | undefined;
192
203
  }
193
204
  interface AnthropicToolSearchToolResultContent {
194
- type: 'tool_search_tool_result';
195
- tool_use_id: string;
196
- content: {
197
- type: 'tool_search_tool_search_result';
198
- tool_references: Array<{
199
- type: 'tool_reference';
200
- tool_name: string;
201
- }>;
202
- } | {
203
- type: 'tool_search_tool_result_error';
204
- error_code: string;
205
- };
206
- cache_control: AnthropicCacheControl | undefined;
205
+ type: 'tool_search_tool_result';
206
+ tool_use_id: string;
207
+ content: {
208
+ type: 'tool_search_tool_search_result';
209
+ tool_references: Array<{
210
+ type: 'tool_reference';
211
+ tool_name: string;
212
+ }>;
213
+ } | {
214
+ type: 'tool_search_tool_result_error';
215
+ error_code: string;
216
+ };
217
+ cache_control: AnthropicCacheControl | undefined;
207
218
  }
208
219
  interface AnthropicCodeExecutionToolResultContent {
209
- type: 'code_execution_tool_result';
210
- tool_use_id: string;
211
- content: {
212
- type: 'code_execution_result';
213
- stdout: string;
214
- stderr: string;
215
- return_code: number;
216
- content: Array<{
217
- type: 'code_execution_output';
218
- file_id: string;
219
- }>;
220
- } | {
221
- type: 'encrypted_code_execution_result';
222
- encrypted_stdout: string;
223
- stderr: string;
224
- return_code: number;
225
- content: Array<{
226
- type: 'code_execution_output';
227
- file_id: string;
228
- }>;
229
- } | {
230
- type: 'code_execution_tool_result_error';
231
- error_code: string;
232
- };
233
- cache_control: AnthropicCacheControl | undefined;
220
+ type: 'code_execution_tool_result';
221
+ tool_use_id: string;
222
+ content: {
223
+ type: 'code_execution_result';
224
+ stdout: string;
225
+ stderr: string;
226
+ return_code: number;
227
+ content: Array<{
228
+ type: 'code_execution_output';
229
+ file_id: string;
230
+ }>;
231
+ } | {
232
+ type: 'encrypted_code_execution_result';
233
+ encrypted_stdout: string;
234
+ stderr: string;
235
+ return_code: number;
236
+ content: Array<{
237
+ type: 'code_execution_output';
238
+ file_id: string;
239
+ }>;
240
+ } | {
241
+ type: 'code_execution_tool_result_error';
242
+ error_code: string;
243
+ };
244
+ cache_control: AnthropicCacheControl | undefined;
234
245
  }
235
246
  interface AnthropicTextEditorCodeExecutionToolResultContent {
236
- type: 'text_editor_code_execution_tool_result';
237
- tool_use_id: string;
238
- content: {
239
- type: 'text_editor_code_execution_tool_result_error';
240
- error_code: string;
241
- } | {
242
- type: 'text_editor_code_execution_create_result';
243
- is_file_update: boolean;
244
- } | {
245
- type: 'text_editor_code_execution_view_result';
246
- content: string;
247
- file_type: string;
248
- num_lines: number | null;
249
- start_line: number | null;
250
- total_lines: number | null;
251
- } | {
252
- type: 'text_editor_code_execution_str_replace_result';
253
- lines: string[] | null;
254
- new_lines: number | null;
255
- new_start: number | null;
256
- old_lines: number | null;
257
- old_start: number | null;
258
- };
259
- cache_control: AnthropicCacheControl | undefined;
247
+ type: 'text_editor_code_execution_tool_result';
248
+ tool_use_id: string;
249
+ content: {
250
+ type: 'text_editor_code_execution_tool_result_error';
251
+ error_code: string;
252
+ } | {
253
+ type: 'text_editor_code_execution_create_result';
254
+ is_file_update: boolean;
255
+ } | {
256
+ type: 'text_editor_code_execution_view_result';
257
+ content: string;
258
+ file_type: string;
259
+ num_lines: number | null;
260
+ start_line: number | null;
261
+ total_lines: number | null;
262
+ } | {
263
+ type: 'text_editor_code_execution_str_replace_result';
264
+ lines: string[] | null;
265
+ new_lines: number | null;
266
+ new_start: number | null;
267
+ old_lines: number | null;
268
+ old_start: number | null;
269
+ };
270
+ cache_control: AnthropicCacheControl | undefined;
260
271
  }
261
272
  interface AnthropicBashCodeExecutionToolResultContent {
262
- type: 'bash_code_execution_tool_result';
263
- tool_use_id: string;
273
+ type: 'bash_code_execution_tool_result';
274
+ tool_use_id: string;
275
+ content: {
276
+ type: 'bash_code_execution_result';
277
+ stdout: string;
278
+ stderr: string;
279
+ return_code: number;
264
280
  content: {
265
- type: 'bash_code_execution_result';
266
- stdout: string;
267
- stderr: string;
268
- return_code: number;
269
- content: {
270
- type: 'bash_code_execution_output';
271
- file_id: string;
272
- }[];
273
- } | {
274
- type: 'bash_code_execution_tool_result_error';
275
- error_code: string;
276
- };
277
- cache_control: AnthropicCacheControl | undefined;
281
+ type: 'bash_code_execution_output';
282
+ file_id: string;
283
+ }[];
284
+ } | {
285
+ type: 'bash_code_execution_tool_result_error';
286
+ error_code: string;
287
+ };
288
+ cache_control: AnthropicCacheControl | undefined;
278
289
  }
279
290
  interface AnthropicAdvisorToolResultContent {
280
- type: 'advisor_tool_result';
281
- tool_use_id: string;
282
- content: {
283
- type: 'advisor_result';
284
- text: string;
285
- stop_reason?: string;
286
- } | {
287
- type: 'advisor_redacted_result';
288
- encrypted_content: string;
289
- stop_reason?: string;
290
- } | {
291
- type: 'advisor_tool_result_error';
292
- /**
293
- * Available options: `max_uses_exceeded`, `too_many_requests`,
294
- * `overloaded`, `prompt_too_long`, `execution_time_exceeded`,
295
- * `unavailable`.
296
- */
297
- error_code: string;
298
- };
299
- cache_control: AnthropicCacheControl | undefined;
291
+ type: 'advisor_tool_result';
292
+ tool_use_id: string;
293
+ content: {
294
+ type: 'advisor_result';
295
+ text: string;
296
+ stop_reason?: string;
297
+ } | {
298
+ type: 'advisor_redacted_result';
299
+ encrypted_content: string;
300
+ stop_reason?: string;
301
+ } | {
302
+ type: 'advisor_tool_result_error';
303
+ /**
304
+ * Available options: `max_uses_exceeded`, `too_many_requests`,
305
+ * `overloaded`, `prompt_too_long`, `execution_time_exceeded`,
306
+ * `unavailable`.
307
+ */
308
+ error_code: string;
309
+ };
310
+ cache_control: AnthropicCacheControl | undefined;
300
311
  }
301
312
  interface AnthropicWebFetchToolResultContent {
302
- type: 'web_fetch_tool_result';
303
- tool_use_id: string;
313
+ type: 'web_fetch_tool_result';
314
+ tool_use_id: string;
315
+ content: {
316
+ type: 'web_fetch_result';
317
+ url: string;
318
+ retrieved_at: string | null;
304
319
  content: {
305
- type: 'web_fetch_result';
306
- url: string;
307
- retrieved_at: string | null;
308
- content: {
309
- type: 'document';
310
- title: string | null;
311
- citations?: {
312
- enabled: boolean;
313
- };
314
- source: {
315
- type: 'base64';
316
- media_type: 'application/pdf';
317
- data: string;
318
- } | {
319
- type: 'text';
320
- media_type: 'text/plain';
321
- data: string;
322
- };
323
- };
324
- } | {
325
- type: 'web_fetch_tool_result_error';
326
- error_code: string;
320
+ type: 'document';
321
+ title: string | null;
322
+ citations?: {
323
+ enabled: boolean;
324
+ };
325
+ source: {
326
+ type: 'base64';
327
+ media_type: 'application/pdf';
328
+ data: string;
329
+ } | {
330
+ type: 'text';
331
+ media_type: 'text/plain';
332
+ data: string;
333
+ };
327
334
  };
328
- caller?: AnthropicToolCallCaller;
329
- cache_control: AnthropicCacheControl | undefined;
335
+ } | {
336
+ type: 'web_fetch_tool_result_error';
337
+ error_code: string;
338
+ };
339
+ caller?: AnthropicToolCallCaller;
340
+ cache_control: AnthropicCacheControl | undefined;
330
341
  }
331
342
  interface AnthropicMcpToolUseContent {
332
- type: 'mcp_tool_use';
333
- id: string;
334
- name: string;
335
- server_name: string;
336
- input: unknown;
337
- cache_control: AnthropicCacheControl | undefined;
343
+ type: 'mcp_tool_use';
344
+ id: string;
345
+ name: string;
346
+ server_name: string;
347
+ input: unknown;
348
+ cache_control: AnthropicCacheControl | undefined;
338
349
  }
339
350
  interface AnthropicMcpToolResultContent {
340
- type: 'mcp_tool_result';
341
- tool_use_id: string;
342
- is_error: boolean;
343
- content: string | Array<{
344
- type: 'text';
345
- text: string;
346
- citations?: Citation[] | null;
347
- }>;
348
- cache_control: AnthropicCacheControl | undefined;
351
+ type: 'mcp_tool_result';
352
+ tool_use_id: string;
353
+ is_error: boolean;
354
+ content: string | Array<{
355
+ type: 'text';
356
+ text: string;
357
+ citations?: Citation[] | null;
358
+ }>;
359
+ cache_control: AnthropicCacheControl | undefined;
349
360
  }
350
361
  type AnthropicTool = {
351
- name: string;
352
- description: string | undefined;
353
- input_schema: JSONSchema7;
354
- cache_control: AnthropicCacheControl | undefined;
355
- eager_input_streaming?: boolean;
356
- strict?: boolean;
357
- /**
358
- * When true, this tool is deferred and will only be loaded when
359
- * discovered via the tool search tool.
360
- */
361
- defer_loading?: boolean;
362
- /**
363
- * Programmatic tool calling: specifies which server-executed tools
364
- * are allowed to call this tool. When set, only the specified callers
365
- * can invoke this tool programmatically.
366
- *
367
- * @example ['code_execution_20250825']
368
- */
369
- allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
362
+ name: string;
363
+ description: string | undefined;
364
+ input_schema: JSONSchema7;
365
+ cache_control: AnthropicCacheControl | undefined;
366
+ eager_input_streaming?: boolean;
367
+ strict?: boolean;
368
+ /**
369
+ * When true, this tool is deferred and will only be loaded when
370
+ * discovered via the tool search tool.
371
+ */
372
+ defer_loading?: boolean;
373
+ /**
374
+ * Programmatic tool calling: specifies which server-executed tools
375
+ * are allowed to call this tool. When set, only the specified callers
376
+ * can invoke this tool programmatically.
377
+ *
378
+ * @example ['code_execution_20250825']
379
+ */
380
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
370
381
  } | {
371
- type: 'code_execution_20250522';
372
- name: string;
373
- cache_control: AnthropicCacheControl | undefined;
382
+ type: 'code_execution_20250522';
383
+ name: string;
384
+ cache_control: AnthropicCacheControl | undefined;
374
385
  } | {
375
- type: 'code_execution_20250825';
376
- name: string;
386
+ type: 'code_execution_20250825';
387
+ name: string;
377
388
  } | {
378
- type: 'code_execution_20260120';
379
- name: string;
389
+ type: 'code_execution_20260120';
390
+ name: string;
380
391
  } | {
381
- name: string;
382
- type: 'computer_20250124' | 'computer_20241022';
383
- display_width_px: number;
384
- display_height_px: number;
385
- display_number: number;
386
- cache_control: AnthropicCacheControl | undefined;
392
+ name: string;
393
+ type: 'computer_20250124' | 'computer_20241022';
394
+ display_width_px: number;
395
+ display_height_px: number;
396
+ display_number: number;
397
+ cache_control: AnthropicCacheControl | undefined;
387
398
  } | {
388
- name: string;
389
- type: 'computer_20251124';
390
- display_width_px: number;
391
- display_height_px: number;
392
- display_number: number;
393
- enable_zoom?: boolean;
394
- cache_control: AnthropicCacheControl | undefined;
399
+ name: string;
400
+ type: 'computer_20251124';
401
+ display_width_px: number;
402
+ display_height_px: number;
403
+ display_number: number;
404
+ enable_zoom?: boolean;
405
+ cache_control: AnthropicCacheControl | undefined;
395
406
  } | {
396
- /**
397
- * Computer toolset. Declared without a `name`; the API returns member
398
- * tool calls (e.g. `left_click`) with `toolset_name: 'computer'`.
399
- */
400
- type: 'computer_toolset_20260801';
401
- configs?: Record<string, {
402
- enabled?: boolean;
403
- defer_loading?: boolean;
404
- }>;
405
- cache_control: AnthropicCacheControl | undefined;
407
+ /**
408
+ * Computer toolset. Declared without a `name`; the API returns member
409
+ * tool calls (e.g. `left_click`) with `toolset_name: 'computer'`.
410
+ */
411
+ type: 'computer_toolset_20260801';
412
+ configs?: Record<string, {
413
+ enabled?: boolean;
414
+ defer_loading?: boolean;
415
+ }>;
416
+ cache_control: AnthropicCacheControl | undefined;
406
417
  } | {
407
- name: string;
408
- type: 'text_editor_20250124' | 'text_editor_20241022' | 'text_editor_20250429';
409
- cache_control: AnthropicCacheControl | undefined;
418
+ name: string;
419
+ type: 'text_editor_20250124' | 'text_editor_20241022' | 'text_editor_20250429';
420
+ cache_control: AnthropicCacheControl | undefined;
410
421
  } | {
411
- name: string;
412
- type: 'text_editor_20250728';
413
- max_characters?: number;
414
- cache_control: AnthropicCacheControl | undefined;
422
+ name: string;
423
+ type: 'text_editor_20250728';
424
+ max_characters?: number;
425
+ cache_control: AnthropicCacheControl | undefined;
415
426
  } | {
416
- name: string;
417
- type: 'bash_20250124' | 'bash_20241022';
418
- cache_control: AnthropicCacheControl | undefined;
427
+ name: string;
428
+ type: 'bash_20250124' | 'bash_20241022';
429
+ cache_control: AnthropicCacheControl | undefined;
419
430
  } | {
420
- name: string;
421
- type: 'memory_20250818';
431
+ name: string;
432
+ type: 'memory_20250818';
422
433
  } | {
423
- type: 'web_fetch_20250910' | 'web_fetch_20260209' | 'web_fetch_20260318';
424
- name: string;
425
- max_uses?: number;
426
- allowed_domains?: string[];
427
- blocked_domains?: string[];
428
- citations?: {
429
- enabled: boolean;
430
- };
431
- max_content_tokens?: number;
432
- use_cache?: boolean;
433
- response_inclusion?: 'full' | 'excluded';
434
- cache_control: AnthropicCacheControl | undefined;
434
+ type: 'web_fetch_20250910' | 'web_fetch_20260209' | 'web_fetch_20260318';
435
+ name: string;
436
+ max_uses?: number;
437
+ allowed_domains?: string[];
438
+ blocked_domains?: string[];
439
+ citations?: {
440
+ enabled: boolean;
441
+ };
442
+ max_content_tokens?: number;
443
+ use_cache?: boolean;
444
+ response_inclusion?: 'full' | 'excluded';
445
+ cache_control: AnthropicCacheControl | undefined;
435
446
  } | {
436
- type: 'web_search_20250305' | 'web_search_20260209' | 'web_search_20260318';
437
- name: string;
438
- max_uses?: number;
439
- allowed_domains?: string[];
440
- blocked_domains?: string[];
441
- user_location?: {
442
- type: 'approximate';
443
- city?: string;
444
- region?: string;
445
- country?: string;
446
- timezone?: string;
447
- };
448
- response_inclusion?: 'full' | 'excluded';
449
- cache_control: AnthropicCacheControl | undefined;
447
+ type: 'web_search_20250305' | 'web_search_20260209' | 'web_search_20260318';
448
+ name: string;
449
+ max_uses?: number;
450
+ allowed_domains?: string[];
451
+ blocked_domains?: string[];
452
+ user_location?: {
453
+ type: 'approximate';
454
+ city?: string;
455
+ region?: string;
456
+ country?: string;
457
+ timezone?: string;
458
+ };
459
+ response_inclusion?: 'full' | 'excluded';
460
+ cache_control: AnthropicCacheControl | undefined;
450
461
  } | {
451
- type: 'tool_search_tool_regex_20251119';
452
- name: string;
462
+ type: 'tool_search_tool_regex_20251119';
463
+ name: string;
453
464
  } | {
454
- type: 'tool_search_tool_bm25_20251119';
455
- name: string;
465
+ type: 'tool_search_tool_bm25_20251119';
466
+ name: string;
456
467
  } | {
457
- type: 'advisor_20260301';
458
- name: 'advisor';
459
- model: string;
460
- max_uses?: number;
461
- max_tokens?: number;
462
- caching?: {
463
- type: 'ephemeral';
464
- ttl: '5m' | '1h';
465
- };
468
+ type: 'advisor_20260301';
469
+ name: 'advisor';
470
+ model: string;
471
+ max_uses?: number;
472
+ max_tokens?: number;
473
+ caching?: {
474
+ type: 'ephemeral';
475
+ ttl: '5m' | '1h';
476
+ };
466
477
  };
467
478
  type AnthropicToolChoice = {
468
- type: 'auto' | 'any';
469
- disable_parallel_tool_use?: boolean;
479
+ type: 'auto' | 'any';
480
+ disable_parallel_tool_use?: boolean;
470
481
  } | {
471
- type: 'tool';
472
- name: string;
473
- disable_parallel_tool_use?: boolean;
482
+ type: 'tool';
483
+ name: string;
484
+ disable_parallel_tool_use?: boolean;
474
485
  };
475
- declare const anthropicResponseSchema: _ai_sdk_provider_utils.LazySchema<{
476
- type: "message";
477
- content: ({
478
- type: "text";
479
- text: string;
480
- citations?: ({
481
- type: "web_search_result_location";
482
- cited_text: string;
483
- url: string;
484
- title: string | null;
485
- encrypted_index: string;
486
- } | {
487
- type: "page_location";
488
- cited_text: string;
489
- document_index: number;
490
- document_title: string | null;
491
- start_page_number: number;
492
- end_page_number: number;
493
- file_id?: string | null | undefined;
494
- } | {
495
- type: "char_location";
496
- cited_text: string;
497
- document_index: number;
498
- document_title: string | null;
499
- start_char_index: number;
500
- end_char_index: number;
501
- file_id?: string | null | undefined;
502
- } | {
503
- type: "content_block_location";
504
- cited_text: string;
505
- document_index: number;
506
- document_title: string | null;
507
- start_block_index: number;
508
- end_block_index: number;
509
- file_id: string | null;
510
- } | {
511
- type: "search_result_location";
512
- cited_text: string;
513
- search_result_index: number;
514
- source: string;
515
- title: string | null;
516
- start_block_index: number;
517
- end_block_index: number;
518
- })[] | null | undefined;
519
- } | {
520
- type: "thinking";
521
- thinking: string;
522
- signature: string;
523
- } | {
524
- type: "redacted_thinking";
525
- data: string;
526
- } | {
527
- type: "compaction";
528
- content?: string | null | undefined;
529
- signature?: string | null | undefined;
530
- } | {
531
- type: "tool_use";
532
- id: string;
533
- name: string;
534
- input: unknown;
535
- caller?: {
536
- type: "code_execution_20250825";
537
- tool_id: string;
538
- } | {
539
- type: "code_execution_20260120";
540
- tool_id: string;
541
- } | {
542
- type: "direct";
543
- } | undefined;
544
- toolset_name?: string | null | undefined;
545
- } | {
546
- type: "server_tool_use";
547
- id: string;
548
- name: string;
549
- input?: Record<string, unknown> | null | undefined;
550
- caller?: {
551
- type: "code_execution_20250825";
552
- tool_id: string;
553
- } | {
554
- type: "code_execution_20260120";
555
- tool_id: string;
556
- } | {
557
- type: "direct";
558
- } | undefined;
559
- } | {
560
- type: "mcp_tool_use";
561
- id: string;
562
- name: string;
563
- input: unknown;
564
- server_name: string;
565
- } | {
566
- type: "mcp_tool_result";
567
- tool_use_id: string;
568
- is_error: boolean;
569
- content: string | (string | {
570
- type: "text";
571
- text: string;
572
- citations?: z.core.util.JSONType[] | null | undefined;
573
- })[];
574
- } | {
575
- type: "web_fetch_tool_result";
576
- tool_use_id: string;
577
- content: {
578
- type: "web_fetch_result";
579
- url: string;
580
- retrieved_at: string | null;
581
- content: {
582
- type: "document";
583
- title: string | null;
584
- source: {
585
- type: "base64";
586
- media_type: "application/pdf";
587
- data: string;
588
- } | {
589
- type: "text";
590
- media_type: "text/plain";
591
- data: string;
592
- };
593
- citations?: {
594
- enabled: boolean;
595
- } | undefined;
596
- };
486
+ declare const anthropicResponseSchema: import("@ai-sdk/provider-utils").LazySchema<{
487
+ type: "message";
488
+ content: ({
489
+ type: "text";
490
+ text: string;
491
+ citations?: ({
492
+ type: "web_search_result_location";
493
+ cited_text: string;
494
+ url: string;
495
+ title: string | null;
496
+ encrypted_index: string;
497
+ } | {
498
+ type: "page_location";
499
+ cited_text: string;
500
+ document_index: number;
501
+ document_title: string | null;
502
+ start_page_number: number;
503
+ end_page_number: number;
504
+ file_id?: string | null | undefined;
505
+ } | {
506
+ type: "char_location";
507
+ cited_text: string;
508
+ document_index: number;
509
+ document_title: string | null;
510
+ start_char_index: number;
511
+ end_char_index: number;
512
+ file_id?: string | null | undefined;
513
+ } | {
514
+ type: "content_block_location";
515
+ cited_text: string;
516
+ document_index: number;
517
+ document_title: string | null;
518
+ start_block_index: number;
519
+ end_block_index: number;
520
+ file_id: string | null;
521
+ } | {
522
+ type: "search_result_location";
523
+ cited_text: string;
524
+ search_result_index: number;
525
+ source: string;
526
+ title: string | null;
527
+ start_block_index: number;
528
+ end_block_index: number;
529
+ })[] | null | undefined;
530
+ } | {
531
+ type: "thinking";
532
+ thinking: string;
533
+ signature: string;
534
+ } | {
535
+ type: "redacted_thinking";
536
+ data: string;
537
+ } | {
538
+ type: "compaction";
539
+ content?: string | null | undefined;
540
+ signature?: string | null | undefined;
541
+ } | {
542
+ type: "tool_use";
543
+ id: string;
544
+ name: string;
545
+ input: unknown;
546
+ caller?: {
547
+ type: "code_execution_20250825";
548
+ tool_id: string;
549
+ } | {
550
+ type: "code_execution_20260120";
551
+ tool_id: string;
552
+ } | {
553
+ type: "direct";
554
+ } | undefined;
555
+ toolset_name?: string | null | undefined;
556
+ } | {
557
+ type: "server_tool_use";
558
+ id: string;
559
+ name: string;
560
+ input?: Record<string, unknown> | null | undefined;
561
+ caller?: {
562
+ type: "code_execution_20250825";
563
+ tool_id: string;
564
+ } | {
565
+ type: "code_execution_20260120";
566
+ tool_id: string;
567
+ } | {
568
+ type: "direct";
569
+ } | undefined;
570
+ } | {
571
+ type: "mcp_tool_use";
572
+ id: string;
573
+ name: string;
574
+ input: unknown;
575
+ server_name: string;
576
+ } | {
577
+ type: "mcp_tool_result";
578
+ tool_use_id: string;
579
+ is_error: boolean;
580
+ content: string | (string | {
581
+ type: "text";
582
+ text: string;
583
+ citations?: z.core.util.JSONType[] | null | undefined;
584
+ })[];
585
+ } | {
586
+ type: "web_fetch_tool_result";
587
+ tool_use_id: string;
588
+ content: {
589
+ type: "web_fetch_result";
590
+ url: string;
591
+ retrieved_at: string | null;
592
+ content: {
593
+ type: "document";
594
+ title: string | null;
595
+ source: {
596
+ type: "base64";
597
+ media_type: "application/pdf";
598
+ data: string;
597
599
  } | {
598
- type: "web_fetch_tool_result_error";
599
- error_code: string;
600
+ type: "text";
601
+ media_type: "text/plain";
602
+ data: string;
600
603
  };
601
- caller?: {
602
- type: "code_execution_20250825";
603
- tool_id: string;
604
- } | {
605
- type: "code_execution_20260120";
606
- tool_id: string;
607
- } | {
608
- type: "direct";
604
+ citations?: {
605
+ enabled: boolean;
609
606
  } | undefined;
607
+ };
610
608
  } | {
611
- type: "web_search_tool_result";
612
- tool_use_id: string;
613
- content: {
614
- type: "web_search_result";
615
- url: string;
616
- title: string | null;
617
- encrypted_content: string;
618
- page_age?: string | null | undefined;
619
- }[] | {
620
- type: "web_search_tool_result_error";
621
- error_code: string;
622
- };
623
- caller?: {
624
- type: "code_execution_20250825";
625
- tool_id: string;
626
- } | {
627
- type: "code_execution_20260120";
628
- tool_id: string;
629
- } | {
630
- type: "direct";
631
- } | undefined;
609
+ type: "web_fetch_tool_result_error";
610
+ error_code: string;
611
+ };
612
+ caller?: {
613
+ type: "code_execution_20250825";
614
+ tool_id: string;
632
615
  } | {
633
- type: "code_execution_tool_result";
634
- tool_use_id: string;
635
- content: {
636
- type: "code_execution_result";
637
- stdout: string;
638
- stderr: string;
639
- return_code: number;
640
- content: {
641
- type: "code_execution_output";
642
- file_id: string;
643
- }[];
644
- } | {
645
- type: "encrypted_code_execution_result";
646
- encrypted_stdout: string;
647
- stderr: string;
648
- return_code: number;
649
- content: {
650
- type: "code_execution_output";
651
- file_id: string;
652
- }[];
653
- } | {
654
- type: "code_execution_tool_result_error";
655
- error_code: string;
656
- };
616
+ type: "code_execution_20260120";
617
+ tool_id: string;
657
618
  } | {
658
- type: "bash_code_execution_tool_result";
659
- tool_use_id: string;
660
- content: {
661
- type: "bash_code_execution_result";
662
- content: {
663
- type: "bash_code_execution_output";
664
- file_id: string;
665
- }[];
666
- stdout: string;
667
- stderr: string;
668
- return_code: number;
669
- } | {
670
- type: "bash_code_execution_tool_result_error";
671
- error_code: string;
672
- };
619
+ type: "direct";
620
+ } | undefined;
621
+ } | {
622
+ type: "web_search_tool_result";
623
+ tool_use_id: string;
624
+ content: {
625
+ type: "web_search_result";
626
+ url: string;
627
+ title: string | null;
628
+ encrypted_content: string;
629
+ page_age?: string | null | undefined;
630
+ }[] | {
631
+ type: "web_search_tool_result_error";
632
+ error_code: string;
633
+ };
634
+ caller?: {
635
+ type: "code_execution_20250825";
636
+ tool_id: string;
673
637
  } | {
674
- type: "text_editor_code_execution_tool_result";
675
- tool_use_id: string;
676
- content: {
677
- type: "text_editor_code_execution_tool_result_error";
678
- error_code: string;
679
- } | {
680
- type: "text_editor_code_execution_view_result";
681
- content: string;
682
- file_type: string;
683
- num_lines: number | null;
684
- start_line: number | null;
685
- total_lines: number | null;
686
- } | {
687
- type: "text_editor_code_execution_create_result";
688
- is_file_update: boolean;
689
- } | {
690
- type: "text_editor_code_execution_str_replace_result";
691
- lines: string[] | null;
692
- new_lines: number | null;
693
- new_start: number | null;
694
- old_lines: number | null;
695
- old_start: number | null;
696
- };
638
+ type: "code_execution_20260120";
639
+ tool_id: string;
697
640
  } | {
698
- type: "tool_search_tool_result";
699
- tool_use_id: string;
700
- content: {
701
- type: "tool_search_tool_search_result";
702
- tool_references: {
703
- type: "tool_reference";
704
- tool_name: string;
705
- }[];
706
- } | {
707
- type: "tool_search_tool_result_error";
708
- error_code: string;
709
- };
641
+ type: "direct";
642
+ } | undefined;
643
+ } | {
644
+ type: "code_execution_tool_result";
645
+ tool_use_id: string;
646
+ content: {
647
+ type: "code_execution_result";
648
+ stdout: string;
649
+ stderr: string;
650
+ return_code: number;
651
+ content: {
652
+ type: "code_execution_output";
653
+ file_id: string;
654
+ }[];
655
+ } | {
656
+ type: "encrypted_code_execution_result";
657
+ encrypted_stdout: string;
658
+ stderr: string;
659
+ return_code: number;
660
+ content: {
661
+ type: "code_execution_output";
662
+ file_id: string;
663
+ }[];
710
664
  } | {
711
- type: "container_upload";
665
+ type: "code_execution_tool_result_error";
666
+ error_code: string;
667
+ };
668
+ } | {
669
+ type: "bash_code_execution_tool_result";
670
+ tool_use_id: string;
671
+ content: {
672
+ type: "bash_code_execution_result";
673
+ content: {
674
+ type: "bash_code_execution_output";
712
675
  file_id: string;
676
+ }[];
677
+ stdout: string;
678
+ stderr: string;
679
+ return_code: number;
713
680
  } | {
714
- type: "advisor_tool_result";
715
- tool_use_id: string;
716
- content: {
717
- type: "advisor_result";
718
- text: string;
719
- stop_reason?: string | null | undefined;
720
- } | {
721
- type: "advisor_redacted_result";
722
- encrypted_content: string;
723
- stop_reason?: string | null | undefined;
724
- } | {
725
- type: "advisor_tool_result_error";
726
- error_code: string;
727
- };
681
+ type: "bash_code_execution_tool_result_error";
682
+ error_code: string;
683
+ };
684
+ } | {
685
+ type: "text_editor_code_execution_tool_result";
686
+ tool_use_id: string;
687
+ content: {
688
+ type: "text_editor_code_execution_tool_result_error";
689
+ error_code: string;
690
+ } | {
691
+ type: "text_editor_code_execution_view_result";
692
+ content: string;
693
+ file_type: string;
694
+ num_lines: number | null;
695
+ start_line: number | null;
696
+ total_lines: number | null;
697
+ } | {
698
+ type: "text_editor_code_execution_create_result";
699
+ is_file_update: boolean;
700
+ } | {
701
+ type: "text_editor_code_execution_str_replace_result";
702
+ lines: string[] | null;
703
+ new_lines: number | null;
704
+ new_start: number | null;
705
+ old_lines: number | null;
706
+ old_start: number | null;
707
+ };
708
+ } | {
709
+ type: "tool_search_tool_result";
710
+ tool_use_id: string;
711
+ content: {
712
+ type: "tool_search_tool_search_result";
713
+ tool_references: {
714
+ type: "tool_reference";
715
+ tool_name: string;
716
+ }[];
728
717
  } | {
729
- type: "fallback";
730
- })[];
731
- usage: {
732
- [x: string]: unknown;
733
- input_tokens: number;
734
- output_tokens: number;
735
- output_tokens_details?: {
736
- thinking_tokens?: number | null | undefined;
737
- } | null | undefined;
738
- cache_creation_input_tokens?: number | null | undefined;
739
- cache_read_input_tokens?: number | null | undefined;
740
- iterations?: {
741
- type: "message" | "compaction" | "advisor_message" | "fallback_message";
742
- input_tokens: number;
743
- output_tokens: number;
744
- model?: string | null | undefined;
745
- cache_creation_input_tokens?: number | null | undefined;
746
- cache_read_input_tokens?: number | null | undefined;
747
- }[] | null | undefined;
718
+ type: "tool_search_tool_result_error";
719
+ error_code: string;
748
720
  };
749
- id?: string | null | undefined;
750
- model?: string | null | undefined;
751
- stop_reason?: string | null | undefined;
752
- stop_sequence?: string | null | undefined;
753
- stop_details?: {
754
- type: string;
755
- category?: string | null | undefined;
756
- explanation?: string | null | undefined;
757
- recommended_model?: string | null | undefined;
721
+ } | {
722
+ type: "container_upload";
723
+ file_id: string;
724
+ } | {
725
+ type: "advisor_tool_result";
726
+ tool_use_id: string;
727
+ content: {
728
+ type: "advisor_result";
729
+ text: string;
730
+ stop_reason?: string | null | undefined;
731
+ } | {
732
+ type: "advisor_redacted_result";
733
+ encrypted_content: string;
734
+ stop_reason?: string | null | undefined;
735
+ } | {
736
+ type: "advisor_tool_result_error";
737
+ error_code: string;
738
+ };
739
+ } | {
740
+ type: "fallback";
741
+ from: {
742
+ model: string;
743
+ };
744
+ to: {
745
+ model: string;
746
+ };
747
+ })[];
748
+ usage: {
749
+ [x: string]: unknown;
750
+ input_tokens: number;
751
+ output_tokens: number;
752
+ output_tokens_details?: {
753
+ thinking_tokens?: number | null | undefined;
758
754
  } | null | undefined;
759
- input_transformations?: {
760
- type: string;
761
- path: string;
762
- reason: string;
755
+ cache_creation_input_tokens?: number | null | undefined;
756
+ cache_read_input_tokens?: number | null | undefined;
757
+ iterations?: {
758
+ type: "message" | "compaction" | "advisor_message" | "fallback_message";
759
+ input_tokens: number;
760
+ output_tokens: number;
761
+ model?: string | null | undefined;
762
+ cache_creation_input_tokens?: number | null | undefined;
763
+ cache_read_input_tokens?: number | null | undefined;
763
764
  }[] | null | undefined;
764
- safeguard_results?: {
765
+ };
766
+ id?: string | null | undefined;
767
+ model?: string | null | undefined;
768
+ stop_reason?: string | null | undefined;
769
+ stop_sequence?: string | null | undefined;
770
+ stop_details?: {
771
+ type: string;
772
+ category?: string | null | undefined;
773
+ explanation?: string | null | undefined;
774
+ recommended_model?: string | null | undefined;
775
+ } | null | undefined;
776
+ input_transformations?: {
777
+ type: string;
778
+ path: string;
779
+ reason: string;
780
+ }[] | null | undefined;
781
+ safeguard_results?: {
782
+ type: string;
783
+ status: {
784
+ type: string;
785
+ tool_uses?: Record<string, {
765
786
  type: string;
766
- status: {
767
- type: string;
768
- tool_uses?: Record<string, {
769
- type: string;
770
- outcome?: string | null | undefined;
771
- explanation?: string | null | undefined;
772
- }> | null | undefined;
773
- };
787
+ outcome?: string | null | undefined;
788
+ explanation?: string | null | undefined;
789
+ }> | null | undefined;
790
+ };
791
+ }[] | null | undefined;
792
+ container?: {
793
+ expires_at: string;
794
+ id: string;
795
+ skills?: {
796
+ type: "anthropic" | "custom";
797
+ skill_id: string;
798
+ version: string;
774
799
  }[] | null | undefined;
775
- container?: {
776
- expires_at: string;
777
- id: string;
778
- skills?: {
779
- type: "custom" | "anthropic";
780
- skill_id: string;
781
- version: string;
782
- }[] | null | undefined;
783
- } | null | undefined;
784
- context_management?: {
785
- applied_edits: ({
786
- type: "clear_tool_uses_20250919";
787
- cleared_tool_uses: number;
788
- cleared_input_tokens: number;
789
- } | {
790
- type: "clear_thinking_20251015";
791
- cleared_thinking_turns: number;
792
- cleared_input_tokens: number;
793
- } | {
794
- type: "compact_20260112";
795
- })[];
796
- } | null | undefined;
800
+ } | null | undefined;
801
+ context_management?: {
802
+ applied_edits: ({
803
+ type: "clear_tool_uses_20250919";
804
+ cleared_tool_uses: number;
805
+ cleared_input_tokens: number;
806
+ } | {
807
+ type: "clear_thinking_20251015";
808
+ cleared_thinking_turns: number;
809
+ cleared_input_tokens: number;
810
+ } | {
811
+ type: "compact_20260112";
812
+ })[];
813
+ } | null | undefined;
797
814
  }>;
798
815
  type Citation = NonNullable<(InferSchema<typeof anthropicResponseSchema>['content'][number] & {
799
- type: 'text';
816
+ type: 'text';
800
817
  })['citations']>[number];
801
-
818
+ //#endregion
819
+ //#region src/anthropic-language-model-options.d.ts
802
820
  type AnthropicModelId = 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-opus-4-0' | 'claude-opus-4-20250514' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-5' | 'claude-opus-4-5-20251101' | 'claude-sonnet-4-0' | 'claude-sonnet-4-20250514' | 'claude-sonnet-4-5-20250929' | 'claude-sonnet-4-5' | 'claude-sonnet-4-6' | 'claude-opus-4-6' | 'claude-opus-4-7' | 'claude-opus-4-8' | 'claude-opus-5' | 'claude-opus-5-5' | 'claude-fable-5' | 'claude-fable-5-1' | 'claude-sonnet-5' | 'claude-sonnet-5-5' | (string & {});
803
-
821
+ //#endregion
822
+ //#region src/anthropic-language-model.d.ts
804
823
  type AnthropicLanguageModelConfig = {
805
- provider: string;
806
- baseURL: string;
807
- headers?: Resolvable<Record<string, string | undefined>>;
808
- fetch?: FetchFunction;
809
- buildRequestUrl?: (baseURL: string, isStreaming: boolean) => string;
810
- transformRequestBody?: (args: Record<string, any>, betas: Set<string>) => Record<string, any>;
811
- supportedUrls?: () => LanguageModelV4['supportedUrls'];
812
- generateId?: () => string;
813
- supportsNativeStructuredOutput?: boolean;
814
- supportsStrictTools?: boolean;
824
+ provider: string;
825
+ baseURL: string;
826
+ headers?: Resolvable<Record<string, string | undefined>>;
827
+ fetch?: FetchFunction;
828
+ buildRequestUrl?: (baseURL: string, isStreaming: boolean) => string;
829
+ transformRequestBody?: (args: Record<string, any>, betas: Set<string>) => Record<string, any>;
830
+ supportedUrls?: () => LanguageModelV4['supportedUrls'];
831
+ generateId?: () => string;
832
+ supportsNativeStructuredOutput?: boolean;
833
+ supportsStrictTools?: boolean;
815
834
  };
816
- declare class AnthropicLanguageModel implements LanguageModelV4 {
817
- readonly specificationVersion = "v4";
818
- readonly modelId: AnthropicModelId;
819
- protected readonly config: AnthropicLanguageModelConfig;
820
- protected readonly generateId: () => string;
821
- static [WORKFLOW_SERIALIZE](model: AnthropicLanguageModel): {
822
- modelId: string;
823
- config: JSONObject;
835
+ export declare class AnthropicLanguageModel implements LanguageModelV4 {
836
+ readonly specificationVersion = "v4";
837
+ readonly modelId: AnthropicModelId;
838
+ protected readonly config: AnthropicLanguageModelConfig;
839
+ protected readonly generateId: () => string;
840
+ static [WORKFLOW_SERIALIZE](model: AnthropicLanguageModel): {
841
+ modelId: string;
842
+ config: JSONObject;
843
+ };
844
+ static [WORKFLOW_DESERIALIZE](options: {
845
+ modelId: AnthropicModelId;
846
+ config: AnthropicLanguageModelConfig;
847
+ }): AnthropicLanguageModel;
848
+ constructor(modelId: AnthropicModelId, config: AnthropicLanguageModelConfig);
849
+ supportsUrl(url: URL): boolean;
850
+ get provider(): string;
851
+ get supportedUrls(): Record<string, RegExp[]> | PromiseLike<Record<string, RegExp[]>>;
852
+ static prepareRequest({ modelId, config, options: { userSuppliedBetas, prompt, maxOutputTokens, temperature, topP, topK, frequencyPenalty, presencePenalty, stopSequences, responseFormat, seed, tools, toolChoice, reasoning, providerOptions, stream } }: {
853
+ modelId: AnthropicModelId;
854
+ config: AnthropicLanguageModelConfig;
855
+ options: LanguageModelV4CallOptions & {
856
+ stream: boolean;
857
+ userSuppliedBetas: Set<string>;
824
858
  };
825
- static [WORKFLOW_DESERIALIZE](options: {
826
- modelId: AnthropicModelId;
827
- config: AnthropicLanguageModelConfig;
828
- }): AnthropicLanguageModel;
829
- constructor(modelId: AnthropicModelId, config: AnthropicLanguageModelConfig);
830
- supportsUrl(url: URL): boolean;
831
- get provider(): string;
832
- get supportedUrls(): Record<string, RegExp[]> | PromiseLike<Record<string, RegExp[]>>;
833
- static prepareRequest({ modelId, config, options: { userSuppliedBetas, prompt, maxOutputTokens, temperature, topP, topK, frequencyPenalty, presencePenalty, stopSequences, responseFormat, seed, tools, toolChoice, reasoning, providerOptions, stream, }, }: {
834
- modelId: AnthropicModelId;
835
- config: AnthropicLanguageModelConfig;
836
- options: LanguageModelV4CallOptions & {
837
- stream: boolean;
838
- userSuppliedBetas: Set<string>;
839
- };
840
- }): Promise<{
841
- args: {
842
- tools: AnthropicTool[] | undefined;
843
- tool_choice: AnthropicToolChoice | undefined;
844
- stream: boolean | undefined;
845
- context_management?: {
846
- edits: ({
847
- exclude_tools?: string[] | undefined;
848
- clear_tool_inputs?: boolean | undefined;
849
- clear_at_least?: {
850
- type: "input_tokens";
851
- value: number;
852
- } | undefined;
853
- keep?: {
854
- type: "tool_uses";
855
- value: number;
856
- } | undefined;
857
- trigger?: {
858
- type: "input_tokens";
859
- value: number;
860
- } | {
861
- type: "tool_uses";
862
- value: number;
863
- } | undefined;
864
- type: "clear_tool_uses_20250919";
865
- } | {
866
- keep?: "all" | {
867
- type: "thinking_turns";
868
- value: number;
869
- } | undefined;
870
- type: "clear_thinking_20251015";
871
- } | {
872
- instructions?: string | undefined;
873
- pause_after_compaction?: boolean | undefined;
874
- trigger?: {
875
- type: "input_tokens";
876
- value: number;
877
- } | undefined;
878
- type: "compact_20260112";
879
- })[];
880
- } | undefined;
881
- compaction?: {
882
- instructions?: string | undefined;
883
- type: "summarize";
884
- } | undefined;
885
- safeguards?: {
886
- classifier_context?: Record<string, unknown> | undefined;
887
- type: "dangerous_tool_use";
888
- }[] | undefined;
889
- system: AnthropicTextContent[] | undefined;
890
- messages: AnthropicMessage[];
891
- container?: string | {
892
- id: string | undefined;
893
- skills: {
894
- type: "custom" | "anthropic";
895
- skill_id: string;
896
- version: string | undefined;
897
- }[];
898
- } | undefined;
899
- mcp_servers?: {
900
- type: "url";
901
- name: string;
902
- url: string;
903
- authorization_token: string | null | undefined;
904
- tool_configuration: {
905
- allowed_tools: string[] | null | undefined;
906
- enabled: boolean | null | undefined;
907
- } | undefined;
908
- }[] | undefined;
909
- metadata?: {
910
- user_id: string;
911
- } | undefined;
912
- cache_control?: {
913
- type: "ephemeral";
914
- ttl?: "5m" | "1h" | undefined;
915
- } | undefined;
916
- fallbacks?: "default" | {
917
- model: string;
918
- max_tokens?: number | undefined;
919
- thinking?: Record<string, unknown> | undefined;
920
- output_config?: Record<string, unknown> | undefined;
921
- speed?: "fast" | "standard" | undefined;
922
- }[] | undefined;
923
- inference_geo?: "us" | "global" | undefined;
924
- service_tier?: "auto" | "standard_only" | undefined;
925
- speed?: "fast" | "standard" | undefined;
926
- output_config?: {
927
- format?: {
928
- type: string;
929
- schema: _ai_sdk_provider.JSONSchema7;
930
- } | undefined;
931
- task_budget?: {
932
- remaining?: number | undefined;
933
- type: "tokens";
934
- total: number;
935
- } | undefined;
936
- effort?: "low" | "medium" | "high" | "xhigh" | "max" | undefined;
937
- } | undefined;
938
- thinking?: {
939
- block_binding?: {
940
- prefix_mismatch_behavior: "error" | "drop_block";
941
- } | undefined;
942
- display?: "omitted" | "summarized" | "updates" | undefined;
943
- budget_tokens?: number | undefined;
944
- type?: "enabled" | "adaptive" | "disabled" | "between_tools" | undefined;
945
- } | undefined;
946
- model: AnthropicModelId;
947
- max_tokens: number;
948
- temperature: number | undefined;
949
- top_k: number | undefined;
950
- top_p: number | undefined;
951
- stop_sequences: string[] | undefined;
952
- };
953
- warnings: SharedV4Warning[];
954
- betas: Set<string>;
955
- usesJsonResponseTool: boolean;
956
- toolNameMapping: _ai_sdk_provider_utils.ToolNameMapping;
957
- providerOptionsName: string;
958
- usedCustomProviderKey: boolean;
959
- }>;
960
- private getArgs;
961
- private getHeaders;
962
- private getBetasFromHeaders;
963
- private buildRequestUrl;
964
- protected transformRequestBody(args: Record<string, any>, betas: Set<string>): Record<string, any>;
965
- private extractCitationDocuments;
966
- doGenerate(options: LanguageModelV4CallOptions): Promise<LanguageModelV4GenerateResult>;
967
- doStream(options: LanguageModelV4CallOptions): Promise<LanguageModelV4StreamResult>;
859
+ }): Promise<{
860
+ args: {
861
+ tools: AnthropicTool[] | undefined;
862
+ tool_choice: AnthropicToolChoice | undefined;
863
+ stream: boolean | undefined;
864
+ context_management?: {
865
+ edits: ({
866
+ exclude_tools?: string[] | undefined;
867
+ clear_tool_inputs?: boolean | undefined;
868
+ clear_at_least?: {
869
+ type: "input_tokens";
870
+ value: number;
871
+ } | undefined;
872
+ keep?: {
873
+ type: "tool_uses";
874
+ value: number;
875
+ } | undefined;
876
+ trigger?: {
877
+ type: "input_tokens";
878
+ value: number;
879
+ } | {
880
+ type: "tool_uses";
881
+ value: number;
882
+ } | undefined;
883
+ type: "clear_tool_uses_20250919";
884
+ } | {
885
+ keep?: "all" | {
886
+ type: "thinking_turns";
887
+ value: number;
888
+ } | undefined;
889
+ type: "clear_thinking_20251015";
890
+ } | {
891
+ instructions?: string | undefined;
892
+ pause_after_compaction?: boolean | undefined;
893
+ trigger?: {
894
+ type: "input_tokens";
895
+ value: number;
896
+ } | undefined;
897
+ type: "compact_20260112";
898
+ })[];
899
+ } | undefined;
900
+ compaction?: {
901
+ instructions?: string | undefined;
902
+ type: "summarize";
903
+ } | undefined;
904
+ safeguards?: {
905
+ classifier_context?: Record<string, unknown> | undefined;
906
+ type: "dangerous_tool_use";
907
+ }[] | undefined;
908
+ system: AnthropicTextContent[] | undefined;
909
+ messages: AnthropicMessage[];
910
+ container?: string | {
911
+ id: string | undefined;
912
+ skills: {
913
+ type: "anthropic" | "custom";
914
+ skill_id: string;
915
+ version: string | undefined;
916
+ }[];
917
+ } | undefined;
918
+ mcp_servers?: {
919
+ type: "url";
920
+ name: string;
921
+ url: string;
922
+ authorization_token: string | null | undefined;
923
+ tool_configuration: {
924
+ allowed_tools: string[] | null | undefined;
925
+ enabled: boolean | null | undefined;
926
+ } | undefined;
927
+ }[] | undefined;
928
+ metadata?: {
929
+ user_id: string;
930
+ } | undefined;
931
+ cache_control?: {
932
+ type: "ephemeral";
933
+ ttl?: "5m" | "1h" | undefined;
934
+ } | undefined;
935
+ fallbacks?: "default" | {
936
+ model: string;
937
+ max_tokens?: number | undefined;
938
+ thinking?: Record<string, unknown> | undefined;
939
+ output_config?: Record<string, unknown> | undefined;
940
+ speed?: "fast" | "standard" | undefined;
941
+ }[] | undefined;
942
+ inference_geo?: "us" | "global" | undefined;
943
+ service_tier?: "auto" | "standard_only" | undefined;
944
+ speed?: "fast" | "standard" | undefined;
945
+ output_config?: {
946
+ format?: {
947
+ type: string;
948
+ schema: import("@ai-sdk/provider").JSONSchema7;
949
+ } | undefined;
950
+ task_budget?: {
951
+ remaining?: number | undefined;
952
+ type: "tokens";
953
+ total: number;
954
+ } | undefined;
955
+ effort?: "low" | "medium" | "high" | "xhigh" | "max" | undefined;
956
+ } | undefined;
957
+ thinking?: {
958
+ block_binding?: {
959
+ prefix_mismatch_behavior: "error" | "drop_block";
960
+ } | undefined;
961
+ display?: "omitted" | "summarized" | "updates" | undefined;
962
+ budget_tokens?: number | undefined;
963
+ type?: "adaptive" | "enabled" | "disabled" | "between_tools" | undefined;
964
+ } | undefined;
965
+ model: AnthropicModelId;
966
+ max_tokens: number;
967
+ temperature: number | undefined;
968
+ top_k: number | undefined;
969
+ top_p: number | undefined;
970
+ stop_sequences: string[] | undefined;
971
+ };
972
+ warnings: SharedV4Warning[];
973
+ betas: Set<string>;
974
+ usesJsonResponseTool: boolean;
975
+ toolNameMapping: import("@ai-sdk/provider-utils").ToolNameMapping;
976
+ providerOptionsName: string;
977
+ usedCustomProviderKey: boolean;
978
+ }>;
979
+ private getArgs;
980
+ private getHeaders;
981
+ private getBetasFromHeaders;
982
+ private buildRequestUrl;
983
+ protected transformRequestBody(args: Record<string, any>, betas: Set<string>): Record<string, any>;
984
+ private extractCitationDocuments;
985
+ doGenerate(options: LanguageModelV4CallOptions): Promise<LanguageModelV4GenerateResult>;
986
+ doStream(options: LanguageModelV4CallOptions): Promise<LanguageModelV4StreamResult>;
968
987
  }
969
988
  /**
970
989
  * Returns the capabilities of a Claude model that are used for defaults and feature selection.
@@ -972,30 +991,31 @@ declare class AnthropicLanguageModel implements LanguageModelV4 {
972
991
  * @see https://docs.claude.com/en/docs/about-claude/models/overview#model-comparison-table
973
992
  * @see https://platform.claude.com/docs/en/build-with-claude/structured-outputs
974
993
  */
975
- declare function getModelCapabilities(modelId: string): {
976
- maxOutputTokens: number;
977
- supportsStructuredOutput: boolean;
978
- supportsAdaptiveThinking: boolean;
979
- rejectsSamplingParameters: boolean;
980
- supportsXhighEffort: boolean;
981
- rejectsThinkingDisabledAboveHighEffort: boolean;
982
- /**
983
- * Thinking is always adaptive: `thinking.type` `disabled` and `enabled`
984
- * are rejected with a 400.
985
- */
986
- rejectsThinkingDisabled: boolean;
987
- /**
988
- * Forced tool use (`tool_choice` `any` or a named tool) is rejected with a 400.
989
- */
990
- rejectsForcedToolUse: boolean;
991
- /**
992
- * Supports `thinking.type` `between_tools`, the lowest thinking setting on
993
- * models that reject disabled thinking.
994
- */
995
- supportsBetweenToolsThinking: boolean;
996
- isKnownModel: boolean;
994
+ export declare function getModelCapabilities(modelId: string): {
995
+ maxOutputTokens: number;
996
+ supportsStructuredOutput: boolean;
997
+ supportsAdaptiveThinking: boolean;
998
+ rejectsSamplingParameters: boolean;
999
+ supportsXhighEffort: boolean;
1000
+ rejectsThinkingDisabledAboveHighEffort: boolean;
1001
+ /**
1002
+ * Thinking is always adaptive: `thinking.type` `disabled` and `enabled`
1003
+ * are rejected with a 400.
1004
+ */
1005
+ rejectsThinkingDisabled: boolean;
1006
+ /**
1007
+ * Forced tool use (`tool_choice` `any` or a named tool) is rejected with a 400.
1008
+ */
1009
+ rejectsForcedToolUse: boolean;
1010
+ /**
1011
+ * Supports `thinking.type` `between_tools`, the lowest thinking setting on
1012
+ * models that reject disabled thinking.
1013
+ */
1014
+ supportsBetweenToolsThinking: boolean;
1015
+ isKnownModel: boolean;
997
1016
  };
998
-
1017
+ //#endregion
1018
+ //#region src/tool/computer-toolset_20260801.d.ts
999
1019
  /**
1000
1020
  * Member tools of the computer toolset. Each member is returned by the API as
1001
1021
  * its own `tool_use` block; the AI SDK exposes it as the `action` of a single
@@ -1003,1086 +1023,1092 @@ declare function getModelCapabilities(modelId: string): {
1003
1023
  */
1004
1024
  declare const computerToolset_20260801Members: readonly ["screenshot", "zoom", "left_click", "right_click", "middle_click", "double_click", "triple_click", "left_click_drag", "mouse_move", "left_mouse_down", "left_mouse_up", "cursor_position", "scroll", "type", "key", "hold_key", "wait"];
1005
1025
  type ComputerToolset_20260801Member = (typeof computerToolset_20260801Members)[number];
1006
-
1026
+ //#endregion
1027
+ //#region src/tool/bash_20241022.d.ts
1007
1028
  type Bash20241022Input = {
1008
- /**
1009
- * The bash command to run. Required unless the tool is being restarted.
1010
- */
1011
- command: string;
1012
- /**
1013
- * Specifying true will restart this tool. Otherwise, leave this unspecified.
1014
- */
1015
- restart?: boolean;
1029
+ /**
1030
+ * The bash command to run. Required unless the tool is being restarted.
1031
+ */
1032
+ command: string;
1033
+ /**
1034
+ * Specifying true will restart this tool. Otherwise, leave this unspecified.
1035
+ */
1036
+ restart?: boolean;
1016
1037
  };
1017
1038
  type Bash20241022Options<OUTPUT> = {
1018
- execute?: ToolExecuteFunction<Bash20241022Input, OUTPUT, {}>;
1019
- needsApproval?: Tool<Bash20241022Input, OUTPUT, {}>['needsApproval'];
1020
- toModelOutput?: Tool<Bash20241022Input, OUTPUT, {}>['toModelOutput'];
1021
- onInputStart?: Tool<Bash20241022Input, OUTPUT, {}>['onInputStart'];
1022
- onInputDelta?: Tool<Bash20241022Input, OUTPUT, {}>['onInputDelta'];
1023
- onInputAvailable?: Tool<Bash20241022Input, OUTPUT, {}>['onInputAvailable'];
1039
+ execute?: ToolExecuteFunction<Bash20241022Input, OUTPUT, {}>;
1040
+ needsApproval?: Tool<Bash20241022Input, OUTPUT, {}>['needsApproval'];
1041
+ toModelOutput?: Tool<Bash20241022Input, OUTPUT, {}>['toModelOutput'];
1042
+ onInputStart?: Tool<Bash20241022Input, OUTPUT, {}>['onInputStart'];
1043
+ onInputDelta?: Tool<Bash20241022Input, OUTPUT, {}>['onInputDelta'];
1044
+ onInputAvailable?: Tool<Bash20241022Input, OUTPUT, {}>['onInputAvailable'];
1024
1045
  };
1025
1046
  type Bash20241022DefaultOutput = Awaited<ReturnType<Experimental_SandboxSession['run']>>;
1026
1047
  declare function bash_20241022(options?: Omit<Bash20241022Options<Bash20241022DefaultOutput>, 'execute'> & {
1027
- execute?: undefined;
1048
+ execute?: undefined;
1028
1049
  }): ProviderDefinedTool<Bash20241022Input, Bash20241022DefaultOutput, {}>;
1029
1050
  declare function bash_20241022<OUTPUT = never>(options: Omit<Bash20241022Options<OUTPUT>, 'execute'> & {
1030
- execute: null;
1051
+ execute: null;
1031
1052
  }): ProviderDefinedTool<Bash20241022Input, OUTPUT, {}>;
1032
1053
  declare function bash_20241022<OUTPUT>(options: Omit<Bash20241022Options<OUTPUT>, 'execute'> & {
1033
- execute: Bash20241022Options<OUTPUT>['execute'];
1054
+ execute: Bash20241022Options<OUTPUT>['execute'];
1034
1055
  }): ProviderDefinedTool<Bash20241022Input, OUTPUT, {}>;
1035
-
1056
+ //#endregion
1057
+ //#region src/tool/bash_20250124.d.ts
1036
1058
  type Bash20250124Input = {
1037
- /**
1038
- * The bash command to run. Required unless the tool is being restarted.
1039
- */
1040
- command: string;
1041
- /**
1042
- * Specifying true will restart this tool. Otherwise, leave this unspecified.
1043
- */
1044
- restart?: boolean;
1059
+ /**
1060
+ * The bash command to run. Required unless the tool is being restarted.
1061
+ */
1062
+ command: string;
1063
+ /**
1064
+ * Specifying true will restart this tool. Otherwise, leave this unspecified.
1065
+ */
1066
+ restart?: boolean;
1045
1067
  };
1046
1068
  type Bash20250124Options<OUTPUT> = {
1047
- execute?: ToolExecuteFunction<Bash20250124Input, OUTPUT, {}>;
1048
- needsApproval?: Tool<Bash20250124Input, OUTPUT, {}>['needsApproval'];
1049
- toModelOutput?: Tool<Bash20250124Input, OUTPUT, {}>['toModelOutput'];
1050
- onInputStart?: Tool<Bash20250124Input, OUTPUT, {}>['onInputStart'];
1051
- onInputDelta?: Tool<Bash20250124Input, OUTPUT, {}>['onInputDelta'];
1052
- onInputAvailable?: Tool<Bash20250124Input, OUTPUT, {}>['onInputAvailable'];
1069
+ execute?: ToolExecuteFunction<Bash20250124Input, OUTPUT, {}>;
1070
+ needsApproval?: Tool<Bash20250124Input, OUTPUT, {}>['needsApproval'];
1071
+ toModelOutput?: Tool<Bash20250124Input, OUTPUT, {}>['toModelOutput'];
1072
+ onInputStart?: Tool<Bash20250124Input, OUTPUT, {}>['onInputStart'];
1073
+ onInputDelta?: Tool<Bash20250124Input, OUTPUT, {}>['onInputDelta'];
1074
+ onInputAvailable?: Tool<Bash20250124Input, OUTPUT, {}>['onInputAvailable'];
1053
1075
  };
1054
1076
  type Bash20250124DefaultOutput = Awaited<ReturnType<Experimental_SandboxSession['run']>>;
1055
1077
  declare function bash_20250124(options?: Omit<Bash20250124Options<Bash20250124DefaultOutput>, 'execute'> & {
1056
- execute?: undefined;
1078
+ execute?: undefined;
1057
1079
  }): ProviderDefinedTool<Bash20250124Input, Bash20250124DefaultOutput, {}>;
1058
1080
  declare function bash_20250124<OUTPUT = never>(options: Omit<Bash20250124Options<OUTPUT>, 'execute'> & {
1059
- execute: null;
1081
+ execute: null;
1060
1082
  }): ProviderDefinedTool<Bash20250124Input, OUTPUT, {}>;
1061
1083
  declare function bash_20250124<OUTPUT>(options: Omit<Bash20250124Options<OUTPUT>, 'execute'> & {
1062
- execute: Bash20250124Options<OUTPUT>['execute'];
1084
+ execute: Bash20250124Options<OUTPUT>['execute'];
1063
1085
  }): ProviderDefinedTool<Bash20250124Input, OUTPUT, {}>;
1064
-
1065
- declare const anthropicTools: {
1066
- /**
1067
- * Pairs a faster executor model with a higher-intelligence advisor model
1068
- * that provides strategic guidance mid-generation.
1069
- *
1070
- * The advisor lets a faster, lower-cost executor model consult a
1071
- * higher-intelligence advisor model server-side. The advisor reads the
1072
- * executor's full transcript and produces a plan or course correction;
1073
- * the executor continues with the task, informed by the advice. All of
1074
- * this happens inside a single `/v1/messages` request.
1075
- *
1076
- * Beta header `advisor-tool-2026-03-01` is added automatically when this
1077
- * tool is included.
1078
- *
1079
- * Multi-turn conversations: pass the full assistant content (including
1080
- * `advisor_tool_result` blocks) back to the API on subsequent turns. If
1081
- * you omit the advisor tool from `tools` on a follow-up turn while the
1082
- * message history still contains `advisor_tool_result` blocks, the API
1083
- * returns a `400 invalid_request_error`.
1084
- *
1085
- * Supported executor models: Claude Haiku 4.5, Sonnet 4.6, Opus 4.6,
1086
- * Opus 4.7. The advisor must be at least as capable as the executor.
1087
- *
1088
- * @param model - The advisor model ID (required), e.g. `"claude-opus-4-8"`.
1089
- * @param maxUses - Maximum advisor calls per request (per-request cap).
1090
- * @param maxTokens - Maximum advisor output tokens per call, including
1091
- * thinking and text. Minimum 1024; Anthropic recommends starting with 2048.
1092
- * @param caching - Enables prompt caching for the advisor's transcript
1093
- * across calls within a conversation. Worthwhile from ~3 advisor calls
1094
- * per conversation.
1095
- */
1096
- advisor_20260301: (args: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {
1097
- type: "advisor_result";
1098
- text: string;
1099
- stopReason?: string;
1100
- } | {
1101
- type: "advisor_redacted_result";
1102
- encryptedContent: string;
1103
- stopReason?: string;
1104
- } | {
1105
- type: "advisor_tool_result_error";
1106
- errorCode: string;
1107
- }, {
1108
- model: string;
1109
- maxUses?: number;
1110
- maxTokens?: number;
1111
- caching?: {
1112
- type: "ephemeral";
1113
- ttl: "5m" | "1h";
1114
- };
1115
- }, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{}, {
1116
- type: "advisor_result";
1117
- text: string;
1118
- stopReason?: string;
1119
- } | {
1120
- type: "advisor_redacted_result";
1121
- encryptedContent: string;
1122
- stopReason?: string;
1123
- } | {
1124
- type: "advisor_tool_result_error";
1125
- errorCode: string;
1126
- }, {}>;
1127
- /**
1128
- * The bash tool enables Claude to execute shell commands in a persistent bash session,
1129
- * allowing system operations, script execution, and command-line automation.
1130
- *
1131
- * Image results are supported.
1132
- */
1133
- bash_20241022: typeof bash_20241022;
1134
- /**
1135
- * The bash tool enables Claude to execute shell commands in a persistent bash session,
1136
- * allowing system operations, script execution, and command-line automation.
1137
- *
1138
- * Image results are supported.
1139
- */
1140
- bash_20250124: typeof bash_20250124;
1141
- /**
1142
- * Claude can analyze data, create visualizations, perform complex calculations,
1143
- * run system commands, create and edit files, and process uploaded files directly within
1144
- * the API conversation.
1145
- *
1146
- * The code execution tool allows Claude to run Bash commands and manipulate files,
1147
- * including writing code, in a secure, sandboxed environment.
1148
- */
1149
- codeExecution_20250522: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
1150
- code: string;
1151
- }, {
1152
- type: "code_execution_result";
1153
- stdout: string;
1154
- stderr: string;
1155
- return_code: number;
1156
- content: Array<{
1157
- type: "code_execution_output";
1158
- file_id: string;
1159
- }>;
1160
- }, {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
1161
- code: string;
1162
- }, {
1163
- type: "code_execution_result";
1164
- stdout: string;
1165
- stderr: string;
1166
- return_code: number;
1167
- content: Array<{
1168
- type: "code_execution_output";
1169
- file_id: string;
1170
- }>;
1171
- }, {}>;
1172
- /**
1173
- * Claude can analyze data, create visualizations, perform complex calculations,
1174
- * run system commands, create and edit files, and process uploaded files directly within
1175
- * the API conversation.
1176
- *
1177
- * The code execution tool allows Claude to run both Python and Bash commands and manipulate files,
1178
- * including writing code, in a secure, sandboxed environment.
1179
- *
1180
- * This is the latest version with enhanced Bash support and file operations.
1181
- */
1182
- codeExecution_20250825: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
1183
- type: "programmatic-tool-call";
1184
- code: string;
1185
- } | {
1186
- type: "bash_code_execution";
1187
- command: string;
1188
- } | {
1189
- type: "text_editor_code_execution";
1190
- command: "view";
1191
- path: string;
1192
- } | {
1193
- type: "text_editor_code_execution";
1194
- command: "create";
1195
- path: string;
1196
- file_text?: string | null;
1197
- } | {
1198
- type: "text_editor_code_execution";
1199
- command: "str_replace";
1200
- path: string;
1201
- old_str: string;
1202
- new_str: string;
1203
- }, {
1204
- type: "code_execution_result";
1205
- stdout: string;
1206
- stderr: string;
1207
- return_code: number;
1208
- content: Array<{
1209
- type: "code_execution_output";
1210
- file_id: string;
1211
- }>;
1212
- } | {
1213
- type: "bash_code_execution_result";
1214
- content: Array<{
1215
- type: "bash_code_execution_output";
1216
- file_id: string;
1217
- }>;
1218
- stdout: string;
1219
- stderr: string;
1220
- return_code: number;
1221
- } | {
1222
- type: "bash_code_execution_tool_result_error";
1223
- error_code: string;
1224
- } | {
1225
- type: "text_editor_code_execution_tool_result_error";
1226
- error_code: string;
1227
- } | {
1228
- type: "text_editor_code_execution_view_result";
1229
- content: string;
1230
- file_type: string;
1231
- num_lines: number | null;
1232
- start_line: number | null;
1233
- total_lines: number | null;
1234
- } | {
1235
- type: "text_editor_code_execution_create_result";
1236
- is_file_update: boolean;
1237
- } | {
1238
- type: "text_editor_code_execution_str_replace_result";
1239
- lines: string[] | null;
1240
- new_lines: number | null;
1241
- new_start: number | null;
1242
- old_lines: number | null;
1243
- old_start: number | null;
1244
- }, {}, {}>>[0]) => _ai_sdk_provider_utils.Experimental_ToolCallerTool<_ai_sdk_provider_utils.ProviderExecutedTool<{
1245
- type: "programmatic-tool-call";
1246
- code: string;
1247
- } | {
1248
- type: "bash_code_execution";
1249
- command: string;
1250
- } | {
1251
- type: "text_editor_code_execution";
1252
- command: "view";
1253
- path: string;
1254
- } | {
1255
- type: "text_editor_code_execution";
1256
- command: "create";
1257
- path: string;
1258
- file_text?: string | null;
1259
- } | {
1260
- type: "text_editor_code_execution";
1261
- command: "str_replace";
1262
- path: string;
1263
- old_str: string;
1264
- new_str: string;
1265
- }, {
1266
- type: "code_execution_result";
1267
- stdout: string;
1268
- stderr: string;
1269
- return_code: number;
1270
- content: Array<{
1271
- type: "code_execution_output";
1272
- file_id: string;
1273
- }>;
1274
- } | {
1275
- type: "bash_code_execution_result";
1276
- content: Array<{
1277
- type: "bash_code_execution_output";
1278
- file_id: string;
1279
- }>;
1280
- stdout: string;
1281
- stderr: string;
1282
- return_code: number;
1283
- } | {
1284
- type: "bash_code_execution_tool_result_error";
1285
- error_code: string;
1286
- } | {
1287
- type: "text_editor_code_execution_tool_result_error";
1288
- error_code: string;
1289
- } | {
1290
- type: "text_editor_code_execution_view_result";
1291
- content: string;
1292
- file_type: string;
1293
- num_lines: number | null;
1294
- start_line: number | null;
1295
- total_lines: number | null;
1296
- } | {
1297
- type: "text_editor_code_execution_create_result";
1298
- is_file_update: boolean;
1299
- } | {
1300
- type: "text_editor_code_execution_str_replace_result";
1301
- lines: string[] | null;
1302
- new_lines: number | null;
1303
- new_start: number | null;
1304
- old_lines: number | null;
1305
- old_start: number | null;
1306
- }, {}>>;
1307
- /**
1308
- * Claude can analyze data, create visualizations, perform complex calculations,
1309
- * run system commands, create and edit files, and process uploaded files directly within
1310
- * the API conversation.
1311
- *
1312
- * The code execution tool allows Claude to run both Python and Bash commands and manipulate files,
1313
- * including writing code, in a secure, sandboxed environment.
1314
- *
1315
- * This is the recommended version. Does not require a beta header.
1316
- *
1317
- * Supported models: Claude Opus 4.6, Sonnet 4.6, Sonnet 4.5, Opus 4.5
1318
- */
1319
- codeExecution_20260120: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
1320
- type: "programmatic-tool-call";
1321
- code: string;
1322
- } | {
1323
- type: "bash_code_execution";
1324
- command: string;
1325
- } | {
1326
- type: "text_editor_code_execution";
1327
- command: "view";
1328
- path: string;
1329
- } | {
1330
- type: "text_editor_code_execution";
1331
- command: "create";
1332
- path: string;
1333
- file_text?: string | null;
1334
- } | {
1335
- type: "text_editor_code_execution";
1336
- command: "str_replace";
1337
- path: string;
1338
- old_str: string;
1339
- new_str: string;
1340
- }, {
1341
- type: "code_execution_result";
1342
- stdout: string;
1343
- stderr: string;
1344
- return_code: number;
1345
- content: Array<{
1346
- type: "code_execution_output";
1347
- file_id: string;
1348
- }>;
1349
- } | {
1350
- type: "encrypted_code_execution_result";
1351
- encrypted_stdout: string;
1352
- stderr: string;
1353
- return_code: number;
1354
- content: Array<{
1355
- type: "code_execution_output";
1356
- file_id: string;
1357
- }>;
1358
- } | {
1359
- type: "bash_code_execution_result";
1360
- content: Array<{
1361
- type: "bash_code_execution_output";
1362
- file_id: string;
1363
- }>;
1364
- stdout: string;
1365
- stderr: string;
1366
- return_code: number;
1367
- } | {
1368
- type: "bash_code_execution_tool_result_error";
1369
- error_code: string;
1370
- } | {
1371
- type: "text_editor_code_execution_tool_result_error";
1372
- error_code: string;
1373
- } | {
1374
- type: "text_editor_code_execution_view_result";
1375
- content: string;
1376
- file_type: string;
1377
- num_lines: number | null;
1378
- start_line: number | null;
1379
- total_lines: number | null;
1380
- } | {
1381
- type: "text_editor_code_execution_create_result";
1382
- is_file_update: boolean;
1383
- } | {
1384
- type: "text_editor_code_execution_str_replace_result";
1385
- lines: string[] | null;
1386
- new_lines: number | null;
1387
- new_start: number | null;
1388
- old_lines: number | null;
1389
- old_start: number | null;
1390
- }, {}, {}>>[0]) => _ai_sdk_provider_utils.Experimental_ToolCallerTool<_ai_sdk_provider_utils.ProviderExecutedTool<{
1391
- type: "programmatic-tool-call";
1392
- code: string;
1393
- } | {
1394
- type: "bash_code_execution";
1395
- command: string;
1396
- } | {
1397
- type: "text_editor_code_execution";
1398
- command: "view";
1399
- path: string;
1400
- } | {
1401
- type: "text_editor_code_execution";
1402
- command: "create";
1403
- path: string;
1404
- file_text?: string | null;
1405
- } | {
1406
- type: "text_editor_code_execution";
1407
- command: "str_replace";
1408
- path: string;
1409
- old_str: string;
1410
- new_str: string;
1411
- }, {
1412
- type: "code_execution_result";
1413
- stdout: string;
1414
- stderr: string;
1415
- return_code: number;
1416
- content: Array<{
1417
- type: "code_execution_output";
1418
- file_id: string;
1419
- }>;
1420
- } | {
1421
- type: "encrypted_code_execution_result";
1422
- encrypted_stdout: string;
1423
- stderr: string;
1424
- return_code: number;
1425
- content: Array<{
1426
- type: "code_execution_output";
1427
- file_id: string;
1428
- }>;
1429
- } | {
1430
- type: "bash_code_execution_result";
1431
- content: Array<{
1432
- type: "bash_code_execution_output";
1433
- file_id: string;
1434
- }>;
1435
- stdout: string;
1436
- stderr: string;
1437
- return_code: number;
1438
- } | {
1439
- type: "bash_code_execution_tool_result_error";
1440
- error_code: string;
1441
- } | {
1442
- type: "text_editor_code_execution_tool_result_error";
1443
- error_code: string;
1444
- } | {
1445
- type: "text_editor_code_execution_view_result";
1446
- content: string;
1447
- file_type: string;
1448
- num_lines: number | null;
1449
- start_line: number | null;
1450
- total_lines: number | null;
1451
- } | {
1452
- type: "text_editor_code_execution_create_result";
1453
- is_file_update: boolean;
1454
- } | {
1455
- type: "text_editor_code_execution_str_replace_result";
1456
- lines: string[] | null;
1457
- new_lines: number | null;
1458
- new_start: number | null;
1459
- old_lines: number | null;
1460
- old_start: number | null;
1461
- }, {}>>;
1462
- /**
1463
- * Claude can interact with computer environments through the computer use tool, which
1464
- * provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
1465
- *
1466
- * Image results are supported.
1467
- *
1468
- * @param displayWidthPx - The width of the display being controlled by the model in pixels.
1469
- * @param displayHeightPx - The height of the display being controlled by the model in pixels.
1470
- * @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
1471
- */
1472
- computer_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
1473
- action: "key" | "type" | "mouse_move" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "screenshot" | "cursor_position";
1474
- coordinate?: number[];
1475
- text?: string;
1476
- }, {
1477
- displayWidthPx: number;
1478
- displayHeightPx: number;
1479
- displayNumber?: number;
1480
- }, {}>;
1481
- /**
1482
- * Claude can interact with computer environments through the computer use tool, which
1483
- * provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
1484
- *
1485
- * Image results are supported.
1486
- *
1487
- * @param displayWidthPx - The width of the display being controlled by the model in pixels.
1488
- * @param displayHeightPx - The height of the display being controlled by the model in pixels.
1489
- * @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
1490
- */
1491
- computer_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
1492
- action: "key" | "hold_key" | "type" | "cursor_position" | "mouse_move" | "left_mouse_down" | "left_mouse_up" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "triple_click" | "scroll" | "wait" | "screenshot";
1493
- coordinate?: [number, number];
1494
- duration?: number;
1495
- scroll_amount?: number;
1496
- scroll_direction?: "up" | "down" | "left" | "right";
1497
- start_coordinate?: [number, number];
1498
- text?: string;
1499
- }, {
1500
- displayWidthPx: number;
1501
- displayHeightPx: number;
1502
- displayNumber?: number;
1503
- }, {}>;
1504
- /**
1505
- * Claude can interact with computer environments through the computer use tool, which
1506
- * provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
1507
- *
1508
- * This version adds the zoom action for detailed screen region inspection.
1509
- *
1510
- * Image results are supported.
1511
- *
1512
- * Supported models: Claude Opus 4.5
1513
- *
1514
- * @param displayWidthPx - The width of the display being controlled by the model in pixels.
1515
- * @param displayHeightPx - The height of the display being controlled by the model in pixels.
1516
- * @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
1517
- * @param enableZoom - Enable zoom action. Set to true to allow Claude to zoom into specific screen regions. Default: false.
1518
- */
1519
- computer_20251124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
1520
- action: "key" | "hold_key" | "type" | "cursor_position" | "mouse_move" | "left_mouse_down" | "left_mouse_up" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "triple_click" | "scroll" | "wait" | "screenshot" | "zoom";
1521
- coordinate?: [number, number];
1522
- duration?: number;
1523
- region?: [number, number, number, number];
1524
- scroll_amount?: number;
1525
- scroll_direction?: "up" | "down" | "left" | "right";
1526
- start_coordinate?: [number, number];
1527
- text?: string;
1528
- }, {
1529
- displayWidthPx: number;
1530
- displayHeightPx: number;
1531
- displayNumber?: number;
1532
- enableZoom?: boolean;
1533
- }, {}>;
1534
- /**
1535
- * The computer toolset lets Claude control a computer through screenshots,
1536
- * mouse, and keyboard. It replaces the versioned computer tools
1537
- * (`computer_20251124` and earlier) on newer models.
1538
- *
1539
- * The API returns each computer action as its own `tool_use` block with
1540
- * `toolset_name: 'computer'`. The AI SDK maps every member call to this tool
1541
- * and exposes the member name as `action`, so `execute` receives the same
1542
- * input shape as the older computer tools. Claude may return several actions
1543
- * in one turn.
1544
- *
1545
- * Coordinates are always in the pixel space of the screenshots you return;
1546
- * there are no display size parameters. Zoom is enabled by default.
1547
- *
1548
- * Does not require a beta header.
1549
- *
1550
- * Supported models: Claude Opus 5.5 (required; older computer tool types
1551
- * are rejected), Opus 5, Sonnet 5, Fable 5, Fable 5.1, Opus 4.8.
1552
- *
1553
- * @param configs - Per-member settings keyed by member name, e.g.
1554
- * `{ zoom: { enabled: false } }`. Omitted members keep their defaults.
1555
- */
1556
- computerToolset_20260801: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
1557
- action: ComputerToolset_20260801Member;
1558
- coordinate?: [number, number];
1559
- duration?: number;
1560
- region?: [number, number, number, number];
1561
- repeat?: number;
1562
- scroll_amount?: number;
1563
- scroll_direction?: "up" | "down" | "left" | "right";
1564
- start_coordinate?: [number, number];
1565
- text?: string;
1566
- }, {
1567
- configs?: Partial<Record<ComputerToolset_20260801Member, {
1568
- enabled?: boolean;
1569
- deferLoading?: boolean;
1570
- }>>;
1571
- }, {}>;
1572
- /**
1573
- * The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
1574
- * Claude can create, read, update, and delete files that persist between sessions,
1575
- * allowing it to build knowledge over time without keeping everything in the context window.
1576
- * The memory tool operates client-side—you control where and how the data is stored through your own infrastructure.
1577
- *
1578
- * Supported models: Claude Sonnet 4.5, Claude Sonnet 4, Claude Opus 4.1, Claude Opus 4.
1579
- */
1580
- memory_20250818: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
1581
- command: "view";
1582
- path: string;
1583
- view_range?: [number, number];
1584
- } | {
1585
- command: "create";
1586
- path: string;
1587
- file_text: string;
1588
- } | {
1589
- command: "str_replace";
1590
- path: string;
1591
- old_str: string;
1592
- new_str: string;
1593
- } | {
1594
- command: "insert";
1595
- path: string;
1596
- insert_line: number;
1597
- insert_text: string;
1598
- } | {
1599
- command: "delete";
1600
- path: string;
1601
- } | {
1602
- command: "rename";
1603
- old_path: string;
1604
- new_path: string;
1605
- }, {}, {}>;
1606
- /**
1607
- * Claude can use an Anthropic-defined text editor tool to view and modify text files,
1608
- * helping you debug, fix, and improve your code or other text documents. This allows Claude
1609
- * to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
1610
- *
1611
- * Supported models: Claude Sonnet 3.5
1612
- */
1613
- textEditor_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
1614
- command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
1615
- path: string;
1616
- file_text?: string;
1617
- insert_line?: number;
1618
- new_str?: string;
1619
- insert_text?: string;
1620
- old_str?: string;
1621
- view_range?: number[];
1622
- }, {}, {}>;
1623
- /**
1624
- * Claude can use an Anthropic-defined text editor tool to view and modify text files,
1625
- * helping you debug, fix, and improve your code or other text documents. This allows Claude
1626
- * to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
1627
- *
1628
- * Supported models: Claude Sonnet 3.7
1629
- */
1630
- textEditor_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
1631
- command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
1632
- path: string;
1633
- file_text?: string;
1634
- insert_line?: number;
1635
- new_str?: string;
1636
- insert_text?: string;
1637
- old_str?: string;
1638
- view_range?: number[];
1639
- }, {}, {}>;
1640
- /**
1641
- * Claude can use an Anthropic-defined text editor tool to view and modify text files,
1642
- * helping you debug, fix, and improve your code or other text documents. This allows Claude
1643
- * to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
1644
- *
1645
- * Note: This version does not support the "undo_edit" command.
1646
- *
1647
- * @deprecated Use textEditor_20250728 instead
1648
- */
1649
- textEditor_20250429: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
1650
- command: "view" | "create" | "str_replace" | "insert";
1651
- path: string;
1652
- file_text?: string;
1653
- insert_line?: number;
1654
- new_str?: string;
1655
- insert_text?: string;
1656
- old_str?: string;
1657
- view_range?: number[];
1658
- }, {}, {}>;
1659
- /**
1660
- * Claude can use an Anthropic-defined text editor tool to view and modify text files,
1661
- * helping you debug, fix, and improve your code or other text documents. This allows Claude
1662
- * to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
1663
- *
1664
- * Note: This version does not support the "undo_edit" command and adds optional max_characters parameter.
1665
- *
1666
- * Supported models: Claude Sonnet 4, Opus 4, and Opus 4.1
1667
- *
1668
- * @param maxCharacters - Optional maximum number of characters to view in the file
1669
- */
1670
- textEditor_20250728: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactory<{
1671
- command: "view" | "create" | "str_replace" | "insert";
1672
- path: string;
1673
- file_text?: string;
1674
- insert_line?: number;
1675
- new_str?: string;
1676
- insert_text?: string;
1677
- old_str?: string;
1678
- view_range?: number[];
1679
- }, {
1680
- maxCharacters?: number;
1681
- }, {}>>[0]) => _ai_sdk_provider_utils.ProviderDefinedTool<{
1682
- command: "view" | "create" | "str_replace" | "insert";
1683
- path: string;
1684
- file_text?: string;
1685
- insert_line?: number;
1686
- new_str?: string;
1687
- insert_text?: string;
1688
- old_str?: string;
1689
- view_range?: number[];
1690
- }, unknown, {}>;
1691
- /**
1692
- * Creates a web fetch tool that gives Claude direct access to real-time web content.
1693
- *
1694
- * @param maxUses - The max_uses parameter limits the number of web fetches performed
1695
- * @param allowedDomains - Only fetch from these domains
1696
- * @param blockedDomains - Never fetch from these domains
1697
- * @param citations - Unlike web search where citations are always enabled, citations are optional for web fetch. Set "citations": {"enabled": true} to enable Claude to cite specific passages from fetched documents.
1698
- * @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
1699
- */
1700
- webFetch_20250910: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
1701
- url: string;
1702
- }, {
1703
- type: "web_fetch_result";
1704
- url: string;
1705
- content: {
1706
- type: "document";
1707
- title: string | null;
1708
- citations?: {
1709
- enabled: boolean;
1710
- };
1711
- source: {
1712
- type: "base64";
1713
- mediaType: "application/pdf";
1714
- data: string;
1715
- } | {
1716
- type: "text";
1717
- mediaType: "text/plain";
1718
- data: string;
1719
- };
1720
- };
1721
- retrievedAt: string | null;
1722
- }, {
1723
- maxUses?: number;
1724
- allowedDomains?: string[];
1725
- blockedDomains?: string[];
1726
- citations?: {
1727
- enabled: boolean;
1728
- };
1729
- maxContentTokens?: number;
1730
- }, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
1731
- url: string;
1732
- }, {
1733
- type: "web_fetch_result";
1734
- url: string;
1735
- content: {
1736
- type: "document";
1737
- title: string | null;
1738
- citations?: {
1739
- enabled: boolean;
1740
- };
1741
- source: {
1742
- type: "base64";
1743
- mediaType: "application/pdf";
1744
- data: string;
1745
- } | {
1746
- type: "text";
1747
- mediaType: "text/plain";
1748
- data: string;
1749
- };
1750
- };
1751
- retrievedAt: string | null;
1752
- }, {}>;
1753
- /**
1754
- * Creates a web fetch tool that gives Claude direct access to real-time web content.
1755
- *
1756
- * @param maxUses - The max_uses parameter limits the number of web fetches performed
1757
- * @param allowedDomains - Only fetch from these domains
1758
- * @param blockedDomains - Never fetch from these domains
1759
- * @param citations - Unlike web search where citations are always enabled, citations are optional for web fetch. Set "citations": {"enabled": true} to enable Claude to cite specific passages from fetched documents.
1760
- * @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
1761
- */
1762
- webFetch_20260209: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
1763
- url: string;
1764
- }, {
1765
- type: "web_fetch_result";
1766
- url: string;
1767
- content: {
1768
- type: "document";
1769
- title: string | null;
1770
- citations?: {
1771
- enabled: boolean;
1772
- };
1773
- source: {
1774
- type: "base64";
1775
- mediaType: "application/pdf";
1776
- data: string;
1777
- } | {
1778
- type: "text";
1779
- mediaType: "text/plain";
1780
- data: string;
1781
- };
1782
- };
1783
- retrievedAt: string | null;
1784
- }, {
1785
- maxUses?: number;
1786
- allowedDomains?: string[];
1787
- blockedDomains?: string[];
1788
- citations?: {
1789
- enabled: boolean;
1790
- };
1791
- maxContentTokens?: number;
1792
- }, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
1793
- url: string;
1794
- }, {
1795
- type: "web_fetch_result";
1796
- url: string;
1797
- content: {
1798
- type: "document";
1799
- title: string | null;
1800
- citations?: {
1801
- enabled: boolean;
1802
- };
1803
- source: {
1804
- type: "base64";
1805
- mediaType: "application/pdf";
1806
- data: string;
1807
- } | {
1808
- type: "text";
1809
- mediaType: "text/plain";
1810
- data: string;
1811
- };
1812
- };
1813
- retrievedAt: string | null;
1814
- }, {}>;
1815
- /**
1816
- * Creates a web fetch tool that gives Claude direct access to real-time web content.
1817
- *
1818
- * @param maxUses - The max_uses parameter limits the number of web fetches performed
1819
- * @param allowedDomains - Only fetch from these domains
1820
- * @param blockedDomains - Never fetch from these domains
1821
- * @param citations - Unlike web search where citations are always enabled, citations are optional for web fetch. Set "citations": {"enabled": true} to enable Claude to cite specific passages from fetched documents.
1822
- * @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
1823
- * @param useCache - Whether cached content may be returned. Set to false to fetch fresh content.
1824
- * @param responseInclusion - Whether result blocks consumed by completed code execution calls are returned. Defaults to "full".
1825
- */
1826
- webFetch_20260318: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
1827
- url: string;
1828
- }, {
1829
- type: "web_fetch_result";
1830
- url: string;
1831
- content: {
1832
- type: "document";
1833
- title: string | null;
1834
- citations?: {
1835
- enabled: boolean;
1836
- };
1837
- source: {
1838
- type: "base64";
1839
- mediaType: "application/pdf";
1840
- data: string;
1841
- } | {
1842
- type: "text";
1843
- mediaType: "text/plain";
1844
- data: string;
1845
- };
1846
- };
1847
- retrievedAt: string | null;
1848
- }, {
1849
- maxUses?: number;
1850
- allowedDomains?: string[];
1851
- blockedDomains?: string[];
1852
- citations?: {
1853
- enabled: boolean;
1854
- };
1855
- maxContentTokens?: number;
1856
- useCache?: boolean;
1857
- responseInclusion?: "full" | "excluded";
1858
- }, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
1859
- url: string;
1860
- }, {
1861
- type: "web_fetch_result";
1862
- url: string;
1863
- content: {
1864
- type: "document";
1865
- title: string | null;
1866
- citations?: {
1867
- enabled: boolean;
1868
- };
1869
- source: {
1870
- type: "base64";
1871
- mediaType: "application/pdf";
1872
- data: string;
1873
- } | {
1874
- type: "text";
1875
- mediaType: "text/plain";
1876
- data: string;
1877
- };
1878
- };
1879
- retrievedAt: string | null;
1880
- }, {}>;
1881
- /**
1882
- * Creates a web search tool that gives Claude direct access to real-time web content.
1883
- *
1884
- * @param maxUses - Maximum number of web searches Claude can perform during the conversation.
1885
- * @param allowedDomains - Optional list of domains that Claude is allowed to search.
1886
- * @param blockedDomains - Optional list of domains that Claude should avoid when searching.
1887
- * @param userLocation - Optional user location information to provide geographically relevant search results.
1888
- */
1889
- webSearch_20250305: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
1890
- query: string;
1891
- }, {
1892
- type: "web_search_result";
1893
- url: string;
1894
- title: string | null;
1895
- pageAge: string | null;
1896
- encryptedContent: string;
1897
- }[], {
1898
- maxUses?: number;
1899
- allowedDomains?: string[];
1900
- blockedDomains?: string[];
1901
- userLocation?: {
1902
- type: "approximate";
1903
- city?: string;
1904
- region?: string;
1905
- country?: string;
1906
- timezone?: string;
1907
- };
1908
- }, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
1909
- query: string;
1910
- }, {
1911
- type: "web_search_result";
1912
- url: string;
1913
- title: string | null;
1914
- pageAge: string | null;
1915
- encryptedContent: string;
1916
- }[], {}>;
1917
- /**
1918
- * Creates a web search tool that gives Claude direct access to real-time web content.
1919
- *
1920
- * @param maxUses - Maximum number of web searches Claude can perform during the conversation.
1921
- * @param allowedDomains - Optional list of domains that Claude is allowed to search.
1922
- * @param blockedDomains - Optional list of domains that Claude should avoid when searching.
1923
- * @param userLocation - Optional user location information to provide geographically relevant search results.
1924
- */
1925
- webSearch_20260209: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
1926
- query: string;
1927
- }, {
1928
- type: "web_search_result";
1929
- url: string;
1930
- title: string | null;
1931
- pageAge: string | null;
1932
- encryptedContent: string;
1933
- }[], {
1934
- maxUses?: number;
1935
- allowedDomains?: string[];
1936
- blockedDomains?: string[];
1937
- userLocation?: {
1938
- type: "approximate";
1939
- city?: string;
1940
- region?: string;
1941
- country?: string;
1942
- timezone?: string;
1943
- };
1944
- }, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
1945
- query: string;
1946
- }, {
1947
- type: "web_search_result";
1948
- url: string;
1949
- title: string | null;
1950
- pageAge: string | null;
1951
- encryptedContent: string;
1952
- }[], {}>;
1953
- /**
1954
- * Creates a web search tool that gives Claude direct access to real-time web content.
1955
- *
1956
- * @param maxUses - Maximum number of web searches Claude can perform during the conversation.
1957
- * @param allowedDomains - Optional list of domains that Claude is allowed to search.
1958
- * @param blockedDomains - Optional list of domains that Claude should avoid when searching.
1959
- * @param userLocation - Optional user location information to provide geographically relevant search results.
1960
- * @param responseInclusion - Whether result blocks consumed by completed code execution calls are returned. Defaults to "full".
1961
- */
1962
- webSearch_20260318: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
1963
- query: string;
1964
- }, {
1965
- type: "web_search_result";
1966
- url: string;
1967
- title: string | null;
1968
- pageAge: string | null;
1969
- encryptedContent: string;
1970
- }[], {
1971
- maxUses?: number;
1972
- allowedDomains?: string[];
1973
- blockedDomains?: string[];
1974
- userLocation?: {
1975
- type: "approximate";
1976
- city?: string;
1977
- region?: string;
1978
- country?: string;
1979
- timezone?: string;
1980
- };
1981
- responseInclusion?: "full" | "excluded";
1982
- }, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
1983
- query: string;
1984
- }, {
1985
- type: "web_search_result";
1986
- url: string;
1987
- title: string | null;
1988
- pageAge: string | null;
1989
- encryptedContent: string;
1990
- }[], {}>;
1991
- /**
1992
- * Creates a tool search tool that uses regex patterns to find tools.
1993
- *
1994
- * The tool search tool enables Claude to work with hundreds or thousands of tools
1995
- * by dynamically discovering and loading them on-demand. Instead of loading all
1996
- * tool definitions into the context window upfront, Claude searches your tool
1997
- * catalog and loads only the tools it needs.
1998
- *
1999
- * Use `providerOptions: { anthropic: { deferLoading: true } }` on other tools
2000
- * to mark them for deferred loading.
2001
- *
2002
- * Supported models: Claude Opus 4.5, Claude Sonnet 4.5
2003
- */
2004
- toolSearchRegex_20251119: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
2005
- pattern: string;
2006
- limit?: number;
2007
- }, {
2008
- type: "tool_reference";
2009
- toolName: string;
2010
- }[], {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
2011
- pattern: string;
2012
- limit?: number;
2013
- }, {
2014
- type: "tool_reference";
2015
- toolName: string;
2016
- }[], {}>;
2017
- /**
2018
- * Creates a tool search tool that uses BM25 (natural language) to find tools.
2019
- *
2020
- * The tool search tool enables Claude to work with hundreds or thousands of tools
2021
- * by dynamically discovering and loading them on-demand. Instead of loading all
2022
- * tool definitions into the context window upfront, Claude searches your tool
2023
- * catalog and loads only the tools it needs.
2024
- *
2025
- * Use `providerOptions: { anthropic: { deferLoading: true } }` on other tools
2026
- * to mark them for deferred loading.
2027
- *
2028
- * Supported models: Claude Opus 4.5, Claude Sonnet 4.5
2029
- */
2030
- toolSearchBm25_20251119: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
2031
- query: string;
2032
- limit?: number;
2033
- }, {
2034
- type: "tool_reference";
2035
- toolName: string;
2036
- }[], {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
2037
- query: string;
2038
- limit?: number;
2039
- }, {
2040
- type: "tool_reference";
2041
- toolName: string;
2042
- }[], {}>;
1086
+ //#endregion
1087
+ //#region src/anthropic-tools.d.ts
1088
+ export declare const anthropicTools: {
1089
+ /**
1090
+ * Pairs a faster executor model with a higher-intelligence advisor model
1091
+ * that provides strategic guidance mid-generation.
1092
+ *
1093
+ * The advisor lets a faster, lower-cost executor model consult a
1094
+ * higher-intelligence advisor model server-side. The advisor reads the
1095
+ * executor's full transcript and produces a plan or course correction;
1096
+ * the executor continues with the task, informed by the advice. All of
1097
+ * this happens inside a single `/v1/messages` request.
1098
+ *
1099
+ * Beta header `advisor-tool-2026-03-01` is added automatically when this
1100
+ * tool is included.
1101
+ *
1102
+ * Multi-turn conversations: pass the full assistant content (including
1103
+ * `advisor_tool_result` blocks) back to the API on subsequent turns. If
1104
+ * you omit the advisor tool from `tools` on a follow-up turn while the
1105
+ * message history still contains `advisor_tool_result` blocks, the API
1106
+ * returns a `400 invalid_request_error`.
1107
+ *
1108
+ * Supported executor models: Claude Haiku 4.5, Sonnet 4.6, Opus 4.6,
1109
+ * Opus 4.7. The advisor must be at least as capable as the executor.
1110
+ *
1111
+ * @param model - The advisor model ID (required), e.g. `"claude-opus-4-8"`.
1112
+ * @param maxUses - Maximum advisor calls per request (per-request cap).
1113
+ * @param maxTokens - Maximum advisor output tokens per call, including
1114
+ * thinking and text. Minimum 1024; Anthropic recommends starting with 2048.
1115
+ * @param caching - Enables prompt caching for the advisor's transcript
1116
+ * across calls within a conversation. Worthwhile from ~3 advisor calls
1117
+ * per conversation.
1118
+ */
1119
+ advisor_20260301: (args: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {
1120
+ type: "advisor_result";
1121
+ text: string;
1122
+ stopReason?: string;
1123
+ } | {
1124
+ type: "advisor_redacted_result";
1125
+ encryptedContent: string;
1126
+ stopReason?: string;
1127
+ } | {
1128
+ type: "advisor_tool_result_error";
1129
+ errorCode: string;
1130
+ }, {
1131
+ model: string;
1132
+ maxUses?: number;
1133
+ maxTokens?: number;
1134
+ caching?: {
1135
+ type: "ephemeral";
1136
+ ttl: "5m" | "1h";
1137
+ };
1138
+ }, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{}, {
1139
+ type: "advisor_result";
1140
+ text: string;
1141
+ stopReason?: string;
1142
+ } | {
1143
+ type: "advisor_redacted_result";
1144
+ encryptedContent: string;
1145
+ stopReason?: string;
1146
+ } | {
1147
+ type: "advisor_tool_result_error";
1148
+ errorCode: string;
1149
+ }, {}>;
1150
+ /**
1151
+ * The bash tool enables Claude to execute shell commands in a persistent bash session,
1152
+ * allowing system operations, script execution, and command-line automation.
1153
+ *
1154
+ * Image results are supported.
1155
+ */
1156
+ bash_20241022: typeof bash_20241022;
1157
+ /**
1158
+ * The bash tool enables Claude to execute shell commands in a persistent bash session,
1159
+ * allowing system operations, script execution, and command-line automation.
1160
+ *
1161
+ * Image results are supported.
1162
+ */
1163
+ bash_20250124: typeof bash_20250124;
1164
+ /**
1165
+ * Claude can analyze data, create visualizations, perform complex calculations,
1166
+ * run system commands, create and edit files, and process uploaded files directly within
1167
+ * the API conversation.
1168
+ *
1169
+ * The code execution tool allows Claude to run Bash commands and manipulate files,
1170
+ * including writing code, in a secure, sandboxed environment.
1171
+ */
1172
+ codeExecution_20250522: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
1173
+ code: string;
1174
+ }, {
1175
+ type: "code_execution_result";
1176
+ stdout: string;
1177
+ stderr: string;
1178
+ return_code: number;
1179
+ content: Array<{
1180
+ type: "code_execution_output";
1181
+ file_id: string;
1182
+ }>;
1183
+ }, {}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
1184
+ code: string;
1185
+ }, {
1186
+ type: "code_execution_result";
1187
+ stdout: string;
1188
+ stderr: string;
1189
+ return_code: number;
1190
+ content: Array<{
1191
+ type: "code_execution_output";
1192
+ file_id: string;
1193
+ }>;
1194
+ }, {}>;
1195
+ /**
1196
+ * Claude can analyze data, create visualizations, perform complex calculations,
1197
+ * run system commands, create and edit files, and process uploaded files directly within
1198
+ * the API conversation.
1199
+ *
1200
+ * The code execution tool allows Claude to run both Python and Bash commands and manipulate files,
1201
+ * including writing code, in a secure, sandboxed environment.
1202
+ *
1203
+ * This is the latest version with enhanced Bash support and file operations.
1204
+ */
1205
+ codeExecution_20250825: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
1206
+ type: "programmatic-tool-call";
1207
+ code: string;
1208
+ } | {
1209
+ type: "bash_code_execution";
1210
+ command: string;
1211
+ } | {
1212
+ type: "text_editor_code_execution";
1213
+ command: "view";
1214
+ path: string;
1215
+ } | {
1216
+ type: "text_editor_code_execution";
1217
+ command: "create";
1218
+ path: string;
1219
+ file_text?: string | null;
1220
+ } | {
1221
+ type: "text_editor_code_execution";
1222
+ command: "str_replace";
1223
+ path: string;
1224
+ old_str: string;
1225
+ new_str: string;
1226
+ }, {
1227
+ type: "code_execution_result";
1228
+ stdout: string;
1229
+ stderr: string;
1230
+ return_code: number;
1231
+ content: Array<{
1232
+ type: "code_execution_output";
1233
+ file_id: string;
1234
+ }>;
1235
+ } | {
1236
+ type: "bash_code_execution_result";
1237
+ content: Array<{
1238
+ type: "bash_code_execution_output";
1239
+ file_id: string;
1240
+ }>;
1241
+ stdout: string;
1242
+ stderr: string;
1243
+ return_code: number;
1244
+ } | {
1245
+ type: "bash_code_execution_tool_result_error";
1246
+ error_code: string;
1247
+ } | {
1248
+ type: "text_editor_code_execution_tool_result_error";
1249
+ error_code: string;
1250
+ } | {
1251
+ type: "text_editor_code_execution_view_result";
1252
+ content: string;
1253
+ file_type: string;
1254
+ num_lines: number | null;
1255
+ start_line: number | null;
1256
+ total_lines: number | null;
1257
+ } | {
1258
+ type: "text_editor_code_execution_create_result";
1259
+ is_file_update: boolean;
1260
+ } | {
1261
+ type: "text_editor_code_execution_str_replace_result";
1262
+ lines: string[] | null;
1263
+ new_lines: number | null;
1264
+ new_start: number | null;
1265
+ old_lines: number | null;
1266
+ old_start: number | null;
1267
+ }, {}, {}>>[0]) => import("@ai-sdk/provider-utils").Experimental_ToolCallerTool<import("@ai-sdk/provider-utils").ProviderExecutedTool<{
1268
+ type: "programmatic-tool-call";
1269
+ code: string;
1270
+ } | {
1271
+ type: "bash_code_execution";
1272
+ command: string;
1273
+ } | {
1274
+ type: "text_editor_code_execution";
1275
+ command: "view";
1276
+ path: string;
1277
+ } | {
1278
+ type: "text_editor_code_execution";
1279
+ command: "create";
1280
+ path: string;
1281
+ file_text?: string | null;
1282
+ } | {
1283
+ type: "text_editor_code_execution";
1284
+ command: "str_replace";
1285
+ path: string;
1286
+ old_str: string;
1287
+ new_str: string;
1288
+ }, {
1289
+ type: "code_execution_result";
1290
+ stdout: string;
1291
+ stderr: string;
1292
+ return_code: number;
1293
+ content: Array<{
1294
+ type: "code_execution_output";
1295
+ file_id: string;
1296
+ }>;
1297
+ } | {
1298
+ type: "bash_code_execution_result";
1299
+ content: Array<{
1300
+ type: "bash_code_execution_output";
1301
+ file_id: string;
1302
+ }>;
1303
+ stdout: string;
1304
+ stderr: string;
1305
+ return_code: number;
1306
+ } | {
1307
+ type: "bash_code_execution_tool_result_error";
1308
+ error_code: string;
1309
+ } | {
1310
+ type: "text_editor_code_execution_tool_result_error";
1311
+ error_code: string;
1312
+ } | {
1313
+ type: "text_editor_code_execution_view_result";
1314
+ content: string;
1315
+ file_type: string;
1316
+ num_lines: number | null;
1317
+ start_line: number | null;
1318
+ total_lines: number | null;
1319
+ } | {
1320
+ type: "text_editor_code_execution_create_result";
1321
+ is_file_update: boolean;
1322
+ } | {
1323
+ type: "text_editor_code_execution_str_replace_result";
1324
+ lines: string[] | null;
1325
+ new_lines: number | null;
1326
+ new_start: number | null;
1327
+ old_lines: number | null;
1328
+ old_start: number | null;
1329
+ }, {}>>;
1330
+ /**
1331
+ * Claude can analyze data, create visualizations, perform complex calculations,
1332
+ * run system commands, create and edit files, and process uploaded files directly within
1333
+ * the API conversation.
1334
+ *
1335
+ * The code execution tool allows Claude to run both Python and Bash commands and manipulate files,
1336
+ * including writing code, in a secure, sandboxed environment.
1337
+ *
1338
+ * This is the recommended version. Does not require a beta header.
1339
+ *
1340
+ * Supported models: Claude Opus 4.6, Sonnet 4.6, Sonnet 4.5, Opus 4.5
1341
+ */
1342
+ codeExecution_20260120: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
1343
+ type: "programmatic-tool-call";
1344
+ code: string;
1345
+ } | {
1346
+ type: "bash_code_execution";
1347
+ command: string;
1348
+ } | {
1349
+ type: "text_editor_code_execution";
1350
+ command: "view";
1351
+ path: string;
1352
+ } | {
1353
+ type: "text_editor_code_execution";
1354
+ command: "create";
1355
+ path: string;
1356
+ file_text?: string | null;
1357
+ } | {
1358
+ type: "text_editor_code_execution";
1359
+ command: "str_replace";
1360
+ path: string;
1361
+ old_str: string;
1362
+ new_str: string;
1363
+ }, {
1364
+ type: "code_execution_result";
1365
+ stdout: string;
1366
+ stderr: string;
1367
+ return_code: number;
1368
+ content: Array<{
1369
+ type: "code_execution_output";
1370
+ file_id: string;
1371
+ }>;
1372
+ } | {
1373
+ type: "encrypted_code_execution_result";
1374
+ encrypted_stdout: string;
1375
+ stderr: string;
1376
+ return_code: number;
1377
+ content: Array<{
1378
+ type: "code_execution_output";
1379
+ file_id: string;
1380
+ }>;
1381
+ } | {
1382
+ type: "bash_code_execution_result";
1383
+ content: Array<{
1384
+ type: "bash_code_execution_output";
1385
+ file_id: string;
1386
+ }>;
1387
+ stdout: string;
1388
+ stderr: string;
1389
+ return_code: number;
1390
+ } | {
1391
+ type: "bash_code_execution_tool_result_error";
1392
+ error_code: string;
1393
+ } | {
1394
+ type: "text_editor_code_execution_tool_result_error";
1395
+ error_code: string;
1396
+ } | {
1397
+ type: "text_editor_code_execution_view_result";
1398
+ content: string;
1399
+ file_type: string;
1400
+ num_lines: number | null;
1401
+ start_line: number | null;
1402
+ total_lines: number | null;
1403
+ } | {
1404
+ type: "text_editor_code_execution_create_result";
1405
+ is_file_update: boolean;
1406
+ } | {
1407
+ type: "text_editor_code_execution_str_replace_result";
1408
+ lines: string[] | null;
1409
+ new_lines: number | null;
1410
+ new_start: number | null;
1411
+ old_lines: number | null;
1412
+ old_start: number | null;
1413
+ }, {}, {}>>[0]) => import("@ai-sdk/provider-utils").Experimental_ToolCallerTool<import("@ai-sdk/provider-utils").ProviderExecutedTool<{
1414
+ type: "programmatic-tool-call";
1415
+ code: string;
1416
+ } | {
1417
+ type: "bash_code_execution";
1418
+ command: string;
1419
+ } | {
1420
+ type: "text_editor_code_execution";
1421
+ command: "view";
1422
+ path: string;
1423
+ } | {
1424
+ type: "text_editor_code_execution";
1425
+ command: "create";
1426
+ path: string;
1427
+ file_text?: string | null;
1428
+ } | {
1429
+ type: "text_editor_code_execution";
1430
+ command: "str_replace";
1431
+ path: string;
1432
+ old_str: string;
1433
+ new_str: string;
1434
+ }, {
1435
+ type: "code_execution_result";
1436
+ stdout: string;
1437
+ stderr: string;
1438
+ return_code: number;
1439
+ content: Array<{
1440
+ type: "code_execution_output";
1441
+ file_id: string;
1442
+ }>;
1443
+ } | {
1444
+ type: "encrypted_code_execution_result";
1445
+ encrypted_stdout: string;
1446
+ stderr: string;
1447
+ return_code: number;
1448
+ content: Array<{
1449
+ type: "code_execution_output";
1450
+ file_id: string;
1451
+ }>;
1452
+ } | {
1453
+ type: "bash_code_execution_result";
1454
+ content: Array<{
1455
+ type: "bash_code_execution_output";
1456
+ file_id: string;
1457
+ }>;
1458
+ stdout: string;
1459
+ stderr: string;
1460
+ return_code: number;
1461
+ } | {
1462
+ type: "bash_code_execution_tool_result_error";
1463
+ error_code: string;
1464
+ } | {
1465
+ type: "text_editor_code_execution_tool_result_error";
1466
+ error_code: string;
1467
+ } | {
1468
+ type: "text_editor_code_execution_view_result";
1469
+ content: string;
1470
+ file_type: string;
1471
+ num_lines: number | null;
1472
+ start_line: number | null;
1473
+ total_lines: number | null;
1474
+ } | {
1475
+ type: "text_editor_code_execution_create_result";
1476
+ is_file_update: boolean;
1477
+ } | {
1478
+ type: "text_editor_code_execution_str_replace_result";
1479
+ lines: string[] | null;
1480
+ new_lines: number | null;
1481
+ new_start: number | null;
1482
+ old_lines: number | null;
1483
+ old_start: number | null;
1484
+ }, {}>>;
1485
+ /**
1486
+ * Claude can interact with computer environments through the computer use tool, which
1487
+ * provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
1488
+ *
1489
+ * Image results are supported.
1490
+ *
1491
+ * @param displayWidthPx - The width of the display being controlled by the model in pixels.
1492
+ * @param displayHeightPx - The height of the display being controlled by the model in pixels.
1493
+ * @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
1494
+ */
1495
+ computer_20241022: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
1496
+ action: "key" | "type" | "mouse_move" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "screenshot" | "cursor_position";
1497
+ coordinate?: number[];
1498
+ text?: string;
1499
+ }, {
1500
+ displayWidthPx: number;
1501
+ displayHeightPx: number;
1502
+ displayNumber?: number;
1503
+ }, {}>;
1504
+ /**
1505
+ * Claude can interact with computer environments through the computer use tool, which
1506
+ * provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
1507
+ *
1508
+ * Image results are supported.
1509
+ *
1510
+ * @param displayWidthPx - The width of the display being controlled by the model in pixels.
1511
+ * @param displayHeightPx - The height of the display being controlled by the model in pixels.
1512
+ * @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
1513
+ */
1514
+ computer_20250124: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
1515
+ action: "key" | "hold_key" | "type" | "cursor_position" | "mouse_move" | "left_mouse_down" | "left_mouse_up" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "triple_click" | "scroll" | "wait" | "screenshot";
1516
+ coordinate?: [number, number];
1517
+ duration?: number;
1518
+ scroll_amount?: number;
1519
+ scroll_direction?: "up" | "down" | "left" | "right";
1520
+ start_coordinate?: [number, number];
1521
+ text?: string;
1522
+ }, {
1523
+ displayWidthPx: number;
1524
+ displayHeightPx: number;
1525
+ displayNumber?: number;
1526
+ }, {}>;
1527
+ /**
1528
+ * Claude can interact with computer environments through the computer use tool, which
1529
+ * provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
1530
+ *
1531
+ * This version adds the zoom action for detailed screen region inspection.
1532
+ *
1533
+ * Image results are supported.
1534
+ *
1535
+ * Supported models: Claude Opus 4.5
1536
+ *
1537
+ * @param displayWidthPx - The width of the display being controlled by the model in pixels.
1538
+ * @param displayHeightPx - The height of the display being controlled by the model in pixels.
1539
+ * @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
1540
+ * @param enableZoom - Enable zoom action. Set to true to allow Claude to zoom into specific screen regions. Default: false.
1541
+ */
1542
+ computer_20251124: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
1543
+ action: "key" | "hold_key" | "type" | "cursor_position" | "mouse_move" | "left_mouse_down" | "left_mouse_up" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "triple_click" | "scroll" | "wait" | "screenshot" | "zoom";
1544
+ coordinate?: [number, number];
1545
+ duration?: number;
1546
+ region?: [number, number, number, number];
1547
+ scroll_amount?: number;
1548
+ scroll_direction?: "up" | "down" | "left" | "right";
1549
+ start_coordinate?: [number, number];
1550
+ text?: string;
1551
+ }, {
1552
+ displayWidthPx: number;
1553
+ displayHeightPx: number;
1554
+ displayNumber?: number;
1555
+ enableZoom?: boolean;
1556
+ }, {}>;
1557
+ /**
1558
+ * The computer toolset lets Claude control a computer through screenshots,
1559
+ * mouse, and keyboard. It replaces the versioned computer tools
1560
+ * (`computer_20251124` and earlier) on newer models.
1561
+ *
1562
+ * The API returns each computer action as its own `tool_use` block with
1563
+ * `toolset_name: 'computer'`. The AI SDK maps every member call to this tool
1564
+ * and exposes the member name as `action`, so `execute` receives the same
1565
+ * input shape as the older computer tools. Claude may return several actions
1566
+ * in one turn.
1567
+ *
1568
+ * Coordinates are always in the pixel space of the screenshots you return;
1569
+ * there are no display size parameters. Zoom is enabled by default.
1570
+ *
1571
+ * Does not require a beta header.
1572
+ *
1573
+ * Supported models: Claude Opus 5.5 (required; older computer tool types
1574
+ * are rejected), Opus 5, Sonnet 5, Fable 5, Fable 5.1, Opus 4.8.
1575
+ *
1576
+ * @param configs - Per-member settings keyed by member name, e.g.
1577
+ * `{ zoom: { enabled: false } }`. Omitted members keep their defaults.
1578
+ */
1579
+ computerToolset_20260801: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
1580
+ action: ComputerToolset_20260801Member;
1581
+ coordinate?: [number, number];
1582
+ duration?: number;
1583
+ region?: [number, number, number, number];
1584
+ repeat?: number;
1585
+ scroll_amount?: number;
1586
+ scroll_direction?: "up" | "down" | "left" | "right";
1587
+ start_coordinate?: [number, number];
1588
+ text?: string;
1589
+ }, {
1590
+ configs?: Partial<Record<ComputerToolset_20260801Member, {
1591
+ enabled?: boolean;
1592
+ deferLoading?: boolean;
1593
+ }>>;
1594
+ }, {}>;
1595
+ /**
1596
+ * The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
1597
+ * Claude can create, read, update, and delete files that persist between sessions,
1598
+ * allowing it to build knowledge over time without keeping everything in the context window.
1599
+ * The memory tool operates client-side—you control where and how the data is stored through your own infrastructure.
1600
+ *
1601
+ * Supported models: Claude Sonnet 4.5, Claude Sonnet 4, Claude Opus 4.1, Claude Opus 4.
1602
+ */
1603
+ memory_20250818: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
1604
+ command: "view";
1605
+ path: string;
1606
+ view_range?: [number, number];
1607
+ } | {
1608
+ command: "create";
1609
+ path: string;
1610
+ file_text: string;
1611
+ } | {
1612
+ command: "str_replace";
1613
+ path: string;
1614
+ old_str: string;
1615
+ new_str: string;
1616
+ } | {
1617
+ command: "insert";
1618
+ path: string;
1619
+ insert_line: number;
1620
+ insert_text: string;
1621
+ } | {
1622
+ command: "delete";
1623
+ path: string;
1624
+ } | {
1625
+ command: "rename";
1626
+ old_path: string;
1627
+ new_path: string;
1628
+ }, {}, {}>;
1629
+ /**
1630
+ * Claude can use an Anthropic-defined text editor tool to view and modify text files,
1631
+ * helping you debug, fix, and improve your code or other text documents. This allows Claude
1632
+ * to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
1633
+ *
1634
+ * Supported models: Claude Sonnet 3.5
1635
+ */
1636
+ textEditor_20241022: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
1637
+ command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
1638
+ path: string;
1639
+ file_text?: string;
1640
+ insert_line?: number;
1641
+ new_str?: string;
1642
+ insert_text?: string;
1643
+ old_str?: string;
1644
+ view_range?: number[];
1645
+ }, {}, {}>;
1646
+ /**
1647
+ * Claude can use an Anthropic-defined text editor tool to view and modify text files,
1648
+ * helping you debug, fix, and improve your code or other text documents. This allows Claude
1649
+ * to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
1650
+ *
1651
+ * Supported models: Claude Sonnet 3.7
1652
+ */
1653
+ textEditor_20250124: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
1654
+ command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
1655
+ path: string;
1656
+ file_text?: string;
1657
+ insert_line?: number;
1658
+ new_str?: string;
1659
+ insert_text?: string;
1660
+ old_str?: string;
1661
+ view_range?: number[];
1662
+ }, {}, {}>;
1663
+ /**
1664
+ * Claude can use an Anthropic-defined text editor tool to view and modify text files,
1665
+ * helping you debug, fix, and improve your code or other text documents. This allows Claude
1666
+ * to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
1667
+ *
1668
+ * Note: This version does not support the "undo_edit" command.
1669
+ *
1670
+ * @deprecated Use textEditor_20250728 instead
1671
+ */
1672
+ textEditor_20250429: import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
1673
+ command: "view" | "create" | "str_replace" | "insert";
1674
+ path: string;
1675
+ file_text?: string;
1676
+ insert_line?: number;
1677
+ new_str?: string;
1678
+ insert_text?: string;
1679
+ old_str?: string;
1680
+ view_range?: number[];
1681
+ }, {}, {}>;
1682
+ /**
1683
+ * Claude can use an Anthropic-defined text editor tool to view and modify text files,
1684
+ * helping you debug, fix, and improve your code or other text documents. This allows Claude
1685
+ * to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
1686
+ *
1687
+ * Note: This version does not support the "undo_edit" command and adds optional max_characters parameter.
1688
+ *
1689
+ * Supported models: Claude Sonnet 4, Opus 4, and Opus 4.1
1690
+ *
1691
+ * @param maxCharacters - Optional maximum number of characters to view in the file
1692
+ */
1693
+ textEditor_20250728: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderDefinedToolFactory<{
1694
+ command: "view" | "create" | "str_replace" | "insert";
1695
+ path: string;
1696
+ file_text?: string;
1697
+ insert_line?: number;
1698
+ new_str?: string;
1699
+ insert_text?: string;
1700
+ old_str?: string;
1701
+ view_range?: number[];
1702
+ }, {
1703
+ maxCharacters?: number;
1704
+ }, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderDefinedTool<{
1705
+ command: "view" | "create" | "str_replace" | "insert";
1706
+ path: string;
1707
+ file_text?: string;
1708
+ insert_line?: number;
1709
+ new_str?: string;
1710
+ insert_text?: string;
1711
+ old_str?: string;
1712
+ view_range?: number[];
1713
+ }, unknown, {}>;
1714
+ /**
1715
+ * Creates a web fetch tool that gives Claude direct access to real-time web content.
1716
+ *
1717
+ * @param maxUses - The max_uses parameter limits the number of web fetches performed
1718
+ * @param allowedDomains - Only fetch from these domains
1719
+ * @param blockedDomains - Never fetch from these domains
1720
+ * @param citations - Unlike web search where citations are always enabled, citations are optional for web fetch. Set "citations": {"enabled": true} to enable Claude to cite specific passages from fetched documents.
1721
+ * @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
1722
+ */
1723
+ webFetch_20250910: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
1724
+ url: string;
1725
+ }, {
1726
+ type: "web_fetch_result";
1727
+ url: string;
1728
+ content: {
1729
+ type: "document";
1730
+ title: string | null;
1731
+ citations?: {
1732
+ enabled: boolean;
1733
+ };
1734
+ source: {
1735
+ type: "base64";
1736
+ mediaType: "application/pdf";
1737
+ data: string;
1738
+ } | {
1739
+ type: "text";
1740
+ mediaType: "text/plain";
1741
+ data: string;
1742
+ };
1743
+ };
1744
+ retrievedAt: string | null;
1745
+ }, {
1746
+ maxUses?: number;
1747
+ allowedDomains?: string[];
1748
+ blockedDomains?: string[];
1749
+ citations?: {
1750
+ enabled: boolean;
1751
+ };
1752
+ maxContentTokens?: number;
1753
+ }, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
1754
+ url: string;
1755
+ }, {
1756
+ type: "web_fetch_result";
1757
+ url: string;
1758
+ content: {
1759
+ type: "document";
1760
+ title: string | null;
1761
+ citations?: {
1762
+ enabled: boolean;
1763
+ };
1764
+ source: {
1765
+ type: "base64";
1766
+ mediaType: "application/pdf";
1767
+ data: string;
1768
+ } | {
1769
+ type: "text";
1770
+ mediaType: "text/plain";
1771
+ data: string;
1772
+ };
1773
+ };
1774
+ retrievedAt: string | null;
1775
+ }, {}>;
1776
+ /**
1777
+ * Creates a web fetch tool that gives Claude direct access to real-time web content.
1778
+ *
1779
+ * @param maxUses - The max_uses parameter limits the number of web fetches performed
1780
+ * @param allowedDomains - Only fetch from these domains
1781
+ * @param blockedDomains - Never fetch from these domains
1782
+ * @param citations - Unlike web search where citations are always enabled, citations are optional for web fetch. Set "citations": {"enabled": true} to enable Claude to cite specific passages from fetched documents.
1783
+ * @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
1784
+ */
1785
+ webFetch_20260209: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
1786
+ url: string;
1787
+ }, {
1788
+ type: "web_fetch_result";
1789
+ url: string;
1790
+ content: {
1791
+ type: "document";
1792
+ title: string | null;
1793
+ citations?: {
1794
+ enabled: boolean;
1795
+ };
1796
+ source: {
1797
+ type: "base64";
1798
+ mediaType: "application/pdf";
1799
+ data: string;
1800
+ } | {
1801
+ type: "text";
1802
+ mediaType: "text/plain";
1803
+ data: string;
1804
+ };
1805
+ };
1806
+ retrievedAt: string | null;
1807
+ }, {
1808
+ maxUses?: number;
1809
+ allowedDomains?: string[];
1810
+ blockedDomains?: string[];
1811
+ citations?: {
1812
+ enabled: boolean;
1813
+ };
1814
+ maxContentTokens?: number;
1815
+ }, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
1816
+ url: string;
1817
+ }, {
1818
+ type: "web_fetch_result";
1819
+ url: string;
1820
+ content: {
1821
+ type: "document";
1822
+ title: string | null;
1823
+ citations?: {
1824
+ enabled: boolean;
1825
+ };
1826
+ source: {
1827
+ type: "base64";
1828
+ mediaType: "application/pdf";
1829
+ data: string;
1830
+ } | {
1831
+ type: "text";
1832
+ mediaType: "text/plain";
1833
+ data: string;
1834
+ };
1835
+ };
1836
+ retrievedAt: string | null;
1837
+ }, {}>;
1838
+ /**
1839
+ * Creates a web fetch tool that gives Claude direct access to real-time web content.
1840
+ *
1841
+ * @param maxUses - The max_uses parameter limits the number of web fetches performed
1842
+ * @param allowedDomains - Only fetch from these domains
1843
+ * @param blockedDomains - Never fetch from these domains
1844
+ * @param citations - Unlike web search where citations are always enabled, citations are optional for web fetch. Set "citations": {"enabled": true} to enable Claude to cite specific passages from fetched documents.
1845
+ * @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
1846
+ * @param useCache - Whether cached content may be returned. Set to false to fetch fresh content.
1847
+ * @param responseInclusion - Whether result blocks consumed by completed code execution calls are returned. Defaults to "full".
1848
+ */
1849
+ webFetch_20260318: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
1850
+ url: string;
1851
+ }, {
1852
+ type: "web_fetch_result";
1853
+ url: string;
1854
+ content: {
1855
+ type: "document";
1856
+ title: string | null;
1857
+ citations?: {
1858
+ enabled: boolean;
1859
+ };
1860
+ source: {
1861
+ type: "base64";
1862
+ mediaType: "application/pdf";
1863
+ data: string;
1864
+ } | {
1865
+ type: "text";
1866
+ mediaType: "text/plain";
1867
+ data: string;
1868
+ };
1869
+ };
1870
+ retrievedAt: string | null;
1871
+ }, {
1872
+ maxUses?: number;
1873
+ allowedDomains?: string[];
1874
+ blockedDomains?: string[];
1875
+ citations?: {
1876
+ enabled: boolean;
1877
+ };
1878
+ maxContentTokens?: number;
1879
+ useCache?: boolean;
1880
+ responseInclusion?: "full" | "excluded";
1881
+ }, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
1882
+ url: string;
1883
+ }, {
1884
+ type: "web_fetch_result";
1885
+ url: string;
1886
+ content: {
1887
+ type: "document";
1888
+ title: string | null;
1889
+ citations?: {
1890
+ enabled: boolean;
1891
+ };
1892
+ source: {
1893
+ type: "base64";
1894
+ mediaType: "application/pdf";
1895
+ data: string;
1896
+ } | {
1897
+ type: "text";
1898
+ mediaType: "text/plain";
1899
+ data: string;
1900
+ };
1901
+ };
1902
+ retrievedAt: string | null;
1903
+ }, {}>;
1904
+ /**
1905
+ * Creates a web search tool that gives Claude direct access to real-time web content.
1906
+ *
1907
+ * @param maxUses - Maximum number of web searches Claude can perform during the conversation.
1908
+ * @param allowedDomains - Optional list of domains that Claude is allowed to search.
1909
+ * @param blockedDomains - Optional list of domains that Claude should avoid when searching.
1910
+ * @param userLocation - Optional user location information to provide geographically relevant search results.
1911
+ */
1912
+ webSearch_20250305: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
1913
+ query: string;
1914
+ }, {
1915
+ type: "web_search_result";
1916
+ url: string;
1917
+ title: string | null;
1918
+ pageAge: string | null;
1919
+ encryptedContent: string;
1920
+ }[], {
1921
+ maxUses?: number;
1922
+ allowedDomains?: string[];
1923
+ blockedDomains?: string[];
1924
+ userLocation?: {
1925
+ type: "approximate";
1926
+ city?: string;
1927
+ region?: string;
1928
+ country?: string;
1929
+ timezone?: string;
1930
+ };
1931
+ }, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
1932
+ query: string;
1933
+ }, {
1934
+ type: "web_search_result";
1935
+ url: string;
1936
+ title: string | null;
1937
+ pageAge: string | null;
1938
+ encryptedContent: string;
1939
+ }[], {}>;
1940
+ /**
1941
+ * Creates a web search tool that gives Claude direct access to real-time web content.
1942
+ *
1943
+ * @param maxUses - Maximum number of web searches Claude can perform during the conversation.
1944
+ * @param allowedDomains - Optional list of domains that Claude is allowed to search.
1945
+ * @param blockedDomains - Optional list of domains that Claude should avoid when searching.
1946
+ * @param userLocation - Optional user location information to provide geographically relevant search results.
1947
+ */
1948
+ webSearch_20260209: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
1949
+ query: string;
1950
+ }, {
1951
+ type: "web_search_result";
1952
+ url: string;
1953
+ title: string | null;
1954
+ pageAge: string | null;
1955
+ encryptedContent: string;
1956
+ }[], {
1957
+ maxUses?: number;
1958
+ allowedDomains?: string[];
1959
+ blockedDomains?: string[];
1960
+ userLocation?: {
1961
+ type: "approximate";
1962
+ city?: string;
1963
+ region?: string;
1964
+ country?: string;
1965
+ timezone?: string;
1966
+ };
1967
+ }, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
1968
+ query: string;
1969
+ }, {
1970
+ type: "web_search_result";
1971
+ url: string;
1972
+ title: string | null;
1973
+ pageAge: string | null;
1974
+ encryptedContent: string;
1975
+ }[], {}>;
1976
+ /**
1977
+ * Creates a web search tool that gives Claude direct access to real-time web content.
1978
+ *
1979
+ * @param maxUses - Maximum number of web searches Claude can perform during the conversation.
1980
+ * @param allowedDomains - Optional list of domains that Claude is allowed to search.
1981
+ * @param blockedDomains - Optional list of domains that Claude should avoid when searching.
1982
+ * @param userLocation - Optional user location information to provide geographically relevant search results.
1983
+ * @param responseInclusion - Whether result blocks consumed by completed code execution calls are returned. Defaults to "full".
1984
+ */
1985
+ webSearch_20260318: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
1986
+ query: string;
1987
+ }, {
1988
+ type: "web_search_result";
1989
+ url: string;
1990
+ title: string | null;
1991
+ pageAge: string | null;
1992
+ encryptedContent: string;
1993
+ }[], {
1994
+ maxUses?: number;
1995
+ allowedDomains?: string[];
1996
+ blockedDomains?: string[];
1997
+ userLocation?: {
1998
+ type: "approximate";
1999
+ city?: string;
2000
+ region?: string;
2001
+ country?: string;
2002
+ timezone?: string;
2003
+ };
2004
+ responseInclusion?: "full" | "excluded";
2005
+ }, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
2006
+ query: string;
2007
+ }, {
2008
+ type: "web_search_result";
2009
+ url: string;
2010
+ title: string | null;
2011
+ pageAge: string | null;
2012
+ encryptedContent: string;
2013
+ }[], {}>;
2014
+ /**
2015
+ * Creates a tool search tool that uses regex patterns to find tools.
2016
+ *
2017
+ * The tool search tool enables Claude to work with hundreds or thousands of tools
2018
+ * by dynamically discovering and loading them on-demand. Instead of loading all
2019
+ * tool definitions into the context window upfront, Claude searches your tool
2020
+ * catalog and loads only the tools it needs.
2021
+ *
2022
+ * Use `providerOptions: { anthropic: { deferLoading: true } }` on other tools
2023
+ * to mark them for deferred loading.
2024
+ *
2025
+ * Supported models: Claude Opus 4.5, Claude Sonnet 4.5
2026
+ */
2027
+ toolSearchRegex_20251119: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
2028
+ pattern: string;
2029
+ limit?: number;
2030
+ }, {
2031
+ type: "tool_reference";
2032
+ toolName: string;
2033
+ }[], {}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
2034
+ pattern: string;
2035
+ limit?: number;
2036
+ }, {
2037
+ type: "tool_reference";
2038
+ toolName: string;
2039
+ }[], {}>;
2040
+ /**
2041
+ * Creates a tool search tool that uses BM25 (natural language) to find tools.
2042
+ *
2043
+ * The tool search tool enables Claude to work with hundreds or thousands of tools
2044
+ * by dynamically discovering and loading them on-demand. Instead of loading all
2045
+ * tool definitions into the context window upfront, Claude searches your tool
2046
+ * catalog and loads only the tools it needs.
2047
+ *
2048
+ * Use `providerOptions: { anthropic: { deferLoading: true } }` on other tools
2049
+ * to mark them for deferred loading.
2050
+ *
2051
+ * Supported models: Claude Opus 4.5, Claude Sonnet 4.5
2052
+ */
2053
+ toolSearchBm25_20251119: (args?: Parameters<import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
2054
+ query: string;
2055
+ limit?: number;
2056
+ }, {
2057
+ type: "tool_reference";
2058
+ toolName: string;
2059
+ }[], {}, {}>>[0]) => import("@ai-sdk/provider-utils").ProviderExecutedTool<{
2060
+ query: string;
2061
+ limit?: number;
2062
+ }, {
2063
+ type: "tool_reference";
2064
+ toolName: string;
2065
+ }[], {}>;
2043
2066
  };
2044
-
2067
+ //#endregion
2068
+ //#region src/get-cache-control.d.ts
2045
2069
  declare class CacheControlValidator {
2046
- private breakpointCount;
2047
- private warnings;
2048
- getCacheControl(providerMetadata: SharedV4ProviderMetadata | undefined, context: {
2049
- type: string;
2050
- canCache: boolean;
2051
- }): AnthropicCacheControl | undefined;
2052
- getWarnings(): SharedV4Warning[];
2070
+ private breakpointCount;
2071
+ private warnings;
2072
+ getCacheControl(providerMetadata: SharedV4ProviderMetadata | undefined, context: {
2073
+ type: string;
2074
+ canCache: boolean;
2075
+ }): AnthropicCacheControl | undefined;
2076
+ getWarnings(): SharedV4Warning[];
2053
2077
  }
2054
-
2055
- declare function prepareTools({ tools, toolChoice, disableParallelToolUse, cacheControlValidator, supportsStructuredOutput, supportsStrictTools, defaultEagerInputStreaming, rejectsForcedToolUse, }: {
2056
- tools: LanguageModelV4CallOptions['tools'];
2057
- toolChoice: LanguageModelV4CallOptions['toolChoice'] | undefined;
2058
- disableParallelToolUse?: boolean;
2059
- cacheControlValidator?: CacheControlValidator;
2060
- /**
2061
- * Whether the model supports native structured output response format.
2062
- */
2063
- supportsStructuredOutput: boolean;
2064
- /**
2065
- * Whether the model supports strict mode on tool definitions.
2066
- */
2067
- supportsStrictTools: boolean;
2068
- /**
2069
- * Default for `eager_input_streaming` on function tools that do not set
2070
- * it explicitly. Driven by the model-level `toolStreaming` option.
2071
- */
2072
- defaultEagerInputStreaming?: boolean;
2073
- /**
2074
- * Whether the model rejects forced tool use (`tool_choice` `any` or a
2075
- * named tool). When true, `required` and `tool` tool choices fall back to
2076
- * `auto` with a warning.
2077
- */
2078
- rejectsForcedToolUse?: boolean;
2078
+ //#endregion
2079
+ //#region src/anthropic-prepare-tools.d.ts
2080
+ export declare function prepareTools({ tools, toolChoice, disableParallelToolUse, cacheControlValidator, supportsStructuredOutput, supportsStrictTools, defaultEagerInputStreaming, rejectsForcedToolUse }: {
2081
+ tools: LanguageModelV4CallOptions['tools'];
2082
+ toolChoice: LanguageModelV4CallOptions['toolChoice'] | undefined;
2083
+ disableParallelToolUse?: boolean;
2084
+ cacheControlValidator?: CacheControlValidator;
2085
+ /**
2086
+ * Whether the model supports native structured output response format.
2087
+ */
2088
+ supportsStructuredOutput: boolean;
2089
+ /**
2090
+ * Whether the model supports strict mode on tool definitions.
2091
+ */
2092
+ supportsStrictTools: boolean;
2093
+ /**
2094
+ * Default for `eager_input_streaming` on function tools that do not set
2095
+ * it explicitly. Driven by the model-level `toolStreaming` option.
2096
+ */
2097
+ defaultEagerInputStreaming?: boolean;
2098
+ /**
2099
+ * Whether the model rejects forced tool use (`tool_choice` `any` or a
2100
+ * named tool). When true, `required` and `tool` tool choices fall back to
2101
+ * `auto` with a warning.
2102
+ */
2103
+ rejectsForcedToolUse?: boolean;
2079
2104
  }): Promise<{
2080
- tools: Array<AnthropicTool> | undefined;
2081
- toolChoice: AnthropicToolChoice | undefined;
2082
- toolWarnings: SharedV4Warning[];
2083
- betas: Set<string>;
2105
+ tools: Array<AnthropicTool> | undefined;
2106
+ toolChoice: AnthropicToolChoice | undefined;
2107
+ toolWarnings: SharedV4Warning[];
2108
+ betas: Set<string>;
2084
2109
  }>;
2085
-
2110
+ //#endregion
2111
+ //#region src/sanitize-json-schema.d.ts
2086
2112
  /**
2087
2113
  * Removes JSON Schema keywords that Anthropic rejects in
2088
2114
  * `output_config.format.schema`.
@@ -2090,22 +2116,24 @@ declare function prepareTools({ tools, toolChoice, disableParallelToolUse, cache
2090
2116
  * The full original schema is still used by AI SDK result validation. This
2091
2117
  * only relaxes the schema sent to Anthropic's constrained decoder.
2092
2118
  */
2093
- declare function sanitizeJsonSchema(schema: JSONSchema7): JSONSchema7;
2094
-
2119
+ export declare function sanitizeJsonSchema(schema: JSONSchema7): JSONSchema7;
2120
+ //#endregion
2121
+ //#region src/skills/anthropic-skills.d.ts
2095
2122
  interface AnthropicSkillsConfig {
2096
- provider: string;
2097
- baseURL: string;
2098
- headers: Resolvable<Record<string, string | undefined>>;
2099
- fetch?: FetchFunction;
2123
+ provider: string;
2124
+ baseURL: string;
2125
+ headers: Resolvable<Record<string, string | undefined>>;
2126
+ fetch?: FetchFunction;
2100
2127
  }
2101
- declare class AnthropicSkills implements SkillsV4 {
2102
- private readonly config;
2103
- readonly specificationVersion = "v4";
2104
- get provider(): string;
2105
- constructor(config: AnthropicSkillsConfig);
2106
- private getHeaders;
2107
- private fetchVersionMetadata;
2108
- uploadSkill(params: Parameters<SkillsV4['uploadSkill']>[0]): Promise<Awaited<ReturnType<SkillsV4['uploadSkill']>>>;
2128
+ export declare class AnthropicSkills implements SkillsV4 {
2129
+ private readonly config;
2130
+ readonly specificationVersion = "v4";
2131
+ get provider(): string;
2132
+ constructor(config: AnthropicSkillsConfig);
2133
+ private getHeaders;
2134
+ private fetchVersionMetadata;
2135
+ uploadSkill(params: Parameters<SkillsV4['uploadSkill']>[0]): Promise<Awaited<ReturnType<SkillsV4['uploadSkill']>>>;
2109
2136
  }
2110
-
2111
- export { AnthropicFiles, AnthropicLanguageModel, AnthropicLanguageModel as AnthropicMessagesLanguageModel, type AnthropicModelId as AnthropicMessagesModelId, type AnthropicModelId, AnthropicSkills, anthropicTools, getModelCapabilities, prepareTools, sanitizeJsonSchema };
2137
+ //#endregion
2138
+ export { AnthropicLanguageModel as AnthropicMessagesLanguageModel, type AnthropicModelId as AnthropicMessagesModelId, type AnthropicModelId };
2139
+ //# sourceMappingURL=index.d.ts.map