@nuasite/cli 0.0.33 → 0.0.34

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/dist/index.js +11 -1
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -2460,7 +2460,17 @@ ${SUMMARY_END}
2460
2460
  const agentsContent = await fs.readFile(AGENTS_PATH, "utf8").catch(() => "");
2461
2461
  if (agentsContent.includes(SUMMARY_START) && agentsContent.includes(SUMMARY_END)) {
2462
2462
  const startIndex = agentsContent.indexOf(SUMMARY_START);
2463
- const endIndex = agentsContent.indexOf(SUMMARY_END) + SUMMARY_END.length;
2463
+ const summaryEndIndex = agentsContent.indexOf(SUMMARY_END, startIndex);
2464
+ if (summaryEndIndex === -1) {
2465
+ const recovered = `${agentsContent.slice(0, startIndex)}${summaryBlock}`;
2466
+ await fs.writeFile(AGENTS_PATH, recovered, "utf8");
2467
+ return;
2468
+ }
2469
+ let endIndex = summaryEndIndex + SUMMARY_END.length;
2470
+ while (endIndex < agentsContent.length && (agentsContent[endIndex] === `
2471
+ ` || agentsContent[endIndex] === "\r")) {
2472
+ endIndex += 1;
2473
+ }
2464
2474
  const updated = `${agentsContent.slice(0, startIndex)}${summaryBlock}${agentsContent.slice(endIndex)}`;
2465
2475
  await fs.writeFile(AGENTS_PATH, updated, "utf8");
2466
2476
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuasite/cli",
3
- "version": "0.0.33",
3
+ "version": "0.0.34",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "files": [
@@ -23,7 +23,7 @@
23
23
  "prepack": "bun run ../../scripts/workspace-deps/resolve-deps.ts"
24
24
  },
25
25
  "dependencies": {
26
- "@nuasite/agent-summary": "0.0.33",
26
+ "@nuasite/agent-summary": "0.0.34",
27
27
  "astro": "5.15.1",
28
28
  "stacktracey": "2.1.8"
29
29
  },