pi-tian-edit-safe 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/index.ts +2 -2
  2. package/package.json +2 -2
package/index.ts CHANGED
@@ -60,7 +60,7 @@ export default function editSafeExtension(pi: ExtensionAPI): void {
60
60
  name: "edit", // same name as the built-in → overrides it
61
61
  label: "edit (strict)",
62
62
  description:
63
- "Replace text in a file. Pass path and edits: [{oldText, newText}, ...] always an array, even for a single change. Edits apply in order, one after another, each matched against the already-updated text. Each oldText must match the file and be unique; small whitespace/indentation, unicode-punctuation, or escape drift is tolerated only when the match is unambiguous. newText is written verbatim. On failure the error explains why so you can re-read the file and retry.",
63
+ "Replace text in a file using only the array schema: { path, edits: [{ oldText, newText }, ...] }. The edits field is required and must be a non-empty array, including for a single replacement; top-level oldText/newText fields are not part of the public schema. Edits apply in order, one after another, each matched against the already-updated text. Each oldText must match the file and be unique; small whitespace/indentation, unicode-punctuation, or escape drift is tolerated only when the match is unambiguous. newText is written verbatim. On failure, re-read the file before retrying.",
64
64
  parameters,
65
65
  // Fold the looser shapes models emit (alias keys, stringified arrays, a bare
66
66
  // edit object, top-level oldText/newText) onto the canonical {path, edits[]}
@@ -72,7 +72,7 @@ export default function editSafeExtension(pi: ExtensionAPI): void {
72
72
  prepareArguments: (args: unknown) => prepareEditArguments(args) as Static<typeof parameters>,
73
73
  promptGuidelines: [
74
74
  "Prefer `edit` for targeted changes and `write` only for new files or full rewrites.",
75
- "Always pass `edits` as an array use a one-element array for a single change. Edits apply in order, top to bottom.",
75
+ "The edit tool supports only the `edits` array schema; use a one-element array for a single change. Edits apply in order, top to bottom.",
76
76
  "Each oldText must be unique in the file; include surrounding lines to disambiguate when needed.",
77
77
  "On an edit failure, re-read the file before retrying — the error usually means your context was stale or the match was ambiguous.",
78
78
  ],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-tian-edit-safe",
3
- "version": "0.1.0",
4
- "description": "A stricter edit tool for the pi coding agent: full-span match verification, throw-on-ambiguity, verbatim replacement, and a weak-model-friendly call shape.",
3
+ "version": "0.1.1",
4
+ "description": "A stricter edit tool for the pi coding agent with full-span match verification, verbatim replacement, and an array-only edits schema.",
5
5
  "type": "module",
6
6
  "keywords": [
7
7
  "pi",