@cleocode/cleo 2026.8.3 → 2026.8.4

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 (77) hide show
  1. package/dist/cli/index.js +140 -104
  2. package/dist/cli/index.js.map +3 -3
  3. package/package.json +13 -13
  4. package/studio-dist/client/_app/immutable/chunks/{B_IgYp0Q.js → BUGCWghM.js} +1 -1
  5. package/studio-dist/client/_app/immutable/chunks/BYc4Jvn4.js +1 -0
  6. package/studio-dist/client/_app/immutable/chunks/{CKl0GUXg.js → Buy7LnV8.js} +1 -1
  7. package/studio-dist/client/_app/immutable/chunks/{Cnf8fGu7.js → DE-1PFLR.js} +1 -1
  8. package/studio-dist/client/_app/immutable/entry/{app.BCazOf3D.js → app.qaAaulo2.js} +2 -2
  9. package/studio-dist/client/_app/immutable/entry/start.geHIExPE.js +1 -0
  10. package/studio-dist/client/_app/immutable/nodes/{0.DkQR1Qhk.js → 0.DukdGTgf.js} +1 -1
  11. package/studio-dist/client/_app/immutable/nodes/{1.sQRW-2Yx.js → 1.B5QmqOp_.js} +1 -1
  12. package/studio-dist/client/_app/immutable/nodes/{15.Bthdk1uH.js → 15.C8C7o4Ke.js} +1 -1
  13. package/studio-dist/client/_app/immutable/nodes/{16.E0OqiJHc.js → 16.gWaB82Pi.js} +1 -1
  14. package/studio-dist/client/_app/immutable/nodes/{17.D5s8A2vJ.js → 17.DArfjohh.js} +1 -1
  15. package/studio-dist/client/_app/immutable/nodes/{18.BGJV6j5H.js → 18.bLTgiKRB.js} +1 -1
  16. package/studio-dist/client/_app/immutable/nodes/{20.D5Qgiozt.js → 20.CiZMN_Ni.js} +1 -1
  17. package/studio-dist/client/_app/immutable/nodes/{24.fg7r7xAq.js → 24.BOeywHAp.js} +1 -1
  18. package/studio-dist/client/_app/immutable/nodes/{25.DMINB1-t.js → 25.-wr6OrE5.js} +1 -1
  19. package/studio-dist/client/_app/immutable/nodes/{26.D5JsjBp1.js → 26.AjZ_Fv7F.js} +1 -1
  20. package/studio-dist/client/_app/immutable/nodes/{3.CbKDVLlu.js → 3.3BhS05qm.js} +1 -1
  21. package/studio-dist/client/_app/version.json +1 -1
  22. package/studio-dist/server/chunks/{0-CrN368X_.js → 0-Cj8lp-vV.js} +3 -3
  23. package/studio-dist/server/chunks/{0-CrN368X_.js.map → 0-Cj8lp-vV.js.map} +1 -1
  24. package/studio-dist/server/chunks/{1-CfcFNOpp.js → 1-mvAddk8l.js} +3 -3
  25. package/studio-dist/server/chunks/{1-CfcFNOpp.js.map → 1-mvAddk8l.js.map} +1 -1
  26. package/studio-dist/server/chunks/{15-tVNJQWMr.js → 15-BaFi1Rz0.js} +3 -3
  27. package/studio-dist/server/chunks/{15-tVNJQWMr.js.map → 15-BaFi1Rz0.js.map} +1 -1
  28. package/studio-dist/server/chunks/{16-BokuGN_z.js → 16-DaoLkZbH.js} +3 -3
  29. package/studio-dist/server/chunks/{16-BokuGN_z.js.map → 16-DaoLkZbH.js.map} +1 -1
  30. package/studio-dist/server/chunks/{17-CDD-Ov5m.js → 17-DE32nTRa.js} +3 -3
  31. package/studio-dist/server/chunks/{17-CDD-Ov5m.js.map → 17-DE32nTRa.js.map} +1 -1
  32. package/studio-dist/server/chunks/{18-DsDyFwyZ.js → 18-DaAfWhLL.js} +3 -3
  33. package/studio-dist/server/chunks/{18-DsDyFwyZ.js.map → 18-DaAfWhLL.js.map} +1 -1
  34. package/studio-dist/server/chunks/{20-ipaJADB4.js → 20-BPT7f_2T.js} +3 -3
  35. package/studio-dist/server/chunks/{20-ipaJADB4.js.map → 20-BPT7f_2T.js.map} +1 -1
  36. package/studio-dist/server/chunks/{24-DMor7iHN.js → 24-Cpe3n5Fe.js} +3 -3
  37. package/studio-dist/server/chunks/{24-DMor7iHN.js.map → 24-Cpe3n5Fe.js.map} +1 -1
  38. package/studio-dist/server/chunks/{25-BMRgppbY.js → 25-BfZnRvHX.js} +3 -3
  39. package/studio-dist/server/chunks/{25-BMRgppbY.js.map → 25-BfZnRvHX.js.map} +1 -1
  40. package/studio-dist/server/chunks/{26-DLr7iTMz.js → 26-CslOdFIr.js} +3 -3
  41. package/studio-dist/server/chunks/{26-DLr7iTMz.js.map → 26-CslOdFIr.js.map} +1 -1
  42. package/studio-dist/server/chunks/{3-CBEuYMKL.js → 3-DMJI0J_l.js} +3 -3
  43. package/studio-dist/server/chunks/{3-CBEuYMKL.js.map → 3-DMJI0J_l.js.map} +1 -1
  44. package/studio-dist/server/chunks/{_layout.svelte-BdYJ0XOr.js → _layout.svelte-Bt5JLnI6.js} +4 -4
  45. package/studio-dist/server/chunks/{_layout.svelte-BdYJ0XOr.js.map → _layout.svelte-Bt5JLnI6.js.map} +1 -1
  46. package/studio-dist/server/chunks/{_page.svelte-DOrUlkcl.js → _page.svelte--X49zLt2.js} +3 -3
  47. package/studio-dist/server/chunks/{_page.svelte-DOrUlkcl.js.map → _page.svelte--X49zLt2.js.map} +1 -1
  48. package/studio-dist/server/chunks/{_page.svelte-anmDho-n.js → _page.svelte-BsnroOSv.js} +3 -3
  49. package/studio-dist/server/chunks/{_page.svelte-anmDho-n.js.map → _page.svelte-BsnroOSv.js.map} +1 -1
  50. package/studio-dist/server/chunks/{_page.svelte-CDOTeiB_.js → _page.svelte-C8U3IifT.js} +3 -3
  51. package/studio-dist/server/chunks/{_page.svelte-CDOTeiB_.js.map → _page.svelte-C8U3IifT.js.map} +1 -1
  52. package/studio-dist/server/chunks/{_page.svelte-CU_2T-us.js → _page.svelte-C9fNWql1.js} +4 -4
  53. package/studio-dist/server/chunks/{_page.svelte-CU_2T-us.js.map → _page.svelte-C9fNWql1.js.map} +1 -1
  54. package/studio-dist/server/chunks/{_page.svelte-DG43u848.js → _page.svelte-CmfYjWds.js} +3 -3
  55. package/studio-dist/server/chunks/{_page.svelte-DG43u848.js.map → _page.svelte-CmfYjWds.js.map} +1 -1
  56. package/studio-dist/server/chunks/{_page.svelte-C1SLWnmf.js → _page.svelte-DiklQPxf.js} +3 -3
  57. package/studio-dist/server/chunks/{_page.svelte-C1SLWnmf.js.map → _page.svelte-DiklQPxf.js.map} +1 -1
  58. package/studio-dist/server/chunks/{_page.svelte-DBJqZ4tH.js → _page.svelte-Dss1dsLk.js} +4 -4
  59. package/studio-dist/server/chunks/{_page.svelte-DBJqZ4tH.js.map → _page.svelte-Dss1dsLk.js.map} +1 -1
  60. package/studio-dist/server/chunks/{_page.svelte-BmKwnSmo.js → _page.svelte-l8g_SB07.js} +3 -3
  61. package/studio-dist/server/chunks/{_page.svelte-BmKwnSmo.js.map → _page.svelte-l8g_SB07.js.map} +1 -1
  62. package/studio-dist/server/chunks/{_page.svelte-N1-4fyD8.js → _page.svelte-sKCSKyCk.js} +3 -3
  63. package/studio-dist/server/chunks/{_page.svelte-N1-4fyD8.js.map → _page.svelte-sKCSKyCk.js.map} +1 -1
  64. package/studio-dist/server/chunks/{client-CpS5Z5ic.js → client-0XYxDqM7.js} +2 -2
  65. package/studio-dist/server/chunks/{client-CpS5Z5ic.js.map → client-0XYxDqM7.js.map} +1 -1
  66. package/studio-dist/server/chunks/{error.svelte-OTAkvfqc.js → error.svelte-uwNG2w3h.js} +3 -3
  67. package/studio-dist/server/chunks/{error.svelte-OTAkvfqc.js.map → error.svelte-uwNG2w3h.js.map} +1 -1
  68. package/studio-dist/server/chunks/{internal-DRwgsLmF.js → internal-C6KP7eXK.js} +2 -2
  69. package/studio-dist/server/chunks/{internal-DRwgsLmF.js.map → internal-C6KP7eXK.js.map} +1 -1
  70. package/studio-dist/server/chunks/{stores-kdOSK__S.js → stores-tMbHvxQz.js} +2 -2
  71. package/studio-dist/server/chunks/{stores-kdOSK__S.js.map → stores-tMbHvxQz.js.map} +1 -1
  72. package/studio-dist/server/index.js +1 -1
  73. package/studio-dist/server/index.js.map +1 -1
  74. package/studio-dist/server/manifest.js +12 -12
  75. package/studio-dist/server/manifest.js.map +1 -1
  76. package/studio-dist/client/_app/immutable/chunks/DWgHjJc2.js +0 -1
  77. package/studio-dist/client/_app/immutable/entry/start.BmXgG-qs.js +0 -1
package/dist/cli/index.js CHANGED
@@ -31898,8 +31898,8 @@ async function loadPlaybookByName(name) {
31898
31898
  return null;
31899
31899
  }
31900
31900
  try {
31901
- const { getProjectRoot: getProjectRoot62 } = await import("@cleocode/core/internal");
31902
- const projectRoot = __playbookRuntimeOverrides.projectRoot ?? getProjectRoot62();
31901
+ const { getProjectRoot: getProjectRoot63 } = await import("@cleocode/core/internal");
31902
+ const projectRoot = __playbookRuntimeOverrides.projectRoot ?? getProjectRoot63();
31903
31903
  const resolved = resolvePlaybook(name, {
31904
31904
  projectRoot,
31905
31905
  globalPlaybooksDir: __playbookRuntimeOverrides.globalPlaybooksDir,
@@ -31944,7 +31944,7 @@ async function buildDefaultDispatcher() {
31944
31944
  if (__playbookRuntimeOverrides.dispatcher) return __playbookRuntimeOverrides.dispatcher;
31945
31945
  const { orchestrateSpawnExecute: orchestrateSpawnExecute2 } = await import("@cleocode/runtime/gateway");
31946
31946
  const {
31947
- getProjectRoot: getProjectRoot62,
31947
+ getProjectRoot: getProjectRoot63,
31948
31948
  createToolGuard,
31949
31949
  runSkillNodeOrSpawn,
31950
31950
  maybeCreatePiRunner,
@@ -31952,7 +31952,7 @@ async function buildDefaultDispatcher() {
31952
31952
  hasCantbookProfilePin,
31953
31953
  DEFAULT_DETERMINISTIC_DENIED_COMMANDS
31954
31954
  } = await import("@cleocode/core/internal");
31955
- const projectRoot = getProjectRoot62();
31955
+ const projectRoot = getProjectRoot63();
31956
31956
  const tools = createToolGuard({
31957
31957
  allowedRoots: [projectRoot],
31958
31958
  deniedCommands: DEFAULT_DETERMINISTIC_DENIED_COMMANDS,
@@ -32045,12 +32045,12 @@ async function buildDefaultDeterministicRunner() {
32045
32045
  return void 0;
32046
32046
  }
32047
32047
  const {
32048
- getProjectRoot: getProjectRoot62,
32048
+ getProjectRoot: getProjectRoot63,
32049
32049
  createToolGuard,
32050
32050
  createGuardedDeterministicRunner,
32051
32051
  DEFAULT_DETERMINISTIC_DENIED_COMMANDS
32052
32052
  } = await import("@cleocode/core/internal");
32053
- const projectRoot = getProjectRoot62();
32053
+ const projectRoot = getProjectRoot63();
32054
32054
  const tools = createToolGuard({
32055
32055
  allowedRoots: [projectRoot],
32056
32056
  deniedCommands: DEFAULT_DETERMINISTIC_DENIED_COMMANDS,
@@ -32208,8 +32208,8 @@ var init_playbook2 = __esm({
32208
32208
  projectRoot = __playbookRuntimeOverrides.projectRoot;
32209
32209
  } else {
32210
32210
  try {
32211
- const { getProjectRoot: getProjectRoot62 } = await import("@cleocode/core/internal");
32212
- projectRoot = getProjectRoot62();
32211
+ const { getProjectRoot: getProjectRoot63 } = await import("@cleocode/core/internal");
32212
+ projectRoot = getProjectRoot63();
32213
32213
  } catch {
32214
32214
  projectRoot = void 0;
32215
32215
  }
@@ -32274,14 +32274,14 @@ var init_playbook2 = __esm({
32274
32274
  const deterministicRunner = await buildDefaultDeterministicRunner();
32275
32275
  let result;
32276
32276
  try {
32277
- const { getProjectRoot: getProjectRoot62 } = await import("@cleocode/core/internal");
32277
+ const { getProjectRoot: getProjectRoot63 } = await import("@cleocode/core/internal");
32278
32278
  const opts = {
32279
32279
  db,
32280
32280
  playbook: parsed.definition,
32281
32281
  playbookHash: parsed.sourceHash,
32282
32282
  initialContext,
32283
32283
  dispatcher,
32284
- projectRoot: getProjectRoot62()
32284
+ projectRoot: getProjectRoot63()
32285
32285
  };
32286
32286
  if (deterministicRunner !== void 0) opts.deterministicRunner = deterministicRunner;
32287
32287
  if (__playbookRuntimeOverrides.approvalSecret !== void 0) {
@@ -39409,11 +39409,11 @@ var init_security = __esm({
39409
39409
  });
39410
39410
 
39411
39411
  // packages/cleo/src/dispatch/middleware/sanitizer.ts
39412
- function createSanitizer(getProjectRoot62) {
39412
+ function createSanitizer(getProjectRoot63) {
39413
39413
  return async (req, next) => {
39414
39414
  if (req.params) {
39415
39415
  try {
39416
- const root = getProjectRoot62 ? getProjectRoot62() : void 0;
39416
+ const root = getProjectRoot63 ? getProjectRoot63() : void 0;
39417
39417
  req.params = sanitizeParams(req.params, root, {
39418
39418
  domain: req.domain,
39419
39419
  operation: req.operation
@@ -46047,9 +46047,9 @@ var init_backup = __esm({
46047
46047
  async run({ args }) {
46048
46048
  const scope = args.scope;
46049
46049
  const { packBundle } = await import("@cleocode/core/store/backup-pack.js");
46050
- const { getProjectRoot: getProjectRoot62 } = await import("@cleocode/core");
46050
+ const { getProjectRoot: getProjectRoot63 } = await import("@cleocode/core");
46051
46051
  const includesProject = scope === "project" || scope === "all";
46052
- const projectRoot = includesProject ? getProjectRoot62() : void 0;
46052
+ const projectRoot = includesProject ? getProjectRoot63() : void 0;
46053
46053
  let passphrase;
46054
46054
  if (args.encrypt === true) {
46055
46055
  passphrase = process.env["CLEO_BACKUP_PASSPHRASE"];
@@ -46125,12 +46125,12 @@ var init_backup = __esm({
46125
46125
  },
46126
46126
  async run({ args }) {
46127
46127
  const bundlePath = args.bundle;
46128
- const { getProjectRoot: getProjectRoot62, getCleoHome: getCleoHome6, getCleoVersion } = await import("@cleocode/core");
46128
+ const { getProjectRoot: getProjectRoot63, getCleoHome: getCleoHome6, getCleoVersion } = await import("@cleocode/core");
46129
46129
  const { BundleError, cleanupStaging, unpackBundle } = await import("@cleocode/core/store/backup-unpack.js");
46130
46130
  const { regenerateConfigJson, regenerateProjectContextJson, regenerateProjectInfoJson } = await import("@cleocode/core/store/regenerators.js");
46131
46131
  const { regenerateAndCompare } = await import("@cleocode/core/store/restore-json-merge.js");
46132
46132
  const { buildConflictReport, writeConflictReport } = await import("@cleocode/core/store/restore-conflict-report.js");
46133
- const projectRoot = getProjectRoot62();
46133
+ const projectRoot = getProjectRoot63();
46134
46134
  if (args.force !== true) {
46135
46135
  const existing = checkForExistingData(projectRoot, getCleoHome6());
46136
46136
  if (existing.length > 0) {
@@ -56563,6 +56563,39 @@ ${this.prefix}: \u2717 ${message}
56563
56563
  }
56564
56564
  });
56565
56565
 
56566
+ // packages/cleo/src/cli/commands/doctor-superseded-store.ts
56567
+ import { getProjectRoot as getProjectRoot44 } from "@cleocode/core";
56568
+ import { scanSupersededStores } from "@cleocode/core/doctor/superseded-store.js";
56569
+ var doctorSupersededStoreCommand;
56570
+ var init_doctor_superseded_store = __esm({
56571
+ "packages/cleo/src/cli/commands/doctor-superseded-store.ts"() {
56572
+ "use strict";
56573
+ init_define_cli_command();
56574
+ init_renderers();
56575
+ doctorSupersededStoreCommand = defineCommand({
56576
+ meta: {
56577
+ name: "superseded-store",
56578
+ description: "Report pre-dual-scope store files (.cleo/tasks.db, .cleo/brain.db) still on disk under their old LIVE names after the cleo.db migration, proving which store holds the data. Read-only \u2014 deletes nothing."
56579
+ },
56580
+ args: {
56581
+ json: { type: "boolean", description: "Output as JSON" },
56582
+ human: { type: "boolean", description: "Force human-readable output" },
56583
+ quiet: { type: "boolean", description: "Suppress non-essential output" }
56584
+ },
56585
+ async run() {
56586
+ const result = scanSupersededStores(getProjectRoot44());
56587
+ cliOutput(result, {
56588
+ command: "doctor",
56589
+ operation: "doctor.superseded-store.run"
56590
+ });
56591
+ if (result.entries.length > 0 && (process.exitCode === void 0 || process.exitCode === 0)) {
56592
+ process.exitCode = 1;
56593
+ }
56594
+ }
56595
+ });
56596
+ }
56597
+ });
56598
+
56566
56599
  // packages/cleo/src/cli/commands/migrate-agents-v2.ts
56567
56600
  var migrate_agents_v2_exports = {};
56568
56601
  __export(migrate_agents_v2_exports, {
@@ -56578,7 +56611,7 @@ import { join as join24 } from "node:path";
56578
56611
  import {
56579
56612
  ensureGlobalAgentRegistryDb,
56580
56613
  getGlobalAgentRegistryNativeDb,
56581
- getProjectRoot as getProjectRoot44,
56614
+ getProjectRoot as getProjectRoot45,
56582
56615
  installAgentFromCant
56583
56616
  } from "@cleocode/core/internal";
56584
56617
  function sha256Hex(bytes) {
@@ -56766,7 +56799,7 @@ var init_migrate_agents_v2 = __esm({
56766
56799
  }
56767
56800
  },
56768
56801
  async run({ args }) {
56769
- const projectRoot = getProjectRoot44();
56802
+ const projectRoot = getProjectRoot45();
56770
56803
  const verbose = args.quiet !== true;
56771
56804
  if (verbose) {
56772
56805
  humanInfo("Scanning .cleo/cant/agents/ and .cleo/agents/ for unregistered agents...");
@@ -56810,7 +56843,7 @@ __export(doctor_exports, {
56810
56843
  });
56811
56844
  import { mkdirSync as mkdirSync4, writeFileSync as writeFileSync4 } from "node:fs";
56812
56845
  import { join as join25 } from "node:path";
56813
- import { getProjectRoot as getProjectRoot45, pushWarning as pushWarning5 } from "@cleocode/core";
56846
+ import { getProjectRoot as getProjectRoot46, pushWarning as pushWarning5 } from "@cleocode/core";
56814
56847
  import { renderInvariantAuditLines } from "@cleocode/core/doctor/invariant-audit-render.js";
56815
56848
  import {
56816
56849
  quarantineRogueCleoDir,
@@ -56934,6 +56967,7 @@ var init_doctor = __esm({
56934
56967
  init_doctor_projects();
56935
56968
  init_doctor_release_readiness();
56936
56969
  init_doctor_repair();
56970
+ init_doctor_superseded_store();
56937
56971
  init_migrate_agents_v2();
56938
56972
  FIXTURE_ID_PATTERNS = [/^E\d+$/, /^T\d+EP$/];
56939
56973
  FIXTURE_TITLE_KEYWORDS = [
@@ -56949,6 +56983,8 @@ var init_doctor = __esm({
56949
56983
  "db-substrate": doctorDbSubstrateCommand,
56950
56984
  // T10309 / Saga T10281 / Epic T10282 — Legacy-backup walker
56951
56985
  "legacy-backups": doctorLegacyBackupsCommand,
56986
+ // T12095 — pre-dual-scope store files still on disk under their old LIVE names
56987
+ "superseded-store": doctorSupersededStoreCommand,
56952
56988
  // T11777 / Saga T11242 / Epic T11249 — exodus stranded-residue check (+ --fix)
56953
56989
  "exodus-residue": doctorExodusResidueCommand,
56954
56990
  // T11837 / Saga T11242 / Epic T11833 — read-only exodus health report
@@ -57161,7 +57197,7 @@ var init_doctor = __esm({
57161
57197
  const { join: pathJoin } = await import("node:path");
57162
57198
  const { existsSync: existsSync24 } = await import("node:fs");
57163
57199
  const { detectAndHealCoreWorktreeLeak } = await import("@cleocode/worktree");
57164
- const projectRoot = getProjectRoot45();
57200
+ const projectRoot = getProjectRoot46();
57165
57201
  let gitRoot = projectRoot;
57166
57202
  try {
57167
57203
  gitRoot = execFile2("git", ["rev-parse", "--show-toplevel"], {
@@ -57213,7 +57249,7 @@ var init_doctor = __esm({
57213
57249
  }
57214
57250
  if (args.brain) {
57215
57251
  const { computeBrainHealthDashboard } = await import("@cleocode/core/memory/brain-health-dashboard.js");
57216
- const projectRoot = getProjectRoot45();
57252
+ const projectRoot = getProjectRoot46();
57217
57253
  const dashboard = await computeBrainHealthDashboard(projectRoot);
57218
57254
  cliOutput(dashboard, { command: "doctor", operation: "doctor.brain" });
57219
57255
  if (dashboard.hasP0Failure) {
@@ -57222,7 +57258,7 @@ var init_doctor = __esm({
57222
57258
  return;
57223
57259
  }
57224
57260
  if (args["scan-test-fixtures-in-prod"]) {
57225
- const projectRoot = getProjectRoot45();
57261
+ const projectRoot = getProjectRoot46();
57226
57262
  const matches = await scanTestFixturesInProd(projectRoot);
57227
57263
  const dryRun = args["dry-run"] !== false && args.quarantine !== true;
57228
57264
  const quarantined = !dryRun && matches.length > 0 ? await quarantineTestFixtures(projectRoot, matches) : void 0;
@@ -57310,7 +57346,7 @@ var init_doctor = __esm({
57310
57346
  progress.complete("Comprehensive diagnostics complete");
57311
57347
  } else if (args["scan-rogue-cleo-dirs"]) {
57312
57348
  progress.step(0, "Scanning for rogue .cleo/ directories");
57313
- const projectRoot = getProjectRoot45();
57349
+ const projectRoot = getProjectRoot46();
57314
57350
  const reports = scanRogueCleoDirs(projectRoot);
57315
57351
  progress.complete(
57316
57352
  `Found ${reports.length} rogue .cleo/ director${reports.length === 1 ? "y" : "ies"}`
@@ -57319,7 +57355,7 @@ var init_doctor = __esm({
57319
57355
  } else if (args["quarantine-rogue-cleo-dirs"]) {
57320
57356
  const isDryRun = args["dry-run"] === true;
57321
57357
  progress.step(0, `${isDryRun ? "[DRY RUN] " : ""}Scanning for rogue .cleo/ directories`);
57322
- const projectRoot = getProjectRoot45();
57358
+ const projectRoot = getProjectRoot46();
57323
57359
  const reports = scanRogueCleoDirs(projectRoot);
57324
57360
  if (reports.length === 0) {
57325
57361
  progress.complete("No rogue .cleo/ directories found \u2014 nothing to quarantine");
@@ -57373,7 +57409,7 @@ var init_doctor = __esm({
57373
57409
  const { detectAndRemoveLegacyGlobalFiles, detectAndRemoveStrayProjectNexus } = await import("@cleocode/core/store/cleanup-legacy.js");
57374
57410
  const { getCleoHome: getCleoHome6 } = await import("@cleocode/core");
57375
57411
  const cleoHome = getCleoHome6();
57376
- const projectRoot = getProjectRoot45();
57412
+ const projectRoot = getProjectRoot46();
57377
57413
  const legacyResult = detectAndRemoveLegacyGlobalFiles(cleoHome);
57378
57414
  const strayResult = detectAndRemoveStrayProjectNexus(projectRoot);
57379
57415
  const isDryRun = args["dry-run"] === true;
@@ -57406,7 +57442,7 @@ var init_doctor = __esm({
57406
57442
  } else if (args["audit-worktree-orphans"]) {
57407
57443
  progress.step(0, "Comprehensive worktree anomaly audit (T9808 / council D009)");
57408
57444
  const { auditWorktreeOrphansComprehensive, scanWorktreeOrphansBudgeted } = await import("@cleocode/core/doctor/worktree-orphans.js");
57409
- const projectRoot = getProjectRoot45();
57445
+ const projectRoot = getProjectRoot46();
57410
57446
  const timeoutSecs = args["timeout"] !== void 0 ? Number.parseInt(String(args["timeout"]), 10) : 30;
57411
57447
  const timeoutMs = Number.isFinite(timeoutSecs) && timeoutSecs > 0 ? timeoutSecs * 1e3 : 3e4;
57412
57448
  const maxEntriesPerLevel = args["max-entries-per-level"] !== void 0 ? Number.parseInt(String(args["max-entries-per-level"]), 10) : 500;
@@ -57463,7 +57499,7 @@ var init_doctor = __esm({
57463
57499
  `${isDryRun ? "[DRY RUN] " : ""}Scanning + pruning worktree-orphan .cleo/ directories`
57464
57500
  );
57465
57501
  const { pruneWorktreeOrphans, scanWorktreeOrphansBudgeted } = await import("@cleocode/core/doctor/worktree-orphans.js");
57466
- const projectRoot = getProjectRoot45();
57502
+ const projectRoot = getProjectRoot46();
57467
57503
  const timeoutSecs = args["timeout"] !== void 0 ? Number.parseInt(String(args["timeout"]), 10) : 30;
57468
57504
  const timeoutMs = Number.isFinite(timeoutSecs) && timeoutSecs > 0 ? timeoutSecs * 1e3 : 3e4;
57469
57505
  const maxEntriesPerLevel = args["max-entries-per-level"] !== void 0 ? Number.parseInt(String(args["max-entries-per-level"]), 10) : 500;
@@ -57542,7 +57578,7 @@ var init_doctor = __esm({
57542
57578
  `${isDryRun ? "[DRY RUN] " : ""}Migrating .cleo/worktree-include \u2192 .worktreeinclude`
57543
57579
  );
57544
57580
  const { migrateWorktreeIncludeFile } = await import("@cleocode/core");
57545
- const projectRoot = getProjectRoot45();
57581
+ const projectRoot = getProjectRoot46();
57546
57582
  const result = await migrateWorktreeIncludeFile(projectRoot, { dryRun: isDryRun });
57547
57583
  progress.complete(`Migration ${result.action}`);
57548
57584
  cliOutput(result, { command: "doctor", operation: "doctor.migrate-worktree-include" });
@@ -57561,7 +57597,7 @@ var init_doctor = __esm({
57561
57597
  const stepLabel = isFocusedAlias ? "Auditing Saga hierarchy for ADR-073 invariants" : "Walking central INVARIANTS_REGISTRY";
57562
57598
  progress.step(0, stepLabel);
57563
57599
  const { auditInvariantRegistry } = await import("@cleocode/core/doctor/invariant-audit.js");
57564
- const projectRoot = getProjectRoot45();
57600
+ const projectRoot = getProjectRoot46();
57565
57601
  const result = await auditInvariantRegistry(projectRoot, { adrFilter });
57566
57602
  const operation = isFocusedAlias ? "doctor.audit-sagas" : "doctor.audit-invariants";
57567
57603
  const summary = `Invariant audit complete \u2014 ${result.totalCount} entries walked, ${result.errorCount} error / ${result.warningCount} warning / ${result.infoCount} info violation(s), ${result.notApplicableCount} not-applicable, ${result.documentedCount} documented`;
@@ -57583,7 +57619,7 @@ var init_doctor = __esm({
57583
57619
  { command: "doctor", operation: "admin.health" }
57584
57620
  );
57585
57621
  try {
57586
- const projectRoot = getProjectRoot45();
57622
+ const projectRoot = getProjectRoot46();
57587
57623
  const conflicts = readMigrationConflicts(projectRoot);
57588
57624
  if (conflicts.length > 0) {
57589
57625
  progress.complete(
@@ -57614,7 +57650,7 @@ var init_doctor = __esm({
57614
57650
  progress.complete("Health check complete");
57615
57651
  }
57616
57652
  try {
57617
- const projectRoot = getProjectRoot45();
57653
+ const projectRoot = getProjectRoot46();
57618
57654
  const { auditSagaHierarchy } = await import("@cleocode/core/doctor/saga-audit.js");
57619
57655
  const sagaAudit = await auditSagaHierarchy(projectRoot);
57620
57656
  if (sagaAudit.sagas.length === 0) {
@@ -58909,7 +58945,7 @@ __export(gateway_exports, {
58909
58945
  gatewayOpenapiSubCommand: () => gatewayOpenapiSubCommand
58910
58946
  });
58911
58947
  import { resolve as resolve8 } from "node:path";
58912
- import { generateOpenApi, getProjectRoot as getProjectRoot46 } from "@cleocode/core";
58948
+ import { generateOpenApi, getProjectRoot as getProjectRoot47 } from "@cleocode/core";
58913
58949
  var gatewayOpenapiSubCommand, gatewayCommand;
58914
58950
  var init_gateway = __esm({
58915
58951
  "packages/cleo/src/cli/commands/gateway.ts"() {
@@ -58941,7 +58977,7 @@ var init_gateway = __esm({
58941
58977
  const pathCount = Object.keys(doc.paths).length;
58942
58978
  if (typeof args.out === "string" && args.out.length > 0) {
58943
58979
  const { writeFileSync: writeFileSync7 } = await import("node:fs");
58944
- const target = resolve8(getProjectRoot46(), args.out);
58980
+ const target = resolve8(getProjectRoot47(), args.out);
58945
58981
  writeFileSync7(target, json2, "utf8");
58946
58982
  cliOutput(
58947
58983
  { out: target, pathCount, version: doc.info.version, openapi: doc.openapi },
@@ -59401,7 +59437,7 @@ var go_exports = {};
59401
59437
  __export(go_exports, {
59402
59438
  goCommand: () => goCommand
59403
59439
  });
59404
- import { getProjectRoot as getProjectRoot47, go } from "@cleocode/core";
59440
+ import { getProjectRoot as getProjectRoot48, go } from "@cleocode/core";
59405
59441
  var goCommand;
59406
59442
  var init_go = __esm({
59407
59443
  "packages/cleo/src/cli/commands/go.ts"() {
@@ -59427,7 +59463,7 @@ var init_go = __esm({
59427
59463
  }
59428
59464
  },
59429
59465
  async run({ args }) {
59430
- const projectRoot = getProjectRoot47();
59466
+ const projectRoot = getProjectRoot48();
59431
59467
  const { getCurrentSessionId, getActiveSession } = await import("@cleocode/core/internal");
59432
59468
  let sessionId = getCurrentSessionId(projectRoot) ?? void 0;
59433
59469
  if (sessionId === void 0) {
@@ -59456,7 +59492,7 @@ var goal_exports = {};
59456
59492
  __export(goal_exports, {
59457
59493
  goalCommand: () => goalCommand
59458
59494
  });
59459
- import { getProjectRoot as getProjectRoot48, goal } from "@cleocode/core";
59495
+ import { getProjectRoot as getProjectRoot49, goal } from "@cleocode/core";
59460
59496
  function resolveGoalKind(task) {
59461
59497
  if (typeof task === "string" && task.length > 0) {
59462
59498
  if (!isValidGoalTargetTaskId(task)) {
@@ -59503,7 +59539,7 @@ var init_goal2 = __esm({
59503
59539
  }
59504
59540
  const record = await goal.createGoal(
59505
59541
  { goalKind: kindResult.kind, intent, turnBudget: resolveTurnBudget(args.turns) },
59506
- getProjectRoot48()
59542
+ getProjectRoot49()
59507
59543
  );
59508
59544
  cliOutput(record, { command: "goal set", operation: "goal.set" });
59509
59545
  }
@@ -59514,7 +59550,7 @@ var init_goal2 = __esm({
59514
59550
  description: "Show the current agent's active goal (per-agent scoped)."
59515
59551
  },
59516
59552
  async run() {
59517
- const record = await goal.getActiveGoal(getProjectRoot48());
59553
+ const record = await goal.getActiveGoal(getProjectRoot49());
59518
59554
  cliOutput(record ?? { active: null }, { command: "goal status", operation: "goal.status" });
59519
59555
  }
59520
59556
  });
@@ -59536,7 +59572,7 @@ var init_goal2 = __esm({
59536
59572
  });
59537
59573
  return;
59538
59574
  }
59539
- const cwd = getProjectRoot48();
59575
+ const cwd = getProjectRoot49();
59540
59576
  const parent = await goal.getActiveGoal(cwd);
59541
59577
  if (!parent) {
59542
59578
  cliError(
@@ -59584,7 +59620,7 @@ var init_goal2 = __esm({
59584
59620
  });
59585
59621
  return;
59586
59622
  }
59587
- const cwd = getProjectRoot48();
59623
+ const cwd = getProjectRoot49();
59588
59624
  const result = await goal.advanceGoalWithPersist(goalId, { cwd });
59589
59625
  if (!result) {
59590
59626
  cliError(`Goal '${goalId}' not found.`, 4 /* NOT_FOUND */, { name: "E_NOT_FOUND" });
@@ -59609,7 +59645,7 @@ var init_goal2 = __esm({
59609
59645
  });
59610
59646
  return;
59611
59647
  }
59612
- const cwd = getProjectRoot48();
59648
+ const cwd = getProjectRoot49();
59613
59649
  const active = await goal.getActiveGoal(cwd);
59614
59650
  if (!active) {
59615
59651
  cliError(
@@ -60598,7 +60634,7 @@ var hygiene_exports = {};
60598
60634
  __export(hygiene_exports, {
60599
60635
  hygieneCommand: () => hygieneCommand
60600
60636
  });
60601
- import { getProjectRoot as getProjectRoot49 } from "@cleocode/core";
60637
+ import { getProjectRoot as getProjectRoot50 } from "@cleocode/core";
60602
60638
  import { runSpawnReadinessHygieneCli } from "@cleocode/core/hygiene/validate-spawn-readiness.js";
60603
60639
  var hygieneCommand;
60604
60640
  var init_hygiene = __esm({
@@ -60627,7 +60663,7 @@ var init_hygiene = __esm({
60627
60663
  }
60628
60664
  },
60629
60665
  async run({ args }) {
60630
- const projectRoot = args["project-root"] || getProjectRoot49() || process.cwd();
60666
+ const projectRoot = args["project-root"] || getProjectRoot50() || process.cwd();
60631
60667
  const worktreePath = args["worktree-path"];
60632
60668
  await runSpawnReadinessHygieneCli(projectRoot, worktreePath);
60633
60669
  }
@@ -61937,7 +61973,7 @@ var llm_cost_exports = {};
61937
61973
  __export(llm_cost_exports, {
61938
61974
  costCommand: () => costCommand
61939
61975
  });
61940
- import { getProjectRoot as getProjectRoot50 } from "@cleocode/core/internal";
61976
+ import { getProjectRoot as getProjectRoot51 } from "@cleocode/core/internal";
61941
61977
  import { computeCost } from "@cleocode/core/llm/usage-pricing";
61942
61978
  function resolveSessionId(raw) {
61943
61979
  if (raw === "current") {
@@ -62010,7 +62046,7 @@ var init_llm_cost = __esm({
62010
62046
  process.exit(6);
62011
62047
  }
62012
62048
  const sessionId = resolveSessionId(rawSessionId);
62013
- const projectRoot = getProjectRoot50(process.cwd());
62049
+ const projectRoot = getProjectRoot51(process.cwd());
62014
62050
  let breakdown;
62015
62051
  try {
62016
62052
  breakdown = await loadSessionCostBreakdown(projectRoot, sessionId);
@@ -63345,7 +63381,7 @@ var memory_exports = {};
63345
63381
  __export(memory_exports, {
63346
63382
  memoryCommand: () => memoryCommand
63347
63383
  });
63348
- import { getProjectRoot as getProjectRoot51 } from "@cleocode/core";
63384
+ import { getProjectRoot as getProjectRoot52 } from "@cleocode/core";
63349
63385
  import {
63350
63386
  getBrainDb as getBrainDb2,
63351
63387
  getDreamStatus,
@@ -64278,7 +64314,7 @@ var init_memory3 = __esm({
64278
64314
  },
64279
64315
  args: {},
64280
64316
  async run() {
64281
- const root = getProjectRoot51();
64317
+ const root = getProjectRoot52();
64282
64318
  try {
64283
64319
  const result = await runConsolidation(root);
64284
64320
  cliOutput(result, { command: "memory-consolidate", operation: "memory.consolidate" });
@@ -64302,7 +64338,7 @@ var init_memory3 = __esm({
64302
64338
  }
64303
64339
  },
64304
64340
  async run({ args }) {
64305
- const root = getProjectRoot51();
64341
+ const root = getProjectRoot52();
64306
64342
  if (args.status) {
64307
64343
  try {
64308
64344
  const status = await getDreamStatus(root);
@@ -64339,7 +64375,7 @@ var init_memory3 = __esm({
64339
64375
  }
64340
64376
  },
64341
64377
  async run({ args }) {
64342
- const root = getProjectRoot51();
64378
+ const root = getProjectRoot52();
64343
64379
  try {
64344
64380
  const { runObserver, runReflector } = await import("@cleocode/core/memory");
64345
64381
  const observerResult = await runObserver(root, args.session, {
@@ -64379,7 +64415,7 @@ var init_memory3 = __esm({
64379
64415
  }
64380
64416
  },
64381
64417
  async run({ args }) {
64382
- const root = getProjectRoot51();
64418
+ const root = getProjectRoot52();
64383
64419
  await getBrainDb2(root);
64384
64420
  const { getBrainNativeDb: getBrainNativeDb3 } = await import("@cleocode/core/internal");
64385
64421
  const nativeDb = getBrainNativeDb3();
@@ -64404,7 +64440,7 @@ var init_memory3 = __esm({
64404
64440
  }
64405
64441
  },
64406
64442
  async run({ args }) {
64407
- const root = getProjectRoot51();
64443
+ const root = getProjectRoot52();
64408
64444
  try {
64409
64445
  await getBrainDb2(root);
64410
64446
  const { totalDuplicateRows, groups } = await scanDuplicateEntries();
@@ -64450,7 +64486,7 @@ var init_memory3 = __esm({
64450
64486
  async run({ args }) {
64451
64487
  const sourceDir = args.from;
64452
64488
  const isDryRun = !!args["dry-run"];
64453
- const projectRoot = getProjectRoot51();
64489
+ const projectRoot = getProjectRoot52();
64454
64490
  try {
64455
64491
  const result = await importMemoryFiles({
64456
64492
  sourceDir,
@@ -64601,7 +64637,7 @@ var init_memory3 = __esm({
64601
64637
  },
64602
64638
  args: {},
64603
64639
  async run() {
64604
- const root = getProjectRoot51();
64640
+ const root = getProjectRoot52();
64605
64641
  try {
64606
64642
  await getBrainDb2(root);
64607
64643
  const result = await getTierStats(root);
@@ -64644,7 +64680,7 @@ var init_memory3 = __esm({
64644
64680
  }
64645
64681
  },
64646
64682
  async run({ args }) {
64647
- const root = getProjectRoot51();
64683
+ const root = getProjectRoot52();
64648
64684
  const targetTier = args.to;
64649
64685
  const reason = args.reason;
64650
64686
  const validTiers = ["medium", "long"];
@@ -64710,7 +64746,7 @@ var init_memory3 = __esm({
64710
64746
  }
64711
64747
  },
64712
64748
  async run({ args }) {
64713
- const root = getProjectRoot51();
64749
+ const root = getProjectRoot52();
64714
64750
  const targetTier = args.to;
64715
64751
  const reason = args.reason;
64716
64752
  const validTiers = ["short", "medium"];
@@ -65174,7 +65210,7 @@ var migrate_claude_mem_exports = {};
65174
65210
  __export(migrate_claude_mem_exports, {
65175
65211
  migrateClaudeMemCommand: () => migrateClaudeMemCommand
65176
65212
  });
65177
- import { getProjectRoot as getProjectRoot52, migrateClaudeMem } from "@cleocode/core/internal";
65213
+ import { getProjectRoot as getProjectRoot53, migrateClaudeMem } from "@cleocode/core/internal";
65178
65214
  import { ingestLooseAgentOutputs, ingestRcasdDirectories } from "@cleocode/core/memory";
65179
65215
  import { getDb as getDb2 } from "@cleocode/core/store/sqlite";
65180
65216
  var storageCommand, claudeMemCommand, manifestIngestCommand, migrateClaudeMemCommand;
@@ -65237,7 +65273,7 @@ var init_migrate_claude_mem = __esm({
65237
65273
  }
65238
65274
  },
65239
65275
  async run({ args }) {
65240
- const root = getProjectRoot52();
65276
+ const root = getProjectRoot53();
65241
65277
  try {
65242
65278
  const result = await migrateClaudeMem(root, {
65243
65279
  sourcePath: args.source,
@@ -65286,7 +65322,7 @@ var init_migrate_claude_mem = __esm({
65286
65322
  }
65287
65323
  },
65288
65324
  async run({ args }) {
65289
- const projectRoot = getProjectRoot52();
65325
+ const projectRoot = getProjectRoot53();
65290
65326
  try {
65291
65327
  const db = await getDb2(projectRoot);
65292
65328
  const rcasdFlag = Boolean(args.rcasd);
@@ -65404,7 +65440,7 @@ __export(nexus_exports, {
65404
65440
  import { appendFile as appendFile2, mkdir as mkdir5 } from "node:fs/promises";
65405
65441
  import { homedir as homedir5 } from "node:os";
65406
65442
  import path4 from "node:path";
65407
- import { getProjectRoot as getProjectRoot53 } from "@cleocode/core";
65443
+ import { getProjectRoot as getProjectRoot54 } from "@cleocode/core";
65408
65444
  import { getSymbolImpact } from "@cleocode/core/nexus";
65409
65445
  import { runNexusAnalysis } from "@cleocode/core/nexus/analyze-orchestrator.js";
65410
65446
  import { exportNexusGraph } from "@cleocode/core/nexus/export.js";
@@ -65519,7 +65555,7 @@ var init_nexus3 = __esm({
65519
65555
  async run({ args }) {
65520
65556
  applyJsonFlag2(args.json);
65521
65557
  const projectIdOverride = args["project-id"];
65522
- const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot53();
65558
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot54();
65523
65559
  const startTime = Date.now();
65524
65560
  try {
65525
65561
  const [{ getNexusDb, nexusSchema }, { getIndexStats }] = await Promise.all([
@@ -66034,7 +66070,7 @@ var init_nexus3 = __esm({
66034
66070
  applyJsonFlag2(args.json);
66035
66071
  const startTime = Date.now();
66036
66072
  const projectIdOverride = args["project-id"];
66037
- const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot53();
66073
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot54();
66038
66074
  const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
66039
66075
  const response = await dispatchRaw("query", "nexus", "clusters", { projectId, repoPath });
66040
66076
  const durationMs = Date.now() - startTime;
@@ -66078,7 +66114,7 @@ var init_nexus3 = __esm({
66078
66114
  applyJsonFlag2(args.json);
66079
66115
  const startTime = Date.now();
66080
66116
  const projectIdOverride = args["project-id"];
66081
- const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot53();
66117
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot54();
66082
66118
  const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
66083
66119
  const response = await dispatchRaw("query", "nexus", "flows", { projectId, repoPath });
66084
66120
  const durationMs = Date.now() - startTime;
@@ -66121,7 +66157,7 @@ var init_nexus3 = __esm({
66121
66157
  void appendDeprecationTelemetry("nexus.context", "cleo graph context");
66122
66158
  const startTime = Date.now();
66123
66159
  const projectIdOverride = args["project-id"];
66124
- const repoPath = getProjectRoot53();
66160
+ const repoPath = getProjectRoot54();
66125
66161
  const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
66126
66162
  const limit = parseInt(args.limit, 10);
66127
66163
  const symbolName = args.symbol;
@@ -66184,7 +66220,7 @@ var init_nexus3 = __esm({
66184
66220
  const startTime = Date.now();
66185
66221
  const whyFlag = !!args.why;
66186
66222
  const projectIdOverride = args["project-id"];
66187
- const repoPath = getProjectRoot53();
66223
+ const repoPath = getProjectRoot54();
66188
66224
  const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
66189
66225
  const maxDepth = Math.min(parseInt(args.depth, 10), 5);
66190
66226
  const symbolName = args.symbol;
@@ -66256,7 +66292,7 @@ var init_nexus3 = __esm({
66256
66292
  const projectIdOverride = args["project-id"];
66257
66293
  const isIncremental = !!args.incremental;
66258
66294
  const ctx = getFormatContext();
66259
- const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot53();
66295
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot54();
66260
66296
  humanInfo(`[nexus] Analyzing: ${repoPath}${isIncremental ? " (incremental)" : ""}`);
66261
66297
  if (!isIncremental) humanInfo("[nexus] Clearing existing index for project...");
66262
66298
  try {
@@ -66359,7 +66395,7 @@ var init_nexus3 = __esm({
66359
66395
  async run({ args }) {
66360
66396
  applyJsonFlag2(args.json);
66361
66397
  const startTime = Date.now();
66362
- const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot53();
66398
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot54();
66363
66399
  const name = args.name;
66364
66400
  const response = await dispatchRaw("mutate", "nexus", "projects.register", {
66365
66401
  path: repoPath,
@@ -66717,7 +66753,7 @@ var init_nexus3 = __esm({
66717
66753
  applyJsonFlag2(args.json);
66718
66754
  const startTime = Date.now();
66719
66755
  const projectIdOverride = args["project-id"];
66720
- const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot53();
66756
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot54();
66721
66757
  const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
66722
66758
  const response = await dispatchRaw("mutate", "nexus", "refresh-bridge", {
66723
66759
  repoPath,
@@ -66823,7 +66859,7 @@ var init_nexus3 = __esm({
66823
66859
  async run({ args }) {
66824
66860
  applyJsonFlag2(args.json);
66825
66861
  const startTime = Date.now();
66826
- const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot53();
66862
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot54();
66827
66863
  const projectIdOverride = args["project-id"];
66828
66864
  const beforeRef = args.before ?? "HEAD~1";
66829
66865
  const afterRef = args.after ?? "HEAD";
@@ -66941,7 +66977,7 @@ var init_nexus3 = __esm({
66941
66977
  applyJsonFlag2(args.json);
66942
66978
  const startTime = Date.now();
66943
66979
  const projectIdOverride = args["project-id"];
66944
- const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot53();
66980
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot54();
66945
66981
  const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
66946
66982
  const response = await dispatchRaw("query", "nexus", "route-map", { projectId });
66947
66983
  const durationMs = Date.now() - startTime;
@@ -66997,7 +67033,7 @@ var init_nexus3 = __esm({
66997
67033
  const startTime = Date.now();
66998
67034
  const routeSymbol = args.routeSymbol;
66999
67035
  const projectIdOverride = args["project-id"];
67000
- const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot53();
67036
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot54();
67001
67037
  const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
67002
67038
  const response = await dispatchRaw("query", "nexus", "shape-check", { routeSymbol, projectId });
67003
67039
  const durationMs = Date.now() - startTime;
@@ -67387,7 +67423,7 @@ var init_nexus3 = __esm({
67387
67423
  async run({ args }) {
67388
67424
  applyJsonFlag2(args.json);
67389
67425
  const startTime = Date.now();
67390
- const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot53();
67426
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot54();
67391
67427
  const projectIdOverride = args["project-id"];
67392
67428
  const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
67393
67429
  const response = await dispatchRaw("mutate", "nexus", "contracts-sync", {
@@ -67491,7 +67527,7 @@ var init_nexus3 = __esm({
67491
67527
  async run({ args }) {
67492
67528
  applyJsonFlag2(args.json);
67493
67529
  const startTime = Date.now();
67494
- const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot53();
67530
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot54();
67495
67531
  const projectId = Buffer.from(repoPath).toString("base64url").slice(0, 32);
67496
67532
  const response = await dispatchRaw("mutate", "nexus", "contracts-link-tasks", {
67497
67533
  projectId,
@@ -67572,7 +67608,7 @@ var init_nexus3 = __esm({
67572
67608
  const isIncremental = !!args.incremental;
67573
67609
  try {
67574
67610
  const result = await runNexusWiki({
67575
- projectRoot: getProjectRoot53(),
67611
+ projectRoot: getProjectRoot54(),
67576
67612
  outputDir,
67577
67613
  communityFilter,
67578
67614
  incremental: isIncremental
@@ -67922,7 +67958,7 @@ __export(orchestrate_exports, {
67922
67958
  });
67923
67959
  import { execFileSync as execFileSync4 } from "node:child_process";
67924
67960
  import { orchestration } from "@cleocode/core";
67925
- import { BUILD_CONFIG as BUILD_CONFIG2, getProjectRoot as getProjectRoot54 } from "@cleocode/core/internal";
67961
+ import { BUILD_CONFIG as BUILD_CONFIG2, getProjectRoot as getProjectRoot55 } from "@cleocode/core/internal";
67926
67962
  function formatRollupTable(rollup) {
67927
67963
  const waves = "waves" in rollup ? rollup.waves : [rollup];
67928
67964
  const lines = [];
@@ -68065,7 +68101,7 @@ var init_orchestrate3 = __esm({
68065
68101
  },
68066
68102
  async run({ args }) {
68067
68103
  const rateWindowHours = args.window !== void 0 ? Number.parseFloat(String(args.window)) : void 0;
68068
- const metrics = await orchestration.collectOrchestrateDashboard(getProjectRoot54(), {
68104
+ const metrics = await orchestration.collectOrchestrateDashboard(getProjectRoot55(), {
68069
68105
  ...rateWindowHours !== void 0 && Number.isFinite(rateWindowHours) && rateWindowHours > 0 ? { rateWindowHours } : {}
68070
68106
  });
68071
68107
  cliOutput(metrics, {
@@ -70191,7 +70227,7 @@ var refresh_memory_exports = {};
70191
70227
  __export(refresh_memory_exports, {
70192
70228
  refreshMemoryCommand: () => refreshMemoryCommand
70193
70229
  });
70194
- import { getProjectRoot as getProjectRoot55 } from "@cleocode/core";
70230
+ import { getProjectRoot as getProjectRoot56 } from "@cleocode/core";
70195
70231
  var refreshMemoryCommand;
70196
70232
  var init_refresh_memory = __esm({
70197
70233
  "packages/cleo/src/cli/commands/refresh-memory.ts"() {
@@ -70204,7 +70240,7 @@ var init_refresh_memory = __esm({
70204
70240
  description: "Regenerate .cleo/memory-bridge.md from brain.db"
70205
70241
  },
70206
70242
  async run() {
70207
- const projectDir = getProjectRoot55();
70243
+ const projectDir = getProjectRoot56();
70208
70244
  const { writeMemoryBridge } = await import("@cleocode/core/internal");
70209
70245
  const result = await writeMemoryBridge(projectDir);
70210
70246
  if (result.written) {
@@ -71758,7 +71794,7 @@ import fs3 from "node:fs";
71758
71794
  import path5 from "node:path";
71759
71795
  import {
71760
71796
  CleoError as CleoError9,
71761
- getProjectRoot as getProjectRoot56,
71797
+ getProjectRoot as getProjectRoot57,
71762
71798
  getTaskAccessor as getTaskAccessor3,
71763
71799
  parseConflictReport,
71764
71800
  setAtPath
@@ -71779,7 +71815,7 @@ var init_restore = __esm({
71779
71815
  description: "Apply manually-resolved conflicts from .cleo/restore-conflicts.md"
71780
71816
  },
71781
71817
  async run() {
71782
- const projectRoot = getProjectRoot56();
71818
+ const projectRoot = getProjectRoot57();
71783
71819
  const reportPath = path5.join(projectRoot, CLEO_DIR_NAME3, RESTORE_CONFLICTS_MD);
71784
71820
  if (!fs3.existsSync(reportPath)) {
71785
71821
  humanLine("No pending restore conflicts. Nothing to finalize.");
@@ -72701,8 +72737,8 @@ var init_saga = __esm({
72701
72737
  }
72702
72738
  },
72703
72739
  async run({ args }) {
72704
- const { sagas: sagas2, getProjectRoot: getProjectRoot62 } = await import("@cleocode/core");
72705
- const projectRoot = getProjectRoot62();
72740
+ const { sagas: sagas2, getProjectRoot: getProjectRoot63 } = await import("@cleocode/core");
72741
+ const projectRoot = getProjectRoot63();
72706
72742
  const sagaId = typeof args.sagaId === "string" && args.sagaId.length > 0 ? args.sagaId : void 0;
72707
72743
  const result = await sagas2.sagaNext(projectRoot, { sagaId });
72708
72744
  cliOutput(result.success ? result.data : result, { command: "saga", operation: "saga.next" });
@@ -74511,7 +74547,7 @@ var sequence_exports = {};
74511
74547
  __export(sequence_exports, {
74512
74548
  sequenceCommand: () => sequenceCommand
74513
74549
  });
74514
- import { getProjectRoot as getProjectRoot57 } from "@cleocode/core/internal";
74550
+ import { getProjectRoot as getProjectRoot58 } from "@cleocode/core/internal";
74515
74551
  var showCommand12, checkCommand7, repairCommand3, sequenceCommand;
74516
74552
  var init_sequence = __esm({
74517
74553
  "packages/cleo/src/cli/commands/sequence.ts"() {
@@ -74547,7 +74583,7 @@ var init_sequence = __esm({
74547
74583
  meta: { name: "repair", description: "Reset counter to max + 1 if behind" },
74548
74584
  async run() {
74549
74585
  const { repairSequence } = await import("@cleocode/core/internal");
74550
- const projectRoot = getProjectRoot57();
74586
+ const projectRoot = getProjectRoot58();
74551
74587
  const repair = await repairSequence(projectRoot);
74552
74588
  const result = {
74553
74589
  repaired: repair.repaired,
@@ -75136,8 +75172,8 @@ var init_session4 = __esm({
75136
75172
  "audit-scope": { type: "string", description: "Audit log scope (global|local)" }
75137
75173
  },
75138
75174
  async run({ args }) {
75139
- const { detectSessionDrift, getProjectRoot: getProjectRoot62 } = await import("@cleocode/core");
75140
- const projectRoot = await getProjectRoot62();
75175
+ const { detectSessionDrift, getProjectRoot: getProjectRoot63 } = await import("@cleocode/core");
75176
+ const projectRoot = await getProjectRoot63();
75141
75177
  const scope = args["audit-scope"] === "local" ? "local" : "global";
75142
75178
  const report = await detectSessionDrift({ projectRoot, auditScope: scope });
75143
75179
  cliOutput(report, { command: "session drift", operation: "session.drift" });
@@ -77682,13 +77718,13 @@ var init_telemetry2 = __esm({
77682
77718
  // packages/cleo/src/cli/commands/templates/lib.ts
77683
77719
  import { readFileSync as readFileSync14 } from "node:fs";
77684
77720
  import { isAbsolute as isAbsolute3, resolve as resolve10 } from "node:path";
77685
- import { getProjectRoot as getProjectRoot58 } from "@cleocode/core";
77721
+ import { getProjectRoot as getProjectRoot59 } from "@cleocode/core";
77686
77722
  import { resolveSourcePathAbsolute } from "@cleocode/core/templates/registry";
77687
77723
  function resolveProjectRoot6(raw) {
77688
77724
  if (typeof raw === "string" && raw.length > 0) {
77689
77725
  return isAbsolute3(raw) ? raw : resolve10(process.cwd(), raw);
77690
77726
  }
77691
- return getProjectRoot58();
77727
+ return getProjectRoot59();
77692
77728
  }
77693
77729
  function readTemplateSource(entry) {
77694
77730
  const sourceAbsolute = resolveSourcePathAbsolute(entry);
@@ -78472,7 +78508,7 @@ __export(token_exports, {
78472
78508
  tokenCommand: () => tokenCommand
78473
78509
  });
78474
78510
  import { readFileSync as readFileSync18 } from "node:fs";
78475
- import { getProjectRoot as getProjectRoot59, measureTokenExchange, recordTokenExchange as recordTokenExchange2 } from "@cleocode/core/internal";
78511
+ import { getProjectRoot as getProjectRoot60, measureTokenExchange, recordTokenExchange as recordTokenExchange2 } from "@cleocode/core/internal";
78476
78512
  function readPayload(args, textKey, fileKey) {
78477
78513
  const text = args[textKey];
78478
78514
  const file = args[fileKey];
@@ -78636,7 +78672,7 @@ var init_token = __esm({
78636
78672
  domain: args.domain,
78637
78673
  operation: args.operation
78638
78674
  };
78639
- const result = args.record ? await recordTokenExchange2(getProjectRoot59(), input2) : await measureTokenExchange(input2);
78675
+ const result = args.record ? await recordTokenExchange2(getProjectRoot60(), input2) : await measureTokenExchange(input2);
78640
78676
  cliOutput(result, {
78641
78677
  command: "token",
78642
78678
  operation: args.record ? "admin.token.record" : "token.estimate"
@@ -78672,7 +78708,7 @@ __export(transcript_exports, {
78672
78708
  });
78673
78709
  import { homedir as homedir6 } from "node:os";
78674
78710
  import { join as join35 } from "node:path";
78675
- import { getProjectRoot as getProjectRoot60 } from "@cleocode/core";
78711
+ import { getProjectRoot as getProjectRoot61 } from "@cleocode/core";
78676
78712
  import {
78677
78713
  parseDurationMs,
78678
78714
  pruneTranscripts,
@@ -78702,7 +78738,7 @@ var init_transcript = __esm({
78702
78738
  async run({ args }) {
78703
78739
  if (args.pending) {
78704
78740
  try {
78705
- const projectRoot = getProjectRoot60();
78741
+ const projectRoot = getProjectRoot61();
78706
78742
  const { scanPendingTranscripts } = await import("@cleocode/core/memory/transcript-scanner.js");
78707
78743
  const pending = await scanPendingTranscripts(projectRoot);
78708
78744
  cliOutput(
@@ -78799,7 +78835,7 @@ var init_transcript = __esm({
78799
78835
  async run({ args }) {
78800
78836
  const tier = args.tier ?? "warm";
78801
78837
  const dryRun = args["dry-run"] ?? false;
78802
- const projectRoot = getProjectRoot60();
78838
+ const projectRoot = getProjectRoot61();
78803
78839
  try {
78804
78840
  const { extractTranscript } = await import("@cleocode/core/memory/transcript-extractor.js");
78805
78841
  const { findSessionTranscriptPath, listAllTranscripts } = await import("@cleocode/core/memory/transcript-scanner.js");
@@ -78911,7 +78947,7 @@ var init_transcript = __esm({
78911
78947
  const dryRun = args["dry-run"] ?? false;
78912
78948
  const olderThanHours = args["older-than-hours"] ? Number.parseInt(args["older-than-hours"], 10) : 24;
78913
78949
  const limit = args.limit ? Number.parseInt(args.limit, 10) : void 0;
78914
- const projectRoot = getProjectRoot60();
78950
+ const projectRoot = getProjectRoot61();
78915
78951
  try {
78916
78952
  const { extractTranscript } = await import("@cleocode/core/memory/transcript-extractor.js");
78917
78953
  const { listAllTranscripts } = await import("@cleocode/core/memory/transcript-scanner.js");
@@ -81227,9 +81263,9 @@ var init_workgraph2 = __esm({
81227
81263
  },
81228
81264
  async run({ args }) {
81229
81265
  const { generatePlanningDoc } = await import("@cleocode/core/workgraph");
81230
- const { getProjectRoot: getProjectRoot62 } = await import("@cleocode/core");
81266
+ const { getProjectRoot: getProjectRoot63 } = await import("@cleocode/core");
81231
81267
  const { cliOutput: cliOutput2 } = await Promise.resolve().then(() => (init_renderers(), renderers_exports));
81232
- const projectRoot = getProjectRoot62();
81268
+ const projectRoot = getProjectRoot63();
81233
81269
  const audience = String(args.audience) === "agent" ? "agent" : "maintainer";
81234
81270
  const result = await generatePlanningDoc(projectRoot, {
81235
81271
  sagaId: String(args.sagaId),
@@ -81246,9 +81282,9 @@ var init_workgraph2 = __esm({
81246
81282
  async run() {
81247
81283
  const { validateWorkGraphStructure } = await import("@cleocode/core/workgraph");
81248
81284
  const { taskList: taskList2 } = await import("@cleocode/core/internal");
81249
- const { getProjectRoot: getProjectRoot62 } = await import("@cleocode/core");
81285
+ const { getProjectRoot: getProjectRoot63 } = await import("@cleocode/core");
81250
81286
  const { cliOutput: cliOutput2 } = await Promise.resolve().then(() => (init_renderers(), renderers_exports));
81251
- const projectRoot = getProjectRoot62();
81287
+ const projectRoot = getProjectRoot63();
81252
81288
  const listResult = await taskList2(projectRoot, { limit: 5e3 });
81253
81289
  const tasks = listResult.success ? listResult.data?.tasks ?? [] : [];
81254
81290
  const nodes = tasks.map((t) => ({
@@ -81267,9 +81303,9 @@ var init_workgraph2 = __esm({
81267
81303
  description: "One-shot saga-to-saga workgraph dashboard (tracking checklist)"
81268
81304
  },
81269
81305
  async run() {
81270
- const { sagas: sagas2, getProjectRoot: getProjectRoot62 } = await import("@cleocode/core");
81306
+ const { sagas: sagas2, getProjectRoot: getProjectRoot63 } = await import("@cleocode/core");
81271
81307
  const { cliOutput: cliOutput2 } = await Promise.resolve().then(() => (init_renderers(), renderers_exports));
81272
- const projectRoot = getProjectRoot62();
81308
+ const projectRoot = getProjectRoot63();
81273
81309
  const listResult = await sagas2.sagaList(projectRoot);
81274
81310
  if (!listResult.success) {
81275
81311
  cliOutput2(listResult, { command: "workgraph", operation: "workgraph.status" });
@@ -81335,7 +81371,7 @@ __export(worktree_exports, {
81335
81371
  worktreeCommand: () => worktreeCommand
81336
81372
  });
81337
81373
  import readline4 from "node:readline";
81338
- import { getProjectRoot as getProjectRoot61, listWorktrees as listWorktrees2 } from "@cleocode/core/internal";
81374
+ import { getProjectRoot as getProjectRoot62, listWorktrees as listWorktrees2 } from "@cleocode/core/internal";
81339
81375
  async function promptYesNo2(question) {
81340
81376
  return new Promise((resolve13) => {
81341
81377
  const rl = readline4.createInterface({ input: process.stdin, output: process.stdout });
@@ -81440,7 +81476,7 @@ var init_worktree3 = __esm({
81440
81476
  const staleDays = staleDaysRaw !== void 0 ? Number.parseInt(staleDaysRaw, 10) : void 0;
81441
81477
  const idleDaysRaw = typeof args["idle-days"] === "string" ? args["idle-days"] : void 0;
81442
81478
  const idleDays = idleDaysRaw !== void 0 ? Number.parseInt(idleDaysRaw, 10) : void 0;
81443
- const projectRoot = getProjectRoot61();
81479
+ const projectRoot = getProjectRoot62();
81444
81480
  const listResult = await listWorktrees2({
81445
81481
  projectRoot,
81446
81482
  ...staleDays !== void 0 && !Number.isNaN(staleDays) ? { staleDays } : {}
@@ -83154,7 +83190,7 @@ async function runStartupMaintenance() {
83154
83190
  detectAndRemoveStrayProjectNexus,
83155
83191
  getGlobalSalt,
83156
83192
  getLogger: getLogger22,
83157
- getProjectRoot: getProjectRoot62,
83193
+ getProjectRoot: getProjectRoot63,
83158
83194
  isCleanupMarkerSet,
83159
83195
  migrateSignaldockToConduit,
83160
83196
  needsSignaldockToConduitMigration,
@@ -83163,7 +83199,7 @@ async function runStartupMaintenance() {
83163
83199
  } = await import("@cleocode/core/internal");
83164
83200
  let projectRootForCleanup = "";
83165
83201
  try {
83166
- projectRootForCleanup = getProjectRoot62();
83202
+ projectRootForCleanup = getProjectRoot63();
83167
83203
  } catch {
83168
83204
  }
83169
83205
  if (!isCleanupMarkerSet(CLI_VERSION, projectRootForCleanup)) {
@@ -83183,7 +83219,7 @@ async function runStartupMaintenance() {
83183
83219
  const isInitInvocation = process.argv.slice(2).some((a) => a === "init");
83184
83220
  if (!isInitInvocation) {
83185
83221
  try {
83186
- const _projectRootForMigration = getProjectRoot62();
83222
+ const _projectRootForMigration = getProjectRoot63();
83187
83223
  if (needsSignaldockToConduitMigration(_projectRootForMigration)) {
83188
83224
  const migrationResult = await migrateSignaldockToConduit(_projectRootForMigration);
83189
83225
  if (migrationResult.status === "failed") {