Releases: RimuruW/pi-hashline-edit
Releases · RimuruW/pi-hashline-edit
v0.6.1
What's Changed
- Fix Claude Agent SDK edit compatibility by accepting deprecated legacy top-level replace args by @dszmaj in #16
- refactor: migrate npm scope to @earendil-works, switch bun→npm+vitest by @RimuruW in #19
- fix(hashline): align rendered line numbers by @XYenon in #18
New Contributors
Full Changelog: v0.6.0...v0.6.1
v0.6.0
Added
- Add first-class
replace_textedits. - Add full and ranges return modes for edit previews.
- Add protocol metadata for snapshot validation, outlines, stale refresh anchors, and edit metrics.
Fixed
- Preserve hard links during atomic writes.
- Canonicalize mutation targets across aliases.
- Render applied edit diffs in the UI only while keeping model-visible responses compact.
- Preserve legacy payload compatibility and fenced result sections.
- Tighten range and snapshot metadata handling.
Changed
- Slim read/edit prompt guidance and edit response text for token efficiency.
- Drop snapshot ID rejection and silent autocorrection behavior from the protocol.
- Improve text-like MIME handling, including XML candidates.
Tests
- Expand file-kind coverage for XML read guard paths and harden related test coverage.
v0.5.4
Highlights
This release fixes #12: If text-file sample for file-kind ends containing a partial utf-8 character, file is incorrectly determined to be binary.
Fixed
- Preserve rendered diff previews when the edit tool returns results.
- Preserve
@signs and Unicode spaces when normalizing relative paths. - Remove edit-application autocorrection heuristics to keep strict hashline semantics.
- Tighten UTF-8 classification for full-window reads while tolerating incomplete truncated input. (#12)
- Prevent unbounded
_hasherCachememory growth.
Changed
- Share file reads between file-kind detection and the
read/edittools to reduce duplicate I/O.
Performance
- Cache the XXH32 hasher instance in hashline processing.
Documentation
- Sync
README.md,AGENTS.md, and prompts with current tool behavior. - Fix broken links in
README.md.
Tests
- Add coverage for stale-position compound edits, EACCES/EPERM paths, line-ending/BOM helpers, and Windows-specific permission guards.
v0.5.3
What's Changed
Features
- Return updated anchors in edit results for chained editing workflows
- Shared file-mutation-queue bridge with tighter schema and
prepareArgumentshook - Add hashline-specific prompt metadata (snippets & guidelines) for
readandedittools
Fixes
- Fix legacy edit line-range and multi-line delete tracking
- Fix fuzzy anchor validation and tighten error handling
- Fix prepend into empty file correctly
- Handle empty range deletes and empty edit results
- Avoid emitting sentinel anchors and correctly track changed span
- Compute updated anchors in final document coordinates
- Use final-document offsets for append tracking
- Preserve non-string legacy key values instead of silently dropping
- Return advisory for empty files, hide terminal newline sentinel
- Remove noisy warning heuristic for line-shift noise
- Enable chained anchors for legacy top-level replace
Docs
- Document
readoffset/limit, chained edits, and diff preview - Replace pseudo-code payload with full JSON examples for
edit - Require
editsto be a JSON array, not a JSON-encoded string
Other
- Sync with pi 0.63+ types and tighten peer dep minimums
New Contributors
- @yuiti-ara made their first contribution
Full Changelog: v0.4.1...v0.5.3
v0.4.1
Fixed
- Fixes #7: restore Pi tool registration by publishing the
edittool schema as a top-level JSON object, while preserving legacyoldText/newTextcompatibility. - Fix EOF append behavior for files ending with a terminal newline so
appendinserts at the real end of file instead of creating an unintended blank line.
Verification
- Added regression coverage for schema publication and terminal-newline append handling.
bun test
v0.4.0
What's Changed
Added
- Compact diff preview in edit results. Each successful edit now returns a condensed
Diff preview:block showing changed lines with+/-markers and their newLINE#HASHanchors, making quick follow-up edits possible without a full re-read. - Legacy compatibility mode. When a caller sends a top-level
oldText/newTextorold_text/new_textpayload (the built-in edit format), the tool attempts an exact unique match and applies it. Usage is surfaced to the interactive UI as a warning — not to the model — so operators can see when hashline mode is not being used. - Compatibility notifications. A turn-end notification is emitted to the UI when one or more edits in a turn fell back to legacy mode, with a count of affected edits.
- Input autocorrections. The tool now automatically strips accidental
LINE#HASH:display prefixes or diff+/-markers copied into replacementlines, and corrects\t-escaped tab indentation whenPI_HASHLINE_AUTOCORRECT_ESCAPED_TABS=1is set. - Binary and image file detection. Both
readandeditnow classify files before processing: images (JPEG, PNG, GIF, WebP) are handled as attachments; binary files are rejected with a descriptive error; only UTF-8 text files proceed to hashline processing. - Out-of-range read offset reporting. Requesting an
offsetbeyond the end of file now returns a clear advisory with the file's actual line count and valid offset range.
Fixed
- Stale anchor error snippets include retry anchors. On hash mismatch the error snippet marks stale lines with
>>>and includes their currentLINE#HASHfor immediate retry, with surrounding context for range edits. - Atomic writes preserve symlink targets, file mode, and detect symlink loops.
- Caller-owned edit arrays are not mutated —
applyHashlineEditsclones its input before deduplication. - Schema validation accepts legacy payloads and rejects mixed camelCase/snake_case keys.
- Hash semantics tightened — symbol-only lines use their line number as hash seed to reduce collisions on
}/{etc. - Unsafe truncated previews are rejected —
readreturns an advisory instead of a partial hashline when the first line exceeds the byte budget.
Changed
- Edit tool is strict hashline-only. Free-text relocation removed; legacy
oldText/newTextis a hidden compatibility fallback only. greptool override removed — use the built-in grep tool.- Migrated from npm to Bun (
bun.lockreplacespackage-lock.json). - Test suite reorganized into layered directories (
core/,tools/,extension/,integration/). tsconfig.jsonadded for explicit TypeScript strict-mode checking.
Full Changelog: https://github.com/RimuruW/pi-hashline-edit/blob/master/CHANGELOG.md