@d3ara1n/pi-hashline-edit 0.3.1 → 0.3.2

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": "@d3ara1n/pi-hashline-edit",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "type": "module",
5
5
  "description": "Hashline-style file editing for pi — line-anchored edits verified by content hash, replacing oldText/newText matching",
6
6
  "keywords": [
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Override edit: hashline ops via structured `edits` (LINE#HASH anchors).
3
3
  *
4
- * Each op in `edits` references line anchors copied from read output (or from a
5
- * prior edit's "Updated anchors"). The core verifies each anchor live against
4
+ * Each op in `edits` references line anchors copied from read / grep / replace output
5
+ * (or from a prior edit's "Updated anchors"). The core verifies each anchor live against
6
6
  * the current file content — no snapshot, no global stale check: a cited line
7
7
  * that changed (or was misremembered) fails its own anchor; unchanged lines
8
8
  * elsewhere never block the edit. Legacy oldText/newText is not accepted — the
@@ -180,12 +180,13 @@ export function makeEditOverride(cwd: string) {
180
180
  name: "edit" as const,
181
181
  label: "edit",
182
182
  description:
183
- "Edit a file via hashline ops (LINE#HASH anchors, content-verified). Each op in `edits` references line anchors from your latest read or edit result.",
183
+ "Edit a file via hashline ops (LINE#HASH anchors, content-verified). Each op in `edits` references line anchors from your latest read, grep, replace, or edit result.",
184
184
  promptSnippet: "Edit files via hashline ops (edits[] with LINE#HASH anchors from read)",
185
185
  promptGuidelines: [
186
186
  "Pass `edits`: an array of ops. Each op = {op, anchor?, end?, body?}.",
187
+ "Prefer one `edit` with multiple ops for several changes to the same file, rather than several separate `edit` calls.",
187
188
  "op ∈ replace | delete | insert_after | insert_before | append | prepend.",
188
- "anchor & end = {line, hash} copied from your latest read or edit result (the `#HASH` after each line number). replace/delete take anchor (+ optional end for a range); insert_after/insert_before take anchor; append/prepend take neither.",
189
+ "anchor & end = {line, hash} copied from your latest read, grep, replace, or edit result (the `#HASH` after each line number); grep's `-C` context lines are anchored and editable too. replace/delete take anchor (+ optional end for a range); insert_after/insert_before take anchor; append/prepend take neither.",
189
190
  "body = string[] of new content lines (required for replace/insert/append/prepend; omit for delete).",
190
191
  "A successful edit returns `Updated anchors` for the changed lines — use those (not stale line numbers) for the next edit to the same file; re-read only if you need lines outside that set.",
191
192
  ],