@ai-sdk/anthropic 2.0.12 → 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 +14 -0
- package/dist/index.d.mts +89 -61
- package/dist/index.d.ts +89 -61
- package/dist/index.js +60 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +60 -25
- 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 +60 -25
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +60 -25
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -34,69 +34,62 @@ declare class AnthropicMessagesLanguageModel implements LanguageModelV2 {
|
|
|
34
34
|
|
|
35
35
|
declare const anthropicTools: {
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
38
|
+
* allowing system operations, script execution, and command-line automation.
|
|
38
39
|
*
|
|
39
40
|
* Image results are supported.
|
|
40
41
|
*
|
|
41
|
-
*
|
|
42
|
+
* Tool name must be `bash`.
|
|
42
43
|
*/
|
|
43
44
|
bash_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
44
45
|
command: string;
|
|
45
46
|
restart?: boolean;
|
|
46
47
|
}, {}>;
|
|
47
48
|
/**
|
|
48
|
-
*
|
|
49
|
+
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
50
|
+
* allowing system operations, script execution, and command-line automation.
|
|
49
51
|
*
|
|
50
52
|
* Image results are supported.
|
|
51
53
|
*
|
|
52
|
-
*
|
|
54
|
+
* Tool name must be `bash`.
|
|
53
55
|
*/
|
|
54
56
|
bash_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
55
57
|
command: string;
|
|
56
58
|
restart?: boolean;
|
|
57
59
|
}, {}>;
|
|
58
60
|
/**
|
|
59
|
-
*
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
old_str?: string;
|
|
68
|
-
view_range?: number[];
|
|
69
|
-
}, {}>;
|
|
70
|
-
/**
|
|
71
|
-
* Creates a tool for editing text. Must have name "str_replace_editor".
|
|
72
|
-
*/
|
|
73
|
-
textEditor_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
74
|
-
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
75
|
-
path: string;
|
|
76
|
-
file_text?: string;
|
|
77
|
-
insert_line?: number;
|
|
78
|
-
new_str?: string;
|
|
79
|
-
old_str?: string;
|
|
80
|
-
view_range?: number[];
|
|
81
|
-
}, {}>;
|
|
82
|
-
/**
|
|
83
|
-
* Creates a tool for editing text. Must have name "str_replace_based_edit_tool".
|
|
84
|
-
* Note: This version does not support the "undo_edit" command.
|
|
61
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
62
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
63
|
+
* the API conversation.
|
|
64
|
+
*
|
|
65
|
+
* The code execution tool allows Claude to run Bash commands and manipulate files,
|
|
66
|
+
* including writing code, in a secure, sandboxed environment.
|
|
67
|
+
*
|
|
68
|
+
* Tool name must be `code_execution`.
|
|
85
69
|
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
70
|
+
codeExecution_20250522: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
|
|
71
|
+
code: string;
|
|
72
|
+
}, {
|
|
73
|
+
type: "code_execution_result";
|
|
74
|
+
stdout: string;
|
|
75
|
+
stderr: string;
|
|
76
|
+
return_code: number;
|
|
77
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
78
|
+
code: string;
|
|
79
|
+
}, {
|
|
80
|
+
type: "code_execution_result";
|
|
81
|
+
stdout: string;
|
|
82
|
+
stderr: string;
|
|
83
|
+
return_code: number;
|
|
84
|
+
}>;
|
|
95
85
|
/**
|
|
96
|
-
*
|
|
86
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
87
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
97
88
|
*
|
|
98
89
|
* Image results are supported.
|
|
99
90
|
*
|
|
91
|
+
* Tool name must be `computer`.
|
|
92
|
+
*
|
|
100
93
|
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
101
94
|
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
102
95
|
* @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.
|
|
@@ -111,14 +104,16 @@ declare const anthropicTools: {
|
|
|
111
104
|
displayNumber?: number;
|
|
112
105
|
}>;
|
|
113
106
|
/**
|
|
114
|
-
*
|
|
107
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
108
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
115
109
|
*
|
|
116
110
|
* Image results are supported.
|
|
117
111
|
*
|
|
112
|
+
* Tool name must be `computer`.
|
|
113
|
+
*
|
|
118
114
|
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
119
115
|
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
120
116
|
* @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.
|
|
121
|
-
* @param execute - The function to execute the tool. Optional.
|
|
122
117
|
*/
|
|
123
118
|
computer_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
124
119
|
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";
|
|
@@ -133,9 +128,60 @@ declare const anthropicTools: {
|
|
|
133
128
|
displayHeightPx: number;
|
|
134
129
|
displayNumber?: number;
|
|
135
130
|
}>;
|
|
131
|
+
/**
|
|
132
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
133
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
134
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
135
|
+
*
|
|
136
|
+
* Tool name must be `str_replace_editor`.
|
|
137
|
+
*/
|
|
138
|
+
textEditor_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
139
|
+
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
140
|
+
path: string;
|
|
141
|
+
file_text?: string;
|
|
142
|
+
insert_line?: number;
|
|
143
|
+
new_str?: string;
|
|
144
|
+
old_str?: string;
|
|
145
|
+
view_range?: number[];
|
|
146
|
+
}, {}>;
|
|
147
|
+
/**
|
|
148
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
149
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
150
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
151
|
+
*
|
|
152
|
+
* Tool name must be `str_replace_editor`.
|
|
153
|
+
*/
|
|
154
|
+
textEditor_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
155
|
+
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
156
|
+
path: string;
|
|
157
|
+
file_text?: string;
|
|
158
|
+
insert_line?: number;
|
|
159
|
+
new_str?: string;
|
|
160
|
+
old_str?: string;
|
|
161
|
+
view_range?: number[];
|
|
162
|
+
}, {}>;
|
|
163
|
+
/**
|
|
164
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
165
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
166
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
167
|
+
*
|
|
168
|
+
* Note: This version does not support the "undo_edit" command.
|
|
169
|
+
*
|
|
170
|
+
* Tool name must be `str_replace_based_edit_tool`.
|
|
171
|
+
*/
|
|
172
|
+
textEditor_20250429: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
173
|
+
command: "view" | "create" | "str_replace" | "insert";
|
|
174
|
+
path: string;
|
|
175
|
+
file_text?: string;
|
|
176
|
+
insert_line?: number;
|
|
177
|
+
new_str?: string;
|
|
178
|
+
old_str?: string;
|
|
179
|
+
view_range?: number[];
|
|
180
|
+
}, {}>;
|
|
136
181
|
/**
|
|
137
182
|
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
138
|
-
*
|
|
183
|
+
*
|
|
184
|
+
* Tool name must be `web_search`.
|
|
139
185
|
*
|
|
140
186
|
* @param maxUses - Maximum number of web searches Claude can perform during the conversation.
|
|
141
187
|
* @param allowedDomains - Optional list of domains that Claude is allowed to search.
|
|
@@ -170,24 +216,6 @@ declare const anthropicTools: {
|
|
|
170
216
|
encryptedContent: string;
|
|
171
217
|
type: string;
|
|
172
218
|
}[]>;
|
|
173
|
-
/**
|
|
174
|
-
* Creates a tool for executing Python code. Must have name "code_execution".
|
|
175
|
-
*/
|
|
176
|
-
codeExecution_20250522: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
|
|
177
|
-
code: string;
|
|
178
|
-
}, {
|
|
179
|
-
type: "code_execution_result";
|
|
180
|
-
stdout: string;
|
|
181
|
-
stderr: string;
|
|
182
|
-
return_code: number;
|
|
183
|
-
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
184
|
-
code: string;
|
|
185
|
-
}, {
|
|
186
|
-
type: "code_execution_result";
|
|
187
|
-
stdout: string;
|
|
188
|
-
stderr: string;
|
|
189
|
-
return_code: number;
|
|
190
|
-
}>;
|
|
191
219
|
};
|
|
192
220
|
|
|
193
221
|
type AnthropicCacheControl = {
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -34,69 +34,62 @@ declare class AnthropicMessagesLanguageModel implements LanguageModelV2 {
|
|
|
34
34
|
|
|
35
35
|
declare const anthropicTools: {
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
38
|
+
* allowing system operations, script execution, and command-line automation.
|
|
38
39
|
*
|
|
39
40
|
* Image results are supported.
|
|
40
41
|
*
|
|
41
|
-
*
|
|
42
|
+
* Tool name must be `bash`.
|
|
42
43
|
*/
|
|
43
44
|
bash_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
44
45
|
command: string;
|
|
45
46
|
restart?: boolean;
|
|
46
47
|
}, {}>;
|
|
47
48
|
/**
|
|
48
|
-
*
|
|
49
|
+
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
50
|
+
* allowing system operations, script execution, and command-line automation.
|
|
49
51
|
*
|
|
50
52
|
* Image results are supported.
|
|
51
53
|
*
|
|
52
|
-
*
|
|
54
|
+
* Tool name must be `bash`.
|
|
53
55
|
*/
|
|
54
56
|
bash_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
55
57
|
command: string;
|
|
56
58
|
restart?: boolean;
|
|
57
59
|
}, {}>;
|
|
58
60
|
/**
|
|
59
|
-
*
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
old_str?: string;
|
|
68
|
-
view_range?: number[];
|
|
69
|
-
}, {}>;
|
|
70
|
-
/**
|
|
71
|
-
* Creates a tool for editing text. Must have name "str_replace_editor".
|
|
72
|
-
*/
|
|
73
|
-
textEditor_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
74
|
-
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
75
|
-
path: string;
|
|
76
|
-
file_text?: string;
|
|
77
|
-
insert_line?: number;
|
|
78
|
-
new_str?: string;
|
|
79
|
-
old_str?: string;
|
|
80
|
-
view_range?: number[];
|
|
81
|
-
}, {}>;
|
|
82
|
-
/**
|
|
83
|
-
* Creates a tool for editing text. Must have name "str_replace_based_edit_tool".
|
|
84
|
-
* Note: This version does not support the "undo_edit" command.
|
|
61
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
62
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
63
|
+
* the API conversation.
|
|
64
|
+
*
|
|
65
|
+
* The code execution tool allows Claude to run Bash commands and manipulate files,
|
|
66
|
+
* including writing code, in a secure, sandboxed environment.
|
|
67
|
+
*
|
|
68
|
+
* Tool name must be `code_execution`.
|
|
85
69
|
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
70
|
+
codeExecution_20250522: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
|
|
71
|
+
code: string;
|
|
72
|
+
}, {
|
|
73
|
+
type: "code_execution_result";
|
|
74
|
+
stdout: string;
|
|
75
|
+
stderr: string;
|
|
76
|
+
return_code: number;
|
|
77
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
78
|
+
code: string;
|
|
79
|
+
}, {
|
|
80
|
+
type: "code_execution_result";
|
|
81
|
+
stdout: string;
|
|
82
|
+
stderr: string;
|
|
83
|
+
return_code: number;
|
|
84
|
+
}>;
|
|
95
85
|
/**
|
|
96
|
-
*
|
|
86
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
87
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
97
88
|
*
|
|
98
89
|
* Image results are supported.
|
|
99
90
|
*
|
|
91
|
+
* Tool name must be `computer`.
|
|
92
|
+
*
|
|
100
93
|
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
101
94
|
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
102
95
|
* @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.
|
|
@@ -111,14 +104,16 @@ declare const anthropicTools: {
|
|
|
111
104
|
displayNumber?: number;
|
|
112
105
|
}>;
|
|
113
106
|
/**
|
|
114
|
-
*
|
|
107
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
108
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
115
109
|
*
|
|
116
110
|
* Image results are supported.
|
|
117
111
|
*
|
|
112
|
+
* Tool name must be `computer`.
|
|
113
|
+
*
|
|
118
114
|
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
119
115
|
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
120
116
|
* @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.
|
|
121
|
-
* @param execute - The function to execute the tool. Optional.
|
|
122
117
|
*/
|
|
123
118
|
computer_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
124
119
|
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";
|
|
@@ -133,9 +128,60 @@ declare const anthropicTools: {
|
|
|
133
128
|
displayHeightPx: number;
|
|
134
129
|
displayNumber?: number;
|
|
135
130
|
}>;
|
|
131
|
+
/**
|
|
132
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
133
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
134
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
135
|
+
*
|
|
136
|
+
* Tool name must be `str_replace_editor`.
|
|
137
|
+
*/
|
|
138
|
+
textEditor_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
139
|
+
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
140
|
+
path: string;
|
|
141
|
+
file_text?: string;
|
|
142
|
+
insert_line?: number;
|
|
143
|
+
new_str?: string;
|
|
144
|
+
old_str?: string;
|
|
145
|
+
view_range?: number[];
|
|
146
|
+
}, {}>;
|
|
147
|
+
/**
|
|
148
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
149
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
150
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
151
|
+
*
|
|
152
|
+
* Tool name must be `str_replace_editor`.
|
|
153
|
+
*/
|
|
154
|
+
textEditor_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
155
|
+
command: "view" | "create" | "str_replace" | "insert" | "undo_edit";
|
|
156
|
+
path: string;
|
|
157
|
+
file_text?: string;
|
|
158
|
+
insert_line?: number;
|
|
159
|
+
new_str?: string;
|
|
160
|
+
old_str?: string;
|
|
161
|
+
view_range?: number[];
|
|
162
|
+
}, {}>;
|
|
163
|
+
/**
|
|
164
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
165
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
166
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
167
|
+
*
|
|
168
|
+
* Note: This version does not support the "undo_edit" command.
|
|
169
|
+
*
|
|
170
|
+
* Tool name must be `str_replace_based_edit_tool`.
|
|
171
|
+
*/
|
|
172
|
+
textEditor_20250429: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
173
|
+
command: "view" | "create" | "str_replace" | "insert";
|
|
174
|
+
path: string;
|
|
175
|
+
file_text?: string;
|
|
176
|
+
insert_line?: number;
|
|
177
|
+
new_str?: string;
|
|
178
|
+
old_str?: string;
|
|
179
|
+
view_range?: number[];
|
|
180
|
+
}, {}>;
|
|
136
181
|
/**
|
|
137
182
|
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
138
|
-
*
|
|
183
|
+
*
|
|
184
|
+
* Tool name must be `web_search`.
|
|
139
185
|
*
|
|
140
186
|
* @param maxUses - Maximum number of web searches Claude can perform during the conversation.
|
|
141
187
|
* @param allowedDomains - Optional list of domains that Claude is allowed to search.
|
|
@@ -170,24 +216,6 @@ declare const anthropicTools: {
|
|
|
170
216
|
encryptedContent: string;
|
|
171
217
|
type: string;
|
|
172
218
|
}[]>;
|
|
173
|
-
/**
|
|
174
|
-
* Creates a tool for executing Python code. Must have name "code_execution".
|
|
175
|
-
*/
|
|
176
|
-
codeExecution_20250522: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
|
|
177
|
-
code: string;
|
|
178
|
-
}, {
|
|
179
|
-
type: "code_execution_result";
|
|
180
|
-
stdout: string;
|
|
181
|
-
stderr: string;
|
|
182
|
-
return_code: number;
|
|
183
|
-
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
184
|
-
code: string;
|
|
185
|
-
}, {
|
|
186
|
-
type: "code_execution_result";
|
|
187
|
-
stdout: string;
|
|
188
|
-
stderr: string;
|
|
189
|
-
return_code: number;
|
|
190
|
-
}>;
|
|
191
219
|
};
|
|
192
220
|
|
|
193
221
|
type AnthropicCacheControl = {
|
package/dist/internal/index.js
CHANGED
|
@@ -568,7 +568,14 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
|
-
|
|
571
|
+
const toolResultParts = anthropicContent.filter(
|
|
572
|
+
(part) => part.type === "tool_result"
|
|
573
|
+
);
|
|
574
|
+
const otherParts = anthropicContent.filter(
|
|
575
|
+
(part) => part.type !== "tool_result"
|
|
576
|
+
);
|
|
577
|
+
const reorderedContent = toolResultParts.length > 0 ? [...toolResultParts, ...otherParts] : anthropicContent;
|
|
578
|
+
messages.push({ role: "user", content: reorderedContent });
|
|
572
579
|
break;
|
|
573
580
|
}
|
|
574
581
|
case "assistant": {
|
|
@@ -1994,69 +2001,97 @@ var textEditor_20250429 = (0, import_provider_utils12.createProviderDefinedToolF
|
|
|
1994
2001
|
// src/anthropic-tools.ts
|
|
1995
2002
|
var anthropicTools = {
|
|
1996
2003
|
/**
|
|
1997
|
-
*
|
|
2004
|
+
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
2005
|
+
* allowing system operations, script execution, and command-line automation.
|
|
1998
2006
|
*
|
|
1999
2007
|
* Image results are supported.
|
|
2000
2008
|
*
|
|
2001
|
-
*
|
|
2009
|
+
* Tool name must be `bash`.
|
|
2002
2010
|
*/
|
|
2003
2011
|
bash_20241022,
|
|
2004
2012
|
/**
|
|
2005
|
-
*
|
|
2013
|
+
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
2014
|
+
* allowing system operations, script execution, and command-line automation.
|
|
2006
2015
|
*
|
|
2007
2016
|
* Image results are supported.
|
|
2008
2017
|
*
|
|
2009
|
-
*
|
|
2018
|
+
* Tool name must be `bash`.
|
|
2010
2019
|
*/
|
|
2011
2020
|
bash_20250124,
|
|
2012
2021
|
/**
|
|
2013
|
-
*
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
*
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
* Creates a tool for editing text. Must have name "str_replace_based_edit_tool".
|
|
2022
|
-
* Note: This version does not support the "undo_edit" command.
|
|
2022
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
2023
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
2024
|
+
* the API conversation.
|
|
2025
|
+
*
|
|
2026
|
+
* The code execution tool allows Claude to run Bash commands and manipulate files,
|
|
2027
|
+
* including writing code, in a secure, sandboxed environment.
|
|
2028
|
+
*
|
|
2029
|
+
* Tool name must be `code_execution`.
|
|
2023
2030
|
*/
|
|
2024
|
-
|
|
2031
|
+
codeExecution_20250522,
|
|
2025
2032
|
/**
|
|
2026
|
-
*
|
|
2033
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
2034
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
2027
2035
|
*
|
|
2028
2036
|
* Image results are supported.
|
|
2029
2037
|
*
|
|
2038
|
+
* Tool name must be `computer`.
|
|
2039
|
+
*
|
|
2030
2040
|
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
2031
2041
|
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
2032
2042
|
* @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.
|
|
2033
2043
|
*/
|
|
2034
2044
|
computer_20241022,
|
|
2035
2045
|
/**
|
|
2036
|
-
*
|
|
2046
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
2047
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
2037
2048
|
*
|
|
2038
2049
|
* Image results are supported.
|
|
2039
2050
|
*
|
|
2051
|
+
* Tool name must be `computer`.
|
|
2052
|
+
*
|
|
2040
2053
|
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
2041
2054
|
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
2042
2055
|
* @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
|
-
* @param execute - The function to execute the tool. Optional.
|
|
2044
2056
|
*/
|
|
2045
2057
|
computer_20250124,
|
|
2058
|
+
/**
|
|
2059
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
2060
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
2061
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
2062
|
+
*
|
|
2063
|
+
* Tool name must be `str_replace_editor`.
|
|
2064
|
+
*/
|
|
2065
|
+
textEditor_20241022,
|
|
2066
|
+
/**
|
|
2067
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
2068
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
2069
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
2070
|
+
*
|
|
2071
|
+
* Tool name must be `str_replace_editor`.
|
|
2072
|
+
*/
|
|
2073
|
+
textEditor_20250124,
|
|
2074
|
+
/**
|
|
2075
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
2076
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
2077
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
2078
|
+
*
|
|
2079
|
+
* Note: This version does not support the "undo_edit" command.
|
|
2080
|
+
*
|
|
2081
|
+
* Tool name must be `str_replace_based_edit_tool`.
|
|
2082
|
+
*/
|
|
2083
|
+
textEditor_20250429,
|
|
2046
2084
|
/**
|
|
2047
2085
|
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
2048
|
-
*
|
|
2086
|
+
*
|
|
2087
|
+
* Tool name must be `web_search`.
|
|
2049
2088
|
*
|
|
2050
2089
|
* @param maxUses - Maximum number of web searches Claude can perform during the conversation.
|
|
2051
2090
|
* @param allowedDomains - Optional list of domains that Claude is allowed to search.
|
|
2052
2091
|
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
2053
2092
|
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
2054
2093
|
*/
|
|
2055
|
-
webSearch_20250305
|
|
2056
|
-
/**
|
|
2057
|
-
* Creates a tool for executing Python code. Must have name "code_execution".
|
|
2058
|
-
*/
|
|
2059
|
-
codeExecution_20250522
|
|
2094
|
+
webSearch_20250305
|
|
2060
2095
|
};
|
|
2061
2096
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2062
2097
|
0 && (module.exports = {
|