muninn_memory_anchor_replace
Replace the span between beginAnchor and endAnchor (inclusive) with newText. Cheaper than resending the whole body when editing a large block — send only the two anchors and the replacement. Both anchors must appear EXACTLY ONCE in the current body; the server rejects if either is missing or appears more than once (never guesses). beginAnchor must precede endAnchor. To delete a span: pass newText as empty string. Returns {id, length} as self-verify. memoryId accepts a short-form 8-char prefix. Works on artifacts too (artifactId IS memoryId) — a published artifact's public link is refreshed automatically. Optional expectedRev: the rev from the read you based these anchors on — the write is REJECTED (nothing written) if the body moved since. Omit for a read-then-immediately-write.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| newText | Yes | Replacement text for the entire span (beginAnchor through endAnchor inclusive). Pass empty string to delete the span. | |
| memoryId | Yes | Memory ID to edit (full UUID or unique 8-char prefix) | |
| endAnchor | Yes | Exact string marking the END of the span to replace — must appear exactly once and after beginAnchor | |
| beginAnchor | Yes | Exact string marking the START of the span to replace — must appear exactly once | |
| expectedRev | No | The `rev` from the read you based this edit on. Rejects the write if the body has changed since. Omit to skip the check. |