edit
Edit a text file by exact string replacement, cheaper than read + write for small changes. Each old_str must be literal text matching exactly once (set replace_all for every occurrence). Edits apply in order and commit atomically as one new version; on STRING_NOT_FOUND check the hint for whitespace mismatches. Text files up to 16 MiB. Pass expected_version to fail instead of overwriting concurrent changes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File to edit, relative to the workspace root. Must already exist. | |
| edits | Yes | Up to 20 replacements, applied in order and committed together as one new version. | |
| workspace | No | Workspace slug. Optional, defaults to "temp". | |
| override_lock | No | Edit even if another agent holds a lock on this path. Recorded in the activity log. | |
| expected_version | No | Fail with VERSION_CONFLICT unless the file is currently at this version. Omit for last-write-wins. |