pi-hashline-edit-pro 0.14.0 → 0.14.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-hashline-edit-pro",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "Strict hashline read/replace tool for pi-coding-agent with hash-anchored edits (3-char, 18-bit, perfect hashing)",
5
5
  "main": "index.ts",
6
6
  "repository": {
@@ -1,4 +1,5 @@
1
1
  - Use `replace` with HASH anchors for all file changes; batch every change to one file into a single `replace` call.
2
2
  - After a successful `replace`, the response text is empty (warnings only). {{AUTO_READ_GUIDANCE}}
3
3
  - On `[E_STALE_ANCHOR]`, call `read` to get fresh anchors, copy the 3-character HASH of the start and end of the range you are replacing into `hash_range_inclusive`, and retry.
4
- - `hash_range_inclusive` replaces the ENTIRE range inclusively. Every line from the first anchor through the second anchor is deleted. Only put the replacement lines in `content_lines` — do not include lines that already exist outside the range.
4
+ - `hash_range_inclusive` replaces the ENTIRE range inclusively. Every line from the first anchor through the second anchor is deleted. Only put the replacement lines in `content_lines` — do not include lines that already exist outside the range.
5
+ - **Preserve leading whitespace (indentation) exactly.** The content after `│` in read output includes all leading spaces and tabs — copy them into `content_lines` unchanged.
@@ -89,6 +89,7 @@ Rules:
89
89
  - To delete a range, use `content_lines: []`.
90
90
  - `hash_range_inclusive` elements are HASH anchors only (e.g. `aB3`). Do not include `│` or line content.
91
91
  - `content_lines` is literal file content — each string becomes exactly one line in the file. No `HASH│` prefix. A line that happens to start with `+` or `-` is written as-is; the only rejected form is the diff preview's `+HASH│…` row (see `[E_INVALID_PATCH]`).
92
+ - **Preserve leading whitespace (indentation) exactly.** The content after `│` in read output includes all leading spaces and tabs — copy them into `content_lines` unchanged. Dropping indentation will produce broken code.
92
93
  - Don't add `""` for spacing unless you actually want a new blank line.
93
94
  - Copy anchors from the most recent `read` of the file. Do not guess or construct them.
94
95
  - All changes in one call must be non-conflicting. The runtime rejects with `[E_EDIT_CONFLICT]` if two ranges overlap.
@@ -1,4 +1,5 @@
1
1
  - Use `replace` with HASH anchors for all file changes. Only one edit per call (flat mode — no `changes` array).
2
2
  - After a successful `replace`, the response text is empty (warnings only). {{AUTO_READ_GUIDANCE}}
3
3
  - On `[E_STALE_ANCHOR]`, call `read` to get fresh anchors, copy the 3-character HASH of the start and end of the range you are replacing into `hash_range_inclusive`, and retry.
4
- - `hash_range_inclusive` replaces the ENTIRE range inclusively. Every line from the first anchor through the second anchor is deleted. Only put the replacement lines in `content_lines` — do not include lines that already exist outside the range.
4
+ - `hash_range_inclusive` replaces the ENTIRE range inclusively. Every line from the first anchor through the second anchor is deleted. Only put the replacement lines in `content_lines` — do not include lines that already exist outside the range.
5
+ - **Preserve leading whitespace (indentation) exactly.** The content after `│` in read output includes all leading spaces and tabs — copy them into `content_lines` unchanged.
@@ -74,6 +74,7 @@ Rules:
74
74
  - To delete a range, use `content_lines: []`.
75
75
  - `hash_range_inclusive` elements are HASH anchors only (e.g. `aB3`). Do not include `│` or line content.
76
76
  - `content_lines` is literal file content — each string becomes exactly one line in the file. No `HASH│` prefix. A line that happens to start with `+` or `-` is written as-is; the only rejected form is the diff preview's `+HASH│…` row (see `[E_INVALID_PATCH]`).
77
+ - **Preserve leading whitespace (indentation) exactly.** The content after `│` in read output includes all leading spaces and tabs — copy them into `content_lines` unchanged. Dropping indentation will produce broken code.
77
78
  - Don't add `""` for spacing unless you actually want a new blank line.
78
79
  - Copy anchors from the most recent `read` of the file. Do not guess or construct them.
79
80
  - If `content_lines` matches current content, the replace is classified as `noop` (file unchanged).
@@ -136,6 +136,7 @@ Rules:
136
136
  - To delete a range, use `content_lines: []`.
137
137
  - `hash_range_inclusive` elements are HASH anchors only (e.g. `aB3`). Do not include `│` or line content.
138
138
  - `content_lines` is literal file content — each string becomes exactly one line in the file. No `HASH│` prefix. A line that happens to start with `+` or `-` is written as-is; the only rejected form is the diff preview's `+HASH│…` row (see `[E_INVALID_PATCH]`).
139
+ - **Preserve leading whitespace (indentation) exactly.** The content after `│` in read output includes all leading spaces and tabs — copy them into `content_lines` unchanged. Dropping indentation will produce broken code.
139
140
  - Don't add `""` for spacing unless you actually want a new blank line.
140
141
  - Copy anchors from the most recent `read` of the file. Do not guess or construct them.
141
142
  - All changes in one call must be non-conflicting. The runtime rejects with `[E_EDIT_CONFLICT]` if two ranges overlap.
@@ -37,7 +37,7 @@ export function buildIdx(content: string): LIdx {
37
37
  lineStarts,
38
38
  hasTerminalNewline: content.endsWith("\n"),
39
39
  };
40
- }
40
+ };
41
41
 
42
42
  type RESpan = {
43
43
  kind: "replace";
@@ -220,7 +220,7 @@ function assemble(
220
220
  * `replace` (no `read` round-trip required, since the hashes are current and
221
221
  * staleness is per-line). Rows are plain `HASH│content` — no annotations.
222
222
  */
223
- function fmtBoundaryWarning(params: {
223
+ export function fmtBoundaryWarning(params: {
224
224
  kind: "trailing" | "leading";
225
225
  survivingContent: string;
226
226
  matchIndex: number;
@@ -433,4 +433,4 @@ export function changedRange(
433
433
  }
434
434
 
435
435
  return { firstChangedLine, lastChangedLine };
436
- }
436
+ }
@@ -36,4 +36,5 @@ export {
36
36
  applyEdits,
37
37
  fmtRegion,
38
38
  changedRange,
39
+ fmtBoundaryWarning,
39
40
  } from "./apply";