Skip to content

Commit ee018d5

Browse files
authored
docs: rename patch tool to apply_patch and clarify apply_patch behavior (#19979)
1 parent 0465579 commit ee018d5

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

packages/web/src/content/docs/tools.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Create new files or overwrite existing ones.
9595
Use this to allow the LLM to create new files. It will overwrite existing files if they already exist.
9696

9797
:::note
98-
The `write` tool is controlled by the `edit` permission, which covers all file modifications (`edit`, `write`, `patch`, `multiedit`).
98+
The `write` tool is controlled by the `edit` permission, which covers all file modifications (`edit`, `write`, `apply_patch`, `multiedit`).
9999
:::
100100

101101
---
@@ -191,7 +191,7 @@ To configure which LSP servers are available for your project, see [LSP Servers]
191191

192192
---
193193

194-
### patch
194+
### apply_patch
195195

196196
Apply patches to files.
197197

@@ -206,8 +206,12 @@ Apply patches to files.
206206

207207
This tool applies patch files to your codebase. Useful for applying diffs and patches from various sources.
208208

209+
When handling `tool.execute.before` or `tool.execute.after` hooks, check `input.tool === "apply_patch"` (not `"patch"`).
210+
211+
`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`).
212+
209213
:::note
210-
The `patch` tool is controlled by the `edit` permission, which covers all file modifications (`edit`, `write`, `patch`, `multiedit`).
214+
The `apply_patch` tool is controlled by the `edit` permission, which covers all file modifications (`edit`, `write`, `apply_patch`, `multiedit`).
211215
:::
212216

213217
---

0 commit comments

Comments
 (0)