edit_transaction
Apply and manage multi-file code edits as transactions, with begin, edit, commit, rollback, and undo actions to preview and revert changes safely.
Instructions
DEFAULT multi-file edit path with rollback/preview/undo (begin→edit→commit). Use when unsure about changes. Single-file? edit_batch. For string params containing double quotes/backslashes, keep JSON escaping consistent across the whole string (escape uniformly or prefer full-width quotes), otherwise client-side parameter parsing fails.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | Single file path relative to workspace_dir (required for action=edit). | |
| name | No | Transaction name (required for action=begin). | |
| edits | No | Array of {old_string,new_string}. Required for edit. | |
| files | No | Multiple file paths relative to workspace_dir. Same edits applied to all (broadcast mode). | |
| action | Yes | Transaction action to perform. | |
| atomic | No | For edit_multi: all-or-nothing (default: true). | |
| txn_id | No | Transaction ID (required for edit, edit_multi, commit, undo_commit, rollback, info). | |
| file_edits | No | Per-file edits for edit_multi: [{file, edits}]. Overrides files+edits. | |
| workspace_dir | Yes | REQUIRED: project root (abs). reindex first if new. |