Replace Carve source of one node
carve_replace_sourceReplace a selected Carve node or heading section's exact source bytes, validating parse and lint to refuse unsafe edits and returning forward and undo patches.
Instructions
Splice Carve text over the exact source bytes of one selected node or heading section, leaving every other byte untouched. Refuses if the node kind changes, the rest of the document parses differently, or new lint findings appear. Returns forward and undo patches.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Carve source that replaces the selected range. | |
| scope | No | section: a heading through its content, up to the next heading of the same or higher level. | node |
| source | Yes | Document source (maximum 1000000 UTF-8 bytes) | |
| selector | Yes | ||
| includeSource | No | Also return the whole edited source. | |
| expectedSha256 | No | Source sha256 from carve_get_block; a mismatch refuses the edit. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | Yes | ||
| lint | Yes | ||
| match | Yes | ||
| patch | Yes | ||
| start | Yes | ||
| write | No | ||
| sha256 | Yes | ||
| source | No | ||
| undoPatch | Yes | ||
| resultSha256 | Yes |