@cleocode/cleo 2026.3.51 → 2026.3.52

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/cli/index.js CHANGED
@@ -35539,16 +35539,24 @@ async function ensureGlobalHome() {
35539
35539
  for (const subdir of REQUIRED_GLOBAL_SUBDIRS) {
35540
35540
  await mkdir5(join37(cleoHome, subdir), { recursive: true });
35541
35541
  }
35542
- for (const stale of STALE_GLOBAL_ENTRIES) {
35543
- const stalePath = join37(cleoHome, stale);
35544
- if (existsSync34(stalePath)) {
35545
- try {
35546
- await rm2(stalePath, { recursive: true, force: true });
35547
- console.warn(`[CLEO] Removed stale global entry: ${stalePath}`);
35548
- } catch (err) {
35549
- console.warn(
35550
- `[CLEO] Could not remove stale global entry ${stalePath}: ${err instanceof Error ? err.message : String(err)}`
35551
- );
35542
+ const homedir7 = (await import("node:os")).homedir();
35543
+ const legacyCleoHome = join37(homedir7, ".cleo");
35544
+ const cleanupPaths = [cleoHome];
35545
+ if (legacyCleoHome !== cleoHome && existsSync34(legacyCleoHome)) {
35546
+ cleanupPaths.push(legacyCleoHome);
35547
+ }
35548
+ for (const homeDir of cleanupPaths) {
35549
+ for (const stale of STALE_GLOBAL_ENTRIES) {
35550
+ const stalePath = join37(homeDir, stale);
35551
+ if (existsSync34(stalePath)) {
35552
+ try {
35553
+ await rm2(stalePath, { recursive: true, force: true });
35554
+ console.warn(`[CLEO] Removed stale global entry: ${stalePath}`);
35555
+ } catch (err) {
35556
+ console.warn(
35557
+ `[CLEO] Could not remove stale global entry ${stalePath}: ${err instanceof Error ? err.message : String(err)}`
35558
+ );
35559
+ }
35552
35560
  }
35553
35561
  }
35554
35562
  }
@@ -65049,9 +65057,13 @@ async function injectAgentsHub(ctx) {
65049
65057
  await mkdir17(globalAgentsDir, { recursive: true });
65050
65058
  if (existsSync103(globalAgentsMd)) {
65051
65059
  const content = await readFile19(globalAgentsMd, "utf8");
65052
- const stripped = content.replace(/\n?<!-- CLEO:START[^>]*-->[\s\S]*?<!-- CLEO:END -->\n?/g, "").replace(/\n?<!-- CAAMP:START -->[\s\S]*?<!-- CAAMP:END -->\n?/g, "").trim();
65053
- await writeFile12(globalAgentsMd, stripped ? `${stripped}
65054
- ` : "", "utf8");
65060
+ const stripped = content.replace(
65061
+ /\n?<!-- CLEO:START[^>]*-->[\s\S]*?<!-- CLEO:END -->\n?/g,
65062
+ ""
65063
+ );
65064
+ if (stripped !== content) {
65065
+ await writeFile12(globalAgentsMd, stripped, "utf8");
65066
+ }
65055
65067
  }
65056
65068
  const expectedContent = "@~/.cleo/templates/CLEO-INJECTION.md";
65057
65069
  const action = await inject2(globalAgentsMd, expectedContent);