mirror of
https://fastgit.cc/https://github.com/anomalyco/opencode
synced 2026-04-23 18:36:59 +08:00
chore: kill unused tool (#23701)
This commit is contained in:
@@ -224,7 +224,6 @@ These tools mostly use direct getters for path resolution and repo-relative disp
|
||||
- `src/tool/bash.ts`
|
||||
- `src/tool/edit.ts`
|
||||
- `src/tool/lsp.ts`
|
||||
- `src/tool/multiedit.ts`
|
||||
- `src/tool/plan.ts`
|
||||
- `src/tool/read.ts`
|
||||
- `src/tool/write.ts`
|
||||
|
||||
@@ -216,7 +216,6 @@ emitted JSON Schema must stay byte-identical.
|
||||
- [ ] `src/tool/grep.ts`
|
||||
- [ ] `src/tool/invalid.ts`
|
||||
- [ ] `src/tool/lsp.ts`
|
||||
- [ ] `src/tool/multiedit.ts`
|
||||
- [ ] `src/tool/plan.ts`
|
||||
- [ ] `src/tool/question.ts`
|
||||
- [ ] `src/tool/read.ts`
|
||||
|
||||
@@ -46,7 +46,6 @@ These exported tool definitions currently use `Tool.define(...)` in `src/tool`:
|
||||
- [x] `grep.ts`
|
||||
- [x] `invalid.ts`
|
||||
- [x] `lsp.ts`
|
||||
- [x] `multiedit.ts`
|
||||
- [x] `plan.ts`
|
||||
- [x] `question.ts`
|
||||
- [x] `read.ts`
|
||||
@@ -82,7 +81,6 @@ Notable items that are already effectively on the target path and do not need se
|
||||
- `write.ts`
|
||||
- `codesearch.ts`
|
||||
- `websearch.ts`
|
||||
- `multiedit.ts`
|
||||
- `edit.ts`
|
||||
|
||||
## Filesystem notes
|
||||
|
||||
@@ -93,7 +93,7 @@ const normalize = (agent: z.infer<typeof Info>) => {
|
||||
const permission: ConfigPermission.Info = {}
|
||||
for (const [tool, enabled] of Object.entries(agent.tools ?? {})) {
|
||||
const action = enabled ? "allow" : "deny"
|
||||
if (tool === "write" || tool === "edit" || tool === "patch" || tool === "multiedit") {
|
||||
if (tool === "write" || tool === "edit" || tool === "patch") {
|
||||
permission.edit = action
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -660,7 +660,7 @@ export const layer = Layer.effect(
|
||||
const perms: Record<string, ConfigPermission.Action> = {}
|
||||
for (const [tool, enabled] of Object.entries(result.tools)) {
|
||||
const action: ConfigPermission.Action = enabled ? "allow" : "deny"
|
||||
if (tool === "write" || tool === "edit" || tool === "patch" || tool === "multiedit") {
|
||||
if (tool === "write" || tool === "edit" || tool === "patch") {
|
||||
perms.edit = action
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -307,7 +307,7 @@ export function merge(...rulesets: Ruleset[]): Ruleset {
|
||||
return rulesets.flat()
|
||||
}
|
||||
|
||||
const EDIT_TOOLS = ["edit", "write", "apply_patch", "multiedit"]
|
||||
const EDIT_TOOLS = ["edit", "write", "apply_patch"]
|
||||
|
||||
export function disabled(tools: string[], ruleset: Ruleset): Set<string> {
|
||||
const result = new Set<string>()
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
import z from "zod"
|
||||
import { Effect } from "effect"
|
||||
import * as Tool from "./tool"
|
||||
import { EditTool } from "./edit"
|
||||
import DESCRIPTION from "./multiedit.txt"
|
||||
import path from "path"
|
||||
import { Instance } from "../project/instance"
|
||||
|
||||
export const MultiEditTool = Tool.define(
|
||||
"multiedit",
|
||||
Effect.gen(function* () {
|
||||
const editInfo = yield* EditTool
|
||||
const edit = yield* editInfo.init()
|
||||
|
||||
return {
|
||||
description: DESCRIPTION,
|
||||
parameters: z.object({
|
||||
filePath: z.string().describe("The absolute path to the file to modify"),
|
||||
edits: z
|
||||
.array(
|
||||
z.object({
|
||||
filePath: z.string().describe("The absolute path to the file to modify"),
|
||||
oldString: z.string().describe("The text to replace"),
|
||||
newString: z.string().describe("The text to replace it with (must be different from oldString)"),
|
||||
replaceAll: z.boolean().optional().describe("Replace all occurrences of oldString (default false)"),
|
||||
}),
|
||||
)
|
||||
.describe("Array of edit operations to perform sequentially on the file"),
|
||||
}),
|
||||
execute: (
|
||||
params: {
|
||||
filePath: string
|
||||
edits: Array<{ filePath: string; oldString: string; newString: string; replaceAll?: boolean }>
|
||||
},
|
||||
ctx: Tool.Context,
|
||||
) =>
|
||||
Effect.gen(function* () {
|
||||
const results = []
|
||||
for (const [, entry] of params.edits.entries()) {
|
||||
const result = yield* edit.execute(
|
||||
{
|
||||
filePath: params.filePath,
|
||||
oldString: entry.oldString,
|
||||
newString: entry.newString,
|
||||
replaceAll: entry.replaceAll,
|
||||
},
|
||||
ctx,
|
||||
)
|
||||
results.push(result)
|
||||
}
|
||||
return {
|
||||
title: path.relative(Instance.worktree, params.filePath),
|
||||
metadata: {
|
||||
results: results.map((r) => r.metadata),
|
||||
},
|
||||
output: results.at(-1)!.output,
|
||||
}
|
||||
}),
|
||||
}
|
||||
}),
|
||||
)
|
||||
@@ -1,41 +0,0 @@
|
||||
This is a tool for making multiple edits to a single file in one operation. It is built on top of the Edit tool and allows you to perform multiple find-and-replace operations efficiently. Prefer this tool over the Edit tool when you need to make multiple edits to the same file.
|
||||
|
||||
Before using this tool:
|
||||
|
||||
1. Use the Read tool to understand the file's contents and context
|
||||
2. Verify the directory path is correct
|
||||
|
||||
To make multiple file edits, provide the following:
|
||||
1. file_path: The absolute path to the file to modify (must be absolute, not relative)
|
||||
2. edits: An array of edit operations to perform, where each edit contains:
|
||||
- oldString: The text to replace (must match the file contents exactly, including all whitespace and indentation)
|
||||
- newString: The edited text to replace the oldString
|
||||
- replaceAll: Replace all occurrences of oldString. This parameter is optional and defaults to false.
|
||||
|
||||
IMPORTANT:
|
||||
- All edits are applied in sequence, in the order they are provided
|
||||
- Each edit operates on the result of the previous edit
|
||||
- All edits must be valid for the operation to succeed - if any edit fails, none will be applied
|
||||
- This tool is ideal when you need to make several changes to different parts of the same file
|
||||
|
||||
CRITICAL REQUIREMENTS:
|
||||
1. All edits follow the same requirements as the single Edit tool
|
||||
2. The edits are atomic - either all succeed or none are applied
|
||||
3. Plan your edits carefully to avoid conflicts between sequential operations
|
||||
|
||||
WARNING:
|
||||
- The tool will fail if edits.oldString doesn't match the file contents exactly (including whitespace)
|
||||
- The tool will fail if edits.oldString and edits.newString are the same
|
||||
- Since edits are applied in sequence, ensure that earlier edits don't affect the text that later edits are trying to find
|
||||
|
||||
When making edits:
|
||||
- Ensure all edits result in idiomatic, correct code
|
||||
- Do not leave the code in a broken state
|
||||
- Always use absolute file paths (starting with /)
|
||||
- Only use emojis if the user explicitly requests it. Avoid adding emojis to files unless asked.
|
||||
- Use replaceAll for replacing and renaming strings across the file. This parameter is useful if you want to rename a variable for instance.
|
||||
|
||||
If you want to create a new file, use:
|
||||
- A new file path, including dir name if needed
|
||||
- First edit: empty oldString and the new file's contents as newString
|
||||
- Subsequent edits: normal edit operations on the created content
|
||||
@@ -474,7 +474,7 @@ test("legacy tools config converts to permissions", async () => {
|
||||
})
|
||||
})
|
||||
|
||||
test("legacy tools config maps write/edit/patch/multiedit to edit permission", async () => {
|
||||
test("legacy tools config maps write/edit/patch to edit permission", async () => {
|
||||
await using tmp = await tmpdir({
|
||||
config: {
|
||||
agent: {
|
||||
|
||||
@@ -1427,35 +1427,6 @@ test("migrates legacy patch tool to edit permission", async () => {
|
||||
})
|
||||
})
|
||||
|
||||
test("migrates legacy multiedit tool to edit permission", async () => {
|
||||
await using tmp = await tmpdir({
|
||||
init: async (dir) => {
|
||||
await Filesystem.write(
|
||||
path.join(dir, "opencode.json"),
|
||||
JSON.stringify({
|
||||
$schema: "https://opencode.ai/config.json",
|
||||
agent: {
|
||||
test: {
|
||||
tools: {
|
||||
multiedit: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
)
|
||||
},
|
||||
})
|
||||
await Instance.provide({
|
||||
directory: tmp.path,
|
||||
fn: async () => {
|
||||
const config = await load()
|
||||
expect(config.agent?.["test"]?.permission).toEqual({
|
||||
edit: "deny",
|
||||
})
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
test("migrates mixed legacy tools config", async () => {
|
||||
await using tmp = await tmpdir({
|
||||
init: async (dir) => {
|
||||
|
||||
@@ -422,9 +422,9 @@ test("disabled - disables tool when denied", () => {
|
||||
expect(result.has("read")).toBe(false)
|
||||
})
|
||||
|
||||
test("disabled - disables edit/write/apply_patch/multiedit when edit denied", () => {
|
||||
test("disabled - disables edit/write/apply_patch when edit denied", () => {
|
||||
const result = Permission.disabled(
|
||||
["edit", "write", "apply_patch", "multiedit", "bash"],
|
||||
["edit", "write", "apply_patch", "bash"],
|
||||
[
|
||||
{ permission: "*", pattern: "*", action: "allow" },
|
||||
{ permission: "edit", pattern: "*", action: "deny" },
|
||||
@@ -433,7 +433,6 @@ test("disabled - disables edit/write/apply_patch/multiedit when edit denied", ()
|
||||
expect(result.has("edit")).toBe(true)
|
||||
expect(result.has("write")).toBe(true)
|
||||
expect(result.has("apply_patch")).toBe(true)
|
||||
expect(result.has("multiedit")).toBe(true)
|
||||
expect(result.has("bash")).toBe(false)
|
||||
})
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ description: تحكّم في الإجراءات التي تتطلب موافقة
|
||||
تُعرَّف أذونات OpenCode بأسماء الأدوات، بالإضافة إلى بعض حواجز الأمان:
|
||||
|
||||
- `read` — قراءة ملف (يطابق مسار الملف)
|
||||
- `edit` — جميع تعديلات الملفات (يشمل `edit` و`write` و`patch` و`multiedit`)
|
||||
- `edit` — جميع تعديلات الملفات (يشمل `edit` و`write` و`patch`)
|
||||
- `glob` — مطابقة أسماء الملفات (يطابق نمط الـ glob)
|
||||
- `grep` — البحث في المحتوى (يطابق نمط regex)
|
||||
- `bash` — تشغيل أوامر shell (يطابق الأوامر المُحلَّلة مثل `git status --porcelain`)
|
||||
|
||||
@@ -95,7 +95,7 @@ description: إدارة الأدوات التي يمكن لـ LLM استخدام
|
||||
استخدم هذا للسماح لـ LLM بإنشاء ملفات جديدة. سيكتب فوق الملفات الموجودة إذا كانت موجودة بالفعل.
|
||||
|
||||
:::note
|
||||
تُدار أداة `write` عبر إذن `edit`، والذي يشمل جميع تعديلات الملفات (`edit` و`write` و`patch` و`multiedit`).
|
||||
تُدار أداة `write` عبر إذن `edit`، والذي يشمل جميع تعديلات الملفات (`edit` و`write` و`patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
@@ -190,7 +190,7 @@ description: إدارة الأدوات التي يمكن لـ LLM استخدام
|
||||
تطبق هذه الأداة ملفات الرقع على قاعدة الشفرة الخاصة بك. وهي مفيدة لتطبيق الفروقات (Diffs) والرقع من مصادر متعددة.
|
||||
|
||||
:::note
|
||||
تُدار أداة `patch` عبر إذن `edit`، والذي يشمل جميع تعديلات الملفات (`edit` و`write` و`patch` و`multiedit`).
|
||||
تُدار أداة `patch` عبر إذن `edit`، والذي يشمل جميع تعديلات الملفات (`edit` و`write` و`patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
@@ -125,7 +125,7 @@ Držite ovu listu fokusiranom na pouzdane putanje, a dodatna allow/deny pravila
|
||||
Dozvole OpenCode su označene imenom alata, plus nekoliko sigurnosnih mjera:
|
||||
|
||||
- `read` — čitanje datoteke (odgovara putanji datoteke)
|
||||
- `edit` — sve izmjene fajlova (pokriva `edit`, `write`, `patch`, `multiedit`)
|
||||
- `edit` — sve izmjene fajlova (pokriva `edit`, `write`, `patch`)
|
||||
- `glob` — globbiranje fajla (odgovara glob uzorku)
|
||||
- `grep` — pretraga sadržaja (podudara se sa regularnim izrazom)
|
||||
- `bash` — izvođenje komandi ljuske (podudara se s raščlanjenim komandama kao što je `git status --porcelain`)
|
||||
|
||||
@@ -95,7 +95,7 @@ Kreira nove datoteke ili prepisuje postojece.
|
||||
Koristite ovo da dozvolite LLM-u kreiranje novih datoteka. Ako datoteka vec postoji, bit ce prepisana.
|
||||
|
||||
:::note
|
||||
`write` alat kontrolise `edit` dozvola, koja pokriva sve izmjene datoteka (`edit`, `write`, `patch`, `multiedit`).
|
||||
`write` alat kontrolise `edit` dozvola, koja pokriva sve izmjene datoteka (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
@@ -190,7 +190,7 @@ Primjenjuje zakrpe na datoteke.
|
||||
Ovaj alat primjenjuje patch datoteke na kod. Koristan je za diffs i patch-eve iz razlicitih izvora.
|
||||
|
||||
:::note
|
||||
`patch` alat kontrolise `edit` dozvola, koja pokriva sve izmjene datoteka (`edit`, `write`, `patch`, `multiedit`).
|
||||
`patch` alat kontrolise `edit` dozvola, koja pokriva sve izmjene datoteka (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
@@ -130,7 +130,7 @@ Hold listen fokuseret på betroede stier, og lag ekstra tillad eller afvis regle
|
||||
OpenCode tilladelser indtastes efter værktøjsnavn plus et par sikkerhedsafskærmninger:
|
||||
|
||||
- `read` — læser en fil (matcher filstien)
|
||||
- `edit` — alle filændringer (dækker `edit`, `write`, `patch`, `multiedit`)
|
||||
- `edit` — alle filændringer (dækker `edit`, `write`, `patch`)
|
||||
- `glob` — fil-globing (matcher glob-mønsteret)
|
||||
- `grep` — indholdssøgning (matcher regex-mønsteret)
|
||||
- `bash` — kører shell-kommandoer (matcher parsede kommandoer som `git status --porcelain`)
|
||||
|
||||
@@ -95,7 +95,7 @@ Opret nye filer eller overskriv eksisterende.
|
||||
Brug denne for at la LLM lage nye filer. Den vil overskrive eksisterende filer hvis de allerede eksisterer.
|
||||
|
||||
:::note
|
||||
`write`-verktøyet kontrolleres av tillatelsen `edit`, som dekker alle filendringer (`edit`, `write`, `patch`, `multiedit`).
|
||||
`write`-verktøyet kontrolleres av tillatelsen `edit`, som dekker alle filendringer (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
@@ -190,7 +190,7 @@ Brug patcher på filer.
|
||||
Dette verktøyet bruger opdateringsfiler til kodebasen din. Nyttig for at påføre diff og lapper fra forskjellige kilder.
|
||||
|
||||
:::note
|
||||
`patch`-verktøyet kontrolleres av tillatelsen `edit`, som dekker alle filendringer (`edit`, `write`, `patch`, `multiedit`).
|
||||
`patch`-verktøyet kontrolleres av tillatelsen `edit`, som dekker alle filendringer (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
@@ -130,7 +130,7 @@ Konzentrieren Sie sich in der Liste auf vertrauenswürdige Pfade und fügen Sie
|
||||
OpenCode-Berechtigungen basieren auf Tool-Namen sowie einigen Sicherheitsvorkehrungen:
|
||||
|
||||
- `read` – eine Datei lesen (entspricht dem Dateipfad)
|
||||
- `edit` – alle Dateiänderungen (umfasst `edit`, `write`, `patch`, `multiedit`)
|
||||
- `edit` – alle Dateiänderungen (umfasst `edit`, `write`, `patch`)
|
||||
- `glob` – Datei-Globbing (entspricht dem Glob-Muster)
|
||||
- `grep` – Inhaltssuche (entspricht dem Regex-Muster)
|
||||
- `bash` – Ausführen von Shell-Befehlen (entspricht analysierten Befehlen wie `git status --porcelain`)
|
||||
|
||||
@@ -102,7 +102,7 @@ Bestehende Dateien werden dabei ueberschrieben.
|
||||
|
||||
:::note
|
||||
Das Tool `write` wird ueber die Berechtigung `edit` gesteuert.
|
||||
`edit` gilt fuer alle Datei-Aenderungen (`edit`, `write`, `patch`, `multiedit`).
|
||||
`edit` gilt fuer alle Datei-Aenderungen (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
@@ -197,7 +197,7 @@ Wendet Patches auf Dateien an.
|
||||
Dieses Tool wendet Patch-Dateien auf deine Codebasis an. Nuetzlich fuer Diffs und Patches aus verschiedenen Quellen.
|
||||
|
||||
:::note
|
||||
Das Tool `patch` wird ueber die Berechtigung `edit` gesteuert, welche alle Datei-Aenderungen abdeckt (`edit`, `write`, `patch`, `multiedit`).
|
||||
Das Tool `patch` wird ueber die Berechtigung `edit` gesteuert, welche alle Datei-Aenderungen abdeckt (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
@@ -130,7 +130,7 @@ Mantenga la lista centrada en rutas confiables y aplique reglas adicionales de p
|
||||
Los permisos OpenCode están codificados por el nombre de la herramienta, además de un par de medidas de seguridad:
|
||||
|
||||
- `read` — leer un archivo (coincide con la ruta del archivo)
|
||||
- `edit` — todas las modificaciones de archivos (cubre `edit`, `write`, `patch`, `multiedit`)
|
||||
- `edit` — todas las modificaciones de archivos (cubre `edit`, `write`, `patch`)
|
||||
- `glob` — globalización de archivos (coincide con el patrón global)
|
||||
- `grep` — búsqueda de contenido (coincide con el patrón de expresiones regulares)
|
||||
- `bash`: ejecuta comandos de shell (coincide con comandos analizados como `git status --porcelain`)
|
||||
|
||||
@@ -95,7 +95,7 @@ Cree nuevos archivos o sobrescriba los existentes.
|
||||
Utilice esto para permitir que LLM cree nuevos archivos. Sobrescribirá los archivos existentes si ya existen.
|
||||
|
||||
:::note
|
||||
La herramienta `write` está controlada por el permiso `edit`, que cubre todas las modificaciones de archivos (`edit`, `write`, `patch`, `multiedit`).
|
||||
La herramienta `write` está controlada por el permiso `edit`, que cubre todas las modificaciones de archivos (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
@@ -190,7 +190,7 @@ Aplicar parches a los archivos.
|
||||
Esta herramienta aplica archivos de parche a su código base. Útil para aplicar diferencias y parches de diversas fuentes.
|
||||
|
||||
:::note
|
||||
La herramienta `patch` está controlada por el permiso `edit`, que cubre todas las modificaciones de archivos (`edit`, `write`, `patch`, `multiedit`).
|
||||
La herramienta `patch` está controlada por el permiso `edit`, que cubre todas las modificaciones de archivos (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
@@ -130,7 +130,7 @@ Gardez la liste centrée sur les chemins approuvés et superposez des règles d'
|
||||
Les autorisations OpenCode sont classées par nom d'outil, plus quelques garde-fous de sécurité :
|
||||
|
||||
- `read` — lecture d'un fichier (correspond au chemin du fichier)
|
||||
- `edit` — toutes les modifications de fichiers (couvre `edit`, `write`, `patch`, `multiedit`)
|
||||
- `edit` — toutes les modifications de fichiers (couvre `edit`, `write`, `patch`)
|
||||
- `glob` — globalisation de fichiers (correspond au modèle global)
|
||||
- `grep` — recherche de contenu (correspond au modèle regex)
|
||||
- `bash` - exécution de commandes shell (correspond aux commandes analysées comme `git status --porcelain`)
|
||||
|
||||
@@ -95,7 +95,7 @@ Créez de nouveaux fichiers ou écrasez ceux existants.
|
||||
Utilisez-le pour permettre au LLM de créer de nouveaux fichiers. Il écrasera les fichiers existants s'ils existent déjà.
|
||||
|
||||
:::note
|
||||
L'outil `write` est contrôlé par l'autorisation `edit`, qui couvre toutes les modifications de fichiers (`edit`, `write`, `patch`, `multiedit`).
|
||||
L'outil `write` est contrôlé par l'autorisation `edit`, qui couvre toutes les modifications de fichiers (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
@@ -190,7 +190,7 @@ Appliquez des correctifs aux fichiers.
|
||||
Cet outil applique les fichiers de correctifs à votre base de code. Utile pour appliquer des différences et des correctifs provenant de diverses sources.
|
||||
|
||||
:::note
|
||||
L'outil `patch` est contrôlé par l'autorisation `edit`, qui couvre toutes les modifications de fichiers (`edit`, `write`, `patch`, `multiedit`).
|
||||
L'outil `patch` est contrôlé par l'autorisation `edit`, qui couvre toutes les modifications de fichiers (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
@@ -130,7 +130,7 @@ Mantieni l'elenco limitato a percorsi fidati e aggiungi regole extra di allow/de
|
||||
I permessi di OpenCode sono indicizzati per nome dello strumento, piu' un paio di guardrail di sicurezza:
|
||||
|
||||
- `read` — lettura di un file (corrisponde al percorso del file)
|
||||
- `edit` — tutte le modifiche ai file (include `edit`, `write`, `patch`, `multiedit`)
|
||||
- `edit` — tutte le modifiche ai file (include `edit`, `write`, `patch`)
|
||||
- `glob` — ricerca file tramite glob (corrisponde al pattern glob)
|
||||
- `grep` — ricerca nel contenuto (corrisponde al pattern regex)
|
||||
- `bash` — esecuzione comandi di shell (corrisponde a comandi parsati come `git status --porcelain`)
|
||||
|
||||
@@ -95,7 +95,7 @@ Crea nuovi file o sovrascrive quelli esistenti.
|
||||
Usalo per consentire all'LLM di creare nuovi file. Sovrascrivera' i file esistenti se sono gia' presenti.
|
||||
|
||||
:::note
|
||||
Lo strumento `write` e' controllato dal permesso `edit`, che copre tutte le modifiche ai file (`edit`, `write`, `patch`, `multiedit`).
|
||||
Lo strumento `write` e' controllato dal permesso `edit`, che copre tutte le modifiche ai file (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
@@ -190,7 +190,7 @@ Applica patch ai file.
|
||||
Questo strumento applica file patch al tuo codebase. Utile per applicare diff e patch da varie fonti.
|
||||
|
||||
:::note
|
||||
Lo strumento `patch` e' controllato dal permesso `edit`, che copre tutte le modifiche ai file (`edit`, `write`, `patch`, `multiedit`).
|
||||
Lo strumento `patch` e' controllato dal permesso `edit`, che copre tutte le modifiche ai file (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
@@ -130,7 +130,7 @@ OpenCode は `permission` 設定を使用して、特定のアクションを自
|
||||
OpenCode の権限は、ツール名に加えて、いくつかの安全対策によってキー化されます。
|
||||
|
||||
- `read` — ファイルの読み取り (ファイルパスと一致)
|
||||
- `edit` — すべてのファイル変更 (`edit`、`write`、`patch`、`multiedit` をカバー)
|
||||
- `edit` — すべてのファイル変更 (`edit`、`write`、`patch` をカバー)
|
||||
- `glob` — ファイルのグロビング (グロブパターンと一致)
|
||||
- `grep` — コンテンツ検索 (正規表現パターンと一致)
|
||||
- `bash` — シェルコマンドの実行 (`git status --porcelain` などの解析されたコマンドと一致します)
|
||||
|
||||
@@ -95,7 +95,7 @@ OpenCode で利用可能なすべての組み込みツールを次に示しま
|
||||
これを使用して、LLM が新しいファイルを作成できるようにします。既存のファイルがすでに存在する場合は上書きされます。
|
||||
|
||||
:::note
|
||||
`write` ツールは、すべてのファイル変更 (`edit`、`edit`、`write`、`patch`) をカバーする `multiedit` 権限によって制御されます。
|
||||
`write` ツールは、すべてのファイル変更 (`edit`、`write`、`patch`) をカバーする `edit` 権限によって制御されます。
|
||||
:::
|
||||
|
||||
---
|
||||
@@ -190,7 +190,7 @@ OpenCode で利用可能なすべての組み込みツールを次に示しま
|
||||
このツールは、コードベースにパッチファイルを適用します。さまざまなソースからの差分やパッチを適用するのに役立ちます。
|
||||
|
||||
:::note
|
||||
`patch` ツールは、すべてのファイル変更 (`edit`、`edit`、`write`、`patch`) をカバーする `multiedit` 権限によって制御されます。
|
||||
`patch` ツールは、すべてのファイル変更 (`edit`、`write`、`patch`) をカバーする `edit` 権限によって制御されます。
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
@@ -130,7 +130,7 @@ Permission 본 사용 간단한 wildcard 일치:
|
||||
opencode 권한은 도구 이름에 의해 키 입력되며, 두 개의 안전 가드 :
|
||||
|
||||
- `read` - 파일 읽기 (파일 경로의 매칭)
|
||||
- `edit` - 모든 파일 수정 (covers `edit`, `write`, `patch`, `multiedit`)
|
||||
- `edit` - 모든 파일 수정 (covers `edit`, `write`, `patch`)
|
||||
- `glob` - 파일 globbing (glob 패턴 매칭)
|
||||
- `grep` - 콘텐츠 검색 ( regex 패턴 매칭)
|
||||
- `bash` - shell 명령 실행 (`git status --porcelain`와 같은 팟 명령)
|
||||
|
||||
@@ -95,7 +95,7 @@ description: LLM이 사용할 수 있는 도구를 관리합니다.
|
||||
LLM을 사용하여 새 파일을 만듭니다. 이미 존재하는 경우 기존 파일을 덮어쓰겠습니다.
|
||||
|
||||
:::note
|
||||
`write` 공구는 모든 파일 수정 (`edit`, `write`, `patch`, `multiedit`)를 포함하는 `edit` 허가에 의해 통제됩니다.
|
||||
`write` 공구는 모든 파일 수정 (`edit`, `write`, `patch`)를 포함하는 `edit` 허가에 의해 통제됩니다.
|
||||
:::
|
||||
|
||||
---
|
||||
@@ -190,7 +190,7 @@ LSP 서버가 프로젝트에 사용할 수 있는 구성하려면 [LSP Servers]
|
||||
이 도구는 코드베이스에 패치 파일을 적용합니다. 다양한 소스에서 diffs 및 Patch를 적용하는 데 유용합니다.
|
||||
|
||||
:::note
|
||||
`patch` 공구는 모든 파일 수정 (`edit`, `write`, `patch`, `multiedit`)를 포함하는 `edit` 허가에 의해 통제됩니다.
|
||||
`patch` 공구는 모든 파일 수정 (`edit`, `write`, `patch`)를 포함하는 `edit` 허가에 의해 통제됩니다.
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
@@ -130,7 +130,7 @@ Hold listen fokusert på klarerte baner, og lag ekstra tillat eller avslå regle
|
||||
OpenCode-tillatelser tastes inn etter verktøynavn, pluss et par sikkerhetsvakter:
|
||||
|
||||
- `read` — lesing av en fil (tilsvarer filbanen)
|
||||
- `edit` — alle filendringer (dekker `edit`, `write`, `patch`, `multiedit`)
|
||||
- `edit` — alle filendringer (dekker `edit`, `write`, `patch`)
|
||||
- `glob` — fil-globing (tilsvarer glob-mønsteret)
|
||||
- `grep` — innholdssøk (samsvarer med regex-mønsteret)
|
||||
- `bash` — kjører skallkommandoer (matcher analyserte kommandoer som `git status --porcelain`)
|
||||
|
||||
@@ -95,7 +95,7 @@ Opprett nye filer eller overskriv eksisterende.
|
||||
Bruk denne for å la LLM lage nye filer. Den vil overskrive eksisterende filer hvis de allerede eksisterer.
|
||||
|
||||
:::note
|
||||
`write`-verktøyet kontrolleres av tillatelsen `edit`, som dekker alle filendringer (`edit`, `write`, `patch`, `multiedit`).
|
||||
`write`-verktøyet kontrolleres av tillatelsen `edit`, som dekker alle filendringer (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
@@ -190,7 +190,7 @@ Bruk patcher på filer.
|
||||
Dette verktøyet bruker oppdateringsfiler til kodebasen din. Nyttig for å påføre diffs og patcher fra forskjellige kilder.
|
||||
|
||||
:::note
|
||||
`patch`-verktøyet kontrolleres av tillatelsen `edit`, som dekker alle filendringer (`edit`, `write`, `patch`, `multiedit`).
|
||||
`patch`-verktøyet kontrolleres av tillatelsen `edit`, som dekker alle filendringer (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
@@ -130,7 +130,7 @@ Keep the list focused on trusted paths, and layer extra allow or deny rules as n
|
||||
OpenCode permissions are keyed by tool name, plus a couple of safety guards:
|
||||
|
||||
- `read` — reading a file (matches the file path)
|
||||
- `edit` — all file modifications (covers `edit`, `write`, `patch`, `multiedit`)
|
||||
- `edit` — all file modifications (covers `edit`, `write`, `patch`)
|
||||
- `glob` — file globbing (matches the glob pattern)
|
||||
- `grep` — content search (matches the regex pattern)
|
||||
- `bash` — running shell commands (matches parsed commands like `git status --porcelain`)
|
||||
|
||||
@@ -130,7 +130,7 @@ Skoncentruj listę na zaufanych ścieżkach i dodaj dodatkowe zezwolenie lub odm
|
||||
Uprawnienia opencode są określane na podstawie nazwy narzędzia i kilku zabezpieczeń:
|
||||
|
||||
- `read` — odczyt pliku (odpowiada ścieżce pliku)
|
||||
- `edit` — wszystkie modyfikacje plików (obejmuje `edit`, `write`, `patch`, `multiedit`)
|
||||
- `edit` — wszystkie modyfikacje plików (obejmuje `edit`, `write`, `patch`)
|
||||
- `glob` — maglowanie plików (pasuje do wzorców globowania)
|
||||
- `grep` — wyszukiwanie treści (pasuje do wzorca regularnego)
|
||||
- `bash` — uruchamianie poleceń shell (pasuje do poleceń przeanalizowanych, takich jak `git status --porcelain`)
|
||||
|
||||
@@ -95,7 +95,7 @@ Twórz nowe pliki lub nadpisuj istniejące.
|
||||
Użyj tego, aby umożliwić LLM tworzenie nowych plików. Zastąpi istniejące pliki, jeśli już istnieją.
|
||||
|
||||
:::note
|
||||
Narzędzie `write` jest kontrolowane przez uprawnienie `edit`, które obejmuje wszystkie modyfikacje plików (`edit`, `write`, `patch`, `multiedit`).
|
||||
Narzędzie `write` jest kontrolowane przez uprawnienie `edit`, które obejmuje wszystkie modyfikacje plików (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
@@ -190,7 +190,7 @@ Stosuj łatki (patches) do plików.
|
||||
To narzędzie stosuje pliki różnicowe (diffs) do bazy kodu. Przydatne do stosowania zmian z różnych źródeł.
|
||||
|
||||
:::note
|
||||
Narzędzie `patch` jest kontrolowane przez uprawnienie `edit`, które obejmuje wszystkie modyfikacje plików (`edit`, `write`, `patch`, `multiedit`).
|
||||
Narzędzie `patch` jest kontrolowane przez uprawnienie `edit`, które obejmuje wszystkie modyfikacje plików (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
@@ -130,7 +130,7 @@ Mantenha a lista focada em caminhos confiáveis e adicione regras adicionais de
|
||||
As permissões do opencode são indexadas pelo nome da ferramenta, além de alguns guardas de segurança:
|
||||
|
||||
- `read` — leitura de um arquivo (corresponde ao caminho do arquivo)
|
||||
- `edit` — todas as modificações de arquivo (cobre `edit`, `write`, `patch`, `multiedit`)
|
||||
- `edit` — todas as modificações de arquivo (cobre `edit`, `write`, `patch`)
|
||||
- `glob` — globbing de arquivos (corresponde ao padrão glob)
|
||||
- `grep` — busca de conteúdo (corresponde ao padrão regex)
|
||||
- `bash` — execução de comandos de shell (corresponde a comandos analisados como `git status --porcelain`)
|
||||
|
||||
@@ -95,7 +95,7 @@ Crie novos arquivos ou sobrescreva os existentes.
|
||||
Use isso para permitir que o LLM crie novos arquivos. Ele sobrescreverá arquivos existentes se já existirem.
|
||||
|
||||
:::note
|
||||
A ferramenta `write` é controlada pela permissão `edit`, que cobre todas as modificações de arquivos (`edit`, `write`, `patch`, `multiedit`).
|
||||
A ferramenta `write` é controlada pela permissão `edit`, que cobre todas as modificações de arquivos (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
@@ -190,7 +190,7 @@ Aplique patches a arquivos.
|
||||
Esta ferramenta aplica arquivos de patch à sua base de código. Útil para aplicar diffs e patches de várias fontes.
|
||||
|
||||
:::note
|
||||
A ferramenta `patch` é controlada pela permissão `edit`, que cobre todas as modificações de arquivos (`edit`, `write`, `patch`, `multiedit`).
|
||||
A ferramenta `patch` é controlada pela permissão `edit`, que cobre todas as modificações de arquivos (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
@@ -130,7 +130,7 @@ opencode использует конфигурацию `permission`, чтобы
|
||||
Разрешения opencode привязаны к имени инструмента, а также к нескольким мерам безопасности:
|
||||
|
||||
- `read` — чтение файла (соответствует пути к файлу)
|
||||
- `edit` — все модификации файлов (охватывает `edit`, `write`, `patch`, `multiedit`)
|
||||
- `edit` — все модификации файлов (охватывает `edit`, `write`, `patch`)
|
||||
- `glob` — подстановка файла (соответствует шаблону подстановки)
|
||||
- `grep` — поиск по контенту (соответствует шаблону регулярного выражения)
|
||||
- `bash` — запуск shell-команд (соответствует проанализированным командам, например `git status --porcelain`)
|
||||
|
||||
@@ -95,7 +95,7 @@ description: Управляйте инструментами, которые м
|
||||
Используйте это, чтобы позволить LLM создавать новые файлы. Он перезапишет существующие файлы, если они уже существуют.
|
||||
|
||||
:::note
|
||||
Инструмент `write` контролируется разрешением `edit`, которое распространяется на все модификации файлов (`edit`, `write`, `patch`, `multiedit`).
|
||||
Инструмент `write` контролируется разрешением `edit`, которое распространяется на все модификации файлов (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
@@ -190,7 +190,7 @@ description: Управляйте инструментами, которые м
|
||||
Этот инструмент применяет файлы исправлений к вашей кодовой базе. Полезно для применения различий и патчей из различных источников.
|
||||
|
||||
:::note
|
||||
Инструмент `patch` контролируется разрешением `edit`, которое распространяется на все модификации файлов (`edit`, `write`, `patch`, `multiedit`).
|
||||
Инструмент `patch` контролируется разрешением `edit`, которое распространяется на все модификации файлов (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
@@ -130,7 +130,7 @@ OpenCode ใช้การกำหนดค่า `permission` เพื่อ
|
||||
สิทธิ์ของ OpenCode จะกำหนดไว้ตามชื่อเครื่องมือ พร้อมด้วย guardrails อีก 2-3 คน:
|
||||
|
||||
- `read` — อ่านไฟล์ (ตรงกับเส้นทางของไฟล์)
|
||||
- `edit` — การแก้ไขไฟล์ทั้งหมด (ครอบคลุมถึง `edit`, `write`, `patch`, `multiedit`)
|
||||
- `edit` — การแก้ไขไฟล์ทั้งหมด (ครอบคลุมถึง `edit`, `write`, `patch`)
|
||||
- `glob` — ไฟล์ globbing (ตรงกับรูปแบบ glob)
|
||||
- `grep` — การค้นหาเนื้อหา (ตรงกับรูปแบบ regex)
|
||||
- `bash` — การรันคำสั่ง shell (ตรงกับคำสั่งที่แยกวิเคราะห์เช่น `git status --porcelain`)
|
||||
|
||||
@@ -95,7 +95,7 @@ description: จัดการเครื่องมือที่ LLM ส
|
||||
ใช้สิ่งนี้เพื่ออนุญาตให้ LLM สร้างไฟล์ใหม่ มันจะเขียนทับไฟล์ที่มีอยู่หากมีอยู่แล้ว
|
||||
|
||||
:::note
|
||||
เครื่องมือ `write` ถูกควบคุมโดยสิทธิ์ `edit` ซึ่งครอบคลุมการแก้ไขไฟล์ทั้งหมด (`edit`, `write`, `patch`, `multiedit`)
|
||||
เครื่องมือ `write` ถูกควบคุมโดยสิทธิ์ `edit` ซึ่งครอบคลุมการแก้ไขไฟล์ทั้งหมด (`edit`, `write`, `patch`)
|
||||
:::
|
||||
|
||||
---
|
||||
@@ -190,7 +190,7 @@ description: จัดการเครื่องมือที่ LLM ส
|
||||
เครื่องมือนี้ใช้ไฟล์แพทช์กับโค้ดเบสของคุณ มีประโยชน์สำหรับการใช้ความแตกต่างและแพตช์จากแหล่งต่างๆ
|
||||
|
||||
:::note
|
||||
เครื่องมือ `patch` ถูกควบคุมโดยสิทธิ์ `edit` ซึ่งครอบคลุมการแก้ไขไฟล์ทั้งหมด (`edit`, `write`, `patch`, `multiedit`)
|
||||
เครื่องมือ `patch` ถูกควบคุมโดยสิทธิ์ `edit` ซึ่งครอบคลุมการแก้ไขไฟล์ทั้งหมด (`edit`, `write`, `patch`)
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
@@ -95,7 +95,7 @@ Create new files or overwrite existing ones.
|
||||
Use this to allow the LLM to create new files. It will overwrite existing files if they already exist.
|
||||
|
||||
:::note
|
||||
The `write` tool is controlled by the `edit` permission, which covers all file modifications (`edit`, `write`, `apply_patch`, `multiedit`).
|
||||
The `write` tool is controlled by the `edit` permission, which covers all file modifications (`edit`, `write`, `apply_patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
@@ -194,7 +194,7 @@ When handling `tool.execute.before` or `tool.execute.after` hooks, check `input.
|
||||
`apply_patch` uses `output.args.patchText` instead of `output.args.filePath`. Paths are embedded in marker lines within `patchText` and are relative to the project root (for example: `*** Add File: src/new-file.ts`, `*** Update File: src/existing.ts`, `*** Move to: src/renamed.ts`, `*** Delete File: src/obsolete.ts`).
|
||||
|
||||
:::note
|
||||
The `apply_patch` tool is controlled by the `edit` permission, which covers all file modifications (`edit`, `write`, `apply_patch`, `multiedit`).
|
||||
The `apply_patch` tool is controlled by the `edit` permission, which covers all file modifications (`edit`, `write`, `apply_patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
@@ -130,7 +130,7 @@ Listeyi güvenilir yollara odaklı tutun ve diğer araçlar için gereken ekstra
|
||||
opencode izinleri araç adına ve birkaç güvenlik önlemine göre anahtarlanır:
|
||||
|
||||
- `read` — bir dosyayı okumak (dosya yoluyla eşleşir)
|
||||
- `edit` — tüm dosya değişiklikleri (`edit`, `write`, `patch`, `multiedit`'yi kapsar)
|
||||
- `edit` — tüm dosya değişiklikleri (`edit`, `write`, `patch`'i kapsar)
|
||||
- `glob` — dosya genellemesi (glob düzeniyle eşleşir)
|
||||
- `grep` — içerik arama (regex modeliyle eşleşir)
|
||||
- `bash` — kabuk komutlarını çalıştırma (`git status --porcelain` gibi ayrıştırılmış komutlarla eşleşir)
|
||||
|
||||
@@ -95,7 +95,7 @@ Yeni dosyalar oluşturur veya mevcut dosyaları üzerine yazar.
|
||||
LLM'in yeni dosya oluşturmasına izin vermek için bunu kullanın. Dosya zaten varsa üzerine yazar.
|
||||
|
||||
:::note
|
||||
`write` aracı `edit` izniyle kontrol edilir; bu izin tüm dosya değişikliklerini kapsar (`edit`, `write`, `patch`, `multiedit`).
|
||||
`write` aracı `edit` izniyle kontrol edilir; bu izin tüm dosya değişikliklerini kapsar (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
@@ -190,7 +190,7 @@ Dosyalara patch uygular.
|
||||
Bu araç patch dosyalarını kod tabanınıza uygular. Farklı kaynaklardan gelen diff ve patch'leri uygulamak için kullanışlıdır.
|
||||
|
||||
:::note
|
||||
`patch` aracı `edit` izniyle kontrol edilir; bu izin tüm dosya değişikliklerini kapsar (`edit`, `write`, `patch`, `multiedit`).
|
||||
`patch` aracı `edit` izniyle kontrol edilir; bu izin tüm dosya değişikliklerini kapsar (`edit`, `write`, `patch`).
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
@@ -130,7 +130,7 @@ OpenCode 使用 `permission` 配置来决定某个操作是否应自动运行、
|
||||
OpenCode 的权限以工具名称为键,外加几个安全防护项:
|
||||
|
||||
- `read` — 读取文件(匹配文件路径)
|
||||
- `edit` — 所有文件修改(涵盖 `edit`、`write`、`patch`、`multiedit`)
|
||||
- `edit` — 所有文件修改(涵盖 `edit`、`write`、`patch`)
|
||||
- `glob` — 文件通配(匹配通配模式)
|
||||
- `grep` — 内容搜索(匹配正则表达式模式)
|
||||
- `bash` — 运行 shell 命令(匹配解析后的命令,如 `git status --porcelain`)
|
||||
|
||||
@@ -95,7 +95,7 @@ description: 管理 LLM 可以使用的工具。
|
||||
使用此工具允许 LLM 创建新文件。如果文件已存在,则会覆盖现有文件。
|
||||
|
||||
:::note
|
||||
`write` 工具由 `edit` 权限控制,该权限涵盖所有文件修改操作(`edit`、`write`、`patch`、`multiedit`)。
|
||||
`write` 工具由 `edit` 权限控制,该权限涵盖所有文件修改操作(`edit`、`write`、`patch`)。
|
||||
:::
|
||||
|
||||
---
|
||||
@@ -190,7 +190,7 @@ description: 管理 LLM 可以使用的工具。
|
||||
该工具将补丁文件应用到您的代码库中。适用于应用来自各种来源的 diff 和补丁。
|
||||
|
||||
:::note
|
||||
`patch` 工具由 `edit` 权限控制,该权限涵盖所有文件修改操作(`edit`、`write`、`patch`、`multiedit`)。
|
||||
`patch` 工具由 `edit` 权限控制,该权限涵盖所有文件修改操作(`edit`、`write`、`patch`)。
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
@@ -130,7 +130,7 @@ OpenCode 使用 `permission` 設定來決定某個操作是否應自動執行、
|
||||
OpenCode 的權限以工具名稱為鍵,外加幾個安全防護項:
|
||||
|
||||
- `read` — 讀取檔案(比對檔案路徑)
|
||||
- `edit` — 所有檔案修改(涵蓋 `edit`、`write`、`patch`、`multiedit`)
|
||||
- `edit` — 所有檔案修改(涵蓋 `edit`、`write`、`patch`)
|
||||
- `glob` — 檔案萬用字元比對(比對萬用字元模式)
|
||||
- `grep` — 內容搜尋(比對正規表示式模式)
|
||||
- `bash` — 執行 shell 指令(比對解析後的指令,如 `git status --porcelain`)
|
||||
|
||||
@@ -95,7 +95,7 @@ description: 管理 LLM 可以使用的工具。
|
||||
使用此工具允許 LLM 建立新檔案。如果檔案已存在,則會覆蓋現有檔案。
|
||||
|
||||
:::note
|
||||
`write` 工具由 `edit` 權限控制,該權限涵蓋所有檔案修改操作(`edit`、`write`、`patch`、`multiedit`)。
|
||||
`write` 工具由 `edit` 權限控制,該權限涵蓋所有檔案修改操作(`edit`、`write`、`patch`)。
|
||||
:::
|
||||
|
||||
---
|
||||
@@ -190,7 +190,7 @@ description: 管理 LLM 可以使用的工具。
|
||||
該工具將補丁檔案套用到您的程式碼庫中。適用於套用來自各種來源的 diff 和補丁。
|
||||
|
||||
:::note
|
||||
`patch` 工具由 `edit` 權限控制,該權限涵蓋所有檔案修改操作(`edit`、`write`、`patch`、`multiedit`)。
|
||||
`patch` 工具由 `edit` 權限控制,該權限涵蓋所有檔案修改操作(`edit`、`write`、`patch`)。
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user