feat(core): pin read, edit, write, and patch in full Code Mode (#64497)

This commit is contained in:
Aiden Cline
2026-11-17 14:39:55 -06:00
committed by GitHub
Unverified
parent 1addb95724
commit e40057ab84
4 changed files with 10 additions and 4 deletions
+3 -1
View File
@@ -272,7 +272,9 @@ export const Plugin = {
.transform((editor) =>
editor.add({
name,
options: { codemode: flags.resolve(loaded.entries).full_codemode.enabled, permission: "edit" },
options: flags.resolve(loaded.entries).full_codemode.enabled
? { codemode: true, pinned: true, permission: "edit" }
: { codemode: false, permission: "edit" },
description:
"Edit the contents of a file by finding and replacing exact text. When editing text from Read output, preserve the exact indentation (tabs or spaces) and omit the line-number prefix, such as `1: `. Never include the prefix in oldString or newString. Write line breaks as \\n; the file's existing CRLF or LF line endings are matched and preserved. To change line endings themselves, make oldString and newString differ only in \\r; that edit applies to the exact bytes. If there is no exact match, the edit retries while ignoring typographic quote, dash, and space variants, then trailing whitespace on each line. The edit fails if oldString is not found. By default, oldString must identify a UNIQUE location. Multiple matches FAIL unless replaceAll is true. Add more surrounding context to disambiguate, or set replaceAll to true to replace every occurrence. Use replaceAll when the change should apply to every occurrence, such as renaming a variable.",
input: Input,
+3 -1
View File
@@ -68,7 +68,9 @@ export const Plugin = {
.transform((editor) =>
editor.add({
name,
options: { codemode: flags.resolve(loaded.entries).full_codemode.enabled, permission: "edit" },
options: flags.resolve(loaded.entries).full_codemode.enabled
? { codemode: true, pinned: true, permission: "edit" }
: { codemode: false, permission: "edit" },
description: DESCRIPTION,
input: Input,
freeform: { type: "lark", grammar: GRAMMAR },
+1 -1
View File
@@ -53,7 +53,7 @@ export const Plugin = {
const codeMode = flags.resolve(loaded.entries).full_codemode.enabled
editor.add({
name,
options: { codemode: codeMode },
options: codeMode ? { codemode: true, pinned: true } : { codemode: false },
description: [
"Read the contents of a file or directory. Supports text files, images, and PDFs.",
...(codeMode
+3 -1
View File
@@ -44,7 +44,9 @@ export const Plugin = {
.transform((editor) =>
editor.add({
name,
options: { codemode: flags.resolve(loaded.entries).full_codemode.enabled, permission: "edit" },
options: flags.resolve(loaded.entries).full_codemode.enabled
? { codemode: true, pinned: true, permission: "edit" }
: { codemode: false, permission: "edit" },
description:
"Writes a file to the local filesystem, overwriting if one exists.\n\nMissing parent directories are created automatically.\n\nUse this tool to create new files or overwrite existing files. For partial changes, use the edit tool instead.",
input: Input,