nexus-agents 8.126.3 → 8.126.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist/{ast-rule-runner-QH55AOYW.js → ast-rule-runner-SMIJDVR5.js} +4 -3
  2. package/dist/{child-mcp-config-7OS34LIX.js → child-mcp-config-GAHKV6IM.js} +3 -2
  3. package/dist/{child-mcp-config-7OS34LIX.js.map → child-mcp-config-GAHKV6IM.js.map} +1 -1
  4. package/dist/{chunk-X52J2EI3.js → chunk-3CFROGBP.js} +80 -107
  5. package/dist/chunk-3CFROGBP.js.map +1 -0
  6. package/dist/{chunk-7ETWTSTB.js → chunk-3UWT434E.js} +4 -3
  7. package/dist/chunk-3UWT434E.js.map +1 -0
  8. package/dist/{chunk-GKNT3TPN.js → chunk-3ZWQJBH7.js} +568 -464
  9. package/dist/chunk-3ZWQJBH7.js.map +1 -0
  10. package/dist/{chunk-RBZ23TGL.js → chunk-43YEAMED.js} +12 -12
  11. package/dist/{chunk-H2EUKN6W.js → chunk-4N3XAYN7.js} +11 -11
  12. package/dist/{chunk-EC7UBSAY.js → chunk-4X5EZH4H.js} +2 -2
  13. package/dist/{chunk-NC5GV7EC.js → chunk-5NFCIY5V.js} +3 -3
  14. package/dist/{chunk-FKXV6BST.js → chunk-5WSMU5OA.js} +4 -4
  15. package/dist/{chunk-XKWRAEIM.js → chunk-6PPS7JPU.js} +2 -2
  16. package/dist/{chunk-5HNVARQQ.js → chunk-7DJXLOAJ.js} +3 -3
  17. package/dist/{chunk-6QI7J3I2.js → chunk-A3QBUBVT.js} +2 -2
  18. package/dist/{chunk-MGYECR4N.js → chunk-APTXCM3Z.js} +2 -2
  19. package/dist/{chunk-2R6E5HBT.js → chunk-FUPEQAFF.js} +2 -2
  20. package/dist/{chunk-FOYPZEKN.js → chunk-FZ443QJ5.js} +4 -4
  21. package/dist/{chunk-F5GNFGJA.js → chunk-HNJTJE6A.js} +5 -5
  22. package/dist/{chunk-BKEMABRA.js → chunk-I7URLQM7.js} +2 -2
  23. package/dist/{chunk-SFCIWJ4N.js → chunk-JD6CANNA.js} +6 -6
  24. package/dist/{chunk-Q2RC2IMA.js → chunk-JFNPXM6W.js} +3 -3
  25. package/dist/{chunk-XAXTHF4V.js → chunk-JPFZZ7WO.js} +3 -3
  26. package/dist/{chunk-JW7KFY6I.js → chunk-KA4MRN7D.js} +2 -2
  27. package/dist/{chunk-D4AOKDGO.js → chunk-KHSP7CNX.js} +3 -3
  28. package/dist/{chunk-NHHYFA64.js → chunk-KKXKB7TF.js} +2 -2
  29. package/dist/{chunk-DM4UXA47.js → chunk-LLUIP44A.js} +9 -9
  30. package/dist/{chunk-UOC22N3S.js → chunk-RG6DJ7FF.js} +7 -7
  31. package/dist/{chunk-LXGONOUN.js → chunk-RQ53DZD7.js} +2 -2
  32. package/dist/{chunk-XDTJIBXF.js → chunk-RUSE5YQQ.js} +5 -5
  33. package/dist/{chunk-6ZQBUCYL.js → chunk-SHB5EE6W.js} +2 -2
  34. package/dist/{chunk-2YPM5AH3.js → chunk-SWK3XQPX.js} +4 -4
  35. package/dist/{chunk-SVMK6IZX.js → chunk-SWTB5L34.js} +2 -2
  36. package/dist/{chunk-6IPZIHKS.js → chunk-TMVBH63B.js} +2 -2
  37. package/dist/{chunk-VOSNQ34O.js → chunk-TVODJINW.js} +5 -5
  38. package/dist/{chunk-ZPSOD4QH.js → chunk-V6YTNHPR.js} +2 -2
  39. package/dist/{chunk-DQIO22XS.js → chunk-VLN2HMXJ.js} +2 -2
  40. package/dist/chunk-XBEKMUTO.js +7 -0
  41. package/dist/chunk-XBEKMUTO.js.map +1 -0
  42. package/dist/{chunk-BECYVDRX.js → chunk-ZCAQSRG6.js} +5 -5
  43. package/dist/{chunk-I6F3Z7JZ.js → chunk-ZNH2YD5I.js} +2 -2
  44. package/dist/{chunk-3VV52CHG.js → chunk-ZREV5TPG.js} +2 -2
  45. package/dist/{cli-circuit-breaker-WG354QOG.js → cli-circuit-breaker-ZWQNP66S.js} +4 -3
  46. package/dist/cli.js +46 -45
  47. package/dist/cli.js.map +1 -1
  48. package/dist/{codebase-search-7YYPTFPL.js → codebase-search-VMKI7FW4.js} +3 -2
  49. package/dist/{composite-router-L2V6K2DE.js → composite-router-GQBZ5OE5.js} +3 -2
  50. package/dist/{consensus-vote-HWUNGKTW.js → consensus-vote-V56W3QW5.js} +18 -17
  51. package/dist/{context-retriever-B22QJPZD.js → context-retriever-AYCAY2U2.js} +9 -8
  52. package/dist/{doctor-deep-2RKNBHBP.js → doctor-deep-SGBCQ5QQ.js} +4 -3
  53. package/dist/doctor-gateway-report-QQHVAFOV.js +20 -0
  54. package/dist/{doctor-live-R2SF22A3.js → doctor-live-4E2IBXIW.js} +12 -11
  55. package/dist/{doctor-live-R2SF22A3.js.map → doctor-live-4E2IBXIW.js.map} +1 -1
  56. package/dist/{expert-bridge-HEN47NON.js → expert-bridge-6ICNND52.js} +5 -4
  57. package/dist/{factory-6EQIV2HF.js → factory-MBS6QSZM.js} +11 -10
  58. package/dist/{factory-XFIXK3N5.js → factory-P4NMFJF2.js} +6 -5
  59. package/dist/{improvement-review-NAZZOCV4.js → improvement-review-2OAD2GGI.js} +7 -6
  60. package/dist/index.d.ts +8 -3
  61. package/dist/index.js +34 -33
  62. package/dist/index.js.map +1 -1
  63. package/dist/{init-opencode-FTKLJVIO.js → init-opencode-UGOPJC5O.js} +7 -6
  64. package/dist/{init-opencode-FTKLJVIO.js.map → init-opencode-UGOPJC5O.js.map} +1 -1
  65. package/dist/{issue-triage-R523TPSU.js → issue-triage-GZHF4HGZ.js} +7 -6
  66. package/dist/{openai-compat-adapter-U4EOZYHJ.js → openai-compat-adapter-QXBN3VJU.js} +7 -6
  67. package/dist/{pr-reviewer-helpers-3C2SMJ25.js → pr-reviewer-helpers-QQYUN7YI.js} +5 -4
  68. package/dist/{registry-command-5W77CK3U.js → registry-command-KYOSY5YM.js} +3 -2
  69. package/dist/{registry-command-5W77CK3U.js.map → registry-command-KYOSY5YM.js.map} +1 -1
  70. package/dist/{repo-security-plan-UPWNMHDF.js → repo-security-plan-H4NMHMWD.js} +4 -3
  71. package/dist/{research-helpers-synthesize-SV22X3ZE.js → research-helpers-synthesize-ZCGNK2ZB.js} +5 -4
  72. package/dist/{routing-memory-M3O4WVIT.js → routing-memory-MZ4LIUQH.js} +3 -2
  73. package/dist/{session-memory-RWJV5SWQ.js → session-memory-H35YIL36.js} +4 -3
  74. package/dist/{setup-config-W4XXWTJY.js → setup-config-5AW6ILJA.js} +4 -3
  75. package/dist/{setup-custom-api-U35ZSHC4.js → setup-custom-api-BWO2M74I.js} +5 -4
  76. package/dist/{setup-custom-api-U35ZSHC4.js.map → setup-custom-api-BWO2M74I.js.map} +1 -1
  77. package/dist/setup-data-dir-S4HDN2CW.js +34 -0
  78. package/dist/{tool-memory-SIS3IBAF.js → tool-memory-KVGE3O4X.js} +6 -5
  79. package/dist/{unified-registry-WYEMU3ST.js → unified-registry-K47SJLY4.js} +12 -11
  80. package/dist/{weather-report-QYBKW7YM.js → weather-report-OJ6GGBXO.js} +3 -2
  81. package/package.json +1 -1
  82. package/dist/chunk-7ETWTSTB.js.map +0 -1
  83. package/dist/chunk-GKNT3TPN.js.map +0 -1
  84. package/dist/chunk-X52J2EI3.js.map +0 -1
  85. package/dist/doctor-gateway-report-FR6FXZVL.js +0 -19
  86. package/dist/setup-data-dir-KW7ZHLXH.js +0 -33
  87. /package/dist/{ast-rule-runner-QH55AOYW.js.map → ast-rule-runner-SMIJDVR5.js.map} +0 -0
  88. /package/dist/{chunk-RBZ23TGL.js.map → chunk-43YEAMED.js.map} +0 -0
  89. /package/dist/{chunk-H2EUKN6W.js.map → chunk-4N3XAYN7.js.map} +0 -0
  90. /package/dist/{chunk-EC7UBSAY.js.map → chunk-4X5EZH4H.js.map} +0 -0
  91. /package/dist/{chunk-NC5GV7EC.js.map → chunk-5NFCIY5V.js.map} +0 -0
  92. /package/dist/{chunk-FKXV6BST.js.map → chunk-5WSMU5OA.js.map} +0 -0
  93. /package/dist/{chunk-XKWRAEIM.js.map → chunk-6PPS7JPU.js.map} +0 -0
  94. /package/dist/{chunk-5HNVARQQ.js.map → chunk-7DJXLOAJ.js.map} +0 -0
  95. /package/dist/{chunk-6QI7J3I2.js.map → chunk-A3QBUBVT.js.map} +0 -0
  96. /package/dist/{chunk-MGYECR4N.js.map → chunk-APTXCM3Z.js.map} +0 -0
  97. /package/dist/{chunk-2R6E5HBT.js.map → chunk-FUPEQAFF.js.map} +0 -0
  98. /package/dist/{chunk-FOYPZEKN.js.map → chunk-FZ443QJ5.js.map} +0 -0
  99. /package/dist/{chunk-F5GNFGJA.js.map → chunk-HNJTJE6A.js.map} +0 -0
  100. /package/dist/{chunk-BKEMABRA.js.map → chunk-I7URLQM7.js.map} +0 -0
  101. /package/dist/{chunk-SFCIWJ4N.js.map → chunk-JD6CANNA.js.map} +0 -0
  102. /package/dist/{chunk-Q2RC2IMA.js.map → chunk-JFNPXM6W.js.map} +0 -0
  103. /package/dist/{chunk-XAXTHF4V.js.map → chunk-JPFZZ7WO.js.map} +0 -0
  104. /package/dist/{chunk-JW7KFY6I.js.map → chunk-KA4MRN7D.js.map} +0 -0
  105. /package/dist/{chunk-D4AOKDGO.js.map → chunk-KHSP7CNX.js.map} +0 -0
  106. /package/dist/{chunk-NHHYFA64.js.map → chunk-KKXKB7TF.js.map} +0 -0
  107. /package/dist/{chunk-DM4UXA47.js.map → chunk-LLUIP44A.js.map} +0 -0
  108. /package/dist/{chunk-UOC22N3S.js.map → chunk-RG6DJ7FF.js.map} +0 -0
  109. /package/dist/{chunk-LXGONOUN.js.map → chunk-RQ53DZD7.js.map} +0 -0
  110. /package/dist/{chunk-XDTJIBXF.js.map → chunk-RUSE5YQQ.js.map} +0 -0
  111. /package/dist/{chunk-6ZQBUCYL.js.map → chunk-SHB5EE6W.js.map} +0 -0
  112. /package/dist/{chunk-2YPM5AH3.js.map → chunk-SWK3XQPX.js.map} +0 -0
  113. /package/dist/{chunk-SVMK6IZX.js.map → chunk-SWTB5L34.js.map} +0 -0
  114. /package/dist/{chunk-6IPZIHKS.js.map → chunk-TMVBH63B.js.map} +0 -0
  115. /package/dist/{chunk-VOSNQ34O.js.map → chunk-TVODJINW.js.map} +0 -0
  116. /package/dist/{chunk-ZPSOD4QH.js.map → chunk-V6YTNHPR.js.map} +0 -0
  117. /package/dist/{chunk-DQIO22XS.js.map → chunk-VLN2HMXJ.js.map} +0 -0
  118. /package/dist/{chunk-BECYVDRX.js.map → chunk-ZCAQSRG6.js.map} +0 -0
  119. /package/dist/{chunk-I6F3Z7JZ.js.map → chunk-ZNH2YD5I.js.map} +0 -0
  120. /package/dist/{chunk-3VV52CHG.js.map → chunk-ZREV5TPG.js.map} +0 -0
  121. /package/dist/{cli-circuit-breaker-WG354QOG.js.map → cli-circuit-breaker-ZWQNP66S.js.map} +0 -0
  122. /package/dist/{codebase-search-7YYPTFPL.js.map → codebase-search-VMKI7FW4.js.map} +0 -0
  123. /package/dist/{composite-router-L2V6K2DE.js.map → composite-router-GQBZ5OE5.js.map} +0 -0
  124. /package/dist/{consensus-vote-HWUNGKTW.js.map → consensus-vote-V56W3QW5.js.map} +0 -0
  125. /package/dist/{context-retriever-B22QJPZD.js.map → context-retriever-AYCAY2U2.js.map} +0 -0
  126. /package/dist/{doctor-deep-2RKNBHBP.js.map → doctor-deep-SGBCQ5QQ.js.map} +0 -0
  127. /package/dist/{doctor-gateway-report-FR6FXZVL.js.map → doctor-gateway-report-QQHVAFOV.js.map} +0 -0
  128. /package/dist/{expert-bridge-HEN47NON.js.map → expert-bridge-6ICNND52.js.map} +0 -0
  129. /package/dist/{factory-6EQIV2HF.js.map → factory-MBS6QSZM.js.map} +0 -0
  130. /package/dist/{factory-XFIXK3N5.js.map → factory-P4NMFJF2.js.map} +0 -0
  131. /package/dist/{improvement-review-NAZZOCV4.js.map → improvement-review-2OAD2GGI.js.map} +0 -0
  132. /package/dist/{issue-triage-R523TPSU.js.map → issue-triage-GZHF4HGZ.js.map} +0 -0
  133. /package/dist/{openai-compat-adapter-U4EOZYHJ.js.map → openai-compat-adapter-QXBN3VJU.js.map} +0 -0
  134. /package/dist/{pr-reviewer-helpers-3C2SMJ25.js.map → pr-reviewer-helpers-QQYUN7YI.js.map} +0 -0
  135. /package/dist/{repo-security-plan-UPWNMHDF.js.map → repo-security-plan-H4NMHMWD.js.map} +0 -0
  136. /package/dist/{research-helpers-synthesize-SV22X3ZE.js.map → research-helpers-synthesize-ZCGNK2ZB.js.map} +0 -0
  137. /package/dist/{routing-memory-M3O4WVIT.js.map → routing-memory-MZ4LIUQH.js.map} +0 -0
  138. /package/dist/{session-memory-RWJV5SWQ.js.map → session-memory-H35YIL36.js.map} +0 -0
  139. /package/dist/{setup-config-W4XXWTJY.js.map → setup-config-5AW6ILJA.js.map} +0 -0
  140. /package/dist/{setup-data-dir-KW7ZHLXH.js.map → setup-data-dir-S4HDN2CW.js.map} +0 -0
  141. /package/dist/{tool-memory-SIS3IBAF.js.map → tool-memory-KVGE3O4X.js.map} +0 -0
  142. /package/dist/{unified-registry-WYEMU3ST.js.map → unified-registry-K47SJLY4.js.map} +0 -0
  143. /package/dist/{weather-report-QYBKW7YM.js.map → weather-report-OJ6GGBXO.js.map} +0 -0
@@ -9,8 +9,9 @@ import {
9
9
  getBuiltInAstRulesPath,
10
10
  loadRules,
11
11
  runAstQaRules
12
- } from "./chunk-XKWRAEIM.js";
13
- import "./chunk-GKNT3TPN.js";
12
+ } from "./chunk-6PPS7JPU.js";
13
+ import "./chunk-3ZWQJBH7.js";
14
+ import "./chunk-XBEKMUTO.js";
14
15
  import "./chunk-UE7A2XHM.js";
15
16
  import "./chunk-LWOX65CP.js";
16
17
  import "./chunk-PX6F3LHL.js";
@@ -26,4 +27,4 @@ export {
26
27
  loadRules,
27
28
  runAstQaRules
28
29
  };
29
- //# sourceMappingURL=ast-rule-runner-QH55AOYW.js.map
30
+ //# sourceMappingURL=ast-rule-runner-SMIJDVR5.js.map
@@ -3,7 +3,8 @@ import {
3
3
  } from "./chunk-OITVVSWO.js";
4
4
  import {
5
5
  createLogger
6
- } from "./chunk-GKNT3TPN.js";
6
+ } from "./chunk-3ZWQJBH7.js";
7
+ import "./chunk-XBEKMUTO.js";
7
8
  import "./chunk-UE7A2XHM.js";
8
9
  import "./chunk-LWOX65CP.js";
9
10
  import "./chunk-PX6F3LHL.js";
@@ -49,4 +50,4 @@ async function generateMcpConfig(options) {
49
50
  export {
50
51
  generateMcpConfig
51
52
  };
52
- //# sourceMappingURL=child-mcp-config-7OS34LIX.js.map
53
+ //# sourceMappingURL=child-mcp-config-GAHKV6IM.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/cli-adapters/child-mcp-config.ts"],"sourcesContent":["/**\n * nexus-agents/cli-adapters - Child CLI MCP Config Generator\n *\n * Generates MCP server configuration for child Claude CLI sessions so\n * spawned agents can call back into nexus-agents' MCP tools (memory,\n * research, etc.). Used by `pipeline/expert-bridge.ts` to give expert\n * agents tool access. Originally lived under `swe-bench/` (#1413);\n * relocated here in #2515 — the helper is generic CLI-spawn\n * infrastructure, not benchmark-specific.\n *\n * The generated config grants NO tool approvals. It only tells the child\n * where the nexus-agents MCP server is; whether an expert may actually call\n * one of its tools follows the host's Claude permission settings (for\n * example `defaultMode`). Measured 2026-09-24: in auto mode the calls run,\n * in default mode they are refused (#6784). An unused `allowedTools` list\n * that read like a guard but was never passed to the CLI was removed then.\n *\n * @module cli-adapters/child-mcp-config\n */\n\nimport { writeFile, rm } from 'node:fs/promises';\nimport { nexusMkdtemp } from '../config/nexus-tmp-dir.js';\nimport { join } from 'node:path';\nimport { createLogger } from '../core/index.js';\n\nconst logger = createLogger({ component: 'swe-bench-mcp-config' });\n\n/**\n * MCP server entry in Claude CLI config format.\n */\ninterface McpServerEntry {\n readonly command: string;\n readonly args: readonly string[];\n readonly env?: Readonly<Record<string, string>>;\n}\n\n/**\n * MCP config file format for Claude CLI (--mcp-config).\n */\ninterface McpConfigFile {\n readonly mcpServers: Readonly<Record<string, McpServerEntry>>;\n}\n\n/**\n * Options for generating MCP config.\n */\nexport interface McpConfigOptions {\n /** Path to nexus-agents CLI entry point. */\n readonly cliPath?: string;\n /** Additional environment variables for the MCP server. */\n readonly env?: Readonly<Record<string, string>>;\n}\n\n/**\n * Resolves the nexus-agents CLI path.\n * Uses the built dist/cli.js relative to this package.\n */\nfunction resolveCliPath(override?: string): string {\n if (override !== undefined) return override;\n // Resolve relative to this file: src/swe-bench/ → dist/cli.js\n // At runtime we're in dist/swe-bench/, so go up one level\n const distDir = join(__dirname, '..');\n return join(distDir, 'cli.js');\n}\n\n/**\n * Env marker naming a child server (#6795). The child's stdio caller is an\n * expert CLI driven by a model, not the operator, so the child must not\n * measure it at tier 1; `connectTransport` reads this and records the caller\n * as unmeasured.\n */\nconst MCP_CHILD_ENV = 'NEXUS_MCP_CHILD';\n\n/**\n * Builds the MCP config object for a nexus-agents server.\n */\nfunction buildConfig(options?: McpConfigOptions): McpConfigFile {\n const cliPath = resolveCliPath(options?.cliPath);\n\n const entry: McpServerEntry = {\n command: 'node',\n args: [cliPath, '--mode=server'],\n // The child marker is applied LAST so caller-supplied env cannot unset it.\n env: { ...options?.env, [MCP_CHILD_ENV]: '1' },\n };\n\n return {\n mcpServers: {\n 'nexus-agents': entry,\n },\n };\n}\n\n/**\n * Generated MCP config with path and cleanup function.\n */\nexport interface GeneratedMcpConfig {\n /** Path to the generated config file. */\n readonly configPath: string;\n /** Cleanup function to remove temp files. */\n readonly cleanup: () => Promise<void>;\n}\n\n/**\n * Generates an MCP config file for Claude CLI child sessions.\n *\n * Creates a temporary JSON file that can be passed to `claude --mcp-config`.\n * Returns the file path and a cleanup function.\n */\nexport async function generateMcpConfig(options?: McpConfigOptions): Promise<GeneratedMcpConfig> {\n const config = buildConfig(options);\n\n const tempDir = await nexusMkdtemp('nexus-mcp-');\n const configPath = join(tempDir, 'mcp-config.json');\n\n await writeFile(configPath, JSON.stringify(config, null, 2), 'utf-8');\n\n const cleanup = async (): Promise<void> => {\n await rm(tempDir, { recursive: true, force: true }).catch((e: unknown) => {\n logger.debug('Best-effort cleanup failed', {\n error: e instanceof Error ? e.message : String(e),\n });\n });\n };\n\n return { configPath, cleanup };\n}\n"],"mappings":";;;;;;;;;;;AAoBA,SAAS,WAAW,UAAU;AAE9B,SAAS,YAAY;AAGrB,IAAM,SAAS,aAAa,EAAE,WAAW,uBAAuB,CAAC;AAgCjE,SAAS,eAAe,UAA2B;AACjD,MAAI,aAAa,OAAW,QAAO;AAGnC,QAAM,UAAU,KAAK,WAAW,IAAI;AACpC,SAAO,KAAK,SAAS,QAAQ;AAC/B;AAQA,IAAM,gBAAgB;AAKtB,SAAS,YAAY,SAA2C;AAC9D,QAAM,UAAU,eAAe,SAAS,OAAO;AAE/C,QAAM,QAAwB;AAAA,IAC5B,SAAS;AAAA,IACT,MAAM,CAAC,SAAS,eAAe;AAAA;AAAA,IAE/B,KAAK,EAAE,GAAG,SAAS,KAAK,CAAC,aAAa,GAAG,IAAI;AAAA,EAC/C;AAEA,SAAO;AAAA,IACL,YAAY;AAAA,MACV,gBAAgB;AAAA,IAClB;AAAA,EACF;AACF;AAkBA,eAAsB,kBAAkB,SAAyD;AAC/F,QAAM,SAAS,YAAY,OAAO;AAElC,QAAM,UAAU,MAAM,aAAa,YAAY;AAC/C,QAAM,aAAa,KAAK,SAAS,iBAAiB;AAElD,QAAM,UAAU,YAAY,KAAK,UAAU,QAAQ,MAAM,CAAC,GAAG,OAAO;AAEpE,QAAM,UAAU,YAA2B;AACzC,UAAM,GAAG,SAAS,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC,EAAE,MAAM,CAAC,MAAe;AACxE,aAAO,MAAM,8BAA8B;AAAA,QACzC,OAAO,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;AAAA,MAClD,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAEA,SAAO,EAAE,YAAY,QAAQ;AAC/B;","names":[]}
1
+ {"version":3,"sources":["../src/cli-adapters/child-mcp-config.ts"],"sourcesContent":["/**\n * nexus-agents/cli-adapters - Child CLI MCP Config Generator\n *\n * Generates MCP server configuration for child Claude CLI sessions so\n * spawned agents can call back into nexus-agents' MCP tools (memory,\n * research, etc.). Used by `pipeline/expert-bridge.ts` to give expert\n * agents tool access. Originally lived under `swe-bench/` (#1413);\n * relocated here in #2515 — the helper is generic CLI-spawn\n * infrastructure, not benchmark-specific.\n *\n * The generated config grants NO tool approvals. It only tells the child\n * where the nexus-agents MCP server is; whether an expert may actually call\n * one of its tools follows the host's Claude permission settings (for\n * example `defaultMode`). Measured 2026-09-24: in auto mode the calls run,\n * in default mode they are refused (#6784). An unused `allowedTools` list\n * that read like a guard but was never passed to the CLI was removed then.\n *\n * @module cli-adapters/child-mcp-config\n */\n\nimport { writeFile, rm } from 'node:fs/promises';\nimport { nexusMkdtemp } from '../config/nexus-tmp-dir.js';\nimport { join } from 'node:path';\nimport { createLogger } from '../core/index.js';\n\nconst logger = createLogger({ component: 'swe-bench-mcp-config' });\n\n/**\n * MCP server entry in Claude CLI config format.\n */\ninterface McpServerEntry {\n readonly command: string;\n readonly args: readonly string[];\n readonly env?: Readonly<Record<string, string>>;\n}\n\n/**\n * MCP config file format for Claude CLI (--mcp-config).\n */\ninterface McpConfigFile {\n readonly mcpServers: Readonly<Record<string, McpServerEntry>>;\n}\n\n/**\n * Options for generating MCP config.\n */\nexport interface McpConfigOptions {\n /** Path to nexus-agents CLI entry point. */\n readonly cliPath?: string;\n /** Additional environment variables for the MCP server. */\n readonly env?: Readonly<Record<string, string>>;\n}\n\n/**\n * Resolves the nexus-agents CLI path.\n * Uses the built dist/cli.js relative to this package.\n */\nfunction resolveCliPath(override?: string): string {\n if (override !== undefined) return override;\n // Resolve relative to this file: src/swe-bench/ → dist/cli.js\n // At runtime we're in dist/swe-bench/, so go up one level\n const distDir = join(__dirname, '..');\n return join(distDir, 'cli.js');\n}\n\n/**\n * Env marker naming a child server (#6795). The child's stdio caller is an\n * expert CLI driven by a model, not the operator, so the child must not\n * measure it at tier 1; `connectTransport` reads this and records the caller\n * as unmeasured.\n */\nconst MCP_CHILD_ENV = 'NEXUS_MCP_CHILD';\n\n/**\n * Builds the MCP config object for a nexus-agents server.\n */\nfunction buildConfig(options?: McpConfigOptions): McpConfigFile {\n const cliPath = resolveCliPath(options?.cliPath);\n\n const entry: McpServerEntry = {\n command: 'node',\n args: [cliPath, '--mode=server'],\n // The child marker is applied LAST so caller-supplied env cannot unset it.\n env: { ...options?.env, [MCP_CHILD_ENV]: '1' },\n };\n\n return {\n mcpServers: {\n 'nexus-agents': entry,\n },\n };\n}\n\n/**\n * Generated MCP config with path and cleanup function.\n */\nexport interface GeneratedMcpConfig {\n /** Path to the generated config file. */\n readonly configPath: string;\n /** Cleanup function to remove temp files. */\n readonly cleanup: () => Promise<void>;\n}\n\n/**\n * Generates an MCP config file for Claude CLI child sessions.\n *\n * Creates a temporary JSON file that can be passed to `claude --mcp-config`.\n * Returns the file path and a cleanup function.\n */\nexport async function generateMcpConfig(options?: McpConfigOptions): Promise<GeneratedMcpConfig> {\n const config = buildConfig(options);\n\n const tempDir = await nexusMkdtemp('nexus-mcp-');\n const configPath = join(tempDir, 'mcp-config.json');\n\n await writeFile(configPath, JSON.stringify(config, null, 2), 'utf-8');\n\n const cleanup = async (): Promise<void> => {\n await rm(tempDir, { recursive: true, force: true }).catch((e: unknown) => {\n logger.debug('Best-effort cleanup failed', {\n error: e instanceof Error ? e.message : String(e),\n });\n });\n };\n\n return { configPath, cleanup };\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,SAAS,WAAW,UAAU;AAE9B,SAAS,YAAY;AAGrB,IAAM,SAAS,aAAa,EAAE,WAAW,uBAAuB,CAAC;AAgCjE,SAAS,eAAe,UAA2B;AACjD,MAAI,aAAa,OAAW,QAAO;AAGnC,QAAM,UAAU,KAAK,WAAW,IAAI;AACpC,SAAO,KAAK,SAAS,QAAQ;AAC/B;AAQA,IAAM,gBAAgB;AAKtB,SAAS,YAAY,SAA2C;AAC9D,QAAM,UAAU,eAAe,SAAS,OAAO;AAE/C,QAAM,QAAwB;AAAA,IAC5B,SAAS;AAAA,IACT,MAAM,CAAC,SAAS,eAAe;AAAA;AAAA,IAE/B,KAAK,EAAE,GAAG,SAAS,KAAK,CAAC,aAAa,GAAG,IAAI;AAAA,EAC/C;AAEA,SAAO;AAAA,IACL,YAAY;AAAA,MACV,gBAAgB;AAAA,IAClB;AAAA,EACF;AACF;AAkBA,eAAsB,kBAAkB,SAAyD;AAC/F,QAAM,SAAS,YAAY,OAAO;AAElC,QAAM,UAAU,MAAM,aAAa,YAAY;AAC/C,QAAM,aAAa,KAAK,SAAS,iBAAiB;AAElD,QAAM,UAAU,YAAY,KAAK,UAAU,QAAQ,MAAM,CAAC,GAAG,OAAO;AAEpE,QAAM,UAAU,YAA2B;AACzC,UAAM,GAAG,SAAS,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC,EAAE,MAAM,CAAC,MAAe;AACxE,aAAO,MAAM,8BAA8B;AAAA,QACzC,OAAO,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;AAAA,MAClD,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAEA,SAAO,EAAE,YAAY,QAAQ;AAC/B;","names":[]}
@@ -6,13 +6,13 @@ import {
6
6
  createGraphAuditBridge,
7
7
  emitPipelinePolicyEvent,
8
8
  readActionRefusal
9
- } from "./chunk-F5GNFGJA.js";
9
+ } from "./chunk-HNJTJE6A.js";
10
10
  import {
11
11
  withPrerequisite
12
- } from "./chunk-NC5GV7EC.js";
12
+ } from "./chunk-5NFCIY5V.js";
13
13
  import {
14
14
  generateSecurityPlan
15
- } from "./chunk-BKEMABRA.js";
15
+ } from "./chunk-I7URLQM7.js";
16
16
  import {
17
17
  analyzeGitHubRepo
18
18
  } from "./chunk-4GDMHCKX.js";
@@ -20,11 +20,10 @@ import {
20
20
  CodebaseIndex,
21
21
  DEFAULT_INDEX_MAX_DEPTH,
22
22
  MAX_INDEX_MAX_DEPTH,
23
- SUPPORTED_EXTENSIONS,
24
23
  extractSymbolIndexResult,
25
24
  extractSymbols,
26
25
  findSourceFiles
27
- } from "./chunk-7ETWTSTB.js";
26
+ } from "./chunk-3UWT434E.js";
28
27
  import {
29
28
  FINDING_SEVERITY_LEVELS,
30
29
  SARIF_LEVEL_MAP,
@@ -32,7 +31,7 @@ import {
32
31
  } from "./chunk-WDAND5YU.js";
33
32
  import {
34
33
  sanitizeInput
35
- } from "./chunk-6QI7J3I2.js";
34
+ } from "./chunk-A3QBUBVT.js";
36
35
  import {
37
36
  BUILT_IN_EXPERTS,
38
37
  BuiltInExpertTypeSchema,
@@ -42,10 +41,10 @@ import {
42
41
  import {
43
42
  DEFAULT_TASK_TTL_MS,
44
43
  clampTaskTtl
45
- } from "./chunk-RBZ23TGL.js";
44
+ } from "./chunk-43YEAMED.js";
46
45
  import {
47
46
  executeExpert
48
- } from "./chunk-UOC22N3S.js";
47
+ } from "./chunk-RG6DJ7FF.js";
49
48
  import {
50
49
  DEPRECATED_MODE_ALIAS_INPUT,
51
50
  JobStatusSchema,
@@ -97,7 +96,7 @@ import {
97
96
  withFileLock,
98
97
  withWarnings,
99
98
  writeJobCancelled
100
- } from "./chunk-H2EUKN6W.js";
99
+ } from "./chunk-4N3XAYN7.js";
101
100
  import {
102
101
  NOOP_NOTIFIER,
103
102
  RateLimiter,
@@ -123,12 +122,12 @@ import {
123
122
  toolSuccessStructured,
124
123
  withProgressHeartbeat,
125
124
  wrapToolWithTimeout
126
- } from "./chunk-FKXV6BST.js";
125
+ } from "./chunk-5WSMU5OA.js";
127
126
  import {
128
127
  VERSION,
129
128
  createRequestContext,
130
129
  measuredTrustTier
131
- } from "./chunk-Q2RC2IMA.js";
130
+ } from "./chunk-JFNPXM6W.js";
132
131
  import {
133
132
  allOf,
134
133
  anyOf
@@ -136,16 +135,16 @@ import {
136
135
  import {
137
136
  normalizeTopicToCanonical,
138
137
  synthesizeResearch
139
- } from "./chunk-D4AOKDGO.js";
138
+ } from "./chunk-KHSP7CNX.js";
140
139
  import {
141
140
  isGatewayModelAdapter
142
- } from "./chunk-VOSNQ34O.js";
141
+ } from "./chunk-TVODJINW.js";
143
142
  import {
144
143
  EventTopics,
145
144
  createEvent,
146
145
  getGlobalEventBus,
147
146
  getGlobalRegistry
148
- } from "./chunk-XDTJIBXF.js";
147
+ } from "./chunk-RUSE5YQQ.js";
149
148
  import {
150
149
  IDENTIFIER_RE,
151
150
  LANG_VALUES,
@@ -178,18 +177,18 @@ import {
178
177
  parseRegistry,
179
178
  sourceExistsInRegistry,
180
179
  summarizeContextForPrompt
181
- } from "./chunk-BECYVDRX.js";
180
+ } from "./chunk-ZCAQSRG6.js";
182
181
  import {
183
182
  getTokenEnvVars,
184
183
  resolveToken
185
- } from "./chunk-ZPSOD4QH.js";
184
+ } from "./chunk-V6YTNHPR.js";
186
185
  import {
187
186
  REGISTRY_PATH,
188
187
  getProjectRoot,
189
188
  loadPapersRegistry,
190
189
  loadTechniquesRegistry,
191
190
  resolveRegistryRoot
192
- } from "./chunk-EC7UBSAY.js";
191
+ } from "./chunk-4X5EZH4H.js";
193
192
  import {
194
193
  DEFAULT_RELEVANCE_CONFIG,
195
194
  MemoryImportance,
@@ -197,7 +196,7 @@ import {
197
196
  calculateTextJaccardSimilarity,
198
197
  getToolMemory,
199
198
  memoryTrustTierTag
200
- } from "./chunk-FOYPZEKN.js";
199
+ } from "./chunk-FZ443QJ5.js";
201
200
  import {
202
201
  EXTERNAL_CONTENT_TRUST_TIER,
203
202
  resolveContentTrustProvenance,
@@ -210,7 +209,7 @@ import {
210
209
  } from "./chunk-SX5DB6UR.js";
211
210
  import {
212
211
  createSessionMemory
213
- } from "./chunk-NHHYFA64.js";
212
+ } from "./chunk-KKXKB7TF.js";
214
213
  import {
215
214
  TrustTierSchema
216
215
  } from "./chunk-CJKHQ6MV.js";
@@ -230,10 +229,10 @@ import {
230
229
  terminateProcessTree,
231
230
  trackProcessTree,
232
231
  withTimeout
233
- } from "./chunk-DM4UXA47.js";
232
+ } from "./chunk-LLUIP44A.js";
234
233
  import {
235
234
  DEFAULTS
236
- } from "./chunk-2R6E5HBT.js";
235
+ } from "./chunk-FUPEQAFF.js";
237
236
  import {
238
237
  DEFAULT_EXECUTION_MODE,
239
238
  DEFAULT_TOOL_RATE_LIMITS,
@@ -244,27 +243,27 @@ import {
244
243
  getAvailabilityCache,
245
244
  getCliForModelId,
246
245
  resolveFallback
247
- } from "./chunk-XAXTHF4V.js";
246
+ } from "./chunk-JPFZZ7WO.js";
248
247
  import {
249
248
  BaseAdapter,
250
249
  createStream,
251
250
  parseGatewayExtraHeaders,
252
251
  requireApiKey,
253
252
  validateApiKeyPresence
254
- } from "./chunk-6IPZIHKS.js";
253
+ } from "./chunk-TMVBH63B.js";
255
254
  import {
256
255
  resolveGatewayEnv
257
- } from "./chunk-LXGONOUN.js";
256
+ } from "./chunk-RQ53DZD7.js";
258
257
  import {
259
258
  sanitizeErrorDetails
260
- } from "./chunk-SVMK6IZX.js";
259
+ } from "./chunk-SWTB5L34.js";
261
260
  import {
262
261
  generateHyphenId,
263
262
  generateUUID
264
- } from "./chunk-MGYECR4N.js";
263
+ } from "./chunk-APTXCM3Z.js";
265
264
  import {
266
265
  getDefaultCliCircuitBreakerRegistry
267
- } from "./chunk-JW7KFY6I.js";
266
+ } from "./chunk-KA4MRN7D.js";
268
267
  import {
269
268
  AGENT_ROUTER_TIMEOUTS,
270
269
  API_TIMEOUTS,
@@ -384,6 +383,7 @@ import {
384
383
  raceAbort,
385
384
  rankStrategiesByManifest,
386
385
  recordRoutingGaps,
386
+ recordToolRefusal,
387
387
  researchContextFromText,
388
388
  resolveClassGuardMs,
389
389
  resolveInsideRoot,
@@ -398,7 +398,10 @@ import {
398
398
  throwIfAborted,
399
399
  toExpertTaskAnalysisResult,
400
400
  withStep
401
- } from "./chunk-GKNT3TPN.js";
401
+ } from "./chunk-3ZWQJBH7.js";
402
+ import {
403
+ SUPPORTED_EXTENSIONS
404
+ } from "./chunk-XBEKMUTO.js";
402
405
  import {
403
406
  ensureLearningDir,
404
407
  getMetaOutcomesFile,
@@ -1172,6 +1175,8 @@ var NexusEnvSchema = z10.object({
1172
1175
  // now go through the same helper, so the schema tells the truth about them.
1173
1176
  NEXUS_BUDGET_ENFORCE: boolLooseStr.optional(),
1174
1177
  NEXUS_CONTEXT_RETRIEVER_INJECT: boolLooseStr.optional(),
1178
+ // Exact opt-in: inferred gaps otherwise remain report-only (#6930).
1179
+ NEXUS_CAPABILITY_GAP_INFERRED: z10.enum(["0", "1"]).optional(),
1175
1180
  NEXUS_DYNAMIC_MODELS: boolLooseStr.optional(),
1176
1181
  NEXUS_GITIGNORE_AUTO: boolLooseStr.optional(),
1177
1182
  NEXUS_SUBPROCESS_ENV_ALLOWLIST: boolLooseStr.optional(),
@@ -30403,7 +30408,7 @@ function execIdFields(executionId) {
30403
30408
  async function populateUnifiedContextOnState(state, options) {
30404
30409
  const taskCandidate = state["task"];
30405
30410
  if (typeof taskCandidate !== "string" || taskCandidate === "") return;
30406
- const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-B22QJPZD.js");
30411
+ const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-AYCAY2U2.js");
30407
30412
  const category = inferTaskCategory2(taskCandidate);
30408
30413
  const executionId = options?.executionId;
30409
30414
  const execFields = execIdFields(executionId);
@@ -31580,12 +31585,9 @@ var CapabilityGapSummarySchema = z58.object({
31580
31585
  /**
31581
31586
  * Whether a capability-gap detector actually ran (#5919).
31582
31587
  *
31583
- * `buildBaseTaskContract` writes `allSatisfied: true` with an EMPTY
31584
- * `available` set — a verdict from a detector that never ran, on the
31585
- * `orchestrate` and `delegate_to_model` paths. Nothing reads it today, which
31586
- * is camouflage rather than safety: it is the same shape as #5896's
31587
- * ValidationHarness, where a missing consumer let a hard-coded verdict sit
31588
- * until someone eventually trusted it.
31588
+ * `buildBaseTaskContract` runs the canonical detector on inferred
31589
+ * requirements for both entry points. Its report describes registry support,
31590
+ * not observed tool execution; inferred gaps retain their origin (#5923).
31589
31591
  *
31590
31592
  * Named for the vocabulary this repo already uses for exactly this —
31591
31593
  * `tokensMeasured`, `policyEvaluated`, `routerTypeMeasured`. A consumer that
@@ -32440,34 +32442,36 @@ function createDefaultPolicyEngine() {
32440
32442
  // src/pipeline/task-contract-builders.ts
32441
32443
  import { randomUUID as randomUUID9 } from "node:crypto";
32442
32444
  var sharedAnalyzer;
32443
- function analyzeForContract(task) {
32445
+ function analyzeTask(task) {
32444
32446
  sharedAnalyzer ??= createSharedTaskAnalyzer();
32445
- const result = sharedAnalyzer.analyze(task);
32446
- return {
32447
- complexity: result.complexity,
32448
- taskType: result.taskType,
32449
- ambiguityScore: result.ambiguityScore
32450
- };
32447
+ return sharedAnalyzer.analyze(task);
32451
32448
  }
32452
32449
  function buildBaseTaskContract(input) {
32450
+ const analysis = analyzeTask(input.task);
32451
+ const report = detectCapabilityGaps(analysis.requiredCapabilities);
32453
32452
  const now = Date.now();
32454
32453
  return {
32455
32454
  id: `${input.idPrefix}-${randomUUID9().slice(0, 8)}`,
32456
32455
  description: input.task,
32457
32456
  status: "approved",
32458
- analysis: input.analysis,
32459
- constraints: { scope: [] },
32460
- requiredCapabilities: { tools: [], experts: [] },
32457
+ analysis: input.analysis ?? {
32458
+ complexity: analysis.complexity,
32459
+ taskType: analysis.taskType,
32460
+ ambiguityScore: analysis.ambiguityScore
32461
+ },
32462
+ constraints: { ...analysis.constraints, scope: [...analysis.constraints.scope] },
32463
+ requiredCapabilities: {
32464
+ tools: [...analysis.requiredCapabilities.tools],
32465
+ experts: [...analysis.requiredCapabilities.experts]
32466
+ },
32461
32467
  capabilityGaps: {
32462
- available: { tools: [], experts: [] },
32463
- gaps: [],
32464
- // NOT a measurement (#5919). No detector runs here, so `allSatisfied`
32465
- // carries no information — `gapsMeasured` is what says so. Wiring
32466
- // `capability-gap-detector.ts` in is the follow-up; its cost on this hot
32467
- // path has not been measured, and asserting an unmeasured verdict is the
32468
- // part that had to stop now.
32469
- allSatisfied: true,
32470
- gapsMeasured: false
32468
+ available: {
32469
+ tools: [...report.available.tools],
32470
+ experts: [...report.available.experts]
32471
+ },
32472
+ gaps: [...report.gaps],
32473
+ allSatisfied: report.allSatisfied,
32474
+ gapsMeasured: true
32471
32475
  },
32472
32476
  artifacts: [],
32473
32477
  metadata: { ...input.metadata },
@@ -32502,9 +32506,6 @@ function delegateInputToTaskContract(input, opts = {}) {
32502
32506
  return buildBaseTaskContract({
32503
32507
  idPrefix: "delegate",
32504
32508
  task: input.task,
32505
- // Derived, not asserted (#5924). This was a literal — every task through
32506
- // this entry point recorded `moderate/routing/0.1` whatever it actually was.
32507
- analysis: analyzeForContract(input.task),
32508
32509
  metadata
32509
32510
  });
32510
32511
  }
@@ -32594,9 +32595,6 @@ function orchestrateInputToTaskContract(input, opts = {}) {
32594
32595
  return buildBaseTaskContract({
32595
32596
  idPrefix: "orchestrate",
32596
32597
  task: input.task,
32597
- // Derived, not asserted (#5924). This was a literal — every task through
32598
- // this entry point recorded `high/orchestration/0.3` whatever it actually was.
32599
- analysis: analyzeForContract(input.task),
32600
32598
  metadata
32601
32599
  });
32602
32600
  }
@@ -37646,7 +37644,7 @@ var TOOL_SCHEMA = {
37646
37644
  function hasKeyword(text, keywords) {
37647
37645
  return keywords.some((k) => text.includes(k));
37648
37646
  }
37649
- function analyzeTask(task) {
37647
+ function analyzeTask2(task) {
37650
37648
  const taskLower = task.toLowerCase();
37651
37649
  const estimatedTokens = Math.ceil(task.length / 4) * 2;
37652
37650
  return {
@@ -38055,7 +38053,7 @@ function notifyAndRecord(opts) {
38055
38053
  }
38056
38054
  async function tryCompositeRoute(deps, ctx, opts) {
38057
38055
  if (deps.router === void 0) return null;
38058
- const requirements = analyzeTask(opts.task);
38056
+ const requirements = analyzeTask2(opts.task);
38059
38057
  const routerResult = await routeViaCompositeRouter(
38060
38058
  opts.task,
38061
38059
  deps.router,
@@ -38100,7 +38098,7 @@ function createDelegateHandler(deps) {
38100
38098
  if (compositeResult !== null) {
38101
38099
  return compositeResult;
38102
38100
  }
38103
- const requirements = analyzeTask(input.task);
38101
+ const requirements = analyzeTask2(input.task);
38104
38102
  const billingMode = input.billing_mode ?? DEFAULTS.PROVIDER_DEFAULTS.billingMode;
38105
38103
  const selection = selectModel(input, requirements, billingMode);
38106
38104
  const output2 = buildDelegateOutput(selection, requirements);
@@ -43549,29 +43547,6 @@ function registerSearchCodebaseTool(server, deps) {
43549
43547
  // src/mcp/tools/extract-symbols-tool.ts
43550
43548
  import { extname as extname3 } from "node:path";
43551
43549
  import { z as z91 } from "zod";
43552
-
43553
- // src/core/task-analysis/tool-refusal-gap.ts
43554
- function toolRefusalGapName(tool, capability) {
43555
- return `${tool}:${capability}`.toLowerCase();
43556
- }
43557
- function recordToolRefusal(refusal, context, ledger = getGapLedger()) {
43558
- const capability = refusal.capability.trim();
43559
- if (capability === "") return;
43560
- const report = {
43561
- gaps: [
43562
- {
43563
- type: "tool_refusal",
43564
- name: toolRefusalGapName(refusal.tool, capability),
43565
- suggestion: refusal.suggestion
43566
- }
43567
- ],
43568
- available: { tools: [], experts: [] },
43569
- allSatisfied: false
43570
- };
43571
- ledger.record(report, context);
43572
- }
43573
-
43574
- // src/mcp/tools/extract-symbols-tool.ts
43575
43550
  var DEFAULT_EXTRACT_MAX_CHARS = 2e4;
43576
43551
  var DEFAULT_EXTRACT_MAX_SYMBOLS = 200;
43577
43552
  var ExtractSymbolsInputSchema = z91.object({
@@ -46655,7 +46630,7 @@ async function tryIssueTriage(task) {
46655
46630
  try {
46656
46631
  const issueMatch = task.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);
46657
46632
  if (issueMatch === null) return null;
46658
- const { createIssueTriage } = await import("./issue-triage-R523TPSU.js");
46633
+ const { createIssueTriage } = await import("./issue-triage-GZHF4HGZ.js");
46659
46634
  const triage = createIssueTriage();
46660
46635
  const owner = issueMatch[1] ?? "";
46661
46636
  const num2 = issueMatch[2] ?? "";
@@ -46683,7 +46658,7 @@ var VALID_TEMPLATES = /* @__PURE__ */ new Set([
46683
46658
  ]);
46684
46659
  async function classifyWithLLM(task) {
46685
46660
  try {
46686
- const { executeExpert: executeExpert2 } = await import("./expert-bridge-HEN47NON.js");
46661
+ const { executeExpert: executeExpert2 } = await import("./expert-bridge-6ICNND52.js");
46687
46662
  const prompt = [
46688
46663
  "Classify this task into exactly one pipeline template.",
46689
46664
  "Templates: dev (implementation/bug fix/refactor), research (investigate/evaluate/compare),",
@@ -47057,7 +47032,7 @@ function buildVotingInput(plan, config) {
47057
47032
  }
47058
47033
  async function executeSingleVote(plan, config, log) {
47059
47034
  try {
47060
- const { executeVoting } = await import("./consensus-vote-HWUNGKTW.js");
47035
+ const { executeVoting } = await import("./consensus-vote-V56W3QW5.js");
47061
47036
  const input = buildVotingInput(plan, config);
47062
47037
  const result = await executeVoting(input, log);
47063
47038
  return parseVotingResult(result);
@@ -47925,7 +47900,7 @@ var memoryInitPromise = null;
47925
47900
  async function initPipelineMemory() {
47926
47901
  if (cachedMemory !== null) return cachedMemory;
47927
47902
  try {
47928
- const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-RWJV5SWQ.js");
47903
+ const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-H35YIL36.js");
47929
47904
  const { getLearningDir } = await import("./learning-persistence-FB4U5AX2.js");
47930
47905
  const mem = createSessionMemory2(getLearningDir());
47931
47906
  mem.startSession(`pipeline-${String(getTimeProvider().now())}`);
@@ -47987,7 +47962,7 @@ function recordRoutingExperience(category, success, durationMs, tokensUsed = 0,
47987
47962
  callRecord(routingMemoryCache);
47988
47963
  return;
47989
47964
  }
47990
- routingMemoryInitPromise ??= import("./routing-memory-M3O4WVIT.js").then(({ createRoutingMemory }) => {
47965
+ routingMemoryInitPromise ??= import("./routing-memory-MZ4LIUQH.js").then(({ createRoutingMemory }) => {
47991
47966
  routingMemoryCache ??= createRoutingMemory();
47992
47967
  return routingMemoryCache;
47993
47968
  }).catch((error) => {
@@ -48204,7 +48179,7 @@ function createVoteStage({ config, startStage }) {
48204
48179
  const strategy = config.votingStrategy ?? "higher_order";
48205
48180
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
48206
48181
  try {
48207
- const { executeVoting } = await import("./consensus-vote-HWUNGKTW.js");
48182
+ const { executeVoting } = await import("./consensus-vote-V56W3QW5.js");
48208
48183
  const proposal = buildVoteProposal(plan, research);
48209
48184
  const votingResult = await executeVoting(
48210
48185
  {
@@ -49063,7 +49038,7 @@ ${text}` : "";
49063
49038
  }
49064
49039
  async function getWeatherContext() {
49065
49040
  try {
49066
- const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-QYBKW7YM.js");
49041
+ const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-OJ6GGBXO.js");
49067
49042
  const report = generateWeatherReport2({ includeAdaptive: true });
49068
49043
  const mappings = "recommendedMappings" in report ? report.recommendedMappings : [];
49069
49044
  if (!Array.isArray(mappings) || mappings.length === 0) return "";
@@ -49081,7 +49056,7 @@ ${lines}
49081
49056
  }
49082
49057
  async function getMemoryContext(task) {
49083
49058
  try {
49084
- const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-RWJV5SWQ.js");
49059
+ const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-H35YIL36.js");
49085
49060
  const { getLearningDir } = await import("./learning-persistence-FB4U5AX2.js");
49086
49061
  const memory = createSessionMemory2(getLearningDir(), { maxLearningsInContext: 10 });
49087
49062
  const learnings = memory.searchLearnings(task.slice(0, 200));
@@ -49722,7 +49697,7 @@ function createScaffoldStageWrapper() {
49722
49697
  }
49723
49698
  async function searchCodebaseForTask(task) {
49724
49699
  try {
49725
- const { CodebaseIndex: CodebaseIndex2 } = await import("./codebase-search-7YYPTFPL.js");
49700
+ const { CodebaseIndex: CodebaseIndex2 } = await import("./codebase-search-VMKI7FW4.js");
49726
49701
  const index = new CodebaseIndex2(process.cwd());
49727
49702
  const terms = task.toLowerCase().split(/\s+/).filter((w) => w.length > 4).slice(0, 3);
49728
49703
  if (terms.length === 0) return null;
@@ -49737,7 +49712,7 @@ async function searchCodebaseForTask(task) {
49737
49712
  }
49738
49713
  async function queryResearchRegistry(task) {
49739
49714
  try {
49740
- const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-SV22X3ZE.js");
49715
+ const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-ZCGNK2ZB.js");
49741
49716
  const topic = task.split(/[.!?\n]/).filter((s) => s.trim().length > 10)[0]?.trim();
49742
49717
  if (topic === void 0) return null;
49743
49718
  const result = await synthesizeResearch2(topic.slice(0, 50));
@@ -49808,7 +49783,7 @@ function createScanStageWrapper() {
49808
49783
  try {
49809
49784
  const slug = ctx.task.match(/([a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+)/)?.[1];
49810
49785
  if (slug !== void 0) {
49811
- const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-UPWNMHDF.js");
49786
+ const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-H4NMHMWD.js");
49812
49787
  const plan = await generateSecurityPlan2({ repo: slug, maxScanners: 10 });
49813
49788
  const recs = plan.recommendations.slice(0, 5).map((r) => `${r.priority}: ${r.displayName} (${r.category})`).join("; ");
49814
49789
  return output(PIPELINE_STATE_KEYS.FINDINGS, recs, getTimeProvider().now() - start, true);
@@ -52853,11 +52828,9 @@ function createMetaOrchestrator(options) {
52853
52828
  if (shadowSelector !== void 0 && shadowSink !== void 0) {
52854
52829
  recordShadow(shadowSelector, shadowSink, decision, timestamp, logger59);
52855
52830
  }
52856
- if (gapLedger !== void 0 && decision.capabilityGaps !== void 0) {
52857
- gapLedger.record(decision.capabilityGaps, {
52858
- goal: input.goal,
52859
- decisionId: decision.decisionId
52860
- });
52831
+ if (gapLedger !== void 0) {
52832
+ const context = { goal: input.goal, decisionId: decision.decisionId };
52833
+ recordRoutingGaps(decision, context, gapLedger);
52861
52834
  }
52862
52835
  logSelection(logger59, decision, forced);
52863
52836
  return decision;
@@ -53455,7 +53428,7 @@ var GitHubTaskTracker = class {
53455
53428
  cachedProvider = null;
53456
53429
  async getProvider() {
53457
53430
  if (this.cachedProvider !== null) return this.cachedProvider;
53458
- const { createScmProvider } = await import("./factory-XFIXK3N5.js");
53431
+ const { createScmProvider } = await import("./factory-P4NMFJF2.js");
53459
53432
  const result = await createScmProvider({ repo: this.config.repo ?? "" });
53460
53433
  if (!result.ok) throw new Error(`SCM provider error: ${result.error.message}`);
53461
53434
  this.cachedProvider = result.value;
@@ -54498,7 +54471,7 @@ function withCatalogueCaveat(report) {
54498
54471
  var GATEWAY_TRANSPORT = "gateway";
54499
54472
  var GATEWAY_API_ARM = "api:custom-openai";
54500
54473
  async function gatewaySource(apiArm) {
54501
- const { discoverModels, readOpenAICompatEnv } = await import("./openai-compat-adapter-U4EOZYHJ.js");
54474
+ const { discoverModels, readOpenAICompatEnv } = await import("./openai-compat-adapter-QXBN3VJU.js");
54502
54475
  const config = readOpenAICompatEnv();
54503
54476
  if (config !== null) {
54504
54477
  return {
@@ -54517,7 +54490,7 @@ async function gatewaySource(apiArm) {
54517
54490
  }
54518
54491
  async function defaultSources(includeOpenRouter, adaptersFactory) {
54519
54492
  const adapters = new Map(
54520
- adaptersFactory !== void 0 ? adaptersFactory() : (await import("./factory-6EQIV2HF.js")).createAllAdapters()
54493
+ adaptersFactory !== void 0 ? adaptersFactory() : (await import("./factory-MBS6QSZM.js")).createAllAdapters()
54521
54494
  );
54522
54495
  const apiArm = adapters.get(GATEWAY_API_ARM);
54523
54496
  adapters.delete(GATEWAY_API_ARM);
@@ -57668,7 +57641,7 @@ export {
57668
57641
  MODEL_CAPABILITIES2 as MODEL_CAPABILITIES,
57669
57642
  DelegateInputSchema,
57670
57643
  DelegateOutputSchema,
57671
- analyzeTask,
57644
+ analyzeTask2 as analyzeTask,
57672
57645
  selectModel,
57673
57646
  registerDelegateToModelTool,
57674
57647
  runConsensusGate,
@@ -57824,4 +57797,4 @@ export {
57824
57797
  startPipelineEventBridge,
57825
57798
  shutdownPipelineEventBridge
57826
57799
  };
57827
- //# sourceMappingURL=chunk-X52J2EI3.js.map
57800
+ //# sourceMappingURL=chunk-3CFROGBP.js.map