@fairyhunter13/ai-anthropic 3.0.58-fork.9 → 3.0.74-fork
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +277 -0
- package/README.md +2 -0
- package/dist/index.d.ts +156 -67
- package/dist/index.js +2190 -1471
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +167 -58
- package/dist/internal/index.js +1950 -1458
- package/dist/internal/index.js.map +1 -1
- package/docs/05-anthropic.mdx +116 -13
- package/package.json +15 -12
- package/src/{anthropic-messages-api.ts → anthropic-api.ts} +46 -15
- package/src/anthropic-error.ts +1 -1
- package/src/anthropic-files.ts +95 -0
- package/src/{anthropic-messages-options.ts → anthropic-language-model-options.ts} +80 -41
- package/src/{anthropic-messages-language-model.ts → anthropic-language-model.ts} +221 -138
- package/src/anthropic-message-metadata.ts +2 -1
- package/src/anthropic-prepare-tools.ts +68 -26
- package/src/anthropic-provider.ts +42 -13
- package/src/anthropic-tools.ts +18 -0
- package/src/{convert-anthropic-messages-usage.ts → convert-anthropic-usage.ts} +4 -4
- package/src/{convert-to-anthropic-messages-prompt.ts → convert-to-anthropic-prompt.ts} +233 -180
- package/src/forward-anthropic-container-id-from-last-step.ts +2 -2
- package/src/get-cache-control.ts +5 -2
- package/src/index.ts +1 -1
- package/src/internal/index.ts +9 -3
- package/src/map-anthropic-stop-reason.ts +1 -1
- package/src/sanitize-json-schema.ts +203 -0
- package/src/skills/anthropic-skills-api.ts +44 -0
- package/src/skills/anthropic-skills.ts +132 -0
- package/src/tool/bash_20241022.ts +2 -2
- package/src/tool/bash_20250124.ts +2 -2
- package/src/tool/code-execution_20250522.ts +2 -2
- package/src/tool/code-execution_20250825.ts +2 -2
- package/src/tool/code-execution_20260120.ts +2 -2
- package/src/tool/computer_20241022.ts +2 -2
- package/src/tool/computer_20250124.ts +2 -2
- package/src/tool/computer_20251124.ts +2 -2
- package/src/tool/memory_20250818.ts +2 -2
- package/src/tool/text-editor_20241022.ts +2 -2
- package/src/tool/text-editor_20250124.ts +2 -2
- package/src/tool/text-editor_20250429.ts +2 -2
- package/src/tool/text-editor_20250728.ts +6 -3
- package/src/tool/tool-search-bm25_20251119.ts +2 -2
- package/src/tool/tool-search-regex_20251119.ts +2 -2
- package/src/tool/web-fetch-20250910.ts +2 -2
- package/src/tool/web-fetch-20260209.ts +2 -2
- package/src/tool/web-fetch-20260309.ts +181 -0
- package/src/tool/web-search_20250305.ts +2 -2
- package/src/tool/web-search_20260209.ts +19 -2
- package/dist/index.d.mts +0 -1105
- package/dist/index.mjs +0 -5394
- package/dist/index.mjs.map +0 -1
- package/dist/internal/index.d.mts +0 -981
- package/dist/internal/index.mjs +0 -5287
- package/dist/internal/index.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JSONObject, ProviderV4, LanguageModelV4 } from '@ai-sdk/provider';
|
|
1
|
+
import { JSONObject, ProviderV4, LanguageModelV4, FilesV4, SkillsV4 } from '@ai-sdk/provider';
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
3
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
4
4
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
@@ -22,6 +22,7 @@ interface AnthropicUsageIteration {
|
|
|
22
22
|
interface AnthropicMessageMetadata {
|
|
23
23
|
usage: JSONObject;
|
|
24
24
|
cacheCreationInputTokens: number | null;
|
|
25
|
+
cacheReadInputTokens: number | null;
|
|
25
26
|
stopSequence: string | null;
|
|
26
27
|
/**
|
|
27
28
|
* Usage breakdown by iteration when compaction is triggered.
|
|
@@ -128,7 +129,7 @@ interface AnthropicMessageMetadata {
|
|
|
128
129
|
} | null;
|
|
129
130
|
}
|
|
130
131
|
|
|
131
|
-
type
|
|
132
|
+
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' | (string & {});
|
|
132
133
|
declare const anthropicLanguageModelOptions: z.ZodObject<{
|
|
133
134
|
sendReasoning: z.ZodOptional<z.ZodBoolean>;
|
|
134
135
|
structuredOutputMode: z.ZodOptional<z.ZodEnum<{
|
|
@@ -145,10 +146,6 @@ declare const anthropicLanguageModelOptions: z.ZodObject<{
|
|
|
145
146
|
}, z.core.$strip>, z.ZodObject<{
|
|
146
147
|
type: z.ZodLiteral<"enabled">;
|
|
147
148
|
budgetTokens: z.ZodOptional<z.ZodNumber>;
|
|
148
|
-
display: z.ZodOptional<z.ZodEnum<{
|
|
149
|
-
omitted: "omitted";
|
|
150
|
-
summarized: "summarized";
|
|
151
|
-
}>>;
|
|
152
149
|
}, z.core.$strip>, z.ZodObject<{
|
|
153
150
|
type: z.ZodLiteral<"disabled">;
|
|
154
151
|
}, z.core.$strip>]>>;
|
|
@@ -157,6 +154,9 @@ declare const anthropicLanguageModelOptions: z.ZodObject<{
|
|
|
157
154
|
type: z.ZodLiteral<"ephemeral">;
|
|
158
155
|
ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"5m">, z.ZodLiteral<"1h">]>>;
|
|
159
156
|
}, z.core.$strip>>;
|
|
157
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
158
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
159
|
+
}, z.core.$strip>>;
|
|
160
160
|
mcpServers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
161
161
|
type: z.ZodLiteral<"url">;
|
|
162
162
|
name: z.ZodString;
|
|
@@ -169,31 +169,42 @@ declare const anthropicLanguageModelOptions: z.ZodObject<{
|
|
|
169
169
|
}, z.core.$strip>>>;
|
|
170
170
|
container: z.ZodOptional<z.ZodObject<{
|
|
171
171
|
id: z.ZodOptional<z.ZodString>;
|
|
172
|
-
skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
173
|
-
type: z.
|
|
172
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
173
|
+
type: z.ZodLiteral<"anthropic">;
|
|
174
174
|
skillId: z.ZodString;
|
|
175
175
|
version: z.ZodOptional<z.ZodString>;
|
|
176
|
-
}, z.core.$strip
|
|
176
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
177
|
+
type: z.ZodLiteral<"custom">;
|
|
178
|
+
providerReference: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
179
|
+
version: z.ZodOptional<z.ZodString>;
|
|
180
|
+
}, z.core.$strip>]>>>;
|
|
177
181
|
}, z.core.$strip>>;
|
|
178
182
|
toolStreaming: z.ZodOptional<z.ZodBoolean>;
|
|
179
183
|
effort: z.ZodOptional<z.ZodEnum<{
|
|
180
184
|
low: "low";
|
|
181
185
|
medium: "medium";
|
|
182
186
|
high: "high";
|
|
187
|
+
xhigh: "xhigh";
|
|
183
188
|
max: "max";
|
|
184
189
|
}>>;
|
|
190
|
+
taskBudget: z.ZodOptional<z.ZodObject<{
|
|
191
|
+
type: z.ZodLiteral<"tokens">;
|
|
192
|
+
total: z.ZodNumber;
|
|
193
|
+
remaining: z.ZodOptional<z.ZodNumber>;
|
|
194
|
+
}, z.core.$strip>>;
|
|
185
195
|
speed: z.ZodOptional<z.ZodEnum<{
|
|
186
196
|
fast: "fast";
|
|
187
197
|
standard: "standard";
|
|
188
198
|
}>>;
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
192
|
-
userId: z.ZodOptional<z.ZodString>;
|
|
199
|
+
advisor: z.ZodOptional<z.ZodObject<{
|
|
200
|
+
model: z.ZodString;
|
|
193
201
|
}, z.core.$strip>>;
|
|
194
|
-
|
|
195
|
-
|
|
202
|
+
output300k: z.ZodOptional<z.ZodBoolean>;
|
|
203
|
+
inferenceGeo: z.ZodOptional<z.ZodEnum<{
|
|
204
|
+
us: "us";
|
|
205
|
+
global: "global";
|
|
196
206
|
}>>;
|
|
207
|
+
anthropicBeta: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
197
208
|
contextManagement: z.ZodOptional<z.ZodObject<{
|
|
198
209
|
edits: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
199
210
|
type: z.ZodLiteral<"clear_tool_uses_20250919">;
|
|
@@ -246,20 +257,20 @@ declare const anthropicTools: {
|
|
|
246
257
|
*
|
|
247
258
|
* Image results are supported.
|
|
248
259
|
*/
|
|
249
|
-
bash_20241022: _ai_sdk_provider_utils.
|
|
260
|
+
bash_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
250
261
|
command: string;
|
|
251
262
|
restart?: boolean;
|
|
252
|
-
}, {}>;
|
|
263
|
+
}, {}, {}>;
|
|
253
264
|
/**
|
|
254
265
|
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
255
266
|
* allowing system operations, script execution, and command-line automation.
|
|
256
267
|
*
|
|
257
268
|
* Image results are supported.
|
|
258
269
|
*/
|
|
259
|
-
bash_20250124: _ai_sdk_provider_utils.
|
|
270
|
+
bash_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
260
271
|
command: string;
|
|
261
272
|
restart?: boolean;
|
|
262
|
-
}, {}>;
|
|
273
|
+
}, {}, {}>;
|
|
263
274
|
/**
|
|
264
275
|
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
265
276
|
* run system commands, create and edit files, and process uploaded files directly within
|
|
@@ -268,7 +279,7 @@ declare const anthropicTools: {
|
|
|
268
279
|
* The code execution tool allows Claude to run Bash commands and manipulate files,
|
|
269
280
|
* including writing code, in a secure, sandboxed environment.
|
|
270
281
|
*/
|
|
271
|
-
codeExecution_20250522: (args?: Parameters<_ai_sdk_provider_utils.
|
|
282
|
+
codeExecution_20250522: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
272
283
|
code: string;
|
|
273
284
|
}, {
|
|
274
285
|
type: "code_execution_result";
|
|
@@ -279,7 +290,7 @@ declare const anthropicTools: {
|
|
|
279
290
|
type: "code_execution_output";
|
|
280
291
|
file_id: string;
|
|
281
292
|
}>;
|
|
282
|
-
}, {}>>[0]) => _ai_sdk_provider_utils.
|
|
293
|
+
}, {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
283
294
|
code: string;
|
|
284
295
|
}, {
|
|
285
296
|
type: "code_execution_result";
|
|
@@ -290,7 +301,7 @@ declare const anthropicTools: {
|
|
|
290
301
|
type: "code_execution_output";
|
|
291
302
|
file_id: string;
|
|
292
303
|
}>;
|
|
293
|
-
}>;
|
|
304
|
+
}, {}>;
|
|
294
305
|
/**
|
|
295
306
|
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
296
307
|
* run system commands, create and edit files, and process uploaded files directly within
|
|
@@ -301,7 +312,7 @@ declare const anthropicTools: {
|
|
|
301
312
|
*
|
|
302
313
|
* This is the latest version with enhanced Bash support and file operations.
|
|
303
314
|
*/
|
|
304
|
-
codeExecution_20250825: (args?: Parameters<_ai_sdk_provider_utils.
|
|
315
|
+
codeExecution_20250825: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
305
316
|
type: "programmatic-tool-call";
|
|
306
317
|
code: string;
|
|
307
318
|
} | {
|
|
@@ -363,7 +374,7 @@ declare const anthropicTools: {
|
|
|
363
374
|
new_start: number | null;
|
|
364
375
|
old_lines: number | null;
|
|
365
376
|
old_start: number | null;
|
|
366
|
-
}, {}>>[0]) => _ai_sdk_provider_utils.
|
|
377
|
+
}, {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
367
378
|
type: "programmatic-tool-call";
|
|
368
379
|
code: string;
|
|
369
380
|
} | {
|
|
@@ -425,7 +436,7 @@ declare const anthropicTools: {
|
|
|
425
436
|
new_start: number | null;
|
|
426
437
|
old_lines: number | null;
|
|
427
438
|
old_start: number | null;
|
|
428
|
-
}>;
|
|
439
|
+
}, {}>;
|
|
429
440
|
/**
|
|
430
441
|
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
431
442
|
* run system commands, create and edit files, and process uploaded files directly within
|
|
@@ -438,7 +449,7 @@ declare const anthropicTools: {
|
|
|
438
449
|
*
|
|
439
450
|
* Supported models: Claude Opus 4.6, Sonnet 4.6, Sonnet 4.5, Opus 4.5
|
|
440
451
|
*/
|
|
441
|
-
codeExecution_20260120: (args?: Parameters<_ai_sdk_provider_utils.
|
|
452
|
+
codeExecution_20260120: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
442
453
|
type: "programmatic-tool-call";
|
|
443
454
|
code: string;
|
|
444
455
|
} | {
|
|
@@ -509,7 +520,7 @@ declare const anthropicTools: {
|
|
|
509
520
|
new_start: number | null;
|
|
510
521
|
old_lines: number | null;
|
|
511
522
|
old_start: number | null;
|
|
512
|
-
}, {}>>[0]) => _ai_sdk_provider_utils.
|
|
523
|
+
}, {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
513
524
|
type: "programmatic-tool-call";
|
|
514
525
|
code: string;
|
|
515
526
|
} | {
|
|
@@ -580,7 +591,7 @@ declare const anthropicTools: {
|
|
|
580
591
|
new_start: number | null;
|
|
581
592
|
old_lines: number | null;
|
|
582
593
|
old_start: number | null;
|
|
583
|
-
}>;
|
|
594
|
+
}, {}>;
|
|
584
595
|
/**
|
|
585
596
|
* Claude can interact with computer environments through the computer use tool, which
|
|
586
597
|
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
@@ -591,7 +602,7 @@ declare const anthropicTools: {
|
|
|
591
602
|
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
592
603
|
* @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.
|
|
593
604
|
*/
|
|
594
|
-
computer_20241022: _ai_sdk_provider_utils.
|
|
605
|
+
computer_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
595
606
|
action: "key" | "type" | "mouse_move" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "screenshot" | "cursor_position";
|
|
596
607
|
coordinate?: number[];
|
|
597
608
|
text?: string;
|
|
@@ -599,7 +610,7 @@ declare const anthropicTools: {
|
|
|
599
610
|
displayWidthPx: number;
|
|
600
611
|
displayHeightPx: number;
|
|
601
612
|
displayNumber?: number;
|
|
602
|
-
}>;
|
|
613
|
+
}, {}>;
|
|
603
614
|
/**
|
|
604
615
|
* Claude can interact with computer environments through the computer use tool, which
|
|
605
616
|
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
@@ -610,7 +621,7 @@ declare const anthropicTools: {
|
|
|
610
621
|
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
611
622
|
* @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.
|
|
612
623
|
*/
|
|
613
|
-
computer_20250124: _ai_sdk_provider_utils.
|
|
624
|
+
computer_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
614
625
|
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";
|
|
615
626
|
coordinate?: [number, number];
|
|
616
627
|
duration?: number;
|
|
@@ -622,7 +633,7 @@ declare const anthropicTools: {
|
|
|
622
633
|
displayWidthPx: number;
|
|
623
634
|
displayHeightPx: number;
|
|
624
635
|
displayNumber?: number;
|
|
625
|
-
}>;
|
|
636
|
+
}, {}>;
|
|
626
637
|
/**
|
|
627
638
|
* Claude can interact with computer environments through the computer use tool, which
|
|
628
639
|
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
@@ -638,7 +649,7 @@ declare const anthropicTools: {
|
|
|
638
649
|
* @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.
|
|
639
650
|
* @param enableZoom - Enable zoom action. Set to true to allow Claude to zoom into specific screen regions. Default: false.
|
|
640
651
|
*/
|
|
641
|
-
computer_20251124: _ai_sdk_provider_utils.
|
|
652
|
+
computer_20251124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
642
653
|
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";
|
|
643
654
|
coordinate?: [number, number];
|
|
644
655
|
duration?: number;
|
|
@@ -652,7 +663,7 @@ declare const anthropicTools: {
|
|
|
652
663
|
displayHeightPx: number;
|
|
653
664
|
displayNumber?: number;
|
|
654
665
|
enableZoom?: boolean;
|
|
655
|
-
}>;
|
|
666
|
+
}, {}>;
|
|
656
667
|
/**
|
|
657
668
|
* The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
|
|
658
669
|
* Claude can create, read, update, and delete files that persist between sessions,
|
|
@@ -661,7 +672,7 @@ declare const anthropicTools: {
|
|
|
661
672
|
*
|
|
662
673
|
* Supported models: Claude Sonnet 4.5, Claude Sonnet 4, Claude Opus 4.1, Claude Opus 4.
|
|
663
674
|
*/
|
|
664
|
-
memory_20250818: _ai_sdk_provider_utils.
|
|
675
|
+
memory_20250818: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
665
676
|
command: "view";
|
|
666
677
|
path: string;
|
|
667
678
|
view_range?: [number, number];
|
|
@@ -686,7 +697,7 @@ declare const anthropicTools: {
|
|
|
686
697
|
command: "rename";
|
|
687
698
|
old_path: string;
|
|
688
699
|
new_path: string;
|
|
689
|
-
}, {}>;
|
|
700
|
+
}, {}, {}>;
|
|
690
701
|
/**
|
|
691
702
|
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
692
703
|
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
@@ -694,7 +705,7 @@ declare const anthropicTools: {
|
|
|
694
705
|
*
|
|
695
706
|
* Supported models: Claude Sonnet 3.5
|
|
696
707
|
*/
|
|
697
|
-
textEditor_20241022: _ai_sdk_provider_utils.
|
|
708
|
+
textEditor_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
698
709
|
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
699
710
|
path: string;
|
|
700
711
|
file_text?: string;
|
|
@@ -703,7 +714,7 @@ declare const anthropicTools: {
|
|
|
703
714
|
insert_text?: string;
|
|
704
715
|
old_str?: string;
|
|
705
716
|
view_range?: number[];
|
|
706
|
-
}, {}>;
|
|
717
|
+
}, {}, {}>;
|
|
707
718
|
/**
|
|
708
719
|
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
709
720
|
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
@@ -711,7 +722,7 @@ declare const anthropicTools: {
|
|
|
711
722
|
*
|
|
712
723
|
* Supported models: Claude Sonnet 3.7
|
|
713
724
|
*/
|
|
714
|
-
textEditor_20250124: _ai_sdk_provider_utils.
|
|
725
|
+
textEditor_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
715
726
|
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
716
727
|
path: string;
|
|
717
728
|
file_text?: string;
|
|
@@ -720,7 +731,7 @@ declare const anthropicTools: {
|
|
|
720
731
|
insert_text?: string;
|
|
721
732
|
old_str?: string;
|
|
722
733
|
view_range?: number[];
|
|
723
|
-
}, {}>;
|
|
734
|
+
}, {}, {}>;
|
|
724
735
|
/**
|
|
725
736
|
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
726
737
|
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
@@ -730,7 +741,7 @@ declare const anthropicTools: {
|
|
|
730
741
|
*
|
|
731
742
|
* @deprecated Use textEditor_20250728 instead
|
|
732
743
|
*/
|
|
733
|
-
textEditor_20250429: _ai_sdk_provider_utils.
|
|
744
|
+
textEditor_20250429: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
734
745
|
command: "view" | "create" | "str_replace" | "insert";
|
|
735
746
|
path: string;
|
|
736
747
|
file_text?: string;
|
|
@@ -739,7 +750,7 @@ declare const anthropicTools: {
|
|
|
739
750
|
insert_text?: string;
|
|
740
751
|
old_str?: string;
|
|
741
752
|
view_range?: number[];
|
|
742
|
-
}, {}>;
|
|
753
|
+
}, {}, {}>;
|
|
743
754
|
/**
|
|
744
755
|
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
745
756
|
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
@@ -751,7 +762,7 @@ declare const anthropicTools: {
|
|
|
751
762
|
*
|
|
752
763
|
* @param maxCharacters - Optional maximum number of characters to view in the file
|
|
753
764
|
*/
|
|
754
|
-
textEditor_20250728: (args?: Parameters<_ai_sdk_provider_utils.
|
|
765
|
+
textEditor_20250728: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
755
766
|
command: "view" | "create" | "str_replace" | "insert";
|
|
756
767
|
path: string;
|
|
757
768
|
file_text?: string;
|
|
@@ -762,7 +773,7 @@ declare const anthropicTools: {
|
|
|
762
773
|
view_range?: number[];
|
|
763
774
|
}, {
|
|
764
775
|
maxCharacters?: number;
|
|
765
|
-
}>>[0]) => _ai_sdk_provider_utils.
|
|
776
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.ProviderDefinedTool<{
|
|
766
777
|
command: "view" | "create" | "str_replace" | "insert";
|
|
767
778
|
path: string;
|
|
768
779
|
file_text?: string;
|
|
@@ -771,7 +782,7 @@ declare const anthropicTools: {
|
|
|
771
782
|
insert_text?: string;
|
|
772
783
|
old_str?: string;
|
|
773
784
|
view_range?: number[];
|
|
774
|
-
}, unknown>;
|
|
785
|
+
}, unknown, {}>;
|
|
775
786
|
/**
|
|
776
787
|
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
777
788
|
*
|
|
@@ -781,7 +792,7 @@ declare const anthropicTools: {
|
|
|
781
792
|
* @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.
|
|
782
793
|
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
783
794
|
*/
|
|
784
|
-
webFetch_20250910: (args?: Parameters<_ai_sdk_provider_utils.
|
|
795
|
+
webFetch_20250910: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
785
796
|
url: string;
|
|
786
797
|
}, {
|
|
787
798
|
type: "web_fetch_result";
|
|
@@ -811,7 +822,7 @@ declare const anthropicTools: {
|
|
|
811
822
|
enabled: boolean;
|
|
812
823
|
};
|
|
813
824
|
maxContentTokens?: number;
|
|
814
|
-
}>>[0]) => _ai_sdk_provider_utils.
|
|
825
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
815
826
|
url: string;
|
|
816
827
|
}, {
|
|
817
828
|
type: "web_fetch_result";
|
|
@@ -833,7 +844,7 @@ declare const anthropicTools: {
|
|
|
833
844
|
};
|
|
834
845
|
};
|
|
835
846
|
retrievedAt: string | null;
|
|
836
|
-
}>;
|
|
847
|
+
}, {}>;
|
|
837
848
|
/**
|
|
838
849
|
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
839
850
|
*
|
|
@@ -843,7 +854,7 @@ declare const anthropicTools: {
|
|
|
843
854
|
* @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.
|
|
844
855
|
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
845
856
|
*/
|
|
846
|
-
webFetch_20260209: (args?: Parameters<_ai_sdk_provider_utils.
|
|
857
|
+
webFetch_20260209: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
847
858
|
url: string;
|
|
848
859
|
}, {
|
|
849
860
|
type: "web_fetch_result";
|
|
@@ -873,7 +884,7 @@ declare const anthropicTools: {
|
|
|
873
884
|
enabled: boolean;
|
|
874
885
|
};
|
|
875
886
|
maxContentTokens?: number;
|
|
876
|
-
}>>[0]) => _ai_sdk_provider_utils.
|
|
887
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
877
888
|
url: string;
|
|
878
889
|
}, {
|
|
879
890
|
type: "web_fetch_result";
|
|
@@ -895,7 +906,79 @@ declare const anthropicTools: {
|
|
|
895
906
|
};
|
|
896
907
|
};
|
|
897
908
|
retrievedAt: string | null;
|
|
898
|
-
}>;
|
|
909
|
+
}, {}>;
|
|
910
|
+
/**
|
|
911
|
+
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
912
|
+
* GA version (no beta header required). Includes caller restrictions, cache control,
|
|
913
|
+
* deferred loading, and strict mode.
|
|
914
|
+
*
|
|
915
|
+
* @param maxUses - The max_uses parameter limits the number of web fetches performed
|
|
916
|
+
* @param allowedDomains - Only fetch from these domains
|
|
917
|
+
* @param blockedDomains - Never fetch from these domains
|
|
918
|
+
* @param citations - Citations configuration for fetched documents
|
|
919
|
+
* @param maxContentTokens - Max content tokens included in context
|
|
920
|
+
* @param allowedCallers - Restrict callers (e.g. ["direct"] to prevent code_execution usage)
|
|
921
|
+
* @param useCache - Whether to use cached content (set false for fresh content)
|
|
922
|
+
* @param deferLoading - Defer loading until tool_search discovers it
|
|
923
|
+
* @param strict - Enable strict schema validation
|
|
924
|
+
*/
|
|
925
|
+
webFetch_20260309: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
|
|
926
|
+
url: string;
|
|
927
|
+
}, {
|
|
928
|
+
type: "web_fetch_result";
|
|
929
|
+
url: string;
|
|
930
|
+
content: {
|
|
931
|
+
type: "document";
|
|
932
|
+
title: string | null;
|
|
933
|
+
citations?: {
|
|
934
|
+
enabled: boolean;
|
|
935
|
+
};
|
|
936
|
+
source: {
|
|
937
|
+
type: "base64";
|
|
938
|
+
mediaType: "application/pdf";
|
|
939
|
+
data: string;
|
|
940
|
+
} | {
|
|
941
|
+
type: "text";
|
|
942
|
+
mediaType: "text/plain";
|
|
943
|
+
data: string;
|
|
944
|
+
};
|
|
945
|
+
};
|
|
946
|
+
retrievedAt: string | null;
|
|
947
|
+
}, {
|
|
948
|
+
maxUses?: number;
|
|
949
|
+
allowedDomains?: string[];
|
|
950
|
+
blockedDomains?: string[];
|
|
951
|
+
citations?: {
|
|
952
|
+
enabled: boolean;
|
|
953
|
+
};
|
|
954
|
+
maxContentTokens?: number;
|
|
955
|
+
allowedCallers?: Array<"direct" | "code_execution_20250825" | "code_execution_20260120">;
|
|
956
|
+
useCache?: boolean;
|
|
957
|
+
deferLoading?: boolean;
|
|
958
|
+
strict?: boolean;
|
|
959
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.ProviderDefinedTool<{
|
|
960
|
+
url: string;
|
|
961
|
+
}, {
|
|
962
|
+
type: "web_fetch_result";
|
|
963
|
+
url: string;
|
|
964
|
+
content: {
|
|
965
|
+
type: "document";
|
|
966
|
+
title: string | null;
|
|
967
|
+
citations?: {
|
|
968
|
+
enabled: boolean;
|
|
969
|
+
};
|
|
970
|
+
source: {
|
|
971
|
+
type: "base64";
|
|
972
|
+
mediaType: "application/pdf";
|
|
973
|
+
data: string;
|
|
974
|
+
} | {
|
|
975
|
+
type: "text";
|
|
976
|
+
mediaType: "text/plain";
|
|
977
|
+
data: string;
|
|
978
|
+
};
|
|
979
|
+
};
|
|
980
|
+
retrievedAt: string | null;
|
|
981
|
+
}, {}>;
|
|
899
982
|
/**
|
|
900
983
|
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
901
984
|
*
|
|
@@ -904,7 +987,7 @@ declare const anthropicTools: {
|
|
|
904
987
|
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
905
988
|
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
906
989
|
*/
|
|
907
|
-
webSearch_20250305: (args?: Parameters<_ai_sdk_provider_utils.
|
|
990
|
+
webSearch_20250305: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
908
991
|
query: string;
|
|
909
992
|
}, {
|
|
910
993
|
type: "web_search_result";
|
|
@@ -923,7 +1006,7 @@ declare const anthropicTools: {
|
|
|
923
1006
|
country?: string;
|
|
924
1007
|
timezone?: string;
|
|
925
1008
|
};
|
|
926
|
-
}>>[0]) => _ai_sdk_provider_utils.
|
|
1009
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
927
1010
|
query: string;
|
|
928
1011
|
}, {
|
|
929
1012
|
type: "web_search_result";
|
|
@@ -931,7 +1014,7 @@ declare const anthropicTools: {
|
|
|
931
1014
|
title: string | null;
|
|
932
1015
|
pageAge: string | null;
|
|
933
1016
|
encryptedContent: string;
|
|
934
|
-
}[]>;
|
|
1017
|
+
}[], {}>;
|
|
935
1018
|
/**
|
|
936
1019
|
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
937
1020
|
*
|
|
@@ -940,7 +1023,7 @@ declare const anthropicTools: {
|
|
|
940
1023
|
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
941
1024
|
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
942
1025
|
*/
|
|
943
|
-
webSearch_20260209: (args?: Parameters<_ai_sdk_provider_utils.
|
|
1026
|
+
webSearch_20260209: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
944
1027
|
query: string;
|
|
945
1028
|
}, {
|
|
946
1029
|
type: "web_search_result";
|
|
@@ -959,7 +1042,8 @@ declare const anthropicTools: {
|
|
|
959
1042
|
country?: string;
|
|
960
1043
|
timezone?: string;
|
|
961
1044
|
};
|
|
962
|
-
|
|
1045
|
+
allowedCallers?: Array<"direct" | "code_execution_20250825" | "code_execution_20260120">;
|
|
1046
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
963
1047
|
query: string;
|
|
964
1048
|
}, {
|
|
965
1049
|
type: "web_search_result";
|
|
@@ -967,7 +1051,7 @@ declare const anthropicTools: {
|
|
|
967
1051
|
title: string | null;
|
|
968
1052
|
pageAge: string | null;
|
|
969
1053
|
encryptedContent: string;
|
|
970
|
-
}[]>;
|
|
1054
|
+
}[], {}>;
|
|
971
1055
|
/**
|
|
972
1056
|
* Creates a tool search tool that uses regex patterns to find tools.
|
|
973
1057
|
*
|
|
@@ -981,19 +1065,19 @@ declare const anthropicTools: {
|
|
|
981
1065
|
*
|
|
982
1066
|
* Supported models: Claude Opus 4.5, Claude Sonnet 4.5
|
|
983
1067
|
*/
|
|
984
|
-
toolSearchRegex_20251119: (args?: Parameters<_ai_sdk_provider_utils.
|
|
1068
|
+
toolSearchRegex_20251119: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
985
1069
|
pattern: string;
|
|
986
1070
|
limit?: number;
|
|
987
1071
|
}, {
|
|
988
1072
|
type: "tool_reference";
|
|
989
1073
|
toolName: string;
|
|
990
|
-
}[], {}>>[0]) => _ai_sdk_provider_utils.
|
|
1074
|
+
}[], {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
991
1075
|
pattern: string;
|
|
992
1076
|
limit?: number;
|
|
993
1077
|
}, {
|
|
994
1078
|
type: "tool_reference";
|
|
995
1079
|
toolName: string;
|
|
996
|
-
}[]>;
|
|
1080
|
+
}[], {}>;
|
|
997
1081
|
/**
|
|
998
1082
|
* Creates a tool search tool that uses BM25 (natural language) to find tools.
|
|
999
1083
|
*
|
|
@@ -1007,36 +1091,41 @@ declare const anthropicTools: {
|
|
|
1007
1091
|
*
|
|
1008
1092
|
* Supported models: Claude Opus 4.5, Claude Sonnet 4.5
|
|
1009
1093
|
*/
|
|
1010
|
-
toolSearchBm25_20251119: (args?: Parameters<_ai_sdk_provider_utils.
|
|
1094
|
+
toolSearchBm25_20251119: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
1011
1095
|
query: string;
|
|
1012
1096
|
limit?: number;
|
|
1013
1097
|
}, {
|
|
1014
1098
|
type: "tool_reference";
|
|
1015
1099
|
toolName: string;
|
|
1016
|
-
}[], {}>>[0]) => _ai_sdk_provider_utils.
|
|
1100
|
+
}[], {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
1017
1101
|
query: string;
|
|
1018
1102
|
limit?: number;
|
|
1019
1103
|
}, {
|
|
1020
1104
|
type: "tool_reference";
|
|
1021
1105
|
toolName: string;
|
|
1022
|
-
}[]>;
|
|
1106
|
+
}[], {}>;
|
|
1023
1107
|
};
|
|
1024
1108
|
|
|
1025
1109
|
interface AnthropicProvider extends ProviderV4 {
|
|
1026
1110
|
/**
|
|
1027
1111
|
* Creates a model for text generation.
|
|
1028
1112
|
*/
|
|
1029
|
-
(modelId:
|
|
1113
|
+
(modelId: AnthropicModelId): LanguageModelV4;
|
|
1030
1114
|
/**
|
|
1031
1115
|
* Creates a model for text generation.
|
|
1032
1116
|
*/
|
|
1033
|
-
languageModel(modelId:
|
|
1034
|
-
chat(modelId:
|
|
1035
|
-
messages(modelId:
|
|
1117
|
+
languageModel(modelId: AnthropicModelId): LanguageModelV4;
|
|
1118
|
+
chat(modelId: AnthropicModelId): LanguageModelV4;
|
|
1119
|
+
messages(modelId: AnthropicModelId): LanguageModelV4;
|
|
1036
1120
|
/**
|
|
1037
1121
|
* @deprecated Use `embeddingModel` instead.
|
|
1038
1122
|
*/
|
|
1039
1123
|
textEmbeddingModel(modelId: string): never;
|
|
1124
|
+
files(): FilesV4;
|
|
1125
|
+
/**
|
|
1126
|
+
* Returns a SkillsV4 interface for uploading skills to Anthropic.
|
|
1127
|
+
*/
|
|
1128
|
+
skills(): SkillsV4;
|
|
1040
1129
|
/**
|
|
1041
1130
|
* Anthropic-specific computer use tool.
|
|
1042
1131
|
*/
|