nexus-agents 8.112.0 → 8.112.2
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-Y7JYRYIJ.js → ast-rule-runner-UEQO7V4Y.js} +3 -3
- package/dist/{child-mcp-config-T5ACQOUC.js → child-mcp-config-BYNNNVZF.js} +3 -12
- package/dist/child-mcp-config-BYNNNVZF.js.map +1 -0
- package/dist/{chunk-7MDXMFP7.js → chunk-27E5O3GY.js} +2 -2
- package/dist/{chunk-WO2QMQUG.js → chunk-3E4J3EE6.js} +121 -84
- package/dist/chunk-3E4J3EE6.js.map +1 -0
- package/dist/{chunk-HWFC5ASC.js → chunk-3SY2GPU3.js} +2 -2
- package/dist/{chunk-2IIJQIMM.js → chunk-3TB6L3TE.js} +109 -39
- package/dist/chunk-3TB6L3TE.js.map +1 -0
- package/dist/{chunk-5U5MRUIO.js → chunk-5GMUGQGF.js} +4 -4
- package/dist/{chunk-THB3IYJX.js → chunk-5VS577SD.js} +2 -2
- package/dist/{chunk-H4NYL266.js → chunk-6FC5VVDA.js} +2 -2
- package/dist/{chunk-JSHF2KFP.js → chunk-6RYPMOR6.js} +8 -8
- package/dist/{chunk-EBWQVNA2.js → chunk-76XX7NPA.js} +2 -2
- package/dist/{chunk-U5K4FVMI.js → chunk-7JKUA5X6.js} +4 -4
- package/dist/{chunk-PQLW4ZXT.js → chunk-CD2O5QRG.js} +11 -11
- package/dist/{chunk-GG3UPYQC.js → chunk-CZ7EPWIJ.js} +2 -2
- package/dist/{chunk-YFNDV7FJ.js → chunk-DARVXIKJ.js} +2 -2
- package/dist/{chunk-XIUCWV2L.js → chunk-DAWGZNLK.js} +2 -2
- package/dist/{chunk-CPZ6OYZV.js → chunk-DAYX7FLQ.js} +3 -3
- package/dist/{chunk-OYV7SZGV.js → chunk-EIDH64P4.js} +5 -5
- package/dist/{chunk-K42UETAL.js → chunk-GFNUYOCY.js} +2 -2
- package/dist/{chunk-7OID2D3X.js → chunk-HEBQA4E4.js} +2 -2
- package/dist/{chunk-QIRFVULH.js → chunk-I2FZPV7P.js} +2 -2
- package/dist/{chunk-ZNBVTWQX.js → chunk-JLOW2KAD.js} +5 -5
- package/dist/{chunk-6UI734G5.js → chunk-KUB3MGWF.js} +27 -7
- package/dist/chunk-KUB3MGWF.js.map +1 -0
- package/dist/{chunk-AXTUSOO2.js → chunk-LLG4XR6P.js} +5 -5
- package/dist/{chunk-A6MJ5OT5.js → chunk-LYZ2OXI7.js} +2 -2
- package/dist/{chunk-4YGPA6RY.js → chunk-M72V2I3F.js} +2 -2
- package/dist/{chunk-22ORLI5U.js → chunk-N67DGBPZ.js} +2 -2
- package/dist/{chunk-DVGHZMUL.js → chunk-NL2IL32T.js} +43 -43
- package/dist/{chunk-DVGHZMUL.js.map → chunk-NL2IL32T.js.map} +1 -1
- package/dist/{chunk-LOUQYL7L.js → chunk-NXCO6Z7O.js} +3 -3
- package/dist/{chunk-56BNVEYR.js → chunk-P7ZL3KD6.js} +2 -2
- package/dist/{chunk-BD7DK7WH.js → chunk-QDDTFVW7.js} +2 -2
- package/dist/{chunk-O7JOVLLY.js → chunk-RLSKNDO5.js} +4 -4
- package/dist/{chunk-JEAVQI3X.js → chunk-TTPAWUHT.js} +2 -2
- package/dist/{chunk-2T6Q3JTZ.js → chunk-X3VNURAA.js} +3 -3
- package/dist/{chunk-FDASKOC7.js → chunk-Y4ZLHASZ.js} +11 -3
- package/dist/chunk-Y4ZLHASZ.js.map +1 -0
- package/dist/{chunk-JKAJK3GA.js → chunk-YBRWJBHN.js} +2 -2
- package/dist/{chunk-TSDOTP53.js → chunk-YZMSYPAU.js} +5 -5
- package/dist/{chunk-VOKK274H.js → chunk-ZWXZY3Z7.js} +2 -2
- package/dist/{cli-circuit-breaker-WIMKRL7H.js → cli-circuit-breaker-KR72NLMQ.js} +3 -3
- package/dist/cli.js +53 -49
- package/dist/cli.js.map +1 -1
- package/dist/{composite-router-JDU5RLVX.js → composite-router-OEN6DCPK.js} +2 -2
- package/dist/{consensus-vote-X5QSYJRA.js → consensus-vote-VD74QW5N.js} +18 -18
- package/dist/{context-retriever-UZKQCWZY.js → context-retriever-7VBZZG3I.js} +8 -8
- package/dist/{doctor-deep-TMRXDBKM.js → doctor-deep-JPICT7QB.js} +3 -3
- package/dist/doctor-gateway-report-MZY47ZZV.js +17 -0
- package/dist/{doctor-live-6HWHQ2WN.js → doctor-live-AF4XP5WY.js} +11 -11
- package/dist/{expert-bridge-HPMKPJFI.js → expert-bridge-MPMDMGCC.js} +5 -5
- package/dist/{factory-PYFGNN5R.js → factory-2Z7GFPKY.js} +5 -5
- package/dist/{factory-QHGZKNBZ.js → factory-ZGYUWL2O.js} +10 -10
- package/dist/{improvement-review-2RVAMHCY.js → improvement-review-UA6OJTZ6.js} +6 -6
- package/dist/index.d.ts +7 -7
- package/dist/index.js +33 -33
- package/dist/{init-opencode-DO36MEWH.js → init-opencode-FYYFCXHB.js} +6 -6
- package/dist/{issue-triage-I2FL44CG.js → issue-triage-FOOCSNNK.js} +6 -6
- package/dist/{openai-compat-adapter-3Q7FLYBM.js → openai-compat-adapter-YAWAN7MX.js} +6 -6
- package/dist/{pr-reviewer-helpers-EHQ4Z7L6.js → pr-reviewer-helpers-J737NDAT.js} +4 -4
- package/dist/{registry-command-MP57K2IU.js → registry-command-OQ4SLR6K.js} +2 -2
- package/dist/{repo-security-plan-EW2Z4UYX.js → repo-security-plan-ZNKV7LPR.js} +3 -3
- package/dist/{research-helpers-synthesize-2ORWR7IO.js → research-helpers-synthesize-7RBYSNPH.js} +4 -4
- package/dist/{routing-memory-7YDZMCBP.js → routing-memory-AFLU42CD.js} +2 -2
- package/dist/{session-memory-YWUVRCF7.js → session-memory-22AVU7MG.js} +3 -3
- package/dist/{setup-config-56WKB7QE.js → setup-config-KVH4TQN7.js} +3 -3
- package/dist/{setup-custom-api-TO2GWNSV.js → setup-custom-api-2ZHJT7BL.js} +4 -4
- package/dist/setup-data-dir-YZ3VVOT2.js +34 -0
- package/dist/{tool-memory-2JWYUQPL.js → tool-memory-WSCOQQS2.js} +5 -5
- package/dist/{unified-registry-QCVJ5M2A.js → unified-registry-RBENDRS4.js} +12 -12
- package/dist/{weather-report-ERRSDDVB.js → weather-report-EGG35WEB.js} +2 -2
- package/package.json +1 -1
- package/dist/child-mcp-config-T5ACQOUC.js.map +0 -1
- package/dist/chunk-2IIJQIMM.js.map +0 -1
- package/dist/chunk-6UI734G5.js.map +0 -1
- package/dist/chunk-FDASKOC7.js.map +0 -1
- package/dist/chunk-WO2QMQUG.js.map +0 -1
- package/dist/doctor-gateway-report-IH5SXTJS.js +0 -17
- package/dist/setup-data-dir-4ONA7QX7.js +0 -34
- /package/dist/{ast-rule-runner-Y7JYRYIJ.js.map → ast-rule-runner-UEQO7V4Y.js.map} +0 -0
- /package/dist/{chunk-7MDXMFP7.js.map → chunk-27E5O3GY.js.map} +0 -0
- /package/dist/{chunk-HWFC5ASC.js.map → chunk-3SY2GPU3.js.map} +0 -0
- /package/dist/{chunk-5U5MRUIO.js.map → chunk-5GMUGQGF.js.map} +0 -0
- /package/dist/{chunk-THB3IYJX.js.map → chunk-5VS577SD.js.map} +0 -0
- /package/dist/{chunk-H4NYL266.js.map → chunk-6FC5VVDA.js.map} +0 -0
- /package/dist/{chunk-JSHF2KFP.js.map → chunk-6RYPMOR6.js.map} +0 -0
- /package/dist/{chunk-EBWQVNA2.js.map → chunk-76XX7NPA.js.map} +0 -0
- /package/dist/{chunk-U5K4FVMI.js.map → chunk-7JKUA5X6.js.map} +0 -0
- /package/dist/{chunk-PQLW4ZXT.js.map → chunk-CD2O5QRG.js.map} +0 -0
- /package/dist/{chunk-GG3UPYQC.js.map → chunk-CZ7EPWIJ.js.map} +0 -0
- /package/dist/{chunk-YFNDV7FJ.js.map → chunk-DARVXIKJ.js.map} +0 -0
- /package/dist/{chunk-XIUCWV2L.js.map → chunk-DAWGZNLK.js.map} +0 -0
- /package/dist/{chunk-CPZ6OYZV.js.map → chunk-DAYX7FLQ.js.map} +0 -0
- /package/dist/{chunk-OYV7SZGV.js.map → chunk-EIDH64P4.js.map} +0 -0
- /package/dist/{chunk-K42UETAL.js.map → chunk-GFNUYOCY.js.map} +0 -0
- /package/dist/{chunk-7OID2D3X.js.map → chunk-HEBQA4E4.js.map} +0 -0
- /package/dist/{chunk-QIRFVULH.js.map → chunk-I2FZPV7P.js.map} +0 -0
- /package/dist/{chunk-ZNBVTWQX.js.map → chunk-JLOW2KAD.js.map} +0 -0
- /package/dist/{chunk-AXTUSOO2.js.map → chunk-LLG4XR6P.js.map} +0 -0
- /package/dist/{chunk-A6MJ5OT5.js.map → chunk-LYZ2OXI7.js.map} +0 -0
- /package/dist/{chunk-4YGPA6RY.js.map → chunk-M72V2I3F.js.map} +0 -0
- /package/dist/{chunk-22ORLI5U.js.map → chunk-N67DGBPZ.js.map} +0 -0
- /package/dist/{chunk-LOUQYL7L.js.map → chunk-NXCO6Z7O.js.map} +0 -0
- /package/dist/{chunk-56BNVEYR.js.map → chunk-P7ZL3KD6.js.map} +0 -0
- /package/dist/{chunk-BD7DK7WH.js.map → chunk-QDDTFVW7.js.map} +0 -0
- /package/dist/{chunk-O7JOVLLY.js.map → chunk-RLSKNDO5.js.map} +0 -0
- /package/dist/{chunk-JEAVQI3X.js.map → chunk-TTPAWUHT.js.map} +0 -0
- /package/dist/{chunk-2T6Q3JTZ.js.map → chunk-X3VNURAA.js.map} +0 -0
- /package/dist/{chunk-JKAJK3GA.js.map → chunk-YBRWJBHN.js.map} +0 -0
- /package/dist/{chunk-TSDOTP53.js.map → chunk-YZMSYPAU.js.map} +0 -0
- /package/dist/{chunk-VOKK274H.js.map → chunk-ZWXZY3Z7.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-WIMKRL7H.js.map → cli-circuit-breaker-KR72NLMQ.js.map} +0 -0
- /package/dist/{composite-router-JDU5RLVX.js.map → composite-router-OEN6DCPK.js.map} +0 -0
- /package/dist/{consensus-vote-X5QSYJRA.js.map → consensus-vote-VD74QW5N.js.map} +0 -0
- /package/dist/{context-retriever-UZKQCWZY.js.map → context-retriever-7VBZZG3I.js.map} +0 -0
- /package/dist/{doctor-deep-TMRXDBKM.js.map → doctor-deep-JPICT7QB.js.map} +0 -0
- /package/dist/{doctor-gateway-report-IH5SXTJS.js.map → doctor-gateway-report-MZY47ZZV.js.map} +0 -0
- /package/dist/{doctor-live-6HWHQ2WN.js.map → doctor-live-AF4XP5WY.js.map} +0 -0
- /package/dist/{expert-bridge-HPMKPJFI.js.map → expert-bridge-MPMDMGCC.js.map} +0 -0
- /package/dist/{factory-PYFGNN5R.js.map → factory-2Z7GFPKY.js.map} +0 -0
- /package/dist/{factory-QHGZKNBZ.js.map → factory-ZGYUWL2O.js.map} +0 -0
- /package/dist/{improvement-review-2RVAMHCY.js.map → improvement-review-UA6OJTZ6.js.map} +0 -0
- /package/dist/{init-opencode-DO36MEWH.js.map → init-opencode-FYYFCXHB.js.map} +0 -0
- /package/dist/{issue-triage-I2FL44CG.js.map → issue-triage-FOOCSNNK.js.map} +0 -0
- /package/dist/{openai-compat-adapter-3Q7FLYBM.js.map → openai-compat-adapter-YAWAN7MX.js.map} +0 -0
- /package/dist/{pr-reviewer-helpers-EHQ4Z7L6.js.map → pr-reviewer-helpers-J737NDAT.js.map} +0 -0
- /package/dist/{registry-command-MP57K2IU.js.map → registry-command-OQ4SLR6K.js.map} +0 -0
- /package/dist/{repo-security-plan-EW2Z4UYX.js.map → repo-security-plan-ZNKV7LPR.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-2ORWR7IO.js.map → research-helpers-synthesize-7RBYSNPH.js.map} +0 -0
- /package/dist/{routing-memory-7YDZMCBP.js.map → routing-memory-AFLU42CD.js.map} +0 -0
- /package/dist/{session-memory-YWUVRCF7.js.map → session-memory-22AVU7MG.js.map} +0 -0
- /package/dist/{setup-config-56WKB7QE.js.map → setup-config-KVH4TQN7.js.map} +0 -0
- /package/dist/{setup-custom-api-TO2GWNSV.js.map → setup-custom-api-2ZHJT7BL.js.map} +0 -0
- /package/dist/{setup-data-dir-4ONA7QX7.js.map → setup-data-dir-YZ3VVOT2.js.map} +0 -0
- /package/dist/{tool-memory-2JWYUQPL.js.map → tool-memory-WSCOQQS2.js.map} +0 -0
- /package/dist/{unified-registry-QCVJ5M2A.js.map → unified-registry-RBENDRS4.js.map} +0 -0
- /package/dist/{weather-report-ERRSDDVB.js.map → weather-report-EGG35WEB.js.map} +0 -0
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
getBuiltInAstRulesPath,
|
|
10
10
|
loadRules,
|
|
11
11
|
runAstQaRules
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-DAWGZNLK.js";
|
|
13
13
|
import "./chunk-XEPZSDN5.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-Y4ZLHASZ.js";
|
|
15
15
|
import "./chunk-UE7A2XHM.js";
|
|
16
16
|
import "./chunk-LWOX65CP.js";
|
|
17
17
|
import "./chunk-PX6F3LHL.js";
|
|
@@ -27,4 +27,4 @@ export {
|
|
|
27
27
|
loadRules,
|
|
28
28
|
runAstQaRules
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=ast-rule-runner-
|
|
30
|
+
//# sourceMappingURL=ast-rule-runner-UEQO7V4Y.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-OITVVSWO.js";
|
|
4
4
|
import {
|
|
5
5
|
createLogger
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Y4ZLHASZ.js";
|
|
7
7
|
import "./chunk-UE7A2XHM.js";
|
|
8
8
|
import "./chunk-LWOX65CP.js";
|
|
9
9
|
import "./chunk-PX6F3LHL.js";
|
|
@@ -12,14 +12,6 @@ import "./chunk-PX6F3LHL.js";
|
|
|
12
12
|
import { writeFile, rm } from "node:fs/promises";
|
|
13
13
|
import { join } from "node:path";
|
|
14
14
|
var logger = createLogger({ component: "swe-bench-mcp-config" });
|
|
15
|
-
var DEFAULT_ALLOWED_TOOLS = [
|
|
16
|
-
"memory_query",
|
|
17
|
-
"memory_stats",
|
|
18
|
-
"research_query",
|
|
19
|
-
"research_discover",
|
|
20
|
-
"weather_report",
|
|
21
|
-
"delegate_to_model"
|
|
22
|
-
];
|
|
23
15
|
function resolveCliPath(override) {
|
|
24
16
|
if (override !== void 0) return override;
|
|
25
17
|
const distDir = join(__dirname, "..");
|
|
@@ -40,7 +32,6 @@ function buildConfig(options) {
|
|
|
40
32
|
}
|
|
41
33
|
async function generateMcpConfig(options) {
|
|
42
34
|
const config = buildConfig(options);
|
|
43
|
-
const tools = options?.allowedTools ?? DEFAULT_ALLOWED_TOOLS;
|
|
44
35
|
const tempDir = await nexusMkdtemp("nexus-mcp-");
|
|
45
36
|
const configPath = join(tempDir, "mcp-config.json");
|
|
46
37
|
await writeFile(configPath, JSON.stringify(config, null, 2), "utf-8");
|
|
@@ -51,9 +42,9 @@ async function generateMcpConfig(options) {
|
|
|
51
42
|
});
|
|
52
43
|
});
|
|
53
44
|
};
|
|
54
|
-
return { configPath, cleanup
|
|
45
|
+
return { configPath, cleanup };
|
|
55
46
|
}
|
|
56
47
|
export {
|
|
57
48
|
generateMcpConfig
|
|
58
49
|
};
|
|
59
|
-
//# sourceMappingURL=child-mcp-config-
|
|
50
|
+
//# sourceMappingURL=child-mcp-config-BYNNNVZF.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 { 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 * 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\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;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;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":[]}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
CACHE_TIMEOUTS,
|
|
8
8
|
createLogger,
|
|
9
9
|
getTimeProvider
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-Y4ZLHASZ.js";
|
|
11
11
|
|
|
12
12
|
// src/security/input-sanitizer.ts
|
|
13
13
|
var DANGEROUS_HTML_PATTERN = /<(picture|source|img)\b[^>]*>[\s\S]*?<\/\1>|<(picture|source|img)\b[^>]*\/?>/gi;
|
|
@@ -509,4 +509,4 @@ export {
|
|
|
509
509
|
resolveReputationGatingMode,
|
|
510
510
|
gateWithReputation
|
|
511
511
|
};
|
|
512
|
-
//# sourceMappingURL=chunk-
|
|
512
|
+
//# sourceMappingURL=chunk-27E5O3GY.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CUSTOM_API_DEFAULT_MODEL
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CZ7EPWIJ.js";
|
|
4
4
|
import {
|
|
5
5
|
AdapterModelError,
|
|
6
6
|
BaseAdapter,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
readGatewayTransport,
|
|
11
11
|
requireApiKey,
|
|
12
12
|
validateApiKeyPresence
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-6FC5VVDA.js";
|
|
14
14
|
import {
|
|
15
15
|
assertCustomApiHostResolvesPublic,
|
|
16
16
|
hostnameOf,
|
|
@@ -19,28 +19,28 @@ import {
|
|
|
19
19
|
readGatewayEnv,
|
|
20
20
|
redactApiKey,
|
|
21
21
|
validateCustomApiBaseUrl
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-YBRWJBHN.js";
|
|
23
23
|
import {
|
|
24
24
|
sanitizeOutput
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-HEBQA4E4.js";
|
|
26
26
|
import {
|
|
27
27
|
nexusMkdtempSync
|
|
28
28
|
} from "./chunk-OITVVSWO.js";
|
|
29
29
|
import {
|
|
30
30
|
getAvailabilityCache
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-3SY2GPU3.js";
|
|
32
32
|
import {
|
|
33
33
|
extractSystemPrompt
|
|
34
34
|
} from "./chunk-QZUG667L.js";
|
|
35
35
|
import {
|
|
36
36
|
generateHyphenId
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-ZWXZY3Z7.js";
|
|
38
38
|
import {
|
|
39
39
|
CliCircuitBreaker,
|
|
40
40
|
DEFAULT_CIRCUIT_BREAKER_CONFIG,
|
|
41
41
|
getCliCircuitBreakerSnapshot,
|
|
42
42
|
getDefaultCliCircuitBreakerRegistry
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-GFNUYOCY.js";
|
|
44
44
|
import {
|
|
45
45
|
CLI_NAMES,
|
|
46
46
|
CLI_SUBPROCESS_TIMEOUTS,
|
|
@@ -106,7 +106,7 @@ import {
|
|
|
106
106
|
resolveRetryAfterMs,
|
|
107
107
|
toModelTokenUsage,
|
|
108
108
|
warnIfGatewayCostUndeclared
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-Y4ZLHASZ.js";
|
|
110
110
|
import {
|
|
111
111
|
parseBoolValue
|
|
112
112
|
} from "./chunk-LWOX65CP.js";
|
|
@@ -2203,7 +2203,7 @@ function stampNoRelaunch(cliName, childEnv) {
|
|
|
2203
2203
|
}
|
|
2204
2204
|
|
|
2205
2205
|
// src/cli-adapters/process-tree-kill.ts
|
|
2206
|
-
import { execFileSync } from "node:child_process";
|
|
2206
|
+
import { execFile, execFileSync } from "node:child_process";
|
|
2207
2207
|
import { readdirSync, readFileSync as readFileSync2 } from "node:fs";
|
|
2208
2208
|
|
|
2209
2209
|
// src/cli-adapters/proc-start-time.ts
|
|
@@ -2227,6 +2227,8 @@ function readProcStartTime(pid) {
|
|
|
2227
2227
|
|
|
2228
2228
|
// src/cli-adapters/process-tree-kill.ts
|
|
2229
2229
|
var MAX_DESCENDANTS = 1e3;
|
|
2230
|
+
var PS_ARGS = ["-A", "-o", "pid=,ppid="];
|
|
2231
|
+
var PS_TIMEOUT_MS = 2e3;
|
|
2230
2232
|
function isSpawnedProcess(child) {
|
|
2231
2233
|
return typeof child.pid === "number" && typeof child.spawnfile === "string" && Array.isArray(child.spawnargs);
|
|
2232
2234
|
}
|
|
@@ -2246,30 +2248,36 @@ function procChildren(pid) {
|
|
|
2246
2248
|
return void 0;
|
|
2247
2249
|
}
|
|
2248
2250
|
}
|
|
2249
|
-
function
|
|
2251
|
+
function parsePsChildMap(out) {
|
|
2252
|
+
const map = /* @__PURE__ */ new Map();
|
|
2253
|
+
for (const line of out.split("\n")) {
|
|
2254
|
+
const [pidText, ppidText] = line.trim().split(/\s+/);
|
|
2255
|
+
const pid = Number(pidText);
|
|
2256
|
+
const ppid = Number(ppidText);
|
|
2257
|
+
if (!Number.isInteger(pid) || !Number.isInteger(ppid)) continue;
|
|
2258
|
+
map.set(ppid, [...map.get(ppid) ?? [], pid]);
|
|
2259
|
+
}
|
|
2260
|
+
return map;
|
|
2261
|
+
}
|
|
2262
|
+
function psChildMapSync() {
|
|
2250
2263
|
if (process.platform === "win32") return void 0;
|
|
2251
2264
|
try {
|
|
2252
|
-
|
|
2253
|
-
encoding: "utf8",
|
|
2254
|
-
|
|
2255
|
-
});
|
|
2256
|
-
const map = /* @__PURE__ */ new Map();
|
|
2257
|
-
for (const line of out.split("\n")) {
|
|
2258
|
-
const [pidText, ppidText] = line.trim().split(/\s+/);
|
|
2259
|
-
const pid = Number(pidText);
|
|
2260
|
-
const ppid = Number(ppidText);
|
|
2261
|
-
if (!Number.isInteger(pid) || !Number.isInteger(ppid)) continue;
|
|
2262
|
-
map.set(ppid, [...map.get(ppid) ?? [], pid]);
|
|
2263
|
-
}
|
|
2264
|
-
return map;
|
|
2265
|
+
return parsePsChildMap(
|
|
2266
|
+
execFileSync("ps", PS_ARGS, { encoding: "utf8", timeout: PS_TIMEOUT_MS })
|
|
2267
|
+
);
|
|
2265
2268
|
} catch {
|
|
2266
2269
|
return void 0;
|
|
2267
2270
|
}
|
|
2268
2271
|
}
|
|
2269
|
-
function
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2272
|
+
function psChildMapAsync() {
|
|
2273
|
+
if (process.platform === "win32") return Promise.resolve(void 0);
|
|
2274
|
+
return new Promise((resolve) => {
|
|
2275
|
+
execFile("ps", PS_ARGS, { encoding: "utf8", timeout: PS_TIMEOUT_MS }, (error, stdout) => {
|
|
2276
|
+
resolve(error === null ? parsePsChildMap(stdout) : void 0);
|
|
2277
|
+
});
|
|
2278
|
+
});
|
|
2279
|
+
}
|
|
2280
|
+
function walkDescendants(root, childrenOf) {
|
|
2273
2281
|
const seen = /* @__PURE__ */ new Set([root]);
|
|
2274
2282
|
const out = [];
|
|
2275
2283
|
const queue = [root];
|
|
@@ -2284,6 +2292,15 @@ function collectDescendants(root) {
|
|
|
2284
2292
|
}
|
|
2285
2293
|
return out;
|
|
2286
2294
|
}
|
|
2295
|
+
function collectDescendants(root) {
|
|
2296
|
+
const useProc = process.platform === "linux" && procChildren(root) !== void 0;
|
|
2297
|
+
const psMap = useProc ? void 0 : psChildMapSync();
|
|
2298
|
+
return walkDescendants(root, (pid) => (useProc ? procChildren(pid) : psMap?.get(pid)) ?? []);
|
|
2299
|
+
}
|
|
2300
|
+
async function collectDescendantsAsync(root) {
|
|
2301
|
+
const psMap = await psChildMapAsync();
|
|
2302
|
+
return walkDescendants(root, (pid) => psMap?.get(pid) ?? []);
|
|
2303
|
+
}
|
|
2287
2304
|
function isPidAlive(pid) {
|
|
2288
2305
|
try {
|
|
2289
2306
|
process.kill(pid, 0);
|
|
@@ -2294,6 +2311,7 @@ function isPidAlive(pid) {
|
|
|
2294
2311
|
}
|
|
2295
2312
|
var defaultOps = {
|
|
2296
2313
|
collectDescendants,
|
|
2314
|
+
collectDescendantsAsync: process.platform === "linux" ? void 0 : collectDescendantsAsync,
|
|
2297
2315
|
hasStartTimes: process.platform === "linux",
|
|
2298
2316
|
readStartTime: readProcStartTime,
|
|
2299
2317
|
isPidAlive,
|
|
@@ -2326,10 +2344,10 @@ function hasExited(child) {
|
|
|
2326
2344
|
}
|
|
2327
2345
|
var liveTrees = /* @__PURE__ */ new Map();
|
|
2328
2346
|
var exitHookInstalled = false;
|
|
2329
|
-
function
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2347
|
+
function walkablePid(child) {
|
|
2348
|
+
return isSpawnedProcess(child) && !hasExited(child) ? child.pid : void 0;
|
|
2349
|
+
}
|
|
2350
|
+
function signalCollected(child, signal, known, fresh, ops) {
|
|
2333
2351
|
const candidates = uniqueByPid([...known, ...liveTrees.get(child) ?? [], ...fresh]);
|
|
2334
2352
|
child.kill(signal);
|
|
2335
2353
|
const tree = candidates.filter((entry) => isSameProcess(entry, ops));
|
|
@@ -2342,6 +2360,26 @@ function signalProcessTree(child, signal, known, ops = defaultOps) {
|
|
|
2342
2360
|
if (liveTrees.has(child)) liveTrees.set(child, tree);
|
|
2343
2361
|
return tree;
|
|
2344
2362
|
}
|
|
2363
|
+
function signalProcessTree(child, signal, known, ops = defaultOps) {
|
|
2364
|
+
const pid = walkablePid(child);
|
|
2365
|
+
const fresh = pid === void 0 ? [] : identify(ops.collectDescendants(pid), ops);
|
|
2366
|
+
return signalCollected(child, signal, known, fresh, ops);
|
|
2367
|
+
}
|
|
2368
|
+
function signalProcessTreeSoon(child, signal, known, ops) {
|
|
2369
|
+
const pid = walkablePid(child);
|
|
2370
|
+
const collectAsync = ops.collectDescendantsAsync;
|
|
2371
|
+
if (pid === void 0 || collectAsync === void 0) {
|
|
2372
|
+
return signalProcessTree(child, signal, known, ops);
|
|
2373
|
+
}
|
|
2374
|
+
return collectAsync(pid).then(
|
|
2375
|
+
(pids) => {
|
|
2376
|
+
const fresh = hasExited(child) ? [] : identify(pids, ops);
|
|
2377
|
+
return signalCollected(child, signal, known, fresh, ops);
|
|
2378
|
+
},
|
|
2379
|
+
// A failed walk must not leave the child unsignalled or reject into a `void`.
|
|
2380
|
+
() => signalCollected(child, signal, known, [], ops)
|
|
2381
|
+
);
|
|
2382
|
+
}
|
|
2345
2383
|
function isProcessTreeAlive(child, tree, ops = defaultOps) {
|
|
2346
2384
|
if (!hasExited(child)) return true;
|
|
2347
2385
|
return tree.some((entry) => isSameProcess(entry, ops));
|
|
@@ -2379,21 +2417,33 @@ function signalTrackedProcessTrees(signal, ops = defaultOps) {
|
|
|
2379
2417
|
}
|
|
2380
2418
|
return count;
|
|
2381
2419
|
}
|
|
2420
|
+
async function signalTrackedProcessTreesAsync(signal, ops = defaultOps) {
|
|
2421
|
+
pruneFinishedTrees(ops);
|
|
2422
|
+
const trees = [...liveTrees];
|
|
2423
|
+
await Promise.all(
|
|
2424
|
+
trees.map(([child, known]) => Promise.resolve(signalProcessTreeSoon(child, signal, known, ops)))
|
|
2425
|
+
);
|
|
2426
|
+
return trees.length;
|
|
2427
|
+
}
|
|
2382
2428
|
var SIGKILL_GRACE_MS = 5e3;
|
|
2383
|
-
function terminateProcessTree(child, graceMs = SIGKILL_GRACE_MS, onEscalate) {
|
|
2384
|
-
const
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2429
|
+
function terminateProcessTree(child, graceMs = SIGKILL_GRACE_MS, onEscalate, ops = defaultOps) {
|
|
2430
|
+
const armEscalation = (tree) => {
|
|
2431
|
+
const timer = setTimeout(() => {
|
|
2432
|
+
if (!isProcessTreeAlive(child, tree, ops)) return;
|
|
2433
|
+
onEscalate?.();
|
|
2434
|
+
void signalProcessTreeSoon(child, "SIGKILL", tree, ops);
|
|
2435
|
+
}, graceMs);
|
|
2436
|
+
timer.unref();
|
|
2437
|
+
if (tree.length === 0) {
|
|
2438
|
+
child.once("close", () => {
|
|
2439
|
+
clearTimeout(timer);
|
|
2440
|
+
});
|
|
2441
|
+
}
|
|
2442
|
+
return tree;
|
|
2443
|
+
};
|
|
2444
|
+
const signalled = signalProcessTreeSoon(child, "SIGTERM", [], ops);
|
|
2445
|
+
if (Array.isArray(signalled)) return Promise.resolve(armEscalation(signalled));
|
|
2446
|
+
return signalled.then(armEscalation);
|
|
2397
2447
|
}
|
|
2398
2448
|
|
|
2399
2449
|
// src/cli-adapters/subprocess-adapter.ts
|
|
@@ -2549,7 +2599,7 @@ var SubprocessCliAdapter = class extends BaseCliAdapter {
|
|
|
2549
2599
|
attachAbortSignal(child, signal, resolve) {
|
|
2550
2600
|
const onAbort = () => {
|
|
2551
2601
|
if (child.exitCode === null && child.signalCode === null) {
|
|
2552
|
-
terminateProcessTree(child, SIGKILL_GRACE_MS, () => {
|
|
2602
|
+
void terminateProcessTree(child, SIGKILL_GRACE_MS, () => {
|
|
2553
2603
|
this.logger.warn("Child ignored SIGTERM after abort, escalating to SIGKILL", {
|
|
2554
2604
|
cli: this.name,
|
|
2555
2605
|
sigkillGraceMs: SIGKILL_GRACE_MS
|
|
@@ -2707,17 +2757,14 @@ var SubprocessCliAdapter = class extends BaseCliAdapter {
|
|
|
2707
2757
|
child.on("error", (error) => {
|
|
2708
2758
|
resolveOnce(this.handleSubprocessError(error));
|
|
2709
2759
|
});
|
|
2710
|
-
const
|
|
2760
|
+
const timeoutId = this.scheduleTimeoutWithSigkillEscalation({
|
|
2711
2761
|
child,
|
|
2712
2762
|
timeoutMs,
|
|
2713
2763
|
requestId,
|
|
2714
2764
|
resolveOnce
|
|
2715
2765
|
});
|
|
2716
2766
|
child.on("close", (code) => {
|
|
2717
|
-
clearTimeout(
|
|
2718
|
-
if (timers.sigkillTimerId !== void 0 && timers.tree.length === 0) {
|
|
2719
|
-
clearTimeout(timers.sigkillTimerId);
|
|
2720
|
-
}
|
|
2767
|
+
clearTimeout(timeoutId);
|
|
2721
2768
|
this.logTimingBreakdown(state, startTime, code, requestId);
|
|
2722
2769
|
resolveOnce(this.classifyCloseResult(code, state, startTime));
|
|
2723
2770
|
});
|
|
@@ -2727,37 +2774,27 @@ var SubprocessCliAdapter = class extends BaseCliAdapter {
|
|
|
2727
2774
|
* Schedules the SIGTERM-on-timeout + SIGKILL-on-grace escalation
|
|
2728
2775
|
* (#3026 finding 1).
|
|
2729
2776
|
*
|
|
2730
|
-
* The
|
|
2777
|
+
* The timer SIGTERMs the tree and resolves the caller's promise
|
|
2731
2778
|
* immediately so it doesn't wait on a hung child. The escalation
|
|
2732
|
-
*
|
|
2733
|
-
* exited and force-reaps it with SIGKILL if
|
|
2734
|
-
* zombie accumulation when a child ignores SIGTERM
|
|
2735
|
-
* install graceful-shutdown handlers can hang on a broken
|
|
2736
|
-
*
|
|
2737
|
-
*
|
|
2779
|
+
* (`SIGKILL_GRACE_MS` later, in {@link terminateProcessTree}) checks
|
|
2780
|
+
* whether the tree actually exited and force-reaps it with SIGKILL if
|
|
2781
|
+
* not — preventing zombie accumulation when a child ignores SIGTERM
|
|
2782
|
+
* (Node CLIs that install graceful-shutdown handlers can hang on a broken
|
|
2783
|
+
* stream). Off Linux the descendants are collected by an async `ps`
|
|
2784
|
+
* first (#6718). Returns the timeout timer, for the `'close'` handler.
|
|
2738
2785
|
*/
|
|
2739
2786
|
scheduleTimeoutWithSigkillEscalation(opts) {
|
|
2740
2787
|
const { child, timeoutMs, requestId, resolveOnce } = opts;
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
sigkillGraceMs: SIGKILL_GRACE_MS
|
|
2752
|
-
});
|
|
2753
|
-
signalProcessTree(child, "SIGKILL", timers.tree);
|
|
2754
|
-
}
|
|
2755
|
-
}, SIGKILL_GRACE_MS);
|
|
2756
|
-
timers.sigkillTimerId.unref();
|
|
2757
|
-
}, timeoutMs),
|
|
2758
|
-
sigkillTimerId: void 0
|
|
2759
|
-
};
|
|
2760
|
-
return timers;
|
|
2788
|
+
return setTimeout(() => {
|
|
2789
|
+
void terminateProcessTree(child, SIGKILL_GRACE_MS, () => {
|
|
2790
|
+
this.logger.warn("Child ignored SIGTERM, escalating to SIGKILL", {
|
|
2791
|
+
cli: this.name,
|
|
2792
|
+
requestId,
|
|
2793
|
+
sigkillGraceMs: SIGKILL_GRACE_MS
|
|
2794
|
+
});
|
|
2795
|
+
});
|
|
2796
|
+
resolveOnce(err(this.createError("TIMEOUT", "Execution timed out")));
|
|
2797
|
+
}, timeoutMs);
|
|
2761
2798
|
}
|
|
2762
2799
|
/** Attach stdout/stderr data handlers + capture first-byte time (#2472). */
|
|
2763
2800
|
attachStdoutHandlers(child, state, onProgress) {
|
|
@@ -4262,7 +4299,7 @@ var CodexMcpAdapter = class extends BaseCliAdapter {
|
|
|
4262
4299
|
};
|
|
4263
4300
|
|
|
4264
4301
|
// src/cli-adapters/adapters/opencode-adapter.ts
|
|
4265
|
-
import { execFile } from "node:child_process";
|
|
4302
|
+
import { execFile as execFile2 } from "node:child_process";
|
|
4266
4303
|
|
|
4267
4304
|
// src/cli-adapters/parsers/opencode-parser.ts
|
|
4268
4305
|
var logger5 = createLogger({ component: "opencode-parser" });
|
|
@@ -4666,7 +4703,7 @@ function probeAvailableModels() {
|
|
|
4666
4703
|
if (cachedModels !== void 0) return Promise.resolve(cachedModels);
|
|
4667
4704
|
if (probePromise !== void 0) return probePromise;
|
|
4668
4705
|
probePromise = new Promise((resolve) => {
|
|
4669
|
-
|
|
4706
|
+
execFile2("opencode", ["models"], { timeout: PROBE_TIMEOUT_MS }, (error, stdout) => {
|
|
4670
4707
|
if (error !== null || stdout.trim() === "") {
|
|
4671
4708
|
logger6.debug("Failed to probe OpenCode models, will omit --model flag", {
|
|
4672
4709
|
error: error?.message
|
|
@@ -4892,12 +4929,12 @@ ${task.content}` : task.content;
|
|
|
4892
4929
|
};
|
|
4893
4930
|
|
|
4894
4931
|
// src/cli/cli-auth-probe.ts
|
|
4895
|
-
import { execFile as
|
|
4932
|
+
import { execFile as execFile3 } from "node:child_process";
|
|
4896
4933
|
import { promisify as promisify2 } from "node:util";
|
|
4897
4934
|
import { existsSync, readFileSync as readFileSync3 } from "node:fs";
|
|
4898
4935
|
import { homedir } from "node:os";
|
|
4899
4936
|
import { join as join2 } from "node:path";
|
|
4900
|
-
var execFileAsync = promisify2(
|
|
4937
|
+
var execFileAsync = promisify2(execFile3);
|
|
4901
4938
|
var HOME = homedir();
|
|
4902
4939
|
function claudeNeedsLogin(reason) {
|
|
4903
4940
|
return {
|
|
@@ -5249,7 +5286,7 @@ export {
|
|
|
5249
5286
|
NEXUS_SUBPROCESS_DEPTH_ENV,
|
|
5250
5287
|
readSubprocessDepth,
|
|
5251
5288
|
trackProcessTree,
|
|
5252
|
-
|
|
5289
|
+
signalTrackedProcessTreesAsync,
|
|
5253
5290
|
SIGKILL_GRACE_MS,
|
|
5254
5291
|
terminateProcessTree,
|
|
5255
5292
|
SubprocessCliAdapter,
|
|
@@ -5286,4 +5323,4 @@ export {
|
|
|
5286
5323
|
SdkAdapter,
|
|
5287
5324
|
createAutoAdapter
|
|
5288
5325
|
};
|
|
5289
|
-
//# sourceMappingURL=chunk-
|
|
5326
|
+
//# sourceMappingURL=chunk-3E4J3EE6.js.map
|