@effect/ai-anthropic 4.0.0-beta.7 → 4.0.0-beta.70
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 +40 -66
- package/dist/AnthropicClient.d.ts.map +1 -1
- package/dist/AnthropicClient.js +12 -14
- package/dist/AnthropicClient.js.map +1 -1
- package/dist/AnthropicConfig.d.ts +46 -10
- package/dist/AnthropicConfig.d.ts.map +1 -1
- package/dist/AnthropicConfig.js +31 -7
- package/dist/AnthropicConfig.js.map +1 -1
- package/dist/AnthropicError.d.ts +128 -37
- package/dist/AnthropicError.d.ts.map +1 -1
- package/dist/AnthropicError.js +1 -1
- package/dist/AnthropicLanguageModel.d.ts +281 -66
- package/dist/AnthropicLanguageModel.d.ts.map +1 -1
- package/dist/AnthropicLanguageModel.js +50 -14
- package/dist/AnthropicLanguageModel.js.map +1 -1
- package/dist/AnthropicTelemetry.d.ts +23 -16
- package/dist/AnthropicTelemetry.d.ts.map +1 -1
- package/dist/AnthropicTelemetry.js +6 -4
- package/dist/AnthropicTelemetry.js.map +1 -1
- package/dist/AnthropicTool.d.ts +298 -138
- package/dist/AnthropicTool.d.ts.map +1 -1
- package/dist/AnthropicTool.js +141 -87
- package/dist/AnthropicTool.js.map +1 -1
- package/dist/Generated.d.ts +11661 -5260
- package/dist/Generated.d.ts.map +1 -1
- package/dist/Generated.js +2318 -915
- package/dist/Generated.js.map +1 -1
- package/dist/index.d.ts +52 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +52 -8
- 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 +41 -67
- package/src/AnthropicConfig.ts +47 -11
- package/src/AnthropicError.ts +130 -37
- package/src/AnthropicLanguageModel.ts +274 -33
- package/src/AnthropicTelemetry.ts +24 -17
- package/src/AnthropicTool.ts +293 -133
- package/src/Generated.ts +3751 -1815
- package/src/index.ts +52 -8
- package/src/internal/errors.ts +9 -7
package/src/AnthropicTool.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides tools that are natively supported by Anthropic's API, including
|
|
5
5
|
* Bash, Code Execution, Computer Use, Memory, and Text Editor functionality.
|
|
6
6
|
*
|
|
7
|
-
* @since
|
|
7
|
+
* @since 4.0.0
|
|
8
8
|
*/
|
|
9
9
|
import * as Schema from "effect/Schema"
|
|
10
10
|
import * as Tool from "effect/unstable/ai/Tool"
|
|
@@ -13,8 +13,8 @@ import * as Generated from "./Generated.ts"
|
|
|
13
13
|
/**
|
|
14
14
|
* Union of all Anthropic provider-defined tools.
|
|
15
15
|
*
|
|
16
|
-
* @since 1.0.0
|
|
17
16
|
* @category models
|
|
17
|
+
* @since 4.0.0
|
|
18
18
|
*/
|
|
19
19
|
export type AnthropicTool =
|
|
20
20
|
| ReturnType<typeof Bash_20241022>
|
|
@@ -41,11 +41,13 @@ export type AnthropicTool =
|
|
|
41
41
|
/**
|
|
42
42
|
* Anthropic Bash tool (2024-10-22 version).
|
|
43
43
|
*
|
|
44
|
+
* **Details**
|
|
45
|
+
*
|
|
44
46
|
* Allows the model to execute bash commands in a sandboxed environment.
|
|
45
47
|
* Requires the "computer-use-2024-10-22" beta header.
|
|
46
48
|
*
|
|
47
|
-
* @since 1.0.0
|
|
48
49
|
* @category Bash
|
|
50
|
+
* @since 4.0.0
|
|
49
51
|
*/
|
|
50
52
|
export const Bash_20241022 = Tool.providerDefined({
|
|
51
53
|
id: "anthropic.bash_20241022",
|
|
@@ -62,11 +64,13 @@ export const Bash_20241022 = Tool.providerDefined({
|
|
|
62
64
|
/**
|
|
63
65
|
* Anthropic Bash tool (2025-01-24 version).
|
|
64
66
|
*
|
|
67
|
+
* **Details**
|
|
68
|
+
*
|
|
65
69
|
* Allows the model to execute bash commands in a sandboxed environment.
|
|
66
70
|
* Requires the "computer-use-2025-01-24" beta header.
|
|
67
71
|
*
|
|
68
|
-
* @since 1.0.0
|
|
69
72
|
* @category Bash
|
|
73
|
+
* @since 4.0.0
|
|
70
74
|
*/
|
|
71
75
|
export const Bash_20250124 = Tool.providerDefined({
|
|
72
76
|
id: "anthropic.bash_20250124",
|
|
@@ -89,10 +93,10 @@ export const Bash_20250124 = Tool.providerDefined({
|
|
|
89
93
|
// -----------------------------------------------------------------------------
|
|
90
94
|
|
|
91
95
|
/**
|
|
92
|
-
*
|
|
96
|
+
* Schema for a code execution request that asks Anthropic to run source code as a programmatic tool call.
|
|
93
97
|
*
|
|
94
|
-
* @since 1.0.0
|
|
95
98
|
* @category Code Execution
|
|
99
|
+
* @since 4.0.0
|
|
96
100
|
*/
|
|
97
101
|
export const CodeExecutionProgrammaticToolCall = Schema.Struct({
|
|
98
102
|
type: Schema.Literal("programmatic-tool-call"),
|
|
@@ -102,16 +106,18 @@ export const CodeExecutionProgrammaticToolCall = Schema.Struct({
|
|
|
102
106
|
code: Schema.String
|
|
103
107
|
})
|
|
104
108
|
/**
|
|
105
|
-
*
|
|
109
|
+
* Input payload for a programmatic code execution tool call, including the source code to execute.
|
|
110
|
+
*
|
|
106
111
|
* @category Code Execution
|
|
112
|
+
* @since 4.0.0
|
|
107
113
|
*/
|
|
108
114
|
export type CodeExecutionProgrammaticToolCall = typeof CodeExecutionProgrammaticToolCall.Type
|
|
109
115
|
|
|
110
116
|
/**
|
|
111
|
-
*
|
|
117
|
+
* Schema for a code execution request that runs a bash command.
|
|
112
118
|
*
|
|
113
|
-
* @since 1.0.0
|
|
114
119
|
* @category Code Execution
|
|
120
|
+
* @since 4.0.0
|
|
115
121
|
*/
|
|
116
122
|
export const CodeExecutionBashCommand = Schema.Struct({
|
|
117
123
|
type: Schema.Literal("bash_code_execution"),
|
|
@@ -121,16 +127,18 @@ export const CodeExecutionBashCommand = Schema.Struct({
|
|
|
121
127
|
command: Schema.String
|
|
122
128
|
})
|
|
123
129
|
/**
|
|
124
|
-
*
|
|
130
|
+
* Input payload for a bash command executed through Anthropic code execution.
|
|
131
|
+
*
|
|
125
132
|
* @category Code Execution
|
|
133
|
+
* @since 4.0.0
|
|
126
134
|
*/
|
|
127
135
|
export type CodeExecutionBashCommand = typeof CodeExecutionBashCommand.Type
|
|
128
136
|
|
|
129
137
|
/**
|
|
130
138
|
* Text editor view command for code execution.
|
|
131
139
|
*
|
|
132
|
-
* @since 1.0.0
|
|
133
140
|
* @category Code Execution
|
|
141
|
+
* @since 4.0.0
|
|
134
142
|
*/
|
|
135
143
|
export const CodeExecutionTextEditorView = Schema.Struct({
|
|
136
144
|
type: Schema.Literal("text_editor_code_execution"),
|
|
@@ -141,16 +149,18 @@ export const CodeExecutionTextEditorView = Schema.Struct({
|
|
|
141
149
|
path: Schema.String
|
|
142
150
|
})
|
|
143
151
|
/**
|
|
144
|
-
*
|
|
152
|
+
* Input payload for viewing a file through the text editor code execution tool.
|
|
153
|
+
*
|
|
145
154
|
* @category Code Execution
|
|
155
|
+
* @since 4.0.0
|
|
146
156
|
*/
|
|
147
157
|
export type CodeExecutionTextEditorView = typeof CodeExecutionTextEditorView.Type
|
|
148
158
|
|
|
149
159
|
/**
|
|
150
160
|
* Text editor create command for code execution.
|
|
151
161
|
*
|
|
152
|
-
* @since 1.0.0
|
|
153
162
|
* @category Code Execution
|
|
163
|
+
* @since 4.0.0
|
|
154
164
|
*/
|
|
155
165
|
export const CodeExecutionTextEditorCreate = Schema.Struct({
|
|
156
166
|
type: Schema.Literal("text_editor_code_execution"),
|
|
@@ -165,16 +175,18 @@ export const CodeExecutionTextEditorCreate = Schema.Struct({
|
|
|
165
175
|
file_text: Schema.optional(Schema.NullOr(Schema.String))
|
|
166
176
|
})
|
|
167
177
|
/**
|
|
168
|
-
*
|
|
178
|
+
* Input payload for creating a file through the text editor code execution tool, optionally including initial file text.
|
|
179
|
+
*
|
|
169
180
|
* @category Code Execution
|
|
181
|
+
* @since 4.0.0
|
|
170
182
|
*/
|
|
171
183
|
export type CodeExecutionTextEditorCreate = typeof CodeExecutionTextEditorCreate.Type
|
|
172
184
|
|
|
173
185
|
/**
|
|
174
186
|
* Text editor str_replace command for code execution.
|
|
175
187
|
*
|
|
176
|
-
* @since 1.0.0
|
|
177
188
|
* @category Code Execution
|
|
189
|
+
* @since 4.0.0
|
|
178
190
|
*/
|
|
179
191
|
export const CodeExecutionTextEditorStrReplace = Schema.Struct({
|
|
180
192
|
type: Schema.Literal("text_editor_code_execution"),
|
|
@@ -193,8 +205,10 @@ export const CodeExecutionTextEditorStrReplace = Schema.Struct({
|
|
|
193
205
|
new_str: Schema.String
|
|
194
206
|
})
|
|
195
207
|
/**
|
|
196
|
-
*
|
|
208
|
+
* Input payload for replacing text in a file through the text editor code execution tool.
|
|
209
|
+
*
|
|
197
210
|
* @category Code Execution
|
|
211
|
+
* @since 4.0.0
|
|
198
212
|
*/
|
|
199
213
|
export type CodeExecutionTextEditorStrReplace = typeof CodeExecutionTextEditorStrReplace.Type
|
|
200
214
|
|
|
@@ -211,10 +225,10 @@ const CodeExecution_20250522_Parameters = Schema.Union([
|
|
|
211
225
|
// -----------------------------------------------------------------------------
|
|
212
226
|
|
|
213
227
|
/**
|
|
214
|
-
*
|
|
228
|
+
* Schema for the 2025-08-25 code execution tool input, containing the code to execute.
|
|
215
229
|
*
|
|
216
|
-
* @since 1.0.0
|
|
217
230
|
* @category Code Execution
|
|
231
|
+
* @since 4.0.0
|
|
218
232
|
*/
|
|
219
233
|
export const CodeExecution_20250825_Parameters = Schema.Struct({
|
|
220
234
|
/**
|
|
@@ -223,8 +237,10 @@ export const CodeExecution_20250825_Parameters = Schema.Struct({
|
|
|
223
237
|
code: Schema.String
|
|
224
238
|
})
|
|
225
239
|
/**
|
|
226
|
-
*
|
|
240
|
+
* Input payload for the 2025-08-25 Anthropic code execution tool.
|
|
241
|
+
*
|
|
227
242
|
* @category Code Execution
|
|
243
|
+
* @since 4.0.0
|
|
228
244
|
*/
|
|
229
245
|
export type CodeExecution_20250825_Parameters = typeof CodeExecution_20250825_Parameters.Type
|
|
230
246
|
|
|
@@ -235,12 +251,14 @@ export type CodeExecution_20250825_Parameters = typeof CodeExecution_20250825_Pa
|
|
|
235
251
|
/**
|
|
236
252
|
* Anthropic Code Execution tool (2025-05-22 version).
|
|
237
253
|
*
|
|
254
|
+
* **Details**
|
|
255
|
+
*
|
|
238
256
|
* Allows the model to execute code in a sandboxed environment with support
|
|
239
257
|
* for multiple execution types including programmatic tool calls, bash
|
|
240
258
|
* execution, and text editor operations.
|
|
241
259
|
*
|
|
242
|
-
* @since 1.0.0
|
|
243
260
|
* @category Code Execution
|
|
261
|
+
* @since 4.0.0
|
|
244
262
|
*/
|
|
245
263
|
export const CodeExecution_20250522 = Tool.providerDefined({
|
|
246
264
|
id: "anthropic.code_execution_20250522",
|
|
@@ -254,10 +272,12 @@ export const CodeExecution_20250522 = Tool.providerDefined({
|
|
|
254
272
|
/**
|
|
255
273
|
* Anthropic Code Execution tool (2025-08-25 version).
|
|
256
274
|
*
|
|
275
|
+
* **Details**
|
|
276
|
+
*
|
|
257
277
|
* Allows the model to execute code in a sandboxed environment.
|
|
258
278
|
*
|
|
259
|
-
* @since 1.0.0
|
|
260
279
|
* @category Code Execution
|
|
280
|
+
* @since 4.0.0
|
|
261
281
|
*/
|
|
262
282
|
export const CodeExecution_20250825 = Tool.providerDefined({
|
|
263
283
|
id: "anthropic.code_execution_20250825",
|
|
@@ -289,52 +309,60 @@ export const CodeExecution_20250825 = Tool.providerDefined({
|
|
|
289
309
|
/**
|
|
290
310
|
* An `[x, y]` pixel position.
|
|
291
311
|
*
|
|
292
|
-
* @since 1.0.0
|
|
293
312
|
* @category Computer Use
|
|
313
|
+
* @since 4.0.0
|
|
294
314
|
*/
|
|
295
315
|
export const Coordinate = Schema.Tuple([Schema.Number, Schema.Number])
|
|
296
316
|
/**
|
|
297
|
-
*
|
|
317
|
+
* An `[x, y]` screen coordinate in pixels.
|
|
318
|
+
*
|
|
298
319
|
* @category Computer Use
|
|
320
|
+
* @since 4.0.0
|
|
299
321
|
*/
|
|
300
322
|
export type Coordinate = typeof Coordinate.Type
|
|
301
323
|
|
|
302
324
|
/**
|
|
303
325
|
* A `[x1, y1, x2, y2]` position defining top-left and bottom-right corners.
|
|
304
326
|
*
|
|
305
|
-
* @since 1.0.0
|
|
306
327
|
* @category Computer Use
|
|
328
|
+
* @since 4.0.0
|
|
307
329
|
*/
|
|
308
330
|
export const Region = Schema.Tuple([Schema.Number, Schema.Number, Schema.Number, Schema.Number])
|
|
309
331
|
/**
|
|
310
|
-
*
|
|
332
|
+
* An `[x1, y1, x2, y2]` screen region in pixels, from top-left to bottom-right.
|
|
333
|
+
*
|
|
311
334
|
* @category Computer Use
|
|
335
|
+
* @since 4.0.0
|
|
312
336
|
*/
|
|
313
337
|
export type Region = typeof Region.Type
|
|
314
338
|
|
|
315
339
|
/**
|
|
316
340
|
* The direction of the scroll for scroll actions.
|
|
317
341
|
*
|
|
318
|
-
* @since 1.0.0
|
|
319
342
|
* @category Computer Use
|
|
343
|
+
* @since 4.0.0
|
|
320
344
|
*/
|
|
321
345
|
export const ScrollDirection = Schema.Literals(["up", "down", "left", "right"])
|
|
322
346
|
/**
|
|
323
|
-
*
|
|
347
|
+
* Direction used by computer-use scroll actions: `"up"`, `"down"`, `"left"`, or `"right"`.
|
|
348
|
+
*
|
|
324
349
|
* @category Computer Use
|
|
350
|
+
* @since 4.0.0
|
|
325
351
|
*/
|
|
326
352
|
export type ScrollDirection = typeof ScrollDirection.Type
|
|
327
353
|
|
|
328
354
|
/**
|
|
329
355
|
* Modifier keys that can be held during click/scroll actions.
|
|
330
356
|
*
|
|
331
|
-
* @since 1.0.0
|
|
332
357
|
* @category Computer Use
|
|
358
|
+
* @since 4.0.0
|
|
333
359
|
*/
|
|
334
360
|
export const ModifierKey = Schema.Literals(["alt", "ctrl", "meta", "shift"])
|
|
335
361
|
/**
|
|
336
|
-
*
|
|
362
|
+
* Modifier key that can be held during computer-use click or scroll actions.
|
|
363
|
+
*
|
|
337
364
|
* @category Computer Use
|
|
365
|
+
* @since 4.0.0
|
|
338
366
|
*/
|
|
339
367
|
export type ModifierKey = typeof ModifierKey.Type
|
|
340
368
|
|
|
@@ -373,8 +401,8 @@ const ComputerUse_20251124_Args = Schema.Struct({
|
|
|
373
401
|
/**
|
|
374
402
|
* Press a key or key combination (e.g. `"Return"`, `"ctrl+c"`, `"ctrl+s"`).
|
|
375
403
|
*
|
|
376
|
-
* @since 1.0.0
|
|
377
404
|
* @category Computer Use
|
|
405
|
+
* @since 4.0.0
|
|
378
406
|
*/
|
|
379
407
|
export const ComputerUseKeyAction = Schema.Struct({
|
|
380
408
|
action: Schema.Literal("key"),
|
|
@@ -384,16 +412,18 @@ export const ComputerUseKeyAction = Schema.Struct({
|
|
|
384
412
|
text: Schema.String
|
|
385
413
|
})
|
|
386
414
|
/**
|
|
387
|
-
*
|
|
415
|
+
* Computer-use action payload for pressing a key or key combination.
|
|
416
|
+
*
|
|
388
417
|
* @category Computer Use
|
|
418
|
+
* @since 4.0.0
|
|
389
419
|
*/
|
|
390
420
|
export type ComputerUseKeyAction = typeof ComputerUseKeyAction.Type
|
|
391
421
|
|
|
392
422
|
/**
|
|
393
423
|
* Perform a left click at the current mouse position or the specified coordinates.
|
|
394
424
|
*
|
|
395
|
-
* @since 1.0.0
|
|
396
425
|
* @category Computer Use
|
|
426
|
+
* @since 4.0.0
|
|
397
427
|
*/
|
|
398
428
|
export const ComputerUseLeftClickAction = Schema.Struct({
|
|
399
429
|
action: Schema.Literal("left_click"),
|
|
@@ -404,16 +434,18 @@ export const ComputerUseLeftClickAction = Schema.Struct({
|
|
|
404
434
|
coordinate: Schema.optional(Coordinate)
|
|
405
435
|
})
|
|
406
436
|
/**
|
|
407
|
-
*
|
|
437
|
+
* Computer-use action payload for performing a left click, optionally at a specific coordinate.
|
|
438
|
+
*
|
|
408
439
|
* @category Computer Use
|
|
440
|
+
* @since 4.0.0
|
|
409
441
|
*/
|
|
410
442
|
export type ComputerUseLeftClickAction = typeof ComputerUseLeftClickAction.Type
|
|
411
443
|
|
|
412
444
|
/**
|
|
413
445
|
* Move the mouse cursor to the specified coordinates.
|
|
414
446
|
*
|
|
415
|
-
* @since 1.0.0
|
|
416
447
|
* @category Computer Use
|
|
448
|
+
* @since 4.0.0
|
|
417
449
|
*/
|
|
418
450
|
export const ComputerUseMouseMoveAction = Schema.Struct({
|
|
419
451
|
action: Schema.Literal("mouse_move"),
|
|
@@ -423,31 +455,35 @@ export const ComputerUseMouseMoveAction = Schema.Struct({
|
|
|
423
455
|
coordinate: Coordinate
|
|
424
456
|
})
|
|
425
457
|
/**
|
|
426
|
-
*
|
|
458
|
+
* Computer-use action payload for moving the mouse cursor to a specific coordinate.
|
|
459
|
+
*
|
|
427
460
|
* @category Computer Use
|
|
461
|
+
* @since 4.0.0
|
|
428
462
|
*/
|
|
429
463
|
export type ComputerUseMouseMoveAction = typeof ComputerUseMouseMoveAction.Type
|
|
430
464
|
|
|
431
465
|
/**
|
|
432
466
|
* Capture the current display.
|
|
433
467
|
*
|
|
434
|
-
* @since 1.0.0
|
|
435
468
|
* @category Computer Use
|
|
469
|
+
* @since 4.0.0
|
|
436
470
|
*/
|
|
437
471
|
export const ComputerUseScreenshotAction = Schema.Struct({
|
|
438
472
|
action: Schema.Literal("screenshot")
|
|
439
473
|
})
|
|
440
474
|
/**
|
|
441
|
-
*
|
|
475
|
+
* Computer-use action payload for capturing the current display.
|
|
476
|
+
*
|
|
442
477
|
* @category Computer Use
|
|
478
|
+
* @since 4.0.0
|
|
443
479
|
*/
|
|
444
480
|
export type ComputerUseScreenshotAction = typeof ComputerUseScreenshotAction.Type
|
|
445
481
|
|
|
446
482
|
/**
|
|
447
483
|
* Type a text string.
|
|
448
484
|
*
|
|
449
|
-
* @since 1.0.0
|
|
450
485
|
* @category Computer Use
|
|
486
|
+
* @since 4.0.0
|
|
451
487
|
*/
|
|
452
488
|
export const TypeAction = Schema.Struct({
|
|
453
489
|
action: Schema.Literal("type"),
|
|
@@ -457,8 +493,10 @@ export const TypeAction = Schema.Struct({
|
|
|
457
493
|
text: Schema.String
|
|
458
494
|
})
|
|
459
495
|
/**
|
|
460
|
-
*
|
|
496
|
+
* Computer-use action payload for typing a text string.
|
|
497
|
+
*
|
|
461
498
|
* @category Computer Use
|
|
499
|
+
* @since 4.0.0
|
|
462
500
|
*/
|
|
463
501
|
export type TypeAction = typeof TypeAction.Type
|
|
464
502
|
|
|
@@ -477,8 +515,8 @@ const ComputerUse_20241022_Actions = Schema.Union([
|
|
|
477
515
|
/**
|
|
478
516
|
* Perform a double click.
|
|
479
517
|
*
|
|
480
|
-
* @since 1.0.0
|
|
481
518
|
* @category Computer Use
|
|
519
|
+
* @since 4.0.0
|
|
482
520
|
*/
|
|
483
521
|
export const ComputerUseDoubleClickAction = Schema.Struct({
|
|
484
522
|
action: Schema.Literal("double_click"),
|
|
@@ -489,16 +527,18 @@ export const ComputerUseDoubleClickAction = Schema.Struct({
|
|
|
489
527
|
coordinate: Schema.optional(Coordinate)
|
|
490
528
|
})
|
|
491
529
|
/**
|
|
492
|
-
*
|
|
530
|
+
* Computer-use action payload for performing a double click, optionally at a specific coordinate.
|
|
531
|
+
*
|
|
493
532
|
* @category Computer Use
|
|
533
|
+
* @since 4.0.0
|
|
494
534
|
*/
|
|
495
535
|
export type ComputerUseDoubleClickAction = typeof ComputerUseDoubleClickAction.Type
|
|
496
536
|
|
|
497
537
|
/**
|
|
498
|
-
*
|
|
538
|
+
* Hold a key for a specified duration during computer-use execution.
|
|
499
539
|
*
|
|
500
|
-
* @since 1.0.0
|
|
501
540
|
* @category Computer Use
|
|
541
|
+
* @since 4.0.0
|
|
502
542
|
*/
|
|
503
543
|
export const ComputerUseHoldKeyAction = Schema.Struct({
|
|
504
544
|
action: Schema.Literal("hold_key"),
|
|
@@ -512,16 +552,18 @@ export const ComputerUseHoldKeyAction = Schema.Struct({
|
|
|
512
552
|
duration: Schema.Number
|
|
513
553
|
})
|
|
514
554
|
/**
|
|
515
|
-
*
|
|
555
|
+
* Computer-use action payload for holding a key for a specified duration.
|
|
556
|
+
*
|
|
516
557
|
* @category Computer Use
|
|
558
|
+
* @since 4.0.0
|
|
517
559
|
*/
|
|
518
560
|
export type ComputerUseHoldKeyAction = typeof ComputerUseHoldKeyAction.Type
|
|
519
561
|
|
|
520
562
|
/**
|
|
521
563
|
* Click and drag from start coordinate to end coordinate.
|
|
522
564
|
*
|
|
523
|
-
* @since 1.0.0
|
|
524
565
|
* @category Computer Use
|
|
566
|
+
* @since 4.0.0
|
|
525
567
|
*/
|
|
526
568
|
export const ComputerUseLeftClickDragAction = Schema.Struct({
|
|
527
569
|
action: Schema.Literal("left_click_drag"),
|
|
@@ -535,18 +577,22 @@ export const ComputerUseLeftClickDragAction = Schema.Struct({
|
|
|
535
577
|
coordinate: Coordinate
|
|
536
578
|
})
|
|
537
579
|
/**
|
|
538
|
-
*
|
|
580
|
+
* Computer-use action payload for dragging from a start coordinate to an end coordinate.
|
|
581
|
+
*
|
|
539
582
|
* @category Computer Use
|
|
583
|
+
* @since 4.0.0
|
|
540
584
|
*/
|
|
541
585
|
export type ComputerUseLeftClickDragAction = typeof ComputerUseLeftClickDragAction.Type
|
|
542
586
|
|
|
543
587
|
/**
|
|
544
588
|
* Press the left mouse button down (without releasing).
|
|
545
589
|
*
|
|
546
|
-
*
|
|
590
|
+
* **When to use**
|
|
591
|
+
*
|
|
592
|
+
* Use this for fine-grained click control.
|
|
547
593
|
*
|
|
548
|
-
* @since 1.0.0
|
|
549
594
|
* @category Computer Use
|
|
595
|
+
* @since 4.0.0
|
|
550
596
|
*/
|
|
551
597
|
export const ComputerUseLeftMouseDownAction = Schema.Struct({
|
|
552
598
|
action: Schema.Literal("left_mouse_down"),
|
|
@@ -557,18 +603,22 @@ export const ComputerUseLeftMouseDownAction = Schema.Struct({
|
|
|
557
603
|
coordinate: Schema.optional(Coordinate)
|
|
558
604
|
})
|
|
559
605
|
/**
|
|
560
|
-
*
|
|
606
|
+
* Computer-use action payload for pressing and holding the left mouse button, optionally at a specific coordinate.
|
|
607
|
+
*
|
|
561
608
|
* @category Computer Use
|
|
609
|
+
* @since 4.0.0
|
|
562
610
|
*/
|
|
563
611
|
export type ComputerUseLeftMouseDownAction = typeof ComputerUseLeftMouseDownAction.Type
|
|
564
612
|
|
|
565
613
|
/**
|
|
566
614
|
* Release the left mouse button.
|
|
567
615
|
*
|
|
568
|
-
*
|
|
616
|
+
* **When to use**
|
|
617
|
+
*
|
|
618
|
+
* Use this for fine-grained click control.
|
|
569
619
|
*
|
|
570
|
-
* @since 1.0.0
|
|
571
620
|
* @category Computer Use
|
|
621
|
+
* @since 4.0.0
|
|
572
622
|
*/
|
|
573
623
|
export const ComputerUseLeftMouseUpAction = Schema.Struct({
|
|
574
624
|
action: Schema.Literal("left_mouse_up"),
|
|
@@ -579,16 +629,18 @@ export const ComputerUseLeftMouseUpAction = Schema.Struct({
|
|
|
579
629
|
coordinate: Schema.optional(Coordinate)
|
|
580
630
|
})
|
|
581
631
|
/**
|
|
582
|
-
*
|
|
632
|
+
* Computer-use action payload for releasing the left mouse button, optionally at a specific coordinate.
|
|
633
|
+
*
|
|
583
634
|
* @category Computer Use
|
|
635
|
+
* @since 4.0.0
|
|
584
636
|
*/
|
|
585
637
|
export type ComputerUseLeftMouseUpAction = typeof ComputerUseLeftMouseUpAction.Type
|
|
586
638
|
|
|
587
639
|
/**
|
|
588
640
|
* Perform a middle click.
|
|
589
641
|
*
|
|
590
|
-
* @since 1.0.0
|
|
591
642
|
* @category Computer Use
|
|
643
|
+
* @since 4.0.0
|
|
592
644
|
*/
|
|
593
645
|
export const ComputerUseMiddleClickAction = Schema.Struct({
|
|
594
646
|
action: Schema.Literal("middle_click"),
|
|
@@ -599,16 +651,18 @@ export const ComputerUseMiddleClickAction = Schema.Struct({
|
|
|
599
651
|
coordinate: Schema.optional(Coordinate)
|
|
600
652
|
})
|
|
601
653
|
/**
|
|
602
|
-
*
|
|
654
|
+
* Computer-use action payload for performing a middle click, optionally at a specific coordinate.
|
|
655
|
+
*
|
|
603
656
|
* @category Computer Use
|
|
657
|
+
* @since 4.0.0
|
|
604
658
|
*/
|
|
605
659
|
export type ComputerUseMiddleClickAction = typeof ComputerUseMiddleClickAction.Type
|
|
606
660
|
|
|
607
661
|
/**
|
|
608
662
|
* Perform a right click.
|
|
609
663
|
*
|
|
610
|
-
* @since 1.0.0
|
|
611
664
|
* @category Computer Use
|
|
665
|
+
* @since 4.0.0
|
|
612
666
|
*/
|
|
613
667
|
export const ComputerUseRightClickAction = Schema.Struct({
|
|
614
668
|
action: Schema.Literal("right_click"),
|
|
@@ -619,16 +673,18 @@ export const ComputerUseRightClickAction = Schema.Struct({
|
|
|
619
673
|
coordinate: Schema.optional(Coordinate)
|
|
620
674
|
})
|
|
621
675
|
/**
|
|
622
|
-
*
|
|
676
|
+
* Computer-use action payload for performing a right click, optionally at a specific coordinate.
|
|
677
|
+
*
|
|
623
678
|
* @category Computer Use
|
|
679
|
+
* @since 4.0.0
|
|
624
680
|
*/
|
|
625
681
|
export type ComputerUseRightClickAction = typeof ComputerUseRightClickAction.Type
|
|
626
682
|
|
|
627
683
|
/**
|
|
628
684
|
* Scroll a given amount in a specified direction.
|
|
629
685
|
*
|
|
630
|
-
* @since 1.0.0
|
|
631
686
|
* @category Computer Use
|
|
687
|
+
* @since 4.0.0
|
|
632
688
|
*/
|
|
633
689
|
export const ComputerUseScrollAction = Schema.Struct({
|
|
634
690
|
action: Schema.Literal("scroll"),
|
|
@@ -647,16 +703,18 @@ export const ComputerUseScrollAction = Schema.Struct({
|
|
|
647
703
|
scroll_amount: Schema.Number
|
|
648
704
|
})
|
|
649
705
|
/**
|
|
650
|
-
*
|
|
706
|
+
* Computer-use action payload for scrolling by a specified amount in a specified direction, optionally from a coordinate.
|
|
707
|
+
*
|
|
651
708
|
* @category Computer Use
|
|
709
|
+
* @since 4.0.0
|
|
652
710
|
*/
|
|
653
711
|
export type ComputerUseScrollAction = typeof ComputerUseScrollAction.Type
|
|
654
712
|
|
|
655
713
|
/**
|
|
656
714
|
* Perform a triple click.
|
|
657
715
|
*
|
|
658
|
-
* @since 1.0.0
|
|
659
716
|
* @category Computer Use
|
|
717
|
+
* @since 4.0.0
|
|
660
718
|
*/
|
|
661
719
|
export const ComputerUseTripleClickAction = Schema.Struct({
|
|
662
720
|
action: Schema.Literal("triple_click"),
|
|
@@ -667,16 +725,18 @@ export const ComputerUseTripleClickAction = Schema.Struct({
|
|
|
667
725
|
coordinate: Schema.optional(Coordinate)
|
|
668
726
|
})
|
|
669
727
|
/**
|
|
670
|
-
*
|
|
728
|
+
* Computer-use action payload for performing a triple click, optionally at a specific coordinate.
|
|
729
|
+
*
|
|
671
730
|
* @category Computer Use
|
|
731
|
+
* @since 4.0.0
|
|
672
732
|
*/
|
|
673
733
|
export type ComputerUseTripleClickAction = typeof ComputerUseTripleClickAction.Type
|
|
674
734
|
|
|
675
735
|
/**
|
|
676
736
|
* Pause between performing actions.
|
|
677
737
|
*
|
|
678
|
-
* @since 1.0.0
|
|
679
738
|
* @category Computer Use
|
|
739
|
+
* @since 4.0.0
|
|
680
740
|
*/
|
|
681
741
|
export const ComputerUseWaitAction = Schema.Struct({
|
|
682
742
|
action: Schema.Literal("wait"),
|
|
@@ -686,8 +746,10 @@ export const ComputerUseWaitAction = Schema.Struct({
|
|
|
686
746
|
duration: Schema.Number
|
|
687
747
|
})
|
|
688
748
|
/**
|
|
689
|
-
*
|
|
749
|
+
* Computer-use action payload for pausing for a specified duration.
|
|
750
|
+
*
|
|
690
751
|
* @category Computer Use
|
|
752
|
+
* @since 4.0.0
|
|
691
753
|
*/
|
|
692
754
|
export type ComputerUseWaitAction = typeof ComputerUseWaitAction.Type
|
|
693
755
|
|
|
@@ -712,10 +774,12 @@ const ComputerUse_20250124_Actions = Schema.Union([
|
|
|
712
774
|
/**
|
|
713
775
|
* Zoom into a specific region of the screen at full resolution.
|
|
714
776
|
*
|
|
777
|
+
* **Details**
|
|
778
|
+
*
|
|
715
779
|
* Requires `enableZoom: true` in the tool definition.
|
|
716
780
|
*
|
|
717
|
-
* @since 1.0.0
|
|
718
781
|
* @category Computer Use
|
|
782
|
+
* @since 4.0.0
|
|
719
783
|
*/
|
|
720
784
|
export const ComputerUseZoomAction = Schema.Struct({
|
|
721
785
|
action: Schema.Literal("zoom"),
|
|
@@ -726,8 +790,14 @@ export const ComputerUseZoomAction = Schema.Struct({
|
|
|
726
790
|
region: Region
|
|
727
791
|
})
|
|
728
792
|
/**
|
|
729
|
-
*
|
|
793
|
+
* Computer-use action payload for zooming into a specific screen region.
|
|
794
|
+
*
|
|
795
|
+
* **Details**
|
|
796
|
+
*
|
|
797
|
+
* The enclosing computer-use tool must be configured with `enableZoom: true`.
|
|
798
|
+
*
|
|
730
799
|
* @category Computer Use
|
|
800
|
+
* @since 4.0.0
|
|
731
801
|
*/
|
|
732
802
|
export type ComputerUseZoomAction = typeof ComputerUseZoomAction.Type
|
|
733
803
|
|
|
@@ -743,12 +813,13 @@ const ComputerUse_20251124_Actions = Schema.Union([
|
|
|
743
813
|
/**
|
|
744
814
|
* Computer use tool for Claude 3.5 Sonnet v2 (deprecated).
|
|
745
815
|
*
|
|
746
|
-
*
|
|
816
|
+
* **Details**
|
|
747
817
|
*
|
|
818
|
+
* Requires the "computer-use-2024-10-22" beta header.
|
|
748
819
|
* Basic actions only: screenshot, left_click, type, key, mouse_move.
|
|
749
820
|
*
|
|
750
|
-
* @since 1.0.0
|
|
751
821
|
* @category Computer Use
|
|
822
|
+
* @since 4.0.0
|
|
752
823
|
*/
|
|
753
824
|
export const ComputerUse_20241022 = Tool.providerDefined({
|
|
754
825
|
id: "anthropic.computer_use_20241022",
|
|
@@ -763,14 +834,15 @@ export const ComputerUse_20241022 = Tool.providerDefined({
|
|
|
763
834
|
/**
|
|
764
835
|
* Computer use tool for Claude 4 models and Claude Sonnet 3.7.
|
|
765
836
|
*
|
|
766
|
-
*
|
|
837
|
+
* **Details**
|
|
767
838
|
*
|
|
839
|
+
* Requires the "computer-use-2025-01-24" beta header.
|
|
768
840
|
* Includes basic actions plus enhanced actions: scroll, left_click_drag,
|
|
769
841
|
* right_click, middle_click, double_click, triple_click, left_mouse_down,
|
|
770
842
|
* left_mouse_up, hold_key, wait.
|
|
771
843
|
*
|
|
772
|
-
* @since 1.0.0
|
|
773
844
|
* @category Computer Use
|
|
845
|
+
* @since 4.0.0
|
|
774
846
|
*/
|
|
775
847
|
export const ComputerUse_20250124 = Tool.providerDefined({
|
|
776
848
|
id: "anthropic.computer_20250124",
|
|
@@ -785,13 +857,14 @@ export const ComputerUse_20250124 = Tool.providerDefined({
|
|
|
785
857
|
/**
|
|
786
858
|
* Computer use tool for Claude Opus 4.5 only.
|
|
787
859
|
*
|
|
788
|
-
*
|
|
860
|
+
* **Details**
|
|
789
861
|
*
|
|
862
|
+
* Requires the "computer-use-2025-11-24" beta header.
|
|
790
863
|
* Includes all actions from computer_20250124 plus the zoom action for
|
|
791
864
|
* detailed screen region inspection. Requires `enableZoom: true` in args.
|
|
792
865
|
*
|
|
793
|
-
* @since 1.0.0
|
|
794
866
|
* @category Computer Use
|
|
867
|
+
* @since 4.0.0
|
|
795
868
|
*/
|
|
796
869
|
export const ComputerUse_20251124 = Tool.providerDefined({
|
|
797
870
|
id: "anthropic.computer_20251124",
|
|
@@ -814,18 +887,21 @@ export const ComputerUse_20251124 = Tool.providerDefined({
|
|
|
814
887
|
/**
|
|
815
888
|
* A `[start, end]` line range for viewing file contents.
|
|
816
889
|
*
|
|
817
|
-
*
|
|
890
|
+
* **Details**
|
|
818
891
|
*
|
|
819
|
-
*
|
|
820
|
-
*
|
|
892
|
+
* Lines are 1-indexed. Use -1 for end to read to the end of the file. For
|
|
893
|
+
* example, `[1, 50]` views lines 1-50 and `[100, -1]` views from line 100 to
|
|
894
|
+
* the end of the file.
|
|
821
895
|
*
|
|
822
|
-
* @since 1.0.0
|
|
823
896
|
* @category Memory
|
|
897
|
+
* @since 4.0.0
|
|
824
898
|
*/
|
|
825
899
|
export const ViewRange = Schema.Tuple([Schema.Number, Schema.Number])
|
|
826
900
|
/**
|
|
827
|
-
*
|
|
901
|
+
* 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.
|
|
902
|
+
*
|
|
828
903
|
* @category Memory
|
|
904
|
+
* @since 4.0.0
|
|
829
905
|
*/
|
|
830
906
|
export type ViewRange = typeof ViewRange.Type
|
|
831
907
|
|
|
@@ -836,8 +912,8 @@ export type ViewRange = typeof ViewRange.Type
|
|
|
836
912
|
/**
|
|
837
913
|
* Creates a new file.
|
|
838
914
|
*
|
|
839
|
-
* @since 1.0.0
|
|
840
915
|
* @category Memory
|
|
916
|
+
* @since 4.0.0
|
|
841
917
|
*/
|
|
842
918
|
export const MemoryCreateCommand = Schema.Struct({
|
|
843
919
|
command: Schema.Literal("create"),
|
|
@@ -847,16 +923,18 @@ export const MemoryCreateCommand = Schema.Struct({
|
|
|
847
923
|
path: Schema.String
|
|
848
924
|
})
|
|
849
925
|
/**
|
|
850
|
-
*
|
|
926
|
+
* Memory tool command payload for creating a new file at a path.
|
|
927
|
+
*
|
|
851
928
|
* @category Memory
|
|
929
|
+
* @since 4.0.0
|
|
852
930
|
*/
|
|
853
931
|
export type MemoryCreateCommand = typeof MemoryCreateCommand.Type
|
|
854
932
|
|
|
855
933
|
/**
|
|
856
934
|
* Delete a file or directory.
|
|
857
935
|
*
|
|
858
|
-
* @since 1.0.0
|
|
859
936
|
* @category Memory
|
|
937
|
+
* @since 4.0.0
|
|
860
938
|
*/
|
|
861
939
|
export const MemoryDeleteCommand = Schema.Struct({
|
|
862
940
|
command: Schema.Literal("delete"),
|
|
@@ -866,16 +944,18 @@ export const MemoryDeleteCommand = Schema.Struct({
|
|
|
866
944
|
path: Schema.String
|
|
867
945
|
})
|
|
868
946
|
/**
|
|
869
|
-
*
|
|
947
|
+
* Memory tool command payload for deleting a file or directory at a path.
|
|
948
|
+
*
|
|
870
949
|
* @category Memory
|
|
950
|
+
* @since 4.0.0
|
|
871
951
|
*/
|
|
872
952
|
export type MemoryDeleteCommand = typeof MemoryDeleteCommand.Type
|
|
873
953
|
|
|
874
954
|
/**
|
|
875
955
|
* Insert text at a specific line.
|
|
876
956
|
*
|
|
877
|
-
* @since 1.0.0
|
|
878
957
|
* @category Memory
|
|
958
|
+
* @since 4.0.0
|
|
879
959
|
*/
|
|
880
960
|
export const MemoryInsertCommand = Schema.Struct({
|
|
881
961
|
command: Schema.Literal("insert"),
|
|
@@ -893,16 +973,18 @@ export const MemoryInsertCommand = Schema.Struct({
|
|
|
893
973
|
insert_text: Schema.String
|
|
894
974
|
})
|
|
895
975
|
/**
|
|
896
|
-
*
|
|
976
|
+
* Memory tool command payload for inserting text at a specific line in a file.
|
|
977
|
+
*
|
|
897
978
|
* @category Memory
|
|
979
|
+
* @since 4.0.0
|
|
898
980
|
*/
|
|
899
981
|
export type MemoryInsertCommand = typeof MemoryInsertCommand.Type
|
|
900
982
|
|
|
901
983
|
/**
|
|
902
984
|
* Rename or move a file or directory.
|
|
903
985
|
*
|
|
904
|
-
* @since 1.0.0
|
|
905
986
|
* @category Memory
|
|
987
|
+
* @since 4.0.0
|
|
906
988
|
*/
|
|
907
989
|
export const MemoryRenameCommand = Schema.Struct({
|
|
908
990
|
command: Schema.Literal("rename"),
|
|
@@ -916,16 +998,18 @@ export const MemoryRenameCommand = Schema.Struct({
|
|
|
916
998
|
new_path: Schema.String
|
|
917
999
|
})
|
|
918
1000
|
/**
|
|
919
|
-
*
|
|
1001
|
+
* Memory tool command payload for renaming or moving a file or directory.
|
|
1002
|
+
*
|
|
920
1003
|
* @category Memory
|
|
1004
|
+
* @since 4.0.0
|
|
921
1005
|
*/
|
|
922
1006
|
export type MemoryRenameCommand = typeof MemoryRenameCommand.Type
|
|
923
1007
|
|
|
924
1008
|
/**
|
|
925
1009
|
* Replace text in a file.
|
|
926
1010
|
*
|
|
927
|
-
* @since 1.0.0
|
|
928
1011
|
* @category Memory
|
|
1012
|
+
* @since 4.0.0
|
|
929
1013
|
*/
|
|
930
1014
|
export const MemoryStrReplaceCommand = Schema.Struct({
|
|
931
1015
|
command: Schema.Literal("str_replace"),
|
|
@@ -943,16 +1027,18 @@ export const MemoryStrReplaceCommand = Schema.Struct({
|
|
|
943
1027
|
new_str: Schema.String
|
|
944
1028
|
})
|
|
945
1029
|
/**
|
|
946
|
-
*
|
|
1030
|
+
* Memory tool command payload for replacing text in a file.
|
|
1031
|
+
*
|
|
947
1032
|
* @category Memory
|
|
1033
|
+
* @since 4.0.0
|
|
948
1034
|
*/
|
|
949
1035
|
export type MemoryStrReplaceCommand = typeof MemoryStrReplaceCommand.Type
|
|
950
1036
|
|
|
951
1037
|
/**
|
|
952
1038
|
* Shows directory contents or file contents with optional line ranges.
|
|
953
1039
|
*
|
|
954
|
-
* @since 1.0.0
|
|
955
1040
|
* @category Memory
|
|
1041
|
+
* @since 4.0.0
|
|
956
1042
|
*/
|
|
957
1043
|
export const MemoryViewCommand = Schema.Struct({
|
|
958
1044
|
command: Schema.Literal("view"),
|
|
@@ -966,8 +1052,10 @@ export const MemoryViewCommand = Schema.Struct({
|
|
|
966
1052
|
view_range: Schema.optional(ViewRange)
|
|
967
1053
|
})
|
|
968
1054
|
/**
|
|
969
|
-
*
|
|
1055
|
+
* Memory tool command payload for viewing a file or directory, optionally with a file line range.
|
|
1056
|
+
*
|
|
970
1057
|
* @category Memory
|
|
1058
|
+
* @since 4.0.0
|
|
971
1059
|
*/
|
|
972
1060
|
export type MemoryViewCommand = typeof MemoryViewCommand.Type
|
|
973
1061
|
|
|
@@ -987,11 +1075,13 @@ const Memory_20250818_Commands = Schema.Union([
|
|
|
987
1075
|
/**
|
|
988
1076
|
* Memory tool for persistent file operations across conversations.
|
|
989
1077
|
*
|
|
1078
|
+
* **Details**
|
|
1079
|
+
*
|
|
990
1080
|
* Provides commands for creating, viewing, editing, renaming, and deleting
|
|
991
1081
|
* files within the model's memory space.
|
|
992
1082
|
*
|
|
993
|
-
* @since 1.0.0
|
|
994
1083
|
* @category Memory
|
|
1084
|
+
* @since 4.0.0
|
|
995
1085
|
*/
|
|
996
1086
|
export const Memory_20250818 = Tool.providerDefined({
|
|
997
1087
|
id: "anthropic.memory_20250818",
|
|
@@ -1012,11 +1102,13 @@ export const Memory_20250818 = Tool.providerDefined({
|
|
|
1012
1102
|
/**
|
|
1013
1103
|
* View the contents of a file or list directory contents.
|
|
1014
1104
|
*
|
|
1015
|
-
*
|
|
1016
|
-
*
|
|
1105
|
+
* **Details**
|
|
1106
|
+
*
|
|
1107
|
+
* When used on a file, returns the file contents, optionally limited to a line
|
|
1108
|
+
* range. When used on a directory, lists all files and subdirectories.
|
|
1017
1109
|
*
|
|
1018
|
-
* @since 1.0.0
|
|
1019
1110
|
* @category Text Editor
|
|
1111
|
+
* @since 4.0.0
|
|
1020
1112
|
*/
|
|
1021
1113
|
export const TextEditorViewCommand = Schema.Struct({
|
|
1022
1114
|
command: Schema.Literal("view"),
|
|
@@ -1031,18 +1123,22 @@ export const TextEditorViewCommand = Schema.Struct({
|
|
|
1031
1123
|
view_range: Schema.optional(ViewRange)
|
|
1032
1124
|
})
|
|
1033
1125
|
/**
|
|
1034
|
-
*
|
|
1126
|
+
* Text editor command payload for viewing file contents or listing directory contents.
|
|
1127
|
+
*
|
|
1035
1128
|
* @category Text Editor
|
|
1129
|
+
* @since 4.0.0
|
|
1036
1130
|
*/
|
|
1037
1131
|
export type TextEditorViewCommand = typeof TextEditorViewCommand.Type
|
|
1038
1132
|
|
|
1039
1133
|
/**
|
|
1040
1134
|
* Create a new file with specified content.
|
|
1041
1135
|
*
|
|
1042
|
-
*
|
|
1136
|
+
* **Gotchas**
|
|
1137
|
+
*
|
|
1138
|
+
* Fails if the file already exists. Parent directories must exist.
|
|
1043
1139
|
*
|
|
1044
|
-
* @since 1.0.0
|
|
1045
1140
|
* @category Text Editor
|
|
1141
|
+
* @since 4.0.0
|
|
1046
1142
|
*/
|
|
1047
1143
|
export const TextEditorCreateCommand = Schema.Struct({
|
|
1048
1144
|
command: Schema.Literal("create"),
|
|
@@ -1056,19 +1152,27 @@ export const TextEditorCreateCommand = Schema.Struct({
|
|
|
1056
1152
|
file_text: Schema.String
|
|
1057
1153
|
})
|
|
1058
1154
|
/**
|
|
1059
|
-
*
|
|
1155
|
+
* Text editor command payload for creating a new file with the specified content.
|
|
1156
|
+
*
|
|
1157
|
+
* **Gotchas**
|
|
1158
|
+
*
|
|
1159
|
+
* The command fails if the file already exists or if parent directories are missing.
|
|
1160
|
+
*
|
|
1060
1161
|
* @category Text Editor
|
|
1162
|
+
* @since 4.0.0
|
|
1061
1163
|
*/
|
|
1062
1164
|
export type TextEditorCreateCommand = typeof TextEditorCreateCommand.Type
|
|
1063
1165
|
|
|
1064
1166
|
/**
|
|
1065
1167
|
* Replace a specific string in a file with a new string.
|
|
1066
1168
|
*
|
|
1169
|
+
* **Gotchas**
|
|
1170
|
+
*
|
|
1067
1171
|
* The `old_str` must match exactly (including whitespace and indentation)
|
|
1068
1172
|
* and must be unique in the file.
|
|
1069
1173
|
*
|
|
1070
|
-
* @since 1.0.0
|
|
1071
1174
|
* @category Text Editor
|
|
1175
|
+
* @since 4.0.0
|
|
1072
1176
|
*/
|
|
1073
1177
|
export const TextEditorStrReplaceCommand = Schema.Struct({
|
|
1074
1178
|
command: Schema.Literal("str_replace"),
|
|
@@ -1086,18 +1190,22 @@ export const TextEditorStrReplaceCommand = Schema.Struct({
|
|
|
1086
1190
|
new_str: Schema.String
|
|
1087
1191
|
})
|
|
1088
1192
|
/**
|
|
1089
|
-
*
|
|
1193
|
+
* Text editor command payload for replacing one exact, unique string in a file.
|
|
1194
|
+
*
|
|
1090
1195
|
* @category Text Editor
|
|
1196
|
+
* @since 4.0.0
|
|
1091
1197
|
*/
|
|
1092
1198
|
export type TextEditorStrReplaceCommand = typeof TextEditorStrReplaceCommand.Type
|
|
1093
1199
|
|
|
1094
1200
|
/**
|
|
1095
1201
|
* Insert text at a specific line number in a file.
|
|
1096
1202
|
*
|
|
1203
|
+
* **Details**
|
|
1204
|
+
*
|
|
1097
1205
|
* Inserts the new text AFTER the specified line number.
|
|
1098
1206
|
*
|
|
1099
|
-
* @since 1.0.0
|
|
1100
1207
|
* @category Text Editor
|
|
1208
|
+
* @since 4.0.0
|
|
1101
1209
|
*/
|
|
1102
1210
|
export const TextEditorInsertCommand = Schema.Struct({
|
|
1103
1211
|
command: Schema.Literal("insert"),
|
|
@@ -1115,21 +1223,27 @@ export const TextEditorInsertCommand = Schema.Struct({
|
|
|
1115
1223
|
new_str: Schema.String
|
|
1116
1224
|
})
|
|
1117
1225
|
/**
|
|
1118
|
-
*
|
|
1226
|
+
* Text editor command payload for inserting text after a specific line number in a file.
|
|
1227
|
+
*
|
|
1119
1228
|
* @category Text Editor
|
|
1229
|
+
* @since 4.0.0
|
|
1120
1230
|
*/
|
|
1121
1231
|
export type TextEditorInsertCommand = typeof TextEditorInsertCommand.Type
|
|
1122
1232
|
|
|
1123
1233
|
/**
|
|
1124
1234
|
* Undo the last edit made to a file.
|
|
1125
1235
|
*
|
|
1236
|
+
* **Details**
|
|
1237
|
+
*
|
|
1126
1238
|
* Reverts the most recent str_replace, insert, or create operation on the file.
|
|
1127
1239
|
*
|
|
1128
|
-
*
|
|
1129
|
-
*
|
|
1240
|
+
* **Gotchas**
|
|
1241
|
+
*
|
|
1242
|
+
* This command is available in text_editor_20241022 and text_editor_20250124,
|
|
1243
|
+
* but not in text_editor_20250728 (Claude 4 models).
|
|
1130
1244
|
*
|
|
1131
|
-
* @since 1.0.0
|
|
1132
1245
|
* @category Text Editor
|
|
1246
|
+
* @since 4.0.0
|
|
1133
1247
|
*/
|
|
1134
1248
|
export const TextEditorUndoEditCommand = Schema.Struct({
|
|
1135
1249
|
command: Schema.Literal("undo_edit"),
|
|
@@ -1139,8 +1253,14 @@ export const TextEditorUndoEditCommand = Schema.Struct({
|
|
|
1139
1253
|
path: Schema.String
|
|
1140
1254
|
})
|
|
1141
1255
|
/**
|
|
1142
|
-
*
|
|
1256
|
+
* Text editor command payload for undoing the most recent edit to a file.
|
|
1257
|
+
*
|
|
1258
|
+
* **Gotchas**
|
|
1259
|
+
*
|
|
1260
|
+
* Available for `text_editor_20241022` and `text_editor_20250124`, but not for Claude 4 text editor versions.
|
|
1261
|
+
*
|
|
1143
1262
|
* @category Text Editor
|
|
1263
|
+
* @since 4.0.0
|
|
1144
1264
|
*/
|
|
1145
1265
|
export type TextEditorUndoEditCommand = typeof TextEditorUndoEditCommand.Type
|
|
1146
1266
|
|
|
@@ -1178,10 +1298,12 @@ const TextEditor_StrReplaceBasedEdit_Args = Schema.Struct({
|
|
|
1178
1298
|
/**
|
|
1179
1299
|
* Text editor tool for Claude 3.5 Sonnet (deprecated).
|
|
1180
1300
|
*
|
|
1301
|
+
* **Details**
|
|
1302
|
+
*
|
|
1181
1303
|
* Requires the "computer-use-2024-10-22" beta header.
|
|
1182
1304
|
*
|
|
1183
|
-
* @since 1.0.0
|
|
1184
1305
|
* @category Text Editor
|
|
1306
|
+
* @since 4.0.0
|
|
1185
1307
|
*/
|
|
1186
1308
|
export const TextEditor_20241022 = Tool.providerDefined({
|
|
1187
1309
|
id: "anthropic.text_editor_20241022",
|
|
@@ -1195,8 +1317,12 @@ export const TextEditor_20241022 = Tool.providerDefined({
|
|
|
1195
1317
|
/**
|
|
1196
1318
|
* Text editor tool for Claude Sonnet 3.7 (deprecated model).
|
|
1197
1319
|
*
|
|
1198
|
-
*
|
|
1320
|
+
* **Details**
|
|
1321
|
+
*
|
|
1322
|
+
* Requires the "computer-use-2025-01-24" beta header.
|
|
1323
|
+
*
|
|
1199
1324
|
* @category Text Editor
|
|
1325
|
+
* @since 4.0.0
|
|
1200
1326
|
*/
|
|
1201
1327
|
export const TextEditor_20250124 = Tool.providerDefined({
|
|
1202
1328
|
id: "anthropic.text_editor_20250124",
|
|
@@ -1208,12 +1334,18 @@ export const TextEditor_20250124 = Tool.providerDefined({
|
|
|
1208
1334
|
})
|
|
1209
1335
|
|
|
1210
1336
|
/**
|
|
1211
|
-
* Text editor tool for Claude 4 models
|
|
1337
|
+
* Text editor tool for Claude 4 models using Anthropic's `str_replace_based_edit_tool`.
|
|
1338
|
+
*
|
|
1339
|
+
* **Details**
|
|
1212
1340
|
*
|
|
1213
|
-
*
|
|
1341
|
+
* Requires the "computer-use-2025-01-24" beta header.
|
|
1342
|
+
*
|
|
1343
|
+
* **Gotchas**
|
|
1344
|
+
*
|
|
1345
|
+
* This version does not support the `undo_edit` command.
|
|
1214
1346
|
*
|
|
1215
|
-
* @since 1.0.0
|
|
1216
1347
|
* @category Text Editor
|
|
1348
|
+
* @since 4.0.0
|
|
1217
1349
|
*/
|
|
1218
1350
|
export const TextEditor_20250429 = Tool.providerDefined({
|
|
1219
1351
|
id: "anthropic.text_editor_20250429",
|
|
@@ -1228,10 +1360,12 @@ export const TextEditor_20250429 = Tool.providerDefined({
|
|
|
1228
1360
|
/**
|
|
1229
1361
|
* Text editor tool for Claude 4 models.
|
|
1230
1362
|
*
|
|
1231
|
-
*
|
|
1363
|
+
* **Gotchas**
|
|
1364
|
+
*
|
|
1365
|
+
* This version does not support the `undo_edit` command.
|
|
1232
1366
|
*
|
|
1233
|
-
* @since 1.0.0
|
|
1234
1367
|
* @category Text Editor
|
|
1368
|
+
* @since 4.0.0
|
|
1235
1369
|
*/
|
|
1236
1370
|
export const TextEditor_20250728 = Tool.providerDefined({
|
|
1237
1371
|
id: "anthropic.text_editor_20250728",
|
|
@@ -1254,11 +1388,13 @@ export const TextEditor_20250728 = Tool.providerDefined({
|
|
|
1254
1388
|
/**
|
|
1255
1389
|
* User location for localizing search results.
|
|
1256
1390
|
*
|
|
1391
|
+
* **When to use**
|
|
1392
|
+
*
|
|
1257
1393
|
* Providing location helps return more relevant results for location-dependent
|
|
1258
1394
|
* queries like weather, local businesses, events, etc.
|
|
1259
1395
|
*
|
|
1260
|
-
* @since 1.0.0
|
|
1261
1396
|
* @category Web Search
|
|
1397
|
+
* @since 4.0.0
|
|
1262
1398
|
*/
|
|
1263
1399
|
export const WebSearchUserLocation = Schema.Struct({
|
|
1264
1400
|
/**
|
|
@@ -1290,8 +1426,8 @@ export const WebSearchUserLocation = Schema.Struct({
|
|
|
1290
1426
|
/**
|
|
1291
1427
|
* Configuration arguments for the web search tool.
|
|
1292
1428
|
*
|
|
1293
|
-
* @since 1.0.0
|
|
1294
1429
|
* @category Web Search
|
|
1430
|
+
* @since 4.0.0
|
|
1295
1431
|
*/
|
|
1296
1432
|
export const WebSearch_20250305_Args = Schema.Struct({
|
|
1297
1433
|
/**
|
|
@@ -1316,8 +1452,10 @@ export const WebSearch_20250305_Args = Schema.Struct({
|
|
|
1316
1452
|
userLocation: Schema.optional(WebSearchUserLocation)
|
|
1317
1453
|
})
|
|
1318
1454
|
/**
|
|
1319
|
-
*
|
|
1455
|
+
* Configuration arguments for the Anthropic web search tool, including usage limits, domain filters, and optional user location.
|
|
1456
|
+
*
|
|
1320
1457
|
* @category Web Search
|
|
1458
|
+
* @since 4.0.0
|
|
1321
1459
|
*/
|
|
1322
1460
|
export type WebSearch_20250305_Args = typeof WebSearch_20250305_Args.Type
|
|
1323
1461
|
|
|
@@ -1328,8 +1466,8 @@ export type WebSearch_20250305_Args = typeof WebSearch_20250305_Args.Type
|
|
|
1328
1466
|
/**
|
|
1329
1467
|
* Input parameters for a web search.
|
|
1330
1468
|
*
|
|
1331
|
-
* @since 1.0.0
|
|
1332
1469
|
* @category Web Search
|
|
1470
|
+
* @since 4.0.0
|
|
1333
1471
|
*/
|
|
1334
1472
|
export const WebSearchParameters = Schema.Struct({
|
|
1335
1473
|
/**
|
|
@@ -1338,8 +1476,14 @@ export const WebSearchParameters = Schema.Struct({
|
|
|
1338
1476
|
query: Schema.String
|
|
1339
1477
|
})
|
|
1340
1478
|
/**
|
|
1341
|
-
*
|
|
1479
|
+
* Type of the parameters Claude supplies when invoking the Anthropic web search tool.
|
|
1480
|
+
*
|
|
1481
|
+
* **Details**
|
|
1482
|
+
*
|
|
1483
|
+
* Contains the generated search query used by `WebSearch_20250305`.
|
|
1484
|
+
*
|
|
1342
1485
|
* @category Web Search
|
|
1486
|
+
* @since 4.0.0
|
|
1343
1487
|
*/
|
|
1344
1488
|
export type WebSearchParameters = typeof WebSearchParameters.Type
|
|
1345
1489
|
|
|
@@ -1350,13 +1494,14 @@ export type WebSearchParameters = typeof WebSearchParameters.Type
|
|
|
1350
1494
|
/**
|
|
1351
1495
|
* Web search tool for Claude models.
|
|
1352
1496
|
*
|
|
1497
|
+
* **Details**
|
|
1498
|
+
*
|
|
1353
1499
|
* Enables Claude to search the web for real-time information. This is a
|
|
1354
1500
|
* server-side tool executed by Anthropic's infrastructure.
|
|
1355
|
-
*
|
|
1356
1501
|
* Generally available (no beta header required).
|
|
1357
1502
|
*
|
|
1358
|
-
* @since 1.0.0
|
|
1359
1503
|
* @category Web Search
|
|
1504
|
+
* @since 4.0.0
|
|
1360
1505
|
*/
|
|
1361
1506
|
export const WebSearch_20250305 = Tool.providerDefined({
|
|
1362
1507
|
id: "anthropic.web_search_20250305",
|
|
@@ -1379,8 +1524,8 @@ export const WebSearch_20250305 = Tool.providerDefined({
|
|
|
1379
1524
|
/**
|
|
1380
1525
|
* Citation configuration for web fetch.
|
|
1381
1526
|
*
|
|
1382
|
-
* @since 1.0.0
|
|
1383
1527
|
* @category Web Fetch
|
|
1528
|
+
* @since 4.0.0
|
|
1384
1529
|
*/
|
|
1385
1530
|
export const WebFetchCitationsConfig = Schema.Struct({
|
|
1386
1531
|
/**
|
|
@@ -1389,8 +1534,10 @@ export const WebFetchCitationsConfig = Schema.Struct({
|
|
|
1389
1534
|
enabled: Schema.Boolean
|
|
1390
1535
|
})
|
|
1391
1536
|
/**
|
|
1392
|
-
*
|
|
1537
|
+
* Configuration payload for enabling or disabling citations on web fetch results.
|
|
1538
|
+
*
|
|
1393
1539
|
* @category Web Fetch
|
|
1540
|
+
* @since 4.0.0
|
|
1394
1541
|
*/
|
|
1395
1542
|
export type WebFetchCitationsConfig = typeof WebFetchCitationsConfig.Type
|
|
1396
1543
|
|
|
@@ -1401,8 +1548,8 @@ export type WebFetchCitationsConfig = typeof WebFetchCitationsConfig.Type
|
|
|
1401
1548
|
/**
|
|
1402
1549
|
* Configuration arguments for the web fetch tool.
|
|
1403
1550
|
*
|
|
1404
|
-
* @since 1.0.0
|
|
1405
1551
|
* @category Web Fetch
|
|
1552
|
+
* @since 4.0.0
|
|
1406
1553
|
*/
|
|
1407
1554
|
export const WebFetch_20250910_Args = Schema.Struct({
|
|
1408
1555
|
/**
|
|
@@ -1431,8 +1578,10 @@ export const WebFetch_20250910_Args = Schema.Struct({
|
|
|
1431
1578
|
maxContentTokens: Schema.optional(Schema.Number)
|
|
1432
1579
|
})
|
|
1433
1580
|
/**
|
|
1434
|
-
*
|
|
1581
|
+
* Configuration arguments for the Anthropic web fetch tool, including usage limits, domain filters, citation settings, and token limits.
|
|
1582
|
+
*
|
|
1435
1583
|
* @category Web Fetch
|
|
1584
|
+
* @since 4.0.0
|
|
1436
1585
|
*/
|
|
1437
1586
|
export type WebFetch_20250910_Args = typeof WebFetch_20250910_Args.Type
|
|
1438
1587
|
|
|
@@ -1443,8 +1592,8 @@ export type WebFetch_20250910_Args = typeof WebFetch_20250910_Args.Type
|
|
|
1443
1592
|
/**
|
|
1444
1593
|
* Input parameters for a web fetch.
|
|
1445
1594
|
*
|
|
1446
|
-
* @since 1.0.0
|
|
1447
1595
|
* @category Web Fetch
|
|
1596
|
+
* @since 4.0.0
|
|
1448
1597
|
*/
|
|
1449
1598
|
export const WebFetchParameters = Schema.Struct({
|
|
1450
1599
|
/**
|
|
@@ -1454,8 +1603,10 @@ export const WebFetchParameters = Schema.Struct({
|
|
|
1454
1603
|
url: Schema.String
|
|
1455
1604
|
})
|
|
1456
1605
|
/**
|
|
1457
|
-
*
|
|
1606
|
+
* Type of the parameters Claude supplies when invoking the Anthropic web fetch tool.
|
|
1607
|
+
*
|
|
1458
1608
|
* @category Web Fetch
|
|
1609
|
+
* @since 4.0.0
|
|
1459
1610
|
*/
|
|
1460
1611
|
export type WebFetchParameters = typeof WebFetchParameters.Type
|
|
1461
1612
|
|
|
@@ -1466,13 +1617,14 @@ export type WebFetchParameters = typeof WebFetchParameters.Type
|
|
|
1466
1617
|
/**
|
|
1467
1618
|
* Web fetch tool for Claude models.
|
|
1468
1619
|
*
|
|
1620
|
+
* **Details**
|
|
1621
|
+
*
|
|
1469
1622
|
* Allows Claude to retrieve full content from web pages and PDF documents.
|
|
1470
1623
|
* This is a server-side tool executed by Anthropic's infrastructure.
|
|
1471
|
-
*
|
|
1472
1624
|
* Requires the "web-fetch-2025-09-10" beta header.
|
|
1473
1625
|
*
|
|
1474
|
-
* @since 1.0.0
|
|
1475
1626
|
* @category Web Fetch
|
|
1627
|
+
* @since 4.0.0
|
|
1476
1628
|
*/
|
|
1477
1629
|
export const WebFetch_20250910 = Tool.providerDefined({
|
|
1478
1630
|
id: "anthropic.web_fetch_20250910",
|
|
@@ -1495,11 +1647,13 @@ export const WebFetch_20250910 = Tool.providerDefined({
|
|
|
1495
1647
|
/**
|
|
1496
1648
|
* Input parameters for regex-based tool search.
|
|
1497
1649
|
*
|
|
1650
|
+
* **Details**
|
|
1651
|
+
*
|
|
1498
1652
|
* Claude constructs regex patterns using Python's `re.search()` syntax.
|
|
1499
1653
|
* Maximum query length: 200 characters.
|
|
1500
1654
|
*
|
|
1501
|
-
* @since 1.0.0
|
|
1502
1655
|
* @category Tool Search
|
|
1656
|
+
* @since 4.0.0
|
|
1503
1657
|
*/
|
|
1504
1658
|
export const ToolSearchRegexParameters = Schema.Struct({
|
|
1505
1659
|
/**
|
|
@@ -1508,16 +1662,18 @@ export const ToolSearchRegexParameters = Schema.Struct({
|
|
|
1508
1662
|
query: Schema.String
|
|
1509
1663
|
})
|
|
1510
1664
|
/**
|
|
1511
|
-
*
|
|
1665
|
+
* Type of the parameters Claude supplies when invoking regex-based Anthropic tool search.
|
|
1666
|
+
*
|
|
1512
1667
|
* @category Tool Search
|
|
1668
|
+
* @since 4.0.0
|
|
1513
1669
|
*/
|
|
1514
1670
|
export type ToolSearchRegexParameters = typeof ToolSearchRegexParameters.Type
|
|
1515
1671
|
|
|
1516
1672
|
/**
|
|
1517
1673
|
* Input parameters for BM25/natural language tool search.
|
|
1518
1674
|
*
|
|
1519
|
-
* @since 1.0.0
|
|
1520
1675
|
* @category Tool Search
|
|
1676
|
+
* @since 4.0.0
|
|
1521
1677
|
*/
|
|
1522
1678
|
export const ToolSearchBM25Parameters = Schema.Struct({
|
|
1523
1679
|
/**
|
|
@@ -1526,8 +1682,10 @@ export const ToolSearchBM25Parameters = Schema.Struct({
|
|
|
1526
1682
|
query: Schema.String
|
|
1527
1683
|
})
|
|
1528
1684
|
/**
|
|
1529
|
-
*
|
|
1685
|
+
* Type of the parameters Claude supplies when invoking BM25 natural-language Anthropic tool search.
|
|
1686
|
+
*
|
|
1530
1687
|
* @category Tool Search
|
|
1688
|
+
* @since 4.0.0
|
|
1531
1689
|
*/
|
|
1532
1690
|
export type ToolSearchBM25Parameters = typeof ToolSearchBM25Parameters.Type
|
|
1533
1691
|
|
|
@@ -1538,14 +1696,15 @@ export type ToolSearchBM25Parameters = typeof ToolSearchBM25Parameters.Type
|
|
|
1538
1696
|
/**
|
|
1539
1697
|
* Regex-based tool search for Claude models.
|
|
1540
1698
|
*
|
|
1699
|
+
* **Details**
|
|
1700
|
+
*
|
|
1541
1701
|
* Claude constructs regex patterns using Python's `re.search()` syntax to
|
|
1542
1702
|
* find tools. The regex is matched against tool names, descriptions,
|
|
1543
1703
|
* argument names, and argument descriptions.
|
|
1544
|
-
*
|
|
1545
1704
|
* Requires the "advanced-tool-use-2025-11-20" beta header.
|
|
1546
1705
|
*
|
|
1547
|
-
* @since 1.0.0
|
|
1548
1706
|
* @category Tool Search
|
|
1707
|
+
* @since 4.0.0
|
|
1549
1708
|
*/
|
|
1550
1709
|
export const ToolSearchRegex_20251119 = Tool.providerDefined({
|
|
1551
1710
|
id: "anthropic.tool_search_tool_regex_20251119",
|
|
@@ -1559,14 +1718,15 @@ export const ToolSearchRegex_20251119 = Tool.providerDefined({
|
|
|
1559
1718
|
/**
|
|
1560
1719
|
* BM25/natural language tool search for Claude models.
|
|
1561
1720
|
*
|
|
1721
|
+
* **Details**
|
|
1722
|
+
*
|
|
1562
1723
|
* Claude uses natural language queries to search for tools using the
|
|
1563
1724
|
* BM25 algorithm. The search is performed against tool names, descriptions,
|
|
1564
1725
|
* argument names, and argument descriptions.
|
|
1565
|
-
*
|
|
1566
1726
|
* Requires the "advanced-tool-use-2025-11-20" beta header.
|
|
1567
1727
|
*
|
|
1568
|
-
* @since 1.0.0
|
|
1569
1728
|
* @category Tool Search
|
|
1729
|
+
* @since 4.0.0
|
|
1570
1730
|
*/
|
|
1571
1731
|
export const ToolSearchBM25_20251119 = Tool.providerDefined({
|
|
1572
1732
|
id: "anthropic.tool_search_tool_bm25_20251119",
|