apply_patch
Apply a unified diff to a file in an Obsidian vault, validating context lines and optionally verifying content hash for safe, precise edits.
Instructions
Apply a unified diff to a file. Context lines (' ' prefix) are validated verbatim per hunk — the diff IS the content precondition. expected_content_hash is optional belt-and-suspenders. Use this for multi-hunk surgical edits.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | ||
| patch | Yes | ||
| vault | No | ||
| dry_run | No | ||
| expected_content_hash | No |