@cleocode/core 2026.3.51 → 2026.3.53

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.
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAWH,iEAAiE;AACjE,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,uCAAuC;AACvC,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAiC/F;AAkID;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmChF;AAID;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAahF"}
1
+ {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAWH,iEAAiE;AACjE,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,uCAAuC;AACvC,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAiC/F;AAiID;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmChF;AAID;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAahF"}
package/dist/index.js CHANGED
@@ -19748,16 +19748,33 @@ async function ensureGlobalHome() {
19748
19748
  for (const subdir of REQUIRED_GLOBAL_SUBDIRS) {
19749
19749
  await mkdir5(join37(cleoHome, subdir), { recursive: true });
19750
19750
  }
19751
- for (const stale of STALE_GLOBAL_ENTRIES) {
19752
- const stalePath = join37(cleoHome, stale);
19753
- if (existsSync33(stalePath)) {
19754
- try {
19755
- await rm2(stalePath, { recursive: true, force: true });
19756
- console.warn(`[CLEO] Removed stale global entry: ${stalePath}`);
19757
- } catch (err) {
19758
- console.warn(
19759
- `[CLEO] Could not remove stale global entry ${stalePath}: ${err instanceof Error ? err.message : String(err)}`
19760
- );
19751
+ const globalConfigPath = join37(cleoHome, "config.json");
19752
+ if (!existsSync33(globalConfigPath)) {
19753
+ const templatePath = join37(getPackageRoot(), "templates", "global-config.template.json");
19754
+ if (existsSync33(templatePath)) {
19755
+ const template = readFileSync22(templatePath, "utf-8");
19756
+ const resolved = template.replace("{{SCHEMA_VERSION_GLOBAL_CONFIG}}", "1.0.0");
19757
+ await writeFile5(globalConfigPath, resolved);
19758
+ }
19759
+ }
19760
+ const homedir7 = (await import("node:os")).homedir();
19761
+ const legacyCleoHome = join37(homedir7, ".cleo");
19762
+ const cleanupPaths = [cleoHome];
19763
+ if (legacyCleoHome !== cleoHome && existsSync33(legacyCleoHome)) {
19764
+ cleanupPaths.push(legacyCleoHome);
19765
+ }
19766
+ for (const homeDir of cleanupPaths) {
19767
+ for (const stale of STALE_GLOBAL_ENTRIES) {
19768
+ const stalePath = join37(homeDir, stale);
19769
+ if (existsSync33(stalePath)) {
19770
+ try {
19771
+ await rm2(stalePath, { recursive: true, force: true });
19772
+ console.warn(`[CLEO] Removed stale global entry: ${stalePath}`);
19773
+ } catch (err) {
19774
+ console.warn(
19775
+ `[CLEO] Could not remove stale global entry ${stalePath}: ${err instanceof Error ? err.message : String(err)}`
19776
+ );
19777
+ }
19761
19778
  }
19762
19779
  }
19763
19780
  }
@@ -19945,7 +19962,9 @@ backups/
19945
19962
  "brain-worker.pid",
19946
19963
  "VERSION",
19947
19964
  "schemas",
19948
- "bin"
19965
+ "bin",
19966
+ ".install-state",
19967
+ "templates/templates"
19949
19968
  ];
19950
19969
  }
19951
19970
  });
@@ -62566,9 +62585,13 @@ async function injectAgentsHub(ctx) {
62566
62585
  await mkdir17(globalAgentsDir, { recursive: true });
62567
62586
  if (existsSync102(globalAgentsMd)) {
62568
62587
  const content = await readFile19(globalAgentsMd, "utf8");
62569
- const stripped = content.replace(/\n?<!-- CLEO:START[^>]*-->[\s\S]*?<!-- CLEO:END -->\n?/g, "").replace(/\n?<!-- CAAMP:START -->[\s\S]*?<!-- CAAMP:END -->\n?/g, "").trim();
62570
- await writeFile12(globalAgentsMd, stripped ? `${stripped}
62571
- ` : "", "utf8");
62588
+ const stripped = content.replace(
62589
+ /\n?<!-- CLEO:START[^>]*-->[\s\S]*?<!-- CLEO:END -->\n?/g,
62590
+ ""
62591
+ );
62592
+ if (stripped !== content) {
62593
+ await writeFile12(globalAgentsMd, stripped, "utf8");
62594
+ }
62572
62595
  }
62573
62596
  const expectedContent = "@~/.cleo/templates/CLEO-INJECTION.md";
62574
62597
  const action = await inject2(globalAgentsMd, expectedContent);