@ai-sdk/anthropic 3.0.0-beta.22 → 3.0.0-beta.24
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 +12 -0
- package/dist/index.d.mts +141 -0
- package/dist/index.d.ts +141 -0
- package/dist/index.js +510 -123
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +502 -107
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +147 -0
- package/dist/internal/index.d.ts +147 -0
- package/dist/internal/index.js +504 -117
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +501 -106
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ai-sdk/anthropic
|
|
2
2
|
|
|
3
|
+
## 3.0.0-beta.24
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d08308b: feat(provider/anthropic): memory tool
|
|
8
|
+
|
|
9
|
+
## 3.0.0-beta.23
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 6f845b4: Add support for 2025-08-25 code execution tool
|
|
14
|
+
|
|
3
15
|
## 3.0.0-beta.22
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -68,6 +68,111 @@ declare const anthropicTools: {
|
|
|
68
68
|
stderr: string;
|
|
69
69
|
return_code: number;
|
|
70
70
|
}>;
|
|
71
|
+
/**
|
|
72
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
73
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
74
|
+
* the API conversation.
|
|
75
|
+
*
|
|
76
|
+
* The code execution tool allows Claude to run both Python and Bash commands and manipulate files,
|
|
77
|
+
* including writing code, in a secure, sandboxed environment.
|
|
78
|
+
*
|
|
79
|
+
* This is the latest version with enhanced Bash support and file operations.
|
|
80
|
+
*
|
|
81
|
+
* Tool name must be `code_execution`.
|
|
82
|
+
*/
|
|
83
|
+
codeExecution_20250825: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
|
|
84
|
+
type: "bash_code_execution";
|
|
85
|
+
command: string;
|
|
86
|
+
} | {
|
|
87
|
+
type: "text_editor_code_execution";
|
|
88
|
+
command: "view";
|
|
89
|
+
path: string;
|
|
90
|
+
} | {
|
|
91
|
+
type: "text_editor_code_execution";
|
|
92
|
+
command: "create";
|
|
93
|
+
path: string;
|
|
94
|
+
file_text?: string | null;
|
|
95
|
+
} | {
|
|
96
|
+
type: "text_editor_code_execution";
|
|
97
|
+
command: "str_replace";
|
|
98
|
+
path: string;
|
|
99
|
+
old_str: string;
|
|
100
|
+
new_str: string;
|
|
101
|
+
}, {
|
|
102
|
+
type: "bash_code_execution_result";
|
|
103
|
+
stdout: string;
|
|
104
|
+
stderr: string;
|
|
105
|
+
return_code: number;
|
|
106
|
+
} | {
|
|
107
|
+
type: "bash_code_execution_tool_result_error";
|
|
108
|
+
error_code: string;
|
|
109
|
+
} | {
|
|
110
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
111
|
+
error_code: string;
|
|
112
|
+
} | {
|
|
113
|
+
type: "text_editor_code_execution_view_result";
|
|
114
|
+
content: string;
|
|
115
|
+
file_type: string;
|
|
116
|
+
num_lines: number | null;
|
|
117
|
+
start_line: number | null;
|
|
118
|
+
total_lines: number | null;
|
|
119
|
+
} | {
|
|
120
|
+
type: "text_editor_code_execution_create_result";
|
|
121
|
+
is_file_update: boolean;
|
|
122
|
+
} | {
|
|
123
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
124
|
+
lines: string[] | null;
|
|
125
|
+
new_lines: number | null;
|
|
126
|
+
new_start: number | null;
|
|
127
|
+
old_lines: number | null;
|
|
128
|
+
old_start: number | null;
|
|
129
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
130
|
+
type: "bash_code_execution";
|
|
131
|
+
command: string;
|
|
132
|
+
} | {
|
|
133
|
+
type: "text_editor_code_execution";
|
|
134
|
+
command: "view";
|
|
135
|
+
path: string;
|
|
136
|
+
} | {
|
|
137
|
+
type: "text_editor_code_execution";
|
|
138
|
+
command: "create";
|
|
139
|
+
path: string;
|
|
140
|
+
file_text?: string | null;
|
|
141
|
+
} | {
|
|
142
|
+
type: "text_editor_code_execution";
|
|
143
|
+
command: "str_replace";
|
|
144
|
+
path: string;
|
|
145
|
+
old_str: string;
|
|
146
|
+
new_str: string;
|
|
147
|
+
}, {
|
|
148
|
+
type: "bash_code_execution_result";
|
|
149
|
+
stdout: string;
|
|
150
|
+
stderr: string;
|
|
151
|
+
return_code: number;
|
|
152
|
+
} | {
|
|
153
|
+
type: "bash_code_execution_tool_result_error";
|
|
154
|
+
error_code: string;
|
|
155
|
+
} | {
|
|
156
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
157
|
+
error_code: string;
|
|
158
|
+
} | {
|
|
159
|
+
type: "text_editor_code_execution_view_result";
|
|
160
|
+
content: string;
|
|
161
|
+
file_type: string;
|
|
162
|
+
num_lines: number | null;
|
|
163
|
+
start_line: number | null;
|
|
164
|
+
total_lines: number | null;
|
|
165
|
+
} | {
|
|
166
|
+
type: "text_editor_code_execution_create_result";
|
|
167
|
+
is_file_update: boolean;
|
|
168
|
+
} | {
|
|
169
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
170
|
+
lines: string[] | null;
|
|
171
|
+
new_lines: number | null;
|
|
172
|
+
new_start: number | null;
|
|
173
|
+
old_lines: number | null;
|
|
174
|
+
old_start: number | null;
|
|
175
|
+
}>;
|
|
71
176
|
/**
|
|
72
177
|
* Claude can interact with computer environments through the computer use tool, which
|
|
73
178
|
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
@@ -114,6 +219,42 @@ declare const anthropicTools: {
|
|
|
114
219
|
displayHeightPx: number;
|
|
115
220
|
displayNumber?: number;
|
|
116
221
|
}>;
|
|
222
|
+
/**
|
|
223
|
+
* The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
|
|
224
|
+
* Claude can create, read, update, and delete files that persist between sessions,
|
|
225
|
+
* allowing it to build knowledge over time without keeping everything in the context window.
|
|
226
|
+
* The memory tool operates client-side—you control where and how the data is stored through your own infrastructure.
|
|
227
|
+
*
|
|
228
|
+
* Supported models: Claude Sonnet 4.5, Claude Sonnet 4, Claude Opus 4.1, Claude Opus 4.
|
|
229
|
+
*
|
|
230
|
+
* Tool name must be `memory`.
|
|
231
|
+
*/
|
|
232
|
+
memory_20250818: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
233
|
+
command: "view";
|
|
234
|
+
path: string;
|
|
235
|
+
view_range?: [number, number];
|
|
236
|
+
} | {
|
|
237
|
+
command: "create";
|
|
238
|
+
path: string;
|
|
239
|
+
file_text: string;
|
|
240
|
+
} | {
|
|
241
|
+
command: "str_replace";
|
|
242
|
+
path: string;
|
|
243
|
+
old_str: string;
|
|
244
|
+
new_str: string;
|
|
245
|
+
} | {
|
|
246
|
+
command: "insert";
|
|
247
|
+
path: string;
|
|
248
|
+
insert_line: number;
|
|
249
|
+
insert_text: string;
|
|
250
|
+
} | {
|
|
251
|
+
command: "delete";
|
|
252
|
+
path: string;
|
|
253
|
+
} | {
|
|
254
|
+
command: "rename";
|
|
255
|
+
old_path: string;
|
|
256
|
+
new_path: string;
|
|
257
|
+
}, {}>;
|
|
117
258
|
/**
|
|
118
259
|
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
119
260
|
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
package/dist/index.d.ts
CHANGED
|
@@ -68,6 +68,111 @@ declare const anthropicTools: {
|
|
|
68
68
|
stderr: string;
|
|
69
69
|
return_code: number;
|
|
70
70
|
}>;
|
|
71
|
+
/**
|
|
72
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
73
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
74
|
+
* the API conversation.
|
|
75
|
+
*
|
|
76
|
+
* The code execution tool allows Claude to run both Python and Bash commands and manipulate files,
|
|
77
|
+
* including writing code, in a secure, sandboxed environment.
|
|
78
|
+
*
|
|
79
|
+
* This is the latest version with enhanced Bash support and file operations.
|
|
80
|
+
*
|
|
81
|
+
* Tool name must be `code_execution`.
|
|
82
|
+
*/
|
|
83
|
+
codeExecution_20250825: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
|
|
84
|
+
type: "bash_code_execution";
|
|
85
|
+
command: string;
|
|
86
|
+
} | {
|
|
87
|
+
type: "text_editor_code_execution";
|
|
88
|
+
command: "view";
|
|
89
|
+
path: string;
|
|
90
|
+
} | {
|
|
91
|
+
type: "text_editor_code_execution";
|
|
92
|
+
command: "create";
|
|
93
|
+
path: string;
|
|
94
|
+
file_text?: string | null;
|
|
95
|
+
} | {
|
|
96
|
+
type: "text_editor_code_execution";
|
|
97
|
+
command: "str_replace";
|
|
98
|
+
path: string;
|
|
99
|
+
old_str: string;
|
|
100
|
+
new_str: string;
|
|
101
|
+
}, {
|
|
102
|
+
type: "bash_code_execution_result";
|
|
103
|
+
stdout: string;
|
|
104
|
+
stderr: string;
|
|
105
|
+
return_code: number;
|
|
106
|
+
} | {
|
|
107
|
+
type: "bash_code_execution_tool_result_error";
|
|
108
|
+
error_code: string;
|
|
109
|
+
} | {
|
|
110
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
111
|
+
error_code: string;
|
|
112
|
+
} | {
|
|
113
|
+
type: "text_editor_code_execution_view_result";
|
|
114
|
+
content: string;
|
|
115
|
+
file_type: string;
|
|
116
|
+
num_lines: number | null;
|
|
117
|
+
start_line: number | null;
|
|
118
|
+
total_lines: number | null;
|
|
119
|
+
} | {
|
|
120
|
+
type: "text_editor_code_execution_create_result";
|
|
121
|
+
is_file_update: boolean;
|
|
122
|
+
} | {
|
|
123
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
124
|
+
lines: string[] | null;
|
|
125
|
+
new_lines: number | null;
|
|
126
|
+
new_start: number | null;
|
|
127
|
+
old_lines: number | null;
|
|
128
|
+
old_start: number | null;
|
|
129
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
130
|
+
type: "bash_code_execution";
|
|
131
|
+
command: string;
|
|
132
|
+
} | {
|
|
133
|
+
type: "text_editor_code_execution";
|
|
134
|
+
command: "view";
|
|
135
|
+
path: string;
|
|
136
|
+
} | {
|
|
137
|
+
type: "text_editor_code_execution";
|
|
138
|
+
command: "create";
|
|
139
|
+
path: string;
|
|
140
|
+
file_text?: string | null;
|
|
141
|
+
} | {
|
|
142
|
+
type: "text_editor_code_execution";
|
|
143
|
+
command: "str_replace";
|
|
144
|
+
path: string;
|
|
145
|
+
old_str: string;
|
|
146
|
+
new_str: string;
|
|
147
|
+
}, {
|
|
148
|
+
type: "bash_code_execution_result";
|
|
149
|
+
stdout: string;
|
|
150
|
+
stderr: string;
|
|
151
|
+
return_code: number;
|
|
152
|
+
} | {
|
|
153
|
+
type: "bash_code_execution_tool_result_error";
|
|
154
|
+
error_code: string;
|
|
155
|
+
} | {
|
|
156
|
+
type: "text_editor_code_execution_tool_result_error";
|
|
157
|
+
error_code: string;
|
|
158
|
+
} | {
|
|
159
|
+
type: "text_editor_code_execution_view_result";
|
|
160
|
+
content: string;
|
|
161
|
+
file_type: string;
|
|
162
|
+
num_lines: number | null;
|
|
163
|
+
start_line: number | null;
|
|
164
|
+
total_lines: number | null;
|
|
165
|
+
} | {
|
|
166
|
+
type: "text_editor_code_execution_create_result";
|
|
167
|
+
is_file_update: boolean;
|
|
168
|
+
} | {
|
|
169
|
+
type: "text_editor_code_execution_str_replace_result";
|
|
170
|
+
lines: string[] | null;
|
|
171
|
+
new_lines: number | null;
|
|
172
|
+
new_start: number | null;
|
|
173
|
+
old_lines: number | null;
|
|
174
|
+
old_start: number | null;
|
|
175
|
+
}>;
|
|
71
176
|
/**
|
|
72
177
|
* Claude can interact with computer environments through the computer use tool, which
|
|
73
178
|
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
@@ -114,6 +219,42 @@ declare const anthropicTools: {
|
|
|
114
219
|
displayHeightPx: number;
|
|
115
220
|
displayNumber?: number;
|
|
116
221
|
}>;
|
|
222
|
+
/**
|
|
223
|
+
* The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
|
|
224
|
+
* Claude can create, read, update, and delete files that persist between sessions,
|
|
225
|
+
* allowing it to build knowledge over time without keeping everything in the context window.
|
|
226
|
+
* The memory tool operates client-side—you control where and how the data is stored through your own infrastructure.
|
|
227
|
+
*
|
|
228
|
+
* Supported models: Claude Sonnet 4.5, Claude Sonnet 4, Claude Opus 4.1, Claude Opus 4.
|
|
229
|
+
*
|
|
230
|
+
* Tool name must be `memory`.
|
|
231
|
+
*/
|
|
232
|
+
memory_20250818: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
233
|
+
command: "view";
|
|
234
|
+
path: string;
|
|
235
|
+
view_range?: [number, number];
|
|
236
|
+
} | {
|
|
237
|
+
command: "create";
|
|
238
|
+
path: string;
|
|
239
|
+
file_text: string;
|
|
240
|
+
} | {
|
|
241
|
+
command: "str_replace";
|
|
242
|
+
path: string;
|
|
243
|
+
old_str: string;
|
|
244
|
+
new_str: string;
|
|
245
|
+
} | {
|
|
246
|
+
command: "insert";
|
|
247
|
+
path: string;
|
|
248
|
+
insert_line: number;
|
|
249
|
+
insert_text: string;
|
|
250
|
+
} | {
|
|
251
|
+
command: "delete";
|
|
252
|
+
path: string;
|
|
253
|
+
} | {
|
|
254
|
+
command: "rename";
|
|
255
|
+
old_path: string;
|
|
256
|
+
new_path: string;
|
|
257
|
+
}, {}>;
|
|
117
258
|
/**
|
|
118
259
|
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
119
260
|
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|