apply_patch
Edit multiple files in one atomic transaction: nothing is written unless every change applies. Reports compiler or linter problems in changed files and returns a checkpoint id.
Instructions
Apply a multi-file patch atomically (nothing is written unless every hunk applies). Preferred way to change code. Format: *** Begin Patch *** Update File: src/app.ts @@ function main() { (optional anchor line to jump near the change) context line (space prefix) -removed line +added line *** Add File: src/new.ts +file content line *** Delete File: src/old.ts *** Update File: a.ts *** Move to: b.ts *** End Patch Include ~3 unchanged context lines around each change. The result reports compiler/linter problems in the changed files and a checkpoint id for undo.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Base directory for relative paths (default: default workspace) | |
| check | No | Run compilers/linters on the changed files afterwards (default true) | |
| patch | Yes |