Repository navigation
pi-snap-edit v2.1.1
pi-snap-edit v2.1.1
Patch release. Improves quick_edit stale line recovery and clarifies batch semantics for agents.
Changes
quick_editexpectedStartLine mismatch errors now search for the expected line elsewhere in the file and include line-numbered ±5 context when found.- Keeps the no-match fallback terse without exposing the unexpected line content at the requested position.
- Clarified prompt guidance:
quick_editbatch edits are snapshot-based, not sequential; do not renumber later edits after earlier insert/delete ops.
Install
pi install npm:pi-snap-editVerification
npm run typecheckpassed.npm testpassed (31 tests).git diff --checkpassed.npm pack --dry-runpassed.
pi-snap-edit v2.1.0
Feature release. Adds target_edit for exact-target edits when agents know stable marker text but line numbers are inconvenient.
Changes
- Added
target_editcallable tool with three operations:replace,insert, anddelete. - Added occurrence/count guards and optional line scope for exact target matching.
target_editpreserves line endings, supports multi-line targets/replacements, and returns diff plus line-numbered refreshed context.- Rebases target edit diff/context positions after later line-shifting operations in the same batch.
- Added tests and docs for target-based editing, atomic failures, CRLF/no-trailing-newline preservation, and batch line-shift output.
Install
pi install npm:pi-snap-editVerification
npm run typecheckpassed.npm testpassed (30 tests).git diff --checkpassed.npm pack --dry-runpassed.- Live Pi tool tests passed after reload.
pi-snap-edit v2.0.0
Breaking cleanup release. Removes the hash-anchored structured_edit workflow and standardizes the active workflow around line-numbered quick_edit plus substitute_edit.
Changes
- Removed the
structured_editcallable tool and its public exports. - Removed structured edit schemas, engine, anchor parsing helpers, and tests.
- Changed refreshed edit context output to absolute padded line numbers, so follow-up
quick_editcalls can use the returned context directly. - Updated README and AGENTS guidance to match the current line-number workflow.
Breaking Changes
structured_editis no longer registered or exported.applyStructuredEdits,StructuredEditOp,StructuredEditParams,parseAnchor, andinvalidAnchorMessageare no longer exported.- Refreshed context output is now
line| contentinstead ofHASH|content.
Install
pi install npm:pi-snap-editVerification
npm run typecheckpassed.npm testpassed (23 tests).npm pack --dry-runpassed.
pi-snap-edit v1.1.1
Hotfix release. Restored numbered read output that was accidentally removed in v1.1.0.
Changes
- Restored numbered read output (line numbers with padding).
- Read output still does not include
fileHashheader (as intended in v1.1.0). - Fixed read hook to properly handle offset reads and image files.
Install
pi install npm:pi-snap-editVerification
npm run typecheckpassed.npm testpassed (47 tests).
pi-snap-edit v1.1.0
Simplified output release. Removed fileHash from read hook and edit responses, removed hash prefix from diff output, and fixed security leak in error messages.
Changes
- Removed
fileHashfromreadoutput (no longer injected by read hook). - Removed
fileHashfromquick_editandsubstitute_editsuccess responses. - Removed hash prefix from diff output: now shows
- content/+ contentinstead of- HASH|content/+ HASH|content. - Fixed security issue:
expectedStartLinemismatch errors no longer leak actual line content. - Made
expectedStartLinerequired for allquick_editoperations.
Breaking Changes
readoutput no longer includesfileHashheader.- Edit tool responses no longer include
fileHash. - Diff output format changed (no hash prefix).
Install
pi install npm:pi-snap-editVerification
npm run typecheckpassed.npm testpassed (47 tests).npm pack --dry-runpassed.
pi-snap-edit v1.0.0
Line-numbered editing release. read now shows a file-level fileHash and readable line numbers, while edit tools reject stale hashes without exposing a retry oracle.
Changes
- Replaced hash-line anchors with padded
readline numbers and a required file-levelfileHash. - Added
expectedStartLinetoquick_editas an optional exact guard for the currentstartline only. - Added
substitute_editfor counted literal substitutions inside a required line range. - Preserved absolute line numbers for offset reads and padded line-number columns around 10/100+ lines.
- Fixed final-newline edge cases so
readdoes not show phantom EOF lines or continuation notices. - Updated README and tests for the line-numbered workflow.
Install
pi install npm:pi-snap-editVerification
npm run typecheckpassed.npm testpassed.npm pack --dry-runpassed.