@ai-sdk/anthropic 3.0.30 → 3.0.32
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 +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +5 -0
- package/dist/internal/index.d.ts +5 -0
- package/dist/internal/index.js +4 -0
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +4 -0
- package/dist/internal/index.mjs.map +1 -1
- package/docs/05-anthropic.mdx +3 -2
- package/package.json +3 -3
- package/src/tool/text-editor_20241022.ts +7 -1
- package/src/tool/text-editor_20250124.ts +7 -1
- package/src/tool/text-editor_20250429.ts +7 -1
- package/src/tool/text-editor_20250728.ts +7 -1
package/docs/05-anthropic.mdx
CHANGED
|
@@ -499,7 +499,7 @@ The Text Editor Tool provides functionality for viewing and editing text files.
|
|
|
499
499
|
const tools = {
|
|
500
500
|
str_replace_based_edit_tool: anthropic.tools.textEditor_20250728({
|
|
501
501
|
maxCharacters: 10000, // optional
|
|
502
|
-
async execute({ command, path, old_str, new_str }) {
|
|
502
|
+
async execute({ command, path, old_str, new_str, insert_text }) {
|
|
503
503
|
// ...
|
|
504
504
|
},
|
|
505
505
|
}),
|
|
@@ -523,7 +523,8 @@ Parameters:
|
|
|
523
523
|
- `path` (string): Absolute path to file or directory, e.g. `/repo/file.py` or `/repo`.
|
|
524
524
|
- `file_text` (string, optional): Required for `create` command, with the content of the file to be created.
|
|
525
525
|
- `insert_line` (number, optional): Required for `insert` command. The line number after which to insert the new string.
|
|
526
|
-
- `new_str` (string, optional): New string for `str_replace`
|
|
526
|
+
- `new_str` (string, optional): New string for `str_replace` command.
|
|
527
|
+
- `insert_text` (string, optional): Required for `insert` command, containing the text to insert.
|
|
527
528
|
- `old_str` (string, optional): Required for `str_replace` command, containing the string to replace.
|
|
528
529
|
- `view_range` (number[], optional): Optional for `view` command to specify line range to show.
|
|
529
530
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/anthropic",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.32",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@ai-sdk/provider": "3.0.
|
|
40
|
-
"@ai-sdk/provider-utils": "4.0.
|
|
39
|
+
"@ai-sdk/provider": "3.0.6",
|
|
40
|
+
"@ai-sdk/provider-utils": "4.0.11"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "20.17.24",
|
|
@@ -13,6 +13,7 @@ const textEditor_20241022InputSchema = lazySchema(() =>
|
|
|
13
13
|
file_text: z.string().optional(),
|
|
14
14
|
insert_line: z.number().int().optional(),
|
|
15
15
|
new_str: z.string().optional(),
|
|
16
|
+
insert_text: z.string().optional(),
|
|
16
17
|
old_str: z.string().optional(),
|
|
17
18
|
view_range: z.array(z.number().int()).optional(),
|
|
18
19
|
}),
|
|
@@ -42,10 +43,15 @@ export const textEditor_20241022 = createProviderToolFactory<
|
|
|
42
43
|
insert_line?: number;
|
|
43
44
|
|
|
44
45
|
/**
|
|
45
|
-
* Optional parameter of `str_replace` command containing the new string (if not given, no string will be added).
|
|
46
|
+
* Optional parameter of `str_replace` command containing the new string (if not given, no string will be added).
|
|
46
47
|
*/
|
|
47
48
|
new_str?: string;
|
|
48
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Required parameter of `insert` command containing the text to insert.
|
|
52
|
+
*/
|
|
53
|
+
insert_text?: string;
|
|
54
|
+
|
|
49
55
|
/**
|
|
50
56
|
* Required parameter of `str_replace` command containing the string in `path` to replace.
|
|
51
57
|
*/
|
|
@@ -13,6 +13,7 @@ const textEditor_20250124InputSchema = lazySchema(() =>
|
|
|
13
13
|
file_text: z.string().optional(),
|
|
14
14
|
insert_line: z.number().int().optional(),
|
|
15
15
|
new_str: z.string().optional(),
|
|
16
|
+
insert_text: z.string().optional(),
|
|
16
17
|
old_str: z.string().optional(),
|
|
17
18
|
view_range: z.array(z.number().int()).optional(),
|
|
18
19
|
}),
|
|
@@ -42,10 +43,15 @@ export const textEditor_20250124 = createProviderToolFactory<
|
|
|
42
43
|
insert_line?: number;
|
|
43
44
|
|
|
44
45
|
/**
|
|
45
|
-
* Optional parameter of `str_replace` command containing the new string (if not given, no string will be added).
|
|
46
|
+
* Optional parameter of `str_replace` command containing the new string (if not given, no string will be added).
|
|
46
47
|
*/
|
|
47
48
|
new_str?: string;
|
|
48
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Required parameter of `insert` command containing the text to insert.
|
|
52
|
+
*/
|
|
53
|
+
insert_text?: string;
|
|
54
|
+
|
|
49
55
|
/**
|
|
50
56
|
* Required parameter of `str_replace` command containing the string in `path` to replace.
|
|
51
57
|
*/
|
|
@@ -13,6 +13,7 @@ const textEditor_20250429InputSchema = lazySchema(() =>
|
|
|
13
13
|
file_text: z.string().optional(),
|
|
14
14
|
insert_line: z.number().int().optional(),
|
|
15
15
|
new_str: z.string().optional(),
|
|
16
|
+
insert_text: z.string().optional(),
|
|
16
17
|
old_str: z.string().optional(),
|
|
17
18
|
view_range: z.array(z.number().int()).optional(),
|
|
18
19
|
}),
|
|
@@ -43,10 +44,15 @@ export const textEditor_20250429 = createProviderToolFactory<
|
|
|
43
44
|
insert_line?: number;
|
|
44
45
|
|
|
45
46
|
/**
|
|
46
|
-
* Optional parameter of `str_replace` command containing the new string (if not given, no string will be added).
|
|
47
|
+
* Optional parameter of `str_replace` command containing the new string (if not given, no string will be added).
|
|
47
48
|
*/
|
|
48
49
|
new_str?: string;
|
|
49
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Required parameter of `insert` command containing the text to insert.
|
|
53
|
+
*/
|
|
54
|
+
insert_text?: string;
|
|
55
|
+
|
|
50
56
|
/**
|
|
51
57
|
* Required parameter of `str_replace` command containing the string in `path` to replace.
|
|
52
58
|
*/
|
|
@@ -18,6 +18,7 @@ const textEditor_20250728InputSchema = lazySchema(() =>
|
|
|
18
18
|
file_text: z.string().optional(),
|
|
19
19
|
insert_line: z.number().int().optional(),
|
|
20
20
|
new_str: z.string().optional(),
|
|
21
|
+
insert_text: z.string().optional(),
|
|
21
22
|
old_str: z.string().optional(),
|
|
22
23
|
view_range: z.array(z.number().int()).optional(),
|
|
23
24
|
}),
|
|
@@ -48,10 +49,15 @@ const factory = createProviderToolFactory<
|
|
|
48
49
|
insert_line?: number;
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
|
-
* Optional parameter of `str_replace` command containing the new string (if not given, no string will be added).
|
|
52
|
+
* Optional parameter of `str_replace` command containing the new string (if not given, no string will be added).
|
|
52
53
|
*/
|
|
53
54
|
new_str?: string;
|
|
54
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Required parameter of `insert` command containing the text to insert.
|
|
58
|
+
*/
|
|
59
|
+
insert_text?: string;
|
|
60
|
+
|
|
55
61
|
/**
|
|
56
62
|
* Required parameter of `str_replace` command containing the string in `path` to replace.
|
|
57
63
|
*/
|