harness-write
Atomic file write + edit + multi-edit with read-before-edit ledger, OLD_STRING_NOT_UNIQUE match locations, fuzzy candidate suggestions.
Rust port of @agent-sh/harness-write. Part of the harness-* monorepo — see the top-level README for architectural context.
Install
[]
= "0.1"
Usage
use ;
use PermissionPolicy;
use Arc;
use json;
let perms = new;
let ledger = new;
let session = new;
// ... after Read, the read-executor should record into ledger ...
let r = edit.await;
Tool naming
The MultiEdit tool's canonical name is multi_edit (MULTIEDIT_TOOL_NAME),
matching fn multi_edit and the snake_case convention of the other multi-word
tool names. The pre-0.3.0 spelling multiedit remains available as the
deprecated MULTIEDIT_TOOL_NAME_LEGACY. is_multi_edit_tool_name() is a
pure matcher that accepts both spellings; normalize_multi_edit_tool_name()
maps both to the canonical name and emits a one-time stderr deprecation
warning for the legacy spelling — use it at dispatch points.
harness-write-cli likewise accepts both multi_edit and the deprecated
multiedit JSON-RPC methods. The multiedit alias will be removed in a
future major release — migrate to multi_edit.
Contract
The full contract lives in agent-knowledge/design/write.md. Changes to this crate must stay in sync with that spec, and with the TypeScript sibling at @agent-sh/harness-write.
License
MIT © Avi Fenesh