pi-hashline-edit-pro 0.17.10 → 0.17.11
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 +1 -1
- package/src/replace.ts +7 -3
package/package.json
CHANGED
package/src/replace.ts
CHANGED
|
@@ -313,8 +313,6 @@ const MODE_CFG = {
|
|
|
313
313
|
} as const;
|
|
314
314
|
|
|
315
315
|
export function buildToolDef(opts: { flat: boolean; autoRead?: boolean }): ToolDef {
|
|
316
|
-
const autoRead = opts.autoRead ?? false;
|
|
317
|
-
|
|
318
316
|
const cfg = MODE_CFG[opts.flat ? "flat" : "bulk"];
|
|
319
317
|
|
|
320
318
|
const E_DESC = loadP("../prompts/replace.md");
|
|
@@ -337,7 +335,13 @@ export function buildToolDef(opts: { flat: boolean; autoRead?: boolean }): ToolD
|
|
|
337
335
|
if (!isRec(args)) return args as any;
|
|
338
336
|
const record = { ...args };
|
|
339
337
|
normalizeFilePath(record);
|
|
340
|
-
|
|
338
|
+
if (has(record, "content_lines") && typeof record.content_lines === "string") {
|
|
339
|
+
try {
|
|
340
|
+
const parsed = JSON.parse(record.content_lines as string);
|
|
341
|
+
if (Array.isArray(parsed)) record.content_lines = parsed;
|
|
342
|
+
} catch {}
|
|
343
|
+
}
|
|
344
|
+
return record;
|
|
341
345
|
}
|
|
342
346
|
: (args: unknown) =>
|
|
343
347
|
normReq(args) as ReqParams,
|