@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
@@ -1,548 +0,0 @@
1
- /**
2
- * @since 1.0.0
3
- */
4
- import * as Tool from "@effect/ai/Tool";
5
- import * as Schema from "effect/Schema";
6
- import * as Generated from "./Generated.js";
7
- /**
8
- * @since 1.0.0
9
- * @category Schemas
10
- */
11
- export declare const ProviderDefinedTools: Schema.Union<[
12
- typeof Generated.BetaBashTool20241022,
13
- typeof Generated.BetaBashTool20250124,
14
- typeof Generated.BetaCodeExecutionTool20250522,
15
- typeof Generated.BetaComputerUseTool20241022,
16
- typeof Generated.BetaComputerUseTool20250124,
17
- typeof Generated.BetaTextEditor20241022,
18
- typeof Generated.BetaTextEditor20250124,
19
- typeof Generated.BetaTextEditor20250429,
20
- typeof Generated.BetaTextEditor20250728,
21
- typeof Generated.BetaWebSearchTool20250305
22
- ]>;
23
- /**
24
- * @since 1.0.0
25
- * @category Schemas
26
- */
27
- export type ProviderDefinedTools = typeof ProviderDefinedTools.Type;
28
- /**
29
- * @since 1.0.0
30
- * @category Tools
31
- */
32
- export declare const Bash_20241022: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
33
- readonly failureMode?: Mode | undefined;
34
- }) => Tool.ProviderDefined<"AnthropicBash", {
35
- readonly args: Schema.Struct<{}>;
36
- readonly parameters: Schema.Struct<{
37
- /**
38
- * The Bash command to run.
39
- */
40
- command: typeof Schema.NonEmptyString;
41
- /**
42
- * If `true`, restart the Bash session.
43
- */
44
- restart: Schema.optional<typeof Schema.Boolean>;
45
- }>;
46
- readonly success: typeof Schema.String;
47
- readonly failure: typeof Schema.Never;
48
- readonly failureMode: Mode extends undefined ? "error" : Mode;
49
- }, true>;
50
- /**
51
- * @since 1.0.0
52
- * @category Tools
53
- */
54
- export declare const Bash_20250124: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
55
- readonly failureMode?: Mode | undefined;
56
- }) => Tool.ProviderDefined<"AnthropicBash", {
57
- readonly args: Schema.Struct<{}>;
58
- readonly parameters: Schema.Struct<{
59
- /**
60
- * The Bash command to run.
61
- */
62
- command: typeof Schema.NonEmptyString;
63
- /**
64
- * If `true`, restart the Bash session.
65
- */
66
- restart: Schema.optional<typeof Schema.Boolean>;
67
- }>;
68
- readonly success: typeof Schema.String;
69
- readonly failure: typeof Schema.Never;
70
- readonly failureMode: Mode extends undefined ? "error" : Mode;
71
- }, true>;
72
- /**
73
- * @since 1.0.0
74
- * @category Tools
75
- */
76
- export declare const CodeExecution_20250522: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
77
- readonly cache_control?: {
78
- readonly type: "ephemeral";
79
- readonly ttl?: "5m" | "1h" | null | undefined;
80
- } | null | undefined;
81
- }) => Tool.ProviderDefined<"AnthropicCodeExecution", {
82
- readonly args: Schema.Struct<{
83
- readonly cache_control: Schema.optionalWith<typeof Generated.BetaCacheControlEphemeral, {
84
- nullable: true;
85
- }>;
86
- }>;
87
- readonly parameters: Schema.Struct<{}>;
88
- readonly success: typeof Generated.BetaResponseCodeExecutionResultBlock;
89
- readonly failure: typeof Generated.BetaResponseCodeExecutionToolResultError;
90
- readonly failureMode: Mode extends undefined ? "error" : Mode;
91
- }, false>;
92
- /**
93
- * @since 1.0.0
94
- * @category Tools
95
- */
96
- export declare const CodeExecution_20250825: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
97
- readonly cache_control?: {
98
- readonly type: "ephemeral";
99
- readonly ttl?: "5m" | "1h" | null | undefined;
100
- } | null | undefined;
101
- }) => Tool.ProviderDefined<"AnthropicCodeExecution", {
102
- readonly args: Schema.Struct<{
103
- readonly cache_control: Schema.optionalWith<typeof Generated.BetaCacheControlEphemeral, {
104
- nullable: true;
105
- }>;
106
- }>;
107
- readonly parameters: Schema.Struct<{}>;
108
- readonly success: Schema.Union<[typeof Generated.BetaResponseBashCodeExecutionResultBlock, typeof Generated.BetaResponseTextEditorCodeExecutionViewResultBlock, typeof Generated.BetaResponseTextEditorCodeExecutionCreateResultBlock, typeof Generated.BetaResponseTextEditorCodeExecutionStrReplaceResultBlock]>;
109
- readonly failure: Schema.Union<[typeof Generated.BetaResponseCodeExecutionToolResultError, typeof Generated.BetaResponseTextEditorCodeExecutionToolResultError]>;
110
- readonly failureMode: Mode extends undefined ? "error" : Mode;
111
- }, false>;
112
- /**
113
- * @since 1.0.0
114
- * @category Models
115
- */
116
- export declare const Coordinate: Schema.Tuple2<typeof Schema.Number, typeof Schema.Number>;
117
- /**
118
- * Allow Claude to interact with computer environments through the computer use
119
- * tool, which provides screenshot capabilities and mouse/keyboard control for
120
- * autonomous desktop interaction.
121
- *
122
- * @since 1.0.0
123
- * @category Tools
124
- */
125
- export declare const ComputerUse_20241022: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
126
- readonly display_height_px: number;
127
- readonly display_width_px: number;
128
- readonly cache_control?: {
129
- readonly type: "ephemeral";
130
- readonly ttl?: "5m" | "1h" | null | undefined;
131
- } | null | undefined;
132
- readonly display_number?: number | null | undefined;
133
- readonly failureMode?: Mode | undefined;
134
- }) => Tool.ProviderDefined<"AnthropicComputerUse", {
135
- readonly args: Schema.Struct<{
136
- readonly cache_control: Schema.optionalWith<typeof Generated.BetaCacheControlEphemeral, {
137
- nullable: true;
138
- }>;
139
- readonly display_height_px: Schema.filter<typeof Schema.Int>;
140
- readonly display_number: Schema.optionalWith<Schema.filter<typeof Schema.Int>, {
141
- nullable: true;
142
- }>;
143
- readonly display_width_px: Schema.filter<typeof Schema.Int>;
144
- }>;
145
- readonly parameters: Schema.Struct<{
146
- /**
147
- * The action to perform. The available actions are:
148
- * - `screenshot`: Take a screenshot of the screen.
149
- * - `left_click`: Click the left mouse button at the specified (x, y) pixel
150
- * coordinate on the screen. You can also include a key combination to
151
- * hold down while clicking using the `text` parameter.
152
- * - `type`: Type a string of text on the keyboard.
153
- * - `key`: Press a key or key-combination on the keyboard.
154
- * - This supports xdotool's `key` syntax.
155
- * - Examples: "a", "Return", "alt+Tab", "ctrl+s", "Up", "KP_0" (for the
156
- * numpad 0 key).
157
- * - `mouse_move`: Move the cursor to a specified (x, y) pixel coordinate on
158
- * the screen.
159
- */
160
- action: Schema.Literal<["screenshot", "left_click", "type", "key", "mouse_move"]>;
161
- /**
162
- * The x (pixels from the left edge) and y (pixels from the top edge)
163
- * coordinates to move the mouse to. Required only by `action=mouse_move`.
164
- */
165
- coordinate: Schema.optional<Schema.Tuple2<typeof Schema.Number, typeof Schema.Number>>;
166
- /**
167
- * Required only by `action=type` and `action=key`.
168
- */
169
- text: Schema.optional<typeof Schema.String>;
170
- }>;
171
- readonly success: typeof Schema.String;
172
- readonly failure: typeof Schema.Never;
173
- readonly failureMode: Mode extends undefined ? "error" : Mode;
174
- }, true>;
175
- /**
176
- * Allow Claude to interact with computer environments through the computer use
177
- * tool, which provides screenshot capabilities and mouse/keyboard control for
178
- * autonomous desktop interaction.
179
- *
180
- * @since 1.0.0
181
- * @category Tools
182
- */
183
- export declare const ComputerUse_20250124: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
184
- readonly display_height_px: number;
185
- readonly display_width_px: number;
186
- readonly cache_control?: {
187
- readonly type: "ephemeral";
188
- readonly ttl?: "5m" | "1h" | null | undefined;
189
- } | null | undefined;
190
- readonly display_number?: number | null | undefined;
191
- readonly failureMode?: Mode | undefined;
192
- }) => Tool.ProviderDefined<"AnthropicComputerUse", {
193
- readonly args: Schema.Struct<{
194
- readonly cache_control: Schema.optionalWith<typeof Generated.BetaCacheControlEphemeral, {
195
- nullable: true;
196
- }>;
197
- readonly display_height_px: Schema.filter<typeof Schema.Int>;
198
- readonly display_number: Schema.optionalWith<Schema.filter<typeof Schema.Int>, {
199
- nullable: true;
200
- }>;
201
- readonly display_width_px: Schema.filter<typeof Schema.Int>;
202
- }>;
203
- readonly parameters: Schema.Struct<{
204
- /**
205
- * The action to perform. The available actions are:
206
- * - `screenshot`: Take a screenshot of the screen.
207
- * - `left_click`: Click the left mouse button at the specified (x, y) pixel
208
- * coordinate on the screen. You can also include a key combination to
209
- * hold down while clicking using the `text` parameter.
210
- * - `type`: Type a string of text on the keyboard.
211
- * - `key`: Press a key or key-combination on the keyboard.
212
- * - This supports xdotool's `key` syntax.
213
- * - Examples: "a", "Return", "alt+Tab", "ctrl+s", "Up", "KP_0" (for the
214
- * numpad 0 key).
215
- * - `mouse_move`: Move the cursor to a specified (x, y) pixel coordinate on
216
- * - `scroll`: Scroll the screen in a specified direction by a specified
217
- * amount of clicks of the scroll wheel, at the specified (x, y) pixel
218
- * coordinate. DO NOT use PageUp/PageDown to scroll.
219
- * - `left_click_drag`: Click and drag the cursor from `start_coordinate`
220
- * to a specified (x, y) pixel coordinate on the screen.
221
- * the screen.
222
- * - `middle_click`: Click the middle mouse button at the specified (x, y)
223
- * pixel coordinate on the screen.
224
- * - `right_click`: Click the right mouse button at the specified (x, y)
225
- * pixel coordinate on the screen.
226
- * - `double_click`: Double-click the left mouse button at the specified
227
- * (x, y) pixel coordinate on the screen.
228
- * - `triple_click`: Triple-click the left mouse button at the specified
229
- * (x, y) pixel coordinate on the screen.
230
- * - `left_mouse_down`: Press the left mouse button.
231
- * - `left_mouse_up`: Release the left mouse button.
232
- * - `hold_key`: Hold down a key or multiple keys for a specified duration
233
- * (in seconds). Supports the same syntax as `key`.
234
- * - `wait`: Wait for a specified duration (in seconds).
235
- */
236
- action: Schema.Literal<["screenshot", "left_click", "type", "key", "mouse_move", "scroll", "left_click_drag", "middle_click", "right_click", "double_click", "triple_click", "left_mouse_down", "left_mouse_up", "hold_key", "wait"]>;
237
- /**
238
- * The x (pixels from the left edge) and y (pixels from the top edge)
239
- * coordinates to move the mouse to. Required only by `action=mouse_move`
240
- * and `action=left_click_drag`.
241
- */
242
- coordinate: Schema.optional<Schema.Tuple2<typeof Schema.Number, typeof Schema.Number>>;
243
- /**
244
- * The x (pixels from the left edge) and y (pixels from the top edge)
245
- * coordinates to start the drag from. Required only by
246
- * `action=left_click_drag`.
247
- */
248
- start_coordinate: Schema.optional<Schema.Tuple2<typeof Schema.Number, typeof Schema.Number>>;
249
- /**
250
- * Required only by `action=type`, `action=key`, and `action=hold_key`. Can
251
- * also be used by click or scroll actions to hold down keys while clicking
252
- * or scrolling.
253
- */
254
- text: Schema.optional<typeof Schema.String>;
255
- /**
256
- * The direction to scroll the screen. Required only by `action=scroll`.
257
- */
258
- scroll_direction: Schema.optional<Schema.Literal<["up", "down", "left", "right"]>>;
259
- /**
260
- * The number of "clicks" of the scroll wheel to scroll. Required only by
261
- * `action=scroll`.
262
- */
263
- scroll_amount: Schema.optional<typeof Schema.Number>;
264
- /**
265
- * The duration to hold the key down for. Required only by `action=hold_key`
266
- * and `action=wait`.
267
- */
268
- duration: Schema.optional<typeof Schema.Number>;
269
- }>;
270
- readonly success: typeof Schema.String;
271
- readonly failure: typeof Schema.Never;
272
- readonly failureMode: Mode extends undefined ? "error" : Mode;
273
- }, true>;
274
- /**
275
- * Allow Claude to directly interact with your files, providing hands-on
276
- * assistance rather than just suggesting changes.
277
- *
278
- * @since 1.0.0
279
- * @category Tools
280
- */
281
- export declare const TextEditor_20241022: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
282
- readonly failureMode?: Mode | undefined;
283
- }) => Tool.ProviderDefined<"AnthropicTextEditor", {
284
- readonly args: Schema.Struct<{}>;
285
- readonly parameters: Schema.Struct<{
286
- /**
287
- * The command to run.
288
- */
289
- command: Schema.Literal<["view", "create", "str_replace", "insert", "undo_edit"]>;
290
- /**
291
- * Absolute path to file or directory, e.g. `/repo/file.py` or `/repo`.
292
- */
293
- path: typeof Schema.String;
294
- /**
295
- * Required parameter of `create` command, with the content of the file to
296
- * be created.
297
- */
298
- file_text: Schema.optional<typeof Schema.String>;
299
- /**
300
- * Required parameter of `insert` command. The `new_str` will be inserted
301
- * AFTER the line `insert_line` of `path`.
302
- */
303
- insert_line: Schema.optional<typeof Schema.Number>;
304
- /**
305
- * Optional parameter of `str_replace` command containing the new string (if
306
- * not given, no string will be added). Required parameter of `insert`
307
- * command containing the string to insert.
308
- */
309
- new_str: Schema.optional<typeof Schema.String>;
310
- /**
311
- * Required parameter of `str_replace` command containing the string in
312
- * `path` to replace.
313
- */
314
- old_str: Schema.optional<typeof Schema.String>;
315
- /**
316
- * Optional parameter of `view` command when `path` points to a file. If
317
- * none is given, the full file is shown. If provided, the file will be
318
- * shown in the indicated line number range, e.g. [11, 12] will show lines
319
- * 11 and 12. Indexing at 1 to start. Setting `[start_line, -1]` shows all
320
- * lines from `start_line` to the end of the file.
321
- */
322
- view_range: Schema.optional<Schema.Array$<typeof Schema.Number>>;
323
- }>;
324
- readonly success: typeof Schema.Void;
325
- readonly failure: typeof Schema.Never;
326
- readonly failureMode: Mode extends undefined ? "error" : Mode;
327
- }, true>;
328
- /**
329
- * Allow Claude to directly interact with your files, providing hands-on
330
- * assistance rather than just suggesting changes.
331
- *
332
- * @since 1.0.0
333
- * @category Tools
334
- */
335
- export declare const TextEditor_20250124: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
336
- readonly failureMode?: Mode | undefined;
337
- }) => Tool.ProviderDefined<"AnthropicTextEditor", {
338
- readonly args: Schema.Struct<{}>;
339
- readonly parameters: Schema.Struct<{
340
- /**
341
- * The command to run.
342
- */
343
- command: Schema.Literal<["view", "create", "str_replace", "insert", "undo_edit"]>;
344
- /**
345
- * Absolute path to file or directory, e.g. `/repo/file.py` or `/repo`.
346
- */
347
- path: typeof Schema.String;
348
- /**
349
- * Required parameter of `create` command, with the content of the file to
350
- * be created.
351
- */
352
- file_text: Schema.optional<typeof Schema.String>;
353
- /**
354
- * Required parameter of `insert` command. The `new_str` will be inserted
355
- * AFTER the line `insert_line` of `path`.
356
- */
357
- insert_line: Schema.optional<typeof Schema.Number>;
358
- /**
359
- * Optional parameter of `str_replace` command containing the new string (if
360
- * not given, no string will be added). Required parameter of `insert`
361
- * command containing the string to insert.
362
- */
363
- new_str: Schema.optional<typeof Schema.String>;
364
- /**
365
- * Required parameter of `str_replace` command containing the string in
366
- * `path` to replace.
367
- */
368
- old_str: Schema.optional<typeof Schema.String>;
369
- /**
370
- * Optional parameter of `view` command when `path` points to a file. If
371
- * none is given, the full file is shown. If provided, the file will be
372
- * shown in the indicated line number range, e.g. [11, 12] will show lines
373
- * 11 and 12. Indexing at 1 to start. Setting `[start_line, -1]` shows all
374
- * lines from `start_line` to the end of the file.
375
- */
376
- view_range: Schema.optional<Schema.Array$<typeof Schema.Number>>;
377
- }>;
378
- readonly success: typeof Schema.Void;
379
- readonly failure: typeof Schema.Never;
380
- readonly failureMode: Mode extends undefined ? "error" : Mode;
381
- }, true>;
382
- /**
383
- * Allow Claude to directly interact with your files, providing hands-on
384
- * assistance rather than just suggesting changes.
385
- *
386
- * @since 1.0.0
387
- * @category Tools
388
- */
389
- export declare const TextEditor_20250429: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
390
- readonly failureMode?: Mode | undefined;
391
- }) => Tool.ProviderDefined<"AnthropicTextEditor", {
392
- readonly args: Schema.Struct<{}>;
393
- readonly parameters: Schema.Struct<{
394
- /**
395
- * The command to run.
396
- */
397
- command: Schema.Literal<["view", "create", "str_replace", "insert"]>;
398
- /**
399
- * Absolute path to file or directory, e.g. `/repo/file.py` or `/repo`.
400
- */
401
- path: typeof Schema.String;
402
- /**
403
- * Required parameter of `create` command, with the content of the file to
404
- * be created.
405
- */
406
- file_text: Schema.optional<typeof Schema.String>;
407
- /**
408
- * Required parameter of `insert` command. The `new_str` will be inserted
409
- * AFTER the line `insert_line` of `path`.
410
- */
411
- insert_line: Schema.optional<typeof Schema.Number>;
412
- /**
413
- * Optional parameter of `str_replace` command containing the new string (if
414
- * not given, no string will be added). Required parameter of `insert`
415
- * command containing the string to insert.
416
- */
417
- new_str: Schema.optional<typeof Schema.String>;
418
- /**
419
- * Required parameter of `str_replace` command containing the string in
420
- * `path` to replace.
421
- */
422
- old_str: Schema.optional<typeof Schema.String>;
423
- /**
424
- * Optional parameter of `view` command when `path` points to a file. If
425
- * none is given, the full file is shown. If provided, the file will be
426
- * shown in the indicated line number range, e.g. [11, 12] will show lines
427
- * 11 and 12. Indexing at 1 to start. Setting `[start_line, -1]` shows all
428
- * lines from `start_line` to the end of the file.
429
- */
430
- view_range: Schema.optional<Schema.Array$<typeof Schema.Number>>;
431
- }>;
432
- readonly success: typeof Schema.Void;
433
- readonly failure: typeof Schema.Never;
434
- readonly failureMode: Mode extends undefined ? "error" : Mode;
435
- }, true>;
436
- /**
437
- * Allow Claude to directly interact with your files, providing hands-on
438
- * assistance rather than just suggesting changes.
439
- *
440
- * @since 1.0.0
441
- * @category Tools
442
- */
443
- export declare const TextEditor_20250728: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
444
- readonly failureMode?: Mode | undefined;
445
- }) => Tool.ProviderDefined<"AnthropicTextEditor", {
446
- readonly args: Schema.Struct<{}>;
447
- readonly parameters: Schema.Struct<{
448
- /**
449
- * The command to run.
450
- */
451
- command: Schema.Literal<["view", "create", "str_replace", "insert"]>;
452
- /**
453
- * Absolute path to file or directory, e.g. `/repo/file.py` or `/repo`.
454
- */
455
- path: typeof Schema.String;
456
- /**
457
- * Required parameter of `create` command, with the content of the file to
458
- * be created.
459
- */
460
- file_text: Schema.optional<typeof Schema.String>;
461
- /**
462
- * Required parameter of `insert` command. The `new_str` will be inserted
463
- * AFTER the line `insert_line` of `path`.
464
- */
465
- insert_line: Schema.optional<typeof Schema.Number>;
466
- /**
467
- * Optional parameter of `str_replace` command containing the new string (if
468
- * not given, no string will be added). Required parameter of `insert`
469
- * command containing the string to insert.
470
- */
471
- new_str: Schema.optional<typeof Schema.String>;
472
- /**
473
- * Required parameter of `str_replace` command containing the string in
474
- * `path` to replace.
475
- */
476
- old_str: Schema.optional<typeof Schema.String>;
477
- /**
478
- * Optional parameter of `view` command when `path` points to a file. If
479
- * none is given, the full file is shown. If provided, the file will be
480
- * shown in the indicated line number range, e.g. [11, 12] will show lines
481
- * 11 and 12. Indexing at 1 to start. Setting `[start_line, -1]` shows all
482
- * lines from `start_line` to the end of the file.
483
- */
484
- view_range: Schema.optional<Schema.Array$<typeof Schema.Number>>;
485
- }>;
486
- readonly success: typeof Schema.Void;
487
- readonly failure: typeof Schema.Never;
488
- readonly failureMode: Mode extends undefined ? "error" : Mode;
489
- }, true>;
490
- /**
491
- * @since 1.0.0
492
- * @category Tools
493
- */
494
- export declare const WebSearch_20250305: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
495
- readonly cache_control?: {
496
- readonly type: "ephemeral";
497
- readonly ttl?: "5m" | "1h" | null | undefined;
498
- } | null | undefined;
499
- readonly allowed_domains?: readonly string[] | null | undefined;
500
- readonly blocked_domains?: readonly string[] | null | undefined;
501
- readonly max_uses?: number | null | undefined;
502
- readonly user_location?: {
503
- readonly type: "approximate";
504
- readonly city?: string | null | undefined;
505
- readonly country?: string | null | undefined;
506
- readonly region?: string | null | undefined;
507
- readonly timezone?: string | null | undefined;
508
- } | null | undefined;
509
- }) => Tool.ProviderDefined<"AnthropicWebSearch", {
510
- readonly args: Schema.Struct<{
511
- readonly cache_control: Schema.optionalWith<typeof Generated.CacheControlEphemeral, {
512
- nullable: true;
513
- }>;
514
- readonly allowed_domains: Schema.optionalWith<Schema.Array$<typeof Schema.String>, {
515
- nullable: true;
516
- }>;
517
- readonly blocked_domains: Schema.optionalWith<Schema.Array$<typeof Schema.String>, {
518
- nullable: true;
519
- }>;
520
- readonly max_uses: Schema.optionalWith<Schema.filter<typeof Schema.Int>, {
521
- nullable: true;
522
- }>;
523
- readonly user_location: Schema.optionalWith<typeof Generated.UserLocation, {
524
- nullable: true;
525
- }>;
526
- }>;
527
- readonly parameters: Schema.Struct<{}>;
528
- readonly success: Schema.Array$<typeof Generated.RequestWebSearchResultBlock>;
529
- readonly failure: typeof Generated.ResponseWebSearchToolResultError;
530
- readonly failureMode: Mode extends undefined ? "error" : Mode;
531
- }, false>;
532
- /**
533
- * A helper method which takes in the name of a tool as returned in the response
534
- * from a large language model provider, and returns either the provider-defined
535
- * name for of the tool as found in the corresponding `Toolkit`, or `undefined`
536
- * if the tool name is not a provider-defined tool.
537
- *
538
- * For example, if the large language model provider returns the tool name
539
- * `"web_search"` in a response, calling this method would return `"AnthropicWebSearch"`.
540
- *
541
- * This method is primarily exposed for use by other Effect provider
542
- * integrations which can utilize Anthropic tools (i.e. Amazon Bedrock).
543
- *
544
- * @since 1.0.0
545
- * @category Tool Calling
546
- */
547
- export declare const getProviderDefinedToolName: (name: string) => string | undefined;
548
- //# sourceMappingURL=AnthropicTool.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnthropicTool.d.ts","sourceRoot":"","sources":["../../src/AnthropicT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