@cleocode/cleo 2026.3.45 → 2026.3.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -34593,7 +34593,7 @@ async function ensureInjection(projectRoot) {
34593
34593
  }
34594
34594
  }
34595
34595
  const agentsMdPath = join36(projectRoot, "AGENTS.md");
34596
- const agentsMdLines = ["@~/.cleo/templates/CLEO-INJECTION.md"];
34596
+ const agentsMdLines = ["@~/.agents/AGENTS.md"];
34597
34597
  const projectContextPath = join36(projectRoot, ".cleo", "project-context.json");
34598
34598
  if (existsSync33(projectContextPath)) {
34599
34599
  agentsMdLines.push("@.cleo/project-context.json");
@@ -34606,7 +34606,8 @@ async function ensureInjection(projectRoot) {
34606
34606
  if (contributorBlock) {
34607
34607
  agentsMdLines.push(contributorBlock);
34608
34608
  }
34609
- const agentsAction = await inject2(agentsMdPath, agentsMdLines.join("\n"));
34609
+ const agentsMdContent = agentsMdLines.join("\n");
34610
+ const agentsAction = await inject2(agentsMdPath, agentsMdContent);
34610
34611
  actions.push(`AGENTS.md CLEO content (${agentsAction})`);
34611
34612
  const content = getInjectionTemplateContent();
34612
34613
  if (content) {
@@ -34621,8 +34622,9 @@ async function ensureInjection(projectRoot) {
34621
34622
  try {
34622
34623
  const globalAgentsDir = getAgentsHome();
34623
34624
  const globalAgentsMd = join36(globalAgentsDir, "AGENTS.md");
34625
+ const globalHubContent = "@~/.cleo/templates/CLEO-INJECTION.md";
34624
34626
  await mkdir4(globalAgentsDir, { recursive: true });
34625
- await inject2(globalAgentsMd, "@~/.cleo/templates/CLEO-INJECTION.md");
34627
+ await inject2(globalAgentsMd, globalHubContent);
34626
34628
  } catch {
34627
34629
  }
34628
34630
  return {
@@ -34802,6 +34804,7 @@ __export(scaffold_exports, {
34802
34804
  CLEO_GITIGNORE_FALLBACK: () => CLEO_GITIGNORE_FALLBACK,
34803
34805
  REQUIRED_CLEO_SUBDIRS: () => REQUIRED_CLEO_SUBDIRS,
34804
34806
  REQUIRED_GLOBAL_SUBDIRS: () => REQUIRED_GLOBAL_SUBDIRS,
34807
+ STALE_GLOBAL_ENTRIES: () => STALE_GLOBAL_ENTRIES,
34805
34808
  checkBrainDb: () => checkBrainDb,
34806
34809
  checkCleoGitRepo: () => checkCleoGitRepo,
34807
34810
  checkCleoStructure: () => checkCleoStructure,
@@ -34838,7 +34841,7 @@ __export(scaffold_exports, {
34838
34841
  import { execFile as execFile3 } from "node:child_process";
34839
34842
  import { randomUUID } from "node:crypto";
34840
34843
  import { existsSync as existsSync34, constants as fsConstants3, readFileSync as readFileSync22, statSync as statSync8 } from "node:fs";
34841
- import { access as access3, mkdir as mkdir5, readFile as readFile6, writeFile as writeFile5 } from "node:fs/promises";
34844
+ import { access as access3, mkdir as mkdir5, readFile as readFile6, rm as rm2, writeFile as writeFile5 } from "node:fs/promises";
34842
34845
  import { dirname as dirname8, join as join37, resolve as resolve5 } from "node:path";
34843
34846
  import { fileURLToPath as fileURLToPath4 } from "node:url";
34844
34847
  import { promisify as promisify3 } from "node:util";
@@ -34853,7 +34856,7 @@ async function fileExists(path2) {
34853
34856
  async function stripCLEOBlocks(filePath) {
34854
34857
  if (!existsSync34(filePath)) return;
34855
34858
  const content = await readFile6(filePath, "utf8");
34856
- const stripped = content.replace(/\n?<!-- CLEO:START -->[\s\S]*?<!-- CLEO:END -->\n?/g, "");
34859
+ const stripped = content.replace(/\n?<!-- CLEO:START[^>]*-->[\s\S]*?<!-- CLEO:END -->\n?/g, "");
34857
34860
  if (stripped !== content) await writeFile5(filePath, stripped, "utf8");
34858
34861
  }
34859
34862
  async function removeCleoFromRootGitignore(projectRoot) {
@@ -35130,7 +35133,7 @@ async function ensureProjectContext(projectRoot, opts) {
35130
35133
  try {
35131
35134
  const schemaPath = join37(
35132
35135
  dirname8(fileURLToPath4(import.meta.url)),
35133
- "../../schemas/project-context.schema.json"
35136
+ "../schemas/project-context.schema.json"
35134
35137
  );
35135
35138
  if (existsSync34(schemaPath)) {
35136
35139
  const AjvModule2 = await import("ajv");
@@ -35536,6 +35539,19 @@ async function ensureGlobalHome() {
35536
35539
  for (const subdir of REQUIRED_GLOBAL_SUBDIRS) {
35537
35540
  await mkdir5(join37(cleoHome, subdir), { recursive: true });
35538
35541
  }
35542
+ for (const stale of STALE_GLOBAL_ENTRIES) {
35543
+ const stalePath = join37(cleoHome, stale);
35544
+ if (existsSync34(stalePath)) {
35545
+ try {
35546
+ await rm2(stalePath, { recursive: true, force: true });
35547
+ console.warn(`[CLEO] Removed stale global entry: ${stalePath}`);
35548
+ } catch (err) {
35549
+ console.warn(
35550
+ `[CLEO] Could not remove stale global entry ${stalePath}: ${err instanceof Error ? err.message : String(err)}`
35551
+ );
35552
+ }
35553
+ }
35554
+ }
35539
35555
  return {
35540
35556
  action: alreadyExists ? "skipped" : "created",
35541
35557
  path: cleoHome,
@@ -35571,11 +35587,9 @@ async function ensureGlobalTemplates() {
35571
35587
  return { action: "created", path: injectionPath };
35572
35588
  }
35573
35589
  async function ensureGlobalScaffold() {
35574
- const { ensureGlobalSchemas: ensureGlobalSchemas2 } = await Promise.resolve().then(() => (init_schema_management(), schema_management_exports));
35575
35590
  const home = await ensureGlobalHome();
35576
- const schemas = ensureGlobalSchemas2();
35577
35591
  const templates2 = await ensureGlobalTemplates();
35578
- return { home, schemas, templates: templates2 };
35592
+ return { home, templates: templates2 };
35579
35593
  }
35580
35594
  function checkGlobalHome() {
35581
35595
  const cleoHome = getCleoHome();
@@ -35652,7 +35666,7 @@ function checkLogDir(projectRoot) {
35652
35666
  fix: null
35653
35667
  };
35654
35668
  }
35655
- var execFileAsync3, REQUIRED_CLEO_SUBDIRS, CLEO_GITIGNORE_FALLBACK, REQUIRED_GLOBAL_SUBDIRS;
35669
+ var execFileAsync3, REQUIRED_CLEO_SUBDIRS, CLEO_GITIGNORE_FALLBACK, REQUIRED_GLOBAL_SUBDIRS, STALE_GLOBAL_ENTRIES;
35656
35670
  var init_scaffold = __esm({
35657
35671
  "packages/core/src/scaffold.ts"() {
35658
35672
  "use strict";
@@ -35709,7 +35723,21 @@ metrics/
35709
35723
  .backups/
35710
35724
  backups/
35711
35725
  `;
35712
- REQUIRED_GLOBAL_SUBDIRS = ["schemas", "templates"];
35726
+ REQUIRED_GLOBAL_SUBDIRS = ["logs", "templates"];
35727
+ STALE_GLOBAL_ENTRIES = [
35728
+ "adrs",
35729
+ "rcasd",
35730
+ "agent-outputs",
35731
+ "backups",
35732
+ "sandbox",
35733
+ "tasks.db",
35734
+ "tasks.db-shm",
35735
+ "tasks.db-wal",
35736
+ "brain-worker.pid",
35737
+ "VERSION",
35738
+ "schemas",
35739
+ "bin"
35740
+ ];
35713
35741
  }
35714
35742
  });
35715
35743
 
@@ -39445,8 +39473,8 @@ function parseTokenMetrics(inputFile, cwd) {
39445
39473
  const raw = JSON.parse(readFileSync28(file2, "utf-8"));
39446
39474
  if (raw.resourceMetrics) {
39447
39475
  const points = [];
39448
- for (const rm3 of raw.resourceMetrics ?? []) {
39449
- for (const sm of rm3.scopeMetrics ?? []) {
39476
+ for (const rm4 of raw.resourceMetrics ?? []) {
39477
+ for (const sm of rm4.scopeMetrics ?? []) {
39450
39478
  for (const metric of sm.metrics ?? []) {
39451
39479
  if (metric.name !== "claude_code.token.usage") continue;
39452
39480
  for (const dp of metric.sum?.dataPoints ?? []) {
@@ -42219,10 +42247,10 @@ async function readProjectMeta(projectPath) {
42219
42247
  }
42220
42248
  async function readProjectId(projectPath) {
42221
42249
  try {
42222
- const { readFileSync: readFileSync97, existsSync: existsSync122 } = await import("node:fs");
42250
+ const { readFileSync: readFileSync98, existsSync: existsSync122 } = await import("node:fs");
42223
42251
  const infoPath = join57(projectPath, ".cleo", "project-info.json");
42224
42252
  if (!existsSync122(infoPath)) return "";
42225
- const data = JSON.parse(readFileSync97(infoPath, "utf-8"));
42253
+ const data = JSON.parse(readFileSync98(infoPath, "utf-8"));
42226
42254
  return typeof data.projectId === "string" ? data.projectId : "";
42227
42255
  } catch {
42228
42256
  return "";
@@ -46879,8 +46907,8 @@ var init_release_config = __esm({
46879
46907
  // packages/core/src/release/ci.ts
46880
46908
  import { existsSync as existsSync60, mkdirSync as mkdirSync12, readFileSync as readFileSync42, writeFileSync as writeFileSync6 } from "node:fs";
46881
46909
  import { dirname as dirname13, join as join63 } from "node:path";
46882
- function getPlatformPath(platform3) {
46883
- return PLATFORM_PATHS[platform3];
46910
+ function getPlatformPath(platform5) {
46911
+ return PLATFORM_PATHS[platform5];
46884
46912
  }
46885
46913
  function detectCIPlatform(projectDir) {
46886
46914
  const dir = projectDir ?? process.cwd();
@@ -46974,10 +47002,10 @@ workflows:
46974
47002
  only: /^v.*/
46975
47003
  `;
46976
47004
  }
46977
- function generateCIConfig(platform3, cwd) {
47005
+ function generateCIConfig(platform5, cwd) {
46978
47006
  const releaseConfig = loadReleaseConfig(cwd);
46979
47007
  const gates = releaseConfig.gates.map((g) => ({ name: g.name, command: g.command }));
46980
- switch (platform3) {
47008
+ switch (platform5) {
46981
47009
  case "github-actions":
46982
47010
  return generateGitHubActions({ gates });
46983
47011
  case "gitlab-ci":
@@ -46986,10 +47014,10 @@ function generateCIConfig(platform3, cwd) {
46986
47014
  return generateCircleCI({ gates });
46987
47015
  }
46988
47016
  }
46989
- function writeCIConfig(platform3, options = {}) {
47017
+ function writeCIConfig(platform5, options = {}) {
46990
47018
  const projectDir = options.projectDir ?? process.cwd();
46991
- const outputPath = join63(projectDir, getPlatformPath(platform3));
46992
- const content = generateCIConfig(platform3, projectDir);
47019
+ const outputPath = join63(projectDir, getPlatformPath(platform5));
47020
+ const content = generateCIConfig(platform5, projectDir);
46993
47021
  if (options.dryRun) {
46994
47022
  return { action: "would_write", path: outputPath, content };
46995
47023
  }
@@ -46997,9 +47025,9 @@ function writeCIConfig(platform3, options = {}) {
46997
47025
  writeFileSync6(outputPath, content, "utf-8");
46998
47026
  return { action: "wrote", path: outputPath, content };
46999
47027
  }
47000
- function validateCIConfig(platform3, projectDir) {
47028
+ function validateCIConfig(platform5, projectDir) {
47001
47029
  const dir = projectDir ?? process.cwd();
47002
- const configPath = join63(dir, getPlatformPath(platform3));
47030
+ const configPath = join63(dir, getPlatformPath(platform5));
47003
47031
  if (!existsSync60(configPath)) {
47004
47032
  return { valid: false, exists: false, errors: ["Config file not found"] };
47005
47033
  }
@@ -48702,239 +48730,1463 @@ var init_capability_matrix = __esm({
48702
48730
  CAPABILITY_MATRIX = [
48703
48731
  // === Tasks Domain ===
48704
48732
  // Query operations
48705
- { domain: "tasks", operation: "show", gateway: "query", mode: "native" },
48706
- { domain: "tasks", operation: "list", gateway: "query", mode: "native" },
48707
- { domain: "tasks", operation: "find", gateway: "query", mode: "native" },
48708
- { domain: "tasks", operation: "tree", gateway: "query", mode: "native" },
48709
- { domain: "tasks", operation: "blockers", gateway: "query", mode: "native" },
48710
- { domain: "tasks", operation: "depends", gateway: "query", mode: "native" },
48711
- { domain: "tasks", operation: "analyze", gateway: "query", mode: "native" },
48712
- { domain: "tasks", operation: "next", gateway: "query", mode: "native" },
48713
- { domain: "tasks", operation: "plan", gateway: "query", mode: "native" },
48714
- { domain: "tasks", operation: "relates", gateway: "query", mode: "native" },
48715
- { domain: "tasks", operation: "complexity.estimate", gateway: "query", mode: "native" },
48716
- { domain: "tasks", operation: "history", gateway: "query", mode: "native" },
48717
- { domain: "tasks", operation: "current", gateway: "query", mode: "native" },
48718
- { domain: "tasks", operation: "label.list", gateway: "query", mode: "native" },
48733
+ { domain: "tasks", operation: "show", gateway: "query", mode: "native", preferredChannel: "mcp" },
48734
+ { domain: "tasks", operation: "list", gateway: "query", mode: "native", preferredChannel: "mcp" },
48735
+ { domain: "tasks", operation: "find", gateway: "query", mode: "native", preferredChannel: "mcp" },
48736
+ {
48737
+ domain: "tasks",
48738
+ operation: "tree",
48739
+ gateway: "query",
48740
+ mode: "native",
48741
+ preferredChannel: "either"
48742
+ },
48743
+ {
48744
+ domain: "tasks",
48745
+ operation: "blockers",
48746
+ gateway: "query",
48747
+ mode: "native",
48748
+ preferredChannel: "either"
48749
+ },
48750
+ {
48751
+ domain: "tasks",
48752
+ operation: "depends",
48753
+ gateway: "query",
48754
+ mode: "native",
48755
+ preferredChannel: "either"
48756
+ },
48757
+ {
48758
+ domain: "tasks",
48759
+ operation: "analyze",
48760
+ gateway: "query",
48761
+ mode: "native",
48762
+ preferredChannel: "either"
48763
+ },
48764
+ { domain: "tasks", operation: "next", gateway: "query", mode: "native", preferredChannel: "mcp" },
48765
+ { domain: "tasks", operation: "plan", gateway: "query", mode: "native", preferredChannel: "mcp" },
48766
+ {
48767
+ domain: "tasks",
48768
+ operation: "relates",
48769
+ gateway: "query",
48770
+ mode: "native",
48771
+ preferredChannel: "either"
48772
+ },
48773
+ {
48774
+ domain: "tasks",
48775
+ operation: "complexity.estimate",
48776
+ gateway: "query",
48777
+ mode: "native",
48778
+ preferredChannel: "either"
48779
+ },
48780
+ {
48781
+ domain: "tasks",
48782
+ operation: "history",
48783
+ gateway: "query",
48784
+ mode: "native",
48785
+ preferredChannel: "either"
48786
+ },
48787
+ {
48788
+ domain: "tasks",
48789
+ operation: "current",
48790
+ gateway: "query",
48791
+ mode: "native",
48792
+ preferredChannel: "mcp"
48793
+ },
48794
+ {
48795
+ domain: "tasks",
48796
+ operation: "label.list",
48797
+ gateway: "query",
48798
+ mode: "native",
48799
+ preferredChannel: "either"
48800
+ },
48719
48801
  // Mutate operations
48720
- { domain: "tasks", operation: "add", gateway: "mutate", mode: "native" },
48721
- { domain: "tasks", operation: "update", gateway: "mutate", mode: "native" },
48722
- { domain: "tasks", operation: "complete", gateway: "mutate", mode: "native" },
48723
- { domain: "tasks", operation: "cancel", gateway: "mutate", mode: "native" },
48724
- { domain: "tasks", operation: "delete", gateway: "mutate", mode: "native" },
48725
- { domain: "tasks", operation: "archive", gateway: "mutate", mode: "native" },
48726
- { domain: "tasks", operation: "restore", gateway: "mutate", mode: "native" },
48727
- { domain: "tasks", operation: "reparent", gateway: "mutate", mode: "native" },
48728
- { domain: "tasks", operation: "reorder", gateway: "mutate", mode: "native" },
48729
- { domain: "tasks", operation: "relates.add", gateway: "mutate", mode: "native" },
48730
- { domain: "tasks", operation: "start", gateway: "mutate", mode: "native" },
48731
- { domain: "tasks", operation: "stop", gateway: "mutate", mode: "native" },
48802
+ { domain: "tasks", operation: "add", gateway: "mutate", mode: "native", preferredChannel: "mcp" },
48803
+ {
48804
+ domain: "tasks",
48805
+ operation: "update",
48806
+ gateway: "mutate",
48807
+ mode: "native",
48808
+ preferredChannel: "mcp"
48809
+ },
48810
+ {
48811
+ domain: "tasks",
48812
+ operation: "complete",
48813
+ gateway: "mutate",
48814
+ mode: "native",
48815
+ preferredChannel: "mcp"
48816
+ },
48817
+ {
48818
+ domain: "tasks",
48819
+ operation: "cancel",
48820
+ gateway: "mutate",
48821
+ mode: "native",
48822
+ preferredChannel: "either"
48823
+ },
48824
+ {
48825
+ domain: "tasks",
48826
+ operation: "delete",
48827
+ gateway: "mutate",
48828
+ mode: "native",
48829
+ preferredChannel: "either"
48830
+ },
48831
+ {
48832
+ domain: "tasks",
48833
+ operation: "archive",
48834
+ gateway: "mutate",
48835
+ mode: "native",
48836
+ preferredChannel: "either"
48837
+ },
48838
+ {
48839
+ domain: "tasks",
48840
+ operation: "restore",
48841
+ gateway: "mutate",
48842
+ mode: "native",
48843
+ preferredChannel: "either"
48844
+ },
48845
+ {
48846
+ domain: "tasks",
48847
+ operation: "reparent",
48848
+ gateway: "mutate",
48849
+ mode: "native",
48850
+ preferredChannel: "either"
48851
+ },
48852
+ {
48853
+ domain: "tasks",
48854
+ operation: "reorder",
48855
+ gateway: "mutate",
48856
+ mode: "native",
48857
+ preferredChannel: "either"
48858
+ },
48859
+ {
48860
+ domain: "tasks",
48861
+ operation: "relates.add",
48862
+ gateway: "mutate",
48863
+ mode: "native",
48864
+ preferredChannel: "either"
48865
+ },
48866
+ {
48867
+ domain: "tasks",
48868
+ operation: "start",
48869
+ gateway: "mutate",
48870
+ mode: "native",
48871
+ preferredChannel: "mcp"
48872
+ },
48873
+ {
48874
+ domain: "tasks",
48875
+ operation: "stop",
48876
+ gateway: "mutate",
48877
+ mode: "native",
48878
+ preferredChannel: "mcp"
48879
+ },
48732
48880
  // Sync sub-domain (provider-agnostic task reconciliation)
48733
- { domain: "tasks", operation: "sync.reconcile", gateway: "mutate", mode: "native" },
48734
- { domain: "tasks", operation: "sync.links", gateway: "query", mode: "native" },
48735
- { domain: "tasks", operation: "sync.links.remove", gateway: "mutate", mode: "native" },
48881
+ {
48882
+ domain: "tasks",
48883
+ operation: "sync.reconcile",
48884
+ gateway: "mutate",
48885
+ mode: "native",
48886
+ preferredChannel: "either"
48887
+ },
48888
+ {
48889
+ domain: "tasks",
48890
+ operation: "sync.links",
48891
+ gateway: "query",
48892
+ mode: "native",
48893
+ preferredChannel: "either"
48894
+ },
48895
+ {
48896
+ domain: "tasks",
48897
+ operation: "sync.links.remove",
48898
+ gateway: "mutate",
48899
+ mode: "native",
48900
+ preferredChannel: "either"
48901
+ },
48736
48902
  // === Session Domain ===
48737
48903
  // Query operations
48738
- { domain: "session", operation: "status", gateway: "query", mode: "native" },
48739
- { domain: "session", operation: "list", gateway: "query", mode: "native" },
48740
- { domain: "session", operation: "show", gateway: "query", mode: "native" },
48741
- { domain: "session", operation: "decision.log", gateway: "query", mode: "native" },
48742
- { domain: "session", operation: "context.drift", gateway: "query", mode: "native" },
48743
- { domain: "session", operation: "handoff.show", gateway: "query", mode: "native" },
48744
- { domain: "session", operation: "briefing.show", gateway: "query", mode: "native" },
48745
- { domain: "session", operation: "find", gateway: "query", mode: "native" },
48904
+ {
48905
+ domain: "session",
48906
+ operation: "status",
48907
+ gateway: "query",
48908
+ mode: "native",
48909
+ preferredChannel: "mcp"
48910
+ },
48911
+ {
48912
+ domain: "session",
48913
+ operation: "list",
48914
+ gateway: "query",
48915
+ mode: "native",
48916
+ preferredChannel: "either"
48917
+ },
48918
+ {
48919
+ domain: "session",
48920
+ operation: "show",
48921
+ gateway: "query",
48922
+ mode: "native",
48923
+ preferredChannel: "either"
48924
+ },
48925
+ {
48926
+ domain: "session",
48927
+ operation: "decision.log",
48928
+ gateway: "query",
48929
+ mode: "native",
48930
+ preferredChannel: "either"
48931
+ },
48932
+ {
48933
+ domain: "session",
48934
+ operation: "context.drift",
48935
+ gateway: "query",
48936
+ mode: "native",
48937
+ preferredChannel: "either"
48938
+ },
48939
+ {
48940
+ domain: "session",
48941
+ operation: "handoff.show",
48942
+ gateway: "query",
48943
+ mode: "native",
48944
+ preferredChannel: "mcp"
48945
+ },
48946
+ {
48947
+ domain: "session",
48948
+ operation: "briefing.show",
48949
+ gateway: "query",
48950
+ mode: "native",
48951
+ preferredChannel: "mcp"
48952
+ },
48953
+ {
48954
+ domain: "session",
48955
+ operation: "find",
48956
+ gateway: "query",
48957
+ mode: "native",
48958
+ preferredChannel: "either"
48959
+ },
48746
48960
  // Mutate operations
48747
- { domain: "session", operation: "start", gateway: "mutate", mode: "native" },
48748
- { domain: "session", operation: "end", gateway: "mutate", mode: "native" },
48749
- { domain: "session", operation: "resume", gateway: "mutate", mode: "native" },
48750
- { domain: "session", operation: "suspend", gateway: "mutate", mode: "native" },
48751
- { domain: "session", operation: "gc", gateway: "mutate", mode: "native" },
48752
- { domain: "session", operation: "record.decision", gateway: "mutate", mode: "native" },
48753
- { domain: "session", operation: "record.assumption", gateway: "mutate", mode: "native" },
48961
+ {
48962
+ domain: "session",
48963
+ operation: "start",
48964
+ gateway: "mutate",
48965
+ mode: "native",
48966
+ preferredChannel: "mcp"
48967
+ },
48968
+ {
48969
+ domain: "session",
48970
+ operation: "end",
48971
+ gateway: "mutate",
48972
+ mode: "native",
48973
+ preferredChannel: "mcp"
48974
+ },
48975
+ {
48976
+ domain: "session",
48977
+ operation: "resume",
48978
+ gateway: "mutate",
48979
+ mode: "native",
48980
+ preferredChannel: "either"
48981
+ },
48982
+ {
48983
+ domain: "session",
48984
+ operation: "suspend",
48985
+ gateway: "mutate",
48986
+ mode: "native",
48987
+ preferredChannel: "either"
48988
+ },
48989
+ {
48990
+ domain: "session",
48991
+ operation: "gc",
48992
+ gateway: "mutate",
48993
+ mode: "native",
48994
+ preferredChannel: "either"
48995
+ },
48996
+ {
48997
+ domain: "session",
48998
+ operation: "record.decision",
48999
+ gateway: "mutate",
49000
+ mode: "native",
49001
+ preferredChannel: "either"
49002
+ },
49003
+ {
49004
+ domain: "session",
49005
+ operation: "record.assumption",
49006
+ gateway: "mutate",
49007
+ mode: "native",
49008
+ preferredChannel: "either"
49009
+ },
48754
49010
  // === Admin Domain ===
48755
49011
  // Query operations
48756
- { domain: "admin", operation: "version", gateway: "query", mode: "native" },
48757
- { domain: "admin", operation: "health", gateway: "query", mode: "native" },
48758
- { domain: "admin", operation: "config.show", gateway: "query", mode: "native" },
48759
- { domain: "admin", operation: "stats", gateway: "query", mode: "native" },
48760
- { domain: "admin", operation: "context", gateway: "query", mode: "native" },
48761
- { domain: "admin", operation: "runtime", gateway: "query", mode: "native" },
48762
- { domain: "admin", operation: "job", gateway: "query", mode: "native" },
48763
- { domain: "admin", operation: "dash", gateway: "query", mode: "native" },
48764
- { domain: "admin", operation: "log", gateway: "query", mode: "native" },
48765
- { domain: "admin", operation: "sequence", gateway: "query", mode: "native" },
48766
- { domain: "admin", operation: "help", gateway: "query", mode: "native" },
48767
- { domain: "admin", operation: "token", gateway: "query", mode: "native" },
48768
- { domain: "admin", operation: "export", gateway: "query", mode: "native" },
48769
- { domain: "admin", operation: "adr.show", gateway: "query", mode: "native" },
48770
- { domain: "admin", operation: "adr.find", gateway: "query", mode: "native" },
49012
+ {
49013
+ domain: "admin",
49014
+ operation: "version",
49015
+ gateway: "query",
49016
+ mode: "native",
49017
+ preferredChannel: "either"
49018
+ },
49019
+ {
49020
+ domain: "admin",
49021
+ operation: "health",
49022
+ gateway: "query",
49023
+ mode: "native",
49024
+ preferredChannel: "either"
49025
+ },
49026
+ {
49027
+ domain: "admin",
49028
+ operation: "config.show",
49029
+ gateway: "query",
49030
+ mode: "native",
49031
+ preferredChannel: "either"
49032
+ },
49033
+ {
49034
+ domain: "admin",
49035
+ operation: "stats",
49036
+ gateway: "query",
49037
+ mode: "native",
49038
+ preferredChannel: "either"
49039
+ },
49040
+ {
49041
+ domain: "admin",
49042
+ operation: "context",
49043
+ gateway: "query",
49044
+ mode: "native",
49045
+ preferredChannel: "either"
49046
+ },
49047
+ {
49048
+ domain: "admin",
49049
+ operation: "runtime",
49050
+ gateway: "query",
49051
+ mode: "native",
49052
+ preferredChannel: "either"
49053
+ },
49054
+ {
49055
+ domain: "admin",
49056
+ operation: "job",
49057
+ gateway: "query",
49058
+ mode: "native",
49059
+ preferredChannel: "either"
49060
+ },
49061
+ { domain: "admin", operation: "dash", gateway: "query", mode: "native", preferredChannel: "mcp" },
49062
+ {
49063
+ domain: "admin",
49064
+ operation: "log",
49065
+ gateway: "query",
49066
+ mode: "native",
49067
+ preferredChannel: "either"
49068
+ },
49069
+ {
49070
+ domain: "admin",
49071
+ operation: "sequence",
49072
+ gateway: "query",
49073
+ mode: "native",
49074
+ preferredChannel: "either"
49075
+ },
49076
+ { domain: "admin", operation: "help", gateway: "query", mode: "native", preferredChannel: "mcp" },
49077
+ {
49078
+ domain: "admin",
49079
+ operation: "token",
49080
+ gateway: "query",
49081
+ mode: "native",
49082
+ preferredChannel: "either"
49083
+ },
49084
+ {
49085
+ domain: "admin",
49086
+ operation: "export",
49087
+ gateway: "query",
49088
+ mode: "native",
49089
+ preferredChannel: "either"
49090
+ },
49091
+ {
49092
+ domain: "admin",
49093
+ operation: "adr.show",
49094
+ gateway: "query",
49095
+ mode: "native",
49096
+ preferredChannel: "either"
49097
+ },
49098
+ {
49099
+ domain: "admin",
49100
+ operation: "adr.find",
49101
+ gateway: "query",
49102
+ mode: "native",
49103
+ preferredChannel: "either"
49104
+ },
49105
+ { domain: "admin", operation: "map", gateway: "query", mode: "native", preferredChannel: "mcp" },
48771
49106
  // Mutate operations
48772
- { domain: "admin", operation: "init", gateway: "mutate", mode: "native" },
48773
- { domain: "admin", operation: "config.set", gateway: "mutate", mode: "native" },
48774
- { domain: "admin", operation: "backup", gateway: "mutate", mode: "native" },
48775
- { domain: "admin", operation: "migrate", gateway: "mutate", mode: "native" },
48776
- { domain: "admin", operation: "cleanup", gateway: "mutate", mode: "native" },
48777
- { domain: "admin", operation: "safestop", gateway: "mutate", mode: "native" },
48778
- { domain: "admin", operation: "inject.generate", gateway: "mutate", mode: "native" },
48779
- { domain: "admin", operation: "job.cancel", gateway: "mutate", mode: "native" },
48780
- { domain: "admin", operation: "install.global", gateway: "mutate", mode: "native" },
48781
- { domain: "admin", operation: "token", gateway: "mutate", mode: "native" },
48782
- { domain: "admin", operation: "health", gateway: "mutate", mode: "native" },
48783
- { domain: "admin", operation: "detect", gateway: "mutate", mode: "native" },
48784
- { domain: "admin", operation: "import", gateway: "mutate", mode: "native" },
48785
- { domain: "admin", operation: "context.inject", gateway: "mutate", mode: "native" },
48786
- { domain: "admin", operation: "adr.sync", gateway: "mutate", mode: "native" },
49107
+ {
49108
+ domain: "admin",
49109
+ operation: "init",
49110
+ gateway: "mutate",
49111
+ mode: "native",
49112
+ preferredChannel: "either"
49113
+ },
49114
+ {
49115
+ domain: "admin",
49116
+ operation: "config.set",
49117
+ gateway: "mutate",
49118
+ mode: "native",
49119
+ preferredChannel: "either"
49120
+ },
49121
+ {
49122
+ domain: "admin",
49123
+ operation: "backup",
49124
+ gateway: "mutate",
49125
+ mode: "native",
49126
+ preferredChannel: "either"
49127
+ },
49128
+ {
49129
+ domain: "admin",
49130
+ operation: "migrate",
49131
+ gateway: "mutate",
49132
+ mode: "native",
49133
+ preferredChannel: "either"
49134
+ },
49135
+ {
49136
+ domain: "admin",
49137
+ operation: "cleanup",
49138
+ gateway: "mutate",
49139
+ mode: "native",
49140
+ preferredChannel: "either"
49141
+ },
49142
+ {
49143
+ domain: "admin",
49144
+ operation: "safestop",
49145
+ gateway: "mutate",
49146
+ mode: "native",
49147
+ preferredChannel: "either"
49148
+ },
49149
+ {
49150
+ domain: "admin",
49151
+ operation: "inject.generate",
49152
+ gateway: "mutate",
49153
+ mode: "native",
49154
+ preferredChannel: "either"
49155
+ },
49156
+ {
49157
+ domain: "admin",
49158
+ operation: "job.cancel",
49159
+ gateway: "mutate",
49160
+ mode: "native",
49161
+ preferredChannel: "either"
49162
+ },
49163
+ {
49164
+ domain: "admin",
49165
+ operation: "install.global",
49166
+ gateway: "mutate",
49167
+ mode: "native",
49168
+ preferredChannel: "either"
49169
+ },
49170
+ {
49171
+ domain: "admin",
49172
+ operation: "token",
49173
+ gateway: "mutate",
49174
+ mode: "native",
49175
+ preferredChannel: "either"
49176
+ },
49177
+ {
49178
+ domain: "admin",
49179
+ operation: "health",
49180
+ gateway: "mutate",
49181
+ mode: "native",
49182
+ preferredChannel: "either"
49183
+ },
49184
+ {
49185
+ domain: "admin",
49186
+ operation: "detect",
49187
+ gateway: "mutate",
49188
+ mode: "native",
49189
+ preferredChannel: "either"
49190
+ },
49191
+ {
49192
+ domain: "admin",
49193
+ operation: "import",
49194
+ gateway: "mutate",
49195
+ mode: "native",
49196
+ preferredChannel: "either"
49197
+ },
49198
+ {
49199
+ domain: "admin",
49200
+ operation: "context.inject",
49201
+ gateway: "mutate",
49202
+ mode: "native",
49203
+ preferredChannel: "either"
49204
+ },
49205
+ {
49206
+ domain: "admin",
49207
+ operation: "adr.sync",
49208
+ gateway: "mutate",
49209
+ mode: "native",
49210
+ preferredChannel: "either"
49211
+ },
49212
+ {
49213
+ domain: "admin",
49214
+ operation: "map",
49215
+ gateway: "mutate",
49216
+ mode: "native",
49217
+ preferredChannel: "either"
49218
+ },
48787
49219
  // === Check Domain ===
48788
49220
  // Query operations
48789
- { domain: "check", operation: "schema", gateway: "query", mode: "native" },
48790
- { domain: "check", operation: "protocol", gateway: "query", mode: "native" },
48791
- { domain: "check", operation: "task", gateway: "query", mode: "native" },
48792
- { domain: "check", operation: "manifest", gateway: "query", mode: "native" },
48793
- { domain: "check", operation: "output", gateway: "query", mode: "native" },
48794
- { domain: "check", operation: "compliance.summary", gateway: "query", mode: "native" },
48795
- { domain: "check", operation: "test", gateway: "query", mode: "native" },
48796
- { domain: "check", operation: "coherence", gateway: "query", mode: "native" },
48797
- { domain: "check", operation: "gate.status", gateway: "query", mode: "native" },
48798
- { domain: "check", operation: "archive.stats", gateway: "query", mode: "native" },
48799
- { domain: "check", operation: "grade", gateway: "query", mode: "native" },
48800
- { domain: "check", operation: "grade.list", gateway: "query", mode: "native" },
48801
- { domain: "check", operation: "chain.validate", gateway: "query", mode: "native" },
49221
+ {
49222
+ domain: "check",
49223
+ operation: "schema",
49224
+ gateway: "query",
49225
+ mode: "native",
49226
+ preferredChannel: "either"
49227
+ },
49228
+ {
49229
+ domain: "check",
49230
+ operation: "protocol",
49231
+ gateway: "query",
49232
+ mode: "native",
49233
+ preferredChannel: "either"
49234
+ },
49235
+ {
49236
+ domain: "check",
49237
+ operation: "task",
49238
+ gateway: "query",
49239
+ mode: "native",
49240
+ preferredChannel: "either"
49241
+ },
49242
+ {
49243
+ domain: "check",
49244
+ operation: "manifest",
49245
+ gateway: "query",
49246
+ mode: "native",
49247
+ preferredChannel: "either"
49248
+ },
49249
+ {
49250
+ domain: "check",
49251
+ operation: "output",
49252
+ gateway: "query",
49253
+ mode: "native",
49254
+ preferredChannel: "either"
49255
+ },
49256
+ {
49257
+ domain: "check",
49258
+ operation: "compliance.summary",
49259
+ gateway: "query",
49260
+ mode: "native",
49261
+ preferredChannel: "mcp"
49262
+ },
49263
+ {
49264
+ domain: "check",
49265
+ operation: "test",
49266
+ gateway: "query",
49267
+ mode: "native",
49268
+ preferredChannel: "either"
49269
+ },
49270
+ {
49271
+ domain: "check",
49272
+ operation: "coherence",
49273
+ gateway: "query",
49274
+ mode: "native",
49275
+ preferredChannel: "either"
49276
+ },
49277
+ {
49278
+ domain: "check",
49279
+ operation: "gate.status",
49280
+ gateway: "query",
49281
+ mode: "native",
49282
+ preferredChannel: "either"
49283
+ },
49284
+ {
49285
+ domain: "check",
49286
+ operation: "archive.stats",
49287
+ gateway: "query",
49288
+ mode: "native",
49289
+ preferredChannel: "either"
49290
+ },
49291
+ {
49292
+ domain: "check",
49293
+ operation: "grade",
49294
+ gateway: "query",
49295
+ mode: "native",
49296
+ preferredChannel: "either"
49297
+ },
49298
+ {
49299
+ domain: "check",
49300
+ operation: "grade.list",
49301
+ gateway: "query",
49302
+ mode: "native",
49303
+ preferredChannel: "either"
49304
+ },
49305
+ {
49306
+ domain: "check",
49307
+ operation: "chain.validate",
49308
+ gateway: "query",
49309
+ mode: "native",
49310
+ preferredChannel: "either"
49311
+ },
48802
49312
  // Mutate operations
48803
- { domain: "check", operation: "compliance.record", gateway: "mutate", mode: "native" },
48804
- { domain: "check", operation: "test.run", gateway: "mutate", mode: "native" },
48805
- { domain: "check", operation: "gate.set", gateway: "mutate", mode: "native" },
49313
+ {
49314
+ domain: "check",
49315
+ operation: "compliance.record",
49316
+ gateway: "mutate",
49317
+ mode: "native",
49318
+ preferredChannel: "mcp"
49319
+ },
49320
+ {
49321
+ domain: "check",
49322
+ operation: "test.run",
49323
+ gateway: "mutate",
49324
+ mode: "native",
49325
+ preferredChannel: "either"
49326
+ },
49327
+ {
49328
+ domain: "check",
49329
+ operation: "gate.set",
49330
+ gateway: "mutate",
49331
+ mode: "native",
49332
+ preferredChannel: "either"
49333
+ },
49334
+ {
49335
+ domain: "check",
49336
+ operation: "compliance.sync",
49337
+ gateway: "mutate",
49338
+ mode: "native",
49339
+ preferredChannel: "either"
49340
+ },
48806
49341
  // === Orchestrate Domain ===
48807
49342
  // Query operations
48808
- { domain: "orchestrate", operation: "status", gateway: "query", mode: "native" },
48809
- { domain: "orchestrate", operation: "next", gateway: "query", mode: "native" },
48810
- { domain: "orchestrate", operation: "ready", gateway: "query", mode: "native" },
48811
- { domain: "orchestrate", operation: "analyze", gateway: "query", mode: "native" },
48812
- { domain: "orchestrate", operation: "context", gateway: "query", mode: "native" },
48813
- { domain: "orchestrate", operation: "waves", gateway: "query", mode: "native" },
48814
- { domain: "orchestrate", operation: "bootstrap", gateway: "query", mode: "native" },
48815
- { domain: "orchestrate", operation: "unblock.opportunities", gateway: "query", mode: "native" },
48816
- { domain: "orchestrate", operation: "tessera.list", gateway: "query", mode: "native" },
49343
+ {
49344
+ domain: "orchestrate",
49345
+ operation: "status",
49346
+ gateway: "query",
49347
+ mode: "native",
49348
+ preferredChannel: "either"
49349
+ },
49350
+ {
49351
+ domain: "orchestrate",
49352
+ operation: "next",
49353
+ gateway: "query",
49354
+ mode: "native",
49355
+ preferredChannel: "either"
49356
+ },
49357
+ {
49358
+ domain: "orchestrate",
49359
+ operation: "ready",
49360
+ gateway: "query",
49361
+ mode: "native",
49362
+ preferredChannel: "either"
49363
+ },
49364
+ {
49365
+ domain: "orchestrate",
49366
+ operation: "analyze",
49367
+ gateway: "query",
49368
+ mode: "native",
49369
+ preferredChannel: "either"
49370
+ },
49371
+ {
49372
+ domain: "orchestrate",
49373
+ operation: "context",
49374
+ gateway: "query",
49375
+ mode: "native",
49376
+ preferredChannel: "either"
49377
+ },
49378
+ {
49379
+ domain: "orchestrate",
49380
+ operation: "waves",
49381
+ gateway: "query",
49382
+ mode: "native",
49383
+ preferredChannel: "either"
49384
+ },
49385
+ {
49386
+ domain: "orchestrate",
49387
+ operation: "bootstrap",
49388
+ gateway: "query",
49389
+ mode: "native",
49390
+ preferredChannel: "either"
49391
+ },
49392
+ {
49393
+ domain: "orchestrate",
49394
+ operation: "unblock.opportunities",
49395
+ gateway: "query",
49396
+ mode: "native",
49397
+ preferredChannel: "either"
49398
+ },
49399
+ {
49400
+ domain: "orchestrate",
49401
+ operation: "tessera.list",
49402
+ gateway: "query",
49403
+ mode: "native",
49404
+ preferredChannel: "either"
49405
+ },
48817
49406
  // Mutate operations
48818
- { domain: "orchestrate", operation: "start", gateway: "mutate", mode: "native" },
48819
- { domain: "orchestrate", operation: "spawn", gateway: "mutate", mode: "native" },
48820
- { domain: "orchestrate", operation: "handoff", gateway: "mutate", mode: "native" },
48821
- { domain: "orchestrate", operation: "spawn.execute", gateway: "mutate", mode: "native" },
48822
- { domain: "orchestrate", operation: "validate", gateway: "mutate", mode: "native" },
48823
- { domain: "orchestrate", operation: "parallel", gateway: "mutate", mode: "native" },
48824
- { domain: "orchestrate", operation: "tessera.instantiate", gateway: "mutate", mode: "native" },
49407
+ {
49408
+ domain: "orchestrate",
49409
+ operation: "start",
49410
+ gateway: "mutate",
49411
+ mode: "native",
49412
+ preferredChannel: "either"
49413
+ },
49414
+ {
49415
+ domain: "orchestrate",
49416
+ operation: "spawn",
49417
+ gateway: "mutate",
49418
+ mode: "native",
49419
+ preferredChannel: "mcp"
49420
+ },
49421
+ {
49422
+ domain: "orchestrate",
49423
+ operation: "handoff",
49424
+ gateway: "mutate",
49425
+ mode: "native",
49426
+ preferredChannel: "either"
49427
+ },
49428
+ {
49429
+ domain: "orchestrate",
49430
+ operation: "spawn.execute",
49431
+ gateway: "mutate",
49432
+ mode: "native",
49433
+ preferredChannel: "either"
49434
+ },
49435
+ {
49436
+ domain: "orchestrate",
49437
+ operation: "validate",
49438
+ gateway: "mutate",
49439
+ mode: "native",
49440
+ preferredChannel: "either"
49441
+ },
49442
+ {
49443
+ domain: "orchestrate",
49444
+ operation: "parallel",
49445
+ gateway: "mutate",
49446
+ mode: "native",
49447
+ preferredChannel: "either"
49448
+ },
49449
+ {
49450
+ domain: "orchestrate",
49451
+ operation: "tessera.instantiate",
49452
+ gateway: "mutate",
49453
+ mode: "native",
49454
+ preferredChannel: "either"
49455
+ },
48825
49456
  // === Memory Domain (brain.db cognitive memory -- T5241) ===
48826
49457
  // Query operations
48827
- { domain: "memory", operation: "find", gateway: "query", mode: "native" },
48828
- { domain: "memory", operation: "timeline", gateway: "query", mode: "native" },
48829
- { domain: "memory", operation: "fetch", gateway: "query", mode: "native" },
48830
- { domain: "memory", operation: "decision.find", gateway: "query", mode: "native" },
48831
- { domain: "memory", operation: "pattern.find", gateway: "query", mode: "native" },
48832
- { domain: "memory", operation: "learning.find", gateway: "query", mode: "native" },
48833
- { domain: "memory", operation: "graph.show", gateway: "query", mode: "native" },
48834
- { domain: "memory", operation: "graph.neighbors", gateway: "query", mode: "native" },
48835
- { domain: "memory", operation: "reason.why", gateway: "query", mode: "native" },
48836
- { domain: "memory", operation: "reason.similar", gateway: "query", mode: "native" },
48837
- { domain: "memory", operation: "search.hybrid", gateway: "query", mode: "native" },
49458
+ {
49459
+ domain: "memory",
49460
+ operation: "find",
49461
+ gateway: "query",
49462
+ mode: "native",
49463
+ preferredChannel: "mcp"
49464
+ },
49465
+ {
49466
+ domain: "memory",
49467
+ operation: "timeline",
49468
+ gateway: "query",
49469
+ mode: "native",
49470
+ preferredChannel: "mcp"
49471
+ },
49472
+ {
49473
+ domain: "memory",
49474
+ operation: "fetch",
49475
+ gateway: "query",
49476
+ mode: "native",
49477
+ preferredChannel: "mcp"
49478
+ },
49479
+ {
49480
+ domain: "memory",
49481
+ operation: "decision.find",
49482
+ gateway: "query",
49483
+ mode: "native",
49484
+ preferredChannel: "mcp"
49485
+ },
49486
+ {
49487
+ domain: "memory",
49488
+ operation: "pattern.find",
49489
+ gateway: "query",
49490
+ mode: "native",
49491
+ preferredChannel: "mcp"
49492
+ },
49493
+ {
49494
+ domain: "memory",
49495
+ operation: "learning.find",
49496
+ gateway: "query",
49497
+ mode: "native",
49498
+ preferredChannel: "mcp"
49499
+ },
49500
+ {
49501
+ domain: "memory",
49502
+ operation: "graph.show",
49503
+ gateway: "query",
49504
+ mode: "native",
49505
+ preferredChannel: "either"
49506
+ },
49507
+ {
49508
+ domain: "memory",
49509
+ operation: "graph.neighbors",
49510
+ gateway: "query",
49511
+ mode: "native",
49512
+ preferredChannel: "either"
49513
+ },
49514
+ {
49515
+ domain: "memory",
49516
+ operation: "reason.why",
49517
+ gateway: "query",
49518
+ mode: "native",
49519
+ preferredChannel: "either"
49520
+ },
49521
+ {
49522
+ domain: "memory",
49523
+ operation: "reason.similar",
49524
+ gateway: "query",
49525
+ mode: "native",
49526
+ preferredChannel: "either"
49527
+ },
49528
+ {
49529
+ domain: "memory",
49530
+ operation: "search.hybrid",
49531
+ gateway: "query",
49532
+ mode: "native",
49533
+ preferredChannel: "either"
49534
+ },
48838
49535
  // Mutate operations
48839
- { domain: "memory", operation: "observe", gateway: "mutate", mode: "native" },
48840
- { domain: "memory", operation: "decision.store", gateway: "mutate", mode: "native" },
48841
- { domain: "memory", operation: "pattern.store", gateway: "mutate", mode: "native" },
48842
- { domain: "memory", operation: "learning.store", gateway: "mutate", mode: "native" },
48843
- { domain: "memory", operation: "link", gateway: "mutate", mode: "native" },
48844
- { domain: "memory", operation: "graph.add", gateway: "mutate", mode: "native" },
48845
- { domain: "memory", operation: "graph.remove", gateway: "mutate", mode: "native" },
49536
+ {
49537
+ domain: "memory",
49538
+ operation: "observe",
49539
+ gateway: "mutate",
49540
+ mode: "native",
49541
+ preferredChannel: "mcp"
49542
+ },
49543
+ {
49544
+ domain: "memory",
49545
+ operation: "decision.store",
49546
+ gateway: "mutate",
49547
+ mode: "native",
49548
+ preferredChannel: "mcp"
49549
+ },
49550
+ {
49551
+ domain: "memory",
49552
+ operation: "pattern.store",
49553
+ gateway: "mutate",
49554
+ mode: "native",
49555
+ preferredChannel: "mcp"
49556
+ },
49557
+ {
49558
+ domain: "memory",
49559
+ operation: "learning.store",
49560
+ gateway: "mutate",
49561
+ mode: "native",
49562
+ preferredChannel: "mcp"
49563
+ },
49564
+ {
49565
+ domain: "memory",
49566
+ operation: "link",
49567
+ gateway: "mutate",
49568
+ mode: "native",
49569
+ preferredChannel: "either"
49570
+ },
49571
+ {
49572
+ domain: "memory",
49573
+ operation: "graph.add",
49574
+ gateway: "mutate",
49575
+ mode: "native",
49576
+ preferredChannel: "either"
49577
+ },
49578
+ {
49579
+ domain: "memory",
49580
+ operation: "graph.remove",
49581
+ gateway: "mutate",
49582
+ mode: "native",
49583
+ preferredChannel: "either"
49584
+ },
48846
49585
  // === Pipeline Domain ===
48847
49586
  // Stage sub-domain (RCASD lifecycle)
48848
- { domain: "pipeline", operation: "stage.validate", gateway: "query", mode: "native" },
48849
- { domain: "pipeline", operation: "stage.status", gateway: "query", mode: "native" },
48850
- { domain: "pipeline", operation: "stage.history", gateway: "query", mode: "native" },
48851
- { domain: "pipeline", operation: "stage.record", gateway: "mutate", mode: "native" },
48852
- { domain: "pipeline", operation: "stage.skip", gateway: "mutate", mode: "native" },
48853
- { domain: "pipeline", operation: "stage.reset", gateway: "mutate", mode: "native" },
48854
- { domain: "pipeline", operation: "stage.gate.pass", gateway: "mutate", mode: "native" },
48855
- { domain: "pipeline", operation: "stage.gate.fail", gateway: "mutate", mode: "native" },
49587
+ {
49588
+ domain: "pipeline",
49589
+ operation: "stage.validate",
49590
+ gateway: "query",
49591
+ mode: "native",
49592
+ preferredChannel: "mcp"
49593
+ },
49594
+ {
49595
+ domain: "pipeline",
49596
+ operation: "stage.status",
49597
+ gateway: "query",
49598
+ mode: "native",
49599
+ preferredChannel: "mcp"
49600
+ },
49601
+ {
49602
+ domain: "pipeline",
49603
+ operation: "stage.history",
49604
+ gateway: "query",
49605
+ mode: "native",
49606
+ preferredChannel: "either"
49607
+ },
49608
+ {
49609
+ domain: "pipeline",
49610
+ operation: "stage.record",
49611
+ gateway: "mutate",
49612
+ mode: "native",
49613
+ preferredChannel: "either"
49614
+ },
49615
+ {
49616
+ domain: "pipeline",
49617
+ operation: "stage.skip",
49618
+ gateway: "mutate",
49619
+ mode: "native",
49620
+ preferredChannel: "either"
49621
+ },
49622
+ {
49623
+ domain: "pipeline",
49624
+ operation: "stage.reset",
49625
+ gateway: "mutate",
49626
+ mode: "native",
49627
+ preferredChannel: "either"
49628
+ },
49629
+ {
49630
+ domain: "pipeline",
49631
+ operation: "stage.gate.pass",
49632
+ gateway: "mutate",
49633
+ mode: "native",
49634
+ preferredChannel: "either"
49635
+ },
49636
+ {
49637
+ domain: "pipeline",
49638
+ operation: "stage.gate.fail",
49639
+ gateway: "mutate",
49640
+ mode: "native",
49641
+ preferredChannel: "either"
49642
+ },
48856
49643
  // Manifest sub-domain (T5241)
48857
- { domain: "pipeline", operation: "manifest.show", gateway: "query", mode: "native" },
48858
- { domain: "pipeline", operation: "manifest.list", gateway: "query", mode: "native" },
48859
- { domain: "pipeline", operation: "manifest.find", gateway: "query", mode: "native" },
48860
- { domain: "pipeline", operation: "manifest.stats", gateway: "query", mode: "native" },
48861
- { domain: "pipeline", operation: "manifest.append", gateway: "mutate", mode: "native" },
48862
- { domain: "pipeline", operation: "manifest.archive", gateway: "mutate", mode: "native" },
49644
+ {
49645
+ domain: "pipeline",
49646
+ operation: "manifest.show",
49647
+ gateway: "query",
49648
+ mode: "native",
49649
+ preferredChannel: "either"
49650
+ },
49651
+ {
49652
+ domain: "pipeline",
49653
+ operation: "manifest.list",
49654
+ gateway: "query",
49655
+ mode: "native",
49656
+ preferredChannel: "either"
49657
+ },
49658
+ {
49659
+ domain: "pipeline",
49660
+ operation: "manifest.find",
49661
+ gateway: "query",
49662
+ mode: "native",
49663
+ preferredChannel: "either"
49664
+ },
49665
+ {
49666
+ domain: "pipeline",
49667
+ operation: "manifest.stats",
49668
+ gateway: "query",
49669
+ mode: "native",
49670
+ preferredChannel: "either"
49671
+ },
49672
+ {
49673
+ domain: "pipeline",
49674
+ operation: "manifest.append",
49675
+ gateway: "mutate",
49676
+ mode: "native",
49677
+ preferredChannel: "either"
49678
+ },
49679
+ {
49680
+ domain: "pipeline",
49681
+ operation: "manifest.archive",
49682
+ gateway: "mutate",
49683
+ mode: "native",
49684
+ preferredChannel: "either"
49685
+ },
48863
49686
  // Phase sub-domain (T5326)
48864
- { domain: "pipeline", operation: "phase.show", gateway: "query", mode: "native" },
48865
- { domain: "pipeline", operation: "phase.list", gateway: "query", mode: "native" },
48866
- { domain: "pipeline", operation: "phase.set", gateway: "mutate", mode: "native" },
48867
- { domain: "pipeline", operation: "phase.advance", gateway: "mutate", mode: "native" },
48868
- { domain: "pipeline", operation: "phase.rename", gateway: "mutate", mode: "native" },
48869
- { domain: "pipeline", operation: "phase.delete", gateway: "mutate", mode: "native" },
49687
+ {
49688
+ domain: "pipeline",
49689
+ operation: "phase.show",
49690
+ gateway: "query",
49691
+ mode: "native",
49692
+ preferredChannel: "either"
49693
+ },
49694
+ {
49695
+ domain: "pipeline",
49696
+ operation: "phase.list",
49697
+ gateway: "query",
49698
+ mode: "native",
49699
+ preferredChannel: "either"
49700
+ },
49701
+ {
49702
+ domain: "pipeline",
49703
+ operation: "phase.set",
49704
+ gateway: "mutate",
49705
+ mode: "native",
49706
+ preferredChannel: "either"
49707
+ },
49708
+ {
49709
+ domain: "pipeline",
49710
+ operation: "phase.advance",
49711
+ gateway: "mutate",
49712
+ mode: "native",
49713
+ preferredChannel: "either"
49714
+ },
49715
+ {
49716
+ domain: "pipeline",
49717
+ operation: "phase.rename",
49718
+ gateway: "mutate",
49719
+ mode: "native",
49720
+ preferredChannel: "either"
49721
+ },
49722
+ {
49723
+ domain: "pipeline",
49724
+ operation: "phase.delete",
49725
+ gateway: "mutate",
49726
+ mode: "native",
49727
+ preferredChannel: "either"
49728
+ },
48870
49729
  // Chain sub-domain (T5405)
48871
- { domain: "pipeline", operation: "chain.show", gateway: "query", mode: "native" },
48872
- { domain: "pipeline", operation: "chain.list", gateway: "query", mode: "native" },
48873
- { domain: "pipeline", operation: "chain.add", gateway: "mutate", mode: "native" },
48874
- { domain: "pipeline", operation: "chain.instantiate", gateway: "mutate", mode: "native" },
48875
- { domain: "pipeline", operation: "chain.advance", gateway: "mutate", mode: "native" },
49730
+ {
49731
+ domain: "pipeline",
49732
+ operation: "chain.show",
49733
+ gateway: "query",
49734
+ mode: "native",
49735
+ preferredChannel: "either"
49736
+ },
49737
+ {
49738
+ domain: "pipeline",
49739
+ operation: "chain.list",
49740
+ gateway: "query",
49741
+ mode: "native",
49742
+ preferredChannel: "either"
49743
+ },
49744
+ {
49745
+ domain: "pipeline",
49746
+ operation: "chain.add",
49747
+ gateway: "mutate",
49748
+ mode: "native",
49749
+ preferredChannel: "either"
49750
+ },
49751
+ {
49752
+ domain: "pipeline",
49753
+ operation: "chain.instantiate",
49754
+ gateway: "mutate",
49755
+ mode: "native",
49756
+ preferredChannel: "either"
49757
+ },
49758
+ {
49759
+ domain: "pipeline",
49760
+ operation: "chain.advance",
49761
+ gateway: "mutate",
49762
+ mode: "native",
49763
+ preferredChannel: "either"
49764
+ },
48876
49765
  // Release sub-domain (T5615 consolidated)
48877
- { domain: "pipeline", operation: "release.list", gateway: "query", mode: "native" },
48878
- { domain: "pipeline", operation: "release.show", gateway: "query", mode: "native" },
48879
- { domain: "pipeline", operation: "release.channel.show", gateway: "query", mode: "native" },
48880
- { domain: "pipeline", operation: "release.ship", gateway: "mutate", mode: "native" },
48881
- { domain: "pipeline", operation: "release.cancel", gateway: "mutate", mode: "native" },
48882
- { domain: "pipeline", operation: "release.rollback", gateway: "mutate", mode: "native" },
49766
+ {
49767
+ domain: "pipeline",
49768
+ operation: "release.list",
49769
+ gateway: "query",
49770
+ mode: "native",
49771
+ preferredChannel: "either"
49772
+ },
49773
+ {
49774
+ domain: "pipeline",
49775
+ operation: "release.show",
49776
+ gateway: "query",
49777
+ mode: "native",
49778
+ preferredChannel: "either"
49779
+ },
49780
+ {
49781
+ domain: "pipeline",
49782
+ operation: "release.channel.show",
49783
+ gateway: "query",
49784
+ mode: "native",
49785
+ preferredChannel: "either"
49786
+ },
49787
+ {
49788
+ domain: "pipeline",
49789
+ operation: "release.ship",
49790
+ gateway: "mutate",
49791
+ mode: "native",
49792
+ preferredChannel: "cli"
49793
+ },
49794
+ {
49795
+ domain: "pipeline",
49796
+ operation: "release.cancel",
49797
+ gateway: "mutate",
49798
+ mode: "native",
49799
+ preferredChannel: "either"
49800
+ },
49801
+ {
49802
+ domain: "pipeline",
49803
+ operation: "release.rollback",
49804
+ gateway: "mutate",
49805
+ mode: "native",
49806
+ preferredChannel: "either"
49807
+ },
48883
49808
  // === Tools Domain ===
48884
49809
  // Issue operations
48885
- { domain: "tools", operation: "issue.diagnostics", gateway: "query", mode: "native" },
49810
+ {
49811
+ domain: "tools",
49812
+ operation: "issue.diagnostics",
49813
+ gateway: "query",
49814
+ mode: "native",
49815
+ preferredChannel: "either"
49816
+ },
48886
49817
  // Skill operations
48887
- { domain: "tools", operation: "skill.list", gateway: "query", mode: "native" },
48888
- { domain: "tools", operation: "skill.show", gateway: "query", mode: "native" },
48889
- { domain: "tools", operation: "skill.find", gateway: "query", mode: "native" },
48890
- { domain: "tools", operation: "skill.dispatch", gateway: "query", mode: "native" },
48891
- { domain: "tools", operation: "skill.verify", gateway: "query", mode: "native" },
48892
- { domain: "tools", operation: "skill.dependencies", gateway: "query", mode: "native" },
48893
- { domain: "tools", operation: "skill.spawn.providers", gateway: "query", mode: "native" },
48894
- { domain: "tools", operation: "skill.catalog", gateway: "query", mode: "native" },
48895
- { domain: "tools", operation: "skill.precedence", gateway: "query", mode: "native" },
48896
- { domain: "tools", operation: "skill.install", gateway: "mutate", mode: "native" },
48897
- { domain: "tools", operation: "skill.uninstall", gateway: "mutate", mode: "native" },
48898
- { domain: "tools", operation: "skill.refresh", gateway: "mutate", mode: "native" },
49818
+ {
49819
+ domain: "tools",
49820
+ operation: "skill.list",
49821
+ gateway: "query",
49822
+ mode: "native",
49823
+ preferredChannel: "mcp"
49824
+ },
49825
+ {
49826
+ domain: "tools",
49827
+ operation: "skill.show",
49828
+ gateway: "query",
49829
+ mode: "native",
49830
+ preferredChannel: "mcp"
49831
+ },
49832
+ {
49833
+ domain: "tools",
49834
+ operation: "skill.find",
49835
+ gateway: "query",
49836
+ mode: "native",
49837
+ preferredChannel: "mcp"
49838
+ },
49839
+ {
49840
+ domain: "tools",
49841
+ operation: "skill.dispatch",
49842
+ gateway: "query",
49843
+ mode: "native",
49844
+ preferredChannel: "either"
49845
+ },
49846
+ {
49847
+ domain: "tools",
49848
+ operation: "skill.verify",
49849
+ gateway: "query",
49850
+ mode: "native",
49851
+ preferredChannel: "either"
49852
+ },
49853
+ {
49854
+ domain: "tools",
49855
+ operation: "skill.dependencies",
49856
+ gateway: "query",
49857
+ mode: "native",
49858
+ preferredChannel: "either"
49859
+ },
49860
+ {
49861
+ domain: "tools",
49862
+ operation: "skill.spawn.providers",
49863
+ gateway: "query",
49864
+ mode: "native",
49865
+ preferredChannel: "either"
49866
+ },
49867
+ {
49868
+ domain: "tools",
49869
+ operation: "skill.catalog",
49870
+ gateway: "query",
49871
+ mode: "native",
49872
+ preferredChannel: "either"
49873
+ },
49874
+ {
49875
+ domain: "tools",
49876
+ operation: "skill.precedence",
49877
+ gateway: "query",
49878
+ mode: "native",
49879
+ preferredChannel: "either"
49880
+ },
49881
+ {
49882
+ domain: "tools",
49883
+ operation: "skill.install",
49884
+ gateway: "mutate",
49885
+ mode: "native",
49886
+ preferredChannel: "either"
49887
+ },
49888
+ {
49889
+ domain: "tools",
49890
+ operation: "skill.uninstall",
49891
+ gateway: "mutate",
49892
+ mode: "native",
49893
+ preferredChannel: "either"
49894
+ },
49895
+ {
49896
+ domain: "tools",
49897
+ operation: "skill.refresh",
49898
+ gateway: "mutate",
49899
+ mode: "native",
49900
+ preferredChannel: "either"
49901
+ },
48899
49902
  // Provider operations
48900
- { domain: "tools", operation: "provider.list", gateway: "query", mode: "native" },
48901
- { domain: "tools", operation: "provider.detect", gateway: "query", mode: "native" },
48902
- { domain: "tools", operation: "provider.inject.status", gateway: "query", mode: "native" },
48903
- { domain: "tools", operation: "provider.supports", gateway: "query", mode: "native" },
48904
- { domain: "tools", operation: "provider.hooks", gateway: "query", mode: "native" },
48905
- { domain: "tools", operation: "provider.inject", gateway: "mutate", mode: "native" },
49903
+ {
49904
+ domain: "tools",
49905
+ operation: "provider.list",
49906
+ gateway: "query",
49907
+ mode: "native",
49908
+ preferredChannel: "mcp"
49909
+ },
49910
+ {
49911
+ domain: "tools",
49912
+ operation: "provider.detect",
49913
+ gateway: "query",
49914
+ mode: "native",
49915
+ preferredChannel: "mcp"
49916
+ },
49917
+ {
49918
+ domain: "tools",
49919
+ operation: "provider.inject.status",
49920
+ gateway: "query",
49921
+ mode: "native",
49922
+ preferredChannel: "either"
49923
+ },
49924
+ {
49925
+ domain: "tools",
49926
+ operation: "provider.supports",
49927
+ gateway: "query",
49928
+ mode: "native",
49929
+ preferredChannel: "either"
49930
+ },
49931
+ {
49932
+ domain: "tools",
49933
+ operation: "provider.hooks",
49934
+ gateway: "query",
49935
+ mode: "native",
49936
+ preferredChannel: "either"
49937
+ },
49938
+ {
49939
+ domain: "tools",
49940
+ operation: "provider.inject",
49941
+ gateway: "mutate",
49942
+ mode: "native",
49943
+ preferredChannel: "either"
49944
+ },
49945
+ // Adapter sub-domain (T5240)
49946
+ {
49947
+ domain: "tools",
49948
+ operation: "adapter.list",
49949
+ gateway: "query",
49950
+ mode: "native",
49951
+ preferredChannel: "mcp"
49952
+ },
49953
+ {
49954
+ domain: "tools",
49955
+ operation: "adapter.show",
49956
+ gateway: "query",
49957
+ mode: "native",
49958
+ preferredChannel: "mcp"
49959
+ },
49960
+ {
49961
+ domain: "tools",
49962
+ operation: "adapter.detect",
49963
+ gateway: "query",
49964
+ mode: "native",
49965
+ preferredChannel: "either"
49966
+ },
49967
+ {
49968
+ domain: "tools",
49969
+ operation: "adapter.health",
49970
+ gateway: "query",
49971
+ mode: "native",
49972
+ preferredChannel: "either"
49973
+ },
49974
+ {
49975
+ domain: "tools",
49976
+ operation: "adapter.activate",
49977
+ gateway: "mutate",
49978
+ mode: "native",
49979
+ preferredChannel: "mcp"
49980
+ },
49981
+ {
49982
+ domain: "tools",
49983
+ operation: "adapter.dispose",
49984
+ gateway: "mutate",
49985
+ mode: "native",
49986
+ preferredChannel: "either"
49987
+ },
48906
49988
  // === Nexus Domain ===
48907
49989
  // Query operations
48908
- { domain: "nexus", operation: "status", gateway: "query", mode: "native" },
48909
- { domain: "nexus", operation: "list", gateway: "query", mode: "native" },
48910
- { domain: "nexus", operation: "show", gateway: "query", mode: "native" },
48911
- { domain: "nexus", operation: "search", gateway: "query", mode: "native" },
48912
- { domain: "nexus", operation: "graph", gateway: "query", mode: "native" },
48913
- { domain: "nexus", operation: "deps", gateway: "query", mode: "native" },
48914
- { domain: "nexus", operation: "resolve", gateway: "query", mode: "native" },
48915
- { domain: "nexus", operation: "discover", gateway: "query", mode: "native" },
48916
- { domain: "nexus", operation: "orphans.list", gateway: "query", mode: "native" },
48917
- { domain: "nexus", operation: "blockers.show", gateway: "query", mode: "native" },
48918
- { domain: "nexus", operation: "path.show", gateway: "query", mode: "native" },
48919
- { domain: "nexus", operation: "share.status", gateway: "query", mode: "native" },
49990
+ {
49991
+ domain: "nexus",
49992
+ operation: "status",
49993
+ gateway: "query",
49994
+ mode: "native",
49995
+ preferredChannel: "either"
49996
+ },
49997
+ {
49998
+ domain: "nexus",
49999
+ operation: "list",
50000
+ gateway: "query",
50001
+ mode: "native",
50002
+ preferredChannel: "either"
50003
+ },
50004
+ {
50005
+ domain: "nexus",
50006
+ operation: "show",
50007
+ gateway: "query",
50008
+ mode: "native",
50009
+ preferredChannel: "either"
50010
+ },
50011
+ {
50012
+ domain: "nexus",
50013
+ operation: "search",
50014
+ gateway: "query",
50015
+ mode: "native",
50016
+ preferredChannel: "either"
50017
+ },
50018
+ {
50019
+ domain: "nexus",
50020
+ operation: "graph",
50021
+ gateway: "query",
50022
+ mode: "native",
50023
+ preferredChannel: "either"
50024
+ },
50025
+ {
50026
+ domain: "nexus",
50027
+ operation: "deps",
50028
+ gateway: "query",
50029
+ mode: "native",
50030
+ preferredChannel: "either"
50031
+ },
50032
+ {
50033
+ domain: "nexus",
50034
+ operation: "resolve",
50035
+ gateway: "query",
50036
+ mode: "native",
50037
+ preferredChannel: "either"
50038
+ },
50039
+ {
50040
+ domain: "nexus",
50041
+ operation: "discover",
50042
+ gateway: "query",
50043
+ mode: "native",
50044
+ preferredChannel: "either"
50045
+ },
50046
+ {
50047
+ domain: "nexus",
50048
+ operation: "orphans.list",
50049
+ gateway: "query",
50050
+ mode: "native",
50051
+ preferredChannel: "either"
50052
+ },
50053
+ {
50054
+ domain: "nexus",
50055
+ operation: "blockers.show",
50056
+ gateway: "query",
50057
+ mode: "native",
50058
+ preferredChannel: "either"
50059
+ },
50060
+ {
50061
+ domain: "nexus",
50062
+ operation: "path.show",
50063
+ gateway: "query",
50064
+ mode: "native",
50065
+ preferredChannel: "either"
50066
+ },
50067
+ {
50068
+ domain: "nexus",
50069
+ operation: "share.status",
50070
+ gateway: "query",
50071
+ mode: "native",
50072
+ preferredChannel: "either"
50073
+ },
50074
+ {
50075
+ domain: "nexus",
50076
+ operation: "transfer.preview",
50077
+ gateway: "query",
50078
+ mode: "native",
50079
+ preferredChannel: "either"
50080
+ },
48920
50081
  // Mutate operations
48921
- { domain: "nexus", operation: "init", gateway: "mutate", mode: "native" },
48922
- { domain: "nexus", operation: "register", gateway: "mutate", mode: "native" },
48923
- { domain: "nexus", operation: "unregister", gateway: "mutate", mode: "native" },
48924
- { domain: "nexus", operation: "sync", gateway: "mutate", mode: "native" },
48925
- { domain: "nexus", operation: "reconcile", gateway: "mutate", mode: "native" },
48926
- { domain: "nexus", operation: "permission.set", gateway: "mutate", mode: "native" },
48927
- { domain: "nexus", operation: "share.snapshot.export", gateway: "mutate", mode: "native" },
48928
- { domain: "nexus", operation: "share.snapshot.import", gateway: "mutate", mode: "native" },
50082
+ {
50083
+ domain: "nexus",
50084
+ operation: "init",
50085
+ gateway: "mutate",
50086
+ mode: "native",
50087
+ preferredChannel: "either"
50088
+ },
50089
+ {
50090
+ domain: "nexus",
50091
+ operation: "register",
50092
+ gateway: "mutate",
50093
+ mode: "native",
50094
+ preferredChannel: "either"
50095
+ },
50096
+ {
50097
+ domain: "nexus",
50098
+ operation: "unregister",
50099
+ gateway: "mutate",
50100
+ mode: "native",
50101
+ preferredChannel: "either"
50102
+ },
50103
+ {
50104
+ domain: "nexus",
50105
+ operation: "sync",
50106
+ gateway: "mutate",
50107
+ mode: "native",
50108
+ preferredChannel: "either"
50109
+ },
50110
+ {
50111
+ domain: "nexus",
50112
+ operation: "reconcile",
50113
+ gateway: "mutate",
50114
+ mode: "native",
50115
+ preferredChannel: "either"
50116
+ },
50117
+ {
50118
+ domain: "nexus",
50119
+ operation: "permission.set",
50120
+ gateway: "mutate",
50121
+ mode: "native",
50122
+ preferredChannel: "either"
50123
+ },
50124
+ {
50125
+ domain: "nexus",
50126
+ operation: "share.snapshot.export",
50127
+ gateway: "mutate",
50128
+ mode: "native",
50129
+ preferredChannel: "either"
50130
+ },
50131
+ {
50132
+ domain: "nexus",
50133
+ operation: "share.snapshot.import",
50134
+ gateway: "mutate",
50135
+ mode: "native",
50136
+ preferredChannel: "either"
50137
+ },
50138
+ {
50139
+ domain: "nexus",
50140
+ operation: "transfer",
50141
+ gateway: "mutate",
50142
+ mode: "native",
50143
+ preferredChannel: "either"
50144
+ },
48929
50145
  // === Sticky Domain ===
48930
50146
  // Query operations
48931
- { domain: "sticky", operation: "list", gateway: "query", mode: "native" },
48932
- { domain: "sticky", operation: "show", gateway: "query", mode: "native" },
50147
+ {
50148
+ domain: "sticky",
50149
+ operation: "list",
50150
+ gateway: "query",
50151
+ mode: "native",
50152
+ preferredChannel: "mcp"
50153
+ },
50154
+ {
50155
+ domain: "sticky",
50156
+ operation: "show",
50157
+ gateway: "query",
50158
+ mode: "native",
50159
+ preferredChannel: "mcp"
50160
+ },
48933
50161
  // Mutate operations
48934
- { domain: "sticky", operation: "add", gateway: "mutate", mode: "native" },
48935
- { domain: "sticky", operation: "archive", gateway: "mutate", mode: "native" },
48936
- { domain: "sticky", operation: "convert", gateway: "mutate", mode: "native" },
48937
- { domain: "sticky", operation: "purge", gateway: "mutate", mode: "native" }
50162
+ {
50163
+ domain: "sticky",
50164
+ operation: "add",
50165
+ gateway: "mutate",
50166
+ mode: "native",
50167
+ preferredChannel: "mcp"
50168
+ },
50169
+ {
50170
+ domain: "sticky",
50171
+ operation: "archive",
50172
+ gateway: "mutate",
50173
+ mode: "native",
50174
+ preferredChannel: "either"
50175
+ },
50176
+ {
50177
+ domain: "sticky",
50178
+ operation: "convert",
50179
+ gateway: "mutate",
50180
+ mode: "native",
50181
+ preferredChannel: "either"
50182
+ },
50183
+ {
50184
+ domain: "sticky",
50185
+ operation: "purge",
50186
+ gateway: "mutate",
50187
+ mode: "native",
50188
+ preferredChannel: "either"
50189
+ }
48938
50190
  ];
48939
50191
  }
48940
50192
  });
@@ -51697,6 +52949,7 @@ var init_config2 = __esm({
51697
52949
 
51698
52950
  // packages/core/src/skills/agents/install.ts
51699
52951
  import { existsSync as existsSync67, mkdirSync as mkdirSync14, readdirSync as readdirSync25, readlinkSync, symlinkSync, unlinkSync as unlinkSync4 } from "node:fs";
52952
+ import { platform as platform2 } from "node:os";
51700
52953
  import { basename as basename12, join as join70 } from "node:path";
51701
52954
  function getAgentInstallDir() {
51702
52955
  return getClaudeAgentsDir();
@@ -51727,7 +52980,7 @@ function installAgent(agentDir) {
51727
52980
  }
51728
52981
  }
51729
52982
  try {
51730
- symlinkSync(agentDir, targetPath, "dir");
52983
+ symlinkSync(agentDir, targetPath, DIR_SYMLINK_TYPE);
51731
52984
  return { installed: true, path: targetPath };
51732
52985
  } catch (err) {
51733
52986
  return { installed: false, path: targetPath, error: `Symlink failed: ${err}` };
@@ -51767,11 +53020,13 @@ function uninstallAgent(agentName) {
51767
53020
  return false;
51768
53021
  }
51769
53022
  }
53023
+ var DIR_SYMLINK_TYPE;
51770
53024
  var init_install = __esm({
51771
53025
  "packages/core/src/skills/agents/install.ts"() {
51772
53026
  "use strict";
51773
53027
  init_paths();
51774
53028
  init_config2();
53029
+ DIR_SYMLINK_TYPE = platform2() === "win32" ? "junction" : "dir";
51775
53030
  }
51776
53031
  });
51777
53032
 
@@ -53704,8 +54959,9 @@ var init_validator = __esm({
53704
54959
  // packages/core/src/skills/skill-paths.ts
53705
54960
  import { existsSync as existsSync77, lstatSync, readlinkSync as readlinkSync2, realpathSync as realpathSync2 } from "node:fs";
53706
54961
  import { delimiter, join as join79, resolve as resolve9 } from "node:path";
54962
+ import { getCanonicalSkillsDir as getCanonicalSkillsDir2 } from "@cleocode/caamp";
53707
54963
  function getCaampCanonical() {
53708
- return join79(getAgentsHome(), "skills");
54964
+ return getCanonicalSkillsDir2();
53709
54965
  }
53710
54966
  function getProjectEmbedded(projectRoot) {
53711
54967
  const root = projectRoot ?? process.cwd();
@@ -53825,7 +55081,6 @@ function getSkillSourceType(skillDir, projectRoot) {
53825
55081
  var init_skill_paths = __esm({
53826
55082
  "packages/core/src/skills/skill-paths.ts"() {
53827
55083
  "use strict";
53828
- init_paths();
53829
55084
  }
53830
55085
  });
53831
55086
 
@@ -56206,7 +57461,7 @@ function getNodeVersionInfo() {
56206
57461
  };
56207
57462
  }
56208
57463
  function getNodeUpgradeInstructions() {
56209
- const platform3 = detectPlatform();
57464
+ const platform5 = detectPlatform();
56210
57465
  const arch2 = process.arch;
56211
57466
  const instructions = [];
56212
57467
  const hasFnm = commandExists2("fnm");
@@ -56221,7 +57476,7 @@ function getNodeUpgradeInstructions() {
56221
57476
  if (hasVolta) {
56222
57477
  instructions.push(`volta install node@${MINIMUM_NODE_MAJOR}`);
56223
57478
  }
56224
- switch (platform3) {
57479
+ switch (platform5) {
56225
57480
  case "linux":
56226
57481
  if (commandExists2("dnf")) {
56227
57482
  instructions.push(
@@ -56253,7 +57508,7 @@ function getNodeUpgradeInstructions() {
56253
57508
  }
56254
57509
  instructions.push(`https://nodejs.org/en/download/`);
56255
57510
  const recommended = instructions[0] ?? `https://nodejs.org/en/download/`;
56256
- return { platform: platform3, arch: arch2, instructions, recommended };
57511
+ return { platform: platform5, arch: arch2, instructions, recommended };
56257
57512
  }
56258
57513
  function getSystemInfo2() {
56259
57514
  return {
@@ -57788,12 +59043,22 @@ async function startupHealthCheck(projectRoot) {
57788
59043
  message: scaffoldResult.home.action === "skipped" ? "Global home already current" : `Global home ${scaffoldResult.home.action}: ${scaffoldResult.home.details ?? ""}`,
57789
59044
  repaired: scaffoldResult.home.action !== "skipped"
57790
59045
  });
57791
- checks.push({
57792
- check: "global_schemas",
57793
- status: "pass",
57794
- message: `Schemas: ${scaffoldResult.schemas.installed} installed, ${scaffoldResult.schemas.updated} updated of ${scaffoldResult.schemas.total}`,
57795
- repaired: scaffoldResult.schemas.installed > 0 || scaffoldResult.schemas.updated > 0
57796
- });
59046
+ if (!globalSchemaCheck.ok) {
59047
+ const { ensureGlobalSchemas: ensureGlobalSchemas2 } = await Promise.resolve().then(() => (init_schema_management(), schema_management_exports));
59048
+ const schemaResult = ensureGlobalSchemas2();
59049
+ checks.push({
59050
+ check: "global_schemas",
59051
+ status: "pass",
59052
+ message: `Schemas: ${schemaResult.installed} installed, ${schemaResult.updated} updated of ${schemaResult.total}`,
59053
+ repaired: schemaResult.installed > 0 || schemaResult.updated > 0
59054
+ });
59055
+ } else {
59056
+ checks.push({
59057
+ check: "global_schemas",
59058
+ status: "pass",
59059
+ message: `All ${globalSchemaCheck.installed} schemas current`
59060
+ });
59061
+ }
57797
59062
  checks.push({
57798
59063
  check: "global_templates",
57799
59064
  status: "pass",
@@ -59330,13 +60595,13 @@ var init_templates = __esm({
59330
60595
 
59331
60596
  // packages/core/src/ui/aliases.ts
59332
60597
  import { existsSync as existsSync93, readFileSync as readFileSync67, writeFileSync as writeFileSync15 } from "node:fs";
59333
- import { homedir as homedir5, platform as platform2 } from "node:os";
60598
+ import { homedir as homedir5, platform as platform3 } from "node:os";
59334
60599
  import { join as join96 } from "node:path";
59335
60600
  function getCurrentShell() {
59336
60601
  const shell = process.env.SHELL ?? "";
59337
60602
  if (shell.includes("zsh")) return "zsh";
59338
60603
  if (shell.includes("bash")) return "bash";
59339
- if (platform2() === "win32") return "powershell";
60604
+ if (platform3() === "win32") return "powershell";
59340
60605
  return "bash";
59341
60606
  }
59342
60607
  function getRcFilePath(shell) {
@@ -59360,7 +60625,7 @@ function detectAvailableShells() {
59360
60625
  const shells = [];
59361
60626
  if (existsSync93(getRcFilePath("bash")) || existsSync93("/bin/bash")) shells.push("bash");
59362
60627
  if (existsSync93(getRcFilePath("zsh")) || existsSync93("/bin/zsh")) shells.push("zsh");
59363
- if (platform2() === "win32") shells.push("powershell");
60628
+ if (platform3() === "win32") shells.push("powershell");
59364
60629
  return shells;
59365
60630
  }
59366
60631
  function generateBashAliases(cleoPath) {
@@ -59824,27 +61089,10 @@ var init_flags = __esm({
59824
61089
  }
59825
61090
  });
59826
61091
 
59827
- // packages/core/src/ui/injection-legacy.ts
59828
- function getValidationKey(target) {
59829
- return INJECTION_VALIDATION_KEYS[target] ?? target.toLowerCase().replace(/[^a-z0-9]/g, "_");
59830
- }
59831
- var INJECTION_VALIDATION_KEYS;
59832
- var init_injection_legacy = __esm({
59833
- "packages/core/src/ui/injection-legacy.ts"() {
59834
- "use strict";
59835
- INJECTION_VALIDATION_KEYS = {
59836
- "CLAUDE.md": "claude_md",
59837
- "AGENTS.md": "agents_md",
59838
- "GEMINI.md": "gemini_md"
59839
- };
59840
- }
59841
- });
59842
-
59843
61092
  // packages/core/src/ui/index.ts
59844
61093
  var ui_exports = {};
59845
61094
  __export(ui_exports, {
59846
61095
  ALIASES_VERSION: () => ALIASES_VERSION,
59847
- INJECTION_VALIDATION_KEYS: () => INJECTION_VALIDATION_KEYS,
59848
61096
  appendToChangelog: () => appendToChangelog,
59849
61097
  checkAliasesStatus: () => checkAliasesStatus,
59850
61098
  defaultFlags: () => defaultFlags,
@@ -59861,7 +61109,6 @@ __export(ui_exports, {
59861
61109
  getCurrentShell: () => getCurrentShell,
59862
61110
  getInstalledVersion: () => getInstalledVersion,
59863
61111
  getRcFilePath: () => getRcFilePath,
59864
- getValidationKey: () => getValidationKey,
59865
61112
  groupTasksIntoSections: () => groupTasksIntoSections,
59866
61113
  hasAliasBlock: () => hasAliasBlock,
59867
61114
  injectAliases: () => injectAliases,
@@ -59881,7 +61128,6 @@ var init_ui = __esm({
59881
61128
  init_changelog();
59882
61129
  init_command_registry();
59883
61130
  init_flags();
59884
- init_injection_legacy();
59885
61131
  }
59886
61132
  });
59887
61133
 
@@ -63056,11 +64302,29 @@ __export(init_exports, {
63056
64302
  });
63057
64303
  import { existsSync as existsSync100, readdirSync as readdirSync33, readFileSync as readFileSync73 } from "node:fs";
63058
64304
  import { copyFile as copyFile3, lstat, mkdir as mkdir16, readFile as readFile17, symlink, unlink as unlink4, writeFile as writeFile11 } from "node:fs/promises";
64305
+ import { platform as platform4 } from "node:os";
63059
64306
  import { basename as basename17, dirname as dirname19, join as join100 } from "node:path";
63060
64307
  async function initAgentDefinition(created, warnings) {
63061
- const packageRoot = getPackageRoot();
63062
- const agentSourceDir = join100(packageRoot, "agents", "cleo-subagent");
63063
- if (!existsSync100(agentSourceDir)) {
64308
+ let agentSourceDir = null;
64309
+ try {
64310
+ const { createRequire: createRequire6 } = await import("node:module");
64311
+ const req = createRequire6(import.meta.url);
64312
+ const agentsPkgMain = req.resolve("@cleocode/agents/package.json");
64313
+ const agentsPkgRoot = dirname19(agentsPkgMain);
64314
+ const candidate = join100(agentsPkgRoot, "cleo-subagent");
64315
+ if (existsSync100(candidate)) {
64316
+ agentSourceDir = candidate;
64317
+ }
64318
+ } catch {
64319
+ }
64320
+ if (!agentSourceDir) {
64321
+ const packageRoot = getPackageRoot();
64322
+ const bundled = join100(packageRoot, "agents", "cleo-subagent");
64323
+ if (existsSync100(bundled)) {
64324
+ agentSourceDir = bundled;
64325
+ }
64326
+ }
64327
+ if (!agentSourceDir) {
63064
64328
  warnings.push("agents/cleo-subagent/ not found in package, skipping agent definition install");
63065
64329
  return;
63066
64330
  }
@@ -63074,7 +64338,7 @@ async function initAgentDefinition(created, warnings) {
63074
64338
  }
63075
64339
  } catch {
63076
64340
  }
63077
- await symlink(agentSourceDir, globalAgentsDir, "dir");
64341
+ await symlink(agentSourceDir, globalAgentsDir, DIR_SYMLINK_TYPE2);
63078
64342
  created.push("agent: cleo-subagent (symlinked)");
63079
64343
  } catch (_err) {
63080
64344
  try {
@@ -63133,17 +64397,29 @@ async function initCoreSkills(created, warnings) {
63133
64397
  const packageRoot = getPackageRoot();
63134
64398
  let ctSkillsRoot = null;
63135
64399
  try {
63136
- const bundledPath = join100(packageRoot, "packages", "skills");
63137
- if (existsSync100(join100(bundledPath, "skills.json"))) {
63138
- ctSkillsRoot = bundledPath;
63139
- } else {
63140
- const ctSkillsPath = join100(packageRoot, "node_modules", "@cleocode", "skills");
63141
- if (existsSync100(join100(ctSkillsPath, "skills.json"))) {
63142
- ctSkillsRoot = ctSkillsPath;
63143
- }
64400
+ const { createRequire: createRequire6 } = await import("node:module");
64401
+ const req = createRequire6(import.meta.url);
64402
+ const skillsPkgMain = req.resolve("@cleocode/skills/package.json");
64403
+ const skillsPkgRoot = dirname19(skillsPkgMain);
64404
+ if (existsSync100(join100(skillsPkgRoot, "skills.json"))) {
64405
+ ctSkillsRoot = skillsPkgRoot;
63144
64406
  }
63145
64407
  } catch {
63146
64408
  }
64409
+ if (!ctSkillsRoot) {
64410
+ try {
64411
+ const bundledPath = join100(packageRoot, "packages", "skills");
64412
+ if (existsSync100(join100(bundledPath, "skills.json"))) {
64413
+ ctSkillsRoot = bundledPath;
64414
+ } else {
64415
+ const ctSkillsPath = join100(packageRoot, "node_modules", "@cleocode", "skills");
64416
+ if (existsSync100(join100(ctSkillsPath, "skills.json"))) {
64417
+ ctSkillsRoot = ctSkillsPath;
64418
+ }
64419
+ }
64420
+ } catch {
64421
+ }
64422
+ }
63147
64423
  if (!ctSkillsRoot) {
63148
64424
  warnings.push("skills package not found, skipping core skill installation");
63149
64425
  return;
@@ -63435,7 +64711,6 @@ async function initProject(opts = {}) {
63435
64711
  warnings.push(`Contributor MCP setup: ${err instanceof Error ? err.message : String(err)}`);
63436
64712
  }
63437
64713
  await initAgentDefinition(created, warnings);
63438
- await initCoreSkills(created, warnings);
63439
64714
  await initNexusRegistration(projRoot, created, warnings);
63440
64715
  try {
63441
64716
  const { AdapterManager: AdapterManager2 } = await Promise.resolve().then(() => (init_adapters(), adapters_exports));
@@ -63522,6 +64797,7 @@ async function getVersion2(projectRoot) {
63522
64797
  }
63523
64798
  return { version: "0.0.0" };
63524
64799
  }
64800
+ var DIR_SYMLINK_TYPE2;
63525
64801
  var init_init = __esm({
63526
64802
  "packages/core/src/init.ts"() {
63527
64803
  "use strict";
@@ -63535,6 +64811,7 @@ var init_init = __esm({
63535
64811
  init_scaffold();
63536
64812
  init_schema_management();
63537
64813
  init_json2();
64814
+ DIR_SYMLINK_TYPE2 = platform4() === "win32" ? "junction" : "dir";
63538
64815
  }
63539
64816
  });
63540
64817
 
@@ -64274,6 +65551,7 @@ async function bootstrapGlobalCleo(options) {
64274
65551
  await injectAgentsHub(ctx);
64275
65552
  await installMcpToProviders(ctx);
64276
65553
  await installSkillsGlobally(ctx);
65554
+ await installAgentDefinitionGlobally(ctx);
64277
65555
  await installProviderAdapters(ctx, options?.packageRoot);
64278
65556
  return ctx;
64279
65557
  }
@@ -64324,12 +65602,16 @@ async function injectAgentsHub(ctx) {
64324
65602
  await mkdir17(globalAgentsDir, { recursive: true });
64325
65603
  if (existsSync103(globalAgentsMd)) {
64326
65604
  const content = await readFile19(globalAgentsMd, "utf8");
64327
- const stripped = content.replace(/\n?<!-- CLEO:START -->[\s\S]*?<!-- CLEO:END -->\n?/g, "");
65605
+ const stripped = content.replace(
65606
+ /\n?<!-- CLEO:START[^>]*-->[\s\S]*?<!-- CLEO:END -->\n?/g,
65607
+ ""
65608
+ );
64328
65609
  if (stripped !== content) {
64329
65610
  await writeFile12(globalAgentsMd, stripped, "utf8");
64330
65611
  }
64331
65612
  }
64332
- const action = await inject2(globalAgentsMd, "@~/.cleo/templates/CLEO-INJECTION.md");
65613
+ const expectedContent = "@~/.cleo/templates/CLEO-INJECTION.md";
65614
+ const action = await inject2(globalAgentsMd, expectedContent);
64333
65615
  ctx.created.push(`~/.agents/AGENTS.md (${action})`);
64334
65616
  } else {
64335
65617
  ctx.created.push("~/.agents/AGENTS.md (would create/update CAAMP block)");
@@ -64347,7 +65629,7 @@ async function injectAgentsHub(ctx) {
64347
65629
  if (existsSync103(instructFilePath)) {
64348
65630
  const fileContent = await readFile19(instructFilePath, "utf8");
64349
65631
  const stripped = fileContent.replace(
64350
- /\n?<!-- CLEO:START -->[\s\S]*?<!-- CLEO:END -->\n?/g,
65632
+ /\n?<!-- CLEO:START[^>]*-->[\s\S]*?<!-- CLEO:END -->\n?/g,
64351
65633
  ""
64352
65634
  );
64353
65635
  if (stripped !== fileContent) {
@@ -64416,6 +65698,20 @@ async function installSkillsGlobally(ctx) {
64416
65698
  );
64417
65699
  }
64418
65700
  }
65701
+ async function installAgentDefinitionGlobally(ctx) {
65702
+ try {
65703
+ if (!ctx.isDryRun) {
65704
+ const { initAgentDefinition: initAgentDefinition2 } = await Promise.resolve().then(() => (init_init(), init_exports));
65705
+ await initAgentDefinition2(ctx.created, ctx.warnings);
65706
+ } else {
65707
+ ctx.created.push("agent: cleo-subagent (would symlink)");
65708
+ }
65709
+ } catch (err) {
65710
+ ctx.warnings.push(
65711
+ `Agent definition install: ${err instanceof Error ? err.message : String(err)}`
65712
+ );
65713
+ }
65714
+ }
64419
65715
  async function installProviderAdapters(ctx, packageRootOverride) {
64420
65716
  try {
64421
65717
  const { AdapterManager: AdapterManager2 } = await Promise.resolve().then(() => (init_adapters(), adapters_exports));
@@ -68415,13 +69711,13 @@ var init_parallel = __esm({
68415
69711
  // packages/core/src/orchestration/skill-ops.ts
68416
69712
  import { existsSync as existsSync107, readdirSync as readdirSync35, readFileSync as readFileSync79 } from "node:fs";
68417
69713
  import { join as join106 } from "node:path";
68418
- import { getCanonicalSkillsDir as getCanonicalSkillsDir2 } from "@cleocode/caamp";
69714
+ import { getCanonicalSkillsDir as getCanonicalSkillsDir3 } from "@cleocode/caamp";
68419
69715
  function getSkillContent(skillName, projectRoot) {
68420
69716
  if (!skillName) {
68421
69717
  throw new CleoError(2 /* INVALID_INPUT */, "skill name is required");
68422
69718
  }
68423
69719
  const projectSkillDir = join106(projectRoot, ".cleo", "skills", skillName);
68424
- const canonicalSkillDir = join106(getCanonicalSkillsDir2(), skillName);
69720
+ const canonicalSkillDir = join106(getCanonicalSkillsDir3(), skillName);
68425
69721
  const skillDir = existsSync107(projectSkillDir) ? projectSkillDir : canonicalSkillDir;
68426
69722
  if (!existsSync107(skillDir)) {
68427
69723
  throw new CleoError(
@@ -72492,7 +73788,7 @@ async function validateLayer2Semantic(context) {
72492
73788
  }
72493
73789
  if (context.domain === "session" && context.operation === "start") {
72494
73790
  const scope = context.params?.scope;
72495
- if (scope && !scope.match(/^(epic|task|global):/)) {
73791
+ if (scope && scope !== "global" && !scope.match(/^(epic|task):/)) {
72496
73792
  violations.push({
72497
73793
  layer: 2 /* SEMANTIC */,
72498
73794
  severity: "error" /* ERROR */,
@@ -72500,7 +73796,7 @@ async function validateLayer2Semantic(context) {
72500
73796
  message: `Invalid session scope format: ${scope}`,
72501
73797
  field: "scope",
72502
73798
  constraint: "Must be epic:<id>, task:<id>, or global",
72503
- fix: "Use format: epic:T1234, task:T5678, or global"
73799
+ fix: 'Provide scope as "global" or "epic:TXXX"'
72504
73800
  });
72505
73801
  }
72506
73802
  }
@@ -76604,7 +77900,9 @@ var init_hooks_engine = __esm({
76604
77900
  });
76605
77901
 
76606
77902
  // packages/cleo/src/cli/index.ts
76607
- import { join as join118 } from "node:path";
77903
+ import { readFileSync as readFileSync97 } from "node:fs";
77904
+ import { dirname as dirname25, join as join118 } from "node:path";
77905
+ import { fileURLToPath as fileURLToPath7 } from "node:url";
76608
77906
 
76609
77907
  // node_modules/.pnpm/citty@0.2.1/node_modules/citty/dist/_chunks/libs/scule.mjs
76610
77908
  var NUMBER_CHAR_RE = /\d/;
@@ -82509,8 +83807,15 @@ async function taskList(projectRoot, params) {
82509
83807
  data: { tasks: tasks2, total: result.total, filtered: result.filtered },
82510
83808
  page: result.page
82511
83809
  };
82512
- } catch {
82513
- return engineError("E_NOT_INITIALIZED", "Task database not initialized");
83810
+ } catch (err) {
83811
+ const code = err?.code;
83812
+ if (code === 4) return engineError("E_NOT_FOUND", err.message || "Task not found");
83813
+ if (code === 2)
83814
+ return engineError("E_INVALID_INPUT", err.message || "Invalid input");
83815
+ return engineError(
83816
+ "E_NOT_INITIALIZED",
83817
+ err.message || "Task database not initialized"
83818
+ );
82514
83819
  }
82515
83820
  }
82516
83821
  async function taskFind(projectRoot, query, limit, options) {
@@ -82537,8 +83842,15 @@ async function taskFind(projectRoot, query, limit, options) {
82537
83842
  parentId: r.parentId
82538
83843
  }));
82539
83844
  return { success: true, data: { results, total: results.length } };
82540
- } catch {
82541
- return engineError("E_NOT_INITIALIZED", "Task database not initialized");
83845
+ } catch (err) {
83846
+ const code = err?.code;
83847
+ if (code === 4) return engineError("E_NOT_FOUND", err.message || "Task not found");
83848
+ if (code === 2)
83849
+ return engineError("E_INVALID_INPUT", err.message || "Invalid input");
83850
+ return engineError(
83851
+ "E_NOT_INITIALIZED",
83852
+ err.message || "Task database not initialized"
83853
+ );
82542
83854
  }
82543
83855
  }
82544
83856
  async function taskCreate(projectRoot, params) {
@@ -83469,54 +84781,42 @@ function routeByParam(params, paramName, routes, defaultRoute) {
83469
84781
 
83470
84782
  // packages/cleo/src/dispatch/domains/admin.ts
83471
84783
  var AdminHandler = class {
83472
- projectRoot;
83473
- constructor() {
83474
- this.projectRoot = getProjectRoot();
83475
- }
83476
84784
  // -----------------------------------------------------------------------
83477
84785
  // Query
83478
84786
  // -----------------------------------------------------------------------
83479
84787
  async query(operation, params) {
84788
+ const projectRoot = getProjectRoot();
83480
84789
  const startTime = Date.now();
83481
84790
  try {
83482
84791
  switch (operation) {
83483
84792
  case "version": {
83484
- const result = await getVersion3(this.projectRoot);
84793
+ const result = await getVersion3(projectRoot);
83485
84794
  return wrapResult(result, "query", "admin", operation, startTime);
83486
84795
  }
83487
84796
  case "health": {
83488
84797
  const mode = params?.mode;
83489
84798
  if (mode === "diagnose") {
83490
- const result2 = await systemDoctor(this.projectRoot);
84799
+ const result2 = await systemDoctor(projectRoot);
83491
84800
  return wrapResult(result2, "query", "admin", operation, startTime);
83492
84801
  }
83493
- const result = systemHealth(
83494
- this.projectRoot,
83495
- params
83496
- );
84802
+ const result = systemHealth(projectRoot, params);
83497
84803
  return wrapResult(result, "query", "admin", operation, startTime);
83498
84804
  }
83499
84805
  case "config.show": {
83500
- const result = await configGet(this.projectRoot, params?.key);
84806
+ const result = await configGet(projectRoot, params?.key);
83501
84807
  return wrapResult(result, "query", "admin", operation, startTime);
83502
84808
  }
83503
84809
  case "stats": {
83504
- const result = await systemStats(
83505
- this.projectRoot,
83506
- params
83507
- );
84810
+ const result = await systemStats(projectRoot, params);
83508
84811
  return wrapResult(result, "query", "admin", operation, startTime);
83509
84812
  }
83510
84813
  case "context": {
83511
- const result = systemContext(
83512
- this.projectRoot,
83513
- params
83514
- );
84814
+ const result = systemContext(projectRoot, params);
83515
84815
  return wrapResult(result, "query", "admin", operation, startTime);
83516
84816
  }
83517
84817
  case "runtime": {
83518
84818
  const result = await systemRuntime(
83519
- this.projectRoot,
84819
+ projectRoot,
83520
84820
  params
83521
84821
  );
83522
84822
  return wrapResult(result, "query", "admin", operation, startTime);
@@ -83611,12 +84911,12 @@ var AdminHandler = class {
83611
84911
  }
83612
84912
  case "dash": {
83613
84913
  const blockedTasksLimit = typeof params?.blockedTasksLimit === "number" ? params.blockedTasksLimit : void 0;
83614
- const result = await systemDash(this.projectRoot, { blockedTasksLimit });
84914
+ const result = await systemDash(projectRoot, { blockedTasksLimit });
83615
84915
  return wrapResult(result, "query", "admin", operation, startTime);
83616
84916
  }
83617
84917
  case "log": {
83618
84918
  const result = await systemLog(
83619
- this.projectRoot,
84919
+ projectRoot,
83620
84920
  params
83621
84921
  );
83622
84922
  return wrapResult(result, "query", "admin", operation, startTime);
@@ -83633,7 +84933,7 @@ var AdminHandler = class {
83633
84933
  startTime
83634
84934
  );
83635
84935
  }
83636
- const result = await systemSequence(this.projectRoot, {
84936
+ const result = await systemSequence(projectRoot, {
83637
84937
  action
83638
84938
  });
83639
84939
  return wrapResult(result, "query", "admin", operation, startTime);
@@ -83651,7 +84951,7 @@ var AdminHandler = class {
83651
84951
  case "adr.find": {
83652
84952
  const query = params?.query;
83653
84953
  if (query) {
83654
- const result2 = await findAdrs(this.projectRoot, query, {
84954
+ const result2 = await findAdrs(projectRoot, query, {
83655
84955
  topics: params?.topics,
83656
84956
  keywords: params?.keywords,
83657
84957
  status: params?.status
@@ -83663,7 +84963,7 @@ var AdminHandler = class {
83663
84963
  };
83664
84964
  }
83665
84965
  const { limit, offset } = getListParams(params);
83666
- const result = await listAdrs(this.projectRoot, {
84966
+ const result = await listAdrs(projectRoot, {
83667
84967
  status: params?.status,
83668
84968
  since: params?.since,
83669
84969
  limit,
@@ -83688,7 +84988,7 @@ var AdminHandler = class {
83688
84988
  startTime
83689
84989
  );
83690
84990
  }
83691
- const adr = await showAdr(this.projectRoot, adrId);
84991
+ const adr = await showAdr(projectRoot, adrId);
83692
84992
  if (!adr) {
83693
84993
  return errorResult(
83694
84994
  "query",
@@ -83727,7 +85027,7 @@ var AdminHandler = class {
83727
85027
  since: params?.since,
83728
85028
  until: params?.until
83729
85029
  },
83730
- this.projectRoot
85030
+ projectRoot
83731
85031
  );
83732
85032
  return {
83733
85033
  _meta: dispatchMeta("query", "admin", operation, startTime),
@@ -83754,7 +85054,7 @@ var AdminHandler = class {
83754
85054
  limit,
83755
85055
  offset
83756
85056
  },
83757
- this.projectRoot
85057
+ projectRoot
83758
85058
  );
83759
85059
  return {
83760
85060
  _meta: dispatchMeta("query", "admin", operation, startTime),
@@ -83779,7 +85079,7 @@ var AdminHandler = class {
83779
85079
  startTime
83780
85080
  );
83781
85081
  }
83782
- const result = await showTokenUsage(tokenId, this.projectRoot);
85082
+ const result = await showTokenUsage(tokenId, projectRoot);
83783
85083
  if (!result) {
83784
85084
  return errorResult(
83785
85085
  "query",
@@ -83804,8 +85104,8 @@ var AdminHandler = class {
83804
85104
  case "export": {
83805
85105
  const scope = params?.scope;
83806
85106
  if (scope === "snapshot") {
83807
- const snapshot = await exportSnapshot(this.projectRoot);
83808
- const outputPath = params?.output ?? getDefaultSnapshotPath(this.projectRoot);
85107
+ const snapshot = await exportSnapshot(projectRoot);
85108
+ const outputPath = params?.output ?? getDefaultSnapshotPath(projectRoot);
83809
85109
  await writeSnapshot(snapshot, outputPath);
83810
85110
  return {
83811
85111
  _meta: dispatchMeta("query", "admin", operation, startTime),
@@ -83826,7 +85126,7 @@ var AdminHandler = class {
83826
85126
  filter: params?.filter,
83827
85127
  includeDeps: params?.includeDeps,
83828
85128
  dryRun: params?.dryRun,
83829
- cwd: this.projectRoot
85129
+ cwd: projectRoot
83830
85130
  });
83831
85131
  return {
83832
85132
  _meta: dispatchMeta("query", "admin", operation, startTime),
@@ -83840,7 +85140,7 @@ var AdminHandler = class {
83840
85140
  status: params?.status,
83841
85141
  parent: params?.parent,
83842
85142
  phase: params?.phase,
83843
- cwd: this.projectRoot
85143
+ cwd: projectRoot
83844
85144
  });
83845
85145
  return {
83846
85146
  _meta: dispatchMeta("query", "admin", operation, startTime),
@@ -83850,7 +85150,7 @@ var AdminHandler = class {
83850
85150
  }
83851
85151
  case "map": {
83852
85152
  const { mapCodebase: mapCodebase3 } = await Promise.resolve().then(() => (init_codebase_map_engine(), codebase_map_engine_exports));
83853
- const result = await mapCodebase3(this.projectRoot, {
85153
+ const result = await mapCodebase3(projectRoot, {
83854
85154
  focus: params?.focus,
83855
85155
  storeToBrain: false
83856
85156
  });
@@ -83871,12 +85171,13 @@ var AdminHandler = class {
83871
85171
  // Mutate
83872
85172
  // -----------------------------------------------------------------------
83873
85173
  async mutate(operation, params) {
85174
+ const projectRoot = getProjectRoot();
83874
85175
  const startTime = Date.now();
83875
85176
  try {
83876
85177
  switch (operation) {
83877
85178
  case "init": {
83878
85179
  const result = await initProject2(
83879
- this.projectRoot,
85180
+ projectRoot,
83880
85181
  params
83881
85182
  );
83882
85183
  return wrapResult(result, "mutate", "admin", operation, startTime);
@@ -83885,10 +85186,10 @@ var AdminHandler = class {
83885
85186
  case "health": {
83886
85187
  const mode = params?.mode;
83887
85188
  if (mode === "diagnose") {
83888
- const result2 = await systemDoctor(this.projectRoot);
85189
+ const result2 = await systemDoctor(projectRoot);
83889
85190
  return wrapResult(result2, "mutate", "admin", operation, startTime);
83890
85191
  }
83891
- const result = await systemFix(this.projectRoot);
85192
+ const result = await systemFix(projectRoot);
83892
85193
  return wrapResult(result, "mutate", "admin", operation, startTime);
83893
85194
  }
83894
85195
  case "config.set": {
@@ -83903,7 +85204,7 @@ var AdminHandler = class {
83903
85204
  startTime
83904
85205
  );
83905
85206
  }
83906
- const result = await configSet(this.projectRoot, key, params?.value);
85207
+ const result = await configSet(projectRoot, key, params?.value);
83907
85208
  return wrapResult(result, "mutate", "admin", operation, startTime);
83908
85209
  }
83909
85210
  // Merged: backup absorbs restore and backup.restore via action param (T5615)
@@ -83921,7 +85222,7 @@ var AdminHandler = class {
83921
85222
  startTime
83922
85223
  );
83923
85224
  }
83924
- const result2 = systemRestore(this.projectRoot, {
85225
+ const result2 = systemRestore(projectRoot, {
83925
85226
  backupId,
83926
85227
  force: params?.force
83927
85228
  });
@@ -83939,20 +85240,20 @@ var AdminHandler = class {
83939
85240
  startTime
83940
85241
  );
83941
85242
  }
83942
- const result2 = await backupRestore(this.projectRoot, file2, {
85243
+ const result2 = await backupRestore(projectRoot, file2, {
83943
85244
  dryRun: params?.dryRun
83944
85245
  });
83945
85246
  return wrapResult(result2, "mutate", "admin", operation, startTime);
83946
85247
  }
83947
85248
  const result = systemBackup(
83948
- this.projectRoot,
85249
+ projectRoot,
83949
85250
  params
83950
85251
  );
83951
85252
  return wrapResult(result, "mutate", "admin", operation, startTime);
83952
85253
  }
83953
85254
  case "migrate": {
83954
85255
  const result = await systemMigrate(
83955
- this.projectRoot,
85256
+ projectRoot,
83956
85257
  params
83957
85258
  );
83958
85259
  return wrapResult(result, "mutate", "admin", operation, startTime);
@@ -83969,7 +85270,7 @@ var AdminHandler = class {
83969
85270
  startTime
83970
85271
  );
83971
85272
  }
83972
- const result = await systemCleanup(this.projectRoot, {
85273
+ const result = await systemCleanup(projectRoot, {
83973
85274
  target,
83974
85275
  olderThan: params?.olderThan,
83975
85276
  dryRun: params?.dryRun
@@ -84021,20 +85322,20 @@ var AdminHandler = class {
84021
85322
  }
84022
85323
  case "safestop": {
84023
85324
  const result = systemSafestop(
84024
- this.projectRoot,
85325
+ projectRoot,
84025
85326
  params
84026
85327
  );
84027
85328
  return wrapResult(result, "mutate", "admin", operation, startTime);
84028
85329
  }
84029
85330
  case "inject.generate": {
84030
- const result = await systemInjectGenerate(this.projectRoot);
85331
+ const result = await systemInjectGenerate(projectRoot);
84031
85332
  return wrapResult(result, "mutate", "admin", operation, startTime);
84032
85333
  }
84033
85334
  // adr.sync absorbs adr.validate via validate flag (T5615)
84034
85335
  case "adr.sync": {
84035
85336
  const validate = params?.validate;
84036
85337
  if (validate) {
84037
- const result2 = await validateAllAdrs(this.projectRoot);
85338
+ const result2 = await validateAllAdrs(projectRoot);
84038
85339
  return {
84039
85340
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
84040
85341
  success: result2.valid,
@@ -84047,7 +85348,7 @@ var AdminHandler = class {
84047
85348
  }
84048
85349
  };
84049
85350
  }
84050
- const result = await syncAdrsToDb(this.projectRoot);
85351
+ const result = await syncAdrsToDb(projectRoot);
84051
85352
  return {
84052
85353
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
84053
85354
  success: true,
@@ -84082,7 +85383,7 @@ var AdminHandler = class {
84082
85383
  }
84083
85384
  };
84084
85385
  }
84085
- const result2 = await importSnapshot(snapshot, this.projectRoot);
85386
+ const result2 = await importSnapshot(snapshot, projectRoot);
84086
85387
  return {
84087
85388
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
84088
85389
  success: true,
@@ -84118,7 +85419,7 @@ var AdminHandler = class {
84118
85419
  onConflict: params?.onConflict,
84119
85420
  onMissingDep: params?.onMissingDep,
84120
85421
  force: params?.force,
84121
- cwd: this.projectRoot
85422
+ cwd: projectRoot
84122
85423
  });
84123
85424
  return {
84124
85425
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
@@ -84144,7 +85445,7 @@ var AdminHandler = class {
84144
85445
  onDuplicate: params?.onDuplicate,
84145
85446
  addLabel: params?.addLabel,
84146
85447
  dryRun: params?.dryRun,
84147
- cwd: this.projectRoot
85448
+ cwd: projectRoot
84148
85449
  });
84149
85450
  return {
84150
85451
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
@@ -84154,8 +85455,8 @@ var AdminHandler = class {
84154
85455
  }
84155
85456
  case "detect": {
84156
85457
  const { ensureProjectContext: ensureProjectContext2, ensureContributorMcp: ensureContributorMcp2 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
84157
- const contextResult = await ensureProjectContext2(this.projectRoot, { force: true });
84158
- const mcpResult = await ensureContributorMcp2(this.projectRoot);
85458
+ const contextResult = await ensureProjectContext2(projectRoot, { force: true });
85459
+ const mcpResult = await ensureContributorMcp2(projectRoot);
84159
85460
  return wrapResult(
84160
85461
  {
84161
85462
  success: true,
@@ -84187,7 +85488,7 @@ var AdminHandler = class {
84187
85488
  requestPayload: params?.requestPayload,
84188
85489
  responsePayload: params?.responsePayload,
84189
85490
  metadata: params?.metadata,
84190
- cwd: this.projectRoot
85491
+ cwd: projectRoot
84191
85492
  });
84192
85493
  return {
84193
85494
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
@@ -84207,7 +85508,7 @@ var AdminHandler = class {
84207
85508
  startTime
84208
85509
  );
84209
85510
  }
84210
- const result = await deleteTokenUsage(tokenId, this.projectRoot);
85511
+ const result = await deleteTokenUsage(tokenId, projectRoot);
84211
85512
  return {
84212
85513
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
84213
85514
  success: true,
@@ -84230,7 +85531,7 @@ var AdminHandler = class {
84230
85531
  since: params?.since,
84231
85532
  until: params?.until
84232
85533
  },
84233
- this.projectRoot
85534
+ projectRoot
84234
85535
  );
84235
85536
  return {
84236
85537
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
@@ -84261,13 +85562,13 @@ var AdminHandler = class {
84261
85562
  taskId: params?.taskId,
84262
85563
  variant: params?.variant
84263
85564
  },
84264
- this.projectRoot
85565
+ projectRoot
84265
85566
  );
84266
85567
  return wrapResult(result, "mutate", "admin", operation, startTime);
84267
85568
  }
84268
85569
  case "map": {
84269
85570
  const { mapCodebase: mapCodebase3 } = await Promise.resolve().then(() => (init_codebase_map_engine(), codebase_map_engine_exports));
84270
- const result = await mapCodebase3(this.projectRoot, {
85571
+ const result = await mapCodebase3(projectRoot, {
84271
85572
  focus: params?.focus,
84272
85573
  storeToBrain: true
84273
85574
  });
@@ -84348,14 +85649,11 @@ var AdminHandler = class {
84348
85649
  // packages/cleo/src/dispatch/domains/check.ts
84349
85650
  init_internal();
84350
85651
  var CheckHandler = class {
84351
- projectRoot;
84352
- constructor() {
84353
- this.projectRoot = getProjectRoot();
84354
- }
84355
85652
  // -----------------------------------------------------------------------
84356
85653
  // Query
84357
85654
  // -----------------------------------------------------------------------
84358
85655
  async query(operation, params) {
85656
+ const projectRoot = getProjectRoot();
84359
85657
  const startTime = Date.now();
84360
85658
  try {
84361
85659
  switch (operation) {
@@ -84371,7 +85669,7 @@ var CheckHandler = class {
84371
85669
  startTime
84372
85670
  );
84373
85671
  }
84374
- const result = validateSchemaOp(type, params?.data, this.projectRoot);
85672
+ const result = validateSchemaOp(type, params?.data, projectRoot);
84375
85673
  return wrapResult(result, "query", "check", operation, startTime);
84376
85674
  }
84377
85675
  case "task": {
@@ -84386,11 +85684,11 @@ var CheckHandler = class {
84386
85684
  startTime
84387
85685
  );
84388
85686
  }
84389
- const result = await validateTask2(taskId, this.projectRoot);
85687
+ const result = await validateTask2(taskId, projectRoot);
84390
85688
  return wrapResult(result, "query", "check", operation, startTime);
84391
85689
  }
84392
85690
  case "manifest": {
84393
- const result = validateManifest(this.projectRoot);
85691
+ const result = validateManifest(projectRoot);
84394
85692
  return wrapResult(result, "query", "check", operation, startTime);
84395
85693
  }
84396
85694
  case "output": {
@@ -84408,7 +85706,7 @@ var CheckHandler = class {
84408
85706
  const result = validateOutput(
84409
85707
  filePath,
84410
85708
  params?.taskId,
84411
- this.projectRoot
85709
+ projectRoot
84412
85710
  );
84413
85711
  return wrapResult(result, "query", "check", operation, startTime);
84414
85712
  }
@@ -84416,23 +85714,23 @@ var CheckHandler = class {
84416
85714
  const detail = params?.detail;
84417
85715
  const limit = params?.limit;
84418
85716
  if (detail) {
84419
- const result2 = validateComplianceViolations(limit, this.projectRoot);
85717
+ const result2 = validateComplianceViolations(limit, projectRoot);
84420
85718
  return wrapResult(result2, "query", "check", operation, startTime);
84421
85719
  }
84422
- const result = validateComplianceSummary(this.projectRoot);
85720
+ const result = validateComplianceSummary(projectRoot);
84423
85721
  return wrapResult(result, "query", "check", operation, startTime);
84424
85722
  }
84425
85723
  case "test": {
84426
85724
  const format = params?.format;
84427
85725
  if (format === "coverage") {
84428
- const result2 = validateTestCoverage(this.projectRoot);
85726
+ const result2 = validateTestCoverage(projectRoot);
84429
85727
  return wrapResult(result2, "query", "check", operation, startTime);
84430
85728
  }
84431
- const result = validateTestStatus(this.projectRoot);
85729
+ const result = validateTestStatus(projectRoot);
84432
85730
  return wrapResult(result, "query", "check", operation, startTime);
84433
85731
  }
84434
85732
  case "coherence": {
84435
- const result = await validateCoherenceCheck(this.projectRoot);
85733
+ const result = await validateCoherenceCheck(projectRoot);
84436
85734
  return wrapResult(result, "query", "check", operation, startTime);
84437
85735
  }
84438
85736
  case "protocol": {
@@ -84451,12 +85749,12 @@ var CheckHandler = class {
84451
85749
  ...protocolParams,
84452
85750
  votingMatrixFile: params?.votingMatrixFile
84453
85751
  },
84454
- this.projectRoot
85752
+ projectRoot
84455
85753
  );
84456
85754
  return wrapResult(result, "query", "check", operation, startTime);
84457
85755
  }
84458
85756
  case "contribution": {
84459
- const result = await validateProtocolContribution(protocolParams, this.projectRoot);
85757
+ const result = await validateProtocolContribution(protocolParams, projectRoot);
84460
85758
  return wrapResult(result, "query", "check", operation, startTime);
84461
85759
  }
84462
85760
  case "decomposition": {
@@ -84465,12 +85763,12 @@ var CheckHandler = class {
84465
85763
  ...protocolParams,
84466
85764
  epicId: params?.epicId
84467
85765
  },
84468
- this.projectRoot
85766
+ projectRoot
84469
85767
  );
84470
85768
  return wrapResult(result, "query", "check", operation, startTime);
84471
85769
  }
84472
85770
  case "implementation": {
84473
- const result = await validateProtocolImplementation(protocolParams, this.projectRoot);
85771
+ const result = await validateProtocolImplementation(protocolParams, projectRoot);
84474
85772
  return wrapResult(result, "query", "check", operation, startTime);
84475
85773
  }
84476
85774
  case "specification": {
@@ -84479,7 +85777,7 @@ var CheckHandler = class {
84479
85777
  ...protocolParams,
84480
85778
  specFile: params?.specFile
84481
85779
  },
84482
- this.projectRoot
85780
+ projectRoot
84483
85781
  );
84484
85782
  return wrapResult(result, "query", "check", operation, startTime);
84485
85783
  }
@@ -84495,7 +85793,7 @@ var CheckHandler = class {
84495
85793
  startTime
84496
85794
  );
84497
85795
  }
84498
- const result = await validateProtocol(taskId, protocolType, this.projectRoot);
85796
+ const result = await validateProtocol(taskId, protocolType, projectRoot);
84499
85797
  return wrapResult(result, "query", "check", operation, startTime);
84500
85798
  }
84501
85799
  }
@@ -84512,11 +85810,11 @@ var CheckHandler = class {
84512
85810
  startTime
84513
85811
  );
84514
85812
  }
84515
- const result = await validateGateVerify({ taskId }, this.projectRoot);
85813
+ const result = await validateGateVerify({ taskId }, projectRoot);
84516
85814
  return wrapResult(result, "query", "check", operation, startTime);
84517
85815
  }
84518
85816
  case "archive.stats": {
84519
- const result = await systemArchiveStats(this.projectRoot);
85817
+ const result = await systemArchiveStats(projectRoot);
84520
85818
  return wrapResult(result, "query", "check", operation, startTime);
84521
85819
  }
84522
85820
  // T5405: WarpChain validation
@@ -84555,7 +85853,7 @@ var CheckHandler = class {
84555
85853
  startTime
84556
85854
  );
84557
85855
  }
84558
- const gradeResult = await gradeSession2(sessionId, this.projectRoot);
85856
+ const gradeResult = await gradeSession2(sessionId, projectRoot);
84559
85857
  return wrapResult(
84560
85858
  { success: true, data: gradeResult },
84561
85859
  "query",
@@ -84568,7 +85866,7 @@ var CheckHandler = class {
84568
85866
  const { readGrades: readGrades2 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
84569
85867
  const limit = typeof params?.limit === "number" ? params.limit : void 0;
84570
85868
  const offset = typeof params?.offset === "number" ? params.offset : void 0;
84571
- const allGrades = await readGrades2(void 0, this.projectRoot);
85869
+ const allGrades = await readGrades2(void 0, projectRoot);
84572
85870
  const sessionId = params?.sessionId;
84573
85871
  const filteredGrades = sessionId ? allGrades.filter((g) => g.sessionId === sessionId) : allGrades;
84574
85872
  const page = paginate(filteredGrades, limit, offset);
@@ -84599,6 +85897,7 @@ var CheckHandler = class {
84599
85897
  // Mutate
84600
85898
  // -----------------------------------------------------------------------
84601
85899
  async mutate(operation, params) {
85900
+ const projectRoot = getProjectRoot();
84602
85901
  const startTime = Date.now();
84603
85902
  try {
84604
85903
  switch (operation) {
@@ -84620,14 +85919,14 @@ var CheckHandler = class {
84620
85919
  result,
84621
85920
  params?.protocol,
84622
85921
  params?.violations,
84623
- this.projectRoot
85922
+ projectRoot
84624
85923
  );
84625
85924
  return wrapResult(engineResult, "mutate", "check", operation, startTime);
84626
85925
  }
84627
85926
  case "test.run": {
84628
85927
  const result = validateTestRun(
84629
85928
  params,
84630
- this.projectRoot
85929
+ projectRoot
84631
85930
  );
84632
85931
  return wrapResult(result, "mutate", "check", operation, startTime);
84633
85932
  }
@@ -84635,7 +85934,7 @@ var CheckHandler = class {
84635
85934
  const { syncComplianceMetrics: syncComplianceMetrics2 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
84636
85935
  const result = await syncComplianceMetrics2({
84637
85936
  force: params?.force,
84638
- cwd: this.projectRoot
85937
+ cwd: projectRoot
84639
85938
  });
84640
85939
  return {
84641
85940
  _meta: dispatchMeta("mutate", "check", operation, startTime),
@@ -84663,7 +85962,7 @@ var CheckHandler = class {
84663
85962
  all: params?.all,
84664
85963
  reset: params?.reset
84665
85964
  };
84666
- const result = await validateGateVerify(gateParams, this.projectRoot);
85965
+ const result = await validateGateVerify(gateParams, projectRoot);
84667
85966
  return wrapResult(result, "mutate", "check", operation, startTime);
84668
85967
  }
84669
85968
  default:
@@ -84706,14 +86005,11 @@ var CheckHandler = class {
84706
86005
  // packages/cleo/src/dispatch/domains/memory.ts
84707
86006
  init_src2();
84708
86007
  var MemoryHandler = class {
84709
- projectRoot;
84710
- constructor() {
84711
- this.projectRoot = getProjectRoot();
84712
- }
84713
86008
  // -----------------------------------------------------------------------
84714
86009
  // Query
84715
86010
  // -----------------------------------------------------------------------
84716
86011
  async query(operation, params) {
86012
+ const projectRoot = getProjectRoot();
84717
86013
  const startTime = Date.now();
84718
86014
  try {
84719
86015
  switch (operation) {
@@ -84737,7 +86033,7 @@ var MemoryHandler = class {
84737
86033
  dateStart: params?.dateStart,
84738
86034
  dateEnd: params?.dateEnd
84739
86035
  },
84740
- this.projectRoot
86036
+ projectRoot
84741
86037
  );
84742
86038
  return wrapResult(result, "query", "memory", operation, startTime);
84743
86039
  }
@@ -84759,7 +86055,7 @@ var MemoryHandler = class {
84759
86055
  depthBefore: params?.depthBefore,
84760
86056
  depthAfter: params?.depthAfter
84761
86057
  },
84762
- this.projectRoot
86058
+ projectRoot
84763
86059
  );
84764
86060
  return wrapResult(result, "query", "memory", operation, startTime);
84765
86061
  }
@@ -84775,7 +86071,7 @@ var MemoryHandler = class {
84775
86071
  startTime
84776
86072
  );
84777
86073
  }
84778
- const result = await memoryFetch({ ids }, this.projectRoot);
86074
+ const result = await memoryFetch({ ids }, projectRoot);
84779
86075
  return wrapResult(result, "query", "memory", operation, startTime);
84780
86076
  }
84781
86077
  case "decision.find": {
@@ -84785,7 +86081,7 @@ var MemoryHandler = class {
84785
86081
  taskId: params?.taskId,
84786
86082
  limit: params?.limit
84787
86083
  },
84788
- this.projectRoot
86084
+ projectRoot
84789
86085
  );
84790
86086
  return wrapResult(result, "query", "memory", operation, startTime);
84791
86087
  }
@@ -84798,7 +86094,7 @@ var MemoryHandler = class {
84798
86094
  minFrequency: params?.minFrequency,
84799
86095
  limit: params?.limit
84800
86096
  },
84801
- this.projectRoot
86097
+ projectRoot
84802
86098
  );
84803
86099
  return wrapResult(result, "query", "memory", operation, startTime);
84804
86100
  }
@@ -84811,7 +86107,7 @@ var MemoryHandler = class {
84811
86107
  applicableType: params?.applicableType,
84812
86108
  limit: params?.limit
84813
86109
  },
84814
- this.projectRoot
86110
+ projectRoot
84815
86111
  );
84816
86112
  return wrapResult(result, "query", "memory", operation, startTime);
84817
86113
  }
@@ -84827,7 +86123,7 @@ var MemoryHandler = class {
84827
86123
  startTime
84828
86124
  );
84829
86125
  }
84830
- const result = await memoryGraphShow({ nodeId }, this.projectRoot);
86126
+ const result = await memoryGraphShow({ nodeId }, projectRoot);
84831
86127
  return wrapResult(result, "query", "memory", operation, startTime);
84832
86128
  }
84833
86129
  case "graph.neighbors": {
@@ -84844,7 +86140,7 @@ var MemoryHandler = class {
84844
86140
  }
84845
86141
  const result = await memoryGraphNeighbors(
84846
86142
  { nodeId, edgeType: params?.edgeType },
84847
- this.projectRoot
86143
+ projectRoot
84848
86144
  );
84849
86145
  return wrapResult(result, "query", "memory", operation, startTime);
84850
86146
  }
@@ -84860,7 +86156,7 @@ var MemoryHandler = class {
84860
86156
  startTime
84861
86157
  );
84862
86158
  }
84863
- const result = await memoryReasonWhy({ taskId }, this.projectRoot);
86159
+ const result = await memoryReasonWhy({ taskId }, projectRoot);
84864
86160
  return wrapResult(result, "query", "memory", operation, startTime);
84865
86161
  }
84866
86162
  case "reason.similar": {
@@ -84877,7 +86173,7 @@ var MemoryHandler = class {
84877
86173
  }
84878
86174
  const result = await memoryReasonSimilar(
84879
86175
  { entryId, limit: params?.limit },
84880
- this.projectRoot
86176
+ projectRoot
84881
86177
  );
84882
86178
  return wrapResult(result, "query", "memory", operation, startTime);
84883
86179
  }
@@ -84901,7 +86197,7 @@ var MemoryHandler = class {
84901
86197
  graphWeight: params?.graphWeight,
84902
86198
  limit: params?.limit
84903
86199
  },
84904
- this.projectRoot
86200
+ projectRoot
84905
86201
  );
84906
86202
  return wrapResult(result, "query", "memory", operation, startTime);
84907
86203
  }
@@ -84921,6 +86217,7 @@ var MemoryHandler = class {
84921
86217
  // Mutate
84922
86218
  // -----------------------------------------------------------------------
84923
86219
  async mutate(operation, params) {
86220
+ const projectRoot = getProjectRoot();
84924
86221
  const startTime = Date.now();
84925
86222
  try {
84926
86223
  switch (operation) {
@@ -84945,7 +86242,7 @@ var MemoryHandler = class {
84945
86242
  sourceSessionId: params?.sourceSessionId,
84946
86243
  sourceType: params?.sourceType
84947
86244
  },
84948
- this.projectRoot
86245
+ projectRoot
84949
86246
  );
84950
86247
  return wrapResult(result, "mutate", "memory", operation, startTime);
84951
86248
  }
@@ -84970,7 +86267,7 @@ var MemoryHandler = class {
84970
86267
  taskId: params?.taskId,
84971
86268
  sessionId: params?.sessionId
84972
86269
  },
84973
- this.projectRoot
86270
+ projectRoot
84974
86271
  );
84975
86272
  return wrapResult(result, "mutate", "memory", operation, startTime);
84976
86273
  }
@@ -84998,7 +86295,7 @@ var MemoryHandler = class {
84998
86295
  examples: params?.examples,
84999
86296
  successRate: params?.successRate
85000
86297
  },
85001
- this.projectRoot
86298
+ projectRoot
85002
86299
  );
85003
86300
  return wrapResult(result, "mutate", "memory", operation, startTime);
85004
86301
  }
@@ -85024,7 +86321,7 @@ var MemoryHandler = class {
85024
86321
  application: params?.application,
85025
86322
  applicableTypes: params?.applicableTypes
85026
86323
  },
85027
- this.projectRoot
86324
+ projectRoot
85028
86325
  );
85029
86326
  return wrapResult(result, "mutate", "memory", operation, startTime);
85030
86327
  }
@@ -85041,7 +86338,7 @@ var MemoryHandler = class {
85041
86338
  startTime
85042
86339
  );
85043
86340
  }
85044
- const result = await memoryLink({ taskId, entryId }, this.projectRoot);
86341
+ const result = await memoryLink({ taskId, entryId }, projectRoot);
85045
86342
  return wrapResult(result, "mutate", "memory", operation, startTime);
85046
86343
  }
85047
86344
  case "graph.add": {
@@ -85056,7 +86353,7 @@ var MemoryHandler = class {
85056
86353
  edgeType: params?.edgeType,
85057
86354
  weight: params?.weight
85058
86355
  },
85059
- this.projectRoot
86356
+ projectRoot
85060
86357
  );
85061
86358
  return wrapResult(result, "mutate", "memory", operation, startTime);
85062
86359
  }
@@ -85068,7 +86365,7 @@ var MemoryHandler = class {
85068
86365
  toId: params?.toId,
85069
86366
  edgeType: params?.edgeType
85070
86367
  },
85071
- this.projectRoot
86368
+ projectRoot
85072
86369
  );
85073
86370
  return wrapResult(result, "mutate", "memory", operation, startTime);
85074
86371
  }
@@ -85357,14 +86654,11 @@ async function nexusTransferExecute(params) {
85357
86654
 
85358
86655
  // packages/cleo/src/dispatch/domains/nexus.ts
85359
86656
  var NexusHandler = class {
85360
- projectRoot;
85361
- constructor() {
85362
- this.projectRoot = getProjectRoot();
85363
- }
85364
86657
  // -----------------------------------------------------------------------
85365
86658
  // Query
85366
86659
  // -----------------------------------------------------------------------
85367
86660
  async query(operation, params) {
86661
+ const projectRoot = getProjectRoot();
85368
86662
  const startTime = Date.now();
85369
86663
  try {
85370
86664
  switch (operation) {
@@ -85512,7 +86806,7 @@ var NexusHandler = class {
85512
86806
  return wrapResult(result, "query", "nexus", operation, startTime);
85513
86807
  }
85514
86808
  case "share.status": {
85515
- const result = await nexusShareStatus(this.projectRoot);
86809
+ const result = await nexusShareStatus(projectRoot);
85516
86810
  return wrapResult(result, "query", "nexus", "share.status", startTime);
85517
86811
  }
85518
86812
  case "transfer.preview": {
@@ -85553,6 +86847,7 @@ var NexusHandler = class {
85553
86847
  // Mutate
85554
86848
  // -----------------------------------------------------------------------
85555
86849
  async mutate(operation, params) {
86850
+ const projectRoot = getProjectRoot();
85556
86851
  const startTime = Date.now();
85557
86852
  try {
85558
86853
  switch (operation) {
@@ -85636,13 +86931,13 @@ var NexusHandler = class {
85636
86931
  return wrapResult(result, "mutate", "nexus", operation, startTime);
85637
86932
  }
85638
86933
  case "reconcile": {
85639
- const projectRoot = params?.projectRoot || process.cwd();
85640
- const result = await nexusReconcileProject(projectRoot);
86934
+ const projectRoot2 = params?.projectRoot || process.cwd();
86935
+ const result = await nexusReconcileProject(projectRoot2);
85641
86936
  return wrapResult(result, "mutate", "nexus", operation, startTime);
85642
86937
  }
85643
86938
  case "share.snapshot.export": {
85644
86939
  const outputPath = params?.outputPath;
85645
- const result = await nexusShareSnapshotExport(this.projectRoot, outputPath);
86940
+ const result = await nexusShareSnapshotExport(projectRoot, outputPath);
85646
86941
  return wrapResult(result, "mutate", "nexus", "share.snapshot.export", startTime);
85647
86942
  }
85648
86943
  case "share.snapshot.import": {
@@ -85657,7 +86952,7 @@ var NexusHandler = class {
85657
86952
  startTime
85658
86953
  );
85659
86954
  }
85660
- const result = await nexusShareSnapshotImport(this.projectRoot, inputPath);
86955
+ const result = await nexusShareSnapshotImport(projectRoot, inputPath);
85661
86956
  return wrapResult(result, "mutate", "nexus", "share.snapshot.import", startTime);
85662
86957
  }
85663
86958
  case "transfer": {
@@ -85734,20 +87029,17 @@ var NexusHandler = class {
85734
87029
  // packages/cleo/src/dispatch/domains/orchestrate.ts
85735
87030
  init_internal();
85736
87031
  var OrchestrateHandler = class {
85737
- projectRoot;
85738
- constructor() {
85739
- this.projectRoot = getProjectRoot();
85740
- }
85741
87032
  // -----------------------------------------------------------------------
85742
87033
  // DomainHandler interface
85743
87034
  // -----------------------------------------------------------------------
85744
87035
  async query(operation, params) {
87036
+ const projectRoot = getProjectRoot();
85745
87037
  const startTime = Date.now();
85746
87038
  try {
85747
87039
  switch (operation) {
85748
87040
  case "status": {
85749
87041
  const epicId = params?.epicId;
85750
- const result = await orchestrateStatus(epicId, this.projectRoot);
87042
+ const result = await orchestrateStatus(epicId, projectRoot);
85751
87043
  return wrapResult(result, "query", "orchestrate", operation, startTime);
85752
87044
  }
85753
87045
  case "next": {
@@ -85762,7 +87054,7 @@ var OrchestrateHandler = class {
85762
87054
  startTime
85763
87055
  );
85764
87056
  }
85765
- const result = await orchestrateNext(epicId, this.projectRoot);
87057
+ const result = await orchestrateNext(epicId, projectRoot);
85766
87058
  return wrapResult(result, "query", "orchestrate", operation, startTime);
85767
87059
  }
85768
87060
  case "ready": {
@@ -85777,18 +87069,18 @@ var OrchestrateHandler = class {
85777
87069
  startTime
85778
87070
  );
85779
87071
  }
85780
- const result = await orchestrateReady(epicId, this.projectRoot);
87072
+ const result = await orchestrateReady(epicId, projectRoot);
85781
87073
  return wrapResult(result, "query", "orchestrate", operation, startTime);
85782
87074
  }
85783
87075
  case "analyze": {
85784
87076
  const epicId = params?.epicId;
85785
87077
  const mode = params?.mode;
85786
- const result = await orchestrateAnalyze(epicId, this.projectRoot, mode);
87078
+ const result = await orchestrateAnalyze(epicId, projectRoot, mode);
85787
87079
  return wrapResult(result, "query", "orchestrate", "analyze", startTime);
85788
87080
  }
85789
87081
  case "context": {
85790
87082
  const epicId = params?.epicId;
85791
- const result = await orchestrateContext(epicId, this.projectRoot);
87083
+ const result = await orchestrateContext(epicId, projectRoot);
85792
87084
  return wrapResult(result, "query", "orchestrate", operation, startTime);
85793
87085
  }
85794
87086
  case "waves": {
@@ -85803,16 +87095,16 @@ var OrchestrateHandler = class {
85803
87095
  startTime
85804
87096
  );
85805
87097
  }
85806
- const result = await orchestrateWaves(epicId, this.projectRoot);
87098
+ const result = await orchestrateWaves(epicId, projectRoot);
85807
87099
  return wrapResult(result, "query", "orchestrate", operation, startTime);
85808
87100
  }
85809
87101
  case "bootstrap": {
85810
87102
  const speed = params?.speed;
85811
- const result = await orchestrateBootstrap(this.projectRoot, { speed });
87103
+ const result = await orchestrateBootstrap(projectRoot, { speed });
85812
87104
  return wrapResult(result, "query", "orchestrate", operation, startTime);
85813
87105
  }
85814
87106
  case "unblock.opportunities": {
85815
- const result = await orchestrateUnblockOpportunities(this.projectRoot);
87107
+ const result = await orchestrateUnblockOpportunities(projectRoot);
85816
87108
  return wrapResult(result, "query", "orchestrate", operation, startTime);
85817
87109
  }
85818
87110
  case "tessera.list": {
@@ -85869,6 +87161,7 @@ var OrchestrateHandler = class {
85869
87161
  }
85870
87162
  }
85871
87163
  async mutate(operation, params) {
87164
+ const projectRoot = getProjectRoot();
85872
87165
  const startTime = Date.now();
85873
87166
  try {
85874
87167
  switch (operation) {
@@ -85884,7 +87177,7 @@ var OrchestrateHandler = class {
85884
87177
  startTime
85885
87178
  );
85886
87179
  }
85887
- const result = await orchestrateStartup(epicId, this.projectRoot);
87180
+ const result = await orchestrateStartup(epicId, projectRoot);
85888
87181
  return wrapResult(result, "mutate", "orchestrate", operation, startTime);
85889
87182
  }
85890
87183
  case "spawn": {
@@ -85901,7 +87194,7 @@ var OrchestrateHandler = class {
85901
87194
  }
85902
87195
  const protocolType = params?.protocolType;
85903
87196
  const tier = params?.tier;
85904
- const result = await orchestrateSpawn(taskId, protocolType, this.projectRoot, tier);
87197
+ const result = await orchestrateSpawn(taskId, protocolType, projectRoot, tier);
85905
87198
  return wrapResult(result, "mutate", "orchestrate", operation, startTime);
85906
87199
  }
85907
87200
  case "handoff": {
@@ -85938,7 +87231,7 @@ var OrchestrateHandler = class {
85938
87231
  tier,
85939
87232
  idempotencyKey: params?.idempotencyKey
85940
87233
  },
85941
- this.projectRoot
87234
+ projectRoot
85942
87235
  );
85943
87236
  return wrapResult(result, "mutate", "orchestrate", operation, startTime);
85944
87237
  }
@@ -85961,7 +87254,7 @@ var OrchestrateHandler = class {
85961
87254
  taskId,
85962
87255
  adapterId,
85963
87256
  protocolType,
85964
- this.projectRoot,
87257
+ projectRoot,
85965
87258
  tier
85966
87259
  );
85967
87260
  return wrapResult(result, "mutate", "orchestrate", operation, startTime);
@@ -85978,7 +87271,7 @@ var OrchestrateHandler = class {
85978
87271
  startTime
85979
87272
  );
85980
87273
  }
85981
- const result = await orchestrateValidate(taskId, this.projectRoot);
87274
+ const result = await orchestrateValidate(taskId, projectRoot);
85982
87275
  return wrapResult(result, "mutate", "orchestrate", operation, startTime);
85983
87276
  }
85984
87277
  case "parallel": {
@@ -86006,7 +87299,7 @@ var OrchestrateHandler = class {
86006
87299
  startTime
86007
87300
  );
86008
87301
  }
86009
- const result = await orchestrateParallelStart(epicId, wave, this.projectRoot);
87302
+ const result = await orchestrateParallelStart(epicId, wave, projectRoot);
86010
87303
  return wrapResult(result, "mutate", "orchestrate", "parallel", startTime);
86011
87304
  },
86012
87305
  end: async () => {
@@ -86032,7 +87325,7 @@ var OrchestrateHandler = class {
86032
87325
  startTime
86033
87326
  );
86034
87327
  }
86035
- const result = await orchestrateParallelEnd(epicId, wave, this.projectRoot);
87328
+ const result = await orchestrateParallelEnd(epicId, wave, projectRoot);
86036
87329
  return wrapResult(result, "mutate", "orchestrate", "parallel", startTime);
86037
87330
  }
86038
87331
  });
@@ -86075,7 +87368,7 @@ var OrchestrateHandler = class {
86075
87368
  const instance = await instantiateTessera(
86076
87369
  template,
86077
87370
  { templateId, epicId, variables: { epicId, ...variables } },
86078
- this.projectRoot
87371
+ projectRoot
86079
87372
  );
86080
87373
  return {
86081
87374
  _meta: dispatchMeta("mutate", "orchestrate", operation, startTime),
@@ -86131,9 +87424,8 @@ var OrchestrateHandler = class {
86131
87424
  init_internal();
86132
87425
  import { execFileSync as execFileSync13 } from "node:child_process";
86133
87426
  var PipelineHandler = class {
86134
- projectRoot;
86135
- constructor() {
86136
- this.projectRoot = getProjectRoot();
87427
+ get projectRoot() {
87428
+ return getProjectRoot();
86137
87429
  }
86138
87430
  // -----------------------------------------------------------------------
86139
87431
  // DomainHandler interface
@@ -87006,24 +88298,21 @@ function unbindSession() {
87006
88298
 
87007
88299
  // packages/cleo/src/dispatch/domains/session.ts
87008
88300
  var SessionHandler = class {
87009
- projectRoot;
87010
- constructor() {
87011
- this.projectRoot = getProjectRoot();
87012
- }
87013
88301
  // -----------------------------------------------------------------------
87014
88302
  // Query
87015
88303
  // -----------------------------------------------------------------------
87016
88304
  async query(operation, params) {
88305
+ const projectRoot = getProjectRoot();
87017
88306
  const startTime = Date.now();
87018
88307
  try {
87019
88308
  switch (operation) {
87020
88309
  case "status": {
87021
- const result = await sessionStatus2(this.projectRoot);
88310
+ const result = await sessionStatus2(projectRoot);
87022
88311
  return wrapResult(result, "query", "session", operation, startTime);
87023
88312
  }
87024
88313
  case "list": {
87025
88314
  const result = await sessionList(
87026
- this.projectRoot,
88315
+ projectRoot,
87027
88316
  params
87028
88317
  );
87029
88318
  return wrapResult(result, "query", "session", operation, startTime);
@@ -87043,24 +88332,21 @@ var SessionHandler = class {
87043
88332
  }
87044
88333
  const include = params?.include;
87045
88334
  if (include === "debrief") {
87046
- const result2 = await sessionDebriefShow(this.projectRoot, sessionId);
88335
+ const result2 = await sessionDebriefShow(projectRoot, sessionId);
87047
88336
  return wrapResult(result2, "query", "session", operation, startTime);
87048
88337
  }
87049
- const result = await sessionShow(this.projectRoot, sessionId);
88338
+ const result = await sessionShow(projectRoot, sessionId);
87050
88339
  return wrapResult(result, "query", "session", operation, startTime);
87051
88340
  }
87052
88341
  case "decision.log": {
87053
88342
  const result = await sessionDecisionLog(
87054
- this.projectRoot,
88343
+ projectRoot,
87055
88344
  params
87056
88345
  );
87057
88346
  return wrapResult(result, "query", "session", operation, startTime);
87058
88347
  }
87059
88348
  case "context.drift": {
87060
- const result = await sessionContextDrift(
87061
- this.projectRoot,
87062
- params
87063
- );
88349
+ const result = await sessionContextDrift(projectRoot, params);
87064
88350
  return wrapResult(result, "query", "session", operation, startTime);
87065
88351
  }
87066
88352
  case "handoff.show": {
@@ -87073,11 +88359,11 @@ var SessionHandler = class {
87073
88359
  scopeFilter = { type: "epic", epicId: scope.replace("epic:", "") };
87074
88360
  }
87075
88361
  }
87076
- const result = await sessionHandoff(this.projectRoot, scopeFilter);
88362
+ const result = await sessionHandoff(projectRoot, scopeFilter);
87077
88363
  return wrapResult(result, "query", "session", operation, startTime);
87078
88364
  }
87079
88365
  case "briefing.show": {
87080
- const result = await sessionBriefing(this.projectRoot, {
88366
+ const result = await sessionBriefing(projectRoot, {
87081
88367
  maxNextTasks: params?.maxNextTasks,
87082
88368
  maxBugs: params?.maxBugs,
87083
88369
  maxBlocked: params?.maxBlocked,
@@ -87088,7 +88374,7 @@ var SessionHandler = class {
87088
88374
  }
87089
88375
  case "find": {
87090
88376
  const result = await sessionFind(
87091
- this.projectRoot,
88377
+ projectRoot,
87092
88378
  params
87093
88379
  );
87094
88380
  return wrapResult(result, "query", "session", operation, startTime);
@@ -87108,6 +88394,7 @@ var SessionHandler = class {
87108
88394
  // Mutate
87109
88395
  // -----------------------------------------------------------------------
87110
88396
  async mutate(operation, params) {
88397
+ const projectRoot = getProjectRoot();
87111
88398
  const startTime = Date.now();
87112
88399
  try {
87113
88400
  switch (operation) {
@@ -87123,7 +88410,7 @@ var SessionHandler = class {
87123
88410
  startTime
87124
88411
  );
87125
88412
  }
87126
- const result = await sessionStart(this.projectRoot, {
88413
+ const result = await sessionStart(projectRoot, {
87127
88414
  scope,
87128
88415
  name: params?.name,
87129
88416
  autoStart: params?.autoStart,
@@ -87154,19 +88441,19 @@ var SessionHandler = class {
87154
88441
  return wrapResult(result, "mutate", "session", operation, startTime);
87155
88442
  }
87156
88443
  case "end": {
87157
- const endResult = await sessionEnd(this.projectRoot, params?.note);
88444
+ const endResult = await sessionEnd(projectRoot, params?.note);
87158
88445
  if (endResult.success && endResult.data) {
87159
88446
  const sessionId = endResult.data.sessionId;
87160
88447
  if (sessionId) {
87161
88448
  let debriefResult = null;
87162
88449
  try {
87163
- debriefResult = await sessionComputeDebrief(this.projectRoot, sessionId, {
88450
+ debriefResult = await sessionComputeDebrief(projectRoot, sessionId, {
87164
88451
  note: params?.note,
87165
88452
  nextAction: params?.nextAction
87166
88453
  });
87167
88454
  } catch {
87168
88455
  try {
87169
- await sessionComputeHandoff(this.projectRoot, sessionId, {
88456
+ await sessionComputeHandoff(projectRoot, sessionId, {
87170
88457
  note: params?.note,
87171
88458
  nextAction: params?.nextAction
87172
88459
  });
@@ -87176,7 +88463,7 @@ var SessionHandler = class {
87176
88463
  if (debriefResult?.success && debriefResult.data) {
87177
88464
  try {
87178
88465
  const { persistSessionMemory: persistSessionMemory2 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
87179
- await persistSessionMemory2(this.projectRoot, sessionId, debriefResult.data);
88466
+ await persistSessionMemory2(projectRoot, sessionId, debriefResult.data);
87180
88467
  } catch {
87181
88468
  }
87182
88469
  }
@@ -87197,7 +88484,7 @@ var SessionHandler = class {
87197
88484
  startTime
87198
88485
  );
87199
88486
  }
87200
- const result = await sessionResume(this.projectRoot, sessionId);
88487
+ const result = await sessionResume(projectRoot, sessionId);
87201
88488
  return wrapResult(result, "mutate", "session", operation, startTime);
87202
88489
  }
87203
88490
  case "suspend": {
@@ -87213,21 +88500,18 @@ var SessionHandler = class {
87213
88500
  );
87214
88501
  }
87215
88502
  const result = await sessionSuspend(
87216
- this.projectRoot,
88503
+ projectRoot,
87217
88504
  sessionId,
87218
88505
  params?.reason
87219
88506
  );
87220
88507
  return wrapResult(result, "mutate", "session", operation, startTime);
87221
88508
  }
87222
88509
  case "gc": {
87223
- const result = await sessionGc(
87224
- this.projectRoot,
87225
- params?.maxAgeDays
87226
- );
88510
+ const result = await sessionGc(projectRoot, params?.maxAgeDays);
87227
88511
  return wrapResult(result, "mutate", "session", operation, startTime);
87228
88512
  }
87229
88513
  case "record.decision": {
87230
- const result = await sessionRecordDecision(this.projectRoot, {
88514
+ const result = await sessionRecordDecision(projectRoot, {
87231
88515
  sessionId: params?.sessionId,
87232
88516
  taskId: params?.taskId,
87233
88517
  decision: params?.decision,
@@ -87237,7 +88521,7 @@ var SessionHandler = class {
87237
88521
  return wrapResult(result, "mutate", "session", operation, startTime);
87238
88522
  }
87239
88523
  case "record.assumption": {
87240
- const result = await sessionRecordAssumption(this.projectRoot, {
88524
+ const result = await sessionRecordAssumption(projectRoot, {
87241
88525
  sessionId: params?.sessionId,
87242
88526
  taskId: params?.taskId,
87243
88527
  assumption: params?.assumption,
@@ -87378,14 +88662,11 @@ async function stickyPurge(projectRoot, id) {
87378
88662
 
87379
88663
  // packages/cleo/src/dispatch/domains/sticky.ts
87380
88664
  var StickyHandler = class {
87381
- projectRoot;
87382
- constructor() {
87383
- this.projectRoot = getProjectRoot();
87384
- }
87385
88665
  // -----------------------------------------------------------------------
87386
88666
  // Query
87387
88667
  // -----------------------------------------------------------------------
87388
88668
  async query(operation, params) {
88669
+ const projectRoot = getProjectRoot();
87389
88670
  const startTime = Date.now();
87390
88671
  try {
87391
88672
  switch (operation) {
@@ -87395,13 +88676,13 @@ var StickyHandler = class {
87395
88676
  color: params?.color,
87396
88677
  priority: params?.priority
87397
88678
  };
87398
- const result = await stickyList(this.projectRoot, filters);
88679
+ const result = await stickyList(projectRoot, filters);
87399
88680
  if (!result.success) {
87400
88681
  return wrapResult(result, "query", "sticky", operation, startTime);
87401
88682
  }
87402
88683
  const filteredStickies = result.data?.stickies ?? [];
87403
88684
  const hasFilter = filters.status !== void 0 || filters.color !== void 0 || filters.priority !== void 0;
87404
- const totalResult = hasFilter ? await stickyList(this.projectRoot, {}) : result;
88685
+ const totalResult = hasFilter ? await stickyList(projectRoot, {}) : result;
87405
88686
  if (!totalResult.success) {
87406
88687
  return wrapResult(totalResult, "query", "sticky", operation, startTime);
87407
88688
  }
@@ -87431,7 +88712,7 @@ var StickyHandler = class {
87431
88712
  startTime
87432
88713
  );
87433
88714
  }
87434
- const result = await stickyShow(this.projectRoot, stickyId);
88715
+ const result = await stickyShow(projectRoot, stickyId);
87435
88716
  return wrapResult(result, "query", "sticky", operation, startTime);
87436
88717
  }
87437
88718
  default:
@@ -87450,6 +88731,7 @@ var StickyHandler = class {
87450
88731
  // Mutate
87451
88732
  // -----------------------------------------------------------------------
87452
88733
  async mutate(operation, params) {
88734
+ const projectRoot = getProjectRoot();
87453
88735
  const startTime = Date.now();
87454
88736
  try {
87455
88737
  switch (operation) {
@@ -87465,7 +88747,7 @@ var StickyHandler = class {
87465
88747
  startTime
87466
88748
  );
87467
88749
  }
87468
- const result = await stickyAdd(this.projectRoot, {
88750
+ const result = await stickyAdd(projectRoot, {
87469
88751
  content,
87470
88752
  tags: params?.tags,
87471
88753
  color: params?.color,
@@ -87498,7 +88780,7 @@ var StickyHandler = class {
87498
88780
  }
87499
88781
  if (targetType === "task") {
87500
88782
  const result = await stickyConvertToTask(
87501
- this.projectRoot,
88783
+ projectRoot,
87502
88784
  stickyId,
87503
88785
  params?.title
87504
88786
  );
@@ -87515,18 +88797,18 @@ var StickyHandler = class {
87515
88797
  startTime
87516
88798
  );
87517
88799
  }
87518
- const result = await stickyConvertToTaskNote(this.projectRoot, stickyId, taskId);
88800
+ const result = await stickyConvertToTaskNote(projectRoot, stickyId, taskId);
87519
88801
  return wrapResult(result, "mutate", "sticky", operation, startTime);
87520
88802
  } else if (targetType === "session_note") {
87521
88803
  const result = await stickyConvertToSessionNote(
87522
- this.projectRoot,
88804
+ projectRoot,
87523
88805
  stickyId,
87524
88806
  params?.sessionId
87525
88807
  );
87526
88808
  return wrapResult(result, "mutate", "sticky", operation, startTime);
87527
88809
  } else {
87528
88810
  const result = await stickyConvertToMemory(
87529
- this.projectRoot,
88811
+ projectRoot,
87530
88812
  stickyId,
87531
88813
  params?.memoryType
87532
88814
  );
@@ -87545,7 +88827,7 @@ var StickyHandler = class {
87545
88827
  startTime
87546
88828
  );
87547
88829
  }
87548
- const result = await stickyArchive(this.projectRoot, stickyId);
88830
+ const result = await stickyArchive(projectRoot, stickyId);
87549
88831
  return wrapResult(result, "mutate", "sticky", operation, startTime);
87550
88832
  }
87551
88833
  case "purge": {
@@ -87560,7 +88842,7 @@ var StickyHandler = class {
87560
88842
  startTime
87561
88843
  );
87562
88844
  }
87563
- const result = await stickyPurge(this.projectRoot, stickyId);
88845
+ const result = await stickyPurge(projectRoot, stickyId);
87564
88846
  return wrapResult(result, "mutate", "sticky", operation, startTime);
87565
88847
  }
87566
88848
  default:
@@ -87589,23 +88871,20 @@ var StickyHandler = class {
87589
88871
  // packages/cleo/src/dispatch/domains/tasks.ts
87590
88872
  init_src2();
87591
88873
  var TasksHandler = class {
87592
- projectRoot;
87593
- constructor() {
87594
- this.projectRoot = getProjectRoot();
87595
- }
87596
88874
  // -----------------------------------------------------------------------
87597
88875
  // Query
87598
88876
  // -----------------------------------------------------------------------
87599
88877
  async query(operation, params) {
88878
+ const projectRoot = getProjectRoot();
87600
88879
  const startTime = Date.now();
87601
88880
  try {
87602
88881
  switch (operation) {
87603
88882
  case "show": {
87604
- const result = await taskShow(this.projectRoot, params.taskId);
88883
+ const result = await taskShow(projectRoot, params.taskId);
87605
88884
  return wrapResult(result, "query", "tasks", operation, startTime);
87606
88885
  }
87607
88886
  case "list": {
87608
- const result = await taskList(this.projectRoot, {
88887
+ const result = await taskList(projectRoot, {
87609
88888
  parent: params?.parent,
87610
88889
  status: params?.status,
87611
88890
  priority: params?.priority,
@@ -87621,7 +88900,7 @@ var TasksHandler = class {
87621
88900
  }
87622
88901
  case "find": {
87623
88902
  const result = await taskFind(
87624
- this.projectRoot,
88903
+ projectRoot,
87625
88904
  params?.query,
87626
88905
  params?.limit,
87627
88906
  {
@@ -87636,12 +88915,12 @@ var TasksHandler = class {
87636
88915
  }
87637
88916
  case "tree": {
87638
88917
  const taskId = params?.taskId;
87639
- const result = await taskTree(this.projectRoot, taskId);
88918
+ const result = await taskTree(projectRoot, taskId);
87640
88919
  return wrapResult(result, "query", "tasks", operation, startTime);
87641
88920
  }
87642
88921
  case "blockers": {
87643
88922
  const result = await taskBlockers(
87644
- this.projectRoot,
88923
+ projectRoot,
87645
88924
  params
87646
88925
  );
87647
88926
  return wrapResult(result, "query", "tasks", operation, startTime);
@@ -87649,11 +88928,11 @@ var TasksHandler = class {
87649
88928
  case "depends": {
87650
88929
  const action = params?.action;
87651
88930
  if (action === "overview") {
87652
- const result2 = await taskDepsOverview(this.projectRoot);
88931
+ const result2 = await taskDepsOverview(projectRoot);
87653
88932
  return wrapResult(result2, "query", "tasks", operation, startTime);
87654
88933
  }
87655
88934
  if (action === "cycles") {
87656
- const result2 = await taskDepsCycles(this.projectRoot);
88935
+ const result2 = await taskDepsCycles(projectRoot);
87657
88936
  return wrapResult(result2, "query", "tasks", operation, startTime);
87658
88937
  }
87659
88938
  const taskId = params?.taskId;
@@ -87669,64 +88948,64 @@ var TasksHandler = class {
87669
88948
  }
87670
88949
  const direction = params?.direction;
87671
88950
  const tree = params?.tree;
87672
- const result = await taskDepends(this.projectRoot, taskId, direction, tree);
88951
+ const result = await taskDepends(projectRoot, taskId, direction, tree);
87673
88952
  return wrapResult(result, "query", "tasks", operation, startTime);
87674
88953
  }
87675
88954
  case "analyze": {
87676
88955
  const taskId = params?.taskId;
87677
88956
  const tierLimit = params?.tierLimit;
87678
- const result = await taskAnalyze(this.projectRoot, taskId, { tierLimit });
88957
+ const result = await taskAnalyze(projectRoot, taskId, { tierLimit });
87679
88958
  return wrapResult(result, "query", "tasks", operation, startTime);
87680
88959
  }
87681
88960
  case "next": {
87682
88961
  const result = await taskNext(
87683
- this.projectRoot,
88962
+ projectRoot,
87684
88963
  params
87685
88964
  );
87686
88965
  return wrapResult(result, "query", "tasks", operation, startTime);
87687
88966
  }
87688
88967
  case "plan": {
87689
- const result = await taskPlan(this.projectRoot);
88968
+ const result = await taskPlan(projectRoot);
87690
88969
  return wrapResult(result, "query", "tasks", operation, startTime);
87691
88970
  }
87692
88971
  case "relates": {
87693
88972
  const taskId = params.taskId;
87694
88973
  if (params?.mode) {
87695
- const result2 = await taskRelatesFind(this.projectRoot, taskId, {
88974
+ const result2 = await taskRelatesFind(projectRoot, taskId, {
87696
88975
  mode: params.mode,
87697
88976
  threshold: params?.threshold ? Number(params.threshold) : void 0
87698
88977
  });
87699
88978
  return wrapResult(result2, "query", "tasks", operation, startTime);
87700
88979
  }
87701
- const result = await taskRelates(this.projectRoot, taskId);
88980
+ const result = await taskRelates(projectRoot, taskId);
87702
88981
  return wrapResult(result, "query", "tasks", operation, startTime);
87703
88982
  }
87704
88983
  case "complexity.estimate": {
87705
- const result = await taskComplexityEstimate(this.projectRoot, {
88984
+ const result = await taskComplexityEstimate(projectRoot, {
87706
88985
  taskId: params.taskId
87707
88986
  });
87708
88987
  return wrapResult(result, "query", "tasks", operation, startTime);
87709
88988
  }
87710
88989
  case "current": {
87711
- const result = await taskCurrentGet(this.projectRoot);
88990
+ const result = await taskCurrentGet(projectRoot);
87712
88991
  return wrapResult(result, "query", "tasks", operation, startTime);
87713
88992
  }
87714
88993
  case "history": {
87715
88994
  const taskId = params?.taskId;
87716
88995
  if (taskId) {
87717
- const result2 = await taskHistory(this.projectRoot, taskId, params?.limit);
88996
+ const result2 = await taskHistory(projectRoot, taskId, params?.limit);
87718
88997
  return wrapResult(result2, "query", "tasks", operation, startTime);
87719
88998
  }
87720
- const result = await taskWorkHistory2(this.projectRoot);
88999
+ const result = await taskWorkHistory2(projectRoot);
87721
89000
  return wrapResult(result, "query", "tasks", operation, startTime);
87722
89001
  }
87723
89002
  case "label.list": {
87724
- const result = await taskLabelList(this.projectRoot);
89003
+ const result = await taskLabelList(projectRoot);
87725
89004
  return wrapResult(result, "query", "tasks", operation, startTime);
87726
89005
  }
87727
89006
  case "sync.links": {
87728
89007
  const result = await taskSyncLinks(
87729
- this.projectRoot,
89008
+ projectRoot,
87730
89009
  params
87731
89010
  );
87732
89011
  return wrapResult(result, "query", "tasks", operation, startTime);
@@ -87746,11 +89025,12 @@ var TasksHandler = class {
87746
89025
  // Mutate
87747
89026
  // -----------------------------------------------------------------------
87748
89027
  async mutate(operation, params) {
89028
+ const projectRoot = getProjectRoot();
87749
89029
  const startTime = Date.now();
87750
89030
  try {
87751
89031
  switch (operation) {
87752
89032
  case "add": {
87753
- const result = await taskCreate(this.projectRoot, {
89033
+ const result = await taskCreate(projectRoot, {
87754
89034
  title: params.title,
87755
89035
  description: params?.description ?? params.title,
87756
89036
  parent: params?.parent ?? params?.parentId,
@@ -87762,7 +89042,7 @@ var TasksHandler = class {
87762
89042
  return wrapResult(result, "mutate", "tasks", operation, startTime);
87763
89043
  }
87764
89044
  case "update": {
87765
- const result = await taskUpdate(this.projectRoot, params.taskId, {
89045
+ const result = await taskUpdate(projectRoot, params.taskId, {
87766
89046
  title: params?.title,
87767
89047
  description: params?.description,
87768
89048
  status: params?.status,
@@ -87783,7 +89063,7 @@ var TasksHandler = class {
87783
89063
  }
87784
89064
  case "complete": {
87785
89065
  const result = await taskComplete(
87786
- this.projectRoot,
89066
+ projectRoot,
87787
89067
  params.taskId,
87788
89068
  params?.notes
87789
89069
  );
@@ -87791,7 +89071,7 @@ var TasksHandler = class {
87791
89071
  }
87792
89072
  case "delete": {
87793
89073
  const result = await taskDelete(
87794
- this.projectRoot,
89074
+ projectRoot,
87795
89075
  params.taskId,
87796
89076
  params?.force
87797
89077
  );
@@ -87799,7 +89079,7 @@ var TasksHandler = class {
87799
89079
  }
87800
89080
  case "archive": {
87801
89081
  const result = await taskArchive(
87802
- this.projectRoot,
89082
+ projectRoot,
87803
89083
  params?.taskId,
87804
89084
  params?.before
87805
89085
  );
@@ -87809,20 +89089,20 @@ var TasksHandler = class {
87809
89089
  const taskId = params.taskId;
87810
89090
  const from = params?.from;
87811
89091
  if (from === "done") {
87812
- const result2 = await taskReopen(this.projectRoot, taskId, {
89092
+ const result2 = await taskReopen(projectRoot, taskId, {
87813
89093
  status: params?.status,
87814
89094
  reason: params?.reason
87815
89095
  });
87816
89096
  return wrapResult(result2, "mutate", "tasks", operation, startTime);
87817
89097
  }
87818
89098
  if (from === "archived") {
87819
- const result2 = await taskUnarchive(this.projectRoot, taskId, {
89099
+ const result2 = await taskUnarchive(projectRoot, taskId, {
87820
89100
  status: params?.status,
87821
89101
  preserveStatus: params?.preserveStatus
87822
89102
  });
87823
89103
  return wrapResult(result2, "mutate", "tasks", operation, startTime);
87824
89104
  }
87825
- const result = await taskRestore(this.projectRoot, taskId, {
89105
+ const result = await taskRestore(projectRoot, taskId, {
87826
89106
  cascade: params?.cascade,
87827
89107
  notes: params?.notes
87828
89108
  });
@@ -87830,7 +89110,7 @@ var TasksHandler = class {
87830
89110
  }
87831
89111
  case "cancel": {
87832
89112
  const result = await taskCancel(
87833
- this.projectRoot,
89113
+ projectRoot,
87834
89114
  params.taskId,
87835
89115
  params?.reason
87836
89116
  );
@@ -87838,7 +89118,7 @@ var TasksHandler = class {
87838
89118
  }
87839
89119
  case "reparent": {
87840
89120
  const result = await taskReparent(
87841
- this.projectRoot,
89121
+ projectRoot,
87842
89122
  params.taskId,
87843
89123
  params?.newParentId ?? null
87844
89124
  );
@@ -87846,7 +89126,7 @@ var TasksHandler = class {
87846
89126
  }
87847
89127
  case "reorder": {
87848
89128
  const result = await taskReorder(
87849
- this.projectRoot,
89129
+ projectRoot,
87850
89130
  params.taskId,
87851
89131
  params.position
87852
89132
  );
@@ -87865,7 +89145,7 @@ var TasksHandler = class {
87865
89145
  );
87866
89146
  }
87867
89147
  const result = await taskRelatesAdd(
87868
- this.projectRoot,
89148
+ projectRoot,
87869
89149
  params.taskId,
87870
89150
  relatedId,
87871
89151
  params.type,
@@ -87874,15 +89154,15 @@ var TasksHandler = class {
87874
89154
  return wrapResult(result, "mutate", "tasks", operation, startTime);
87875
89155
  }
87876
89156
  case "start": {
87877
- const result = await taskStart(this.projectRoot, params.taskId);
89157
+ const result = await taskStart(projectRoot, params.taskId);
87878
89158
  return wrapResult(result, "mutate", "tasks", operation, startTime);
87879
89159
  }
87880
89160
  case "stop": {
87881
- const result = await taskStop(this.projectRoot);
89161
+ const result = await taskStop(projectRoot);
87882
89162
  return wrapResult(result, "mutate", "tasks", operation, startTime);
87883
89163
  }
87884
89164
  case "sync.reconcile": {
87885
- const result = await taskSyncReconcile(this.projectRoot, {
89165
+ const result = await taskSyncReconcile(projectRoot, {
87886
89166
  providerId: params.providerId,
87887
89167
  externalTasks: params.externalTasks,
87888
89168
  dryRun: params?.dryRun,
@@ -87893,7 +89173,7 @@ var TasksHandler = class {
87893
89173
  return wrapResult(result, "mutate", "tasks", operation, startTime);
87894
89174
  }
87895
89175
  case "sync.links.remove": {
87896
- const result = await taskSyncLinksRemove(this.projectRoot, params.providerId);
89176
+ const result = await taskSyncLinksRemove(projectRoot, params.providerId);
87897
89177
  return wrapResult(result, "mutate", "tasks", operation, startTime);
87898
89178
  }
87899
89179
  default:
@@ -87964,7 +89244,7 @@ import {
87964
89244
  discoverSkill as discoverSkill2,
87965
89245
  discoverSkills,
87966
89246
  getAllProviders as getAllProviders2,
87967
- getCanonicalSkillsDir as getCanonicalSkillsDir3,
89247
+ getCanonicalSkillsDir as getCanonicalSkillsDir4,
87968
89248
  getInstalledProviders as getInstalledProviders3,
87969
89249
  getTrackedSkills,
87970
89250
  injectAll as injectAll2,
@@ -87981,7 +89261,7 @@ function toolsIssueDiagnostics() {
87981
89261
  }
87982
89262
  async function toolsSkillList(limit, offset) {
87983
89263
  try {
87984
- const skills = await discoverSkills(getCanonicalSkillsDir3());
89264
+ const skills = await discoverSkills(getCanonicalSkillsDir4());
87985
89265
  const page = paginate(skills, limit, offset);
87986
89266
  return {
87987
89267
  success: true,
@@ -88000,7 +89280,7 @@ async function toolsSkillList(limit, offset) {
88000
89280
  }
88001
89281
  async function toolsSkillShow(name2) {
88002
89282
  try {
88003
- const skill = await discoverSkill2(`${getCanonicalSkillsDir3()}/${name2}`);
89283
+ const skill = await discoverSkill2(`${getCanonicalSkillsDir4()}/${name2}`);
88004
89284
  if (!skill) {
88005
89285
  return engineError("E_NOT_FOUND", `Skill not found: ${name2}`);
88006
89286
  }
@@ -88012,7 +89292,7 @@ async function toolsSkillShow(name2) {
88012
89292
  async function toolsSkillFind(query) {
88013
89293
  try {
88014
89294
  const q = (query ?? "").toLowerCase();
88015
- const skills = await discoverSkills(getCanonicalSkillsDir3());
89295
+ const skills = await discoverSkills(getCanonicalSkillsDir4());
88016
89296
  const filtered = q ? skills.filter(
88017
89297
  (s) => s.name.toLowerCase().includes(q) || s.metadata.description.toLowerCase().includes(q)
88018
89298
  ) : skills;
@@ -88036,13 +89316,13 @@ function toolsSkillDispatch(name2) {
88036
89316
  }
88037
89317
  async function toolsSkillVerify(name2) {
88038
89318
  try {
88039
- const installed = await discoverSkill2(`${getCanonicalSkillsDir3()}/${name2}`);
89319
+ const installed = await discoverSkill2(`${getCanonicalSkillsDir4()}/${name2}`);
88040
89320
  const catalogEntry = catalog3.getSkill(name2);
88041
89321
  return engineSuccess({
88042
89322
  skill: name2,
88043
89323
  installed: !!installed,
88044
89324
  inCatalog: !!catalogEntry,
88045
- installPath: installed ? `${getCanonicalSkillsDir3()}/${name2}` : null
89325
+ installPath: installed ? `${getCanonicalSkillsDir4()}/${name2}` : null
88046
89326
  });
88047
89327
  } catch (error40) {
88048
89328
  return engineError("E_INTERNAL", error40 instanceof Error ? error40.message : String(error40));
@@ -88447,9 +89727,8 @@ async function toolsAdapterDispose(projectRoot, id) {
88447
89727
 
88448
89728
  // packages/cleo/src/dispatch/domains/tools.ts
88449
89729
  var ToolsHandler = class {
88450
- projectRoot;
88451
- constructor() {
88452
- this.projectRoot = getProjectRoot();
89730
+ get projectRoot() {
89731
+ return getProjectRoot();
88453
89732
  }
88454
89733
  // -----------------------------------------------------------------------
88455
89734
  // DomainHandler interface
@@ -91144,8 +92423,8 @@ function getEnabledPlatforms(cwd) {
91144
92423
  return [];
91145
92424
  }
91146
92425
  }
91147
- function getDefaultOutputPath(platform3) {
91148
- switch (platform3) {
92426
+ function getDefaultOutputPath(platform5) {
92427
+ switch (platform5) {
91149
92428
  case "mintlify":
91150
92429
  return "docs/changelog/overview.mdx";
91151
92430
  case "docusaurus":
@@ -91167,8 +92446,8 @@ function getGitHubRepoSlug(cwd) {
91167
92446
  return "";
91168
92447
  }
91169
92448
  }
91170
- function generateForPlatform(platform3, sourceContent, repoSlug, limit) {
91171
- switch (platform3) {
92449
+ function generateForPlatform(platform5, sourceContent, repoSlug, limit) {
92450
+ switch (platform5) {
91172
92451
  case "mintlify":
91173
92452
  return generateMintlify(sourceContent, repoSlug, limit);
91174
92453
  case "docusaurus":
@@ -94454,7 +95733,7 @@ init_src();
94454
95733
  init_src2();
94455
95734
  init_renderers();
94456
95735
  import { execFileSync as execFileSync16, spawn as spawn2 } from "node:child_process";
94457
- import { mkdir as mkdir18, readFile as readFile22, rm as rm2, stat as stat2, writeFile as writeFile13 } from "node:fs/promises";
95736
+ import { mkdir as mkdir18, readFile as readFile22, rm as rm3, stat as stat2, writeFile as writeFile13 } from "node:fs/promises";
94458
95737
  import { join as join117 } from "node:path";
94459
95738
  var DEFAULT_PORT = 3456;
94460
95739
  var DEFAULT_HOST = "127.0.0.1";
@@ -94560,7 +95839,7 @@ function registerWebCommand(program) {
94560
95839
  process.kill(serverProcess.pid);
94561
95840
  } catch {
94562
95841
  }
94563
- await rm2(pidFile, { force: true });
95842
+ await rm3(pidFile, { force: true });
94564
95843
  throw new CleoError(1 /* GENERAL_ERROR */, "Server failed to start within 15 seconds");
94565
95844
  }
94566
95845
  cliOutput(
@@ -94585,7 +95864,7 @@ function registerWebCommand(program) {
94585
95864
  const { pidFile } = getWebPaths();
94586
95865
  const status = await getStatus();
94587
95866
  if (!status.running || !status.pid) {
94588
- await rm2(pidFile, { force: true });
95867
+ await rm3(pidFile, { force: true });
94589
95868
  cliOutput({ running: false }, { command: "web", message: "Server is not running" });
94590
95869
  return;
94591
95870
  }
@@ -94603,7 +95882,7 @@ function registerWebCommand(program) {
94603
95882
  } catch {
94604
95883
  }
94605
95884
  }
94606
- await rm2(pidFile, { force: true });
95885
+ await rm3(pidFile, { force: true });
94607
95886
  cliOutput({ stopped: true }, { command: "web", message: "CLEO Web UI stopped" });
94608
95887
  } catch (err) {
94609
95888
  if (err instanceof CleoError) {
@@ -94635,11 +95914,11 @@ function registerWebCommand(program) {
94635
95914
  );
94636
95915
  }
94637
95916
  const url2 = status.url;
94638
- const platform3 = process.platform;
95917
+ const platform5 = process.platform;
94639
95918
  try {
94640
- if (platform3 === "linux") {
95919
+ if (platform5 === "linux") {
94641
95920
  spawn2("xdg-open", [url2], { detached: true, stdio: "ignore" }).unref();
94642
- } else if (platform3 === "darwin") {
95921
+ } else if (platform5 === "darwin") {
94643
95922
  spawn2("open", [url2], { detached: true, stdio: "ignore" }).unref();
94644
95923
  }
94645
95924
  } catch {
@@ -94656,7 +95935,12 @@ function registerWebCommand(program) {
94656
95935
  }
94657
95936
 
94658
95937
  // packages/cleo/src/cli/index.ts
94659
- var CLI_VERSION = "2026.3.38";
95938
+ function getPackageVersion() {
95939
+ const pkgPath = join118(dirname25(fileURLToPath7(import.meta.url)), "../../package.json");
95940
+ const pkg = JSON.parse(readFileSync97(pkgPath, "utf-8"));
95941
+ return pkg.version;
95942
+ }
95943
+ var CLI_VERSION = getPackageVersion();
94660
95944
  var rootShim = new ShimCommand();
94661
95945
  registerAddCommand(rootShim);
94662
95946
  registerListCommand(rootShim);