@ai-sdk/anthropic 2.0.13 → 2.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.d.mts +89 -61
- package/dist/index.d.ts +89 -61
- package/dist/index.js +52 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +52 -24
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +89 -61
- package/dist/internal/index.d.ts +89 -61
- package/dist/internal/index.js +52 -24
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +52 -24
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -16,69 +16,62 @@ type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptions>;
|
|
|
16
16
|
|
|
17
17
|
declare const anthropicTools: {
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
20
|
+
* allowing system operations, script execution, and command-line automation.
|
|
20
21
|
*
|
|
21
22
|
* Image results are supported.
|
|
22
23
|
*
|
|
23
|
-
*
|
|
24
|
+
* Tool name must be `bash`.
|
|
24
25
|
*/
|
|
25
26
|
bash_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
26
27
|
command: string;
|
|
27
28
|
restart?: boolean;
|
|
28
29
|
}, {}>;
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
+
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
32
|
+
* allowing system operations, script execution, and command-line automation.
|
|
31
33
|
*
|
|
32
34
|
* Image results are supported.
|
|
33
35
|
*
|
|
34
|
-
*
|
|
36
|
+
* Tool name must be `bash`.
|
|
35
37
|
*/
|
|
36
38
|
bash_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
37
39
|
command: string;
|
|
38
40
|
restart?: boolean;
|
|
39
41
|
}, {}>;
|
|
40
42
|
/**
|
|
41
|
-
*
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
old_str?: string;
|
|
50
|
-
view_range?: number[];
|
|
51
|
-
}, {}>;
|
|
52
|
-
/**
|
|
53
|
-
* Creates a tool for editing text. Must have name "str_replace_editor".
|
|
54
|
-
*/
|
|
55
|
-
textEditor_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
56
|
-
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
57
|
-
path: string;
|
|
58
|
-
file_text?: string;
|
|
59
|
-
insert_line?: number;
|
|
60
|
-
new_str?: string;
|
|
61
|
-
old_str?: string;
|
|
62
|
-
view_range?: number[];
|
|
63
|
-
}, {}>;
|
|
64
|
-
/**
|
|
65
|
-
* Creates a tool for editing text. Must have name "str_replace_based_edit_tool".
|
|
66
|
-
* Note: This version does not support the "undo_edit" command.
|
|
43
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
44
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
45
|
+
* the API conversation.
|
|
46
|
+
*
|
|
47
|
+
* The code execution tool allows Claude to run Bash commands and manipulate files,
|
|
48
|
+
* including writing code, in a secure, sandboxed environment.
|
|
49
|
+
*
|
|
50
|
+
* Tool name must be `code_execution`.
|
|
67
51
|
*/
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
52
|
+
codeExecution_20250522: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
|
|
53
|
+
code: string;
|
|
54
|
+
}, {
|
|
55
|
+
type: "code_execution_result";
|
|
56
|
+
stdout: string;
|
|
57
|
+
stderr: string;
|
|
58
|
+
return_code: number;
|
|
59
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
60
|
+
code: string;
|
|
61
|
+
}, {
|
|
62
|
+
type: "code_execution_result";
|
|
63
|
+
stdout: string;
|
|
64
|
+
stderr: string;
|
|
65
|
+
return_code: number;
|
|
66
|
+
}>;
|
|
77
67
|
/**
|
|
78
|
-
*
|
|
68
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
69
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
79
70
|
*
|
|
80
71
|
* Image results are supported.
|
|
81
72
|
*
|
|
73
|
+
* Tool name must be `computer`.
|
|
74
|
+
*
|
|
82
75
|
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
83
76
|
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
84
77
|
* @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
|
|
@@ -93,14 +86,16 @@ declare const anthropicTools: {
|
|
|
93
86
|
displayNumber?: number;
|
|
94
87
|
}>;
|
|
95
88
|
/**
|
|
96
|
-
*
|
|
89
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
90
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
97
91
|
*
|
|
98
92
|
* Image results are supported.
|
|
99
93
|
*
|
|
94
|
+
* Tool name must be `computer`.
|
|
95
|
+
*
|
|
100
96
|
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
101
97
|
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
102
98
|
* @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
|
|
103
|
-
* @param execute - The function to execute the tool. Optional.
|
|
104
99
|
*/
|
|
105
100
|
computer_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
106
101
|
action: "key" | "hold_key" | "type" | "cursor_position" | "mouse_move" | "left_mouse_down" | "left_mouse_up" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "triple_click" | "scroll" | "wait" | "screenshot";
|
|
@@ -115,9 +110,60 @@ declare const anthropicTools: {
|
|
|
115
110
|
displayHeightPx: number;
|
|
116
111
|
displayNumber?: number;
|
|
117
112
|
}>;
|
|
113
|
+
/**
|
|
114
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
115
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
116
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
117
|
+
*
|
|
118
|
+
* Tool name must be `str_replace_editor`.
|
|
119
|
+
*/
|
|
120
|
+
textEditor_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
121
|
+
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
122
|
+
path: string;
|
|
123
|
+
file_text?: string;
|
|
124
|
+
insert_line?: number;
|
|
125
|
+
new_str?: string;
|
|
126
|
+
old_str?: string;
|
|
127
|
+
view_range?: number[];
|
|
128
|
+
}, {}>;
|
|
129
|
+
/**
|
|
130
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
131
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
132
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
133
|
+
*
|
|
134
|
+
* Tool name must be `str_replace_editor`.
|
|
135
|
+
*/
|
|
136
|
+
textEditor_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
137
|
+
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
138
|
+
path: string;
|
|
139
|
+
file_text?: string;
|
|
140
|
+
insert_line?: number;
|
|
141
|
+
new_str?: string;
|
|
142
|
+
old_str?: string;
|
|
143
|
+
view_range?: number[];
|
|
144
|
+
}, {}>;
|
|
145
|
+
/**
|
|
146
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
147
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
148
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
149
|
+
*
|
|
150
|
+
* Note: This version does not support the "undo_edit" command.
|
|
151
|
+
*
|
|
152
|
+
* Tool name must be `str_replace_based_edit_tool`.
|
|
153
|
+
*/
|
|
154
|
+
textEditor_20250429: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
155
|
+
command: "view" | "create" | "str_replace" | "insert";
|
|
156
|
+
path: string;
|
|
157
|
+
file_text?: string;
|
|
158
|
+
insert_line?: number;
|
|
159
|
+
new_str?: string;
|
|
160
|
+
old_str?: string;
|
|
161
|
+
view_range?: number[];
|
|
162
|
+
}, {}>;
|
|
118
163
|
/**
|
|
119
164
|
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
120
|
-
*
|
|
165
|
+
*
|
|
166
|
+
* Tool name must be `web_search`.
|
|
121
167
|
*
|
|
122
168
|
* @param maxUses - Maximum number of web searches Claude can perform during the conversation.
|
|
123
169
|
* @param allowedDomains - Optional list of domains that Claude is allowed to search.
|
|
@@ -152,24 +198,6 @@ declare const anthropicTools: {
|
|
|
152
198
|
encryptedContent: string;
|
|
153
199
|
type: string;
|
|
154
200
|
}[]>;
|
|
155
|
-
/**
|
|
156
|
-
* Creates a tool for executing Python code. Must have name "code_execution".
|
|
157
|
-
*/
|
|
158
|
-
codeExecution_20250522: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
|
|
159
|
-
code: string;
|
|
160
|
-
}, {
|
|
161
|
-
type: "code_execution_result";
|
|
162
|
-
stdout: string;
|
|
163
|
-
stderr: string;
|
|
164
|
-
return_code: number;
|
|
165
|
-
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
166
|
-
code: string;
|
|
167
|
-
}, {
|
|
168
|
-
type: "code_execution_result";
|
|
169
|
-
stdout: string;
|
|
170
|
-
stderr: string;
|
|
171
|
-
return_code: number;
|
|
172
|
-
}>;
|
|
173
201
|
};
|
|
174
202
|
|
|
175
203
|
interface AnthropicProvider extends ProviderV2 {
|
package/dist/index.d.ts
CHANGED
|
@@ -16,69 +16,62 @@ type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptions>;
|
|
|
16
16
|
|
|
17
17
|
declare const anthropicTools: {
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
20
|
+
* allowing system operations, script execution, and command-line automation.
|
|
20
21
|
*
|
|
21
22
|
* Image results are supported.
|
|
22
23
|
*
|
|
23
|
-
*
|
|
24
|
+
* Tool name must be `bash`.
|
|
24
25
|
*/
|
|
25
26
|
bash_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
26
27
|
command: string;
|
|
27
28
|
restart?: boolean;
|
|
28
29
|
}, {}>;
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
+
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
32
|
+
* allowing system operations, script execution, and command-line automation.
|
|
31
33
|
*
|
|
32
34
|
* Image results are supported.
|
|
33
35
|
*
|
|
34
|
-
*
|
|
36
|
+
* Tool name must be `bash`.
|
|
35
37
|
*/
|
|
36
38
|
bash_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
37
39
|
command: string;
|
|
38
40
|
restart?: boolean;
|
|
39
41
|
}, {}>;
|
|
40
42
|
/**
|
|
41
|
-
*
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
old_str?: string;
|
|
50
|
-
view_range?: number[];
|
|
51
|
-
}, {}>;
|
|
52
|
-
/**
|
|
53
|
-
* Creates a tool for editing text. Must have name "str_replace_editor".
|
|
54
|
-
*/
|
|
55
|
-
textEditor_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
56
|
-
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
57
|
-
path: string;
|
|
58
|
-
file_text?: string;
|
|
59
|
-
insert_line?: number;
|
|
60
|
-
new_str?: string;
|
|
61
|
-
old_str?: string;
|
|
62
|
-
view_range?: number[];
|
|
63
|
-
}, {}>;
|
|
64
|
-
/**
|
|
65
|
-
* Creates a tool for editing text. Must have name "str_replace_based_edit_tool".
|
|
66
|
-
* Note: This version does not support the "undo_edit" command.
|
|
43
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
44
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
45
|
+
* the API conversation.
|
|
46
|
+
*
|
|
47
|
+
* The code execution tool allows Claude to run Bash commands and manipulate files,
|
|
48
|
+
* including writing code, in a secure, sandboxed environment.
|
|
49
|
+
*
|
|
50
|
+
* Tool name must be `code_execution`.
|
|
67
51
|
*/
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
52
|
+
codeExecution_20250522: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
|
|
53
|
+
code: string;
|
|
54
|
+
}, {
|
|
55
|
+
type: "code_execution_result";
|
|
56
|
+
stdout: string;
|
|
57
|
+
stderr: string;
|
|
58
|
+
return_code: number;
|
|
59
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
60
|
+
code: string;
|
|
61
|
+
}, {
|
|
62
|
+
type: "code_execution_result";
|
|
63
|
+
stdout: string;
|
|
64
|
+
stderr: string;
|
|
65
|
+
return_code: number;
|
|
66
|
+
}>;
|
|
77
67
|
/**
|
|
78
|
-
*
|
|
68
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
69
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
79
70
|
*
|
|
80
71
|
* Image results are supported.
|
|
81
72
|
*
|
|
73
|
+
* Tool name must be `computer`.
|
|
74
|
+
*
|
|
82
75
|
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
83
76
|
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
84
77
|
* @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
|
|
@@ -93,14 +86,16 @@ declare const anthropicTools: {
|
|
|
93
86
|
displayNumber?: number;
|
|
94
87
|
}>;
|
|
95
88
|
/**
|
|
96
|
-
*
|
|
89
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
90
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
97
91
|
*
|
|
98
92
|
* Image results are supported.
|
|
99
93
|
*
|
|
94
|
+
* Tool name must be `computer`.
|
|
95
|
+
*
|
|
100
96
|
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
101
97
|
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
102
98
|
* @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
|
|
103
|
-
* @param execute - The function to execute the tool. Optional.
|
|
104
99
|
*/
|
|
105
100
|
computer_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
106
101
|
action: "key" | "hold_key" | "type" | "cursor_position" | "mouse_move" | "left_mouse_down" | "left_mouse_up" | "left_click" | "left_click_drag" | "right_click" | "middle_click" | "double_click" | "triple_click" | "scroll" | "wait" | "screenshot";
|
|
@@ -115,9 +110,60 @@ declare const anthropicTools: {
|
|
|
115
110
|
displayHeightPx: number;
|
|
116
111
|
displayNumber?: number;
|
|
117
112
|
}>;
|
|
113
|
+
/**
|
|
114
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
115
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
116
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
117
|
+
*
|
|
118
|
+
* Tool name must be `str_replace_editor`.
|
|
119
|
+
*/
|
|
120
|
+
textEditor_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
121
|
+
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
122
|
+
path: string;
|
|
123
|
+
file_text?: string;
|
|
124
|
+
insert_line?: number;
|
|
125
|
+
new_str?: string;
|
|
126
|
+
old_str?: string;
|
|
127
|
+
view_range?: number[];
|
|
128
|
+
}, {}>;
|
|
129
|
+
/**
|
|
130
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
131
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
132
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
133
|
+
*
|
|
134
|
+
* Tool name must be `str_replace_editor`.
|
|
135
|
+
*/
|
|
136
|
+
textEditor_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
137
|
+
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
138
|
+
path: string;
|
|
139
|
+
file_text?: string;
|
|
140
|
+
insert_line?: number;
|
|
141
|
+
new_str?: string;
|
|
142
|
+
old_str?: string;
|
|
143
|
+
view_range?: number[];
|
|
144
|
+
}, {}>;
|
|
145
|
+
/**
|
|
146
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
147
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
148
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
149
|
+
*
|
|
150
|
+
* Note: This version does not support the "undo_edit" command.
|
|
151
|
+
*
|
|
152
|
+
* Tool name must be `str_replace_based_edit_tool`.
|
|
153
|
+
*/
|
|
154
|
+
textEditor_20250429: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
155
|
+
command: "view" | "create" | "str_replace" | "insert";
|
|
156
|
+
path: string;
|
|
157
|
+
file_text?: string;
|
|
158
|
+
insert_line?: number;
|
|
159
|
+
new_str?: string;
|
|
160
|
+
old_str?: string;
|
|
161
|
+
view_range?: number[];
|
|
162
|
+
}, {}>;
|
|
118
163
|
/**
|
|
119
164
|
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
120
|
-
*
|
|
165
|
+
*
|
|
166
|
+
* Tool name must be `web_search`.
|
|
121
167
|
*
|
|
122
168
|
* @param maxUses - Maximum number of web searches Claude can perform during the conversation.
|
|
123
169
|
* @param allowedDomains - Optional list of domains that Claude is allowed to search.
|
|
@@ -152,24 +198,6 @@ declare const anthropicTools: {
|
|
|
152
198
|
encryptedContent: string;
|
|
153
199
|
type: string;
|
|
154
200
|
}[]>;
|
|
155
|
-
/**
|
|
156
|
-
* Creates a tool for executing Python code. Must have name "code_execution".
|
|
157
|
-
*/
|
|
158
|
-
codeExecution_20250522: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
|
|
159
|
-
code: string;
|
|
160
|
-
}, {
|
|
161
|
-
type: "code_execution_result";
|
|
162
|
-
stdout: string;
|
|
163
|
-
stderr: string;
|
|
164
|
-
return_code: number;
|
|
165
|
-
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
166
|
-
code: string;
|
|
167
|
-
}, {
|
|
168
|
-
type: "code_execution_result";
|
|
169
|
-
stdout: string;
|
|
170
|
-
stderr: string;
|
|
171
|
-
return_code: number;
|
|
172
|
-
}>;
|
|
173
201
|
};
|
|
174
202
|
|
|
175
203
|
interface AnthropicProvider extends ProviderV2 {
|
package/dist/index.js
CHANGED
|
@@ -2004,69 +2004,97 @@ var textEditor_20250429 = (0, import_provider_utils12.createProviderDefinedToolF
|
|
|
2004
2004
|
// src/anthropic-tools.ts
|
|
2005
2005
|
var anthropicTools = {
|
|
2006
2006
|
/**
|
|
2007
|
-
*
|
|
2007
|
+
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
2008
|
+
* allowing system operations, script execution, and command-line automation.
|
|
2008
2009
|
*
|
|
2009
2010
|
* Image results are supported.
|
|
2010
2011
|
*
|
|
2011
|
-
*
|
|
2012
|
+
* Tool name must be `bash`.
|
|
2012
2013
|
*/
|
|
2013
2014
|
bash_20241022,
|
|
2014
2015
|
/**
|
|
2015
|
-
*
|
|
2016
|
+
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
2017
|
+
* allowing system operations, script execution, and command-line automation.
|
|
2016
2018
|
*
|
|
2017
2019
|
* Image results are supported.
|
|
2018
2020
|
*
|
|
2019
|
-
*
|
|
2021
|
+
* Tool name must be `bash`.
|
|
2020
2022
|
*/
|
|
2021
2023
|
bash_20250124,
|
|
2022
2024
|
/**
|
|
2023
|
-
*
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
*
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
* Creates a tool for editing text. Must have name "str_replace_based_edit_tool".
|
|
2032
|
-
* Note: This version does not support the "undo_edit" command.
|
|
2025
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
2026
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
2027
|
+
* the API conversation.
|
|
2028
|
+
*
|
|
2029
|
+
* The code execution tool allows Claude to run Bash commands and manipulate files,
|
|
2030
|
+
* including writing code, in a secure, sandboxed environment.
|
|
2031
|
+
*
|
|
2032
|
+
* Tool name must be `code_execution`.
|
|
2033
2033
|
*/
|
|
2034
|
-
|
|
2034
|
+
codeExecution_20250522,
|
|
2035
2035
|
/**
|
|
2036
|
-
*
|
|
2036
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
2037
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
2037
2038
|
*
|
|
2038
2039
|
* Image results are supported.
|
|
2039
2040
|
*
|
|
2041
|
+
* Tool name must be `computer`.
|
|
2042
|
+
*
|
|
2040
2043
|
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
2041
2044
|
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
2042
2045
|
* @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
|
|
2043
2046
|
*/
|
|
2044
2047
|
computer_20241022,
|
|
2045
2048
|
/**
|
|
2046
|
-
*
|
|
2049
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
2050
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
2047
2051
|
*
|
|
2048
2052
|
* Image results are supported.
|
|
2049
2053
|
*
|
|
2054
|
+
* Tool name must be `computer`.
|
|
2055
|
+
*
|
|
2050
2056
|
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
2051
2057
|
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
2052
2058
|
* @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
|
|
2053
|
-
* @param execute - The function to execute the tool. Optional.
|
|
2054
2059
|
*/
|
|
2055
2060
|
computer_20250124,
|
|
2061
|
+
/**
|
|
2062
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
2063
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
2064
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
2065
|
+
*
|
|
2066
|
+
* Tool name must be `str_replace_editor`.
|
|
2067
|
+
*/
|
|
2068
|
+
textEditor_20241022,
|
|
2069
|
+
/**
|
|
2070
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
2071
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
2072
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
2073
|
+
*
|
|
2074
|
+
* Tool name must be `str_replace_editor`.
|
|
2075
|
+
*/
|
|
2076
|
+
textEditor_20250124,
|
|
2077
|
+
/**
|
|
2078
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
2079
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
2080
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
2081
|
+
*
|
|
2082
|
+
* Note: This version does not support the "undo_edit" command.
|
|
2083
|
+
*
|
|
2084
|
+
* Tool name must be `str_replace_based_edit_tool`.
|
|
2085
|
+
*/
|
|
2086
|
+
textEditor_20250429,
|
|
2056
2087
|
/**
|
|
2057
2088
|
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
2058
|
-
*
|
|
2089
|
+
*
|
|
2090
|
+
* Tool name must be `web_search`.
|
|
2059
2091
|
*
|
|
2060
2092
|
* @param maxUses - Maximum number of web searches Claude can perform during the conversation.
|
|
2061
2093
|
* @param allowedDomains - Optional list of domains that Claude is allowed to search.
|
|
2062
2094
|
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
2063
2095
|
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
2064
2096
|
*/
|
|
2065
|
-
webSearch_20250305
|
|
2066
|
-
/**
|
|
2067
|
-
* Creates a tool for executing Python code. Must have name "code_execution".
|
|
2068
|
-
*/
|
|
2069
|
-
codeExecution_20250522
|
|
2097
|
+
webSearch_20250305
|
|
2070
2098
|
};
|
|
2071
2099
|
|
|
2072
2100
|
// src/anthropic-provider.ts
|