nexus-agents 8.79.0 → 8.80.1

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 (128) hide show
  1. package/dist/{ast-rule-runner-WLKU5YHB.js → ast-rule-runner-QYUO4JKS.js} +3 -3
  2. package/dist/{child-mcp-config-4SKZNE7O.js → child-mcp-config-2I3ZP5UI.js} +3 -7
  3. package/dist/{child-mcp-config-4SKZNE7O.js.map → child-mcp-config-2I3ZP5UI.js.map} +1 -1
  4. package/dist/{chunk-43SBVXRB.js → chunk-2A3CC5SZ.js} +2 -2
  5. package/dist/{chunk-J63N4QQ6.js → chunk-2DTLUKLA.js} +3 -3
  6. package/dist/{chunk-YZWG3Q7Q.js → chunk-34YOAV3B.js} +4 -4
  7. package/dist/{chunk-JYZAWVET.js → chunk-3N4XSJPY.js} +5 -5
  8. package/dist/{chunk-FPDJQYZF.js → chunk-5GMAK2H5.js} +2 -2
  9. package/dist/{chunk-FYJ22FK4.js → chunk-6NXLVWML.js} +2 -2
  10. package/dist/{chunk-HIPXSLH6.js → chunk-6YB3F2HP.js} +2 -2
  11. package/dist/{chunk-JXHGQZHZ.js → chunk-7WKMF5VE.js} +2 -2
  12. package/dist/{chunk-VXL4B5FG.js → chunk-BSCTEWWP.js} +2 -2
  13. package/dist/{chunk-54KBJTS5.js → chunk-CNBXEHTN.js} +2 -2
  14. package/dist/{chunk-FIJ6IGBP.js → chunk-D22SPEEU.js} +2 -2
  15. package/dist/{chunk-DYADW74K.js → chunk-D6MOQULW.js} +8 -8
  16. package/dist/{chunk-VEDRL7RF.js → chunk-HLHCNG7B.js} +2 -2
  17. package/dist/{chunk-N3CM6SD3.js → chunk-ITMG2I6K.js} +2 -2
  18. package/dist/{chunk-J2UPT4QH.js → chunk-JSR6RFWB.js} +3 -3
  19. package/dist/{chunk-QAE6CXFB.js → chunk-L7KWTUF7.js} +10 -10
  20. package/dist/{chunk-JJEKTXCT.js → chunk-LZXMWS5C.js} +61 -24
  21. package/dist/chunk-LZXMWS5C.js.map +1 -0
  22. package/dist/{chunk-BHNNGFEQ.js → chunk-OM62MDMA.js} +4 -4
  23. package/dist/{chunk-RHHQJLZ4.js → chunk-Q2HCR2IW.js} +36 -54
  24. package/dist/{chunk-RHHQJLZ4.js.map → chunk-Q2HCR2IW.js.map} +1 -1
  25. package/dist/{chunk-LUABUQOK.js → chunk-QBTNUCQB.js} +7 -7
  26. package/dist/{chunk-S5VINCRF.js → chunk-RIKQ4FZF.js} +2 -2
  27. package/dist/{chunk-ZP632JYM.js → chunk-RIYFOUW4.js} +216 -266
  28. package/dist/chunk-RIYFOUW4.js.map +1 -0
  29. package/dist/{chunk-4MCXZPL5.js → chunk-TQHQMEWO.js} +2 -2
  30. package/dist/{chunk-K4PX2QXZ.js → chunk-TRIUZ45L.js} +3 -3
  31. package/dist/{chunk-AYYETRVT.js → chunk-UABEPFK5.js} +2 -2
  32. package/dist/{chunk-KM7ZZH63.js → chunk-VXXD6VQI.js} +2 -2
  33. package/dist/{chunk-AAW6JINR.js → chunk-X5CLL6FQ.js} +4 -58
  34. package/dist/chunk-X5CLL6FQ.js.map +1 -0
  35. package/dist/{chunk-IMUIPM5L.js → chunk-X7ZAI75Z.js} +4 -4
  36. package/dist/{chunk-A5GEH5FM.js → chunk-XSWKTCGW.js} +2 -2
  37. package/dist/{chunk-DBCP2TA7.js → chunk-Y2RY4K3I.js} +2 -2
  38. package/dist/{chunk-4PWLJG2X.js → chunk-YWTC3XY5.js} +2 -2
  39. package/dist/{chunk-56IPR3SB.js → chunk-Z2XU45MC.js} +5 -5
  40. package/dist/{chunk-E3O3HWO5.js → chunk-Z63NLSGK.js} +3 -3
  41. package/dist/{cli-circuit-breaker-SYPADEG3.js → cli-circuit-breaker-33PVKG37.js} +3 -3
  42. package/dist/cli.js +42 -42
  43. package/dist/cli.js.map +1 -1
  44. package/dist/{composite-router-6JVEOVSL.js → composite-router-KTEJHOMM.js} +2 -2
  45. package/dist/{consensus-vote-NH3Y6KQU.js → consensus-vote-O2PNH5LI.js} +16 -16
  46. package/dist/{context-retriever-FCQPM3MD.js → context-retriever-NP32AMUI.js} +8 -8
  47. package/dist/{doctor-deep-N3X7ZICY.js → doctor-deep-NE5NQ7JS.js} +3 -3
  48. package/dist/{doctor-live-BRZKNVSO.js → doctor-live-HP7OI6RY.js} +10 -10
  49. package/dist/{expert-bridge-2YX2YOJO.js → expert-bridge-7C7JYDQK.js} +4 -4
  50. package/dist/{factory-NS2BW5MI.js → factory-7UBWG5DM.js} +9 -9
  51. package/dist/{factory-URK2XJZF.js → factory-MXLVVYCL.js} +5 -5
  52. package/dist/{improvement-review-JXN3E7AF.js → improvement-review-ZPMPWUMO.js} +5 -5
  53. package/dist/index.d.ts +6 -1
  54. package/dist/index.js +30 -30
  55. package/dist/{init-opencode-4U6KRPWB.js → init-opencode-ZKRXMYKO.js} +5 -5
  56. package/dist/issue-triage-GNFG3HMH.js +16 -0
  57. package/dist/{pr-reviewer-helpers-K6MEHUKV.js → pr-reviewer-helpers-DEXQAVKI.js} +4 -4
  58. package/dist/{registry-command-NJRVZ5TW.js → registry-command-ZWSTB7PN.js} +2 -2
  59. package/dist/{repo-security-plan-7CB2SWNV.js → repo-security-plan-3TMT3MRL.js} +3 -3
  60. package/dist/{research-helpers-synthesize-S2OAZRC3.js → research-helpers-synthesize-3S27D2MH.js} +4 -4
  61. package/dist/{routing-memory-N63ETQ5N.js → routing-memory-POVUTBL2.js} +2 -2
  62. package/dist/{session-memory-RZLMTQRF.js → session-memory-44C2EEPJ.js} +3 -3
  63. package/dist/{setup-config-5K67D6CO.js → setup-config-FTKTKSHZ.js} +3 -3
  64. package/dist/{setup-custom-api-RU4SKJ6O.js → setup-custom-api-M752UDNC.js} +4 -4
  65. package/dist/setup-data-dir-YMU6OBUA.js +30 -0
  66. package/dist/{tool-memory-XBJU5EST.js → tool-memory-A73LJT5T.js} +5 -7
  67. package/dist/{unified-registry-YVGARTAA.js → unified-registry-GRYB3ALS.js} +10 -10
  68. package/dist/{weather-report-5JWGIEFQ.js → weather-report-UCQC62SV.js} +2 -2
  69. package/package.json +1 -1
  70. package/dist/chunk-AAW6JINR.js.map +0 -1
  71. package/dist/chunk-JJEKTXCT.js.map +0 -1
  72. package/dist/chunk-ZP632JYM.js.map +0 -1
  73. package/dist/issue-triage-NOETX2XW.js +0 -16
  74. package/dist/setup-data-dir-YPQVED6C.js +0 -30
  75. /package/dist/{ast-rule-runner-WLKU5YHB.js.map → ast-rule-runner-QYUO4JKS.js.map} +0 -0
  76. /package/dist/{chunk-43SBVXRB.js.map → chunk-2A3CC5SZ.js.map} +0 -0
  77. /package/dist/{chunk-J63N4QQ6.js.map → chunk-2DTLUKLA.js.map} +0 -0
  78. /package/dist/{chunk-YZWG3Q7Q.js.map → chunk-34YOAV3B.js.map} +0 -0
  79. /package/dist/{chunk-JYZAWVET.js.map → chunk-3N4XSJPY.js.map} +0 -0
  80. /package/dist/{chunk-FPDJQYZF.js.map → chunk-5GMAK2H5.js.map} +0 -0
  81. /package/dist/{chunk-FYJ22FK4.js.map → chunk-6NXLVWML.js.map} +0 -0
  82. /package/dist/{chunk-HIPXSLH6.js.map → chunk-6YB3F2HP.js.map} +0 -0
  83. /package/dist/{chunk-JXHGQZHZ.js.map → chunk-7WKMF5VE.js.map} +0 -0
  84. /package/dist/{chunk-VXL4B5FG.js.map → chunk-BSCTEWWP.js.map} +0 -0
  85. /package/dist/{chunk-54KBJTS5.js.map → chunk-CNBXEHTN.js.map} +0 -0
  86. /package/dist/{chunk-FIJ6IGBP.js.map → chunk-D22SPEEU.js.map} +0 -0
  87. /package/dist/{chunk-DYADW74K.js.map → chunk-D6MOQULW.js.map} +0 -0
  88. /package/dist/{chunk-VEDRL7RF.js.map → chunk-HLHCNG7B.js.map} +0 -0
  89. /package/dist/{chunk-N3CM6SD3.js.map → chunk-ITMG2I6K.js.map} +0 -0
  90. /package/dist/{chunk-J2UPT4QH.js.map → chunk-JSR6RFWB.js.map} +0 -0
  91. /package/dist/{chunk-QAE6CXFB.js.map → chunk-L7KWTUF7.js.map} +0 -0
  92. /package/dist/{chunk-BHNNGFEQ.js.map → chunk-OM62MDMA.js.map} +0 -0
  93. /package/dist/{chunk-LUABUQOK.js.map → chunk-QBTNUCQB.js.map} +0 -0
  94. /package/dist/{chunk-S5VINCRF.js.map → chunk-RIKQ4FZF.js.map} +0 -0
  95. /package/dist/{chunk-4MCXZPL5.js.map → chunk-TQHQMEWO.js.map} +0 -0
  96. /package/dist/{chunk-K4PX2QXZ.js.map → chunk-TRIUZ45L.js.map} +0 -0
  97. /package/dist/{chunk-AYYETRVT.js.map → chunk-UABEPFK5.js.map} +0 -0
  98. /package/dist/{chunk-KM7ZZH63.js.map → chunk-VXXD6VQI.js.map} +0 -0
  99. /package/dist/{chunk-IMUIPM5L.js.map → chunk-X7ZAI75Z.js.map} +0 -0
  100. /package/dist/{chunk-A5GEH5FM.js.map → chunk-XSWKTCGW.js.map} +0 -0
  101. /package/dist/{chunk-DBCP2TA7.js.map → chunk-Y2RY4K3I.js.map} +0 -0
  102. /package/dist/{chunk-4PWLJG2X.js.map → chunk-YWTC3XY5.js.map} +0 -0
  103. /package/dist/{chunk-56IPR3SB.js.map → chunk-Z2XU45MC.js.map} +0 -0
  104. /package/dist/{chunk-E3O3HWO5.js.map → chunk-Z63NLSGK.js.map} +0 -0
  105. /package/dist/{cli-circuit-breaker-SYPADEG3.js.map → cli-circuit-breaker-33PVKG37.js.map} +0 -0
  106. /package/dist/{composite-router-6JVEOVSL.js.map → composite-router-KTEJHOMM.js.map} +0 -0
  107. /package/dist/{consensus-vote-NH3Y6KQU.js.map → consensus-vote-O2PNH5LI.js.map} +0 -0
  108. /package/dist/{context-retriever-FCQPM3MD.js.map → context-retriever-NP32AMUI.js.map} +0 -0
  109. /package/dist/{doctor-deep-N3X7ZICY.js.map → doctor-deep-NE5NQ7JS.js.map} +0 -0
  110. /package/dist/{doctor-live-BRZKNVSO.js.map → doctor-live-HP7OI6RY.js.map} +0 -0
  111. /package/dist/{expert-bridge-2YX2YOJO.js.map → expert-bridge-7C7JYDQK.js.map} +0 -0
  112. /package/dist/{factory-NS2BW5MI.js.map → factory-7UBWG5DM.js.map} +0 -0
  113. /package/dist/{factory-URK2XJZF.js.map → factory-MXLVVYCL.js.map} +0 -0
  114. /package/dist/{improvement-review-JXN3E7AF.js.map → improvement-review-ZPMPWUMO.js.map} +0 -0
  115. /package/dist/{init-opencode-4U6KRPWB.js.map → init-opencode-ZKRXMYKO.js.map} +0 -0
  116. /package/dist/{issue-triage-NOETX2XW.js.map → issue-triage-GNFG3HMH.js.map} +0 -0
  117. /package/dist/{pr-reviewer-helpers-K6MEHUKV.js.map → pr-reviewer-helpers-DEXQAVKI.js.map} +0 -0
  118. /package/dist/{registry-command-NJRVZ5TW.js.map → registry-command-ZWSTB7PN.js.map} +0 -0
  119. /package/dist/{repo-security-plan-7CB2SWNV.js.map → repo-security-plan-3TMT3MRL.js.map} +0 -0
  120. /package/dist/{research-helpers-synthesize-S2OAZRC3.js.map → research-helpers-synthesize-3S27D2MH.js.map} +0 -0
  121. /package/dist/{routing-memory-N63ETQ5N.js.map → routing-memory-POVUTBL2.js.map} +0 -0
  122. /package/dist/{session-memory-RZLMTQRF.js.map → session-memory-44C2EEPJ.js.map} +0 -0
  123. /package/dist/{setup-config-5K67D6CO.js.map → setup-config-FTKTKSHZ.js.map} +0 -0
  124. /package/dist/{setup-custom-api-RU4SKJ6O.js.map → setup-custom-api-M752UDNC.js.map} +0 -0
  125. /package/dist/{setup-data-dir-YPQVED6C.js.map → setup-data-dir-YMU6OBUA.js.map} +0 -0
  126. /package/dist/{tool-memory-XBJU5EST.js.map → tool-memory-A73LJT5T.js.map} +0 -0
  127. /package/dist/{unified-registry-YVGARTAA.js.map → unified-registry-GRYB3ALS.js.map} +0 -0
  128. /package/dist/{weather-report-5JWGIEFQ.js.map → weather-report-UCQC62SV.js.map} +0 -0
@@ -9,8 +9,8 @@ import {
9
9
  getBuiltInAstRulesPath,
10
10
  loadRules,
11
11
  runAstQaRules
12
- } from "./chunk-S5VINCRF.js";
13
- import "./chunk-ZP632JYM.js";
12
+ } from "./chunk-RIKQ4FZF.js";
13
+ import "./chunk-RIYFOUW4.js";
14
14
  import "./chunk-4UHDDCRB.js";
15
15
  import "./chunk-RNDHNRSX.js";
16
16
  import "./chunk-PX6F3LHL.js";
@@ -26,4 +26,4 @@ export {
26
26
  loadRules,
27
27
  runAstQaRules
28
28
  };
29
- //# sourceMappingURL=ast-rule-runner-WLKU5YHB.js.map
29
+ //# sourceMappingURL=ast-rule-runner-QYUO4JKS.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-HERI7LXN.js";
4
4
  import {
5
5
  createLogger
6
- } from "./chunk-ZP632JYM.js";
6
+ } from "./chunk-RIYFOUW4.js";
7
7
  import "./chunk-4UHDDCRB.js";
8
8
  import "./chunk-RNDHNRSX.js";
9
9
  import "./chunk-PX6F3LHL.js";
@@ -53,11 +53,7 @@ async function generateMcpConfig(options) {
53
53
  };
54
54
  return { configPath, cleanup, allowedTools: tools };
55
55
  }
56
- function getDefaultAllowedTools() {
57
- return DEFAULT_ALLOWED_TOOLS;
58
- }
59
56
  export {
60
- generateMcpConfig,
61
- getDefaultAllowedTools
57
+ generateMcpConfig
62
58
  };
63
- //# sourceMappingURL=child-mcp-config-4SKZNE7O.js.map
59
+ //# sourceMappingURL=child-mcp-config-2I3ZP5UI.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 * @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 /** Custom allowed tools (default: read-only subset). */\n readonly allowedTools?: readonly string[];\n}\n\n/** Default read-only tools available to SWE-bench child sessions. */\nconst DEFAULT_ALLOWED_TOOLS: readonly string[] = [\n 'memory_query',\n 'memory_stats',\n 'research_query',\n 'research_discover',\n 'weather_report',\n 'delegate_to_model',\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 * 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 ...(options?.env !== undefined ? { env: options.env } : {}),\n };\n\n return {\n mcpServers: {\n 'nexus-agents': entry,\n },\n };\n\n // Tool allowlisting is handled by Claude CLI's --allowedTools flag, not in\n // the MCP config itself; the caller passes tools separately. Nothing here\n // needs the resolved list, so it is no longer computed.\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 /** Allowed tools list for --allowedTools flag. */\n readonly allowedTools: readonly string[];\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 const tools = options?.allowedTools ?? DEFAULT_ALLOWED_TOOLS;\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, allowedTools: tools };\n}\n\n/**\n * Gets the default allowed tools for SWE-bench MCP sessions.\n */\nexport function getDefaultAllowedTools(): readonly string[] {\n return DEFAULT_ALLOWED_TOOLS;\n}\n"],"mappings":";;;;;;;;;;;AAaA,SAAS,WAAW,UAAU;AAE9B,SAAS,YAAY;AAGrB,IAAM,SAAS,aAAa,EAAE,WAAW,uBAAuB,CAAC;AA+BjE,IAAM,wBAA2C;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAMA,SAAS,eAAe,UAA2B;AACjD,MAAI,aAAa,OAAW,QAAO;AAGnC,QAAM,UAAU,KAAK,WAAW,IAAI;AACpC,SAAO,KAAK,SAAS,QAAQ;AAC/B;AAKA,SAAS,YAAY,SAA2C;AAC9D,QAAM,UAAU,eAAe,SAAS,OAAO;AAE/C,QAAM,QAAwB;AAAA,IAC5B,SAAS;AAAA,IACT,MAAM,CAAC,SAAS,eAAe;AAAA,IAC/B,GAAI,SAAS,QAAQ,SAAY,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC;AAAA,EAC3D;AAEA,SAAO;AAAA,IACL,YAAY;AAAA,MACV,gBAAgB;AAAA,IAClB;AAAA,EACF;AAKF;AAoBA,eAAsB,kBAAkB,SAAyD;AAC/F,QAAM,SAAS,YAAY,OAAO;AAClC,QAAM,QAAQ,SAAS,gBAAgB;AAEvC,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,SAAS,cAAc,MAAM;AACpD;AAKO,SAAS,yBAA4C;AAC1D,SAAO;AACT;","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 * @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 /** Custom allowed tools (default: read-only subset). */\n readonly allowedTools?: readonly string[];\n}\n\n/** Default read-only tools available to SWE-bench child sessions. */\nconst DEFAULT_ALLOWED_TOOLS: readonly string[] = [\n 'memory_query',\n 'memory_stats',\n 'research_query',\n 'research_discover',\n 'weather_report',\n 'delegate_to_model',\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 * 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 ...(options?.env !== undefined ? { env: options.env } : {}),\n };\n\n return {\n mcpServers: {\n 'nexus-agents': entry,\n },\n };\n\n // Tool allowlisting is handled by Claude CLI's --allowedTools flag, not in\n // the MCP config itself; the caller passes tools separately. Nothing here\n // needs the resolved list, so it is no longer computed.\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 /** Allowed tools list for --allowedTools flag. */\n readonly allowedTools: readonly string[];\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 const tools = options?.allowedTools ?? DEFAULT_ALLOWED_TOOLS;\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, allowedTools: tools };\n}\n"],"mappings":";;;;;;;;;;;AAaA,SAAS,WAAW,UAAU;AAE9B,SAAS,YAAY;AAGrB,IAAM,SAAS,aAAa,EAAE,WAAW,uBAAuB,CAAC;AA+BjE,IAAM,wBAA2C;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAMA,SAAS,eAAe,UAA2B;AACjD,MAAI,aAAa,OAAW,QAAO;AAGnC,QAAM,UAAU,KAAK,WAAW,IAAI;AACpC,SAAO,KAAK,SAAS,QAAQ;AAC/B;AAKA,SAAS,YAAY,SAA2C;AAC9D,QAAM,UAAU,eAAe,SAAS,OAAO;AAE/C,QAAM,QAAwB;AAAA,IAC5B,SAAS;AAAA,IACT,MAAM,CAAC,SAAS,eAAe;AAAA,IAC/B,GAAI,SAAS,QAAQ,SAAY,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC;AAAA,EAC3D;AAEA,SAAO;AAAA,IACL,YAAY;AAAA,MACV,gBAAgB;AAAA,IAClB;AAAA,EACF;AAKF;AAoBA,eAAsB,kBAAkB,SAAyD;AAC/F,QAAM,SAAS,YAAY,OAAO;AAClC,QAAM,QAAQ,SAAS,gBAAgB;AAEvC,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,SAAS,cAAc,MAAM;AACpD;","names":[]}
@@ -1,6 +1,6 @@
1
1
  // src/version.ts
2
2
  import semver from "semver";
3
- var VERSION = true ? "8.79.0" : "dev";
3
+ var VERSION = true ? "8.80.1" : "dev";
4
4
  var NODE_ENGINE_RANGE = ">=22.5.0";
5
5
  function isNodeVersionSupported(version) {
6
6
  return semver.satisfies(version, NODE_ENGINE_RANGE);
@@ -11,4 +11,4 @@ export {
11
11
  NODE_ENGINE_RANGE,
12
12
  isNodeVersionSupported
13
13
  };
14
- //# sourceMappingURL=chunk-43SBVXRB.js.map
14
+ //# sourceMappingURL=chunk-2A3CC5SZ.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  loadPapersRegistry
3
- } from "./chunk-4PWLJG2X.js";
3
+ } from "./chunk-YWTC3XY5.js";
4
4
  import {
5
5
  getErrorMessage
6
- } from "./chunk-ZP632JYM.js";
6
+ } from "./chunk-RIYFOUW4.js";
7
7
 
8
8
  // src/cli/research-helpers-synthesize.ts
9
9
  import { z } from "zod";
@@ -876,4 +876,4 @@ export {
876
876
  AttributedInsightSchema,
877
877
  synthesizeResearch
878
878
  };
879
- //# sourceMappingURL=chunk-J63N4QQ6.js.map
879
+ //# sourceMappingURL=chunk-2DTLUKLA.js.map
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  GitHubProvider,
3
3
  ScmError
4
- } from "./chunk-HIPXSLH6.js";
4
+ } from "./chunk-6YB3F2HP.js";
5
5
  import {
6
6
  resolveToken
7
- } from "./chunk-DBCP2TA7.js";
7
+ } from "./chunk-Y2RY4K3I.js";
8
8
  import {
9
9
  err,
10
10
  ok
11
- } from "./chunk-ZP632JYM.js";
11
+ } from "./chunk-RIYFOUW4.js";
12
12
 
13
13
  // src/scm/factory.ts
14
14
  async function createScmProvider(config) {
@@ -41,4 +41,4 @@ export {
41
41
  createScmProvider,
42
42
  createGitHubProvider
43
43
  };
44
- //# sourceMappingURL=chunk-YZWG3Q7Q.js.map
44
+ //# sourceMappingURL=chunk-34YOAV3B.js.map
@@ -8,13 +8,13 @@ import {
8
8
  loadTechniquesRegistry,
9
9
  resolveInsideRoot,
10
10
  savePapersRegistry
11
- } from "./chunk-4PWLJG2X.js";
11
+ } from "./chunk-YWTC3XY5.js";
12
12
  import {
13
13
  resolveToken
14
- } from "./chunk-DBCP2TA7.js";
14
+ } from "./chunk-Y2RY4K3I.js";
15
15
  import {
16
16
  getToolMemory
17
- } from "./chunk-AAW6JINR.js";
17
+ } from "./chunk-X5CLL6FQ.js";
18
18
  import {
19
19
  capitalizeWords,
20
20
  tokenizeFiltered,
@@ -43,7 +43,7 @@ import {
43
43
  ok,
44
44
  registerPersistentDistillerFactory,
45
45
  sigmoidConfidence
46
- } from "./chunk-ZP632JYM.js";
46
+ } from "./chunk-RIYFOUW4.js";
47
47
  import {
48
48
  ensureLearningDir,
49
49
  getRulesFile
@@ -4241,4 +4241,4 @@ export {
4241
4241
  DEFAULT_CONTEXT_BUDGET_TOKENS,
4242
4242
  getContextPromptPrefix
4243
4243
  };
4244
- //# sourceMappingURL=chunk-JYZAWVET.js.map
4244
+ //# sourceMappingURL=chunk-3N4XSJPY.js.map
@@ -7,7 +7,7 @@ import {
7
7
  createLogger,
8
8
  err,
9
9
  ok
10
- } from "./chunk-ZP632JYM.js";
10
+ } from "./chunk-RIYFOUW4.js";
11
11
 
12
12
  // src/adapters/sdk/gateway-env.ts
13
13
  function readTrimmed(env, name) {
@@ -315,4 +315,4 @@ export {
315
315
  validateCustomApiBaseUrl,
316
316
  assertCustomApiHostResolvesPublic
317
317
  };
318
- //# sourceMappingURL=chunk-FPDJQYZF.js.map
318
+ //# sourceMappingURL=chunk-5GMAK2H5.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getErrorMessage
3
- } from "./chunk-ZP632JYM.js";
3
+ } from "./chunk-RIYFOUW4.js";
4
4
 
5
5
  // src/cli/setup-config.ts
6
6
  import { copyFileSync, existsSync, mkdirSync, writeFileSync } from "node:fs";
@@ -77,4 +77,4 @@ function ensureBackup(outputPath) {
77
77
  export {
78
78
  runConfigInitSync
79
79
  };
80
- //# sourceMappingURL=chunk-FYJ22FK4.js.map
80
+ //# sourceMappingURL=chunk-6NXLVWML.js.map
@@ -4,7 +4,7 @@ import {
4
4
  err,
5
5
  getErrorMessage,
6
6
  ok
7
- } from "./chunk-ZP632JYM.js";
7
+ } from "./chunk-RIYFOUW4.js";
8
8
 
9
9
  // src/scm/types.ts
10
10
  var ScmError = class extends Error {
@@ -281,4 +281,4 @@ export {
281
281
  ScmError,
282
282
  GitHubProvider
283
283
  };
284
- //# sourceMappingURL=chunk-HIPXSLH6.js.map
284
+ //# sourceMappingURL=chunk-6YB3F2HP.js.map
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  createLogger,
6
6
  getTimeProvider
7
- } from "./chunk-ZP632JYM.js";
7
+ } from "./chunk-RIYFOUW4.js";
8
8
 
9
9
  // src/mcp/tools/scanner-registry-fetcher.ts
10
10
  import { z } from "zod";
@@ -740,4 +740,4 @@ export {
740
740
  generateSecurityPlan,
741
741
  buildPlanFromAnalysis
742
742
  };
743
- //# sourceMappingURL=chunk-JXHGQZHZ.js.map
743
+ //# sourceMappingURL=chunk-7WKMF5VE.js.map
@@ -2,7 +2,7 @@ import {
2
2
  TASK_CATEGORIES,
3
3
  getAdaptiveBonus,
4
4
  getOutcomeStore
5
- } from "./chunk-ZP632JYM.js";
5
+ } from "./chunk-RIYFOUW4.js";
6
6
 
7
7
  // src/cli/doctor-deep.ts
8
8
  var CLI_NAMES = ["claude", "gemini", "codex", "opencode"];
@@ -106,4 +106,4 @@ export {
106
106
  runDeepDiagnostics,
107
107
  formatDeepDiagnostics
108
108
  };
109
- //# sourceMappingURL=chunk-VXL4B5FG.js.map
109
+ //# sourceMappingURL=chunk-BSCTEWWP.js.map
@@ -13,7 +13,7 @@ import {
13
13
  lookupInTreeCapability,
14
14
  ok,
15
15
  resolveRetryAfterMs
16
- } from "./chunk-ZP632JYM.js";
16
+ } from "./chunk-RIYFOUW4.js";
17
17
 
18
18
  // src/config/model-parameter-support.ts
19
19
  function parseClaudeMajorMinor(bareId) {
@@ -834,4 +834,4 @@ export {
834
834
  DEFAULT_COLLECT_STREAM_MAX_CHUNKS,
835
835
  collectStream
836
836
  };
837
- //# sourceMappingURL=chunk-54KBJTS5.js.map
837
+ //# sourceMappingURL=chunk-CNBXEHTN.js.map
@@ -2,7 +2,7 @@ import {
2
2
  CACHE_TIMEOUTS,
3
3
  createLogger,
4
4
  getTimeProvider
5
- } from "./chunk-ZP632JYM.js";
5
+ } from "./chunk-RIYFOUW4.js";
6
6
 
7
7
  // src/security/trust-types.ts
8
8
  import { z } from "zod";
@@ -610,4 +610,4 @@ export {
610
610
  resolveReputationGatingMode,
611
611
  gateWithReputation
612
612
  };
613
- //# sourceMappingURL=chunk-FIJ6IGBP.js.map
613
+ //# sourceMappingURL=chunk-D22SPEEU.js.map
@@ -5,35 +5,35 @@ import {
5
5
  planOptionalParams,
6
6
  requireApiKey,
7
7
  validateApiKeyPresence
8
- } from "./chunk-54KBJTS5.js";
8
+ } from "./chunk-CNBXEHTN.js";
9
9
  import {
10
10
  CUSTOM_API_DEFAULT_MODEL
11
- } from "./chunk-N3CM6SD3.js";
11
+ } from "./chunk-ITMG2I6K.js";
12
12
  import {
13
13
  assertCustomApiHostResolvesPublic,
14
14
  hostnameOf,
15
15
  readGatewayEnv,
16
16
  redactApiKey,
17
17
  validateCustomApiBaseUrl
18
- } from "./chunk-FPDJQYZF.js";
18
+ } from "./chunk-5GMAK2H5.js";
19
19
  import {
20
20
  nexusMkdtempSync
21
21
  } from "./chunk-HERI7LXN.js";
22
22
  import {
23
23
  getAvailabilityCache
24
- } from "./chunk-VEDRL7RF.js";
24
+ } from "./chunk-HLHCNG7B.js";
25
25
  import {
26
26
  extractSystemPrompt
27
27
  } from "./chunk-QZUG667L.js";
28
28
  import {
29
29
  generateHyphenId
30
- } from "./chunk-KM7ZZH63.js";
30
+ } from "./chunk-VXXD6VQI.js";
31
31
  import {
32
32
  CliCircuitBreaker,
33
33
  DEFAULT_CIRCUIT_BREAKER_CONFIG,
34
34
  getCliCircuitBreakerSnapshot,
35
35
  getDefaultCliCircuitBreakerRegistry
36
- } from "./chunk-4MCXZPL5.js";
36
+ } from "./chunk-TQHQMEWO.js";
37
37
  import {
38
38
  CLI_SUBPROCESS_TIMEOUTS,
39
39
  CLI_TIMEOUTS,
@@ -78,7 +78,7 @@ import {
78
78
  resolveRetryAfterMs,
79
79
  retryAfterMsFromContext,
80
80
  warnIfGatewayCostUndeclared
81
- } from "./chunk-ZP632JYM.js";
81
+ } from "./chunk-RIYFOUW4.js";
82
82
  import {
83
83
  parseBoolValue
84
84
  } from "./chunk-RNDHNRSX.js";
@@ -5282,4 +5282,4 @@ export {
5282
5282
  SdkAdapter,
5283
5283
  createAutoAdapter
5284
5284
  };
5285
- //# sourceMappingURL=chunk-DYADW74K.js.map
5285
+ //# sourceMappingURL=chunk-D6MOQULW.js.map
@@ -3,7 +3,7 @@ import {
3
3
  MODEL_IDS,
4
4
  getTimeProvider,
5
5
  resolveModelIdentitySync
6
- } from "./chunk-ZP632JYM.js";
6
+ } from "./chunk-RIYFOUW4.js";
7
7
 
8
8
  // src/config/model-availability.ts
9
9
  var DEFAULT_TTL_MS = 6e4;
@@ -150,4 +150,4 @@ export {
150
150
  resetAvailabilityCache,
151
151
  filterAvailableModels
152
152
  };
153
- //# sourceMappingURL=chunk-VEDRL7RF.js.map
153
+ //# sourceMappingURL=chunk-HLHCNG7B.js.map
@@ -5,7 +5,7 @@ import {
5
5
  MCP_TIMEOUTS,
6
6
  TEST_TIMEOUTS,
7
7
  WORKFLOW_TIMEOUTS
8
- } from "./chunk-ZP632JYM.js";
8
+ } from "./chunk-RIYFOUW4.js";
9
9
  import {
10
10
  createGetToolRateLimit
11
11
  } from "./chunk-RNDHNRSX.js";
@@ -220,4 +220,4 @@ export {
220
220
  CUSTOM_API_DEFAULT_MODEL,
221
221
  DEFAULTS
222
222
  };
223
- //# sourceMappingURL=chunk-N3CM6SD3.js.map
223
+ //# sourceMappingURL=chunk-ITMG2I6K.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-43SBVXRB.js";
3
+ } from "./chunk-2A3CC5SZ.js";
4
4
  import {
5
5
  CACHE_TIMEOUTS,
6
6
  MCP_TIMEOUTS,
@@ -17,7 +17,7 @@ import {
17
17
  getTimeProvider,
18
18
  ok,
19
19
  resolveToolClassGuardMs
20
- } from "./chunk-ZP632JYM.js";
20
+ } from "./chunk-RIYFOUW4.js";
21
21
  import {
22
22
  getNexusDataDir
23
23
  } from "./chunk-RNDHNRSX.js";
@@ -2186,4 +2186,4 @@ export {
2186
2186
  DEFAULT_CONSENSUS_CONFIG,
2187
2187
  ConsensusMetricsSchema
2188
2188
  };
2189
- //# sourceMappingURL=chunk-J2UPT4QH.js.map
2189
+ //# sourceMappingURL=chunk-JSR6RFWB.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  SERVES_PROBE_PROMPT
3
- } from "./chunk-A5GEH5FM.js";
3
+ } from "./chunk-XSWKTCGW.js";
4
4
  import {
5
5
  readOpenAICompatEndpoint,
6
6
  readOpenAICompatEnv
7
- } from "./chunk-IMUIPM5L.js";
7
+ } from "./chunk-X7ZAI75Z.js";
8
8
  import {
9
9
  allOf
10
10
  } from "./chunk-OQB3XC5O.js";
@@ -12,10 +12,10 @@ import {
12
12
  NODE_ENGINE_RANGE,
13
13
  VERSION,
14
14
  isNodeVersionSupported
15
- } from "./chunk-43SBVXRB.js";
15
+ } from "./chunk-2A3CC5SZ.js";
16
16
  import {
17
17
  claimGlobalRegistry
18
- } from "./chunk-BHNNGFEQ.js";
18
+ } from "./chunk-OM62MDMA.js";
19
19
  import {
20
20
  capitalize
21
21
  } from "./chunk-7LP6VJRP.js";
@@ -26,10 +26,10 @@ import {
26
26
  codexMcpServerAvailable,
27
27
  createAllAdapters,
28
28
  probeCli
29
- } from "./chunk-DYADW74K.js";
29
+ } from "./chunk-D6MOQULW.js";
30
30
  import {
31
31
  resolveGatewayEnv
32
- } from "./chunk-FPDJQYZF.js";
32
+ } from "./chunk-5GMAK2H5.js";
33
33
  import {
34
34
  getNexusTmpDir
35
35
  } from "./chunk-HERI7LXN.js";
@@ -57,7 +57,7 @@ import {
57
57
  resolveGatewayCostDeclaration,
58
58
  symbols,
59
59
  writeLine
60
- } from "./chunk-ZP632JYM.js";
60
+ } from "./chunk-RIYFOUW4.js";
61
61
  import {
62
62
  getLearningDir,
63
63
  getOutcomesFile,
@@ -1372,13 +1372,13 @@ async function runDoctorFix(result) {
1372
1372
  writeLine2("\u2500".repeat(40));
1373
1373
  let fixCount = 0;
1374
1374
  if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
1375
- const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-YPQVED6C.js");
1375
+ const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-YMU6OBUA.js");
1376
1376
  const outcome = describeDataDirFix2(initDataDirectories2());
1377
1377
  writeLine2(outcome.line);
1378
1378
  if (outcome.counted) fixCount++;
1379
1379
  }
1380
1380
  if (!result.configFile.found) {
1381
- const { runConfigInitSync } = await import("./setup-config-5K67D6CO.js");
1381
+ const { runConfigInitSync } = await import("./setup-config-FTKTKSHZ.js");
1382
1382
  const configResult = runConfigInitSync(process.cwd(), false, false);
1383
1383
  if (configResult.success && configResult.created) {
1384
1384
  writeLine2(`\u2713 Generated config: ${configResult.path}`);
@@ -1474,4 +1474,4 @@ export {
1474
1474
  startStdioServer,
1475
1475
  closeServer
1476
1476
  };
1477
- //# sourceMappingURL=chunk-QAE6CXFB.js.map
1477
+ //# sourceMappingURL=chunk-L7KWTUF7.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isGatewayModelAdapter
3
- } from "./chunk-IMUIPM5L.js";
3
+ } from "./chunk-X7ZAI75Z.js";
4
4
  import {
5
5
  allOf
6
6
  } from "./chunk-OQB3XC5O.js";
@@ -24,20 +24,20 @@ import {
24
24
  toolSuccessStructured,
25
25
  withProgressHeartbeat,
26
26
  wrapToolWithTimeout
27
- } from "./chunk-J2UPT4QH.js";
27
+ } from "./chunk-JSR6RFWB.js";
28
28
  import {
29
29
  VERSION
30
- } from "./chunk-43SBVXRB.js";
30
+ } from "./chunk-2A3CC5SZ.js";
31
31
  import {
32
32
  UNRESOLVED_MODEL_ID,
33
33
  assessPanelIndependence,
34
34
  countDistinctModels,
35
35
  createEvent,
36
36
  getGlobalRegistry
37
- } from "./chunk-BHNNGFEQ.js";
37
+ } from "./chunk-OM62MDMA.js";
38
38
  import {
39
39
  getToolMemory
40
- } from "./chunk-AAW6JINR.js";
40
+ } from "./chunk-X5CLL6FQ.js";
41
41
  import {
42
42
  authRemediation,
43
43
  classifyExtractedError,
@@ -48,7 +48,7 @@ import {
48
48
  sanitizeOutput,
49
49
  sleep,
50
50
  withTimeout
51
- } from "./chunk-DYADW74K.js";
51
+ } from "./chunk-D6MOQULW.js";
52
52
  import {
53
53
  AgentError,
54
54
  CLI_NAMES,
@@ -57,6 +57,7 @@ import {
57
57
  OPERATION_CLASSES,
58
58
  OutcomeStore,
59
59
  TaskOutcomeSchema,
60
+ UNDECLARED_OPTIONS_EXCERPT_CHARS,
60
61
  VOTE_TIMEOUTS,
61
62
  categorizeOutcomeErrorMessage,
62
63
  clamp01,
@@ -81,7 +82,7 @@ import {
81
82
  registerPersistentOutcomeStoreFactory,
82
83
  resolveClassGuardMs,
83
84
  resolveVoteTimeout
84
- } from "./chunk-ZP632JYM.js";
85
+ } from "./chunk-RIYFOUW4.js";
85
86
  import {
86
87
  ensureLearningDir,
87
88
  getOutcomesFile
@@ -6032,7 +6033,7 @@ function singleModelPanelWarning(votes) {
6032
6033
  }
6033
6034
 
6034
6035
  // src/mcp/tools/consensus-vote-option-detection.ts
6035
- var MULTI_OPTION_PATTERNS = Object.freeze([
6036
+ var UNDECLARED_OPTION_PATTERNS = Object.freeze([
6036
6037
  // `Option A` and `OPTION A`, but NOT `option a` — the lowercase form appears
6037
6038
  // in ordinary prose ("there is no option a caller can set"), the capitalised
6038
6039
  // form is a heading. The motivating proposal used `Option A`; an
@@ -6043,10 +6044,32 @@ var MULTI_OPTION_PATTERNS = Object.freeze([
6043
6044
  /\bpick exactly one\b/i,
6044
6045
  /\bvote for exactly one\b/i
6045
6046
  ]);
6047
+ function excerptAround(text, start, end) {
6048
+ const width = UNDECLARED_OPTIONS_EXCERPT_CHARS;
6049
+ if (text.length <= width) return text;
6050
+ const slack = Math.max(0, width - (end - start));
6051
+ let from = Math.max(0, start - Math.floor(slack / 2));
6052
+ const to = Math.min(text.length, from + width);
6053
+ from = Math.max(0, to - width);
6054
+ return text.slice(from, to);
6055
+ }
6056
+ function detectUndeclaredOptions(proposal, declaredOptions) {
6057
+ if (declaredOptions !== void 0 && declaredOptions.length > 0) return { fired: false };
6058
+ if (proposal === "") return { fired: false };
6059
+ for (const pattern of UNDECLARED_OPTION_PATTERNS) {
6060
+ const match = pattern.exec(proposal);
6061
+ if (match === null) continue;
6062
+ const start = match.index;
6063
+ return {
6064
+ fired: true,
6065
+ pattern: String(pattern),
6066
+ excerpt: excerptAround(proposal, start, start + match[0].length)
6067
+ };
6068
+ }
6069
+ return { fired: false };
6070
+ }
6046
6071
  function checkUndeclaredOptions(proposal, declaredOptions, allEngagedApproved) {
6047
- if (declaredOptions !== void 0 && declaredOptions.length > 0) return { flagged: false };
6048
- if (proposal === "") return { flagged: false };
6049
- if (!MULTI_OPTION_PATTERNS.some((p) => p.test(proposal))) return { flagged: false };
6072
+ if (!detectUndeclaredOptions(proposal, declaredOptions).fired) return { flagged: false };
6050
6073
  const base = "This proposal appears to name alternatives, but `options` was not declared, so the tally records approve/reject only and cannot say WHICH alternative won (#4452, #5360). Re-run with `options` to record the option tally.";
6051
6074
  return {
6052
6075
  flagged: true,
@@ -6410,7 +6433,7 @@ function logPartialProposal(bounded, log) {
6410
6433
  }
6411
6434
  async function runContrarianCheck(proposal, log, opts) {
6412
6435
  try {
6413
- const { executeExpert } = await import("./expert-bridge-2YX2YOJO.js");
6436
+ const { executeExpert } = await import("./expert-bridge-7C7JYDQK.js");
6414
6437
  const bounded = boundArtifactForReview(proposal, CONTRARIAN_PROPOSAL_BUDGET, "proposal");
6415
6438
  logPartialProposal(bounded, log);
6416
6439
  const result = await executeExpert("architecture", buildContrarianPrompt(bounded, opts), {
@@ -6785,7 +6808,7 @@ function parseVoteRecordsText(text) {
6785
6808
  }
6786
6809
 
6787
6810
  // src/orchestration/outcomes/outcome-store-persistence.ts
6788
- import { appendFileSync as appendFileSync3, readFileSync as readFileSync4, writeFileSync as writeFileSync2, existsSync as existsSync3 } from "node:fs";
6811
+ import { appendFileSync as appendFileSync3, readFileSync as readFileSync4, writeFileSync, existsSync as existsSync3 } from "node:fs";
6789
6812
  var PersistentOutcomeStore = class extends OutcomeStore {
6790
6813
  filePath;
6791
6814
  logger;
@@ -6884,7 +6907,7 @@ var PersistentOutcomeStore = class extends OutcomeStore {
6884
6907
  try {
6885
6908
  const entries = this.query();
6886
6909
  const content = entries.map((e) => JSON.stringify(e)).join("\n") + "\n";
6887
- writeFileSync2(this.filePath, content, "utf-8");
6910
+ writeFileSync(this.filePath, content, "utf-8");
6888
6911
  } catch (error) {
6889
6912
  const msg = getErrorMessage(error);
6890
6913
  this.logger.warn("Failed to rewrite outcomes file after reclassification", {
@@ -7111,7 +7134,8 @@ function recordDecisionCost(options) {
7111
7134
  gate: options.gate,
7112
7135
  voters,
7113
7136
  billingMode,
7114
- timestamp
7137
+ timestamp,
7138
+ ...options.undeclaredOptionsDetector !== void 0 ? { undeclaredOptionsDetector: options.undeclaredOptionsDetector } : {}
7115
7139
  });
7116
7140
  if (!persisted) {
7117
7141
  droppedCostRecordCount += 1;
@@ -7194,15 +7218,15 @@ import {
7194
7218
  existsSync as existsSync5,
7195
7219
  readFileSync as readFileSync6,
7196
7220
  readdirSync,
7197
- unlinkSync as unlinkSync2,
7198
- writeFileSync as writeFileSync4,
7221
+ unlinkSync,
7222
+ writeFileSync as writeFileSync3,
7199
7223
  chmodSync
7200
7224
  } from "node:fs";
7201
7225
  import { z as z13 } from "zod";
7202
7226
 
7203
7227
  // src/mcp/jobs/job-idempotency.ts
7204
7228
  import { createHash as createHash3, randomUUID } from "node:crypto";
7205
- import { existsSync as existsSync4, readFileSync as readFileSync5, writeFileSync as writeFileSync3 } from "node:fs";
7229
+ import { existsSync as existsSync4, readFileSync as readFileSync5, writeFileSync as writeFileSync2 } from "node:fs";
7206
7230
  import { z as z12 } from "zod";
7207
7231
  var logger7 = createLogger({ component: "job-idempotency" });
7208
7232
  var IdempotencyIndexEntrySchema = z12.object({
@@ -7279,7 +7303,7 @@ function registerIdempotentJob(params) {
7279
7303
  jobId: params.jobId,
7280
7304
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
7281
7305
  };
7282
- writeFileSync3(path2, JSON.stringify(entry, null, 2));
7306
+ writeFileSync2(path2, JSON.stringify(entry, null, 2));
7283
7307
  logger7.debug("Wrote idempotency index entry", { tool: params.tool, jobId: params.jobId });
7284
7308
  }
7285
7309
  function shortCircuitOrFreshJobId(params) {
@@ -7407,7 +7431,7 @@ function jobResultPath(jobId) {
7407
7431
  return nexusDataPathEnsure("jobs", `result-${jobId}.json`);
7408
7432
  }
7409
7433
  function persistJobRecord(path2, record) {
7410
- writeFileSync4(path2, JSON.stringify(record, null, 2), { mode: 384 });
7434
+ writeFileSync3(path2, JSON.stringify(record, null, 2), { mode: 384 });
7411
7435
  chmodSync(path2, 384);
7412
7436
  }
7413
7437
  function writeJobPending(jobId, toolName, signalAccepted, producerVersion = VERSION) {
@@ -7594,7 +7618,7 @@ function sweepRecord(jobId, entry, sweep) {
7594
7618
  }
7595
7619
  const settledAt = record.completedAt ?? record.createdAt;
7596
7620
  if (!isOlderThan(settledAt, sweep.nowMs, sweep.retentionMs)) return "kept";
7597
- if (!sweep.dryRun) unlinkSync2(path2);
7621
+ if (!sweep.dryRun) unlinkSync(path2);
7598
7622
  return "deleted";
7599
7623
  }
7600
7624
  function sweepKeyEntry(entry, removedJobIds, sweep) {
@@ -7604,7 +7628,7 @@ function sweepKeyEntry(entry, removedJobIds, sweep) {
7604
7628
  if (!isOlderThan(indexEntry.createdAt, sweep.nowMs, sweep.retentionMs)) return null;
7605
7629
  const recordGone = removedJobIds.has(indexEntry.jobId) || !existsSync5(nexusDataPath("jobs", `result-${indexEntry.jobId}.json`));
7606
7630
  if (!recordGone) return null;
7607
- if (!sweep.dryRun) unlinkSync2(path2);
7631
+ if (!sweep.dryRun) unlinkSync(path2);
7608
7632
  return "deletedKeys";
7609
7633
  }
7610
7634
  function isOlderThan(isoTimestamp, nowMs, windowMs) {
@@ -8750,7 +8774,20 @@ function recordVoteSideEffects(proposal, strategy, result, logger11, declared) {
8750
8774
  });
8751
8775
  let costSummary;
8752
8776
  try {
8753
- costSummary = recordDecisionCost({ decisionId, gate: "consensus_vote", votes: result.votes });
8777
+ costSummary = recordDecisionCost({
8778
+ decisionId,
8779
+ gate: "consensus_vote",
8780
+ votes: result.votes,
8781
+ // #5422: the detector's verdict, recorded on EVERY vote so the not-fired
8782
+ // rows are the denominator. Computed here, where the FULL proposal is in
8783
+ // hand — the ledger keeps a 503-char preview, which is why precision
8784
+ // cannot be measured there. Same patterns as the `panelWarning` in
8785
+ // `buildResponse`, so the measured precision is the warning's precision.
8786
+ undeclaredOptionsDetector: {
8787
+ ...detectUndeclaredOptions(proposal, declared.options),
8788
+ declaredOptionCount: declared.options?.length ?? 0
8789
+ }
8790
+ });
8754
8791
  } catch (costError) {
8755
8792
  logger11.warn("Per-decision cost rollup failed (non-fatal)", {
8756
8793
  error: getErrorMessage(costError)
@@ -9188,4 +9225,4 @@ export {
9188
9225
  CONSENSUS_VOTE_TOOL_SCHEMA,
9189
9226
  registerConsensusVoteTool
9190
9227
  };
9191
- //# sourceMappingURL=chunk-JJEKTXCT.js.map
9228
+ //# sourceMappingURL=chunk-LZXMWS5C.js.map