@effect/ai-anthropic 0.22.0 → 4.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/AnthropicClient.d.ts +196 -0
  2. package/dist/AnthropicClient.d.ts.map +1 -0
  3. package/dist/AnthropicClient.js +142 -0
  4. package/dist/AnthropicClient.js.map +1 -0
  5. package/dist/{dts/AnthropicConfig.d.ts → AnthropicConfig.d.ts} +9 -9
  6. package/dist/AnthropicConfig.d.ts.map +1 -0
  7. package/dist/{esm/AnthropicConfig.js → AnthropicConfig.js} +8 -5
  8. package/dist/AnthropicConfig.js.map +1 -0
  9. package/dist/AnthropicError.d.ts +102 -0
  10. package/dist/AnthropicError.d.ts.map +1 -0
  11. package/dist/AnthropicError.js +10 -0
  12. package/dist/AnthropicError.js.map +1 -0
  13. package/dist/AnthropicLanguageModel.d.ts +522 -0
  14. package/dist/AnthropicLanguageModel.d.ts.map +1 -0
  15. package/dist/AnthropicLanguageModel.js +2107 -0
  16. package/dist/AnthropicLanguageModel.js.map +1 -0
  17. package/dist/AnthropicTelemetry.d.ts +101 -0
  18. package/dist/AnthropicTelemetry.d.ts.map +1 -0
  19. package/dist/AnthropicTelemetry.js +35 -0
  20. package/dist/AnthropicTelemetry.js.map +1 -0
  21. package/dist/AnthropicTool.d.ts +2153 -0
  22. package/dist/AnthropicTool.d.ts.map +1 -0
  23. package/dist/AnthropicTool.js +1168 -0
  24. package/dist/AnthropicTool.js.map +1 -0
  25. package/dist/Generated.d.ts +25233 -0
  26. package/dist/Generated.d.ts.map +1 -0
  27. package/dist/Generated.js +7649 -0
  28. package/dist/Generated.js.map +1 -0
  29. package/dist/index.d.ts +53 -0
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +54 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/internal/errors.d.ts +2 -0
  34. package/dist/internal/errors.d.ts.map +1 -0
  35. package/dist/internal/errors.js +344 -0
  36. package/dist/internal/errors.js.map +1 -0
  37. package/dist/{dts/internal → internal}/utilities.d.ts.map +1 -1
  38. package/dist/internal/utilities.js.map +1 -0
  39. package/package.json +45 -81
  40. package/src/AnthropicClient.ts +327 -683
  41. package/src/AnthropicConfig.ts +20 -34
  42. package/src/AnthropicError.ts +111 -0
  43. package/src/AnthropicLanguageModel.ts +2039 -993
  44. package/src/AnthropicTelemetry.ts +138 -0
  45. package/src/AnthropicTool.ts +1500 -475
  46. package/src/Generated.ts +9798 -6359
  47. package/src/index.ts +38 -6
  48. package/src/internal/errors.ts +368 -0
  49. package/src/internal/utilities.ts +1 -1
  50. package/AnthropicClient/package.json +0 -6
  51. package/AnthropicConfig/package.json +0 -6
  52. package/AnthropicLanguageModel/package.json +0 -6
  53. package/AnthropicTokenizer/package.json +0 -6
  54. package/AnthropicTool/package.json +0 -6
  55. package/Generated/package.json +0 -6
  56. package/README.md +0 -5
  57. package/dist/cjs/AnthropicClient.js +0 -344
  58. package/dist/cjs/AnthropicClient.js.map +0 -1
  59. package/dist/cjs/AnthropicConfig.js +0 -30
  60. package/dist/cjs/AnthropicConfig.js.map +0 -1
  61. package/dist/cjs/AnthropicLanguageModel.js +0 -1322
  62. package/dist/cjs/AnthropicLanguageModel.js.map +0 -1
  63. package/dist/cjs/AnthropicTokenizer.js +0 -52
  64. package/dist/cjs/AnthropicTokenizer.js.map +0 -1
  65. package/dist/cjs/AnthropicTool.js +0 -461
  66. package/dist/cjs/AnthropicTool.js.map +0 -1
  67. package/dist/cjs/Generated.js +0 -6578
  68. package/dist/cjs/Generated.js.map +0 -1
  69. package/dist/cjs/index.js +0 -20
  70. package/dist/cjs/index.js.map +0 -1
  71. package/dist/cjs/internal/utilities.js +0 -29
  72. package/dist/cjs/internal/utilities.js.map +0 -1
  73. package/dist/dts/AnthropicClient.d.ts +0 -730
  74. package/dist/dts/AnthropicClient.d.ts.map +0 -1
  75. package/dist/dts/AnthropicConfig.d.ts.map +0 -1
  76. package/dist/dts/AnthropicLanguageModel.d.ts +0 -304
  77. package/dist/dts/AnthropicLanguageModel.d.ts.map +0 -1
  78. package/dist/dts/AnthropicTokenizer.d.ts +0 -13
  79. package/dist/dts/AnthropicTokenizer.d.ts.map +0 -1
  80. package/dist/dts/AnthropicTool.d.ts +0 -548
  81. package/dist/dts/AnthropicTool.d.ts.map +0 -1
  82. package/dist/dts/Generated.d.ts +0 -12504
  83. package/dist/dts/Generated.d.ts.map +0 -1
  84. package/dist/dts/index.d.ts +0 -25
  85. package/dist/dts/index.d.ts.map +0 -1
  86. package/dist/esm/AnthropicClient.js +0 -317
  87. package/dist/esm/AnthropicClient.js.map +0 -1
  88. package/dist/esm/AnthropicConfig.js.map +0 -1
  89. package/dist/esm/AnthropicLanguageModel.js +0 -1309
  90. package/dist/esm/AnthropicLanguageModel.js.map +0 -1
  91. package/dist/esm/AnthropicTokenizer.js +0 -44
  92. package/dist/esm/AnthropicTokenizer.js.map +0 -1
  93. package/dist/esm/AnthropicTool.js +0 -452
  94. package/dist/esm/AnthropicTool.js.map +0 -1
  95. package/dist/esm/Generated.js +0 -6247
  96. package/dist/esm/Generated.js.map +0 -1
  97. package/dist/esm/index.js +0 -25
  98. package/dist/esm/index.js.map +0 -1
  99. package/dist/esm/internal/utilities.js.map +0 -1
  100. package/dist/esm/package.json +0 -4
  101. package/index/package.json +0 -6
  102. package/src/AnthropicTokenizer.ts +0 -59
  103. /package/dist/{dts/internal → internal}/utilities.d.ts +0 -0
  104. /package/dist/{esm/internal → internal}/utilities.js +0 -0
@@ -0,0 +1,2153 @@
1
+ /**
2
+ * Anthropic provider-defined tools for use with the LanguageModel.
3
+ *
4
+ * Provides tools that are natively supported by Anthropic's API, including
5
+ * Bash, Code Execution, Computer Use, Memory, and Text Editor functionality.
6
+ *
7
+ * @since 1.0.0
8
+ */
9
+ import * as Schema from "effect/Schema";
10
+ import * as Tool from "effect/unstable/ai/Tool";
11
+ /**
12
+ * Union of all Anthropic provider-defined tools.
13
+ *
14
+ * @since 1.0.0
15
+ * @category models
16
+ */
17
+ 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
+ /**
19
+ * Anthropic Bash tool (2024-10-22 version).
20
+ *
21
+ * Allows the model to execute bash commands in a sandboxed environment.
22
+ * Requires the "computer-use-2024-10-22" beta header.
23
+ *
24
+ * @since 1.0.0
25
+ * @category Bash
26
+ */
27
+ export declare const Bash_20241022: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
28
+ readonly failureMode?: Mode | undefined;
29
+ }) => Tool.ProviderDefined<"anthropic.bash_20241022", "AnthropicBash", {
30
+ readonly args: Schema.Void;
31
+ readonly parameters: Schema.Struct<{
32
+ readonly command: Schema.String;
33
+ readonly restart: Schema.optional<Schema.Boolean>;
34
+ }>;
35
+ readonly success: Schema.String;
36
+ readonly failure: Schema.Never;
37
+ readonly failureMode: Mode extends undefined ? "error" : Mode;
38
+ }, true>;
39
+ /**
40
+ * Anthropic Bash tool (2025-01-24 version).
41
+ *
42
+ * Allows the model to execute bash commands in a sandboxed environment.
43
+ * Requires the "computer-use-2025-01-24" beta header.
44
+ *
45
+ * @since 1.0.0
46
+ * @category Bash
47
+ */
48
+ export declare const Bash_20250124: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
49
+ readonly failureMode?: Mode | undefined;
50
+ }) => Tool.ProviderDefined<"anthropic.bash_20250124", "AnthropicBash", {
51
+ readonly args: Schema.Void;
52
+ readonly parameters: Schema.Struct<{
53
+ readonly command: Schema.String;
54
+ readonly restart: Schema.optional<Schema.Boolean>;
55
+ }>;
56
+ readonly success: Schema.String;
57
+ readonly failure: Schema.Never;
58
+ readonly failureMode: Mode extends undefined ? "error" : Mode;
59
+ }, true>;
60
+ /**
61
+ * Programmatic tool call execution parameter.
62
+ *
63
+ * @since 1.0.0
64
+ * @category Code Execution
65
+ */
66
+ export declare const CodeExecutionProgrammaticToolCall: Schema.Struct<{
67
+ readonly type: Schema.Literal<"programmatic-tool-call">;
68
+ /**
69
+ * The code to execute.
70
+ */
71
+ readonly code: Schema.String;
72
+ }>;
73
+ /**
74
+ * @since 1.0.0
75
+ * @category Code Execution
76
+ */
77
+ export type CodeExecutionProgrammaticToolCall = typeof CodeExecutionProgrammaticToolCall.Type;
78
+ /**
79
+ * Bash code execution parameter.
80
+ *
81
+ * @since 1.0.0
82
+ * @category Code Execution
83
+ */
84
+ export declare const CodeExecutionBashCommand: Schema.Struct<{
85
+ readonly type: Schema.Literal<"bash_code_execution">;
86
+ /**
87
+ * The bash command to execute.
88
+ */
89
+ readonly command: Schema.String;
90
+ }>;
91
+ /**
92
+ * @since 1.0.0
93
+ * @category Code Execution
94
+ */
95
+ export type CodeExecutionBashCommand = typeof CodeExecutionBashCommand.Type;
96
+ /**
97
+ * Text editor view command for code execution.
98
+ *
99
+ * @since 1.0.0
100
+ * @category Code Execution
101
+ */
102
+ export declare const CodeExecutionTextEditorView: Schema.Struct<{
103
+ readonly type: Schema.Literal<"text_editor_code_execution">;
104
+ readonly command: Schema.Literal<"view">;
105
+ /**
106
+ * Path to the file to view.
107
+ */
108
+ readonly path: Schema.String;
109
+ }>;
110
+ /**
111
+ * @since 1.0.0
112
+ * @category Code Execution
113
+ */
114
+ export type CodeExecutionTextEditorView = typeof CodeExecutionTextEditorView.Type;
115
+ /**
116
+ * Text editor create command for code execution.
117
+ *
118
+ * @since 1.0.0
119
+ * @category Code Execution
120
+ */
121
+ export declare const CodeExecutionTextEditorCreate: Schema.Struct<{
122
+ readonly type: Schema.Literal<"text_editor_code_execution">;
123
+ readonly command: Schema.Literal<"create">;
124
+ /**
125
+ * Path where the file should be created.
126
+ */
127
+ readonly path: Schema.String;
128
+ /**
129
+ * The content to write to the new file.
130
+ */
131
+ readonly file_text: Schema.optional<Schema.NullOr<Schema.String>>;
132
+ }>;
133
+ /**
134
+ * @since 1.0.0
135
+ * @category Code Execution
136
+ */
137
+ export type CodeExecutionTextEditorCreate = typeof CodeExecutionTextEditorCreate.Type;
138
+ /**
139
+ * Text editor str_replace command for code execution.
140
+ *
141
+ * @since 1.0.0
142
+ * @category Code Execution
143
+ */
144
+ export declare const CodeExecutionTextEditorStrReplace: Schema.Struct<{
145
+ readonly type: Schema.Literal<"text_editor_code_execution">;
146
+ readonly command: Schema.Literal<"str_replace">;
147
+ /**
148
+ * Path to the file to modify.
149
+ */
150
+ readonly path: Schema.String;
151
+ /**
152
+ * The text to replace.
153
+ */
154
+ readonly old_str: Schema.String;
155
+ /**
156
+ * The replacement text.
157
+ */
158
+ readonly new_str: Schema.String;
159
+ }>;
160
+ /**
161
+ * @since 1.0.0
162
+ * @category Code Execution
163
+ */
164
+ export type CodeExecutionTextEditorStrReplace = typeof CodeExecutionTextEditorStrReplace.Type;
165
+ /**
166
+ * Simple code execution parameter.
167
+ *
168
+ * @since 1.0.0
169
+ * @category Code Execution
170
+ */
171
+ export declare const CodeExecution_20250825_Parameters: Schema.Struct<{
172
+ /**
173
+ * The code to execute.
174
+ */
175
+ readonly code: Schema.String;
176
+ }>;
177
+ /**
178
+ * @since 1.0.0
179
+ * @category Code Execution
180
+ */
181
+ export type CodeExecution_20250825_Parameters = typeof CodeExecution_20250825_Parameters.Type;
182
+ /**
183
+ * Anthropic Code Execution tool (2025-05-22 version).
184
+ *
185
+ * Allows the model to execute code in a sandboxed environment with support
186
+ * for multiple execution types including programmatic tool calls, bash
187
+ * execution, and text editor operations.
188
+ *
189
+ * @since 1.0.0
190
+ * @category Code Execution
191
+ */
192
+ export declare const CodeExecution_20250522: <Mode extends Tool.FailureMode | undefined = undefined>(args: void) => Tool.ProviderDefined<"anthropic.code_execution_20250522", "AnthropicCodeExecution", {
193
+ readonly args: Schema.Void;
194
+ readonly parameters: Schema.Union<readonly [Schema.Struct<{
195
+ readonly type: Schema.Literal<"programmatic-tool-call">;
196
+ /**
197
+ * The code to execute.
198
+ */
199
+ readonly code: Schema.String;
200
+ }>, Schema.Struct<{
201
+ readonly type: Schema.Literal<"bash_code_execution">;
202
+ /**
203
+ * The bash command to execute.
204
+ */
205
+ readonly command: Schema.String;
206
+ }>, Schema.Struct<{
207
+ readonly type: Schema.Literal<"text_editor_code_execution">;
208
+ readonly command: Schema.Literal<"view">;
209
+ /**
210
+ * Path to the file to view.
211
+ */
212
+ readonly path: Schema.String;
213
+ }>, Schema.Struct<{
214
+ readonly type: Schema.Literal<"text_editor_code_execution">;
215
+ readonly command: Schema.Literal<"create">;
216
+ /**
217
+ * Path where the file should be created.
218
+ */
219
+ readonly path: Schema.String;
220
+ /**
221
+ * The content to write to the new file.
222
+ */
223
+ readonly file_text: Schema.optional<Schema.NullOr<Schema.String>>;
224
+ }>, Schema.Struct<{
225
+ readonly type: Schema.Literal<"text_editor_code_execution">;
226
+ readonly command: Schema.Literal<"str_replace">;
227
+ /**
228
+ * Path to the file to modify.
229
+ */
230
+ readonly path: Schema.String;
231
+ /**
232
+ * The text to replace.
233
+ */
234
+ readonly old_str: Schema.String;
235
+ /**
236
+ * The replacement text.
237
+ */
238
+ readonly new_str: Schema.String;
239
+ }>]>;
240
+ readonly success: Schema.Struct<{
241
+ readonly content: Schema.Array$<Schema.Struct<{
242
+ readonly file_id: Schema.String;
243
+ readonly type: Schema.Literal<"code_execution_output">;
244
+ }>>;
245
+ readonly return_code: Schema.Number;
246
+ readonly stderr: Schema.String;
247
+ readonly stdout: Schema.String;
248
+ readonly type: Schema.Literal<"code_execution_result">;
249
+ }>;
250
+ readonly failure: Schema.Struct<{
251
+ readonly error_code: Schema.Literals<readonly ["invalid_tool_input", "unavailable", "too_many_requests", "execution_time_exceeded"]>;
252
+ readonly type: Schema.Literal<"code_execution_tool_result_error">;
253
+ }>;
254
+ readonly failureMode: Mode extends undefined ? "error" : Mode;
255
+ }, false>;
256
+ /**
257
+ * Anthropic Code Execution tool (2025-08-25 version).
258
+ *
259
+ * Allows the model to execute code in a sandboxed environment.
260
+ *
261
+ * @since 1.0.0
262
+ * @category Code Execution
263
+ */
264
+ export declare const CodeExecution_20250825: <Mode extends Tool.FailureMode | undefined = undefined>(args: void) => Tool.ProviderDefined<"anthropic.code_execution_20250825", "AnthropicCodeExecution", {
265
+ readonly args: Schema.Void;
266
+ readonly parameters: Schema.Struct<{
267
+ /**
268
+ * The code to execute.
269
+ */
270
+ readonly code: Schema.String;
271
+ }>;
272
+ readonly success: Schema.Union<readonly [Schema.Struct<{
273
+ readonly content: Schema.Array$<Schema.Struct<{
274
+ readonly file_id: Schema.String;
275
+ readonly type: Schema.Literal<"code_execution_output">;
276
+ }>>;
277
+ readonly return_code: Schema.Number;
278
+ readonly stderr: Schema.String;
279
+ readonly stdout: Schema.String;
280
+ readonly type: Schema.Literal<"code_execution_result">;
281
+ }>, Schema.Struct<{
282
+ readonly content: Schema.Array$<Schema.Struct<{
283
+ readonly file_id: Schema.String;
284
+ readonly type: Schema.Literal<"bash_code_execution_output">;
285
+ }>>;
286
+ readonly return_code: Schema.Number;
287
+ readonly stderr: Schema.String;
288
+ readonly stdout: Schema.String;
289
+ readonly type: Schema.Literal<"bash_code_execution_result">;
290
+ }>, Schema.Struct<{
291
+ readonly content: Schema.String;
292
+ readonly file_type: Schema.Literals<readonly ["text", "image", "pdf"]>;
293
+ readonly num_lines: Schema.Union<readonly [Schema.Number, Schema.Null]>;
294
+ readonly start_line: Schema.Union<readonly [Schema.Number, Schema.Null]>;
295
+ readonly total_lines: Schema.Union<readonly [Schema.Number, Schema.Null]>;
296
+ readonly type: Schema.Literal<"text_editor_code_execution_view_result">;
297
+ }>, Schema.Struct<{
298
+ readonly is_file_update: Schema.Boolean;
299
+ readonly type: Schema.Literal<"text_editor_code_execution_create_result">;
300
+ }>, Schema.Struct<{
301
+ readonly lines: Schema.Union<readonly [Schema.Array$<Schema.String>, Schema.Null]>;
302
+ readonly new_lines: Schema.Union<readonly [Schema.Number, Schema.Null]>;
303
+ readonly new_start: Schema.Union<readonly [Schema.Number, Schema.Null]>;
304
+ readonly old_lines: Schema.Union<readonly [Schema.Number, Schema.Null]>;
305
+ readonly old_start: Schema.Union<readonly [Schema.Number, Schema.Null]>;
306
+ readonly type: Schema.Literal<"text_editor_code_execution_str_replace_result">;
307
+ }>]>;
308
+ readonly failure: Schema.Union<readonly [Schema.Struct<{
309
+ readonly error_code: Schema.Literals<readonly ["invalid_tool_input", "unavailable", "too_many_requests", "execution_time_exceeded"]>;
310
+ readonly type: Schema.Literal<"code_execution_tool_result_error">;
311
+ }>, Schema.Struct<{
312
+ readonly error_code: Schema.Literals<readonly ["invalid_tool_input", "unavailable", "too_many_requests", "execution_time_exceeded", "output_file_too_large"]>;
313
+ readonly type: Schema.Literal<"bash_code_execution_tool_result_error">;
314
+ }>, Schema.Struct<{
315
+ readonly error_code: Schema.Literals<readonly ["invalid_tool_input", "unavailable", "too_many_requests", "execution_time_exceeded", "file_not_found"]>;
316
+ readonly error_message: Schema.Union<readonly [Schema.String, Schema.Null]>;
317
+ readonly type: Schema.Literal<"text_editor_code_execution_tool_result_error">;
318
+ }>]>;
319
+ readonly failureMode: Mode extends undefined ? "error" : Mode;
320
+ }, false>;
321
+ /**
322
+ * An `[x, y]` pixel position.
323
+ *
324
+ * @since 1.0.0
325
+ * @category Computer Use
326
+ */
327
+ export declare const Coordinate: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
328
+ /**
329
+ * @since 1.0.0
330
+ * @category Computer Use
331
+ */
332
+ export type Coordinate = typeof Coordinate.Type;
333
+ /**
334
+ * A `[x1, y1, x2, y2]` position defining top-left and bottom-right corners.
335
+ *
336
+ * @since 1.0.0
337
+ * @category Computer Use
338
+ */
339
+ export declare const Region: Schema.Tuple<readonly [Schema.Number, Schema.Number, Schema.Number, Schema.Number]>;
340
+ /**
341
+ * @since 1.0.0
342
+ * @category Computer Use
343
+ */
344
+ export type Region = typeof Region.Type;
345
+ /**
346
+ * The direction of the scroll for scroll actions.
347
+ *
348
+ * @since 1.0.0
349
+ * @category Computer Use
350
+ */
351
+ export declare const ScrollDirection: Schema.Literals<readonly ["up", "down", "left", "right"]>;
352
+ /**
353
+ * @since 1.0.0
354
+ * @category Computer Use
355
+ */
356
+ export type ScrollDirection = typeof ScrollDirection.Type;
357
+ /**
358
+ * Modifier keys that can be held during click/scroll actions.
359
+ *
360
+ * @since 1.0.0
361
+ * @category Computer Use
362
+ */
363
+ export declare const ModifierKey: Schema.Literals<readonly ["alt", "ctrl", "meta", "shift"]>;
364
+ /**
365
+ * @since 1.0.0
366
+ * @category Computer Use
367
+ */
368
+ export type ModifierKey = typeof ModifierKey.Type;
369
+ /**
370
+ * Press a key or key combination (e.g. `"Return"`, `"ctrl+c"`, `"ctrl+s"`).
371
+ *
372
+ * @since 1.0.0
373
+ * @category Computer Use
374
+ */
375
+ export declare const ComputerUseKeyAction: Schema.Struct<{
376
+ readonly action: Schema.Literal<"key">;
377
+ /**
378
+ * The key to press.
379
+ */
380
+ readonly text: Schema.String;
381
+ }>;
382
+ /**
383
+ * @since 1.0.0
384
+ * @category Computer Use
385
+ */
386
+ export type ComputerUseKeyAction = typeof ComputerUseKeyAction.Type;
387
+ /**
388
+ * Perform a left click at the current mouse position or the specified coordinates.
389
+ *
390
+ * @since 1.0.0
391
+ * @category Computer Use
392
+ */
393
+ export declare const ComputerUseLeftClickAction: Schema.Struct<{
394
+ readonly action: Schema.Literal<"left_click">;
395
+ /**
396
+ * The `[x, y]` coordinate on the screen to left click (defaults to the current
397
+ * mouse position if omitted).
398
+ */
399
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
400
+ }>;
401
+ /**
402
+ * @since 1.0.0
403
+ * @category Computer Use
404
+ */
405
+ export type ComputerUseLeftClickAction = typeof ComputerUseLeftClickAction.Type;
406
+ /**
407
+ * Move the mouse cursor to the specified coordinates.
408
+ *
409
+ * @since 1.0.0
410
+ * @category Computer Use
411
+ */
412
+ export declare const ComputerUseMouseMoveAction: Schema.Struct<{
413
+ readonly action: Schema.Literal<"mouse_move">;
414
+ /**
415
+ * The `[x, y]` coordinate on the screen to move to.
416
+ */
417
+ readonly coordinate: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
418
+ }>;
419
+ /**
420
+ * @since 1.0.0
421
+ * @category Computer Use
422
+ */
423
+ export type ComputerUseMouseMoveAction = typeof ComputerUseMouseMoveAction.Type;
424
+ /**
425
+ * Capture the current display.
426
+ *
427
+ * @since 1.0.0
428
+ * @category Computer Use
429
+ */
430
+ export declare const ComputerUseScreenshotAction: Schema.Struct<{
431
+ readonly action: Schema.Literal<"screenshot">;
432
+ }>;
433
+ /**
434
+ * @since 1.0.0
435
+ * @category Computer Use
436
+ */
437
+ export type ComputerUseScreenshotAction = typeof ComputerUseScreenshotAction.Type;
438
+ /**
439
+ * Type a text string.
440
+ *
441
+ * @since 1.0.0
442
+ * @category Computer Use
443
+ */
444
+ export declare const TypeAction: Schema.Struct<{
445
+ readonly action: Schema.Literal<"type">;
446
+ /**
447
+ * The text to type.
448
+ */
449
+ readonly text: Schema.String;
450
+ }>;
451
+ /**
452
+ * @since 1.0.0
453
+ * @category Computer Use
454
+ */
455
+ export type TypeAction = typeof TypeAction.Type;
456
+ /**
457
+ * Perform a double click.
458
+ *
459
+ * @since 1.0.0
460
+ * @category Computer Use
461
+ */
462
+ export declare const ComputerUseDoubleClickAction: Schema.Struct<{
463
+ readonly action: Schema.Literal<"double_click">;
464
+ /**
465
+ * The coordinate to double click (defaults to the current mouse position if
466
+ * omitted).
467
+ */
468
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
469
+ }>;
470
+ /**
471
+ * @since 1.0.0
472
+ * @category Computer Use
473
+ */
474
+ export type ComputerUseDoubleClickAction = typeof ComputerUseDoubleClickAction.Type;
475
+ /**
476
+ * Holds a key while performing other actions.
477
+ *
478
+ * @since 1.0.0
479
+ * @category Computer Use
480
+ */
481
+ export declare const ComputerUseHoldKeyAction: Schema.Struct<{
482
+ readonly action: Schema.Literal<"hold_key">;
483
+ /**
484
+ * The key to hold (e.g. `"shift"`, `"ctrl"`).
485
+ */
486
+ readonly text: Schema.String;
487
+ /**
488
+ * The number of seconds to hold the key.
489
+ */
490
+ readonly duration: Schema.Number;
491
+ }>;
492
+ /**
493
+ * @since 1.0.0
494
+ * @category Computer Use
495
+ */
496
+ export type ComputerUseHoldKeyAction = typeof ComputerUseHoldKeyAction.Type;
497
+ /**
498
+ * Click and drag from start coordinate to end coordinate.
499
+ *
500
+ * @since 1.0.0
501
+ * @category Computer Use
502
+ */
503
+ export declare const ComputerUseLeftClickDragAction: Schema.Struct<{
504
+ readonly action: Schema.Literal<"left_click_drag">;
505
+ /**
506
+ * The `[x, y]` coordinate to start dragging from.
507
+ */
508
+ readonly start_coordinate: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
509
+ /**
510
+ * The `[x, y]` coordinate to drag to.
511
+ */
512
+ readonly coordinate: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
513
+ }>;
514
+ /**
515
+ * @since 1.0.0
516
+ * @category Computer Use
517
+ */
518
+ export type ComputerUseLeftClickDragAction = typeof ComputerUseLeftClickDragAction.Type;
519
+ /**
520
+ * Press the left mouse button down (without releasing).
521
+ *
522
+ * Used for fine-grained click control.
523
+ *
524
+ * @since 1.0.0
525
+ * @category Computer Use
526
+ */
527
+ export declare const ComputerUseLeftMouseDownAction: Schema.Struct<{
528
+ readonly action: Schema.Literal<"left_mouse_down">;
529
+ /**
530
+ * The coordinate at which the left mouse button should be held down (defaults
531
+ * to the current mouse position if omitted).
532
+ */
533
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
534
+ }>;
535
+ /**
536
+ * @since 1.0.0
537
+ * @category Computer Use
538
+ */
539
+ export type ComputerUseLeftMouseDownAction = typeof ComputerUseLeftMouseDownAction.Type;
540
+ /**
541
+ * Release the left mouse button.
542
+ *
543
+ * Used for fine-grained click control.
544
+ *
545
+ * @since 1.0.0
546
+ * @category Computer Use
547
+ */
548
+ export declare const ComputerUseLeftMouseUpAction: Schema.Struct<{
549
+ readonly action: Schema.Literal<"left_mouse_up">;
550
+ /**
551
+ * The coordinate at which the left mouse button should be released (defaults
552
+ * to the current mouse position if omitted).
553
+ */
554
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
555
+ }>;
556
+ /**
557
+ * @since 1.0.0
558
+ * @category Computer Use
559
+ */
560
+ export type ComputerUseLeftMouseUpAction = typeof ComputerUseLeftMouseUpAction.Type;
561
+ /**
562
+ * Perform a middle click.
563
+ *
564
+ * @since 1.0.0
565
+ * @category Computer Use
566
+ */
567
+ export declare const ComputerUseMiddleClickAction: Schema.Struct<{
568
+ readonly action: Schema.Literal<"middle_click">;
569
+ /**
570
+ * The coordinate to middle click (defaults to the current mouse position if
571
+ * omitted).
572
+ */
573
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
574
+ }>;
575
+ /**
576
+ * @since 1.0.0
577
+ * @category Computer Use
578
+ */
579
+ export type ComputerUseMiddleClickAction = typeof ComputerUseMiddleClickAction.Type;
580
+ /**
581
+ * Perform a right click.
582
+ *
583
+ * @since 1.0.0
584
+ * @category Computer Use
585
+ */
586
+ export declare const ComputerUseRightClickAction: Schema.Struct<{
587
+ readonly action: Schema.Literal<"right_click">;
588
+ /**
589
+ * The coordinate to right click (defaults to the current mouse position if
590
+ * omitted).
591
+ */
592
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
593
+ }>;
594
+ /**
595
+ * @since 1.0.0
596
+ * @category Computer Use
597
+ */
598
+ export type ComputerUseRightClickAction = typeof ComputerUseRightClickAction.Type;
599
+ /**
600
+ * Scroll a given amount in a specified direction.
601
+ *
602
+ * @since 1.0.0
603
+ * @category Computer Use
604
+ */
605
+ export declare const ComputerUseScrollAction: Schema.Struct<{
606
+ readonly action: Schema.Literal<"scroll">;
607
+ /**
608
+ * The coordinate to start scrolling from (defaults to the current mouse
609
+ * position if omitted).
610
+ */
611
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
612
+ /**
613
+ * The direction to scroll.
614
+ */
615
+ readonly scroll_direction: Schema.Literals<readonly ["up", "down", "left", "right"]>;
616
+ /**
617
+ * The amount to scroll (in pixels or scroll units).
618
+ */
619
+ readonly scroll_amount: Schema.Number;
620
+ }>;
621
+ /**
622
+ * @since 1.0.0
623
+ * @category Computer Use
624
+ */
625
+ export type ComputerUseScrollAction = typeof ComputerUseScrollAction.Type;
626
+ /**
627
+ * Perform a triple click.
628
+ *
629
+ * @since 1.0.0
630
+ * @category Computer Use
631
+ */
632
+ export declare const ComputerUseTripleClickAction: Schema.Struct<{
633
+ readonly action: Schema.Literal<"triple_click">;
634
+ /**
635
+ * The coordinate to triple click (defaults to the current mouse position if
636
+ * omitted).
637
+ */
638
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
639
+ }>;
640
+ /**
641
+ * @since 1.0.0
642
+ * @category Computer Use
643
+ */
644
+ export type ComputerUseTripleClickAction = typeof ComputerUseTripleClickAction.Type;
645
+ /**
646
+ * Pause between performing actions.
647
+ *
648
+ * @since 1.0.0
649
+ * @category Computer Use
650
+ */
651
+ export declare const ComputerUseWaitAction: Schema.Struct<{
652
+ readonly action: Schema.Literal<"wait">;
653
+ /**
654
+ * The number of seconds to wait.
655
+ */
656
+ readonly duration: Schema.Number;
657
+ }>;
658
+ /**
659
+ * @since 1.0.0
660
+ * @category Computer Use
661
+ */
662
+ export type ComputerUseWaitAction = typeof ComputerUseWaitAction.Type;
663
+ /**
664
+ * Zoom into a specific region of the screen at full resolution.
665
+ *
666
+ * Requires `enableZoom: true` in the tool definition.
667
+ *
668
+ * @since 1.0.0
669
+ * @category Computer Use
670
+ */
671
+ export declare const ComputerUseZoomAction: Schema.Struct<{
672
+ readonly action: Schema.Literal<"zoom">;
673
+ /**
674
+ * Region to zoom into, defined as `[x1, y1, x2, y2]` coordinates where
675
+ * `(x1, y1)` is the top-left corner and `(x2, y2)` is the bottom-right corner.
676
+ */
677
+ readonly region: Schema.Tuple<readonly [Schema.Number, Schema.Number, Schema.Number, Schema.Number]>;
678
+ }>;
679
+ /**
680
+ * @since 1.0.0
681
+ * @category Computer Use
682
+ */
683
+ export type ComputerUseZoomAction = typeof ComputerUseZoomAction.Type;
684
+ /**
685
+ * Computer use tool for Claude 3.5 Sonnet v2 (deprecated).
686
+ *
687
+ * Requires the "computer-use-2024-10-22" beta header.
688
+ *
689
+ * Basic actions only: screenshot, left_click, type, key, mouse_move.
690
+ *
691
+ * @since 1.0.0
692
+ * @category Computer Use
693
+ */
694
+ export declare const ComputerUse_20241022: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
695
+ readonly displayWidthPx: number;
696
+ readonly displayHeightPx: number;
697
+ readonly displayNumber?: number | undefined;
698
+ readonly failureMode?: Mode | undefined;
699
+ }) => Tool.ProviderDefined<"anthropic.computer_use_20241022", "AnthropicComputerUse", {
700
+ readonly args: Schema.Struct<{
701
+ /**
702
+ * The width of the display being controlled by the model in pixels.
703
+ */
704
+ readonly displayWidthPx: Schema.Number;
705
+ /**
706
+ * The height of the display being controlled by the model in pixels.
707
+ */
708
+ readonly displayHeightPx: Schema.Number;
709
+ /**
710
+ * The display number to control (only relevant for X11 environments). If
711
+ * specified, the tool will be provided a display number in the tool
712
+ * definition.
713
+ */
714
+ readonly displayNumber: Schema.optional<Schema.Number>;
715
+ }>;
716
+ readonly parameters: Schema.Union<readonly [Schema.Struct<{
717
+ readonly action: Schema.Literal<"key">;
718
+ /**
719
+ * The key to press.
720
+ */
721
+ readonly text: Schema.String;
722
+ }>, Schema.Struct<{
723
+ readonly action: Schema.Literal<"left_click">;
724
+ /**
725
+ * The `[x, y]` coordinate on the screen to left click (defaults to the current
726
+ * mouse position if omitted).
727
+ */
728
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
729
+ }>, Schema.Struct<{
730
+ readonly action: Schema.Literal<"mouse_move">;
731
+ /**
732
+ * The `[x, y]` coordinate on the screen to move to.
733
+ */
734
+ readonly coordinate: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
735
+ }>, Schema.Struct<{
736
+ readonly action: Schema.Literal<"screenshot">;
737
+ }>, Schema.Struct<{
738
+ readonly action: Schema.Literal<"type">;
739
+ /**
740
+ * The text to type.
741
+ */
742
+ readonly text: Schema.String;
743
+ }>]>;
744
+ readonly success: Schema.String;
745
+ readonly failure: Schema.Never;
746
+ readonly failureMode: Mode extends undefined ? "error" : Mode;
747
+ }, true>;
748
+ /**
749
+ * Computer use tool for Claude 4 models and Claude Sonnet 3.7.
750
+ *
751
+ * Requires the "computer-use-2025-01-24" beta header.
752
+ *
753
+ * Includes basic actions plus enhanced actions: scroll, left_click_drag,
754
+ * right_click, middle_click, double_click, triple_click, left_mouse_down,
755
+ * left_mouse_up, hold_key, wait.
756
+ *
757
+ * @since 1.0.0
758
+ * @category Computer Use
759
+ */
760
+ export declare const ComputerUse_20250124: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
761
+ readonly displayWidthPx: number;
762
+ readonly displayHeightPx: number;
763
+ readonly displayNumber?: number | undefined;
764
+ readonly failureMode?: Mode | undefined;
765
+ }) => Tool.ProviderDefined<"anthropic.computer_20250124", "AnthropicComputerUse", {
766
+ readonly args: Schema.Struct<{
767
+ /**
768
+ * The width of the display being controlled by the model in pixels.
769
+ */
770
+ readonly displayWidthPx: Schema.Number;
771
+ /**
772
+ * The height of the display being controlled by the model in pixels.
773
+ */
774
+ readonly displayHeightPx: Schema.Number;
775
+ /**
776
+ * The display number to control (only relevant for X11 environments). If
777
+ * specified, the tool will be provided a display number in the tool
778
+ * definition.
779
+ */
780
+ readonly displayNumber: Schema.optional<Schema.Number>;
781
+ }>;
782
+ readonly parameters: Schema.Union<readonly [Schema.Struct<{
783
+ readonly action: Schema.Literal<"key">;
784
+ /**
785
+ * The key to press.
786
+ */
787
+ readonly text: Schema.String;
788
+ }>, Schema.Struct<{
789
+ readonly action: Schema.Literal<"left_click">;
790
+ /**
791
+ * The `[x, y]` coordinate on the screen to left click (defaults to the current
792
+ * mouse position if omitted).
793
+ */
794
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
795
+ }>, Schema.Struct<{
796
+ readonly action: Schema.Literal<"mouse_move">;
797
+ /**
798
+ * The `[x, y]` coordinate on the screen to move to.
799
+ */
800
+ readonly coordinate: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
801
+ }>, Schema.Struct<{
802
+ readonly action: Schema.Literal<"screenshot">;
803
+ }>, Schema.Struct<{
804
+ readonly action: Schema.Literal<"type">;
805
+ /**
806
+ * The text to type.
807
+ */
808
+ readonly text: Schema.String;
809
+ }>, Schema.Struct<{
810
+ readonly action: Schema.Literal<"double_click">;
811
+ /**
812
+ * The coordinate to double click (defaults to the current mouse position if
813
+ * omitted).
814
+ */
815
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
816
+ }>, Schema.Struct<{
817
+ readonly action: Schema.Literal<"hold_key">;
818
+ /**
819
+ * The key to hold (e.g. `"shift"`, `"ctrl"`).
820
+ */
821
+ readonly text: Schema.String;
822
+ /**
823
+ * The number of seconds to hold the key.
824
+ */
825
+ readonly duration: Schema.Number;
826
+ }>, Schema.Struct<{
827
+ readonly action: Schema.Literal<"left_click_drag">;
828
+ /**
829
+ * The `[x, y]` coordinate to start dragging from.
830
+ */
831
+ readonly start_coordinate: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
832
+ /**
833
+ * The `[x, y]` coordinate to drag to.
834
+ */
835
+ readonly coordinate: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
836
+ }>, Schema.Struct<{
837
+ readonly action: Schema.Literal<"left_mouse_down">;
838
+ /**
839
+ * The coordinate at which the left mouse button should be held down (defaults
840
+ * to the current mouse position if omitted).
841
+ */
842
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
843
+ }>, Schema.Struct<{
844
+ readonly action: Schema.Literal<"left_mouse_up">;
845
+ /**
846
+ * The coordinate at which the left mouse button should be released (defaults
847
+ * to the current mouse position if omitted).
848
+ */
849
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
850
+ }>, Schema.Struct<{
851
+ readonly action: Schema.Literal<"middle_click">;
852
+ /**
853
+ * The coordinate to middle click (defaults to the current mouse position if
854
+ * omitted).
855
+ */
856
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
857
+ }>, Schema.Struct<{
858
+ readonly action: Schema.Literal<"right_click">;
859
+ /**
860
+ * The coordinate to right click (defaults to the current mouse position if
861
+ * omitted).
862
+ */
863
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
864
+ }>, Schema.Struct<{
865
+ readonly action: Schema.Literal<"scroll">;
866
+ /**
867
+ * The coordinate to start scrolling from (defaults to the current mouse
868
+ * position if omitted).
869
+ */
870
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
871
+ /**
872
+ * The direction to scroll.
873
+ */
874
+ readonly scroll_direction: Schema.Literals<readonly ["up", "down", "left", "right"]>;
875
+ /**
876
+ * The amount to scroll (in pixels or scroll units).
877
+ */
878
+ readonly scroll_amount: Schema.Number;
879
+ }>, Schema.Struct<{
880
+ readonly action: Schema.Literal<"triple_click">;
881
+ /**
882
+ * The coordinate to triple click (defaults to the current mouse position if
883
+ * omitted).
884
+ */
885
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
886
+ }>, Schema.Struct<{
887
+ readonly action: Schema.Literal<"wait">;
888
+ /**
889
+ * The number of seconds to wait.
890
+ */
891
+ readonly duration: Schema.Number;
892
+ }>]>;
893
+ readonly success: Schema.String;
894
+ readonly failure: Schema.Never;
895
+ readonly failureMode: Mode extends undefined ? "error" : Mode;
896
+ }, true>;
897
+ /**
898
+ * Computer use tool for Claude Opus 4.5 only.
899
+ *
900
+ * Requires the "computer-use-2025-11-24" beta header.
901
+ *
902
+ * Includes all actions from computer_20250124 plus the zoom action for
903
+ * detailed screen region inspection. Requires `enableZoom: true` in args.
904
+ *
905
+ * @since 1.0.0
906
+ * @category Computer Use
907
+ */
908
+ export declare const ComputerUse_20251124: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
909
+ readonly displayWidthPx: number;
910
+ readonly displayHeightPx: number;
911
+ readonly displayNumber?: number | undefined;
912
+ readonly enableZoom?: boolean | undefined;
913
+ readonly failureMode?: Mode | undefined;
914
+ }) => Tool.ProviderDefined<"anthropic.computer_20251124", "AnthropicComputerUse", {
915
+ readonly args: Schema.Struct<{
916
+ readonly enableZoom: Schema.optional<Schema.Boolean>;
917
+ /**
918
+ * The width of the display being controlled by the model in pixels.
919
+ */
920
+ readonly displayWidthPx: Schema.Number;
921
+ /**
922
+ * The height of the display being controlled by the model in pixels.
923
+ */
924
+ readonly displayHeightPx: Schema.Number;
925
+ /**
926
+ * The display number to control (only relevant for X11 environments). If
927
+ * specified, the tool will be provided a display number in the tool
928
+ * definition.
929
+ */
930
+ readonly displayNumber: Schema.optional<Schema.Number>;
931
+ }>;
932
+ readonly parameters: Schema.Union<readonly [Schema.Struct<{
933
+ readonly action: Schema.Literal<"key">;
934
+ /**
935
+ * The key to press.
936
+ */
937
+ readonly text: Schema.String;
938
+ }>, Schema.Struct<{
939
+ readonly action: Schema.Literal<"left_click">;
940
+ /**
941
+ * The `[x, y]` coordinate on the screen to left click (defaults to the current
942
+ * mouse position if omitted).
943
+ */
944
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
945
+ }>, Schema.Struct<{
946
+ readonly action: Schema.Literal<"mouse_move">;
947
+ /**
948
+ * The `[x, y]` coordinate on the screen to move to.
949
+ */
950
+ readonly coordinate: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
951
+ }>, Schema.Struct<{
952
+ readonly action: Schema.Literal<"screenshot">;
953
+ }>, Schema.Struct<{
954
+ readonly action: Schema.Literal<"type">;
955
+ /**
956
+ * The text to type.
957
+ */
958
+ readonly text: Schema.String;
959
+ }>, Schema.Struct<{
960
+ readonly action: Schema.Literal<"double_click">;
961
+ /**
962
+ * The coordinate to double click (defaults to the current mouse position if
963
+ * omitted).
964
+ */
965
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
966
+ }>, Schema.Struct<{
967
+ readonly action: Schema.Literal<"hold_key">;
968
+ /**
969
+ * The key to hold (e.g. `"shift"`, `"ctrl"`).
970
+ */
971
+ readonly text: Schema.String;
972
+ /**
973
+ * The number of seconds to hold the key.
974
+ */
975
+ readonly duration: Schema.Number;
976
+ }>, Schema.Struct<{
977
+ readonly action: Schema.Literal<"left_click_drag">;
978
+ /**
979
+ * The `[x, y]` coordinate to start dragging from.
980
+ */
981
+ readonly start_coordinate: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
982
+ /**
983
+ * The `[x, y]` coordinate to drag to.
984
+ */
985
+ readonly coordinate: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
986
+ }>, Schema.Struct<{
987
+ readonly action: Schema.Literal<"left_mouse_down">;
988
+ /**
989
+ * The coordinate at which the left mouse button should be held down (defaults
990
+ * to the current mouse position if omitted).
991
+ */
992
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
993
+ }>, Schema.Struct<{
994
+ readonly action: Schema.Literal<"left_mouse_up">;
995
+ /**
996
+ * The coordinate at which the left mouse button should be released (defaults
997
+ * to the current mouse position if omitted).
998
+ */
999
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
1000
+ }>, Schema.Struct<{
1001
+ readonly action: Schema.Literal<"middle_click">;
1002
+ /**
1003
+ * The coordinate to middle click (defaults to the current mouse position if
1004
+ * omitted).
1005
+ */
1006
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
1007
+ }>, Schema.Struct<{
1008
+ readonly action: Schema.Literal<"right_click">;
1009
+ /**
1010
+ * The coordinate to right click (defaults to the current mouse position if
1011
+ * omitted).
1012
+ */
1013
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
1014
+ }>, Schema.Struct<{
1015
+ readonly action: Schema.Literal<"scroll">;
1016
+ /**
1017
+ * The coordinate to start scrolling from (defaults to the current mouse
1018
+ * position if omitted).
1019
+ */
1020
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
1021
+ /**
1022
+ * The direction to scroll.
1023
+ */
1024
+ readonly scroll_direction: Schema.Literals<readonly ["up", "down", "left", "right"]>;
1025
+ /**
1026
+ * The amount to scroll (in pixels or scroll units).
1027
+ */
1028
+ readonly scroll_amount: Schema.Number;
1029
+ }>, Schema.Struct<{
1030
+ readonly action: Schema.Literal<"triple_click">;
1031
+ /**
1032
+ * The coordinate to triple click (defaults to the current mouse position if
1033
+ * omitted).
1034
+ */
1035
+ readonly coordinate: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
1036
+ }>, Schema.Struct<{
1037
+ readonly action: Schema.Literal<"wait">;
1038
+ /**
1039
+ * The number of seconds to wait.
1040
+ */
1041
+ readonly duration: Schema.Number;
1042
+ }>, Schema.Struct<{
1043
+ readonly action: Schema.Literal<"zoom">;
1044
+ /**
1045
+ * Region to zoom into, defined as `[x1, y1, x2, y2]` coordinates where
1046
+ * `(x1, y1)` is the top-left corner and `(x2, y2)` is the bottom-right corner.
1047
+ */
1048
+ readonly region: Schema.Tuple<readonly [Schema.Number, Schema.Number, Schema.Number, Schema.Number]>;
1049
+ }>]>;
1050
+ readonly success: Schema.String;
1051
+ readonly failure: Schema.Never;
1052
+ readonly failureMode: Mode extends undefined ? "error" : Mode;
1053
+ }, true>;
1054
+ /**
1055
+ * A `[start, end]` line range for viewing file contents.
1056
+ *
1057
+ * Lines are 1-indexed. Use -1 for end to read to end of file.
1058
+ *
1059
+ * @example [1, 50] // View lines 1-50
1060
+ * @example [100, -1] // View from line 100 to end of file
1061
+ *
1062
+ * @since 1.0.0
1063
+ * @category Memory
1064
+ */
1065
+ export declare const ViewRange: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
1066
+ /**
1067
+ * @since 1.0.0
1068
+ * @category Memory
1069
+ */
1070
+ export type ViewRange = typeof ViewRange.Type;
1071
+ /**
1072
+ * Creates a new file.
1073
+ *
1074
+ * @since 1.0.0
1075
+ * @category Memory
1076
+ */
1077
+ export declare const MemoryCreateCommand: Schema.Struct<{
1078
+ readonly command: Schema.Literal<"create">;
1079
+ /**
1080
+ * The path to the file that should be created.
1081
+ */
1082
+ readonly path: Schema.String;
1083
+ }>;
1084
+ /**
1085
+ * @since 1.0.0
1086
+ * @category Memory
1087
+ */
1088
+ export type MemoryCreateCommand = typeof MemoryCreateCommand.Type;
1089
+ /**
1090
+ * Delete a file or directory.
1091
+ *
1092
+ * @since 1.0.0
1093
+ * @category Memory
1094
+ */
1095
+ export declare const MemoryDeleteCommand: Schema.Struct<{
1096
+ readonly command: Schema.Literal<"delete">;
1097
+ /**
1098
+ * The path to the file to delete.
1099
+ */
1100
+ readonly path: Schema.String;
1101
+ }>;
1102
+ /**
1103
+ * @since 1.0.0
1104
+ * @category Memory
1105
+ */
1106
+ export type MemoryDeleteCommand = typeof MemoryDeleteCommand.Type;
1107
+ /**
1108
+ * Insert text at a specific line.
1109
+ *
1110
+ * @since 1.0.0
1111
+ * @category Memory
1112
+ */
1113
+ export declare const MemoryInsertCommand: Schema.Struct<{
1114
+ readonly command: Schema.Literal<"insert">;
1115
+ /**
1116
+ * The path to the file to insert text into.
1117
+ */
1118
+ readonly path: Schema.String;
1119
+ /**
1120
+ * The line at which the text should be inserted.
1121
+ */
1122
+ readonly insert_line: Schema.Number;
1123
+ /**
1124
+ * The text to insert.
1125
+ */
1126
+ readonly insert_text: Schema.String;
1127
+ }>;
1128
+ /**
1129
+ * @since 1.0.0
1130
+ * @category Memory
1131
+ */
1132
+ export type MemoryInsertCommand = typeof MemoryInsertCommand.Type;
1133
+ /**
1134
+ * Rename or move a file or directory.
1135
+ *
1136
+ * @since 1.0.0
1137
+ * @category Memory
1138
+ */
1139
+ export declare const MemoryRenameCommand: Schema.Struct<{
1140
+ readonly command: Schema.Literal<"rename">;
1141
+ /**
1142
+ * The old path to the file or directory.
1143
+ */
1144
+ readonly old_path: Schema.String;
1145
+ /**
1146
+ * The new path to the file or directory.
1147
+ */
1148
+ readonly new_path: Schema.String;
1149
+ }>;
1150
+ /**
1151
+ * @since 1.0.0
1152
+ * @category Memory
1153
+ */
1154
+ export type MemoryRenameCommand = typeof MemoryRenameCommand.Type;
1155
+ /**
1156
+ * Replace text in a file.
1157
+ *
1158
+ * @since 1.0.0
1159
+ * @category Memory
1160
+ */
1161
+ export declare const MemoryStrReplaceCommand: Schema.Struct<{
1162
+ readonly command: Schema.Literal<"str_replace">;
1163
+ /**
1164
+ * The path to the file in which the replacement should occur.
1165
+ */
1166
+ readonly path: Schema.String;
1167
+ /**
1168
+ * The text to replace.
1169
+ */
1170
+ readonly old_str: Schema.String;
1171
+ /**
1172
+ * The replacement text.
1173
+ */
1174
+ readonly new_str: Schema.String;
1175
+ }>;
1176
+ /**
1177
+ * @since 1.0.0
1178
+ * @category Memory
1179
+ */
1180
+ export type MemoryStrReplaceCommand = typeof MemoryStrReplaceCommand.Type;
1181
+ /**
1182
+ * Shows directory contents or file contents with optional line ranges.
1183
+ *
1184
+ * @since 1.0.0
1185
+ * @category Memory
1186
+ */
1187
+ export declare const MemoryViewCommand: Schema.Struct<{
1188
+ readonly command: Schema.Literal<"view">;
1189
+ /**
1190
+ * The path to the file to view.
1191
+ */
1192
+ readonly path: Schema.String;
1193
+ /**
1194
+ * The specific lines to view.
1195
+ */
1196
+ readonly view_range: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
1197
+ }>;
1198
+ /**
1199
+ * @since 1.0.0
1200
+ * @category Memory
1201
+ */
1202
+ export type MemoryViewCommand = typeof MemoryViewCommand.Type;
1203
+ /**
1204
+ * Memory tool for persistent file operations across conversations.
1205
+ *
1206
+ * Provides commands for creating, viewing, editing, renaming, and deleting
1207
+ * files within the model's memory space.
1208
+ *
1209
+ * @since 1.0.0
1210
+ * @category Memory
1211
+ */
1212
+ export declare const Memory_20250818: <Mode extends Tool.FailureMode | undefined = undefined>(args: void) => Tool.ProviderDefined<"anthropic.memory_20250818", "AnthropicMemory", {
1213
+ readonly args: Schema.Void;
1214
+ readonly parameters: Schema.Union<readonly [Schema.Struct<{
1215
+ readonly command: Schema.Literal<"create">;
1216
+ /**
1217
+ * The path to the file that should be created.
1218
+ */
1219
+ readonly path: Schema.String;
1220
+ }>, Schema.Struct<{
1221
+ readonly command: Schema.Literal<"delete">;
1222
+ /**
1223
+ * The path to the file to delete.
1224
+ */
1225
+ readonly path: Schema.String;
1226
+ }>, Schema.Struct<{
1227
+ readonly command: Schema.Literal<"insert">;
1228
+ /**
1229
+ * The path to the file to insert text into.
1230
+ */
1231
+ readonly path: Schema.String;
1232
+ /**
1233
+ * The line at which the text should be inserted.
1234
+ */
1235
+ readonly insert_line: Schema.Number;
1236
+ /**
1237
+ * The text to insert.
1238
+ */
1239
+ readonly insert_text: Schema.String;
1240
+ }>, Schema.Struct<{
1241
+ readonly command: Schema.Literal<"rename">;
1242
+ /**
1243
+ * The old path to the file or directory.
1244
+ */
1245
+ readonly old_path: Schema.String;
1246
+ /**
1247
+ * The new path to the file or directory.
1248
+ */
1249
+ readonly new_path: Schema.String;
1250
+ }>, Schema.Struct<{
1251
+ readonly command: Schema.Literal<"str_replace">;
1252
+ /**
1253
+ * The path to the file in which the replacement should occur.
1254
+ */
1255
+ readonly path: Schema.String;
1256
+ /**
1257
+ * The text to replace.
1258
+ */
1259
+ readonly old_str: Schema.String;
1260
+ /**
1261
+ * The replacement text.
1262
+ */
1263
+ readonly new_str: Schema.String;
1264
+ }>, Schema.Struct<{
1265
+ readonly command: Schema.Literal<"view">;
1266
+ /**
1267
+ * The path to the file to view.
1268
+ */
1269
+ readonly path: Schema.String;
1270
+ /**
1271
+ * The specific lines to view.
1272
+ */
1273
+ readonly view_range: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
1274
+ }>]>;
1275
+ readonly success: Schema.String;
1276
+ readonly failure: Schema.Never;
1277
+ readonly failureMode: Mode extends undefined ? "error" : Mode;
1278
+ }, false>;
1279
+ /**
1280
+ * View the contents of a file or list directory contents.
1281
+ *
1282
+ * When used on a file: Returns the file contents, optionally limited to a line range.
1283
+ * When used on a directory: Lists all files and subdirectories.
1284
+ *
1285
+ * @since 1.0.0
1286
+ * @category Text Editor
1287
+ */
1288
+ export declare const TextEditorViewCommand: Schema.Struct<{
1289
+ readonly command: Schema.Literal<"view">;
1290
+ /**
1291
+ * Absolute or relative path to the file or directory to view.
1292
+ */
1293
+ readonly path: Schema.String;
1294
+ /**
1295
+ * Optional line range to view (only applies to files, not directories).
1296
+ * Lines are 1-indexed. Use -1 for end to read to end of file.
1297
+ */
1298
+ readonly view_range: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
1299
+ }>;
1300
+ /**
1301
+ * @since 1.0.0
1302
+ * @category Text Editor
1303
+ */
1304
+ export type TextEditorViewCommand = typeof TextEditorViewCommand.Type;
1305
+ /**
1306
+ * Create a new file with specified content.
1307
+ *
1308
+ * Will fail if the file already exists. Parent directories must exist.
1309
+ *
1310
+ * @since 1.0.0
1311
+ * @category Text Editor
1312
+ */
1313
+ export declare const TextEditorCreateCommand: Schema.Struct<{
1314
+ readonly command: Schema.Literal<"create">;
1315
+ /**
1316
+ * Path where the file should be created.
1317
+ */
1318
+ readonly path: Schema.String;
1319
+ /**
1320
+ * The content to write to the new file.
1321
+ */
1322
+ readonly file_text: Schema.String;
1323
+ }>;
1324
+ /**
1325
+ * @since 1.0.0
1326
+ * @category Text Editor
1327
+ */
1328
+ export type TextEditorCreateCommand = typeof TextEditorCreateCommand.Type;
1329
+ /**
1330
+ * Replace a specific string in a file with a new string.
1331
+ *
1332
+ * The `old_str` must match exactly (including whitespace and indentation)
1333
+ * and must be unique in the file.
1334
+ *
1335
+ * @since 1.0.0
1336
+ * @category Text Editor
1337
+ */
1338
+ export declare const TextEditorStrReplaceCommand: Schema.Struct<{
1339
+ readonly command: Schema.Literal<"str_replace">;
1340
+ /**
1341
+ * Path to the file to modify.
1342
+ */
1343
+ readonly path: Schema.String;
1344
+ /**
1345
+ * The exact string to find and replace (must be unique in the file).
1346
+ */
1347
+ readonly old_str: Schema.String;
1348
+ /**
1349
+ * The string to replace old_str with (can be empty to delete).
1350
+ */
1351
+ readonly new_str: Schema.String;
1352
+ }>;
1353
+ /**
1354
+ * @since 1.0.0
1355
+ * @category Text Editor
1356
+ */
1357
+ export type TextEditorStrReplaceCommand = typeof TextEditorStrReplaceCommand.Type;
1358
+ /**
1359
+ * Insert text at a specific line number in a file.
1360
+ *
1361
+ * Inserts the new text AFTER the specified line number.
1362
+ *
1363
+ * @since 1.0.0
1364
+ * @category Text Editor
1365
+ */
1366
+ export declare const TextEditorInsertCommand: Schema.Struct<{
1367
+ readonly command: Schema.Literal<"insert">;
1368
+ /**
1369
+ * Path to the file to modify.
1370
+ */
1371
+ readonly path: Schema.String;
1372
+ /**
1373
+ * The line number after which to insert (0 = beginning, 1-indexed).
1374
+ */
1375
+ readonly insert_line: Schema.Number;
1376
+ /**
1377
+ * The text to insert.
1378
+ */
1379
+ readonly new_str: Schema.String;
1380
+ }>;
1381
+ /**
1382
+ * @since 1.0.0
1383
+ * @category Text Editor
1384
+ */
1385
+ export type TextEditorInsertCommand = typeof TextEditorInsertCommand.Type;
1386
+ /**
1387
+ * Undo the last edit made to a file.
1388
+ *
1389
+ * Reverts the most recent str_replace, insert, or create operation on the file.
1390
+ *
1391
+ * NOTE: This command is available in text_editor_20241022 and text_editor_20250124,
1392
+ * but NOT in text_editor_20250728 (Claude 4 models).
1393
+ *
1394
+ * @since 1.0.0
1395
+ * @category Text Editor
1396
+ */
1397
+ export declare const TextEditorUndoEditCommand: Schema.Struct<{
1398
+ readonly command: Schema.Literal<"undo_edit">;
1399
+ /**
1400
+ * Path to the file to undo the last edit on.
1401
+ */
1402
+ readonly path: Schema.String;
1403
+ }>;
1404
+ /**
1405
+ * @since 1.0.0
1406
+ * @category Text Editor
1407
+ */
1408
+ export type TextEditorUndoEditCommand = typeof TextEditorUndoEditCommand.Type;
1409
+ /**
1410
+ * Text editor tool for Claude 3.5 Sonnet (deprecated).
1411
+ *
1412
+ * Requires the "computer-use-2024-10-22" beta header.
1413
+ *
1414
+ * @since 1.0.0
1415
+ * @category Text Editor
1416
+ */
1417
+ export declare const TextEditor_20241022: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
1418
+ readonly failureMode?: Mode | undefined;
1419
+ }) => Tool.ProviderDefined<"anthropic.text_editor_20241022", "AnthropicTextEditor", {
1420
+ readonly args: Schema.Void;
1421
+ readonly parameters: Schema.Union<readonly [Schema.Struct<{
1422
+ readonly command: Schema.Literal<"view">;
1423
+ /**
1424
+ * Absolute or relative path to the file or directory to view.
1425
+ */
1426
+ readonly path: Schema.String;
1427
+ /**
1428
+ * Optional line range to view (only applies to files, not directories).
1429
+ * Lines are 1-indexed. Use -1 for end to read to end of file.
1430
+ */
1431
+ readonly view_range: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
1432
+ }>, Schema.Struct<{
1433
+ readonly command: Schema.Literal<"create">;
1434
+ /**
1435
+ * Path where the file should be created.
1436
+ */
1437
+ readonly path: Schema.String;
1438
+ /**
1439
+ * The content to write to the new file.
1440
+ */
1441
+ readonly file_text: Schema.String;
1442
+ }>, Schema.Struct<{
1443
+ readonly command: Schema.Literal<"str_replace">;
1444
+ /**
1445
+ * Path to the file to modify.
1446
+ */
1447
+ readonly path: Schema.String;
1448
+ /**
1449
+ * The exact string to find and replace (must be unique in the file).
1450
+ */
1451
+ readonly old_str: Schema.String;
1452
+ /**
1453
+ * The string to replace old_str with (can be empty to delete).
1454
+ */
1455
+ readonly new_str: Schema.String;
1456
+ }>, Schema.Struct<{
1457
+ readonly command: Schema.Literal<"insert">;
1458
+ /**
1459
+ * Path to the file to modify.
1460
+ */
1461
+ readonly path: Schema.String;
1462
+ /**
1463
+ * The line number after which to insert (0 = beginning, 1-indexed).
1464
+ */
1465
+ readonly insert_line: Schema.Number;
1466
+ /**
1467
+ * The text to insert.
1468
+ */
1469
+ readonly new_str: Schema.String;
1470
+ }>, Schema.Struct<{
1471
+ readonly command: Schema.Literal<"undo_edit">;
1472
+ /**
1473
+ * Path to the file to undo the last edit on.
1474
+ */
1475
+ readonly path: Schema.String;
1476
+ }>]>;
1477
+ readonly success: Schema.String;
1478
+ readonly failure: Schema.Never;
1479
+ readonly failureMode: Mode extends undefined ? "error" : Mode;
1480
+ }, true>;
1481
+ /**
1482
+ * Text editor tool for Claude Sonnet 3.7 (deprecated model).
1483
+ *
1484
+ * @since 1.0.0
1485
+ * @category Text Editor
1486
+ */
1487
+ export declare const TextEditor_20250124: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
1488
+ readonly failureMode?: Mode | undefined;
1489
+ }) => Tool.ProviderDefined<"anthropic.text_editor_20250124", "AnthropicTextEditor", {
1490
+ readonly args: Schema.Void;
1491
+ readonly parameters: Schema.Union<readonly [Schema.Struct<{
1492
+ readonly command: Schema.Literal<"view">;
1493
+ /**
1494
+ * Absolute or relative path to the file or directory to view.
1495
+ */
1496
+ readonly path: Schema.String;
1497
+ /**
1498
+ * Optional line range to view (only applies to files, not directories).
1499
+ * Lines are 1-indexed. Use -1 for end to read to end of file.
1500
+ */
1501
+ readonly view_range: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
1502
+ }>, Schema.Struct<{
1503
+ readonly command: Schema.Literal<"create">;
1504
+ /**
1505
+ * Path where the file should be created.
1506
+ */
1507
+ readonly path: Schema.String;
1508
+ /**
1509
+ * The content to write to the new file.
1510
+ */
1511
+ readonly file_text: Schema.String;
1512
+ }>, Schema.Struct<{
1513
+ readonly command: Schema.Literal<"str_replace">;
1514
+ /**
1515
+ * Path to the file to modify.
1516
+ */
1517
+ readonly path: Schema.String;
1518
+ /**
1519
+ * The exact string to find and replace (must be unique in the file).
1520
+ */
1521
+ readonly old_str: Schema.String;
1522
+ /**
1523
+ * The string to replace old_str with (can be empty to delete).
1524
+ */
1525
+ readonly new_str: Schema.String;
1526
+ }>, Schema.Struct<{
1527
+ readonly command: Schema.Literal<"insert">;
1528
+ /**
1529
+ * Path to the file to modify.
1530
+ */
1531
+ readonly path: Schema.String;
1532
+ /**
1533
+ * The line number after which to insert (0 = beginning, 1-indexed).
1534
+ */
1535
+ readonly insert_line: Schema.Number;
1536
+ /**
1537
+ * The text to insert.
1538
+ */
1539
+ readonly new_str: Schema.String;
1540
+ }>, Schema.Struct<{
1541
+ readonly command: Schema.Literal<"undo_edit">;
1542
+ /**
1543
+ * Path to the file to undo the last edit on.
1544
+ */
1545
+ readonly path: Schema.String;
1546
+ }>]>;
1547
+ readonly success: Schema.String;
1548
+ readonly failure: Schema.Never;
1549
+ readonly failureMode: Mode extends undefined ? "error" : Mode;
1550
+ }, true>;
1551
+ /**
1552
+ * Text editor tool for Claude 4 models.
1553
+ *
1554
+ * NOTE: This version does NOT support the `undo_edit` command.
1555
+ *
1556
+ * @since 1.0.0
1557
+ * @category Text Editor
1558
+ */
1559
+ export declare const TextEditor_20250429: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
1560
+ readonly max_characters?: number | undefined;
1561
+ readonly failureMode?: Mode | undefined;
1562
+ }) => Tool.ProviderDefined<"anthropic.text_editor_20250429", "AnthropicTextEditor", {
1563
+ readonly args: Schema.Struct<{
1564
+ /**
1565
+ * Maximum number of characters to return when viewing large files.
1566
+ * When a file exceeds this limit, it will be truncated.
1567
+ */
1568
+ readonly max_characters: Schema.optional<Schema.Number>;
1569
+ }>;
1570
+ readonly parameters: Schema.Union<readonly [Schema.Struct<{
1571
+ readonly command: Schema.Literal<"view">;
1572
+ /**
1573
+ * Absolute or relative path to the file or directory to view.
1574
+ */
1575
+ readonly path: Schema.String;
1576
+ /**
1577
+ * Optional line range to view (only applies to files, not directories).
1578
+ * Lines are 1-indexed. Use -1 for end to read to end of file.
1579
+ */
1580
+ readonly view_range: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
1581
+ }>, Schema.Struct<{
1582
+ readonly command: Schema.Literal<"create">;
1583
+ /**
1584
+ * Path where the file should be created.
1585
+ */
1586
+ readonly path: Schema.String;
1587
+ /**
1588
+ * The content to write to the new file.
1589
+ */
1590
+ readonly file_text: Schema.String;
1591
+ }>, Schema.Struct<{
1592
+ readonly command: Schema.Literal<"str_replace">;
1593
+ /**
1594
+ * Path to the file to modify.
1595
+ */
1596
+ readonly path: Schema.String;
1597
+ /**
1598
+ * The exact string to find and replace (must be unique in the file).
1599
+ */
1600
+ readonly old_str: Schema.String;
1601
+ /**
1602
+ * The string to replace old_str with (can be empty to delete).
1603
+ */
1604
+ readonly new_str: Schema.String;
1605
+ }>, Schema.Struct<{
1606
+ readonly command: Schema.Literal<"insert">;
1607
+ /**
1608
+ * Path to the file to modify.
1609
+ */
1610
+ readonly path: Schema.String;
1611
+ /**
1612
+ * The line number after which to insert (0 = beginning, 1-indexed).
1613
+ */
1614
+ readonly insert_line: Schema.Number;
1615
+ /**
1616
+ * The text to insert.
1617
+ */
1618
+ readonly new_str: Schema.String;
1619
+ }>]>;
1620
+ readonly success: Schema.String;
1621
+ readonly failure: Schema.Never;
1622
+ readonly failureMode: Mode extends undefined ? "error" : Mode;
1623
+ }, true>;
1624
+ /**
1625
+ * Text editor tool for Claude 4 models.
1626
+ *
1627
+ * NOTE: This version does NOT support the `undo_edit` command.
1628
+ *
1629
+ * @since 1.0.0
1630
+ * @category Text Editor
1631
+ */
1632
+ export declare const TextEditor_20250728: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
1633
+ readonly max_characters?: number | undefined;
1634
+ readonly failureMode?: Mode | undefined;
1635
+ }) => Tool.ProviderDefined<"anthropic.text_editor_20250728", "AnthropicTextEditor", {
1636
+ readonly args: Schema.Struct<{
1637
+ /**
1638
+ * Maximum number of characters to return when viewing large files.
1639
+ * When a file exceeds this limit, it will be truncated.
1640
+ */
1641
+ readonly max_characters: Schema.optional<Schema.Number>;
1642
+ }>;
1643
+ readonly parameters: Schema.Union<readonly [Schema.Struct<{
1644
+ readonly command: Schema.Literal<"view">;
1645
+ /**
1646
+ * Absolute or relative path to the file or directory to view.
1647
+ */
1648
+ readonly path: Schema.String;
1649
+ /**
1650
+ * Optional line range to view (only applies to files, not directories).
1651
+ * Lines are 1-indexed. Use -1 for end to read to end of file.
1652
+ */
1653
+ readonly view_range: Schema.optional<Schema.Tuple<readonly [Schema.Number, Schema.Number]>>;
1654
+ }>, Schema.Struct<{
1655
+ readonly command: Schema.Literal<"create">;
1656
+ /**
1657
+ * Path where the file should be created.
1658
+ */
1659
+ readonly path: Schema.String;
1660
+ /**
1661
+ * The content to write to the new file.
1662
+ */
1663
+ readonly file_text: Schema.String;
1664
+ }>, Schema.Struct<{
1665
+ readonly command: Schema.Literal<"str_replace">;
1666
+ /**
1667
+ * Path to the file to modify.
1668
+ */
1669
+ readonly path: Schema.String;
1670
+ /**
1671
+ * The exact string to find and replace (must be unique in the file).
1672
+ */
1673
+ readonly old_str: Schema.String;
1674
+ /**
1675
+ * The string to replace old_str with (can be empty to delete).
1676
+ */
1677
+ readonly new_str: Schema.String;
1678
+ }>, Schema.Struct<{
1679
+ readonly command: Schema.Literal<"insert">;
1680
+ /**
1681
+ * Path to the file to modify.
1682
+ */
1683
+ readonly path: Schema.String;
1684
+ /**
1685
+ * The line number after which to insert (0 = beginning, 1-indexed).
1686
+ */
1687
+ readonly insert_line: Schema.Number;
1688
+ /**
1689
+ * The text to insert.
1690
+ */
1691
+ readonly new_str: Schema.String;
1692
+ }>]>;
1693
+ readonly success: Schema.String;
1694
+ readonly failure: Schema.Never;
1695
+ readonly failureMode: Mode extends undefined ? "error" : Mode;
1696
+ }, true>;
1697
+ /**
1698
+ * User location for localizing search results.
1699
+ *
1700
+ * Providing location helps return more relevant results for location-dependent
1701
+ * queries like weather, local businesses, events, etc.
1702
+ *
1703
+ * @since 1.0.0
1704
+ * @category Web Search
1705
+ */
1706
+ export declare const WebSearchUserLocation: Schema.Struct<{
1707
+ /**
1708
+ * Location type - currently only "approximate" is supported.
1709
+ */
1710
+ readonly type: Schema.Literal<"approximate">;
1711
+ /**
1712
+ * City name.
1713
+ */
1714
+ readonly city: Schema.optional<Schema.String>;
1715
+ /**
1716
+ * Region/state/province name.
1717
+ */
1718
+ readonly region: Schema.optional<Schema.String>;
1719
+ /**
1720
+ * ISO 3166-1 alpha-2 country code.
1721
+ */
1722
+ readonly country: Schema.optional<Schema.String>;
1723
+ /**
1724
+ * IANA timezone identifier.
1725
+ */
1726
+ readonly timezone: Schema.optional<Schema.String>;
1727
+ }>;
1728
+ /**
1729
+ * Configuration arguments for the web search tool.
1730
+ *
1731
+ * @since 1.0.0
1732
+ * @category Web Search
1733
+ */
1734
+ export declare const WebSearch_20250305_Args: Schema.Struct<{
1735
+ /**
1736
+ * Maximum number of searches allowed per API request.
1737
+ */
1738
+ readonly maxUses: Schema.optional<Schema.Number>;
1739
+ /**
1740
+ * Restrict search results to only these domains.
1741
+ *
1742
+ * Cannot be used together with `blockedDomains`.
1743
+ */
1744
+ readonly allowedDomains: Schema.optional<Schema.Array$<Schema.String>>;
1745
+ /**
1746
+ * Exclude results from these domains.
1747
+ *
1748
+ * Cannot be used together with `allowedDomains`.
1749
+ */
1750
+ readonly blockedDomains: Schema.optional<Schema.Array$<Schema.String>>;
1751
+ /**
1752
+ * User location for localizing search results.
1753
+ */
1754
+ readonly userLocation: Schema.optional<Schema.Struct<{
1755
+ /**
1756
+ * Location type - currently only "approximate" is supported.
1757
+ */
1758
+ readonly type: Schema.Literal<"approximate">;
1759
+ /**
1760
+ * City name.
1761
+ */
1762
+ readonly city: Schema.optional<Schema.String>;
1763
+ /**
1764
+ * Region/state/province name.
1765
+ */
1766
+ readonly region: Schema.optional<Schema.String>;
1767
+ /**
1768
+ * ISO 3166-1 alpha-2 country code.
1769
+ */
1770
+ readonly country: Schema.optional<Schema.String>;
1771
+ /**
1772
+ * IANA timezone identifier.
1773
+ */
1774
+ readonly timezone: Schema.optional<Schema.String>;
1775
+ }>>;
1776
+ }>;
1777
+ /**
1778
+ * @since 1.0.0
1779
+ * @category Web Search
1780
+ */
1781
+ export type WebSearch_20250305_Args = typeof WebSearch_20250305_Args.Type;
1782
+ /**
1783
+ * Input parameters for a web search.
1784
+ *
1785
+ * @since 1.0.0
1786
+ * @category Web Search
1787
+ */
1788
+ export declare const WebSearchParameters: Schema.Struct<{
1789
+ /**
1790
+ * The search query generated by Claude.
1791
+ */
1792
+ readonly query: Schema.String;
1793
+ }>;
1794
+ /**
1795
+ * @since 1.0.0
1796
+ * @category Web Search
1797
+ */
1798
+ export type WebSearchParameters = typeof WebSearchParameters.Type;
1799
+ /**
1800
+ * Web search tool for Claude models.
1801
+ *
1802
+ * Enables Claude to search the web for real-time information. This is a
1803
+ * server-side tool executed by Anthropic's infrastructure.
1804
+ *
1805
+ * Generally available (no beta header required).
1806
+ *
1807
+ * @since 1.0.0
1808
+ * @category Web Search
1809
+ */
1810
+ export declare const WebSearch_20250305: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
1811
+ readonly maxUses?: number | undefined;
1812
+ readonly allowedDomains?: readonly string[] | undefined;
1813
+ readonly blockedDomains?: readonly string[] | undefined;
1814
+ readonly userLocation?: {
1815
+ readonly type: "approximate";
1816
+ readonly city?: string | undefined;
1817
+ readonly country?: string | undefined;
1818
+ readonly region?: string | undefined;
1819
+ readonly timezone?: string | undefined;
1820
+ } | undefined;
1821
+ }) => Tool.ProviderDefined<"anthropic.web_search_20250305", "AnthropicWebSearch", {
1822
+ readonly args: Schema.Struct<{
1823
+ /**
1824
+ * Maximum number of searches allowed per API request.
1825
+ */
1826
+ readonly maxUses: Schema.optional<Schema.Number>;
1827
+ /**
1828
+ * Restrict search results to only these domains.
1829
+ *
1830
+ * Cannot be used together with `blockedDomains`.
1831
+ */
1832
+ readonly allowedDomains: Schema.optional<Schema.Array$<Schema.String>>;
1833
+ /**
1834
+ * Exclude results from these domains.
1835
+ *
1836
+ * Cannot be used together with `allowedDomains`.
1837
+ */
1838
+ readonly blockedDomains: Schema.optional<Schema.Array$<Schema.String>>;
1839
+ /**
1840
+ * User location for localizing search results.
1841
+ */
1842
+ readonly userLocation: Schema.optional<Schema.Struct<{
1843
+ /**
1844
+ * Location type - currently only "approximate" is supported.
1845
+ */
1846
+ readonly type: Schema.Literal<"approximate">;
1847
+ /**
1848
+ * City name.
1849
+ */
1850
+ readonly city: Schema.optional<Schema.String>;
1851
+ /**
1852
+ * Region/state/province name.
1853
+ */
1854
+ readonly region: Schema.optional<Schema.String>;
1855
+ /**
1856
+ * ISO 3166-1 alpha-2 country code.
1857
+ */
1858
+ readonly country: Schema.optional<Schema.String>;
1859
+ /**
1860
+ * IANA timezone identifier.
1861
+ */
1862
+ readonly timezone: Schema.optional<Schema.String>;
1863
+ }>>;
1864
+ }>;
1865
+ readonly parameters: Schema.Struct<{
1866
+ /**
1867
+ * The search query generated by Claude.
1868
+ */
1869
+ readonly query: Schema.String;
1870
+ }>;
1871
+ readonly success: Schema.Array$<Schema.Struct<{
1872
+ readonly encrypted_content: Schema.String;
1873
+ readonly page_age: Schema.Union<readonly [Schema.String, Schema.Null]>;
1874
+ readonly title: Schema.String;
1875
+ readonly type: Schema.Literal<"web_search_result">;
1876
+ readonly url: Schema.String;
1877
+ }>>;
1878
+ readonly failure: Schema.Struct<{
1879
+ readonly error_code: Schema.Literals<readonly ["invalid_tool_input", "unavailable", "max_uses_exceeded", "too_many_requests", "query_too_long", "request_too_large"]>;
1880
+ readonly type: Schema.Literal<"web_search_tool_result_error">;
1881
+ }>;
1882
+ readonly failureMode: Mode extends undefined ? "error" : Mode;
1883
+ }, false>;
1884
+ /**
1885
+ * Citation configuration for web fetch.
1886
+ *
1887
+ * @since 1.0.0
1888
+ * @category Web Fetch
1889
+ */
1890
+ export declare const WebFetchCitationsConfig: Schema.Struct<{
1891
+ /**
1892
+ * Enable citations for fetched content.
1893
+ */
1894
+ readonly enabled: Schema.Boolean;
1895
+ }>;
1896
+ /**
1897
+ * @since 1.0.0
1898
+ * @category Web Fetch
1899
+ */
1900
+ export type WebFetchCitationsConfig = typeof WebFetchCitationsConfig.Type;
1901
+ /**
1902
+ * Configuration arguments for the web fetch tool.
1903
+ *
1904
+ * @since 1.0.0
1905
+ * @category Web Fetch
1906
+ */
1907
+ export declare const WebFetch_20250910_Args: Schema.Struct<{
1908
+ /**
1909
+ * Maximum number of fetches allowed per API request.
1910
+ */
1911
+ readonly maxUses: Schema.optional<Schema.Number>;
1912
+ /**
1913
+ * Restrict fetches to only these domains.
1914
+ *
1915
+ * Cannot be used together with `blockedDomains`.
1916
+ */
1917
+ readonly allowedDomains: Schema.optional<Schema.Array$<Schema.String>>;
1918
+ /**
1919
+ * Exclude fetches from these domains.
1920
+ *
1921
+ * Cannot be used together with `allowedDomains`.
1922
+ */
1923
+ readonly blockedDomains: Schema.optional<Schema.Array$<Schema.String>>;
1924
+ /**
1925
+ * Enable citations for fetched content.
1926
+ */
1927
+ readonly citations: Schema.optional<Schema.Struct<{
1928
+ /**
1929
+ * Enable citations for fetched content.
1930
+ */
1931
+ readonly enabled: Schema.Boolean;
1932
+ }>>;
1933
+ /**
1934
+ * Maximum content length in tokens.
1935
+ */
1936
+ readonly maxContentTokens: Schema.optional<Schema.Number>;
1937
+ }>;
1938
+ /**
1939
+ * @since 1.0.0
1940
+ * @category Web Fetch
1941
+ */
1942
+ export type WebFetch_20250910_Args = typeof WebFetch_20250910_Args.Type;
1943
+ /**
1944
+ * Input parameters for a web fetch.
1945
+ *
1946
+ * @since 1.0.0
1947
+ * @category Web Fetch
1948
+ */
1949
+ export declare const WebFetchParameters: Schema.Struct<{
1950
+ /**
1951
+ * URL to fetch. Must be a URL provided by the user or from prior search/fetch
1952
+ * results. Maximum URL length: 250 characters.
1953
+ */
1954
+ readonly url: Schema.String;
1955
+ }>;
1956
+ /**
1957
+ * @since 1.0.0
1958
+ * @category Web Fetch
1959
+ */
1960
+ export type WebFetchParameters = typeof WebFetchParameters.Type;
1961
+ /**
1962
+ * Web fetch tool for Claude models.
1963
+ *
1964
+ * Allows Claude to retrieve full content from web pages and PDF documents.
1965
+ * This is a server-side tool executed by Anthropic's infrastructure.
1966
+ *
1967
+ * Requires the "web-fetch-2025-09-10" beta header.
1968
+ *
1969
+ * @since 1.0.0
1970
+ * @category Web Fetch
1971
+ */
1972
+ export declare const WebFetch_20250910: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
1973
+ readonly citations?: {
1974
+ readonly enabled: boolean;
1975
+ } | undefined;
1976
+ readonly maxUses?: number | undefined;
1977
+ readonly allowedDomains?: readonly string[] | undefined;
1978
+ readonly blockedDomains?: readonly string[] | undefined;
1979
+ readonly maxContentTokens?: number | undefined;
1980
+ }) => Tool.ProviderDefined<"anthropic.web_fetch_20250910", "AnthropicWebFetch", {
1981
+ readonly args: Schema.Struct<{
1982
+ /**
1983
+ * Maximum number of fetches allowed per API request.
1984
+ */
1985
+ readonly maxUses: Schema.optional<Schema.Number>;
1986
+ /**
1987
+ * Restrict fetches to only these domains.
1988
+ *
1989
+ * Cannot be used together with `blockedDomains`.
1990
+ */
1991
+ readonly allowedDomains: Schema.optional<Schema.Array$<Schema.String>>;
1992
+ /**
1993
+ * Exclude fetches from these domains.
1994
+ *
1995
+ * Cannot be used together with `allowedDomains`.
1996
+ */
1997
+ readonly blockedDomains: Schema.optional<Schema.Array$<Schema.String>>;
1998
+ /**
1999
+ * Enable citations for fetched content.
2000
+ */
2001
+ readonly citations: Schema.optional<Schema.Struct<{
2002
+ /**
2003
+ * Enable citations for fetched content.
2004
+ */
2005
+ readonly enabled: Schema.Boolean;
2006
+ }>>;
2007
+ /**
2008
+ * Maximum content length in tokens.
2009
+ */
2010
+ readonly maxContentTokens: Schema.optional<Schema.Number>;
2011
+ }>;
2012
+ readonly parameters: Schema.Struct<{
2013
+ /**
2014
+ * URL to fetch. Must be a URL provided by the user or from prior search/fetch
2015
+ * results. Maximum URL length: 250 characters.
2016
+ */
2017
+ readonly url: Schema.String;
2018
+ }>;
2019
+ readonly success: Schema.Struct<{
2020
+ readonly content: Schema.Struct<{
2021
+ readonly citations: Schema.Union<readonly [Schema.Struct<{
2022
+ readonly enabled: Schema.Boolean;
2023
+ }>, Schema.Null]>;
2024
+ readonly source: Schema.Union<readonly [Schema.Struct<{
2025
+ readonly data: Schema.String;
2026
+ readonly media_type: Schema.Literal<"application/pdf">;
2027
+ readonly type: Schema.Literal<"base64">;
2028
+ }>, Schema.Struct<{
2029
+ readonly data: Schema.String;
2030
+ readonly media_type: Schema.Literal<"text/plain">;
2031
+ readonly type: Schema.Literal<"text">;
2032
+ }>]>;
2033
+ readonly title: Schema.Union<readonly [Schema.String, Schema.Null]>;
2034
+ readonly type: Schema.Literal<"document">;
2035
+ }>;
2036
+ readonly retrieved_at: Schema.Union<readonly [Schema.String, Schema.Null]>;
2037
+ readonly type: Schema.Literal<"web_fetch_result">;
2038
+ readonly url: Schema.String;
2039
+ }>;
2040
+ readonly failure: Schema.Struct<{
2041
+ readonly error_code: Schema.Literals<readonly ["invalid_tool_input", "url_too_long", "url_not_allowed", "url_not_accessible", "unsupported_content_type", "too_many_requests", "max_uses_exceeded", "unavailable"]>;
2042
+ readonly type: Schema.Literal<"web_fetch_tool_result_error">;
2043
+ }>;
2044
+ readonly failureMode: Mode extends undefined ? "error" : Mode;
2045
+ }, false>;
2046
+ /**
2047
+ * Input parameters for regex-based tool search.
2048
+ *
2049
+ * Claude constructs regex patterns using Python's `re.search()` syntax.
2050
+ * Maximum query length: 200 characters.
2051
+ *
2052
+ * @since 1.0.0
2053
+ * @category Tool Search
2054
+ */
2055
+ export declare const ToolSearchRegexParameters: Schema.Struct<{
2056
+ /**
2057
+ * Python regex pattern to search for tools.
2058
+ */
2059
+ readonly query: Schema.String;
2060
+ }>;
2061
+ /**
2062
+ * @since 1.0.0
2063
+ * @category Tool Search
2064
+ */
2065
+ export type ToolSearchRegexParameters = typeof ToolSearchRegexParameters.Type;
2066
+ /**
2067
+ * Input parameters for BM25/natural language tool search.
2068
+ *
2069
+ * @since 1.0.0
2070
+ * @category Tool Search
2071
+ */
2072
+ export declare const ToolSearchBM25Parameters: Schema.Struct<{
2073
+ /**
2074
+ * Natural language query to search for tools.
2075
+ */
2076
+ readonly query: Schema.String;
2077
+ }>;
2078
+ /**
2079
+ * @since 1.0.0
2080
+ * @category Tool Search
2081
+ */
2082
+ export type ToolSearchBM25Parameters = typeof ToolSearchBM25Parameters.Type;
2083
+ /**
2084
+ * Regex-based tool search for Claude models.
2085
+ *
2086
+ * Claude constructs regex patterns using Python's `re.search()` syntax to
2087
+ * find tools. The regex is matched against tool names, descriptions,
2088
+ * argument names, and argument descriptions.
2089
+ *
2090
+ * Requires the "advanced-tool-use-2025-11-20" beta header.
2091
+ *
2092
+ * @since 1.0.0
2093
+ * @category Tool Search
2094
+ */
2095
+ export declare const ToolSearchRegex_20251119: <Mode extends Tool.FailureMode | undefined = undefined>(args: void) => Tool.ProviderDefined<"anthropic.tool_search_tool_regex_20251119", "AnthropicToolSearchRegex", {
2096
+ readonly args: Schema.Void;
2097
+ readonly parameters: Schema.Struct<{
2098
+ /**
2099
+ * Python regex pattern to search for tools.
2100
+ */
2101
+ readonly query: Schema.String;
2102
+ }>;
2103
+ readonly success: Schema.Array$<Schema.Struct<{
2104
+ readonly cache_control: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
2105
+ readonly ttl: Schema.optionalKey<Schema.Literals<readonly ["5m", "1h"]>>;
2106
+ readonly type: Schema.Literal<"ephemeral">;
2107
+ }>]>, Schema.Null]>>;
2108
+ readonly tool_name: Schema.String;
2109
+ readonly type: Schema.Literal<"tool_reference">;
2110
+ }>>;
2111
+ readonly failure: Schema.Struct<{
2112
+ readonly error_code: Schema.Literals<readonly ["invalid_tool_input", "unavailable", "too_many_requests", "execution_time_exceeded"]>;
2113
+ readonly error_message: Schema.Union<readonly [Schema.String, Schema.Null]>;
2114
+ readonly type: Schema.Literal<"tool_search_tool_result_error">;
2115
+ }>;
2116
+ readonly failureMode: Mode extends undefined ? "error" : Mode;
2117
+ }, false>;
2118
+ /**
2119
+ * BM25/natural language tool search for Claude models.
2120
+ *
2121
+ * Claude uses natural language queries to search for tools using the
2122
+ * BM25 algorithm. The search is performed against tool names, descriptions,
2123
+ * argument names, and argument descriptions.
2124
+ *
2125
+ * Requires the "advanced-tool-use-2025-11-20" beta header.
2126
+ *
2127
+ * @since 1.0.0
2128
+ * @category Tool Search
2129
+ */
2130
+ export declare const ToolSearchBM25_20251119: <Mode extends Tool.FailureMode | undefined = undefined>(args: void) => Tool.ProviderDefined<"anthropic.tool_search_tool_bm25_20251119", "AnthropicToolSearchBM25", {
2131
+ readonly args: Schema.Void;
2132
+ readonly parameters: Schema.Struct<{
2133
+ /**
2134
+ * Natural language query to search for tools.
2135
+ */
2136
+ readonly query: Schema.String;
2137
+ }>;
2138
+ readonly success: Schema.Array$<Schema.Struct<{
2139
+ readonly cache_control: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
2140
+ readonly ttl: Schema.optionalKey<Schema.Literals<readonly ["5m", "1h"]>>;
2141
+ readonly type: Schema.Literal<"ephemeral">;
2142
+ }>]>, Schema.Null]>>;
2143
+ readonly tool_name: Schema.String;
2144
+ readonly type: Schema.Literal<"tool_reference">;
2145
+ }>>;
2146
+ readonly failure: Schema.Struct<{
2147
+ readonly error_code: Schema.Literals<readonly ["invalid_tool_input", "unavailable", "too_many_requests", "execution_time_exceeded"]>;
2148
+ readonly error_message: Schema.Union<readonly [Schema.String, Schema.Null]>;
2149
+ readonly type: Schema.Literal<"tool_search_tool_result_error">;
2150
+ }>;
2151
+ readonly failureMode: Mode extends undefined ? "error" : Mode;
2152
+ }, false>;
2153
+ //# sourceMappingURL=AnthropicTool.d.ts.map