@effect/ai-anthropic 4.0.0-beta.8 → 4.0.0-beta.81
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 +93 -74
- package/dist/AnthropicClient.d.ts.map +1 -1
- package/dist/AnthropicClient.js +51 -19
- package/dist/AnthropicClient.js.map +1 -1
- package/dist/AnthropicConfig.d.ts +55 -10
- package/dist/AnthropicConfig.d.ts.map +1 -1
- package/dist/AnthropicConfig.js +30 -7
- package/dist/AnthropicConfig.js.map +1 -1
- package/dist/AnthropicError.d.ts +136 -37
- package/dist/AnthropicError.d.ts.map +1 -1
- package/dist/AnthropicError.js +1 -1
- package/dist/AnthropicLanguageModel.d.ts +362 -52
- package/dist/AnthropicLanguageModel.d.ts.map +1 -1
- package/dist/AnthropicLanguageModel.js +88 -21
- package/dist/AnthropicLanguageModel.js.map +1 -1
- package/dist/AnthropicTelemetry.d.ts +43 -16
- package/dist/AnthropicTelemetry.d.ts.map +1 -1
- package/dist/AnthropicTelemetry.js +15 -9
- package/dist/AnthropicTelemetry.js.map +1 -1
- package/dist/AnthropicTool.d.ts +1223 -289
- package/dist/AnthropicTool.d.ts.map +1 -1
- package/dist/AnthropicTool.js +859 -201
- package/dist/AnthropicTool.js.map +1 -1
- package/dist/Generated.d.ts +1 -1
- package/dist/Generated.js +1 -1
- package/dist/index.d.ts +8 -29
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -29
- package/dist/index.js.map +1 -1
- package/dist/internal/errors.js +7 -7
- package/dist/internal/errors.js.map +1 -1
- package/package.json +3 -3
- package/src/AnthropicClient.ts +114 -104
- package/src/AnthropicConfig.ts +56 -11
- package/src/AnthropicError.ts +138 -37
- package/src/AnthropicLanguageModel.ts +395 -43
- package/src/AnthropicTelemetry.ts +48 -22
- package/src/AnthropicTool.ts +1216 -282
- package/src/Generated.ts +1 -1
- package/src/index.ts +8 -29
- package/src/internal/errors.ts +9 -7
package/dist/AnthropicTool.d.ts
CHANGED
|
@@ -1,28 +1,49 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Anthropic provider
|
|
2
|
+
* The `AnthropicTool` module defines Anthropic provider tools and the schemas
|
|
3
|
+
* for their inputs and results. It covers Anthropic-owned tools such as Bash,
|
|
4
|
+
* Code Execution, Computer Use, Memory, Text Editor, Web Search, Web Fetch, and
|
|
5
|
+
* Tool Search, which can be attached to Anthropic-backed Effect AI language
|
|
6
|
+
* model requests.
|
|
3
7
|
*
|
|
4
|
-
*
|
|
5
|
-
* Bash, Code Execution, Computer Use, Memory, and Text Editor functionality.
|
|
6
|
-
*
|
|
7
|
-
* @since 1.0.0
|
|
8
|
+
* @since 4.0.0
|
|
8
9
|
*/
|
|
9
10
|
import * as Schema from "effect/Schema";
|
|
10
11
|
import * as Tool from "effect/unstable/ai/Tool";
|
|
11
12
|
/**
|
|
12
|
-
* Union of all Anthropic provider-defined
|
|
13
|
+
* Union of all Anthropic provider-defined tool definitions exported by this module.
|
|
14
|
+
*
|
|
15
|
+
* **When to use**
|
|
16
|
+
*
|
|
17
|
+
* Use when a helper, collection, or option accepts any Anthropic
|
|
18
|
+
* provider-defined tool value created by this module.
|
|
19
|
+
*
|
|
20
|
+
* **Details**
|
|
21
|
+
*
|
|
22
|
+
* The union is built from the return types of the exported constructors,
|
|
23
|
+
* including Bash, Code Execution, Computer Use, Memory, Text Editor, Tool
|
|
24
|
+
* Search, Web Fetch, and Web Search tool versions.
|
|
13
25
|
*
|
|
14
|
-
* @since 1.0.0
|
|
15
26
|
* @category models
|
|
27
|
+
* @since 4.0.0
|
|
16
28
|
*/
|
|
17
29
|
export type AnthropicTool = ReturnType<typeof Bash_20241022> | ReturnType<typeof Bash_20250124> | ReturnType<typeof CodeExecution_20250522> | ReturnType<typeof CodeExecution_20250825> | ReturnType<typeof ComputerUse_20241022> | ReturnType<typeof ComputerUse_20250124> | ReturnType<typeof ComputerUse_20251124> | ReturnType<typeof Memory_20250818> | ReturnType<typeof TextEditor_20241022> | ReturnType<typeof TextEditor_20250124> | ReturnType<typeof TextEditor_20250429> | ReturnType<typeof TextEditor_20250728> | ReturnType<typeof ToolSearchRegex_20251119> | ReturnType<typeof ToolSearchBM25_20251119> | ReturnType<typeof WebFetch_20250910> | ReturnType<typeof WebSearch_20250305>;
|
|
18
30
|
/**
|
|
19
|
-
* Anthropic Bash tool (2024-10-22 version).
|
|
31
|
+
* Defines the Anthropic Bash tool (2024-10-22 version).
|
|
32
|
+
*
|
|
33
|
+
* **When to use**
|
|
34
|
+
*
|
|
35
|
+
* Use when you want the model to execute bash commands with the 2024-10-22
|
|
36
|
+
* Anthropic computer-use beta.
|
|
37
|
+
*
|
|
38
|
+
* **Details**
|
|
20
39
|
*
|
|
21
40
|
* Allows the model to execute bash commands in a sandboxed environment.
|
|
22
41
|
* Requires the "computer-use-2024-10-22" beta header.
|
|
23
42
|
*
|
|
24
|
-
* @
|
|
43
|
+
* @see {@link Bash_20250124} for the newer 2025-01-24 version of the bash tool
|
|
44
|
+
*
|
|
25
45
|
* @category Bash
|
|
46
|
+
* @since 4.0.0
|
|
26
47
|
*/
|
|
27
48
|
export declare const Bash_20241022: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
|
|
28
49
|
readonly failureMode?: Mode | undefined;
|
|
@@ -37,13 +58,22 @@ export declare const Bash_20241022: <Mode extends Tool.FailureMode | undefined =
|
|
|
37
58
|
readonly failureMode: Mode extends undefined ? "error" : Mode;
|
|
38
59
|
}, true>;
|
|
39
60
|
/**
|
|
40
|
-
* Anthropic Bash tool (2025-01-24 version).
|
|
61
|
+
* Defines the Anthropic Bash tool (2025-01-24 version).
|
|
62
|
+
*
|
|
63
|
+
* **When to use**
|
|
64
|
+
*
|
|
65
|
+
* Use when you want the model to execute bash commands with the 2025-01-24
|
|
66
|
+
* Anthropic computer-use beta.
|
|
67
|
+
*
|
|
68
|
+
* **Details**
|
|
41
69
|
*
|
|
42
70
|
* Allows the model to execute bash commands in a sandboxed environment.
|
|
43
71
|
* Requires the "computer-use-2025-01-24" beta header.
|
|
44
72
|
*
|
|
45
|
-
* @
|
|
73
|
+
* @see {@link Bash_20241022} for the older 2024-10-22 version of the bash tool
|
|
74
|
+
*
|
|
46
75
|
* @category Bash
|
|
76
|
+
* @since 4.0.0
|
|
47
77
|
*/
|
|
48
78
|
export declare const Bash_20250124: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
|
|
49
79
|
readonly failureMode?: Mode | undefined;
|
|
@@ -58,10 +88,17 @@ export declare const Bash_20250124: <Mode extends Tool.FailureMode | undefined =
|
|
|
58
88
|
readonly failureMode: Mode extends undefined ? "error" : Mode;
|
|
59
89
|
}, true>;
|
|
60
90
|
/**
|
|
61
|
-
*
|
|
91
|
+
* Schema for a code execution request that asks Anthropic to run source code as a programmatic tool call.
|
|
92
|
+
*
|
|
93
|
+
* **When to use**
|
|
94
|
+
*
|
|
95
|
+
* Use when constructing or validating a programmatic tool call for the Anthropic
|
|
96
|
+
* Code Execution tool.
|
|
97
|
+
*
|
|
98
|
+
* @see {@link CodeExecution_20250522} for the parent tool definition
|
|
62
99
|
*
|
|
63
|
-
* @since 1.0.0
|
|
64
100
|
* @category Code Execution
|
|
101
|
+
* @since 4.0.0
|
|
65
102
|
*/
|
|
66
103
|
export declare const CodeExecutionProgrammaticToolCall: Schema.Struct<{
|
|
67
104
|
readonly type: Schema.Literal<"programmatic-tool-call">;
|
|
@@ -71,15 +108,29 @@ export declare const CodeExecutionProgrammaticToolCall: Schema.Struct<{
|
|
|
71
108
|
readonly code: Schema.String;
|
|
72
109
|
}>;
|
|
73
110
|
/**
|
|
74
|
-
*
|
|
111
|
+
* Input payload for a programmatic code execution tool call, including the source code to execute.
|
|
112
|
+
*
|
|
75
113
|
* @category Code Execution
|
|
114
|
+
* @since 4.0.0
|
|
76
115
|
*/
|
|
77
116
|
export type CodeExecutionProgrammaticToolCall = typeof CodeExecutionProgrammaticToolCall.Type;
|
|
78
117
|
/**
|
|
79
|
-
*
|
|
118
|
+
* Schema for the `bash_code_execution` input variant of Anthropic Code Execution.
|
|
119
|
+
*
|
|
120
|
+
* **When to use**
|
|
121
|
+
*
|
|
122
|
+
* Use when validating or constructing a bash command request for
|
|
123
|
+
* `CodeExecution_20250522`.
|
|
124
|
+
*
|
|
125
|
+
* **Details**
|
|
126
|
+
*
|
|
127
|
+
* The schema requires `type` to be `"bash_code_execution"` and `command` to
|
|
128
|
+
* contain the bash command sent to Anthropic.
|
|
129
|
+
*
|
|
130
|
+
* @see {@link CodeExecution_20250522} for the provider-defined tool that consumes this input variant
|
|
80
131
|
*
|
|
81
|
-
* @since 1.0.0
|
|
82
132
|
* @category Code Execution
|
|
133
|
+
* @since 4.0.0
|
|
83
134
|
*/
|
|
84
135
|
export declare const CodeExecutionBashCommand: Schema.Struct<{
|
|
85
136
|
readonly type: Schema.Literal<"bash_code_execution">;
|
|
@@ -89,15 +140,47 @@ export declare const CodeExecutionBashCommand: Schema.Struct<{
|
|
|
89
140
|
readonly command: Schema.String;
|
|
90
141
|
}>;
|
|
91
142
|
/**
|
|
92
|
-
*
|
|
143
|
+
* Input payload for a bash command routed through the Anthropic code execution tool.
|
|
144
|
+
*
|
|
145
|
+
* **When to use**
|
|
146
|
+
*
|
|
147
|
+
* Use when representing a provider-executed bash command request for the
|
|
148
|
+
* 2025-05-22 code execution tool.
|
|
149
|
+
*
|
|
150
|
+
* **Details**
|
|
151
|
+
*
|
|
152
|
+
* The payload uses `type: "bash_code_execution"` to distinguish bash execution
|
|
153
|
+
* from programmatic code and text editor operations, and `command` contains the
|
|
154
|
+
* bash command to run.
|
|
155
|
+
*
|
|
156
|
+
* @see {@link CodeExecutionProgrammaticToolCall} for programmatic code execution input
|
|
157
|
+
* @see {@link CodeExecutionTextEditorView} for viewing files through text editor code execution
|
|
158
|
+
* @see {@link CodeExecutionTextEditorCreate} for creating files through text editor code execution
|
|
159
|
+
* @see {@link CodeExecutionTextEditorStrReplace} for replacing text through text editor code execution
|
|
160
|
+
* @see {@link CodeExecution_20250522} for the provider-defined tool that consumes this payload
|
|
161
|
+
*
|
|
93
162
|
* @category Code Execution
|
|
163
|
+
* @since 4.0.0
|
|
94
164
|
*/
|
|
95
165
|
export type CodeExecutionBashCommand = typeof CodeExecutionBashCommand.Type;
|
|
96
166
|
/**
|
|
97
|
-
*
|
|
167
|
+
* Schema for a code execution text editor request that views a file by path.
|
|
168
|
+
*
|
|
169
|
+
* **When to use**
|
|
170
|
+
*
|
|
171
|
+
* Use when you need the schema for provider-bound code-execution view requests
|
|
172
|
+
* before distinguishing them from create or replace text-editor commands.
|
|
173
|
+
*
|
|
174
|
+
* **Details**
|
|
175
|
+
*
|
|
176
|
+
* The encoded payload uses `type: "text_editor_code_execution"`,
|
|
177
|
+
* `command: "view"`, and a `path` string.
|
|
178
|
+
*
|
|
179
|
+
* @see {@link CodeExecutionTextEditorCreate} for the command that creates a file
|
|
180
|
+
* @see {@link CodeExecutionTextEditorStrReplace} for the command that replaces text in a file
|
|
98
181
|
*
|
|
99
|
-
* @since 1.0.0
|
|
100
182
|
* @category Code Execution
|
|
183
|
+
* @since 4.0.0
|
|
101
184
|
*/
|
|
102
185
|
export declare const CodeExecutionTextEditorView: Schema.Struct<{
|
|
103
186
|
readonly type: Schema.Literal<"text_editor_code_execution">;
|
|
@@ -108,15 +191,51 @@ export declare const CodeExecutionTextEditorView: Schema.Struct<{
|
|
|
108
191
|
readonly path: Schema.String;
|
|
109
192
|
}>;
|
|
110
193
|
/**
|
|
111
|
-
*
|
|
194
|
+
* Input payload for the `view` command of Anthropic's text editor code execution tool.
|
|
195
|
+
*
|
|
196
|
+
* **When to use**
|
|
197
|
+
*
|
|
198
|
+
* Use when working at the Anthropic protocol boundary and the code-execution
|
|
199
|
+
* view request must be distinguished from standalone text-editor view requests.
|
|
200
|
+
*
|
|
201
|
+
* **Details**
|
|
202
|
+
*
|
|
203
|
+
* The payload is discriminated by `type: "text_editor_code_execution"` and
|
|
204
|
+
* `command: "view"`. The `path` field identifies the file to view.
|
|
205
|
+
*
|
|
206
|
+
* **Gotchas**
|
|
207
|
+
*
|
|
208
|
+
* This code execution view payload does not include `view_range`; line ranges
|
|
209
|
+
* are part of the standalone text editor view payload, not this code execution
|
|
210
|
+
* payload.
|
|
211
|
+
*
|
|
212
|
+
* @see {@link CodeExecution_20250522} for the provider-defined code execution tool that includes this payload
|
|
213
|
+
* @see {@link TextEditorViewCommand} for the standalone text editor view payload
|
|
214
|
+
*
|
|
112
215
|
* @category Code Execution
|
|
216
|
+
* @since 4.0.0
|
|
113
217
|
*/
|
|
114
218
|
export type CodeExecutionTextEditorView = typeof CodeExecutionTextEditorView.Type;
|
|
115
219
|
/**
|
|
116
|
-
*
|
|
220
|
+
* Schema for a text editor code execution request that creates a file at a path.
|
|
221
|
+
*
|
|
222
|
+
* **When to use**
|
|
223
|
+
*
|
|
224
|
+
* Use when validating or constructing an Anthropic `text_editor_code_execution`
|
|
225
|
+
* tool call that should create a file.
|
|
226
|
+
*
|
|
227
|
+
* **Details**
|
|
228
|
+
*
|
|
229
|
+
* The request is discriminated by `type: "text_editor_code_execution"` and
|
|
230
|
+
* `command: "create"`. It requires `path` and accepts optional `file_text`; the
|
|
231
|
+
* schema allows `file_text` to be omitted, `null`, or a string.
|
|
232
|
+
*
|
|
233
|
+
* @see {@link CodeExecution_20250522} for the provider-defined tool that consumes this request
|
|
234
|
+
* @see {@link CodeExecutionTextEditorView} for the matching view request
|
|
235
|
+
* @see {@link CodeExecutionTextEditorStrReplace} for the matching replace request
|
|
117
236
|
*
|
|
118
|
-
* @since 1.0.0
|
|
119
237
|
* @category Code Execution
|
|
238
|
+
* @since 4.0.0
|
|
120
239
|
*/
|
|
121
240
|
export declare const CodeExecutionTextEditorCreate: Schema.Struct<{
|
|
122
241
|
readonly type: Schema.Literal<"text_editor_code_execution">;
|
|
@@ -131,15 +250,30 @@ export declare const CodeExecutionTextEditorCreate: Schema.Struct<{
|
|
|
131
250
|
readonly file_text: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
132
251
|
}>;
|
|
133
252
|
/**
|
|
134
|
-
*
|
|
253
|
+
* Input payload for creating a file through the text editor code execution tool, optionally including initial file text.
|
|
254
|
+
*
|
|
135
255
|
* @category Code Execution
|
|
256
|
+
* @since 4.0.0
|
|
136
257
|
*/
|
|
137
258
|
export type CodeExecutionTextEditorCreate = typeof CodeExecutionTextEditorCreate.Type;
|
|
138
259
|
/**
|
|
139
|
-
*
|
|
260
|
+
* Schema for a code execution text editor request that replaces one exact string in a file.
|
|
261
|
+
*
|
|
262
|
+
* **When to use**
|
|
263
|
+
*
|
|
264
|
+
* Use when validating or constructing the `str_replace` text editor operation
|
|
265
|
+
* for the 2025-05-22 Anthropic code execution tool.
|
|
266
|
+
*
|
|
267
|
+
* **Gotchas**
|
|
268
|
+
*
|
|
269
|
+
* The `old_str` must match the file contents exactly, including whitespace and
|
|
270
|
+
* indentation, and must identify a single occurrence.
|
|
271
|
+
*
|
|
272
|
+
* @see {@link CodeExecutionTextEditorView} for reading file contents before choosing the replacement text
|
|
273
|
+
* @see {@link CodeExecution_20250522} for the provider-defined tool that consumes this payload
|
|
140
274
|
*
|
|
141
|
-
* @since 1.0.0
|
|
142
275
|
* @category Code Execution
|
|
276
|
+
* @since 4.0.0
|
|
143
277
|
*/
|
|
144
278
|
export declare const CodeExecutionTextEditorStrReplace: Schema.Struct<{
|
|
145
279
|
readonly type: Schema.Literal<"text_editor_code_execution">;
|
|
@@ -158,15 +292,24 @@ export declare const CodeExecutionTextEditorStrReplace: Schema.Struct<{
|
|
|
158
292
|
readonly new_str: Schema.String;
|
|
159
293
|
}>;
|
|
160
294
|
/**
|
|
161
|
-
*
|
|
295
|
+
* Input payload for replacing text in a file through the text editor code execution tool.
|
|
296
|
+
*
|
|
162
297
|
* @category Code Execution
|
|
298
|
+
* @since 4.0.0
|
|
163
299
|
*/
|
|
164
300
|
export type CodeExecutionTextEditorStrReplace = typeof CodeExecutionTextEditorStrReplace.Type;
|
|
165
301
|
/**
|
|
166
|
-
*
|
|
302
|
+
* Schema for the 2025-08-25 code execution tool input, containing the code to execute.
|
|
303
|
+
*
|
|
304
|
+
* **When to use**
|
|
305
|
+
*
|
|
306
|
+
* Use when you need the schema for code-execution input at the Anthropic
|
|
307
|
+
* protocol boundary before sending source code to the 2025-08-25 tool.
|
|
308
|
+
*
|
|
309
|
+
* @see {@link CodeExecution_20250825} for the provider-defined tool that consumes this schema
|
|
167
310
|
*
|
|
168
|
-
* @since 1.0.0
|
|
169
311
|
* @category Code Execution
|
|
312
|
+
* @since 4.0.0
|
|
170
313
|
*/
|
|
171
314
|
export declare const CodeExecution_20250825_Parameters: Schema.Struct<{
|
|
172
315
|
/**
|
|
@@ -175,19 +318,42 @@ export declare const CodeExecution_20250825_Parameters: Schema.Struct<{
|
|
|
175
318
|
readonly code: Schema.String;
|
|
176
319
|
}>;
|
|
177
320
|
/**
|
|
178
|
-
*
|
|
321
|
+
* Input payload for the 2025-08-25 Anthropic code execution tool.
|
|
322
|
+
*
|
|
323
|
+
* **When to use**
|
|
324
|
+
*
|
|
325
|
+
* Use when exposing the 2025-08-25 code-execution payload separately from the
|
|
326
|
+
* provider tool definition, such as at a transport or persistence boundary.
|
|
327
|
+
*
|
|
328
|
+
* **Details**
|
|
329
|
+
*
|
|
330
|
+
* The payload has a single `code` field containing the source code string to
|
|
331
|
+
* execute.
|
|
332
|
+
*
|
|
333
|
+
* @see {@link CodeExecution_20250825} for the provider-defined tool that consumes this payload
|
|
334
|
+
*
|
|
179
335
|
* @category Code Execution
|
|
336
|
+
* @since 4.0.0
|
|
180
337
|
*/
|
|
181
338
|
export type CodeExecution_20250825_Parameters = typeof CodeExecution_20250825_Parameters.Type;
|
|
182
339
|
/**
|
|
183
|
-
* Anthropic Code Execution tool (2025-05-22 version).
|
|
340
|
+
* Defines the Anthropic Code Execution tool (2025-05-22 version).
|
|
341
|
+
*
|
|
342
|
+
* **When to use**
|
|
343
|
+
*
|
|
344
|
+
* Use when you want the model to execute code in a sandboxed environment with
|
|
345
|
+
* the 2025-05-22 Anthropic code-execution beta.
|
|
346
|
+
*
|
|
347
|
+
* **Details**
|
|
184
348
|
*
|
|
185
349
|
* Allows the model to execute code in a sandboxed environment with support
|
|
186
350
|
* for multiple execution types including programmatic tool calls, bash
|
|
187
351
|
* execution, and text editor operations.
|
|
188
352
|
*
|
|
189
|
-
* @
|
|
353
|
+
* @see {@link CodeExecutionProgrammaticToolCall} for the programmatic tool call schema
|
|
354
|
+
*
|
|
190
355
|
* @category Code Execution
|
|
356
|
+
* @since 4.0.0
|
|
191
357
|
*/
|
|
192
358
|
export declare const CodeExecution_20250522: <Mode extends Tool.FailureMode | undefined = undefined>(args: void) => Tool.ProviderDefined<"anthropic.code_execution_20250522", "AnthropicCodeExecution", {
|
|
193
359
|
readonly args: Schema.Void;
|
|
@@ -254,12 +420,23 @@ export declare const CodeExecution_20250522: <Mode extends Tool.FailureMode | un
|
|
|
254
420
|
readonly failureMode: Mode extends undefined ? "error" : Mode;
|
|
255
421
|
}, false>;
|
|
256
422
|
/**
|
|
257
|
-
* Anthropic Code Execution tool (2025-08-25 version).
|
|
423
|
+
* Defines the Anthropic Code Execution tool (2025-08-25 version).
|
|
424
|
+
*
|
|
425
|
+
* **When to use**
|
|
426
|
+
*
|
|
427
|
+
* Use when you want the model to execute code in a sandboxed environment with
|
|
428
|
+
* the 2025-08-25 Anthropic code-execution beta.
|
|
429
|
+
*
|
|
430
|
+
* **Details**
|
|
431
|
+
*
|
|
432
|
+
* Requires the `code-execution-2025-08-25` beta header and uses
|
|
433
|
+
* `CodeExecution_20250825_Parameters` as its input schema.
|
|
258
434
|
*
|
|
259
|
-
*
|
|
435
|
+
* @see {@link CodeExecution_20250522} for the older 2025-05-22 code execution tool
|
|
436
|
+
* @see {@link CodeExecution_20250825_Parameters} for the input schema consumed by this tool
|
|
260
437
|
*
|
|
261
|
-
* @since 1.0.0
|
|
262
438
|
* @category Code Execution
|
|
439
|
+
* @since 4.0.0
|
|
263
440
|
*/
|
|
264
441
|
export declare const CodeExecution_20250825: <Mode extends Tool.FailureMode | undefined = undefined>(args: void) => Tool.ProviderDefined<"anthropic.code_execution_20250825", "AnthropicCodeExecution", {
|
|
265
442
|
readonly args: Schema.Void;
|
|
@@ -319,58 +496,113 @@ export declare const CodeExecution_20250825: <Mode extends Tool.FailureMode | un
|
|
|
319
496
|
readonly failureMode: Mode extends undefined ? "error" : Mode;
|
|
320
497
|
}, false>;
|
|
321
498
|
/**
|
|
322
|
-
*
|
|
499
|
+
* Schema for an `[x, y]` screen coordinate in pixels.
|
|
500
|
+
*
|
|
501
|
+
* **When to use**
|
|
502
|
+
*
|
|
503
|
+
* Use when validating computer-use action payloads that carry a single screen
|
|
504
|
+
* position and provider-side bounds checks remain acceptable.
|
|
505
|
+
*
|
|
506
|
+
* **Details**
|
|
507
|
+
*
|
|
508
|
+
* This is a two-number tuple used by computer-use actions that accept screen
|
|
509
|
+
* positions.
|
|
510
|
+
*
|
|
511
|
+
* **Gotchas**
|
|
512
|
+
*
|
|
513
|
+
* This schema validates tuple shape only and does not check display bounds.
|
|
323
514
|
*
|
|
324
|
-
* @
|
|
325
|
-
* @
|
|
515
|
+
* @category computer use
|
|
516
|
+
* @since 4.0.0
|
|
326
517
|
*/
|
|
327
518
|
export declare const Coordinate: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
|
|
328
519
|
/**
|
|
329
|
-
*
|
|
330
|
-
*
|
|
520
|
+
* An `[x, y]` screen coordinate in pixels.
|
|
521
|
+
*
|
|
522
|
+
* @category computer use
|
|
523
|
+
* @since 4.0.0
|
|
331
524
|
*/
|
|
332
525
|
export type Coordinate = typeof Coordinate.Type;
|
|
333
526
|
/**
|
|
334
|
-
*
|
|
527
|
+
* Schema for an `[x1, y1, x2, y2]` screen region in pixels.
|
|
528
|
+
*
|
|
529
|
+
* **When to use**
|
|
530
|
+
*
|
|
531
|
+
* Use when validating computer-use action payloads that carry a rectangular
|
|
532
|
+
* screen region and provider-side bounds checks remain acceptable.
|
|
533
|
+
*
|
|
534
|
+
* **Details**
|
|
535
|
+
*
|
|
536
|
+
* The tuple represents top-left and bottom-right corners.
|
|
537
|
+
*
|
|
538
|
+
* **Gotchas**
|
|
539
|
+
*
|
|
540
|
+
* This schema validates four numbers only and does not check coordinate ordering
|
|
541
|
+
* or display bounds.
|
|
335
542
|
*
|
|
336
|
-
* @
|
|
337
|
-
* @
|
|
543
|
+
* @category computer use
|
|
544
|
+
* @since 4.0.0
|
|
338
545
|
*/
|
|
339
546
|
export declare const Region: Schema.Tuple<readonly [Schema.Number, Schema.Number, Schema.Number, Schema.Number]>;
|
|
340
547
|
/**
|
|
341
|
-
*
|
|
342
|
-
*
|
|
548
|
+
* An `[x1, y1, x2, y2]` screen region in pixels, from top-left to bottom-right.
|
|
549
|
+
*
|
|
550
|
+
* @category computer use
|
|
551
|
+
* @since 4.0.0
|
|
343
552
|
*/
|
|
344
553
|
export type Region = typeof Region.Type;
|
|
345
554
|
/**
|
|
346
|
-
*
|
|
555
|
+
* Schema for scroll direction literals: `"up"`, `"down"`, `"left"`, or `"right"`.
|
|
556
|
+
*
|
|
557
|
+
* @see {@link ComputerUseScrollAction} for the action payload that consumes this schema
|
|
347
558
|
*
|
|
348
|
-
* @
|
|
349
|
-
* @
|
|
559
|
+
* @category computer use
|
|
560
|
+
* @since 4.0.0
|
|
350
561
|
*/
|
|
351
562
|
export declare const ScrollDirection: Schema.Literals<readonly ["up", "down", "left", "right"]>;
|
|
352
563
|
/**
|
|
353
|
-
*
|
|
354
|
-
*
|
|
564
|
+
* Direction used by computer-use scroll actions: `"up"`, `"down"`, `"left"`, or `"right"`.
|
|
565
|
+
*
|
|
566
|
+
* @category computer use
|
|
567
|
+
* @since 4.0.0
|
|
355
568
|
*/
|
|
356
569
|
export type ScrollDirection = typeof ScrollDirection.Type;
|
|
357
570
|
/**
|
|
358
|
-
*
|
|
571
|
+
* Schema for modifier key literals.
|
|
359
572
|
*
|
|
360
|
-
*
|
|
361
|
-
*
|
|
573
|
+
* **Details**
|
|
574
|
+
*
|
|
575
|
+
* Allowed values are `"alt"`, `"ctrl"`, `"meta"`, and `"shift"`.
|
|
576
|
+
*
|
|
577
|
+
* @category computer use
|
|
578
|
+
* @since 4.0.0
|
|
362
579
|
*/
|
|
363
580
|
export declare const ModifierKey: Schema.Literals<readonly ["alt", "ctrl", "meta", "shift"]>;
|
|
364
581
|
/**
|
|
365
|
-
*
|
|
366
|
-
*
|
|
582
|
+
* Modifier key literals.
|
|
583
|
+
*
|
|
584
|
+
* **Details**
|
|
585
|
+
*
|
|
586
|
+
* Allowed values are `"alt"`, `"ctrl"`, `"meta"`, and `"shift"`.
|
|
587
|
+
*
|
|
588
|
+
* @category computer use
|
|
589
|
+
* @since 4.0.0
|
|
367
590
|
*/
|
|
368
591
|
export type ModifierKey = typeof ModifierKey.Type;
|
|
369
592
|
/**
|
|
370
|
-
*
|
|
593
|
+
* Schema for a computer-use action that presses a key or key combination, such
|
|
594
|
+
* as `"Return"`, `"ctrl+c"`, or `"ctrl+s"`.
|
|
595
|
+
*
|
|
596
|
+
* **When to use**
|
|
371
597
|
*
|
|
372
|
-
*
|
|
373
|
-
*
|
|
598
|
+
* Use when validating or constructing a computer-use action for keyboard
|
|
599
|
+
* shortcuts or non-text key presses.
|
|
600
|
+
*
|
|
601
|
+
* @see {@link TypeAction} for entering ordinary text strings
|
|
602
|
+
* @see {@link ComputerUseHoldKeyAction} for holding a key for a duration
|
|
603
|
+
*
|
|
604
|
+
* @category computer use
|
|
605
|
+
* @since 4.0.0
|
|
374
606
|
*/
|
|
375
607
|
export declare const ComputerUseKeyAction: Schema.Struct<{
|
|
376
608
|
readonly action: Schema.Literal<"key">;
|
|
@@ -380,15 +612,53 @@ export declare const ComputerUseKeyAction: Schema.Struct<{
|
|
|
380
612
|
readonly text: Schema.String;
|
|
381
613
|
}>;
|
|
382
614
|
/**
|
|
383
|
-
*
|
|
384
|
-
*
|
|
615
|
+
* Computer-use action payload for pressing a key or key combination.
|
|
616
|
+
*
|
|
617
|
+
* **When to use**
|
|
618
|
+
*
|
|
619
|
+
* Use when typing parsed computer-use key action payloads after schema
|
|
620
|
+
* validation, where provider-specific key-name validation is handled outside
|
|
621
|
+
* TypeScript.
|
|
622
|
+
*
|
|
623
|
+
* **Details**
|
|
624
|
+
*
|
|
625
|
+
* The payload uses `action: "key"` and stores the key or key combination to
|
|
626
|
+
* press in `text`, such as `"Return"`, `"ctrl+c"`, or `"ctrl+s"`.
|
|
627
|
+
*
|
|
628
|
+
* **Gotchas**
|
|
629
|
+
*
|
|
630
|
+
* `text` is typed as `string`; the paired schema does not validate
|
|
631
|
+
* provider-specific key names or key combinations.
|
|
632
|
+
*
|
|
633
|
+
* @category computer use
|
|
634
|
+
* @since 4.0.0
|
|
385
635
|
*/
|
|
386
636
|
export type ComputerUseKeyAction = typeof ComputerUseKeyAction.Type;
|
|
387
637
|
/**
|
|
388
|
-
*
|
|
638
|
+
* Schema for a computer-use action that performs a left click.
|
|
389
639
|
*
|
|
390
|
-
*
|
|
391
|
-
*
|
|
640
|
+
* **When to use**
|
|
641
|
+
*
|
|
642
|
+
* Use to validate or construct an Anthropic computer-use payload for clicking
|
|
643
|
+
* once at the current mouse position or at a specific screen coordinate.
|
|
644
|
+
*
|
|
645
|
+
* **Details**
|
|
646
|
+
*
|
|
647
|
+
* The encoded payload uses `action: "left_click"`. The optional `coordinate`
|
|
648
|
+
* field supplies the `[x, y]` pixel position; when omitted, the action uses the
|
|
649
|
+
* current mouse position.
|
|
650
|
+
*
|
|
651
|
+
* **Gotchas**
|
|
652
|
+
*
|
|
653
|
+
* The coordinate schema only checks that the value is a two-number tuple. It
|
|
654
|
+
* does not validate that the point falls within the configured display
|
|
655
|
+
* dimensions.
|
|
656
|
+
*
|
|
657
|
+
* @see {@link ComputerUseDoubleClickAction} for performing a double click
|
|
658
|
+
* @see {@link ComputerUseMouseMoveAction} for moving the mouse without clicking
|
|
659
|
+
*
|
|
660
|
+
* @category computer use
|
|
661
|
+
* @since 4.0.0
|
|
392
662
|
*/
|
|
393
663
|
export declare const ComputerUseLeftClickAction: Schema.Struct<{
|
|
394
664
|
readonly action: Schema.Literal<"left_click">;
|
|
@@ -399,15 +669,34 @@ export declare const ComputerUseLeftClickAction: Schema.Struct<{
|
|
|
399
669
|
readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
|
|
400
670
|
}>;
|
|
401
671
|
/**
|
|
402
|
-
*
|
|
403
|
-
*
|
|
672
|
+
* Computer-use action payload for performing a left click, optionally at a specific coordinate.
|
|
673
|
+
*
|
|
674
|
+
* @category computer use
|
|
675
|
+
* @since 4.0.0
|
|
404
676
|
*/
|
|
405
677
|
export type ComputerUseLeftClickAction = typeof ComputerUseLeftClickAction.Type;
|
|
406
678
|
/**
|
|
407
|
-
*
|
|
679
|
+
* Schema for a computer-use action that moves the mouse cursor to a required
|
|
680
|
+
* `[x, y]` screen coordinate.
|
|
681
|
+
*
|
|
682
|
+
* **When to use**
|
|
683
|
+
*
|
|
684
|
+
* Use to validate or construct a mouse movement action for an Anthropic
|
|
685
|
+
* computer-use tool call.
|
|
686
|
+
*
|
|
687
|
+
* **Details**
|
|
688
|
+
*
|
|
689
|
+
* The encoded payload has action `"mouse_move"` and a required `coordinate`
|
|
690
|
+
* field containing the target `[x, y]` pixel position.
|
|
691
|
+
*
|
|
692
|
+
* **Gotchas**
|
|
408
693
|
*
|
|
409
|
-
*
|
|
410
|
-
*
|
|
694
|
+
* The coordinate schema only checks that the value is a two-number tuple. It
|
|
695
|
+
* does not validate that the point falls within the configured display
|
|
696
|
+
* dimensions.
|
|
697
|
+
*
|
|
698
|
+
* @category computer use
|
|
699
|
+
* @since 4.0.0
|
|
411
700
|
*/
|
|
412
701
|
export declare const ComputerUseMouseMoveAction: Schema.Struct<{
|
|
413
702
|
readonly action: Schema.Literal<"mouse_move">;
|
|
@@ -417,29 +706,57 @@ export declare const ComputerUseMouseMoveAction: Schema.Struct<{
|
|
|
417
706
|
readonly coordinate: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
|
|
418
707
|
}>;
|
|
419
708
|
/**
|
|
420
|
-
*
|
|
421
|
-
*
|
|
709
|
+
* Computer-use action payload for moving the mouse cursor to a specific coordinate.
|
|
710
|
+
*
|
|
711
|
+
* @category computer use
|
|
712
|
+
* @since 4.0.0
|
|
422
713
|
*/
|
|
423
714
|
export type ComputerUseMouseMoveAction = typeof ComputerUseMouseMoveAction.Type;
|
|
424
715
|
/**
|
|
425
|
-
*
|
|
716
|
+
* Schema for a computer-use action that requests a screenshot of the current display.
|
|
717
|
+
*
|
|
718
|
+
* **When to use**
|
|
719
|
+
*
|
|
720
|
+
* Use to validate or construct a computer-use tool action that asks the handler
|
|
721
|
+
* to capture the full current display.
|
|
722
|
+
*
|
|
723
|
+
* **Details**
|
|
724
|
+
*
|
|
725
|
+
* The payload contains only `action: "screenshot"` and does not include
|
|
726
|
+
* coordinates or other options.
|
|
727
|
+
*
|
|
728
|
+
* @see {@link ComputerUseZoomAction} for requesting a zoomed-in screenshot of a specific screen region with the 2025-11-24 computer-use tool
|
|
426
729
|
*
|
|
427
|
-
* @
|
|
428
|
-
* @
|
|
730
|
+
* @category computer use
|
|
731
|
+
* @since 4.0.0
|
|
429
732
|
*/
|
|
430
733
|
export declare const ComputerUseScreenshotAction: Schema.Struct<{
|
|
431
734
|
readonly action: Schema.Literal<"screenshot">;
|
|
432
735
|
}>;
|
|
433
736
|
/**
|
|
434
|
-
*
|
|
435
|
-
*
|
|
737
|
+
* Computer-use action payload for capturing the current display.
|
|
738
|
+
*
|
|
739
|
+
* @category computer use
|
|
740
|
+
* @since 4.0.0
|
|
436
741
|
*/
|
|
437
742
|
export type ComputerUseScreenshotAction = typeof ComputerUseScreenshotAction.Type;
|
|
438
743
|
/**
|
|
439
|
-
*
|
|
744
|
+
* Schema for a computer-use action that enters text.
|
|
745
|
+
*
|
|
746
|
+
* **When to use**
|
|
747
|
+
*
|
|
748
|
+
* Use to validate or construct a computer-use action for entering ordinary text
|
|
749
|
+
* strings.
|
|
750
|
+
*
|
|
751
|
+
* **Details**
|
|
752
|
+
*
|
|
753
|
+
* The payload uses `action: "type"` and a `text` string containing the text to
|
|
754
|
+
* enter.
|
|
755
|
+
*
|
|
756
|
+
* @see {@link ComputerUseKeyAction} for key presses and keyboard shortcuts
|
|
440
757
|
*
|
|
441
|
-
* @
|
|
442
|
-
* @
|
|
758
|
+
* @category computer use
|
|
759
|
+
* @since 4.0.0
|
|
443
760
|
*/
|
|
444
761
|
export declare const TypeAction: Schema.Struct<{
|
|
445
762
|
readonly action: Schema.Literal<"type">;
|
|
@@ -449,15 +766,41 @@ export declare const TypeAction: Schema.Struct<{
|
|
|
449
766
|
readonly text: Schema.String;
|
|
450
767
|
}>;
|
|
451
768
|
/**
|
|
452
|
-
*
|
|
453
|
-
*
|
|
769
|
+
* Computer-use action payload for typing a text string.
|
|
770
|
+
*
|
|
771
|
+
* **Details**
|
|
772
|
+
*
|
|
773
|
+
* The payload uses `action: "type"` and a `text` string containing the text to
|
|
774
|
+
* enter.
|
|
775
|
+
*
|
|
776
|
+
* @category computer use
|
|
777
|
+
* @since 4.0.0
|
|
454
778
|
*/
|
|
455
779
|
export type TypeAction = typeof TypeAction.Type;
|
|
456
780
|
/**
|
|
457
|
-
*
|
|
781
|
+
* Schema for a computer-use action that performs a double click.
|
|
782
|
+
*
|
|
783
|
+
* **When to use**
|
|
784
|
+
*
|
|
785
|
+
* Use to validate or construct an Anthropic computer-use payload for double
|
|
786
|
+
* clicking at the current mouse position or at a specific screen coordinate.
|
|
787
|
+
*
|
|
788
|
+
* **Details**
|
|
789
|
+
*
|
|
790
|
+
* The encoded payload uses `action: "double_click"`. The optional
|
|
791
|
+
* `coordinate` field supplies the `[x, y]` pixel position; when omitted, the
|
|
792
|
+
* action uses the current mouse position.
|
|
458
793
|
*
|
|
459
|
-
*
|
|
460
|
-
*
|
|
794
|
+
* **Gotchas**
|
|
795
|
+
*
|
|
796
|
+
* The coordinate schema only checks that the value is a two-number tuple. It
|
|
797
|
+
* does not validate that the point falls within the configured display
|
|
798
|
+
* dimensions.
|
|
799
|
+
*
|
|
800
|
+
* @see {@link ComputerUseLeftClickAction} for performing a single left click
|
|
801
|
+
*
|
|
802
|
+
* @category computer use
|
|
803
|
+
* @since 4.0.0
|
|
461
804
|
*/
|
|
462
805
|
export declare const ComputerUseDoubleClickAction: Schema.Struct<{
|
|
463
806
|
readonly action: Schema.Literal<"double_click">;
|
|
@@ -468,15 +811,36 @@ export declare const ComputerUseDoubleClickAction: Schema.Struct<{
|
|
|
468
811
|
readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
|
|
469
812
|
}>;
|
|
470
813
|
/**
|
|
471
|
-
*
|
|
472
|
-
*
|
|
814
|
+
* Computer-use action payload for performing a double click, optionally at a specific coordinate.
|
|
815
|
+
*
|
|
816
|
+
* @category computer use
|
|
817
|
+
* @since 4.0.0
|
|
473
818
|
*/
|
|
474
819
|
export type ComputerUseDoubleClickAction = typeof ComputerUseDoubleClickAction.Type;
|
|
475
820
|
/**
|
|
476
|
-
*
|
|
821
|
+
* Keeps a key pressed for a specified duration during computer-use execution.
|
|
822
|
+
*
|
|
823
|
+
* **When to use**
|
|
824
|
+
*
|
|
825
|
+
* Use to keep a keyboard key depressed for a fixed number of seconds in a
|
|
826
|
+
* computer-use action sequence.
|
|
477
827
|
*
|
|
478
|
-
*
|
|
479
|
-
*
|
|
828
|
+
* **Details**
|
|
829
|
+
*
|
|
830
|
+
* The schema describes objects with `action: "hold_key"`, a `text` field
|
|
831
|
+
* containing the key to hold, and a `duration` field containing the number of
|
|
832
|
+
* seconds to hold it.
|
|
833
|
+
*
|
|
834
|
+
* **Gotchas**
|
|
835
|
+
*
|
|
836
|
+
* The schema only checks that `duration` is a number; it does not require a
|
|
837
|
+
* positive value.
|
|
838
|
+
*
|
|
839
|
+
* @see {@link ComputerUseKeyAction} for pressing a key or key combination without holding it
|
|
840
|
+
* @see {@link ComputerUseWaitAction} for pausing between actions without holding a key
|
|
841
|
+
*
|
|
842
|
+
* @category computer use
|
|
843
|
+
* @since 4.0.0
|
|
480
844
|
*/
|
|
481
845
|
export declare const ComputerUseHoldKeyAction: Schema.Struct<{
|
|
482
846
|
readonly action: Schema.Literal<"hold_key">;
|
|
@@ -490,15 +854,47 @@ export declare const ComputerUseHoldKeyAction: Schema.Struct<{
|
|
|
490
854
|
readonly duration: Schema.Number;
|
|
491
855
|
}>;
|
|
492
856
|
/**
|
|
493
|
-
*
|
|
494
|
-
*
|
|
857
|
+
* Computer-use action payload for holding a key for a specified duration.
|
|
858
|
+
*
|
|
859
|
+
* **When to use**
|
|
860
|
+
*
|
|
861
|
+
* Use to represent a key that should remain pressed for a measured interval.
|
|
862
|
+
*
|
|
863
|
+
* **Details**
|
|
864
|
+
*
|
|
865
|
+
* Set `action` to `"hold_key"`, `text` to the key to hold, and `duration` to
|
|
866
|
+
* the number of seconds to hold it.
|
|
867
|
+
*
|
|
868
|
+
* @see {@link ComputerUseKeyAction} for a single key press or key combination without a hold duration
|
|
869
|
+
*
|
|
870
|
+
* @category computer use
|
|
871
|
+
* @since 4.0.0
|
|
495
872
|
*/
|
|
496
873
|
export type ComputerUseHoldKeyAction = typeof ComputerUseHoldKeyAction.Type;
|
|
497
874
|
/**
|
|
498
|
-
*
|
|
875
|
+
* Schema for a computer-use action that drags with the left mouse button.
|
|
876
|
+
*
|
|
877
|
+
* **When to use**
|
|
499
878
|
*
|
|
500
|
-
*
|
|
501
|
-
*
|
|
879
|
+
* Use to validate or construct an Anthropic computer-use payload for dragging
|
|
880
|
+
* from one screen coordinate to another in a single action.
|
|
881
|
+
*
|
|
882
|
+
* **Details**
|
|
883
|
+
*
|
|
884
|
+
* The encoded payload uses `action: "left_click_drag"` and requires both
|
|
885
|
+
* `start_coordinate` and `coordinate` as `[x, y]` pixel positions.
|
|
886
|
+
*
|
|
887
|
+
* **Gotchas**
|
|
888
|
+
*
|
|
889
|
+
* The coordinate schema only checks that each value is a two-number tuple. It
|
|
890
|
+
* does not validate that either point falls within the configured display
|
|
891
|
+
* dimensions.
|
|
892
|
+
*
|
|
893
|
+
* @see {@link ComputerUseLeftMouseDownAction} for starting a manual drag sequence
|
|
894
|
+
* @see {@link ComputerUseLeftMouseUpAction} for ending a manual drag sequence
|
|
895
|
+
*
|
|
896
|
+
* @category computer use
|
|
897
|
+
* @since 4.0.0
|
|
502
898
|
*/
|
|
503
899
|
export declare const ComputerUseLeftClickDragAction: Schema.Struct<{
|
|
504
900
|
readonly action: Schema.Literal<"left_click_drag">;
|
|
@@ -512,17 +908,22 @@ export declare const ComputerUseLeftClickDragAction: Schema.Struct<{
|
|
|
512
908
|
readonly coordinate: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
|
|
513
909
|
}>;
|
|
514
910
|
/**
|
|
515
|
-
*
|
|
516
|
-
*
|
|
911
|
+
* Computer-use action payload for dragging from a start coordinate to an end coordinate.
|
|
912
|
+
*
|
|
913
|
+
* @category computer use
|
|
914
|
+
* @since 4.0.0
|
|
517
915
|
*/
|
|
518
916
|
export type ComputerUseLeftClickDragAction = typeof ComputerUseLeftClickDragAction.Type;
|
|
519
917
|
/**
|
|
520
|
-
*
|
|
918
|
+
* Starts a left mouse button press without releasing it.
|
|
521
919
|
*
|
|
522
|
-
*
|
|
920
|
+
* **When to use**
|
|
523
921
|
*
|
|
524
|
-
*
|
|
525
|
-
*
|
|
922
|
+
* Use when constructing a manual click or drag sequence that should press and
|
|
923
|
+
* hold the left mouse button before a later release.
|
|
924
|
+
*
|
|
925
|
+
* @category computer use
|
|
926
|
+
* @since 4.0.0
|
|
526
927
|
*/
|
|
527
928
|
export declare const ComputerUseLeftMouseDownAction: Schema.Struct<{
|
|
528
929
|
readonly action: Schema.Literal<"left_mouse_down">;
|
|
@@ -533,17 +934,22 @@ export declare const ComputerUseLeftMouseDownAction: Schema.Struct<{
|
|
|
533
934
|
readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
|
|
534
935
|
}>;
|
|
535
936
|
/**
|
|
536
|
-
*
|
|
537
|
-
*
|
|
937
|
+
* Computer-use action payload for pressing and holding the left mouse button, optionally at a specific coordinate.
|
|
938
|
+
*
|
|
939
|
+
* @category computer use
|
|
940
|
+
* @since 4.0.0
|
|
538
941
|
*/
|
|
539
942
|
export type ComputerUseLeftMouseDownAction = typeof ComputerUseLeftMouseDownAction.Type;
|
|
540
943
|
/**
|
|
541
|
-
*
|
|
944
|
+
* Releases the left mouse button.
|
|
945
|
+
*
|
|
946
|
+
* **When to use**
|
|
542
947
|
*
|
|
543
|
-
*
|
|
948
|
+
* Use when constructing a manual click or drag sequence that should release the
|
|
949
|
+
* left mouse button after it was previously held down.
|
|
544
950
|
*
|
|
545
|
-
* @
|
|
546
|
-
* @
|
|
951
|
+
* @category computer use
|
|
952
|
+
* @since 4.0.0
|
|
547
953
|
*/
|
|
548
954
|
export declare const ComputerUseLeftMouseUpAction: Schema.Struct<{
|
|
549
955
|
readonly action: Schema.Literal<"left_mouse_up">;
|
|
@@ -554,15 +960,36 @@ export declare const ComputerUseLeftMouseUpAction: Schema.Struct<{
|
|
|
554
960
|
readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
|
|
555
961
|
}>;
|
|
556
962
|
/**
|
|
557
|
-
*
|
|
558
|
-
*
|
|
963
|
+
* Computer-use action payload for releasing the left mouse button, optionally at a specific coordinate.
|
|
964
|
+
*
|
|
965
|
+
* @category computer use
|
|
966
|
+
* @since 4.0.0
|
|
559
967
|
*/
|
|
560
968
|
export type ComputerUseLeftMouseUpAction = typeof ComputerUseLeftMouseUpAction.Type;
|
|
561
969
|
/**
|
|
562
|
-
*
|
|
970
|
+
* Schema for a computer-use action that performs a middle click.
|
|
971
|
+
*
|
|
972
|
+
* **When to use**
|
|
973
|
+
*
|
|
974
|
+
* Use to validate or construct a middle-button click action for Anthropic
|
|
975
|
+
* computer use, optionally targeting a specific screen coordinate.
|
|
563
976
|
*
|
|
564
|
-
*
|
|
565
|
-
*
|
|
977
|
+
* **Details**
|
|
978
|
+
*
|
|
979
|
+
* The payload must use `action: "middle_click"`. When `coordinate` is omitted,
|
|
980
|
+
* the click occurs at the current mouse position.
|
|
981
|
+
*
|
|
982
|
+
* **Gotchas**
|
|
983
|
+
*
|
|
984
|
+
* This action is available in the 2025-01-24 computer-use action set and later;
|
|
985
|
+
* it is not part of `ComputerUse_20241022`.
|
|
986
|
+
*
|
|
987
|
+
* @see {@link ComputerUse_20250124} for the provider-defined tool version that first accepts this action
|
|
988
|
+
* @see {@link ComputerUseLeftClickAction} for primary-button clicks
|
|
989
|
+
* @see {@link ComputerUseRightClickAction} for secondary-button clicks
|
|
990
|
+
*
|
|
991
|
+
* @category computer use
|
|
992
|
+
* @since 4.0.0
|
|
566
993
|
*/
|
|
567
994
|
export declare const ComputerUseMiddleClickAction: Schema.Struct<{
|
|
568
995
|
readonly action: Schema.Literal<"middle_click">;
|
|
@@ -573,15 +1000,32 @@ export declare const ComputerUseMiddleClickAction: Schema.Struct<{
|
|
|
573
1000
|
readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
|
|
574
1001
|
}>;
|
|
575
1002
|
/**
|
|
576
|
-
*
|
|
577
|
-
*
|
|
1003
|
+
* Computer-use action payload for performing a middle click, optionally at a specific coordinate.
|
|
1004
|
+
*
|
|
1005
|
+
* @category computer use
|
|
1006
|
+
* @since 4.0.0
|
|
578
1007
|
*/
|
|
579
1008
|
export type ComputerUseMiddleClickAction = typeof ComputerUseMiddleClickAction.Type;
|
|
580
1009
|
/**
|
|
581
|
-
*
|
|
1010
|
+
* Schema for a computer-use action that performs a right click, optionally at a
|
|
1011
|
+
* specific screen coordinate.
|
|
582
1012
|
*
|
|
583
|
-
*
|
|
584
|
-
*
|
|
1013
|
+
* **When to use**
|
|
1014
|
+
*
|
|
1015
|
+
* Use to validate or construct the `right_click` action for an Anthropic
|
|
1016
|
+
* computer-use tool call.
|
|
1017
|
+
*
|
|
1018
|
+
* **Details**
|
|
1019
|
+
*
|
|
1020
|
+
* The optional `coordinate` field is an `[x, y]` screen coordinate in pixels.
|
|
1021
|
+
* When omitted, the right click is performed at the current mouse position.
|
|
1022
|
+
*
|
|
1023
|
+
* @see {@link ComputerUse_20250124} for the provider-defined computer-use tool version that introduced this action
|
|
1024
|
+
* @see {@link ComputerUseLeftClickAction} for the corresponding left-click action
|
|
1025
|
+
* @see {@link ComputerUseMiddleClickAction} for the corresponding middle-click action
|
|
1026
|
+
*
|
|
1027
|
+
* @category computer use
|
|
1028
|
+
* @since 4.0.0
|
|
585
1029
|
*/
|
|
586
1030
|
export declare const ComputerUseRightClickAction: Schema.Struct<{
|
|
587
1031
|
readonly action: Schema.Literal<"right_click">;
|
|
@@ -592,15 +1036,34 @@ export declare const ComputerUseRightClickAction: Schema.Struct<{
|
|
|
592
1036
|
readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
|
|
593
1037
|
}>;
|
|
594
1038
|
/**
|
|
595
|
-
*
|
|
596
|
-
*
|
|
1039
|
+
* Computer-use action payload for performing a right click, optionally at a specific coordinate.
|
|
1040
|
+
*
|
|
1041
|
+
* @category computer use
|
|
1042
|
+
* @since 4.0.0
|
|
597
1043
|
*/
|
|
598
1044
|
export type ComputerUseRightClickAction = typeof ComputerUseRightClickAction.Type;
|
|
599
1045
|
/**
|
|
600
|
-
*
|
|
1046
|
+
* Schema for a computer-use scroll action.
|
|
601
1047
|
*
|
|
602
|
-
*
|
|
603
|
-
*
|
|
1048
|
+
* **When to use**
|
|
1049
|
+
*
|
|
1050
|
+
* Use when validating or constructing Anthropic computer-use scroll payloads.
|
|
1051
|
+
*
|
|
1052
|
+
* **Details**
|
|
1053
|
+
*
|
|
1054
|
+
* The encoded payload uses `action: "scroll"`, an optional `coordinate`,
|
|
1055
|
+
* `scroll_direction`, and `scroll_amount`.
|
|
1056
|
+
*
|
|
1057
|
+
* **Gotchas**
|
|
1058
|
+
*
|
|
1059
|
+
* `coordinate` only checks a two-number tuple, and `scroll_amount` is only
|
|
1060
|
+
* `Schema.Number`.
|
|
1061
|
+
*
|
|
1062
|
+
* @see {@link ComputerUse_20250124} for the tool version that accepts this action
|
|
1063
|
+
* @see {@link ScrollDirection} for the accepted direction literals
|
|
1064
|
+
*
|
|
1065
|
+
* @category computer use
|
|
1066
|
+
* @since 4.0.0
|
|
604
1067
|
*/
|
|
605
1068
|
export declare const ComputerUseScrollAction: Schema.Struct<{
|
|
606
1069
|
readonly action: Schema.Literal<"scroll">;
|
|
@@ -619,15 +1082,36 @@ export declare const ComputerUseScrollAction: Schema.Struct<{
|
|
|
619
1082
|
readonly scroll_amount: Schema.Number;
|
|
620
1083
|
}>;
|
|
621
1084
|
/**
|
|
622
|
-
*
|
|
623
|
-
*
|
|
1085
|
+
* Computer-use action payload for scrolling by a specified amount in a specified direction, optionally from a coordinate.
|
|
1086
|
+
*
|
|
1087
|
+
* @category computer use
|
|
1088
|
+
* @since 4.0.0
|
|
624
1089
|
*/
|
|
625
1090
|
export type ComputerUseScrollAction = typeof ComputerUseScrollAction.Type;
|
|
626
1091
|
/**
|
|
627
|
-
*
|
|
1092
|
+
* Schema for a computer-use triple-click action.
|
|
1093
|
+
*
|
|
1094
|
+
* **When to use**
|
|
1095
|
+
*
|
|
1096
|
+
* Use when validating or constructing Anthropic computer-use triple-click
|
|
1097
|
+
* payloads at the current pointer position or an optional coordinate.
|
|
1098
|
+
*
|
|
1099
|
+
* **Details**
|
|
1100
|
+
*
|
|
1101
|
+
* The encoded payload uses `action: "triple_click"` and an optional
|
|
1102
|
+
* `coordinate`.
|
|
1103
|
+
*
|
|
1104
|
+
* **Gotchas**
|
|
628
1105
|
*
|
|
629
|
-
*
|
|
630
|
-
*
|
|
1106
|
+
* `coordinate` only validates as a two-number tuple and does not check display
|
|
1107
|
+
* bounds.
|
|
1108
|
+
*
|
|
1109
|
+
* @see {@link ComputerUse_20250124} for the tool version that accepts this action
|
|
1110
|
+
* @see {@link ComputerUseDoubleClickAction} for the two-click variant
|
|
1111
|
+
* @see {@link ComputerUseLeftClickAction} for a single left click
|
|
1112
|
+
*
|
|
1113
|
+
* @category computer use
|
|
1114
|
+
* @since 4.0.0
|
|
631
1115
|
*/
|
|
632
1116
|
export declare const ComputerUseTripleClickAction: Schema.Struct<{
|
|
633
1117
|
readonly action: Schema.Literal<"triple_click">;
|
|
@@ -638,15 +1122,35 @@ export declare const ComputerUseTripleClickAction: Schema.Struct<{
|
|
|
638
1122
|
readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
|
|
639
1123
|
}>;
|
|
640
1124
|
/**
|
|
641
|
-
*
|
|
642
|
-
*
|
|
1125
|
+
* Computer-use action payload for performing a triple click, optionally at a specific coordinate.
|
|
1126
|
+
*
|
|
1127
|
+
* @category computer use
|
|
1128
|
+
* @since 4.0.0
|
|
643
1129
|
*/
|
|
644
1130
|
export type ComputerUseTripleClickAction = typeof ComputerUseTripleClickAction.Type;
|
|
645
1131
|
/**
|
|
646
|
-
*
|
|
1132
|
+
* Schema for a computer-use wait action.
|
|
1133
|
+
*
|
|
1134
|
+
* **When to use**
|
|
1135
|
+
*
|
|
1136
|
+
* Use when validating or constructing Anthropic computer-use payloads that pause
|
|
1137
|
+
* between actions.
|
|
1138
|
+
*
|
|
1139
|
+
* **Details**
|
|
647
1140
|
*
|
|
648
|
-
*
|
|
649
|
-
*
|
|
1141
|
+
* The encoded payload uses `action: "wait"` and a required `duration` in
|
|
1142
|
+
* seconds.
|
|
1143
|
+
*
|
|
1144
|
+
* **Gotchas**
|
|
1145
|
+
*
|
|
1146
|
+
* `duration` is only `Schema.Number`; it is not constrained to positive or
|
|
1147
|
+
* finite values.
|
|
1148
|
+
*
|
|
1149
|
+
* @see {@link ComputerUseHoldKeyAction} for another duration-based computer-use action
|
|
1150
|
+
* @see {@link ComputerUse_20250124} for the tool version that accepts this action
|
|
1151
|
+
*
|
|
1152
|
+
* @category computer use
|
|
1153
|
+
* @since 4.0.0
|
|
650
1154
|
*/
|
|
651
1155
|
export declare const ComputerUseWaitAction: Schema.Struct<{
|
|
652
1156
|
readonly action: Schema.Literal<"wait">;
|
|
@@ -656,17 +1160,34 @@ export declare const ComputerUseWaitAction: Schema.Struct<{
|
|
|
656
1160
|
readonly duration: Schema.Number;
|
|
657
1161
|
}>;
|
|
658
1162
|
/**
|
|
659
|
-
*
|
|
660
|
-
*
|
|
1163
|
+
* Computer-use action payload for pausing for a specified duration.
|
|
1164
|
+
*
|
|
1165
|
+
* @category computer use
|
|
1166
|
+
* @since 4.0.0
|
|
661
1167
|
*/
|
|
662
1168
|
export type ComputerUseWaitAction = typeof ComputerUseWaitAction.Type;
|
|
663
1169
|
/**
|
|
664
|
-
*
|
|
1170
|
+
* Zooms into a specific region of the screen at full resolution.
|
|
1171
|
+
*
|
|
1172
|
+
* **When to use**
|
|
665
1173
|
*
|
|
666
|
-
*
|
|
1174
|
+
* Use when building or validating the 2025-11-24 computer-use action for a
|
|
1175
|
+
* zoom-enabled tool definition.
|
|
667
1176
|
*
|
|
668
|
-
*
|
|
669
|
-
*
|
|
1177
|
+
* **Details**
|
|
1178
|
+
*
|
|
1179
|
+
* The encoded payload uses `action: "zoom"` and a `region` tuple.
|
|
1180
|
+
*
|
|
1181
|
+
* **Gotchas**
|
|
1182
|
+
*
|
|
1183
|
+
* Requires `enableZoom: true` in the tool definition. `region` is only a
|
|
1184
|
+
* four-number tuple and does not validate corner ordering or display bounds.
|
|
1185
|
+
*
|
|
1186
|
+
* @see {@link ComputerUse_20251124} for the tool version that accepts this action
|
|
1187
|
+
* @see {@link ComputerUseScreenshotAction} for capturing the full screen instead
|
|
1188
|
+
*
|
|
1189
|
+
* @category computer use
|
|
1190
|
+
* @since 4.0.0
|
|
670
1191
|
*/
|
|
671
1192
|
export declare const ComputerUseZoomAction: Schema.Struct<{
|
|
672
1193
|
readonly action: Schema.Literal<"zoom">;
|
|
@@ -677,19 +1198,28 @@ export declare const ComputerUseZoomAction: Schema.Struct<{
|
|
|
677
1198
|
readonly region: Schema.Tuple<readonly [Schema.Number, Schema.Number, Schema.Number, Schema.Number]>;
|
|
678
1199
|
}>;
|
|
679
1200
|
/**
|
|
680
|
-
*
|
|
681
|
-
*
|
|
1201
|
+
* Computer-use action payload for zooming into a specific screen region.
|
|
1202
|
+
*
|
|
1203
|
+
* **Gotchas**
|
|
1204
|
+
*
|
|
1205
|
+
* The enclosing computer-use tool must be configured with `enableZoom: true`.
|
|
1206
|
+
* `region` is only a four-number tuple and does not validate corner ordering or
|
|
1207
|
+
* display bounds.
|
|
1208
|
+
*
|
|
1209
|
+
* @category computer use
|
|
1210
|
+
* @since 4.0.0
|
|
682
1211
|
*/
|
|
683
1212
|
export type ComputerUseZoomAction = typeof ComputerUseZoomAction.Type;
|
|
684
1213
|
/**
|
|
685
|
-
*
|
|
1214
|
+
* Defines the deprecated computer-use tool for Claude 3.5 Sonnet v2.
|
|
686
1215
|
*
|
|
687
|
-
*
|
|
1216
|
+
* **Details**
|
|
688
1217
|
*
|
|
1218
|
+
* Requires the "computer-use-2024-10-22" beta header.
|
|
689
1219
|
* Basic actions only: screenshot, left_click, type, key, mouse_move.
|
|
690
1220
|
*
|
|
691
|
-
* @
|
|
692
|
-
* @
|
|
1221
|
+
* @category computer use
|
|
1222
|
+
* @since 4.0.0
|
|
693
1223
|
*/
|
|
694
1224
|
export declare const ComputerUse_20241022: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
|
|
695
1225
|
readonly displayWidthPx: number;
|
|
@@ -746,16 +1276,25 @@ export declare const ComputerUse_20241022: <Mode extends Tool.FailureMode | unde
|
|
|
746
1276
|
readonly failureMode: Mode extends undefined ? "error" : Mode;
|
|
747
1277
|
}, true>;
|
|
748
1278
|
/**
|
|
749
|
-
*
|
|
1279
|
+
* Defines the computer-use tool for Claude 4 models and Claude Sonnet 3.7.
|
|
750
1280
|
*
|
|
751
|
-
*
|
|
1281
|
+
* **When to use**
|
|
1282
|
+
*
|
|
1283
|
+
* Use when you need Anthropic computer use for Claude 4 models or Claude
|
|
1284
|
+
* Sonnet 3.7 with the 2025-01-24 action set.
|
|
1285
|
+
*
|
|
1286
|
+
* **Details**
|
|
752
1287
|
*
|
|
1288
|
+
* Requires the "computer-use-2025-01-24" beta header.
|
|
753
1289
|
* Includes basic actions plus enhanced actions: scroll, left_click_drag,
|
|
754
1290
|
* right_click, middle_click, double_click, triple_click, left_mouse_down,
|
|
755
1291
|
* left_mouse_up, hold_key, wait.
|
|
756
1292
|
*
|
|
757
|
-
* @
|
|
758
|
-
* @
|
|
1293
|
+
* @see {@link ComputerUse_20241022} for the older basic action set
|
|
1294
|
+
* @see {@link ComputerUse_20251124} for the newer zoom-capable version
|
|
1295
|
+
*
|
|
1296
|
+
* @category computer use
|
|
1297
|
+
* @since 4.0.0
|
|
759
1298
|
*/
|
|
760
1299
|
export declare const ComputerUse_20250124: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
|
|
761
1300
|
readonly displayWidthPx: number;
|
|
@@ -895,21 +1434,34 @@ export declare const ComputerUse_20250124: <Mode extends Tool.FailureMode | unde
|
|
|
895
1434
|
readonly failureMode: Mode extends undefined ? "error" : Mode;
|
|
896
1435
|
}, true>;
|
|
897
1436
|
/**
|
|
898
|
-
*
|
|
1437
|
+
* Defines the computer-use tool for Claude Opus 4.5 only.
|
|
899
1438
|
*
|
|
900
|
-
*
|
|
1439
|
+
* **When to use**
|
|
1440
|
+
*
|
|
1441
|
+
* Use when you need Anthropic computer use for Claude Opus 4.5 with the
|
|
1442
|
+
* 2025-11-24 action set and zoom-capable screen inspection.
|
|
901
1443
|
*
|
|
1444
|
+
* **Details**
|
|
1445
|
+
*
|
|
1446
|
+
* Requires the "computer-use-2025-11-24" beta header.
|
|
902
1447
|
* Includes all actions from computer_20250124 plus the zoom action for
|
|
903
|
-
* detailed screen region inspection.
|
|
1448
|
+
* detailed screen region inspection.
|
|
1449
|
+
*
|
|
1450
|
+
* **Gotchas**
|
|
904
1451
|
*
|
|
905
|
-
*
|
|
906
|
-
*
|
|
1452
|
+
* Zoom actions require `enableZoom: true` in args.
|
|
1453
|
+
*
|
|
1454
|
+
* @see {@link ComputerUse_20250124} for the previous action set without zoom
|
|
1455
|
+
* @see {@link ComputerUseZoomAction} for the zoom action payload
|
|
1456
|
+
*
|
|
1457
|
+
* @category computer use
|
|
1458
|
+
* @since 4.0.0
|
|
907
1459
|
*/
|
|
908
1460
|
export declare const ComputerUse_20251124: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
|
|
909
1461
|
readonly displayWidthPx: number;
|
|
910
1462
|
readonly displayHeightPx: number;
|
|
911
|
-
readonly displayNumber?: number | undefined;
|
|
912
1463
|
readonly enableZoom?: boolean | undefined;
|
|
1464
|
+
readonly displayNumber?: number | undefined;
|
|
913
1465
|
readonly failureMode?: Mode | undefined;
|
|
914
1466
|
}) => Tool.ProviderDefined<"anthropic.computer_20251124", "AnthropicComputerUse", {
|
|
915
1467
|
readonly args: Schema.Struct<{
|
|
@@ -1052,27 +1604,46 @@ export declare const ComputerUse_20251124: <Mode extends Tool.FailureMode | unde
|
|
|
1052
1604
|
readonly failureMode: Mode extends undefined ? "error" : Mode;
|
|
1053
1605
|
}, true>;
|
|
1054
1606
|
/**
|
|
1055
|
-
*
|
|
1607
|
+
* Defines a `[start, end]` line range for viewing file contents.
|
|
1608
|
+
*
|
|
1609
|
+
* **When to use**
|
|
1610
|
+
*
|
|
1611
|
+
* Use when constructing or validating `view_range` for memory or text editor
|
|
1612
|
+
* view commands.
|
|
1056
1613
|
*
|
|
1057
|
-
*
|
|
1614
|
+
* **Details**
|
|
1058
1615
|
*
|
|
1059
|
-
*
|
|
1060
|
-
*
|
|
1616
|
+
* Lines are 1-indexed. Use `-1` for end to read to the end of the file. For
|
|
1617
|
+
* example, `[1, 50]` views lines 1-50 and `[100, -1]` views from line 100 to
|
|
1618
|
+
* the end of the file.
|
|
1061
1619
|
*
|
|
1062
|
-
* @
|
|
1063
|
-
* @
|
|
1620
|
+
* @see {@link MemoryViewCommand} for memory view payloads that use this range
|
|
1621
|
+
* @see {@link TextEditorViewCommand} for text editor view payloads that use this range
|
|
1622
|
+
*
|
|
1623
|
+
* @category memory
|
|
1624
|
+
* @since 4.0.0
|
|
1064
1625
|
*/
|
|
1065
1626
|
export declare const ViewRange: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
|
|
1066
1627
|
/**
|
|
1067
|
-
*
|
|
1068
|
-
*
|
|
1628
|
+
* 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.
|
|
1629
|
+
*
|
|
1630
|
+
* **When to use**
|
|
1631
|
+
*
|
|
1632
|
+
* Use when typing `view_range` for memory or text editor view commands.
|
|
1633
|
+
*
|
|
1634
|
+
* @category memory
|
|
1635
|
+
* @since 4.0.0
|
|
1069
1636
|
*/
|
|
1070
1637
|
export type ViewRange = typeof ViewRange.Type;
|
|
1071
1638
|
/**
|
|
1072
|
-
*
|
|
1639
|
+
* Schema for the memory tool command that creates a new file at a path.
|
|
1073
1640
|
*
|
|
1074
|
-
*
|
|
1075
|
-
*
|
|
1641
|
+
* **Details**
|
|
1642
|
+
*
|
|
1643
|
+
* The payload contains `command: "create"` and a `path` string.
|
|
1644
|
+
*
|
|
1645
|
+
* @category memory
|
|
1646
|
+
* @since 4.0.0
|
|
1076
1647
|
*/
|
|
1077
1648
|
export declare const MemoryCreateCommand: Schema.Struct<{
|
|
1078
1649
|
readonly command: Schema.Literal<"create">;
|
|
@@ -1082,33 +1653,49 @@ export declare const MemoryCreateCommand: Schema.Struct<{
|
|
|
1082
1653
|
readonly path: Schema.String;
|
|
1083
1654
|
}>;
|
|
1084
1655
|
/**
|
|
1085
|
-
*
|
|
1086
|
-
*
|
|
1656
|
+
* Memory tool command payload for creating a new file at a path.
|
|
1657
|
+
*
|
|
1658
|
+
* @category memory
|
|
1659
|
+
* @since 4.0.0
|
|
1087
1660
|
*/
|
|
1088
1661
|
export type MemoryCreateCommand = typeof MemoryCreateCommand.Type;
|
|
1089
1662
|
/**
|
|
1090
|
-
*
|
|
1663
|
+
* Schema for a memory command that deletes a file or directory.
|
|
1091
1664
|
*
|
|
1092
|
-
* @
|
|
1093
|
-
* @
|
|
1665
|
+
* @category memory
|
|
1666
|
+
* @since 4.0.0
|
|
1094
1667
|
*/
|
|
1095
1668
|
export declare const MemoryDeleteCommand: Schema.Struct<{
|
|
1096
1669
|
readonly command: Schema.Literal<"delete">;
|
|
1097
1670
|
/**
|
|
1098
|
-
* The path to the file to delete.
|
|
1671
|
+
* The path to the file or directory to delete.
|
|
1099
1672
|
*/
|
|
1100
1673
|
readonly path: Schema.String;
|
|
1101
1674
|
}>;
|
|
1102
1675
|
/**
|
|
1103
|
-
*
|
|
1104
|
-
*
|
|
1676
|
+
* Memory tool command payload for deleting a file or directory at a path.
|
|
1677
|
+
*
|
|
1678
|
+
* @category memory
|
|
1679
|
+
* @since 4.0.0
|
|
1105
1680
|
*/
|
|
1106
1681
|
export type MemoryDeleteCommand = typeof MemoryDeleteCommand.Type;
|
|
1107
1682
|
/**
|
|
1108
|
-
*
|
|
1683
|
+
* Schema for the memory `insert` command.
|
|
1684
|
+
*
|
|
1685
|
+
* **When to use**
|
|
1686
|
+
*
|
|
1687
|
+
* Use when validating or constructing `insert` payloads for `Memory_20250818`.
|
|
1688
|
+
*
|
|
1689
|
+
* **Details**
|
|
1690
|
+
*
|
|
1691
|
+
* The payload is discriminated by `command: "insert"` and requires `path`,
|
|
1692
|
+
* `insert_line`, and `insert_text`.
|
|
1693
|
+
*
|
|
1694
|
+
* @see {@link Memory_20250818} for the provider-defined tool that consumes this command
|
|
1695
|
+
* @see {@link MemoryStrReplaceCommand} for replacing existing text instead
|
|
1109
1696
|
*
|
|
1110
|
-
* @
|
|
1111
|
-
* @
|
|
1697
|
+
* @category memory
|
|
1698
|
+
* @since 4.0.0
|
|
1112
1699
|
*/
|
|
1113
1700
|
export declare const MemoryInsertCommand: Schema.Struct<{
|
|
1114
1701
|
readonly command: Schema.Literal<"insert">;
|
|
@@ -1126,15 +1713,22 @@ export declare const MemoryInsertCommand: Schema.Struct<{
|
|
|
1126
1713
|
readonly insert_text: Schema.String;
|
|
1127
1714
|
}>;
|
|
1128
1715
|
/**
|
|
1129
|
-
*
|
|
1130
|
-
*
|
|
1716
|
+
* Memory tool command payload for inserting text at a specific line in a file.
|
|
1717
|
+
*
|
|
1718
|
+
* @category memory
|
|
1719
|
+
* @since 4.0.0
|
|
1131
1720
|
*/
|
|
1132
1721
|
export type MemoryInsertCommand = typeof MemoryInsertCommand.Type;
|
|
1133
1722
|
/**
|
|
1134
|
-
*
|
|
1723
|
+
* Schema for the memory command that renames or moves a file or directory.
|
|
1724
|
+
*
|
|
1725
|
+
* **Details**
|
|
1726
|
+
*
|
|
1727
|
+
* The payload uses `command: "rename"` and requires `old_path` as the current
|
|
1728
|
+
* path plus `new_path` as the new destination path.
|
|
1135
1729
|
*
|
|
1136
|
-
* @
|
|
1137
|
-
* @
|
|
1730
|
+
* @category memory
|
|
1731
|
+
* @since 4.0.0
|
|
1138
1732
|
*/
|
|
1139
1733
|
export declare const MemoryRenameCommand: Schema.Struct<{
|
|
1140
1734
|
readonly command: Schema.Literal<"rename">;
|
|
@@ -1148,15 +1742,29 @@ export declare const MemoryRenameCommand: Schema.Struct<{
|
|
|
1148
1742
|
readonly new_path: Schema.String;
|
|
1149
1743
|
}>;
|
|
1150
1744
|
/**
|
|
1151
|
-
*
|
|
1152
|
-
*
|
|
1745
|
+
* Memory tool command payload for renaming or moving a file or directory.
|
|
1746
|
+
*
|
|
1747
|
+
* @category memory
|
|
1748
|
+
* @since 4.0.0
|
|
1153
1749
|
*/
|
|
1154
1750
|
export type MemoryRenameCommand = typeof MemoryRenameCommand.Type;
|
|
1155
1751
|
/**
|
|
1156
|
-
*
|
|
1752
|
+
* Schema for the memory `str_replace` command.
|
|
1753
|
+
*
|
|
1754
|
+
* **When to use**
|
|
1755
|
+
*
|
|
1756
|
+
* Use when validating or constructing `str_replace` payloads for
|
|
1757
|
+
* `Memory_20250818`.
|
|
1157
1758
|
*
|
|
1158
|
-
*
|
|
1159
|
-
*
|
|
1759
|
+
* **Details**
|
|
1760
|
+
*
|
|
1761
|
+
* The payload is discriminated by `command: "str_replace"` and requires `path`,
|
|
1762
|
+
* `old_str`, and `new_str`.
|
|
1763
|
+
*
|
|
1764
|
+
* @see {@link Memory_20250818} for the provider-defined tool that consumes this command
|
|
1765
|
+
*
|
|
1766
|
+
* @category memory
|
|
1767
|
+
* @since 4.0.0
|
|
1160
1768
|
*/
|
|
1161
1769
|
export declare const MemoryStrReplaceCommand: Schema.Struct<{
|
|
1162
1770
|
readonly command: Schema.Literal<"str_replace">;
|
|
@@ -1174,20 +1782,27 @@ export declare const MemoryStrReplaceCommand: Schema.Struct<{
|
|
|
1174
1782
|
readonly new_str: Schema.String;
|
|
1175
1783
|
}>;
|
|
1176
1784
|
/**
|
|
1177
|
-
*
|
|
1178
|
-
*
|
|
1785
|
+
* Memory tool command payload for replacing text in a file.
|
|
1786
|
+
*
|
|
1787
|
+
* @category memory
|
|
1788
|
+
* @since 4.0.0
|
|
1179
1789
|
*/
|
|
1180
1790
|
export type MemoryStrReplaceCommand = typeof MemoryStrReplaceCommand.Type;
|
|
1181
1791
|
/**
|
|
1182
1792
|
* Shows directory contents or file contents with optional line ranges.
|
|
1183
1793
|
*
|
|
1184
|
-
*
|
|
1185
|
-
*
|
|
1794
|
+
* **Details**
|
|
1795
|
+
*
|
|
1796
|
+
* When used on a file, returns file contents optionally limited by `view_range`.
|
|
1797
|
+
* When used on a directory, lists contents.
|
|
1798
|
+
*
|
|
1799
|
+
* @category memory
|
|
1800
|
+
* @since 4.0.0
|
|
1186
1801
|
*/
|
|
1187
1802
|
export declare const MemoryViewCommand: Schema.Struct<{
|
|
1188
1803
|
readonly command: Schema.Literal<"view">;
|
|
1189
1804
|
/**
|
|
1190
|
-
* The path to the file to view.
|
|
1805
|
+
* The path to the file or directory to view.
|
|
1191
1806
|
*/
|
|
1192
1807
|
readonly path: Schema.String;
|
|
1193
1808
|
/**
|
|
@@ -1196,18 +1811,22 @@ export declare const MemoryViewCommand: Schema.Struct<{
|
|
|
1196
1811
|
readonly view_range: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
|
|
1197
1812
|
}>;
|
|
1198
1813
|
/**
|
|
1199
|
-
*
|
|
1200
|
-
*
|
|
1814
|
+
* Memory tool command payload for viewing a file or directory, optionally with a file line range.
|
|
1815
|
+
*
|
|
1816
|
+
* @category memory
|
|
1817
|
+
* @since 4.0.0
|
|
1201
1818
|
*/
|
|
1202
1819
|
export type MemoryViewCommand = typeof MemoryViewCommand.Type;
|
|
1203
1820
|
/**
|
|
1204
|
-
*
|
|
1821
|
+
* Defines the memory tool for persistent file operations across conversations.
|
|
1822
|
+
*
|
|
1823
|
+
* **Details**
|
|
1205
1824
|
*
|
|
1206
1825
|
* Provides commands for creating, viewing, editing, renaming, and deleting
|
|
1207
1826
|
* files within the model's memory space.
|
|
1208
1827
|
*
|
|
1209
|
-
* @
|
|
1210
|
-
* @
|
|
1828
|
+
* @category memory
|
|
1829
|
+
* @since 4.0.0
|
|
1211
1830
|
*/
|
|
1212
1831
|
export declare const Memory_20250818: <Mode extends Tool.FailureMode | undefined = undefined>(args: void) => Tool.ProviderDefined<"anthropic.memory_20250818", "AnthropicMemory", {
|
|
1213
1832
|
readonly args: Schema.Void;
|
|
@@ -1220,7 +1839,7 @@ export declare const Memory_20250818: <Mode extends Tool.FailureMode | undefined
|
|
|
1220
1839
|
}>, Schema.Struct<{
|
|
1221
1840
|
readonly command: Schema.Literal<"delete">;
|
|
1222
1841
|
/**
|
|
1223
|
-
* The path to the file to delete.
|
|
1842
|
+
* The path to the file or directory to delete.
|
|
1224
1843
|
*/
|
|
1225
1844
|
readonly path: Schema.String;
|
|
1226
1845
|
}>, Schema.Struct<{
|
|
@@ -1264,7 +1883,7 @@ export declare const Memory_20250818: <Mode extends Tool.FailureMode | undefined
|
|
|
1264
1883
|
}>, Schema.Struct<{
|
|
1265
1884
|
readonly command: Schema.Literal<"view">;
|
|
1266
1885
|
/**
|
|
1267
|
-
* The path to the file to view.
|
|
1886
|
+
* The path to the file or directory to view.
|
|
1268
1887
|
*/
|
|
1269
1888
|
readonly path: Schema.String;
|
|
1270
1889
|
/**
|
|
@@ -1277,13 +1896,24 @@ export declare const Memory_20250818: <Mode extends Tool.FailureMode | undefined
|
|
|
1277
1896
|
readonly failureMode: Mode extends undefined ? "error" : Mode;
|
|
1278
1897
|
}, false>;
|
|
1279
1898
|
/**
|
|
1280
|
-
*
|
|
1899
|
+
* Reads the contents of a file or lists directory contents.
|
|
1900
|
+
*
|
|
1901
|
+
* **When to use**
|
|
1902
|
+
*
|
|
1903
|
+
* Use when validating or constructing the standalone Anthropic Text Editor
|
|
1904
|
+
* `view` command.
|
|
1281
1905
|
*
|
|
1282
|
-
*
|
|
1283
|
-
* When used on a directory: Lists all files and subdirectories.
|
|
1906
|
+
* **Details**
|
|
1284
1907
|
*
|
|
1285
|
-
*
|
|
1286
|
-
*
|
|
1908
|
+
* When used on a file, returns the file contents, optionally limited to a line
|
|
1909
|
+
* range. When used on a directory, lists all files and subdirectories.
|
|
1910
|
+
* `view_range` is a 1-indexed `[start, end]` tuple where `-1` means through
|
|
1911
|
+
* the end of the file.
|
|
1912
|
+
*
|
|
1913
|
+
* @see {@link CodeExecutionTextEditorView} for the code-execution variant without `view_range`
|
|
1914
|
+
*
|
|
1915
|
+
* @category text editor
|
|
1916
|
+
* @since 4.0.0
|
|
1287
1917
|
*/
|
|
1288
1918
|
export declare const TextEditorViewCommand: Schema.Struct<{
|
|
1289
1919
|
readonly command: Schema.Literal<"view">;
|
|
@@ -1298,17 +1928,36 @@ export declare const TextEditorViewCommand: Schema.Struct<{
|
|
|
1298
1928
|
readonly view_range: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
|
|
1299
1929
|
}>;
|
|
1300
1930
|
/**
|
|
1301
|
-
*
|
|
1302
|
-
*
|
|
1931
|
+
* Text editor command payload for viewing file contents or listing directory contents.
|
|
1932
|
+
*
|
|
1933
|
+
* **Details**
|
|
1934
|
+
*
|
|
1935
|
+
* `view_range` is a 1-indexed `[start, end]` tuple where `-1` means through
|
|
1936
|
+
* the end of the file.
|
|
1937
|
+
*
|
|
1938
|
+
* @category text editor
|
|
1939
|
+
* @since 4.0.0
|
|
1303
1940
|
*/
|
|
1304
1941
|
export type TextEditorViewCommand = typeof TextEditorViewCommand.Type;
|
|
1305
1942
|
/**
|
|
1306
1943
|
* Create a new file with specified content.
|
|
1307
1944
|
*
|
|
1308
|
-
*
|
|
1945
|
+
* **When to use**
|
|
1946
|
+
*
|
|
1947
|
+
* Use when validating or constructing an Anthropic text editor `create`
|
|
1948
|
+
* command.
|
|
1949
|
+
*
|
|
1950
|
+
* **Details**
|
|
1951
|
+
*
|
|
1952
|
+
* The payload is discriminated by `command: "create"` and requires both `path`
|
|
1953
|
+
* and `file_text`.
|
|
1954
|
+
*
|
|
1955
|
+
* **Gotchas**
|
|
1309
1956
|
*
|
|
1310
|
-
*
|
|
1311
|
-
*
|
|
1957
|
+
* Fails if the file already exists. Parent directories must exist.
|
|
1958
|
+
*
|
|
1959
|
+
* @category text editor
|
|
1960
|
+
* @since 4.0.0
|
|
1312
1961
|
*/
|
|
1313
1962
|
export declare const TextEditorCreateCommand: Schema.Struct<{
|
|
1314
1963
|
readonly command: Schema.Literal<"create">;
|
|
@@ -1322,18 +1971,44 @@ export declare const TextEditorCreateCommand: Schema.Struct<{
|
|
|
1322
1971
|
readonly file_text: Schema.String;
|
|
1323
1972
|
}>;
|
|
1324
1973
|
/**
|
|
1325
|
-
*
|
|
1326
|
-
*
|
|
1974
|
+
* Text editor command payload for creating a new file with the specified content.
|
|
1975
|
+
*
|
|
1976
|
+
* **When to use**
|
|
1977
|
+
*
|
|
1978
|
+
* Use when typing parsed text-editor create command payloads after schema
|
|
1979
|
+
* validation and before dispatching to Anthropic tool handlers.
|
|
1980
|
+
*
|
|
1981
|
+
* **Gotchas**
|
|
1982
|
+
*
|
|
1983
|
+
* The command fails if the file already exists or if parent directories are missing.
|
|
1984
|
+
*
|
|
1985
|
+
* @category text editor
|
|
1986
|
+
* @since 4.0.0
|
|
1327
1987
|
*/
|
|
1328
1988
|
export type TextEditorCreateCommand = typeof TextEditorCreateCommand.Type;
|
|
1329
1989
|
/**
|
|
1330
|
-
*
|
|
1990
|
+
* Replaces a specific string in a file with a new string.
|
|
1991
|
+
*
|
|
1992
|
+
* **When to use**
|
|
1993
|
+
*
|
|
1994
|
+
* Use when validating or constructing standalone Anthropic text editor
|
|
1995
|
+
* `str_replace` commands.
|
|
1996
|
+
*
|
|
1997
|
+
* **Details**
|
|
1998
|
+
*
|
|
1999
|
+
* The payload uses `command: "str_replace"`, `path`, `old_str`, and `new_str`.
|
|
2000
|
+
* `new_str` may be empty to delete text.
|
|
2001
|
+
*
|
|
2002
|
+
* **Gotchas**
|
|
1331
2003
|
*
|
|
1332
2004
|
* The `old_str` must match exactly (including whitespace and indentation)
|
|
1333
2005
|
* and must be unique in the file.
|
|
1334
2006
|
*
|
|
1335
|
-
* @
|
|
1336
|
-
* @
|
|
2007
|
+
* @see {@link TextEditorViewCommand} for reading contents before choosing `old_str`
|
|
2008
|
+
* @see {@link CodeExecutionTextEditorStrReplace} for the code-execution variant
|
|
2009
|
+
*
|
|
2010
|
+
* @category text editor
|
|
2011
|
+
* @since 4.0.0
|
|
1337
2012
|
*/
|
|
1338
2013
|
export declare const TextEditorStrReplaceCommand: Schema.Struct<{
|
|
1339
2014
|
readonly command: Schema.Literal<"str_replace">;
|
|
@@ -1351,17 +2026,32 @@ export declare const TextEditorStrReplaceCommand: Schema.Struct<{
|
|
|
1351
2026
|
readonly new_str: Schema.String;
|
|
1352
2027
|
}>;
|
|
1353
2028
|
/**
|
|
1354
|
-
*
|
|
1355
|
-
*
|
|
2029
|
+
* Text editor command payload for replacing one exact, unique string in a file.
|
|
2030
|
+
*
|
|
2031
|
+
* **When to use**
|
|
2032
|
+
*
|
|
2033
|
+
* Use when typing parsed text-editor replace command payloads that must carry
|
|
2034
|
+
* one exact `old_str` match.
|
|
2035
|
+
*
|
|
2036
|
+
* **Gotchas**
|
|
2037
|
+
*
|
|
2038
|
+
* The `old_str` must match exactly, including whitespace and indentation, and
|
|
2039
|
+
* must be unique in the file.
|
|
2040
|
+
*
|
|
2041
|
+
* @category text editor
|
|
2042
|
+
* @since 4.0.0
|
|
1356
2043
|
*/
|
|
1357
2044
|
export type TextEditorStrReplaceCommand = typeof TextEditorStrReplaceCommand.Type;
|
|
1358
2045
|
/**
|
|
1359
|
-
*
|
|
2046
|
+
* Inserts text at a specific line number in a file.
|
|
2047
|
+
*
|
|
2048
|
+
* **Details**
|
|
1360
2049
|
*
|
|
1361
|
-
* Inserts the new text
|
|
2050
|
+
* Inserts the new text after the specified line number. Use `0` to insert at
|
|
2051
|
+
* the beginning of the file; other values are 1-indexed.
|
|
1362
2052
|
*
|
|
1363
|
-
* @
|
|
1364
|
-
* @
|
|
2053
|
+
* @category text editor
|
|
2054
|
+
* @since 4.0.0
|
|
1365
2055
|
*/
|
|
1366
2056
|
export declare const TextEditorInsertCommand: Schema.Struct<{
|
|
1367
2057
|
readonly command: Schema.Literal<"insert">;
|
|
@@ -1379,20 +2069,28 @@ export declare const TextEditorInsertCommand: Schema.Struct<{
|
|
|
1379
2069
|
readonly new_str: Schema.String;
|
|
1380
2070
|
}>;
|
|
1381
2071
|
/**
|
|
1382
|
-
*
|
|
1383
|
-
*
|
|
2072
|
+
* Text editor command payload for inserting text after a specific line number in a file.
|
|
2073
|
+
*
|
|
2074
|
+
* @category text editor
|
|
2075
|
+
* @since 4.0.0
|
|
1384
2076
|
*/
|
|
1385
2077
|
export type TextEditorInsertCommand = typeof TextEditorInsertCommand.Type;
|
|
1386
2078
|
/**
|
|
1387
|
-
*
|
|
2079
|
+
* Undoes the last edit made to a file.
|
|
1388
2080
|
*
|
|
1389
|
-
*
|
|
2081
|
+
* **Details**
|
|
1390
2082
|
*
|
|
1391
|
-
*
|
|
1392
|
-
*
|
|
2083
|
+
* Reverts the most recent `str_replace`, `insert`, or `create` operation on the
|
|
2084
|
+
* file.
|
|
1393
2085
|
*
|
|
1394
|
-
*
|
|
1395
|
-
*
|
|
2086
|
+
* **Gotchas**
|
|
2087
|
+
*
|
|
2088
|
+
* This command is available in `text_editor_20241022` and
|
|
2089
|
+
* `text_editor_20250124`, but not in `text_editor_20250429` or
|
|
2090
|
+
* `text_editor_20250728`.
|
|
2091
|
+
*
|
|
2092
|
+
* @category text editor
|
|
2093
|
+
* @since 4.0.0
|
|
1396
2094
|
*/
|
|
1397
2095
|
export declare const TextEditorUndoEditCommand: Schema.Struct<{
|
|
1398
2096
|
readonly command: Schema.Literal<"undo_edit">;
|
|
@@ -1402,17 +2100,35 @@ export declare const TextEditorUndoEditCommand: Schema.Struct<{
|
|
|
1402
2100
|
readonly path: Schema.String;
|
|
1403
2101
|
}>;
|
|
1404
2102
|
/**
|
|
1405
|
-
*
|
|
1406
|
-
*
|
|
2103
|
+
* Text editor command payload for undoing the most recent edit to a file.
|
|
2104
|
+
*
|
|
2105
|
+
* **Gotchas**
|
|
2106
|
+
*
|
|
2107
|
+
* Available for `text_editor_20241022` and `text_editor_20250124`, but not for
|
|
2108
|
+
* `text_editor_20250429` or `text_editor_20250728`.
|
|
2109
|
+
*
|
|
2110
|
+
* @category text editor
|
|
2111
|
+
* @since 4.0.0
|
|
1407
2112
|
*/
|
|
1408
2113
|
export type TextEditorUndoEditCommand = typeof TextEditorUndoEditCommand.Type;
|
|
1409
2114
|
/**
|
|
1410
|
-
*
|
|
2115
|
+
* Defines the deprecated text editor tool for Claude 3.5 Sonnet.
|
|
1411
2116
|
*
|
|
1412
|
-
*
|
|
2117
|
+
* **When to use**
|
|
1413
2118
|
*
|
|
1414
|
-
*
|
|
1415
|
-
*
|
|
2119
|
+
* Use when you need the 2024-10-22 `str_replace_editor` compatibility path for
|
|
2120
|
+
* Claude 3.5 Sonnet.
|
|
2121
|
+
*
|
|
2122
|
+
* **Details**
|
|
2123
|
+
*
|
|
2124
|
+
* Requires the "computer-use-2024-10-22" beta header and supports `view`,
|
|
2125
|
+
* `create`, `str_replace`, `insert`, and `undo_edit` commands.
|
|
2126
|
+
*
|
|
2127
|
+
* @see {@link TextEditor_20250124} for the newer `str_replace_editor` version
|
|
2128
|
+
* @see {@link TextEditor_20250728} for the Claude 4 `str_replace_based_edit_tool` line
|
|
2129
|
+
*
|
|
2130
|
+
* @category text editor
|
|
2131
|
+
* @since 4.0.0
|
|
1416
2132
|
*/
|
|
1417
2133
|
export declare const TextEditor_20241022: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
|
|
1418
2134
|
readonly failureMode?: Mode | undefined;
|
|
@@ -1479,10 +2195,23 @@ export declare const TextEditor_20241022: <Mode extends Tool.FailureMode | undef
|
|
|
1479
2195
|
readonly failureMode: Mode extends undefined ? "error" : Mode;
|
|
1480
2196
|
}, true>;
|
|
1481
2197
|
/**
|
|
1482
|
-
*
|
|
2198
|
+
* Defines the text editor tool for deprecated Claude Sonnet 3.7.
|
|
2199
|
+
*
|
|
2200
|
+
* **When to use**
|
|
2201
|
+
*
|
|
2202
|
+
* Use when you need the 2025-01-24 Claude Sonnet 3.7 text editor tool using
|
|
2203
|
+
* `str_replace_editor`.
|
|
1483
2204
|
*
|
|
1484
|
-
*
|
|
1485
|
-
*
|
|
2205
|
+
* **Details**
|
|
2206
|
+
*
|
|
2207
|
+
* Requires the "computer-use-2025-01-24" beta header, requires a handler, and
|
|
2208
|
+
* supports `view`, `create`, `str_replace`, `insert`, and `undo_edit` commands.
|
|
2209
|
+
*
|
|
2210
|
+
* @see {@link TextEditor_20241022} for the older `str_replace_editor` version
|
|
2211
|
+
* @see {@link TextEditor_20250429} for the Claude 4 `str_replace_based_edit_tool` line
|
|
2212
|
+
*
|
|
2213
|
+
* @category text editor
|
|
2214
|
+
* @since 4.0.0
|
|
1486
2215
|
*/
|
|
1487
2216
|
export declare const TextEditor_20250124: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
|
|
1488
2217
|
readonly failureMode?: Mode | undefined;
|
|
@@ -1549,12 +2278,26 @@ export declare const TextEditor_20250124: <Mode extends Tool.FailureMode | undef
|
|
|
1549
2278
|
readonly failureMode: Mode extends undefined ? "error" : Mode;
|
|
1550
2279
|
}, true>;
|
|
1551
2280
|
/**
|
|
1552
|
-
*
|
|
2281
|
+
* Defines the text editor tool for Claude 4 models using Anthropic's `str_replace_based_edit_tool`.
|
|
1553
2282
|
*
|
|
1554
|
-
*
|
|
2283
|
+
* **When to use**
|
|
1555
2284
|
*
|
|
1556
|
-
*
|
|
1557
|
-
*
|
|
2285
|
+
* Use when you need the 2025-04-29 Claude 4 `str_replace_based_edit_tool`
|
|
2286
|
+
* version.
|
|
2287
|
+
*
|
|
2288
|
+
* **Details**
|
|
2289
|
+
*
|
|
2290
|
+
* Requires the "computer-use-2025-01-24" beta header.
|
|
2291
|
+
*
|
|
2292
|
+
* **Gotchas**
|
|
2293
|
+
*
|
|
2294
|
+
* This version does not support the `undo_edit` command.
|
|
2295
|
+
*
|
|
2296
|
+
* @see {@link TextEditor_20250124} for the previous `str_replace_editor` version
|
|
2297
|
+
* @see {@link TextEditor_20250728} for the later Claude 4 text editor version
|
|
2298
|
+
*
|
|
2299
|
+
* @category text editor
|
|
2300
|
+
* @since 4.0.0
|
|
1558
2301
|
*/
|
|
1559
2302
|
export declare const TextEditor_20250429: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
|
|
1560
2303
|
readonly max_characters?: number | undefined;
|
|
@@ -1622,12 +2365,19 @@ export declare const TextEditor_20250429: <Mode extends Tool.FailureMode | undef
|
|
|
1622
2365
|
readonly failureMode: Mode extends undefined ? "error" : Mode;
|
|
1623
2366
|
}, true>;
|
|
1624
2367
|
/**
|
|
1625
|
-
*
|
|
2368
|
+
* Defines the text editor tool for Claude 4 models.
|
|
2369
|
+
*
|
|
2370
|
+
* **Details**
|
|
2371
|
+
*
|
|
2372
|
+
* Uses Anthropic's `str_replace_based_edit_tool`. `max_characters` can limit
|
|
2373
|
+
* file-view output for this version.
|
|
2374
|
+
*
|
|
2375
|
+
* **Gotchas**
|
|
1626
2376
|
*
|
|
1627
|
-
*
|
|
2377
|
+
* This version does not support the `undo_edit` command.
|
|
1628
2378
|
*
|
|
1629
|
-
* @
|
|
1630
|
-
* @
|
|
2379
|
+
* @category text editor
|
|
2380
|
+
* @since 4.0.0
|
|
1631
2381
|
*/
|
|
1632
2382
|
export declare const TextEditor_20250728: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
|
|
1633
2383
|
readonly max_characters?: number | undefined;
|
|
@@ -1695,13 +2445,23 @@ export declare const TextEditor_20250728: <Mode extends Tool.FailureMode | undef
|
|
|
1695
2445
|
readonly failureMode: Mode extends undefined ? "error" : Mode;
|
|
1696
2446
|
}, true>;
|
|
1697
2447
|
/**
|
|
1698
|
-
*
|
|
2448
|
+
* Describes user location for localizing search results.
|
|
1699
2449
|
*
|
|
1700
|
-
*
|
|
1701
|
-
*
|
|
2450
|
+
* **When to use**
|
|
2451
|
+
*
|
|
2452
|
+
* Use when you need to localize search results for location-dependent queries
|
|
2453
|
+
* like weather, local businesses, or events.
|
|
2454
|
+
*
|
|
2455
|
+
* **Details**
|
|
2456
|
+
*
|
|
2457
|
+
* The schema uses `type: "approximate"` plus optional `city`, `region`,
|
|
2458
|
+
* `country`, and `timezone`. `country` is an ISO 3166-1 alpha-2 code, and
|
|
2459
|
+
* `timezone` is an IANA time zone identifier.
|
|
2460
|
+
*
|
|
2461
|
+
* @see {@link WebSearch_20250305_Args} for the argument schema that consumes this location
|
|
1702
2462
|
*
|
|
1703
|
-
* @since 1.0.0
|
|
1704
2463
|
* @category Web Search
|
|
2464
|
+
* @since 4.0.0
|
|
1705
2465
|
*/
|
|
1706
2466
|
export declare const WebSearchUserLocation: Schema.Struct<{
|
|
1707
2467
|
/**
|
|
@@ -1726,10 +2486,27 @@ export declare const WebSearchUserLocation: Schema.Struct<{
|
|
|
1726
2486
|
readonly timezone: Schema.optional<Schema.String>;
|
|
1727
2487
|
}>;
|
|
1728
2488
|
/**
|
|
1729
|
-
*
|
|
2489
|
+
* Defines configuration arguments for the web search tool.
|
|
2490
|
+
*
|
|
2491
|
+
* **When to use**
|
|
2492
|
+
*
|
|
2493
|
+
* Use when you need to configure `WebSearch_20250305` with search limits,
|
|
2494
|
+
* domain filters, or user location.
|
|
2495
|
+
*
|
|
2496
|
+
* **Details**
|
|
2497
|
+
*
|
|
2498
|
+
* The payload can set `maxUses`, `allowedDomains`, `blockedDomains`, and
|
|
2499
|
+
* `userLocation`.
|
|
2500
|
+
*
|
|
2501
|
+
* **Gotchas**
|
|
2502
|
+
*
|
|
2503
|
+
* `allowedDomains` and `blockedDomains` are mutually exclusive.
|
|
2504
|
+
*
|
|
2505
|
+
* @see {@link WebSearch_20250305} for the provider-defined tool that consumes these arguments
|
|
2506
|
+
* @see {@link WebSearchUserLocation} for localizing search results
|
|
1730
2507
|
*
|
|
1731
|
-
* @since 1.0.0
|
|
1732
2508
|
* @category Web Search
|
|
2509
|
+
* @since 4.0.0
|
|
1733
2510
|
*/
|
|
1734
2511
|
export declare const WebSearch_20250305_Args: Schema.Struct<{
|
|
1735
2512
|
/**
|
|
@@ -1775,15 +2552,28 @@ export declare const WebSearch_20250305_Args: Schema.Struct<{
|
|
|
1775
2552
|
}>>;
|
|
1776
2553
|
}>;
|
|
1777
2554
|
/**
|
|
1778
|
-
*
|
|
2555
|
+
* Configuration arguments for the Anthropic web search tool, including usage limits, domain filters, and optional user location.
|
|
2556
|
+
*
|
|
2557
|
+
* **Gotchas**
|
|
2558
|
+
*
|
|
2559
|
+
* `allowedDomains` and `blockedDomains` are mutually exclusive.
|
|
2560
|
+
*
|
|
1779
2561
|
* @category Web Search
|
|
2562
|
+
* @since 4.0.0
|
|
1780
2563
|
*/
|
|
1781
2564
|
export type WebSearch_20250305_Args = typeof WebSearch_20250305_Args.Type;
|
|
1782
2565
|
/**
|
|
1783
|
-
*
|
|
2566
|
+
* Schema for Claude-supplied web search tool parameters.
|
|
2567
|
+
*
|
|
2568
|
+
* **Details**
|
|
2569
|
+
*
|
|
2570
|
+
* The payload contains the generated `query` string and is consumed by
|
|
2571
|
+
* `WebSearch_20250305`.
|
|
2572
|
+
*
|
|
2573
|
+
* @see {@link WebSearch_20250305} for the provider-defined tool that consumes this payload
|
|
1784
2574
|
*
|
|
1785
|
-
* @since 1.0.0
|
|
1786
2575
|
* @category Web Search
|
|
2576
|
+
* @since 4.0.0
|
|
1787
2577
|
*/
|
|
1788
2578
|
export declare const WebSearchParameters: Schema.Struct<{
|
|
1789
2579
|
/**
|
|
@@ -1792,20 +2582,35 @@ export declare const WebSearchParameters: Schema.Struct<{
|
|
|
1792
2582
|
readonly query: Schema.String;
|
|
1793
2583
|
}>;
|
|
1794
2584
|
/**
|
|
1795
|
-
*
|
|
2585
|
+
* Type of the parameters Claude supplies when invoking the Anthropic web search tool.
|
|
2586
|
+
*
|
|
2587
|
+
* **Details**
|
|
2588
|
+
*
|
|
2589
|
+
* Contains the generated search query used by `WebSearch_20250305`.
|
|
2590
|
+
*
|
|
2591
|
+
* @see {@link WebSearch_20250305} for the provider-defined tool that consumes this payload
|
|
2592
|
+
*
|
|
1796
2593
|
* @category Web Search
|
|
2594
|
+
* @since 4.0.0
|
|
1797
2595
|
*/
|
|
1798
2596
|
export type WebSearchParameters = typeof WebSearchParameters.Type;
|
|
1799
2597
|
/**
|
|
1800
|
-
*
|
|
2598
|
+
* Defines the web search tool for Claude models.
|
|
2599
|
+
*
|
|
2600
|
+
* **When to use**
|
|
2601
|
+
*
|
|
2602
|
+
* Use when you want Claude to search the web for real-time information.
|
|
2603
|
+
*
|
|
2604
|
+
* **Details**
|
|
1801
2605
|
*
|
|
1802
2606
|
* Enables Claude to search the web for real-time information. This is a
|
|
1803
2607
|
* server-side tool executed by Anthropic's infrastructure.
|
|
1804
|
-
*
|
|
1805
2608
|
* Generally available (no beta header required).
|
|
1806
2609
|
*
|
|
1807
|
-
* @
|
|
2610
|
+
* @see {@link WebFetch_20250910} for retrieving known URLs after discovery
|
|
2611
|
+
*
|
|
1808
2612
|
* @category Web Search
|
|
2613
|
+
* @since 4.0.0
|
|
1809
2614
|
*/
|
|
1810
2615
|
export declare const WebSearch_20250305: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
|
|
1811
2616
|
readonly maxUses?: number | undefined;
|
|
@@ -1814,8 +2619,8 @@ export declare const WebSearch_20250305: <Mode extends Tool.FailureMode | undefi
|
|
|
1814
2619
|
readonly userLocation?: {
|
|
1815
2620
|
readonly type: "approximate";
|
|
1816
2621
|
readonly city?: string | undefined;
|
|
1817
|
-
readonly country?: string | undefined;
|
|
1818
2622
|
readonly region?: string | undefined;
|
|
2623
|
+
readonly country?: string | undefined;
|
|
1819
2624
|
readonly timezone?: string | undefined;
|
|
1820
2625
|
} | undefined;
|
|
1821
2626
|
}) => Tool.ProviderDefined<"anthropic.web_search_20250305", "AnthropicWebSearch", {
|
|
@@ -1882,10 +2687,21 @@ export declare const WebSearch_20250305: <Mode extends Tool.FailureMode | undefi
|
|
|
1882
2687
|
readonly failureMode: Mode extends undefined ? "error" : Mode;
|
|
1883
2688
|
}, false>;
|
|
1884
2689
|
/**
|
|
1885
|
-
*
|
|
2690
|
+
* Defines citation configuration for web fetch.
|
|
2691
|
+
*
|
|
2692
|
+
* **When to use**
|
|
2693
|
+
*
|
|
2694
|
+
* Use when you need to enable or disable citations on web fetch results.
|
|
2695
|
+
*
|
|
2696
|
+
* **Details**
|
|
2697
|
+
*
|
|
2698
|
+
* The payload contains the `enabled` flag. `citations` is optional on
|
|
2699
|
+
* `WebFetch_20250910_Args`, and citations are disabled by default.
|
|
2700
|
+
*
|
|
2701
|
+
* @see {@link WebFetch_20250910_Args} for the argument schema that consumes this configuration
|
|
1886
2702
|
*
|
|
1887
|
-
* @since 1.0.0
|
|
1888
2703
|
* @category Web Fetch
|
|
2704
|
+
* @since 4.0.0
|
|
1889
2705
|
*/
|
|
1890
2706
|
export declare const WebFetchCitationsConfig: Schema.Struct<{
|
|
1891
2707
|
/**
|
|
@@ -1894,15 +2710,48 @@ export declare const WebFetchCitationsConfig: Schema.Struct<{
|
|
|
1894
2710
|
readonly enabled: Schema.Boolean;
|
|
1895
2711
|
}>;
|
|
1896
2712
|
/**
|
|
1897
|
-
*
|
|
2713
|
+
* Configuration payload for enabling or disabling citations on web fetch results.
|
|
2714
|
+
*
|
|
2715
|
+
* **When to use**
|
|
2716
|
+
*
|
|
2717
|
+
* Use when typing parsed web-fetch citation configuration shared between
|
|
2718
|
+
* request arguments and handler code.
|
|
2719
|
+
*
|
|
2720
|
+
* **Details**
|
|
2721
|
+
*
|
|
2722
|
+
* The payload contains the `enabled` flag. `citations` is optional on
|
|
2723
|
+
* `WebFetch_20250910_Args`, and citations are disabled by default.
|
|
2724
|
+
*
|
|
2725
|
+
* @see {@link WebFetch_20250910_Args} for the argument schema that consumes this configuration
|
|
2726
|
+
*
|
|
1898
2727
|
* @category Web Fetch
|
|
2728
|
+
* @since 4.0.0
|
|
1899
2729
|
*/
|
|
1900
2730
|
export type WebFetchCitationsConfig = typeof WebFetchCitationsConfig.Type;
|
|
1901
2731
|
/**
|
|
1902
|
-
*
|
|
2732
|
+
* Defines configuration arguments for the web fetch tool.
|
|
2733
|
+
*
|
|
2734
|
+
* **When to use**
|
|
2735
|
+
*
|
|
2736
|
+
* Use when you need to configure `WebFetch_20250910` with usage limits, domain
|
|
2737
|
+
* filters, citations, or content token limits.
|
|
2738
|
+
*
|
|
2739
|
+
* **Details**
|
|
2740
|
+
*
|
|
2741
|
+
* The payload can set `maxUses`, domain filters, `citations`, and
|
|
2742
|
+
* `maxContentTokens`, which map to Anthropic web fetch request fields.
|
|
2743
|
+
*
|
|
2744
|
+
* **Gotchas**
|
|
2745
|
+
*
|
|
2746
|
+
* `allowedDomains` and `blockedDomains` are mutually exclusive.
|
|
2747
|
+
* `maxContentTokens` is approximate and does not apply to binary content such
|
|
2748
|
+
* as PDFs.
|
|
2749
|
+
*
|
|
2750
|
+
* @see {@link WebFetch_20250910} for the provider-defined tool that consumes these arguments
|
|
2751
|
+
* @see {@link WebFetchCitationsConfig} for configuring citations
|
|
1903
2752
|
*
|
|
1904
|
-
* @since 1.0.0
|
|
1905
2753
|
* @category Web Fetch
|
|
2754
|
+
* @since 4.0.0
|
|
1906
2755
|
*/
|
|
1907
2756
|
export declare const WebFetch_20250910_Args: Schema.Struct<{
|
|
1908
2757
|
/**
|
|
@@ -1936,15 +2785,44 @@ export declare const WebFetch_20250910_Args: Schema.Struct<{
|
|
|
1936
2785
|
readonly maxContentTokens: Schema.optional<Schema.Number>;
|
|
1937
2786
|
}>;
|
|
1938
2787
|
/**
|
|
1939
|
-
*
|
|
2788
|
+
* Configuration arguments for the Anthropic web fetch tool, including usage limits, domain filters, citation settings, and token limits.
|
|
2789
|
+
*
|
|
2790
|
+
* **When to use**
|
|
2791
|
+
*
|
|
2792
|
+
* Use when typing parsed web-fetch tool configuration shared by the
|
|
2793
|
+
* provider-defined tool and request-building code.
|
|
2794
|
+
*
|
|
2795
|
+
* **Gotchas**
|
|
2796
|
+
*
|
|
2797
|
+
* `allowedDomains` and `blockedDomains` are mutually exclusive.
|
|
2798
|
+
* `maxContentTokens` is approximate and does not apply to binary content such
|
|
2799
|
+
* as PDFs.
|
|
2800
|
+
*
|
|
1940
2801
|
* @category Web Fetch
|
|
2802
|
+
* @since 4.0.0
|
|
1941
2803
|
*/
|
|
1942
2804
|
export type WebFetch_20250910_Args = typeof WebFetch_20250910_Args.Type;
|
|
1943
2805
|
/**
|
|
1944
|
-
*
|
|
2806
|
+
* Schema for Claude-supplied web fetch parameters.
|
|
2807
|
+
*
|
|
2808
|
+
* **When to use**
|
|
2809
|
+
*
|
|
2810
|
+
* Use when validating or constructing the `url` payload consumed by
|
|
2811
|
+
* `WebFetch_20250910`.
|
|
2812
|
+
*
|
|
2813
|
+
* **Details**
|
|
2814
|
+
*
|
|
2815
|
+
* The payload contains the single `url` parameter for Anthropic web fetch.
|
|
2816
|
+
*
|
|
2817
|
+
* **Gotchas**
|
|
2818
|
+
*
|
|
2819
|
+
* The URL must be user-provided or from prior search/fetch results. Maximum URL
|
|
2820
|
+
* length is 250 characters.
|
|
2821
|
+
*
|
|
2822
|
+
* @see {@link WebFetch_20250910} for the provider-defined tool that consumes this payload
|
|
1945
2823
|
*
|
|
1946
|
-
* @since 1.0.0
|
|
1947
2824
|
* @category Web Fetch
|
|
2825
|
+
* @since 4.0.0
|
|
1948
2826
|
*/
|
|
1949
2827
|
export declare const WebFetchParameters: Schema.Struct<{
|
|
1950
2828
|
/**
|
|
@@ -1954,28 +2832,52 @@ export declare const WebFetchParameters: Schema.Struct<{
|
|
|
1954
2832
|
readonly url: Schema.String;
|
|
1955
2833
|
}>;
|
|
1956
2834
|
/**
|
|
1957
|
-
*
|
|
2835
|
+
* Type of the parameters Claude supplies when invoking the Anthropic web fetch tool.
|
|
2836
|
+
*
|
|
2837
|
+
* **When to use**
|
|
2838
|
+
*
|
|
2839
|
+
* Use when typing Claude-supplied web-fetch tool parameters after schema
|
|
2840
|
+
* validation, before enforcing URL provenance or length constraints.
|
|
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
|
+
*
|
|
1958
2851
|
* @category Web Fetch
|
|
2852
|
+
* @since 4.0.0
|
|
1959
2853
|
*/
|
|
1960
2854
|
export type WebFetchParameters = typeof WebFetchParameters.Type;
|
|
1961
2855
|
/**
|
|
1962
|
-
*
|
|
2856
|
+
* Defines the web fetch tool for Claude models.
|
|
2857
|
+
*
|
|
2858
|
+
* **When to use**
|
|
2859
|
+
*
|
|
2860
|
+
* Use when you want Claude to retrieve the content of a specific web page or
|
|
2861
|
+
* PDF.
|
|
2862
|
+
*
|
|
2863
|
+
* **Details**
|
|
1963
2864
|
*
|
|
1964
2865
|
* Allows Claude to retrieve full content from web pages and PDF documents.
|
|
1965
|
-
* This is a server-side tool executed by Anthropic's infrastructure.
|
|
2866
|
+
* This is a server-side tool executed by Anthropic's infrastructure. Selecting
|
|
2867
|
+
* this tool adds the "web-fetch-2025-09-10" beta header.
|
|
1966
2868
|
*
|
|
1967
|
-
*
|
|
2869
|
+
* @see {@link WebSearch_20250305} for discovering URLs before fetching specific content
|
|
1968
2870
|
*
|
|
1969
|
-
* @since 1.0.0
|
|
1970
2871
|
* @category Web Fetch
|
|
2872
|
+
* @since 4.0.0
|
|
1971
2873
|
*/
|
|
1972
2874
|
export declare const WebFetch_20250910: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
|
|
1973
|
-
readonly citations?: {
|
|
1974
|
-
readonly enabled: boolean;
|
|
1975
|
-
} | undefined;
|
|
1976
2875
|
readonly maxUses?: number | undefined;
|
|
1977
2876
|
readonly allowedDomains?: readonly string[] | undefined;
|
|
1978
2877
|
readonly blockedDomains?: readonly string[] | undefined;
|
|
2878
|
+
readonly citations?: {
|
|
2879
|
+
readonly enabled: boolean;
|
|
2880
|
+
} | undefined;
|
|
1979
2881
|
readonly maxContentTokens?: number | undefined;
|
|
1980
2882
|
}) => Tool.ProviderDefined<"anthropic.web_fetch_20250910", "AnthropicWebFetch", {
|
|
1981
2883
|
readonly args: Schema.Struct<{
|
|
@@ -2044,13 +2946,15 @@ export declare const WebFetch_20250910: <Mode extends Tool.FailureMode | undefin
|
|
|
2044
2946
|
readonly failureMode: Mode extends undefined ? "error" : Mode;
|
|
2045
2947
|
}, false>;
|
|
2046
2948
|
/**
|
|
2047
|
-
*
|
|
2949
|
+
* Schema for regex-based tool search input parameters.
|
|
2950
|
+
*
|
|
2951
|
+
* **Details**
|
|
2048
2952
|
*
|
|
2049
2953
|
* Claude constructs regex patterns using Python's `re.search()` syntax.
|
|
2050
2954
|
* Maximum query length: 200 characters.
|
|
2051
2955
|
*
|
|
2052
|
-
* @
|
|
2053
|
-
* @
|
|
2956
|
+
* @category tool search
|
|
2957
|
+
* @since 4.0.0
|
|
2054
2958
|
*/
|
|
2055
2959
|
export declare const ToolSearchRegexParameters: Schema.Struct<{
|
|
2056
2960
|
/**
|
|
@@ -2059,15 +2963,34 @@ export declare const ToolSearchRegexParameters: Schema.Struct<{
|
|
|
2059
2963
|
readonly query: Schema.String;
|
|
2060
2964
|
}>;
|
|
2061
2965
|
/**
|
|
2062
|
-
*
|
|
2063
|
-
*
|
|
2966
|
+
* Type of the parameters Claude supplies when invoking regex-based Anthropic tool search.
|
|
2967
|
+
*
|
|
2968
|
+
* **Details**
|
|
2969
|
+
*
|
|
2970
|
+
* Claude constructs regex patterns using Python's `re.search()` syntax.
|
|
2971
|
+
* Maximum query length: 200 characters.
|
|
2972
|
+
*
|
|
2973
|
+
* @category tool search
|
|
2974
|
+
* @since 4.0.0
|
|
2064
2975
|
*/
|
|
2065
2976
|
export type ToolSearchRegexParameters = typeof ToolSearchRegexParameters.Type;
|
|
2066
2977
|
/**
|
|
2067
|
-
*
|
|
2978
|
+
* Defines input parameters for BM25/natural language tool search.
|
|
2979
|
+
*
|
|
2980
|
+
* **When to use**
|
|
2068
2981
|
*
|
|
2069
|
-
*
|
|
2070
|
-
*
|
|
2982
|
+
* Use when validating or constructing the natural-language query payload for
|
|
2983
|
+
* `ToolSearchBM25_20251119`.
|
|
2984
|
+
*
|
|
2985
|
+
* **Details**
|
|
2986
|
+
*
|
|
2987
|
+
* The payload contains Claude's natural-language `query`. BM25 searches tool
|
|
2988
|
+
* names, descriptions, argument names, and argument descriptions.
|
|
2989
|
+
*
|
|
2990
|
+
* @see {@link ToolSearchBM25_20251119} for the provider-defined tool that consumes these parameters
|
|
2991
|
+
*
|
|
2992
|
+
* @category tool search
|
|
2993
|
+
* @since 4.0.0
|
|
2071
2994
|
*/
|
|
2072
2995
|
export declare const ToolSearchBM25Parameters: Schema.Struct<{
|
|
2073
2996
|
/**
|
|
@@ -2076,21 +2999,24 @@ export declare const ToolSearchBM25Parameters: Schema.Struct<{
|
|
|
2076
2999
|
readonly query: Schema.String;
|
|
2077
3000
|
}>;
|
|
2078
3001
|
/**
|
|
2079
|
-
*
|
|
2080
|
-
*
|
|
3002
|
+
* Type of the parameters Claude supplies when invoking BM25 natural-language Anthropic tool search.
|
|
3003
|
+
*
|
|
3004
|
+
* @category tool search
|
|
3005
|
+
* @since 4.0.0
|
|
2081
3006
|
*/
|
|
2082
3007
|
export type ToolSearchBM25Parameters = typeof ToolSearchBM25Parameters.Type;
|
|
2083
3008
|
/**
|
|
2084
|
-
*
|
|
3009
|
+
* Defines regex-based tool search for Claude models.
|
|
3010
|
+
*
|
|
3011
|
+
* **Details**
|
|
2085
3012
|
*
|
|
2086
3013
|
* Claude constructs regex patterns using Python's `re.search()` syntax to
|
|
2087
3014
|
* find tools. The regex is matched against tool names, descriptions,
|
|
2088
3015
|
* argument names, and argument descriptions.
|
|
2089
|
-
*
|
|
2090
3016
|
* Requires the "advanced-tool-use-2025-11-20" beta header.
|
|
2091
3017
|
*
|
|
2092
|
-
* @
|
|
2093
|
-
* @
|
|
3018
|
+
* @category tool search
|
|
3019
|
+
* @since 4.0.0
|
|
2094
3020
|
*/
|
|
2095
3021
|
export declare const ToolSearchRegex_20251119: <Mode extends Tool.FailureMode | undefined = undefined>(args: void) => Tool.ProviderDefined<"anthropic.tool_search_tool_regex_20251119", "AnthropicToolSearchRegex", {
|
|
2096
3022
|
readonly args: Schema.Void;
|
|
@@ -2116,16 +3042,24 @@ export declare const ToolSearchRegex_20251119: <Mode extends Tool.FailureMode |
|
|
|
2116
3042
|
readonly failureMode: Mode extends undefined ? "error" : Mode;
|
|
2117
3043
|
}, false>;
|
|
2118
3044
|
/**
|
|
2119
|
-
* BM25/natural language tool search for Claude models.
|
|
3045
|
+
* Defines BM25/natural language tool search for Claude models.
|
|
3046
|
+
*
|
|
3047
|
+
* **When to use**
|
|
3048
|
+
*
|
|
3049
|
+
* Use when you want Claude to find relevant tools from a natural-language query
|
|
3050
|
+
* instead of a regex pattern.
|
|
3051
|
+
*
|
|
3052
|
+
* **Details**
|
|
2120
3053
|
*
|
|
2121
3054
|
* Claude uses natural language queries to search for tools using the
|
|
2122
3055
|
* BM25 algorithm. The search is performed against tool names, descriptions,
|
|
2123
3056
|
* argument names, and argument descriptions.
|
|
2124
|
-
*
|
|
2125
3057
|
* Requires the "advanced-tool-use-2025-11-20" beta header.
|
|
2126
3058
|
*
|
|
2127
|
-
* @
|
|
2128
|
-
*
|
|
3059
|
+
* @see {@link ToolSearchRegex_20251119} for the regex-pattern alternative
|
|
3060
|
+
*
|
|
3061
|
+
* @category tool search
|
|
3062
|
+
* @since 4.0.0
|
|
2129
3063
|
*/
|
|
2130
3064
|
export declare const ToolSearchBM25_20251119: <Mode extends Tool.FailureMode | undefined = undefined>(args: void) => Tool.ProviderDefined<"anthropic.tool_search_tool_bm25_20251119", "AnthropicToolSearchBM25", {
|
|
2131
3065
|
readonly args: Schema.Void;
|