experimental-ash 0.20.1 → 0.22.0
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 +13 -0
- package/dist/docs/public/channels/README.md +3 -1
- package/dist/docs/public/hooks.md +76 -6
- package/dist/docs/public/skills.md +6 -1
- package/dist/docs/public/tools.md +4 -0
- package/dist/src/chunks/{dev-authored-source-watcher-BR7XYOW0.js → dev-authored-source-watcher-DKDaaPea.js} +1 -1
- package/dist/src/chunks/{host-Dxf7CGaE.js → host-Btr4S69C.js} +7 -7
- package/dist/src/chunks/paths-DZTgjrW-.js +88 -0
- package/dist/src/chunks/{prewarm-vAT2QBqc.js → prewarm-BELT37PI.js} +1 -1
- package/dist/src/cli/commands/info.js +1 -1
- package/dist/src/cli/run.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +3 -3
- package/dist/src/compiled/@ai-sdk/anthropic/_provider-utils.d.ts +15 -0
- package/dist/src/compiled/@ai-sdk/anthropic/index.d.ts +1259 -6
- package/dist/src/compiled/@ai-sdk/google/_provider-utils.d.ts +11 -0
- package/dist/src/compiled/@ai-sdk/google/index.d.ts +561 -6
- package/dist/src/compiled/@ai-sdk/google/index.js +4 -4
- package/dist/src/compiled/@ai-sdk/google/package.json +1 -1
- package/dist/src/compiled/@ai-sdk/openai/_provider-utils.d.ts +15 -0
- package/dist/src/compiled/@ai-sdk/openai/index.d.ts +1255 -6
- package/dist/src/compiled/@ai-sdk/openai/index.js +1 -1
- package/dist/src/compiled/@ai-sdk/openai/package.json +1 -1
- package/dist/src/compiler/normalize-skill.js +5 -1
- package/dist/src/compiler/workspace-resources.js +12 -5
- package/dist/src/context/hook-lifecycle.d.ts +8 -8
- package/dist/src/context/hook-lifecycle.js +88 -36
- package/dist/src/evals/cli/eval.js +1 -1
- package/dist/src/execution/skills/instructions.d.ts +8 -4
- package/dist/src/execution/skills/instructions.js +3 -2
- package/dist/src/harness/attachment-staging.js +5 -1
- package/dist/src/harness/tool-loop.js +11 -3
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/core.js +16 -1
- package/dist/src/internal/nitro/routes/workflow-route-helpers.d.ts +4 -4
- package/dist/src/internal/nitro/routes/workflow-route-helpers.js +6 -5
- package/dist/src/internal/nitro/routes/workflow-run-events.d.ts +1 -1
- package/dist/src/internal/nitro/routes/workflow-run-events.js +1 -1
- package/dist/src/internal/nitro/routes/workflow-run-steps.d.ts +1 -1
- package/dist/src/internal/nitro/routes/workflow-run-steps.js +1 -1
- package/dist/src/internal/nitro/routes/workflow-run.d.ts +1 -1
- package/dist/src/internal/nitro/routes/workflow-run.js +1 -1
- package/dist/src/internal/nitro/routes/workflow-runs.d.ts +1 -1
- package/dist/src/internal/nitro/routes/workflow-runs.js +1 -1
- package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +2 -0
- package/dist/src/public/definitions/hook.d.ts +11 -3
- package/dist/src/public/definitions/skill.d.ts +4 -3
- package/dist/src/public/definitions/skill.js +1 -1
- package/dist/src/public/next/index.d.ts +74 -0
- package/dist/src/public/next/index.js +150 -0
- package/dist/src/public/next/server.d.ts +6 -0
- package/dist/src/public/next/server.js +348 -0
- package/dist/src/public/next/vercel-json.d.ts +8 -0
- package/dist/src/public/next/vercel-json.js +76 -0
- package/dist/src/public/skills/index.d.ts +1 -1
- package/dist/src/public/skills/index.js +1 -1
- package/dist/src/public/tool-result-narrowing.d.ts +68 -0
- package/dist/src/public/tool-result-narrowing.js +58 -0
- package/dist/src/public/tools/index.d.ts +1 -0
- package/dist/src/public/tools/index.js +1 -0
- package/dist/src/runtime/resolve-connection.js +2 -0
- package/dist/src/runtime/resolve-tool.js +2 -0
- package/dist/src/shared/skill-definition.d.ts +20 -2
- package/dist/src/shared/skill-package.d.ts +43 -0
- package/dist/src/shared/skill-package.js +100 -0
- package/package.json +13 -3
- package/dist/src/chunks/paths-BcM3el4Q.js +0 -88
|
@@ -1,9 +1,1262 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { JSONObject, ProviderV4, LanguageModelV4, FilesV4, SkillsV4 } from '#compiled/@ai-sdk/provider/index.js';
|
|
2
|
+
import { z } from '#compiled/zod/index.js';
|
|
3
|
+
import * as _ai_sdk_provider_utils from './_provider-utils.js';
|
|
4
|
+
import { ToolExecuteFunction, Tool, Experimental_Sandbox, ProviderDefinedTool, FetchFunction } from './_provider-utils.js';
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Represents a single iteration in the usage breakdown.
|
|
8
|
+
*
|
|
9
|
+
* The API returns an iterations array showing usage for each sampling
|
|
10
|
+
* iteration. Iterations can be:
|
|
11
|
+
* - `compaction`: a context compaction step (billed at executor rates).
|
|
12
|
+
* - `message`: an executor sampling iteration (billed at executor rates).
|
|
13
|
+
* - `advisor_message`: an advisor sub-inference (billed at the advisor
|
|
14
|
+
* model's rates; `model` carries the advisor model ID). Advisor token
|
|
15
|
+
* usage is NOT rolled into the top-level usage totals because it bills
|
|
16
|
+
* at a different rate; inspect this array directly for advisor billing.
|
|
17
|
+
*/
|
|
18
|
+
type AnthropicUsageIteration = {
|
|
19
|
+
type: 'compaction' | 'message';
|
|
20
|
+
/**
|
|
21
|
+
* Number of input tokens consumed in this iteration.
|
|
22
|
+
*/
|
|
23
|
+
inputTokens: number;
|
|
24
|
+
/**
|
|
25
|
+
* Number of output tokens generated in this iteration.
|
|
26
|
+
*/
|
|
27
|
+
outputTokens: number;
|
|
28
|
+
/**
|
|
29
|
+
* Number of cache-creation input tokens consumed in this iteration.
|
|
30
|
+
*/
|
|
31
|
+
cacheCreationInputTokens?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Number of cache-read input tokens consumed in this iteration.
|
|
34
|
+
*/
|
|
35
|
+
cacheReadInputTokens?: number;
|
|
36
|
+
} | {
|
|
37
|
+
type: 'advisor_message';
|
|
38
|
+
/**
|
|
39
|
+
* The advisor model that produced this iteration.
|
|
40
|
+
*/
|
|
41
|
+
model: string;
|
|
42
|
+
/**
|
|
43
|
+
* Number of input tokens consumed in this iteration.
|
|
44
|
+
*/
|
|
45
|
+
inputTokens: number;
|
|
46
|
+
/**
|
|
47
|
+
* Number of output tokens generated in this iteration.
|
|
48
|
+
*/
|
|
49
|
+
outputTokens: number;
|
|
50
|
+
/**
|
|
51
|
+
* Number of cache-creation input tokens consumed by this advisor
|
|
52
|
+
* sub-inference. Nonzero when advisor-side caching is enabled and
|
|
53
|
+
* the advisor writes a fresh cache entry.
|
|
54
|
+
*/
|
|
55
|
+
cacheCreationInputTokens?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Number of cache-read input tokens consumed by this advisor
|
|
58
|
+
* sub-inference. Nonzero on the second and later advisor calls
|
|
59
|
+
* when advisor-side caching is enabled.
|
|
60
|
+
*/
|
|
61
|
+
cacheReadInputTokens?: number;
|
|
62
|
+
};
|
|
63
|
+
interface AnthropicMessageMetadata {
|
|
64
|
+
usage: JSONObject;
|
|
65
|
+
stopSequence: string | null;
|
|
66
|
+
/**
|
|
67
|
+
* Usage breakdown by iteration when compaction is triggered.
|
|
68
|
+
*
|
|
69
|
+
* When compaction occurs, this array contains usage for each sampling iteration.
|
|
70
|
+
* The first iteration is typically the compaction step, followed by the main
|
|
71
|
+
* message iteration.
|
|
72
|
+
*/
|
|
73
|
+
iterations: AnthropicUsageIteration[] | null;
|
|
74
|
+
/**
|
|
75
|
+
* Information about the container used in this request.
|
|
76
|
+
*
|
|
77
|
+
* This will be non-null if a container tool (e.g., code execution) was used.
|
|
78
|
+
* Information about the container used in the request (for the code execution tool).
|
|
79
|
+
*/
|
|
80
|
+
container: {
|
|
81
|
+
/**
|
|
82
|
+
* The time at which the container will expire (RFC3339 timestamp).
|
|
83
|
+
*/
|
|
84
|
+
expiresAt: string;
|
|
85
|
+
/**
|
|
86
|
+
* Identifier for the container used in this request.
|
|
87
|
+
*/
|
|
88
|
+
id: string;
|
|
89
|
+
/**
|
|
90
|
+
* Skills loaded in the container.
|
|
91
|
+
*/
|
|
92
|
+
skills: Array<{
|
|
93
|
+
/**
|
|
94
|
+
* Type of skill: either 'anthropic' (built-in) or 'custom' (user-defined).
|
|
95
|
+
*/
|
|
96
|
+
type: 'anthropic' | 'custom';
|
|
97
|
+
/**
|
|
98
|
+
* Skill ID (1-64 characters).
|
|
99
|
+
*/
|
|
100
|
+
skillId: string;
|
|
101
|
+
/**
|
|
102
|
+
* Skill version or 'latest' for most recent version (1-64 characters).
|
|
103
|
+
*/
|
|
104
|
+
version: string;
|
|
105
|
+
}> | null;
|
|
106
|
+
} | null;
|
|
107
|
+
/**
|
|
108
|
+
* Context management response.
|
|
109
|
+
*
|
|
110
|
+
* Information about context management strategies applied during the request.
|
|
111
|
+
*/
|
|
112
|
+
contextManagement: {
|
|
113
|
+
/**
|
|
114
|
+
* List of context management edits that were applied.
|
|
115
|
+
* Each item in the array is a specific type of context management edit.
|
|
116
|
+
*/
|
|
117
|
+
appliedEdits: Array<
|
|
118
|
+
/**
|
|
119
|
+
* Represents an edit where a certain number of tool uses and input tokens were cleared.
|
|
120
|
+
*/
|
|
121
|
+
{
|
|
122
|
+
/**
|
|
123
|
+
* The type of context management edit applied.
|
|
124
|
+
* Possible value: 'clear_tool_uses_20250919'
|
|
125
|
+
*/
|
|
126
|
+
type: 'clear_tool_uses_20250919';
|
|
127
|
+
/**
|
|
128
|
+
* Number of tool uses that were cleared by this edit.
|
|
129
|
+
* Minimum: 0
|
|
130
|
+
*/
|
|
131
|
+
clearedToolUses: number;
|
|
132
|
+
/**
|
|
133
|
+
* Number of input tokens cleared by this edit.
|
|
134
|
+
* Minimum: 0
|
|
135
|
+
*/
|
|
136
|
+
clearedInputTokens: number;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Represents an edit where a certain number of thinking turns and input tokens were cleared.
|
|
140
|
+
*/
|
|
141
|
+
| {
|
|
142
|
+
/**
|
|
143
|
+
* The type of context management edit applied.
|
|
144
|
+
* Possible value: 'clear_thinking_20251015'
|
|
145
|
+
*/
|
|
146
|
+
type: 'clear_thinking_20251015';
|
|
147
|
+
/**
|
|
148
|
+
* Number of thinking turns that were cleared by this edit.
|
|
149
|
+
* Minimum: 0
|
|
150
|
+
*/
|
|
151
|
+
clearedThinkingTurns: number;
|
|
152
|
+
/**
|
|
153
|
+
* Number of input tokens cleared by this edit.
|
|
154
|
+
* Minimum: 0
|
|
155
|
+
*/
|
|
156
|
+
clearedInputTokens: number;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Represents a compaction edit where the conversation context was summarized.
|
|
160
|
+
*/
|
|
161
|
+
| {
|
|
162
|
+
/**
|
|
163
|
+
* The type of context management edit applied.
|
|
164
|
+
* Possible value: 'compact_20260112'
|
|
165
|
+
*/
|
|
166
|
+
type: 'compact_20260112';
|
|
167
|
+
}>;
|
|
168
|
+
} | null;
|
|
7
169
|
}
|
|
8
170
|
|
|
9
|
-
|
|
171
|
+
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 & {});
|
|
172
|
+
declare const anthropicLanguageModelOptions: z.ZodObject<{
|
|
173
|
+
sendReasoning: z.ZodOptional<z.ZodBoolean>;
|
|
174
|
+
structuredOutputMode: z.ZodOptional<z.ZodEnum<{
|
|
175
|
+
outputFormat: "outputFormat";
|
|
176
|
+
jsonTool: "jsonTool";
|
|
177
|
+
auto: "auto";
|
|
178
|
+
}>>;
|
|
179
|
+
thinking: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
180
|
+
type: z.ZodLiteral<"adaptive">;
|
|
181
|
+
display: z.ZodOptional<z.ZodEnum<{
|
|
182
|
+
omitted: "omitted";
|
|
183
|
+
summarized: "summarized";
|
|
184
|
+
}>>;
|
|
185
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
186
|
+
type: z.ZodLiteral<"enabled">;
|
|
187
|
+
budgetTokens: z.ZodOptional<z.ZodNumber>;
|
|
188
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
189
|
+
type: z.ZodLiteral<"disabled">;
|
|
190
|
+
}, z.core.$strip>]>>;
|
|
191
|
+
disableParallelToolUse: z.ZodOptional<z.ZodBoolean>;
|
|
192
|
+
cacheControl: z.ZodOptional<z.ZodObject<{
|
|
193
|
+
type: z.ZodLiteral<"ephemeral">;
|
|
194
|
+
ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"5m">, z.ZodLiteral<"1h">]>>;
|
|
195
|
+
}, z.core.$strip>>;
|
|
196
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
197
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
198
|
+
}, z.core.$strip>>;
|
|
199
|
+
mcpServers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
200
|
+
type: z.ZodLiteral<"url">;
|
|
201
|
+
name: z.ZodString;
|
|
202
|
+
url: z.ZodString;
|
|
203
|
+
authorizationToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
204
|
+
toolConfiguration: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
205
|
+
enabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
206
|
+
allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
207
|
+
}, z.core.$strip>>>;
|
|
208
|
+
}, z.core.$strip>>>;
|
|
209
|
+
container: z.ZodOptional<z.ZodObject<{
|
|
210
|
+
id: z.ZodOptional<z.ZodString>;
|
|
211
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
212
|
+
type: z.ZodLiteral<"anthropic">;
|
|
213
|
+
skillId: z.ZodString;
|
|
214
|
+
version: z.ZodOptional<z.ZodString>;
|
|
215
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
216
|
+
type: z.ZodLiteral<"custom">;
|
|
217
|
+
providerReference: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
218
|
+
version: z.ZodOptional<z.ZodString>;
|
|
219
|
+
}, z.core.$strip>]>>>;
|
|
220
|
+
}, z.core.$strip>>;
|
|
221
|
+
toolStreaming: z.ZodOptional<z.ZodBoolean>;
|
|
222
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
223
|
+
low: "low";
|
|
224
|
+
medium: "medium";
|
|
225
|
+
high: "high";
|
|
226
|
+
xhigh: "xhigh";
|
|
227
|
+
max: "max";
|
|
228
|
+
}>>;
|
|
229
|
+
taskBudget: z.ZodOptional<z.ZodObject<{
|
|
230
|
+
type: z.ZodLiteral<"tokens">;
|
|
231
|
+
total: z.ZodNumber;
|
|
232
|
+
remaining: z.ZodOptional<z.ZodNumber>;
|
|
233
|
+
}, z.core.$strip>>;
|
|
234
|
+
speed: z.ZodOptional<z.ZodEnum<{
|
|
235
|
+
fast: "fast";
|
|
236
|
+
standard: "standard";
|
|
237
|
+
}>>;
|
|
238
|
+
inferenceGeo: z.ZodOptional<z.ZodEnum<{
|
|
239
|
+
us: "us";
|
|
240
|
+
global: "global";
|
|
241
|
+
}>>;
|
|
242
|
+
anthropicBeta: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
243
|
+
contextManagement: z.ZodOptional<z.ZodObject<{
|
|
244
|
+
edits: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
245
|
+
type: z.ZodLiteral<"clear_tool_uses_20250919">;
|
|
246
|
+
trigger: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
247
|
+
type: z.ZodLiteral<"input_tokens">;
|
|
248
|
+
value: z.ZodNumber;
|
|
249
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
250
|
+
type: z.ZodLiteral<"tool_uses">;
|
|
251
|
+
value: z.ZodNumber;
|
|
252
|
+
}, z.core.$strip>]>>;
|
|
253
|
+
keep: z.ZodOptional<z.ZodObject<{
|
|
254
|
+
type: z.ZodLiteral<"tool_uses">;
|
|
255
|
+
value: z.ZodNumber;
|
|
256
|
+
}, z.core.$strip>>;
|
|
257
|
+
clearAtLeast: z.ZodOptional<z.ZodObject<{
|
|
258
|
+
type: z.ZodLiteral<"input_tokens">;
|
|
259
|
+
value: z.ZodNumber;
|
|
260
|
+
}, z.core.$strip>>;
|
|
261
|
+
clearToolInputs: z.ZodOptional<z.ZodBoolean>;
|
|
262
|
+
excludeTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
263
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
264
|
+
type: z.ZodLiteral<"clear_thinking_20251015">;
|
|
265
|
+
keep: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodObject<{
|
|
266
|
+
type: z.ZodLiteral<"thinking_turns">;
|
|
267
|
+
value: z.ZodNumber;
|
|
268
|
+
}, z.core.$strip>]>>;
|
|
269
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
270
|
+
type: z.ZodLiteral<"compact_20260112">;
|
|
271
|
+
trigger: z.ZodOptional<z.ZodObject<{
|
|
272
|
+
type: z.ZodLiteral<"input_tokens">;
|
|
273
|
+
value: z.ZodNumber;
|
|
274
|
+
}, z.core.$strip>>;
|
|
275
|
+
pauseAfterCompaction: z.ZodOptional<z.ZodBoolean>;
|
|
276
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
277
|
+
}, z.core.$strip>]>>;
|
|
278
|
+
}, z.core.$strip>>;
|
|
279
|
+
}, z.core.$strip>;
|
|
280
|
+
type AnthropicLanguageModelOptions = z.infer<typeof anthropicLanguageModelOptions>;
|
|
281
|
+
|
|
282
|
+
interface AnthropicToolOptions {
|
|
283
|
+
deferLoading?: boolean;
|
|
284
|
+
allowedCallers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
|
|
285
|
+
eagerInputStreaming?: boolean;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
type Bash20241022Input = {
|
|
289
|
+
/**
|
|
290
|
+
* The bash command to run. Required unless the tool is being restarted.
|
|
291
|
+
*/
|
|
292
|
+
command: string;
|
|
293
|
+
/**
|
|
294
|
+
* Specifying true will restart this tool. Otherwise, leave this unspecified.
|
|
295
|
+
*/
|
|
296
|
+
restart?: boolean;
|
|
297
|
+
};
|
|
298
|
+
type Bash20241022Options<OUTPUT> = {
|
|
299
|
+
execute?: ToolExecuteFunction<Bash20241022Input, OUTPUT, {}>;
|
|
300
|
+
needsApproval?: Tool<Bash20241022Input, OUTPUT, {}>['needsApproval'];
|
|
301
|
+
toModelOutput?: Tool<Bash20241022Input, OUTPUT, {}>['toModelOutput'];
|
|
302
|
+
onInputStart?: Tool<Bash20241022Input, OUTPUT, {}>['onInputStart'];
|
|
303
|
+
onInputDelta?: Tool<Bash20241022Input, OUTPUT, {}>['onInputDelta'];
|
|
304
|
+
onInputAvailable?: Tool<Bash20241022Input, OUTPUT, {}>['onInputAvailable'];
|
|
305
|
+
};
|
|
306
|
+
type Bash20241022DefaultOutput = Awaited<ReturnType<Experimental_Sandbox['runCommand']>>;
|
|
307
|
+
declare function bash_20241022(options?: Omit<Bash20241022Options<Bash20241022DefaultOutput>, 'execute'> & {
|
|
308
|
+
execute?: undefined;
|
|
309
|
+
}): ProviderDefinedTool<Bash20241022Input, Bash20241022DefaultOutput, {}>;
|
|
310
|
+
declare function bash_20241022<OUTPUT = never>(options: Omit<Bash20241022Options<OUTPUT>, 'execute'> & {
|
|
311
|
+
execute: null;
|
|
312
|
+
}): ProviderDefinedTool<Bash20241022Input, OUTPUT, {}>;
|
|
313
|
+
declare function bash_20241022<OUTPUT>(options: Omit<Bash20241022Options<OUTPUT>, 'execute'> & {
|
|
314
|
+
execute: Bash20241022Options<OUTPUT>['execute'];
|
|
315
|
+
}): ProviderDefinedTool<Bash20241022Input, OUTPUT, {}>;
|
|
316
|
+
|
|
317
|
+
type Bash20250124Input = {
|
|
318
|
+
/**
|
|
319
|
+
* The bash command to run. Required unless the tool is being restarted.
|
|
320
|
+
*/
|
|
321
|
+
command: string;
|
|
322
|
+
/**
|
|
323
|
+
* Specifying true will restart this tool. Otherwise, leave this unspecified.
|
|
324
|
+
*/
|
|
325
|
+
restart?: boolean;
|
|
326
|
+
};
|
|
327
|
+
type Bash20250124Options<OUTPUT> = {
|
|
328
|
+
execute?: ToolExecuteFunction<Bash20250124Input, OUTPUT, {}>;
|
|
329
|
+
needsApproval?: Tool<Bash20250124Input, OUTPUT, {}>['needsApproval'];
|
|
330
|
+
toModelOutput?: Tool<Bash20250124Input, OUTPUT, {}>['toModelOutput'];
|
|
331
|
+
onInputStart?: Tool<Bash20250124Input, OUTPUT, {}>['onInputStart'];
|
|
332
|
+
onInputDelta?: Tool<Bash20250124Input, OUTPUT, {}>['onInputDelta'];
|
|
333
|
+
onInputAvailable?: Tool<Bash20250124Input, OUTPUT, {}>['onInputAvailable'];
|
|
334
|
+
};
|
|
335
|
+
type Bash20250124DefaultOutput = Awaited<ReturnType<Experimental_Sandbox['runCommand']>>;
|
|
336
|
+
declare function bash_20250124(options?: Omit<Bash20250124Options<Bash20250124DefaultOutput>, 'execute'> & {
|
|
337
|
+
execute?: undefined;
|
|
338
|
+
}): ProviderDefinedTool<Bash20250124Input, Bash20250124DefaultOutput, {}>;
|
|
339
|
+
declare function bash_20250124<OUTPUT = never>(options: Omit<Bash20250124Options<OUTPUT>, 'execute'> & {
|
|
340
|
+
execute: null;
|
|
341
|
+
}): ProviderDefinedTool<Bash20250124Input, OUTPUT, {}>;
|
|
342
|
+
declare function bash_20250124<OUTPUT>(options: Omit<Bash20250124Options<OUTPUT>, 'execute'> & {
|
|
343
|
+
execute: Bash20250124Options<OUTPUT>['execute'];
|
|
344
|
+
}): ProviderDefinedTool<Bash20250124Input, OUTPUT, {}>;
|
|
345
|
+
|
|
346
|
+
declare const anthropicTools: {
|
|
347
|
+
/**
|
|
348
|
+
* Pairs a faster executor model with a higher-intelligence advisor model
|
|
349
|
+
* that provides strategic guidance mid-generation.
|
|
350
|
+
*
|
|
351
|
+
* The advisor lets a faster, lower-cost executor model consult a
|
|
352
|
+
* higher-intelligence advisor model server-side. The advisor reads the
|
|
353
|
+
* executor's full transcript and produces a plan or course correction;
|
|
354
|
+
* the executor continues with the task, informed by the advice. All of
|
|
355
|
+
* this happens inside a single `/v1/messages` request.
|
|
356
|
+
*
|
|
357
|
+
* Beta header `advisor-tool-2026-03-01` is added automatically when this
|
|
358
|
+
* tool is included.
|
|
359
|
+
*
|
|
360
|
+
* Multi-turn conversations: pass the full assistant content (including
|
|
361
|
+
* `advisor_tool_result` blocks) back to the API on subsequent turns. If
|
|
362
|
+
* you omit the advisor tool from `tools` on a follow-up turn while the
|
|
363
|
+
* message history still contains `advisor_tool_result` blocks, the API
|
|
364
|
+
* returns a `400 invalid_request_error`.
|
|
365
|
+
*
|
|
366
|
+
* Supported executor models: Claude Haiku 4.5, Sonnet 4.6, Opus 4.6,
|
|
367
|
+
* Opus 4.7. The advisor must be at least as capable as the executor.
|
|
368
|
+
*
|
|
369
|
+
* @param model - The advisor model ID (required), e.g. `"claude-opus-4-7"`.
|
|
370
|
+
* @param maxUses - Maximum advisor calls per request (per-request cap).
|
|
371
|
+
* @param caching - Enables prompt caching for the advisor's transcript
|
|
372
|
+
* across calls within a conversation. Worthwhile from ~3 advisor calls
|
|
373
|
+
* per conversation.
|
|
374
|
+
*/
|
|
375
|
+
advisor_20260301: (args: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {
|
|
376
|
+
type: "advisor_result";
|
|
377
|
+
text: string;
|
|
378
|
+
} | {
|
|
379
|
+
type: "advisor_redacted_result";
|
|
380
|
+
encryptedContent: string;
|
|
381
|
+
} | {
|
|
382
|
+
type: "advisor_tool_result_error";
|
|
383
|
+
errorCode: string;
|
|
384
|
+
}, {
|
|
385
|
+
model: string;
|
|
386
|
+
maxUses?: number;
|
|
387
|
+
caching?: {
|
|
388
|
+
type: "ephemeral";
|
|
389
|
+
ttl: "5m" | "1h";
|
|
390
|
+
};
|
|
391
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{}, {
|
|
392
|
+
type: "advisor_result";
|
|
393
|
+
text: string;
|
|
394
|
+
} | {
|
|
395
|
+
type: "advisor_redacted_result";
|
|
396
|
+
encryptedContent: string;
|
|
397
|
+
} | {
|
|
398
|
+
type: "advisor_tool_result_error";
|
|
399
|
+
errorCode: string;
|
|
400
|
+
}, {}>;
|
|
401
|
+
/**
|
|
402
|
+
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
403
|
+
* allowing system operations, script execution, and command-line automation.
|
|
404
|
+
*
|
|
405
|
+
* Image results are supported.
|
|
406
|
+
*/
|
|
407
|
+
bash_20241022: typeof bash_20241022;
|
|
408
|
+
/**
|
|
409
|
+
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
410
|
+
* allowing system operations, script execution, and command-line automation.
|
|
411
|
+
*
|
|
412
|
+
* Image results are supported.
|
|
413
|
+
*/
|
|
414
|
+
bash_20250124: typeof bash_20250124;
|
|
415
|
+
/**
|
|
416
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
417
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
418
|
+
* the API conversation.
|
|
419
|
+
*
|
|
420
|
+
* The code execution tool allows Claude to run Bash commands and manipulate files,
|
|
421
|
+
* including writing code, in a secure, sandboxed environment.
|
|
422
|
+
*/
|
|
423
|
+
codeExecution_20250522: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
424
|
+
code: string;
|
|
425
|
+
}, {
|
|
426
|
+
type: "code_execution_result";
|
|
427
|
+
stdout: string;
|
|
428
|
+
stderr: string;
|
|
429
|
+
return_code: number;
|
|
430
|
+
content: Array<{
|
|
431
|
+
type: "code_execution_output";
|
|
432
|
+
file_id: string;
|
|
433
|
+
}>;
|
|
434
|
+
}, {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
435
|
+
code: string;
|
|
436
|
+
}, {
|
|
437
|
+
type: "code_execution_result";
|
|
438
|
+
stdout: string;
|
|
439
|
+
stderr: string;
|
|
440
|
+
return_code: number;
|
|
441
|
+
content: Array<{
|
|
442
|
+
type: "code_execution_output";
|
|
443
|
+
file_id: string;
|
|
444
|
+
}>;
|
|
445
|
+
}, {}>;
|
|
446
|
+
/**
|
|
447
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
448
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
449
|
+
* the API conversation.
|
|
450
|
+
*
|
|
451
|
+
* The code execution tool allows Claude to run both Python and Bash commands and manipulate files,
|
|
452
|
+
* including writing code, in a secure, sandboxed environment.
|
|
453
|
+
*
|
|
454
|
+
* This is the latest version with enhanced Bash support and file operations.
|
|
455
|
+
*/
|
|
456
|
+
codeExecution_20250825: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
457
|
+
type: "programmatic-tool-call";
|
|
458
|
+
code: string;
|
|
459
|
+
} | {
|
|
460
|
+
type: "bash_code_execution";
|
|
461
|
+
command: string;
|
|
462
|
+
} | {
|
|
463
|
+
type: "text_editor_code_execution";
|
|
464
|
+
command: "view";
|
|
465
|
+
path: string;
|
|
466
|
+
} | {
|
|
467
|
+
type: "text_editor_code_execution";
|
|
468
|
+
command: "create";
|
|
469
|
+
path: string;
|
|
470
|
+
file_text?: string | null;
|
|
471
|
+
} | {
|
|
472
|
+
type: "text_editor_code_execution";
|
|
473
|
+
command: "str_replace";
|
|
474
|
+
path: string;
|
|
475
|
+
old_str: string;
|
|
476
|
+
new_str: string;
|
|
477
|
+
}, {
|
|
478
|
+
type: "code_execution_result";
|
|
479
|
+
stdout: string;
|
|
480
|
+
stderr: string;
|
|
481
|
+
return_code: number;
|
|
482
|
+
content: Array<{
|
|
483
|
+
type: "code_execution_output";
|
|
484
|
+
file_id: string;
|
|
485
|
+
}>;
|
|
486
|
+
} | {
|
|
487
|
+
type: "bash_code_execution_result";
|
|
488
|
+
content: Array<{
|
|
489
|
+
type: "bash_code_execution_output";
|
|
490
|
+
file_id: string;
|
|
491
|
+
}>;
|
|
492
|
+
stdout: string;
|
|
493
|
+
stderr: string;
|
|
494
|
+
return_code: number;
|
|
495
|
+
} | {
|
|
496
|
+
type: "bash_code_execution_tool_result_error";
|
|
497
|
+
error_code: string;
|
|
498
|
+
} | {
|
|
499
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
500
|
+
error_code: string;
|
|
501
|
+
} | {
|
|
502
|
+
type: "text_editor_code_execution_view_result";
|
|
503
|
+
content: string;
|
|
504
|
+
file_type: string;
|
|
505
|
+
num_lines: number | null;
|
|
506
|
+
start_line: number | null;
|
|
507
|
+
total_lines: number | null;
|
|
508
|
+
} | {
|
|
509
|
+
type: "text_editor_code_execution_create_result";
|
|
510
|
+
is_file_update: boolean;
|
|
511
|
+
} | {
|
|
512
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
513
|
+
lines: string[] | null;
|
|
514
|
+
new_lines: number | null;
|
|
515
|
+
new_start: number | null;
|
|
516
|
+
old_lines: number | null;
|
|
517
|
+
old_start: number | null;
|
|
518
|
+
}, {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
519
|
+
type: "programmatic-tool-call";
|
|
520
|
+
code: string;
|
|
521
|
+
} | {
|
|
522
|
+
type: "bash_code_execution";
|
|
523
|
+
command: string;
|
|
524
|
+
} | {
|
|
525
|
+
type: "text_editor_code_execution";
|
|
526
|
+
command: "view";
|
|
527
|
+
path: string;
|
|
528
|
+
} | {
|
|
529
|
+
type: "text_editor_code_execution";
|
|
530
|
+
command: "create";
|
|
531
|
+
path: string;
|
|
532
|
+
file_text?: string | null;
|
|
533
|
+
} | {
|
|
534
|
+
type: "text_editor_code_execution";
|
|
535
|
+
command: "str_replace";
|
|
536
|
+
path: string;
|
|
537
|
+
old_str: string;
|
|
538
|
+
new_str: string;
|
|
539
|
+
}, {
|
|
540
|
+
type: "code_execution_result";
|
|
541
|
+
stdout: string;
|
|
542
|
+
stderr: string;
|
|
543
|
+
return_code: number;
|
|
544
|
+
content: Array<{
|
|
545
|
+
type: "code_execution_output";
|
|
546
|
+
file_id: string;
|
|
547
|
+
}>;
|
|
548
|
+
} | {
|
|
549
|
+
type: "bash_code_execution_result";
|
|
550
|
+
content: Array<{
|
|
551
|
+
type: "bash_code_execution_output";
|
|
552
|
+
file_id: string;
|
|
553
|
+
}>;
|
|
554
|
+
stdout: string;
|
|
555
|
+
stderr: string;
|
|
556
|
+
return_code: number;
|
|
557
|
+
} | {
|
|
558
|
+
type: "bash_code_execution_tool_result_error";
|
|
559
|
+
error_code: string;
|
|
560
|
+
} | {
|
|
561
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
562
|
+
error_code: string;
|
|
563
|
+
} | {
|
|
564
|
+
type: "text_editor_code_execution_view_result";
|
|
565
|
+
content: string;
|
|
566
|
+
file_type: string;
|
|
567
|
+
num_lines: number | null;
|
|
568
|
+
start_line: number | null;
|
|
569
|
+
total_lines: number | null;
|
|
570
|
+
} | {
|
|
571
|
+
type: "text_editor_code_execution_create_result";
|
|
572
|
+
is_file_update: boolean;
|
|
573
|
+
} | {
|
|
574
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
575
|
+
lines: string[] | null;
|
|
576
|
+
new_lines: number | null;
|
|
577
|
+
new_start: number | null;
|
|
578
|
+
old_lines: number | null;
|
|
579
|
+
old_start: number | null;
|
|
580
|
+
}, {}>;
|
|
581
|
+
/**
|
|
582
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
583
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
584
|
+
* the API conversation.
|
|
585
|
+
*
|
|
586
|
+
* The code execution tool allows Claude to run both Python and Bash commands and manipulate files,
|
|
587
|
+
* including writing code, in a secure, sandboxed environment.
|
|
588
|
+
*
|
|
589
|
+
* This is the recommended version. Does not require a beta header.
|
|
590
|
+
*
|
|
591
|
+
* Supported models: Claude Opus 4.6, Sonnet 4.6, Sonnet 4.5, Opus 4.5
|
|
592
|
+
*/
|
|
593
|
+
codeExecution_20260120: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
594
|
+
type: "programmatic-tool-call";
|
|
595
|
+
code: string;
|
|
596
|
+
} | {
|
|
597
|
+
type: "bash_code_execution";
|
|
598
|
+
command: string;
|
|
599
|
+
} | {
|
|
600
|
+
type: "text_editor_code_execution";
|
|
601
|
+
command: "view";
|
|
602
|
+
path: string;
|
|
603
|
+
} | {
|
|
604
|
+
type: "text_editor_code_execution";
|
|
605
|
+
command: "create";
|
|
606
|
+
path: string;
|
|
607
|
+
file_text?: string | null;
|
|
608
|
+
} | {
|
|
609
|
+
type: "text_editor_code_execution";
|
|
610
|
+
command: "str_replace";
|
|
611
|
+
path: string;
|
|
612
|
+
old_str: string;
|
|
613
|
+
new_str: string;
|
|
614
|
+
}, {
|
|
615
|
+
type: "code_execution_result";
|
|
616
|
+
stdout: string;
|
|
617
|
+
stderr: string;
|
|
618
|
+
return_code: number;
|
|
619
|
+
content: Array<{
|
|
620
|
+
type: "code_execution_output";
|
|
621
|
+
file_id: string;
|
|
622
|
+
}>;
|
|
623
|
+
} | {
|
|
624
|
+
type: "encrypted_code_execution_result";
|
|
625
|
+
encrypted_stdout: string;
|
|
626
|
+
stderr: string;
|
|
627
|
+
return_code: number;
|
|
628
|
+
content: Array<{
|
|
629
|
+
type: "code_execution_output";
|
|
630
|
+
file_id: string;
|
|
631
|
+
}>;
|
|
632
|
+
} | {
|
|
633
|
+
type: "bash_code_execution_result";
|
|
634
|
+
content: Array<{
|
|
635
|
+
type: "bash_code_execution_output";
|
|
636
|
+
file_id: string;
|
|
637
|
+
}>;
|
|
638
|
+
stdout: string;
|
|
639
|
+
stderr: string;
|
|
640
|
+
return_code: number;
|
|
641
|
+
} | {
|
|
642
|
+
type: "bash_code_execution_tool_result_error";
|
|
643
|
+
error_code: string;
|
|
644
|
+
} | {
|
|
645
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
646
|
+
error_code: string;
|
|
647
|
+
} | {
|
|
648
|
+
type: "text_editor_code_execution_view_result";
|
|
649
|
+
content: string;
|
|
650
|
+
file_type: string;
|
|
651
|
+
num_lines: number | null;
|
|
652
|
+
start_line: number | null;
|
|
653
|
+
total_lines: number | null;
|
|
654
|
+
} | {
|
|
655
|
+
type: "text_editor_code_execution_create_result";
|
|
656
|
+
is_file_update: boolean;
|
|
657
|
+
} | {
|
|
658
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
659
|
+
lines: string[] | null;
|
|
660
|
+
new_lines: number | null;
|
|
661
|
+
new_start: number | null;
|
|
662
|
+
old_lines: number | null;
|
|
663
|
+
old_start: number | null;
|
|
664
|
+
}, {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
665
|
+
type: "programmatic-tool-call";
|
|
666
|
+
code: string;
|
|
667
|
+
} | {
|
|
668
|
+
type: "bash_code_execution";
|
|
669
|
+
command: string;
|
|
670
|
+
} | {
|
|
671
|
+
type: "text_editor_code_execution";
|
|
672
|
+
command: "view";
|
|
673
|
+
path: string;
|
|
674
|
+
} | {
|
|
675
|
+
type: "text_editor_code_execution";
|
|
676
|
+
command: "create";
|
|
677
|
+
path: string;
|
|
678
|
+
file_text?: string | null;
|
|
679
|
+
} | {
|
|
680
|
+
type: "text_editor_code_execution";
|
|
681
|
+
command: "str_replace";
|
|
682
|
+
path: string;
|
|
683
|
+
old_str: string;
|
|
684
|
+
new_str: string;
|
|
685
|
+
}, {
|
|
686
|
+
type: "code_execution_result";
|
|
687
|
+
stdout: string;
|
|
688
|
+
stderr: string;
|
|
689
|
+
return_code: number;
|
|
690
|
+
content: Array<{
|
|
691
|
+
type: "code_execution_output";
|
|
692
|
+
file_id: string;
|
|
693
|
+
}>;
|
|
694
|
+
} | {
|
|
695
|
+
type: "encrypted_code_execution_result";
|
|
696
|
+
encrypted_stdout: string;
|
|
697
|
+
stderr: string;
|
|
698
|
+
return_code: number;
|
|
699
|
+
content: Array<{
|
|
700
|
+
type: "code_execution_output";
|
|
701
|
+
file_id: string;
|
|
702
|
+
}>;
|
|
703
|
+
} | {
|
|
704
|
+
type: "bash_code_execution_result";
|
|
705
|
+
content: Array<{
|
|
706
|
+
type: "bash_code_execution_output";
|
|
707
|
+
file_id: string;
|
|
708
|
+
}>;
|
|
709
|
+
stdout: string;
|
|
710
|
+
stderr: string;
|
|
711
|
+
return_code: number;
|
|
712
|
+
} | {
|
|
713
|
+
type: "bash_code_execution_tool_result_error";
|
|
714
|
+
error_code: string;
|
|
715
|
+
} | {
|
|
716
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
717
|
+
error_code: string;
|
|
718
|
+
} | {
|
|
719
|
+
type: "text_editor_code_execution_view_result";
|
|
720
|
+
content: string;
|
|
721
|
+
file_type: string;
|
|
722
|
+
num_lines: number | null;
|
|
723
|
+
start_line: number | null;
|
|
724
|
+
total_lines: number | null;
|
|
725
|
+
} | {
|
|
726
|
+
type: "text_editor_code_execution_create_result";
|
|
727
|
+
is_file_update: boolean;
|
|
728
|
+
} | {
|
|
729
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
730
|
+
lines: string[] | null;
|
|
731
|
+
new_lines: number | null;
|
|
732
|
+
new_start: number | null;
|
|
733
|
+
old_lines: number | null;
|
|
734
|
+
old_start: number | null;
|
|
735
|
+
}, {}>;
|
|
736
|
+
/**
|
|
737
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
738
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
739
|
+
*
|
|
740
|
+
* Image results are supported.
|
|
741
|
+
*
|
|
742
|
+
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
743
|
+
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
744
|
+
* @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.
|
|
745
|
+
*/
|
|
746
|
+
computer_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
747
|
+
action: "key" | "type" | "mouse_move" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "screenshot" | "cursor_position";
|
|
748
|
+
coordinate?: number[];
|
|
749
|
+
text?: string;
|
|
750
|
+
}, {
|
|
751
|
+
displayWidthPx: number;
|
|
752
|
+
displayHeightPx: number;
|
|
753
|
+
displayNumber?: number;
|
|
754
|
+
}, {}>;
|
|
755
|
+
/**
|
|
756
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
757
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
758
|
+
*
|
|
759
|
+
* Image results are supported.
|
|
760
|
+
*
|
|
761
|
+
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
762
|
+
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
763
|
+
* @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.
|
|
764
|
+
*/
|
|
765
|
+
computer_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
766
|
+
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";
|
|
767
|
+
coordinate?: [number, number];
|
|
768
|
+
duration?: number;
|
|
769
|
+
scroll_amount?: number;
|
|
770
|
+
scroll_direction?: "up" | "down" | "left" | "right";
|
|
771
|
+
start_coordinate?: [number, number];
|
|
772
|
+
text?: string;
|
|
773
|
+
}, {
|
|
774
|
+
displayWidthPx: number;
|
|
775
|
+
displayHeightPx: number;
|
|
776
|
+
displayNumber?: number;
|
|
777
|
+
}, {}>;
|
|
778
|
+
/**
|
|
779
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
780
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
781
|
+
*
|
|
782
|
+
* This version adds the zoom action for detailed screen region inspection.
|
|
783
|
+
*
|
|
784
|
+
* Image results are supported.
|
|
785
|
+
*
|
|
786
|
+
* Supported models: Claude Opus 4.5
|
|
787
|
+
*
|
|
788
|
+
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
789
|
+
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
790
|
+
* @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.
|
|
791
|
+
* @param enableZoom - Enable zoom action. Set to true to allow Claude to zoom into specific screen regions. Default: false.
|
|
792
|
+
*/
|
|
793
|
+
computer_20251124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
794
|
+
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";
|
|
795
|
+
coordinate?: [number, number];
|
|
796
|
+
duration?: number;
|
|
797
|
+
region?: [number, number, number, number];
|
|
798
|
+
scroll_amount?: number;
|
|
799
|
+
scroll_direction?: "up" | "down" | "left" | "right";
|
|
800
|
+
start_coordinate?: [number, number];
|
|
801
|
+
text?: string;
|
|
802
|
+
}, {
|
|
803
|
+
displayWidthPx: number;
|
|
804
|
+
displayHeightPx: number;
|
|
805
|
+
displayNumber?: number;
|
|
806
|
+
enableZoom?: boolean;
|
|
807
|
+
}, {}>;
|
|
808
|
+
/**
|
|
809
|
+
* The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
|
|
810
|
+
* Claude can create, read, update, and delete files that persist between sessions,
|
|
811
|
+
* allowing it to build knowledge over time without keeping everything in the context window.
|
|
812
|
+
* The memory tool operates client-side—you control where and how the data is stored through your own infrastructure.
|
|
813
|
+
*
|
|
814
|
+
* Supported models: Claude Sonnet 4.5, Claude Sonnet 4, Claude Opus 4.1, Claude Opus 4.
|
|
815
|
+
*/
|
|
816
|
+
memory_20250818: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
817
|
+
command: "view";
|
|
818
|
+
path: string;
|
|
819
|
+
view_range?: [number, number];
|
|
820
|
+
} | {
|
|
821
|
+
command: "create";
|
|
822
|
+
path: string;
|
|
823
|
+
file_text: string;
|
|
824
|
+
} | {
|
|
825
|
+
command: "str_replace";
|
|
826
|
+
path: string;
|
|
827
|
+
old_str: string;
|
|
828
|
+
new_str: string;
|
|
829
|
+
} | {
|
|
830
|
+
command: "insert";
|
|
831
|
+
path: string;
|
|
832
|
+
insert_line: number;
|
|
833
|
+
insert_text: string;
|
|
834
|
+
} | {
|
|
835
|
+
command: "delete";
|
|
836
|
+
path: string;
|
|
837
|
+
} | {
|
|
838
|
+
command: "rename";
|
|
839
|
+
old_path: string;
|
|
840
|
+
new_path: string;
|
|
841
|
+
}, {}, {}>;
|
|
842
|
+
/**
|
|
843
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
844
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
845
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
846
|
+
*
|
|
847
|
+
* Supported models: Claude Sonnet 3.5
|
|
848
|
+
*/
|
|
849
|
+
textEditor_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
850
|
+
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
851
|
+
path: string;
|
|
852
|
+
file_text?: string;
|
|
853
|
+
insert_line?: number;
|
|
854
|
+
new_str?: string;
|
|
855
|
+
insert_text?: string;
|
|
856
|
+
old_str?: string;
|
|
857
|
+
view_range?: number[];
|
|
858
|
+
}, {}, {}>;
|
|
859
|
+
/**
|
|
860
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
861
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
862
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
863
|
+
*
|
|
864
|
+
* Supported models: Claude Sonnet 3.7
|
|
865
|
+
*/
|
|
866
|
+
textEditor_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
867
|
+
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
868
|
+
path: string;
|
|
869
|
+
file_text?: string;
|
|
870
|
+
insert_line?: number;
|
|
871
|
+
new_str?: string;
|
|
872
|
+
insert_text?: string;
|
|
873
|
+
old_str?: string;
|
|
874
|
+
view_range?: number[];
|
|
875
|
+
}, {}, {}>;
|
|
876
|
+
/**
|
|
877
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
878
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
879
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
880
|
+
*
|
|
881
|
+
* Note: This version does not support the "undo_edit" command.
|
|
882
|
+
*
|
|
883
|
+
* @deprecated Use textEditor_20250728 instead
|
|
884
|
+
*/
|
|
885
|
+
textEditor_20250429: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
886
|
+
command: "view" | "create" | "str_replace" | "insert";
|
|
887
|
+
path: string;
|
|
888
|
+
file_text?: string;
|
|
889
|
+
insert_line?: number;
|
|
890
|
+
new_str?: string;
|
|
891
|
+
insert_text?: string;
|
|
892
|
+
old_str?: string;
|
|
893
|
+
view_range?: number[];
|
|
894
|
+
}, {}, {}>;
|
|
895
|
+
/**
|
|
896
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
897
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
898
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
899
|
+
*
|
|
900
|
+
* Note: This version does not support the "undo_edit" command and adds optional max_characters parameter.
|
|
901
|
+
*
|
|
902
|
+
* Supported models: Claude Sonnet 4, Opus 4, and Opus 4.1
|
|
903
|
+
*
|
|
904
|
+
* @param maxCharacters - Optional maximum number of characters to view in the file
|
|
905
|
+
*/
|
|
906
|
+
textEditor_20250728: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
907
|
+
command: "view" | "create" | "str_replace" | "insert";
|
|
908
|
+
path: string;
|
|
909
|
+
file_text?: string;
|
|
910
|
+
insert_line?: number;
|
|
911
|
+
new_str?: string;
|
|
912
|
+
insert_text?: string;
|
|
913
|
+
old_str?: string;
|
|
914
|
+
view_range?: number[];
|
|
915
|
+
}, {
|
|
916
|
+
maxCharacters?: number;
|
|
917
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.ProviderDefinedTool<{
|
|
918
|
+
command: "view" | "create" | "str_replace" | "insert";
|
|
919
|
+
path: string;
|
|
920
|
+
file_text?: string;
|
|
921
|
+
insert_line?: number;
|
|
922
|
+
new_str?: string;
|
|
923
|
+
insert_text?: string;
|
|
924
|
+
old_str?: string;
|
|
925
|
+
view_range?: number[];
|
|
926
|
+
}, unknown, {}>;
|
|
927
|
+
/**
|
|
928
|
+
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
929
|
+
*
|
|
930
|
+
* @param maxUses - The max_uses parameter limits the number of web fetches performed
|
|
931
|
+
* @param allowedDomains - Only fetch from these domains
|
|
932
|
+
* @param blockedDomains - Never fetch from these domains
|
|
933
|
+
* @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.
|
|
934
|
+
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
935
|
+
*/
|
|
936
|
+
webFetch_20250910: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
937
|
+
url: string;
|
|
938
|
+
}, {
|
|
939
|
+
type: "web_fetch_result";
|
|
940
|
+
url: string;
|
|
941
|
+
content: {
|
|
942
|
+
type: "document";
|
|
943
|
+
title: string | null;
|
|
944
|
+
citations?: {
|
|
945
|
+
enabled: boolean;
|
|
946
|
+
};
|
|
947
|
+
source: {
|
|
948
|
+
type: "base64";
|
|
949
|
+
mediaType: "application/pdf";
|
|
950
|
+
data: string;
|
|
951
|
+
} | {
|
|
952
|
+
type: "text";
|
|
953
|
+
mediaType: "text/plain";
|
|
954
|
+
data: string;
|
|
955
|
+
};
|
|
956
|
+
};
|
|
957
|
+
retrievedAt: string | null;
|
|
958
|
+
}, {
|
|
959
|
+
maxUses?: number;
|
|
960
|
+
allowedDomains?: string[];
|
|
961
|
+
blockedDomains?: string[];
|
|
962
|
+
citations?: {
|
|
963
|
+
enabled: boolean;
|
|
964
|
+
};
|
|
965
|
+
maxContentTokens?: number;
|
|
966
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
967
|
+
url: string;
|
|
968
|
+
}, {
|
|
969
|
+
type: "web_fetch_result";
|
|
970
|
+
url: string;
|
|
971
|
+
content: {
|
|
972
|
+
type: "document";
|
|
973
|
+
title: string | null;
|
|
974
|
+
citations?: {
|
|
975
|
+
enabled: boolean;
|
|
976
|
+
};
|
|
977
|
+
source: {
|
|
978
|
+
type: "base64";
|
|
979
|
+
mediaType: "application/pdf";
|
|
980
|
+
data: string;
|
|
981
|
+
} | {
|
|
982
|
+
type: "text";
|
|
983
|
+
mediaType: "text/plain";
|
|
984
|
+
data: string;
|
|
985
|
+
};
|
|
986
|
+
};
|
|
987
|
+
retrievedAt: string | null;
|
|
988
|
+
}, {}>;
|
|
989
|
+
/**
|
|
990
|
+
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
991
|
+
*
|
|
992
|
+
* @param maxUses - The max_uses parameter limits the number of web fetches performed
|
|
993
|
+
* @param allowedDomains - Only fetch from these domains
|
|
994
|
+
* @param blockedDomains - Never fetch from these domains
|
|
995
|
+
* @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.
|
|
996
|
+
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
997
|
+
*/
|
|
998
|
+
webFetch_20260209: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
999
|
+
url: string;
|
|
1000
|
+
}, {
|
|
1001
|
+
type: "web_fetch_result";
|
|
1002
|
+
url: string;
|
|
1003
|
+
content: {
|
|
1004
|
+
type: "document";
|
|
1005
|
+
title: string | null;
|
|
1006
|
+
citations?: {
|
|
1007
|
+
enabled: boolean;
|
|
1008
|
+
};
|
|
1009
|
+
source: {
|
|
1010
|
+
type: "base64";
|
|
1011
|
+
mediaType: "application/pdf";
|
|
1012
|
+
data: string;
|
|
1013
|
+
} | {
|
|
1014
|
+
type: "text";
|
|
1015
|
+
mediaType: "text/plain";
|
|
1016
|
+
data: string;
|
|
1017
|
+
};
|
|
1018
|
+
};
|
|
1019
|
+
retrievedAt: string | null;
|
|
1020
|
+
}, {
|
|
1021
|
+
maxUses?: number;
|
|
1022
|
+
allowedDomains?: string[];
|
|
1023
|
+
blockedDomains?: string[];
|
|
1024
|
+
citations?: {
|
|
1025
|
+
enabled: boolean;
|
|
1026
|
+
};
|
|
1027
|
+
maxContentTokens?: number;
|
|
1028
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
1029
|
+
url: string;
|
|
1030
|
+
}, {
|
|
1031
|
+
type: "web_fetch_result";
|
|
1032
|
+
url: string;
|
|
1033
|
+
content: {
|
|
1034
|
+
type: "document";
|
|
1035
|
+
title: string | null;
|
|
1036
|
+
citations?: {
|
|
1037
|
+
enabled: boolean;
|
|
1038
|
+
};
|
|
1039
|
+
source: {
|
|
1040
|
+
type: "base64";
|
|
1041
|
+
mediaType: "application/pdf";
|
|
1042
|
+
data: string;
|
|
1043
|
+
} | {
|
|
1044
|
+
type: "text";
|
|
1045
|
+
mediaType: "text/plain";
|
|
1046
|
+
data: string;
|
|
1047
|
+
};
|
|
1048
|
+
};
|
|
1049
|
+
retrievedAt: string | null;
|
|
1050
|
+
}, {}>;
|
|
1051
|
+
/**
|
|
1052
|
+
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
1053
|
+
*
|
|
1054
|
+
* @param maxUses - Maximum number of web searches Claude can perform during the conversation.
|
|
1055
|
+
* @param allowedDomains - Optional list of domains that Claude is allowed to search.
|
|
1056
|
+
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
1057
|
+
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
1058
|
+
*/
|
|
1059
|
+
webSearch_20250305: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
1060
|
+
query: string;
|
|
1061
|
+
}, {
|
|
1062
|
+
type: "web_search_result";
|
|
1063
|
+
url: string;
|
|
1064
|
+
title: string | null;
|
|
1065
|
+
pageAge: string | null;
|
|
1066
|
+
encryptedContent: string;
|
|
1067
|
+
}[], {
|
|
1068
|
+
maxUses?: number;
|
|
1069
|
+
allowedDomains?: string[];
|
|
1070
|
+
blockedDomains?: string[];
|
|
1071
|
+
userLocation?: {
|
|
1072
|
+
type: "approximate";
|
|
1073
|
+
city?: string;
|
|
1074
|
+
region?: string;
|
|
1075
|
+
country?: string;
|
|
1076
|
+
timezone?: string;
|
|
1077
|
+
};
|
|
1078
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
1079
|
+
query: string;
|
|
1080
|
+
}, {
|
|
1081
|
+
type: "web_search_result";
|
|
1082
|
+
url: string;
|
|
1083
|
+
title: string | null;
|
|
1084
|
+
pageAge: string | null;
|
|
1085
|
+
encryptedContent: string;
|
|
1086
|
+
}[], {}>;
|
|
1087
|
+
/**
|
|
1088
|
+
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
1089
|
+
*
|
|
1090
|
+
* @param maxUses - Maximum number of web searches Claude can perform during the conversation.
|
|
1091
|
+
* @param allowedDomains - Optional list of domains that Claude is allowed to search.
|
|
1092
|
+
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
1093
|
+
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
1094
|
+
*/
|
|
1095
|
+
webSearch_20260209: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
1096
|
+
query: string;
|
|
1097
|
+
}, {
|
|
1098
|
+
type: "web_search_result";
|
|
1099
|
+
url: string;
|
|
1100
|
+
title: string | null;
|
|
1101
|
+
pageAge: string | null;
|
|
1102
|
+
encryptedContent: string;
|
|
1103
|
+
}[], {
|
|
1104
|
+
maxUses?: number;
|
|
1105
|
+
allowedDomains?: string[];
|
|
1106
|
+
blockedDomains?: string[];
|
|
1107
|
+
userLocation?: {
|
|
1108
|
+
type: "approximate";
|
|
1109
|
+
city?: string;
|
|
1110
|
+
region?: string;
|
|
1111
|
+
country?: string;
|
|
1112
|
+
timezone?: string;
|
|
1113
|
+
};
|
|
1114
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
1115
|
+
query: string;
|
|
1116
|
+
}, {
|
|
1117
|
+
type: "web_search_result";
|
|
1118
|
+
url: string;
|
|
1119
|
+
title: string | null;
|
|
1120
|
+
pageAge: string | null;
|
|
1121
|
+
encryptedContent: string;
|
|
1122
|
+
}[], {}>;
|
|
1123
|
+
/**
|
|
1124
|
+
* Creates a tool search tool that uses regex patterns to find tools.
|
|
1125
|
+
*
|
|
1126
|
+
* The tool search tool enables Claude to work with hundreds or thousands of tools
|
|
1127
|
+
* by dynamically discovering and loading them on-demand. Instead of loading all
|
|
1128
|
+
* tool definitions into the context window upfront, Claude searches your tool
|
|
1129
|
+
* catalog and loads only the tools it needs.
|
|
1130
|
+
*
|
|
1131
|
+
* Use `providerOptions: { anthropic: { deferLoading: true } }` on other tools
|
|
1132
|
+
* to mark them for deferred loading.
|
|
1133
|
+
*
|
|
1134
|
+
* Supported models: Claude Opus 4.5, Claude Sonnet 4.5
|
|
1135
|
+
*/
|
|
1136
|
+
toolSearchRegex_20251119: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
1137
|
+
pattern: string;
|
|
1138
|
+
limit?: number;
|
|
1139
|
+
}, {
|
|
1140
|
+
type: "tool_reference";
|
|
1141
|
+
toolName: string;
|
|
1142
|
+
}[], {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
1143
|
+
pattern: string;
|
|
1144
|
+
limit?: number;
|
|
1145
|
+
}, {
|
|
1146
|
+
type: "tool_reference";
|
|
1147
|
+
toolName: string;
|
|
1148
|
+
}[], {}>;
|
|
1149
|
+
/**
|
|
1150
|
+
* Creates a tool search tool that uses BM25 (natural language) to find tools.
|
|
1151
|
+
*
|
|
1152
|
+
* The tool search tool enables Claude to work with hundreds or thousands of tools
|
|
1153
|
+
* by dynamically discovering and loading them on-demand. Instead of loading all
|
|
1154
|
+
* tool definitions into the context window upfront, Claude searches your tool
|
|
1155
|
+
* catalog and loads only the tools it needs.
|
|
1156
|
+
*
|
|
1157
|
+
* Use `providerOptions: { anthropic: { deferLoading: true } }` on other tools
|
|
1158
|
+
* to mark them for deferred loading.
|
|
1159
|
+
*
|
|
1160
|
+
* Supported models: Claude Opus 4.5, Claude Sonnet 4.5
|
|
1161
|
+
*/
|
|
1162
|
+
toolSearchBm25_20251119: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
1163
|
+
query: string;
|
|
1164
|
+
limit?: number;
|
|
1165
|
+
}, {
|
|
1166
|
+
type: "tool_reference";
|
|
1167
|
+
toolName: string;
|
|
1168
|
+
}[], {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
|
|
1169
|
+
query: string;
|
|
1170
|
+
limit?: number;
|
|
1171
|
+
}, {
|
|
1172
|
+
type: "tool_reference";
|
|
1173
|
+
toolName: string;
|
|
1174
|
+
}[], {}>;
|
|
1175
|
+
};
|
|
1176
|
+
|
|
1177
|
+
interface AnthropicProvider extends ProviderV4 {
|
|
1178
|
+
/**
|
|
1179
|
+
* Creates a model for text generation.
|
|
1180
|
+
*/
|
|
1181
|
+
(modelId: AnthropicModelId): LanguageModelV4;
|
|
1182
|
+
/**
|
|
1183
|
+
* Creates a model for text generation.
|
|
1184
|
+
*/
|
|
1185
|
+
languageModel(modelId: AnthropicModelId): LanguageModelV4;
|
|
1186
|
+
chat(modelId: AnthropicModelId): LanguageModelV4;
|
|
1187
|
+
messages(modelId: AnthropicModelId): LanguageModelV4;
|
|
1188
|
+
/**
|
|
1189
|
+
* @deprecated Use `embeddingModel` instead.
|
|
1190
|
+
*/
|
|
1191
|
+
textEmbeddingModel(modelId: string): never;
|
|
1192
|
+
files(): FilesV4;
|
|
1193
|
+
/**
|
|
1194
|
+
* Returns a SkillsV4 interface for uploading skills to Anthropic.
|
|
1195
|
+
*/
|
|
1196
|
+
skills(): SkillsV4;
|
|
1197
|
+
/**
|
|
1198
|
+
* Anthropic-specific computer use tool.
|
|
1199
|
+
*/
|
|
1200
|
+
tools: typeof anthropicTools;
|
|
1201
|
+
}
|
|
1202
|
+
interface AnthropicProviderSettings {
|
|
1203
|
+
/**
|
|
1204
|
+
* Use a different URL prefix for API calls, e.g. to use proxy servers.
|
|
1205
|
+
* The default prefix is `https://api.anthropic.com/v1`.
|
|
1206
|
+
*/
|
|
1207
|
+
baseURL?: string;
|
|
1208
|
+
/**
|
|
1209
|
+
* API key that is being send using the `x-api-key` header.
|
|
1210
|
+
* It defaults to the `ANTHROPIC_API_KEY` environment variable.
|
|
1211
|
+
* Only one of `apiKey` or `authToken` is required.
|
|
1212
|
+
*/
|
|
1213
|
+
apiKey?: string;
|
|
1214
|
+
/**
|
|
1215
|
+
* Auth token that is being sent using the `Authorization: Bearer` header.
|
|
1216
|
+
* It defaults to the `ANTHROPIC_AUTH_TOKEN` environment variable.
|
|
1217
|
+
* Only one of `apiKey` or `authToken` is required.
|
|
1218
|
+
*/
|
|
1219
|
+
authToken?: string;
|
|
1220
|
+
/**
|
|
1221
|
+
* Custom headers to include in the requests.
|
|
1222
|
+
*/
|
|
1223
|
+
headers?: Record<string, string>;
|
|
1224
|
+
/**
|
|
1225
|
+
* Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
1226
|
+
* or to provide a custom fetch implementation for e.g. testing.
|
|
1227
|
+
*/
|
|
1228
|
+
fetch?: FetchFunction;
|
|
1229
|
+
generateId?: () => string;
|
|
1230
|
+
/**
|
|
1231
|
+
* Custom provider name
|
|
1232
|
+
* Defaults to 'anthropic.messages'.
|
|
1233
|
+
*/
|
|
1234
|
+
name?: string;
|
|
1235
|
+
}
|
|
1236
|
+
/**
|
|
1237
|
+
* Create an Anthropic provider instance.
|
|
1238
|
+
*/
|
|
1239
|
+
declare function createAnthropic(options?: AnthropicProviderSettings): AnthropicProvider;
|
|
1240
|
+
/**
|
|
1241
|
+
* Default Anthropic provider instance.
|
|
1242
|
+
*/
|
|
1243
|
+
declare const anthropic: AnthropicProvider;
|
|
1244
|
+
|
|
1245
|
+
/**
|
|
1246
|
+
* Sets the Anthropic container ID in the provider options based on
|
|
1247
|
+
* any previous step's provider metadata.
|
|
1248
|
+
*
|
|
1249
|
+
* Searches backwards through steps to find the most recent container ID.
|
|
1250
|
+
* You can use this function in `prepareStep` to forward the container ID between steps.
|
|
1251
|
+
*/
|
|
1252
|
+
declare function forwardAnthropicContainerIdFromLastStep({ steps, }: {
|
|
1253
|
+
steps: Array<{
|
|
1254
|
+
providerMetadata?: Record<string, JSONObject>;
|
|
1255
|
+
}>;
|
|
1256
|
+
}): undefined | {
|
|
1257
|
+
providerOptions?: Record<string, JSONObject>;
|
|
1258
|
+
};
|
|
1259
|
+
|
|
1260
|
+
declare const VERSION: string;
|
|
1261
|
+
|
|
1262
|
+
export { type AnthropicLanguageModelOptions, type AnthropicMessageMetadata, type AnthropicProvider, type AnthropicLanguageModelOptions as AnthropicProviderOptions, type AnthropicProviderSettings, type AnthropicToolOptions, type AnthropicUsageIteration, VERSION, anthropic, createAnthropic, forwardAnthropicContainerIdFromLastStep };
|