@tanstack/ai-anthropic 0.7.5 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/adapters/summarize.js +79 -49
- package/dist/esm/adapters/summarize.js.map +1 -1
- package/dist/esm/adapters/text.d.ts +5 -4
- package/dist/esm/adapters/text.js +28 -2
- package/dist/esm/adapters/text.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/model-meta.d.ts +28 -0
- package/dist/esm/model-meta.js.map +1 -1
- package/dist/esm/tools/bash-tool.d.ts +7 -4
- package/dist/esm/tools/bash-tool.js +8 -0
- package/dist/esm/tools/bash-tool.js.map +1 -1
- package/dist/esm/tools/code-execution-tool.d.ts +7 -4
- package/dist/esm/tools/code-execution-tool.js +8 -0
- package/dist/esm/tools/code-execution-tool.js.map +1 -1
- package/dist/esm/tools/computer-use-tool.d.ts +7 -4
- package/dist/esm/tools/computer-use-tool.js +8 -0
- package/dist/esm/tools/computer-use-tool.js.map +1 -1
- package/dist/esm/tools/custom-tool.d.ts +4 -2
- package/dist/esm/tools/custom-tool.js +12 -1
- package/dist/esm/tools/custom-tool.js.map +1 -1
- package/dist/esm/tools/index.d.ts +8 -1
- package/dist/esm/tools/index.js +19 -0
- package/dist/esm/tools/index.js.map +1 -0
- package/dist/esm/tools/memory-tool.d.ts +7 -4
- package/dist/esm/tools/memory-tool.js +9 -1
- package/dist/esm/tools/memory-tool.js.map +1 -1
- package/dist/esm/tools/text-editor-tool.d.ts +7 -4
- package/dist/esm/tools/text-editor-tool.js +9 -1
- package/dist/esm/tools/text-editor-tool.js.map +1 -1
- package/dist/esm/tools/web-fetch-tool.d.ts +7 -4
- package/dist/esm/tools/web-fetch-tool.js +9 -1
- package/dist/esm/tools/web-fetch-tool.js.map +1 -1
- package/dist/esm/tools/web-search-tool.d.ts +7 -4
- package/dist/esm/tools/web-search-tool.js +41 -1
- package/dist/esm/tools/web-search-tool.js.map +1 -1
- package/package.json +7 -3
- package/src/adapters/summarize.ts +88 -54
- package/src/adapters/text.ts +45 -6
- package/src/index.ts +2 -1
- package/src/model-meta.ts +126 -0
- package/src/tools/bash-tool.ts +13 -6
- package/src/tools/code-execution-tool.ts +17 -6
- package/src/tools/computer-use-tool.ts +14 -6
- package/src/tools/custom-tool.ts +5 -3
- package/src/tools/index.ts +49 -12
- package/src/tools/memory-tool.ts +12 -6
- package/src/tools/text-editor-tool.ts +14 -6
- package/src/tools/web-fetch-tool.ts +15 -7
- package/src/tools/web-search-tool.ts +17 -7
package/dist/esm/model-meta.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ declare const CLAUDE_OPUS_4_6: {
|
|
|
17
17
|
readonly input: ["text", "image", "document"];
|
|
18
18
|
readonly extended_thinking: true;
|
|
19
19
|
readonly priority_tier: true;
|
|
20
|
+
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
20
21
|
};
|
|
21
22
|
};
|
|
22
23
|
declare const CLAUDE_OPUS_4_5: {
|
|
@@ -37,6 +38,7 @@ declare const CLAUDE_OPUS_4_5: {
|
|
|
37
38
|
readonly input: ["text", "image", "document"];
|
|
38
39
|
readonly extended_thinking: true;
|
|
39
40
|
readonly priority_tier: true;
|
|
41
|
+
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
40
42
|
};
|
|
41
43
|
};
|
|
42
44
|
declare const CLAUDE_SONNET_4_6: {
|
|
@@ -58,6 +60,7 @@ declare const CLAUDE_SONNET_4_6: {
|
|
|
58
60
|
readonly extended_thinking: true;
|
|
59
61
|
readonly adaptive_thinking: true;
|
|
60
62
|
readonly priority_tier: true;
|
|
63
|
+
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
61
64
|
};
|
|
62
65
|
};
|
|
63
66
|
declare const CLAUDE_SONNET_4_5: {
|
|
@@ -78,6 +81,7 @@ declare const CLAUDE_SONNET_4_5: {
|
|
|
78
81
|
readonly input: ["text", "image", "document"];
|
|
79
82
|
readonly extended_thinking: true;
|
|
80
83
|
readonly priority_tier: true;
|
|
84
|
+
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
81
85
|
};
|
|
82
86
|
};
|
|
83
87
|
declare const CLAUDE_HAIKU_4_5: {
|
|
@@ -98,6 +102,7 @@ declare const CLAUDE_HAIKU_4_5: {
|
|
|
98
102
|
readonly input: ["text", "image", "document"];
|
|
99
103
|
readonly extended_thinking: true;
|
|
100
104
|
readonly priority_tier: true;
|
|
105
|
+
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
101
106
|
};
|
|
102
107
|
};
|
|
103
108
|
declare const CLAUDE_OPUS_4_1: {
|
|
@@ -118,6 +123,7 @@ declare const CLAUDE_OPUS_4_1: {
|
|
|
118
123
|
readonly input: ["text", "image", "document"];
|
|
119
124
|
readonly extended_thinking: true;
|
|
120
125
|
readonly priority_tier: true;
|
|
126
|
+
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
121
127
|
};
|
|
122
128
|
};
|
|
123
129
|
declare const CLAUDE_SONNET_4: {
|
|
@@ -138,6 +144,7 @@ declare const CLAUDE_SONNET_4: {
|
|
|
138
144
|
readonly input: ["text", "image", "document"];
|
|
139
145
|
readonly extended_thinking: true;
|
|
140
146
|
readonly priority_tier: true;
|
|
147
|
+
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
141
148
|
};
|
|
142
149
|
};
|
|
143
150
|
declare const CLAUDE_SONNET_3_7: {
|
|
@@ -157,6 +164,7 @@ declare const CLAUDE_SONNET_3_7: {
|
|
|
157
164
|
readonly input: ["text", "image", "document"];
|
|
158
165
|
readonly extended_thinking: true;
|
|
159
166
|
readonly priority_tier: true;
|
|
167
|
+
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
160
168
|
};
|
|
161
169
|
};
|
|
162
170
|
declare const CLAUDE_OPUS_4: {
|
|
@@ -177,6 +185,7 @@ declare const CLAUDE_OPUS_4: {
|
|
|
177
185
|
readonly input: ["text", "image", "document"];
|
|
178
186
|
readonly extended_thinking: true;
|
|
179
187
|
readonly priority_tier: true;
|
|
188
|
+
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
180
189
|
};
|
|
181
190
|
};
|
|
182
191
|
declare const CLAUDE_HAIKU_3_5: {
|
|
@@ -197,6 +206,7 @@ declare const CLAUDE_HAIKU_3_5: {
|
|
|
197
206
|
readonly input: ["text", "image", "document"];
|
|
198
207
|
readonly extended_thinking: false;
|
|
199
208
|
readonly priority_tier: true;
|
|
209
|
+
readonly tools: ["web_search", "web_fetch"];
|
|
200
210
|
};
|
|
201
211
|
};
|
|
202
212
|
declare const CLAUDE_HAIKU_3: {
|
|
@@ -217,6 +227,7 @@ declare const CLAUDE_HAIKU_3: {
|
|
|
217
227
|
readonly input: ["text", "image", "document"];
|
|
218
228
|
readonly extended_thinking: false;
|
|
219
229
|
readonly priority_tier: false;
|
|
230
|
+
readonly tools: ["web_search"];
|
|
220
231
|
};
|
|
221
232
|
};
|
|
222
233
|
declare const CLAUDE_OPUS_4_6_FAST: {
|
|
@@ -228,6 +239,7 @@ declare const CLAUDE_OPUS_4_6_FAST: {
|
|
|
228
239
|
readonly input: ["text", "image"];
|
|
229
240
|
readonly extended_thinking: true;
|
|
230
241
|
readonly priority_tier: true;
|
|
242
|
+
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
231
243
|
};
|
|
232
244
|
readonly pricing: {
|
|
233
245
|
readonly input: {
|
|
@@ -248,6 +260,7 @@ declare const CLAUDE_OPUS_4_7: {
|
|
|
248
260
|
readonly input: ["text", "image"];
|
|
249
261
|
readonly extended_thinking: true;
|
|
250
262
|
readonly priority_tier: true;
|
|
263
|
+
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
251
264
|
};
|
|
252
265
|
readonly pricing: {
|
|
253
266
|
readonly input: {
|
|
@@ -276,6 +289,21 @@ export type AnthropicChatModelProviderOptionsByName = {
|
|
|
276
289
|
[CLAUDE_OPUS_4_6_FAST.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
277
290
|
[CLAUDE_OPUS_4_7.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
278
291
|
};
|
|
292
|
+
export type AnthropicChatModelToolCapabilitiesByName = {
|
|
293
|
+
[CLAUDE_OPUS_4_6.id]: typeof CLAUDE_OPUS_4_6.supports.tools;
|
|
294
|
+
[CLAUDE_OPUS_4_5.id]: typeof CLAUDE_OPUS_4_5.supports.tools;
|
|
295
|
+
[CLAUDE_SONNET_4_6.id]: typeof CLAUDE_SONNET_4_6.supports.tools;
|
|
296
|
+
[CLAUDE_SONNET_4_5.id]: typeof CLAUDE_SONNET_4_5.supports.tools;
|
|
297
|
+
[CLAUDE_HAIKU_4_5.id]: typeof CLAUDE_HAIKU_4_5.supports.tools;
|
|
298
|
+
[CLAUDE_OPUS_4_1.id]: typeof CLAUDE_OPUS_4_1.supports.tools;
|
|
299
|
+
[CLAUDE_SONNET_4.id]: typeof CLAUDE_SONNET_4.supports.tools;
|
|
300
|
+
[CLAUDE_SONNET_3_7.id]: typeof CLAUDE_SONNET_3_7.supports.tools;
|
|
301
|
+
[CLAUDE_OPUS_4.id]: typeof CLAUDE_OPUS_4.supports.tools;
|
|
302
|
+
[CLAUDE_HAIKU_3_5.id]: typeof CLAUDE_HAIKU_3_5.supports.tools;
|
|
303
|
+
[CLAUDE_HAIKU_3.id]: typeof CLAUDE_HAIKU_3.supports.tools;
|
|
304
|
+
[CLAUDE_OPUS_4_6_FAST.id]: typeof CLAUDE_OPUS_4_6_FAST.supports.tools;
|
|
305
|
+
[CLAUDE_OPUS_4_7.id]: typeof CLAUDE_OPUS_4_7.supports.tools;
|
|
306
|
+
};
|
|
279
307
|
/**
|
|
280
308
|
* Type-only map from chat model name to its supported input modalities.
|
|
281
309
|
* All Anthropic Claude models support text, image, and document (PDF) input.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-meta.js","sources":["../../src/model-meta.ts"],"sourcesContent":["import type {\n AnthropicContainerOptions,\n AnthropicContextManagementOptions,\n AnthropicMCPOptions,\n AnthropicSamplingOptions,\n AnthropicServiceTierOptions,\n AnthropicStopSequencesOptions,\n AnthropicThinkingOptions,\n AnthropicToolChoiceOptions,\n} from './text/text-provider-options'\n\ninterface ModelMeta<\n TProviderOptions = unknown,\n TToolCapabilities = unknown,\n TMessageCapabilities = unknown,\n> {\n name: string\n id: string\n supports: {\n input: Array<'text' | 'image' | 'audio' | 'video' | 'document'>\n extended_thinking?: boolean\n adaptive_thinking?: boolean\n priority_tier?: boolean\n }\n context_window?: number\n max_output_tokens?: number\n knowledge_cutoff?: string\n pricing: {\n input: {\n normal: number\n cached?: number\n }\n output: {\n normal: number\n }\n }\n /**\n * Type-level description of which provider options this model supports.\n */\n providerOptions?: TProviderOptions\n /**\n * Type-level description of which tool capabilities this model supports.\n */\n toolCapabilities?: TToolCapabilities\n /**\n * Type-level description of which message/input capabilities this model supports.\n */\n messageCapabilities?: TMessageCapabilities\n}\n\nconst CLAUDE_OPUS_4_6 = {\n name: 'claude-opus-4-6',\n id: 'claude-opus-4-6',\n context_window: 200_000,\n max_output_tokens: 128_000,\n knowledge_cutoff: '2025-05-01',\n pricing: {\n input: {\n normal: 5,\n },\n output: {\n normal: 25,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_OPUS_4_5 = {\n name: 'claude-opus-4-5',\n id: 'claude-opus-4-5',\n context_window: 200_000,\n max_output_tokens: 32_000,\n knowledge_cutoff: '2025-11-01',\n pricing: {\n input: {\n normal: 15,\n },\n output: {\n normal: 75,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_SONNET_4_6 = {\n name: 'claude-sonnet-4-6',\n id: 'claude-sonnet-4-6',\n context_window: 1_000_000,\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-08-01',\n pricing: {\n input: {\n normal: 3,\n },\n output: {\n normal: 15,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n adaptive_thinking: true,\n priority_tier: true,\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_SONNET_4_5 = {\n name: 'claude-sonnet-4-5',\n id: 'claude-sonnet-4-5',\n context_window: 200_000,\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-09-29',\n pricing: {\n input: {\n normal: 3,\n },\n output: {\n normal: 15,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_HAIKU_4_5 = {\n name: 'claude-haiku-4-5',\n id: 'claude-haiku-4-5',\n context_window: 200_000,\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-10-01',\n pricing: {\n input: {\n normal: 1,\n },\n output: {\n normal: 5,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_OPUS_4_1 = {\n name: 'claude-opus-4-1',\n id: 'claude-opus-4-1',\n context_window: 200_000,\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-08-05',\n pricing: {\n input: {\n normal: 15,\n },\n output: {\n normal: 75,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_SONNET_4 = {\n name: 'claude-sonnet-4',\n id: 'claude-sonnet-4',\n context_window: 200_000,\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-05-14',\n pricing: {\n input: {\n normal: 3,\n },\n output: {\n normal: 15,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_SONNET_3_7 = {\n name: 'claude-sonnet-3-7',\n id: 'claude-3-7-sonnet',\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-05-14',\n pricing: {\n input: {\n normal: 3,\n },\n output: {\n normal: 15,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_OPUS_4 = {\n name: 'claude-opus-4',\n id: 'claude-opus-4',\n context_window: 200_000,\n max_output_tokens: 32_000,\n knowledge_cutoff: '2025-05-14',\n pricing: {\n input: {\n normal: 15,\n },\n output: {\n normal: 75,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_HAIKU_3_5 = {\n name: 'claude-haiku-3-5',\n id: 'claude-3-5-haiku',\n context_window: 200_000,\n max_output_tokens: 8_000,\n knowledge_cutoff: '2025-10-22',\n pricing: {\n input: {\n normal: 0.8,\n },\n output: {\n normal: 4,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: false,\n priority_tier: true,\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_HAIKU_3 = {\n name: 'claude-haiku-3',\n id: 'claude-3-haiku',\n context_window: 200_000,\n max_output_tokens: 4_000,\n knowledge_cutoff: '2024-03-07',\n pricing: {\n input: {\n normal: 0.25,\n },\n output: {\n normal: 1.25,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: false,\n priority_tier: false,\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\n/* const ANTHROPIC_MODEL_META = {\n [CLAUDE_OPUS_4_5.name]: CLAUDE_OPUS_4_5,\n [CLAUDE_SONNET_4_5.name]: CLAUDE_SONNET_4_5,\n [CLAUDE_HAIKU_4_5.name]: CLAUDE_HAIKU_4_5,\n [CLAUDE_OPUS_4_1.name]: CLAUDE_OPUS_4_1,\n [CLAUDE_SONNET_4.name]: CLAUDE_SONNET_4,\n [CLAUDE_SONNET_3_7.name]: CLAUDE_SONNET_3_7,\n [CLAUDE_OPUS_4.name]: CLAUDE_OPUS_4,\n [CLAUDE_HAIKU_3_5.name]: CLAUDE_HAIKU_3_5,\n [CLAUDE_HAIKU_3.name]: CLAUDE_HAIKU_3,\n} as const */\n\n/* export type AnthropicModelProviderOptions<\n TModel extends keyof AnthropicModelMetaMap,\n> =\n AnthropicModelMetaMap[TModel] extends ModelMeta<\n infer TProviderOptions,\n any,\n any\n >\n ? TProviderOptions\n : unknown */\n\n/* export type AnthropicModelToolCapabilities<\n TModel extends keyof AnthropicModelMetaMap,\n> =\n AnthropicModelMetaMap[TModel] extends ModelMeta<\n any,\n infer TToolCapabilities,\n any\n >\n ? TToolCapabilities\n : unknown\n */\n/* export type AnthropicModelMessageCapabilities<\n TModel extends keyof AnthropicModelMetaMap,\n> =\n AnthropicModelMetaMap[TModel] extends ModelMeta<\n any,\n any,\n infer TMessageCapabilities\n >\n ? TMessageCapabilities\n : unknown */\n\nconst CLAUDE_OPUS_4_6_FAST = {\n name: 'claude-opus-4.6-fast',\n id: 'claude-opus-4.6-fast',\n context_window: 1_000_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image'],\n extended_thinking: true,\n priority_tier: true,\n },\n pricing: {\n input: {\n normal: 30,\n cached: 3,\n },\n output: {\n normal: 150,\n },\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_OPUS_4_7 = {\n name: 'claude-opus-4.7',\n id: 'claude-opus-4.7',\n context_window: 1_000_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image'],\n extended_thinking: true,\n priority_tier: true,\n },\n pricing: {\n input: {\n normal: 5,\n cached: 0.5,\n },\n output: {\n normal: 25,\n },\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nexport const ANTHROPIC_MODELS = [\n CLAUDE_OPUS_4_6.id,\n CLAUDE_OPUS_4_5.id,\n CLAUDE_SONNET_4_6.id,\n CLAUDE_SONNET_4_5.id,\n CLAUDE_HAIKU_4_5.id,\n CLAUDE_OPUS_4_1.id,\n CLAUDE_SONNET_4.id,\n CLAUDE_SONNET_3_7.id,\n CLAUDE_OPUS_4.id,\n CLAUDE_HAIKU_3_5.id,\n CLAUDE_HAIKU_3.id,\n\n CLAUDE_OPUS_4_6_FAST.id,\n\n CLAUDE_OPUS_4_7.id,\n] as const\n\n// const ANTHROPIC_IMAGE_MODELS = [] as const\n// const ANTHROPIC_EMBEDDING_MODELS = [] as const\n// const ANTHROPIC_AUDIO_MODELS = [] as const\n// const ANTHROPIC_VIDEO_MODELS = [] as const\n\n/* type AnthropicModel = (typeof ANTHROPIC_MODELS)[number] */\nexport type AnthropicChatModel = (typeof ANTHROPIC_MODELS)[number]\n// Manual type map for per-model provider options\n// Models are differentiated by extended_thinking and priority_tier support\nexport type AnthropicChatModelProviderOptionsByName = {\n // Models with both extended_thinking and priority_tier\n [CLAUDE_OPUS_4_6.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_OPUS_4_5.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_SONNET_4_6.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_SONNET_4_5.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_HAIKU_4_5.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_OPUS_4_1.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_SONNET_4.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_SONNET_3_7.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_OPUS_4.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n\n // Model with priority_tier but NO extended_thinking\n [CLAUDE_HAIKU_3_5.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n\n // Model with neither extended_thinking nor priority_tier\n [CLAUDE_HAIKU_3.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicStopSequencesOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_OPUS_4_6_FAST.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_OPUS_4_7.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n}\n\n/**\n * Type-only map from chat model name to its supported input modalities.\n * All Anthropic Claude models support text, image, and document (PDF) input.\n * Used by the core AI types to constrain ContentPart types based on the selected model.\n * Note: These must be inlined as readonly arrays (not typeof) because the model\n * constants are not exported and typeof references don't work in .d.ts files\n * when consumed by external packages.\n *\n * @see https://docs.anthropic.com/claude/docs/vision\n * @see https://docs.anthropic.com/claude/docs/pdf-support\n */\nexport type AnthropicModelInputModalitiesByName = {\n [CLAUDE_OPUS_4_6.id]: typeof CLAUDE_OPUS_4_6.supports.input\n [CLAUDE_OPUS_4_5.id]: typeof CLAUDE_OPUS_4_5.supports.input\n [CLAUDE_SONNET_4_6.id]: typeof CLAUDE_SONNET_4_6.supports.input\n [CLAUDE_SONNET_4_5.id]: typeof CLAUDE_SONNET_4_5.supports.input\n [CLAUDE_HAIKU_4_5.id]: typeof CLAUDE_HAIKU_4_5.supports.input\n [CLAUDE_OPUS_4_1.id]: typeof CLAUDE_OPUS_4_1.supports.input\n [CLAUDE_SONNET_4.id]: typeof CLAUDE_SONNET_4.supports.input\n [CLAUDE_SONNET_3_7.id]: typeof CLAUDE_SONNET_3_7.supports.input\n [CLAUDE_OPUS_4.id]: typeof CLAUDE_OPUS_4.supports.input\n [CLAUDE_HAIKU_3_5.id]: typeof CLAUDE_HAIKU_3_5.supports.input\n [CLAUDE_HAIKU_3.id]: typeof CLAUDE_HAIKU_3.supports.input\n [CLAUDE_OPUS_4_6_FAST.id]: typeof CLAUDE_OPUS_4_6_FAST.supports.input\n [CLAUDE_OPUS_4_7.id]: typeof CLAUDE_OPUS_4_7.supports.input\n}\n"],"names":[],"mappings":"AAkDA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AAiBN;AAWA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AAiBN;AAWA,MAAM,oBAAoB;AAAA,EAExB,IAAI;AAkBN;AAWA,MAAM,oBAAoB;AAAA,EAExB,IAAI;AAiBN;AAWA,MAAM,mBAAmB;AAAA,EAEvB,IAAI;AAiBN;AAWA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AAiBN;AAWA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AAiBN;AAWA,MAAM,oBAAoB;AAAA,EAExB,IAAI;AAgBN;AAWA,MAAM,gBAAgB;AAAA,EAEpB,IAAI;AAiBN;AAWA,MAAM,mBAAmB;AAAA,EAEvB,IAAI;AAiBN;AAWA,MAAM,iBAAiB;AAAA,EAErB,IAAI;AAiBN;AAwDA,MAAM,uBAAuB;AAAA,EAE3B,IAAI;AAiBN;AAWA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AAiBN;AAWO,MAAM,mBAAmB;AAAA,EAC9B,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,eAAe;AAAA,EAEf,qBAAqB;AAAA,EAErB,gBAAgB;AAClB;"}
|
|
1
|
+
{"version":3,"file":"model-meta.js","sources":["../../src/model-meta.ts"],"sourcesContent":["import type {\n AnthropicContainerOptions,\n AnthropicContextManagementOptions,\n AnthropicMCPOptions,\n AnthropicSamplingOptions,\n AnthropicServiceTierOptions,\n AnthropicStopSequencesOptions,\n AnthropicThinkingOptions,\n AnthropicToolChoiceOptions,\n} from './text/text-provider-options'\n\ninterface ModelMeta<\n TProviderOptions = unknown,\n TToolCapabilities = unknown,\n TMessageCapabilities = unknown,\n> {\n name: string\n id: string\n supports: {\n input: Array<'text' | 'image' | 'audio' | 'video' | 'document'>\n extended_thinking?: boolean\n adaptive_thinking?: boolean\n priority_tier?: boolean\n tools?: Array<\n | 'web_search'\n | 'web_fetch'\n | 'code_execution'\n | 'computer_use'\n | 'bash'\n | 'text_editor'\n | 'memory'\n >\n }\n context_window?: number\n max_output_tokens?: number\n knowledge_cutoff?: string\n pricing: {\n input: {\n normal: number\n cached?: number\n }\n output: {\n normal: number\n }\n }\n /**\n * Type-level description of which provider options this model supports.\n */\n providerOptions?: TProviderOptions\n /**\n * Type-level description of which tool capabilities this model supports.\n */\n toolCapabilities?: TToolCapabilities\n /**\n * Type-level description of which message/input capabilities this model supports.\n */\n messageCapabilities?: TMessageCapabilities\n}\n\nconst CLAUDE_OPUS_4_6 = {\n name: 'claude-opus-4-6',\n id: 'claude-opus-4-6',\n context_window: 200_000,\n max_output_tokens: 128_000,\n knowledge_cutoff: '2025-05-01',\n pricing: {\n input: {\n normal: 5,\n },\n output: {\n normal: 25,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_OPUS_4_5 = {\n name: 'claude-opus-4-5',\n id: 'claude-opus-4-5',\n context_window: 200_000,\n max_output_tokens: 32_000,\n knowledge_cutoff: '2025-11-01',\n pricing: {\n input: {\n normal: 15,\n },\n output: {\n normal: 75,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_SONNET_4_6 = {\n name: 'claude-sonnet-4-6',\n id: 'claude-sonnet-4-6',\n context_window: 1_000_000,\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-08-01',\n pricing: {\n input: {\n normal: 3,\n },\n output: {\n normal: 15,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n adaptive_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_SONNET_4_5 = {\n name: 'claude-sonnet-4-5',\n id: 'claude-sonnet-4-5',\n context_window: 200_000,\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-09-29',\n pricing: {\n input: {\n normal: 3,\n },\n output: {\n normal: 15,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_HAIKU_4_5 = {\n name: 'claude-haiku-4-5',\n id: 'claude-haiku-4-5',\n context_window: 200_000,\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-10-01',\n pricing: {\n input: {\n normal: 1,\n },\n output: {\n normal: 5,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_OPUS_4_1 = {\n name: 'claude-opus-4-1',\n id: 'claude-opus-4-1',\n context_window: 200_000,\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-08-05',\n pricing: {\n input: {\n normal: 15,\n },\n output: {\n normal: 75,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_SONNET_4 = {\n name: 'claude-sonnet-4',\n id: 'claude-sonnet-4',\n context_window: 200_000,\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-05-14',\n pricing: {\n input: {\n normal: 3,\n },\n output: {\n normal: 15,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_SONNET_3_7 = {\n name: 'claude-sonnet-3-7',\n id: 'claude-3-7-sonnet',\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-05-14',\n pricing: {\n input: {\n normal: 3,\n },\n output: {\n normal: 15,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_OPUS_4 = {\n name: 'claude-opus-4',\n id: 'claude-opus-4',\n context_window: 200_000,\n max_output_tokens: 32_000,\n knowledge_cutoff: '2025-05-14',\n pricing: {\n input: {\n normal: 15,\n },\n output: {\n normal: 75,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_HAIKU_3_5 = {\n name: 'claude-haiku-3-5',\n id: 'claude-3-5-haiku',\n context_window: 200_000,\n max_output_tokens: 8_000,\n knowledge_cutoff: '2025-10-22',\n pricing: {\n input: {\n normal: 0.8,\n },\n output: {\n normal: 4,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: false,\n priority_tier: true,\n tools: ['web_search', 'web_fetch'],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_HAIKU_3 = {\n name: 'claude-haiku-3',\n id: 'claude-3-haiku',\n context_window: 200_000,\n max_output_tokens: 4_000,\n knowledge_cutoff: '2024-03-07',\n pricing: {\n input: {\n normal: 0.25,\n },\n output: {\n normal: 1.25,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: false,\n priority_tier: false,\n tools: ['web_search'],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\n/* const ANTHROPIC_MODEL_META = {\n [CLAUDE_OPUS_4_5.name]: CLAUDE_OPUS_4_5,\n [CLAUDE_SONNET_4_5.name]: CLAUDE_SONNET_4_5,\n [CLAUDE_HAIKU_4_5.name]: CLAUDE_HAIKU_4_5,\n [CLAUDE_OPUS_4_1.name]: CLAUDE_OPUS_4_1,\n [CLAUDE_SONNET_4.name]: CLAUDE_SONNET_4,\n [CLAUDE_SONNET_3_7.name]: CLAUDE_SONNET_3_7,\n [CLAUDE_OPUS_4.name]: CLAUDE_OPUS_4,\n [CLAUDE_HAIKU_3_5.name]: CLAUDE_HAIKU_3_5,\n [CLAUDE_HAIKU_3.name]: CLAUDE_HAIKU_3,\n} as const */\n\n/* export type AnthropicModelProviderOptions<\n TModel extends keyof AnthropicModelMetaMap,\n> =\n AnthropicModelMetaMap[TModel] extends ModelMeta<\n infer TProviderOptions,\n any,\n any\n >\n ? TProviderOptions\n : unknown */\n\n/* export type AnthropicModelToolCapabilities<\n TModel extends keyof AnthropicModelMetaMap,\n> =\n AnthropicModelMetaMap[TModel] extends ModelMeta<\n any,\n infer TToolCapabilities,\n any\n >\n ? TToolCapabilities\n : unknown\n */\n/* export type AnthropicModelMessageCapabilities<\n TModel extends keyof AnthropicModelMetaMap,\n> =\n AnthropicModelMetaMap[TModel] extends ModelMeta<\n any,\n any,\n infer TMessageCapabilities\n >\n ? TMessageCapabilities\n : unknown */\n\nconst CLAUDE_OPUS_4_6_FAST = {\n name: 'claude-opus-4.6-fast',\n id: 'claude-opus-4.6-fast',\n context_window: 1_000_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n pricing: {\n input: {\n normal: 30,\n cached: 3,\n },\n output: {\n normal: 150,\n },\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_OPUS_4_7 = {\n name: 'claude-opus-4.7',\n id: 'claude-opus-4.7',\n context_window: 1_000_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n pricing: {\n input: {\n normal: 5,\n cached: 0.5,\n },\n output: {\n normal: 25,\n },\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nexport const ANTHROPIC_MODELS = [\n CLAUDE_OPUS_4_6.id,\n CLAUDE_OPUS_4_5.id,\n CLAUDE_SONNET_4_6.id,\n CLAUDE_SONNET_4_5.id,\n CLAUDE_HAIKU_4_5.id,\n CLAUDE_OPUS_4_1.id,\n CLAUDE_SONNET_4.id,\n CLAUDE_SONNET_3_7.id,\n CLAUDE_OPUS_4.id,\n CLAUDE_HAIKU_3_5.id,\n CLAUDE_HAIKU_3.id,\n\n CLAUDE_OPUS_4_6_FAST.id,\n\n CLAUDE_OPUS_4_7.id,\n] as const\n\n// const ANTHROPIC_IMAGE_MODELS = [] as const\n// const ANTHROPIC_EMBEDDING_MODELS = [] as const\n// const ANTHROPIC_AUDIO_MODELS = [] as const\n// const ANTHROPIC_VIDEO_MODELS = [] as const\n\n/* type AnthropicModel = (typeof ANTHROPIC_MODELS)[number] */\nexport type AnthropicChatModel = (typeof ANTHROPIC_MODELS)[number]\n// Manual type map for per-model provider options\n// Models are differentiated by extended_thinking and priority_tier support\nexport type AnthropicChatModelProviderOptionsByName = {\n // Models with both extended_thinking and priority_tier\n [CLAUDE_OPUS_4_6.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_OPUS_4_5.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_SONNET_4_6.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_SONNET_4_5.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_HAIKU_4_5.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_OPUS_4_1.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_SONNET_4.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_SONNET_3_7.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_OPUS_4.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n\n // Model with priority_tier but NO extended_thinking\n [CLAUDE_HAIKU_3_5.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n\n // Model with neither extended_thinking nor priority_tier\n [CLAUDE_HAIKU_3.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicStopSequencesOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_OPUS_4_6_FAST.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_OPUS_4_7.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n}\n\nexport type AnthropicChatModelToolCapabilitiesByName = {\n [CLAUDE_OPUS_4_6.id]: typeof CLAUDE_OPUS_4_6.supports.tools\n [CLAUDE_OPUS_4_5.id]: typeof CLAUDE_OPUS_4_5.supports.tools\n [CLAUDE_SONNET_4_6.id]: typeof CLAUDE_SONNET_4_6.supports.tools\n [CLAUDE_SONNET_4_5.id]: typeof CLAUDE_SONNET_4_5.supports.tools\n [CLAUDE_HAIKU_4_5.id]: typeof CLAUDE_HAIKU_4_5.supports.tools\n [CLAUDE_OPUS_4_1.id]: typeof CLAUDE_OPUS_4_1.supports.tools\n [CLAUDE_SONNET_4.id]: typeof CLAUDE_SONNET_4.supports.tools\n [CLAUDE_SONNET_3_7.id]: typeof CLAUDE_SONNET_3_7.supports.tools\n [CLAUDE_OPUS_4.id]: typeof CLAUDE_OPUS_4.supports.tools\n [CLAUDE_HAIKU_3_5.id]: typeof CLAUDE_HAIKU_3_5.supports.tools\n [CLAUDE_HAIKU_3.id]: typeof CLAUDE_HAIKU_3.supports.tools\n [CLAUDE_OPUS_4_6_FAST.id]: typeof CLAUDE_OPUS_4_6_FAST.supports.tools\n [CLAUDE_OPUS_4_7.id]: typeof CLAUDE_OPUS_4_7.supports.tools\n}\n\n/**\n * Type-only map from chat model name to its supported input modalities.\n * All Anthropic Claude models support text, image, and document (PDF) input.\n * Used by the core AI types to constrain ContentPart types based on the selected model.\n * Note: These must be inlined as readonly arrays (not typeof) because the model\n * constants are not exported and typeof references don't work in .d.ts files\n * when consumed by external packages.\n *\n * @see https://docs.anthropic.com/claude/docs/vision\n * @see https://docs.anthropic.com/claude/docs/pdf-support\n */\nexport type AnthropicModelInputModalitiesByName = {\n [CLAUDE_OPUS_4_6.id]: typeof CLAUDE_OPUS_4_6.supports.input\n [CLAUDE_OPUS_4_5.id]: typeof CLAUDE_OPUS_4_5.supports.input\n [CLAUDE_SONNET_4_6.id]: typeof CLAUDE_SONNET_4_6.supports.input\n [CLAUDE_SONNET_4_5.id]: typeof CLAUDE_SONNET_4_5.supports.input\n [CLAUDE_HAIKU_4_5.id]: typeof CLAUDE_HAIKU_4_5.supports.input\n [CLAUDE_OPUS_4_1.id]: typeof CLAUDE_OPUS_4_1.supports.input\n [CLAUDE_SONNET_4.id]: typeof CLAUDE_SONNET_4.supports.input\n [CLAUDE_SONNET_3_7.id]: typeof CLAUDE_SONNET_3_7.supports.input\n [CLAUDE_OPUS_4.id]: typeof CLAUDE_OPUS_4.supports.input\n [CLAUDE_HAIKU_3_5.id]: typeof CLAUDE_HAIKU_3_5.supports.input\n [CLAUDE_HAIKU_3.id]: typeof CLAUDE_HAIKU_3.supports.input\n [CLAUDE_OPUS_4_6_FAST.id]: typeof CLAUDE_OPUS_4_6_FAST.supports.input\n [CLAUDE_OPUS_4_7.id]: typeof CLAUDE_OPUS_4_7.supports.input\n}\n"],"names":[],"mappings":"AA2DA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AA0BN;AAWA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AA0BN;AAWA,MAAM,oBAAoB;AAAA,EAExB,IAAI;AA2BN;AAWA,MAAM,oBAAoB;AAAA,EAExB,IAAI;AA0BN;AAWA,MAAM,mBAAmB;AAAA,EAEvB,IAAI;AA0BN;AAWA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AA0BN;AAWA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AA0BN;AAWA,MAAM,oBAAoB;AAAA,EAExB,IAAI;AAyBN;AAWA,MAAM,gBAAgB;AAAA,EAEpB,IAAI;AA0BN;AAWA,MAAM,mBAAmB;AAAA,EAEvB,IAAI;AAkBN;AAWA,MAAM,iBAAiB;AAAA,EAErB,IAAI;AAkBN;AAwDA,MAAM,uBAAuB;AAAA,EAE3B,IAAI;AA0BN;AAWA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AA0BN;AAWO,MAAM,mBAAmB;AAAA,EAC9B,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,eAAe;AAAA,EAEf,qBAAqB;AAAA,EAErB,gBAAgB;AAClB;"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { BetaToolBash20241022, BetaToolBash20250124 } from '@anthropic-ai/sdk/resources/beta';
|
|
2
|
-
import { Tool } from '@tanstack/ai';
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
export
|
|
2
|
+
import { ProviderTool, Tool } from '@tanstack/ai';
|
|
3
|
+
export type BashToolConfig = BetaToolBash20241022 | BetaToolBash20250124;
|
|
4
|
+
/** @deprecated Renamed to `BashToolConfig`. Will be removed in a future release. */
|
|
5
|
+
export type BashTool = BashToolConfig;
|
|
6
|
+
export type AnthropicBashTool = ProviderTool<'anthropic', 'bash'>;
|
|
7
|
+
export declare function convertBashToolToAdapterFormat(tool: Tool): BashToolConfig;
|
|
8
|
+
export declare function bashTool(config: BashToolConfig): AnthropicBashTool;
|
|
@@ -2,7 +2,15 @@ function convertBashToolToAdapterFormat(tool) {
|
|
|
2
2
|
const metadata = tool.metadata;
|
|
3
3
|
return metadata;
|
|
4
4
|
}
|
|
5
|
+
function bashTool(config) {
|
|
6
|
+
return {
|
|
7
|
+
name: "bash",
|
|
8
|
+
description: "",
|
|
9
|
+
metadata: config
|
|
10
|
+
};
|
|
11
|
+
}
|
|
5
12
|
export {
|
|
13
|
+
bashTool,
|
|
6
14
|
convertBashToolToAdapterFormat
|
|
7
15
|
};
|
|
8
16
|
//# sourceMappingURL=bash-tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash-tool.js","sources":["../../../src/tools/bash-tool.ts"],"sourcesContent":["import type {\n BetaToolBash20241022,\n BetaToolBash20250124,\n} from '@anthropic-ai/sdk/resources/beta'\nimport type { Tool } from '@tanstack/ai'\n\nexport type
|
|
1
|
+
{"version":3,"file":"bash-tool.js","sources":["../../../src/tools/bash-tool.ts"],"sourcesContent":["import type {\n BetaToolBash20241022,\n BetaToolBash20250124,\n} from '@anthropic-ai/sdk/resources/beta'\nimport type { ProviderTool, Tool } from '@tanstack/ai'\n\nexport type BashToolConfig = BetaToolBash20241022 | BetaToolBash20250124\n\n/** @deprecated Renamed to `BashToolConfig`. Will be removed in a future release. */\nexport type BashTool = BashToolConfig\n\nexport type AnthropicBashTool = ProviderTool<'anthropic', 'bash'>\n\nexport function convertBashToolToAdapterFormat(tool: Tool): BashToolConfig {\n const metadata = tool.metadata as BashToolConfig\n return metadata\n}\n\nexport function bashTool(config: BashToolConfig): AnthropicBashTool {\n // Phantom-brand cast: '~provider'/'~toolKind' are type-only and never assigned at runtime.\n return {\n name: 'bash',\n description: '',\n metadata: config,\n } as unknown as AnthropicBashTool\n}\n"],"names":[],"mappings":"AAaO,SAAS,+BAA+B,MAA4B;AACzE,QAAM,WAAW,KAAK;AACtB,SAAO;AACT;AAEO,SAAS,SAAS,QAA2C;AAElE,SAAO;AAAA,IACL,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EAAA;AAEd;"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { BetaCodeExecutionTool20250522, BetaCodeExecutionTool20250825 } from '@anthropic-ai/sdk/resources/beta';
|
|
2
|
-
import { Tool } from '@tanstack/ai';
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
export
|
|
2
|
+
import { ProviderTool, Tool } from '@tanstack/ai';
|
|
3
|
+
export type CodeExecutionToolConfig = BetaCodeExecutionTool20250522 | BetaCodeExecutionTool20250825;
|
|
4
|
+
/** @deprecated Renamed to `CodeExecutionToolConfig`. Will be removed in a future release. */
|
|
5
|
+
export type CodeExecutionTool = CodeExecutionToolConfig;
|
|
6
|
+
export type AnthropicCodeExecutionTool = ProviderTool<'anthropic', 'code_execution'>;
|
|
7
|
+
export declare function convertCodeExecutionToolToAdapterFormat(tool: Tool): CodeExecutionToolConfig;
|
|
8
|
+
export declare function codeExecutionTool(config: CodeExecutionToolConfig): AnthropicCodeExecutionTool;
|
|
@@ -2,7 +2,15 @@ function convertCodeExecutionToolToAdapterFormat(tool) {
|
|
|
2
2
|
const metadata = tool.metadata;
|
|
3
3
|
return metadata;
|
|
4
4
|
}
|
|
5
|
+
function codeExecutionTool(config) {
|
|
6
|
+
return {
|
|
7
|
+
name: "code_execution",
|
|
8
|
+
description: "",
|
|
9
|
+
metadata: config
|
|
10
|
+
};
|
|
11
|
+
}
|
|
5
12
|
export {
|
|
13
|
+
codeExecutionTool,
|
|
6
14
|
convertCodeExecutionToolToAdapterFormat
|
|
7
15
|
};
|
|
8
16
|
//# sourceMappingURL=code-execution-tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-execution-tool.js","sources":["../../../src/tools/code-execution-tool.ts"],"sourcesContent":["import type {\n BetaCodeExecutionTool20250522,\n BetaCodeExecutionTool20250825,\n} from '@anthropic-ai/sdk/resources/beta'\nimport type { Tool } from '@tanstack/ai'\n\nexport type
|
|
1
|
+
{"version":3,"file":"code-execution-tool.js","sources":["../../../src/tools/code-execution-tool.ts"],"sourcesContent":["import type {\n BetaCodeExecutionTool20250522,\n BetaCodeExecutionTool20250825,\n} from '@anthropic-ai/sdk/resources/beta'\nimport type { ProviderTool, Tool } from '@tanstack/ai'\n\nexport type CodeExecutionToolConfig =\n | BetaCodeExecutionTool20250522\n | BetaCodeExecutionTool20250825\n\n/** @deprecated Renamed to `CodeExecutionToolConfig`. Will be removed in a future release. */\nexport type CodeExecutionTool = CodeExecutionToolConfig\n\nexport type AnthropicCodeExecutionTool = ProviderTool<\n 'anthropic',\n 'code_execution'\n>\n\nexport function convertCodeExecutionToolToAdapterFormat(\n tool: Tool,\n): CodeExecutionToolConfig {\n const metadata = tool.metadata as CodeExecutionToolConfig\n return metadata\n}\n\nexport function codeExecutionTool(\n config: CodeExecutionToolConfig,\n): AnthropicCodeExecutionTool {\n // Phantom-brand cast: '~provider'/'~toolKind' are type-only and never assigned at runtime.\n return {\n name: 'code_execution',\n description: '',\n metadata: config,\n } as unknown as AnthropicCodeExecutionTool\n}\n"],"names":[],"mappings":"AAkBO,SAAS,wCACd,MACyB;AACzB,QAAM,WAAW,KAAK;AACtB,SAAO;AACT;AAEO,SAAS,kBACd,QAC4B;AAE5B,SAAO;AAAA,IACL,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EAAA;AAEd;"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { BetaToolComputerUse20241022, BetaToolComputerUse20250124 } from '@anthropic-ai/sdk/resources/beta';
|
|
2
|
-
import { Tool } from '@tanstack/ai';
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
export
|
|
2
|
+
import { ProviderTool, Tool } from '@tanstack/ai';
|
|
3
|
+
export type ComputerUseToolConfig = BetaToolComputerUse20241022 | BetaToolComputerUse20250124;
|
|
4
|
+
/** @deprecated Renamed to `ComputerUseToolConfig`. Will be removed in a future release. */
|
|
5
|
+
export type ComputerUseTool = ComputerUseToolConfig;
|
|
6
|
+
export type AnthropicComputerUseTool = ProviderTool<'anthropic', 'computer_use'>;
|
|
7
|
+
export declare function convertComputerUseToolToAdapterFormat(tool: Tool): ComputerUseToolConfig;
|
|
8
|
+
export declare function computerUseTool(config: ComputerUseToolConfig): AnthropicComputerUseTool;
|
|
@@ -2,7 +2,15 @@ function convertComputerUseToolToAdapterFormat(tool) {
|
|
|
2
2
|
const metadata = tool.metadata;
|
|
3
3
|
return metadata;
|
|
4
4
|
}
|
|
5
|
+
function computerUseTool(config) {
|
|
6
|
+
return {
|
|
7
|
+
name: "computer",
|
|
8
|
+
description: "",
|
|
9
|
+
metadata: config
|
|
10
|
+
};
|
|
11
|
+
}
|
|
5
12
|
export {
|
|
13
|
+
computerUseTool,
|
|
6
14
|
convertComputerUseToolToAdapterFormat
|
|
7
15
|
};
|
|
8
16
|
//# sourceMappingURL=computer-use-tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computer-use-tool.js","sources":["../../../src/tools/computer-use-tool.ts"],"sourcesContent":["import type {\n BetaToolComputerUse20241022,\n BetaToolComputerUse20250124,\n} from '@anthropic-ai/sdk/resources/beta'\nimport type { Tool } from '@tanstack/ai'\n\nexport type
|
|
1
|
+
{"version":3,"file":"computer-use-tool.js","sources":["../../../src/tools/computer-use-tool.ts"],"sourcesContent":["import type {\n BetaToolComputerUse20241022,\n BetaToolComputerUse20250124,\n} from '@anthropic-ai/sdk/resources/beta'\nimport type { ProviderTool, Tool } from '@tanstack/ai'\n\nexport type ComputerUseToolConfig =\n | BetaToolComputerUse20241022\n | BetaToolComputerUse20250124\n\n/** @deprecated Renamed to `ComputerUseToolConfig`. Will be removed in a future release. */\nexport type ComputerUseTool = ComputerUseToolConfig\n\nexport type AnthropicComputerUseTool = ProviderTool<'anthropic', 'computer_use'>\n\nexport function convertComputerUseToolToAdapterFormat(\n tool: Tool,\n): ComputerUseToolConfig {\n const metadata = tool.metadata as ComputerUseToolConfig\n return metadata\n}\n\nexport function computerUseTool(\n config: ComputerUseToolConfig,\n): AnthropicComputerUseTool {\n // Phantom-brand cast: '~provider'/'~toolKind' are type-only and never assigned at runtime.\n return {\n name: 'computer',\n description: '',\n metadata: config,\n } as unknown as AnthropicComputerUseTool\n}\n"],"names":[],"mappings":"AAeO,SAAS,sCACd,MACuB;AACvB,QAAM,WAAW,KAAK;AACtB,SAAO;AACT;AAEO,SAAS,gBACd,QAC0B;AAE1B,SAAO;AAAA,IACL,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EAAA;AAEd;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SchemaInput, Tool } from '@tanstack/ai';
|
|
2
2
|
import { CacheControl } from '../text/text-provider-options.js';
|
|
3
|
-
export interface
|
|
3
|
+
export interface CustomToolConfig {
|
|
4
4
|
/**
|
|
5
5
|
* The name of the tool.
|
|
6
6
|
*/
|
|
@@ -20,5 +20,7 @@ export interface CustomTool {
|
|
|
20
20
|
};
|
|
21
21
|
cache_control?: CacheControl | null;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
/** @deprecated Renamed to `CustomToolConfig`. Will be removed in a future release. */
|
|
24
|
+
export type CustomTool = CustomToolConfig;
|
|
25
|
+
export declare function convertCustomToolToAdapterFormat(tool: Tool): CustomToolConfig;
|
|
24
26
|
export declare function customTool(name: string, description: string, inputSchema: SchemaInput, cacheControl?: CacheControl | null): Tool;
|
|
@@ -17,7 +17,18 @@ function convertCustomToolToAdapterFormat(tool) {
|
|
|
17
17
|
cache_control: metadata.cacheControl || null
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
+
function customTool(name, description, inputSchema, cacheControl) {
|
|
21
|
+
return {
|
|
22
|
+
name,
|
|
23
|
+
description,
|
|
24
|
+
inputSchema,
|
|
25
|
+
metadata: {
|
|
26
|
+
cacheControl
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
20
30
|
export {
|
|
21
|
-
convertCustomToolToAdapterFormat
|
|
31
|
+
convertCustomToolToAdapterFormat,
|
|
32
|
+
customTool
|
|
22
33
|
};
|
|
23
34
|
//# sourceMappingURL=custom-tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-tool.js","sources":["../../../src/tools/custom-tool.ts"],"sourcesContent":["import type { JSONSchema, SchemaInput, Tool } from '@tanstack/ai'\nimport type { CacheControl } from '../text/text-provider-options'\n\nexport interface
|
|
1
|
+
{"version":3,"file":"custom-tool.js","sources":["../../../src/tools/custom-tool.ts"],"sourcesContent":["import type { JSONSchema, SchemaInput, Tool } from '@tanstack/ai'\nimport type { CacheControl } from '../text/text-provider-options'\n\nexport interface CustomToolConfig {\n /**\n * The name of the tool.\n */\n name: string\n type: 'custom'\n /**\n * A brief description of what the tool does. Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.\n */\n description: string\n /**\n * This defines the shape of the input that your tool accepts and that the model will produce.\n */\n input_schema: {\n type: 'object'\n properties: Record<string, any> | null\n required?: Array<string> | null\n }\n\n cache_control?: CacheControl | null\n}\n\n/** @deprecated Renamed to `CustomToolConfig`. Will be removed in a future release. */\nexport type CustomTool = CustomToolConfig\n\nexport function convertCustomToolToAdapterFormat(tool: Tool): CustomToolConfig {\n const metadata =\n (tool.metadata as { cacheControl?: CacheControl | null } | undefined) || {}\n\n const jsonSchema = (tool.inputSchema ?? {\n type: 'object',\n properties: {},\n required: [],\n }) as JSONSchema\n\n const inputSchema = {\n type: 'object' as const,\n properties: jsonSchema.properties || null,\n required: jsonSchema.required || null,\n }\n\n return {\n name: tool.name,\n type: 'custom',\n description: tool.description,\n input_schema: inputSchema,\n cache_control: metadata.cacheControl || null,\n }\n}\n\nexport function customTool(\n name: string,\n description: string,\n inputSchema: SchemaInput,\n cacheControl?: CacheControl | null,\n): Tool {\n return {\n name,\n description,\n inputSchema,\n metadata: {\n cacheControl,\n },\n }\n}\n"],"names":[],"mappings":"AA4BO,SAAS,iCAAiC,MAA8B;AAC7E,QAAM,WACH,KAAK,YAAmE,CAAA;AAE3E,QAAM,aAAc,KAAK,eAAe;AAAA,IAEtC,YAAY,CAAA;AAAA,IACZ,UAAU,CAAA;AAAA,EAAC;AAGb,QAAM,cAAc;AAAA,IAClB,MAAM;AAAA,IACN,YAAY,WAAW,cAAc;AAAA,IACrC,UAAU,WAAW,YAAY;AAAA,EAAA;AAGnC,SAAO;AAAA,IACL,MAAM,KAAK;AAAA,IACX,MAAM;AAAA,IACN,aAAa,KAAK;AAAA,IAClB,cAAc;AAAA,IACd,eAAe,SAAS,gBAAgB;AAAA,EAAA;AAE5C;AAEO,SAAS,WACd,MACA,aACA,aACA,cACM;AACN,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,MACR;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -6,5 +6,12 @@ import { MemoryTool } from './memory-tool.js';
|
|
|
6
6
|
import { TextEditorTool } from './text-editor-tool.js';
|
|
7
7
|
import { WebFetchTool } from './web-fetch-tool.js';
|
|
8
8
|
import { WebSearchTool } from './web-search-tool.js';
|
|
9
|
+
export { bashTool, type AnthropicBashTool, type BashToolConfig, type BashTool, } from './bash-tool.js';
|
|
10
|
+
export { codeExecutionTool, type AnthropicCodeExecutionTool, type CodeExecutionToolConfig, type CodeExecutionTool, } from './code-execution-tool.js';
|
|
11
|
+
export { computerUseTool, type AnthropicComputerUseTool, type ComputerUseToolConfig, type ComputerUseTool, } from './computer-use-tool.js';
|
|
12
|
+
export { customTool, type CustomToolConfig, type CustomTool, } from './custom-tool.js';
|
|
13
|
+
export { memoryTool, type AnthropicMemoryTool, type MemoryToolConfig, type MemoryTool, } from './memory-tool.js';
|
|
14
|
+
export { textEditorTool, type AnthropicTextEditorTool, type TextEditorToolConfig, type TextEditorTool, } from './text-editor-tool.js';
|
|
15
|
+
export { webFetchTool, type AnthropicWebFetchTool, type WebFetchToolConfig, type WebFetchTool, } from './web-fetch-tool.js';
|
|
16
|
+
export { webSearchTool, type AnthropicWebSearchTool, type WebSearchToolConfig, type WebSearchTool, } from './web-search-tool.js';
|
|
9
17
|
export type AnthropicTool = BashTool | CodeExecutionTool | ComputerUseTool | CustomTool | MemoryTool | TextEditorTool | WebFetchTool | WebSearchTool;
|
|
10
|
-
export type { CustomTool, };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { bashTool } from "./bash-tool.js";
|
|
2
|
+
import { codeExecutionTool } from "./code-execution-tool.js";
|
|
3
|
+
import { computerUseTool } from "./computer-use-tool.js";
|
|
4
|
+
import { customTool } from "./custom-tool.js";
|
|
5
|
+
import { memoryTool } from "./memory-tool.js";
|
|
6
|
+
import { textEditorTool } from "./text-editor-tool.js";
|
|
7
|
+
import { webFetchTool } from "./web-fetch-tool.js";
|
|
8
|
+
import { webSearchTool } from "./web-search-tool.js";
|
|
9
|
+
export {
|
|
10
|
+
bashTool,
|
|
11
|
+
codeExecutionTool,
|
|
12
|
+
computerUseTool,
|
|
13
|
+
customTool,
|
|
14
|
+
memoryTool,
|
|
15
|
+
textEditorTool,
|
|
16
|
+
webFetchTool,
|
|
17
|
+
webSearchTool
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { BetaMemoryTool20250818 } from '@anthropic-ai/sdk/resources/beta';
|
|
2
|
-
import { Tool } from '@tanstack/ai';
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
export
|
|
2
|
+
import { ProviderTool, Tool } from '@tanstack/ai';
|
|
3
|
+
export type MemoryToolConfig = BetaMemoryTool20250818;
|
|
4
|
+
/** @deprecated Renamed to `MemoryToolConfig`. Will be removed in a future release. */
|
|
5
|
+
export type MemoryTool = MemoryToolConfig;
|
|
6
|
+
export type AnthropicMemoryTool = ProviderTool<'anthropic', 'memory'>;
|
|
7
|
+
export declare function convertMemoryToolToAdapterFormat(tool: Tool): MemoryToolConfig;
|
|
8
|
+
export declare function memoryTool(config?: MemoryToolConfig): AnthropicMemoryTool;
|
|
@@ -5,7 +5,15 @@ function convertMemoryToolToAdapterFormat(tool) {
|
|
|
5
5
|
...metadata
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
|
+
function memoryTool(config) {
|
|
9
|
+
return {
|
|
10
|
+
name: "memory",
|
|
11
|
+
description: "",
|
|
12
|
+
metadata: config
|
|
13
|
+
};
|
|
14
|
+
}
|
|
8
15
|
export {
|
|
9
|
-
convertMemoryToolToAdapterFormat
|
|
16
|
+
convertMemoryToolToAdapterFormat,
|
|
17
|
+
memoryTool
|
|
10
18
|
};
|
|
11
19
|
//# sourceMappingURL=memory-tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-tool.js","sources":["../../../src/tools/memory-tool.ts"],"sourcesContent":["import type { BetaMemoryTool20250818 } from '@anthropic-ai/sdk/resources/beta'\nimport type { Tool } from '@tanstack/ai'\n\nexport type
|
|
1
|
+
{"version":3,"file":"memory-tool.js","sources":["../../../src/tools/memory-tool.ts"],"sourcesContent":["import type { BetaMemoryTool20250818 } from '@anthropic-ai/sdk/resources/beta'\nimport type { ProviderTool, Tool } from '@tanstack/ai'\n\nexport type MemoryToolConfig = BetaMemoryTool20250818\n\n/** @deprecated Renamed to `MemoryToolConfig`. Will be removed in a future release. */\nexport type MemoryTool = MemoryToolConfig\n\nexport type AnthropicMemoryTool = ProviderTool<'anthropic', 'memory'>\n\nexport function convertMemoryToolToAdapterFormat(tool: Tool): MemoryToolConfig {\n const metadata = tool.metadata as Omit<MemoryToolConfig, 'type'>\n return {\n type: 'memory_20250818',\n ...metadata,\n }\n}\n\nexport function memoryTool(config?: MemoryToolConfig): AnthropicMemoryTool {\n // Phantom-brand cast: '~provider'/'~toolKind' are type-only and never assigned at runtime.\n return {\n name: 'memory',\n description: '',\n metadata: config,\n } as unknown as AnthropicMemoryTool\n}\n"],"names":[],"mappings":"AAUO,SAAS,iCAAiC,MAA8B;AAC7E,QAAM,WAAW,KAAK;AACtB,SAAO;AAAA,IACL,MAAM;AAAA,IACN,GAAG;AAAA,EAAA;AAEP;AAEO,SAAS,WAAW,QAAgD;AAEzE,SAAO;AAAA,IACL,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EAAA;AAEd;"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ToolTextEditor20250124, ToolTextEditor20250429, ToolTextEditor20250728 } from '@anthropic-ai/sdk/resources/messages';
|
|
2
|
-
import { Tool } from '@tanstack/ai';
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
export
|
|
2
|
+
import { ProviderTool, Tool } from '@tanstack/ai';
|
|
3
|
+
export type TextEditorToolConfig = ToolTextEditor20250124 | ToolTextEditor20250429 | ToolTextEditor20250728;
|
|
4
|
+
/** @deprecated Renamed to `TextEditorToolConfig`. Will be removed in a future release. */
|
|
5
|
+
export type TextEditorTool = TextEditorToolConfig;
|
|
6
|
+
export type AnthropicTextEditorTool = ProviderTool<'anthropic', 'text_editor'>;
|
|
7
|
+
export declare function convertTextEditorToolToAdapterFormat(tool: Tool): TextEditorToolConfig;
|
|
8
|
+
export declare function textEditorTool<T extends TextEditorToolConfig>(config: T): AnthropicTextEditorTool;
|
|
@@ -4,7 +4,15 @@ function convertTextEditorToolToAdapterFormat(tool) {
|
|
|
4
4
|
...metadata
|
|
5
5
|
};
|
|
6
6
|
}
|
|
7
|
+
function textEditorTool(config) {
|
|
8
|
+
return {
|
|
9
|
+
name: "str_replace_editor",
|
|
10
|
+
description: "",
|
|
11
|
+
metadata: config
|
|
12
|
+
};
|
|
13
|
+
}
|
|
7
14
|
export {
|
|
8
|
-
convertTextEditorToolToAdapterFormat
|
|
15
|
+
convertTextEditorToolToAdapterFormat,
|
|
16
|
+
textEditorTool
|
|
9
17
|
};
|
|
10
18
|
//# sourceMappingURL=text-editor-tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-editor-tool.js","sources":["../../../src/tools/text-editor-tool.ts"],"sourcesContent":["import type {\n ToolTextEditor20250124,\n ToolTextEditor20250429,\n ToolTextEditor20250728,\n} from '@anthropic-ai/sdk/resources/messages'\nimport type { Tool } from '@tanstack/ai'\n\nexport type
|
|
1
|
+
{"version":3,"file":"text-editor-tool.js","sources":["../../../src/tools/text-editor-tool.ts"],"sourcesContent":["import type {\n ToolTextEditor20250124,\n ToolTextEditor20250429,\n ToolTextEditor20250728,\n} from '@anthropic-ai/sdk/resources/messages'\nimport type { ProviderTool, Tool } from '@tanstack/ai'\n\nexport type TextEditorToolConfig =\n | ToolTextEditor20250124\n | ToolTextEditor20250429\n | ToolTextEditor20250728\n\n/** @deprecated Renamed to `TextEditorToolConfig`. Will be removed in a future release. */\nexport type TextEditorTool = TextEditorToolConfig\n\nexport type AnthropicTextEditorTool = ProviderTool<'anthropic', 'text_editor'>\n\nexport function convertTextEditorToolToAdapterFormat(\n tool: Tool,\n): TextEditorToolConfig {\n const metadata = tool.metadata as TextEditorToolConfig\n return {\n ...metadata,\n }\n}\n\nexport function textEditorTool<T extends TextEditorToolConfig>(\n config: T,\n): AnthropicTextEditorTool {\n // Phantom-brand cast: '~provider'/'~toolKind' are type-only and never assigned at runtime.\n return {\n name: 'str_replace_editor',\n description: '',\n metadata: config,\n } as unknown as AnthropicTextEditorTool\n}\n"],"names":[],"mappings":"AAiBO,SAAS,qCACd,MACsB;AACtB,QAAM,WAAW,KAAK;AACtB,SAAO;AAAA,IACL,GAAG;AAAA,EAAA;AAEP;AAEO,SAAS,eACd,QACyB;AAEzB,SAAO;AAAA,IACL,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EAAA;AAEd;"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { BetaWebFetchTool20250910 } from '@anthropic-ai/sdk/resources/beta';
|
|
2
|
-
import { Tool } from '@tanstack/ai';
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
export
|
|
2
|
+
import { ProviderTool, Tool } from '@tanstack/ai';
|
|
3
|
+
export type WebFetchToolConfig = BetaWebFetchTool20250910;
|
|
4
|
+
/** @deprecated Renamed to `WebFetchToolConfig`. Will be removed in a future release. */
|
|
5
|
+
export type WebFetchTool = WebFetchToolConfig;
|
|
6
|
+
export type AnthropicWebFetchTool = ProviderTool<'anthropic', 'web_fetch'>;
|
|
7
|
+
export declare function convertWebFetchToolToAdapterFormat(tool: Tool): WebFetchToolConfig;
|
|
8
|
+
export declare function webFetchTool(config?: Omit<WebFetchToolConfig, 'type' | 'name'>): AnthropicWebFetchTool;
|
|
@@ -6,7 +6,15 @@ function convertWebFetchToolToAdapterFormat(tool) {
|
|
|
6
6
|
...metadata
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
+
function webFetchTool(config) {
|
|
10
|
+
return {
|
|
11
|
+
name: "web_fetch",
|
|
12
|
+
description: "",
|
|
13
|
+
metadata: config
|
|
14
|
+
};
|
|
15
|
+
}
|
|
9
16
|
export {
|
|
10
|
-
convertWebFetchToolToAdapterFormat
|
|
17
|
+
convertWebFetchToolToAdapterFormat,
|
|
18
|
+
webFetchTool
|
|
11
19
|
};
|
|
12
20
|
//# sourceMappingURL=web-fetch-tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-fetch-tool.js","sources":["../../../src/tools/web-fetch-tool.ts"],"sourcesContent":["import type { BetaWebFetchTool20250910 } from '@anthropic-ai/sdk/resources/beta'\nimport type { Tool } from '@tanstack/ai'\n\nexport type
|
|
1
|
+
{"version":3,"file":"web-fetch-tool.js","sources":["../../../src/tools/web-fetch-tool.ts"],"sourcesContent":["import type { BetaWebFetchTool20250910 } from '@anthropic-ai/sdk/resources/beta'\nimport type { ProviderTool, Tool } from '@tanstack/ai'\n\nexport type WebFetchToolConfig = BetaWebFetchTool20250910\n\n/** @deprecated Renamed to `WebFetchToolConfig`. Will be removed in a future release. */\nexport type WebFetchTool = WebFetchToolConfig\n\nexport type AnthropicWebFetchTool = ProviderTool<'anthropic', 'web_fetch'>\n\nexport function convertWebFetchToolToAdapterFormat(\n tool: Tool,\n): WebFetchToolConfig {\n const metadata = tool.metadata as Omit<WebFetchToolConfig, 'type' | 'name'>\n return {\n name: 'web_fetch',\n type: 'web_fetch_20250910',\n ...metadata,\n }\n}\n\nexport function webFetchTool(\n config?: Omit<WebFetchToolConfig, 'type' | 'name'>,\n): AnthropicWebFetchTool {\n // Phantom-brand cast: '~provider'/'~toolKind' are type-only and never assigned at runtime.\n return {\n name: 'web_fetch',\n description: '',\n metadata: config,\n } as unknown as AnthropicWebFetchTool\n}\n"],"names":[],"mappings":"AAUO,SAAS,mCACd,MACoB;AACpB,QAAM,WAAW,KAAK;AACtB,SAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,GAAG;AAAA,EAAA;AAEP;AAEO,SAAS,aACd,QACuB;AAEvB,SAAO;AAAA,IACL,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EAAA;AAEd;"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { WebSearchTool20250305 } from '@anthropic-ai/sdk/resources/messages';
|
|
2
|
-
import { Tool } from '@tanstack/ai';
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
export
|
|
2
|
+
import { ProviderTool, Tool } from '@tanstack/ai';
|
|
3
|
+
export type WebSearchToolConfig = WebSearchTool20250305;
|
|
4
|
+
/** @deprecated Renamed to `WebSearchToolConfig`. Will be removed in a future release. */
|
|
5
|
+
export type WebSearchTool = WebSearchToolConfig;
|
|
6
|
+
export type AnthropicWebSearchTool = ProviderTool<'anthropic', 'web_search'>;
|
|
7
|
+
export declare function convertWebSearchToolToAdapterFormat(tool: Tool): WebSearchToolConfig;
|
|
8
|
+
export declare function webSearchTool(config: WebSearchToolConfig): AnthropicWebSearchTool;
|