Preview reversible AST patch as source edits
carve_apply_reversible_ast_patchVerify and apply or undo a reversible AST patch against Carve source, returning a stale-guarded UTF-8 edit without writing files.
Instructions
Verify a reversible AST patch against source, apply or undo it, and return a minimal stale-guarded UTF-8 source edit without writing files.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"source": "<source>",
"patch": "<patch>"
},
"name": "carve_apply_reversible_ast_patch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| patch | Yes | Version 1 reversible AST patch (maximum 1000000 JSON bytes and 1000 operations per direction) | |
| source | Yes | Document source (maximum 1000000 UTF-8 bytes) | |
| inverse | No | Apply inverse operations to undo the patch. | |
| includeAst | No | Also return the patched AST. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ast | No | ||
| sha256 | No | ||
| source | Yes | ||
| direction | Yes | ||
| sourcePatch | Yes |