@cleocode/cleo 2026.3.45 → 2026.3.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -34593,7 +34593,7 @@ async function ensureInjection(projectRoot) {
34593
34593
  }
34594
34594
  }
34595
34595
  const agentsMdPath = join36(projectRoot, "AGENTS.md");
34596
- const agentsMdLines = ["@~/.cleo/templates/CLEO-INJECTION.md"];
34596
+ const agentsMdLines = ["@~/.agents/AGENTS.md"];
34597
34597
  const projectContextPath = join36(projectRoot, ".cleo", "project-context.json");
34598
34598
  if (existsSync33(projectContextPath)) {
34599
34599
  agentsMdLines.push("@.cleo/project-context.json");
@@ -34606,7 +34606,8 @@ async function ensureInjection(projectRoot) {
34606
34606
  if (contributorBlock) {
34607
34607
  agentsMdLines.push(contributorBlock);
34608
34608
  }
34609
- const agentsAction = await inject2(agentsMdPath, agentsMdLines.join("\n"));
34609
+ const agentsMdContent = agentsMdLines.join("\n");
34610
+ const agentsAction = await inject2(agentsMdPath, agentsMdContent);
34610
34611
  actions.push(`AGENTS.md CLEO content (${agentsAction})`);
34611
34612
  const content = getInjectionTemplateContent();
34612
34613
  if (content) {
@@ -34621,8 +34622,9 @@ async function ensureInjection(projectRoot) {
34621
34622
  try {
34622
34623
  const globalAgentsDir = getAgentsHome();
34623
34624
  const globalAgentsMd = join36(globalAgentsDir, "AGENTS.md");
34625
+ const globalHubContent = "@~/.cleo/templates/CLEO-INJECTION.md";
34624
34626
  await mkdir4(globalAgentsDir, { recursive: true });
34625
- await inject2(globalAgentsMd, "@~/.cleo/templates/CLEO-INJECTION.md");
34627
+ await inject2(globalAgentsMd, globalHubContent);
34626
34628
  } catch {
34627
34629
  }
34628
34630
  return {
@@ -35130,7 +35132,7 @@ async function ensureProjectContext(projectRoot, opts) {
35130
35132
  try {
35131
35133
  const schemaPath = join37(
35132
35134
  dirname8(fileURLToPath4(import.meta.url)),
35133
- "../../schemas/project-context.schema.json"
35135
+ "../schemas/project-context.schema.json"
35134
35136
  );
35135
35137
  if (existsSync34(schemaPath)) {
35136
35138
  const AjvModule2 = await import("ajv");
@@ -35571,11 +35573,9 @@ async function ensureGlobalTemplates() {
35571
35573
  return { action: "created", path: injectionPath };
35572
35574
  }
35573
35575
  async function ensureGlobalScaffold() {
35574
- const { ensureGlobalSchemas: ensureGlobalSchemas2 } = await Promise.resolve().then(() => (init_schema_management(), schema_management_exports));
35575
35576
  const home = await ensureGlobalHome();
35576
- const schemas = ensureGlobalSchemas2();
35577
35577
  const templates2 = await ensureGlobalTemplates();
35578
- return { home, schemas, templates: templates2 };
35578
+ return { home, templates: templates2 };
35579
35579
  }
35580
35580
  function checkGlobalHome() {
35581
35581
  const cleoHome = getCleoHome();
@@ -35709,7 +35709,7 @@ metrics/
35709
35709
  .backups/
35710
35710
  backups/
35711
35711
  `;
35712
- REQUIRED_GLOBAL_SUBDIRS = ["schemas", "templates"];
35712
+ REQUIRED_GLOBAL_SUBDIRS = ["logs", "templates"];
35713
35713
  }
35714
35714
  });
35715
35715
 
@@ -46879,8 +46879,8 @@ var init_release_config = __esm({
46879
46879
  // packages/core/src/release/ci.ts
46880
46880
  import { existsSync as existsSync60, mkdirSync as mkdirSync12, readFileSync as readFileSync42, writeFileSync as writeFileSync6 } from "node:fs";
46881
46881
  import { dirname as dirname13, join as join63 } from "node:path";
46882
- function getPlatformPath(platform3) {
46883
- return PLATFORM_PATHS[platform3];
46882
+ function getPlatformPath(platform5) {
46883
+ return PLATFORM_PATHS[platform5];
46884
46884
  }
46885
46885
  function detectCIPlatform(projectDir) {
46886
46886
  const dir = projectDir ?? process.cwd();
@@ -46974,10 +46974,10 @@ workflows:
46974
46974
  only: /^v.*/
46975
46975
  `;
46976
46976
  }
46977
- function generateCIConfig(platform3, cwd) {
46977
+ function generateCIConfig(platform5, cwd) {
46978
46978
  const releaseConfig = loadReleaseConfig(cwd);
46979
46979
  const gates = releaseConfig.gates.map((g) => ({ name: g.name, command: g.command }));
46980
- switch (platform3) {
46980
+ switch (platform5) {
46981
46981
  case "github-actions":
46982
46982
  return generateGitHubActions({ gates });
46983
46983
  case "gitlab-ci":
@@ -46986,10 +46986,10 @@ function generateCIConfig(platform3, cwd) {
46986
46986
  return generateCircleCI({ gates });
46987
46987
  }
46988
46988
  }
46989
- function writeCIConfig(platform3, options = {}) {
46989
+ function writeCIConfig(platform5, options = {}) {
46990
46990
  const projectDir = options.projectDir ?? process.cwd();
46991
- const outputPath = join63(projectDir, getPlatformPath(platform3));
46992
- const content = generateCIConfig(platform3, projectDir);
46991
+ const outputPath = join63(projectDir, getPlatformPath(platform5));
46992
+ const content = generateCIConfig(platform5, projectDir);
46993
46993
  if (options.dryRun) {
46994
46994
  return { action: "would_write", path: outputPath, content };
46995
46995
  }
@@ -46997,9 +46997,9 @@ function writeCIConfig(platform3, options = {}) {
46997
46997
  writeFileSync6(outputPath, content, "utf-8");
46998
46998
  return { action: "wrote", path: outputPath, content };
46999
46999
  }
47000
- function validateCIConfig(platform3, projectDir) {
47000
+ function validateCIConfig(platform5, projectDir) {
47001
47001
  const dir = projectDir ?? process.cwd();
47002
- const configPath = join63(dir, getPlatformPath(platform3));
47002
+ const configPath = join63(dir, getPlatformPath(platform5));
47003
47003
  if (!existsSync60(configPath)) {
47004
47004
  return { valid: false, exists: false, errors: ["Config file not found"] };
47005
47005
  }
@@ -48702,239 +48702,1463 @@ var init_capability_matrix = __esm({
48702
48702
  CAPABILITY_MATRIX = [
48703
48703
  // === Tasks Domain ===
48704
48704
  // 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" },
48705
+ { domain: "tasks", operation: "show", gateway: "query", mode: "native", preferredChannel: "mcp" },
48706
+ { domain: "tasks", operation: "list", gateway: "query", mode: "native", preferredChannel: "mcp" },
48707
+ { domain: "tasks", operation: "find", gateway: "query", mode: "native", preferredChannel: "mcp" },
48708
+ {
48709
+ domain: "tasks",
48710
+ operation: "tree",
48711
+ gateway: "query",
48712
+ mode: "native",
48713
+ preferredChannel: "either"
48714
+ },
48715
+ {
48716
+ domain: "tasks",
48717
+ operation: "blockers",
48718
+ gateway: "query",
48719
+ mode: "native",
48720
+ preferredChannel: "either"
48721
+ },
48722
+ {
48723
+ domain: "tasks",
48724
+ operation: "depends",
48725
+ gateway: "query",
48726
+ mode: "native",
48727
+ preferredChannel: "either"
48728
+ },
48729
+ {
48730
+ domain: "tasks",
48731
+ operation: "analyze",
48732
+ gateway: "query",
48733
+ mode: "native",
48734
+ preferredChannel: "either"
48735
+ },
48736
+ { domain: "tasks", operation: "next", gateway: "query", mode: "native", preferredChannel: "mcp" },
48737
+ { domain: "tasks", operation: "plan", gateway: "query", mode: "native", preferredChannel: "mcp" },
48738
+ {
48739
+ domain: "tasks",
48740
+ operation: "relates",
48741
+ gateway: "query",
48742
+ mode: "native",
48743
+ preferredChannel: "either"
48744
+ },
48745
+ {
48746
+ domain: "tasks",
48747
+ operation: "complexity.estimate",
48748
+ gateway: "query",
48749
+ mode: "native",
48750
+ preferredChannel: "either"
48751
+ },
48752
+ {
48753
+ domain: "tasks",
48754
+ operation: "history",
48755
+ gateway: "query",
48756
+ mode: "native",
48757
+ preferredChannel: "either"
48758
+ },
48759
+ {
48760
+ domain: "tasks",
48761
+ operation: "current",
48762
+ gateway: "query",
48763
+ mode: "native",
48764
+ preferredChannel: "mcp"
48765
+ },
48766
+ {
48767
+ domain: "tasks",
48768
+ operation: "label.list",
48769
+ gateway: "query",
48770
+ mode: "native",
48771
+ preferredChannel: "either"
48772
+ },
48719
48773
  // 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" },
48774
+ { domain: "tasks", operation: "add", gateway: "mutate", mode: "native", preferredChannel: "mcp" },
48775
+ {
48776
+ domain: "tasks",
48777
+ operation: "update",
48778
+ gateway: "mutate",
48779
+ mode: "native",
48780
+ preferredChannel: "mcp"
48781
+ },
48782
+ {
48783
+ domain: "tasks",
48784
+ operation: "complete",
48785
+ gateway: "mutate",
48786
+ mode: "native",
48787
+ preferredChannel: "mcp"
48788
+ },
48789
+ {
48790
+ domain: "tasks",
48791
+ operation: "cancel",
48792
+ gateway: "mutate",
48793
+ mode: "native",
48794
+ preferredChannel: "either"
48795
+ },
48796
+ {
48797
+ domain: "tasks",
48798
+ operation: "delete",
48799
+ gateway: "mutate",
48800
+ mode: "native",
48801
+ preferredChannel: "either"
48802
+ },
48803
+ {
48804
+ domain: "tasks",
48805
+ operation: "archive",
48806
+ gateway: "mutate",
48807
+ mode: "native",
48808
+ preferredChannel: "either"
48809
+ },
48810
+ {
48811
+ domain: "tasks",
48812
+ operation: "restore",
48813
+ gateway: "mutate",
48814
+ mode: "native",
48815
+ preferredChannel: "either"
48816
+ },
48817
+ {
48818
+ domain: "tasks",
48819
+ operation: "reparent",
48820
+ gateway: "mutate",
48821
+ mode: "native",
48822
+ preferredChannel: "either"
48823
+ },
48824
+ {
48825
+ domain: "tasks",
48826
+ operation: "reorder",
48827
+ gateway: "mutate",
48828
+ mode: "native",
48829
+ preferredChannel: "either"
48830
+ },
48831
+ {
48832
+ domain: "tasks",
48833
+ operation: "relates.add",
48834
+ gateway: "mutate",
48835
+ mode: "native",
48836
+ preferredChannel: "either"
48837
+ },
48838
+ {
48839
+ domain: "tasks",
48840
+ operation: "start",
48841
+ gateway: "mutate",
48842
+ mode: "native",
48843
+ preferredChannel: "mcp"
48844
+ },
48845
+ {
48846
+ domain: "tasks",
48847
+ operation: "stop",
48848
+ gateway: "mutate",
48849
+ mode: "native",
48850
+ preferredChannel: "mcp"
48851
+ },
48732
48852
  // 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" },
48853
+ {
48854
+ domain: "tasks",
48855
+ operation: "sync.reconcile",
48856
+ gateway: "mutate",
48857
+ mode: "native",
48858
+ preferredChannel: "either"
48859
+ },
48860
+ {
48861
+ domain: "tasks",
48862
+ operation: "sync.links",
48863
+ gateway: "query",
48864
+ mode: "native",
48865
+ preferredChannel: "either"
48866
+ },
48867
+ {
48868
+ domain: "tasks",
48869
+ operation: "sync.links.remove",
48870
+ gateway: "mutate",
48871
+ mode: "native",
48872
+ preferredChannel: "either"
48873
+ },
48736
48874
  // === Session Domain ===
48737
48875
  // 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" },
48876
+ {
48877
+ domain: "session",
48878
+ operation: "status",
48879
+ gateway: "query",
48880
+ mode: "native",
48881
+ preferredChannel: "mcp"
48882
+ },
48883
+ {
48884
+ domain: "session",
48885
+ operation: "list",
48886
+ gateway: "query",
48887
+ mode: "native",
48888
+ preferredChannel: "either"
48889
+ },
48890
+ {
48891
+ domain: "session",
48892
+ operation: "show",
48893
+ gateway: "query",
48894
+ mode: "native",
48895
+ preferredChannel: "either"
48896
+ },
48897
+ {
48898
+ domain: "session",
48899
+ operation: "decision.log",
48900
+ gateway: "query",
48901
+ mode: "native",
48902
+ preferredChannel: "either"
48903
+ },
48904
+ {
48905
+ domain: "session",
48906
+ operation: "context.drift",
48907
+ gateway: "query",
48908
+ mode: "native",
48909
+ preferredChannel: "either"
48910
+ },
48911
+ {
48912
+ domain: "session",
48913
+ operation: "handoff.show",
48914
+ gateway: "query",
48915
+ mode: "native",
48916
+ preferredChannel: "mcp"
48917
+ },
48918
+ {
48919
+ domain: "session",
48920
+ operation: "briefing.show",
48921
+ gateway: "query",
48922
+ mode: "native",
48923
+ preferredChannel: "mcp"
48924
+ },
48925
+ {
48926
+ domain: "session",
48927
+ operation: "find",
48928
+ gateway: "query",
48929
+ mode: "native",
48930
+ preferredChannel: "either"
48931
+ },
48746
48932
  // 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" },
48933
+ {
48934
+ domain: "session",
48935
+ operation: "start",
48936
+ gateway: "mutate",
48937
+ mode: "native",
48938
+ preferredChannel: "mcp"
48939
+ },
48940
+ {
48941
+ domain: "session",
48942
+ operation: "end",
48943
+ gateway: "mutate",
48944
+ mode: "native",
48945
+ preferredChannel: "mcp"
48946
+ },
48947
+ {
48948
+ domain: "session",
48949
+ operation: "resume",
48950
+ gateway: "mutate",
48951
+ mode: "native",
48952
+ preferredChannel: "either"
48953
+ },
48954
+ {
48955
+ domain: "session",
48956
+ operation: "suspend",
48957
+ gateway: "mutate",
48958
+ mode: "native",
48959
+ preferredChannel: "either"
48960
+ },
48961
+ {
48962
+ domain: "session",
48963
+ operation: "gc",
48964
+ gateway: "mutate",
48965
+ mode: "native",
48966
+ preferredChannel: "either"
48967
+ },
48968
+ {
48969
+ domain: "session",
48970
+ operation: "record.decision",
48971
+ gateway: "mutate",
48972
+ mode: "native",
48973
+ preferredChannel: "either"
48974
+ },
48975
+ {
48976
+ domain: "session",
48977
+ operation: "record.assumption",
48978
+ gateway: "mutate",
48979
+ mode: "native",
48980
+ preferredChannel: "either"
48981
+ },
48754
48982
  // === Admin Domain ===
48755
48983
  // 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" },
48984
+ {
48985
+ domain: "admin",
48986
+ operation: "version",
48987
+ gateway: "query",
48988
+ mode: "native",
48989
+ preferredChannel: "either"
48990
+ },
48991
+ {
48992
+ domain: "admin",
48993
+ operation: "health",
48994
+ gateway: "query",
48995
+ mode: "native",
48996
+ preferredChannel: "either"
48997
+ },
48998
+ {
48999
+ domain: "admin",
49000
+ operation: "config.show",
49001
+ gateway: "query",
49002
+ mode: "native",
49003
+ preferredChannel: "either"
49004
+ },
49005
+ {
49006
+ domain: "admin",
49007
+ operation: "stats",
49008
+ gateway: "query",
49009
+ mode: "native",
49010
+ preferredChannel: "either"
49011
+ },
49012
+ {
49013
+ domain: "admin",
49014
+ operation: "context",
49015
+ gateway: "query",
49016
+ mode: "native",
49017
+ preferredChannel: "either"
49018
+ },
49019
+ {
49020
+ domain: "admin",
49021
+ operation: "runtime",
49022
+ gateway: "query",
49023
+ mode: "native",
49024
+ preferredChannel: "either"
49025
+ },
49026
+ {
49027
+ domain: "admin",
49028
+ operation: "job",
49029
+ gateway: "query",
49030
+ mode: "native",
49031
+ preferredChannel: "either"
49032
+ },
49033
+ { domain: "admin", operation: "dash", gateway: "query", mode: "native", preferredChannel: "mcp" },
49034
+ {
49035
+ domain: "admin",
49036
+ operation: "log",
49037
+ gateway: "query",
49038
+ mode: "native",
49039
+ preferredChannel: "either"
49040
+ },
49041
+ {
49042
+ domain: "admin",
49043
+ operation: "sequence",
49044
+ gateway: "query",
49045
+ mode: "native",
49046
+ preferredChannel: "either"
49047
+ },
49048
+ { domain: "admin", operation: "help", gateway: "query", mode: "native", preferredChannel: "mcp" },
49049
+ {
49050
+ domain: "admin",
49051
+ operation: "token",
49052
+ gateway: "query",
49053
+ mode: "native",
49054
+ preferredChannel: "either"
49055
+ },
49056
+ {
49057
+ domain: "admin",
49058
+ operation: "export",
49059
+ gateway: "query",
49060
+ mode: "native",
49061
+ preferredChannel: "either"
49062
+ },
49063
+ {
49064
+ domain: "admin",
49065
+ operation: "adr.show",
49066
+ gateway: "query",
49067
+ mode: "native",
49068
+ preferredChannel: "either"
49069
+ },
49070
+ {
49071
+ domain: "admin",
49072
+ operation: "adr.find",
49073
+ gateway: "query",
49074
+ mode: "native",
49075
+ preferredChannel: "either"
49076
+ },
49077
+ { domain: "admin", operation: "map", gateway: "query", mode: "native", preferredChannel: "mcp" },
48771
49078
  // 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" },
49079
+ {
49080
+ domain: "admin",
49081
+ operation: "init",
49082
+ gateway: "mutate",
49083
+ mode: "native",
49084
+ preferredChannel: "either"
49085
+ },
49086
+ {
49087
+ domain: "admin",
49088
+ operation: "config.set",
49089
+ gateway: "mutate",
49090
+ mode: "native",
49091
+ preferredChannel: "either"
49092
+ },
49093
+ {
49094
+ domain: "admin",
49095
+ operation: "backup",
49096
+ gateway: "mutate",
49097
+ mode: "native",
49098
+ preferredChannel: "either"
49099
+ },
49100
+ {
49101
+ domain: "admin",
49102
+ operation: "migrate",
49103
+ gateway: "mutate",
49104
+ mode: "native",
49105
+ preferredChannel: "either"
49106
+ },
49107
+ {
49108
+ domain: "admin",
49109
+ operation: "cleanup",
49110
+ gateway: "mutate",
49111
+ mode: "native",
49112
+ preferredChannel: "either"
49113
+ },
49114
+ {
49115
+ domain: "admin",
49116
+ operation: "safestop",
49117
+ gateway: "mutate",
49118
+ mode: "native",
49119
+ preferredChannel: "either"
49120
+ },
49121
+ {
49122
+ domain: "admin",
49123
+ operation: "inject.generate",
49124
+ gateway: "mutate",
49125
+ mode: "native",
49126
+ preferredChannel: "either"
49127
+ },
49128
+ {
49129
+ domain: "admin",
49130
+ operation: "job.cancel",
49131
+ gateway: "mutate",
49132
+ mode: "native",
49133
+ preferredChannel: "either"
49134
+ },
49135
+ {
49136
+ domain: "admin",
49137
+ operation: "install.global",
49138
+ gateway: "mutate",
49139
+ mode: "native",
49140
+ preferredChannel: "either"
49141
+ },
49142
+ {
49143
+ domain: "admin",
49144
+ operation: "token",
49145
+ gateway: "mutate",
49146
+ mode: "native",
49147
+ preferredChannel: "either"
49148
+ },
49149
+ {
49150
+ domain: "admin",
49151
+ operation: "health",
49152
+ gateway: "mutate",
49153
+ mode: "native",
49154
+ preferredChannel: "either"
49155
+ },
49156
+ {
49157
+ domain: "admin",
49158
+ operation: "detect",
49159
+ gateway: "mutate",
49160
+ mode: "native",
49161
+ preferredChannel: "either"
49162
+ },
49163
+ {
49164
+ domain: "admin",
49165
+ operation: "import",
49166
+ gateway: "mutate",
49167
+ mode: "native",
49168
+ preferredChannel: "either"
49169
+ },
49170
+ {
49171
+ domain: "admin",
49172
+ operation: "context.inject",
49173
+ gateway: "mutate",
49174
+ mode: "native",
49175
+ preferredChannel: "either"
49176
+ },
49177
+ {
49178
+ domain: "admin",
49179
+ operation: "adr.sync",
49180
+ gateway: "mutate",
49181
+ mode: "native",
49182
+ preferredChannel: "either"
49183
+ },
49184
+ {
49185
+ domain: "admin",
49186
+ operation: "map",
49187
+ gateway: "mutate",
49188
+ mode: "native",
49189
+ preferredChannel: "either"
49190
+ },
48787
49191
  // === Check Domain ===
48788
49192
  // 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" },
49193
+ {
49194
+ domain: "check",
49195
+ operation: "schema",
49196
+ gateway: "query",
49197
+ mode: "native",
49198
+ preferredChannel: "either"
49199
+ },
49200
+ {
49201
+ domain: "check",
49202
+ operation: "protocol",
49203
+ gateway: "query",
49204
+ mode: "native",
49205
+ preferredChannel: "either"
49206
+ },
49207
+ {
49208
+ domain: "check",
49209
+ operation: "task",
49210
+ gateway: "query",
49211
+ mode: "native",
49212
+ preferredChannel: "either"
49213
+ },
49214
+ {
49215
+ domain: "check",
49216
+ operation: "manifest",
49217
+ gateway: "query",
49218
+ mode: "native",
49219
+ preferredChannel: "either"
49220
+ },
49221
+ {
49222
+ domain: "check",
49223
+ operation: "output",
49224
+ gateway: "query",
49225
+ mode: "native",
49226
+ preferredChannel: "either"
49227
+ },
49228
+ {
49229
+ domain: "check",
49230
+ operation: "compliance.summary",
49231
+ gateway: "query",
49232
+ mode: "native",
49233
+ preferredChannel: "mcp"
49234
+ },
49235
+ {
49236
+ domain: "check",
49237
+ operation: "test",
49238
+ gateway: "query",
49239
+ mode: "native",
49240
+ preferredChannel: "either"
49241
+ },
49242
+ {
49243
+ domain: "check",
49244
+ operation: "coherence",
49245
+ gateway: "query",
49246
+ mode: "native",
49247
+ preferredChannel: "either"
49248
+ },
49249
+ {
49250
+ domain: "check",
49251
+ operation: "gate.status",
49252
+ gateway: "query",
49253
+ mode: "native",
49254
+ preferredChannel: "either"
49255
+ },
49256
+ {
49257
+ domain: "check",
49258
+ operation: "archive.stats",
49259
+ gateway: "query",
49260
+ mode: "native",
49261
+ preferredChannel: "either"
49262
+ },
49263
+ {
49264
+ domain: "check",
49265
+ operation: "grade",
49266
+ gateway: "query",
49267
+ mode: "native",
49268
+ preferredChannel: "either"
49269
+ },
49270
+ {
49271
+ domain: "check",
49272
+ operation: "grade.list",
49273
+ gateway: "query",
49274
+ mode: "native",
49275
+ preferredChannel: "either"
49276
+ },
49277
+ {
49278
+ domain: "check",
49279
+ operation: "chain.validate",
49280
+ gateway: "query",
49281
+ mode: "native",
49282
+ preferredChannel: "either"
49283
+ },
48802
49284
  // 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" },
49285
+ {
49286
+ domain: "check",
49287
+ operation: "compliance.record",
49288
+ gateway: "mutate",
49289
+ mode: "native",
49290
+ preferredChannel: "mcp"
49291
+ },
49292
+ {
49293
+ domain: "check",
49294
+ operation: "test.run",
49295
+ gateway: "mutate",
49296
+ mode: "native",
49297
+ preferredChannel: "either"
49298
+ },
49299
+ {
49300
+ domain: "check",
49301
+ operation: "gate.set",
49302
+ gateway: "mutate",
49303
+ mode: "native",
49304
+ preferredChannel: "either"
49305
+ },
49306
+ {
49307
+ domain: "check",
49308
+ operation: "compliance.sync",
49309
+ gateway: "mutate",
49310
+ mode: "native",
49311
+ preferredChannel: "either"
49312
+ },
48806
49313
  // === Orchestrate Domain ===
48807
49314
  // 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" },
49315
+ {
49316
+ domain: "orchestrate",
49317
+ operation: "status",
49318
+ gateway: "query",
49319
+ mode: "native",
49320
+ preferredChannel: "either"
49321
+ },
49322
+ {
49323
+ domain: "orchestrate",
49324
+ operation: "next",
49325
+ gateway: "query",
49326
+ mode: "native",
49327
+ preferredChannel: "either"
49328
+ },
49329
+ {
49330
+ domain: "orchestrate",
49331
+ operation: "ready",
49332
+ gateway: "query",
49333
+ mode: "native",
49334
+ preferredChannel: "either"
49335
+ },
49336
+ {
49337
+ domain: "orchestrate",
49338
+ operation: "analyze",
49339
+ gateway: "query",
49340
+ mode: "native",
49341
+ preferredChannel: "either"
49342
+ },
49343
+ {
49344
+ domain: "orchestrate",
49345
+ operation: "context",
49346
+ gateway: "query",
49347
+ mode: "native",
49348
+ preferredChannel: "either"
49349
+ },
49350
+ {
49351
+ domain: "orchestrate",
49352
+ operation: "waves",
49353
+ gateway: "query",
49354
+ mode: "native",
49355
+ preferredChannel: "either"
49356
+ },
49357
+ {
49358
+ domain: "orchestrate",
49359
+ operation: "bootstrap",
49360
+ gateway: "query",
49361
+ mode: "native",
49362
+ preferredChannel: "either"
49363
+ },
49364
+ {
49365
+ domain: "orchestrate",
49366
+ operation: "unblock.opportunities",
49367
+ gateway: "query",
49368
+ mode: "native",
49369
+ preferredChannel: "either"
49370
+ },
49371
+ {
49372
+ domain: "orchestrate",
49373
+ operation: "tessera.list",
49374
+ gateway: "query",
49375
+ mode: "native",
49376
+ preferredChannel: "either"
49377
+ },
48817
49378
  // 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" },
49379
+ {
49380
+ domain: "orchestrate",
49381
+ operation: "start",
49382
+ gateway: "mutate",
49383
+ mode: "native",
49384
+ preferredChannel: "either"
49385
+ },
49386
+ {
49387
+ domain: "orchestrate",
49388
+ operation: "spawn",
49389
+ gateway: "mutate",
49390
+ mode: "native",
49391
+ preferredChannel: "mcp"
49392
+ },
49393
+ {
49394
+ domain: "orchestrate",
49395
+ operation: "handoff",
49396
+ gateway: "mutate",
49397
+ mode: "native",
49398
+ preferredChannel: "either"
49399
+ },
49400
+ {
49401
+ domain: "orchestrate",
49402
+ operation: "spawn.execute",
49403
+ gateway: "mutate",
49404
+ mode: "native",
49405
+ preferredChannel: "either"
49406
+ },
49407
+ {
49408
+ domain: "orchestrate",
49409
+ operation: "validate",
49410
+ gateway: "mutate",
49411
+ mode: "native",
49412
+ preferredChannel: "either"
49413
+ },
49414
+ {
49415
+ domain: "orchestrate",
49416
+ operation: "parallel",
49417
+ gateway: "mutate",
49418
+ mode: "native",
49419
+ preferredChannel: "either"
49420
+ },
49421
+ {
49422
+ domain: "orchestrate",
49423
+ operation: "tessera.instantiate",
49424
+ gateway: "mutate",
49425
+ mode: "native",
49426
+ preferredChannel: "either"
49427
+ },
48825
49428
  // === Memory Domain (brain.db cognitive memory -- T5241) ===
48826
49429
  // 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" },
49430
+ {
49431
+ domain: "memory",
49432
+ operation: "find",
49433
+ gateway: "query",
49434
+ mode: "native",
49435
+ preferredChannel: "mcp"
49436
+ },
49437
+ {
49438
+ domain: "memory",
49439
+ operation: "timeline",
49440
+ gateway: "query",
49441
+ mode: "native",
49442
+ preferredChannel: "mcp"
49443
+ },
49444
+ {
49445
+ domain: "memory",
49446
+ operation: "fetch",
49447
+ gateway: "query",
49448
+ mode: "native",
49449
+ preferredChannel: "mcp"
49450
+ },
49451
+ {
49452
+ domain: "memory",
49453
+ operation: "decision.find",
49454
+ gateway: "query",
49455
+ mode: "native",
49456
+ preferredChannel: "mcp"
49457
+ },
49458
+ {
49459
+ domain: "memory",
49460
+ operation: "pattern.find",
49461
+ gateway: "query",
49462
+ mode: "native",
49463
+ preferredChannel: "mcp"
49464
+ },
49465
+ {
49466
+ domain: "memory",
49467
+ operation: "learning.find",
49468
+ gateway: "query",
49469
+ mode: "native",
49470
+ preferredChannel: "mcp"
49471
+ },
49472
+ {
49473
+ domain: "memory",
49474
+ operation: "graph.show",
49475
+ gateway: "query",
49476
+ mode: "native",
49477
+ preferredChannel: "either"
49478
+ },
49479
+ {
49480
+ domain: "memory",
49481
+ operation: "graph.neighbors",
49482
+ gateway: "query",
49483
+ mode: "native",
49484
+ preferredChannel: "either"
49485
+ },
49486
+ {
49487
+ domain: "memory",
49488
+ operation: "reason.why",
49489
+ gateway: "query",
49490
+ mode: "native",
49491
+ preferredChannel: "either"
49492
+ },
49493
+ {
49494
+ domain: "memory",
49495
+ operation: "reason.similar",
49496
+ gateway: "query",
49497
+ mode: "native",
49498
+ preferredChannel: "either"
49499
+ },
49500
+ {
49501
+ domain: "memory",
49502
+ operation: "search.hybrid",
49503
+ gateway: "query",
49504
+ mode: "native",
49505
+ preferredChannel: "either"
49506
+ },
48838
49507
  // 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" },
49508
+ {
49509
+ domain: "memory",
49510
+ operation: "observe",
49511
+ gateway: "mutate",
49512
+ mode: "native",
49513
+ preferredChannel: "mcp"
49514
+ },
49515
+ {
49516
+ domain: "memory",
49517
+ operation: "decision.store",
49518
+ gateway: "mutate",
49519
+ mode: "native",
49520
+ preferredChannel: "mcp"
49521
+ },
49522
+ {
49523
+ domain: "memory",
49524
+ operation: "pattern.store",
49525
+ gateway: "mutate",
49526
+ mode: "native",
49527
+ preferredChannel: "mcp"
49528
+ },
49529
+ {
49530
+ domain: "memory",
49531
+ operation: "learning.store",
49532
+ gateway: "mutate",
49533
+ mode: "native",
49534
+ preferredChannel: "mcp"
49535
+ },
49536
+ {
49537
+ domain: "memory",
49538
+ operation: "link",
49539
+ gateway: "mutate",
49540
+ mode: "native",
49541
+ preferredChannel: "either"
49542
+ },
49543
+ {
49544
+ domain: "memory",
49545
+ operation: "graph.add",
49546
+ gateway: "mutate",
49547
+ mode: "native",
49548
+ preferredChannel: "either"
49549
+ },
49550
+ {
49551
+ domain: "memory",
49552
+ operation: "graph.remove",
49553
+ gateway: "mutate",
49554
+ mode: "native",
49555
+ preferredChannel: "either"
49556
+ },
48846
49557
  // === Pipeline Domain ===
48847
49558
  // 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" },
49559
+ {
49560
+ domain: "pipeline",
49561
+ operation: "stage.validate",
49562
+ gateway: "query",
49563
+ mode: "native",
49564
+ preferredChannel: "mcp"
49565
+ },
49566
+ {
49567
+ domain: "pipeline",
49568
+ operation: "stage.status",
49569
+ gateway: "query",
49570
+ mode: "native",
49571
+ preferredChannel: "mcp"
49572
+ },
49573
+ {
49574
+ domain: "pipeline",
49575
+ operation: "stage.history",
49576
+ gateway: "query",
49577
+ mode: "native",
49578
+ preferredChannel: "either"
49579
+ },
49580
+ {
49581
+ domain: "pipeline",
49582
+ operation: "stage.record",
49583
+ gateway: "mutate",
49584
+ mode: "native",
49585
+ preferredChannel: "either"
49586
+ },
49587
+ {
49588
+ domain: "pipeline",
49589
+ operation: "stage.skip",
49590
+ gateway: "mutate",
49591
+ mode: "native",
49592
+ preferredChannel: "either"
49593
+ },
49594
+ {
49595
+ domain: "pipeline",
49596
+ operation: "stage.reset",
49597
+ gateway: "mutate",
49598
+ mode: "native",
49599
+ preferredChannel: "either"
49600
+ },
49601
+ {
49602
+ domain: "pipeline",
49603
+ operation: "stage.gate.pass",
49604
+ gateway: "mutate",
49605
+ mode: "native",
49606
+ preferredChannel: "either"
49607
+ },
49608
+ {
49609
+ domain: "pipeline",
49610
+ operation: "stage.gate.fail",
49611
+ gateway: "mutate",
49612
+ mode: "native",
49613
+ preferredChannel: "either"
49614
+ },
48856
49615
  // 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" },
49616
+ {
49617
+ domain: "pipeline",
49618
+ operation: "manifest.show",
49619
+ gateway: "query",
49620
+ mode: "native",
49621
+ preferredChannel: "either"
49622
+ },
49623
+ {
49624
+ domain: "pipeline",
49625
+ operation: "manifest.list",
49626
+ gateway: "query",
49627
+ mode: "native",
49628
+ preferredChannel: "either"
49629
+ },
49630
+ {
49631
+ domain: "pipeline",
49632
+ operation: "manifest.find",
49633
+ gateway: "query",
49634
+ mode: "native",
49635
+ preferredChannel: "either"
49636
+ },
49637
+ {
49638
+ domain: "pipeline",
49639
+ operation: "manifest.stats",
49640
+ gateway: "query",
49641
+ mode: "native",
49642
+ preferredChannel: "either"
49643
+ },
49644
+ {
49645
+ domain: "pipeline",
49646
+ operation: "manifest.append",
49647
+ gateway: "mutate",
49648
+ mode: "native",
49649
+ preferredChannel: "either"
49650
+ },
49651
+ {
49652
+ domain: "pipeline",
49653
+ operation: "manifest.archive",
49654
+ gateway: "mutate",
49655
+ mode: "native",
49656
+ preferredChannel: "either"
49657
+ },
48863
49658
  // 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" },
49659
+ {
49660
+ domain: "pipeline",
49661
+ operation: "phase.show",
49662
+ gateway: "query",
49663
+ mode: "native",
49664
+ preferredChannel: "either"
49665
+ },
49666
+ {
49667
+ domain: "pipeline",
49668
+ operation: "phase.list",
49669
+ gateway: "query",
49670
+ mode: "native",
49671
+ preferredChannel: "either"
49672
+ },
49673
+ {
49674
+ domain: "pipeline",
49675
+ operation: "phase.set",
49676
+ gateway: "mutate",
49677
+ mode: "native",
49678
+ preferredChannel: "either"
49679
+ },
49680
+ {
49681
+ domain: "pipeline",
49682
+ operation: "phase.advance",
49683
+ gateway: "mutate",
49684
+ mode: "native",
49685
+ preferredChannel: "either"
49686
+ },
49687
+ {
49688
+ domain: "pipeline",
49689
+ operation: "phase.rename",
49690
+ gateway: "mutate",
49691
+ mode: "native",
49692
+ preferredChannel: "either"
49693
+ },
49694
+ {
49695
+ domain: "pipeline",
49696
+ operation: "phase.delete",
49697
+ gateway: "mutate",
49698
+ mode: "native",
49699
+ preferredChannel: "either"
49700
+ },
48870
49701
  // 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" },
49702
+ {
49703
+ domain: "pipeline",
49704
+ operation: "chain.show",
49705
+ gateway: "query",
49706
+ mode: "native",
49707
+ preferredChannel: "either"
49708
+ },
49709
+ {
49710
+ domain: "pipeline",
49711
+ operation: "chain.list",
49712
+ gateway: "query",
49713
+ mode: "native",
49714
+ preferredChannel: "either"
49715
+ },
49716
+ {
49717
+ domain: "pipeline",
49718
+ operation: "chain.add",
49719
+ gateway: "mutate",
49720
+ mode: "native",
49721
+ preferredChannel: "either"
49722
+ },
49723
+ {
49724
+ domain: "pipeline",
49725
+ operation: "chain.instantiate",
49726
+ gateway: "mutate",
49727
+ mode: "native",
49728
+ preferredChannel: "either"
49729
+ },
49730
+ {
49731
+ domain: "pipeline",
49732
+ operation: "chain.advance",
49733
+ gateway: "mutate",
49734
+ mode: "native",
49735
+ preferredChannel: "either"
49736
+ },
48876
49737
  // 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" },
49738
+ {
49739
+ domain: "pipeline",
49740
+ operation: "release.list",
49741
+ gateway: "query",
49742
+ mode: "native",
49743
+ preferredChannel: "either"
49744
+ },
49745
+ {
49746
+ domain: "pipeline",
49747
+ operation: "release.show",
49748
+ gateway: "query",
49749
+ mode: "native",
49750
+ preferredChannel: "either"
49751
+ },
49752
+ {
49753
+ domain: "pipeline",
49754
+ operation: "release.channel.show",
49755
+ gateway: "query",
49756
+ mode: "native",
49757
+ preferredChannel: "either"
49758
+ },
49759
+ {
49760
+ domain: "pipeline",
49761
+ operation: "release.ship",
49762
+ gateway: "mutate",
49763
+ mode: "native",
49764
+ preferredChannel: "cli"
49765
+ },
49766
+ {
49767
+ domain: "pipeline",
49768
+ operation: "release.cancel",
49769
+ gateway: "mutate",
49770
+ mode: "native",
49771
+ preferredChannel: "either"
49772
+ },
49773
+ {
49774
+ domain: "pipeline",
49775
+ operation: "release.rollback",
49776
+ gateway: "mutate",
49777
+ mode: "native",
49778
+ preferredChannel: "either"
49779
+ },
48883
49780
  // === Tools Domain ===
48884
49781
  // Issue operations
48885
- { domain: "tools", operation: "issue.diagnostics", gateway: "query", mode: "native" },
49782
+ {
49783
+ domain: "tools",
49784
+ operation: "issue.diagnostics",
49785
+ gateway: "query",
49786
+ mode: "native",
49787
+ preferredChannel: "either"
49788
+ },
48886
49789
  // 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" },
49790
+ {
49791
+ domain: "tools",
49792
+ operation: "skill.list",
49793
+ gateway: "query",
49794
+ mode: "native",
49795
+ preferredChannel: "mcp"
49796
+ },
49797
+ {
49798
+ domain: "tools",
49799
+ operation: "skill.show",
49800
+ gateway: "query",
49801
+ mode: "native",
49802
+ preferredChannel: "mcp"
49803
+ },
49804
+ {
49805
+ domain: "tools",
49806
+ operation: "skill.find",
49807
+ gateway: "query",
49808
+ mode: "native",
49809
+ preferredChannel: "mcp"
49810
+ },
49811
+ {
49812
+ domain: "tools",
49813
+ operation: "skill.dispatch",
49814
+ gateway: "query",
49815
+ mode: "native",
49816
+ preferredChannel: "either"
49817
+ },
49818
+ {
49819
+ domain: "tools",
49820
+ operation: "skill.verify",
49821
+ gateway: "query",
49822
+ mode: "native",
49823
+ preferredChannel: "either"
49824
+ },
49825
+ {
49826
+ domain: "tools",
49827
+ operation: "skill.dependencies",
49828
+ gateway: "query",
49829
+ mode: "native",
49830
+ preferredChannel: "either"
49831
+ },
49832
+ {
49833
+ domain: "tools",
49834
+ operation: "skill.spawn.providers",
49835
+ gateway: "query",
49836
+ mode: "native",
49837
+ preferredChannel: "either"
49838
+ },
49839
+ {
49840
+ domain: "tools",
49841
+ operation: "skill.catalog",
49842
+ gateway: "query",
49843
+ mode: "native",
49844
+ preferredChannel: "either"
49845
+ },
49846
+ {
49847
+ domain: "tools",
49848
+ operation: "skill.precedence",
49849
+ gateway: "query",
49850
+ mode: "native",
49851
+ preferredChannel: "either"
49852
+ },
49853
+ {
49854
+ domain: "tools",
49855
+ operation: "skill.install",
49856
+ gateway: "mutate",
49857
+ mode: "native",
49858
+ preferredChannel: "either"
49859
+ },
49860
+ {
49861
+ domain: "tools",
49862
+ operation: "skill.uninstall",
49863
+ gateway: "mutate",
49864
+ mode: "native",
49865
+ preferredChannel: "either"
49866
+ },
49867
+ {
49868
+ domain: "tools",
49869
+ operation: "skill.refresh",
49870
+ gateway: "mutate",
49871
+ mode: "native",
49872
+ preferredChannel: "either"
49873
+ },
48899
49874
  // 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" },
49875
+ {
49876
+ domain: "tools",
49877
+ operation: "provider.list",
49878
+ gateway: "query",
49879
+ mode: "native",
49880
+ preferredChannel: "mcp"
49881
+ },
49882
+ {
49883
+ domain: "tools",
49884
+ operation: "provider.detect",
49885
+ gateway: "query",
49886
+ mode: "native",
49887
+ preferredChannel: "mcp"
49888
+ },
49889
+ {
49890
+ domain: "tools",
49891
+ operation: "provider.inject.status",
49892
+ gateway: "query",
49893
+ mode: "native",
49894
+ preferredChannel: "either"
49895
+ },
49896
+ {
49897
+ domain: "tools",
49898
+ operation: "provider.supports",
49899
+ gateway: "query",
49900
+ mode: "native",
49901
+ preferredChannel: "either"
49902
+ },
49903
+ {
49904
+ domain: "tools",
49905
+ operation: "provider.hooks",
49906
+ gateway: "query",
49907
+ mode: "native",
49908
+ preferredChannel: "either"
49909
+ },
49910
+ {
49911
+ domain: "tools",
49912
+ operation: "provider.inject",
49913
+ gateway: "mutate",
49914
+ mode: "native",
49915
+ preferredChannel: "either"
49916
+ },
49917
+ // Adapter sub-domain (T5240)
49918
+ {
49919
+ domain: "tools",
49920
+ operation: "adapter.list",
49921
+ gateway: "query",
49922
+ mode: "native",
49923
+ preferredChannel: "mcp"
49924
+ },
49925
+ {
49926
+ domain: "tools",
49927
+ operation: "adapter.show",
49928
+ gateway: "query",
49929
+ mode: "native",
49930
+ preferredChannel: "mcp"
49931
+ },
49932
+ {
49933
+ domain: "tools",
49934
+ operation: "adapter.detect",
49935
+ gateway: "query",
49936
+ mode: "native",
49937
+ preferredChannel: "either"
49938
+ },
49939
+ {
49940
+ domain: "tools",
49941
+ operation: "adapter.health",
49942
+ gateway: "query",
49943
+ mode: "native",
49944
+ preferredChannel: "either"
49945
+ },
49946
+ {
49947
+ domain: "tools",
49948
+ operation: "adapter.activate",
49949
+ gateway: "mutate",
49950
+ mode: "native",
49951
+ preferredChannel: "mcp"
49952
+ },
49953
+ {
49954
+ domain: "tools",
49955
+ operation: "adapter.dispose",
49956
+ gateway: "mutate",
49957
+ mode: "native",
49958
+ preferredChannel: "either"
49959
+ },
48906
49960
  // === Nexus Domain ===
48907
49961
  // 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" },
49962
+ {
49963
+ domain: "nexus",
49964
+ operation: "status",
49965
+ gateway: "query",
49966
+ mode: "native",
49967
+ preferredChannel: "either"
49968
+ },
49969
+ {
49970
+ domain: "nexus",
49971
+ operation: "list",
49972
+ gateway: "query",
49973
+ mode: "native",
49974
+ preferredChannel: "either"
49975
+ },
49976
+ {
49977
+ domain: "nexus",
49978
+ operation: "show",
49979
+ gateway: "query",
49980
+ mode: "native",
49981
+ preferredChannel: "either"
49982
+ },
49983
+ {
49984
+ domain: "nexus",
49985
+ operation: "search",
49986
+ gateway: "query",
49987
+ mode: "native",
49988
+ preferredChannel: "either"
49989
+ },
49990
+ {
49991
+ domain: "nexus",
49992
+ operation: "graph",
49993
+ gateway: "query",
49994
+ mode: "native",
49995
+ preferredChannel: "either"
49996
+ },
49997
+ {
49998
+ domain: "nexus",
49999
+ operation: "deps",
50000
+ gateway: "query",
50001
+ mode: "native",
50002
+ preferredChannel: "either"
50003
+ },
50004
+ {
50005
+ domain: "nexus",
50006
+ operation: "resolve",
50007
+ gateway: "query",
50008
+ mode: "native",
50009
+ preferredChannel: "either"
50010
+ },
50011
+ {
50012
+ domain: "nexus",
50013
+ operation: "discover",
50014
+ gateway: "query",
50015
+ mode: "native",
50016
+ preferredChannel: "either"
50017
+ },
50018
+ {
50019
+ domain: "nexus",
50020
+ operation: "orphans.list",
50021
+ gateway: "query",
50022
+ mode: "native",
50023
+ preferredChannel: "either"
50024
+ },
50025
+ {
50026
+ domain: "nexus",
50027
+ operation: "blockers.show",
50028
+ gateway: "query",
50029
+ mode: "native",
50030
+ preferredChannel: "either"
50031
+ },
50032
+ {
50033
+ domain: "nexus",
50034
+ operation: "path.show",
50035
+ gateway: "query",
50036
+ mode: "native",
50037
+ preferredChannel: "either"
50038
+ },
50039
+ {
50040
+ domain: "nexus",
50041
+ operation: "share.status",
50042
+ gateway: "query",
50043
+ mode: "native",
50044
+ preferredChannel: "either"
50045
+ },
50046
+ {
50047
+ domain: "nexus",
50048
+ operation: "transfer.preview",
50049
+ gateway: "query",
50050
+ mode: "native",
50051
+ preferredChannel: "either"
50052
+ },
48920
50053
  // 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" },
50054
+ {
50055
+ domain: "nexus",
50056
+ operation: "init",
50057
+ gateway: "mutate",
50058
+ mode: "native",
50059
+ preferredChannel: "either"
50060
+ },
50061
+ {
50062
+ domain: "nexus",
50063
+ operation: "register",
50064
+ gateway: "mutate",
50065
+ mode: "native",
50066
+ preferredChannel: "either"
50067
+ },
50068
+ {
50069
+ domain: "nexus",
50070
+ operation: "unregister",
50071
+ gateway: "mutate",
50072
+ mode: "native",
50073
+ preferredChannel: "either"
50074
+ },
50075
+ {
50076
+ domain: "nexus",
50077
+ operation: "sync",
50078
+ gateway: "mutate",
50079
+ mode: "native",
50080
+ preferredChannel: "either"
50081
+ },
50082
+ {
50083
+ domain: "nexus",
50084
+ operation: "reconcile",
50085
+ gateway: "mutate",
50086
+ mode: "native",
50087
+ preferredChannel: "either"
50088
+ },
50089
+ {
50090
+ domain: "nexus",
50091
+ operation: "permission.set",
50092
+ gateway: "mutate",
50093
+ mode: "native",
50094
+ preferredChannel: "either"
50095
+ },
50096
+ {
50097
+ domain: "nexus",
50098
+ operation: "share.snapshot.export",
50099
+ gateway: "mutate",
50100
+ mode: "native",
50101
+ preferredChannel: "either"
50102
+ },
50103
+ {
50104
+ domain: "nexus",
50105
+ operation: "share.snapshot.import",
50106
+ gateway: "mutate",
50107
+ mode: "native",
50108
+ preferredChannel: "either"
50109
+ },
50110
+ {
50111
+ domain: "nexus",
50112
+ operation: "transfer",
50113
+ gateway: "mutate",
50114
+ mode: "native",
50115
+ preferredChannel: "either"
50116
+ },
48929
50117
  // === Sticky Domain ===
48930
50118
  // Query operations
48931
- { domain: "sticky", operation: "list", gateway: "query", mode: "native" },
48932
- { domain: "sticky", operation: "show", gateway: "query", mode: "native" },
50119
+ {
50120
+ domain: "sticky",
50121
+ operation: "list",
50122
+ gateway: "query",
50123
+ mode: "native",
50124
+ preferredChannel: "mcp"
50125
+ },
50126
+ {
50127
+ domain: "sticky",
50128
+ operation: "show",
50129
+ gateway: "query",
50130
+ mode: "native",
50131
+ preferredChannel: "mcp"
50132
+ },
48933
50133
  // 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" }
50134
+ {
50135
+ domain: "sticky",
50136
+ operation: "add",
50137
+ gateway: "mutate",
50138
+ mode: "native",
50139
+ preferredChannel: "mcp"
50140
+ },
50141
+ {
50142
+ domain: "sticky",
50143
+ operation: "archive",
50144
+ gateway: "mutate",
50145
+ mode: "native",
50146
+ preferredChannel: "either"
50147
+ },
50148
+ {
50149
+ domain: "sticky",
50150
+ operation: "convert",
50151
+ gateway: "mutate",
50152
+ mode: "native",
50153
+ preferredChannel: "either"
50154
+ },
50155
+ {
50156
+ domain: "sticky",
50157
+ operation: "purge",
50158
+ gateway: "mutate",
50159
+ mode: "native",
50160
+ preferredChannel: "either"
50161
+ }
48938
50162
  ];
48939
50163
  }
48940
50164
  });
@@ -51697,6 +52921,7 @@ var init_config2 = __esm({
51697
52921
 
51698
52922
  // packages/core/src/skills/agents/install.ts
51699
52923
  import { existsSync as existsSync67, mkdirSync as mkdirSync14, readdirSync as readdirSync25, readlinkSync, symlinkSync, unlinkSync as unlinkSync4 } from "node:fs";
52924
+ import { platform as platform2 } from "node:os";
51700
52925
  import { basename as basename12, join as join70 } from "node:path";
51701
52926
  function getAgentInstallDir() {
51702
52927
  return getClaudeAgentsDir();
@@ -51727,7 +52952,7 @@ function installAgent(agentDir) {
51727
52952
  }
51728
52953
  }
51729
52954
  try {
51730
- symlinkSync(agentDir, targetPath, "dir");
52955
+ symlinkSync(agentDir, targetPath, DIR_SYMLINK_TYPE);
51731
52956
  return { installed: true, path: targetPath };
51732
52957
  } catch (err) {
51733
52958
  return { installed: false, path: targetPath, error: `Symlink failed: ${err}` };
@@ -51767,11 +52992,13 @@ function uninstallAgent(agentName) {
51767
52992
  return false;
51768
52993
  }
51769
52994
  }
52995
+ var DIR_SYMLINK_TYPE;
51770
52996
  var init_install = __esm({
51771
52997
  "packages/core/src/skills/agents/install.ts"() {
51772
52998
  "use strict";
51773
52999
  init_paths();
51774
53000
  init_config2();
53001
+ DIR_SYMLINK_TYPE = platform2() === "win32" ? "junction" : "dir";
51775
53002
  }
51776
53003
  });
51777
53004
 
@@ -53704,8 +54931,9 @@ var init_validator = __esm({
53704
54931
  // packages/core/src/skills/skill-paths.ts
53705
54932
  import { existsSync as existsSync77, lstatSync, readlinkSync as readlinkSync2, realpathSync as realpathSync2 } from "node:fs";
53706
54933
  import { delimiter, join as join79, resolve as resolve9 } from "node:path";
54934
+ import { getCanonicalSkillsDir as getCanonicalSkillsDir2 } from "@cleocode/caamp";
53707
54935
  function getCaampCanonical() {
53708
- return join79(getAgentsHome(), "skills");
54936
+ return getCanonicalSkillsDir2();
53709
54937
  }
53710
54938
  function getProjectEmbedded(projectRoot) {
53711
54939
  const root = projectRoot ?? process.cwd();
@@ -53825,7 +55053,6 @@ function getSkillSourceType(skillDir, projectRoot) {
53825
55053
  var init_skill_paths = __esm({
53826
55054
  "packages/core/src/skills/skill-paths.ts"() {
53827
55055
  "use strict";
53828
- init_paths();
53829
55056
  }
53830
55057
  });
53831
55058
 
@@ -56206,7 +57433,7 @@ function getNodeVersionInfo() {
56206
57433
  };
56207
57434
  }
56208
57435
  function getNodeUpgradeInstructions() {
56209
- const platform3 = detectPlatform();
57436
+ const platform5 = detectPlatform();
56210
57437
  const arch2 = process.arch;
56211
57438
  const instructions = [];
56212
57439
  const hasFnm = commandExists2("fnm");
@@ -56221,7 +57448,7 @@ function getNodeUpgradeInstructions() {
56221
57448
  if (hasVolta) {
56222
57449
  instructions.push(`volta install node@${MINIMUM_NODE_MAJOR}`);
56223
57450
  }
56224
- switch (platform3) {
57451
+ switch (platform5) {
56225
57452
  case "linux":
56226
57453
  if (commandExists2("dnf")) {
56227
57454
  instructions.push(
@@ -56253,7 +57480,7 @@ function getNodeUpgradeInstructions() {
56253
57480
  }
56254
57481
  instructions.push(`https://nodejs.org/en/download/`);
56255
57482
  const recommended = instructions[0] ?? `https://nodejs.org/en/download/`;
56256
- return { platform: platform3, arch: arch2, instructions, recommended };
57483
+ return { platform: platform5, arch: arch2, instructions, recommended };
56257
57484
  }
56258
57485
  function getSystemInfo2() {
56259
57486
  return {
@@ -57788,12 +59015,22 @@ async function startupHealthCheck(projectRoot) {
57788
59015
  message: scaffoldResult.home.action === "skipped" ? "Global home already current" : `Global home ${scaffoldResult.home.action}: ${scaffoldResult.home.details ?? ""}`,
57789
59016
  repaired: scaffoldResult.home.action !== "skipped"
57790
59017
  });
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
- });
59018
+ if (!globalSchemaCheck.ok) {
59019
+ const { ensureGlobalSchemas: ensureGlobalSchemas2 } = await Promise.resolve().then(() => (init_schema_management(), schema_management_exports));
59020
+ const schemaResult = ensureGlobalSchemas2();
59021
+ checks.push({
59022
+ check: "global_schemas",
59023
+ status: "pass",
59024
+ message: `Schemas: ${schemaResult.installed} installed, ${schemaResult.updated} updated of ${schemaResult.total}`,
59025
+ repaired: schemaResult.installed > 0 || schemaResult.updated > 0
59026
+ });
59027
+ } else {
59028
+ checks.push({
59029
+ check: "global_schemas",
59030
+ status: "pass",
59031
+ message: `All ${globalSchemaCheck.installed} schemas current`
59032
+ });
59033
+ }
57797
59034
  checks.push({
57798
59035
  check: "global_templates",
57799
59036
  status: "pass",
@@ -59330,13 +60567,13 @@ var init_templates = __esm({
59330
60567
 
59331
60568
  // packages/core/src/ui/aliases.ts
59332
60569
  import { existsSync as existsSync93, readFileSync as readFileSync67, writeFileSync as writeFileSync15 } from "node:fs";
59333
- import { homedir as homedir5, platform as platform2 } from "node:os";
60570
+ import { homedir as homedir5, platform as platform3 } from "node:os";
59334
60571
  import { join as join96 } from "node:path";
59335
60572
  function getCurrentShell() {
59336
60573
  const shell = process.env.SHELL ?? "";
59337
60574
  if (shell.includes("zsh")) return "zsh";
59338
60575
  if (shell.includes("bash")) return "bash";
59339
- if (platform2() === "win32") return "powershell";
60576
+ if (platform3() === "win32") return "powershell";
59340
60577
  return "bash";
59341
60578
  }
59342
60579
  function getRcFilePath(shell) {
@@ -59360,7 +60597,7 @@ function detectAvailableShells() {
59360
60597
  const shells = [];
59361
60598
  if (existsSync93(getRcFilePath("bash")) || existsSync93("/bin/bash")) shells.push("bash");
59362
60599
  if (existsSync93(getRcFilePath("zsh")) || existsSync93("/bin/zsh")) shells.push("zsh");
59363
- if (platform2() === "win32") shells.push("powershell");
60600
+ if (platform3() === "win32") shells.push("powershell");
59364
60601
  return shells;
59365
60602
  }
59366
60603
  function generateBashAliases(cleoPath) {
@@ -59824,27 +61061,10 @@ var init_flags = __esm({
59824
61061
  }
59825
61062
  });
59826
61063
 
59827
- // packages/core/src/ui/injection-legacy.ts
59828
- function getValidationKey(target) {
59829
- return INJECTION_VALIDATION_KEYS[target] ?? target.toLowerCase().replace(/[^a-z0-9]/g, "_");
59830
- }
59831
- var INJECTION_VALIDATION_KEYS;
59832
- var init_injection_legacy = __esm({
59833
- "packages/core/src/ui/injection-legacy.ts"() {
59834
- "use strict";
59835
- INJECTION_VALIDATION_KEYS = {
59836
- "CLAUDE.md": "claude_md",
59837
- "AGENTS.md": "agents_md",
59838
- "GEMINI.md": "gemini_md"
59839
- };
59840
- }
59841
- });
59842
-
59843
61064
  // packages/core/src/ui/index.ts
59844
61065
  var ui_exports = {};
59845
61066
  __export(ui_exports, {
59846
61067
  ALIASES_VERSION: () => ALIASES_VERSION,
59847
- INJECTION_VALIDATION_KEYS: () => INJECTION_VALIDATION_KEYS,
59848
61068
  appendToChangelog: () => appendToChangelog,
59849
61069
  checkAliasesStatus: () => checkAliasesStatus,
59850
61070
  defaultFlags: () => defaultFlags,
@@ -59861,7 +61081,6 @@ __export(ui_exports, {
59861
61081
  getCurrentShell: () => getCurrentShell,
59862
61082
  getInstalledVersion: () => getInstalledVersion,
59863
61083
  getRcFilePath: () => getRcFilePath,
59864
- getValidationKey: () => getValidationKey,
59865
61084
  groupTasksIntoSections: () => groupTasksIntoSections,
59866
61085
  hasAliasBlock: () => hasAliasBlock,
59867
61086
  injectAliases: () => injectAliases,
@@ -59881,7 +61100,6 @@ var init_ui = __esm({
59881
61100
  init_changelog();
59882
61101
  init_command_registry();
59883
61102
  init_flags();
59884
- init_injection_legacy();
59885
61103
  }
59886
61104
  });
59887
61105
 
@@ -63056,11 +64274,29 @@ __export(init_exports, {
63056
64274
  });
63057
64275
  import { existsSync as existsSync100, readdirSync as readdirSync33, readFileSync as readFileSync73 } from "node:fs";
63058
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";
63059
64278
  import { basename as basename17, dirname as dirname19, join as join100 } from "node:path";
63060
64279
  async function initAgentDefinition(created, warnings) {
63061
- const packageRoot = getPackageRoot();
63062
- const agentSourceDir = join100(packageRoot, "agents", "cleo-subagent");
63063
- 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) {
63064
64300
  warnings.push("agents/cleo-subagent/ not found in package, skipping agent definition install");
63065
64301
  return;
63066
64302
  }
@@ -63074,7 +64310,7 @@ async function initAgentDefinition(created, warnings) {
63074
64310
  }
63075
64311
  } catch {
63076
64312
  }
63077
- await symlink(agentSourceDir, globalAgentsDir, "dir");
64313
+ await symlink(agentSourceDir, globalAgentsDir, DIR_SYMLINK_TYPE2);
63078
64314
  created.push("agent: cleo-subagent (symlinked)");
63079
64315
  } catch (_err) {
63080
64316
  try {
@@ -63133,17 +64369,29 @@ async function initCoreSkills(created, warnings) {
63133
64369
  const packageRoot = getPackageRoot();
63134
64370
  let ctSkillsRoot = null;
63135
64371
  try {
63136
- const bundledPath = join100(packageRoot, "packages", "skills");
63137
- if (existsSync100(join100(bundledPath, "skills.json"))) {
63138
- ctSkillsRoot = bundledPath;
63139
- } else {
63140
- const ctSkillsPath = join100(packageRoot, "node_modules", "@cleocode", "skills");
63141
- if (existsSync100(join100(ctSkillsPath, "skills.json"))) {
63142
- ctSkillsRoot = ctSkillsPath;
63143
- }
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;
63144
64378
  }
63145
64379
  } catch {
63146
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
+ }
63147
64395
  if (!ctSkillsRoot) {
63148
64396
  warnings.push("skills package not found, skipping core skill installation");
63149
64397
  return;
@@ -63435,7 +64683,6 @@ async function initProject(opts = {}) {
63435
64683
  warnings.push(`Contributor MCP setup: ${err instanceof Error ? err.message : String(err)}`);
63436
64684
  }
63437
64685
  await initAgentDefinition(created, warnings);
63438
- await initCoreSkills(created, warnings);
63439
64686
  await initNexusRegistration(projRoot, created, warnings);
63440
64687
  try {
63441
64688
  const { AdapterManager: AdapterManager2 } = await Promise.resolve().then(() => (init_adapters(), adapters_exports));
@@ -63522,6 +64769,7 @@ async function getVersion2(projectRoot) {
63522
64769
  }
63523
64770
  return { version: "0.0.0" };
63524
64771
  }
64772
+ var DIR_SYMLINK_TYPE2;
63525
64773
  var init_init = __esm({
63526
64774
  "packages/core/src/init.ts"() {
63527
64775
  "use strict";
@@ -63535,6 +64783,7 @@ var init_init = __esm({
63535
64783
  init_scaffold();
63536
64784
  init_schema_management();
63537
64785
  init_json2();
64786
+ DIR_SYMLINK_TYPE2 = platform4() === "win32" ? "junction" : "dir";
63538
64787
  }
63539
64788
  });
63540
64789
 
@@ -64329,7 +65578,8 @@ async function injectAgentsHub(ctx) {
64329
65578
  await writeFile12(globalAgentsMd, stripped, "utf8");
64330
65579
  }
64331
65580
  }
64332
- const action = await inject2(globalAgentsMd, "@~/.cleo/templates/CLEO-INJECTION.md");
65581
+ const expectedContent = "@~/.cleo/templates/CLEO-INJECTION.md";
65582
+ const action = await inject2(globalAgentsMd, expectedContent);
64333
65583
  ctx.created.push(`~/.agents/AGENTS.md (${action})`);
64334
65584
  } else {
64335
65585
  ctx.created.push("~/.agents/AGENTS.md (would create/update CAAMP block)");
@@ -68415,13 +69665,13 @@ var init_parallel = __esm({
68415
69665
  // packages/core/src/orchestration/skill-ops.ts
68416
69666
  import { existsSync as existsSync107, readdirSync as readdirSync35, readFileSync as readFileSync79 } from "node:fs";
68417
69667
  import { join as join106 } from "node:path";
68418
- import { getCanonicalSkillsDir as getCanonicalSkillsDir2 } from "@cleocode/caamp";
69668
+ import { getCanonicalSkillsDir as getCanonicalSkillsDir3 } from "@cleocode/caamp";
68419
69669
  function getSkillContent(skillName, projectRoot) {
68420
69670
  if (!skillName) {
68421
69671
  throw new CleoError(2 /* INVALID_INPUT */, "skill name is required");
68422
69672
  }
68423
69673
  const projectSkillDir = join106(projectRoot, ".cleo", "skills", skillName);
68424
- const canonicalSkillDir = join106(getCanonicalSkillsDir2(), skillName);
69674
+ const canonicalSkillDir = join106(getCanonicalSkillsDir3(), skillName);
68425
69675
  const skillDir = existsSync107(projectSkillDir) ? projectSkillDir : canonicalSkillDir;
68426
69676
  if (!existsSync107(skillDir)) {
68427
69677
  throw new CleoError(
@@ -72492,7 +73742,7 @@ async function validateLayer2Semantic(context) {
72492
73742
  }
72493
73743
  if (context.domain === "session" && context.operation === "start") {
72494
73744
  const scope = context.params?.scope;
72495
- if (scope && !scope.match(/^(epic|task|global):/)) {
73745
+ if (scope && scope !== "global" && !scope.match(/^(epic|task):/)) {
72496
73746
  violations.push({
72497
73747
  layer: 2 /* SEMANTIC */,
72498
73748
  severity: "error" /* ERROR */,
@@ -72500,7 +73750,7 @@ async function validateLayer2Semantic(context) {
72500
73750
  message: `Invalid session scope format: ${scope}`,
72501
73751
  field: "scope",
72502
73752
  constraint: "Must be epic:<id>, task:<id>, or global",
72503
- fix: "Use format: epic:T1234, task:T5678, or global"
73753
+ fix: 'Provide scope as "global" or "epic:TXXX"'
72504
73754
  });
72505
73755
  }
72506
73756
  }
@@ -82509,8 +83759,15 @@ async function taskList(projectRoot, params) {
82509
83759
  data: { tasks: tasks2, total: result.total, filtered: result.filtered },
82510
83760
  page: result.page
82511
83761
  };
82512
- } catch {
82513
- return engineError("E_NOT_INITIALIZED", "Task database not initialized");
83762
+ } catch (err) {
83763
+ const code = err?.code;
83764
+ if (code === 4) return engineError("E_NOT_FOUND", err.message || "Task not found");
83765
+ if (code === 2)
83766
+ return engineError("E_INVALID_INPUT", err.message || "Invalid input");
83767
+ return engineError(
83768
+ "E_NOT_INITIALIZED",
83769
+ err.message || "Task database not initialized"
83770
+ );
82514
83771
  }
82515
83772
  }
82516
83773
  async function taskFind(projectRoot, query, limit, options) {
@@ -82537,8 +83794,15 @@ async function taskFind(projectRoot, query, limit, options) {
82537
83794
  parentId: r.parentId
82538
83795
  }));
82539
83796
  return { success: true, data: { results, total: results.length } };
82540
- } catch {
82541
- return engineError("E_NOT_INITIALIZED", "Task database not initialized");
83797
+ } catch (err) {
83798
+ const code = err?.code;
83799
+ if (code === 4) return engineError("E_NOT_FOUND", err.message || "Task not found");
83800
+ if (code === 2)
83801
+ return engineError("E_INVALID_INPUT", err.message || "Invalid input");
83802
+ return engineError(
83803
+ "E_NOT_INITIALIZED",
83804
+ err.message || "Task database not initialized"
83805
+ );
82542
83806
  }
82543
83807
  }
82544
83808
  async function taskCreate(projectRoot, params) {
@@ -83469,54 +84733,42 @@ function routeByParam(params, paramName, routes, defaultRoute) {
83469
84733
 
83470
84734
  // packages/cleo/src/dispatch/domains/admin.ts
83471
84735
  var AdminHandler = class {
83472
- projectRoot;
83473
- constructor() {
83474
- this.projectRoot = getProjectRoot();
83475
- }
83476
84736
  // -----------------------------------------------------------------------
83477
84737
  // Query
83478
84738
  // -----------------------------------------------------------------------
83479
84739
  async query(operation, params) {
84740
+ const projectRoot = getProjectRoot();
83480
84741
  const startTime = Date.now();
83481
84742
  try {
83482
84743
  switch (operation) {
83483
84744
  case "version": {
83484
- const result = await getVersion3(this.projectRoot);
84745
+ const result = await getVersion3(projectRoot);
83485
84746
  return wrapResult(result, "query", "admin", operation, startTime);
83486
84747
  }
83487
84748
  case "health": {
83488
84749
  const mode = params?.mode;
83489
84750
  if (mode === "diagnose") {
83490
- const result2 = await systemDoctor(this.projectRoot);
84751
+ const result2 = await systemDoctor(projectRoot);
83491
84752
  return wrapResult(result2, "query", "admin", operation, startTime);
83492
84753
  }
83493
- const result = systemHealth(
83494
- this.projectRoot,
83495
- params
83496
- );
84754
+ const result = systemHealth(projectRoot, params);
83497
84755
  return wrapResult(result, "query", "admin", operation, startTime);
83498
84756
  }
83499
84757
  case "config.show": {
83500
- const result = await configGet(this.projectRoot, params?.key);
84758
+ const result = await configGet(projectRoot, params?.key);
83501
84759
  return wrapResult(result, "query", "admin", operation, startTime);
83502
84760
  }
83503
84761
  case "stats": {
83504
- const result = await systemStats(
83505
- this.projectRoot,
83506
- params
83507
- );
84762
+ const result = await systemStats(projectRoot, params);
83508
84763
  return wrapResult(result, "query", "admin", operation, startTime);
83509
84764
  }
83510
84765
  case "context": {
83511
- const result = systemContext(
83512
- this.projectRoot,
83513
- params
83514
- );
84766
+ const result = systemContext(projectRoot, params);
83515
84767
  return wrapResult(result, "query", "admin", operation, startTime);
83516
84768
  }
83517
84769
  case "runtime": {
83518
84770
  const result = await systemRuntime(
83519
- this.projectRoot,
84771
+ projectRoot,
83520
84772
  params
83521
84773
  );
83522
84774
  return wrapResult(result, "query", "admin", operation, startTime);
@@ -83611,12 +84863,12 @@ var AdminHandler = class {
83611
84863
  }
83612
84864
  case "dash": {
83613
84865
  const blockedTasksLimit = typeof params?.blockedTasksLimit === "number" ? params.blockedTasksLimit : void 0;
83614
- const result = await systemDash(this.projectRoot, { blockedTasksLimit });
84866
+ const result = await systemDash(projectRoot, { blockedTasksLimit });
83615
84867
  return wrapResult(result, "query", "admin", operation, startTime);
83616
84868
  }
83617
84869
  case "log": {
83618
84870
  const result = await systemLog(
83619
- this.projectRoot,
84871
+ projectRoot,
83620
84872
  params
83621
84873
  );
83622
84874
  return wrapResult(result, "query", "admin", operation, startTime);
@@ -83633,7 +84885,7 @@ var AdminHandler = class {
83633
84885
  startTime
83634
84886
  );
83635
84887
  }
83636
- const result = await systemSequence(this.projectRoot, {
84888
+ const result = await systemSequence(projectRoot, {
83637
84889
  action
83638
84890
  });
83639
84891
  return wrapResult(result, "query", "admin", operation, startTime);
@@ -83651,7 +84903,7 @@ var AdminHandler = class {
83651
84903
  case "adr.find": {
83652
84904
  const query = params?.query;
83653
84905
  if (query) {
83654
- const result2 = await findAdrs(this.projectRoot, query, {
84906
+ const result2 = await findAdrs(projectRoot, query, {
83655
84907
  topics: params?.topics,
83656
84908
  keywords: params?.keywords,
83657
84909
  status: params?.status
@@ -83663,7 +84915,7 @@ var AdminHandler = class {
83663
84915
  };
83664
84916
  }
83665
84917
  const { limit, offset } = getListParams(params);
83666
- const result = await listAdrs(this.projectRoot, {
84918
+ const result = await listAdrs(projectRoot, {
83667
84919
  status: params?.status,
83668
84920
  since: params?.since,
83669
84921
  limit,
@@ -83688,7 +84940,7 @@ var AdminHandler = class {
83688
84940
  startTime
83689
84941
  );
83690
84942
  }
83691
- const adr = await showAdr(this.projectRoot, adrId);
84943
+ const adr = await showAdr(projectRoot, adrId);
83692
84944
  if (!adr) {
83693
84945
  return errorResult(
83694
84946
  "query",
@@ -83727,7 +84979,7 @@ var AdminHandler = class {
83727
84979
  since: params?.since,
83728
84980
  until: params?.until
83729
84981
  },
83730
- this.projectRoot
84982
+ projectRoot
83731
84983
  );
83732
84984
  return {
83733
84985
  _meta: dispatchMeta("query", "admin", operation, startTime),
@@ -83754,7 +85006,7 @@ var AdminHandler = class {
83754
85006
  limit,
83755
85007
  offset
83756
85008
  },
83757
- this.projectRoot
85009
+ projectRoot
83758
85010
  );
83759
85011
  return {
83760
85012
  _meta: dispatchMeta("query", "admin", operation, startTime),
@@ -83779,7 +85031,7 @@ var AdminHandler = class {
83779
85031
  startTime
83780
85032
  );
83781
85033
  }
83782
- const result = await showTokenUsage(tokenId, this.projectRoot);
85034
+ const result = await showTokenUsage(tokenId, projectRoot);
83783
85035
  if (!result) {
83784
85036
  return errorResult(
83785
85037
  "query",
@@ -83804,8 +85056,8 @@ var AdminHandler = class {
83804
85056
  case "export": {
83805
85057
  const scope = params?.scope;
83806
85058
  if (scope === "snapshot") {
83807
- const snapshot = await exportSnapshot(this.projectRoot);
83808
- const outputPath = params?.output ?? getDefaultSnapshotPath(this.projectRoot);
85059
+ const snapshot = await exportSnapshot(projectRoot);
85060
+ const outputPath = params?.output ?? getDefaultSnapshotPath(projectRoot);
83809
85061
  await writeSnapshot(snapshot, outputPath);
83810
85062
  return {
83811
85063
  _meta: dispatchMeta("query", "admin", operation, startTime),
@@ -83826,7 +85078,7 @@ var AdminHandler = class {
83826
85078
  filter: params?.filter,
83827
85079
  includeDeps: params?.includeDeps,
83828
85080
  dryRun: params?.dryRun,
83829
- cwd: this.projectRoot
85081
+ cwd: projectRoot
83830
85082
  });
83831
85083
  return {
83832
85084
  _meta: dispatchMeta("query", "admin", operation, startTime),
@@ -83840,7 +85092,7 @@ var AdminHandler = class {
83840
85092
  status: params?.status,
83841
85093
  parent: params?.parent,
83842
85094
  phase: params?.phase,
83843
- cwd: this.projectRoot
85095
+ cwd: projectRoot
83844
85096
  });
83845
85097
  return {
83846
85098
  _meta: dispatchMeta("query", "admin", operation, startTime),
@@ -83850,7 +85102,7 @@ var AdminHandler = class {
83850
85102
  }
83851
85103
  case "map": {
83852
85104
  const { mapCodebase: mapCodebase3 } = await Promise.resolve().then(() => (init_codebase_map_engine(), codebase_map_engine_exports));
83853
- const result = await mapCodebase3(this.projectRoot, {
85105
+ const result = await mapCodebase3(projectRoot, {
83854
85106
  focus: params?.focus,
83855
85107
  storeToBrain: false
83856
85108
  });
@@ -83871,12 +85123,13 @@ var AdminHandler = class {
83871
85123
  // Mutate
83872
85124
  // -----------------------------------------------------------------------
83873
85125
  async mutate(operation, params) {
85126
+ const projectRoot = getProjectRoot();
83874
85127
  const startTime = Date.now();
83875
85128
  try {
83876
85129
  switch (operation) {
83877
85130
  case "init": {
83878
85131
  const result = await initProject2(
83879
- this.projectRoot,
85132
+ projectRoot,
83880
85133
  params
83881
85134
  );
83882
85135
  return wrapResult(result, "mutate", "admin", operation, startTime);
@@ -83885,10 +85138,10 @@ var AdminHandler = class {
83885
85138
  case "health": {
83886
85139
  const mode = params?.mode;
83887
85140
  if (mode === "diagnose") {
83888
- const result2 = await systemDoctor(this.projectRoot);
85141
+ const result2 = await systemDoctor(projectRoot);
83889
85142
  return wrapResult(result2, "mutate", "admin", operation, startTime);
83890
85143
  }
83891
- const result = await systemFix(this.projectRoot);
85144
+ const result = await systemFix(projectRoot);
83892
85145
  return wrapResult(result, "mutate", "admin", operation, startTime);
83893
85146
  }
83894
85147
  case "config.set": {
@@ -83903,7 +85156,7 @@ var AdminHandler = class {
83903
85156
  startTime
83904
85157
  );
83905
85158
  }
83906
- const result = await configSet(this.projectRoot, key, params?.value);
85159
+ const result = await configSet(projectRoot, key, params?.value);
83907
85160
  return wrapResult(result, "mutate", "admin", operation, startTime);
83908
85161
  }
83909
85162
  // Merged: backup absorbs restore and backup.restore via action param (T5615)
@@ -83921,7 +85174,7 @@ var AdminHandler = class {
83921
85174
  startTime
83922
85175
  );
83923
85176
  }
83924
- const result2 = systemRestore(this.projectRoot, {
85177
+ const result2 = systemRestore(projectRoot, {
83925
85178
  backupId,
83926
85179
  force: params?.force
83927
85180
  });
@@ -83939,20 +85192,20 @@ var AdminHandler = class {
83939
85192
  startTime
83940
85193
  );
83941
85194
  }
83942
- const result2 = await backupRestore(this.projectRoot, file2, {
85195
+ const result2 = await backupRestore(projectRoot, file2, {
83943
85196
  dryRun: params?.dryRun
83944
85197
  });
83945
85198
  return wrapResult(result2, "mutate", "admin", operation, startTime);
83946
85199
  }
83947
85200
  const result = systemBackup(
83948
- this.projectRoot,
85201
+ projectRoot,
83949
85202
  params
83950
85203
  );
83951
85204
  return wrapResult(result, "mutate", "admin", operation, startTime);
83952
85205
  }
83953
85206
  case "migrate": {
83954
85207
  const result = await systemMigrate(
83955
- this.projectRoot,
85208
+ projectRoot,
83956
85209
  params
83957
85210
  );
83958
85211
  return wrapResult(result, "mutate", "admin", operation, startTime);
@@ -83969,7 +85222,7 @@ var AdminHandler = class {
83969
85222
  startTime
83970
85223
  );
83971
85224
  }
83972
- const result = await systemCleanup(this.projectRoot, {
85225
+ const result = await systemCleanup(projectRoot, {
83973
85226
  target,
83974
85227
  olderThan: params?.olderThan,
83975
85228
  dryRun: params?.dryRun
@@ -84021,20 +85274,20 @@ var AdminHandler = class {
84021
85274
  }
84022
85275
  case "safestop": {
84023
85276
  const result = systemSafestop(
84024
- this.projectRoot,
85277
+ projectRoot,
84025
85278
  params
84026
85279
  );
84027
85280
  return wrapResult(result, "mutate", "admin", operation, startTime);
84028
85281
  }
84029
85282
  case "inject.generate": {
84030
- const result = await systemInjectGenerate(this.projectRoot);
85283
+ const result = await systemInjectGenerate(projectRoot);
84031
85284
  return wrapResult(result, "mutate", "admin", operation, startTime);
84032
85285
  }
84033
85286
  // adr.sync absorbs adr.validate via validate flag (T5615)
84034
85287
  case "adr.sync": {
84035
85288
  const validate = params?.validate;
84036
85289
  if (validate) {
84037
- const result2 = await validateAllAdrs(this.projectRoot);
85290
+ const result2 = await validateAllAdrs(projectRoot);
84038
85291
  return {
84039
85292
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
84040
85293
  success: result2.valid,
@@ -84047,7 +85300,7 @@ var AdminHandler = class {
84047
85300
  }
84048
85301
  };
84049
85302
  }
84050
- const result = await syncAdrsToDb(this.projectRoot);
85303
+ const result = await syncAdrsToDb(projectRoot);
84051
85304
  return {
84052
85305
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
84053
85306
  success: true,
@@ -84082,7 +85335,7 @@ var AdminHandler = class {
84082
85335
  }
84083
85336
  };
84084
85337
  }
84085
- const result2 = await importSnapshot(snapshot, this.projectRoot);
85338
+ const result2 = await importSnapshot(snapshot, projectRoot);
84086
85339
  return {
84087
85340
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
84088
85341
  success: true,
@@ -84118,7 +85371,7 @@ var AdminHandler = class {
84118
85371
  onConflict: params?.onConflict,
84119
85372
  onMissingDep: params?.onMissingDep,
84120
85373
  force: params?.force,
84121
- cwd: this.projectRoot
85374
+ cwd: projectRoot
84122
85375
  });
84123
85376
  return {
84124
85377
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
@@ -84144,7 +85397,7 @@ var AdminHandler = class {
84144
85397
  onDuplicate: params?.onDuplicate,
84145
85398
  addLabel: params?.addLabel,
84146
85399
  dryRun: params?.dryRun,
84147
- cwd: this.projectRoot
85400
+ cwd: projectRoot
84148
85401
  });
84149
85402
  return {
84150
85403
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
@@ -84154,8 +85407,8 @@ var AdminHandler = class {
84154
85407
  }
84155
85408
  case "detect": {
84156
85409
  const { ensureProjectContext: ensureProjectContext2, ensureContributorMcp: ensureContributorMcp2 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
84157
- const contextResult = await ensureProjectContext2(this.projectRoot, { force: true });
84158
- const mcpResult = await ensureContributorMcp2(this.projectRoot);
85410
+ const contextResult = await ensureProjectContext2(projectRoot, { force: true });
85411
+ const mcpResult = await ensureContributorMcp2(projectRoot);
84159
85412
  return wrapResult(
84160
85413
  {
84161
85414
  success: true,
@@ -84187,7 +85440,7 @@ var AdminHandler = class {
84187
85440
  requestPayload: params?.requestPayload,
84188
85441
  responsePayload: params?.responsePayload,
84189
85442
  metadata: params?.metadata,
84190
- cwd: this.projectRoot
85443
+ cwd: projectRoot
84191
85444
  });
84192
85445
  return {
84193
85446
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
@@ -84207,7 +85460,7 @@ var AdminHandler = class {
84207
85460
  startTime
84208
85461
  );
84209
85462
  }
84210
- const result = await deleteTokenUsage(tokenId, this.projectRoot);
85463
+ const result = await deleteTokenUsage(tokenId, projectRoot);
84211
85464
  return {
84212
85465
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
84213
85466
  success: true,
@@ -84230,7 +85483,7 @@ var AdminHandler = class {
84230
85483
  since: params?.since,
84231
85484
  until: params?.until
84232
85485
  },
84233
- this.projectRoot
85486
+ projectRoot
84234
85487
  );
84235
85488
  return {
84236
85489
  _meta: dispatchMeta("mutate", "admin", operation, startTime),
@@ -84261,13 +85514,13 @@ var AdminHandler = class {
84261
85514
  taskId: params?.taskId,
84262
85515
  variant: params?.variant
84263
85516
  },
84264
- this.projectRoot
85517
+ projectRoot
84265
85518
  );
84266
85519
  return wrapResult(result, "mutate", "admin", operation, startTime);
84267
85520
  }
84268
85521
  case "map": {
84269
85522
  const { mapCodebase: mapCodebase3 } = await Promise.resolve().then(() => (init_codebase_map_engine(), codebase_map_engine_exports));
84270
- const result = await mapCodebase3(this.projectRoot, {
85523
+ const result = await mapCodebase3(projectRoot, {
84271
85524
  focus: params?.focus,
84272
85525
  storeToBrain: true
84273
85526
  });
@@ -84348,14 +85601,11 @@ var AdminHandler = class {
84348
85601
  // packages/cleo/src/dispatch/domains/check.ts
84349
85602
  init_internal();
84350
85603
  var CheckHandler = class {
84351
- projectRoot;
84352
- constructor() {
84353
- this.projectRoot = getProjectRoot();
84354
- }
84355
85604
  // -----------------------------------------------------------------------
84356
85605
  // Query
84357
85606
  // -----------------------------------------------------------------------
84358
85607
  async query(operation, params) {
85608
+ const projectRoot = getProjectRoot();
84359
85609
  const startTime = Date.now();
84360
85610
  try {
84361
85611
  switch (operation) {
@@ -84371,7 +85621,7 @@ var CheckHandler = class {
84371
85621
  startTime
84372
85622
  );
84373
85623
  }
84374
- const result = validateSchemaOp(type, params?.data, this.projectRoot);
85624
+ const result = validateSchemaOp(type, params?.data, projectRoot);
84375
85625
  return wrapResult(result, "query", "check", operation, startTime);
84376
85626
  }
84377
85627
  case "task": {
@@ -84386,11 +85636,11 @@ var CheckHandler = class {
84386
85636
  startTime
84387
85637
  );
84388
85638
  }
84389
- const result = await validateTask2(taskId, this.projectRoot);
85639
+ const result = await validateTask2(taskId, projectRoot);
84390
85640
  return wrapResult(result, "query", "check", operation, startTime);
84391
85641
  }
84392
85642
  case "manifest": {
84393
- const result = validateManifest(this.projectRoot);
85643
+ const result = validateManifest(projectRoot);
84394
85644
  return wrapResult(result, "query", "check", operation, startTime);
84395
85645
  }
84396
85646
  case "output": {
@@ -84408,7 +85658,7 @@ var CheckHandler = class {
84408
85658
  const result = validateOutput(
84409
85659
  filePath,
84410
85660
  params?.taskId,
84411
- this.projectRoot
85661
+ projectRoot
84412
85662
  );
84413
85663
  return wrapResult(result, "query", "check", operation, startTime);
84414
85664
  }
@@ -84416,23 +85666,23 @@ var CheckHandler = class {
84416
85666
  const detail = params?.detail;
84417
85667
  const limit = params?.limit;
84418
85668
  if (detail) {
84419
- const result2 = validateComplianceViolations(limit, this.projectRoot);
85669
+ const result2 = validateComplianceViolations(limit, projectRoot);
84420
85670
  return wrapResult(result2, "query", "check", operation, startTime);
84421
85671
  }
84422
- const result = validateComplianceSummary(this.projectRoot);
85672
+ const result = validateComplianceSummary(projectRoot);
84423
85673
  return wrapResult(result, "query", "check", operation, startTime);
84424
85674
  }
84425
85675
  case "test": {
84426
85676
  const format = params?.format;
84427
85677
  if (format === "coverage") {
84428
- const result2 = validateTestCoverage(this.projectRoot);
85678
+ const result2 = validateTestCoverage(projectRoot);
84429
85679
  return wrapResult(result2, "query", "check", operation, startTime);
84430
85680
  }
84431
- const result = validateTestStatus(this.projectRoot);
85681
+ const result = validateTestStatus(projectRoot);
84432
85682
  return wrapResult(result, "query", "check", operation, startTime);
84433
85683
  }
84434
85684
  case "coherence": {
84435
- const result = await validateCoherenceCheck(this.projectRoot);
85685
+ const result = await validateCoherenceCheck(projectRoot);
84436
85686
  return wrapResult(result, "query", "check", operation, startTime);
84437
85687
  }
84438
85688
  case "protocol": {
@@ -84451,12 +85701,12 @@ var CheckHandler = class {
84451
85701
  ...protocolParams,
84452
85702
  votingMatrixFile: params?.votingMatrixFile
84453
85703
  },
84454
- this.projectRoot
85704
+ projectRoot
84455
85705
  );
84456
85706
  return wrapResult(result, "query", "check", operation, startTime);
84457
85707
  }
84458
85708
  case "contribution": {
84459
- const result = await validateProtocolContribution(protocolParams, this.projectRoot);
85709
+ const result = await validateProtocolContribution(protocolParams, projectRoot);
84460
85710
  return wrapResult(result, "query", "check", operation, startTime);
84461
85711
  }
84462
85712
  case "decomposition": {
@@ -84465,12 +85715,12 @@ var CheckHandler = class {
84465
85715
  ...protocolParams,
84466
85716
  epicId: params?.epicId
84467
85717
  },
84468
- this.projectRoot
85718
+ projectRoot
84469
85719
  );
84470
85720
  return wrapResult(result, "query", "check", operation, startTime);
84471
85721
  }
84472
85722
  case "implementation": {
84473
- const result = await validateProtocolImplementation(protocolParams, this.projectRoot);
85723
+ const result = await validateProtocolImplementation(protocolParams, projectRoot);
84474
85724
  return wrapResult(result, "query", "check", operation, startTime);
84475
85725
  }
84476
85726
  case "specification": {
@@ -84479,7 +85729,7 @@ var CheckHandler = class {
84479
85729
  ...protocolParams,
84480
85730
  specFile: params?.specFile
84481
85731
  },
84482
- this.projectRoot
85732
+ projectRoot
84483
85733
  );
84484
85734
  return wrapResult(result, "query", "check", operation, startTime);
84485
85735
  }
@@ -84495,7 +85745,7 @@ var CheckHandler = class {
84495
85745
  startTime
84496
85746
  );
84497
85747
  }
84498
- const result = await validateProtocol(taskId, protocolType, this.projectRoot);
85748
+ const result = await validateProtocol(taskId, protocolType, projectRoot);
84499
85749
  return wrapResult(result, "query", "check", operation, startTime);
84500
85750
  }
84501
85751
  }
@@ -84512,11 +85762,11 @@ var CheckHandler = class {
84512
85762
  startTime
84513
85763
  );
84514
85764
  }
84515
- const result = await validateGateVerify({ taskId }, this.projectRoot);
85765
+ const result = await validateGateVerify({ taskId }, projectRoot);
84516
85766
  return wrapResult(result, "query", "check", operation, startTime);
84517
85767
  }
84518
85768
  case "archive.stats": {
84519
- const result = await systemArchiveStats(this.projectRoot);
85769
+ const result = await systemArchiveStats(projectRoot);
84520
85770
  return wrapResult(result, "query", "check", operation, startTime);
84521
85771
  }
84522
85772
  // T5405: WarpChain validation
@@ -84555,7 +85805,7 @@ var CheckHandler = class {
84555
85805
  startTime
84556
85806
  );
84557
85807
  }
84558
- const gradeResult = await gradeSession2(sessionId, this.projectRoot);
85808
+ const gradeResult = await gradeSession2(sessionId, projectRoot);
84559
85809
  return wrapResult(
84560
85810
  { success: true, data: gradeResult },
84561
85811
  "query",
@@ -84568,7 +85818,7 @@ var CheckHandler = class {
84568
85818
  const { readGrades: readGrades2 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
84569
85819
  const limit = typeof params?.limit === "number" ? params.limit : void 0;
84570
85820
  const offset = typeof params?.offset === "number" ? params.offset : void 0;
84571
- const allGrades = await readGrades2(void 0, this.projectRoot);
85821
+ const allGrades = await readGrades2(void 0, projectRoot);
84572
85822
  const sessionId = params?.sessionId;
84573
85823
  const filteredGrades = sessionId ? allGrades.filter((g) => g.sessionId === sessionId) : allGrades;
84574
85824
  const page = paginate(filteredGrades, limit, offset);
@@ -84599,6 +85849,7 @@ var CheckHandler = class {
84599
85849
  // Mutate
84600
85850
  // -----------------------------------------------------------------------
84601
85851
  async mutate(operation, params) {
85852
+ const projectRoot = getProjectRoot();
84602
85853
  const startTime = Date.now();
84603
85854
  try {
84604
85855
  switch (operation) {
@@ -84620,14 +85871,14 @@ var CheckHandler = class {
84620
85871
  result,
84621
85872
  params?.protocol,
84622
85873
  params?.violations,
84623
- this.projectRoot
85874
+ projectRoot
84624
85875
  );
84625
85876
  return wrapResult(engineResult, "mutate", "check", operation, startTime);
84626
85877
  }
84627
85878
  case "test.run": {
84628
85879
  const result = validateTestRun(
84629
85880
  params,
84630
- this.projectRoot
85881
+ projectRoot
84631
85882
  );
84632
85883
  return wrapResult(result, "mutate", "check", operation, startTime);
84633
85884
  }
@@ -84635,7 +85886,7 @@ var CheckHandler = class {
84635
85886
  const { syncComplianceMetrics: syncComplianceMetrics2 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
84636
85887
  const result = await syncComplianceMetrics2({
84637
85888
  force: params?.force,
84638
- cwd: this.projectRoot
85889
+ cwd: projectRoot
84639
85890
  });
84640
85891
  return {
84641
85892
  _meta: dispatchMeta("mutate", "check", operation, startTime),
@@ -84663,7 +85914,7 @@ var CheckHandler = class {
84663
85914
  all: params?.all,
84664
85915
  reset: params?.reset
84665
85916
  };
84666
- const result = await validateGateVerify(gateParams, this.projectRoot);
85917
+ const result = await validateGateVerify(gateParams, projectRoot);
84667
85918
  return wrapResult(result, "mutate", "check", operation, startTime);
84668
85919
  }
84669
85920
  default:
@@ -84706,14 +85957,11 @@ var CheckHandler = class {
84706
85957
  // packages/cleo/src/dispatch/domains/memory.ts
84707
85958
  init_src2();
84708
85959
  var MemoryHandler = class {
84709
- projectRoot;
84710
- constructor() {
84711
- this.projectRoot = getProjectRoot();
84712
- }
84713
85960
  // -----------------------------------------------------------------------
84714
85961
  // Query
84715
85962
  // -----------------------------------------------------------------------
84716
85963
  async query(operation, params) {
85964
+ const projectRoot = getProjectRoot();
84717
85965
  const startTime = Date.now();
84718
85966
  try {
84719
85967
  switch (operation) {
@@ -84737,7 +85985,7 @@ var MemoryHandler = class {
84737
85985
  dateStart: params?.dateStart,
84738
85986
  dateEnd: params?.dateEnd
84739
85987
  },
84740
- this.projectRoot
85988
+ projectRoot
84741
85989
  );
84742
85990
  return wrapResult(result, "query", "memory", operation, startTime);
84743
85991
  }
@@ -84759,7 +86007,7 @@ var MemoryHandler = class {
84759
86007
  depthBefore: params?.depthBefore,
84760
86008
  depthAfter: params?.depthAfter
84761
86009
  },
84762
- this.projectRoot
86010
+ projectRoot
84763
86011
  );
84764
86012
  return wrapResult(result, "query", "memory", operation, startTime);
84765
86013
  }
@@ -84775,7 +86023,7 @@ var MemoryHandler = class {
84775
86023
  startTime
84776
86024
  );
84777
86025
  }
84778
- const result = await memoryFetch({ ids }, this.projectRoot);
86026
+ const result = await memoryFetch({ ids }, projectRoot);
84779
86027
  return wrapResult(result, "query", "memory", operation, startTime);
84780
86028
  }
84781
86029
  case "decision.find": {
@@ -84785,7 +86033,7 @@ var MemoryHandler = class {
84785
86033
  taskId: params?.taskId,
84786
86034
  limit: params?.limit
84787
86035
  },
84788
- this.projectRoot
86036
+ projectRoot
84789
86037
  );
84790
86038
  return wrapResult(result, "query", "memory", operation, startTime);
84791
86039
  }
@@ -84798,7 +86046,7 @@ var MemoryHandler = class {
84798
86046
  minFrequency: params?.minFrequency,
84799
86047
  limit: params?.limit
84800
86048
  },
84801
- this.projectRoot
86049
+ projectRoot
84802
86050
  );
84803
86051
  return wrapResult(result, "query", "memory", operation, startTime);
84804
86052
  }
@@ -84811,7 +86059,7 @@ var MemoryHandler = class {
84811
86059
  applicableType: params?.applicableType,
84812
86060
  limit: params?.limit
84813
86061
  },
84814
- this.projectRoot
86062
+ projectRoot
84815
86063
  );
84816
86064
  return wrapResult(result, "query", "memory", operation, startTime);
84817
86065
  }
@@ -84827,7 +86075,7 @@ var MemoryHandler = class {
84827
86075
  startTime
84828
86076
  );
84829
86077
  }
84830
- const result = await memoryGraphShow({ nodeId }, this.projectRoot);
86078
+ const result = await memoryGraphShow({ nodeId }, projectRoot);
84831
86079
  return wrapResult(result, "query", "memory", operation, startTime);
84832
86080
  }
84833
86081
  case "graph.neighbors": {
@@ -84844,7 +86092,7 @@ var MemoryHandler = class {
84844
86092
  }
84845
86093
  const result = await memoryGraphNeighbors(
84846
86094
  { nodeId, edgeType: params?.edgeType },
84847
- this.projectRoot
86095
+ projectRoot
84848
86096
  );
84849
86097
  return wrapResult(result, "query", "memory", operation, startTime);
84850
86098
  }
@@ -84860,7 +86108,7 @@ var MemoryHandler = class {
84860
86108
  startTime
84861
86109
  );
84862
86110
  }
84863
- const result = await memoryReasonWhy({ taskId }, this.projectRoot);
86111
+ const result = await memoryReasonWhy({ taskId }, projectRoot);
84864
86112
  return wrapResult(result, "query", "memory", operation, startTime);
84865
86113
  }
84866
86114
  case "reason.similar": {
@@ -84877,7 +86125,7 @@ var MemoryHandler = class {
84877
86125
  }
84878
86126
  const result = await memoryReasonSimilar(
84879
86127
  { entryId, limit: params?.limit },
84880
- this.projectRoot
86128
+ projectRoot
84881
86129
  );
84882
86130
  return wrapResult(result, "query", "memory", operation, startTime);
84883
86131
  }
@@ -84901,7 +86149,7 @@ var MemoryHandler = class {
84901
86149
  graphWeight: params?.graphWeight,
84902
86150
  limit: params?.limit
84903
86151
  },
84904
- this.projectRoot
86152
+ projectRoot
84905
86153
  );
84906
86154
  return wrapResult(result, "query", "memory", operation, startTime);
84907
86155
  }
@@ -84921,6 +86169,7 @@ var MemoryHandler = class {
84921
86169
  // Mutate
84922
86170
  // -----------------------------------------------------------------------
84923
86171
  async mutate(operation, params) {
86172
+ const projectRoot = getProjectRoot();
84924
86173
  const startTime = Date.now();
84925
86174
  try {
84926
86175
  switch (operation) {
@@ -84945,7 +86194,7 @@ var MemoryHandler = class {
84945
86194
  sourceSessionId: params?.sourceSessionId,
84946
86195
  sourceType: params?.sourceType
84947
86196
  },
84948
- this.projectRoot
86197
+ projectRoot
84949
86198
  );
84950
86199
  return wrapResult(result, "mutate", "memory", operation, startTime);
84951
86200
  }
@@ -84970,7 +86219,7 @@ var MemoryHandler = class {
84970
86219
  taskId: params?.taskId,
84971
86220
  sessionId: params?.sessionId
84972
86221
  },
84973
- this.projectRoot
86222
+ projectRoot
84974
86223
  );
84975
86224
  return wrapResult(result, "mutate", "memory", operation, startTime);
84976
86225
  }
@@ -84998,7 +86247,7 @@ var MemoryHandler = class {
84998
86247
  examples: params?.examples,
84999
86248
  successRate: params?.successRate
85000
86249
  },
85001
- this.projectRoot
86250
+ projectRoot
85002
86251
  );
85003
86252
  return wrapResult(result, "mutate", "memory", operation, startTime);
85004
86253
  }
@@ -85024,7 +86273,7 @@ var MemoryHandler = class {
85024
86273
  application: params?.application,
85025
86274
  applicableTypes: params?.applicableTypes
85026
86275
  },
85027
- this.projectRoot
86276
+ projectRoot
85028
86277
  );
85029
86278
  return wrapResult(result, "mutate", "memory", operation, startTime);
85030
86279
  }
@@ -85041,7 +86290,7 @@ var MemoryHandler = class {
85041
86290
  startTime
85042
86291
  );
85043
86292
  }
85044
- const result = await memoryLink({ taskId, entryId }, this.projectRoot);
86293
+ const result = await memoryLink({ taskId, entryId }, projectRoot);
85045
86294
  return wrapResult(result, "mutate", "memory", operation, startTime);
85046
86295
  }
85047
86296
  case "graph.add": {
@@ -85056,7 +86305,7 @@ var MemoryHandler = class {
85056
86305
  edgeType: params?.edgeType,
85057
86306
  weight: params?.weight
85058
86307
  },
85059
- this.projectRoot
86308
+ projectRoot
85060
86309
  );
85061
86310
  return wrapResult(result, "mutate", "memory", operation, startTime);
85062
86311
  }
@@ -85068,7 +86317,7 @@ var MemoryHandler = class {
85068
86317
  toId: params?.toId,
85069
86318
  edgeType: params?.edgeType
85070
86319
  },
85071
- this.projectRoot
86320
+ projectRoot
85072
86321
  );
85073
86322
  return wrapResult(result, "mutate", "memory", operation, startTime);
85074
86323
  }
@@ -85357,14 +86606,11 @@ async function nexusTransferExecute(params) {
85357
86606
 
85358
86607
  // packages/cleo/src/dispatch/domains/nexus.ts
85359
86608
  var NexusHandler = class {
85360
- projectRoot;
85361
- constructor() {
85362
- this.projectRoot = getProjectRoot();
85363
- }
85364
86609
  // -----------------------------------------------------------------------
85365
86610
  // Query
85366
86611
  // -----------------------------------------------------------------------
85367
86612
  async query(operation, params) {
86613
+ const projectRoot = getProjectRoot();
85368
86614
  const startTime = Date.now();
85369
86615
  try {
85370
86616
  switch (operation) {
@@ -85512,7 +86758,7 @@ var NexusHandler = class {
85512
86758
  return wrapResult(result, "query", "nexus", operation, startTime);
85513
86759
  }
85514
86760
  case "share.status": {
85515
- const result = await nexusShareStatus(this.projectRoot);
86761
+ const result = await nexusShareStatus(projectRoot);
85516
86762
  return wrapResult(result, "query", "nexus", "share.status", startTime);
85517
86763
  }
85518
86764
  case "transfer.preview": {
@@ -85553,6 +86799,7 @@ var NexusHandler = class {
85553
86799
  // Mutate
85554
86800
  // -----------------------------------------------------------------------
85555
86801
  async mutate(operation, params) {
86802
+ const projectRoot = getProjectRoot();
85556
86803
  const startTime = Date.now();
85557
86804
  try {
85558
86805
  switch (operation) {
@@ -85636,13 +86883,13 @@ var NexusHandler = class {
85636
86883
  return wrapResult(result, "mutate", "nexus", operation, startTime);
85637
86884
  }
85638
86885
  case "reconcile": {
85639
- const projectRoot = params?.projectRoot || process.cwd();
85640
- const result = await nexusReconcileProject(projectRoot);
86886
+ const projectRoot2 = params?.projectRoot || process.cwd();
86887
+ const result = await nexusReconcileProject(projectRoot2);
85641
86888
  return wrapResult(result, "mutate", "nexus", operation, startTime);
85642
86889
  }
85643
86890
  case "share.snapshot.export": {
85644
86891
  const outputPath = params?.outputPath;
85645
- const result = await nexusShareSnapshotExport(this.projectRoot, outputPath);
86892
+ const result = await nexusShareSnapshotExport(projectRoot, outputPath);
85646
86893
  return wrapResult(result, "mutate", "nexus", "share.snapshot.export", startTime);
85647
86894
  }
85648
86895
  case "share.snapshot.import": {
@@ -85657,7 +86904,7 @@ var NexusHandler = class {
85657
86904
  startTime
85658
86905
  );
85659
86906
  }
85660
- const result = await nexusShareSnapshotImport(this.projectRoot, inputPath);
86907
+ const result = await nexusShareSnapshotImport(projectRoot, inputPath);
85661
86908
  return wrapResult(result, "mutate", "nexus", "share.snapshot.import", startTime);
85662
86909
  }
85663
86910
  case "transfer": {
@@ -85734,20 +86981,17 @@ var NexusHandler = class {
85734
86981
  // packages/cleo/src/dispatch/domains/orchestrate.ts
85735
86982
  init_internal();
85736
86983
  var OrchestrateHandler = class {
85737
- projectRoot;
85738
- constructor() {
85739
- this.projectRoot = getProjectRoot();
85740
- }
85741
86984
  // -----------------------------------------------------------------------
85742
86985
  // DomainHandler interface
85743
86986
  // -----------------------------------------------------------------------
85744
86987
  async query(operation, params) {
86988
+ const projectRoot = getProjectRoot();
85745
86989
  const startTime = Date.now();
85746
86990
  try {
85747
86991
  switch (operation) {
85748
86992
  case "status": {
85749
86993
  const epicId = params?.epicId;
85750
- const result = await orchestrateStatus(epicId, this.projectRoot);
86994
+ const result = await orchestrateStatus(epicId, projectRoot);
85751
86995
  return wrapResult(result, "query", "orchestrate", operation, startTime);
85752
86996
  }
85753
86997
  case "next": {
@@ -85762,7 +87006,7 @@ var OrchestrateHandler = class {
85762
87006
  startTime
85763
87007
  );
85764
87008
  }
85765
- const result = await orchestrateNext(epicId, this.projectRoot);
87009
+ const result = await orchestrateNext(epicId, projectRoot);
85766
87010
  return wrapResult(result, "query", "orchestrate", operation, startTime);
85767
87011
  }
85768
87012
  case "ready": {
@@ -85777,18 +87021,18 @@ var OrchestrateHandler = class {
85777
87021
  startTime
85778
87022
  );
85779
87023
  }
85780
- const result = await orchestrateReady(epicId, this.projectRoot);
87024
+ const result = await orchestrateReady(epicId, projectRoot);
85781
87025
  return wrapResult(result, "query", "orchestrate", operation, startTime);
85782
87026
  }
85783
87027
  case "analyze": {
85784
87028
  const epicId = params?.epicId;
85785
87029
  const mode = params?.mode;
85786
- const result = await orchestrateAnalyze(epicId, this.projectRoot, mode);
87030
+ const result = await orchestrateAnalyze(epicId, projectRoot, mode);
85787
87031
  return wrapResult(result, "query", "orchestrate", "analyze", startTime);
85788
87032
  }
85789
87033
  case "context": {
85790
87034
  const epicId = params?.epicId;
85791
- const result = await orchestrateContext(epicId, this.projectRoot);
87035
+ const result = await orchestrateContext(epicId, projectRoot);
85792
87036
  return wrapResult(result, "query", "orchestrate", operation, startTime);
85793
87037
  }
85794
87038
  case "waves": {
@@ -85803,16 +87047,16 @@ var OrchestrateHandler = class {
85803
87047
  startTime
85804
87048
  );
85805
87049
  }
85806
- const result = await orchestrateWaves(epicId, this.projectRoot);
87050
+ const result = await orchestrateWaves(epicId, projectRoot);
85807
87051
  return wrapResult(result, "query", "orchestrate", operation, startTime);
85808
87052
  }
85809
87053
  case "bootstrap": {
85810
87054
  const speed = params?.speed;
85811
- const result = await orchestrateBootstrap(this.projectRoot, { speed });
87055
+ const result = await orchestrateBootstrap(projectRoot, { speed });
85812
87056
  return wrapResult(result, "query", "orchestrate", operation, startTime);
85813
87057
  }
85814
87058
  case "unblock.opportunities": {
85815
- const result = await orchestrateUnblockOpportunities(this.projectRoot);
87059
+ const result = await orchestrateUnblockOpportunities(projectRoot);
85816
87060
  return wrapResult(result, "query", "orchestrate", operation, startTime);
85817
87061
  }
85818
87062
  case "tessera.list": {
@@ -85869,6 +87113,7 @@ var OrchestrateHandler = class {
85869
87113
  }
85870
87114
  }
85871
87115
  async mutate(operation, params) {
87116
+ const projectRoot = getProjectRoot();
85872
87117
  const startTime = Date.now();
85873
87118
  try {
85874
87119
  switch (operation) {
@@ -85884,7 +87129,7 @@ var OrchestrateHandler = class {
85884
87129
  startTime
85885
87130
  );
85886
87131
  }
85887
- const result = await orchestrateStartup(epicId, this.projectRoot);
87132
+ const result = await orchestrateStartup(epicId, projectRoot);
85888
87133
  return wrapResult(result, "mutate", "orchestrate", operation, startTime);
85889
87134
  }
85890
87135
  case "spawn": {
@@ -85901,7 +87146,7 @@ var OrchestrateHandler = class {
85901
87146
  }
85902
87147
  const protocolType = params?.protocolType;
85903
87148
  const tier = params?.tier;
85904
- const result = await orchestrateSpawn(taskId, protocolType, this.projectRoot, tier);
87149
+ const result = await orchestrateSpawn(taskId, protocolType, projectRoot, tier);
85905
87150
  return wrapResult(result, "mutate", "orchestrate", operation, startTime);
85906
87151
  }
85907
87152
  case "handoff": {
@@ -85938,7 +87183,7 @@ var OrchestrateHandler = class {
85938
87183
  tier,
85939
87184
  idempotencyKey: params?.idempotencyKey
85940
87185
  },
85941
- this.projectRoot
87186
+ projectRoot
85942
87187
  );
85943
87188
  return wrapResult(result, "mutate", "orchestrate", operation, startTime);
85944
87189
  }
@@ -85961,7 +87206,7 @@ var OrchestrateHandler = class {
85961
87206
  taskId,
85962
87207
  adapterId,
85963
87208
  protocolType,
85964
- this.projectRoot,
87209
+ projectRoot,
85965
87210
  tier
85966
87211
  );
85967
87212
  return wrapResult(result, "mutate", "orchestrate", operation, startTime);
@@ -85978,7 +87223,7 @@ var OrchestrateHandler = class {
85978
87223
  startTime
85979
87224
  );
85980
87225
  }
85981
- const result = await orchestrateValidate(taskId, this.projectRoot);
87226
+ const result = await orchestrateValidate(taskId, projectRoot);
85982
87227
  return wrapResult(result, "mutate", "orchestrate", operation, startTime);
85983
87228
  }
85984
87229
  case "parallel": {
@@ -86006,7 +87251,7 @@ var OrchestrateHandler = class {
86006
87251
  startTime
86007
87252
  );
86008
87253
  }
86009
- const result = await orchestrateParallelStart(epicId, wave, this.projectRoot);
87254
+ const result = await orchestrateParallelStart(epicId, wave, projectRoot);
86010
87255
  return wrapResult(result, "mutate", "orchestrate", "parallel", startTime);
86011
87256
  },
86012
87257
  end: async () => {
@@ -86032,7 +87277,7 @@ var OrchestrateHandler = class {
86032
87277
  startTime
86033
87278
  );
86034
87279
  }
86035
- const result = await orchestrateParallelEnd(epicId, wave, this.projectRoot);
87280
+ const result = await orchestrateParallelEnd(epicId, wave, projectRoot);
86036
87281
  return wrapResult(result, "mutate", "orchestrate", "parallel", startTime);
86037
87282
  }
86038
87283
  });
@@ -86075,7 +87320,7 @@ var OrchestrateHandler = class {
86075
87320
  const instance = await instantiateTessera(
86076
87321
  template,
86077
87322
  { templateId, epicId, variables: { epicId, ...variables } },
86078
- this.projectRoot
87323
+ projectRoot
86079
87324
  );
86080
87325
  return {
86081
87326
  _meta: dispatchMeta("mutate", "orchestrate", operation, startTime),
@@ -86131,9 +87376,8 @@ var OrchestrateHandler = class {
86131
87376
  init_internal();
86132
87377
  import { execFileSync as execFileSync13 } from "node:child_process";
86133
87378
  var PipelineHandler = class {
86134
- projectRoot;
86135
- constructor() {
86136
- this.projectRoot = getProjectRoot();
87379
+ get projectRoot() {
87380
+ return getProjectRoot();
86137
87381
  }
86138
87382
  // -----------------------------------------------------------------------
86139
87383
  // DomainHandler interface
@@ -87006,24 +88250,21 @@ function unbindSession() {
87006
88250
 
87007
88251
  // packages/cleo/src/dispatch/domains/session.ts
87008
88252
  var SessionHandler = class {
87009
- projectRoot;
87010
- constructor() {
87011
- this.projectRoot = getProjectRoot();
87012
- }
87013
88253
  // -----------------------------------------------------------------------
87014
88254
  // Query
87015
88255
  // -----------------------------------------------------------------------
87016
88256
  async query(operation, params) {
88257
+ const projectRoot = getProjectRoot();
87017
88258
  const startTime = Date.now();
87018
88259
  try {
87019
88260
  switch (operation) {
87020
88261
  case "status": {
87021
- const result = await sessionStatus2(this.projectRoot);
88262
+ const result = await sessionStatus2(projectRoot);
87022
88263
  return wrapResult(result, "query", "session", operation, startTime);
87023
88264
  }
87024
88265
  case "list": {
87025
88266
  const result = await sessionList(
87026
- this.projectRoot,
88267
+ projectRoot,
87027
88268
  params
87028
88269
  );
87029
88270
  return wrapResult(result, "query", "session", operation, startTime);
@@ -87043,24 +88284,21 @@ var SessionHandler = class {
87043
88284
  }
87044
88285
  const include = params?.include;
87045
88286
  if (include === "debrief") {
87046
- const result2 = await sessionDebriefShow(this.projectRoot, sessionId);
88287
+ const result2 = await sessionDebriefShow(projectRoot, sessionId);
87047
88288
  return wrapResult(result2, "query", "session", operation, startTime);
87048
88289
  }
87049
- const result = await sessionShow(this.projectRoot, sessionId);
88290
+ const result = await sessionShow(projectRoot, sessionId);
87050
88291
  return wrapResult(result, "query", "session", operation, startTime);
87051
88292
  }
87052
88293
  case "decision.log": {
87053
88294
  const result = await sessionDecisionLog(
87054
- this.projectRoot,
88295
+ projectRoot,
87055
88296
  params
87056
88297
  );
87057
88298
  return wrapResult(result, "query", "session", operation, startTime);
87058
88299
  }
87059
88300
  case "context.drift": {
87060
- const result = await sessionContextDrift(
87061
- this.projectRoot,
87062
- params
87063
- );
88301
+ const result = await sessionContextDrift(projectRoot, params);
87064
88302
  return wrapResult(result, "query", "session", operation, startTime);
87065
88303
  }
87066
88304
  case "handoff.show": {
@@ -87073,11 +88311,11 @@ var SessionHandler = class {
87073
88311
  scopeFilter = { type: "epic", epicId: scope.replace("epic:", "") };
87074
88312
  }
87075
88313
  }
87076
- const result = await sessionHandoff(this.projectRoot, scopeFilter);
88314
+ const result = await sessionHandoff(projectRoot, scopeFilter);
87077
88315
  return wrapResult(result, "query", "session", operation, startTime);
87078
88316
  }
87079
88317
  case "briefing.show": {
87080
- const result = await sessionBriefing(this.projectRoot, {
88318
+ const result = await sessionBriefing(projectRoot, {
87081
88319
  maxNextTasks: params?.maxNextTasks,
87082
88320
  maxBugs: params?.maxBugs,
87083
88321
  maxBlocked: params?.maxBlocked,
@@ -87088,7 +88326,7 @@ var SessionHandler = class {
87088
88326
  }
87089
88327
  case "find": {
87090
88328
  const result = await sessionFind(
87091
- this.projectRoot,
88329
+ projectRoot,
87092
88330
  params
87093
88331
  );
87094
88332
  return wrapResult(result, "query", "session", operation, startTime);
@@ -87108,6 +88346,7 @@ var SessionHandler = class {
87108
88346
  // Mutate
87109
88347
  // -----------------------------------------------------------------------
87110
88348
  async mutate(operation, params) {
88349
+ const projectRoot = getProjectRoot();
87111
88350
  const startTime = Date.now();
87112
88351
  try {
87113
88352
  switch (operation) {
@@ -87123,7 +88362,7 @@ var SessionHandler = class {
87123
88362
  startTime
87124
88363
  );
87125
88364
  }
87126
- const result = await sessionStart(this.projectRoot, {
88365
+ const result = await sessionStart(projectRoot, {
87127
88366
  scope,
87128
88367
  name: params?.name,
87129
88368
  autoStart: params?.autoStart,
@@ -87154,19 +88393,19 @@ var SessionHandler = class {
87154
88393
  return wrapResult(result, "mutate", "session", operation, startTime);
87155
88394
  }
87156
88395
  case "end": {
87157
- const endResult = await sessionEnd(this.projectRoot, params?.note);
88396
+ const endResult = await sessionEnd(projectRoot, params?.note);
87158
88397
  if (endResult.success && endResult.data) {
87159
88398
  const sessionId = endResult.data.sessionId;
87160
88399
  if (sessionId) {
87161
88400
  let debriefResult = null;
87162
88401
  try {
87163
- debriefResult = await sessionComputeDebrief(this.projectRoot, sessionId, {
88402
+ debriefResult = await sessionComputeDebrief(projectRoot, sessionId, {
87164
88403
  note: params?.note,
87165
88404
  nextAction: params?.nextAction
87166
88405
  });
87167
88406
  } catch {
87168
88407
  try {
87169
- await sessionComputeHandoff(this.projectRoot, sessionId, {
88408
+ await sessionComputeHandoff(projectRoot, sessionId, {
87170
88409
  note: params?.note,
87171
88410
  nextAction: params?.nextAction
87172
88411
  });
@@ -87176,7 +88415,7 @@ var SessionHandler = class {
87176
88415
  if (debriefResult?.success && debriefResult.data) {
87177
88416
  try {
87178
88417
  const { persistSessionMemory: persistSessionMemory2 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
87179
- await persistSessionMemory2(this.projectRoot, sessionId, debriefResult.data);
88418
+ await persistSessionMemory2(projectRoot, sessionId, debriefResult.data);
87180
88419
  } catch {
87181
88420
  }
87182
88421
  }
@@ -87197,7 +88436,7 @@ var SessionHandler = class {
87197
88436
  startTime
87198
88437
  );
87199
88438
  }
87200
- const result = await sessionResume(this.projectRoot, sessionId);
88439
+ const result = await sessionResume(projectRoot, sessionId);
87201
88440
  return wrapResult(result, "mutate", "session", operation, startTime);
87202
88441
  }
87203
88442
  case "suspend": {
@@ -87213,21 +88452,18 @@ var SessionHandler = class {
87213
88452
  );
87214
88453
  }
87215
88454
  const result = await sessionSuspend(
87216
- this.projectRoot,
88455
+ projectRoot,
87217
88456
  sessionId,
87218
88457
  params?.reason
87219
88458
  );
87220
88459
  return wrapResult(result, "mutate", "session", operation, startTime);
87221
88460
  }
87222
88461
  case "gc": {
87223
- const result = await sessionGc(
87224
- this.projectRoot,
87225
- params?.maxAgeDays
87226
- );
88462
+ const result = await sessionGc(projectRoot, params?.maxAgeDays);
87227
88463
  return wrapResult(result, "mutate", "session", operation, startTime);
87228
88464
  }
87229
88465
  case "record.decision": {
87230
- const result = await sessionRecordDecision(this.projectRoot, {
88466
+ const result = await sessionRecordDecision(projectRoot, {
87231
88467
  sessionId: params?.sessionId,
87232
88468
  taskId: params?.taskId,
87233
88469
  decision: params?.decision,
@@ -87237,7 +88473,7 @@ var SessionHandler = class {
87237
88473
  return wrapResult(result, "mutate", "session", operation, startTime);
87238
88474
  }
87239
88475
  case "record.assumption": {
87240
- const result = await sessionRecordAssumption(this.projectRoot, {
88476
+ const result = await sessionRecordAssumption(projectRoot, {
87241
88477
  sessionId: params?.sessionId,
87242
88478
  taskId: params?.taskId,
87243
88479
  assumption: params?.assumption,
@@ -87378,14 +88614,11 @@ async function stickyPurge(projectRoot, id) {
87378
88614
 
87379
88615
  // packages/cleo/src/dispatch/domains/sticky.ts
87380
88616
  var StickyHandler = class {
87381
- projectRoot;
87382
- constructor() {
87383
- this.projectRoot = getProjectRoot();
87384
- }
87385
88617
  // -----------------------------------------------------------------------
87386
88618
  // Query
87387
88619
  // -----------------------------------------------------------------------
87388
88620
  async query(operation, params) {
88621
+ const projectRoot = getProjectRoot();
87389
88622
  const startTime = Date.now();
87390
88623
  try {
87391
88624
  switch (operation) {
@@ -87395,13 +88628,13 @@ var StickyHandler = class {
87395
88628
  color: params?.color,
87396
88629
  priority: params?.priority
87397
88630
  };
87398
- const result = await stickyList(this.projectRoot, filters);
88631
+ const result = await stickyList(projectRoot, filters);
87399
88632
  if (!result.success) {
87400
88633
  return wrapResult(result, "query", "sticky", operation, startTime);
87401
88634
  }
87402
88635
  const filteredStickies = result.data?.stickies ?? [];
87403
88636
  const hasFilter = filters.status !== void 0 || filters.color !== void 0 || filters.priority !== void 0;
87404
- const totalResult = hasFilter ? await stickyList(this.projectRoot, {}) : result;
88637
+ const totalResult = hasFilter ? await stickyList(projectRoot, {}) : result;
87405
88638
  if (!totalResult.success) {
87406
88639
  return wrapResult(totalResult, "query", "sticky", operation, startTime);
87407
88640
  }
@@ -87431,7 +88664,7 @@ var StickyHandler = class {
87431
88664
  startTime
87432
88665
  );
87433
88666
  }
87434
- const result = await stickyShow(this.projectRoot, stickyId);
88667
+ const result = await stickyShow(projectRoot, stickyId);
87435
88668
  return wrapResult(result, "query", "sticky", operation, startTime);
87436
88669
  }
87437
88670
  default:
@@ -87450,6 +88683,7 @@ var StickyHandler = class {
87450
88683
  // Mutate
87451
88684
  // -----------------------------------------------------------------------
87452
88685
  async mutate(operation, params) {
88686
+ const projectRoot = getProjectRoot();
87453
88687
  const startTime = Date.now();
87454
88688
  try {
87455
88689
  switch (operation) {
@@ -87465,7 +88699,7 @@ var StickyHandler = class {
87465
88699
  startTime
87466
88700
  );
87467
88701
  }
87468
- const result = await stickyAdd(this.projectRoot, {
88702
+ const result = await stickyAdd(projectRoot, {
87469
88703
  content,
87470
88704
  tags: params?.tags,
87471
88705
  color: params?.color,
@@ -87498,7 +88732,7 @@ var StickyHandler = class {
87498
88732
  }
87499
88733
  if (targetType === "task") {
87500
88734
  const result = await stickyConvertToTask(
87501
- this.projectRoot,
88735
+ projectRoot,
87502
88736
  stickyId,
87503
88737
  params?.title
87504
88738
  );
@@ -87515,18 +88749,18 @@ var StickyHandler = class {
87515
88749
  startTime
87516
88750
  );
87517
88751
  }
87518
- const result = await stickyConvertToTaskNote(this.projectRoot, stickyId, taskId);
88752
+ const result = await stickyConvertToTaskNote(projectRoot, stickyId, taskId);
87519
88753
  return wrapResult(result, "mutate", "sticky", operation, startTime);
87520
88754
  } else if (targetType === "session_note") {
87521
88755
  const result = await stickyConvertToSessionNote(
87522
- this.projectRoot,
88756
+ projectRoot,
87523
88757
  stickyId,
87524
88758
  params?.sessionId
87525
88759
  );
87526
88760
  return wrapResult(result, "mutate", "sticky", operation, startTime);
87527
88761
  } else {
87528
88762
  const result = await stickyConvertToMemory(
87529
- this.projectRoot,
88763
+ projectRoot,
87530
88764
  stickyId,
87531
88765
  params?.memoryType
87532
88766
  );
@@ -87545,7 +88779,7 @@ var StickyHandler = class {
87545
88779
  startTime
87546
88780
  );
87547
88781
  }
87548
- const result = await stickyArchive(this.projectRoot, stickyId);
88782
+ const result = await stickyArchive(projectRoot, stickyId);
87549
88783
  return wrapResult(result, "mutate", "sticky", operation, startTime);
87550
88784
  }
87551
88785
  case "purge": {
@@ -87560,7 +88794,7 @@ var StickyHandler = class {
87560
88794
  startTime
87561
88795
  );
87562
88796
  }
87563
- const result = await stickyPurge(this.projectRoot, stickyId);
88797
+ const result = await stickyPurge(projectRoot, stickyId);
87564
88798
  return wrapResult(result, "mutate", "sticky", operation, startTime);
87565
88799
  }
87566
88800
  default:
@@ -87589,23 +88823,20 @@ var StickyHandler = class {
87589
88823
  // packages/cleo/src/dispatch/domains/tasks.ts
87590
88824
  init_src2();
87591
88825
  var TasksHandler = class {
87592
- projectRoot;
87593
- constructor() {
87594
- this.projectRoot = getProjectRoot();
87595
- }
87596
88826
  // -----------------------------------------------------------------------
87597
88827
  // Query
87598
88828
  // -----------------------------------------------------------------------
87599
88829
  async query(operation, params) {
88830
+ const projectRoot = getProjectRoot();
87600
88831
  const startTime = Date.now();
87601
88832
  try {
87602
88833
  switch (operation) {
87603
88834
  case "show": {
87604
- const result = await taskShow(this.projectRoot, params.taskId);
88835
+ const result = await taskShow(projectRoot, params.taskId);
87605
88836
  return wrapResult(result, "query", "tasks", operation, startTime);
87606
88837
  }
87607
88838
  case "list": {
87608
- const result = await taskList(this.projectRoot, {
88839
+ const result = await taskList(projectRoot, {
87609
88840
  parent: params?.parent,
87610
88841
  status: params?.status,
87611
88842
  priority: params?.priority,
@@ -87621,7 +88852,7 @@ var TasksHandler = class {
87621
88852
  }
87622
88853
  case "find": {
87623
88854
  const result = await taskFind(
87624
- this.projectRoot,
88855
+ projectRoot,
87625
88856
  params?.query,
87626
88857
  params?.limit,
87627
88858
  {
@@ -87636,12 +88867,12 @@ var TasksHandler = class {
87636
88867
  }
87637
88868
  case "tree": {
87638
88869
  const taskId = params?.taskId;
87639
- const result = await taskTree(this.projectRoot, taskId);
88870
+ const result = await taskTree(projectRoot, taskId);
87640
88871
  return wrapResult(result, "query", "tasks", operation, startTime);
87641
88872
  }
87642
88873
  case "blockers": {
87643
88874
  const result = await taskBlockers(
87644
- this.projectRoot,
88875
+ projectRoot,
87645
88876
  params
87646
88877
  );
87647
88878
  return wrapResult(result, "query", "tasks", operation, startTime);
@@ -87649,11 +88880,11 @@ var TasksHandler = class {
87649
88880
  case "depends": {
87650
88881
  const action = params?.action;
87651
88882
  if (action === "overview") {
87652
- const result2 = await taskDepsOverview(this.projectRoot);
88883
+ const result2 = await taskDepsOverview(projectRoot);
87653
88884
  return wrapResult(result2, "query", "tasks", operation, startTime);
87654
88885
  }
87655
88886
  if (action === "cycles") {
87656
- const result2 = await taskDepsCycles(this.projectRoot);
88887
+ const result2 = await taskDepsCycles(projectRoot);
87657
88888
  return wrapResult(result2, "query", "tasks", operation, startTime);
87658
88889
  }
87659
88890
  const taskId = params?.taskId;
@@ -87669,64 +88900,64 @@ var TasksHandler = class {
87669
88900
  }
87670
88901
  const direction = params?.direction;
87671
88902
  const tree = params?.tree;
87672
- const result = await taskDepends(this.projectRoot, taskId, direction, tree);
88903
+ const result = await taskDepends(projectRoot, taskId, direction, tree);
87673
88904
  return wrapResult(result, "query", "tasks", operation, startTime);
87674
88905
  }
87675
88906
  case "analyze": {
87676
88907
  const taskId = params?.taskId;
87677
88908
  const tierLimit = params?.tierLimit;
87678
- const result = await taskAnalyze(this.projectRoot, taskId, { tierLimit });
88909
+ const result = await taskAnalyze(projectRoot, taskId, { tierLimit });
87679
88910
  return wrapResult(result, "query", "tasks", operation, startTime);
87680
88911
  }
87681
88912
  case "next": {
87682
88913
  const result = await taskNext(
87683
- this.projectRoot,
88914
+ projectRoot,
87684
88915
  params
87685
88916
  );
87686
88917
  return wrapResult(result, "query", "tasks", operation, startTime);
87687
88918
  }
87688
88919
  case "plan": {
87689
- const result = await taskPlan(this.projectRoot);
88920
+ const result = await taskPlan(projectRoot);
87690
88921
  return wrapResult(result, "query", "tasks", operation, startTime);
87691
88922
  }
87692
88923
  case "relates": {
87693
88924
  const taskId = params.taskId;
87694
88925
  if (params?.mode) {
87695
- const result2 = await taskRelatesFind(this.projectRoot, taskId, {
88926
+ const result2 = await taskRelatesFind(projectRoot, taskId, {
87696
88927
  mode: params.mode,
87697
88928
  threshold: params?.threshold ? Number(params.threshold) : void 0
87698
88929
  });
87699
88930
  return wrapResult(result2, "query", "tasks", operation, startTime);
87700
88931
  }
87701
- const result = await taskRelates(this.projectRoot, taskId);
88932
+ const result = await taskRelates(projectRoot, taskId);
87702
88933
  return wrapResult(result, "query", "tasks", operation, startTime);
87703
88934
  }
87704
88935
  case "complexity.estimate": {
87705
- const result = await taskComplexityEstimate(this.projectRoot, {
88936
+ const result = await taskComplexityEstimate(projectRoot, {
87706
88937
  taskId: params.taskId
87707
88938
  });
87708
88939
  return wrapResult(result, "query", "tasks", operation, startTime);
87709
88940
  }
87710
88941
  case "current": {
87711
- const result = await taskCurrentGet(this.projectRoot);
88942
+ const result = await taskCurrentGet(projectRoot);
87712
88943
  return wrapResult(result, "query", "tasks", operation, startTime);
87713
88944
  }
87714
88945
  case "history": {
87715
88946
  const taskId = params?.taskId;
87716
88947
  if (taskId) {
87717
- const result2 = await taskHistory(this.projectRoot, taskId, params?.limit);
88948
+ const result2 = await taskHistory(projectRoot, taskId, params?.limit);
87718
88949
  return wrapResult(result2, "query", "tasks", operation, startTime);
87719
88950
  }
87720
- const result = await taskWorkHistory2(this.projectRoot);
88951
+ const result = await taskWorkHistory2(projectRoot);
87721
88952
  return wrapResult(result, "query", "tasks", operation, startTime);
87722
88953
  }
87723
88954
  case "label.list": {
87724
- const result = await taskLabelList(this.projectRoot);
88955
+ const result = await taskLabelList(projectRoot);
87725
88956
  return wrapResult(result, "query", "tasks", operation, startTime);
87726
88957
  }
87727
88958
  case "sync.links": {
87728
88959
  const result = await taskSyncLinks(
87729
- this.projectRoot,
88960
+ projectRoot,
87730
88961
  params
87731
88962
  );
87732
88963
  return wrapResult(result, "query", "tasks", operation, startTime);
@@ -87746,11 +88977,12 @@ var TasksHandler = class {
87746
88977
  // Mutate
87747
88978
  // -----------------------------------------------------------------------
87748
88979
  async mutate(operation, params) {
88980
+ const projectRoot = getProjectRoot();
87749
88981
  const startTime = Date.now();
87750
88982
  try {
87751
88983
  switch (operation) {
87752
88984
  case "add": {
87753
- const result = await taskCreate(this.projectRoot, {
88985
+ const result = await taskCreate(projectRoot, {
87754
88986
  title: params.title,
87755
88987
  description: params?.description ?? params.title,
87756
88988
  parent: params?.parent ?? params?.parentId,
@@ -87762,7 +88994,7 @@ var TasksHandler = class {
87762
88994
  return wrapResult(result, "mutate", "tasks", operation, startTime);
87763
88995
  }
87764
88996
  case "update": {
87765
- const result = await taskUpdate(this.projectRoot, params.taskId, {
88997
+ const result = await taskUpdate(projectRoot, params.taskId, {
87766
88998
  title: params?.title,
87767
88999
  description: params?.description,
87768
89000
  status: params?.status,
@@ -87783,7 +89015,7 @@ var TasksHandler = class {
87783
89015
  }
87784
89016
  case "complete": {
87785
89017
  const result = await taskComplete(
87786
- this.projectRoot,
89018
+ projectRoot,
87787
89019
  params.taskId,
87788
89020
  params?.notes
87789
89021
  );
@@ -87791,7 +89023,7 @@ var TasksHandler = class {
87791
89023
  }
87792
89024
  case "delete": {
87793
89025
  const result = await taskDelete(
87794
- this.projectRoot,
89026
+ projectRoot,
87795
89027
  params.taskId,
87796
89028
  params?.force
87797
89029
  );
@@ -87799,7 +89031,7 @@ var TasksHandler = class {
87799
89031
  }
87800
89032
  case "archive": {
87801
89033
  const result = await taskArchive(
87802
- this.projectRoot,
89034
+ projectRoot,
87803
89035
  params?.taskId,
87804
89036
  params?.before
87805
89037
  );
@@ -87809,20 +89041,20 @@ var TasksHandler = class {
87809
89041
  const taskId = params.taskId;
87810
89042
  const from = params?.from;
87811
89043
  if (from === "done") {
87812
- const result2 = await taskReopen(this.projectRoot, taskId, {
89044
+ const result2 = await taskReopen(projectRoot, taskId, {
87813
89045
  status: params?.status,
87814
89046
  reason: params?.reason
87815
89047
  });
87816
89048
  return wrapResult(result2, "mutate", "tasks", operation, startTime);
87817
89049
  }
87818
89050
  if (from === "archived") {
87819
- const result2 = await taskUnarchive(this.projectRoot, taskId, {
89051
+ const result2 = await taskUnarchive(projectRoot, taskId, {
87820
89052
  status: params?.status,
87821
89053
  preserveStatus: params?.preserveStatus
87822
89054
  });
87823
89055
  return wrapResult(result2, "mutate", "tasks", operation, startTime);
87824
89056
  }
87825
- const result = await taskRestore(this.projectRoot, taskId, {
89057
+ const result = await taskRestore(projectRoot, taskId, {
87826
89058
  cascade: params?.cascade,
87827
89059
  notes: params?.notes
87828
89060
  });
@@ -87830,7 +89062,7 @@ var TasksHandler = class {
87830
89062
  }
87831
89063
  case "cancel": {
87832
89064
  const result = await taskCancel(
87833
- this.projectRoot,
89065
+ projectRoot,
87834
89066
  params.taskId,
87835
89067
  params?.reason
87836
89068
  );
@@ -87838,7 +89070,7 @@ var TasksHandler = class {
87838
89070
  }
87839
89071
  case "reparent": {
87840
89072
  const result = await taskReparent(
87841
- this.projectRoot,
89073
+ projectRoot,
87842
89074
  params.taskId,
87843
89075
  params?.newParentId ?? null
87844
89076
  );
@@ -87846,7 +89078,7 @@ var TasksHandler = class {
87846
89078
  }
87847
89079
  case "reorder": {
87848
89080
  const result = await taskReorder(
87849
- this.projectRoot,
89081
+ projectRoot,
87850
89082
  params.taskId,
87851
89083
  params.position
87852
89084
  );
@@ -87865,7 +89097,7 @@ var TasksHandler = class {
87865
89097
  );
87866
89098
  }
87867
89099
  const result = await taskRelatesAdd(
87868
- this.projectRoot,
89100
+ projectRoot,
87869
89101
  params.taskId,
87870
89102
  relatedId,
87871
89103
  params.type,
@@ -87874,15 +89106,15 @@ var TasksHandler = class {
87874
89106
  return wrapResult(result, "mutate", "tasks", operation, startTime);
87875
89107
  }
87876
89108
  case "start": {
87877
- const result = await taskStart(this.projectRoot, params.taskId);
89109
+ const result = await taskStart(projectRoot, params.taskId);
87878
89110
  return wrapResult(result, "mutate", "tasks", operation, startTime);
87879
89111
  }
87880
89112
  case "stop": {
87881
- const result = await taskStop(this.projectRoot);
89113
+ const result = await taskStop(projectRoot);
87882
89114
  return wrapResult(result, "mutate", "tasks", operation, startTime);
87883
89115
  }
87884
89116
  case "sync.reconcile": {
87885
- const result = await taskSyncReconcile(this.projectRoot, {
89117
+ const result = await taskSyncReconcile(projectRoot, {
87886
89118
  providerId: params.providerId,
87887
89119
  externalTasks: params.externalTasks,
87888
89120
  dryRun: params?.dryRun,
@@ -87893,7 +89125,7 @@ var TasksHandler = class {
87893
89125
  return wrapResult(result, "mutate", "tasks", operation, startTime);
87894
89126
  }
87895
89127
  case "sync.links.remove": {
87896
- const result = await taskSyncLinksRemove(this.projectRoot, params.providerId);
89128
+ const result = await taskSyncLinksRemove(projectRoot, params.providerId);
87897
89129
  return wrapResult(result, "mutate", "tasks", operation, startTime);
87898
89130
  }
87899
89131
  default:
@@ -87964,7 +89196,7 @@ import {
87964
89196
  discoverSkill as discoverSkill2,
87965
89197
  discoverSkills,
87966
89198
  getAllProviders as getAllProviders2,
87967
- getCanonicalSkillsDir as getCanonicalSkillsDir3,
89199
+ getCanonicalSkillsDir as getCanonicalSkillsDir4,
87968
89200
  getInstalledProviders as getInstalledProviders3,
87969
89201
  getTrackedSkills,
87970
89202
  injectAll as injectAll2,
@@ -87981,7 +89213,7 @@ function toolsIssueDiagnostics() {
87981
89213
  }
87982
89214
  async function toolsSkillList(limit, offset) {
87983
89215
  try {
87984
- const skills = await discoverSkills(getCanonicalSkillsDir3());
89216
+ const skills = await discoverSkills(getCanonicalSkillsDir4());
87985
89217
  const page = paginate(skills, limit, offset);
87986
89218
  return {
87987
89219
  success: true,
@@ -88000,7 +89232,7 @@ async function toolsSkillList(limit, offset) {
88000
89232
  }
88001
89233
  async function toolsSkillShow(name2) {
88002
89234
  try {
88003
- const skill = await discoverSkill2(`${getCanonicalSkillsDir3()}/${name2}`);
89235
+ const skill = await discoverSkill2(`${getCanonicalSkillsDir4()}/${name2}`);
88004
89236
  if (!skill) {
88005
89237
  return engineError("E_NOT_FOUND", `Skill not found: ${name2}`);
88006
89238
  }
@@ -88012,7 +89244,7 @@ async function toolsSkillShow(name2) {
88012
89244
  async function toolsSkillFind(query) {
88013
89245
  try {
88014
89246
  const q = (query ?? "").toLowerCase();
88015
- const skills = await discoverSkills(getCanonicalSkillsDir3());
89247
+ const skills = await discoverSkills(getCanonicalSkillsDir4());
88016
89248
  const filtered = q ? skills.filter(
88017
89249
  (s) => s.name.toLowerCase().includes(q) || s.metadata.description.toLowerCase().includes(q)
88018
89250
  ) : skills;
@@ -88036,13 +89268,13 @@ function toolsSkillDispatch(name2) {
88036
89268
  }
88037
89269
  async function toolsSkillVerify(name2) {
88038
89270
  try {
88039
- const installed = await discoverSkill2(`${getCanonicalSkillsDir3()}/${name2}`);
89271
+ const installed = await discoverSkill2(`${getCanonicalSkillsDir4()}/${name2}`);
88040
89272
  const catalogEntry = catalog3.getSkill(name2);
88041
89273
  return engineSuccess({
88042
89274
  skill: name2,
88043
89275
  installed: !!installed,
88044
89276
  inCatalog: !!catalogEntry,
88045
- installPath: installed ? `${getCanonicalSkillsDir3()}/${name2}` : null
89277
+ installPath: installed ? `${getCanonicalSkillsDir4()}/${name2}` : null
88046
89278
  });
88047
89279
  } catch (error40) {
88048
89280
  return engineError("E_INTERNAL", error40 instanceof Error ? error40.message : String(error40));
@@ -88447,9 +89679,8 @@ async function toolsAdapterDispose(projectRoot, id) {
88447
89679
 
88448
89680
  // packages/cleo/src/dispatch/domains/tools.ts
88449
89681
  var ToolsHandler = class {
88450
- projectRoot;
88451
- constructor() {
88452
- this.projectRoot = getProjectRoot();
89682
+ get projectRoot() {
89683
+ return getProjectRoot();
88453
89684
  }
88454
89685
  // -----------------------------------------------------------------------
88455
89686
  // DomainHandler interface
@@ -91144,8 +92375,8 @@ function getEnabledPlatforms(cwd) {
91144
92375
  return [];
91145
92376
  }
91146
92377
  }
91147
- function getDefaultOutputPath(platform3) {
91148
- switch (platform3) {
92378
+ function getDefaultOutputPath(platform5) {
92379
+ switch (platform5) {
91149
92380
  case "mintlify":
91150
92381
  return "docs/changelog/overview.mdx";
91151
92382
  case "docusaurus":
@@ -91167,8 +92398,8 @@ function getGitHubRepoSlug(cwd) {
91167
92398
  return "";
91168
92399
  }
91169
92400
  }
91170
- function generateForPlatform(platform3, sourceContent, repoSlug, limit) {
91171
- switch (platform3) {
92401
+ function generateForPlatform(platform5, sourceContent, repoSlug, limit) {
92402
+ switch (platform5) {
91172
92403
  case "mintlify":
91173
92404
  return generateMintlify(sourceContent, repoSlug, limit);
91174
92405
  case "docusaurus":
@@ -94635,11 +95866,11 @@ function registerWebCommand(program) {
94635
95866
  );
94636
95867
  }
94637
95868
  const url2 = status.url;
94638
- const platform3 = process.platform;
95869
+ const platform5 = process.platform;
94639
95870
  try {
94640
- if (platform3 === "linux") {
95871
+ if (platform5 === "linux") {
94641
95872
  spawn2("xdg-open", [url2], { detached: true, stdio: "ignore" }).unref();
94642
- } else if (platform3 === "darwin") {
95873
+ } else if (platform5 === "darwin") {
94643
95874
  spawn2("open", [url2], { detached: true, stdio: "ignore" }).unref();
94644
95875
  }
94645
95876
  } catch {