@cleocode/cleo 2026.3.46 → 2026.3.47

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/mcp/index.js CHANGED
@@ -34804,6 +34804,7 @@ __export(scaffold_exports, {
34804
34804
  CLEO_GITIGNORE_FALLBACK: () => CLEO_GITIGNORE_FALLBACK,
34805
34805
  REQUIRED_CLEO_SUBDIRS: () => REQUIRED_CLEO_SUBDIRS,
34806
34806
  REQUIRED_GLOBAL_SUBDIRS: () => REQUIRED_GLOBAL_SUBDIRS,
34807
+ STALE_GLOBAL_ENTRIES: () => STALE_GLOBAL_ENTRIES,
34807
34808
  checkBrainDb: () => checkBrainDb,
34808
34809
  checkCleoGitRepo: () => checkCleoGitRepo,
34809
34810
  checkCleoStructure: () => checkCleoStructure,
@@ -34840,7 +34841,7 @@ __export(scaffold_exports, {
34840
34841
  import { execFile as execFile3 } from "node:child_process";
34841
34842
  import { randomUUID } from "node:crypto";
34842
34843
  import { existsSync as existsSync34, constants as fsConstants3, readFileSync as readFileSync22, statSync as statSync8 } from "node:fs";
34843
- import { access as access3, mkdir as mkdir5, readFile as readFile6, writeFile as writeFile5 } from "node:fs/promises";
34844
+ import { access as access3, mkdir as mkdir5, readFile as readFile6, rm as rm2, writeFile as writeFile5 } from "node:fs/promises";
34844
34845
  import { dirname as dirname8, join as join37, resolve as resolve5 } from "node:path";
34845
34846
  import { fileURLToPath as fileURLToPath4 } from "node:url";
34846
34847
  import { promisify as promisify3 } from "node:util";
@@ -34855,7 +34856,7 @@ async function fileExists(path2) {
34855
34856
  async function stripCLEOBlocks(filePath) {
34856
34857
  if (!existsSync34(filePath)) return;
34857
34858
  const content = await readFile6(filePath, "utf8");
34858
- const stripped = content.replace(/\n?<!-- CLEO:START -->[\s\S]*?<!-- CLEO:END -->\n?/g, "");
34859
+ const stripped = content.replace(/\n?<!-- CLEO:START[^>]*-->[\s\S]*?<!-- CLEO:END -->\n?/g, "");
34859
34860
  if (stripped !== content) await writeFile5(filePath, stripped, "utf8");
34860
34861
  }
34861
34862
  async function removeCleoFromRootGitignore(projectRoot) {
@@ -35538,6 +35539,19 @@ async function ensureGlobalHome() {
35538
35539
  for (const subdir of REQUIRED_GLOBAL_SUBDIRS) {
35539
35540
  await mkdir5(join37(cleoHome, subdir), { recursive: true });
35540
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
+ );
35552
+ }
35553
+ }
35554
+ }
35541
35555
  return {
35542
35556
  action: alreadyExists ? "skipped" : "created",
35543
35557
  path: cleoHome,
@@ -35652,7 +35666,7 @@ function checkLogDir(projectRoot) {
35652
35666
  fix: null
35653
35667
  };
35654
35668
  }
35655
- var execFileAsync3, REQUIRED_CLEO_SUBDIRS, CLEO_GITIGNORE_FALLBACK, REQUIRED_GLOBAL_SUBDIRS;
35669
+ var execFileAsync3, REQUIRED_CLEO_SUBDIRS, CLEO_GITIGNORE_FALLBACK, REQUIRED_GLOBAL_SUBDIRS, STALE_GLOBAL_ENTRIES;
35656
35670
  var init_scaffold = __esm({
35657
35671
  "packages/core/src/scaffold.ts"() {
35658
35672
  "use strict";
@@ -35710,6 +35724,20 @@ metrics/
35710
35724
  backups/
35711
35725
  `;
35712
35726
  REQUIRED_GLOBAL_SUBDIRS = ["logs", "templates"];
35727
+ STALE_GLOBAL_ENTRIES = [
35728
+ "adrs",
35729
+ "rcasd",
35730
+ "agent-outputs",
35731
+ "backups",
35732
+ "sandbox",
35733
+ "tasks.db",
35734
+ "tasks.db-shm",
35735
+ "tasks.db-wal",
35736
+ "brain-worker.pid",
35737
+ "VERSION",
35738
+ "schemas",
35739
+ "bin"
35740
+ ];
35713
35741
  }
35714
35742
  });
35715
35743
 
@@ -39445,8 +39473,8 @@ function parseTokenMetrics(inputFile, cwd) {
39445
39473
  const raw = JSON.parse(readFileSync28(file2, "utf-8"));
39446
39474
  if (raw.resourceMetrics) {
39447
39475
  const points = [];
39448
- for (const rm2 of raw.resourceMetrics ?? []) {
39449
- for (const sm of rm2.scopeMetrics ?? []) {
39476
+ for (const rm3 of raw.resourceMetrics ?? []) {
39477
+ for (const sm of rm3.scopeMetrics ?? []) {
39450
39478
  for (const metric of sm.metrics ?? []) {
39451
39479
  if (metric.name !== "claude_code.token.usage") continue;
39452
39480
  for (const dp of metric.sum?.dataPoints ?? []) {
@@ -65273,6 +65301,7 @@ async function bootstrapGlobalCleo(options) {
65273
65301
  await injectAgentsHub(ctx);
65274
65302
  await installMcpToProviders(ctx);
65275
65303
  await installSkillsGlobally(ctx);
65304
+ await installAgentDefinitionGlobally(ctx);
65276
65305
  await installProviderAdapters(ctx, options?.packageRoot);
65277
65306
  return ctx;
65278
65307
  }
@@ -65323,7 +65352,10 @@ async function injectAgentsHub(ctx) {
65323
65352
  await mkdir17(globalAgentsDir, { recursive: true });
65324
65353
  if (existsSync103(globalAgentsMd)) {
65325
65354
  const content = await readFile19(globalAgentsMd, "utf8");
65326
- const stripped = content.replace(/\n?<!-- CLEO:START -->[\s\S]*?<!-- CLEO:END -->\n?/g, "");
65355
+ const stripped = content.replace(
65356
+ /\n?<!-- CLEO:START[^>]*-->[\s\S]*?<!-- CLEO:END -->\n?/g,
65357
+ ""
65358
+ );
65327
65359
  if (stripped !== content) {
65328
65360
  await writeFile12(globalAgentsMd, stripped, "utf8");
65329
65361
  }
@@ -65347,7 +65379,7 @@ async function injectAgentsHub(ctx) {
65347
65379
  if (existsSync103(instructFilePath)) {
65348
65380
  const fileContent = await readFile19(instructFilePath, "utf8");
65349
65381
  const stripped = fileContent.replace(
65350
- /\n?<!-- CLEO:START -->[\s\S]*?<!-- CLEO:END -->\n?/g,
65382
+ /\n?<!-- CLEO:START[^>]*-->[\s\S]*?<!-- CLEO:END -->\n?/g,
65351
65383
  ""
65352
65384
  );
65353
65385
  if (stripped !== fileContent) {
@@ -65416,6 +65448,20 @@ async function installSkillsGlobally(ctx) {
65416
65448
  );
65417
65449
  }
65418
65450
  }
65451
+ async function installAgentDefinitionGlobally(ctx) {
65452
+ try {
65453
+ if (!ctx.isDryRun) {
65454
+ const { initAgentDefinition: initAgentDefinition2 } = await Promise.resolve().then(() => (init_init(), init_exports));
65455
+ await initAgentDefinition2(ctx.created, ctx.warnings);
65456
+ } else {
65457
+ ctx.created.push("agent: cleo-subagent (would symlink)");
65458
+ }
65459
+ } catch (err) {
65460
+ ctx.warnings.push(
65461
+ `Agent definition install: ${err instanceof Error ? err.message : String(err)}`
65462
+ );
65463
+ }
65464
+ }
65419
65465
  async function installProviderAdapters(ctx, packageRootOverride) {
65420
65466
  try {
65421
65467
  const { AdapterManager: AdapterManager2 } = await Promise.resolve().then(() => (init_adapters(), adapters_exports));