Skip to content

Commit 83928cc

Browse files
celestial-vaultElephant LumpsCline Evaluation
authored
Add edit tool definition (RooCodeInc#3939)
* add ls file tool description, parsing, and return formatting * add json tool definition and remove extra '.' * changeset * use separate function for new format * using json * add grep tool new format * add editTool definition * removed changeset * removed changeset --------- Co-authored-by: Elephant Lumps <[email protected]> Co-authored-by: Cline Evaluation <[email protected]>
1 parent 38a1179 commit 83928cc

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

src/core/tools/editTool.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { ToolDefinition } from "@core/prompts/model_prompts/jsonToolToXml"
2+
3+
export const editToolDefinition: ToolDefinition = {
4+
name: "MultiEdit",
5+
descriptionForAgent:
6+
"Makes multiple changes to a single file in one operation. Use this tool to edit files by providing the exact text to replace and the new text.",
7+
inputSchema: {
8+
type: "object",
9+
properties: {
10+
file_path: {
11+
type: "string",
12+
description: "Absolute path to the file to modify",
13+
},
14+
edits: {
15+
type: "array",
16+
description: "Array of edit operations, each containing old_string and new_string",
17+
items: {
18+
type: "object",
19+
properties: {
20+
old_string: {
21+
type: "string",
22+
description: "Exact text to replace",
23+
},
24+
new_string: {
25+
type: "string",
26+
description: "The replacement text",
27+
},
28+
},
29+
required: ["old_string", "new_string"],
30+
},
31+
},
32+
},
33+
required: ["file_path", "edits"],
34+
},
35+
}

0 commit comments

Comments
 (0)