pi-hashline-edit-pro 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/package.json +1 -1
- package/prompts/replace.md +1 -1
package/README.md
CHANGED
|
@@ -76,14 +76,14 @@ Replaces using the `HASH│content` anchors from `read` output to target lines p
|
|
|
76
76
|
| `old_range` | Inclusive line range `[start_hash, end_hash]` (required). |
|
|
77
77
|
| `new_lines` | Replacement content (one string per line). Use `[]` to delete. |
|
|
78
78
|
|
|
79
|
-
- **Request structure validation.** The request envelope (`path`, `edits`) and individual edit items are validated before any file I/O. Unknown fields, missing required fields, invalid types, and malformed anchors are rejected with `[E_BAD_SHAPE]` or `[
|
|
79
|
+
- **Request structure validation.** The request envelope (`path`, `edits`) and individual edit items are validated before any file I/O. Unknown fields, missing required fields, invalid types, and malformed anchors are rejected with `[E_BAD_SHAPE]` or `[E_BAD_REF]`.
|
|
80
80
|
- **Legacy dialect rejected.** The native top-level `oldText`/`newText` (and `old_text`/`new_text`) dialect is rejected with `[E_LEGACY_SHAPE]`. The error message tells the model to call `read` first and send `{old_range: ["<START>", "<END>"], new_lines: [...]}`.
|
|
81
81
|
|
|
82
82
|
All edits in a single call validate against the same pre-edit snapshot and apply bottom-up, so line numbers stay consistent across operations.
|
|
83
83
|
|
|
84
84
|
### Chained edits
|
|
85
85
|
|
|
86
|
-
After a successful replace, the
|
|
86
|
+
After a successful replace, the response text is empty (warnings are still shown if present). To get fresh anchors for follow-up edits, call `read` on the file first. This avoids token overhead from re-displaying content the model already knows.
|
|
87
87
|
|
|
88
88
|
### Auto-read after write
|
|
89
89
|
|
|
@@ -98,7 +98,7 @@ For large files (>2000 lines), the auto-read output is truncated with a paginati
|
|
|
98
98
|
|
|
99
99
|
### Diff for the host
|
|
100
100
|
|
|
101
|
-
The post-edit diff (with `+`/`-` markers
|
|
101
|
+
The post-edit diff (with `+`/`-` markers) is exposed to the host UI via `details.diff`. It is intentionally not in the LLM-visible text. The model already knows what it changed and can call `read` for fresh anchors when needed.
|
|
102
102
|
|
|
103
103
|
## Design Decisions
|
|
104
104
|
|
package/package.json
CHANGED
package/prompts/replace.md
CHANGED
|
@@ -59,7 +59,7 @@ Rules:
|
|
|
59
59
|
- If `new_lines` matches current content, the replace is classified as `noop` (file unchanged).
|
|
60
60
|
- The `old_range` is inclusive — both anchors and every line between them are replaced. If your replacement content includes lines that already exist in the file (e.g. closing brackets), make sure those lines are within your range, otherwise they will appear twice.
|
|
61
61
|
|
|
62
|
-
On success, the response
|
|
62
|
+
On success, the response text is empty (or contains only warnings if present). Call `read` to get fresh anchors for follow-up edits.
|
|
63
63
|
|
|
64
64
|
Error recovery:
|
|
65
65
|
- `[E_STALE_ANCHOR]` — file changed since last read. Call `read` to get fresh anchors, then copy the HASH and retry.
|