@delorenj/pjangler 1.2.14 → 1.2.16
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/dist/index.js +13 -5
- package/dist/mcp-server.js +13 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2524,6 +2524,9 @@ function extractTomlStrings(text3) {
|
|
|
2524
2524
|
}
|
|
2525
2525
|
return values;
|
|
2526
2526
|
}
|
|
2527
|
+
function stripTomlStringsAndComments(line) {
|
|
2528
|
+
return line.replace(/"(?:\\.|[^"\\])*"/g, '""').replace(/'[^']*'/g, "''").replace(/#.*$/, "");
|
|
2529
|
+
}
|
|
2527
2530
|
function isManagedHookEntry(value) {
|
|
2528
2531
|
const trimmed = value.trim();
|
|
2529
2532
|
return trimmed === "op inject -i .env.op > .env" || /(^|\/)link-agentfiles\.sh$/.test(trimmed);
|
|
@@ -2551,12 +2554,17 @@ function upsertLinkAgentfilesHooks(text3) {
|
|
|
2551
2554
|
for (let i = hooksStart + 1; i < hooksEnd; i++) {
|
|
2552
2555
|
if (!/^\s*enter\s*=/.test(lines[i])) continue;
|
|
2553
2556
|
enterStart = i;
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2557
|
+
let depth = 0;
|
|
2558
|
+
let j = i;
|
|
2559
|
+
for (; j < hooksEnd; j++) {
|
|
2560
|
+
for (const ch of stripTomlStringsAndComments(lines[j])) {
|
|
2561
|
+
if (ch === "[") depth++;
|
|
2562
|
+
else if (ch === "]") depth--;
|
|
2563
|
+
}
|
|
2564
|
+
if (depth <= 0) break;
|
|
2559
2565
|
}
|
|
2566
|
+
enterEnd = Math.min(j, hooksEnd - 1) + 1;
|
|
2567
|
+
while (enterEnd < hooksEnd && /^\s*\]\s*$/.test(lines[enterEnd])) enterEnd++;
|
|
2560
2568
|
break;
|
|
2561
2569
|
}
|
|
2562
2570
|
const existingBlock = enterStart >= 0 ? lines.slice(enterStart, enterEnd).join("\n") : "";
|
package/dist/mcp-server.js
CHANGED
|
@@ -2451,6 +2451,9 @@ function extractTomlStrings(text2) {
|
|
|
2451
2451
|
}
|
|
2452
2452
|
return values;
|
|
2453
2453
|
}
|
|
2454
|
+
function stripTomlStringsAndComments(line) {
|
|
2455
|
+
return line.replace(/"(?:\\.|[^"\\])*"/g, '""').replace(/'[^']*'/g, "''").replace(/#.*$/, "");
|
|
2456
|
+
}
|
|
2454
2457
|
function isManagedHookEntry(value) {
|
|
2455
2458
|
const trimmed = value.trim();
|
|
2456
2459
|
return trimmed === "op inject -i .env.op > .env" || /(^|\/)link-agentfiles\.sh$/.test(trimmed);
|
|
@@ -2478,12 +2481,17 @@ function upsertLinkAgentfilesHooks(text2) {
|
|
|
2478
2481
|
for (let i = hooksStart + 1; i < hooksEnd; i++) {
|
|
2479
2482
|
if (!/^\s*enter\s*=/.test(lines[i])) continue;
|
|
2480
2483
|
enterStart = i;
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2484
|
+
let depth = 0;
|
|
2485
|
+
let j = i;
|
|
2486
|
+
for (; j < hooksEnd; j++) {
|
|
2487
|
+
for (const ch of stripTomlStringsAndComments(lines[j])) {
|
|
2488
|
+
if (ch === "[") depth++;
|
|
2489
|
+
else if (ch === "]") depth--;
|
|
2490
|
+
}
|
|
2491
|
+
if (depth <= 0) break;
|
|
2486
2492
|
}
|
|
2493
|
+
enterEnd = Math.min(j, hooksEnd - 1) + 1;
|
|
2494
|
+
while (enterEnd < hooksEnd && /^\s*\]\s*$/.test(lines[enterEnd])) enterEnd++;
|
|
2487
2495
|
break;
|
|
2488
2496
|
}
|
|
2489
2497
|
const existingBlock = enterStart >= 0 ? lines.slice(enterStart, enterEnd).join("\n") : "";
|