@effect/ai-anthropic 4.0.0-beta.70 → 4.0.0-beta.71
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/AnthropicClient.d.ts +49 -0
- package/dist/AnthropicClient.d.ts.map +1 -1
- package/dist/AnthropicClient.js +63 -3
- package/dist/AnthropicClient.js.map +1 -1
- package/dist/AnthropicConfig.d.ts +22 -0
- package/dist/AnthropicConfig.d.ts.map +1 -1
- package/dist/AnthropicConfig.js +12 -0
- package/dist/AnthropicConfig.js.map +1 -1
- package/dist/AnthropicError.d.ts +8 -0
- package/dist/AnthropicError.d.ts.map +1 -1
- package/dist/AnthropicLanguageModel.d.ts +104 -6
- package/dist/AnthropicLanguageModel.d.ts.map +1 -1
- package/dist/AnthropicLanguageModel.js +53 -3
- package/dist/AnthropicLanguageModel.js.map +1 -1
- package/dist/AnthropicTelemetry.d.ts +21 -1
- package/dist/AnthropicTelemetry.d.ts.map +1 -1
- package/dist/AnthropicTelemetry.js +38 -4
- package/dist/AnthropicTelemetry.js.map +1 -1
- package/dist/AnthropicTool.d.ts +829 -56
- package/dist/AnthropicTool.d.ts.map +1 -1
- package/dist/AnthropicTool.js +683 -48
- package/dist/AnthropicTool.js.map +1 -1
- package/dist/index.d.ts +0 -65
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -65
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/AnthropicClient.ts +78 -3
- package/src/AnthropicConfig.ts +22 -0
- package/src/AnthropicError.ts +8 -0
- package/src/AnthropicLanguageModel.ts +133 -7
- package/src/AnthropicTelemetry.ts +54 -5
- package/src/AnthropicTool.ts +827 -54
- package/src/index.ts +0 -65
package/dist/AnthropicTool.d.ts
CHANGED
|
@@ -1,15 +1,76 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Anthropic provider
|
|
2
|
+
* The `AnthropicTool` module defines Anthropic provider tools that can be
|
|
3
|
+
* attached to Anthropic-backed Effect AI language model requests. These are
|
|
4
|
+
* provider-defined tools: Anthropic owns the tool names, argument formats,
|
|
5
|
+
* beta headers, and in some cases the execution environment.
|
|
6
|
+
*
|
|
7
|
+
* **Mental model**
|
|
8
|
+
*
|
|
9
|
+
* - Exports such as {@link Bash_20250124}, {@link CodeExecution_20250825},
|
|
10
|
+
* {@link ComputerUse_20250124}, and {@link WebSearch_20250305} create
|
|
11
|
+
* versioned provider-defined tool values understood by the Anthropic
|
|
12
|
+
* language model integration
|
|
13
|
+
* - Tool-specific `Schema` exports describe the arguments Claude may provide
|
|
14
|
+
* when invoking that provider tool
|
|
15
|
+
* - Some tools run on Anthropic infrastructure, such as
|
|
16
|
+
* {@link WebSearch_20250305}, {@link WebFetch_20250910}, and
|
|
17
|
+
* {@link CodeExecution_20250825}; handler-backed tools such as Bash,
|
|
18
|
+
* Computer Use, and Text Editor variants require application-side execution
|
|
19
|
+
* - Selecting a versioned tool lets the Anthropic model layer add the beta
|
|
20
|
+
* header required by that exact Anthropic API version
|
|
21
|
+
*
|
|
22
|
+
* **Common tasks**
|
|
23
|
+
*
|
|
24
|
+
* - Enable terminal-style actions with {@link Bash_20250124}
|
|
25
|
+
* - Enable sandboxed code execution with {@link CodeExecution_20250825}
|
|
26
|
+
* - Enable desktop automation payloads with {@link ComputerUse_20250124}
|
|
27
|
+
* - Enable persistent memory file operations with {@link Memory_20250818}
|
|
28
|
+
* - Enable text-editor commands with {@link TextEditor_20250728}
|
|
29
|
+
* - Enable hosted web capabilities with {@link WebSearch_20250305} or
|
|
30
|
+
* {@link WebFetch_20250910}
|
|
31
|
+
* - Restrict tool discovery with {@link ToolSearchRegex_20251119} or
|
|
32
|
+
* {@link ToolSearchBM25_20251119}
|
|
33
|
+
*
|
|
34
|
+
* **Quickstart**
|
|
35
|
+
*
|
|
36
|
+
* **Example** (Creating hosted Anthropic tools)
|
|
37
|
+
*
|
|
38
|
+
* ```ts
|
|
39
|
+
* import { AnthropicTool } from "@effect/ai-anthropic"
|
|
40
|
+
*
|
|
41
|
+
* const tools = [
|
|
42
|
+
* AnthropicTool.WebSearch_20250305({ maxUses: 3 }),
|
|
43
|
+
* AnthropicTool.WebFetch_20250910({
|
|
44
|
+
* citations: { enabled: true }
|
|
45
|
+
* })
|
|
46
|
+
* ]
|
|
47
|
+
* ```
|
|
3
48
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
49
|
+
* **Gotchas**
|
|
50
|
+
*
|
|
51
|
+
* - The suffix date is part of the Anthropic tool contract; choose the version
|
|
52
|
+
* that matches the model and beta behavior you intend to use
|
|
53
|
+
* - Handler-backed tools expose schemas for Claude's requested actions, but
|
|
54
|
+
* your runtime is responsible for performing those actions and returning
|
|
55
|
+
* results
|
|
6
56
|
*
|
|
7
57
|
* @since 4.0.0
|
|
8
58
|
*/
|
|
9
59
|
import * as Schema from "effect/Schema";
|
|
10
60
|
import * as Tool from "effect/unstable/ai/Tool";
|
|
11
61
|
/**
|
|
12
|
-
* Union of all Anthropic provider-defined
|
|
62
|
+
* Union of all Anthropic provider-defined tool definitions exported by this module.
|
|
63
|
+
*
|
|
64
|
+
* **When to use**
|
|
65
|
+
*
|
|
66
|
+
* Use when a helper, collection, or option accepts any Anthropic
|
|
67
|
+
* provider-defined tool value created by this module.
|
|
68
|
+
*
|
|
69
|
+
* **Details**
|
|
70
|
+
*
|
|
71
|
+
* The union is built from the return types of the exported constructors,
|
|
72
|
+
* including Bash, Code Execution, Computer Use, Memory, Text Editor, Tool
|
|
73
|
+
* Search, Web Fetch, and Web Search tool versions.
|
|
13
74
|
*
|
|
14
75
|
* @category models
|
|
15
76
|
* @since 4.0.0
|
|
@@ -18,11 +79,18 @@ export type AnthropicTool = ReturnType<typeof Bash_20241022> | ReturnType<typeof
|
|
|
18
79
|
/**
|
|
19
80
|
* Anthropic Bash tool (2024-10-22 version).
|
|
20
81
|
*
|
|
82
|
+
* **When to use**
|
|
83
|
+
*
|
|
84
|
+
* Use when you need the model to execute bash commands and require the 2024-10-22
|
|
85
|
+
* version of the Anthropic computer-use beta.
|
|
86
|
+
*
|
|
21
87
|
* **Details**
|
|
22
88
|
*
|
|
23
89
|
* Allows the model to execute bash commands in a sandboxed environment.
|
|
24
90
|
* Requires the "computer-use-2024-10-22" beta header.
|
|
25
91
|
*
|
|
92
|
+
* @see {@link Bash_20250124} for the newer 2025-01-24 version of the bash tool
|
|
93
|
+
*
|
|
26
94
|
* @category Bash
|
|
27
95
|
* @since 4.0.0
|
|
28
96
|
*/
|
|
@@ -41,11 +109,18 @@ export declare const Bash_20241022: <Mode extends Tool.FailureMode | undefined =
|
|
|
41
109
|
/**
|
|
42
110
|
* Anthropic Bash tool (2025-01-24 version).
|
|
43
111
|
*
|
|
112
|
+
* **When to use**
|
|
113
|
+
*
|
|
114
|
+
* Use when you need the model to execute bash commands and require the 2025-01-24
|
|
115
|
+
* version of the Anthropic computer-use beta.
|
|
116
|
+
*
|
|
44
117
|
* **Details**
|
|
45
118
|
*
|
|
46
119
|
* Allows the model to execute bash commands in a sandboxed environment.
|
|
47
120
|
* Requires the "computer-use-2025-01-24" beta header.
|
|
48
121
|
*
|
|
122
|
+
* @see {@link Bash_20241022} for the older 2024-10-22 version of the bash tool
|
|
123
|
+
*
|
|
49
124
|
* @category Bash
|
|
50
125
|
* @since 4.0.0
|
|
51
126
|
*/
|
|
@@ -64,6 +139,13 @@ export declare const Bash_20250124: <Mode extends Tool.FailureMode | undefined =
|
|
|
64
139
|
/**
|
|
65
140
|
* Schema for a code execution request that asks Anthropic to run source code as a programmatic tool call.
|
|
66
141
|
*
|
|
142
|
+
* **When to use**
|
|
143
|
+
*
|
|
144
|
+
* Use when constructing or validating a programmatic tool call for the Anthropic
|
|
145
|
+
* Code Execution tool.
|
|
146
|
+
*
|
|
147
|
+
* @see {@link CodeExecution_20250522} for the parent tool definition
|
|
148
|
+
*
|
|
67
149
|
* @category Code Execution
|
|
68
150
|
* @since 4.0.0
|
|
69
151
|
*/
|
|
@@ -82,7 +164,19 @@ export declare const CodeExecutionProgrammaticToolCall: Schema.Struct<{
|
|
|
82
164
|
*/
|
|
83
165
|
export type CodeExecutionProgrammaticToolCall = typeof CodeExecutionProgrammaticToolCall.Type;
|
|
84
166
|
/**
|
|
85
|
-
* Schema for
|
|
167
|
+
* Schema for the `bash_code_execution` input variant of Anthropic Code Execution.
|
|
168
|
+
*
|
|
169
|
+
* **When to use**
|
|
170
|
+
*
|
|
171
|
+
* Use when validating or constructing a bash command request for
|
|
172
|
+
* `CodeExecution_20250522`.
|
|
173
|
+
*
|
|
174
|
+
* **Details**
|
|
175
|
+
*
|
|
176
|
+
* The schema requires `type` to be `"bash_code_execution"` and `command` to
|
|
177
|
+
* contain the bash command sent to Anthropic.
|
|
178
|
+
*
|
|
179
|
+
* @see {@link CodeExecution_20250522} for the provider-defined tool that consumes this input variant
|
|
86
180
|
*
|
|
87
181
|
* @category Code Execution
|
|
88
182
|
* @since 4.0.0
|
|
@@ -95,14 +189,44 @@ export declare const CodeExecutionBashCommand: Schema.Struct<{
|
|
|
95
189
|
readonly command: Schema.String;
|
|
96
190
|
}>;
|
|
97
191
|
/**
|
|
98
|
-
* Input payload for a bash command
|
|
192
|
+
* Input payload for a bash command routed through the Anthropic code execution tool.
|
|
193
|
+
*
|
|
194
|
+
* **When to use**
|
|
195
|
+
*
|
|
196
|
+
* Use when representing a provider-executed bash command request for the
|
|
197
|
+
* 2025-05-22 code execution tool.
|
|
198
|
+
*
|
|
199
|
+
* **Details**
|
|
200
|
+
*
|
|
201
|
+
* The payload uses `type: "bash_code_execution"` to distinguish bash execution
|
|
202
|
+
* from programmatic code and text editor operations, and `command` contains the
|
|
203
|
+
* bash command to run.
|
|
204
|
+
*
|
|
205
|
+
* @see {@link CodeExecutionProgrammaticToolCall} for programmatic code execution input
|
|
206
|
+
* @see {@link CodeExecutionTextEditorView} for viewing files through text editor code execution
|
|
207
|
+
* @see {@link CodeExecutionTextEditorCreate} for creating files through text editor code execution
|
|
208
|
+
* @see {@link CodeExecutionTextEditorStrReplace} for replacing text through text editor code execution
|
|
209
|
+
* @see {@link CodeExecution_20250522} for the provider-defined tool that consumes this payload
|
|
99
210
|
*
|
|
100
211
|
* @category Code Execution
|
|
101
212
|
* @since 4.0.0
|
|
102
213
|
*/
|
|
103
214
|
export type CodeExecutionBashCommand = typeof CodeExecutionBashCommand.Type;
|
|
104
215
|
/**
|
|
105
|
-
*
|
|
216
|
+
* Schema for a code execution text editor request that views a file by path.
|
|
217
|
+
*
|
|
218
|
+
* **When to use**
|
|
219
|
+
*
|
|
220
|
+
* Use to validate or construct the `view` command for Anthropic code execution
|
|
221
|
+
* text editor tool calls.
|
|
222
|
+
*
|
|
223
|
+
* **Details**
|
|
224
|
+
*
|
|
225
|
+
* The encoded payload uses `type: "text_editor_code_execution"`,
|
|
226
|
+
* `command: "view"`, and a `path` string.
|
|
227
|
+
*
|
|
228
|
+
* @see {@link CodeExecutionTextEditorCreate} for the command that creates a file
|
|
229
|
+
* @see {@link CodeExecutionTextEditorStrReplace} for the command that replaces text in a file
|
|
106
230
|
*
|
|
107
231
|
* @category Code Execution
|
|
108
232
|
* @since 4.0.0
|
|
@@ -116,14 +240,48 @@ export declare const CodeExecutionTextEditorView: Schema.Struct<{
|
|
|
116
240
|
readonly path: Schema.String;
|
|
117
241
|
}>;
|
|
118
242
|
/**
|
|
119
|
-
* Input payload for
|
|
243
|
+
* Input payload for the `view` command of Anthropic's text editor code execution tool.
|
|
244
|
+
*
|
|
245
|
+
* **When to use**
|
|
246
|
+
*
|
|
247
|
+
* Use when handling or validating the `view` command for Anthropic's text
|
|
248
|
+
* editor code execution tool.
|
|
249
|
+
*
|
|
250
|
+
* **Details**
|
|
251
|
+
*
|
|
252
|
+
* The payload is discriminated by `type: "text_editor_code_execution"` and
|
|
253
|
+
* `command: "view"`. The `path` field identifies the file to view.
|
|
254
|
+
*
|
|
255
|
+
* **Gotchas**
|
|
256
|
+
*
|
|
257
|
+
* This code execution view payload does not include `view_range`; line ranges
|
|
258
|
+
* are part of the standalone text editor view payload, not this code execution
|
|
259
|
+
* payload.
|
|
260
|
+
*
|
|
261
|
+
* @see {@link CodeExecution_20250522} for the provider-defined code execution tool that includes this payload
|
|
262
|
+
* @see {@link TextEditorViewCommand} for the standalone text editor view payload
|
|
120
263
|
*
|
|
121
264
|
* @category Code Execution
|
|
122
265
|
* @since 4.0.0
|
|
123
266
|
*/
|
|
124
267
|
export type CodeExecutionTextEditorView = typeof CodeExecutionTextEditorView.Type;
|
|
125
268
|
/**
|
|
126
|
-
*
|
|
269
|
+
* Schema for a text editor code execution request that creates a file at a path.
|
|
270
|
+
*
|
|
271
|
+
* **When to use**
|
|
272
|
+
*
|
|
273
|
+
* Use when validating or constructing an Anthropic `text_editor_code_execution`
|
|
274
|
+
* tool call that should create a file.
|
|
275
|
+
*
|
|
276
|
+
* **Details**
|
|
277
|
+
*
|
|
278
|
+
* The request is discriminated by `type: "text_editor_code_execution"` and
|
|
279
|
+
* `command: "create"`. It requires `path` and accepts optional `file_text`; the
|
|
280
|
+
* schema allows `file_text` to be omitted, `null`, or a string.
|
|
281
|
+
*
|
|
282
|
+
* @see {@link CodeExecution_20250522} for the provider-defined tool that consumes this request
|
|
283
|
+
* @see {@link CodeExecutionTextEditorView} for the matching view request
|
|
284
|
+
* @see {@link CodeExecutionTextEditorStrReplace} for the matching replace request
|
|
127
285
|
*
|
|
128
286
|
* @category Code Execution
|
|
129
287
|
* @since 4.0.0
|
|
@@ -148,7 +306,20 @@ export declare const CodeExecutionTextEditorCreate: Schema.Struct<{
|
|
|
148
306
|
*/
|
|
149
307
|
export type CodeExecutionTextEditorCreate = typeof CodeExecutionTextEditorCreate.Type;
|
|
150
308
|
/**
|
|
151
|
-
*
|
|
309
|
+
* Schema for a code execution text editor request that replaces one exact string in a file.
|
|
310
|
+
*
|
|
311
|
+
* **When to use**
|
|
312
|
+
*
|
|
313
|
+
* Use when validating or constructing the `str_replace` text editor operation
|
|
314
|
+
* for the 2025-05-22 Anthropic code execution tool.
|
|
315
|
+
*
|
|
316
|
+
* **Gotchas**
|
|
317
|
+
*
|
|
318
|
+
* The `old_str` must match the file contents exactly, including whitespace and
|
|
319
|
+
* indentation, and must identify a single occurrence.
|
|
320
|
+
*
|
|
321
|
+
* @see {@link CodeExecutionTextEditorView} for reading file contents before choosing the replacement text
|
|
322
|
+
* @see {@link CodeExecution_20250522} for the provider-defined tool that consumes this payload
|
|
152
323
|
*
|
|
153
324
|
* @category Code Execution
|
|
154
325
|
* @since 4.0.0
|
|
@@ -179,6 +350,13 @@ export type CodeExecutionTextEditorStrReplace = typeof CodeExecutionTextEditorSt
|
|
|
179
350
|
/**
|
|
180
351
|
* Schema for the 2025-08-25 code execution tool input, containing the code to execute.
|
|
181
352
|
*
|
|
353
|
+
* **When to use**
|
|
354
|
+
*
|
|
355
|
+
* Use when validating or constructing the input payload for the 2025-08-25
|
|
356
|
+
* Anthropic code execution tool.
|
|
357
|
+
*
|
|
358
|
+
* @see {@link CodeExecution_20250825} for the provider-defined tool that consumes this schema
|
|
359
|
+
*
|
|
182
360
|
* @category Code Execution
|
|
183
361
|
* @since 4.0.0
|
|
184
362
|
*/
|
|
@@ -191,6 +369,17 @@ export declare const CodeExecution_20250825_Parameters: Schema.Struct<{
|
|
|
191
369
|
/**
|
|
192
370
|
* Input payload for the 2025-08-25 Anthropic code execution tool.
|
|
193
371
|
*
|
|
372
|
+
* **When to use**
|
|
373
|
+
*
|
|
374
|
+
* Use when typing input passed to the 2025-08-25 Anthropic code execution tool.
|
|
375
|
+
*
|
|
376
|
+
* **Details**
|
|
377
|
+
*
|
|
378
|
+
* The payload has a single `code` field containing the source code string to
|
|
379
|
+
* execute.
|
|
380
|
+
*
|
|
381
|
+
* @see {@link CodeExecution_20250825} for the provider-defined tool that consumes this payload
|
|
382
|
+
*
|
|
194
383
|
* @category Code Execution
|
|
195
384
|
* @since 4.0.0
|
|
196
385
|
*/
|
|
@@ -198,12 +387,19 @@ export type CodeExecution_20250825_Parameters = typeof CodeExecution_20250825_Pa
|
|
|
198
387
|
/**
|
|
199
388
|
* Anthropic Code Execution tool (2025-05-22 version).
|
|
200
389
|
*
|
|
390
|
+
* **When to use**
|
|
391
|
+
*
|
|
392
|
+
* Use when you need the model to execute code in a sandboxed environment and
|
|
393
|
+
* require the 2025-05-22 version of the Anthropic code-execution beta.
|
|
394
|
+
*
|
|
201
395
|
* **Details**
|
|
202
396
|
*
|
|
203
397
|
* Allows the model to execute code in a sandboxed environment with support
|
|
204
398
|
* for multiple execution types including programmatic tool calls, bash
|
|
205
399
|
* execution, and text editor operations.
|
|
206
400
|
*
|
|
401
|
+
* @see {@link CodeExecutionProgrammaticToolCall} for the programmatic tool call schema
|
|
402
|
+
*
|
|
207
403
|
* @category Code Execution
|
|
208
404
|
* @since 4.0.0
|
|
209
405
|
*/
|
|
@@ -274,9 +470,18 @@ export declare const CodeExecution_20250522: <Mode extends Tool.FailureMode | un
|
|
|
274
470
|
/**
|
|
275
471
|
* Anthropic Code Execution tool (2025-08-25 version).
|
|
276
472
|
*
|
|
473
|
+
* **When to use**
|
|
474
|
+
*
|
|
475
|
+
* Use when you need the model to execute code in a sandboxed environment and
|
|
476
|
+
* require the 2025-08-25 version of the Anthropic code-execution beta.
|
|
477
|
+
*
|
|
277
478
|
* **Details**
|
|
278
479
|
*
|
|
279
|
-
*
|
|
480
|
+
* Requires the `code-execution-2025-08-25` beta header and uses
|
|
481
|
+
* `CodeExecution_20250825_Parameters` as its input schema.
|
|
482
|
+
*
|
|
483
|
+
* @see {@link CodeExecution_20250522} for the older 2025-05-22 code execution tool
|
|
484
|
+
* @see {@link CodeExecution_20250825_Parameters} for the input schema consumed by this tool
|
|
280
485
|
*
|
|
281
486
|
* @category Code Execution
|
|
282
487
|
* @since 4.0.0
|
|
@@ -339,7 +544,16 @@ export declare const CodeExecution_20250825: <Mode extends Tool.FailureMode | un
|
|
|
339
544
|
readonly failureMode: Mode extends undefined ? "error" : Mode;
|
|
340
545
|
}, false>;
|
|
341
546
|
/**
|
|
342
|
-
*
|
|
547
|
+
* Schema for an `[x, y]` screen coordinate in pixels.
|
|
548
|
+
*
|
|
549
|
+
* **Details**
|
|
550
|
+
*
|
|
551
|
+
* This is a two-number tuple used by computer-use actions that accept screen
|
|
552
|
+
* positions.
|
|
553
|
+
*
|
|
554
|
+
* **Gotchas**
|
|
555
|
+
*
|
|
556
|
+
* This schema validates tuple shape only and does not check display bounds.
|
|
343
557
|
*
|
|
344
558
|
* @category Computer Use
|
|
345
559
|
* @since 4.0.0
|
|
@@ -353,7 +567,16 @@ export declare const Coordinate: Schema.Tuple<readonly [Schema.Number, Schema.Nu
|
|
|
353
567
|
*/
|
|
354
568
|
export type Coordinate = typeof Coordinate.Type;
|
|
355
569
|
/**
|
|
356
|
-
*
|
|
570
|
+
* Schema for an `[x1, y1, x2, y2]` screen region in pixels.
|
|
571
|
+
*
|
|
572
|
+
* **Details**
|
|
573
|
+
*
|
|
574
|
+
* The tuple represents top-left and bottom-right corners.
|
|
575
|
+
*
|
|
576
|
+
* **Gotchas**
|
|
577
|
+
*
|
|
578
|
+
* This schema validates four numbers only and does not check coordinate ordering
|
|
579
|
+
* or display bounds.
|
|
357
580
|
*
|
|
358
581
|
* @category Computer Use
|
|
359
582
|
* @since 4.0.0
|
|
@@ -367,7 +590,9 @@ export declare const Region: Schema.Tuple<readonly [Schema.Number, Schema.Number
|
|
|
367
590
|
*/
|
|
368
591
|
export type Region = typeof Region.Type;
|
|
369
592
|
/**
|
|
370
|
-
*
|
|
593
|
+
* Scroll direction literal: `"up"`, `"down"`, `"left"`, or `"right"`.
|
|
594
|
+
*
|
|
595
|
+
* @see {@link ComputerUseScrollAction} for the action payload that consumes this schema
|
|
371
596
|
*
|
|
372
597
|
* @category Computer Use
|
|
373
598
|
* @since 4.0.0
|
|
@@ -381,21 +606,38 @@ export declare const ScrollDirection: Schema.Literals<readonly ["up", "down", "l
|
|
|
381
606
|
*/
|
|
382
607
|
export type ScrollDirection = typeof ScrollDirection.Type;
|
|
383
608
|
/**
|
|
384
|
-
* Modifier
|
|
609
|
+
* Modifier key literal.
|
|
610
|
+
*
|
|
611
|
+
* **Details**
|
|
612
|
+
*
|
|
613
|
+
* Allowed values are `"alt"`, `"ctrl"`, `"meta"`, and `"shift"`.
|
|
385
614
|
*
|
|
386
615
|
* @category Computer Use
|
|
387
616
|
* @since 4.0.0
|
|
388
617
|
*/
|
|
389
618
|
export declare const ModifierKey: Schema.Literals<readonly ["alt", "ctrl", "meta", "shift"]>;
|
|
390
619
|
/**
|
|
391
|
-
* Modifier key
|
|
620
|
+
* Modifier key literal.
|
|
621
|
+
*
|
|
622
|
+
* **Details**
|
|
623
|
+
*
|
|
624
|
+
* Allowed values are `"alt"`, `"ctrl"`, `"meta"`, and `"shift"`.
|
|
392
625
|
*
|
|
393
626
|
* @category Computer Use
|
|
394
627
|
* @since 4.0.0
|
|
395
628
|
*/
|
|
396
629
|
export type ModifierKey = typeof ModifierKey.Type;
|
|
397
630
|
/**
|
|
398
|
-
*
|
|
631
|
+
* Schema for a computer-use action that presses a key or key combination, such
|
|
632
|
+
* as `"Return"`, `"ctrl+c"`, or `"ctrl+s"`.
|
|
633
|
+
*
|
|
634
|
+
* **When to use**
|
|
635
|
+
*
|
|
636
|
+
* Use when validating or constructing a computer-use action for keyboard
|
|
637
|
+
* shortcuts or non-text key presses.
|
|
638
|
+
*
|
|
639
|
+
* @see {@link TypeAction} for entering ordinary text strings
|
|
640
|
+
* @see {@link ComputerUseHoldKeyAction} for holding a key for a duration
|
|
399
641
|
*
|
|
400
642
|
* @category Computer Use
|
|
401
643
|
* @since 4.0.0
|
|
@@ -410,12 +652,42 @@ export declare const ComputerUseKeyAction: Schema.Struct<{
|
|
|
410
652
|
/**
|
|
411
653
|
* Computer-use action payload for pressing a key or key combination.
|
|
412
654
|
*
|
|
655
|
+
* **Details**
|
|
656
|
+
*
|
|
657
|
+
* The payload uses `action: "key"` and stores the key or key combination to
|
|
658
|
+
* press in `text`, such as `"Return"`, `"ctrl+c"`, or `"ctrl+s"`.
|
|
659
|
+
*
|
|
660
|
+
* **Gotchas**
|
|
661
|
+
*
|
|
662
|
+
* `text` is typed as `string`; the paired schema does not validate
|
|
663
|
+
* provider-specific key names or key combinations.
|
|
664
|
+
*
|
|
413
665
|
* @category Computer Use
|
|
414
666
|
* @since 4.0.0
|
|
415
667
|
*/
|
|
416
668
|
export type ComputerUseKeyAction = typeof ComputerUseKeyAction.Type;
|
|
417
669
|
/**
|
|
418
|
-
*
|
|
670
|
+
* Schema for a computer-use action that performs a left click.
|
|
671
|
+
*
|
|
672
|
+
* **When to use**
|
|
673
|
+
*
|
|
674
|
+
* Use to validate or construct an Anthropic computer-use payload for clicking
|
|
675
|
+
* once at the current mouse position or at a specific screen coordinate.
|
|
676
|
+
*
|
|
677
|
+
* **Details**
|
|
678
|
+
*
|
|
679
|
+
* The encoded payload uses `action: "left_click"`. The optional `coordinate`
|
|
680
|
+
* field supplies the `[x, y]` pixel position; when omitted, the action uses the
|
|
681
|
+
* current mouse position.
|
|
682
|
+
*
|
|
683
|
+
* **Gotchas**
|
|
684
|
+
*
|
|
685
|
+
* The coordinate schema only checks that the value is a two-number tuple. It
|
|
686
|
+
* does not validate that the point falls within the configured display
|
|
687
|
+
* dimensions.
|
|
688
|
+
*
|
|
689
|
+
* @see {@link ComputerUseDoubleClickAction} for performing a double click
|
|
690
|
+
* @see {@link ComputerUseMouseMoveAction} for moving the mouse without clicking
|
|
419
691
|
*
|
|
420
692
|
* @category Computer Use
|
|
421
693
|
* @since 4.0.0
|
|
@@ -436,7 +708,24 @@ export declare const ComputerUseLeftClickAction: Schema.Struct<{
|
|
|
436
708
|
*/
|
|
437
709
|
export type ComputerUseLeftClickAction = typeof ComputerUseLeftClickAction.Type;
|
|
438
710
|
/**
|
|
439
|
-
*
|
|
711
|
+
* Schema for a computer-use action that moves the mouse cursor to a required
|
|
712
|
+
* `[x, y]` screen coordinate.
|
|
713
|
+
*
|
|
714
|
+
* **When to use**
|
|
715
|
+
*
|
|
716
|
+
* Use to validate or construct a mouse movement action for an Anthropic
|
|
717
|
+
* computer-use tool call.
|
|
718
|
+
*
|
|
719
|
+
* **Details**
|
|
720
|
+
*
|
|
721
|
+
* The encoded payload has action `"mouse_move"` and a required `coordinate`
|
|
722
|
+
* field containing the target `[x, y]` pixel position.
|
|
723
|
+
*
|
|
724
|
+
* **Gotchas**
|
|
725
|
+
*
|
|
726
|
+
* The coordinate schema only checks that the value is a two-number tuple. It
|
|
727
|
+
* does not validate that the point falls within the configured display
|
|
728
|
+
* dimensions.
|
|
440
729
|
*
|
|
441
730
|
* @category Computer Use
|
|
442
731
|
* @since 4.0.0
|
|
@@ -456,7 +745,19 @@ export declare const ComputerUseMouseMoveAction: Schema.Struct<{
|
|
|
456
745
|
*/
|
|
457
746
|
export type ComputerUseMouseMoveAction = typeof ComputerUseMouseMoveAction.Type;
|
|
458
747
|
/**
|
|
459
|
-
*
|
|
748
|
+
* Schema for a computer-use action that requests a screenshot of the current display.
|
|
749
|
+
*
|
|
750
|
+
* **When to use**
|
|
751
|
+
*
|
|
752
|
+
* Use to validate or construct a computer-use tool action that asks the handler
|
|
753
|
+
* to capture the full current display.
|
|
754
|
+
*
|
|
755
|
+
* **Details**
|
|
756
|
+
*
|
|
757
|
+
* The payload contains only `action: "screenshot"` and does not include
|
|
758
|
+
* coordinates or other options.
|
|
759
|
+
*
|
|
760
|
+
* @see {@link ComputerUseZoomAction} for requesting a zoomed-in screenshot of a specific screen region with the 2025-11-24 computer-use tool
|
|
460
761
|
*
|
|
461
762
|
* @category Computer Use
|
|
462
763
|
* @since 4.0.0
|
|
@@ -472,7 +773,19 @@ export declare const ComputerUseScreenshotAction: Schema.Struct<{
|
|
|
472
773
|
*/
|
|
473
774
|
export type ComputerUseScreenshotAction = typeof ComputerUseScreenshotAction.Type;
|
|
474
775
|
/**
|
|
475
|
-
*
|
|
776
|
+
* Schema for a computer-use action that enters text.
|
|
777
|
+
*
|
|
778
|
+
* **When to use**
|
|
779
|
+
*
|
|
780
|
+
* Use to validate or construct a computer-use action for entering ordinary text
|
|
781
|
+
* strings.
|
|
782
|
+
*
|
|
783
|
+
* **Details**
|
|
784
|
+
*
|
|
785
|
+
* The payload uses `action: "type"` and a `text` string containing the text to
|
|
786
|
+
* enter.
|
|
787
|
+
*
|
|
788
|
+
* @see {@link ComputerUseKeyAction} for key presses and keyboard shortcuts
|
|
476
789
|
*
|
|
477
790
|
* @category Computer Use
|
|
478
791
|
* @since 4.0.0
|
|
@@ -487,12 +800,36 @@ export declare const TypeAction: Schema.Struct<{
|
|
|
487
800
|
/**
|
|
488
801
|
* Computer-use action payload for typing a text string.
|
|
489
802
|
*
|
|
803
|
+
* **Details**
|
|
804
|
+
*
|
|
805
|
+
* The payload uses `action: "type"` and a `text` string containing the text to
|
|
806
|
+
* enter.
|
|
807
|
+
*
|
|
490
808
|
* @category Computer Use
|
|
491
809
|
* @since 4.0.0
|
|
492
810
|
*/
|
|
493
811
|
export type TypeAction = typeof TypeAction.Type;
|
|
494
812
|
/**
|
|
495
|
-
*
|
|
813
|
+
* Schema for a computer-use action that performs a double click.
|
|
814
|
+
*
|
|
815
|
+
* **When to use**
|
|
816
|
+
*
|
|
817
|
+
* Use to validate or construct an Anthropic computer-use payload for double
|
|
818
|
+
* clicking at the current mouse position or at a specific screen coordinate.
|
|
819
|
+
*
|
|
820
|
+
* **Details**
|
|
821
|
+
*
|
|
822
|
+
* The encoded payload uses `action: "double_click"`. The optional
|
|
823
|
+
* `coordinate` field supplies the `[x, y]` pixel position; when omitted, the
|
|
824
|
+
* action uses the current mouse position.
|
|
825
|
+
*
|
|
826
|
+
* **Gotchas**
|
|
827
|
+
*
|
|
828
|
+
* The coordinate schema only checks that the value is a two-number tuple. It
|
|
829
|
+
* does not validate that the point falls within the configured display
|
|
830
|
+
* dimensions.
|
|
831
|
+
*
|
|
832
|
+
* @see {@link ComputerUseLeftClickAction} for performing a single left click
|
|
496
833
|
*
|
|
497
834
|
* @category Computer Use
|
|
498
835
|
* @since 4.0.0
|
|
@@ -515,6 +852,25 @@ export type ComputerUseDoubleClickAction = typeof ComputerUseDoubleClickAction.T
|
|
|
515
852
|
/**
|
|
516
853
|
* Hold a key for a specified duration during computer-use execution.
|
|
517
854
|
*
|
|
855
|
+
* **When to use**
|
|
856
|
+
*
|
|
857
|
+
* Use to keep a keyboard key depressed for a fixed number of seconds in a
|
|
858
|
+
* computer-use action sequence.
|
|
859
|
+
*
|
|
860
|
+
* **Details**
|
|
861
|
+
*
|
|
862
|
+
* The schema describes objects with `action: "hold_key"`, a `text` field
|
|
863
|
+
* containing the key to hold, and a `duration` field containing the number of
|
|
864
|
+
* seconds to hold it.
|
|
865
|
+
*
|
|
866
|
+
* **Gotchas**
|
|
867
|
+
*
|
|
868
|
+
* The schema only checks that `duration` is a number; it does not require a
|
|
869
|
+
* positive value.
|
|
870
|
+
*
|
|
871
|
+
* @see {@link ComputerUseKeyAction} for pressing a key or key combination without holding it
|
|
872
|
+
* @see {@link ComputerUseWaitAction} for pausing between actions without holding a key
|
|
873
|
+
*
|
|
518
874
|
* @category Computer Use
|
|
519
875
|
* @since 4.0.0
|
|
520
876
|
*/
|
|
@@ -532,12 +888,42 @@ export declare const ComputerUseHoldKeyAction: Schema.Struct<{
|
|
|
532
888
|
/**
|
|
533
889
|
* Computer-use action payload for holding a key for a specified duration.
|
|
534
890
|
*
|
|
891
|
+
* **When to use**
|
|
892
|
+
*
|
|
893
|
+
* Use to represent a key that should remain pressed for a measured interval.
|
|
894
|
+
*
|
|
895
|
+
* **Details**
|
|
896
|
+
*
|
|
897
|
+
* Set `action` to `"hold_key"`, `text` to the key to hold, and `duration` to
|
|
898
|
+
* the number of seconds to hold it.
|
|
899
|
+
*
|
|
900
|
+
* @see {@link ComputerUseKeyAction} for a single key press or key combination without a hold duration
|
|
901
|
+
*
|
|
535
902
|
* @category Computer Use
|
|
536
903
|
* @since 4.0.0
|
|
537
904
|
*/
|
|
538
905
|
export type ComputerUseHoldKeyAction = typeof ComputerUseHoldKeyAction.Type;
|
|
539
906
|
/**
|
|
540
|
-
*
|
|
907
|
+
* Schema for a computer-use action that drags with the left mouse button.
|
|
908
|
+
*
|
|
909
|
+
* **When to use**
|
|
910
|
+
*
|
|
911
|
+
* Use to validate or construct an Anthropic computer-use payload for dragging
|
|
912
|
+
* from one screen coordinate to another in a single action.
|
|
913
|
+
*
|
|
914
|
+
* **Details**
|
|
915
|
+
*
|
|
916
|
+
* The encoded payload uses `action: "left_click_drag"` and requires both
|
|
917
|
+
* `start_coordinate` and `coordinate` as `[x, y]` pixel positions.
|
|
918
|
+
*
|
|
919
|
+
* **Gotchas**
|
|
920
|
+
*
|
|
921
|
+
* The coordinate schema only checks that each value is a two-number tuple. It
|
|
922
|
+
* does not validate that either point falls within the configured display
|
|
923
|
+
* dimensions.
|
|
924
|
+
*
|
|
925
|
+
* @see {@link ComputerUseLeftMouseDownAction} for starting a manual drag sequence
|
|
926
|
+
* @see {@link ComputerUseLeftMouseUpAction} for ending a manual drag sequence
|
|
541
927
|
*
|
|
542
928
|
* @category Computer Use
|
|
543
929
|
* @since 4.0.0
|
|
@@ -565,7 +951,7 @@ export type ComputerUseLeftClickDragAction = typeof ComputerUseLeftClickDragActi
|
|
|
565
951
|
*
|
|
566
952
|
* **When to use**
|
|
567
953
|
*
|
|
568
|
-
* Use this for fine-grained click control.
|
|
954
|
+
* Use when you use this for fine-grained click control.
|
|
569
955
|
*
|
|
570
956
|
* @category Computer Use
|
|
571
957
|
* @since 4.0.0
|
|
@@ -590,7 +976,7 @@ export type ComputerUseLeftMouseDownAction = typeof ComputerUseLeftMouseDownActi
|
|
|
590
976
|
*
|
|
591
977
|
* **When to use**
|
|
592
978
|
*
|
|
593
|
-
* Use this for fine-grained click control.
|
|
979
|
+
* Use when you use this for fine-grained click control.
|
|
594
980
|
*
|
|
595
981
|
* @category Computer Use
|
|
596
982
|
* @since 4.0.0
|
|
@@ -611,7 +997,26 @@ export declare const ComputerUseLeftMouseUpAction: Schema.Struct<{
|
|
|
611
997
|
*/
|
|
612
998
|
export type ComputerUseLeftMouseUpAction = typeof ComputerUseLeftMouseUpAction.Type;
|
|
613
999
|
/**
|
|
614
|
-
*
|
|
1000
|
+
* Schema for a computer-use action that performs a middle click.
|
|
1001
|
+
*
|
|
1002
|
+
* **When to use**
|
|
1003
|
+
*
|
|
1004
|
+
* Use to validate or construct a middle-button click action for Anthropic
|
|
1005
|
+
* computer use, optionally targeting a specific screen coordinate.
|
|
1006
|
+
*
|
|
1007
|
+
* **Details**
|
|
1008
|
+
*
|
|
1009
|
+
* The payload must use `action: "middle_click"`. When `coordinate` is omitted,
|
|
1010
|
+
* the click occurs at the current mouse position.
|
|
1011
|
+
*
|
|
1012
|
+
* **Gotchas**
|
|
1013
|
+
*
|
|
1014
|
+
* This action is available in the 2025-01-24 computer-use action set and later;
|
|
1015
|
+
* it is not part of `ComputerUse_20241022`.
|
|
1016
|
+
*
|
|
1017
|
+
* @see {@link ComputerUse_20250124} for the provider-defined tool version that first accepts this action
|
|
1018
|
+
* @see {@link ComputerUseLeftClickAction} for primary-button clicks
|
|
1019
|
+
* @see {@link ComputerUseRightClickAction} for secondary-button clicks
|
|
615
1020
|
*
|
|
616
1021
|
* @category Computer Use
|
|
617
1022
|
* @since 4.0.0
|
|
@@ -632,7 +1037,22 @@ export declare const ComputerUseMiddleClickAction: Schema.Struct<{
|
|
|
632
1037
|
*/
|
|
633
1038
|
export type ComputerUseMiddleClickAction = typeof ComputerUseMiddleClickAction.Type;
|
|
634
1039
|
/**
|
|
635
|
-
*
|
|
1040
|
+
* Schema for a computer-use action that performs a right click, optionally at a
|
|
1041
|
+
* specific screen coordinate.
|
|
1042
|
+
*
|
|
1043
|
+
* **When to use**
|
|
1044
|
+
*
|
|
1045
|
+
* Use to validate or construct the `right_click` action for an Anthropic
|
|
1046
|
+
* computer-use tool call.
|
|
1047
|
+
*
|
|
1048
|
+
* **Details**
|
|
1049
|
+
*
|
|
1050
|
+
* The optional `coordinate` field is an `[x, y]` screen coordinate in pixels.
|
|
1051
|
+
* When omitted, the right click is performed at the current mouse position.
|
|
1052
|
+
*
|
|
1053
|
+
* @see {@link ComputerUse_20250124} for the provider-defined computer-use tool version that introduced this action
|
|
1054
|
+
* @see {@link ComputerUseLeftClickAction} for the corresponding left-click action
|
|
1055
|
+
* @see {@link ComputerUseMiddleClickAction} for the corresponding middle-click action
|
|
636
1056
|
*
|
|
637
1057
|
* @category Computer Use
|
|
638
1058
|
* @since 4.0.0
|
|
@@ -653,7 +1073,24 @@ export declare const ComputerUseRightClickAction: Schema.Struct<{
|
|
|
653
1073
|
*/
|
|
654
1074
|
export type ComputerUseRightClickAction = typeof ComputerUseRightClickAction.Type;
|
|
655
1075
|
/**
|
|
656
|
-
*
|
|
1076
|
+
* Schema for a computer-use scroll action.
|
|
1077
|
+
*
|
|
1078
|
+
* **When to use**
|
|
1079
|
+
*
|
|
1080
|
+
* Use when validating or constructing Anthropic computer-use scroll payloads.
|
|
1081
|
+
*
|
|
1082
|
+
* **Details**
|
|
1083
|
+
*
|
|
1084
|
+
* The encoded payload uses `action: "scroll"`, an optional `coordinate`,
|
|
1085
|
+
* `scroll_direction`, and `scroll_amount`.
|
|
1086
|
+
*
|
|
1087
|
+
* **Gotchas**
|
|
1088
|
+
*
|
|
1089
|
+
* `coordinate` only checks a two-number tuple, and `scroll_amount` is only
|
|
1090
|
+
* `Schema.Number`.
|
|
1091
|
+
*
|
|
1092
|
+
* @see {@link ComputerUse_20250124} for the tool version that accepts this action
|
|
1093
|
+
* @see {@link ScrollDirection} for the accepted direction literals
|
|
657
1094
|
*
|
|
658
1095
|
* @category Computer Use
|
|
659
1096
|
* @since 4.0.0
|
|
@@ -682,7 +1119,26 @@ export declare const ComputerUseScrollAction: Schema.Struct<{
|
|
|
682
1119
|
*/
|
|
683
1120
|
export type ComputerUseScrollAction = typeof ComputerUseScrollAction.Type;
|
|
684
1121
|
/**
|
|
685
|
-
*
|
|
1122
|
+
* Schema for a computer-use triple-click action.
|
|
1123
|
+
*
|
|
1124
|
+
* **When to use**
|
|
1125
|
+
*
|
|
1126
|
+
* Use when validating or constructing Anthropic computer-use triple-click
|
|
1127
|
+
* payloads at the current pointer position or an optional coordinate.
|
|
1128
|
+
*
|
|
1129
|
+
* **Details**
|
|
1130
|
+
*
|
|
1131
|
+
* The encoded payload uses `action: "triple_click"` and an optional
|
|
1132
|
+
* `coordinate`.
|
|
1133
|
+
*
|
|
1134
|
+
* **Gotchas**
|
|
1135
|
+
*
|
|
1136
|
+
* `coordinate` only validates as a two-number tuple and does not check display
|
|
1137
|
+
* bounds.
|
|
1138
|
+
*
|
|
1139
|
+
* @see {@link ComputerUse_20250124} for the tool version that accepts this action
|
|
1140
|
+
* @see {@link ComputerUseDoubleClickAction} for the two-click variant
|
|
1141
|
+
* @see {@link ComputerUseLeftClickAction} for a single left click
|
|
686
1142
|
*
|
|
687
1143
|
* @category Computer Use
|
|
688
1144
|
* @since 4.0.0
|
|
@@ -703,7 +1159,25 @@ export declare const ComputerUseTripleClickAction: Schema.Struct<{
|
|
|
703
1159
|
*/
|
|
704
1160
|
export type ComputerUseTripleClickAction = typeof ComputerUseTripleClickAction.Type;
|
|
705
1161
|
/**
|
|
706
|
-
*
|
|
1162
|
+
* Schema for a computer-use wait action.
|
|
1163
|
+
*
|
|
1164
|
+
* **When to use**
|
|
1165
|
+
*
|
|
1166
|
+
* Use when validating or constructing Anthropic computer-use payloads that pause
|
|
1167
|
+
* between actions.
|
|
1168
|
+
*
|
|
1169
|
+
* **Details**
|
|
1170
|
+
*
|
|
1171
|
+
* The encoded payload uses `action: "wait"` and a required `duration` in
|
|
1172
|
+
* seconds.
|
|
1173
|
+
*
|
|
1174
|
+
* **Gotchas**
|
|
1175
|
+
*
|
|
1176
|
+
* `duration` is only `Schema.Number`; it is not constrained to positive or
|
|
1177
|
+
* finite values.
|
|
1178
|
+
*
|
|
1179
|
+
* @see {@link ComputerUseHoldKeyAction} for another duration-based computer-use action
|
|
1180
|
+
* @see {@link ComputerUse_20250124} for the tool version that accepts this action
|
|
707
1181
|
*
|
|
708
1182
|
* @category Computer Use
|
|
709
1183
|
* @since 4.0.0
|
|
@@ -727,7 +1201,15 @@ export type ComputerUseWaitAction = typeof ComputerUseWaitAction.Type;
|
|
|
727
1201
|
*
|
|
728
1202
|
* **Details**
|
|
729
1203
|
*
|
|
730
|
-
*
|
|
1204
|
+
* The encoded payload uses `action: "zoom"` and a `region` tuple.
|
|
1205
|
+
*
|
|
1206
|
+
* **Gotchas**
|
|
1207
|
+
*
|
|
1208
|
+
* Requires `enableZoom: true` in the tool definition. `region` is only a
|
|
1209
|
+
* four-number tuple and does not validate corner ordering or display bounds.
|
|
1210
|
+
*
|
|
1211
|
+
* @see {@link ComputerUse_20251124} for the tool version that accepts this action
|
|
1212
|
+
* @see {@link ComputerUseScreenshotAction} for capturing the full screen instead
|
|
731
1213
|
*
|
|
732
1214
|
* @category Computer Use
|
|
733
1215
|
* @since 4.0.0
|
|
@@ -743,9 +1225,11 @@ export declare const ComputerUseZoomAction: Schema.Struct<{
|
|
|
743
1225
|
/**
|
|
744
1226
|
* Computer-use action payload for zooming into a specific screen region.
|
|
745
1227
|
*
|
|
746
|
-
* **
|
|
1228
|
+
* **Gotchas**
|
|
747
1229
|
*
|
|
748
1230
|
* The enclosing computer-use tool must be configured with `enableZoom: true`.
|
|
1231
|
+
* `region` is only a four-number tuple and does not validate corner ordering or
|
|
1232
|
+
* display bounds.
|
|
749
1233
|
*
|
|
750
1234
|
* @category Computer Use
|
|
751
1235
|
* @since 4.0.0
|
|
@@ -819,6 +1303,11 @@ export declare const ComputerUse_20241022: <Mode extends Tool.FailureMode | unde
|
|
|
819
1303
|
/**
|
|
820
1304
|
* Computer use tool for Claude 4 models and Claude Sonnet 3.7.
|
|
821
1305
|
*
|
|
1306
|
+
* **When to use**
|
|
1307
|
+
*
|
|
1308
|
+
* Use when configuring Anthropic computer use for Claude 4 models or Claude
|
|
1309
|
+
* Sonnet 3.7 with the 2025-01-24 action set.
|
|
1310
|
+
*
|
|
822
1311
|
* **Details**
|
|
823
1312
|
*
|
|
824
1313
|
* Requires the "computer-use-2025-01-24" beta header.
|
|
@@ -826,6 +1315,9 @@ export declare const ComputerUse_20241022: <Mode extends Tool.FailureMode | unde
|
|
|
826
1315
|
* right_click, middle_click, double_click, triple_click, left_mouse_down,
|
|
827
1316
|
* left_mouse_up, hold_key, wait.
|
|
828
1317
|
*
|
|
1318
|
+
* @see {@link ComputerUse_20241022} for the older basic action set
|
|
1319
|
+
* @see {@link ComputerUse_20251124} for the newer zoom-capable version
|
|
1320
|
+
*
|
|
829
1321
|
* @category Computer Use
|
|
830
1322
|
* @since 4.0.0
|
|
831
1323
|
*/
|
|
@@ -969,11 +1461,23 @@ export declare const ComputerUse_20250124: <Mode extends Tool.FailureMode | unde
|
|
|
969
1461
|
/**
|
|
970
1462
|
* Computer use tool for Claude Opus 4.5 only.
|
|
971
1463
|
*
|
|
1464
|
+
* **When to use**
|
|
1465
|
+
*
|
|
1466
|
+
* Use when configuring Anthropic computer use for Claude Opus 4.5 with the
|
|
1467
|
+
* 2025-11-24 action set and zoom-capable screen inspection.
|
|
1468
|
+
*
|
|
972
1469
|
* **Details**
|
|
973
1470
|
*
|
|
974
1471
|
* Requires the "computer-use-2025-11-24" beta header.
|
|
975
1472
|
* Includes all actions from computer_20250124 plus the zoom action for
|
|
976
|
-
* detailed screen region inspection.
|
|
1473
|
+
* detailed screen region inspection.
|
|
1474
|
+
*
|
|
1475
|
+
* **Gotchas**
|
|
1476
|
+
*
|
|
1477
|
+
* Zoom actions require `enableZoom: true` in args.
|
|
1478
|
+
*
|
|
1479
|
+
* @see {@link ComputerUse_20250124} for the previous action set without zoom
|
|
1480
|
+
* @see {@link ComputerUseZoomAction} for the zoom action payload
|
|
977
1481
|
*
|
|
978
1482
|
* @category Computer Use
|
|
979
1483
|
* @since 4.0.0
|
|
@@ -1127,12 +1631,20 @@ export declare const ComputerUse_20251124: <Mode extends Tool.FailureMode | unde
|
|
|
1127
1631
|
/**
|
|
1128
1632
|
* A `[start, end]` line range for viewing file contents.
|
|
1129
1633
|
*
|
|
1634
|
+
* **When to use**
|
|
1635
|
+
*
|
|
1636
|
+
* Use when constructing or validating `view_range` for memory or text editor
|
|
1637
|
+
* view commands.
|
|
1638
|
+
*
|
|
1130
1639
|
* **Details**
|
|
1131
1640
|
*
|
|
1132
|
-
* Lines are 1-indexed. Use
|
|
1641
|
+
* Lines are 1-indexed. Use `-1` for end to read to the end of the file. For
|
|
1133
1642
|
* example, `[1, 50]` views lines 1-50 and `[100, -1]` views from line 100 to
|
|
1134
1643
|
* the end of the file.
|
|
1135
1644
|
*
|
|
1645
|
+
* @see {@link MemoryViewCommand} for memory view payloads that use this range
|
|
1646
|
+
* @see {@link TextEditorViewCommand} for text editor view payloads that use this range
|
|
1647
|
+
*
|
|
1136
1648
|
* @category Memory
|
|
1137
1649
|
* @since 4.0.0
|
|
1138
1650
|
*/
|
|
@@ -1140,12 +1652,20 @@ export declare const ViewRange: Schema.Tuple<readonly [Schema.Number, Schema.Num
|
|
|
1140
1652
|
/**
|
|
1141
1653
|
* A `[start, end]` 1-indexed line range for viewing file contents, using `-1` as the end value to read through the end of the file.
|
|
1142
1654
|
*
|
|
1655
|
+
* **When to use**
|
|
1656
|
+
*
|
|
1657
|
+
* Use when typing `view_range` for memory or text editor view commands.
|
|
1658
|
+
*
|
|
1143
1659
|
* @category Memory
|
|
1144
1660
|
* @since 4.0.0
|
|
1145
1661
|
*/
|
|
1146
1662
|
export type ViewRange = typeof ViewRange.Type;
|
|
1147
1663
|
/**
|
|
1148
|
-
*
|
|
1664
|
+
* Schema for the memory tool command that creates a new file at a path.
|
|
1665
|
+
*
|
|
1666
|
+
* **Details**
|
|
1667
|
+
*
|
|
1668
|
+
* The payload contains `command: "create"` and a `path` string.
|
|
1149
1669
|
*
|
|
1150
1670
|
* @category Memory
|
|
1151
1671
|
* @since 4.0.0
|
|
@@ -1165,7 +1685,7 @@ export declare const MemoryCreateCommand: Schema.Struct<{
|
|
|
1165
1685
|
*/
|
|
1166
1686
|
export type MemoryCreateCommand = typeof MemoryCreateCommand.Type;
|
|
1167
1687
|
/**
|
|
1168
|
-
*
|
|
1688
|
+
* Schema for a memory command that deletes a file or directory.
|
|
1169
1689
|
*
|
|
1170
1690
|
* @category Memory
|
|
1171
1691
|
* @since 4.0.0
|
|
@@ -1173,7 +1693,7 @@ export type MemoryCreateCommand = typeof MemoryCreateCommand.Type;
|
|
|
1173
1693
|
export declare const MemoryDeleteCommand: Schema.Struct<{
|
|
1174
1694
|
readonly command: Schema.Literal<"delete">;
|
|
1175
1695
|
/**
|
|
1176
|
-
* The path to the file to delete.
|
|
1696
|
+
* The path to the file or directory to delete.
|
|
1177
1697
|
*/
|
|
1178
1698
|
readonly path: Schema.String;
|
|
1179
1699
|
}>;
|
|
@@ -1185,7 +1705,19 @@ export declare const MemoryDeleteCommand: Schema.Struct<{
|
|
|
1185
1705
|
*/
|
|
1186
1706
|
export type MemoryDeleteCommand = typeof MemoryDeleteCommand.Type;
|
|
1187
1707
|
/**
|
|
1188
|
-
*
|
|
1708
|
+
* Schema for the memory `insert` command.
|
|
1709
|
+
*
|
|
1710
|
+
* **When to use**
|
|
1711
|
+
*
|
|
1712
|
+
* Use when validating or constructing `insert` payloads for `Memory_20250818`.
|
|
1713
|
+
*
|
|
1714
|
+
* **Details**
|
|
1715
|
+
*
|
|
1716
|
+
* The payload is discriminated by `command: "insert"` and requires `path`,
|
|
1717
|
+
* `insert_line`, and `insert_text`.
|
|
1718
|
+
*
|
|
1719
|
+
* @see {@link Memory_20250818} for the provider-defined tool that consumes this command
|
|
1720
|
+
* @see {@link MemoryStrReplaceCommand} for replacing existing text instead
|
|
1189
1721
|
*
|
|
1190
1722
|
* @category Memory
|
|
1191
1723
|
* @since 4.0.0
|
|
@@ -1213,7 +1745,12 @@ export declare const MemoryInsertCommand: Schema.Struct<{
|
|
|
1213
1745
|
*/
|
|
1214
1746
|
export type MemoryInsertCommand = typeof MemoryInsertCommand.Type;
|
|
1215
1747
|
/**
|
|
1216
|
-
*
|
|
1748
|
+
* Schema for the memory command that renames or moves a file or directory.
|
|
1749
|
+
*
|
|
1750
|
+
* **Details**
|
|
1751
|
+
*
|
|
1752
|
+
* The payload uses `command: "rename"` and requires `old_path` as the current
|
|
1753
|
+
* path plus `new_path` as the new destination path.
|
|
1217
1754
|
*
|
|
1218
1755
|
* @category Memory
|
|
1219
1756
|
* @since 4.0.0
|
|
@@ -1237,7 +1774,19 @@ export declare const MemoryRenameCommand: Schema.Struct<{
|
|
|
1237
1774
|
*/
|
|
1238
1775
|
export type MemoryRenameCommand = typeof MemoryRenameCommand.Type;
|
|
1239
1776
|
/**
|
|
1240
|
-
*
|
|
1777
|
+
* Schema for the memory `str_replace` command.
|
|
1778
|
+
*
|
|
1779
|
+
* **When to use**
|
|
1780
|
+
*
|
|
1781
|
+
* Use when validating or constructing `str_replace` payloads for
|
|
1782
|
+
* `Memory_20250818`.
|
|
1783
|
+
*
|
|
1784
|
+
* **Details**
|
|
1785
|
+
*
|
|
1786
|
+
* The payload is discriminated by `command: "str_replace"` and requires `path`,
|
|
1787
|
+
* `old_str`, and `new_str`.
|
|
1788
|
+
*
|
|
1789
|
+
* @see {@link Memory_20250818} for the provider-defined tool that consumes this command
|
|
1241
1790
|
*
|
|
1242
1791
|
* @category Memory
|
|
1243
1792
|
* @since 4.0.0
|
|
@@ -1267,13 +1816,18 @@ export type MemoryStrReplaceCommand = typeof MemoryStrReplaceCommand.Type;
|
|
|
1267
1816
|
/**
|
|
1268
1817
|
* Shows directory contents or file contents with optional line ranges.
|
|
1269
1818
|
*
|
|
1819
|
+
* **Details**
|
|
1820
|
+
*
|
|
1821
|
+
* When used on a file, returns file contents optionally limited by `view_range`.
|
|
1822
|
+
* When used on a directory, lists contents.
|
|
1823
|
+
*
|
|
1270
1824
|
* @category Memory
|
|
1271
1825
|
* @since 4.0.0
|
|
1272
1826
|
*/
|
|
1273
1827
|
export declare const MemoryViewCommand: Schema.Struct<{
|
|
1274
1828
|
readonly command: Schema.Literal<"view">;
|
|
1275
1829
|
/**
|
|
1276
|
-
* The path to the file to view.
|
|
1830
|
+
* The path to the file or directory to view.
|
|
1277
1831
|
*/
|
|
1278
1832
|
readonly path: Schema.String;
|
|
1279
1833
|
/**
|
|
@@ -1310,7 +1864,7 @@ export declare const Memory_20250818: <Mode extends Tool.FailureMode | undefined
|
|
|
1310
1864
|
}>, Schema.Struct<{
|
|
1311
1865
|
readonly command: Schema.Literal<"delete">;
|
|
1312
1866
|
/**
|
|
1313
|
-
* The path to the file to delete.
|
|
1867
|
+
* The path to the file or directory to delete.
|
|
1314
1868
|
*/
|
|
1315
1869
|
readonly path: Schema.String;
|
|
1316
1870
|
}>, Schema.Struct<{
|
|
@@ -1354,7 +1908,7 @@ export declare const Memory_20250818: <Mode extends Tool.FailureMode | undefined
|
|
|
1354
1908
|
}>, Schema.Struct<{
|
|
1355
1909
|
readonly command: Schema.Literal<"view">;
|
|
1356
1910
|
/**
|
|
1357
|
-
* The path to the file to view.
|
|
1911
|
+
* The path to the file or directory to view.
|
|
1358
1912
|
*/
|
|
1359
1913
|
readonly path: Schema.String;
|
|
1360
1914
|
/**
|
|
@@ -1369,10 +1923,19 @@ export declare const Memory_20250818: <Mode extends Tool.FailureMode | undefined
|
|
|
1369
1923
|
/**
|
|
1370
1924
|
* View the contents of a file or list directory contents.
|
|
1371
1925
|
*
|
|
1926
|
+
* **When to use**
|
|
1927
|
+
*
|
|
1928
|
+
* Use when validating or constructing the standalone Anthropic Text Editor
|
|
1929
|
+
* `view` command.
|
|
1930
|
+
*
|
|
1372
1931
|
* **Details**
|
|
1373
1932
|
*
|
|
1374
1933
|
* When used on a file, returns the file contents, optionally limited to a line
|
|
1375
1934
|
* range. When used on a directory, lists all files and subdirectories.
|
|
1935
|
+
* `view_range` is a 1-indexed `[start, end]` tuple where `-1` means through
|
|
1936
|
+
* the end of the file.
|
|
1937
|
+
*
|
|
1938
|
+
* @see {@link CodeExecutionTextEditorView} for the code-execution variant without `view_range`
|
|
1376
1939
|
*
|
|
1377
1940
|
* @category Text Editor
|
|
1378
1941
|
* @since 4.0.0
|
|
@@ -1392,6 +1955,11 @@ export declare const TextEditorViewCommand: Schema.Struct<{
|
|
|
1392
1955
|
/**
|
|
1393
1956
|
* Text editor command payload for viewing file contents or listing directory contents.
|
|
1394
1957
|
*
|
|
1958
|
+
* **Details**
|
|
1959
|
+
*
|
|
1960
|
+
* `view_range` is a 1-indexed `[start, end]` tuple where `-1` means through
|
|
1961
|
+
* the end of the file.
|
|
1962
|
+
*
|
|
1395
1963
|
* @category Text Editor
|
|
1396
1964
|
* @since 4.0.0
|
|
1397
1965
|
*/
|
|
@@ -1399,6 +1967,16 @@ export type TextEditorViewCommand = typeof TextEditorViewCommand.Type;
|
|
|
1399
1967
|
/**
|
|
1400
1968
|
* Create a new file with specified content.
|
|
1401
1969
|
*
|
|
1970
|
+
* **When to use**
|
|
1971
|
+
*
|
|
1972
|
+
* Use when validating or constructing an Anthropic text editor `create`
|
|
1973
|
+
* command.
|
|
1974
|
+
*
|
|
1975
|
+
* **Details**
|
|
1976
|
+
*
|
|
1977
|
+
* The payload is discriminated by `command: "create"` and requires both `path`
|
|
1978
|
+
* and `file_text`.
|
|
1979
|
+
*
|
|
1402
1980
|
* **Gotchas**
|
|
1403
1981
|
*
|
|
1404
1982
|
* Fails if the file already exists. Parent directories must exist.
|
|
@@ -1431,11 +2009,24 @@ export type TextEditorCreateCommand = typeof TextEditorCreateCommand.Type;
|
|
|
1431
2009
|
/**
|
|
1432
2010
|
* Replace a specific string in a file with a new string.
|
|
1433
2011
|
*
|
|
2012
|
+
* **When to use**
|
|
2013
|
+
*
|
|
2014
|
+
* Use when validating or constructing standalone Anthropic text editor
|
|
2015
|
+
* `str_replace` commands.
|
|
2016
|
+
*
|
|
2017
|
+
* **Details**
|
|
2018
|
+
*
|
|
2019
|
+
* The payload uses `command: "str_replace"`, `path`, `old_str`, and `new_str`.
|
|
2020
|
+
* `new_str` may be empty to delete text.
|
|
2021
|
+
*
|
|
1434
2022
|
* **Gotchas**
|
|
1435
2023
|
*
|
|
1436
2024
|
* The `old_str` must match exactly (including whitespace and indentation)
|
|
1437
2025
|
* and must be unique in the file.
|
|
1438
2026
|
*
|
|
2027
|
+
* @see {@link TextEditorViewCommand} for reading contents before choosing `old_str`
|
|
2028
|
+
* @see {@link CodeExecutionTextEditorStrReplace} for the code-execution variant
|
|
2029
|
+
*
|
|
1439
2030
|
* @category Text Editor
|
|
1440
2031
|
* @since 4.0.0
|
|
1441
2032
|
*/
|
|
@@ -1457,6 +2048,11 @@ export declare const TextEditorStrReplaceCommand: Schema.Struct<{
|
|
|
1457
2048
|
/**
|
|
1458
2049
|
* Text editor command payload for replacing one exact, unique string in a file.
|
|
1459
2050
|
*
|
|
2051
|
+
* **Gotchas**
|
|
2052
|
+
*
|
|
2053
|
+
* The `old_str` must match exactly, including whitespace and indentation, and
|
|
2054
|
+
* must be unique in the file.
|
|
2055
|
+
*
|
|
1460
2056
|
* @category Text Editor
|
|
1461
2057
|
* @since 4.0.0
|
|
1462
2058
|
*/
|
|
@@ -1466,7 +2062,8 @@ export type TextEditorStrReplaceCommand = typeof TextEditorStrReplaceCommand.Typ
|
|
|
1466
2062
|
*
|
|
1467
2063
|
* **Details**
|
|
1468
2064
|
*
|
|
1469
|
-
* Inserts the new text
|
|
2065
|
+
* Inserts the new text after the specified line number. Use `0` to insert at
|
|
2066
|
+
* the beginning of the file; other values are 1-indexed.
|
|
1470
2067
|
*
|
|
1471
2068
|
* @category Text Editor
|
|
1472
2069
|
* @since 4.0.0
|
|
@@ -1498,12 +2095,14 @@ export type TextEditorInsertCommand = typeof TextEditorInsertCommand.Type;
|
|
|
1498
2095
|
*
|
|
1499
2096
|
* **Details**
|
|
1500
2097
|
*
|
|
1501
|
-
* Reverts the most recent str_replace
|
|
2098
|
+
* Reverts the most recent `str_replace`, `insert`, or `create` operation on the
|
|
2099
|
+
* file.
|
|
1502
2100
|
*
|
|
1503
2101
|
* **Gotchas**
|
|
1504
2102
|
*
|
|
1505
|
-
* This command is available in text_editor_20241022 and
|
|
1506
|
-
* but not in
|
|
2103
|
+
* This command is available in `text_editor_20241022` and
|
|
2104
|
+
* `text_editor_20250124`, but not in `text_editor_20250429` or
|
|
2105
|
+
* `text_editor_20250728`.
|
|
1507
2106
|
*
|
|
1508
2107
|
* @category Text Editor
|
|
1509
2108
|
* @since 4.0.0
|
|
@@ -1520,7 +2119,8 @@ export declare const TextEditorUndoEditCommand: Schema.Struct<{
|
|
|
1520
2119
|
*
|
|
1521
2120
|
* **Gotchas**
|
|
1522
2121
|
*
|
|
1523
|
-
* Available for `text_editor_20241022` and `text_editor_20250124`, but not for
|
|
2122
|
+
* Available for `text_editor_20241022` and `text_editor_20250124`, but not for
|
|
2123
|
+
* `text_editor_20250429` or `text_editor_20250728`.
|
|
1524
2124
|
*
|
|
1525
2125
|
* @category Text Editor
|
|
1526
2126
|
* @since 4.0.0
|
|
@@ -1529,9 +2129,18 @@ export type TextEditorUndoEditCommand = typeof TextEditorUndoEditCommand.Type;
|
|
|
1529
2129
|
/**
|
|
1530
2130
|
* Text editor tool for Claude 3.5 Sonnet (deprecated).
|
|
1531
2131
|
*
|
|
2132
|
+
* **When to use**
|
|
2133
|
+
*
|
|
2134
|
+
* Use when configuring the 2024-10-22 `str_replace_editor` compatibility path
|
|
2135
|
+
* for Claude 3.5 Sonnet.
|
|
2136
|
+
*
|
|
1532
2137
|
* **Details**
|
|
1533
2138
|
*
|
|
1534
|
-
* Requires the "computer-use-2024-10-22" beta header
|
|
2139
|
+
* Requires the "computer-use-2024-10-22" beta header and supports `view`,
|
|
2140
|
+
* `create`, `str_replace`, `insert`, and `undo_edit` commands.
|
|
2141
|
+
*
|
|
2142
|
+
* @see {@link TextEditor_20250124} for the newer `str_replace_editor` version
|
|
2143
|
+
* @see {@link TextEditor_20250728} for the Claude 4 `str_replace_based_edit_tool` line
|
|
1535
2144
|
*
|
|
1536
2145
|
* @category Text Editor
|
|
1537
2146
|
* @since 4.0.0
|
|
@@ -1603,9 +2212,18 @@ export declare const TextEditor_20241022: <Mode extends Tool.FailureMode | undef
|
|
|
1603
2212
|
/**
|
|
1604
2213
|
* Text editor tool for Claude Sonnet 3.7 (deprecated model).
|
|
1605
2214
|
*
|
|
2215
|
+
* **When to use**
|
|
2216
|
+
*
|
|
2217
|
+
* Use when configuring the 2025-01-24 Claude Sonnet 3.7 text editor tool using
|
|
2218
|
+
* `str_replace_editor`.
|
|
2219
|
+
*
|
|
1606
2220
|
* **Details**
|
|
1607
2221
|
*
|
|
1608
|
-
* Requires the "computer-use-2025-01-24" beta header
|
|
2222
|
+
* Requires the "computer-use-2025-01-24" beta header, requires a handler, and
|
|
2223
|
+
* supports `view`, `create`, `str_replace`, `insert`, and `undo_edit` commands.
|
|
2224
|
+
*
|
|
2225
|
+
* @see {@link TextEditor_20241022} for the older `str_replace_editor` version
|
|
2226
|
+
* @see {@link TextEditor_20250429} for the Claude 4 `str_replace_based_edit_tool` line
|
|
1609
2227
|
*
|
|
1610
2228
|
* @category Text Editor
|
|
1611
2229
|
* @since 4.0.0
|
|
@@ -1677,6 +2295,11 @@ export declare const TextEditor_20250124: <Mode extends Tool.FailureMode | undef
|
|
|
1677
2295
|
/**
|
|
1678
2296
|
* Text editor tool for Claude 4 models using Anthropic's `str_replace_based_edit_tool`.
|
|
1679
2297
|
*
|
|
2298
|
+
* **When to use**
|
|
2299
|
+
*
|
|
2300
|
+
* Use when configuring the 2025-04-29 Claude 4 `str_replace_based_edit_tool`
|
|
2301
|
+
* version.
|
|
2302
|
+
*
|
|
1680
2303
|
* **Details**
|
|
1681
2304
|
*
|
|
1682
2305
|
* Requires the "computer-use-2025-01-24" beta header.
|
|
@@ -1685,6 +2308,9 @@ export declare const TextEditor_20250124: <Mode extends Tool.FailureMode | undef
|
|
|
1685
2308
|
*
|
|
1686
2309
|
* This version does not support the `undo_edit` command.
|
|
1687
2310
|
*
|
|
2311
|
+
* @see {@link TextEditor_20250124} for the previous `str_replace_editor` version
|
|
2312
|
+
* @see {@link TextEditor_20250728} for the later Claude 4 text editor version
|
|
2313
|
+
*
|
|
1688
2314
|
* @category Text Editor
|
|
1689
2315
|
* @since 4.0.0
|
|
1690
2316
|
*/
|
|
@@ -1756,6 +2382,11 @@ export declare const TextEditor_20250429: <Mode extends Tool.FailureMode | undef
|
|
|
1756
2382
|
/**
|
|
1757
2383
|
* Text editor tool for Claude 4 models.
|
|
1758
2384
|
*
|
|
2385
|
+
* **Details**
|
|
2386
|
+
*
|
|
2387
|
+
* Uses Anthropic's `str_replace_based_edit_tool`. `max_characters` can limit
|
|
2388
|
+
* file-view output for this version.
|
|
2389
|
+
*
|
|
1759
2390
|
* **Gotchas**
|
|
1760
2391
|
*
|
|
1761
2392
|
* This version does not support the `undo_edit` command.
|
|
@@ -1833,8 +2464,16 @@ export declare const TextEditor_20250728: <Mode extends Tool.FailureMode | undef
|
|
|
1833
2464
|
*
|
|
1834
2465
|
* **When to use**
|
|
1835
2466
|
*
|
|
1836
|
-
*
|
|
1837
|
-
* queries like weather, local businesses, events
|
|
2467
|
+
* Use when providing location helps return more relevant results for
|
|
2468
|
+
* location-dependent queries like weather, local businesses, or events.
|
|
2469
|
+
*
|
|
2470
|
+
* **Details**
|
|
2471
|
+
*
|
|
2472
|
+
* The schema uses `type: "approximate"` plus optional `city`, `region`,
|
|
2473
|
+
* `country`, and `timezone`. `country` is an ISO 3166-1 alpha-2 code, and
|
|
2474
|
+
* `timezone` is an IANA time zone identifier.
|
|
2475
|
+
*
|
|
2476
|
+
* @see {@link WebSearch_20250305_Args} for the argument schema that consumes this location
|
|
1838
2477
|
*
|
|
1839
2478
|
* @category Web Search
|
|
1840
2479
|
* @since 4.0.0
|
|
@@ -1864,6 +2503,23 @@ export declare const WebSearchUserLocation: Schema.Struct<{
|
|
|
1864
2503
|
/**
|
|
1865
2504
|
* Configuration arguments for the web search tool.
|
|
1866
2505
|
*
|
|
2506
|
+
* **When to use**
|
|
2507
|
+
*
|
|
2508
|
+
* Use when configuring `WebSearch_20250305` with search limits, domain filters,
|
|
2509
|
+
* or user location.
|
|
2510
|
+
*
|
|
2511
|
+
* **Details**
|
|
2512
|
+
*
|
|
2513
|
+
* The payload can set `maxUses`, `allowedDomains`, `blockedDomains`, and
|
|
2514
|
+
* `userLocation`.
|
|
2515
|
+
*
|
|
2516
|
+
* **Gotchas**
|
|
2517
|
+
*
|
|
2518
|
+
* `allowedDomains` and `blockedDomains` are mutually exclusive.
|
|
2519
|
+
*
|
|
2520
|
+
* @see {@link WebSearch_20250305} for the provider-defined tool that consumes these arguments
|
|
2521
|
+
* @see {@link WebSearchUserLocation} for localizing search results
|
|
2522
|
+
*
|
|
1867
2523
|
* @category Web Search
|
|
1868
2524
|
* @since 4.0.0
|
|
1869
2525
|
*/
|
|
@@ -1913,12 +2569,23 @@ export declare const WebSearch_20250305_Args: Schema.Struct<{
|
|
|
1913
2569
|
/**
|
|
1914
2570
|
* Configuration arguments for the Anthropic web search tool, including usage limits, domain filters, and optional user location.
|
|
1915
2571
|
*
|
|
2572
|
+
* **Gotchas**
|
|
2573
|
+
*
|
|
2574
|
+
* `allowedDomains` and `blockedDomains` are mutually exclusive.
|
|
2575
|
+
*
|
|
1916
2576
|
* @category Web Search
|
|
1917
2577
|
* @since 4.0.0
|
|
1918
2578
|
*/
|
|
1919
2579
|
export type WebSearch_20250305_Args = typeof WebSearch_20250305_Args.Type;
|
|
1920
2580
|
/**
|
|
1921
|
-
*
|
|
2581
|
+
* Schema for Claude-supplied web search tool parameters.
|
|
2582
|
+
*
|
|
2583
|
+
* **Details**
|
|
2584
|
+
*
|
|
2585
|
+
* The payload contains the generated `query` string and is consumed by
|
|
2586
|
+
* `WebSearch_20250305`.
|
|
2587
|
+
*
|
|
2588
|
+
* @see {@link WebSearch_20250305} for the provider-defined tool that consumes this payload
|
|
1922
2589
|
*
|
|
1923
2590
|
* @category Web Search
|
|
1924
2591
|
* @since 4.0.0
|
|
@@ -1936,6 +2603,8 @@ export declare const WebSearchParameters: Schema.Struct<{
|
|
|
1936
2603
|
*
|
|
1937
2604
|
* Contains the generated search query used by `WebSearch_20250305`.
|
|
1938
2605
|
*
|
|
2606
|
+
* @see {@link WebSearch_20250305} for the provider-defined tool that consumes this payload
|
|
2607
|
+
*
|
|
1939
2608
|
* @category Web Search
|
|
1940
2609
|
* @since 4.0.0
|
|
1941
2610
|
*/
|
|
@@ -1943,12 +2612,18 @@ export type WebSearchParameters = typeof WebSearchParameters.Type;
|
|
|
1943
2612
|
/**
|
|
1944
2613
|
* Web search tool for Claude models.
|
|
1945
2614
|
*
|
|
2615
|
+
* **When to use**
|
|
2616
|
+
*
|
|
2617
|
+
* Use when Claude should search the web for real-time information.
|
|
2618
|
+
*
|
|
1946
2619
|
* **Details**
|
|
1947
2620
|
*
|
|
1948
2621
|
* Enables Claude to search the web for real-time information. This is a
|
|
1949
2622
|
* server-side tool executed by Anthropic's infrastructure.
|
|
1950
2623
|
* Generally available (no beta header required).
|
|
1951
2624
|
*
|
|
2625
|
+
* @see {@link WebFetch_20250910} for retrieving known URLs after discovery
|
|
2626
|
+
*
|
|
1952
2627
|
* @category Web Search
|
|
1953
2628
|
* @since 4.0.0
|
|
1954
2629
|
*/
|
|
@@ -2029,6 +2704,17 @@ export declare const WebSearch_20250305: <Mode extends Tool.FailureMode | undefi
|
|
|
2029
2704
|
/**
|
|
2030
2705
|
* Citation configuration for web fetch.
|
|
2031
2706
|
*
|
|
2707
|
+
* **When to use**
|
|
2708
|
+
*
|
|
2709
|
+
* Use when configuring whether web fetch results should include citations.
|
|
2710
|
+
*
|
|
2711
|
+
* **Details**
|
|
2712
|
+
*
|
|
2713
|
+
* The payload contains the `enabled` flag. `citations` is optional on
|
|
2714
|
+
* `WebFetch_20250910_Args`, and citations are disabled by default.
|
|
2715
|
+
*
|
|
2716
|
+
* @see {@link WebFetch_20250910_Args} for the argument schema that consumes this configuration
|
|
2717
|
+
*
|
|
2032
2718
|
* @category Web Fetch
|
|
2033
2719
|
* @since 4.0.0
|
|
2034
2720
|
*/
|
|
@@ -2041,6 +2727,13 @@ export declare const WebFetchCitationsConfig: Schema.Struct<{
|
|
|
2041
2727
|
/**
|
|
2042
2728
|
* Configuration payload for enabling or disabling citations on web fetch results.
|
|
2043
2729
|
*
|
|
2730
|
+
* **Details**
|
|
2731
|
+
*
|
|
2732
|
+
* The payload contains the `enabled` flag. `citations` is optional on
|
|
2733
|
+
* `WebFetch_20250910_Args`, and citations are disabled by default.
|
|
2734
|
+
*
|
|
2735
|
+
* @see {@link WebFetch_20250910_Args} for the argument schema that consumes this configuration
|
|
2736
|
+
*
|
|
2044
2737
|
* @category Web Fetch
|
|
2045
2738
|
* @since 4.0.0
|
|
2046
2739
|
*/
|
|
@@ -2048,6 +2741,25 @@ export type WebFetchCitationsConfig = typeof WebFetchCitationsConfig.Type;
|
|
|
2048
2741
|
/**
|
|
2049
2742
|
* Configuration arguments for the web fetch tool.
|
|
2050
2743
|
*
|
|
2744
|
+
* **When to use**
|
|
2745
|
+
*
|
|
2746
|
+
* Use when configuring `WebFetch_20250910` with usage limits, domain filters,
|
|
2747
|
+
* citations, or content token limits.
|
|
2748
|
+
*
|
|
2749
|
+
* **Details**
|
|
2750
|
+
*
|
|
2751
|
+
* The payload can set `maxUses`, domain filters, `citations`, and
|
|
2752
|
+
* `maxContentTokens`, which map to Anthropic web fetch request fields.
|
|
2753
|
+
*
|
|
2754
|
+
* **Gotchas**
|
|
2755
|
+
*
|
|
2756
|
+
* `allowedDomains` and `blockedDomains` are mutually exclusive.
|
|
2757
|
+
* `maxContentTokens` is approximate and does not apply to binary content such
|
|
2758
|
+
* as PDFs.
|
|
2759
|
+
*
|
|
2760
|
+
* @see {@link WebFetch_20250910} for the provider-defined tool that consumes these arguments
|
|
2761
|
+
* @see {@link WebFetchCitationsConfig} for configuring citations
|
|
2762
|
+
*
|
|
2051
2763
|
* @category Web Fetch
|
|
2052
2764
|
* @since 4.0.0
|
|
2053
2765
|
*/
|
|
@@ -2085,12 +2797,34 @@ export declare const WebFetch_20250910_Args: Schema.Struct<{
|
|
|
2085
2797
|
/**
|
|
2086
2798
|
* Configuration arguments for the Anthropic web fetch tool, including usage limits, domain filters, citation settings, and token limits.
|
|
2087
2799
|
*
|
|
2800
|
+
* **Gotchas**
|
|
2801
|
+
*
|
|
2802
|
+
* `allowedDomains` and `blockedDomains` are mutually exclusive.
|
|
2803
|
+
* `maxContentTokens` is approximate and does not apply to binary content such
|
|
2804
|
+
* as PDFs.
|
|
2805
|
+
*
|
|
2088
2806
|
* @category Web Fetch
|
|
2089
2807
|
* @since 4.0.0
|
|
2090
2808
|
*/
|
|
2091
2809
|
export type WebFetch_20250910_Args = typeof WebFetch_20250910_Args.Type;
|
|
2092
2810
|
/**
|
|
2093
|
-
*
|
|
2811
|
+
* Schema for Claude-supplied web fetch parameters.
|
|
2812
|
+
*
|
|
2813
|
+
* **When to use**
|
|
2814
|
+
*
|
|
2815
|
+
* Use when validating or constructing the `url` payload consumed by
|
|
2816
|
+
* `WebFetch_20250910`.
|
|
2817
|
+
*
|
|
2818
|
+
* **Details**
|
|
2819
|
+
*
|
|
2820
|
+
* The payload contains the single `url` parameter for Anthropic web fetch.
|
|
2821
|
+
*
|
|
2822
|
+
* **Gotchas**
|
|
2823
|
+
*
|
|
2824
|
+
* The URL must be user-provided or from prior search/fetch results. Maximum URL
|
|
2825
|
+
* length is 250 characters.
|
|
2826
|
+
*
|
|
2827
|
+
* @see {@link WebFetch_20250910} for the provider-defined tool that consumes this payload
|
|
2094
2828
|
*
|
|
2095
2829
|
* @category Web Fetch
|
|
2096
2830
|
* @since 4.0.0
|
|
@@ -2105,6 +2839,15 @@ export declare const WebFetchParameters: Schema.Struct<{
|
|
|
2105
2839
|
/**
|
|
2106
2840
|
* Type of the parameters Claude supplies when invoking the Anthropic web fetch tool.
|
|
2107
2841
|
*
|
|
2842
|
+
* **Details**
|
|
2843
|
+
*
|
|
2844
|
+
* The payload contains the single `url` parameter for Anthropic web fetch.
|
|
2845
|
+
*
|
|
2846
|
+
* **Gotchas**
|
|
2847
|
+
*
|
|
2848
|
+
* The URL must be user-provided or from prior search/fetch results. Maximum URL
|
|
2849
|
+
* length is 250 characters.
|
|
2850
|
+
*
|
|
2108
2851
|
* @category Web Fetch
|
|
2109
2852
|
* @since 4.0.0
|
|
2110
2853
|
*/
|
|
@@ -2112,11 +2855,17 @@ export type WebFetchParameters = typeof WebFetchParameters.Type;
|
|
|
2112
2855
|
/**
|
|
2113
2856
|
* Web fetch tool for Claude models.
|
|
2114
2857
|
*
|
|
2858
|
+
* **When to use**
|
|
2859
|
+
*
|
|
2860
|
+
* Use when Claude should retrieve the content of a specific web page or PDF.
|
|
2861
|
+
*
|
|
2115
2862
|
* **Details**
|
|
2116
2863
|
*
|
|
2117
2864
|
* Allows Claude to retrieve full content from web pages and PDF documents.
|
|
2118
|
-
* This is a server-side tool executed by Anthropic's infrastructure.
|
|
2119
|
-
*
|
|
2865
|
+
* This is a server-side tool executed by Anthropic's infrastructure. Selecting
|
|
2866
|
+
* this tool adds the "web-fetch-2025-09-10" beta header.
|
|
2867
|
+
*
|
|
2868
|
+
* @see {@link WebSearch_20250305} for discovering URLs before fetching specific content
|
|
2120
2869
|
*
|
|
2121
2870
|
* @category Web Fetch
|
|
2122
2871
|
* @since 4.0.0
|
|
@@ -2215,6 +2964,11 @@ export declare const ToolSearchRegexParameters: Schema.Struct<{
|
|
|
2215
2964
|
/**
|
|
2216
2965
|
* Type of the parameters Claude supplies when invoking regex-based Anthropic tool search.
|
|
2217
2966
|
*
|
|
2967
|
+
* **Details**
|
|
2968
|
+
*
|
|
2969
|
+
* Claude constructs regex patterns using Python's `re.search()` syntax.
|
|
2970
|
+
* Maximum query length: 200 characters.
|
|
2971
|
+
*
|
|
2218
2972
|
* @category Tool Search
|
|
2219
2973
|
* @since 4.0.0
|
|
2220
2974
|
*/
|
|
@@ -2222,6 +2976,18 @@ export type ToolSearchRegexParameters = typeof ToolSearchRegexParameters.Type;
|
|
|
2222
2976
|
/**
|
|
2223
2977
|
* Input parameters for BM25/natural language tool search.
|
|
2224
2978
|
*
|
|
2979
|
+
* **When to use**
|
|
2980
|
+
*
|
|
2981
|
+
* Use when validating or constructing the natural-language query payload for
|
|
2982
|
+
* `ToolSearchBM25_20251119`.
|
|
2983
|
+
*
|
|
2984
|
+
* **Details**
|
|
2985
|
+
*
|
|
2986
|
+
* The payload contains Claude's natural-language `query`. BM25 searches tool
|
|
2987
|
+
* names, descriptions, argument names, and argument descriptions.
|
|
2988
|
+
*
|
|
2989
|
+
* @see {@link ToolSearchBM25_20251119} for the provider-defined tool that consumes these parameters
|
|
2990
|
+
*
|
|
2225
2991
|
* @category Tool Search
|
|
2226
2992
|
* @since 4.0.0
|
|
2227
2993
|
*/
|
|
@@ -2277,6 +3043,11 @@ export declare const ToolSearchRegex_20251119: <Mode extends Tool.FailureMode |
|
|
|
2277
3043
|
/**
|
|
2278
3044
|
* BM25/natural language tool search for Claude models.
|
|
2279
3045
|
*
|
|
3046
|
+
* **When to use**
|
|
3047
|
+
*
|
|
3048
|
+
* Use when you want Claude to find relevant tools from a natural-language query
|
|
3049
|
+
* instead of a regex pattern.
|
|
3050
|
+
*
|
|
2280
3051
|
* **Details**
|
|
2281
3052
|
*
|
|
2282
3053
|
* Claude uses natural language queries to search for tools using the
|
|
@@ -2284,6 +3055,8 @@ export declare const ToolSearchRegex_20251119: <Mode extends Tool.FailureMode |
|
|
|
2284
3055
|
* argument names, and argument descriptions.
|
|
2285
3056
|
* Requires the "advanced-tool-use-2025-11-20" beta header.
|
|
2286
3057
|
*
|
|
3058
|
+
* @see {@link ToolSearchRegex_20251119} for the regex-pattern alternative
|
|
3059
|
+
*
|
|
2287
3060
|
* @category Tool Search
|
|
2288
3061
|
* @since 4.0.0
|
|
2289
3062
|
*/
|