You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/core/prompts/sections/rules.ts
+7-10Lines changed: 7 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -13,19 +13,22 @@ function getEditingInstructions(diffStrategy?: DiffStrategy, experiments?: Recor
13
13
}else{
14
14
availableTools.push("write_to_file (for creating new files or complete file rewrites)")
15
15
}
16
+
17
+
availableTools.push("append_to_file (for appending content to the end of files)")
18
+
16
19
if(experiments?.["insert_content"]){
17
20
availableTools.push("insert_content (for adding lines to existing files)")
18
21
}
19
-
if(experiments?.["append_to_file"]){
20
-
availableTools.push("append_to_file (for appending content to the end of files)")
21
-
}
22
22
if(experiments?.["search_and_replace"]){
23
23
availableTools.push("search_and_replace (for finding and replacing individual pieces of text)")
24
24
}
25
25
26
26
// Base editing instruction mentioning all available tools
27
27
if(availableTools.length>1){
28
-
instructions.push(`- For editing files, you have access to these tools: ${availableTools.join(", ")}.`)
28
+
instructions.push(
29
+
`- For editing files, you have access to these tools: ${availableTools.join(", ")}.`,
30
+
"- The append_to_file tool adds content to the end of files, such as appending new log entries or adding new data records. This tool will always add the content at the end of the file.",
31
+
)
29
32
}
30
33
31
34
// Additional details for experimental features
@@ -35,12 +38,6 @@ function getEditingInstructions(diffStrategy?: DiffStrategy, experiments?: Recor
35
38
)
36
39
}
37
40
38
-
if(experiments?.["append_to_file"]){
39
-
instructions.push(
40
-
"- The append_to_file tool adds content to the end of files, such as appending new log entries or adding new data records. This tool will always add the content at the end of the file.",
41
-
)
42
-
}
43
-
44
41
if(experiments?.["search_and_replace"]){
45
42
instructions.push(
46
43
"- The search_and_replace tool finds and replaces text or regex in files. This tool allows you to search for a specific regex pattern or text and replace it with another value. Be cautious when using this tool to ensure you are replacing the correct text. It can support multiple operations at once.",
0 commit comments