mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-18 15:28:48 +03:00
feat(core): pin read, edit, write, and patch in full Code Mode (#64497)
This commit is contained in:
committed by
GitHub
Unverified
parent
1addb95724
commit
e40057ab84
@@ -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,
|
||||
|
||||
@@ -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 },
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user