@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/mcp/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 rm2 of raw.resourceMetrics ?? []) {
39449
- for (const sm of rm2.scopeMetrics ?? []) {
39476
+ for (const rm3 of raw.resourceMetrics ?? []) {
39477
+ for (const sm of rm3.scopeMetrics ?? []) {
39450
39478
  for (const metric of sm.metrics ?? []) {
39451
39479
  if (metric.name !== "claude_code.token.usage") continue;
39452
39480
  for (const dp of metric.sum?.dataPoints ?? []) {
@@ -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",
@@ -59302,13 +60567,13 @@ var init_templates = __esm({
59302
60567
 
59303
60568
  // packages/core/src/ui/aliases.ts
59304
60569
  import { existsSync as existsSync93, readFileSync as readFileSync67, writeFileSync as writeFileSync15 } from "node:fs";
59305
- import { homedir as homedir5, platform as platform2 } from "node:os";
60570
+ import { homedir as homedir5, platform as platform3 } from "node:os";
59306
60571
  import { join as join96 } from "node:path";
59307
60572
  function getCurrentShell() {
59308
60573
  const shell = process.env.SHELL ?? "";
59309
60574
  if (shell.includes("zsh")) return "zsh";
59310
60575
  if (shell.includes("bash")) return "bash";
59311
- if (platform2() === "win32") return "powershell";
60576
+ if (platform3() === "win32") return "powershell";
59312
60577
  return "bash";
59313
60578
  }
59314
60579
  function getRcFilePath(shell) {
@@ -59332,7 +60597,7 @@ function detectAvailableShells() {
59332
60597
  const shells = [];
59333
60598
  if (existsSync93(getRcFilePath("bash")) || existsSync93("/bin/bash")) shells.push("bash");
59334
60599
  if (existsSync93(getRcFilePath("zsh")) || existsSync93("/bin/zsh")) shells.push("zsh");
59335
- if (platform2() === "win32") shells.push("powershell");
60600
+ if (platform3() === "win32") shells.push("powershell");
59336
60601
  return shells;
59337
60602
  }
59338
60603
  function generateBashAliases(cleoPath) {
@@ -59796,27 +61061,10 @@ var init_flags = __esm({
59796
61061
  }
59797
61062
  });
59798
61063
 
59799
- // packages/core/src/ui/injection-legacy.ts
59800
- function getValidationKey(target) {
59801
- return INJECTION_VALIDATION_KEYS[target] ?? target.toLowerCase().replace(/[^a-z0-9]/g, "_");
59802
- }
59803
- var INJECTION_VALIDATION_KEYS;
59804
- var init_injection_legacy = __esm({
59805
- "packages/core/src/ui/injection-legacy.ts"() {
59806
- "use strict";
59807
- INJECTION_VALIDATION_KEYS = {
59808
- "CLAUDE.md": "claude_md",
59809
- "AGENTS.md": "agents_md",
59810
- "GEMINI.md": "gemini_md"
59811
- };
59812
- }
59813
- });
59814
-
59815
61064
  // packages/core/src/ui/index.ts
59816
61065
  var ui_exports = {};
59817
61066
  __export(ui_exports, {
59818
61067
  ALIASES_VERSION: () => ALIASES_VERSION,
59819
- INJECTION_VALIDATION_KEYS: () => INJECTION_VALIDATION_KEYS,
59820
61068
  appendToChangelog: () => appendToChangelog,
59821
61069
  checkAliasesStatus: () => checkAliasesStatus,
59822
61070
  defaultFlags: () => defaultFlags,
@@ -59833,7 +61081,6 @@ __export(ui_exports, {
59833
61081
  getCurrentShell: () => getCurrentShell,
59834
61082
  getInstalledVersion: () => getInstalledVersion,
59835
61083
  getRcFilePath: () => getRcFilePath,
59836
- getValidationKey: () => getValidationKey,
59837
61084
  groupTasksIntoSections: () => groupTasksIntoSections,
59838
61085
  hasAliasBlock: () => hasAliasBlock,
59839
61086
  injectAliases: () => injectAliases,
@@ -59853,7 +61100,6 @@ var init_ui = __esm({
59853
61100
  init_changelog();
59854
61101
  init_command_registry();
59855
61102
  init_flags();
59856
- init_injection_legacy();
59857
61103
  }
59858
61104
  });
59859
61105
 
@@ -63028,11 +64274,29 @@ __export(init_exports, {
63028
64274
  });
63029
64275
  import { existsSync as existsSync100, readdirSync as readdirSync33, readFileSync as readFileSync73 } from "node:fs";
63030
64276
  import { copyFile as copyFile3, lstat, mkdir as mkdir16, readFile as readFile17, symlink, unlink as unlink4, writeFile as writeFile11 } from "node:fs/promises";
64277
+ import { platform as platform4 } from "node:os";
63031
64278
  import { basename as basename17, dirname as dirname19, join as join100 } from "node:path";
63032
64279
  async function initAgentDefinition(created, warnings) {
63033
- const packageRoot = getPackageRoot();
63034
- const agentSourceDir = join100(packageRoot, "agents", "cleo-subagent");
63035
- if (!existsSync100(agentSourceDir)) {
64280
+ let agentSourceDir = null;
64281
+ try {
64282
+ const { createRequire: createRequire6 } = await import("node:module");
64283
+ const req = createRequire6(import.meta.url);
64284
+ const agentsPkgMain = req.resolve("@cleocode/agents/package.json");
64285
+ const agentsPkgRoot = dirname19(agentsPkgMain);
64286
+ const candidate = join100(agentsPkgRoot, "cleo-subagent");
64287
+ if (existsSync100(candidate)) {
64288
+ agentSourceDir = candidate;
64289
+ }
64290
+ } catch {
64291
+ }
64292
+ if (!agentSourceDir) {
64293
+ const packageRoot = getPackageRoot();
64294
+ const bundled = join100(packageRoot, "agents", "cleo-subagent");
64295
+ if (existsSync100(bundled)) {
64296
+ agentSourceDir = bundled;
64297
+ }
64298
+ }
64299
+ if (!agentSourceDir) {
63036
64300
  warnings.push("agents/cleo-subagent/ not found in package, skipping agent definition install");
63037
64301
  return;
63038
64302
  }
@@ -63046,7 +64310,7 @@ async function initAgentDefinition(created, warnings) {
63046
64310
  }
63047
64311
  } catch {
63048
64312
  }
63049
- await symlink(agentSourceDir, globalAgentsDir, "dir");
64313
+ await symlink(agentSourceDir, globalAgentsDir, DIR_SYMLINK_TYPE2);
63050
64314
  created.push("agent: cleo-subagent (symlinked)");
63051
64315
  } catch (_err) {
63052
64316
  try {
@@ -63105,17 +64369,29 @@ async function initCoreSkills(created, warnings) {
63105
64369
  const packageRoot = getPackageRoot();
63106
64370
  let ctSkillsRoot = null;
63107
64371
  try {
63108
- const bundledPath = join100(packageRoot, "packages", "skills");
63109
- if (existsSync100(join100(bundledPath, "skills.json"))) {
63110
- ctSkillsRoot = bundledPath;
63111
- } else {
63112
- const ctSkillsPath = join100(packageRoot, "node_modules", "@cleocode", "skills");
63113
- if (existsSync100(join100(ctSkillsPath, "skills.json"))) {
63114
- ctSkillsRoot = ctSkillsPath;
63115
- }
64372
+ const { createRequire: createRequire6 } = await import("node:module");
64373
+ const req = createRequire6(import.meta.url);
64374
+ const skillsPkgMain = req.resolve("@cleocode/skills/package.json");
64375
+ const skillsPkgRoot = dirname19(skillsPkgMain);
64376
+ if (existsSync100(join100(skillsPkgRoot, "skills.json"))) {
64377
+ ctSkillsRoot = skillsPkgRoot;
63116
64378
  }
63117
64379
  } catch {
63118
64380
  }
64381
+ if (!ctSkillsRoot) {
64382
+ try {
64383
+ const bundledPath = join100(packageRoot, "packages", "skills");
64384
+ if (existsSync100(join100(bundledPath, "skills.json"))) {
64385
+ ctSkillsRoot = bundledPath;
64386
+ } else {
64387
+ const ctSkillsPath = join100(packageRoot, "node_modules", "@cleocode", "skills");
64388
+ if (existsSync100(join100(ctSkillsPath, "skills.json"))) {
64389
+ ctSkillsRoot = ctSkillsPath;
64390
+ }
64391
+ }
64392
+ } catch {
64393
+ }
64394
+ }
63119
64395
  if (!ctSkillsRoot) {
63120
64396
  warnings.push("skills package not found, skipping core skill installation");
63121
64397
  return;
@@ -63407,7 +64683,6 @@ async function initProject(opts = {}) {
63407
64683
  warnings.push(`Contributor MCP setup: ${err instanceof Error ? err.message : String(err)}`);
63408
64684
  }
63409
64685
  await initAgentDefinition(created, warnings);
63410
- await initCoreSkills(created, warnings);
63411
64686
  await initNexusRegistration(projRoot, created, warnings);
63412
64687
  try {
63413
64688
  const { AdapterManager: AdapterManager2 } = await Promise.resolve().then(() => (init_adapters(), adapters_exports));
@@ -63494,6 +64769,7 @@ async function getVersion2(projectRoot) {
63494
64769
  }
63495
64770
  return { version: "0.0.0" };
63496
64771
  }
64772
+ var DIR_SYMLINK_TYPE2;
63497
64773
  var init_init = __esm({
63498
64774
  "packages/core/src/init.ts"() {
63499
64775
  "use strict";
@@ -63507,6 +64783,7 @@ var init_init = __esm({
63507
64783
  init_scaffold();
63508
64784
  init_schema_management();
63509
64785
  init_json2();
64786
+ DIR_SYMLINK_TYPE2 = platform4() === "win32" ? "junction" : "dir";
63510
64787
  }
63511
64788
  });
63512
64789
 
@@ -64024,6 +65301,7 @@ async function bootstrapGlobalCleo(options) {
64024
65301
  await injectAgentsHub(ctx);
64025
65302
  await installMcpToProviders(ctx);
64026
65303
  await installSkillsGlobally(ctx);
65304
+ await installAgentDefinitionGlobally(ctx);
64027
65305
  await installProviderAdapters(ctx, options?.packageRoot);
64028
65306
  return ctx;
64029
65307
  }
@@ -64074,12 +65352,16 @@ async function injectAgentsHub(ctx) {
64074
65352
  await mkdir17(globalAgentsDir, { recursive: true });
64075
65353
  if (existsSync103(globalAgentsMd)) {
64076
65354
  const content = await readFile19(globalAgentsMd, "utf8");
64077
- const stripped = content.replace(/\n?<!-- CLEO:START -->[\s\S]*?<!-- CLEO:END -->\n?/g, "");
65355
+ const stripped = content.replace(
65356
+ /\n?<!-- CLEO:START[^>]*-->[\s\S]*?<!-- CLEO:END -->\n?/g,
65357
+ ""
65358
+ );
64078
65359
  if (stripped !== content) {
64079
65360
  await writeFile12(globalAgentsMd, stripped, "utf8");
64080
65361
  }
64081
65362
  }
64082
- const action = await inject2(globalAgentsMd, "@~/.cleo/templates/CLEO-INJECTION.md");
65363
+ const expectedContent = "@~/.cleo/templates/CLEO-INJECTION.md";
65364
+ const action = await inject2(globalAgentsMd, expectedContent);
64083
65365
  ctx.created.push(`~/.agents/AGENTS.md (${action})`);
64084
65366
  } else {
64085
65367
  ctx.created.push("~/.agents/AGENTS.md (would create/update CAAMP block)");
@@ -64097,7 +65379,7 @@ async function injectAgentsHub(ctx) {
64097
65379
  if (existsSync103(instructFilePath)) {
64098
65380
  const fileContent = await readFile19(instructFilePath, "utf8");
64099
65381
  const stripped = fileContent.replace(
64100
- /\n?<!-- CLEO:START -->[\s\S]*?<!-- CLEO:END -->\n?/g,
65382
+ /\n?<!-- CLEO:START[^>]*-->[\s\S]*?<!-- CLEO:END -->\n?/g,
64101
65383
  ""
64102
65384
  );
64103
65385
  if (stripped !== fileContent) {
@@ -64166,6 +65448,20 @@ async function installSkillsGlobally(ctx) {
64166
65448
  );
64167
65449
  }
64168
65450
  }
65451
+ async function installAgentDefinitionGlobally(ctx) {
65452
+ try {
65453
+ if (!ctx.isDryRun) {
65454
+ const { initAgentDefinition: initAgentDefinition2 } = await Promise.resolve().then(() => (init_init(), init_exports));
65455
+ await initAgentDefinition2(ctx.created, ctx.warnings);
65456
+ } else {
65457
+ ctx.created.push("agent: cleo-subagent (would symlink)");
65458
+ }
65459
+ } catch (err) {
65460
+ ctx.warnings.push(
65461
+ `Agent definition install: ${err instanceof Error ? err.message : String(err)}`
65462
+ );
65463
+ }
65464
+ }
64169
65465
  async function installProviderAdapters(ctx, packageRootOverride) {
64170
65466
  try {
64171
65467
  const { AdapterManager: AdapterManager2 } = await Promise.resolve().then(() => (init_adapters(), adapters_exports));
@@ -68165,13 +69461,13 @@ var init_parallel = __esm({
68165
69461
  // packages/core/src/orchestration/skill-ops.ts
68166
69462
  import { existsSync as existsSync107, readdirSync as readdirSync35, readFileSync as readFileSync79 } from "node:fs";
68167
69463
  import { join as join106 } from "node:path";
68168
- import { getCanonicalSkillsDir as getCanonicalSkillsDir2 } from "@cleocode/caamp";
69464
+ import { getCanonicalSkillsDir as getCanonicalSkillsDir3 } from "@cleocode/caamp";
68169
69465
  function getSkillContent(skillName, projectRoot) {
68170
69466
  if (!skillName) {
68171
69467
  throw new CleoError(2 /* INVALID_INPUT */, "skill name is required");
68172
69468
  }
68173
69469
  const projectSkillDir = join106(projectRoot, ".cleo", "skills", skillName);
68174
- const canonicalSkillDir = join106(getCanonicalSkillsDir2(), skillName);
69470
+ const canonicalSkillDir = join106(getCanonicalSkillsDir3(), skillName);
68175
69471
  const skillDir = existsSync107(projectSkillDir) ? projectSkillDir : canonicalSkillDir;
68176
69472
  if (!existsSync107(skillDir)) {
68177
69473
  throw new CleoError(
@@ -72242,7 +73538,7 @@ async function validateLayer2Semantic(context) {
72242
73538
  }
72243
73539
  if (context.domain === "session" && context.operation === "start") {
72244
73540
  const scope = context.params?.scope;
72245
- if (scope && !scope.match(/^(epic|task|global):/)) {
73541
+ if (scope && scope !== "global" && !scope.match(/^(epic|task):/)) {
72246
73542
  violations.push({
72247
73543
  layer: 2 /* SEMANTIC */,
72248
73544
  severity: "error" /* ERROR */,
@@ -72250,7 +73546,7 @@ async function validateLayer2Semantic(context) {
72250
73546
  message: `Invalid session scope format: ${scope}`,
72251
73547
  field: "scope",
72252
73548
  constraint: "Must be epic:<id>, task:<id>, or global",
72253
- fix: "Use format: epic:T1234, task:T5678, or global"
73549
+ fix: 'Provide scope as "global" or "epic:TXXX"'
72254
73550
  });
72255
73551
  }
72256
73552
  }
@@ -84141,8 +85437,15 @@ async function taskList(projectRoot, params) {
84141
85437
  data: { tasks: tasks2, total: result.total, filtered: result.filtered },
84142
85438
  page: result.page
84143
85439
  };
84144
- } catch {
84145
- return engineError("E_NOT_INITIALIZED", "Task database not initialized");
85440
+ } catch (err) {
85441
+ const code = err?.code;
85442
+ if (code === 4) return engineError("E_NOT_FOUND", err.message || "Task not found");
85443
+ if (code === 2)
85444
+ return engineError("E_INVALID_INPUT", err.message || "Invalid input");
85445
+ return engineError(
85446
+ "E_NOT_INITIALIZED",
85447
+ err.message || "Task database not initialized"
85448
+ );
84146
85449
  }
84147
85450
  }
84148
85451
  async function taskFind(projectRoot, query, limit, options) {
@@ -84169,8 +85472,15 @@ async function taskFind(projectRoot, query, limit, options) {
84169
85472
  parentId: r.parentId
84170
85473
  }));
84171
85474
  return { success: true, data: { results, total: results.length } };
84172
- } catch {
84173
- return engineError("E_NOT_INITIALIZED", "Task database not initialized");
85475
+ } catch (err) {
85476
+ const code = err?.code;
85477
+ if (code === 4) return engineError("E_NOT_FOUND", err.message || "Task not found");
85478
+ if (code === 2)
85479
+ return engineError("E_INVALID_INPUT", err.message || "Invalid input");
85480
+ return engineError(
85481
+ "E_NOT_INITIALIZED",
85482
+ err.message || "Task database not initialized"
85483
+ );
84174
85484
  }
84175
85485
  }
84176
85486
  async function taskCreate(projectRoot, params) {
@@ -85101,54 +86411,42 @@ function routeByParam(params, paramName, routes, defaultRoute) {
85101
86411
 
85102
86412
  // packages/cleo/src/dispatch/domains/admin.ts
85103
86413
  var AdminHandler = class {
85104
- projectRoot;
85105
- constructor() {
85106
- this.projectRoot = getProjectRoot();
85107
- }
85108
86414
  // -----------------------------------------------------------------------
85109
86415
  // Query
85110
86416
  // -----------------------------------------------------------------------
85111
86417
  async query(operation, params) {
86418
+ const projectRoot = getProjectRoot();
85112
86419
  const startTime = Date.now();
85113
86420
  try {
85114
86421
  switch (operation) {
85115
86422
  case "version": {
85116
- const result = await getVersion3(this.projectRoot);
86423
+ const result = await getVersion3(projectRoot);
85117
86424
  return wrapResult(result, "query", "admin", operation, startTime);
85118
86425
  }
85119
86426
  case "health": {
85120
86427
  const mode = params?.mode;
85121
86428
  if (mode === "diagnose") {
85122
- const result2 = await systemDoctor(this.projectRoot);
86429
+ const result2 = await systemDoctor(projectRoot);
85123
86430
  return wrapResult(result2, "query", "admin", operation, startTime);
85124
86431
  }
85125
- const result = systemHealth(
85126
- this.projectRoot,
85127
- params
85128
- );
86432
+ const result = systemHealth(projectRoot, params);
85129
86433
  return wrapResult(result, "query", "admin", operation, startTime);
85130
86434
  }
85131
86435
  case "config.show": {
85132
- const result = await configGet(this.projectRoot, params?.key);
86436
+ const result = await configGet(projectRoot, params?.key);
85133
86437
  return wrapResult(result, "query", "admin", operation, startTime);
85134
86438
  }
85135
86439
  case "stats": {
85136
- const result = await systemStats(
85137
- this.projectRoot,
85138
- params
85139
- );
86440
+ const result = await systemStats(projectRoot, params);
85140
86441
  return wrapResult(result, "query", "admin", operation, startTime);
85141
86442
  }
85142
86443
  case "context": {
85143
- const result = systemContext(
85144
- this.projectRoot,
85145
- params
85146
- );
86444
+ const result = systemContext(projectRoot, params);
85147
86445
  return wrapResult(result, "query", "admin", operation, startTime);
85148
86446
  }
85149
86447
  case "runtime": {
85150
86448
  const result = await systemRuntime(
85151
- this.projectRoot,
86449
+ projectRoot,
85152
86450
  params
85153
86451
  );
85154
86452
  return wrapResult(result, "query", "admin", operation, startTime);
@@ -85243,12 +86541,12 @@ var AdminHandler = class {
85243
86541
  }
85244
86542
  case "dash": {
85245
86543
  const blockedTasksLimit = typeof params?.blockedTasksLimit === "number" ? params.blockedTasksLimit : void 0;
85246
- const result = await systemDash(this.projectRoot, { blockedTasksLimit });
86544
+ const result = await systemDash(projectRoot, { blockedTasksLimit });
85247
86545
  return wrapResult(result, "query", "admin", operation, startTime);
85248
86546
  }
85249
86547
  case "log": {
85250
86548
  const result = await systemLog(
85251
- this.projectRoot,
86549
+ projectRoot,
85252
86550
  params
85253
86551
  );
85254
86552
  return wrapResult(result, "query", "admin", operation, startTime);
@@ -85265,7 +86563,7 @@ var AdminHandler = class {
85265
86563
  startTime
85266
86564
  );
85267
86565
  }
85268
- const result = await systemSequence(this.projectRoot, {
86566
+ const result = await systemSequence(projectRoot, {
85269
86567
  action
85270
86568
  });
85271
86569
  return wrapResult(result, "query", "admin", operation, startTime);
@@ -85283,7 +86581,7 @@ var AdminHandler = class {
85283
86581
  case "adr.find": {
85284
86582
  const query = params?.query;
85285
86583
  if (query) {
85286
- const result2 = await findAdrs(this.projectRoot, query, {
86584
+ const result2 = await findAdrs(projectRoot, query, {
85287
86585
  topics: params?.topics,
85288
86586
  keywords: params?.keywords,
85289
86587
  status: params?.status
@@ -85295,7 +86593,7 @@ var AdminHandler = class {
85295
86593
  };
85296
86594
  }
85297
86595
  const { limit, offset } = getListParams(params);
85298
- const result = await listAdrs(this.projectRoot, {
86596
+ const result = await listAdrs(projectRoot, {
85299
86597
  status: params?.status,
85300
86598
  since: params?.since,
85301
86599
  limit,
@@ -85320,7 +86618,7 @@ var AdminHandler = class {
85320
86618
  startTime
85321
86619
  );
85322
86620
  }
85323
- const adr = await showAdr(this.projectRoot, adrId);
86621
+ const adr = await showAdr(projectRoot, adrId);
85324
86622
  if (!adr) {
85325
86623
  return errorResult(
85326
86624
  "query",
@@ -85359,7 +86657,7 @@ var AdminHandler = class {
85359
86657
  since: params?.since,
85360
86658
  until: params?.until
85361
86659
  },
85362
- this.projectRoot
86660
+ projectRoot
85363
86661
  );
85364
86662
  return {
85365
86663
  _meta: dispatchMeta("query", "admin", operation, startTime),
@@ -85386,7 +86684,7 @@ var AdminHandler = class {
85386
86684
  limit,
85387
86685
  offset
85388
86686
  },
85389
- this.projectRoot
86687
+ projectRoot
85390
86688
  );
85391
86689
  return {
85392
86690
  _meta: dispatchMeta("query", "admin", operation, startTime),
@@ -85411,7 +86709,7 @@ var AdminHandler = class {
85411
86709
  startTime
85412
86710
  );
85413
86711
  }
85414
- const result = await showTokenUsage(tokenId, this.projectRoot);
86712
+ const result = await showTokenUsage(tokenId, projectRoot);
85415
86713
  if (!result) {
85416
86714
  return errorResult(
85417
86715
  "query",
@@ -85436,8 +86734,8 @@ var AdminHandler = class {
85436
86734
  case "export": {
85437
86735
  const scope = params?.scope;
85438
86736
  if (scope === "snapshot") {
85439
- const snapshot = await exportSnapshot(this.projectRoot);
85440
- const outputPath = params?.output ?? getDefaultSnapshotPath(this.projectRoot);
86737
+ const snapshot = await exportSnapshot(projectRoot);
86738
+ const outputPath = params?.output ?? getDefaultSnapshotPath(projectRoot);
85441
86739
  await writeSnapshot(snapshot, outputPath);
85442
86740
  return {
85443
86741
  _meta: dispatchMeta("query", "admin", operation, startTime),
@@ -85458,7 +86756,7 @@ var AdminHandler = class {
85458
86756
  filter: params?.filter,
85459
86757
  includeDeps: params?.includeDeps,
85460
86758
  dryRun: params?.dryRun,
85461
- cwd: this.projectRoot
86759
+ cwd: projectRoot
85462
86760
  });
85463
86761
  return {
85464
86762
  _meta: dispatchMeta("query", "admin", operation, startTime),
@@ -85472,7 +86770,7 @@ var AdminHandler = class {
85472
86770
  status: params?.status,
85473
86771
  parent: params?.parent,
85474
86772
  phase: params?.phase,
85475
- cwd: this.projectRoot
86773
+ cwd: projectRoot
85476
86774
  });
85477
86775
  return {
85478
86776
  _meta: dispatchMeta("query", "admin", operation, startTime),
@@ -85482,7 +86780,7 @@ var AdminHandler = class {
85482
86780
  }
85483
86781
  case "map": {
85484
86782
  const { mapCodebase: mapCodebase3 } = await Promise.resolve().then(() => (init_codebase_map_engine(), codebase_map_engine_exports));
85485
- const result = await mapCodebase3(this.projectRoot, {
86783
+ const result = await mapCodebase3(projectRoot, {
85486
86784
  focus: params?.focus,
85487
86785
  storeToBrain: false
85488
86786
  });
@@ -85503,12 +86801,13 @@ var AdminHandler = class {
85503
86801
  // Mutate
85504
86802
  // -----------------------------------------------------------------------
85505
86803
  async mutate(operation, params) {
86804
+ const projectRoot = getProjectRoot();
85506
86805
  const startTime = Date.now();
85507
86806
  try {
85508
86807
  switch (operation) {
85509
86808
  case "init": {
85510
86809
  const result = await initProject2(
85511
- this.projectRoot,
86810
+ projectRoot,
85512
86811
  params
85513
86812
  );
85514
86813
  return wrapResult(result, "mutate", "admin", operation, startTime);
@@ -85517,10 +86816,10 @@ var AdminHandler = class {
85517
86816
  case "health": {
85518
86817
  const mode = params?.mode;
85519
86818
  if (mode === "diagnose") {
85520
- const result2 = await systemDoctor(this.projectRoot);
86819
+ const result2 = await systemDoctor(projectRoot);
85521
86820
  return wrapResult(result2, "mutate", "admin", operation, startTime);
85522
86821
  }
85523
- const result = await systemFix(this.projectRoot);
86822
+ const result = await systemFix(projectRoot);
85524
86823
  return wrapResult(result, "mutate", "admin", operation, startTime);
85525
86824
  }
85526
86825
  case "config.set": {
@@ -85535,7 +86834,7 @@ var AdminHandler = class {
85535
86834
  startTime
85536
86835
  );
85537
86836
  }
85538
- const result = await configSet(this.projectRoot, key, params?.value);
86837
+ const result = await configSet(projectRoot, key, params?.value);
85539
86838
  return wrapResult(result, "mutate", "admin", operation, startTime);
85540
86839
  }
85541
86840
  // Merged: backup absorbs restore and backup.restore via action param (T5615)
@@ -85553,7 +86852,7 @@ var AdminHandler = class {
85553
86852
  startTime
85554
86853
  );
85555
86854
  }
85556
- const result2 = systemRestore(this.projectRoot, {
86855
+ const result2 = systemRestore(projectRoot, {
85557
86856
  backupId,
85558
86857
  force: params?.force
85559
86858
  });
@@ -85571,20 +86870,20 @@ var AdminHandler = class {
85571
86870
  startTime
85572
86871
  );
85573
86872
  }
85574
- const result2 = await backupRestore(this.projectRoot, file2, {
86873
+ const result2 = await backupRestore(projectRoot, file2, {
85575
86874
  dryRun: params?.dryRun
85576
86875
  });
85577
86876
  return wrapResult(result2, "mutate", "admin", operation, startTime);
85578
86877
  }
85579
86878
  const result = systemBackup(
85580
- this.projectRoot,
86879
+ projectRoot,
85581
86880
  params
85582
86881
  );
85583
86882
  return wrapResult(result, "mutate", "admin", operation, startTime);
85584
86883
  }
85585
86884
  case "migrate": {
85586
86885
  const result = await systemMigrate(
85587
- this.projectRoot,
86886
+ projectRoot,
85588
86887
  params
85589
86888
  );
85590
86889
  return wrapResult(result, "mutate", "admin", operation, startTime);
@@ -85601,7 +86900,7 @@ var AdminHandler = class {
85601
86900
  startTime
85602
86901
  );
85603
86902
  }
85604
- const result = await systemCleanup(this.projectRoot, {
86903
+ const result = await systemCleanup(projectRoot, {
85605
86904
  target,
85606
86905
  olderThan: params?.olderThan,
85607
86906
  dryRun: params?.dryRun
@@ -85653,20 +86952,20 @@ var AdminHandler = class {
85653
86952
  }
85654
86953
  case "safestop": {
85655
86954
  const result = systemSafestop(
85656
- this.projectRoot,
86955
+ projectRoot,
85657
86956
  params
85658
86957
  );
85659
86958
  return wrapResult(result, "mutate", "admin", operation, startTime);
85660
86959
  }
85661
86960
  case "inject.generate": {
85662
- const result = await systemInjectGenerate(this.projectRoot);
86961
+ const result = await systemInjectGenerate(projectRoot);
85663
86962
  return wrapResult(result, "mutate", "admin", operation, startTime);
85664
86963
  }
85665
86964
  // adr.sync absorbs adr.validate via validate flag (T5615)
85666
86965
  case "adr.sync": {
85667
86966
  const validate = params?.validate;
85668
86967
  if (validate) {
85669
- const result2 = await validateAllAdrs(this.projectRoot);
86968
+ const result2 = await validateAllAdrs(projectRoot);
85670
86969
  return {
85671
86970
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
85672
86971
  success: result2.valid,
@@ -85679,7 +86978,7 @@ var AdminHandler = class {
85679
86978
  }
85680
86979
  };
85681
86980
  }
85682
- const result = await syncAdrsToDb(this.projectRoot);
86981
+ const result = await syncAdrsToDb(projectRoot);
85683
86982
  return {
85684
86983
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
85685
86984
  success: true,
@@ -85714,7 +87013,7 @@ var AdminHandler = class {
85714
87013
  }
85715
87014
  };
85716
87015
  }
85717
- const result2 = await importSnapshot(snapshot, this.projectRoot);
87016
+ const result2 = await importSnapshot(snapshot, projectRoot);
85718
87017
  return {
85719
87018
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
85720
87019
  success: true,
@@ -85750,7 +87049,7 @@ var AdminHandler = class {
85750
87049
  onConflict: params?.onConflict,
85751
87050
  onMissingDep: params?.onMissingDep,
85752
87051
  force: params?.force,
85753
- cwd: this.projectRoot
87052
+ cwd: projectRoot
85754
87053
  });
85755
87054
  return {
85756
87055
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
@@ -85776,7 +87075,7 @@ var AdminHandler = class {
85776
87075
  onDuplicate: params?.onDuplicate,
85777
87076
  addLabel: params?.addLabel,
85778
87077
  dryRun: params?.dryRun,
85779
- cwd: this.projectRoot
87078
+ cwd: projectRoot
85780
87079
  });
85781
87080
  return {
85782
87081
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
@@ -85786,8 +87085,8 @@ var AdminHandler = class {
85786
87085
  }
85787
87086
  case "detect": {
85788
87087
  const { ensureProjectContext: ensureProjectContext2, ensureContributorMcp: ensureContributorMcp2 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
85789
- const contextResult = await ensureProjectContext2(this.projectRoot, { force: true });
85790
- const mcpResult = await ensureContributorMcp2(this.projectRoot);
87088
+ const contextResult = await ensureProjectContext2(projectRoot, { force: true });
87089
+ const mcpResult = await ensureContributorMcp2(projectRoot);
85791
87090
  return wrapResult(
85792
87091
  {
85793
87092
  success: true,
@@ -85819,7 +87118,7 @@ var AdminHandler = class {
85819
87118
  requestPayload: params?.requestPayload,
85820
87119
  responsePayload: params?.responsePayload,
85821
87120
  metadata: params?.metadata,
85822
- cwd: this.projectRoot
87121
+ cwd: projectRoot
85823
87122
  });
85824
87123
  return {
85825
87124
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
@@ -85839,7 +87138,7 @@ var AdminHandler = class {
85839
87138
  startTime
85840
87139
  );
85841
87140
  }
85842
- const result = await deleteTokenUsage(tokenId, this.projectRoot);
87141
+ const result = await deleteTokenUsage(tokenId, projectRoot);
85843
87142
  return {
85844
87143
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
85845
87144
  success: true,
@@ -85862,7 +87161,7 @@ var AdminHandler = class {
85862
87161
  since: params?.since,
85863
87162
  until: params?.until
85864
87163
  },
85865
- this.projectRoot
87164
+ projectRoot
85866
87165
  );
85867
87166
  return {
85868
87167
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
@@ -85893,13 +87192,13 @@ var AdminHandler = class {
85893
87192
  taskId: params?.taskId,
85894
87193
  variant: params?.variant
85895
87194
  },
85896
- this.projectRoot
87195
+ projectRoot
85897
87196
  );
85898
87197
  return wrapResult(result, "mutate", "admin", operation, startTime);
85899
87198
  }
85900
87199
  case "map": {
85901
87200
  const { mapCodebase: mapCodebase3 } = await Promise.resolve().then(() => (init_codebase_map_engine(), codebase_map_engine_exports));
85902
- const result = await mapCodebase3(this.projectRoot, {
87201
+ const result = await mapCodebase3(projectRoot, {
85903
87202
  focus: params?.focus,
85904
87203
  storeToBrain: true
85905
87204
  });
@@ -85980,14 +87279,11 @@ var AdminHandler = class {
85980
87279
  // packages/cleo/src/dispatch/domains/check.ts
85981
87280
  init_internal();
85982
87281
  var CheckHandler = class {
85983
- projectRoot;
85984
- constructor() {
85985
- this.projectRoot = getProjectRoot();
85986
- }
85987
87282
  // -----------------------------------------------------------------------
85988
87283
  // Query
85989
87284
  // -----------------------------------------------------------------------
85990
87285
  async query(operation, params) {
87286
+ const projectRoot = getProjectRoot();
85991
87287
  const startTime = Date.now();
85992
87288
  try {
85993
87289
  switch (operation) {
@@ -86003,7 +87299,7 @@ var CheckHandler = class {
86003
87299
  startTime
86004
87300
  );
86005
87301
  }
86006
- const result = validateSchemaOp(type, params?.data, this.projectRoot);
87302
+ const result = validateSchemaOp(type, params?.data, projectRoot);
86007
87303
  return wrapResult(result, "query", "check", operation, startTime);
86008
87304
  }
86009
87305
  case "task": {
@@ -86018,11 +87314,11 @@ var CheckHandler = class {
86018
87314
  startTime
86019
87315
  );
86020
87316
  }
86021
- const result = await validateTask2(taskId, this.projectRoot);
87317
+ const result = await validateTask2(taskId, projectRoot);
86022
87318
  return wrapResult(result, "query", "check", operation, startTime);
86023
87319
  }
86024
87320
  case "manifest": {
86025
- const result = validateManifest(this.projectRoot);
87321
+ const result = validateManifest(projectRoot);
86026
87322
  return wrapResult(result, "query", "check", operation, startTime);
86027
87323
  }
86028
87324
  case "output": {
@@ -86040,7 +87336,7 @@ var CheckHandler = class {
86040
87336
  const result = validateOutput(
86041
87337
  filePath,
86042
87338
  params?.taskId,
86043
- this.projectRoot
87339
+ projectRoot
86044
87340
  );
86045
87341
  return wrapResult(result, "query", "check", operation, startTime);
86046
87342
  }
@@ -86048,23 +87344,23 @@ var CheckHandler = class {
86048
87344
  const detail = params?.detail;
86049
87345
  const limit = params?.limit;
86050
87346
  if (detail) {
86051
- const result2 = validateComplianceViolations(limit, this.projectRoot);
87347
+ const result2 = validateComplianceViolations(limit, projectRoot);
86052
87348
  return wrapResult(result2, "query", "check", operation, startTime);
86053
87349
  }
86054
- const result = validateComplianceSummary(this.projectRoot);
87350
+ const result = validateComplianceSummary(projectRoot);
86055
87351
  return wrapResult(result, "query", "check", operation, startTime);
86056
87352
  }
86057
87353
  case "test": {
86058
87354
  const format = params?.format;
86059
87355
  if (format === "coverage") {
86060
- const result2 = validateTestCoverage(this.projectRoot);
87356
+ const result2 = validateTestCoverage(projectRoot);
86061
87357
  return wrapResult(result2, "query", "check", operation, startTime);
86062
87358
  }
86063
- const result = validateTestStatus(this.projectRoot);
87359
+ const result = validateTestStatus(projectRoot);
86064
87360
  return wrapResult(result, "query", "check", operation, startTime);
86065
87361
  }
86066
87362
  case "coherence": {
86067
- const result = await validateCoherenceCheck(this.projectRoot);
87363
+ const result = await validateCoherenceCheck(projectRoot);
86068
87364
  return wrapResult(result, "query", "check", operation, startTime);
86069
87365
  }
86070
87366
  case "protocol": {
@@ -86083,12 +87379,12 @@ var CheckHandler = class {
86083
87379
  ...protocolParams,
86084
87380
  votingMatrixFile: params?.votingMatrixFile
86085
87381
  },
86086
- this.projectRoot
87382
+ projectRoot
86087
87383
  );
86088
87384
  return wrapResult(result, "query", "check", operation, startTime);
86089
87385
  }
86090
87386
  case "contribution": {
86091
- const result = await validateProtocolContribution(protocolParams, this.projectRoot);
87387
+ const result = await validateProtocolContribution(protocolParams, projectRoot);
86092
87388
  return wrapResult(result, "query", "check", operation, startTime);
86093
87389
  }
86094
87390
  case "decomposition": {
@@ -86097,12 +87393,12 @@ var CheckHandler = class {
86097
87393
  ...protocolParams,
86098
87394
  epicId: params?.epicId
86099
87395
  },
86100
- this.projectRoot
87396
+ projectRoot
86101
87397
  );
86102
87398
  return wrapResult(result, "query", "check", operation, startTime);
86103
87399
  }
86104
87400
  case "implementation": {
86105
- const result = await validateProtocolImplementation(protocolParams, this.projectRoot);
87401
+ const result = await validateProtocolImplementation(protocolParams, projectRoot);
86106
87402
  return wrapResult(result, "query", "check", operation, startTime);
86107
87403
  }
86108
87404
  case "specification": {
@@ -86111,7 +87407,7 @@ var CheckHandler = class {
86111
87407
  ...protocolParams,
86112
87408
  specFile: params?.specFile
86113
87409
  },
86114
- this.projectRoot
87410
+ projectRoot
86115
87411
  );
86116
87412
  return wrapResult(result, "query", "check", operation, startTime);
86117
87413
  }
@@ -86127,7 +87423,7 @@ var CheckHandler = class {
86127
87423
  startTime
86128
87424
  );
86129
87425
  }
86130
- const result = await validateProtocol(taskId, protocolType, this.projectRoot);
87426
+ const result = await validateProtocol(taskId, protocolType, projectRoot);
86131
87427
  return wrapResult(result, "query", "check", operation, startTime);
86132
87428
  }
86133
87429
  }
@@ -86144,11 +87440,11 @@ var CheckHandler = class {
86144
87440
  startTime
86145
87441
  );
86146
87442
  }
86147
- const result = await validateGateVerify({ taskId }, this.projectRoot);
87443
+ const result = await validateGateVerify({ taskId }, projectRoot);
86148
87444
  return wrapResult(result, "query", "check", operation, startTime);
86149
87445
  }
86150
87446
  case "archive.stats": {
86151
- const result = await systemArchiveStats(this.projectRoot);
87447
+ const result = await systemArchiveStats(projectRoot);
86152
87448
  return wrapResult(result, "query", "check", operation, startTime);
86153
87449
  }
86154
87450
  // T5405: WarpChain validation
@@ -86187,7 +87483,7 @@ var CheckHandler = class {
86187
87483
  startTime
86188
87484
  );
86189
87485
  }
86190
- const gradeResult = await gradeSession2(sessionId, this.projectRoot);
87486
+ const gradeResult = await gradeSession2(sessionId, projectRoot);
86191
87487
  return wrapResult(
86192
87488
  { success: true, data: gradeResult },
86193
87489
  "query",
@@ -86200,7 +87496,7 @@ var CheckHandler = class {
86200
87496
  const { readGrades: readGrades2 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
86201
87497
  const limit = typeof params?.limit === "number" ? params.limit : void 0;
86202
87498
  const offset = typeof params?.offset === "number" ? params.offset : void 0;
86203
- const allGrades = await readGrades2(void 0, this.projectRoot);
87499
+ const allGrades = await readGrades2(void 0, projectRoot);
86204
87500
  const sessionId = params?.sessionId;
86205
87501
  const filteredGrades = sessionId ? allGrades.filter((g) => g.sessionId === sessionId) : allGrades;
86206
87502
  const page = paginate(filteredGrades, limit, offset);
@@ -86231,6 +87527,7 @@ var CheckHandler = class {
86231
87527
  // Mutate
86232
87528
  // -----------------------------------------------------------------------
86233
87529
  async mutate(operation, params) {
87530
+ const projectRoot = getProjectRoot();
86234
87531
  const startTime = Date.now();
86235
87532
  try {
86236
87533
  switch (operation) {
@@ -86252,14 +87549,14 @@ var CheckHandler = class {
86252
87549
  result,
86253
87550
  params?.protocol,
86254
87551
  params?.violations,
86255
- this.projectRoot
87552
+ projectRoot
86256
87553
  );
86257
87554
  return wrapResult(engineResult, "mutate", "check", operation, startTime);
86258
87555
  }
86259
87556
  case "test.run": {
86260
87557
  const result = validateTestRun(
86261
87558
  params,
86262
- this.projectRoot
87559
+ projectRoot
86263
87560
  );
86264
87561
  return wrapResult(result, "mutate", "check", operation, startTime);
86265
87562
  }
@@ -86267,7 +87564,7 @@ var CheckHandler = class {
86267
87564
  const { syncComplianceMetrics: syncComplianceMetrics2 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
86268
87565
  const result = await syncComplianceMetrics2({
86269
87566
  force: params?.force,
86270
- cwd: this.projectRoot
87567
+ cwd: projectRoot
86271
87568
  });
86272
87569
  return {
86273
87570
  _meta: dispatchMeta("mutate", "check", operation, startTime),
@@ -86295,7 +87592,7 @@ var CheckHandler = class {
86295
87592
  all: params?.all,
86296
87593
  reset: params?.reset
86297
87594
  };
86298
- const result = await validateGateVerify(gateParams, this.projectRoot);
87595
+ const result = await validateGateVerify(gateParams, projectRoot);
86299
87596
  return wrapResult(result, "mutate", "check", operation, startTime);
86300
87597
  }
86301
87598
  default:
@@ -86338,14 +87635,11 @@ var CheckHandler = class {
86338
87635
  // packages/cleo/src/dispatch/domains/memory.ts
86339
87636
  init_src2();
86340
87637
  var MemoryHandler = class {
86341
- projectRoot;
86342
- constructor() {
86343
- this.projectRoot = getProjectRoot();
86344
- }
86345
87638
  // -----------------------------------------------------------------------
86346
87639
  // Query
86347
87640
  // -----------------------------------------------------------------------
86348
87641
  async query(operation, params) {
87642
+ const projectRoot = getProjectRoot();
86349
87643
  const startTime = Date.now();
86350
87644
  try {
86351
87645
  switch (operation) {
@@ -86369,7 +87663,7 @@ var MemoryHandler = class {
86369
87663
  dateStart: params?.dateStart,
86370
87664
  dateEnd: params?.dateEnd
86371
87665
  },
86372
- this.projectRoot
87666
+ projectRoot
86373
87667
  );
86374
87668
  return wrapResult(result, "query", "memory", operation, startTime);
86375
87669
  }
@@ -86391,7 +87685,7 @@ var MemoryHandler = class {
86391
87685
  depthBefore: params?.depthBefore,
86392
87686
  depthAfter: params?.depthAfter
86393
87687
  },
86394
- this.projectRoot
87688
+ projectRoot
86395
87689
  );
86396
87690
  return wrapResult(result, "query", "memory", operation, startTime);
86397
87691
  }
@@ -86407,7 +87701,7 @@ var MemoryHandler = class {
86407
87701
  startTime
86408
87702
  );
86409
87703
  }
86410
- const result = await memoryFetch({ ids }, this.projectRoot);
87704
+ const result = await memoryFetch({ ids }, projectRoot);
86411
87705
  return wrapResult(result, "query", "memory", operation, startTime);
86412
87706
  }
86413
87707
  case "decision.find": {
@@ -86417,7 +87711,7 @@ var MemoryHandler = class {
86417
87711
  taskId: params?.taskId,
86418
87712
  limit: params?.limit
86419
87713
  },
86420
- this.projectRoot
87714
+ projectRoot
86421
87715
  );
86422
87716
  return wrapResult(result, "query", "memory", operation, startTime);
86423
87717
  }
@@ -86430,7 +87724,7 @@ var MemoryHandler = class {
86430
87724
  minFrequency: params?.minFrequency,
86431
87725
  limit: params?.limit
86432
87726
  },
86433
- this.projectRoot
87727
+ projectRoot
86434
87728
  );
86435
87729
  return wrapResult(result, "query", "memory", operation, startTime);
86436
87730
  }
@@ -86443,7 +87737,7 @@ var MemoryHandler = class {
86443
87737
  applicableType: params?.applicableType,
86444
87738
  limit: params?.limit
86445
87739
  },
86446
- this.projectRoot
87740
+ projectRoot
86447
87741
  );
86448
87742
  return wrapResult(result, "query", "memory", operation, startTime);
86449
87743
  }
@@ -86459,7 +87753,7 @@ var MemoryHandler = class {
86459
87753
  startTime
86460
87754
  );
86461
87755
  }
86462
- const result = await memoryGraphShow({ nodeId }, this.projectRoot);
87756
+ const result = await memoryGraphShow({ nodeId }, projectRoot);
86463
87757
  return wrapResult(result, "query", "memory", operation, startTime);
86464
87758
  }
86465
87759
  case "graph.neighbors": {
@@ -86476,7 +87770,7 @@ var MemoryHandler = class {
86476
87770
  }
86477
87771
  const result = await memoryGraphNeighbors(
86478
87772
  { nodeId, edgeType: params?.edgeType },
86479
- this.projectRoot
87773
+ projectRoot
86480
87774
  );
86481
87775
  return wrapResult(result, "query", "memory", operation, startTime);
86482
87776
  }
@@ -86492,7 +87786,7 @@ var MemoryHandler = class {
86492
87786
  startTime
86493
87787
  );
86494
87788
  }
86495
- const result = await memoryReasonWhy({ taskId }, this.projectRoot);
87789
+ const result = await memoryReasonWhy({ taskId }, projectRoot);
86496
87790
  return wrapResult(result, "query", "memory", operation, startTime);
86497
87791
  }
86498
87792
  case "reason.similar": {
@@ -86509,7 +87803,7 @@ var MemoryHandler = class {
86509
87803
  }
86510
87804
  const result = await memoryReasonSimilar(
86511
87805
  { entryId, limit: params?.limit },
86512
- this.projectRoot
87806
+ projectRoot
86513
87807
  );
86514
87808
  return wrapResult(result, "query", "memory", operation, startTime);
86515
87809
  }
@@ -86533,7 +87827,7 @@ var MemoryHandler = class {
86533
87827
  graphWeight: params?.graphWeight,
86534
87828
  limit: params?.limit
86535
87829
  },
86536
- this.projectRoot
87830
+ projectRoot
86537
87831
  );
86538
87832
  return wrapResult(result, "query", "memory", operation, startTime);
86539
87833
  }
@@ -86553,6 +87847,7 @@ var MemoryHandler = class {
86553
87847
  // Mutate
86554
87848
  // -----------------------------------------------------------------------
86555
87849
  async mutate(operation, params) {
87850
+ const projectRoot = getProjectRoot();
86556
87851
  const startTime = Date.now();
86557
87852
  try {
86558
87853
  switch (operation) {
@@ -86577,7 +87872,7 @@ var MemoryHandler = class {
86577
87872
  sourceSessionId: params?.sourceSessionId,
86578
87873
  sourceType: params?.sourceType
86579
87874
  },
86580
- this.projectRoot
87875
+ projectRoot
86581
87876
  );
86582
87877
  return wrapResult(result, "mutate", "memory", operation, startTime);
86583
87878
  }
@@ -86602,7 +87897,7 @@ var MemoryHandler = class {
86602
87897
  taskId: params?.taskId,
86603
87898
  sessionId: params?.sessionId
86604
87899
  },
86605
- this.projectRoot
87900
+ projectRoot
86606
87901
  );
86607
87902
  return wrapResult(result, "mutate", "memory", operation, startTime);
86608
87903
  }
@@ -86630,7 +87925,7 @@ var MemoryHandler = class {
86630
87925
  examples: params?.examples,
86631
87926
  successRate: params?.successRate
86632
87927
  },
86633
- this.projectRoot
87928
+ projectRoot
86634
87929
  );
86635
87930
  return wrapResult(result, "mutate", "memory", operation, startTime);
86636
87931
  }
@@ -86656,7 +87951,7 @@ var MemoryHandler = class {
86656
87951
  application: params?.application,
86657
87952
  applicableTypes: params?.applicableTypes
86658
87953
  },
86659
- this.projectRoot
87954
+ projectRoot
86660
87955
  );
86661
87956
  return wrapResult(result, "mutate", "memory", operation, startTime);
86662
87957
  }
@@ -86673,7 +87968,7 @@ var MemoryHandler = class {
86673
87968
  startTime
86674
87969
  );
86675
87970
  }
86676
- const result = await memoryLink({ taskId, entryId }, this.projectRoot);
87971
+ const result = await memoryLink({ taskId, entryId }, projectRoot);
86677
87972
  return wrapResult(result, "mutate", "memory", operation, startTime);
86678
87973
  }
86679
87974
  case "graph.add": {
@@ -86688,7 +87983,7 @@ var MemoryHandler = class {
86688
87983
  edgeType: params?.edgeType,
86689
87984
  weight: params?.weight
86690
87985
  },
86691
- this.projectRoot
87986
+ projectRoot
86692
87987
  );
86693
87988
  return wrapResult(result, "mutate", "memory", operation, startTime);
86694
87989
  }
@@ -86700,7 +87995,7 @@ var MemoryHandler = class {
86700
87995
  toId: params?.toId,
86701
87996
  edgeType: params?.edgeType
86702
87997
  },
86703
- this.projectRoot
87998
+ projectRoot
86704
87999
  );
86705
88000
  return wrapResult(result, "mutate", "memory", operation, startTime);
86706
88001
  }
@@ -86989,14 +88284,11 @@ async function nexusTransferExecute(params) {
86989
88284
 
86990
88285
  // packages/cleo/src/dispatch/domains/nexus.ts
86991
88286
  var NexusHandler = class {
86992
- projectRoot;
86993
- constructor() {
86994
- this.projectRoot = getProjectRoot();
86995
- }
86996
88287
  // -----------------------------------------------------------------------
86997
88288
  // Query
86998
88289
  // -----------------------------------------------------------------------
86999
88290
  async query(operation, params) {
88291
+ const projectRoot = getProjectRoot();
87000
88292
  const startTime = Date.now();
87001
88293
  try {
87002
88294
  switch (operation) {
@@ -87144,7 +88436,7 @@ var NexusHandler = class {
87144
88436
  return wrapResult(result, "query", "nexus", operation, startTime);
87145
88437
  }
87146
88438
  case "share.status": {
87147
- const result = await nexusShareStatus(this.projectRoot);
88439
+ const result = await nexusShareStatus(projectRoot);
87148
88440
  return wrapResult(result, "query", "nexus", "share.status", startTime);
87149
88441
  }
87150
88442
  case "transfer.preview": {
@@ -87185,6 +88477,7 @@ var NexusHandler = class {
87185
88477
  // Mutate
87186
88478
  // -----------------------------------------------------------------------
87187
88479
  async mutate(operation, params) {
88480
+ const projectRoot = getProjectRoot();
87188
88481
  const startTime = Date.now();
87189
88482
  try {
87190
88483
  switch (operation) {
@@ -87268,13 +88561,13 @@ var NexusHandler = class {
87268
88561
  return wrapResult(result, "mutate", "nexus", operation, startTime);
87269
88562
  }
87270
88563
  case "reconcile": {
87271
- const projectRoot = params?.projectRoot || process.cwd();
87272
- const result = await nexusReconcileProject(projectRoot);
88564
+ const projectRoot2 = params?.projectRoot || process.cwd();
88565
+ const result = await nexusReconcileProject(projectRoot2);
87273
88566
  return wrapResult(result, "mutate", "nexus", operation, startTime);
87274
88567
  }
87275
88568
  case "share.snapshot.export": {
87276
88569
  const outputPath = params?.outputPath;
87277
- const result = await nexusShareSnapshotExport(this.projectRoot, outputPath);
88570
+ const result = await nexusShareSnapshotExport(projectRoot, outputPath);
87278
88571
  return wrapResult(result, "mutate", "nexus", "share.snapshot.export", startTime);
87279
88572
  }
87280
88573
  case "share.snapshot.import": {
@@ -87289,7 +88582,7 @@ var NexusHandler = class {
87289
88582
  startTime
87290
88583
  );
87291
88584
  }
87292
- const result = await nexusShareSnapshotImport(this.projectRoot, inputPath);
88585
+ const result = await nexusShareSnapshotImport(projectRoot, inputPath);
87293
88586
  return wrapResult(result, "mutate", "nexus", "share.snapshot.import", startTime);
87294
88587
  }
87295
88588
  case "transfer": {
@@ -87366,20 +88659,17 @@ var NexusHandler = class {
87366
88659
  // packages/cleo/src/dispatch/domains/orchestrate.ts
87367
88660
  init_internal();
87368
88661
  var OrchestrateHandler = class {
87369
- projectRoot;
87370
- constructor() {
87371
- this.projectRoot = getProjectRoot();
87372
- }
87373
88662
  // -----------------------------------------------------------------------
87374
88663
  // DomainHandler interface
87375
88664
  // -----------------------------------------------------------------------
87376
88665
  async query(operation, params) {
88666
+ const projectRoot = getProjectRoot();
87377
88667
  const startTime = Date.now();
87378
88668
  try {
87379
88669
  switch (operation) {
87380
88670
  case "status": {
87381
88671
  const epicId = params?.epicId;
87382
- const result = await orchestrateStatus(epicId, this.projectRoot);
88672
+ const result = await orchestrateStatus(epicId, projectRoot);
87383
88673
  return wrapResult(result, "query", "orchestrate", operation, startTime);
87384
88674
  }
87385
88675
  case "next": {
@@ -87394,7 +88684,7 @@ var OrchestrateHandler = class {
87394
88684
  startTime
87395
88685
  );
87396
88686
  }
87397
- const result = await orchestrateNext(epicId, this.projectRoot);
88687
+ const result = await orchestrateNext(epicId, projectRoot);
87398
88688
  return wrapResult(result, "query", "orchestrate", operation, startTime);
87399
88689
  }
87400
88690
  case "ready": {
@@ -87409,18 +88699,18 @@ var OrchestrateHandler = class {
87409
88699
  startTime
87410
88700
  );
87411
88701
  }
87412
- const result = await orchestrateReady(epicId, this.projectRoot);
88702
+ const result = await orchestrateReady(epicId, projectRoot);
87413
88703
  return wrapResult(result, "query", "orchestrate", operation, startTime);
87414
88704
  }
87415
88705
  case "analyze": {
87416
88706
  const epicId = params?.epicId;
87417
88707
  const mode = params?.mode;
87418
- const result = await orchestrateAnalyze(epicId, this.projectRoot, mode);
88708
+ const result = await orchestrateAnalyze(epicId, projectRoot, mode);
87419
88709
  return wrapResult(result, "query", "orchestrate", "analyze", startTime);
87420
88710
  }
87421
88711
  case "context": {
87422
88712
  const epicId = params?.epicId;
87423
- const result = await orchestrateContext(epicId, this.projectRoot);
88713
+ const result = await orchestrateContext(epicId, projectRoot);
87424
88714
  return wrapResult(result, "query", "orchestrate", operation, startTime);
87425
88715
  }
87426
88716
  case "waves": {
@@ -87435,16 +88725,16 @@ var OrchestrateHandler = class {
87435
88725
  startTime
87436
88726
  );
87437
88727
  }
87438
- const result = await orchestrateWaves(epicId, this.projectRoot);
88728
+ const result = await orchestrateWaves(epicId, projectRoot);
87439
88729
  return wrapResult(result, "query", "orchestrate", operation, startTime);
87440
88730
  }
87441
88731
  case "bootstrap": {
87442
88732
  const speed = params?.speed;
87443
- const result = await orchestrateBootstrap(this.projectRoot, { speed });
88733
+ const result = await orchestrateBootstrap(projectRoot, { speed });
87444
88734
  return wrapResult(result, "query", "orchestrate", operation, startTime);
87445
88735
  }
87446
88736
  case "unblock.opportunities": {
87447
- const result = await orchestrateUnblockOpportunities(this.projectRoot);
88737
+ const result = await orchestrateUnblockOpportunities(projectRoot);
87448
88738
  return wrapResult(result, "query", "orchestrate", operation, startTime);
87449
88739
  }
87450
88740
  case "tessera.list": {
@@ -87501,6 +88791,7 @@ var OrchestrateHandler = class {
87501
88791
  }
87502
88792
  }
87503
88793
  async mutate(operation, params) {
88794
+ const projectRoot = getProjectRoot();
87504
88795
  const startTime = Date.now();
87505
88796
  try {
87506
88797
  switch (operation) {
@@ -87516,7 +88807,7 @@ var OrchestrateHandler = class {
87516
88807
  startTime
87517
88808
  );
87518
88809
  }
87519
- const result = await orchestrateStartup(epicId, this.projectRoot);
88810
+ const result = await orchestrateStartup(epicId, projectRoot);
87520
88811
  return wrapResult(result, "mutate", "orchestrate", operation, startTime);
87521
88812
  }
87522
88813
  case "spawn": {
@@ -87533,7 +88824,7 @@ var OrchestrateHandler = class {
87533
88824
  }
87534
88825
  const protocolType = params?.protocolType;
87535
88826
  const tier = params?.tier;
87536
- const result = await orchestrateSpawn(taskId, protocolType, this.projectRoot, tier);
88827
+ const result = await orchestrateSpawn(taskId, protocolType, projectRoot, tier);
87537
88828
  return wrapResult(result, "mutate", "orchestrate", operation, startTime);
87538
88829
  }
87539
88830
  case "handoff": {
@@ -87570,7 +88861,7 @@ var OrchestrateHandler = class {
87570
88861
  tier,
87571
88862
  idempotencyKey: params?.idempotencyKey
87572
88863
  },
87573
- this.projectRoot
88864
+ projectRoot
87574
88865
  );
87575
88866
  return wrapResult(result, "mutate", "orchestrate", operation, startTime);
87576
88867
  }
@@ -87593,7 +88884,7 @@ var OrchestrateHandler = class {
87593
88884
  taskId,
87594
88885
  adapterId,
87595
88886
  protocolType,
87596
- this.projectRoot,
88887
+ projectRoot,
87597
88888
  tier
87598
88889
  );
87599
88890
  return wrapResult(result, "mutate", "orchestrate", operation, startTime);
@@ -87610,7 +88901,7 @@ var OrchestrateHandler = class {
87610
88901
  startTime
87611
88902
  );
87612
88903
  }
87613
- const result = await orchestrateValidate(taskId, this.projectRoot);
88904
+ const result = await orchestrateValidate(taskId, projectRoot);
87614
88905
  return wrapResult(result, "mutate", "orchestrate", operation, startTime);
87615
88906
  }
87616
88907
  case "parallel": {
@@ -87638,7 +88929,7 @@ var OrchestrateHandler = class {
87638
88929
  startTime
87639
88930
  );
87640
88931
  }
87641
- const result = await orchestrateParallelStart(epicId, wave, this.projectRoot);
88932
+ const result = await orchestrateParallelStart(epicId, wave, projectRoot);
87642
88933
  return wrapResult(result, "mutate", "orchestrate", "parallel", startTime);
87643
88934
  },
87644
88935
  end: async () => {
@@ -87664,7 +88955,7 @@ var OrchestrateHandler = class {
87664
88955
  startTime
87665
88956
  );
87666
88957
  }
87667
- const result = await orchestrateParallelEnd(epicId, wave, this.projectRoot);
88958
+ const result = await orchestrateParallelEnd(epicId, wave, projectRoot);
87668
88959
  return wrapResult(result, "mutate", "orchestrate", "parallel", startTime);
87669
88960
  }
87670
88961
  });
@@ -87707,7 +88998,7 @@ var OrchestrateHandler = class {
87707
88998
  const instance = await instantiateTessera(
87708
88999
  template,
87709
89000
  { templateId, epicId, variables: { epicId, ...variables } },
87710
- this.projectRoot
89001
+ projectRoot
87711
89002
  );
87712
89003
  return {
87713
89004
  _meta: dispatchMeta("mutate", "orchestrate", operation, startTime),
@@ -87763,9 +89054,8 @@ var OrchestrateHandler = class {
87763
89054
  init_internal();
87764
89055
  import { execFileSync as execFileSync13 } from "node:child_process";
87765
89056
  var PipelineHandler = class {
87766
- projectRoot;
87767
- constructor() {
87768
- this.projectRoot = getProjectRoot();
89057
+ get projectRoot() {
89058
+ return getProjectRoot();
87769
89059
  }
87770
89060
  // -----------------------------------------------------------------------
87771
89061
  // DomainHandler interface
@@ -88638,24 +89928,21 @@ function unbindSession() {
88638
89928
 
88639
89929
  // packages/cleo/src/dispatch/domains/session.ts
88640
89930
  var SessionHandler = class {
88641
- projectRoot;
88642
- constructor() {
88643
- this.projectRoot = getProjectRoot();
88644
- }
88645
89931
  // -----------------------------------------------------------------------
88646
89932
  // Query
88647
89933
  // -----------------------------------------------------------------------
88648
89934
  async query(operation, params) {
89935
+ const projectRoot = getProjectRoot();
88649
89936
  const startTime = Date.now();
88650
89937
  try {
88651
89938
  switch (operation) {
88652
89939
  case "status": {
88653
- const result = await sessionStatus2(this.projectRoot);
89940
+ const result = await sessionStatus2(projectRoot);
88654
89941
  return wrapResult(result, "query", "session", operation, startTime);
88655
89942
  }
88656
89943
  case "list": {
88657
89944
  const result = await sessionList(
88658
- this.projectRoot,
89945
+ projectRoot,
88659
89946
  params
88660
89947
  );
88661
89948
  return wrapResult(result, "query", "session", operation, startTime);
@@ -88675,24 +89962,21 @@ var SessionHandler = class {
88675
89962
  }
88676
89963
  const include = params?.include;
88677
89964
  if (include === "debrief") {
88678
- const result2 = await sessionDebriefShow(this.projectRoot, sessionId);
89965
+ const result2 = await sessionDebriefShow(projectRoot, sessionId);
88679
89966
  return wrapResult(result2, "query", "session", operation, startTime);
88680
89967
  }
88681
- const result = await sessionShow(this.projectRoot, sessionId);
89968
+ const result = await sessionShow(projectRoot, sessionId);
88682
89969
  return wrapResult(result, "query", "session", operation, startTime);
88683
89970
  }
88684
89971
  case "decision.log": {
88685
89972
  const result = await sessionDecisionLog(
88686
- this.projectRoot,
89973
+ projectRoot,
88687
89974
  params
88688
89975
  );
88689
89976
  return wrapResult(result, "query", "session", operation, startTime);
88690
89977
  }
88691
89978
  case "context.drift": {
88692
- const result = await sessionContextDrift(
88693
- this.projectRoot,
88694
- params
88695
- );
89979
+ const result = await sessionContextDrift(projectRoot, params);
88696
89980
  return wrapResult(result, "query", "session", operation, startTime);
88697
89981
  }
88698
89982
  case "handoff.show": {
@@ -88705,11 +89989,11 @@ var SessionHandler = class {
88705
89989
  scopeFilter = { type: "epic", epicId: scope.replace("epic:", "") };
88706
89990
  }
88707
89991
  }
88708
- const result = await sessionHandoff(this.projectRoot, scopeFilter);
89992
+ const result = await sessionHandoff(projectRoot, scopeFilter);
88709
89993
  return wrapResult(result, "query", "session", operation, startTime);
88710
89994
  }
88711
89995
  case "briefing.show": {
88712
- const result = await sessionBriefing(this.projectRoot, {
89996
+ const result = await sessionBriefing(projectRoot, {
88713
89997
  maxNextTasks: params?.maxNextTasks,
88714
89998
  maxBugs: params?.maxBugs,
88715
89999
  maxBlocked: params?.maxBlocked,
@@ -88720,7 +90004,7 @@ var SessionHandler = class {
88720
90004
  }
88721
90005
  case "find": {
88722
90006
  const result = await sessionFind(
88723
- this.projectRoot,
90007
+ projectRoot,
88724
90008
  params
88725
90009
  );
88726
90010
  return wrapResult(result, "query", "session", operation, startTime);
@@ -88740,6 +90024,7 @@ var SessionHandler = class {
88740
90024
  // Mutate
88741
90025
  // -----------------------------------------------------------------------
88742
90026
  async mutate(operation, params) {
90027
+ const projectRoot = getProjectRoot();
88743
90028
  const startTime = Date.now();
88744
90029
  try {
88745
90030
  switch (operation) {
@@ -88755,7 +90040,7 @@ var SessionHandler = class {
88755
90040
  startTime
88756
90041
  );
88757
90042
  }
88758
- const result = await sessionStart(this.projectRoot, {
90043
+ const result = await sessionStart(projectRoot, {
88759
90044
  scope,
88760
90045
  name: params?.name,
88761
90046
  autoStart: params?.autoStart,
@@ -88786,19 +90071,19 @@ var SessionHandler = class {
88786
90071
  return wrapResult(result, "mutate", "session", operation, startTime);
88787
90072
  }
88788
90073
  case "end": {
88789
- const endResult = await sessionEnd(this.projectRoot, params?.note);
90074
+ const endResult = await sessionEnd(projectRoot, params?.note);
88790
90075
  if (endResult.success && endResult.data) {
88791
90076
  const sessionId = endResult.data.sessionId;
88792
90077
  if (sessionId) {
88793
90078
  let debriefResult = null;
88794
90079
  try {
88795
- debriefResult = await sessionComputeDebrief(this.projectRoot, sessionId, {
90080
+ debriefResult = await sessionComputeDebrief(projectRoot, sessionId, {
88796
90081
  note: params?.note,
88797
90082
  nextAction: params?.nextAction
88798
90083
  });
88799
90084
  } catch {
88800
90085
  try {
88801
- await sessionComputeHandoff(this.projectRoot, sessionId, {
90086
+ await sessionComputeHandoff(projectRoot, sessionId, {
88802
90087
  note: params?.note,
88803
90088
  nextAction: params?.nextAction
88804
90089
  });
@@ -88808,7 +90093,7 @@ var SessionHandler = class {
88808
90093
  if (debriefResult?.success && debriefResult.data) {
88809
90094
  try {
88810
90095
  const { persistSessionMemory: persistSessionMemory2 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
88811
- await persistSessionMemory2(this.projectRoot, sessionId, debriefResult.data);
90096
+ await persistSessionMemory2(projectRoot, sessionId, debriefResult.data);
88812
90097
  } catch {
88813
90098
  }
88814
90099
  }
@@ -88829,7 +90114,7 @@ var SessionHandler = class {
88829
90114
  startTime
88830
90115
  );
88831
90116
  }
88832
- const result = await sessionResume(this.projectRoot, sessionId);
90117
+ const result = await sessionResume(projectRoot, sessionId);
88833
90118
  return wrapResult(result, "mutate", "session", operation, startTime);
88834
90119
  }
88835
90120
  case "suspend": {
@@ -88845,21 +90130,18 @@ var SessionHandler = class {
88845
90130
  );
88846
90131
  }
88847
90132
  const result = await sessionSuspend(
88848
- this.projectRoot,
90133
+ projectRoot,
88849
90134
  sessionId,
88850
90135
  params?.reason
88851
90136
  );
88852
90137
  return wrapResult(result, "mutate", "session", operation, startTime);
88853
90138
  }
88854
90139
  case "gc": {
88855
- const result = await sessionGc(
88856
- this.projectRoot,
88857
- params?.maxAgeDays
88858
- );
90140
+ const result = await sessionGc(projectRoot, params?.maxAgeDays);
88859
90141
  return wrapResult(result, "mutate", "session", operation, startTime);
88860
90142
  }
88861
90143
  case "record.decision": {
88862
- const result = await sessionRecordDecision(this.projectRoot, {
90144
+ const result = await sessionRecordDecision(projectRoot, {
88863
90145
  sessionId: params?.sessionId,
88864
90146
  taskId: params?.taskId,
88865
90147
  decision: params?.decision,
@@ -88869,7 +90151,7 @@ var SessionHandler = class {
88869
90151
  return wrapResult(result, "mutate", "session", operation, startTime);
88870
90152
  }
88871
90153
  case "record.assumption": {
88872
- const result = await sessionRecordAssumption(this.projectRoot, {
90154
+ const result = await sessionRecordAssumption(projectRoot, {
88873
90155
  sessionId: params?.sessionId,
88874
90156
  taskId: params?.taskId,
88875
90157
  assumption: params?.assumption,
@@ -89010,14 +90292,11 @@ async function stickyPurge(projectRoot, id) {
89010
90292
 
89011
90293
  // packages/cleo/src/dispatch/domains/sticky.ts
89012
90294
  var StickyHandler = class {
89013
- projectRoot;
89014
- constructor() {
89015
- this.projectRoot = getProjectRoot();
89016
- }
89017
90295
  // -----------------------------------------------------------------------
89018
90296
  // Query
89019
90297
  // -----------------------------------------------------------------------
89020
90298
  async query(operation, params) {
90299
+ const projectRoot = getProjectRoot();
89021
90300
  const startTime = Date.now();
89022
90301
  try {
89023
90302
  switch (operation) {
@@ -89027,13 +90306,13 @@ var StickyHandler = class {
89027
90306
  color: params?.color,
89028
90307
  priority: params?.priority
89029
90308
  };
89030
- const result = await stickyList(this.projectRoot, filters);
90309
+ const result = await stickyList(projectRoot, filters);
89031
90310
  if (!result.success) {
89032
90311
  return wrapResult(result, "query", "sticky", operation, startTime);
89033
90312
  }
89034
90313
  const filteredStickies = result.data?.stickies ?? [];
89035
90314
  const hasFilter = filters.status !== void 0 || filters.color !== void 0 || filters.priority !== void 0;
89036
- const totalResult = hasFilter ? await stickyList(this.projectRoot, {}) : result;
90315
+ const totalResult = hasFilter ? await stickyList(projectRoot, {}) : result;
89037
90316
  if (!totalResult.success) {
89038
90317
  return wrapResult(totalResult, "query", "sticky", operation, startTime);
89039
90318
  }
@@ -89063,7 +90342,7 @@ var StickyHandler = class {
89063
90342
  startTime
89064
90343
  );
89065
90344
  }
89066
- const result = await stickyShow(this.projectRoot, stickyId);
90345
+ const result = await stickyShow(projectRoot, stickyId);
89067
90346
  return wrapResult(result, "query", "sticky", operation, startTime);
89068
90347
  }
89069
90348
  default:
@@ -89082,6 +90361,7 @@ var StickyHandler = class {
89082
90361
  // Mutate
89083
90362
  // -----------------------------------------------------------------------
89084
90363
  async mutate(operation, params) {
90364
+ const projectRoot = getProjectRoot();
89085
90365
  const startTime = Date.now();
89086
90366
  try {
89087
90367
  switch (operation) {
@@ -89097,7 +90377,7 @@ var StickyHandler = class {
89097
90377
  startTime
89098
90378
  );
89099
90379
  }
89100
- const result = await stickyAdd(this.projectRoot, {
90380
+ const result = await stickyAdd(projectRoot, {
89101
90381
  content,
89102
90382
  tags: params?.tags,
89103
90383
  color: params?.color,
@@ -89130,7 +90410,7 @@ var StickyHandler = class {
89130
90410
  }
89131
90411
  if (targetType === "task") {
89132
90412
  const result = await stickyConvertToTask(
89133
- this.projectRoot,
90413
+ projectRoot,
89134
90414
  stickyId,
89135
90415
  params?.title
89136
90416
  );
@@ -89147,18 +90427,18 @@ var StickyHandler = class {
89147
90427
  startTime
89148
90428
  );
89149
90429
  }
89150
- const result = await stickyConvertToTaskNote(this.projectRoot, stickyId, taskId);
90430
+ const result = await stickyConvertToTaskNote(projectRoot, stickyId, taskId);
89151
90431
  return wrapResult(result, "mutate", "sticky", operation, startTime);
89152
90432
  } else if (targetType === "session_note") {
89153
90433
  const result = await stickyConvertToSessionNote(
89154
- this.projectRoot,
90434
+ projectRoot,
89155
90435
  stickyId,
89156
90436
  params?.sessionId
89157
90437
  );
89158
90438
  return wrapResult(result, "mutate", "sticky", operation, startTime);
89159
90439
  } else {
89160
90440
  const result = await stickyConvertToMemory(
89161
- this.projectRoot,
90441
+ projectRoot,
89162
90442
  stickyId,
89163
90443
  params?.memoryType
89164
90444
  );
@@ -89177,7 +90457,7 @@ var StickyHandler = class {
89177
90457
  startTime
89178
90458
  );
89179
90459
  }
89180
- const result = await stickyArchive(this.projectRoot, stickyId);
90460
+ const result = await stickyArchive(projectRoot, stickyId);
89181
90461
  return wrapResult(result, "mutate", "sticky", operation, startTime);
89182
90462
  }
89183
90463
  case "purge": {
@@ -89192,7 +90472,7 @@ var StickyHandler = class {
89192
90472
  startTime
89193
90473
  );
89194
90474
  }
89195
- const result = await stickyPurge(this.projectRoot, stickyId);
90475
+ const result = await stickyPurge(projectRoot, stickyId);
89196
90476
  return wrapResult(result, "mutate", "sticky", operation, startTime);
89197
90477
  }
89198
90478
  default:
@@ -89221,23 +90501,20 @@ var StickyHandler = class {
89221
90501
  // packages/cleo/src/dispatch/domains/tasks.ts
89222
90502
  init_src2();
89223
90503
  var TasksHandler = class {
89224
- projectRoot;
89225
- constructor() {
89226
- this.projectRoot = getProjectRoot();
89227
- }
89228
90504
  // -----------------------------------------------------------------------
89229
90505
  // Query
89230
90506
  // -----------------------------------------------------------------------
89231
90507
  async query(operation, params) {
90508
+ const projectRoot = getProjectRoot();
89232
90509
  const startTime = Date.now();
89233
90510
  try {
89234
90511
  switch (operation) {
89235
90512
  case "show": {
89236
- const result = await taskShow(this.projectRoot, params.taskId);
90513
+ const result = await taskShow(projectRoot, params.taskId);
89237
90514
  return wrapResult(result, "query", "tasks", operation, startTime);
89238
90515
  }
89239
90516
  case "list": {
89240
- const result = await taskList(this.projectRoot, {
90517
+ const result = await taskList(projectRoot, {
89241
90518
  parent: params?.parent,
89242
90519
  status: params?.status,
89243
90520
  priority: params?.priority,
@@ -89253,7 +90530,7 @@ var TasksHandler = class {
89253
90530
  }
89254
90531
  case "find": {
89255
90532
  const result = await taskFind(
89256
- this.projectRoot,
90533
+ projectRoot,
89257
90534
  params?.query,
89258
90535
  params?.limit,
89259
90536
  {
@@ -89268,12 +90545,12 @@ var TasksHandler = class {
89268
90545
  }
89269
90546
  case "tree": {
89270
90547
  const taskId = params?.taskId;
89271
- const result = await taskTree(this.projectRoot, taskId);
90548
+ const result = await taskTree(projectRoot, taskId);
89272
90549
  return wrapResult(result, "query", "tasks", operation, startTime);
89273
90550
  }
89274
90551
  case "blockers": {
89275
90552
  const result = await taskBlockers(
89276
- this.projectRoot,
90553
+ projectRoot,
89277
90554
  params
89278
90555
  );
89279
90556
  return wrapResult(result, "query", "tasks", operation, startTime);
@@ -89281,11 +90558,11 @@ var TasksHandler = class {
89281
90558
  case "depends": {
89282
90559
  const action = params?.action;
89283
90560
  if (action === "overview") {
89284
- const result2 = await taskDepsOverview(this.projectRoot);
90561
+ const result2 = await taskDepsOverview(projectRoot);
89285
90562
  return wrapResult(result2, "query", "tasks", operation, startTime);
89286
90563
  }
89287
90564
  if (action === "cycles") {
89288
- const result2 = await taskDepsCycles(this.projectRoot);
90565
+ const result2 = await taskDepsCycles(projectRoot);
89289
90566
  return wrapResult(result2, "query", "tasks", operation, startTime);
89290
90567
  }
89291
90568
  const taskId = params?.taskId;
@@ -89301,64 +90578,64 @@ var TasksHandler = class {
89301
90578
  }
89302
90579
  const direction = params?.direction;
89303
90580
  const tree = params?.tree;
89304
- const result = await taskDepends(this.projectRoot, taskId, direction, tree);
90581
+ const result = await taskDepends(projectRoot, taskId, direction, tree);
89305
90582
  return wrapResult(result, "query", "tasks", operation, startTime);
89306
90583
  }
89307
90584
  case "analyze": {
89308
90585
  const taskId = params?.taskId;
89309
90586
  const tierLimit = params?.tierLimit;
89310
- const result = await taskAnalyze(this.projectRoot, taskId, { tierLimit });
90587
+ const result = await taskAnalyze(projectRoot, taskId, { tierLimit });
89311
90588
  return wrapResult(result, "query", "tasks", operation, startTime);
89312
90589
  }
89313
90590
  case "next": {
89314
90591
  const result = await taskNext(
89315
- this.projectRoot,
90592
+ projectRoot,
89316
90593
  params
89317
90594
  );
89318
90595
  return wrapResult(result, "query", "tasks", operation, startTime);
89319
90596
  }
89320
90597
  case "plan": {
89321
- const result = await taskPlan(this.projectRoot);
90598
+ const result = await taskPlan(projectRoot);
89322
90599
  return wrapResult(result, "query", "tasks", operation, startTime);
89323
90600
  }
89324
90601
  case "relates": {
89325
90602
  const taskId = params.taskId;
89326
90603
  if (params?.mode) {
89327
- const result2 = await taskRelatesFind(this.projectRoot, taskId, {
90604
+ const result2 = await taskRelatesFind(projectRoot, taskId, {
89328
90605
  mode: params.mode,
89329
90606
  threshold: params?.threshold ? Number(params.threshold) : void 0
89330
90607
  });
89331
90608
  return wrapResult(result2, "query", "tasks", operation, startTime);
89332
90609
  }
89333
- const result = await taskRelates(this.projectRoot, taskId);
90610
+ const result = await taskRelates(projectRoot, taskId);
89334
90611
  return wrapResult(result, "query", "tasks", operation, startTime);
89335
90612
  }
89336
90613
  case "complexity.estimate": {
89337
- const result = await taskComplexityEstimate(this.projectRoot, {
90614
+ const result = await taskComplexityEstimate(projectRoot, {
89338
90615
  taskId: params.taskId
89339
90616
  });
89340
90617
  return wrapResult(result, "query", "tasks", operation, startTime);
89341
90618
  }
89342
90619
  case "current": {
89343
- const result = await taskCurrentGet(this.projectRoot);
90620
+ const result = await taskCurrentGet(projectRoot);
89344
90621
  return wrapResult(result, "query", "tasks", operation, startTime);
89345
90622
  }
89346
90623
  case "history": {
89347
90624
  const taskId = params?.taskId;
89348
90625
  if (taskId) {
89349
- const result2 = await taskHistory(this.projectRoot, taskId, params?.limit);
90626
+ const result2 = await taskHistory(projectRoot, taskId, params?.limit);
89350
90627
  return wrapResult(result2, "query", "tasks", operation, startTime);
89351
90628
  }
89352
- const result = await taskWorkHistory2(this.projectRoot);
90629
+ const result = await taskWorkHistory2(projectRoot);
89353
90630
  return wrapResult(result, "query", "tasks", operation, startTime);
89354
90631
  }
89355
90632
  case "label.list": {
89356
- const result = await taskLabelList(this.projectRoot);
90633
+ const result = await taskLabelList(projectRoot);
89357
90634
  return wrapResult(result, "query", "tasks", operation, startTime);
89358
90635
  }
89359
90636
  case "sync.links": {
89360
90637
  const result = await taskSyncLinks(
89361
- this.projectRoot,
90638
+ projectRoot,
89362
90639
  params
89363
90640
  );
89364
90641
  return wrapResult(result, "query", "tasks", operation, startTime);
@@ -89378,11 +90655,12 @@ var TasksHandler = class {
89378
90655
  // Mutate
89379
90656
  // -----------------------------------------------------------------------
89380
90657
  async mutate(operation, params) {
90658
+ const projectRoot = getProjectRoot();
89381
90659
  const startTime = Date.now();
89382
90660
  try {
89383
90661
  switch (operation) {
89384
90662
  case "add": {
89385
- const result = await taskCreate(this.projectRoot, {
90663
+ const result = await taskCreate(projectRoot, {
89386
90664
  title: params.title,
89387
90665
  description: params?.description ?? params.title,
89388
90666
  parent: params?.parent ?? params?.parentId,
@@ -89394,7 +90672,7 @@ var TasksHandler = class {
89394
90672
  return wrapResult(result, "mutate", "tasks", operation, startTime);
89395
90673
  }
89396
90674
  case "update": {
89397
- const result = await taskUpdate(this.projectRoot, params.taskId, {
90675
+ const result = await taskUpdate(projectRoot, params.taskId, {
89398
90676
  title: params?.title,
89399
90677
  description: params?.description,
89400
90678
  status: params?.status,
@@ -89415,7 +90693,7 @@ var TasksHandler = class {
89415
90693
  }
89416
90694
  case "complete": {
89417
90695
  const result = await taskComplete(
89418
- this.projectRoot,
90696
+ projectRoot,
89419
90697
  params.taskId,
89420
90698
  params?.notes
89421
90699
  );
@@ -89423,7 +90701,7 @@ var TasksHandler = class {
89423
90701
  }
89424
90702
  case "delete": {
89425
90703
  const result = await taskDelete(
89426
- this.projectRoot,
90704
+ projectRoot,
89427
90705
  params.taskId,
89428
90706
  params?.force
89429
90707
  );
@@ -89431,7 +90709,7 @@ var TasksHandler = class {
89431
90709
  }
89432
90710
  case "archive": {
89433
90711
  const result = await taskArchive(
89434
- this.projectRoot,
90712
+ projectRoot,
89435
90713
  params?.taskId,
89436
90714
  params?.before
89437
90715
  );
@@ -89441,20 +90719,20 @@ var TasksHandler = class {
89441
90719
  const taskId = params.taskId;
89442
90720
  const from = params?.from;
89443
90721
  if (from === "done") {
89444
- const result2 = await taskReopen(this.projectRoot, taskId, {
90722
+ const result2 = await taskReopen(projectRoot, taskId, {
89445
90723
  status: params?.status,
89446
90724
  reason: params?.reason
89447
90725
  });
89448
90726
  return wrapResult(result2, "mutate", "tasks", operation, startTime);
89449
90727
  }
89450
90728
  if (from === "archived") {
89451
- const result2 = await taskUnarchive(this.projectRoot, taskId, {
90729
+ const result2 = await taskUnarchive(projectRoot, taskId, {
89452
90730
  status: params?.status,
89453
90731
  preserveStatus: params?.preserveStatus
89454
90732
  });
89455
90733
  return wrapResult(result2, "mutate", "tasks", operation, startTime);
89456
90734
  }
89457
- const result = await taskRestore(this.projectRoot, taskId, {
90735
+ const result = await taskRestore(projectRoot, taskId, {
89458
90736
  cascade: params?.cascade,
89459
90737
  notes: params?.notes
89460
90738
  });
@@ -89462,7 +90740,7 @@ var TasksHandler = class {
89462
90740
  }
89463
90741
  case "cancel": {
89464
90742
  const result = await taskCancel(
89465
- this.projectRoot,
90743
+ projectRoot,
89466
90744
  params.taskId,
89467
90745
  params?.reason
89468
90746
  );
@@ -89470,7 +90748,7 @@ var TasksHandler = class {
89470
90748
  }
89471
90749
  case "reparent": {
89472
90750
  const result = await taskReparent(
89473
- this.projectRoot,
90751
+ projectRoot,
89474
90752
  params.taskId,
89475
90753
  params?.newParentId ?? null
89476
90754
  );
@@ -89478,7 +90756,7 @@ var TasksHandler = class {
89478
90756
  }
89479
90757
  case "reorder": {
89480
90758
  const result = await taskReorder(
89481
- this.projectRoot,
90759
+ projectRoot,
89482
90760
  params.taskId,
89483
90761
  params.position
89484
90762
  );
@@ -89497,7 +90775,7 @@ var TasksHandler = class {
89497
90775
  );
89498
90776
  }
89499
90777
  const result = await taskRelatesAdd(
89500
- this.projectRoot,
90778
+ projectRoot,
89501
90779
  params.taskId,
89502
90780
  relatedId,
89503
90781
  params.type,
@@ -89506,15 +90784,15 @@ var TasksHandler = class {
89506
90784
  return wrapResult(result, "mutate", "tasks", operation, startTime);
89507
90785
  }
89508
90786
  case "start": {
89509
- const result = await taskStart(this.projectRoot, params.taskId);
90787
+ const result = await taskStart(projectRoot, params.taskId);
89510
90788
  return wrapResult(result, "mutate", "tasks", operation, startTime);
89511
90789
  }
89512
90790
  case "stop": {
89513
- const result = await taskStop(this.projectRoot);
90791
+ const result = await taskStop(projectRoot);
89514
90792
  return wrapResult(result, "mutate", "tasks", operation, startTime);
89515
90793
  }
89516
90794
  case "sync.reconcile": {
89517
- const result = await taskSyncReconcile(this.projectRoot, {
90795
+ const result = await taskSyncReconcile(projectRoot, {
89518
90796
  providerId: params.providerId,
89519
90797
  externalTasks: params.externalTasks,
89520
90798
  dryRun: params?.dryRun,
@@ -89525,7 +90803,7 @@ var TasksHandler = class {
89525
90803
  return wrapResult(result, "mutate", "tasks", operation, startTime);
89526
90804
  }
89527
90805
  case "sync.links.remove": {
89528
- const result = await taskSyncLinksRemove(this.projectRoot, params.providerId);
90806
+ const result = await taskSyncLinksRemove(projectRoot, params.providerId);
89529
90807
  return wrapResult(result, "mutate", "tasks", operation, startTime);
89530
90808
  }
89531
90809
  default:
@@ -89596,7 +90874,7 @@ import {
89596
90874
  discoverSkill as discoverSkill2,
89597
90875
  discoverSkills,
89598
90876
  getAllProviders as getAllProviders2,
89599
- getCanonicalSkillsDir as getCanonicalSkillsDir3,
90877
+ getCanonicalSkillsDir as getCanonicalSkillsDir4,
89600
90878
  getInstalledProviders as getInstalledProviders3,
89601
90879
  getTrackedSkills,
89602
90880
  injectAll as injectAll2,
@@ -89613,7 +90891,7 @@ function toolsIssueDiagnostics() {
89613
90891
  }
89614
90892
  async function toolsSkillList(limit, offset) {
89615
90893
  try {
89616
- const skills = await discoverSkills(getCanonicalSkillsDir3());
90894
+ const skills = await discoverSkills(getCanonicalSkillsDir4());
89617
90895
  const page = paginate(skills, limit, offset);
89618
90896
  return {
89619
90897
  success: true,
@@ -89632,7 +90910,7 @@ async function toolsSkillList(limit, offset) {
89632
90910
  }
89633
90911
  async function toolsSkillShow(name2) {
89634
90912
  try {
89635
- const skill = await discoverSkill2(`${getCanonicalSkillsDir3()}/${name2}`);
90913
+ const skill = await discoverSkill2(`${getCanonicalSkillsDir4()}/${name2}`);
89636
90914
  if (!skill) {
89637
90915
  return engineError("E_NOT_FOUND", `Skill not found: ${name2}`);
89638
90916
  }
@@ -89644,7 +90922,7 @@ async function toolsSkillShow(name2) {
89644
90922
  async function toolsSkillFind(query) {
89645
90923
  try {
89646
90924
  const q = (query ?? "").toLowerCase();
89647
- const skills = await discoverSkills(getCanonicalSkillsDir3());
90925
+ const skills = await discoverSkills(getCanonicalSkillsDir4());
89648
90926
  const filtered = q ? skills.filter(
89649
90927
  (s) => s.name.toLowerCase().includes(q) || s.metadata.description.toLowerCase().includes(q)
89650
90928
  ) : skills;
@@ -89668,13 +90946,13 @@ function toolsSkillDispatch(name2) {
89668
90946
  }
89669
90947
  async function toolsSkillVerify(name2) {
89670
90948
  try {
89671
- const installed = await discoverSkill2(`${getCanonicalSkillsDir3()}/${name2}`);
90949
+ const installed = await discoverSkill2(`${getCanonicalSkillsDir4()}/${name2}`);
89672
90950
  const catalogEntry = catalog3.getSkill(name2);
89673
90951
  return engineSuccess({
89674
90952
  skill: name2,
89675
90953
  installed: !!installed,
89676
90954
  inCatalog: !!catalogEntry,
89677
- installPath: installed ? `${getCanonicalSkillsDir3()}/${name2}` : null
90955
+ installPath: installed ? `${getCanonicalSkillsDir4()}/${name2}` : null
89678
90956
  });
89679
90957
  } catch (error40) {
89680
90958
  return engineError("E_INTERNAL", error40 instanceof Error ? error40.message : String(error40));
@@ -90079,9 +91357,8 @@ async function toolsAdapterDispose(projectRoot, id) {
90079
91357
 
90080
91358
  // packages/cleo/src/dispatch/domains/tools.ts
90081
91359
  var ToolsHandler = class {
90082
- projectRoot;
90083
- constructor() {
90084
- this.projectRoot = getProjectRoot();
91360
+ get projectRoot() {
91361
+ return getProjectRoot();
90085
91362
  }
90086
91363
  // -----------------------------------------------------------------------
90087
91364
  // DomainHandler interface