nexus-agents 8.130.4 → 8.130.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.
- package/dist/{ast-rule-runner-P42U5PCG.js → ast-rule-runner-EZSJT4GQ.js} +3 -3
- package/dist/{child-mcp-config-JVBLHGPR.js → child-mcp-config-PBZHDHVK.js} +33 -9
- package/dist/child-mcp-config-PBZHDHVK.js.map +1 -0
- package/dist/{chunk-5MNTAXZ4.js → chunk-243T5S2C.js} +2 -2
- package/dist/{chunk-QYQ2V6YD.js → chunk-2EA4S4UY.js} +2 -2
- package/dist/{chunk-GNDVHJBG.js → chunk-2TLL6TQQ.js} +3 -3
- package/dist/{chunk-JOYN26BG.js → chunk-4Z2JSMPB.js} +2 -2
- package/dist/{chunk-RO572OKZ.js → chunk-5DTE5EGF.js} +5 -5
- package/dist/{chunk-BMFPFCDH.js → chunk-7TFJLA5G.js} +2 -2
- package/dist/{chunk-2FHR7KX7.js → chunk-7YP7UNWL.js} +44 -44
- package/dist/chunk-7YP7UNWL.js.map +1 -0
- package/dist/{chunk-HVZG3LD2.js → chunk-APPW6S7M.js} +39 -44
- package/dist/chunk-APPW6S7M.js.map +1 -0
- package/dist/{chunk-TPUD2XJI.js → chunk-D5CIAWZ7.js} +2 -2
- package/dist/{chunk-3P3VEM43.js → chunk-EDTTLHNL.js} +3 -3
- package/dist/{chunk-4E6XQ2SN.js → chunk-H6XT6CZR.js} +2 -2
- package/dist/{chunk-OITVVSWO.js → chunk-JPFRRNRR.js} +2 -7
- package/dist/{chunk-OITVVSWO.js.map → chunk-JPFRRNRR.js.map} +1 -1
- package/dist/{chunk-G2OCXWFR.js → chunk-K3QOPEBF.js} +2 -2
- package/dist/{chunk-A3VN5QVF.js → chunk-K6K5V3XV.js} +2 -2
- package/dist/{chunk-Y7SY74LP.js → chunk-KGPQJ3UA.js} +2 -2
- package/dist/{chunk-Z7I6DJ3A.js → chunk-KSAIBUUI.js} +42 -42
- package/dist/{chunk-BLBAXXM7.js → chunk-L3AO3BT4.js} +2 -2
- package/dist/{chunk-S7AXE7JM.js → chunk-NU6ZVBEZ.js} +5 -5
- package/dist/{chunk-VGGRQQ4L.js → chunk-OSOW6DH4.js} +3 -3
- package/dist/{chunk-Z7QFPQSU.js → chunk-QII3PDIC.js} +2 -2
- package/dist/{chunk-JIB54TK5.js → chunk-R7JFXOU3.js} +11 -11
- package/dist/{chunk-4IKZ55E7.js → chunk-RWXDQACL.js} +3 -3
- package/dist/{chunk-ZRB3WUEW.js → chunk-RYJ6DFUB.js} +4 -4
- package/dist/{chunk-WVYS34G3.js → chunk-RZJA6GTZ.js} +4 -4
- package/dist/{chunk-KPRUVLLV.js → chunk-S4S4VLJN.js} +5 -5
- package/dist/{chunk-222HCPM2.js → chunk-S77X4QRM.js} +2 -2
- package/dist/{chunk-5FUAP5RK.js → chunk-SGU3LXML.js} +10 -10
- package/dist/{chunk-6SGB2REH.js → chunk-STM4UKX5.js} +4 -4
- package/dist/{chunk-LEWJQLEC.js → chunk-STS7KLBD.js} +3 -3
- package/dist/{chunk-HTGUGK3T.js → chunk-TA7H2DKY.js} +2 -2
- package/dist/{chunk-QDGM3LNQ.js → chunk-UEE5B7ZS.js} +4 -4
- package/dist/{chunk-NC2Z3ULV.js → chunk-UMEWQYSE.js} +6 -6
- package/dist/{chunk-X2WDNE4Q.js → chunk-VMMSCZ5K.js} +4 -4
- package/dist/{chunk-JMH4TL22.js → chunk-XKIOI7ID.js} +2 -2
- package/dist/{chunk-BVNRU5WX.js → chunk-XXCJ4VPU.js} +5 -5
- package/dist/{chunk-UMFH67CM.js → chunk-YVBA73EL.js} +2 -2
- package/dist/{cli-circuit-breaker-UEC7ORHN.js → cli-circuit-breaker-EUH6WOHP.js} +3 -3
- package/dist/cli.js +55 -51
- package/dist/cli.js.map +1 -1
- package/dist/{composite-router-RH4X5EDO.js → composite-router-5V2WB445.js} +2 -2
- package/dist/{consensus-vote-NM4MNYSM.js → consensus-vote-ZRTTSQKH.js} +18 -18
- package/dist/{context-retriever-35Z4IWT5.js → context-retriever-GU2GEQG3.js} +8 -8
- package/dist/{doctor-deep-X6NMJBPO.js → doctor-deep-LYOGINVN.js} +3 -3
- package/dist/{doctor-gateway-report-V2CUP7A6.js → doctor-gateway-report-ZZLWOCS2.js} +8 -8
- package/dist/{doctor-live-TMIGJPAW.js → doctor-live-VP3J66WQ.js} +12 -12
- package/dist/{expert-bridge-3QEMUXT5.js → expert-bridge-SWIS4YIE.js} +4 -4
- package/dist/{factory-DKKMM223.js → factory-CT3RMGOI.js} +11 -11
- package/dist/{factory-7ZWGRFEK.js → factory-TM2G72M5.js} +5 -5
- package/dist/{improvement-review-DUMMWRNW.js → improvement-review-GALIOWWL.js} +6 -6
- package/dist/index.js +33 -33
- package/dist/{init-opencode-477R7MU7.js → init-opencode-MHPNBK6J.js} +6 -6
- package/dist/{issue-triage-6M6X5LE3.js → issue-triage-GYYX36F2.js} +6 -6
- package/dist/{openai-compat-adapter-FSBJXHKI.js → openai-compat-adapter-6EOYWQ4W.js} +6 -6
- package/dist/{outcome-store-adapter-AL5RDO5W.js → outcome-store-adapter-4XDTZV3H.js} +2 -2
- package/dist/{pr-reviewer-helpers-HFV72QPJ.js → pr-reviewer-helpers-QVFFEZFH.js} +4 -4
- package/dist/{registry-command-6ESIA7FU.js → registry-command-N6UI2MZR.js} +2 -2
- package/dist/{repo-security-plan-5EN7SUGD.js → repo-security-plan-HOBHOF6L.js} +3 -3
- package/dist/{research-helpers-synthesize-UUNI5KE3.js → research-helpers-synthesize-MMKCQWJW.js} +4 -4
- package/dist/{routing-memory-JFWDOQKF.js → routing-memory-TWRTPLVA.js} +2 -2
- package/dist/{session-memory-YDBEKS2R.js → session-memory-6ESI25NN.js} +3 -3
- package/dist/{setup-config-TJCZYWYQ.js → setup-config-PZSZBB2E.js} +3 -3
- package/dist/{setup-custom-api-AQNOF4GK.js → setup-custom-api-4QG765OZ.js} +4 -4
- package/dist/setup-data-dir-PN2K7QCA.js +33 -0
- package/dist/{tool-memory-4UZ64PAP.js → tool-memory-TDXXTV27.js} +5 -5
- package/dist/{unified-registry-I3GWI6VY.js → unified-registry-Y4PJ2MTE.js} +12 -12
- package/dist/{weather-report-AZXWBBJN.js → weather-report-JKEHPRVU.js} +2 -2
- package/package.json +1 -1
- package/dist/child-mcp-config-JVBLHGPR.js.map +0 -1
- package/dist/chunk-2FHR7KX7.js.map +0 -1
- package/dist/chunk-HVZG3LD2.js.map +0 -1
- package/dist/setup-data-dir-AHEIUZMI.js +0 -33
- /package/dist/{ast-rule-runner-P42U5PCG.js.map → ast-rule-runner-EZSJT4GQ.js.map} +0 -0
- /package/dist/{chunk-5MNTAXZ4.js.map → chunk-243T5S2C.js.map} +0 -0
- /package/dist/{chunk-QYQ2V6YD.js.map → chunk-2EA4S4UY.js.map} +0 -0
- /package/dist/{chunk-GNDVHJBG.js.map → chunk-2TLL6TQQ.js.map} +0 -0
- /package/dist/{chunk-JOYN26BG.js.map → chunk-4Z2JSMPB.js.map} +0 -0
- /package/dist/{chunk-RO572OKZ.js.map → chunk-5DTE5EGF.js.map} +0 -0
- /package/dist/{chunk-BMFPFCDH.js.map → chunk-7TFJLA5G.js.map} +0 -0
- /package/dist/{chunk-TPUD2XJI.js.map → chunk-D5CIAWZ7.js.map} +0 -0
- /package/dist/{chunk-3P3VEM43.js.map → chunk-EDTTLHNL.js.map} +0 -0
- /package/dist/{chunk-4E6XQ2SN.js.map → chunk-H6XT6CZR.js.map} +0 -0
- /package/dist/{chunk-G2OCXWFR.js.map → chunk-K3QOPEBF.js.map} +0 -0
- /package/dist/{chunk-A3VN5QVF.js.map → chunk-K6K5V3XV.js.map} +0 -0
- /package/dist/{chunk-Y7SY74LP.js.map → chunk-KGPQJ3UA.js.map} +0 -0
- /package/dist/{chunk-Z7I6DJ3A.js.map → chunk-KSAIBUUI.js.map} +0 -0
- /package/dist/{chunk-BLBAXXM7.js.map → chunk-L3AO3BT4.js.map} +0 -0
- /package/dist/{chunk-S7AXE7JM.js.map → chunk-NU6ZVBEZ.js.map} +0 -0
- /package/dist/{chunk-VGGRQQ4L.js.map → chunk-OSOW6DH4.js.map} +0 -0
- /package/dist/{chunk-Z7QFPQSU.js.map → chunk-QII3PDIC.js.map} +0 -0
- /package/dist/{chunk-JIB54TK5.js.map → chunk-R7JFXOU3.js.map} +0 -0
- /package/dist/{chunk-4IKZ55E7.js.map → chunk-RWXDQACL.js.map} +0 -0
- /package/dist/{chunk-ZRB3WUEW.js.map → chunk-RYJ6DFUB.js.map} +0 -0
- /package/dist/{chunk-WVYS34G3.js.map → chunk-RZJA6GTZ.js.map} +0 -0
- /package/dist/{chunk-KPRUVLLV.js.map → chunk-S4S4VLJN.js.map} +0 -0
- /package/dist/{chunk-222HCPM2.js.map → chunk-S77X4QRM.js.map} +0 -0
- /package/dist/{chunk-5FUAP5RK.js.map → chunk-SGU3LXML.js.map} +0 -0
- /package/dist/{chunk-6SGB2REH.js.map → chunk-STM4UKX5.js.map} +0 -0
- /package/dist/{chunk-LEWJQLEC.js.map → chunk-STS7KLBD.js.map} +0 -0
- /package/dist/{chunk-HTGUGK3T.js.map → chunk-TA7H2DKY.js.map} +0 -0
- /package/dist/{chunk-QDGM3LNQ.js.map → chunk-UEE5B7ZS.js.map} +0 -0
- /package/dist/{chunk-NC2Z3ULV.js.map → chunk-UMEWQYSE.js.map} +0 -0
- /package/dist/{chunk-X2WDNE4Q.js.map → chunk-VMMSCZ5K.js.map} +0 -0
- /package/dist/{chunk-JMH4TL22.js.map → chunk-XKIOI7ID.js.map} +0 -0
- /package/dist/{chunk-BVNRU5WX.js.map → chunk-XXCJ4VPU.js.map} +0 -0
- /package/dist/{chunk-UMFH67CM.js.map → chunk-YVBA73EL.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-UEC7ORHN.js.map → cli-circuit-breaker-EUH6WOHP.js.map} +0 -0
- /package/dist/{composite-router-RH4X5EDO.js.map → composite-router-5V2WB445.js.map} +0 -0
- /package/dist/{consensus-vote-NM4MNYSM.js.map → consensus-vote-ZRTTSQKH.js.map} +0 -0
- /package/dist/{context-retriever-35Z4IWT5.js.map → context-retriever-GU2GEQG3.js.map} +0 -0
- /package/dist/{doctor-deep-X6NMJBPO.js.map → doctor-deep-LYOGINVN.js.map} +0 -0
- /package/dist/{doctor-gateway-report-V2CUP7A6.js.map → doctor-gateway-report-ZZLWOCS2.js.map} +0 -0
- /package/dist/{doctor-live-TMIGJPAW.js.map → doctor-live-VP3J66WQ.js.map} +0 -0
- /package/dist/{expert-bridge-3QEMUXT5.js.map → expert-bridge-SWIS4YIE.js.map} +0 -0
- /package/dist/{factory-7ZWGRFEK.js.map → factory-CT3RMGOI.js.map} +0 -0
- /package/dist/{factory-DKKMM223.js.map → factory-TM2G72M5.js.map} +0 -0
- /package/dist/{improvement-review-DUMMWRNW.js.map → improvement-review-GALIOWWL.js.map} +0 -0
- /package/dist/{init-opencode-477R7MU7.js.map → init-opencode-MHPNBK6J.js.map} +0 -0
- /package/dist/{issue-triage-6M6X5LE3.js.map → issue-triage-GYYX36F2.js.map} +0 -0
- /package/dist/{openai-compat-adapter-FSBJXHKI.js.map → openai-compat-adapter-6EOYWQ4W.js.map} +0 -0
- /package/dist/{outcome-store-adapter-AL5RDO5W.js.map → outcome-store-adapter-4XDTZV3H.js.map} +0 -0
- /package/dist/{pr-reviewer-helpers-HFV72QPJ.js.map → pr-reviewer-helpers-QVFFEZFH.js.map} +0 -0
- /package/dist/{registry-command-6ESIA7FU.js.map → registry-command-N6UI2MZR.js.map} +0 -0
- /package/dist/{repo-security-plan-5EN7SUGD.js.map → repo-security-plan-HOBHOF6L.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-UUNI5KE3.js.map → research-helpers-synthesize-MMKCQWJW.js.map} +0 -0
- /package/dist/{routing-memory-JFWDOQKF.js.map → routing-memory-TWRTPLVA.js.map} +0 -0
- /package/dist/{session-memory-YDBEKS2R.js.map → session-memory-6ESI25NN.js.map} +0 -0
- /package/dist/{setup-config-TJCZYWYQ.js.map → setup-config-PZSZBB2E.js.map} +0 -0
- /package/dist/{setup-custom-api-AQNOF4GK.js.map → setup-custom-api-4QG765OZ.js.map} +0 -0
- /package/dist/{setup-data-dir-AHEIUZMI.js.map → setup-data-dir-PN2K7QCA.js.map} +0 -0
- /package/dist/{tool-memory-4UZ64PAP.js.map → tool-memory-TDXXTV27.js.map} +0 -0
- /package/dist/{unified-registry-I3GWI6VY.js.map → unified-registry-Y4PJ2MTE.js.map} +0 -0
- /package/dist/{weather-report-AZXWBBJN.js.map → weather-report-JKEHPRVU.js.map} +0 -0
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
getBuiltInAstRulesPath,
|
|
10
10
|
loadRules,
|
|
11
11
|
runAstQaRules
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-D5CIAWZ7.js";
|
|
13
|
+
import "./chunk-RYJ6DFUB.js";
|
|
14
14
|
import "./chunk-XBEKMUTO.js";
|
|
15
15
|
import "./chunk-UE7A2XHM.js";
|
|
16
16
|
import "./chunk-LWOX65CP.js";
|
|
@@ -27,4 +27,4 @@ export {
|
|
|
27
27
|
loadRules,
|
|
28
28
|
runAstQaRules
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=ast-rule-runner-
|
|
30
|
+
//# sourceMappingURL=ast-rule-runner-EZSJT4GQ.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
nexusMkdtempSync
|
|
3
|
+
} from "./chunk-JPFRRNRR.js";
|
|
4
4
|
import {
|
|
5
5
|
createLogger
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RYJ6DFUB.js";
|
|
7
7
|
import "./chunk-XBEKMUTO.js";
|
|
8
8
|
import "./chunk-UE7A2XHM.js";
|
|
9
9
|
import "./chunk-LWOX65CP.js";
|
|
@@ -11,8 +11,21 @@ import "./chunk-PX6F3LHL.js";
|
|
|
11
11
|
|
|
12
12
|
// src/cli-adapters/child-mcp-config.ts
|
|
13
13
|
import { writeFile, rm } from "node:fs/promises";
|
|
14
|
+
import { rmSync } from "node:fs";
|
|
14
15
|
import { join } from "node:path";
|
|
15
16
|
var logger = createLogger({ component: "swe-bench-mcp-config" });
|
|
17
|
+
var activeMcpDirs = /* @__PURE__ */ new Set();
|
|
18
|
+
function cleanupOnExit() {
|
|
19
|
+
for (const dir of activeMcpDirs) {
|
|
20
|
+
try {
|
|
21
|
+
rmSync(dir, { recursive: true, force: true });
|
|
22
|
+
} catch (error) {
|
|
23
|
+
logger.debug("MCP-config exit cleanup failed", {
|
|
24
|
+
error: error instanceof Error ? error.message : String(error)
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
16
29
|
function resolveCliPath(override) {
|
|
17
30
|
if (override !== void 0) return override;
|
|
18
31
|
const distDir = join(__dirname, "..");
|
|
@@ -35,19 +48,30 @@ function buildConfig(options) {
|
|
|
35
48
|
}
|
|
36
49
|
async function generateMcpConfig(options) {
|
|
37
50
|
const config = buildConfig(options);
|
|
38
|
-
const tempDir =
|
|
51
|
+
const tempDir = nexusMkdtempSync("nexus-mcp-");
|
|
39
52
|
const configPath = join(tempDir, "mcp-config.json");
|
|
40
|
-
|
|
53
|
+
if (activeMcpDirs.size === 0) process.on("exit", cleanupOnExit);
|
|
54
|
+
activeMcpDirs.add(tempDir);
|
|
41
55
|
const cleanup = async () => {
|
|
42
|
-
|
|
56
|
+
try {
|
|
57
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
58
|
+
activeMcpDirs.delete(tempDir);
|
|
59
|
+
if (activeMcpDirs.size === 0) process.removeListener("exit", cleanupOnExit);
|
|
60
|
+
} catch (e) {
|
|
43
61
|
logger.debug("Best-effort cleanup failed", {
|
|
44
62
|
error: e instanceof Error ? e.message : String(e)
|
|
45
63
|
});
|
|
46
|
-
}
|
|
64
|
+
}
|
|
47
65
|
};
|
|
48
|
-
|
|
66
|
+
try {
|
|
67
|
+
await writeFile(configPath, JSON.stringify(config, null, 2), "utf-8");
|
|
68
|
+
return { configPath, cleanup };
|
|
69
|
+
} catch (error) {
|
|
70
|
+
await cleanup();
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
49
73
|
}
|
|
50
74
|
export {
|
|
51
75
|
generateMcpConfig
|
|
52
76
|
};
|
|
53
|
-
//# sourceMappingURL=child-mcp-config-
|
|
77
|
+
//# sourceMappingURL=child-mcp-config-PBZHDHVK.js.map
|
|
@@ -0,0 +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 { rmSync } from 'node:fs';\nimport { nexusMkdtempSync } 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// Async finally blocks cannot run after process.exit (#4631). One listener\n// covers concurrent configs; SIGKILL cannot execute any in-process cleanup.\nconst activeMcpDirs = new Set<string>();\n\nfunction cleanupOnExit(): void {\n for (const dir of activeMcpDirs) {\n try {\n rmSync(dir, { recursive: true, force: true });\n } catch (error: unknown) {\n logger.debug('MCP-config exit cleanup failed', {\n error: error instanceof Error ? error.message : String(error),\n });\n }\n }\n}\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 // Creation and exit registration must occur in one turn: async mkdtemp\n // can finish in its worker before JS can register cleanup (#4631).\n const tempDir = nexusMkdtempSync('nexus-mcp-');\n const configPath = join(tempDir, 'mcp-config.json');\n\n if (activeMcpDirs.size === 0) process.on('exit', cleanupOnExit);\n activeMcpDirs.add(tempDir);\n\n const cleanup = async (): Promise<void> => {\n try {\n await rm(tempDir, { recursive: true, force: true });\n activeMcpDirs.delete(tempDir);\n if (activeMcpDirs.size === 0) process.removeListener('exit', cleanupOnExit);\n } catch (e: unknown) {\n logger.debug('Best-effort cleanup failed', {\n error: e instanceof Error ? e.message : String(e),\n });\n }\n };\n\n try {\n await writeFile(configPath, JSON.stringify(config, null, 2), 'utf-8');\n return { configPath, cleanup };\n } catch (error: unknown) {\n await cleanup();\n throw error;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,SAAS,WAAW,UAAU;AAC9B,SAAS,cAAc;AAEvB,SAAS,YAAY;AAGrB,IAAM,SAAS,aAAa,EAAE,WAAW,uBAAuB,CAAC;AAIjE,IAAM,gBAAgB,oBAAI,IAAY;AAEtC,SAAS,gBAAsB;AAC7B,aAAW,OAAO,eAAe;AAC/B,QAAI;AACF,aAAO,KAAK,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AAAA,IAC9C,SAAS,OAAgB;AACvB,aAAO,MAAM,kCAAkC;AAAA,QAC7C,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,MAC9D,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAgCA,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;AAIlC,QAAM,UAAU,iBAAiB,YAAY;AAC7C,QAAM,aAAa,KAAK,SAAS,iBAAiB;AAElD,MAAI,cAAc,SAAS,EAAG,SAAQ,GAAG,QAAQ,aAAa;AAC9D,gBAAc,IAAI,OAAO;AAEzB,QAAM,UAAU,YAA2B;AACzC,QAAI;AACF,YAAM,GAAG,SAAS,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AAClD,oBAAc,OAAO,OAAO;AAC5B,UAAI,cAAc,SAAS,EAAG,SAAQ,eAAe,QAAQ,aAAa;AAAA,IAC5E,SAAS,GAAY;AACnB,aAAO,MAAM,8BAA8B;AAAA,QACzC,OAAO,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;AAAA,MAClD,CAAC;AAAA,IACH;AAAA,EACF;AAEA,MAAI;AACF,UAAM,UAAU,YAAY,KAAK,UAAU,QAAQ,MAAM,CAAC,GAAG,OAAO;AACpE,WAAO,EAAE,YAAY,QAAQ;AAAA,EAC/B,SAAS,OAAgB;AACvB,UAAM,QAAQ;AACd,UAAM;AAAA,EACR;AACF;","names":[]}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getErrorMessage,
|
|
8
8
|
getTimeProvider,
|
|
9
9
|
ok
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RYJ6DFUB.js";
|
|
11
11
|
|
|
12
12
|
// src/context/session-memory.ts
|
|
13
13
|
import * as fs from "node:fs";
|
|
@@ -374,4 +374,4 @@ export {
|
|
|
374
374
|
SessionMemory,
|
|
375
375
|
createSessionMemory
|
|
376
376
|
};
|
|
377
|
-
//# sourceMappingURL=chunk-
|
|
377
|
+
//# sourceMappingURL=chunk-243T5S2C.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
createLogger,
|
|
6
6
|
getTimeProvider
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-RYJ6DFUB.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-
|
|
743
|
+
//# sourceMappingURL=chunk-2EA4S4UY.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadPapersRegistry
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-S77X4QRM.js";
|
|
4
4
|
import {
|
|
5
5
|
getErrorMessage
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RYJ6DFUB.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-
|
|
879
|
+
//# sourceMappingURL=chunk-2TLL6TQQ.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
createLogger,
|
|
8
8
|
err,
|
|
9
9
|
ok
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RYJ6DFUB.js";
|
|
11
11
|
|
|
12
12
|
// src/adapters/gateway-redaction.ts
|
|
13
13
|
var GATEWAY_REDACTED = "<redacted>";
|
|
@@ -341,4 +341,4 @@ export {
|
|
|
341
341
|
validateCustomApiBaseUrl,
|
|
342
342
|
assertCustomApiHostResolvesPublic
|
|
343
343
|
};
|
|
344
|
-
//# sourceMappingURL=chunk-
|
|
344
|
+
//# sourceMappingURL=chunk-4Z2JSMPB.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GitHubProvider,
|
|
3
3
|
ScmError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YVBA73EL.js";
|
|
5
5
|
import {
|
|
6
6
|
ReputationCache,
|
|
7
7
|
assessReputation,
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
resolveEnvMode,
|
|
10
10
|
resolveReputationGatingMode,
|
|
11
11
|
sanitizeInput
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-TA7H2DKY.js";
|
|
13
13
|
import {
|
|
14
14
|
hasToken
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-H6XT6CZR.js";
|
|
16
16
|
import {
|
|
17
17
|
toContentTrustProvenanceRecord
|
|
18
18
|
} from "./chunk-ZO6ZKR7L.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
getErrorMessage,
|
|
29
29
|
getTimeProvider,
|
|
30
30
|
ok
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-RYJ6DFUB.js";
|
|
32
32
|
|
|
33
33
|
// src/security/firewall/firewall-policy-mode.ts
|
|
34
34
|
import { z } from "zod";
|
|
@@ -2661,4 +2661,4 @@ export {
|
|
|
2661
2661
|
IssueTriage,
|
|
2662
2662
|
createIssueTriage
|
|
2663
2663
|
};
|
|
2664
|
-
//# sourceMappingURL=chunk-
|
|
2664
|
+
//# sourceMappingURL=chunk-5DTE5EGF.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
MCP_TIMEOUTS,
|
|
9
9
|
TEST_TIMEOUTS,
|
|
10
10
|
WORKFLOW_TIMEOUTS
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-RYJ6DFUB.js";
|
|
12
12
|
import {
|
|
13
13
|
createGetToolRateLimit
|
|
14
14
|
} from "./chunk-LWOX65CP.js";
|
|
@@ -223,4 +223,4 @@ export {
|
|
|
223
223
|
CUSTOM_API_DEFAULT_MODEL,
|
|
224
224
|
DEFAULTS
|
|
225
225
|
};
|
|
226
|
-
//# sourceMappingURL=chunk-
|
|
226
|
+
//# sourceMappingURL=chunk-7TFJLA5G.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SERVES_PROBE_PROMPT
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RZJA6GTZ.js";
|
|
4
4
|
import {
|
|
5
5
|
checkGatewayHealth,
|
|
6
6
|
cliFailsVerdict,
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
gatewaySlotServing,
|
|
11
11
|
gatewayVerdict,
|
|
12
12
|
printVoterTransportCheck
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-UMEWQYSE.js";
|
|
14
14
|
import {
|
|
15
15
|
NODE_ENGINE_RANGE,
|
|
16
16
|
VERSION,
|
|
17
17
|
isNodeVersionSupported,
|
|
18
18
|
recordServerTransport
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-EDTTLHNL.js";
|
|
20
20
|
import {
|
|
21
21
|
allOf,
|
|
22
22
|
anyOf
|
|
@@ -24,10 +24,10 @@ import {
|
|
|
24
24
|
import {
|
|
25
25
|
readOpenAICompatEndpoint,
|
|
26
26
|
readOpenAICompatEnv
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-S4S4VLJN.js";
|
|
28
28
|
import {
|
|
29
29
|
claimGlobalRegistry
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-XXCJ4VPU.js";
|
|
31
31
|
import {
|
|
32
32
|
CODEX_LEGACY_LANDLOCK_CONFIG,
|
|
33
33
|
CODEX_MCP_SERVER_UNAVAILABLE_REASON,
|
|
@@ -36,15 +36,16 @@ import {
|
|
|
36
36
|
codexMcpServerAvailable,
|
|
37
37
|
codexSandboxPreflight,
|
|
38
38
|
createAllAdapters,
|
|
39
|
+
createCliAdapter,
|
|
39
40
|
isCliAdmitted,
|
|
40
41
|
probeCli
|
|
41
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-SGU3LXML.js";
|
|
42
43
|
import {
|
|
43
44
|
getNexusTmpDir
|
|
44
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-JPFRRNRR.js";
|
|
45
46
|
import {
|
|
46
47
|
resolveGatewayEnv
|
|
47
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-4Z2JSMPB.js";
|
|
48
49
|
import {
|
|
49
50
|
DEFAULT_CAPABILITIES,
|
|
50
51
|
capitalize,
|
|
@@ -68,7 +69,7 @@ import {
|
|
|
68
69
|
resolveGatewayCostDeclaration,
|
|
69
70
|
symbols,
|
|
70
71
|
writeLine
|
|
71
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-RYJ6DFUB.js";
|
|
72
73
|
import {
|
|
73
74
|
getLearningDir,
|
|
74
75
|
getOutcomesFile,
|
|
@@ -213,6 +214,25 @@ function scratchSeverityIsAcceptable(severity) {
|
|
|
213
214
|
}
|
|
214
215
|
}
|
|
215
216
|
|
|
217
|
+
// src/cli-adapters/cli-adapter-diagnostics.ts
|
|
218
|
+
var CLI_PACKAGES = {
|
|
219
|
+
claude: "@anthropic-ai/claude-code",
|
|
220
|
+
codex: "@openai/codex",
|
|
221
|
+
opencode: "opencode-ai"
|
|
222
|
+
};
|
|
223
|
+
function getCliAdapterDiagnostics(adapter) {
|
|
224
|
+
const binaryName = "binaryName" in adapter && typeof adapter.binaryName === "string" ? adapter.binaryName : adapter.name;
|
|
225
|
+
const packageName = CLI_PACKAGES[adapter.name];
|
|
226
|
+
return {
|
|
227
|
+
binaryName,
|
|
228
|
+
installationHints: {
|
|
229
|
+
install: packageName === void 0 ? `Install ${binaryName} and ensure it is on PATH` : `npm install -g ${packageName}`,
|
|
230
|
+
upgrade: packageName === void 0 ? `Update ${binaryName} to the latest version` : `npm update -g ${packageName}`,
|
|
231
|
+
auth: packageName === void 0 ? `Authenticate ${binaryName} using its CLI` : `${binaryName} auth login`
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
|
|
216
236
|
// src/mcp/server.ts
|
|
217
237
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
218
238
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
@@ -1082,32 +1102,11 @@ var DATA_SUBDIRECTORIES = [
|
|
|
1082
1102
|
"research",
|
|
1083
1103
|
"checkpoints"
|
|
1084
1104
|
];
|
|
1085
|
-
function getFixCommand(name, issue) {
|
|
1086
|
-
const
|
|
1087
|
-
|
|
1088
|
-
install: "npm install -g @anthropic-ai/claude-code",
|
|
1089
|
-
upgrade: "npm update -g @anthropic-ai/claude-code",
|
|
1090
|
-
auth: "claude auth login"
|
|
1091
|
-
},
|
|
1092
|
-
gemini: {
|
|
1093
|
-
install: "npm install -g @google/gemini-cli",
|
|
1094
|
-
upgrade: "npm update -g @google/gemini-cli",
|
|
1095
|
-
auth: "gemini auth login"
|
|
1096
|
-
},
|
|
1097
|
-
codex: {
|
|
1098
|
-
install: "npm install -g @openai/codex",
|
|
1099
|
-
upgrade: "npm update -g @openai/codex",
|
|
1100
|
-
auth: "codex auth login"
|
|
1101
|
-
},
|
|
1102
|
-
opencode: {
|
|
1103
|
-
install: "npm install -g opencode-ai",
|
|
1104
|
-
upgrade: "npm update -g opencode-ai",
|
|
1105
|
-
auth: "opencode auth login"
|
|
1106
|
-
}
|
|
1107
|
-
};
|
|
1108
|
-
return commands[name][issue] ?? "";
|
|
1105
|
+
function getFixCommand(name, issue, adapter) {
|
|
1106
|
+
const source = adapter !== void 0 && "binaryName" in adapter ? adapter : createCliAdapter({ cli: name, transport: "subprocess" });
|
|
1107
|
+
return getCliAdapterDiagnostics(source).installationHints[issue];
|
|
1109
1108
|
}
|
|
1110
|
-
function createNotFoundResult(name, errorMsg) {
|
|
1109
|
+
function createNotFoundResult(name, errorMsg, adapter) {
|
|
1111
1110
|
return {
|
|
1112
1111
|
name,
|
|
1113
1112
|
// Not installed, so auth was never probed. `not-authenticated` would claim
|
|
@@ -1120,7 +1119,7 @@ function createNotFoundResult(name, errorMsg) {
|
|
|
1120
1119
|
versionStatus: "unsupported",
|
|
1121
1120
|
authenticated: false,
|
|
1122
1121
|
error: errorMsg,
|
|
1123
|
-
fix: getFixCommand(name, "install")
|
|
1122
|
+
fix: getFixCommand(name, "install", adapter)
|
|
1124
1123
|
};
|
|
1125
1124
|
}
|
|
1126
1125
|
function detectAuthMethod(name) {
|
|
@@ -1136,7 +1135,7 @@ function resolveAuthState(authenticated, probeState) {
|
|
|
1136
1135
|
if (authenticated) return "authenticated";
|
|
1137
1136
|
return probeState === "unknown" ? "unverified" : "not-authenticated";
|
|
1138
1137
|
}
|
|
1139
|
-
function createHealthyResult(name, health, authProbe, capacity) {
|
|
1138
|
+
function createHealthyResult(name, health, authProbe, capacity, adapter) {
|
|
1140
1139
|
const versionOk = health.healthy;
|
|
1141
1140
|
const authenticated = versionOk && authProbe.state === "authenticated";
|
|
1142
1141
|
const authState = resolveAuthState(authenticated, authProbe.state);
|
|
@@ -1162,10 +1161,10 @@ function createHealthyResult(name, health, authProbe, capacity) {
|
|
|
1162
1161
|
};
|
|
1163
1162
|
}
|
|
1164
1163
|
if (authState === "not-authenticated") {
|
|
1165
|
-
return { ...result, fix: getFixCommand(name, "auth") };
|
|
1164
|
+
return { ...result, fix: getFixCommand(name, "auth", adapter) };
|
|
1166
1165
|
}
|
|
1167
1166
|
if (health.versionStatus === "outdated") {
|
|
1168
|
-
return { ...result, fix: getFixCommand(name, "upgrade") };
|
|
1167
|
+
return { ...result, fix: getFixCommand(name, "upgrade", adapter) };
|
|
1169
1168
|
}
|
|
1170
1169
|
return result;
|
|
1171
1170
|
}
|
|
@@ -1186,11 +1185,11 @@ async function checkCli(name) {
|
|
|
1186
1185
|
capacity = await adapter.getCapacity();
|
|
1187
1186
|
} catch {
|
|
1188
1187
|
}
|
|
1189
|
-
return createHealthyResult(name, health, authProbe, capacity);
|
|
1188
|
+
return createHealthyResult(name, health, authProbe, capacity, adapter);
|
|
1190
1189
|
} catch (error) {
|
|
1191
1190
|
const message = getErrorMessage(error);
|
|
1192
1191
|
const isNotFound = message.includes("ENOENT") || message.includes("not found");
|
|
1193
|
-
return createNotFoundResult(name, isNotFound ? "Not found in PATH" : message);
|
|
1192
|
+
return createNotFoundResult(name, isNotFound ? "Not found in PATH" : message, adapter);
|
|
1194
1193
|
}
|
|
1195
1194
|
}
|
|
1196
1195
|
function checkNodeVersion() {
|
|
@@ -1534,7 +1533,7 @@ async function doctorCommand(options = {}) {
|
|
|
1534
1533
|
options.onResult?.(result);
|
|
1535
1534
|
printDoctorResults(result, void 0, options.deferSummary === true);
|
|
1536
1535
|
if (options.gateway === true || options.probe === true) {
|
|
1537
|
-
const { formatGatewayReport } = await import("./doctor-gateway-report-
|
|
1536
|
+
const { formatGatewayReport } = await import("./doctor-gateway-report-ZZLWOCS2.js");
|
|
1538
1537
|
for (const line of formatGatewayReport(result.gateway, result.clis)) {
|
|
1539
1538
|
process.stdout.write(line + "\n");
|
|
1540
1539
|
}
|
|
@@ -1553,13 +1552,13 @@ async function runDoctorFix(result) {
|
|
|
1553
1552
|
writeLine2("\u2500".repeat(40));
|
|
1554
1553
|
let fixCount = 0;
|
|
1555
1554
|
if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
|
|
1556
|
-
const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-
|
|
1555
|
+
const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-PN2K7QCA.js");
|
|
1557
1556
|
const outcome = describeDataDirFix2(initDataDirectories2());
|
|
1558
1557
|
writeLine2(outcome.line);
|
|
1559
1558
|
if (outcome.counted) fixCount++;
|
|
1560
1559
|
}
|
|
1561
1560
|
if (!result.configFile.found) {
|
|
1562
|
-
const { runConfigInitSync } = await import("./setup-config-
|
|
1561
|
+
const { runConfigInitSync } = await import("./setup-config-PZSZBB2E.js");
|
|
1563
1562
|
const configResult = runConfigInitSync(process.cwd(), false, false);
|
|
1564
1563
|
if (configResult.success && configResult.created) {
|
|
1565
1564
|
writeLine2(`\u2713 Generated config: ${configResult.path}`);
|
|
@@ -1641,6 +1640,7 @@ function describeDataDirFix(result) {
|
|
|
1641
1640
|
export {
|
|
1642
1641
|
DEFAULT_TASK_TTL_MS,
|
|
1643
1642
|
clampTaskTtl,
|
|
1643
|
+
getCliAdapterDiagnostics,
|
|
1644
1644
|
failingVerdictTerms,
|
|
1645
1645
|
printDoctorSummary,
|
|
1646
1646
|
DATA_SUBDIRECTORIES,
|
|
@@ -1657,4 +1657,4 @@ export {
|
|
|
1657
1657
|
startStdioServer,
|
|
1658
1658
|
closeServer
|
|
1659
1659
|
};
|
|
1660
|
-
//# sourceMappingURL=chunk-
|
|
1660
|
+
//# sourceMappingURL=chunk-7YP7UNWL.js.map
|