str_replace
Replace a specific substring in a file, verifying uniqueness to avoid errors, for precise small edits.
Instructions
Surgical edit: replace a literal substring in a file. Default occurrence='unique' (errors on >1 match). Tiny payload in/out; preferred over file.replace for any edit smaller than the whole file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | ||
| find | Yes | ||
| vault | No | ||
| dry_run | No | ||
| replace | Yes | ||
| occurrence | No | ||
| expected_content_hash | No |