@cleocode/cleo 2026.5.81 → 2026.5.83

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
@@ -16086,10 +16086,11 @@ var init_check = __esm({
16086
16086
  });
16087
16087
 
16088
16088
  // packages/cleo/src/dispatch/domains/conduit.ts
16089
+ import { getProjectRoot as getProjectRoot4 } from "@cleocode/core";
16089
16090
  async function _resolveCredential(agentId) {
16090
16091
  const { AgentRegistryAccessor, getDb: getDb3 } = await import("@cleocode/core/internal");
16091
16092
  await getDb3();
16092
- const registry = new AgentRegistryAccessor(process.cwd());
16093
+ const registry = new AgentRegistryAccessor(getProjectRoot4());
16093
16094
  const credential = agentId ? await registry.get(agentId) : await registry.getActive();
16094
16095
  if (!credential) {
16095
16096
  throw new Error(
@@ -16102,7 +16103,7 @@ async function getStatusImpl(agentId) {
16102
16103
  const credential = await _resolveCredential(agentId);
16103
16104
  const pollerRunning = activePoller !== null && activeAgentId === credential.agentId;
16104
16105
  const { LocalTransport } = await import("@cleocode/core/conduit");
16105
- if (LocalTransport.isAvailable(process.cwd())) {
16106
+ if (LocalTransport.isAvailable(getProjectRoot4())) {
16106
16107
  const transport = new LocalTransport();
16107
16108
  await transport.connect({
16108
16109
  agentId: credential.agentId,
@@ -16160,7 +16161,7 @@ async function getStatusImpl(agentId) {
16160
16161
  async function peekImpl(agentId, limit) {
16161
16162
  const credential = await _resolveCredential(agentId);
16162
16163
  const { LocalTransport } = await import("@cleocode/core/conduit");
16163
- if (LocalTransport.isAvailable(process.cwd())) {
16164
+ if (LocalTransport.isAvailable(getProjectRoot4())) {
16164
16165
  const transport = new LocalTransport();
16165
16166
  await transport.connect({
16166
16167
  agentId: credential.agentId,
@@ -16232,7 +16233,7 @@ async function startPollingImpl(agentId, pollIntervalMs, groupConversationIds) {
16232
16233
  const { LocalTransport } = await import("@cleocode/core/conduit");
16233
16234
  let transport;
16234
16235
  let transportName = "http";
16235
- if (LocalTransport.isAvailable(process.cwd())) {
16236
+ if (LocalTransport.isAvailable(getProjectRoot4())) {
16236
16237
  const local = new LocalTransport();
16237
16238
  await local.connect({
16238
16239
  agentId: credential.agentId,
@@ -16291,7 +16292,7 @@ async function subscribeTopicImpl(topicName, agentId, _filter) {
16291
16292
  }
16292
16293
  const credential = await _resolveCredential(agentId);
16293
16294
  const { LocalTransport } = await import("@cleocode/core/conduit");
16294
- if (!LocalTransport.isAvailable(process.cwd())) {
16295
+ if (!LocalTransport.isAvailable(getProjectRoot4())) {
16295
16296
  return {
16296
16297
  success: false,
16297
16298
  error: { code: "E_CONDUIT", message: "conduit.db not found \u2014 run: cleo init" }
@@ -16332,7 +16333,7 @@ async function publishToTopicImpl(topicName, content, kind, payload, agentId) {
16332
16333
  }
16333
16334
  const credential = await _resolveCredential(agentId);
16334
16335
  const { LocalTransport } = await import("@cleocode/core/conduit");
16335
- if (!LocalTransport.isAvailable(process.cwd())) {
16336
+ if (!LocalTransport.isAvailable(getProjectRoot4())) {
16336
16337
  return {
16337
16338
  success: false,
16338
16339
  error: { code: "E_CONDUIT", message: "conduit.db not found \u2014 run: cleo init" }
@@ -16370,7 +16371,7 @@ async function listenTopicImpl(topicName, agentId, limit, since) {
16370
16371
  const startMs = Date.now();
16371
16372
  const credential = await _resolveCredential(agentId);
16372
16373
  const { LocalTransport } = await import("@cleocode/core/conduit");
16373
- if (!LocalTransport.isAvailable(process.cwd())) {
16374
+ if (!LocalTransport.isAvailable(getProjectRoot4())) {
16374
16375
  return {
16375
16376
  success: false,
16376
16377
  error: { code: "E_CONDUIT", message: "conduit.db not found \u2014 run: cleo init" }
@@ -16415,7 +16416,7 @@ async function sendMessageImpl(content, to, conversationId, agentId) {
16415
16416
  }
16416
16417
  const credential = await _resolveCredential(agentId);
16417
16418
  const { LocalTransport } = await import("@cleocode/core/conduit");
16418
- if (LocalTransport.isAvailable(process.cwd())) {
16419
+ if (LocalTransport.isAvailable(getProjectRoot4())) {
16419
16420
  const transport = new LocalTransport();
16420
16421
  await transport.connect({
16421
16422
  agentId: credential.agentId,
@@ -16669,7 +16670,7 @@ import {
16669
16670
  createAttachmentStoreV2,
16670
16671
  generateDocsLlmsTxt,
16671
16672
  getCleoDirAbsolute,
16672
- getProjectRoot as getProjectRoot4,
16673
+ getProjectRoot as getProjectRoot5,
16673
16674
  resolveAttachmentBackend
16674
16675
  } from "@cleocode/core/internal";
16675
16676
  function inferOwnerType(ownerId) {
@@ -16782,7 +16783,7 @@ var init_docs2 = __esm({
16782
16783
  if (!forId) {
16783
16784
  return lafsError("E_INVALID_INPUT", "--for <taskId|epicId> is required", "generate");
16784
16785
  }
16785
- const cwd = getProjectRoot4();
16786
+ const cwd = getProjectRoot5();
16786
16787
  const result = await generateDocsLlmsTxt({ ownerId: forId, cwd });
16787
16788
  let attachmentId;
16788
16789
  let attachmentSha256;
@@ -16848,7 +16849,7 @@ var init_docs2 = __esm({
16848
16849
  if (!fetchResult || !metadata) {
16849
16850
  return lafsError("E_NOT_FOUND", `Attachment not found: ${ref}`, "fetch");
16850
16851
  }
16851
- const cwd = getProjectRoot4();
16852
+ const cwd = getProjectRoot5();
16852
16853
  const cleoDir = getCleoDirAbsolute(cwd);
16853
16854
  let storagePath;
16854
16855
  if (metadata.attachment.kind === "local-file") {
@@ -16938,7 +16939,7 @@ var init_docs2 = __esm({
16938
16939
  const meta = await store.put(bytes, attachment, ownerType, ownerId, attachedBy);
16939
16940
  let backend = "legacy";
16940
16941
  try {
16941
- const v2 = createAttachmentStoreV2(getProjectRoot4());
16942
+ const v2 = createAttachmentStoreV2(getProjectRoot5());
16942
16943
  const v2Result = await v2.put(ownerId, {
16943
16944
  name: absPath.split(/[\\/]/).pop() ?? meta.sha256.slice(0, 12),
16944
16945
  data: new Uint8Array(bytes),
@@ -16950,7 +16951,7 @@ var init_docs2 = __esm({
16950
16951
  }
16951
16952
  import("@cleocode/core/internal").then(
16952
16953
  ({ ensureLlmtxtNode }) => ensureLlmtxtNode(
16953
- getProjectRoot4(),
16954
+ getProjectRoot5(),
16954
16955
  meta.sha256,
16955
16956
  `${ownerType}:${ownerId}`,
16956
16957
  absPath.split("/").pop() ?? meta.sha256.slice(0, 12)
@@ -16981,7 +16982,7 @@ var init_docs2 = __esm({
16981
16982
  const urlBytes = Buffer.from(url, "utf-8");
16982
16983
  const meta = await store.put(urlBytes, attachment, ownerType, ownerId, attachedBy);
16983
16984
  import("@cleocode/core/internal").then(
16984
- ({ ensureLlmtxtNode }) => ensureLlmtxtNode(getProjectRoot4(), meta.sha256, `${ownerType}:${ownerId}`, url)
16985
+ ({ ensureLlmtxtNode }) => ensureLlmtxtNode(getProjectRoot5(), meta.sha256, `${ownerType}:${ownerId}`, url)
16985
16986
  ).catch(() => {
16986
16987
  });
16987
16988
  const backend = "legacy";
@@ -17036,7 +17037,7 @@ var init_docs2 = __esm({
17036
17037
  const blobPurged = derefResult.status === "removed";
17037
17038
  const refCountAfter = derefResult.status === "derefd" ? derefResult.refCountAfter : 0;
17038
17039
  try {
17039
- const v2 = createAttachmentStoreV2(getProjectRoot4());
17040
+ const v2 = createAttachmentStoreV2(getProjectRoot5());
17040
17041
  await v2.remove(attachmentId, fromOwner);
17041
17042
  } catch {
17042
17043
  }
@@ -17123,7 +17124,7 @@ var init_docs2 = __esm({
17123
17124
  });
17124
17125
 
17125
17126
  // packages/cleo/src/dispatch/domains/intelligence.ts
17126
- import { getLogger as getLogger5, getProjectRoot as getProjectRoot5, getTaskAccessor as getTaskAccessor2 } from "@cleocode/core";
17127
+ import { getLogger as getLogger5, getProjectRoot as getProjectRoot6, getTaskAccessor as getTaskAccessor2 } from "@cleocode/core";
17127
17128
  import {
17128
17129
  calculateTaskRisk,
17129
17130
  extractPatternsFromHistory,
@@ -17143,7 +17144,7 @@ var init_intelligence2 = __esm({
17143
17144
  // Query
17144
17145
  // -----------------------------------------------------------------------
17145
17146
  async query(operation, params) {
17146
- const projectRoot = getProjectRoot5();
17147
+ const projectRoot = getProjectRoot6();
17147
17148
  const startTime = Date.now();
17148
17149
  try {
17149
17150
  switch (operation) {
@@ -17447,7 +17448,7 @@ var init_llm2 = __esm({
17447
17448
  });
17448
17449
 
17449
17450
  // packages/cleo/src/dispatch/domains/memory.ts
17450
- import { getLogger as getLogger6, getProjectRoot as getProjectRoot6 } from "@cleocode/core";
17451
+ import { getLogger as getLogger6, getProjectRoot as getProjectRoot7 } from "@cleocode/core";
17451
17452
  import {
17452
17453
  generateMemoryBridgeContent,
17453
17454
  getBrainDb,
@@ -17475,7 +17476,7 @@ var init_memory2 = __esm({
17475
17476
  // Query
17476
17477
  // -----------------------------------------------------------------------
17477
17478
  async query(operation, params) {
17478
- const projectRoot = getProjectRoot6();
17479
+ const projectRoot = getProjectRoot7();
17479
17480
  const startTime = Date.now();
17480
17481
  try {
17481
17482
  switch (operation) {
@@ -18582,7 +18583,7 @@ var init_memory2 = __esm({
18582
18583
  // Mutate
18583
18584
  // -----------------------------------------------------------------------
18584
18585
  async mutate(operation, params) {
18585
- const projectRoot = getProjectRoot6();
18586
+ const projectRoot = getProjectRoot7();
18586
18587
  const startTime = Date.now();
18587
18588
  try {
18588
18589
  switch (operation) {
@@ -19231,7 +19232,7 @@ import {
19231
19232
  getBrainNativeDb as getBrainNativeDb2,
19232
19233
  getLogger as getLogger7,
19233
19234
  getNexusNativeDb,
19234
- getProjectRoot as getProjectRoot7,
19235
+ getProjectRoot as getProjectRoot8,
19235
19236
  nexusAugment,
19236
19237
  nexusBlockers,
19237
19238
  nexusBrainAnchors,
@@ -19503,7 +19504,7 @@ async function handleImpact(operation, params, startTime) {
19503
19504
  5
19504
19505
  );
19505
19506
  const projectIdParam = params?.projectId;
19506
- const projectId = projectIdParam ?? Buffer.from(process.cwd()).toString("base64url").slice(0, 32);
19507
+ const projectId = projectIdParam ?? Buffer.from(getProjectRoot8()).toString("base64url").slice(0, 32);
19507
19508
  try {
19508
19509
  const { getNexusDb } = await import("@cleocode/core/store/nexus-sqlite");
19509
19510
  await getNexusDb();
@@ -19764,7 +19765,7 @@ var init_nexus3 = __esm({
19764
19765
  return wrapCoreResult(await nexusAugment(params.pattern, params.limit ?? 5), "augment");
19765
19766
  },
19766
19767
  "share.status": async (_params) => {
19767
- const projectRoot = getProjectRoot7();
19768
+ const projectRoot = getProjectRoot8();
19768
19769
  return wrapCoreResult(await nexusShareStatus(projectRoot), "share.status");
19769
19770
  },
19770
19771
  "transfer.preview": async (params) => {
@@ -19800,39 +19801,39 @@ var init_nexus3 = __esm({
19800
19801
  },
19801
19802
  "full-context": async (params) => {
19802
19803
  if (!params.symbol) return lafsError("E_INVALID_INPUT", "symbol is required", "full-context");
19803
- const projectRoot = getProjectRoot7();
19804
+ const projectRoot = getProjectRoot8();
19804
19805
  return wrapCoreResult(await nexusFullContext(params.symbol, projectRoot), "full-context");
19805
19806
  },
19806
19807
  "task-footprint": async (params) => {
19807
19808
  if (!params.taskId) return lafsError("E_INVALID_INPUT", "taskId is required", "task-footprint");
19808
- const projectRoot = getProjectRoot7();
19809
+ const projectRoot = getProjectRoot8();
19809
19810
  return wrapCoreResult(await nexusTaskFootprint(params.taskId, projectRoot), "task-footprint");
19810
19811
  },
19811
19812
  "brain-anchors": async (params) => {
19812
19813
  if (!params.entryId)
19813
19814
  return lafsError("E_INVALID_INPUT", "entryId is required", "brain-anchors");
19814
- const projectRoot = getProjectRoot7();
19815
+ const projectRoot = getProjectRoot8();
19815
19816
  return wrapCoreResult(await nexusBrainAnchors(params.entryId, projectRoot), "brain-anchors");
19816
19817
  },
19817
19818
  why: async (params) => {
19818
19819
  if (!params.symbol) return lafsError("E_INVALID_INPUT", "symbol is required", "why");
19819
- const projectRoot = getProjectRoot7();
19820
+ const projectRoot = getProjectRoot8();
19820
19821
  return wrapCoreResult(await nexusWhy(params.symbol, projectRoot), "why");
19821
19822
  },
19822
19823
  "impact-full": async (params) => {
19823
19824
  if (!params.symbol) return lafsError("E_INVALID_INPUT", "symbol is required", "impact-full");
19824
- const projectRoot = getProjectRoot7();
19825
+ const projectRoot = getProjectRoot8();
19825
19826
  return wrapCoreResult(await nexusImpactFull(params.symbol, projectRoot), "impact-full");
19826
19827
  },
19827
19828
  "route-map": async (params) => {
19828
- const projectRoot = getProjectRoot7();
19829
+ const projectRoot = getProjectRoot8();
19829
19830
  const projectId = params.projectId ?? Buffer.from(projectRoot).toString("base64url").slice(0, 32);
19830
19831
  return wrapCoreResult(await nexusRouteMap(projectId, projectRoot), "route-map");
19831
19832
  },
19832
19833
  "shape-check": async (params) => {
19833
19834
  if (!params.routeSymbol)
19834
19835
  return lafsError("E_INVALID_INPUT", "routeSymbol is required", "shape-check");
19835
- const projectRoot = getProjectRoot7();
19836
+ const projectRoot = getProjectRoot8();
19836
19837
  const projectId = params.projectId ?? Buffer.from(projectRoot).toString("base64url").slice(0, 32);
19837
19838
  return wrapCoreResult(
19838
19839
  await nexusShapeCheck(params.routeSymbol, projectId, projectRoot),
@@ -19844,7 +19845,7 @@ var init_nexus3 = __esm({
19844
19845
  return wrapCoreResult(await nexusSearchCode(params.pattern, params.limit ?? 10), "search-code");
19845
19846
  },
19846
19847
  wiki: async (params) => {
19847
- const projectRoot = getProjectRoot7();
19848
+ const projectRoot = getProjectRoot8();
19848
19849
  const outputDir = params.outputDir ?? `${projectRoot}/.cleo/wiki`;
19849
19850
  return wrapCoreResult(
19850
19851
  await nexusWiki(outputDir, projectRoot, {
@@ -19857,7 +19858,7 @@ var init_nexus3 = __esm({
19857
19858
  "contracts-show": async (params) => {
19858
19859
  if (!params.projectA || !params.projectB)
19859
19860
  return lafsError("E_INVALID_INPUT", "projectA and projectB are required", "contracts-show");
19860
- const projectRoot = getProjectRoot7();
19861
+ const projectRoot = getProjectRoot8();
19861
19862
  return wrapCoreResult(
19862
19863
  await nexusContractsShow(params.projectA, params.projectB, projectRoot),
19863
19864
  "contracts-show"
@@ -19865,7 +19866,7 @@ var init_nexus3 = __esm({
19865
19866
  },
19866
19867
  "task-symbols": async (params) => {
19867
19868
  if (!params.taskId) return lafsError("E_INVALID_INPUT", "taskId is required", "task-symbols");
19868
- const projectRoot = getProjectRoot7();
19869
+ const projectRoot = getProjectRoot8();
19869
19870
  return wrapCoreResult(await nexusTaskSymbols(params.taskId, projectRoot), "task-symbols");
19870
19871
  },
19871
19872
  "profile.view": async (params) => wrapCoreResult(
@@ -19880,20 +19881,20 @@ var init_nexus3 = __esm({
19880
19881
  "sigil.list": async (params) => wrapCoreResult(await nexusSigilList(params.role), "sigil.list"),
19881
19882
  // T1510 — Phase 2 query ops
19882
19883
  clusters: async (params) => {
19883
- const projectRoot = getProjectRoot7();
19884
+ const projectRoot = getProjectRoot8();
19884
19885
  const repoPath = params.repoPath ?? projectRoot;
19885
19886
  const projectId = params.projectId ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
19886
19887
  return wrapCoreResult(await nexusClusters(projectId, repoPath), "clusters");
19887
19888
  },
19888
19889
  flows: async (params) => {
19889
- const projectRoot = getProjectRoot7();
19890
+ const projectRoot = getProjectRoot8();
19890
19891
  const repoPath = params.repoPath ?? projectRoot;
19891
19892
  const projectId = params.projectId ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
19892
19893
  return wrapCoreResult(await nexusFlows(projectId, repoPath), "flows");
19893
19894
  },
19894
19895
  context: async (params) => {
19895
19896
  if (!params.symbol) return lafsError("E_INVALID_INPUT", "symbol is required", "context");
19896
- const projectRoot = getProjectRoot7();
19897
+ const projectRoot = getProjectRoot8();
19897
19898
  const projectId = params.projectId ?? Buffer.from(projectRoot).toString("base64url").slice(0, 32);
19898
19899
  const limit = typeof params.limit === "number" ? params.limit : 20;
19899
19900
  const showContent = params.content === true;
@@ -19942,13 +19943,13 @@ var init_nexus3 = __esm({
19942
19943
  "projects.clean"
19943
19944
  ),
19944
19945
  "refresh-bridge": async (params) => {
19945
- const projectRoot = getProjectRoot7();
19946
+ const projectRoot = getProjectRoot8();
19946
19947
  const repoPath = params.repoPath ?? projectRoot;
19947
19948
  const projectId = params.projectId;
19948
19949
  return wrapCoreResult(await nexusRefreshBridge(repoPath, projectId), "refresh-bridge");
19949
19950
  },
19950
19951
  diff: async (params) => {
19951
- const projectRoot = getProjectRoot7();
19952
+ const projectRoot = getProjectRoot8();
19952
19953
  const repoPath = params.repoPath ?? projectRoot;
19953
19954
  return wrapCoreResult(
19954
19955
  await nexusDiff(
@@ -19968,17 +19969,17 @@ var init_nexus3 = __esm({
19968
19969
  );
19969
19970
  },
19970
19971
  "hot-paths": async (params) => {
19971
- const projectRoot = getProjectRoot7();
19972
+ const projectRoot = getProjectRoot8();
19972
19973
  const limit = typeof params.limit === "number" ? params.limit : 20;
19973
19974
  return wrapCoreResult(await nexusHotPaths(projectRoot, limit), "hot-paths");
19974
19975
  },
19975
19976
  "hot-nodes": async (params) => {
19976
- const projectRoot = getProjectRoot7();
19977
+ const projectRoot = getProjectRoot8();
19977
19978
  const limit = typeof params.limit === "number" ? params.limit : 20;
19978
19979
  return wrapCoreResult(await nexusHotNodes(projectRoot, limit), "hot-nodes");
19979
19980
  },
19980
19981
  "cold-symbols": async (params) => {
19981
- const projectRoot = getProjectRoot7();
19982
+ const projectRoot = getProjectRoot8();
19982
19983
  const days = typeof params.days === "number" ? params.days : 30;
19983
19984
  return wrapCoreResult(await nexusColdSymbols(projectRoot, days), "cold-symbols");
19984
19985
  },
@@ -20013,9 +20014,12 @@ var init_nexus3 = __esm({
20013
20014
  "permission.set"
20014
20015
  );
20015
20016
  },
20016
- reconcile: async (params) => wrapCoreResult(await nexusReconcileProject(params.projectRoot ?? process.cwd()), "reconcile"),
20017
+ reconcile: async (params) => wrapCoreResult(
20018
+ await nexusReconcileProject(params.projectRoot ?? getProjectRoot8()),
20019
+ "reconcile"
20020
+ ),
20017
20021
  "share.snapshot.export": async (params) => {
20018
- const projectRoot = getProjectRoot7();
20022
+ const projectRoot = getProjectRoot8();
20019
20023
  return wrapCoreResult(
20020
20024
  await nexusShareSnapshotExport(projectRoot, params.outputPath),
20021
20025
  "share.snapshot.export"
@@ -20024,7 +20028,7 @@ var init_nexus3 = __esm({
20024
20028
  "share.snapshot.import": async (params) => {
20025
20029
  if (!params.inputPath)
20026
20030
  return lafsError("E_INVALID_INPUT", "inputPath is required", "share.snapshot.import");
20027
- const projectRoot = getProjectRoot7();
20031
+ const projectRoot = getProjectRoot8();
20028
20032
  return wrapCoreResult(
20029
20033
  await nexusShareSnapshotImport(projectRoot, params.inputPath),
20030
20034
  "share.snapshot.import"
@@ -20052,13 +20056,13 @@ var init_nexus3 = __esm({
20052
20056
  );
20053
20057
  },
20054
20058
  "contracts-sync": async (params) => {
20055
- const projectRoot = getProjectRoot7();
20059
+ const projectRoot = getProjectRoot8();
20056
20060
  const repoPath = params.repoPath ?? projectRoot;
20057
20061
  const projectId = params.projectId ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
20058
20062
  return wrapCoreResult(await nexusContractsSync(projectId, repoPath), "contracts-sync");
20059
20063
  },
20060
20064
  "contracts-link-tasks": async (params) => {
20061
- const projectRoot = getProjectRoot7();
20065
+ const projectRoot = getProjectRoot8();
20062
20066
  const repoPath = params.repoPath ?? projectRoot;
20063
20067
  const projectId = params.projectId ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
20064
20068
  return wrapCoreResult(
@@ -20067,7 +20071,7 @@ var init_nexus3 = __esm({
20067
20071
  );
20068
20072
  },
20069
20073
  "conduit-scan": async (_params) => {
20070
- const projectRoot = getProjectRoot7();
20074
+ const projectRoot = getProjectRoot8();
20071
20075
  return wrapCoreResult(await nexusConduitScan(projectRoot), "conduit-scan");
20072
20076
  },
20073
20077
  "profile.import": async (params) => wrapCoreResult(await nexusProfileImport(params.path), "profile.import"),
@@ -20271,7 +20275,7 @@ import {
20271
20275
  extractTypedGates,
20272
20276
  getIvtrState,
20273
20277
  getLogger as getLogger8,
20274
- getProjectRoot as getProjectRoot8,
20278
+ getProjectRoot as getProjectRoot9,
20275
20279
  getTask,
20276
20280
  loopBackIvtr,
20277
20281
  releaseIvtr,
@@ -20287,7 +20291,7 @@ function extractEvidenceFromRaw(raw) {
20287
20291
  return [];
20288
20292
  }
20289
20293
  async function ivtrStatusOp(params) {
20290
- const cwd = getProjectRoot8();
20294
+ const cwd = getProjectRoot9();
20291
20295
  const state = await getIvtrState(params.taskId, { cwd });
20292
20296
  if (!state) {
20293
20297
  return engineSuccess2({
@@ -20317,7 +20321,7 @@ async function ivtrStatusOp(params) {
20317
20321
  });
20318
20322
  }
20319
20323
  async function ivtrStartOp(params) {
20320
- const cwd = getProjectRoot8();
20324
+ const cwd = getProjectRoot9();
20321
20325
  const task = await getTask(params.taskId, cwd);
20322
20326
  if (!task) {
20323
20327
  return engineError2("E_NOT_FOUND", `Task ${params.taskId} not found`);
@@ -20338,7 +20342,7 @@ async function ivtrStartOp(params) {
20338
20342
  });
20339
20343
  }
20340
20344
  async function ivtrNextOp(params) {
20341
- const cwd = getProjectRoot8();
20345
+ const cwd = getProjectRoot9();
20342
20346
  const task = await getTask(params.taskId, cwd);
20343
20347
  if (!task) {
20344
20348
  return engineError2("E_NOT_FOUND", `Task ${params.taskId} not found`);
@@ -20389,7 +20393,7 @@ async function ivtrNextOp(params) {
20389
20393
  });
20390
20394
  }
20391
20395
  async function ivtrReleaseOp(params) {
20392
- const cwd = getProjectRoot8();
20396
+ const cwd = getProjectRoot9();
20393
20397
  const result = await releaseIvtr(params.taskId, { cwd });
20394
20398
  if (!result.released) {
20395
20399
  return {
@@ -20426,7 +20430,7 @@ async function ivtrReleaseOp(params) {
20426
20430
  };
20427
20431
  }
20428
20432
  async function ivtrLoopBackOp(params) {
20429
- const cwd = getProjectRoot8();
20433
+ const cwd = getProjectRoot9();
20430
20434
  if (!isLoopBackTarget(params.phase)) {
20431
20435
  return {
20432
20436
  success: false,
@@ -24992,8 +24996,8 @@ async function loadPlaybookByName(name) {
24992
24996
  return null;
24993
24997
  }
24994
24998
  try {
24995
- const { getProjectRoot: getProjectRoot38 } = await import("@cleocode/core/internal");
24996
- const projectRoot = __playbookRuntimeOverrides.projectRoot ?? getProjectRoot38();
24999
+ const { getProjectRoot: getProjectRoot41 } = await import("@cleocode/core/internal");
25000
+ const projectRoot = __playbookRuntimeOverrides.projectRoot ?? getProjectRoot41();
24997
25001
  const resolved = resolvePlaybook(name, {
24998
25002
  projectRoot,
24999
25003
  globalPlaybooksDir: __playbookRuntimeOverrides.globalPlaybooksDir,
@@ -25037,8 +25041,8 @@ async function acquireDb() {
25037
25041
  async function buildDefaultDispatcher() {
25038
25042
  if (__playbookRuntimeOverrides.dispatcher) return __playbookRuntimeOverrides.dispatcher;
25039
25043
  const { orchestrateSpawnExecute: orchestrateSpawnExecute2 } = await Promise.resolve().then(() => (init_engine(), engine_exports));
25040
- const { getProjectRoot: getProjectRoot38 } = await import("@cleocode/core/internal");
25041
- const projectRoot = getProjectRoot38();
25044
+ const { getProjectRoot: getProjectRoot41 } = await import("@cleocode/core/internal");
25045
+ const projectRoot = getProjectRoot41();
25042
25046
  return {
25043
25047
  async dispatch(input2) {
25044
25048
  try {
@@ -25228,8 +25232,8 @@ var init_playbook2 = __esm({
25228
25232
  projectRoot = __playbookRuntimeOverrides.projectRoot;
25229
25233
  } else {
25230
25234
  try {
25231
- const { getProjectRoot: getProjectRoot38 } = await import("@cleocode/core/internal");
25232
- projectRoot = getProjectRoot38();
25235
+ const { getProjectRoot: getProjectRoot41 } = await import("@cleocode/core/internal");
25236
+ projectRoot = getProjectRoot41();
25233
25237
  } catch {
25234
25238
  projectRoot = void 0;
25235
25239
  }
@@ -25293,14 +25297,14 @@ var init_playbook2 = __esm({
25293
25297
  const dispatcher = await buildDefaultDispatcher();
25294
25298
  let result;
25295
25299
  try {
25296
- const { getProjectRoot: getProjectRoot38 } = await import("@cleocode/core/internal");
25300
+ const { getProjectRoot: getProjectRoot41 } = await import("@cleocode/core/internal");
25297
25301
  const opts = {
25298
25302
  db,
25299
25303
  playbook: parsed.definition,
25300
25304
  playbookHash: parsed.sourceHash,
25301
25305
  initialContext,
25302
25306
  dispatcher,
25303
- projectRoot: getProjectRoot38()
25307
+ projectRoot: getProjectRoot41()
25304
25308
  };
25305
25309
  if (__playbookRuntimeOverrides.approvalSecret !== void 0) {
25306
25310
  opts.approvalSecret = __playbookRuntimeOverrides.approvalSecret;
@@ -25482,7 +25486,7 @@ var init_playbook2 = __esm({
25482
25486
  // packages/cleo/src/dispatch/domains/orchestrate.ts
25483
25487
  import {
25484
25488
  getLogger as getLogger9,
25485
- getProjectRoot as getProjectRoot9,
25489
+ getProjectRoot as getProjectRoot10,
25486
25490
  instantiateTessera,
25487
25491
  listTesseraTemplates,
25488
25492
  paginate as paginate2,
@@ -25496,24 +25500,24 @@ function evictFanoutManifest() {
25496
25500
  }
25497
25501
  }
25498
25502
  async function orchestrateStatusOp(params) {
25499
- return orchestrateStatus(params.epicId, getProjectRoot9());
25503
+ return orchestrateStatus(params.epicId, getProjectRoot10());
25500
25504
  }
25501
25505
  async function orchestrateNextOp(params) {
25502
- return orchestrateNext(params.epicId, getProjectRoot9());
25506
+ return orchestrateNext(params.epicId, getProjectRoot10());
25503
25507
  }
25504
25508
  async function orchestrateReadyOp(params) {
25505
- return orchestrateReady(params.epicId, getProjectRoot9(), {
25509
+ return orchestrateReady(params.epicId, getProjectRoot10(), {
25506
25510
  ignoreDepsValidate: params.ignoreDepsValidate
25507
25511
  });
25508
25512
  }
25509
25513
  async function orchestrateAnalyzeOp(params) {
25510
25514
  if (params.mode === "parallel-safety") {
25511
- return orchestrateAnalyzeParallelSafety(params.taskIds ?? [], getProjectRoot9());
25515
+ return orchestrateAnalyzeParallelSafety(params.taskIds ?? [], getProjectRoot10());
25512
25516
  }
25513
- return orchestrateAnalyze(params.epicId, getProjectRoot9(), params.mode);
25517
+ return orchestrateAnalyze(params.epicId, getProjectRoot10(), params.mode);
25514
25518
  }
25515
25519
  async function orchestrateClassifyOp(params) {
25516
- return orchestrateClassify(params.request, params.context, getProjectRoot9());
25520
+ return orchestrateClassify(params.request, params.context, getProjectRoot10());
25517
25521
  }
25518
25522
  function orchestrateFanoutStatusOp(params) {
25519
25523
  const entry = fanoutManifestStore.get(params.manifestEntryId);
@@ -25546,23 +25550,23 @@ function orchestrateFanoutStatusOp(params) {
25546
25550
  });
25547
25551
  }
25548
25552
  async function orchestrateContextOp(params) {
25549
- return orchestrateContext(params.epicId, getProjectRoot9());
25553
+ return orchestrateContext(params.epicId, getProjectRoot10());
25550
25554
  }
25551
25555
  async function orchestrateWavesOp(params) {
25552
- return orchestrateWaves(params.epicId, getProjectRoot9());
25556
+ return orchestrateWaves(params.epicId, getProjectRoot10());
25553
25557
  }
25554
25558
  async function orchestratePlanOp(params) {
25555
25559
  return orchestratePlan({
25556
25560
  epicId: params.epicId,
25557
- projectRoot: getProjectRoot9(),
25561
+ projectRoot: getProjectRoot10(),
25558
25562
  preferTier: params.preferTier
25559
25563
  });
25560
25564
  }
25561
25565
  async function orchestrateBootstrapOp(params) {
25562
- return orchestrateBootstrap(getProjectRoot9(), { speed: params.speed });
25566
+ return orchestrateBootstrap(getProjectRoot10(), { speed: params.speed });
25563
25567
  }
25564
25568
  async function orchestrateUnblockOp(_params) {
25565
- return orchestrateUnblockOpportunities(getProjectRoot9());
25569
+ return orchestrateUnblockOpportunities(getProjectRoot10());
25566
25570
  }
25567
25571
  async function orchestrateTesseraListOp(params) {
25568
25572
  return Promise.resolve({ success: true, data: params });
@@ -25574,13 +25578,13 @@ async function orchestratePendingOp(_params) {
25574
25578
  return Promise.resolve({ success: true, data: {} });
25575
25579
  }
25576
25580
  async function orchestrateStartOp(params) {
25577
- return orchestrateStartup(params.epicId, getProjectRoot9());
25581
+ return orchestrateStartup(params.epicId, getProjectRoot10());
25578
25582
  }
25579
25583
  async function orchestrateSpawnOp(params) {
25580
25584
  return orchestrateSpawn(
25581
25585
  params.taskId,
25582
25586
  params.protocolType,
25583
- getProjectRoot9(),
25587
+ getProjectRoot10(),
25584
25588
  params.tier,
25585
25589
  params.noWorktree
25586
25590
  );
@@ -25598,7 +25602,7 @@ async function orchestrateHandoffOp(params) {
25598
25602
  },
25599
25603
  // Inject cleo session ops to avoid core→cleo import cycle (T1570 ADR-057)
25600
25604
  { sessionStatus, sessionEnd, sessionContextInject },
25601
- getProjectRoot9()
25605
+ getProjectRoot10()
25602
25606
  );
25603
25607
  }
25604
25608
  async function orchestrateSpawnExecuteOp(params) {
@@ -25606,19 +25610,19 @@ async function orchestrateSpawnExecuteOp(params) {
25606
25610
  params.taskId,
25607
25611
  params.adapterId,
25608
25612
  params.protocolType,
25609
- getProjectRoot9(),
25613
+ getProjectRoot10(),
25610
25614
  params.tier
25611
25615
  );
25612
25616
  }
25613
25617
  async function orchestrateValidateOp(params) {
25614
- return orchestrateValidate(params.taskId, getProjectRoot9());
25618
+ return orchestrateValidate(params.taskId, getProjectRoot10());
25615
25619
  }
25616
25620
  async function orchestratePivotOp(params) {
25617
25621
  try {
25618
25622
  const result = await pivotTask(params.fromTaskId, params.toTaskId, {
25619
25623
  reason: params.reason,
25620
25624
  blocksFrom: params.blocksFrom,
25621
- projectRoot: getProjectRoot9()
25625
+ projectRoot: getProjectRoot10()
25622
25626
  });
25623
25627
  return { success: true, data: result };
25624
25628
  } catch (err) {
@@ -25636,19 +25640,19 @@ async function orchestratePivotOp(params) {
25636
25640
  }
25637
25641
  }
25638
25642
  async function orchestrateWorktreeCompleteOp(params) {
25639
- return handleWorktreeComplete(params.taskId, getProjectRoot9(), params.resolve);
25643
+ return handleWorktreeComplete(params.taskId, getProjectRoot10(), params.resolve);
25640
25644
  }
25641
25645
  async function orchestrateWorktreeCleanupOp(params) {
25642
- return handleWorktreeCleanup(getProjectRoot9(), params.taskIds);
25646
+ return handleWorktreeCleanup(getProjectRoot10(), params.taskIds);
25643
25647
  }
25644
25648
  async function orchestrateWorktreePruneOp(params) {
25645
- return handleWorktreePrune(getProjectRoot9(), params.taskId);
25649
+ return handleWorktreePrune(getProjectRoot10(), params.taskId);
25646
25650
  }
25647
25651
  async function orchestrateParallelOp(params) {
25648
25652
  return Promise.resolve({ success: true, data: params });
25649
25653
  }
25650
25654
  async function orchestrateFanoutOp(params) {
25651
- return orchestrateFanoutImpl(params.items, getProjectRoot9());
25655
+ return orchestrateFanoutImpl(params.items, getProjectRoot10());
25652
25656
  }
25653
25657
  async function orchestrateTesseraInstantiateOp(params) {
25654
25658
  return Promise.resolve({ success: true, data: params });
@@ -26616,7 +26620,7 @@ var init_orchestrate2 = __esm({
26616
26620
  startTime
26617
26621
  );
26618
26622
  return wrapResult(
26619
- await orchestrateParallelStart(epicId, wave, getProjectRoot9()),
26623
+ await orchestrateParallelStart(epicId, wave, getProjectRoot10()),
26620
26624
  "mutate",
26621
26625
  "orchestrate",
26622
26626
  "parallel",
@@ -26645,7 +26649,7 @@ var init_orchestrate2 = __esm({
26645
26649
  startTime
26646
26650
  );
26647
26651
  return wrapResult(
26648
- await orchestrateParallelEnd(epicId, wave, getProjectRoot9()),
26652
+ await orchestrateParallelEnd(epicId, wave, getProjectRoot10()),
26649
26653
  "mutate",
26650
26654
  "orchestrate",
26651
26655
  "parallel",
@@ -26712,7 +26716,7 @@ var init_orchestrate2 = __esm({
26712
26716
  epicId,
26713
26717
  variables: { epicId, ...variables }
26714
26718
  },
26715
- getProjectRoot9()
26719
+ getProjectRoot10()
26716
26720
  );
26717
26721
  return {
26718
26722
  meta: dispatchMeta("mutate", "orchestrate", operation, startTime),
@@ -26805,7 +26809,7 @@ import {
26805
26809
  describeChannel,
26806
26810
  formatStageGuidance,
26807
26811
  getLogger as getLogger10,
26808
- getProjectRoot as getProjectRoot10,
26812
+ getProjectRoot as getProjectRoot11,
26809
26813
  isValidStage,
26810
26814
  listChains,
26811
26815
  paginate as paginate3,
@@ -26813,19 +26817,19 @@ import {
26813
26817
  showChain
26814
26818
  } from "@cleocode/core/internal";
26815
26819
  async function stageValidateOp(params) {
26816
- return lifecycleCheck(params.epicId, params.targetStage, getProjectRoot10());
26820
+ return lifecycleCheck(params.epicId, params.targetStage, getProjectRoot11());
26817
26821
  }
26818
26822
  async function stageStatusOp(params) {
26819
- return lifecycleStatus(params.epicId, getProjectRoot10());
26823
+ return lifecycleStatus(params.epicId, getProjectRoot11());
26820
26824
  }
26821
26825
  async function stageHistoryOp(params) {
26822
- return lifecycleHistory(params.taskId, getProjectRoot10());
26826
+ return lifecycleHistory(params.taskId, getProjectRoot11());
26823
26827
  }
26824
26828
  async function stageGuidanceOp(params) {
26825
26829
  let stage = params.stage;
26826
26830
  const epicId = params.epicId;
26827
26831
  const format = params.format ?? "markdown";
26828
- const projectRoot = getProjectRoot10();
26832
+ const projectRoot = getProjectRoot11();
26829
26833
  if (!stage && epicId) {
26830
26834
  const statusResult = await lifecycleStatus(epicId, projectRoot);
26831
26835
  if (statusResult.success) {
@@ -26841,14 +26845,14 @@ async function stageRecordOp(params) {
26841
26845
  params.stage,
26842
26846
  params.status,
26843
26847
  params.notes,
26844
- getProjectRoot10()
26848
+ getProjectRoot11()
26845
26849
  );
26846
26850
  }
26847
26851
  async function stageSkipOp(params) {
26848
- return lifecycleSkip(params.taskId, params.stage, params.reason, getProjectRoot10());
26852
+ return lifecycleSkip(params.taskId, params.stage, params.reason, getProjectRoot11());
26849
26853
  }
26850
26854
  async function stageResetOp(params) {
26851
- return lifecycleReset(params.taskId, params.stage, params.reason, getProjectRoot10());
26855
+ return lifecycleReset(params.taskId, params.stage, params.reason, getProjectRoot11());
26852
26856
  }
26853
26857
  async function stageGatePassOp(params) {
26854
26858
  return lifecycleGatePass(
@@ -26856,24 +26860,24 @@ async function stageGatePassOp(params) {
26856
26860
  params.gateName,
26857
26861
  params.agent,
26858
26862
  params.notes,
26859
- getProjectRoot10()
26863
+ getProjectRoot11()
26860
26864
  );
26861
26865
  }
26862
26866
  async function stageGateFailOp(params) {
26863
- return lifecycleGateFail(params.taskId, params.gateName, params.reason, getProjectRoot10());
26867
+ return lifecycleGateFail(params.taskId, params.gateName, params.reason, getProjectRoot11());
26864
26868
  }
26865
26869
  async function releaseListOp(params) {
26866
26870
  return releaseList(
26867
26871
  { status: params.status, limit: params.limit, offset: params.offset },
26868
- getProjectRoot10()
26872
+ getProjectRoot11()
26869
26873
  );
26870
26874
  }
26871
26875
  async function releaseShowOp(params) {
26872
- return releaseShow(params.version, getProjectRoot10());
26876
+ return releaseShow(params.version, getProjectRoot11());
26873
26877
  }
26874
26878
  async function releaseChannelShowOp(_params) {
26875
26879
  let currentBranch = "unknown";
26876
- const projectRoot = getProjectRoot10();
26880
+ const projectRoot = getProjectRoot11();
26877
26881
  try {
26878
26882
  currentBranch = execFileSync("git", ["rev-parse", "--abbrev-ref", "HEAD"], {
26879
26883
  encoding: "utf-8",
@@ -26891,55 +26895,55 @@ async function releaseChannelShowOp(_params) {
26891
26895
  };
26892
26896
  }
26893
26897
  async function releaseChangelogSinceOp(params) {
26894
- return releaseChangelogSince(params.sinceTag, getProjectRoot10());
26898
+ return releaseChangelogSince(params.sinceTag, getProjectRoot11());
26895
26899
  }
26896
26900
  async function releasePrStatusOp(params) {
26897
- return releasePrStatus(params.version, getProjectRoot10());
26901
+ return releasePrStatus(params.version, getProjectRoot11());
26898
26902
  }
26899
26903
  async function releaseCancelOp(params) {
26900
- return releaseCancel(params.version, getProjectRoot10());
26904
+ return releaseCancel(params.version, getProjectRoot11());
26901
26905
  }
26902
26906
  async function releaseRollbackOp(params) {
26903
- return releaseRollback(params.version, params.reason, getProjectRoot10());
26907
+ return releaseRollback(params.version, params.reason, getProjectRoot11());
26904
26908
  }
26905
26909
  async function releaseRollbackFullOp(params) {
26906
26910
  return releaseRollbackFull(
26907
26911
  params.version,
26908
26912
  { reason: params.reason, force: params.force, unpublish: params.unpublish },
26909
- getProjectRoot10()
26913
+ getProjectRoot11()
26910
26914
  );
26911
26915
  }
26912
26916
  async function manifestShowOp(params) {
26913
- return pipelineManifestShow(params.entryId, getProjectRoot10());
26917
+ return pipelineManifestShow(params.entryId, getProjectRoot11());
26914
26918
  }
26915
26919
  async function manifestListOp(params) {
26916
- return pipelineManifestList(params, getProjectRoot10());
26920
+ return pipelineManifestList(params, getProjectRoot11());
26917
26921
  }
26918
26922
  async function manifestFindOp(params) {
26919
26923
  return pipelineManifestFind(
26920
26924
  params.query,
26921
26925
  { confidence: params.confidence, limit: params.limit },
26922
- getProjectRoot10()
26926
+ getProjectRoot11()
26923
26927
  );
26924
26928
  }
26925
26929
  async function manifestStatsOp(params) {
26926
- return pipelineManifestStats(params.epicId, getProjectRoot10());
26930
+ return pipelineManifestStats(params.epicId, getProjectRoot11());
26927
26931
  }
26928
26932
  async function manifestAppendOp(params) {
26929
- return pipelineManifestAppend(params.entry, getProjectRoot10());
26933
+ return pipelineManifestAppend(params.entry, getProjectRoot11());
26930
26934
  }
26931
26935
  async function manifestArchiveOp(params) {
26932
- return pipelineManifestArchive(params.beforeDate, getProjectRoot10());
26936
+ return pipelineManifestArchive(params.beforeDate, getProjectRoot11());
26933
26937
  }
26934
26938
  async function phaseShowOp(params) {
26935
- return phaseShow(params.phaseId, getProjectRoot10());
26939
+ return phaseShow(params.phaseId, getProjectRoot11());
26936
26940
  }
26937
26941
  async function phaseListOp(_params) {
26938
- return phaseList(getProjectRoot10());
26942
+ return phaseList(getProjectRoot11());
26939
26943
  }
26940
26944
  async function phaseSetOp(params) {
26941
26945
  const { phaseId, action, rollback, force, dryRun } = params;
26942
- const projectRoot = getProjectRoot10();
26946
+ const projectRoot = getProjectRoot11();
26943
26947
  if (action === "start") {
26944
26948
  return phaseStart(phaseId, projectRoot);
26945
26949
  }
@@ -26949,28 +26953,28 @@ async function phaseSetOp(params) {
26949
26953
  return phaseSet({ phaseId, rollback, force, dryRun }, projectRoot);
26950
26954
  }
26951
26955
  async function phaseAdvanceOp(params) {
26952
- return phaseAdvance(params.force, getProjectRoot10());
26956
+ return phaseAdvance(params.force, getProjectRoot11());
26953
26957
  }
26954
26958
  async function phaseRenameOp(params) {
26955
- return phaseRename(params.oldName, params.newName, getProjectRoot10());
26959
+ return phaseRename(params.oldName, params.newName, getProjectRoot11());
26956
26960
  }
26957
26961
  async function phaseDeleteOp(params) {
26958
26962
  return phaseDelete(
26959
26963
  params.phaseId,
26960
26964
  { reassignTo: params.reassignTo, force: params.force },
26961
- getProjectRoot10()
26965
+ getProjectRoot11()
26962
26966
  );
26963
26967
  }
26964
26968
  async function chainShowOp(params) {
26965
- const chain = await showChain(params.chainId, getProjectRoot10());
26969
+ const chain = await showChain(params.chainId, getProjectRoot11());
26966
26970
  return { _chain: chain, _chainId: params.chainId };
26967
26971
  }
26968
26972
  async function chainListOp(_params) {
26969
- const chains = await listChains(getProjectRoot10());
26973
+ const chains = await listChains(getProjectRoot11());
26970
26974
  return { _chains: chains };
26971
26975
  }
26972
26976
  async function chainAddOp(params) {
26973
- await addChain(params.chain, getProjectRoot10());
26977
+ await addChain(params.chain, getProjectRoot11());
26974
26978
  return { id: params.chain.id };
26975
26979
  }
26976
26980
  async function chainInstantiateOp(params) {
@@ -26981,7 +26985,7 @@ async function chainInstantiateOp(params) {
26981
26985
  variables: params.variables,
26982
26986
  stageToTask: params.stageToTask
26983
26987
  },
26984
- getProjectRoot10()
26988
+ getProjectRoot11()
26985
26989
  );
26986
26990
  }
26987
26991
  async function chainAdvanceOp(params) {
@@ -26989,7 +26993,7 @@ async function chainAdvanceOp(params) {
26989
26993
  params.instanceId,
26990
26994
  params.nextStage,
26991
26995
  params.gateResults ?? [],
26992
- getProjectRoot10()
26996
+ getProjectRoot11()
26993
26997
  );
26994
26998
  }
26995
26999
  function pipelinePhaseListResponse(envelope, params, operation, startTime) {
@@ -27518,7 +27522,7 @@ var init_pipeline3 = __esm({
27518
27522
  // packages/cleo/src/dispatch/domains/provenance.ts
27519
27523
  import {
27520
27524
  getLogger as getLogger11,
27521
- getProjectRoot as getProjectRoot11,
27525
+ getProjectRoot as getProjectRoot12,
27522
27526
  provenanceBackfill,
27523
27527
  verifyProvenance
27524
27528
  } from "@cleocode/core/internal";
@@ -27563,7 +27567,7 @@ var init_provenance = __esm({
27563
27567
  ...version ? { version } : {},
27564
27568
  all,
27565
27569
  ...limit !== void 0 ? { limit } : {},
27566
- projectRoot: getProjectRoot11()
27570
+ projectRoot: getProjectRoot12()
27567
27571
  });
27568
27572
  return wrapResult(result, "query", "provenance", operation, startTime);
27569
27573
  }
@@ -27609,7 +27613,7 @@ var init_provenance = __esm({
27609
27613
  const resetCheckpoint = typeof params?.["resetCheckpoint"] === "boolean" ? params["resetCheckpoint"] : false;
27610
27614
  const result = await provenanceBackfill({
27611
27615
  since,
27612
- projectRoot: getProjectRoot11(),
27616
+ projectRoot: getProjectRoot12(),
27613
27617
  forceOverwrite,
27614
27618
  dryRun,
27615
27619
  resetCheckpoint
@@ -27639,12 +27643,12 @@ var init_provenance = __esm({
27639
27643
  });
27640
27644
 
27641
27645
  // packages/cleo/src/dispatch/domains/release.ts
27642
- import { getLogger as getLogger12, getProjectRoot as getProjectRoot12 } from "@cleocode/core/internal";
27646
+ import { getLogger as getLogger12, getProjectRoot as getProjectRoot13 } from "@cleocode/core/internal";
27643
27647
  async function releaseGateOp(params) {
27644
- return releaseGateCheck(params.epicId, params.force ?? false, getProjectRoot12());
27648
+ return releaseGateCheck(params.epicId, params.force ?? false, getProjectRoot13());
27645
27649
  }
27646
27650
  async function releaseIvtrSuggestOp(params) {
27647
- return releaseIvtrAutoSuggest(params.taskId, getProjectRoot12());
27651
+ return releaseIvtrAutoSuggest(params.taskId, getProjectRoot13());
27648
27652
  }
27649
27653
  var log3, coreOps4, ReleaseHandler;
27650
27654
  var init_release2 = __esm({
@@ -27815,7 +27819,7 @@ var init_release2 = __esm({
27815
27819
  channel: typeof params?.channel === "string" ? params.channel : void 0,
27816
27820
  hotfix: typeof params?.hotfix === "boolean" ? params.hotfix : false,
27817
27821
  dryRun: typeof params?.dryRun === "boolean" ? params.dryRun : false,
27818
- projectRoot: getProjectRoot12()
27822
+ projectRoot: getProjectRoot13()
27819
27823
  };
27820
27824
  return wrapResult(await releasePlan(typed), "mutate", "release", operation, startTime);
27821
27825
  }
@@ -27837,7 +27841,7 @@ var init_release2 = __esm({
27837
27841
  workflow: typeof params?.workflow === "string" ? params.workflow : void 0,
27838
27842
  watch: typeof params?.watch === "boolean" ? params.watch : false,
27839
27843
  commitPlan: typeof params?.commitPlan === "boolean" ? params.commitPlan : false,
27840
- projectRoot: getProjectRoot12()
27844
+ projectRoot: getProjectRoot13()
27841
27845
  };
27842
27846
  return wrapResult(await releaseOpen(typed), "mutate", "release", operation, startTime);
27843
27847
  }
@@ -27854,7 +27858,7 @@ var init_release2 = __esm({
27854
27858
  startTime
27855
27859
  );
27856
27860
  const result = await releaseReconcileV2(version, {
27857
- projectRoot: getProjectRoot12(),
27861
+ projectRoot: getProjectRoot13(),
27858
27862
  fromWorkflow: typeof params?.fromWorkflow === "boolean" ? params.fromWorkflow : false,
27859
27863
  rollback: typeof params?.rollback === "boolean" ? params.rollback : false
27860
27864
  });
@@ -27883,7 +27887,7 @@ var init_release2 = __esm({
27883
27887
  });
27884
27888
 
27885
27889
  // packages/cleo/src/dispatch/domains/sentient.ts
27886
- import { getProjectRoot as getProjectRoot13 } from "@cleocode/core";
27890
+ import { getProjectRoot as getProjectRoot14 } from "@cleocode/core";
27887
27891
  import {
27888
27892
  sentientAllowlistAdd,
27889
27893
  sentientAllowlistList,
@@ -27903,16 +27907,16 @@ var init_sentient2 = __esm({
27903
27907
  init_typed();
27904
27908
  init_base();
27905
27909
  coreOps5 = {
27906
- "propose.list": (params) => sentientProposeList(getProjectRoot13(), params),
27907
- "propose.diff": (params) => sentientProposeDiff(getProjectRoot13(), params),
27908
- "allowlist.list": (params) => sentientAllowlistList(getProjectRoot13(), params),
27909
- "propose.accept": (params) => sentientProposeAccept(getProjectRoot13(), params),
27910
- "propose.reject": (params) => sentientProposeReject(getProjectRoot13(), params),
27911
- "propose.run": (params) => sentientProposeRun(getProjectRoot13(), params),
27912
- "propose.enable": (params) => sentientProposeEnable(getProjectRoot13(), params),
27913
- "propose.disable": (params) => sentientProposeDisable(getProjectRoot13(), params),
27914
- "allowlist.add": (params) => sentientAllowlistAdd(getProjectRoot13(), params),
27915
- "allowlist.remove": (params) => sentientAllowlistRemove(getProjectRoot13(), params)
27910
+ "propose.list": (params) => sentientProposeList(getProjectRoot14(), params),
27911
+ "propose.diff": (params) => sentientProposeDiff(getProjectRoot14(), params),
27912
+ "allowlist.list": (params) => sentientAllowlistList(getProjectRoot14(), params),
27913
+ "propose.accept": (params) => sentientProposeAccept(getProjectRoot14(), params),
27914
+ "propose.reject": (params) => sentientProposeReject(getProjectRoot14(), params),
27915
+ "propose.run": (params) => sentientProposeRun(getProjectRoot14(), params),
27916
+ "propose.enable": (params) => sentientProposeEnable(getProjectRoot14(), params),
27917
+ "propose.disable": (params) => sentientProposeDisable(getProjectRoot14(), params),
27918
+ "allowlist.add": (params) => sentientAllowlistAdd(getProjectRoot14(), params),
27919
+ "allowlist.remove": (params) => sentientAllowlistRemove(getProjectRoot14(), params)
27916
27920
  };
27917
27921
  _sentientTypedHandler = defineTypedHandler("sentient", {
27918
27922
  // -------------------------------------------------------------------------
@@ -28142,28 +28146,28 @@ var init_session_context = __esm({
28142
28146
  });
28143
28147
 
28144
28148
  // packages/cleo/src/dispatch/domains/session.ts
28145
- import { getDb, getLogger as getLogger13, getProjectRoot as getProjectRoot14, sessions } from "@cleocode/core/internal";
28149
+ import { getDb, getLogger as getLogger13, getProjectRoot as getProjectRoot15, sessions } from "@cleocode/core/internal";
28146
28150
  import { eq } from "drizzle-orm";
28147
28151
  async function sessionStatusOp() {
28148
- return sessionStatus(getProjectRoot14());
28152
+ return sessionStatus(getProjectRoot15());
28149
28153
  }
28150
28154
  async function sessionListOp(params) {
28151
- return sessionList(getProjectRoot14(), params);
28155
+ return sessionList(getProjectRoot15(), params);
28152
28156
  }
28153
28157
  async function sessionShowOp(params) {
28154
28158
  if (params.include === "debrief") {
28155
- return sessionDebriefShow(getProjectRoot14(), params.sessionId);
28159
+ return sessionDebriefShow(getProjectRoot15(), params.sessionId);
28156
28160
  }
28157
- return sessionShow(getProjectRoot14(), params.sessionId);
28161
+ return sessionShow(getProjectRoot15(), params.sessionId);
28158
28162
  }
28159
28163
  async function sessionFindOp(params) {
28160
- return sessionFind(getProjectRoot14(), params);
28164
+ return sessionFind(getProjectRoot15(), params);
28161
28165
  }
28162
28166
  async function sessionDecisionLogOp(params) {
28163
- return sessionDecisionLog(getProjectRoot14(), params);
28167
+ return sessionDecisionLog(getProjectRoot15(), params);
28164
28168
  }
28165
28169
  async function sessionContextDriftOp(params) {
28166
- return sessionContextDrift(getProjectRoot14(), params);
28170
+ return sessionContextDrift(getProjectRoot15(), params);
28167
28171
  }
28168
28172
  async function sessionHandoffShowOp(params) {
28169
28173
  let scopeFilter;
@@ -28174,33 +28178,33 @@ async function sessionHandoffShowOp(params) {
28174
28178
  scopeFilter = { type: "epic", epicId: params.scope.replace("epic:", "") };
28175
28179
  }
28176
28180
  }
28177
- return sessionHandoff(getProjectRoot14(), scopeFilter);
28181
+ return sessionHandoff(getProjectRoot15(), scopeFilter);
28178
28182
  }
28179
28183
  async function sessionBriefingShowOp(params) {
28180
- return sessionBriefing(getProjectRoot14(), params);
28184
+ return sessionBriefing(getProjectRoot15(), params);
28181
28185
  }
28182
28186
  async function sessionStartOp(params) {
28183
- return sessionStart(getProjectRoot14(), params);
28187
+ return sessionStart(getProjectRoot15(), params);
28184
28188
  }
28185
28189
  async function sessionEndOp(params) {
28186
- return sessionEnd(getProjectRoot14(), params.note, {
28190
+ return sessionEnd(getProjectRoot15(), params.note, {
28187
28191
  sessionSummary: params.sessionSummary
28188
28192
  });
28189
28193
  }
28190
28194
  async function sessionResumeOp(params) {
28191
- return sessionResume(getProjectRoot14(), params.sessionId);
28195
+ return sessionResume(getProjectRoot15(), params.sessionId);
28192
28196
  }
28193
28197
  async function sessionSuspendOp(params) {
28194
- return sessionSuspend(getProjectRoot14(), params.sessionId, params.reason);
28198
+ return sessionSuspend(getProjectRoot15(), params.sessionId, params.reason);
28195
28199
  }
28196
28200
  async function sessionGcOp(params) {
28197
- return sessionGc(getProjectRoot14(), params.maxAgeDays);
28201
+ return sessionGc(getProjectRoot15(), params.maxAgeDays);
28198
28202
  }
28199
28203
  async function sessionRecordDecisionOp(params) {
28200
- return sessionRecordDecision(getProjectRoot14(), params);
28204
+ return sessionRecordDecision(getProjectRoot15(), params);
28201
28205
  }
28202
28206
  async function sessionRecordAssumptionOp(params) {
28203
- return sessionRecordAssumption(getProjectRoot14(), params);
28207
+ return sessionRecordAssumption(getProjectRoot15(), params);
28204
28208
  }
28205
28209
  async function storeSessionOwnerAuthToken(projectRoot, sessionId, token) {
28206
28210
  const db = await getDb(projectRoot);
@@ -28289,7 +28293,7 @@ var init_session3 = __esm({
28289
28293
  // SSoT-EXEMPT: storeOwnerAuthToken (DB side-effect requiring post-create sessionId),
28290
28294
  // bindSession (process-scoped context, requires scope-string parsing) — ADR-058
28291
28295
  start: async (params) => {
28292
- const projectRoot = getProjectRoot14();
28296
+ const projectRoot = getProjectRoot15();
28293
28297
  if (!params.scope) {
28294
28298
  return lafsError("E_INVALID_INPUT", "scope is required", "start");
28295
28299
  }
@@ -28338,7 +28342,7 @@ var init_session3 = __esm({
28338
28342
  // SSoT-EXEMPT: orchestrated post-op pipeline — sessionComputeDebrief, persistSessionMemory,
28339
28343
  // unbindSession (process-context teardown), refreshMemoryBridge — ADR-058
28340
28344
  end: async (params) => {
28341
- const projectRoot = getProjectRoot14();
28345
+ const projectRoot = getProjectRoot15();
28342
28346
  const endResult = await coreOps6.end(params);
28343
28347
  if (!endResult.success) {
28344
28348
  return lafsError(
@@ -28530,7 +28534,7 @@ var init_session3 = __esm({
28530
28534
  });
28531
28535
 
28532
28536
  // packages/cleo/src/dispatch/domains/sticky.ts
28533
- import { getLogger as getLogger14, getProjectRoot as getProjectRoot15 } from "@cleocode/core";
28537
+ import { getLogger as getLogger14, getProjectRoot as getProjectRoot16 } from "@cleocode/core";
28534
28538
  import {
28535
28539
  stickyAdd,
28536
28540
  stickyArchive,
@@ -28544,7 +28548,7 @@ import {
28544
28548
  } from "@cleocode/core/internal";
28545
28549
  async function stickyListOp(params) {
28546
28550
  return stickyListFiltered(
28547
- getProjectRoot15(),
28551
+ getProjectRoot16(),
28548
28552
  {
28549
28553
  status: params.status,
28550
28554
  color: params.color,
@@ -28556,10 +28560,10 @@ async function stickyListOp(params) {
28556
28560
  );
28557
28561
  }
28558
28562
  async function stickyShowOp(params) {
28559
- return stickyShow(getProjectRoot15(), params.stickyId);
28563
+ return stickyShow(getProjectRoot16(), params.stickyId);
28560
28564
  }
28561
28565
  async function stickyAddOp(params) {
28562
- return stickyAdd(getProjectRoot15(), {
28566
+ return stickyAdd(getProjectRoot16(), {
28563
28567
  content: params.content,
28564
28568
  tags: params.tags,
28565
28569
  color: params.color,
@@ -28567,24 +28571,24 @@ async function stickyAddOp(params) {
28567
28571
  });
28568
28572
  }
28569
28573
  async function stickyArchiveOp(params) {
28570
- return stickyArchive(getProjectRoot15(), params.stickyId);
28574
+ return stickyArchive(getProjectRoot16(), params.stickyId);
28571
28575
  }
28572
28576
  async function stickyPurgeOp(params) {
28573
- return stickyPurge(getProjectRoot15(), params.stickyId);
28577
+ return stickyPurge(getProjectRoot16(), params.stickyId);
28574
28578
  }
28575
28579
  async function stickyConvertTaskOp(params) {
28576
- const result = await stickyConvertToTask(getProjectRoot15(), params.stickyId, params.title);
28580
+ const result = await stickyConvertToTask(getProjectRoot16(), params.stickyId, params.title);
28577
28581
  if (!result.success) return { taskId: void 0 };
28578
28582
  return { taskId: result.data.taskId };
28579
28583
  }
28580
28584
  async function stickyConvertMemoryOp(params) {
28581
- const result = await stickyConvertToMemory(getProjectRoot15(), params.stickyId, params.memoryType);
28585
+ const result = await stickyConvertToMemory(getProjectRoot16(), params.stickyId, params.memoryType);
28582
28586
  if (!result.success) return { memoryId: void 0 };
28583
28587
  return { memoryId: result.data.memoryId };
28584
28588
  }
28585
28589
  async function stickyConvertSessionNoteOp(params) {
28586
28590
  const result = await stickyConvertToSessionNote(
28587
- getProjectRoot15(),
28591
+ getProjectRoot16(),
28588
28592
  params.stickyId,
28589
28593
  params.sessionId
28590
28594
  );
@@ -28592,7 +28596,7 @@ async function stickyConvertSessionNoteOp(params) {
28592
28596
  return { sessionId: result.data.sessionId };
28593
28597
  }
28594
28598
  async function stickyConvertTaskNoteOp(params) {
28595
- const result = await stickyConvertToTaskNote(getProjectRoot15(), params.stickyId, params.taskId);
28599
+ const result = await stickyConvertToTaskNote(getProjectRoot16(), params.stickyId, params.taskId);
28596
28600
  if (!result.success) return { taskId: void 0 };
28597
28601
  return { taskId: result.data.taskId };
28598
28602
  }
@@ -28763,9 +28767,9 @@ var init_sticky2 = __esm({
28763
28767
  });
28764
28768
 
28765
28769
  // packages/cleo/src/dispatch/domains/tasks.ts
28766
- import { getLogger as getLogger15, getProjectRoot as getProjectRoot16 } from "@cleocode/core";
28770
+ import { getLogger as getLogger15, getProjectRoot as getProjectRoot17 } from "@cleocode/core";
28767
28771
  async function sagaCreate(params) {
28768
- const projectRoot = getProjectRoot16();
28772
+ const projectRoot = getProjectRoot17();
28769
28773
  const title = typeof params.title === "string" ? params.title : "";
28770
28774
  const description = typeof params.description === "string" ? params.description : void 0;
28771
28775
  const acceptance = Array.isArray(params.acceptance) ? params.acceptance : void 0;
@@ -28781,7 +28785,7 @@ async function sagaCreate(params) {
28781
28785
  );
28782
28786
  }
28783
28787
  async function sagaAdd(params) {
28784
- const projectRoot = getProjectRoot16();
28788
+ const projectRoot = getProjectRoot17();
28785
28789
  const sagaId = typeof params.sagaId === "string" ? params.sagaId : "";
28786
28790
  const epicId = typeof params.epicId === "string" ? params.epicId : "";
28787
28791
  if (!sagaId || !epicId) {
@@ -28819,7 +28823,7 @@ async function sagaAdd(params) {
28819
28823
  return lafsSuccess({ sagaId, epicId, added: relResult.data?.added ?? true }, "saga.add");
28820
28824
  }
28821
28825
  async function sagaList() {
28822
- const projectRoot = getProjectRoot16();
28826
+ const projectRoot = getProjectRoot17();
28823
28827
  const result = await taskList(projectRoot, { type: "epic", label: "saga" });
28824
28828
  if (!result.success) {
28825
28829
  return lafsError("E_GENERAL", result.error?.message ?? "Failed to list Sagas", "saga.list");
@@ -28832,7 +28836,7 @@ async function sagaList() {
28832
28836
  return lafsSuccess({ sagas: topLevel, total: topLevel.length }, "saga.list");
28833
28837
  }
28834
28838
  async function sagaMembers(params) {
28835
- const projectRoot = getProjectRoot16();
28839
+ const projectRoot = getProjectRoot17();
28836
28840
  const sagaId = typeof params.sagaId === "string" ? params.sagaId : "";
28837
28841
  if (!sagaId) {
28838
28842
  return lafsError("E_INVALID_INPUT", "sagaId is required", "saga.members");
@@ -28857,7 +28861,7 @@ async function sagaMembers(params) {
28857
28861
  );
28858
28862
  }
28859
28863
  async function sagaRollup(params) {
28860
- const projectRoot = getProjectRoot16();
28864
+ const projectRoot = getProjectRoot17();
28861
28865
  const sagaId = typeof params.sagaId === "string" ? params.sagaId : "";
28862
28866
  if (!sagaId) {
28863
28867
  return lafsError("E_INVALID_INPUT", "sagaId is required", "saga.rollup");
@@ -28909,7 +28913,7 @@ var init_tasks3 = __esm({
28909
28913
  // Query ops
28910
28914
  // -------------------------------------------------------------------------
28911
28915
  show: async (params) => {
28912
- const projectRoot = getProjectRoot16();
28916
+ const projectRoot = getProjectRoot17();
28913
28917
  if (params.ivtrHistory) {
28914
28918
  return wrapCoreResult(await taskShowIvtrHistory(projectRoot, params.taskId), "show");
28915
28919
  }
@@ -28919,7 +28923,7 @@ var init_tasks3 = __esm({
28919
28923
  return wrapCoreResult(await taskShow(projectRoot, params.taskId), "show");
28920
28924
  },
28921
28925
  list: async (params) => {
28922
- const projectRoot = getProjectRoot16();
28926
+ const projectRoot = getProjectRoot17();
28923
28927
  const result = await taskList(projectRoot, {
28924
28928
  parent: params.parent,
28925
28929
  status: params.status,
@@ -28945,7 +28949,7 @@ var init_tasks3 = __esm({
28945
28949
  return lafsSuccess(result.data, "list");
28946
28950
  },
28947
28951
  find: async (params) => {
28948
- const projectRoot = getProjectRoot16();
28952
+ const projectRoot = getProjectRoot17();
28949
28953
  return wrapCoreResult(
28950
28954
  await taskFind(projectRoot, params.query, params.limit, {
28951
28955
  id: params.id,
@@ -28962,15 +28966,15 @@ var init_tasks3 = __esm({
28962
28966
  );
28963
28967
  },
28964
28968
  tree: async (params) => {
28965
- const projectRoot = getProjectRoot16();
28969
+ const projectRoot = getProjectRoot17();
28966
28970
  return wrapCoreResult(await taskTree(projectRoot, params.taskId, params.withBlockers), "tree");
28967
28971
  },
28968
28972
  blockers: async (params) => {
28969
- const projectRoot = getProjectRoot16();
28973
+ const projectRoot = getProjectRoot17();
28970
28974
  return wrapCoreResult(await taskBlockers(projectRoot, params), "blockers");
28971
28975
  },
28972
28976
  depends: async (params) => {
28973
- const projectRoot = getProjectRoot16();
28977
+ const projectRoot = getProjectRoot17();
28974
28978
  if (params.action === "overview") {
28975
28979
  return wrapCoreResult(await taskDepsOverview(projectRoot), "depends");
28976
28980
  }
@@ -28990,14 +28994,14 @@ var init_tasks3 = __esm({
28990
28994
  );
28991
28995
  },
28992
28996
  "deps.validate": async (params) => {
28993
- const projectRoot = getProjectRoot16();
28997
+ const projectRoot = getProjectRoot17();
28994
28998
  return wrapCoreResult(
28995
28999
  await taskDepsValidate(projectRoot, params.epicId, params.scope),
28996
29000
  "deps.validate"
28997
29001
  );
28998
29002
  },
28999
29003
  "deps.tree": async (params) => {
29000
- const projectRoot = getProjectRoot16();
29004
+ const projectRoot = getProjectRoot17();
29001
29005
  if (!params.epicId) {
29002
29006
  return lafsError("E_INVALID_INPUT", "epicId is required for deps.tree", "deps.tree");
29003
29007
  }
@@ -29007,29 +29011,29 @@ var init_tasks3 = __esm({
29007
29011
  );
29008
29012
  },
29009
29013
  analyze: async (params) => {
29010
- const projectRoot = getProjectRoot16();
29014
+ const projectRoot = getProjectRoot17();
29011
29015
  return wrapCoreResult(
29012
29016
  await taskAnalyze(projectRoot, params.taskId, { tierLimit: params.tierLimit }),
29013
29017
  "analyze"
29014
29018
  );
29015
29019
  },
29016
29020
  impact: async (params) => {
29017
- const projectRoot = getProjectRoot16();
29021
+ const projectRoot = getProjectRoot17();
29018
29022
  return wrapCoreResult(
29019
29023
  await taskImpact(projectRoot, params.change, params.matchLimit),
29020
29024
  "impact"
29021
29025
  );
29022
29026
  },
29023
29027
  next: async (params) => {
29024
- const projectRoot = getProjectRoot16();
29028
+ const projectRoot = getProjectRoot17();
29025
29029
  return wrapCoreResult(await taskNext(projectRoot, params), "next");
29026
29030
  },
29027
29031
  plan: async (_params) => {
29028
- const projectRoot = getProjectRoot16();
29032
+ const projectRoot = getProjectRoot17();
29029
29033
  return wrapCoreResult(await taskPlan(projectRoot), "plan");
29030
29034
  },
29031
29035
  relates: async (params) => {
29032
- const projectRoot = getProjectRoot16();
29036
+ const projectRoot = getProjectRoot17();
29033
29037
  if (params.mode) {
29034
29038
  return wrapCoreResult(
29035
29039
  await taskRelatesFind(projectRoot, params.taskId, {
@@ -29042,36 +29046,36 @@ var init_tasks3 = __esm({
29042
29046
  return wrapCoreResult(await taskRelates(projectRoot, params.taskId), "relates");
29043
29047
  },
29044
29048
  "complexity.estimate": async (params) => {
29045
- const projectRoot = getProjectRoot16();
29049
+ const projectRoot = getProjectRoot17();
29046
29050
  return wrapCoreResult(
29047
29051
  await taskComplexityEstimate(projectRoot, { taskId: params.taskId }),
29048
29052
  "complexity.estimate"
29049
29053
  );
29050
29054
  },
29051
29055
  history: async (params) => {
29052
- const projectRoot = getProjectRoot16();
29056
+ const projectRoot = getProjectRoot17();
29053
29057
  if (params.taskId) {
29054
29058
  return wrapCoreResult(await taskHistory(projectRoot, params.taskId, params.limit), "history");
29055
29059
  }
29056
29060
  return wrapCoreResult(await taskWorkHistory(projectRoot), "history");
29057
29061
  },
29058
29062
  current: async (_params) => {
29059
- const projectRoot = getProjectRoot16();
29063
+ const projectRoot = getProjectRoot17();
29060
29064
  return wrapCoreResult(await taskCurrentGet(projectRoot), "current");
29061
29065
  },
29062
29066
  "label.list": async (_params) => {
29063
- const projectRoot = getProjectRoot16();
29067
+ const projectRoot = getProjectRoot17();
29064
29068
  return wrapCoreResult(await taskLabelList(projectRoot), "label.list");
29065
29069
  },
29066
29070
  "sync.links": async (params) => {
29067
- const projectRoot = getProjectRoot16();
29071
+ const projectRoot = getProjectRoot17();
29068
29072
  return wrapCoreResult(await taskSyncLinks(projectRoot, params), "sync.links");
29069
29073
  },
29070
29074
  // -------------------------------------------------------------------------
29071
29075
  // Mutate ops
29072
29076
  // -------------------------------------------------------------------------
29073
29077
  add: async (params) => {
29074
- const projectRoot = getProjectRoot16();
29078
+ const projectRoot = getProjectRoot17();
29075
29079
  return wrapCoreResult(
29076
29080
  await addTaskWithSessionScope(projectRoot, {
29077
29081
  title: params.title,
@@ -29099,7 +29103,7 @@ var init_tasks3 = __esm({
29099
29103
  );
29100
29104
  },
29101
29105
  update: async (params) => {
29102
- const projectRoot = getProjectRoot16();
29106
+ const projectRoot = getProjectRoot17();
29103
29107
  return wrapCoreResult(
29104
29108
  await taskUpdate(projectRoot, params.taskId, {
29105
29109
  title: params.title,
@@ -29142,7 +29146,7 @@ var init_tasks3 = __esm({
29142
29146
  );
29143
29147
  },
29144
29148
  complete: async (params) => {
29145
- const projectRoot = getProjectRoot16();
29149
+ const projectRoot = getProjectRoot17();
29146
29150
  if (params.force !== void 0) {
29147
29151
  return lafsError(
29148
29152
  "E_FLAG_REMOVED",
@@ -29165,15 +29169,15 @@ var init_tasks3 = __esm({
29165
29169
  return wrapCoreResult(result, "complete");
29166
29170
  },
29167
29171
  cancel: async (params) => {
29168
- const projectRoot = getProjectRoot16();
29172
+ const projectRoot = getProjectRoot17();
29169
29173
  return wrapCoreResult(await taskCancel(projectRoot, params.taskId, params.reason), "cancel");
29170
29174
  },
29171
29175
  delete: async (params) => {
29172
- const projectRoot = getProjectRoot16();
29176
+ const projectRoot = getProjectRoot17();
29173
29177
  return wrapCoreResult(await taskDelete(projectRoot, params.taskId, params.force), "delete");
29174
29178
  },
29175
29179
  archive: async (params) => {
29176
- const projectRoot = getProjectRoot16();
29180
+ const projectRoot = getProjectRoot17();
29177
29181
  return wrapCoreResult(
29178
29182
  await taskArchive(projectRoot, params.taskId, params.before, {
29179
29183
  taskIds: params.taskIds,
@@ -29184,7 +29188,7 @@ var init_tasks3 = __esm({
29184
29188
  );
29185
29189
  },
29186
29190
  restore: async (params) => {
29187
- const projectRoot = getProjectRoot16();
29191
+ const projectRoot = getProjectRoot17();
29188
29192
  if (params.from === "done") {
29189
29193
  return wrapCoreResult(
29190
29194
  await taskReopen(projectRoot, params.taskId, {
@@ -29212,21 +29216,21 @@ var init_tasks3 = __esm({
29212
29216
  );
29213
29217
  },
29214
29218
  reparent: async (params) => {
29215
- const projectRoot = getProjectRoot16();
29219
+ const projectRoot = getProjectRoot17();
29216
29220
  return wrapCoreResult(
29217
29221
  await taskReparent(projectRoot, params.taskId, params.newParentId ?? null),
29218
29222
  "reparent"
29219
29223
  );
29220
29224
  },
29221
29225
  reorder: async (params) => {
29222
- const projectRoot = getProjectRoot16();
29226
+ const projectRoot = getProjectRoot17();
29223
29227
  return wrapCoreResult(
29224
29228
  await taskReorder(projectRoot, params.taskId, params.position),
29225
29229
  "reorder"
29226
29230
  );
29227
29231
  },
29228
29232
  "relates.add": async (params) => {
29229
- const projectRoot = getProjectRoot16();
29233
+ const projectRoot = getProjectRoot17();
29230
29234
  const relatedId = params.relatedId ?? params.targetId;
29231
29235
  if (!relatedId) {
29232
29236
  return lafsError("E_INVALID_INPUT", "relatedId (or targetId) is required", "relates.add");
@@ -29237,7 +29241,7 @@ var init_tasks3 = __esm({
29237
29241
  );
29238
29242
  },
29239
29243
  "relates.remove": async (params) => {
29240
- const projectRoot = getProjectRoot16();
29244
+ const projectRoot = getProjectRoot17();
29241
29245
  if (!params.relatedId) {
29242
29246
  return lafsError("E_INVALID_INPUT", "relatedId is required", "relates.remove");
29243
29247
  }
@@ -29247,15 +29251,15 @@ var init_tasks3 = __esm({
29247
29251
  );
29248
29252
  },
29249
29253
  start: async (params) => {
29250
- const projectRoot = getProjectRoot16();
29254
+ const projectRoot = getProjectRoot17();
29251
29255
  return wrapCoreResult(await taskStart(projectRoot, params.taskId), "start");
29252
29256
  },
29253
29257
  stop: async (_params) => {
29254
- const projectRoot = getProjectRoot16();
29258
+ const projectRoot = getProjectRoot17();
29255
29259
  return wrapCoreResult(await taskStop(projectRoot), "stop");
29256
29260
  },
29257
29261
  "sync.reconcile": async (params) => {
29258
- const projectRoot = getProjectRoot16();
29262
+ const projectRoot = getProjectRoot17();
29259
29263
  return wrapCoreResult(
29260
29264
  await taskSyncReconcile(projectRoot, {
29261
29265
  providerId: params.providerId,
@@ -29269,18 +29273,18 @@ var init_tasks3 = __esm({
29269
29273
  );
29270
29274
  },
29271
29275
  "sync.links.remove": async (params) => {
29272
- const projectRoot = getProjectRoot16();
29276
+ const projectRoot = getProjectRoot17();
29273
29277
  return wrapCoreResult(
29274
29278
  await taskSyncLinksRemove(projectRoot, params.providerId),
29275
29279
  "sync.links.remove"
29276
29280
  );
29277
29281
  },
29278
29282
  claim: async (params) => {
29279
- const projectRoot = getProjectRoot16();
29283
+ const projectRoot = getProjectRoot17();
29280
29284
  return wrapCoreResult(await taskClaim(projectRoot, params.taskId, params.agentId), "claim");
29281
29285
  },
29282
29286
  unclaim: async (params) => {
29283
- const projectRoot = getProjectRoot16();
29287
+ const projectRoot = getProjectRoot17();
29284
29288
  return wrapCoreResult(await taskUnclaim(projectRoot, params.taskId), "unclaim");
29285
29289
  }
29286
29290
  });
@@ -29506,7 +29510,7 @@ var init_tasks3 = __esm({
29506
29510
  });
29507
29511
 
29508
29512
  // packages/cleo/src/dispatch/domains/tools.ts
29509
- import { getLogger as getLogger16, getProjectRoot as getProjectRoot17 } from "@cleocode/core";
29513
+ import { getLogger as getLogger16, getProjectRoot as getProjectRoot18 } from "@cleocode/core";
29510
29514
  import {
29511
29515
  codeOutline,
29512
29516
  codeParse,
@@ -29551,7 +29555,7 @@ var init_tools = __esm({
29551
29555
  init_routing();
29552
29556
  ToolsHandler = class {
29553
29557
  get projectRoot() {
29554
- return getProjectRoot17();
29558
+ return getProjectRoot18();
29555
29559
  }
29556
29560
  // -----------------------------------------------------------------------
29557
29561
  // DomainHandler interface
@@ -30074,7 +30078,7 @@ var init_tools = __esm({
30074
30078
  // packages/cleo/src/dispatch/domains/upgrade.ts
30075
30079
  import { dirname as dirname3, resolve as resolve3 } from "node:path";
30076
30080
  import { fileURLToPath as fileURLToPath2 } from "node:url";
30077
- import { getLogger as getLogger17, getProjectRoot as getProjectRoot18 } from "@cleocode/core";
30081
+ import { getLogger as getLogger17, getProjectRoot as getProjectRoot19 } from "@cleocode/core";
30078
30082
  import { upgradeWorkflows } from "@cleocode/core/internal";
30079
30083
  function resolveTemplatesDir() {
30080
30084
  const here = dirname3(fileURLToPath2(import.meta.url));
@@ -30114,7 +30118,7 @@ var init_upgrade = __esm({
30114
30118
  case "workflows": {
30115
30119
  const includeRendered = params?.["includeRendered"] === true;
30116
30120
  const result = await upgradeWorkflows({
30117
- projectRoot: getProjectRoot18(),
30121
+ projectRoot: getProjectRoot19(),
30118
30122
  templatesDir: resolveTemplatesDir(),
30119
30123
  dryRun: true
30120
30124
  });
@@ -30157,7 +30161,7 @@ var init_upgrade = __esm({
30157
30161
  const dryRun = params?.["dryRun"] === true;
30158
30162
  const includeRendered = params?.["includeRendered"] === true;
30159
30163
  const result = await upgradeWorkflows({
30160
- projectRoot: getProjectRoot18(),
30164
+ projectRoot: getProjectRoot19(),
30161
30165
  templatesDir: resolveTemplatesDir(),
30162
30166
  force,
30163
30167
  dryRun
@@ -30198,7 +30202,7 @@ var init_upgrade = __esm({
30198
30202
  import {
30199
30203
  forceUnlockWorktree,
30200
30204
  getLogger as getLogger18,
30201
- getProjectRoot as getProjectRoot19,
30205
+ getProjectRoot as getProjectRoot20,
30202
30206
  listWorktrees,
30203
30207
  pruneOrphanedWorktreesByStatus
30204
30208
  } from "@cleocode/core/internal";
@@ -30249,7 +30253,7 @@ var init_worktree2 = __esm({
30249
30253
  switch (operation) {
30250
30254
  case "list": {
30251
30255
  const opts = {
30252
- projectRoot: getProjectRoot19(),
30256
+ projectRoot: getProjectRoot20(),
30253
30257
  statusFilter: coerceStatusFilter(params?.["statusFilter"]),
30254
30258
  staleDays: typeof params?.["staleDays"] === "number" ? params["staleDays"] : void 0
30255
30259
  };
@@ -30288,7 +30292,7 @@ var init_worktree2 = __esm({
30288
30292
  switch (operation) {
30289
30293
  case "prune": {
30290
30294
  const opts = {
30291
- projectRoot: getProjectRoot19(),
30295
+ projectRoot: getProjectRoot20(),
30292
30296
  dryRun: params?.["dryRun"] === true,
30293
30297
  ...typeof params?.["staleDays"] === "number" ? { staleDays: params["staleDays"] } : {},
30294
30298
  ...coerceStringList(params?.["paths"]) !== void 0 ? { paths: coerceStringList(params?.["paths"]) } : {},
@@ -30316,7 +30320,7 @@ var init_worktree2 = __esm({
30316
30320
  );
30317
30321
  }
30318
30322
  const opts = {
30319
- projectRoot: getProjectRoot19(),
30323
+ projectRoot: getProjectRoot20(),
30320
30324
  taskId,
30321
30325
  ...typeof params?.["actor"] === "string" && params["actor"].length > 0 ? { actor: params["actor"] } : {}
30322
30326
  };
@@ -30839,11 +30843,11 @@ var init_security = __esm({
30839
30843
  });
30840
30844
 
30841
30845
  // packages/cleo/src/dispatch/middleware/sanitizer.ts
30842
- function createSanitizer(getProjectRoot38) {
30846
+ function createSanitizer(getProjectRoot41) {
30843
30847
  return async (req, next) => {
30844
30848
  if (req.params) {
30845
30849
  try {
30846
- const root = getProjectRoot38 ? getProjectRoot38() : void 0;
30850
+ const root = getProjectRoot41 ? getProjectRoot41() : void 0;
30847
30851
  req.params = sanitizeParams(req.params, root, {
30848
30852
  domain: req.domain,
30849
30853
  operation: req.operation
@@ -30968,7 +30972,7 @@ import { createRequire } from "node:module";
30968
30972
  import { dirname as dirname4, join as join6 } from "node:path";
30969
30973
  import { fileURLToPath as fileURLToPath3 } from "node:url";
30970
30974
  import { catalog, registerSkillLibraryFromPath } from "@cleocode/caamp";
30971
- import { autoRecordDispatchTokenUsage, getProjectRoot as getProjectRoot20, hooks } from "@cleocode/core/internal";
30975
+ import { autoRecordDispatchTokenUsage, getProjectRoot as getProjectRoot21, hooks } from "@cleocode/core/internal";
30972
30976
  function ensureCaampLibrary() {
30973
30977
  if (catalog.isCatalogAvailable()) return;
30974
30978
  try {
@@ -31019,7 +31023,7 @@ function createCliDispatcher() {
31019
31023
  middlewares: [
31020
31024
  createSessionResolver(lookupCliSession),
31021
31025
  // T4959: session identity first
31022
- createSanitizer(() => getProjectRoot20()),
31026
+ createSanitizer(() => getProjectRoot21()),
31023
31027
  createFieldFilter(),
31024
31028
  createAudit(),
31025
31029
  // T4959: CLI now gets audit trail
@@ -31033,7 +31037,7 @@ function resetCliDispatcher() {
31033
31037
  }
31034
31038
  async function dispatchFromCli(gateway, domain, operation, params, outputOpts) {
31035
31039
  const dispatcher = getCliDispatcher();
31036
- const projectRoot = getProjectRoot20();
31040
+ const projectRoot = getProjectRoot21();
31037
31041
  const dispatchStart = Date.now();
31038
31042
  hooks.dispatch("PromptSubmit", projectRoot, {
31039
31043
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
@@ -31078,7 +31082,7 @@ async function dispatchFromCli(gateway, domain, operation, params, outputOpts) {
31078
31082
  operation,
31079
31083
  sessionId: response.meta.sessionId,
31080
31084
  requestId: response.meta.requestId,
31081
- cwd: getProjectRoot20()
31085
+ cwd: getProjectRoot21()
31082
31086
  });
31083
31087
  const opts = {
31084
31088
  command: outputOpts?.command ?? operation,
@@ -31140,7 +31144,7 @@ function handleRawError(response, _opts) {
31140
31144
  }
31141
31145
  async function dispatchRaw(gateway, domain, operation, params) {
31142
31146
  const dispatcher = getCliDispatcher();
31143
- const projectRoot = getProjectRoot20();
31147
+ const projectRoot = getProjectRoot21();
31144
31148
  const dispatchStart = Date.now();
31145
31149
  hooks.dispatch("PromptSubmit", projectRoot, {
31146
31150
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
@@ -31535,7 +31539,7 @@ __export(add_exports, {
31535
31539
  });
31536
31540
  import {
31537
31541
  appendSignedSeverityAttestation,
31538
- getProjectRoot as getProjectRoot21,
31542
+ getProjectRoot as getProjectRoot22,
31539
31543
  inferTaskAddParams
31540
31544
  } from "@cleocode/core";
31541
31545
  var addCommand;
@@ -31763,7 +31767,7 @@ var init_add = __esm({
31763
31767
  return;
31764
31768
  }
31765
31769
  if (args["depends-waiver"] !== void 0) params["dependsWaiver"] = args["depends-waiver"];
31766
- const inferred = await inferTaskAddParams(getProjectRoot21(), {
31770
+ const inferred = await inferTaskAddParams(getProjectRoot22(), {
31767
31771
  title: args.title,
31768
31772
  description: args.description ?? args.desc,
31769
31773
  filesInfer: args["files-infer"],
@@ -32387,6 +32391,7 @@ var agent_exports = {};
32387
32391
  __export(agent_exports, {
32388
32392
  agentCommand: () => agentCommand
32389
32393
  });
32394
+ import { getProjectRoot as getProjectRoot23 } from "@cleocode/core";
32390
32395
  import {
32391
32396
  checkAgentHealth,
32392
32397
  detectCrashedAgents,
@@ -32779,7 +32784,7 @@ var init_agent = __esm({
32779
32784
  const { AgentRegistryAccessor } = await import("@cleocode/core/agents");
32780
32785
  const { getDb: getDb3 } = await import("@cleocode/core/internal");
32781
32786
  await getDb3();
32782
- const registry = new AgentRegistryAccessor(process.cwd());
32787
+ const registry = new AgentRegistryAccessor(getProjectRoot23());
32783
32788
  const agentId = args.id;
32784
32789
  const displayName = args.name;
32785
32790
  const classification = args.classification;
@@ -32897,7 +32902,7 @@ agent ${agentId}:
32897
32902
  const { AgentRegistryAccessor } = await import("@cleocode/core/agents");
32898
32903
  const { getDb: getDb3 } = await import("@cleocode/core/internal");
32899
32904
  await getDb3();
32900
- const registry = new AgentRegistryAccessor(process.cwd());
32905
+ const registry = new AgentRegistryAccessor(getProjectRoot23());
32901
32906
  const credential = await registry.get(args.agentId);
32902
32907
  if (!credential) {
32903
32908
  cliOutput(
@@ -32985,7 +32990,7 @@ agent ${agentId}:
32985
32990
  const { existsSync: existsSync17, readFileSync: readFileSync18 } = await import("node:fs");
32986
32991
  const { join: join29 } = await import("node:path");
32987
32992
  await getDb3();
32988
- const registry = new AgentRegistryAccessor(process.cwd());
32993
+ const registry = new AgentRegistryAccessor(getProjectRoot23());
32989
32994
  const credential = await registry.get(args.agentId);
32990
32995
  if (!credential) {
32991
32996
  cliOutput(
@@ -33104,7 +33109,7 @@ agent ${agentId}:
33104
33109
  const { AgentRegistryAccessor } = await import("@cleocode/core/agents");
33105
33110
  const { getDb: getDb3 } = await import("@cleocode/core/internal");
33106
33111
  await getDb3();
33107
- const registry = new AgentRegistryAccessor(process.cwd());
33112
+ const registry = new AgentRegistryAccessor(getProjectRoot23());
33108
33113
  const credential = await registry.get(args.agentId);
33109
33114
  if (!credential) {
33110
33115
  cliOutput(
@@ -33161,7 +33166,7 @@ agent ${agentId}:
33161
33166
  const { AgentRegistryAccessor } = await import("@cleocode/core/agents");
33162
33167
  const { getDb: getDb3 } = await import("@cleocode/core/internal");
33163
33168
  await getDb3();
33164
- const registry = new AgentRegistryAccessor(process.cwd());
33169
+ const registry = new AgentRegistryAccessor(getProjectRoot23());
33165
33170
  if (args.agentId) {
33166
33171
  const credential = await registry.get(args.agentId);
33167
33172
  if (!credential) {
@@ -33237,7 +33242,7 @@ agent ${agentId}:
33237
33242
  const { AgentRegistryAccessor, createConduit } = await import("@cleocode/core/agents");
33238
33243
  const { getDb: getDb3 } = await import("@cleocode/core/internal");
33239
33244
  await getDb3();
33240
- const registry = new AgentRegistryAccessor(process.cwd());
33245
+ const registry = new AgentRegistryAccessor(getProjectRoot23());
33241
33246
  const active = await registry.getActive();
33242
33247
  if (!active) {
33243
33248
  cliOutput(
@@ -33294,7 +33299,7 @@ Assigned task ${args.taskId}. Run: cleo show ${args.taskId} && cleo start ${args
33294
33299
  const { AgentRegistryAccessor, createConduit } = await import("@cleocode/core/agents");
33295
33300
  const { getDb: getDb3 } = await import("@cleocode/core/internal");
33296
33301
  await getDb3();
33297
- const registry = new AgentRegistryAccessor(process.cwd());
33302
+ const registry = new AgentRegistryAccessor(getProjectRoot23());
33298
33303
  const active = await registry.getActive();
33299
33304
  if (!active) {
33300
33305
  cliOutput(
@@ -33360,7 +33365,7 @@ You are idle. Check your queue: cleo current || cleo next. Report status immedia
33360
33365
  const { AgentRegistryAccessor } = await import("@cleocode/core/agents");
33361
33366
  const { getDb: getDb3 } = await import("@cleocode/core/internal");
33362
33367
  await getDb3();
33363
- const registry = new AgentRegistryAccessor(process.cwd());
33368
+ const registry = new AgentRegistryAccessor(getProjectRoot23());
33364
33369
  const role = args.role;
33365
33370
  const taskId = args.task;
33366
33371
  const model = args.model ?? "sonnet";
@@ -33425,7 +33430,7 @@ You are idle. Check your queue: cleo current || cleo next. Report status immedia
33425
33430
  const { AgentRegistryAccessor, createConduit } = await import("@cleocode/core/agents");
33426
33431
  const { getDb: getDb3 } = await import("@cleocode/core/internal");
33427
33432
  await getDb3();
33428
- const registry = new AgentRegistryAccessor(process.cwd());
33433
+ const registry = new AgentRegistryAccessor(getProjectRoot23());
33429
33434
  const active = await registry.getActive();
33430
33435
  if (!active) {
33431
33436
  cliOutput(
@@ -33469,7 +33474,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
33469
33474
  const { AgentRegistryAccessor } = await import("@cleocode/core/agents");
33470
33475
  const { getDb: getDb3 } = await import("@cleocode/core/internal");
33471
33476
  await getDb3();
33472
- const registry = new AgentRegistryAccessor(process.cwd());
33477
+ const registry = new AgentRegistryAccessor(getProjectRoot23());
33473
33478
  const agents = await registry.list({ active: true });
33474
33479
  let stopped = 0;
33475
33480
  for (const a of agents) {
@@ -33542,7 +33547,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
33542
33547
  const { promisify: promisify2 } = await import("node:util");
33543
33548
  const execFileAsync = promisify2(execFile2);
33544
33549
  await getDb3();
33545
- const registry = new AgentRegistryAccessor(process.cwd());
33550
+ const registry = new AgentRegistryAccessor(getProjectRoot23());
33546
33551
  const credential = await registry.get(args.agentId);
33547
33552
  if (!credential) {
33548
33553
  cliOutput(
@@ -33699,7 +33704,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
33699
33704
  await getDb3();
33700
33705
  const includeGlobal = args.global === true;
33701
33706
  const includeDisabled = args["include-disabled"] === true;
33702
- const agents = listAgentsForProject(process.cwd(), {
33707
+ const agents = listAgentsForProject(getProjectRoot23(), {
33703
33708
  includeGlobal,
33704
33709
  includeDisabled
33705
33710
  });
@@ -33750,7 +33755,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
33750
33755
  const { getDb: getDb3 } = await import("@cleocode/core/internal");
33751
33756
  await getDb3();
33752
33757
  const includeGlobal = args.global === true;
33753
- const agent = lookupAgent(process.cwd(), args.agentId, { includeGlobal });
33758
+ const agent = lookupAgent(getProjectRoot23(), args.agentId, { includeGlobal });
33754
33759
  if (!agent) {
33755
33760
  cliOutput(
33756
33761
  {
@@ -33816,7 +33821,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
33816
33821
  const { AgentRegistryAccessor, attachAgentToProject, lookupAgent } = await import("@cleocode/core/agents");
33817
33822
  const { getDb: getDb3 } = await import("@cleocode/core/internal");
33818
33823
  await getDb3();
33819
- const projectRoot = process.cwd();
33824
+ const projectRoot = getProjectRoot23();
33820
33825
  const _registry = new AgentRegistryAccessor(projectRoot);
33821
33826
  void _registry;
33822
33827
  const globalAgent = lookupAgent(projectRoot, args.agentId, { includeGlobal: true });
@@ -33872,7 +33877,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
33872
33877
  const { AgentRegistryAccessor, detachAgentFromProject, getProjectAgentRef } = await import("@cleocode/core/agents");
33873
33878
  const { getDb: getDb3 } = await import("@cleocode/core/internal");
33874
33879
  await getDb3();
33875
- const projectRoot = process.cwd();
33880
+ const projectRoot = getProjectRoot23();
33876
33881
  const _registry = new AgentRegistryAccessor(projectRoot);
33877
33882
  void _registry;
33878
33883
  const ref = getProjectAgentRef(projectRoot, args.agentId);
@@ -33929,7 +33934,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
33929
33934
  const { AgentRegistryAccessor, detachAgentFromProject, getProjectAgentRef } = await import("@cleocode/core/agents");
33930
33935
  const { getDb: getDb3 } = await import("@cleocode/core/internal");
33931
33936
  await getDb3();
33932
- const projectRoot = process.cwd();
33937
+ const projectRoot = getProjectRoot23();
33933
33938
  if (!args.global) {
33934
33939
  const _registry = new AgentRegistryAccessor(projectRoot);
33935
33940
  void _registry;
@@ -34011,7 +34016,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
34011
34016
  const { AgentRegistryAccessor } = await import("@cleocode/core/agents");
34012
34017
  const { getDb: getDb3 } = await import("@cleocode/core/internal");
34013
34018
  await getDb3();
34014
- const registry = new AgentRegistryAccessor(process.cwd());
34019
+ const registry = new AgentRegistryAccessor(getProjectRoot23());
34015
34020
  const result = await registry.rotateKey(args.agentId);
34016
34021
  cliOutput(
34017
34022
  {
@@ -34050,7 +34055,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
34050
34055
  const { AgentRegistryAccessor } = await import("@cleocode/core/agents");
34051
34056
  const { getDb: getDb3 } = await import("@cleocode/core/internal");
34052
34057
  await getDb3();
34053
- const registry = new AgentRegistryAccessor(process.cwd());
34058
+ const registry = new AgentRegistryAccessor(getProjectRoot23());
34054
34059
  const credential = await registry.get(args.agentId);
34055
34060
  if (!credential) {
34056
34061
  cliOutput(
@@ -34125,7 +34130,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
34125
34130
  const { getDb: getDb3 } = await import("@cleocode/core/internal");
34126
34131
  const { createRuntime } = await import("@cleocode/runtime");
34127
34132
  await getDb3();
34128
- const registry = new AgentRegistryAccessor(process.cwd());
34133
+ const registry = new AgentRegistryAccessor(getProjectRoot23());
34129
34134
  const groupIds = args.group ? args.group.split(",").map((s) => s.trim()) : void 0;
34130
34135
  const handle = await createRuntime(registry, {
34131
34136
  agentId: args.agent,
@@ -34208,7 +34213,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
34208
34213
  const { AgentRegistryAccessor, createConduit } = await import("@cleocode/core/agents");
34209
34214
  const { getDb: getDb3 } = await import("@cleocode/core/internal");
34210
34215
  await getDb3();
34211
- const registry = new AgentRegistryAccessor(process.cwd());
34216
+ const registry = new AgentRegistryAccessor(getProjectRoot23());
34212
34217
  const agentId = args.agent;
34213
34218
  const conduit = await createConduit(registry, agentId);
34214
34219
  const limit = Number(args.limit) || 20;
@@ -34260,7 +34265,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
34260
34265
  const { AgentRegistryAccessor, createConduit } = await import("@cleocode/core/agents");
34261
34266
  const { getDb: getDb3 } = await import("@cleocode/core/internal");
34262
34267
  await getDb3();
34263
- const registry = new AgentRegistryAccessor(process.cwd());
34268
+ const registry = new AgentRegistryAccessor(getProjectRoot23());
34264
34269
  const agentId = args.agent;
34265
34270
  const to = args.to;
34266
34271
  const conv = args.conv;
@@ -34538,7 +34543,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
34538
34543
  const db = _sdDb;
34539
34544
  const isGlobal = args.global === true;
34540
34545
  const targetTier = isGlobal ? "global" : "project";
34541
- const projectRoot = process.cwd();
34546
+ const projectRoot = getProjectRoot23();
34542
34547
  try {
34543
34548
  if (args.resync) {
34544
34549
  const parsedName = basename(cantPath, ".cant");
@@ -34773,7 +34778,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
34773
34778
  try {
34774
34779
  const { existsSync: existsSync17, mkdirSync: mkdirSync7, writeFileSync: writeFileSync7 } = await import("node:fs");
34775
34780
  const { join: join29 } = await import("node:path");
34776
- const { homedir: homedir10 } = await import("node:os");
34781
+ const { homedir: homedir8 } = await import("node:os");
34777
34782
  const name = args.name;
34778
34783
  const role = args.role;
34779
34784
  const tier = args.tier ?? inferTierFromRole(role);
@@ -34831,11 +34836,11 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
34831
34836
  }
34832
34837
  let targetRoot;
34833
34838
  if (isGlobal) {
34834
- const home = homedir10();
34839
+ const home = homedir8();
34835
34840
  const xdgData = process.env["XDG_DATA_HOME"] ?? join29(home, ".local", "share");
34836
34841
  targetRoot = join29(xdgData, "cleo", "cant", "agents");
34837
34842
  } else {
34838
- targetRoot = join29(process.cwd(), CLEO_DIR_NAME, CANT_AGENTS_SUBDIR);
34843
+ targetRoot = join29(getProjectRoot23(), CLEO_DIR_NAME, CANT_AGENTS_SUBDIR);
34839
34844
  }
34840
34845
  const agentDir = join29(targetRoot, name);
34841
34846
  if (existsSync17(agentDir)) {
@@ -34908,7 +34913,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
34908
34913
  const { AgentRegistryAccessor } = await import("@cleocode/core/agents");
34909
34914
  const { getDb: getDb3 } = await import("@cleocode/core/internal");
34910
34915
  await getDb3();
34911
- const registry = new AgentRegistryAccessor(process.cwd());
34916
+ const registry = new AgentRegistryAccessor(getProjectRoot23());
34912
34917
  const existing = await registry.get(name);
34913
34918
  if (!existing) {
34914
34919
  const descMatch = personaContent.match(/description:\s*"([^"]+)"/);
@@ -34992,7 +34997,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
34992
34997
  return;
34993
34998
  }
34994
34999
  const specContent = readFileSync18(specPath, "utf-8");
34995
- const projectRoot = process.cwd();
35000
+ const projectRoot = getProjectRoot23();
34996
35001
  const outputDir = args["output-dir"] ? resolve8(args["output-dir"]) : join29(projectRoot, ".cleo", "cant", "agents");
34997
35002
  mkdirSync7(outputDir, { recursive: true });
34998
35003
  if (args["dry-run"]) {
@@ -35123,7 +35128,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
35123
35128
  const { db: _sdDb3 } = await openCleoDb2("signaldock");
35124
35129
  const db = _sdDb3;
35125
35130
  try {
35126
- const report = await buildDoctorReport(db, { projectRoot: process.cwd() });
35131
+ const report = await buildDoctorReport(db, { projectRoot: getProjectRoot23() });
35127
35132
  const repairFlag = args.repair === true;
35128
35133
  let reconciled;
35129
35134
  if (repairFlag) {
@@ -35391,7 +35396,7 @@ var audit_exports = {};
35391
35396
  __export(audit_exports, {
35392
35397
  auditCommand: () => auditCommand
35393
35398
  });
35394
- import { getProjectRoot as getProjectRoot22, reconstructLineage } from "@cleocode/core/internal";
35399
+ import { getProjectRoot as getProjectRoot24, reconstructLineage } from "@cleocode/core/internal";
35395
35400
  var reconstructCommand, auditCommand;
35396
35401
  var init_audit2 = __esm({
35397
35402
  "packages/cleo/src/cli/commands/audit.ts"() {
@@ -35435,7 +35440,7 @@ var init_audit2 = __esm({
35435
35440
  repoRoot = args["repo-root"];
35436
35441
  } else {
35437
35442
  try {
35438
- repoRoot = getProjectRoot22(process.cwd()) ?? process.cwd();
35443
+ repoRoot = getProjectRoot24(process.cwd()) ?? process.cwd();
35439
35444
  } catch {
35440
35445
  repoRoot = process.cwd();
35441
35446
  }
@@ -36059,7 +36064,7 @@ var backfill_exports = {};
36059
36064
  __export(backfill_exports, {
36060
36065
  backfillCommand: () => backfillCommand
36061
36066
  });
36062
- import { backfillTasks, getProjectRoot as getProjectRoot23, populateEmbeddings } from "@cleocode/core/internal";
36067
+ import { backfillTasks, getProjectRoot as getProjectRoot25, populateEmbeddings } from "@cleocode/core/internal";
36063
36068
  var backfillCommand;
36064
36069
  var init_backfill = __esm({
36065
36070
  "packages/cleo/src/cli/commands/backfill.ts"() {
@@ -36093,7 +36098,7 @@ var init_backfill = __esm({
36093
36098
  }
36094
36099
  },
36095
36100
  async run({ args }) {
36096
- const root = getProjectRoot23();
36101
+ const root = getProjectRoot25();
36097
36102
  if (args.embeddings) {
36098
36103
  try {
36099
36104
  let lastLine = "";
@@ -36611,9 +36616,9 @@ var init_backup = __esm({
36611
36616
  async run({ args }) {
36612
36617
  const scope = args.scope;
36613
36618
  const { packBundle } = await import("@cleocode/core/store/backup-pack.js");
36614
- const { getProjectRoot: getProjectRoot38 } = await import("@cleocode/core");
36619
+ const { getProjectRoot: getProjectRoot41 } = await import("@cleocode/core");
36615
36620
  const includesProject = scope === "project" || scope === "all";
36616
- const projectRoot = includesProject ? getProjectRoot38() : void 0;
36621
+ const projectRoot = includesProject ? getProjectRoot41() : void 0;
36617
36622
  let passphrase;
36618
36623
  if (args.encrypt === true) {
36619
36624
  passphrase = process.env["CLEO_BACKUP_PASSPHRASE"];
@@ -36689,12 +36694,12 @@ var init_backup = __esm({
36689
36694
  },
36690
36695
  async run({ args }) {
36691
36696
  const bundlePath = args.bundle;
36692
- const { getProjectRoot: getProjectRoot38, getCleoHome: getCleoHome3, getCleoVersion } = await import("@cleocode/core");
36697
+ const { getProjectRoot: getProjectRoot41, getCleoHome: getCleoHome3, getCleoVersion } = await import("@cleocode/core");
36693
36698
  const { BundleError, cleanupStaging, unpackBundle } = await import("@cleocode/core/store/backup-unpack.js");
36694
36699
  const { regenerateConfigJson, regenerateProjectContextJson, regenerateProjectInfoJson } = await import("@cleocode/core/store/regenerators.js");
36695
36700
  const { regenerateAndCompare } = await import("@cleocode/core/store/restore-json-merge.js");
36696
36701
  const { buildConflictReport, writeConflictReport } = await import("@cleocode/core/store/restore-conflict-report.js");
36697
- const projectRoot = getProjectRoot38();
36702
+ const projectRoot = getProjectRoot41();
36698
36703
  if (args.force !== true) {
36699
36704
  const existing = checkForExistingData(projectRoot, getCleoHome3());
36700
36705
  if (existing.length > 0) {
@@ -36912,7 +36917,7 @@ var brain_exports = {};
36912
36917
  __export(brain_exports, {
36913
36918
  brainCommand: () => brainCommand
36914
36919
  });
36915
- import { getProjectRoot as getProjectRoot24 } from "@cleocode/core";
36920
+ import { getProjectRoot as getProjectRoot26 } from "@cleocode/core";
36916
36921
  import {
36917
36922
  backfillBrainGraph,
36918
36923
  exportBrainAsGexf,
@@ -36957,7 +36962,7 @@ var init_brain2 = __esm({
36957
36962
  json: { type: "boolean", description: "Output results as JSON" }
36958
36963
  },
36959
36964
  async run({ args }) {
36960
- const root = getProjectRoot24();
36965
+ const root = getProjectRoot26();
36961
36966
  try {
36962
36967
  const result = await runBrainMaintenance(root, {
36963
36968
  skipDecay: !!args["skip-decay"],
@@ -37028,7 +37033,7 @@ var init_brain2 = __esm({
37028
37033
  json: { type: "boolean", description: "Output results as JSON" }
37029
37034
  },
37030
37035
  async run({ args: _args }) {
37031
- const root = getProjectRoot24();
37036
+ const root = getProjectRoot26();
37032
37037
  try {
37033
37038
  const result = await backfillBrainGraph(root);
37034
37039
  cliOutput(
@@ -37069,7 +37074,7 @@ var init_brain2 = __esm({
37069
37074
  json: { type: "boolean", description: "Output results as JSON" }
37070
37075
  },
37071
37076
  async run({ args: _args }) {
37072
- const root = getProjectRoot24();
37077
+ const root = getProjectRoot26();
37073
37078
  try {
37074
37079
  const result = await purgeBrainNoise(root);
37075
37080
  cliOutput(
@@ -37115,7 +37120,7 @@ var init_brain2 = __esm({
37115
37120
  json: { type: "boolean", description: "Output results as JSON" }
37116
37121
  },
37117
37122
  async run({ args }) {
37118
- const root = getProjectRoot24();
37123
+ const root = getProjectRoot26();
37119
37124
  const limit = Number.parseInt(args.limit, 10) || 20;
37120
37125
  try {
37121
37126
  const stats = await getPlasticityStats(root, limit);
@@ -37165,7 +37170,7 @@ var init_brain2 = __esm({
37165
37170
  json: { type: "boolean", description: "Output results as JSON" }
37166
37171
  },
37167
37172
  async run({ args: _args }) {
37168
- const root = getProjectRoot24();
37173
+ const root = getProjectRoot26();
37169
37174
  try {
37170
37175
  const report = await getMemoryQualityReport(root);
37171
37176
  cliOutput(
@@ -37214,7 +37219,7 @@ var init_brain2 = __esm({
37214
37219
  }
37215
37220
  },
37216
37221
  async run({ args }) {
37217
- const root = getProjectRoot24();
37222
+ const root = getProjectRoot26();
37218
37223
  const format = args.format ?? "gexf";
37219
37224
  if (format !== "gexf" && format !== "json") {
37220
37225
  cliError(`Invalid format: ${format}. Use 'gexf' or 'json'.`, "E_VALIDATION", {
@@ -37295,10 +37300,10 @@ __export(briefing_exports, {
37295
37300
  briefingCommand: () => briefingCommand
37296
37301
  });
37297
37302
  import { existsSync as existsSync8, readFileSync as readFileSync8 } from "node:fs";
37298
- import { homedir as homedir3 } from "node:os";
37299
37303
  import { join as join9 } from "node:path";
37304
+ import { resolveLegacyCleoDir } from "@cleocode/paths";
37300
37305
  function resolveInjectionTemplatePath() {
37301
- const xdgConfig = process.env["XDG_CONFIG_HOME"] ?? join9(homedir3(), ".cleo");
37306
+ const xdgConfig = resolveLegacyCleoDir(process.env["XDG_CONFIG_HOME"]);
37302
37307
  return join9(xdgConfig, "templates", "CLEO-INJECTION.md");
37303
37308
  }
37304
37309
  function extractSection(content, sectionName) {
@@ -37474,7 +37479,7 @@ var caamp_exports = {};
37474
37479
  __export(caamp_exports, {
37475
37480
  caampCommand: () => caampCommand
37476
37481
  });
37477
- import { homedir as homedir4 } from "node:os";
37482
+ import { homedir as homedir3 } from "node:os";
37478
37483
  import { join as join10 } from "node:path";
37479
37484
  var dedupeCommand, caampCommand;
37480
37485
  var init_caamp = __esm({
@@ -37510,7 +37515,7 @@ var init_caamp = __esm({
37510
37515
  if (args.file) {
37511
37516
  filePaths = [args.file];
37512
37517
  } else {
37513
- const home = homedir4();
37518
+ const home = homedir3();
37514
37519
  filePaths = [
37515
37520
  join10(home, ".agents", "AGENTS.md"),
37516
37521
  // project-level AGENTS.md in cwd
@@ -39783,7 +39788,6 @@ __export(daemon_exports, {
39783
39788
  daemonCommand: () => daemonCommand
39784
39789
  });
39785
39790
  import { existsSync as existsSync10 } from "node:fs";
39786
- import { homedir as homedir5 } from "node:os";
39787
39791
  import { join as join12 } from "node:path";
39788
39792
  import { fileURLToPath as fileURLToPath4 } from "node:url";
39789
39793
  import { getGCDaemonStatus, spawnGCDaemon, stopGCDaemon } from "@cleocode/core/gc/daemon.js";
@@ -39791,6 +39795,7 @@ import {
39791
39795
  bootstrapDaemon as bootstrapSentientDaemon,
39792
39796
  getSentientDaemonStatus
39793
39797
  } from "@cleocode/core/sentient";
39798
+ import { resolveLegacyCleoDir as resolveLegacyCleoDir2 } from "@cleocode/paths";
39794
39799
  async function showDaemonStatus(cleoDir, projectRoot) {
39795
39800
  try {
39796
39801
  const gcStatus = await getGCDaemonStatus(cleoDir);
@@ -39886,7 +39891,7 @@ var init_daemon = __esm({
39886
39891
  }
39887
39892
  },
39888
39893
  async run({ args }) {
39889
- const cleoDir = args["cleo-dir"] ?? join12(homedir5(), ".cleo");
39894
+ const cleoDir = resolveLegacyCleoDir2(args["cleo-dir"]);
39890
39895
  const foreground = args.foreground ?? false;
39891
39896
  if (foreground) {
39892
39897
  const projectRoot = process.cwd();
@@ -39959,7 +39964,7 @@ var init_daemon = __esm({
39959
39964
  }
39960
39965
  },
39961
39966
  async run({ args }) {
39962
- const cleoDir = args["cleo-dir"] ?? join12(homedir5(), ".cleo");
39967
+ const cleoDir = resolveLegacyCleoDir2(args["cleo-dir"]);
39963
39968
  try {
39964
39969
  const stopResult = await stopGCDaemon(cleoDir);
39965
39970
  cliOutput(stopResult, {
@@ -39997,7 +40002,7 @@ var init_daemon = __esm({
39997
40002
  }
39998
40003
  },
39999
40004
  async run({ args }) {
40000
- const cleoDir = args["cleo-dir"] ?? join12(homedir5(), ".cleo");
40005
+ const cleoDir = resolveLegacyCleoDir2(args["cleo-dir"]);
40001
40006
  await showDaemonStatus(cleoDir, process.cwd());
40002
40007
  }
40003
40008
  });
@@ -40095,7 +40100,7 @@ var init_daemon = __esm({
40095
40100
  },
40096
40101
  async run({ args, cmd, rawArgs }) {
40097
40102
  if (isSubCommandDispatch(rawArgs, cmd.subCommands)) return;
40098
- const cleoDir = args["cleo-dir"] ?? join12(homedir5(), ".cleo");
40103
+ const cleoDir = resolveLegacyCleoDir2(args["cleo-dir"]);
40099
40104
  await showDaemonStatus(cleoDir, process.cwd());
40100
40105
  }
40101
40106
  });
@@ -41091,7 +41096,7 @@ import {
41091
41096
  exportDocument,
41092
41097
  formatError as formatError5,
41093
41098
  getAgentOutputsAbsolute,
41094
- getProjectRoot as getProjectRoot25,
41099
+ getProjectRoot as getProjectRoot27,
41095
41100
  listDocVersions,
41096
41101
  mergeDocs,
41097
41102
  publishDocs,
@@ -41387,7 +41392,7 @@ var init_docs3 = __esm({
41387
41392
  const taskId = String(args.task);
41388
41393
  const includeAttachments = args["include-attachments"] !== false;
41389
41394
  const includeMemoryRefs = args["include-memory-refs"] === true;
41390
- const projectRoot = getProjectRoot25();
41395
+ const projectRoot = getProjectRoot27();
41391
41396
  try {
41392
41397
  const result = await exportDocument({
41393
41398
  taskId,
@@ -41450,7 +41455,7 @@ var init_docs3 = __esm({
41450
41455
  }
41451
41456
  },
41452
41457
  async run({ args }) {
41453
- const projectRoot = getProjectRoot25();
41458
+ const projectRoot = getProjectRoot27();
41454
41459
  try {
41455
41460
  const result = await searchDocs2(String(args.query), {
41456
41461
  ownerId: args.owner ?? void 0,
@@ -41502,7 +41507,7 @@ var init_docs3 = __esm({
41502
41507
  }
41503
41508
  },
41504
41509
  async run({ args }) {
41505
- const projectRoot = getProjectRoot25();
41510
+ const projectRoot = getProjectRoot27();
41506
41511
  const rawStrategy = args.strategy ?? "three-way";
41507
41512
  const strategy = rawStrategy === "cherry-pick" || rawStrategy === "multi-diff" ? rawStrategy : "three-way";
41508
41513
  try {
@@ -41552,7 +41557,7 @@ var init_docs3 = __esm({
41552
41557
  }
41553
41558
  },
41554
41559
  async run({ args }) {
41555
- const projectRoot = getProjectRoot25();
41560
+ const projectRoot = getProjectRoot27();
41556
41561
  const fmt = args.format ?? "mermaid";
41557
41562
  try {
41558
41563
  const result = await buildDocsGraph({ ownerId: String(args.for), projectRoot });
@@ -41622,7 +41627,7 @@ var init_docs3 = __esm({
41622
41627
  }
41623
41628
  },
41624
41629
  async run({ args }) {
41625
- const projectRoot = getProjectRoot25();
41630
+ const projectRoot = getProjectRoot27();
41626
41631
  try {
41627
41632
  const result = await rankDocs({
41628
41633
  ownerId: String(args.for),
@@ -41661,7 +41666,7 @@ var init_docs3 = __esm({
41661
41666
  }
41662
41667
  },
41663
41668
  async run({ args }) {
41664
- const projectRoot = getProjectRoot25();
41669
+ const projectRoot = getProjectRoot27();
41665
41670
  try {
41666
41671
  const result = await listDocVersions({
41667
41672
  ownerId: String(args.for),
@@ -41705,7 +41710,7 @@ var init_docs3 = __esm({
41705
41710
  }
41706
41711
  },
41707
41712
  async run({ args }) {
41708
- const projectRoot = getProjectRoot25();
41713
+ const projectRoot = getProjectRoot27();
41709
41714
  try {
41710
41715
  const result = await publishDocs({
41711
41716
  ownerId: String(args.for),
@@ -42110,7 +42115,7 @@ __export(migrate_agents_v2_exports, {
42110
42115
  import { createHash as createHash2 } from "node:crypto";
42111
42116
  import { appendFileSync as appendFileSync2, existsSync as existsSync12, mkdirSync as mkdirSync3, readdirSync as readdirSync2, readFileSync as readFileSync12 } from "node:fs";
42112
42117
  import { join as join15 } from "node:path";
42113
- import { getProjectRoot as getProjectRoot26, installAgentFromCant } from "@cleocode/core/internal";
42118
+ import { getProjectRoot as getProjectRoot28, installAgentFromCant } from "@cleocode/core/internal";
42114
42119
  import { openCleoDb } from "@cleocode/core/store/open-cleo-db";
42115
42120
  function sha256Hex(bytes) {
42116
42121
  return createHash2("sha256").update(bytes).digest("hex");
@@ -42297,7 +42302,7 @@ var init_migrate_agents_v2 = __esm({
42297
42302
  }
42298
42303
  },
42299
42304
  async run({ args }) {
42300
- const projectRoot = getProjectRoot26();
42305
+ const projectRoot = getProjectRoot28();
42301
42306
  const verbose = args.quiet !== true;
42302
42307
  if (verbose) {
42303
42308
  humanInfo("Scanning .cleo/cant/agents/ and .cleo/agents/ for unregistered agents...");
@@ -42341,7 +42346,7 @@ __export(doctor_exports, {
42341
42346
  });
42342
42347
  import { mkdirSync as mkdirSync4, writeFileSync as writeFileSync4 } from "node:fs";
42343
42348
  import { join as join16 } from "node:path";
42344
- import { getProjectRoot as getProjectRoot27 } from "@cleocode/core";
42349
+ import { getProjectRoot as getProjectRoot29 } from "@cleocode/core";
42345
42350
  import {
42346
42351
  quarantineRogueCleoDir,
42347
42352
  scanRogueCleoDirs
@@ -42567,7 +42572,7 @@ var init_doctor = __esm({
42567
42572
  try {
42568
42573
  if (args.brain) {
42569
42574
  const { computeBrainHealthDashboard } = await import("@cleocode/core/memory/brain-health-dashboard.js");
42570
- const projectRoot = getProjectRoot27();
42575
+ const projectRoot = getProjectRoot29();
42571
42576
  const dashboard = await computeBrainHealthDashboard(projectRoot);
42572
42577
  cliOutput(dashboard, { command: "doctor", operation: "doctor.brain" });
42573
42578
  if (dashboard.hasP0Failure) {
@@ -42576,7 +42581,7 @@ var init_doctor = __esm({
42576
42581
  return;
42577
42582
  }
42578
42583
  if (args["scan-test-fixtures-in-prod"]) {
42579
- const projectRoot = getProjectRoot27();
42584
+ const projectRoot = getProjectRoot29();
42580
42585
  const matches = await scanTestFixturesInProd(projectRoot);
42581
42586
  const dryRun = args["dry-run"] !== false && args.quarantine !== true;
42582
42587
  const quarantined = !dryRun && matches.length > 0 ? await quarantineTestFixtures(projectRoot, matches) : void 0;
@@ -42664,7 +42669,7 @@ var init_doctor = __esm({
42664
42669
  progress.complete("Comprehensive diagnostics complete");
42665
42670
  } else if (args["scan-rogue-cleo-dirs"]) {
42666
42671
  progress.step(0, "Scanning for rogue .cleo/ directories");
42667
- const projectRoot = getProjectRoot27();
42672
+ const projectRoot = getProjectRoot29();
42668
42673
  const reports = scanRogueCleoDirs(projectRoot);
42669
42674
  progress.complete(
42670
42675
  `Found ${reports.length} rogue .cleo/ director${reports.length === 1 ? "y" : "ies"}`
@@ -42673,7 +42678,7 @@ var init_doctor = __esm({
42673
42678
  } else if (args["quarantine-rogue-cleo-dirs"]) {
42674
42679
  const isDryRun = args["dry-run"] === true;
42675
42680
  progress.step(0, `${isDryRun ? "[DRY RUN] " : ""}Scanning for rogue .cleo/ directories`);
42676
- const projectRoot = getProjectRoot27();
42681
+ const projectRoot = getProjectRoot29();
42677
42682
  const reports = scanRogueCleoDirs(projectRoot);
42678
42683
  if (reports.length === 0) {
42679
42684
  progress.complete("No rogue .cleo/ directories found \u2014 nothing to quarantine");
@@ -42727,7 +42732,7 @@ var init_doctor = __esm({
42727
42732
  const { detectAndRemoveLegacyGlobalFiles, detectAndRemoveStrayProjectNexus } = await import("@cleocode/core/store/cleanup-legacy.js");
42728
42733
  const { getCleoHome: getCleoHome3 } = await import("@cleocode/core");
42729
42734
  const cleoHome = getCleoHome3();
42730
- const projectRoot = getProjectRoot27();
42735
+ const projectRoot = getProjectRoot29();
42731
42736
  const legacyResult = detectAndRemoveLegacyGlobalFiles(cleoHome);
42732
42737
  const strayResult = detectAndRemoveStrayProjectNexus(projectRoot);
42733
42738
  const isDryRun = args["dry-run"] === true;
@@ -42776,7 +42781,7 @@ var init_doctor = __esm({
42776
42781
  { command: "doctor", operation: "admin.health" }
42777
42782
  );
42778
42783
  try {
42779
- const projectRoot = getProjectRoot27();
42784
+ const projectRoot = getProjectRoot29();
42780
42785
  const conflicts = readMigrationConflicts(projectRoot);
42781
42786
  if (conflicts.length > 0) {
42782
42787
  progress.complete(
@@ -43472,11 +43477,12 @@ var gc_exports = {};
43472
43477
  __export(gc_exports, {
43473
43478
  gcCommand: () => gcCommand
43474
43479
  });
43475
- import { homedir as homedir6, tmpdir } from "node:os";
43480
+ import { homedir as homedir4, tmpdir } from "node:os";
43476
43481
  import { join as join18 } from "node:path";
43477
43482
  import { pruneOrphanTempDirs, pruneOrphanWorktrees } from "@cleocode/core/gc/cleanup.js";
43478
43483
  import { runGC } from "@cleocode/core/gc/runner.js";
43479
43484
  import { readGCState } from "@cleocode/core/gc/state.js";
43485
+ import { resolveLegacyCleoDir as resolveLegacyCleoDir3 } from "@cleocode/paths";
43480
43486
  function formatBytes(bytes) {
43481
43487
  if (bytes === 0) return "0 B";
43482
43488
  const units = ["B", "KB", "MB", "GB", "TB"];
@@ -43512,7 +43518,7 @@ var init_gc = __esm({
43512
43518
  }
43513
43519
  },
43514
43520
  async run({ args }) {
43515
- const cleoDir = args["cleo-dir"] ?? join18(homedir6(), ".cleo");
43521
+ const cleoDir = resolveLegacyCleoDir3(args["cleo-dir"]);
43516
43522
  const dryRun = args["dry-run"];
43517
43523
  try {
43518
43524
  const gcResult = await runGC({ cleoDir, dryRun });
@@ -43554,7 +43560,7 @@ var init_gc = __esm({
43554
43560
  }
43555
43561
  },
43556
43562
  async run({ args }) {
43557
- const cleoDir = args["cleo-dir"] ?? join18(homedir6(), ".cleo");
43563
+ const cleoDir = resolveLegacyCleoDir3(args["cleo-dir"]);
43558
43564
  const statePath = join18(cleoDir, "gc-state.json");
43559
43565
  try {
43560
43566
  const state = await readGCState(statePath);
@@ -43608,7 +43614,7 @@ var init_gc = __esm({
43608
43614
  }
43609
43615
  },
43610
43616
  async run({ args }) {
43611
- const xdgData = process.env["XDG_DATA_HOME"] ?? join18(homedir6(), ".local", "share");
43617
+ const xdgData = process.env["XDG_DATA_HOME"] ?? join18(homedir4(), ".local", "share");
43612
43618
  const worktreesRoot = args["worktrees-root"] ?? join18(xdgData, "cleo", "worktrees");
43613
43619
  const projectHash = args["project-hash"];
43614
43620
  const dryRun = args["dry-run"];
@@ -43721,7 +43727,7 @@ __export(generate_changelog_exports, {
43721
43727
  import { execFileSync as execFileSync2 } from "node:child_process";
43722
43728
  import { existsSync as existsSync13, mkdirSync as mkdirSync5, readFileSync as readFileSync13, writeFileSync as writeFileSync5 } from "node:fs";
43723
43729
  import { dirname as dirname8, join as join19 } from "node:path";
43724
- import { CleoError as CleoError4, formatError as formatError6, getConfigPath, getProjectRoot as getProjectRoot28 } from "@cleocode/core";
43730
+ import { CleoError as CleoError4, formatError as formatError6, getConfigPath, getProjectRoot as getProjectRoot30 } from "@cleocode/core";
43725
43731
  function getChangelogSource(cwd) {
43726
43732
  const configPath = getConfigPath(cwd);
43727
43733
  try {
@@ -43752,7 +43758,7 @@ function getDefaultOutputPath(platform) {
43752
43758
  }
43753
43759
  }
43754
43760
  function getGitHubRepoSlug(cwd) {
43755
- const projectRoot = getProjectRoot28(cwd);
43761
+ const projectRoot = getProjectRoot30(cwd);
43756
43762
  try {
43757
43763
  const remoteUrl = execFileSync2("git", ["remote", "get-url", "origin"], {
43758
43764
  cwd: projectRoot,
@@ -43885,7 +43891,7 @@ var init_generate_changelog = __esm({
43885
43891
  const targetPlatform = args.platform;
43886
43892
  const dryRun = args["dry-run"] === true;
43887
43893
  const sourceFile = getChangelogSource();
43888
- const sourcePath = join19(getProjectRoot28(), sourceFile);
43894
+ const sourcePath = join19(getProjectRoot30(), sourceFile);
43889
43895
  if (!existsSync13(sourcePath)) {
43890
43896
  throw new CleoError4(4 /* NOT_FOUND */, `Changelog source not found: ${sourcePath}`);
43891
43897
  }
@@ -43898,7 +43904,7 @@ var init_generate_changelog = __esm({
43898
43904
  const outputPath = platformConfig?.path ?? getDefaultOutputPath(targetPlatform);
43899
43905
  const content = generateForPlatform(targetPlatform, sourceContent, repoSlug, limit);
43900
43906
  if (!dryRun) {
43901
- const fullPath = join19(getProjectRoot28(), outputPath);
43907
+ const fullPath = join19(getProjectRoot30(), outputPath);
43902
43908
  mkdirSync5(dirname8(fullPath), { recursive: true });
43903
43909
  writeFileSync5(fullPath, content, "utf-8");
43904
43910
  }
@@ -43919,7 +43925,7 @@ var init_generate_changelog = __esm({
43919
43925
  limit
43920
43926
  );
43921
43927
  if (!dryRun) {
43922
- const fullPath = join19(getProjectRoot28(), platformConfig.path);
43928
+ const fullPath = join19(getProjectRoot30(), platformConfig.path);
43923
43929
  mkdirSync5(dirname8(fullPath), { recursive: true });
43924
43930
  writeFileSync5(fullPath, content, "utf-8");
43925
43931
  }
@@ -46000,7 +46006,7 @@ var llm_cost_exports = {};
46000
46006
  __export(llm_cost_exports, {
46001
46007
  costCommand: () => costCommand
46002
46008
  });
46003
- import { getProjectRoot as getProjectRoot29 } from "@cleocode/core/internal";
46009
+ import { getProjectRoot as getProjectRoot31 } from "@cleocode/core/internal";
46004
46010
  import { computeCost } from "@cleocode/core/llm/usage-pricing";
46005
46011
  function resolveSessionId(raw) {
46006
46012
  if (raw === "current") {
@@ -46073,7 +46079,7 @@ var init_llm_cost = __esm({
46073
46079
  process.exit(6);
46074
46080
  }
46075
46081
  const sessionId = resolveSessionId(rawSessionId);
46076
- const projectRoot = getProjectRoot29(process.cwd());
46082
+ const projectRoot = getProjectRoot31(process.cwd());
46077
46083
  let breakdown;
46078
46084
  try {
46079
46085
  breakdown = await loadSessionCostBreakdown(projectRoot, sessionId);
@@ -47578,9 +47584,9 @@ __export(memory_exports, {
47578
47584
  });
47579
47585
  import { createHash as createHash3 } from "node:crypto";
47580
47586
  import { existsSync as existsSync15, mkdirSync as mkdirSync6, readdirSync as readdirSync3, readFileSync as readFileSync15, writeFileSync as writeFileSync6 } from "node:fs";
47581
- import { homedir as homedir7 } from "node:os";
47587
+ import { homedir as homedir5 } from "node:os";
47582
47588
  import { join as join21 } from "node:path";
47583
- import { getProjectRoot as getProjectRoot30 } from "@cleocode/core";
47589
+ import { getProjectRoot as getProjectRoot32 } from "@cleocode/core";
47584
47590
  import {
47585
47591
  getBrainDb as getBrainDb2,
47586
47592
  getDreamStatus,
@@ -48547,7 +48553,7 @@ var init_memory3 = __esm({
48547
48553
  },
48548
48554
  args: {},
48549
48555
  async run() {
48550
- const root = getProjectRoot30();
48556
+ const root = getProjectRoot32();
48551
48557
  try {
48552
48558
  const result = await runConsolidation(root);
48553
48559
  cliOutput(result, { command: "memory-consolidate", operation: "memory.consolidate" });
@@ -48571,7 +48577,7 @@ var init_memory3 = __esm({
48571
48577
  }
48572
48578
  },
48573
48579
  async run({ args }) {
48574
- const root = getProjectRoot30();
48580
+ const root = getProjectRoot32();
48575
48581
  if (args.status) {
48576
48582
  try {
48577
48583
  const status = await getDreamStatus(root);
@@ -48608,7 +48614,7 @@ var init_memory3 = __esm({
48608
48614
  }
48609
48615
  },
48610
48616
  async run({ args }) {
48611
- const root = getProjectRoot30();
48617
+ const root = getProjectRoot32();
48612
48618
  try {
48613
48619
  const { runObserver, runReflector } = await import("@cleocode/core/memory");
48614
48620
  const observerResult = await runObserver(root, args.session, {
@@ -48648,7 +48654,7 @@ var init_memory3 = __esm({
48648
48654
  }
48649
48655
  },
48650
48656
  async run({ args }) {
48651
- const root = getProjectRoot30();
48657
+ const root = getProjectRoot32();
48652
48658
  try {
48653
48659
  await getBrainDb2(root);
48654
48660
  const { totalDuplicateRows, groups } = await scanDuplicateEntries();
@@ -48692,9 +48698,9 @@ var init_memory3 = __esm({
48692
48698
  }
48693
48699
  },
48694
48700
  async run({ args }) {
48695
- const sourceDir = args.from ?? join21(homedir7(), ".claude", "projects", "-mnt-projects-cleocode", "memory");
48701
+ const sourceDir = args.from ?? join21(homedir5(), ".claude", "projects", "-mnt-projects-cleocode", "memory");
48696
48702
  const isDryRun = !!args["dry-run"];
48697
- const projectRoot = getProjectRoot30();
48703
+ const projectRoot = getProjectRoot32();
48698
48704
  const stateFile = join21(projectRoot, CLEO_DIR_NAME, MIGRATE_MEMORY_HASHES_JSON);
48699
48705
  if (!existsSync15(sourceDir)) {
48700
48706
  cliError(`Source directory not found: ${sourceDir}`, "E_NOT_FOUND", { name: "E_NOT_FOUND" });
@@ -48907,7 +48913,7 @@ var init_memory3 = __esm({
48907
48913
  },
48908
48914
  args: {},
48909
48915
  async run() {
48910
- const root = getProjectRoot30();
48916
+ const root = getProjectRoot32();
48911
48917
  try {
48912
48918
  await getBrainDb2(root);
48913
48919
  const result = await getTierStats(root);
@@ -48950,7 +48956,7 @@ var init_memory3 = __esm({
48950
48956
  }
48951
48957
  },
48952
48958
  async run({ args }) {
48953
- const root = getProjectRoot30();
48959
+ const root = getProjectRoot32();
48954
48960
  const targetTier = args.to;
48955
48961
  const reason = args.reason;
48956
48962
  const validTiers = ["medium", "long"];
@@ -49016,7 +49022,7 @@ var init_memory3 = __esm({
49016
49022
  }
49017
49023
  },
49018
49024
  async run({ args }) {
49019
- const root = getProjectRoot30();
49025
+ const root = getProjectRoot32();
49020
49026
  const targetTier = args.to;
49021
49027
  const reason = args.reason;
49022
49028
  const validTiers = ["short", "medium"];
@@ -49484,7 +49490,7 @@ var migrate_claude_mem_exports = {};
49484
49490
  __export(migrate_claude_mem_exports, {
49485
49491
  migrateClaudeMemCommand: () => migrateClaudeMemCommand
49486
49492
  });
49487
- import { getProjectRoot as getProjectRoot31, migrateClaudeMem } from "@cleocode/core/internal";
49493
+ import { getProjectRoot as getProjectRoot33, migrateClaudeMem } from "@cleocode/core/internal";
49488
49494
  import { ingestLooseAgentOutputs, ingestRcasdDirectories } from "@cleocode/core/memory";
49489
49495
  import { getDb as getDb2 } from "@cleocode/core/store/sqlite";
49490
49496
  var storageCommand, claudeMemCommand, manifestIngestCommand, migrateClaudeMemCommand;
@@ -49547,7 +49553,7 @@ var init_migrate_claude_mem = __esm({
49547
49553
  }
49548
49554
  },
49549
49555
  async run({ args }) {
49550
- const root = getProjectRoot31();
49556
+ const root = getProjectRoot33();
49551
49557
  try {
49552
49558
  const result = await migrateClaudeMem(root, {
49553
49559
  sourcePath: args.source,
@@ -49596,7 +49602,7 @@ var init_migrate_claude_mem = __esm({
49596
49602
  }
49597
49603
  },
49598
49604
  async run({ args }) {
49599
- const projectRoot = getProjectRoot31();
49605
+ const projectRoot = getProjectRoot33();
49600
49606
  try {
49601
49607
  const db = await getDb2(projectRoot);
49602
49608
  const rcasdFlag = Boolean(args.rcasd);
@@ -49698,13 +49704,14 @@ __export(nexus_exports, {
49698
49704
  nexusCommand: () => nexusCommand
49699
49705
  });
49700
49706
  import { appendFile, mkdir as mkdir2 } from "node:fs/promises";
49701
- import { homedir as homedir8 } from "node:os";
49707
+ import { homedir as homedir6 } from "node:os";
49702
49708
  import path4 from "node:path";
49709
+ import { getProjectRoot as getProjectRoot34 } from "@cleocode/core";
49703
49710
  import { generateGexf, getSymbolImpact } from "@cleocode/core/nexus";
49704
49711
  async function appendDeprecationTelemetry(op, replacement) {
49705
49712
  try {
49706
49713
  const dateStr = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
49707
- const dir = path4.join(homedir8(), ".local", "state", "cleo", "nexus-deprecation");
49714
+ const dir = path4.join(homedir6(), ".local", "state", "cleo", "nexus-deprecation");
49708
49715
  await mkdir2(dir, { recursive: true });
49709
49716
  const record = JSON.stringify({ ts: (/* @__PURE__ */ new Date()).toISOString(), op, replacement }) + "\n";
49710
49717
  await appendFile(path4.join(dir, `${dateStr}.jsonl`), record, "utf8");
@@ -49811,7 +49818,7 @@ var init_nexus4 = __esm({
49811
49818
  async run({ args }) {
49812
49819
  applyJsonFlag2(args.json);
49813
49820
  const projectIdOverride = args["project-id"];
49814
- const repoPath = args.path ? path4.resolve(args.path) : process.cwd();
49821
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot34();
49815
49822
  const startTime = Date.now();
49816
49823
  try {
49817
49824
  const [{ getNexusDb, nexusSchema }, { getIndexStats }] = await Promise.all([
@@ -49958,9 +49965,9 @@ var init_nexus4 = __esm({
49958
49965
  args: {},
49959
49966
  async run() {
49960
49967
  try {
49961
- const { homedir: homedir10 } = await import("node:os");
49968
+ const { homedir: homedir8 } = await import("node:os");
49962
49969
  const { installNexusAugmentHook } = await import("@cleocode/core/internal");
49963
- const homeDir = homedir10();
49970
+ const homeDir = homedir8();
49964
49971
  installNexusAugmentHook(homeDir);
49965
49972
  cliOutput({ homeDir }, { command: "nexus-setup", operation: "nexus.setup" });
49966
49973
  } catch (err) {
@@ -50326,7 +50333,7 @@ var init_nexus4 = __esm({
50326
50333
  applyJsonFlag2(args.json);
50327
50334
  const startTime = Date.now();
50328
50335
  const projectIdOverride = args["project-id"];
50329
- const repoPath = args.path ? path4.resolve(args.path) : process.cwd();
50336
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot34();
50330
50337
  const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
50331
50338
  const response = await dispatchRaw("query", "nexus", "clusters", { projectId, repoPath });
50332
50339
  const durationMs = Date.now() - startTime;
@@ -50370,7 +50377,7 @@ var init_nexus4 = __esm({
50370
50377
  applyJsonFlag2(args.json);
50371
50378
  const startTime = Date.now();
50372
50379
  const projectIdOverride = args["project-id"];
50373
- const repoPath = args.path ? path4.resolve(args.path) : process.cwd();
50380
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot34();
50374
50381
  const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
50375
50382
  const response = await dispatchRaw("query", "nexus", "flows", { projectId, repoPath });
50376
50383
  const durationMs = Date.now() - startTime;
@@ -50413,7 +50420,7 @@ var init_nexus4 = __esm({
50413
50420
  void appendDeprecationTelemetry("nexus.context", "cleo graph context");
50414
50421
  const startTime = Date.now();
50415
50422
  const projectIdOverride = args["project-id"];
50416
- const repoPath = process.cwd();
50423
+ const repoPath = getProjectRoot34();
50417
50424
  const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
50418
50425
  const limit = parseInt(args.limit, 10);
50419
50426
  const symbolName = args.symbol;
@@ -50476,7 +50483,7 @@ var init_nexus4 = __esm({
50476
50483
  const startTime = Date.now();
50477
50484
  const whyFlag = !!args.why;
50478
50485
  const projectIdOverride = args["project-id"];
50479
- const repoPath = process.cwd();
50486
+ const repoPath = getProjectRoot34();
50480
50487
  const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
50481
50488
  const maxDepth = Math.min(parseInt(args.depth, 10), 5);
50482
50489
  const symbolName = args.symbol;
@@ -50548,13 +50555,12 @@ var init_nexus4 = __esm({
50548
50555
  const projectIdOverride = args["project-id"];
50549
50556
  const isIncremental = !!args.incremental;
50550
50557
  const ctx = getFormatContext();
50551
- const repoPath = args.path ? path4.resolve(args.path) : process.cwd();
50558
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot34();
50552
50559
  humanInfo(`[nexus] Analyzing: ${repoPath}${isIncremental ? " (incremental)" : ""}`);
50553
50560
  try {
50554
- const [{ getNexusDb, nexusSchema }, { runPipeline }, { getProjectRoot: getProjectRoot38 }, { eq: eq2 }] = await Promise.all([
50561
+ const [{ getNexusDb, nexusSchema }, { runPipeline }, { eq: eq2 }] = await Promise.all([
50555
50562
  import("@cleocode/core/store/nexus-sqlite"),
50556
50563
  import("@cleocode/nexus/pipeline"),
50557
- import("@cleocode/core/internal"),
50558
50564
  import("drizzle-orm")
50559
50565
  ]);
50560
50566
  const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
@@ -50631,7 +50637,6 @@ var init_nexus4 = __esm({
50631
50637
  extensions: { duration_ms: durationMs }
50632
50638
  }
50633
50639
  );
50634
- void getProjectRoot38;
50635
50640
  } catch (err) {
50636
50641
  const msg = err instanceof Error ? err.message : String(err);
50637
50642
  cliError(
@@ -50702,7 +50707,7 @@ var init_nexus4 = __esm({
50702
50707
  async run({ args }) {
50703
50708
  applyJsonFlag2(args.json);
50704
50709
  const startTime = Date.now();
50705
- const repoPath = args.path ? path4.resolve(args.path) : process.cwd();
50710
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot34();
50706
50711
  const name = args.name;
50707
50712
  const response = await dispatchRaw("mutate", "nexus", "projects.register", {
50708
50713
  path: repoPath,
@@ -51060,7 +51065,7 @@ var init_nexus4 = __esm({
51060
51065
  applyJsonFlag2(args.json);
51061
51066
  const startTime = Date.now();
51062
51067
  const projectIdOverride = args["project-id"];
51063
- const repoPath = args.path ? path4.resolve(args.path) : process.cwd();
51068
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot34();
51064
51069
  const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
51065
51070
  const response = await dispatchRaw("mutate", "nexus", "refresh-bridge", {
51066
51071
  repoPath,
@@ -51209,7 +51214,7 @@ var init_nexus4 = __esm({
51209
51214
  async run({ args }) {
51210
51215
  applyJsonFlag2(args.json);
51211
51216
  const startTime = Date.now();
51212
- const repoPath = args.path ? path4.resolve(args.path) : process.cwd();
51217
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot34();
51213
51218
  const projectIdOverride = args["project-id"];
51214
51219
  const beforeRef = args.before ?? "HEAD~1";
51215
51220
  const afterRef = args.after ?? "HEAD";
@@ -51327,7 +51332,7 @@ var init_nexus4 = __esm({
51327
51332
  applyJsonFlag2(args.json);
51328
51333
  const startTime = Date.now();
51329
51334
  const projectIdOverride = args["project-id"];
51330
- const repoPath = args.path ? path4.resolve(args.path) : process.cwd();
51335
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot34();
51331
51336
  const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
51332
51337
  const response = await dispatchRaw("query", "nexus", "route-map", { projectId });
51333
51338
  const durationMs = Date.now() - startTime;
@@ -51383,7 +51388,7 @@ var init_nexus4 = __esm({
51383
51388
  const startTime = Date.now();
51384
51389
  const routeSymbol = args.routeSymbol;
51385
51390
  const projectIdOverride = args["project-id"];
51386
- const repoPath = args.path ? path4.resolve(args.path) : process.cwd();
51391
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot34();
51387
51392
  const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
51388
51393
  const response = await dispatchRaw("query", "nexus", "shape-check", { routeSymbol, projectId });
51389
51394
  const durationMs = Date.now() - startTime;
@@ -51773,7 +51778,7 @@ var init_nexus4 = __esm({
51773
51778
  async run({ args }) {
51774
51779
  applyJsonFlag2(args.json);
51775
51780
  const startTime = Date.now();
51776
- const repoPath = args.path ? path4.resolve(args.path) : process.cwd();
51781
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot34();
51777
51782
  const projectIdOverride = args["project-id"];
51778
51783
  const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
51779
51784
  const response = await dispatchRaw("mutate", "nexus", "contracts-sync", {
@@ -51877,7 +51882,7 @@ var init_nexus4 = __esm({
51877
51882
  async run({ args }) {
51878
51883
  applyJsonFlag2(args.json);
51879
51884
  const startTime = Date.now();
51880
- const repoPath = args.path ? path4.resolve(args.path) : process.cwd();
51885
+ const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot34();
51881
51886
  const projectId = Buffer.from(repoPath).toString("base64url").slice(0, 32);
51882
51887
  const response = await dispatchRaw("mutate", "nexus", "contracts-link-tasks", {
51883
51888
  projectId,
@@ -51953,7 +51958,7 @@ var init_nexus4 = __esm({
51953
51958
  async run({ args }) {
51954
51959
  applyJsonFlag2(args.json);
51955
51960
  const startTime = Date.now();
51956
- const outputDir = args.output ?? path4.join(process.cwd(), ".cleo", "wiki");
51961
+ const outputDir = args.output ?? path4.join(getProjectRoot34(), ".cleo", "wiki");
51957
51962
  const communityFilter = args.community ?? void 0;
51958
51963
  const isIncremental = !!args.incremental;
51959
51964
  let loomProvider = null;
@@ -51977,11 +51982,11 @@ var init_nexus4 = __esm({
51977
51982
  }
51978
51983
  try {
51979
51984
  const { generateNexusWikiIndex } = await import("@cleocode/core/nexus/wiki-index.js");
51980
- const result = await generateNexusWikiIndex(outputDir, process.cwd(), {
51985
+ const result = await generateNexusWikiIndex(outputDir, getProjectRoot34(), {
51981
51986
  communityFilter,
51982
51987
  incremental: isIncremental,
51983
51988
  loomProvider,
51984
- projectRoot: process.cwd()
51989
+ projectRoot: getProjectRoot34()
51985
51990
  });
51986
51991
  const durationMs = Date.now() - startTime;
51987
51992
  if (!result.success) {
@@ -54379,7 +54384,7 @@ var refresh_memory_exports = {};
54379
54384
  __export(refresh_memory_exports, {
54380
54385
  refreshMemoryCommand: () => refreshMemoryCommand
54381
54386
  });
54382
- import { getProjectRoot as getProjectRoot32 } from "@cleocode/core";
54387
+ import { getProjectRoot as getProjectRoot35 } from "@cleocode/core";
54383
54388
  var refreshMemoryCommand;
54384
54389
  var init_refresh_memory = __esm({
54385
54390
  "packages/cleo/src/cli/commands/refresh-memory.ts"() {
@@ -54392,7 +54397,7 @@ var init_refresh_memory = __esm({
54392
54397
  description: "Regenerate .cleo/memory-bridge.md from brain.db"
54393
54398
  },
54394
54399
  async run() {
54395
- const projectDir = getProjectRoot32();
54400
+ const projectDir = getProjectRoot35();
54396
54401
  const { writeMemoryBridge } = await import("@cleocode/core/internal");
54397
54402
  const result = await writeMemoryBridge(projectDir);
54398
54403
  if (result.written) {
@@ -55772,7 +55777,7 @@ __export(restore_exports, {
55772
55777
  });
55773
55778
  import fs3 from "node:fs";
55774
55779
  import path5 from "node:path";
55775
- import { CleoError as CleoError8, getProjectRoot as getProjectRoot33, getTaskAccessor as getTaskAccessor3 } from "@cleocode/core";
55780
+ import { CleoError as CleoError8, getProjectRoot as getProjectRoot36, getTaskAccessor as getTaskAccessor3 } from "@cleocode/core";
55776
55781
  function parseMarkdownValue(raw) {
55777
55782
  const trimmed = raw.trim();
55778
55783
  if (trimmed === "_(not present)_" || trimmed === "") return void 0;
@@ -55892,7 +55897,7 @@ var init_restore = __esm({
55892
55897
  description: "Apply manually-resolved conflicts from .cleo/restore-conflicts.md"
55893
55898
  },
55894
55899
  async run() {
55895
- const projectRoot = getProjectRoot33();
55900
+ const projectRoot = getProjectRoot36();
55896
55901
  const reportPath = path5.join(projectRoot, CLEO_DIR_NAME, RESTORE_CONFLICTS_MD);
55897
55902
  if (!fs3.existsSync(reportPath)) {
55898
55903
  humanLine("No pending restore conflicts. Nothing to finalize.");
@@ -58014,7 +58019,7 @@ var sequence_exports = {};
58014
58019
  __export(sequence_exports, {
58015
58020
  sequenceCommand: () => sequenceCommand
58016
58021
  });
58017
- import { getProjectRoot as getProjectRoot34 } from "@cleocode/core/internal";
58022
+ import { getProjectRoot as getProjectRoot37 } from "@cleocode/core/internal";
58018
58023
  var showCommand12, checkCommand6, repairCommand, sequenceCommand;
58019
58024
  var init_sequence = __esm({
58020
58025
  "packages/cleo/src/cli/commands/sequence.ts"() {
@@ -58050,7 +58055,7 @@ var init_sequence = __esm({
58050
58055
  meta: { name: "repair", description: "Reset counter to max + 1 if behind" },
58051
58056
  async run() {
58052
58057
  const { repairSequence } = await import("@cleocode/core/internal");
58053
- const projectRoot = getProjectRoot34();
58058
+ const projectRoot = getProjectRoot37();
58054
58059
  const repair = await repairSequence(projectRoot);
58055
58060
  const result = {
58056
58061
  repaired: repair.repaired,
@@ -58493,8 +58498,8 @@ var init_session4 = __esm({
58493
58498
  "audit-scope": { type: "string", description: "Audit log scope (global|local)" }
58494
58499
  },
58495
58500
  async run({ args }) {
58496
- const { detectSessionDrift, getProjectRoot: getProjectRoot38 } = await import("@cleocode/core");
58497
- const projectRoot = await getProjectRoot38();
58501
+ const { detectSessionDrift, getProjectRoot: getProjectRoot41 } = await import("@cleocode/core");
58502
+ const projectRoot = await getProjectRoot41();
58498
58503
  const scope = args["audit-scope"] === "local" ? "local" : "global";
58499
58504
  const report = await detectSessionDrift({ projectRoot, auditScope: scope });
58500
58505
  cliOutput(report, { command: "session drift", operation: "session.drift" });
@@ -60695,7 +60700,7 @@ __export(token_exports, {
60695
60700
  tokenCommand: () => tokenCommand
60696
60701
  });
60697
60702
  import { readFileSync as readFileSync16 } from "node:fs";
60698
- import { getProjectRoot as getProjectRoot35, measureTokenExchange, recordTokenExchange as recordTokenExchange2 } from "@cleocode/core/internal";
60703
+ import { getProjectRoot as getProjectRoot38, measureTokenExchange, recordTokenExchange as recordTokenExchange2 } from "@cleocode/core/internal";
60699
60704
  function readPayload(args, textKey, fileKey) {
60700
60705
  const text = args[textKey];
60701
60706
  const file = args[fileKey];
@@ -60859,7 +60864,7 @@ var init_token = __esm({
60859
60864
  domain: args.domain,
60860
60865
  operation: args.operation
60861
60866
  };
60862
- const result = args.record ? await recordTokenExchange2(getProjectRoot35(), input2) : await measureTokenExchange(input2);
60867
+ const result = args.record ? await recordTokenExchange2(getProjectRoot38(), input2) : await measureTokenExchange(input2);
60863
60868
  cliOutput(result, {
60864
60869
  command: "token",
60865
60870
  operation: args.record ? "admin.token.record" : "token.estimate"
@@ -60893,9 +60898,9 @@ var transcript_exports = {};
60893
60898
  __export(transcript_exports, {
60894
60899
  transcriptCommand: () => transcriptCommand
60895
60900
  });
60896
- import { homedir as homedir9 } from "node:os";
60901
+ import { homedir as homedir7 } from "node:os";
60897
60902
  import { join as join25 } from "node:path";
60898
- import { getProjectRoot as getProjectRoot36 } from "@cleocode/core";
60903
+ import { getProjectRoot as getProjectRoot39 } from "@cleocode/core";
60899
60904
  import {
60900
60905
  parseDurationMs,
60901
60906
  pruneTranscripts,
@@ -60925,7 +60930,7 @@ var init_transcript = __esm({
60925
60930
  async run({ args }) {
60926
60931
  if (args.pending) {
60927
60932
  try {
60928
- const projectRoot = getProjectRoot36();
60933
+ const projectRoot = getProjectRoot39();
60929
60934
  const { scanPendingTranscripts } = await import("@cleocode/core/memory/transcript-scanner.js");
60930
60935
  const pending = await scanPendingTranscripts(projectRoot);
60931
60936
  cliOutput(
@@ -60948,7 +60953,7 @@ var init_transcript = __esm({
60948
60953
  }
60949
60954
  return;
60950
60955
  }
60951
- const projectsDir = args["projects-dir"] ?? join25(homedir9(), ".claude", "projects");
60956
+ const projectsDir = args["projects-dir"] ?? join25(homedir7(), ".claude", "projects");
60952
60957
  try {
60953
60958
  const result = await scanTranscripts(projectsDir);
60954
60959
  cliOutput(
@@ -61022,7 +61027,7 @@ var init_transcript = __esm({
61022
61027
  async run({ args }) {
61023
61028
  const tier = args.tier ?? "warm";
61024
61029
  const dryRun = args["dry-run"] ?? false;
61025
- const projectRoot = getProjectRoot36();
61030
+ const projectRoot = getProjectRoot39();
61026
61031
  try {
61027
61032
  const { extractTranscript } = await import("@cleocode/core/memory/transcript-extractor.js");
61028
61033
  const { findSessionTranscriptPath, listAllTranscripts } = await import("@cleocode/core/memory/transcript-scanner.js");
@@ -61134,7 +61139,7 @@ var init_transcript = __esm({
61134
61139
  const dryRun = args["dry-run"] ?? false;
61135
61140
  const olderThanHours = args["older-than-hours"] ? Number.parseInt(args["older-than-hours"], 10) : 24;
61136
61141
  const limit = args.limit ? Number.parseInt(args.limit, 10) : void 0;
61137
- const projectRoot = getProjectRoot36();
61142
+ const projectRoot = getProjectRoot39();
61138
61143
  try {
61139
61144
  const { extractTranscript } = await import("@cleocode/core/memory/transcript-extractor.js");
61140
61145
  const { listAllTranscripts } = await import("@cleocode/core/memory/transcript-scanner.js");
@@ -61254,7 +61259,7 @@ var init_transcript = __esm({
61254
61259
  process.exit(2);
61255
61260
  return;
61256
61261
  }
61257
- const projectsDir = args["projects-dir"] ?? join25(homedir9(), ".claude", "projects");
61262
+ const projectsDir = args["projects-dir"] ?? join25(homedir7(), ".claude", "projects");
61258
61263
  try {
61259
61264
  const pruneResult = await pruneTranscripts({
61260
61265
  olderThanMs,
@@ -62249,7 +62254,7 @@ __export(worktree_exports, {
62249
62254
  worktreeCommand: () => worktreeCommand
62250
62255
  });
62251
62256
  import readline4 from "node:readline";
62252
- import { getProjectRoot as getProjectRoot37, listWorktrees as listWorktrees2 } from "@cleocode/core/internal";
62257
+ import { getProjectRoot as getProjectRoot40, listWorktrees as listWorktrees2 } from "@cleocode/core/internal";
62253
62258
  async function promptYesNo2(question) {
62254
62259
  return new Promise((resolve8) => {
62255
62260
  const rl = readline4.createInterface({ input: process.stdin, output: process.stdout });
@@ -62348,7 +62353,7 @@ var init_worktree3 = __esm({
62348
62353
  const yes = args["yes"] === true;
62349
62354
  const staleDaysRaw = typeof args["days"] === "string" ? args["days"] : void 0;
62350
62355
  const staleDays = staleDaysRaw !== void 0 ? Number.parseInt(staleDaysRaw, 10) : void 0;
62351
- const projectRoot = getProjectRoot37();
62356
+ const projectRoot = getProjectRoot40();
62352
62357
  const listResult = await listWorktrees2({
62353
62358
  projectRoot,
62354
62359
  ...staleDays !== void 0 && !Number.isNaN(staleDays) ? { staleDays } : {}
@@ -63777,7 +63782,7 @@ async function runStartupMaintenance() {
63777
63782
  detectAndRemoveStrayProjectNexus,
63778
63783
  getGlobalSalt,
63779
63784
  getLogger: getLogger20,
63780
- getProjectRoot: getProjectRoot38,
63785
+ getProjectRoot: getProjectRoot41,
63781
63786
  isCleanupMarkerSet,
63782
63787
  migrateSignaldockToConduit,
63783
63788
  needsSignaldockToConduitMigration,
@@ -63786,7 +63791,7 @@ async function runStartupMaintenance() {
63786
63791
  } = await import("@cleocode/core/internal");
63787
63792
  let projectRootForCleanup = "";
63788
63793
  try {
63789
- projectRootForCleanup = getProjectRoot38();
63794
+ projectRootForCleanup = getProjectRoot41();
63790
63795
  } catch {
63791
63796
  }
63792
63797
  if (!isCleanupMarkerSet(CLI_VERSION, projectRootForCleanup)) {
@@ -63806,7 +63811,7 @@ async function runStartupMaintenance() {
63806
63811
  const isInitInvocation = process.argv.slice(2).some((a) => a === "init");
63807
63812
  if (!isInitInvocation) {
63808
63813
  try {
63809
- const _projectRootForMigration = getProjectRoot38();
63814
+ const _projectRootForMigration = getProjectRoot41();
63810
63815
  if (needsSignaldockToConduitMigration(_projectRootForMigration)) {
63811
63816
  const migrationResult = migrateSignaldockToConduit(_projectRootForMigration);
63812
63817
  if (migrationResult.status === "failed") {