file_replace_text
Replace literal text in files with staged exact or normalized matching, first/all replacement, and an undoable operation ID.
Instructions
Replace literal text and return operation_id, undo_available and the match stage.
Matching is staged and the result always names the stage: exact first,
then normalised (indentation and trailing whitespace tolerated, the
replacement re-based onto the matched indentation), then a NO_MATCH
refusal carrying the nearest candidate lines. match is required and is
either first or all; there is no default policy. match_count reports the
matches found, expected_match_count refuses a different number, and
expected_content pins the exact text of one region.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| new | Yes | ||
| old | Yes | ||
| path | Yes | ||
| match | Yes | replacement policy: 'first' or 'all' | |
| dry_run | No | ||
| expected_hash | No | ||
| expected_content | No | ||
| expected_match_count | No | ||
| i_accept_secret_write_risk | No |