nexus-agents 2.63.0 → 2.63.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/README.md +7 -7
- package/dist/{adaptive-memory-TSZEJUJC.js → adaptive-memory-2UIPH67R.js} +5 -4
- package/dist/{chunk-JKDHWOQL.js → chunk-46S665SD.js} +6 -6
- package/dist/{chunk-PTGBJFSD.js → chunk-CDWQP3UC.js} +3 -3
- package/dist/{chunk-4G7MSCIK.js → chunk-EB7LP5WD.js} +182 -181
- package/dist/{chunk-4G7MSCIK.js.map → chunk-EB7LP5WD.js.map} +1 -1
- package/dist/{chunk-QGZBCD2A.js → chunk-EBFXDM3P.js} +2 -2
- package/dist/{chunk-GMOGKX4E.js → chunk-ETZULQ7Z.js} +2 -2
- package/dist/{chunk-R2Y57PM3.js → chunk-FAUHVWYZ.js} +2 -2
- package/dist/{chunk-H43PABG4.js → chunk-FHFNOMNK.js} +2 -2
- package/dist/{chunk-EDGG3RQE.js → chunk-FTWGBV7S.js} +2 -2
- package/dist/{chunk-7Y36JLES.js → chunk-I37IQ26H.js} +2 -2
- package/dist/{chunk-XEMRMZUN.js → chunk-KLZHA5KA.js} +4 -4
- package/dist/{chunk-TFEFN37P.js → chunk-KVZNQWWI.js} +2 -2
- package/dist/chunk-LJT65EA7.js +32 -0
- package/dist/chunk-LJT65EA7.js.map +1 -0
- package/dist/{chunk-6QU4DJYW.js → chunk-MSFUOGN4.js} +2 -2
- package/dist/{chunk-YU4NABXM.js → chunk-NF5KOUKM.js} +2 -2
- package/dist/{chunk-TC46TRLR.js → chunk-PB2EXTSV.js} +2 -2
- package/dist/{chunk-FEWWXGFE.js → chunk-PEDEZRPR.js} +54 -30
- package/dist/chunk-PEDEZRPR.js.map +1 -0
- package/dist/{chunk-V5CGWMYL.js → chunk-QAOI6EIU.js} +2 -2
- package/dist/{chunk-FMFQJLMR.js → chunk-QJTOZIE7.js} +19 -20
- package/dist/chunk-QJTOZIE7.js.map +1 -0
- package/dist/{chunk-AFSIP6JH.js → chunk-RCQZMJBZ.js} +3 -3
- package/dist/{chunk-EZXOJZYE.js → chunk-UCQTXKTS.js} +2 -2
- package/dist/{chunk-K7EA5OV4.js → chunk-UDKYZ7CS.js} +2 -2
- package/dist/{chunk-7C32M23X.js → chunk-V276U3ZC.js} +4 -4
- package/dist/{chunk-YQAOMDR2.js → chunk-ZC4KHPRL.js} +3 -3
- package/dist/cli-circuit-breaker-5E6OWOMI.js +14 -0
- package/dist/cli.js +42 -35
- package/dist/cli.js.map +1 -1
- package/dist/{composite-router-A7URDW4X.js → composite-router-FC3H7NKN.js} +4 -3
- package/dist/{consensus-vote-PRLGGUNY.js → consensus-vote-6FKSINXV.js} +11 -11
- package/dist/doctor-deep-X3YCUM4Q.js +13 -0
- package/dist/expert-bridge-R6FQWUHB.js +11 -0
- package/dist/factory-7DJA2CIL.js +15 -0
- package/dist/{factory-6MT5VKI3.js → factory-BOXBN4ZS.js} +6 -5
- package/dist/index.js +43 -45
- package/dist/index.js.map +1 -1
- package/dist/issue-triage-DGDKQQTD.js +16 -0
- package/dist/learning-persistence-FILWP3IR.js +17 -0
- package/dist/mcp-config-CHS2ZC42.js +13 -0
- package/dist/{mobimem-QDBP37H7.js → mobimem-NO7I2Y4O.js} +4 -3
- package/dist/{registry-command-TTXAUCOK.js → registry-command-ZO75YQJG.js} +9 -11
- package/dist/{registry-command-TTXAUCOK.js.map → registry-command-ZO75YQJG.js.map} +1 -1
- package/dist/{repo-security-plan-C3LLE3Z7.js → repo-security-plan-BZ3WOIEZ.js} +5 -4
- package/dist/research-helpers-synthesize-SH34FJIE.js +12 -0
- package/dist/{routing-memory-W3YWMLJM.js → routing-memory-SALB3DZI.js} +4 -3
- package/dist/{session-memory-DWF5Z2LC.js → session-memory-IOXXN6XA.js} +5 -4
- package/dist/{setup-command-QKAVRVLV.js → setup-command-IP2PV75E.js} +10 -10
- package/dist/setup-config-FYRXUWQH.js +11 -0
- package/dist/{setup-custom-api-CSB26HWD.js → setup-custom-api-VAFP4X43.js} +6 -5
- package/dist/{setup-custom-api-CSB26HWD.js.map → setup-custom-api-VAFP4X43.js.map} +1 -1
- package/dist/{weather-report-YQSLX4MS.js → weather-report-SBJRXFTW.js} +4 -3
- package/package.json +1 -1
- package/dist/chunk-CLYZ7FWP.js +0 -30
- package/dist/chunk-CLYZ7FWP.js.map +0 -1
- package/dist/chunk-FEWWXGFE.js.map +0 -1
- package/dist/chunk-FMFQJLMR.js.map +0 -1
- package/dist/cli-circuit-breaker-SL73NWX2.js +0 -13
- package/dist/doctor-deep-VN6KMUCG.js +0 -12
- package/dist/expert-bridge-BHTUNALT.js +0 -10
- package/dist/factory-FA7WDPZW.js +0 -14
- package/dist/issue-triage-YYTE6KTC.js +0 -15
- package/dist/learning-persistence-WMWZJZ35.js +0 -16
- package/dist/mcp-config-34XMRM64.js +0 -12
- package/dist/research-helpers-synthesize-NVQIWLQL.js +0 -11
- package/dist/setup-config-JA5IX53Q.js +0 -10
- /package/dist/{adaptive-memory-TSZEJUJC.js.map → adaptive-memory-2UIPH67R.js.map} +0 -0
- /package/dist/{chunk-JKDHWOQL.js.map → chunk-46S665SD.js.map} +0 -0
- /package/dist/{chunk-PTGBJFSD.js.map → chunk-CDWQP3UC.js.map} +0 -0
- /package/dist/{chunk-QGZBCD2A.js.map → chunk-EBFXDM3P.js.map} +0 -0
- /package/dist/{chunk-GMOGKX4E.js.map → chunk-ETZULQ7Z.js.map} +0 -0
- /package/dist/{chunk-R2Y57PM3.js.map → chunk-FAUHVWYZ.js.map} +0 -0
- /package/dist/{chunk-H43PABG4.js.map → chunk-FHFNOMNK.js.map} +0 -0
- /package/dist/{chunk-EDGG3RQE.js.map → chunk-FTWGBV7S.js.map} +0 -0
- /package/dist/{chunk-7Y36JLES.js.map → chunk-I37IQ26H.js.map} +0 -0
- /package/dist/{chunk-XEMRMZUN.js.map → chunk-KLZHA5KA.js.map} +0 -0
- /package/dist/{chunk-TFEFN37P.js.map → chunk-KVZNQWWI.js.map} +0 -0
- /package/dist/{chunk-6QU4DJYW.js.map → chunk-MSFUOGN4.js.map} +0 -0
- /package/dist/{chunk-YU4NABXM.js.map → chunk-NF5KOUKM.js.map} +0 -0
- /package/dist/{chunk-TC46TRLR.js.map → chunk-PB2EXTSV.js.map} +0 -0
- /package/dist/{chunk-V5CGWMYL.js.map → chunk-QAOI6EIU.js.map} +0 -0
- /package/dist/{chunk-AFSIP6JH.js.map → chunk-RCQZMJBZ.js.map} +0 -0
- /package/dist/{chunk-EZXOJZYE.js.map → chunk-UCQTXKTS.js.map} +0 -0
- /package/dist/{chunk-K7EA5OV4.js.map → chunk-UDKYZ7CS.js.map} +0 -0
- /package/dist/{chunk-7C32M23X.js.map → chunk-V276U3ZC.js.map} +0 -0
- /package/dist/{chunk-YQAOMDR2.js.map → chunk-ZC4KHPRL.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-SL73NWX2.js.map → cli-circuit-breaker-5E6OWOMI.js.map} +0 -0
- /package/dist/{composite-router-A7URDW4X.js.map → composite-router-FC3H7NKN.js.map} +0 -0
- /package/dist/{consensus-vote-PRLGGUNY.js.map → consensus-vote-6FKSINXV.js.map} +0 -0
- /package/dist/{doctor-deep-VN6KMUCG.js.map → doctor-deep-X3YCUM4Q.js.map} +0 -0
- /package/dist/{expert-bridge-BHTUNALT.js.map → expert-bridge-R6FQWUHB.js.map} +0 -0
- /package/dist/{factory-6MT5VKI3.js.map → factory-7DJA2CIL.js.map} +0 -0
- /package/dist/{factory-FA7WDPZW.js.map → factory-BOXBN4ZS.js.map} +0 -0
- /package/dist/{issue-triage-YYTE6KTC.js.map → issue-triage-DGDKQQTD.js.map} +0 -0
- /package/dist/{learning-persistence-WMWZJZ35.js.map → learning-persistence-FILWP3IR.js.map} +0 -0
- /package/dist/{mcp-config-34XMRM64.js.map → mcp-config-CHS2ZC42.js.map} +0 -0
- /package/dist/{mobimem-QDBP37H7.js.map → mobimem-NO7I2Y4O.js.map} +0 -0
- /package/dist/{repo-security-plan-C3LLE3Z7.js.map → repo-security-plan-BZ3WOIEZ.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-NVQIWLQL.js.map → research-helpers-synthesize-SH34FJIE.js.map} +0 -0
- /package/dist/{routing-memory-W3YWMLJM.js.map → routing-memory-SALB3DZI.js.map} +0 -0
- /package/dist/{session-memory-DWF5Z2LC.js.map → session-memory-IOXXN6XA.js.map} +0 -0
- /package/dist/{setup-command-QKAVRVLV.js.map → setup-command-IP2PV75E.js.map} +0 -0
- /package/dist/{setup-config-JA5IX53Q.js.map → setup-config-FYRXUWQH.js.map} +0 -0
- /package/dist/{weather-report-YQSLX4MS.js.map → weather-report-SBJRXFTW.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getErrorMessage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FAUHVWYZ.js";
|
|
4
4
|
|
|
5
5
|
// src/cli/setup-config.ts
|
|
6
6
|
import { copyFileSync, existsSync, writeFileSync } from "fs";
|
|
@@ -74,4 +74,4 @@ function ensureBackup(outputPath) {
|
|
|
74
74
|
export {
|
|
75
75
|
runConfigInitSync
|
|
76
76
|
};
|
|
77
|
-
//# sourceMappingURL=chunk-
|
|
77
|
+
//# sourceMappingURL=chunk-EBFXDM3P.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getErrorMessage,
|
|
6
6
|
getTimeProvider,
|
|
7
7
|
ok
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FAUHVWYZ.js";
|
|
9
9
|
|
|
10
10
|
// src/cli-adapters/circuit-breaker-types.ts
|
|
11
11
|
var CircuitErrorCode = {
|
|
@@ -353,4 +353,4 @@ export {
|
|
|
353
353
|
CircuitBreakerRegistry,
|
|
354
354
|
mapCliErrorToCategory
|
|
355
355
|
};
|
|
356
|
-
//# sourceMappingURL=chunk-
|
|
356
|
+
//# sourceMappingURL=chunk-ETZULQ7Z.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isPersistenceEnabled
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LJT65EA7.js";
|
|
4
4
|
import {
|
|
5
5
|
__require
|
|
6
6
|
} from "./chunk-UP2VWCW5.js";
|
|
@@ -11127,4 +11127,4 @@ export {
|
|
|
11127
11127
|
ParseError,
|
|
11128
11128
|
OrchestratorError
|
|
11129
11129
|
};
|
|
11130
|
-
//# sourceMappingURL=chunk-
|
|
11130
|
+
//# sourceMappingURL=chunk-FAUHVWYZ.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
MCP_TIMEOUTS,
|
|
6
6
|
TEST_TIMEOUTS,
|
|
7
7
|
WORKFLOW_TIMEOUTS
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FAUHVWYZ.js";
|
|
9
9
|
|
|
10
10
|
// src/config/defaults-env.ts
|
|
11
11
|
function parseIntEnv(envKey, fallback) {
|
|
@@ -399,4 +399,4 @@ export {
|
|
|
399
399
|
CUSTOM_API_DEFAULT_MODEL,
|
|
400
400
|
DEFAULTS
|
|
401
401
|
};
|
|
402
|
-
//# sourceMappingURL=chunk-
|
|
402
|
+
//# sourceMappingURL=chunk-FHFNOMNK.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createLogger
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FAUHVWYZ.js";
|
|
4
4
|
|
|
5
5
|
// src/swe-bench/mcp-config.ts
|
|
6
6
|
import { writeFile, mkdtemp, rm } from "fs/promises";
|
|
@@ -58,4 +58,4 @@ export {
|
|
|
58
58
|
generateMcpConfig,
|
|
59
59
|
getDefaultAllowedTools
|
|
60
60
|
};
|
|
61
|
-
//# sourceMappingURL=chunk-
|
|
61
|
+
//# sourceMappingURL=chunk-FTWGBV7S.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
getErrorMessage,
|
|
5
5
|
getTimeProvider,
|
|
6
6
|
ok
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FAUHVWYZ.js";
|
|
8
8
|
|
|
9
9
|
// src/context/session-memory.ts
|
|
10
10
|
import * as fs from "fs";
|
|
@@ -351,4 +351,4 @@ export {
|
|
|
351
351
|
SessionMemory,
|
|
352
352
|
createSessionMemory
|
|
353
353
|
};
|
|
354
|
-
//# sourceMappingURL=chunk-
|
|
354
|
+
//# sourceMappingURL=chunk-I37IQ26H.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveToken
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UCQTXKTS.js";
|
|
4
4
|
import {
|
|
5
5
|
GitHubProvider,
|
|
6
6
|
ScmError
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UDKYZ7CS.js";
|
|
8
8
|
import {
|
|
9
9
|
err,
|
|
10
10
|
ok
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-FAUHVWYZ.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-
|
|
44
|
+
//# sourceMappingURL=chunk-KLZHA5KA.js.map
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
formatZodError,
|
|
12
12
|
getTimeProvider,
|
|
13
13
|
ok
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-FAUHVWYZ.js";
|
|
15
15
|
|
|
16
16
|
// src/context/memory-backend-types.ts
|
|
17
17
|
import { z } from "zod";
|
|
@@ -941,4 +941,4 @@ export {
|
|
|
941
941
|
AdaptiveMemoryBackend,
|
|
942
942
|
createAdaptiveMemory
|
|
943
943
|
};
|
|
944
|
-
//# sourceMappingURL=chunk-
|
|
944
|
+
//# sourceMappingURL=chunk-KVZNQWWI.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getNexusDataDir
|
|
3
|
+
} from "./chunk-FDNWRZNJ.js";
|
|
4
|
+
|
|
5
|
+
// src/config/learning-persistence.ts
|
|
6
|
+
import { mkdirSync } from "fs";
|
|
7
|
+
import { join } from "path";
|
|
8
|
+
function getLearningDir() {
|
|
9
|
+
return join(getNexusDataDir(), "learning");
|
|
10
|
+
}
|
|
11
|
+
function getOutcomesFile() {
|
|
12
|
+
return join(getLearningDir(), "outcomes.jsonl");
|
|
13
|
+
}
|
|
14
|
+
function getRulesFile() {
|
|
15
|
+
return join(getLearningDir(), "rules.json");
|
|
16
|
+
}
|
|
17
|
+
var DIR_MODE = 448;
|
|
18
|
+
function isPersistenceEnabled() {
|
|
19
|
+
return process.env["NEXUS_PERSIST_LEARNING"] !== "false";
|
|
20
|
+
}
|
|
21
|
+
function ensureLearningDir(dir) {
|
|
22
|
+
mkdirSync(dir ?? getLearningDir(), { recursive: true, mode: DIR_MODE });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
getLearningDir,
|
|
27
|
+
getOutcomesFile,
|
|
28
|
+
getRulesFile,
|
|
29
|
+
isPersistenceEnabled,
|
|
30
|
+
ensureLearningDir
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=chunk-LJT65EA7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/config/learning-persistence.ts"],"sourcesContent":["/**\n * Shared configuration for cross-session learning persistence.\n *\n * Controls where learning data (outcomes, distilled rules) is stored\n * on disk and whether persistence is enabled via feature flag.\n *\n * @module config/learning-persistence\n * (Source: Issue #1009 — Cross-session persistence)\n */\n\nimport { mkdirSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { getNexusDataDir } from './nexus-data-dir.js';\n\n// ============================================================================\n// Path resolution (#2316: must read NEXUS_DATA_DIR at call time, not import)\n// ============================================================================\n\n/**\n * Base directory for learning persistence data. Resolved at call time so\n * `NEXUS_DATA_DIR` overrides take effect — the const-at-import-time\n * pattern this replaces was the bug discovered while dogfooding v2.63.0\n * (#2316). Outcome counts on a fresh portable workspace were leaking\n * the host home directory's outcome history.\n */\nexport function getLearningDir(): string {\n return join(getNexusDataDir(), 'learning');\n}\n\n/** JSONL file for persisted task outcomes. */\nexport function getOutcomesFile(): string {\n return join(getLearningDir(), 'outcomes.jsonl');\n}\n\n/** JSON file for persisted distilled rules. */\nexport function getRulesFile(): string {\n return join(getLearningDir(), 'rules.json');\n}\n\n// Note: previous LEARNING_DIR / OUTCOMES_FILE / RULES_FILE exports were\n// removed in #2316 — they were evaluated at module import time and ignored\n// `NEXUS_DATA_DIR`. All callers must use the getter functions above.\n\n/** Directory mode: owner-only (rwx------). */\nconst DIR_MODE = 0o700;\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\n/**\n * Check whether learning persistence is enabled via feature flag.\n *\n * Defaults to true — cross-session LinUCB routing data persists to\n * `~/.nexus-agents/learning/` unless explicitly disabled.\n * Only routing metadata is stored (model, success, duration, category).\n * No user prompts, API keys, or model outputs are persisted.\n *\n * Set NEXUS_PERSIST_LEARNING=false to disable.\n */\nexport function isPersistenceEnabled(): boolean {\n return process.env['NEXUS_PERSIST_LEARNING'] !== 'false';\n}\n\n/** Ensure the learning data directory exists. */\nexport function ensureLearningDir(dir?: string): void {\n mkdirSync(dir ?? getLearningDir(), { recursive: true, mode: DIR_MODE });\n}\n"],"mappings":";;;;;AAUA,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AAcd,SAAS,iBAAyB;AACvC,SAAO,KAAK,gBAAgB,GAAG,UAAU;AAC3C;AAGO,SAAS,kBAA0B;AACxC,SAAO,KAAK,eAAe,GAAG,gBAAgB;AAChD;AAGO,SAAS,eAAuB;AACrC,SAAO,KAAK,eAAe,GAAG,YAAY;AAC5C;AAOA,IAAM,WAAW;AAgBV,SAAS,uBAAgC;AAC9C,SAAO,QAAQ,IAAI,wBAAwB,MAAM;AACnD;AAGO,SAAS,kBAAkB,KAAoB;AACpD,YAAU,OAAO,eAAe,GAAG,EAAE,WAAW,MAAM,MAAM,SAAS,CAAC;AACxE;","names":[]}
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
TASK_CATEGORIES,
|
|
3
3
|
getAdaptiveBonus,
|
|
4
4
|
getOutcomeStore
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FAUHVWYZ.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-
|
|
109
|
+
//# sourceMappingURL=chunk-MSFUOGN4.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
ConfigError,
|
|
3
3
|
err,
|
|
4
4
|
ok
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FAUHVWYZ.js";
|
|
6
6
|
|
|
7
7
|
// src/adapters/sdk/types.ts
|
|
8
8
|
var PROVIDER_ENV_KEYS = {
|
|
@@ -117,4 +117,4 @@ export {
|
|
|
117
117
|
CUSTOM_API_ALLOW_PRIVATE_ENV,
|
|
118
118
|
validateCustomApiBaseUrl
|
|
119
119
|
};
|
|
120
|
-
//# sourceMappingURL=chunk-
|
|
120
|
+
//# sourceMappingURL=chunk-NF5KOUKM.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
ParseError,
|
|
6
6
|
SecurityError,
|
|
7
7
|
getErrorMessage
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FAUHVWYZ.js";
|
|
9
9
|
|
|
10
10
|
// src/cli/research-helpers-io.ts
|
|
11
11
|
import * as fs from "fs/promises";
|
|
@@ -918,4 +918,4 @@ export {
|
|
|
918
918
|
normalizeTopicToCanonical,
|
|
919
919
|
synthesizeResearch
|
|
920
920
|
};
|
|
921
|
-
//# sourceMappingURL=chunk-
|
|
921
|
+
//# sourceMappingURL=chunk-PB2EXTSV.js.map
|
|
@@ -2,16 +2,21 @@ import {
|
|
|
2
2
|
CUSTOM_API_BASE_URL_ENV,
|
|
3
3
|
PROVIDER_ENV_KEYS,
|
|
4
4
|
validateCustomApiBaseUrl
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-NF5KOUKM.js";
|
|
6
6
|
import {
|
|
7
7
|
CUSTOM_API_DEFAULT_MODEL
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FHFNOMNK.js";
|
|
9
9
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
createCliAdapter,
|
|
11
|
+
createCliDetectionCache,
|
|
12
|
+
delay,
|
|
13
|
+
getAvailableClis,
|
|
14
|
+
isCliAvailable,
|
|
15
|
+
withTimeout
|
|
16
|
+
} from "./chunk-ZC4KHPRL.js";
|
|
12
17
|
import {
|
|
13
18
|
SessionMemory
|
|
14
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-I37IQ26H.js";
|
|
15
20
|
import {
|
|
16
21
|
AdaptiveMemoryBackend,
|
|
17
22
|
HybridMemoryBackend,
|
|
@@ -20,19 +25,11 @@ import {
|
|
|
20
25
|
getMemoryEntry,
|
|
21
26
|
memoryExists,
|
|
22
27
|
memoryRowToEntry
|
|
23
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-KVZNQWWI.js";
|
|
24
29
|
import {
|
|
25
30
|
stringifyValue,
|
|
26
31
|
tokenizeFiltered
|
|
27
32
|
} from "./chunk-633WH2ML.js";
|
|
28
|
-
import {
|
|
29
|
-
createCliAdapter,
|
|
30
|
-
createCliDetectionCache,
|
|
31
|
-
delay,
|
|
32
|
-
getAvailableClis,
|
|
33
|
-
isCliAvailable,
|
|
34
|
-
withTimeout
|
|
35
|
-
} from "./chunk-YQAOMDR2.js";
|
|
36
33
|
import {
|
|
37
34
|
AgentError,
|
|
38
35
|
CACHE_TIMEOUTS,
|
|
@@ -79,11 +76,14 @@ import {
|
|
|
79
76
|
resolveVoteTimeout,
|
|
80
77
|
toRateLimitError,
|
|
81
78
|
validateTimeout
|
|
82
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-FAUHVWYZ.js";
|
|
83
80
|
import {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
} from "./chunk-
|
|
81
|
+
ensureLearningDir,
|
|
82
|
+
getOutcomesFile
|
|
83
|
+
} from "./chunk-LJT65EA7.js";
|
|
84
|
+
import {
|
|
85
|
+
nexusDataPath
|
|
86
|
+
} from "./chunk-FDNWRZNJ.js";
|
|
87
87
|
|
|
88
88
|
// src/mcp/tools/consensus-vote.ts
|
|
89
89
|
import { z as z19 } from "zod";
|
|
@@ -8082,7 +8082,9 @@ var ConsensusVoteInputSchema = z8.object({
|
|
|
8082
8082
|
"Voting strategy: simple_majority (default), supermajority, unanimous, proof_of_learning, or higher_order (Bayesian-optimal)"
|
|
8083
8083
|
),
|
|
8084
8084
|
quickMode: z8.boolean().optional().default(false).describe("Use 3 agents instead of 5 for faster execution"),
|
|
8085
|
-
simulateVotes: z8.boolean().optional().default(false).describe(
|
|
8085
|
+
simulateVotes: z8.boolean().optional().default(false).describe(
|
|
8086
|
+
"TESTS ONLY \u2014 when true, voters return random decisions. Output must not be used for real decisions. (#2319)"
|
|
8087
|
+
)
|
|
8086
8088
|
});
|
|
8087
8089
|
function toAgentVoteSummary(result) {
|
|
8088
8090
|
const roleName = VOTER_ROLES[result.role].split(" - ")[0] ?? result.role;
|
|
@@ -10345,7 +10347,6 @@ var AgenticMemoryBackend = class {
|
|
|
10345
10347
|
|
|
10346
10348
|
// src/context/belief-memory-persistence.ts
|
|
10347
10349
|
import * as fs2 from "fs";
|
|
10348
|
-
import * as os from "os";
|
|
10349
10350
|
import * as path from "path";
|
|
10350
10351
|
|
|
10351
10352
|
// src/context/belief-persistence-types.ts
|
|
@@ -10424,7 +10425,9 @@ var BeliefSnapshotSchema = z16.object({
|
|
|
10424
10425
|
});
|
|
10425
10426
|
|
|
10426
10427
|
// src/context/belief-memory-persistence.ts
|
|
10427
|
-
|
|
10428
|
+
function getBeliefsDir() {
|
|
10429
|
+
return nexusDataPath("memory", "beliefs");
|
|
10430
|
+
}
|
|
10428
10431
|
var MAX_SNAPSHOT_FILES = 10;
|
|
10429
10432
|
var SNAPSHOT_VERSION = 1;
|
|
10430
10433
|
function optProp(key, value) {
|
|
@@ -10602,11 +10605,11 @@ function hydrateSnapshot(snapshot) {
|
|
|
10602
10605
|
};
|
|
10603
10606
|
}
|
|
10604
10607
|
function ensureBeliefsDir() {
|
|
10605
|
-
if (!fs2.existsSync(
|
|
10608
|
+
if (!fs2.existsSync(getBeliefsDir())) fs2.mkdirSync(getBeliefsDir(), { recursive: true });
|
|
10606
10609
|
}
|
|
10607
10610
|
function getSnapshotFiles() {
|
|
10608
10611
|
try {
|
|
10609
|
-
return fs2.readdirSync(
|
|
10612
|
+
return fs2.readdirSync(getBeliefsDir()).filter((f) => f.startsWith("beliefs-") && f.endsWith(".json")).sort().reverse();
|
|
10610
10613
|
} catch {
|
|
10611
10614
|
return [];
|
|
10612
10615
|
}
|
|
@@ -10616,7 +10619,7 @@ function enforceRetention(logger11) {
|
|
|
10616
10619
|
const files = getSnapshotFiles();
|
|
10617
10620
|
if (files.length <= MAX_SNAPSHOT_FILES) return;
|
|
10618
10621
|
const toDelete = files.slice(MAX_SNAPSHOT_FILES);
|
|
10619
|
-
for (const file of toDelete) fs2.unlinkSync(path.join(
|
|
10622
|
+
for (const file of toDelete) fs2.unlinkSync(path.join(getBeliefsDir(), file));
|
|
10620
10623
|
logger11.debug("Belief snapshot retention enforced", {
|
|
10621
10624
|
kept: MAX_SNAPSHOT_FILES,
|
|
10622
10625
|
deleted: toDelete.length
|
|
@@ -10633,7 +10636,7 @@ function saveBeliefSnapshot(data, logger11) {
|
|
|
10633
10636
|
const snapshot = createSnapshot(data);
|
|
10634
10637
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
10635
10638
|
const filename = `beliefs-${timestamp}.json`;
|
|
10636
|
-
const filepath = path.join(
|
|
10639
|
+
const filepath = path.join(getBeliefsDir(), filename);
|
|
10637
10640
|
fs2.writeFileSync(filepath, JSON.stringify(snapshot, null, 2), "utf-8");
|
|
10638
10641
|
logger11.info("Belief memory snapshot saved", { filename, beliefs: snapshot.beliefs.length });
|
|
10639
10642
|
enforceRetention(logger11);
|
|
@@ -10653,7 +10656,7 @@ function loadBeliefSnapshot(logger11) {
|
|
|
10653
10656
|
}
|
|
10654
10657
|
for (const file of files.slice(0, 3)) {
|
|
10655
10658
|
try {
|
|
10656
|
-
const filepath = path.join(
|
|
10659
|
+
const filepath = path.join(getBeliefsDir(), file);
|
|
10657
10660
|
const raw = JSON.parse(fs2.readFileSync(filepath, "utf-8"));
|
|
10658
10661
|
const validation = BeliefSnapshotSchema.safeParse(raw);
|
|
10659
10662
|
if (!validation.success) {
|
|
@@ -12493,7 +12496,7 @@ var PersistentOutcomeStore = class extends OutcomeStore {
|
|
|
12493
12496
|
logger;
|
|
12494
12497
|
constructor(config, logger11) {
|
|
12495
12498
|
super(config);
|
|
12496
|
-
this.filePath = config?.filePath ??
|
|
12499
|
+
this.filePath = config?.filePath ?? getOutcomesFile();
|
|
12497
12500
|
this.logger = logger11 ?? createLogger({ component: "PersistentOutcomeStore" });
|
|
12498
12501
|
const dataDir = config?.dataDir;
|
|
12499
12502
|
ensureLearningDir(dataDir);
|
|
@@ -12637,6 +12640,11 @@ function emitTrendDetected(bus, detail) {
|
|
|
12637
12640
|
// src/mcp/tools/consensus-vote-recording.ts
|
|
12638
12641
|
var logger10 = createLogger({ tool: "consensus-vote" });
|
|
12639
12642
|
function recordVoteSuccess(proposal, strategy, outcome, duration, votes) {
|
|
12643
|
+
const allSimulated = votes !== void 0 && votes.length > 0 && votes.every((v) => v.source === "simulation");
|
|
12644
|
+
if (allSimulated) {
|
|
12645
|
+
logger10.debug("Skipping memory + outcome recording \u2014 all votes simulated");
|
|
12646
|
+
return;
|
|
12647
|
+
}
|
|
12640
12648
|
try {
|
|
12641
12649
|
const memory = getToolMemory();
|
|
12642
12650
|
memory.recordTask({
|
|
@@ -12700,6 +12708,20 @@ function recordVoteOutcomes(votes) {
|
|
|
12700
12708
|
}
|
|
12701
12709
|
}
|
|
12702
12710
|
|
|
12711
|
+
// src/mcp/tools/simulation-guard.ts
|
|
12712
|
+
var WARNED = /* @__PURE__ */ new Set();
|
|
12713
|
+
function isTestRunner() {
|
|
12714
|
+
return process.env.VITEST === "true" || process.env.NODE_ENV === "test";
|
|
12715
|
+
}
|
|
12716
|
+
function warnIfSimulatedOutsideTests(toolName, logger11) {
|
|
12717
|
+
if (isTestRunner()) return;
|
|
12718
|
+
if (WARNED.has(toolName)) return;
|
|
12719
|
+
WARNED.add(toolName);
|
|
12720
|
+
logger11.warn(
|
|
12721
|
+
`[${toolName}] simulateVotes=true: output is RANDOM and reserved for tests/demos. Do not treat the result as a real decision.`
|
|
12722
|
+
);
|
|
12723
|
+
}
|
|
12724
|
+
|
|
12703
12725
|
// src/mcp/tools/consensus-vote.ts
|
|
12704
12726
|
var persistentCorrelationTracker;
|
|
12705
12727
|
function getOrCreateCorrelationTracker() {
|
|
@@ -12855,7 +12877,7 @@ async function processVotesWithCascade(votes, opts) {
|
|
|
12855
12877
|
var CONTRARIAN_ESCALATION_THRESHOLD = 0.8;
|
|
12856
12878
|
async function runContrarianCheck(proposal, log) {
|
|
12857
12879
|
try {
|
|
12858
|
-
const { executeExpert } = await import("./expert-bridge-
|
|
12880
|
+
const { executeExpert } = await import("./expert-bridge-R6FQWUHB.js");
|
|
12859
12881
|
const prompt = [
|
|
12860
12882
|
"You are a contrarian analyst. Your job is to find reasons this proposal should be REJECTED.",
|
|
12861
12883
|
"Look for: YAGNI (not needed), MISALIGNED (wrong tech/architecture), SECURITY_RISK, SCOPE_CREEP.",
|
|
@@ -12932,6 +12954,7 @@ async function executeVoting(input, logger11) {
|
|
|
12932
12954
|
}
|
|
12933
12955
|
async function handleConsensusVote(deps, args) {
|
|
12934
12956
|
const logger11 = deps.logger ?? createLogger({ tool: "consensus_vote" });
|
|
12957
|
+
if (args.simulateVotes) warnIfSimulatedOutsideTests("consensus_vote", logger11);
|
|
12935
12958
|
try {
|
|
12936
12959
|
const result = await executeVoting(args, logger11);
|
|
12937
12960
|
const strategy = args.strategy ?? "simple_majority";
|
|
@@ -13064,7 +13087,7 @@ function registerConsensusVoteTool(server, deps) {
|
|
|
13064
13087
|
"Voting strategy: simple_majority (default), supermajority, unanimous, proof_of_learning, or higher_order"
|
|
13065
13088
|
),
|
|
13066
13089
|
quickMode: z19.boolean().optional().default(false).describe("Use 3 agents instead of 7"),
|
|
13067
|
-
simulateVotes: z19.boolean().optional().default(false).describe("
|
|
13090
|
+
simulateVotes: z19.boolean().optional().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)")
|
|
13068
13091
|
};
|
|
13069
13092
|
const description = "Execute multi-model consensus voting on a proposal. Uses 7 specialized agent roles (architect, security, devex, ai_ml, pm, catfish, scope_steward) to vote on proposals with configurable strategies. Supports higher_order strategy for Bayesian-optimal aggregation with correlation awareness (Issue #514).";
|
|
13070
13093
|
const secureHandler = createSecureHandler(createConsensusVoteHandler(depsWithNotifier), {
|
|
@@ -13223,9 +13246,10 @@ export {
|
|
|
13223
13246
|
createCorrelationTracker,
|
|
13224
13247
|
VotingStrategySchema,
|
|
13225
13248
|
ConsensusVoteInputSchema,
|
|
13249
|
+
warnIfSimulatedOutsideTests,
|
|
13226
13250
|
resetCorrelationTracker,
|
|
13227
13251
|
executeVoting,
|
|
13228
13252
|
CONSENSUS_VOTE_OUTPUT_SCHEMA,
|
|
13229
13253
|
registerConsensusVoteTool
|
|
13230
13254
|
};
|
|
13231
|
-
//# sourceMappingURL=chunk-
|
|
13255
|
+
//# sourceMappingURL=chunk-PEDEZRPR.js.map
|