@cleocode/cleo 2026.3.47 → 2026.3.48

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
@@ -34691,7 +34691,7 @@ function checkInjection2(projectRoot) {
34691
34691
  status: "warning",
34692
34692
  message: "AGENTS.md not found in project root",
34693
34693
  details: { path: agentsMdPath, exists: false },
34694
- fix: "cleo init --update-docs"
34694
+ fix: "cleo upgrade"
34695
34695
  };
34696
34696
  }
34697
34697
  let content;
@@ -34716,7 +34716,7 @@ function checkInjection2(projectRoot) {
34716
34716
  status: "warning",
34717
34717
  message: "AGENTS.md exists but has no CAAMP markers",
34718
34718
  details: { path: agentsMdPath, hasCaampMarker: false },
34719
- fix: "cleo init --update-docs"
34719
+ fix: "cleo upgrade"
34720
34720
  };
34721
34721
  }
34722
34722
  if (startCount !== endCount) {
@@ -34726,7 +34726,7 @@ function checkInjection2(projectRoot) {
34726
34726
  status: "warning",
34727
34727
  message: `CAAMP markers unbalanced: ${startCount} START vs ${endCount} END`,
34728
34728
  details: { path: agentsMdPath, startCount, endCount },
34729
- fix: "cleo init --update-docs"
34729
+ fix: "cleo upgrade"
34730
34730
  };
34731
34731
  }
34732
34732
  const caampMatch = content.match(/<!-- CAAMP:START -->([\s\S]*?)<!-- CAAMP:END -->/);
@@ -34748,7 +34748,7 @@ function checkInjection2(projectRoot) {
34748
34748
  status: "warning",
34749
34749
  message: `Missing @ reference targets: ${missing.join(", ")}`,
34750
34750
  details: { path: agentsMdPath, missing, totalRefs: refs.length },
34751
- fix: "cleo init --update-docs"
34751
+ fix: "cleo upgrade"
34752
34752
  };
34753
34753
  }
34754
34754
  }
@@ -34765,7 +34765,7 @@ function checkInjection2(projectRoot) {
34765
34765
  status: "warning",
34766
34766
  message: `CLAUDE.md CAAMP markers unbalanced: ${cStartCount} START vs ${cEndCount} END`,
34767
34767
  details: { file: "CLAUDE.md", startCount: cStartCount, endCount: cEndCount },
34768
- fix: "cleo init --update-docs"
34768
+ fix: "cleo upgrade"
34769
34769
  };
34770
34770
  }
34771
34771
  if (cStartCount === 0) {
@@ -34775,7 +34775,7 @@ function checkInjection2(projectRoot) {
34775
34775
  status: "warning",
34776
34776
  message: "CLAUDE.md has no CAAMP markers",
34777
34777
  details: { file: "CLAUDE.md", hasCaampMarker: false },
34778
- fix: "cleo init --update-docs"
34778
+ fix: "cleo upgrade"
34779
34779
  };
34780
34780
  }
34781
34781
  } catch {
@@ -57677,7 +57677,7 @@ function checkAgentsMdHub(projectRoot) {
57677
57677
  status: "warning",
57678
57678
  message: "AGENTS.md not found in project root",
57679
57679
  details: { path: agentsMdPath, exists: false },
57680
- fix: "cleo init --update-docs"
57680
+ fix: "cleo upgrade"
57681
57681
  };
57682
57682
  }
57683
57683
  let content;
@@ -57700,7 +57700,7 @@ function checkAgentsMdHub(projectRoot) {
57700
57700
  status: "warning",
57701
57701
  message: "AGENTS.md exists but has no CAAMP:START marker",
57702
57702
  details: { path: agentsMdPath, hasCaampMarker: false },
57703
- fix: "cleo init --update-docs"
57703
+ fix: "cleo upgrade"
57704
57704
  };
57705
57705
  }
57706
57706
  return {
@@ -58039,7 +58039,7 @@ function checkCaampMarkerIntegrity(projectRoot) {
58039
58039
  status: "warning",
58040
58040
  message: `CAAMP marker issues: ${issues.join("; ")}`,
58041
58041
  details: { issues },
58042
- fix: "cleo init --update-docs"
58042
+ fix: "cleo upgrade"
58043
58043
  };
58044
58044
  }
58045
58045
  return {
@@ -58105,7 +58105,7 @@ function checkAtReferenceTargetExists(projectRoot) {
58105
58105
  status: "warning",
58106
58106
  message: `Missing @ reference targets: ${missing.join(", ")}`,
58107
58107
  details: { missing, totalRefs: refs.length },
58108
- fix: "cleo init --update-docs"
58108
+ fix: "cleo upgrade"
58109
58109
  };
58110
58110
  }
58111
58111
  return {
@@ -64511,9 +64511,6 @@ async function updateDocs() {
64511
64511
  };
64512
64512
  }
64513
64513
  async function initProject(opts = {}) {
64514
- if (opts.updateDocs) {
64515
- return updateDocs();
64516
- }
64517
64514
  const cleoDir = getCleoDirAbsolute();
64518
64515
  const projRoot = getProjectRoot();
64519
64516
  const alreadyInitialized = existsSync100(cleoDir) && (existsSync100(join100(cleoDir, "tasks.db")) || existsSync100(join100(cleoDir, "config.json")));
@@ -64880,7 +64877,13 @@ var init_output = __esm({
64880
64877
  });
64881
64878
 
64882
64879
  // packages/core/src/project-info.ts
64883
- import { existsSync as existsSync102, readFileSync as readFileSync75 } from "node:fs";
64880
+ var project_info_exports = {};
64881
+ __export(project_info_exports, {
64882
+ getProjectInfo: () => getProjectInfo,
64883
+ getProjectInfoSync: () => getProjectInfoSync,
64884
+ updateProjectName: () => updateProjectName
64885
+ });
64886
+ import { existsSync as existsSync102, readFileSync as readFileSync75, writeFileSync as writeFileSync19 } from "node:fs";
64884
64887
  import { readFile as readFile18 } from "node:fs/promises";
64885
64888
  import { join as join102 } from "node:path";
64886
64889
  async function getProjectInfo(cwd) {
@@ -64924,6 +64927,16 @@ function getProjectInfoSync(cwd) {
64924
64927
  return null;
64925
64928
  }
64926
64929
  }
64930
+ function updateProjectName(cwd, name2) {
64931
+ const cleoDir = getCleoDirAbsolute(cwd);
64932
+ const infoPath = join102(cleoDir, "project-info.json");
64933
+ if (!existsSync102(infoPath)) return;
64934
+ const data = JSON.parse(readFileSync75(infoPath, "utf-8"));
64935
+ data.projectName = name2;
64936
+ data.lastUpdated = (/* @__PURE__ */ new Date()).toISOString();
64937
+ writeFileSync19(infoPath, `${JSON.stringify(data, null, 2)}
64938
+ `);
64939
+ }
64927
64940
  var init_project_info = __esm({
64928
64941
  "packages/core/src/project-info.ts"() {
64929
64942
  "use strict";
@@ -65199,7 +65212,6 @@ var init_cleo = __esm({
65199
65212
  // packages/core/src/index.ts
65200
65213
  var init_src2 = __esm({
65201
65214
  "packages/core/src/index.ts"() {
65202
- "use strict";
65203
65215
  init_src();
65204
65216
  init_adapters();
65205
65217
  init_admin();
@@ -72131,7 +72143,7 @@ import {
72131
72143
  mkdirSync as mkdirSync23,
72132
72144
  readdirSync as readdirSync36,
72133
72145
  readFileSync as readFileSync82,
72134
- writeFileSync as writeFileSync19
72146
+ writeFileSync as writeFileSync20
72135
72147
  } from "node:fs";
72136
72148
  import { join as join108 } from "node:path";
72137
72149
  async function runUpgrade(options = {}) {
@@ -72277,7 +72289,7 @@ async function runUpgrade(options = {}) {
72277
72289
  if (totalImported === 0 && existsSync110(dbBackupPath)) {
72278
72290
  copyFileSync7(dbBackupPath, dbPath2);
72279
72291
  if (configBackup) {
72280
- writeFileSync19(configPath, configBackup);
72292
+ writeFileSync20(configPath, configBackup);
72281
72293
  }
72282
72294
  actions.push({
72283
72295
  action: "storage_migration",
@@ -72298,7 +72310,7 @@ async function runUpgrade(options = {}) {
72298
72310
  config2.storage = {};
72299
72311
  }
72300
72312
  config2.storage.engine = "sqlite";
72301
- writeFileSync19(configPath, JSON.stringify(config2, null, 2));
72313
+ writeFileSync20(configPath, JSON.stringify(config2, null, 2));
72302
72314
  actions.push({
72303
72315
  action: "storage_migration",
72304
72316
  status: "applied",
@@ -72320,7 +72332,7 @@ async function runUpgrade(options = {}) {
72320
72332
  copyFileSync7(dbBackupPath, dbPath2);
72321
72333
  }
72322
72334
  if (configBackup) {
72323
- writeFileSync19(configPath, configBackup);
72335
+ writeFileSync20(configPath, configBackup);
72324
72336
  }
72325
72337
  await updateMigrationPhase2(cleoDir2, "failed");
72326
72338
  for (const error40 of result.errors) {
@@ -72573,7 +72585,9 @@ async function runUpgrade(options = {}) {
72573
72585
  }
72574
72586
  }
72575
72587
  } else {
72576
- const contextResult = await ensureProjectContext(projectRootForContext, { staleDays: 30 });
72588
+ const contextResult = await ensureProjectContext(projectRootForContext, {
72589
+ staleDays: options.forceDetect ? 0 : 30
72590
+ });
72577
72591
  actions.push({
72578
72592
  action: "project_context_detection",
72579
72593
  status: contextResult.action === "skipped" ? "skipped" : "applied",
@@ -72771,6 +72785,35 @@ async function runUpgrade(options = {}) {
72771
72785
  }
72772
72786
  } catch {
72773
72787
  }
72788
+ if (options.mapCodebase) {
72789
+ try {
72790
+ const { mapCodebase: mapCodebase3 } = await Promise.resolve().then(() => (init_codebase_map(), codebase_map_exports));
72791
+ const mapResult = await mapCodebase3(projectRootForMaint, { storeToBrain: true });
72792
+ actions.push({
72793
+ action: "codebase_map",
72794
+ status: "applied",
72795
+ details: `Analyzed: ${mapResult.stack?.languages?.length ?? 0} languages, ${mapResult.concerns?.todos?.length ?? 0} TODOs found`
72796
+ });
72797
+ } catch (err) {
72798
+ actions.push({
72799
+ action: "codebase_map",
72800
+ status: "error",
72801
+ details: `Codebase mapping failed: ${err instanceof Error ? err.message : String(err)}`
72802
+ });
72803
+ }
72804
+ }
72805
+ if (options.projectName) {
72806
+ try {
72807
+ const { updateProjectName: updateProjectName2 } = await Promise.resolve().then(() => (init_project_info(), project_info_exports));
72808
+ await updateProjectName2(projectRootForMaint, options.projectName);
72809
+ actions.push({
72810
+ action: "project_name_update",
72811
+ status: "applied",
72812
+ details: `Project name set to "${options.projectName}"`
72813
+ });
72814
+ } catch {
72815
+ }
72816
+ }
72774
72817
  try {
72775
72818
  const { existsSync: fsExistsSync } = await import("node:fs");
72776
72819
  const { join: pathJoin } = await import("node:path");