nexus-agents 8.12.0 → 8.14.0
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-ULTGOLYC.js → ast-rule-runner-KUJFW47X.js} +3 -3
- package/dist/{child-mcp-config-3GRIYVTK.js → child-mcp-config-IYTNL7BL.js} +2 -2
- package/dist/{chunk-P4ZJXKI2.js → chunk-34RAZYMS.js} +2 -2
- package/dist/{chunk-IWGOQT2U.js → chunk-357SIWOH.js} +3 -3
- package/dist/{chunk-64OYCDBV.js → chunk-6KIB5IEZ.js} +2 -2
- package/dist/{chunk-PDPVC2OX.js → chunk-6XQIQFSZ.js} +2 -2
- package/dist/{chunk-X7ESU7NR.js → chunk-AJVKSAL4.js} +4 -4
- package/dist/{chunk-SMYENAUF.js → chunk-BQEHURYG.js} +2 -2
- package/dist/{chunk-TURKS6GI.js → chunk-DO63GVEY.js} +7 -7
- package/dist/{chunk-55DJLNSW.js → chunk-DVYY5WN6.js} +35 -15
- package/dist/chunk-DVYY5WN6.js.map +1 -0
- package/dist/{chunk-PIMUNS74.js → chunk-EIEC22PA.js} +2 -2
- package/dist/{chunk-2HWSN5MU.js → chunk-FGEGUND2.js} +2 -2
- package/dist/chunk-GLIEFVVU.js +7 -0
- package/dist/{chunk-VEWMQCWS.js → chunk-GZTMRQCU.js} +4 -4
- package/dist/{chunk-LG46AWH2.js → chunk-HJQK55Y3.js} +2 -2
- package/dist/{chunk-5XV6E3ZG.js → chunk-HMMDFXWP.js} +2 -2
- package/dist/{chunk-VHNL7SEV.js → chunk-HVNAQEXZ.js} +4 -4
- package/dist/{chunk-UGJD6VAO.js → chunk-I7CJQVAU.js} +8 -8
- package/dist/{chunk-BGW474Z7.js → chunk-KHJACO7N.js} +2 -2
- package/dist/{chunk-43CSXUDA.js → chunk-LMYHGHZN.js} +41 -36
- package/dist/{chunk-43CSXUDA.js.map → chunk-LMYHGHZN.js.map} +1 -1
- package/dist/{chunk-45544EK4.js → chunk-MNL3WLSK.js} +2 -2
- package/dist/{chunk-RO5PBERK.js → chunk-MSOUT5RH.js} +9 -9
- package/dist/{chunk-NNHBAG24.js → chunk-MSYJ6PXM.js} +2 -2
- package/dist/{chunk-GZ4HYAEA.js → chunk-NQKOEST5.js} +2 -2
- package/dist/{chunk-YG7CNXSA.js → chunk-PNUKI2ME.js} +6 -6
- package/dist/{chunk-WBDV5YEW.js → chunk-QILEDL6U.js} +5 -5
- package/dist/{chunk-XUVTH4KP.js → chunk-SAHC533U.js} +2 -2
- package/dist/{chunk-BNEQG7PP.js → chunk-SZZAVOGX.js} +3 -3
- package/dist/{chunk-C3BE2YNZ.js → chunk-T22TMAIG.js} +5 -5
- package/dist/{chunk-YIMWO55G.js → chunk-TXVM5B3N.js} +2 -2
- package/dist/{chunk-AOWHPHH5.js → chunk-UGBTAJIZ.js} +4 -4
- package/dist/{chunk-QYYH6J2J.js → chunk-VBR2WGUN.js} +2 -2
- package/dist/{chunk-L5VUMXDA.js → chunk-XUQY3DRD.js} +3 -3
- package/dist/{chunk-AHMLCRHA.js → chunk-Z2JGBVLF.js} +2 -2
- package/dist/{chunk-2AOTXWA4.js → chunk-ZCF3WKIB.js} +12 -5
- package/dist/{chunk-2AOTXWA4.js.map → chunk-ZCF3WKIB.js.map} +1 -1
- package/dist/{chunk-2D3BRT4W.js → chunk-ZVBGJJHJ.js} +7 -7
- package/dist/{cli-circuit-breaker-4LN2Y7W2.js → cli-circuit-breaker-KB4D3ZQJ.js} +3 -3
- package/dist/cli.js +85 -55
- package/dist/cli.js.map +1 -1
- package/dist/{composite-router-NUDAZQVG.js → composite-router-EHJLO5VJ.js} +2 -2
- package/dist/{consensus-vote-QRF2VFTE.js → consensus-vote-TMWNYIHD.js} +17 -17
- package/dist/{context-retriever-3SZVQJ2Y.js → context-retriever-6OBOSRB6.js} +8 -8
- package/dist/{doctor-deep-EZRNR7DV.js → doctor-deep-LPSVGBF2.js} +3 -3
- package/dist/{doctor-live-Z73GHTJS.js → doctor-live-A6OJPJF7.js} +9 -9
- package/dist/{expert-bridge-XOFUAAI7.js → expert-bridge-CNT6CMBD.js} +4 -4
- package/dist/{factory-QIODQUMI.js → factory-I2VVLBIF.js} +9 -9
- package/dist/{factory-3HFIT5Y6.js → factory-JBI4JQBU.js} +5 -5
- package/dist/{improvement-review-7RC42LWW.js → improvement-review-SZTIX2IL.js} +6 -6
- package/dist/index.d.ts +3 -3
- package/dist/index.js +32 -32
- package/dist/{init-opencode-O54HSBQY.js → init-opencode-3NZVCAQX.js} +6 -6
- package/dist/issue-triage-7P3FSETT.js +17 -0
- package/dist/{pr-reviewer-helpers-OY6Y6ALX.js → pr-reviewer-helpers-OQLT6XRH.js} +4 -4
- package/dist/{registry-command-KNQTC6PH.js → registry-command-CYDFEOLI.js} +2 -2
- package/dist/{repo-security-plan-VSEJRFA6.js → repo-security-plan-ICJBDJHL.js} +3 -3
- package/dist/{research-helpers-synthesize-2XX7MRD2.js → research-helpers-synthesize-RGXQKUDE.js} +4 -4
- package/dist/{routing-memory-NCUTBJWR.js → routing-memory-MB4HBNZU.js} +2 -2
- package/dist/{session-memory-E2HZZQVR.js → session-memory-P2WTGEFO.js} +3 -3
- package/dist/{setup-config-TZSIS3CV.js → setup-config-SE6RBMRL.js} +3 -3
- package/dist/{setup-custom-api-YGDDTJ3R.js → setup-custom-api-XWWHUIWI.js} +4 -4
- package/dist/setup-data-dir-PFCBRVZ5.js +29 -0
- package/dist/{tool-memory-QHQI2HTQ.js → tool-memory-5FSWU4LY.js} +5 -5
- package/dist/{unified-registry-25EVXQKI.js → unified-registry-QYKA5N3R.js} +10 -10
- package/dist/{weather-report-UTQ4DSZP.js → weather-report-QCAOIHI2.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-55DJLNSW.js.map +0 -1
- package/dist/chunk-N4ZVNOYN.js +0 -7
- package/dist/issue-triage-AHYTWMTZ.js +0 -17
- package/dist/setup-data-dir-ATYDEUSH.js +0 -29
- /package/dist/{ast-rule-runner-ULTGOLYC.js.map → ast-rule-runner-KUJFW47X.js.map} +0 -0
- /package/dist/{child-mcp-config-3GRIYVTK.js.map → child-mcp-config-IYTNL7BL.js.map} +0 -0
- /package/dist/{chunk-P4ZJXKI2.js.map → chunk-34RAZYMS.js.map} +0 -0
- /package/dist/{chunk-IWGOQT2U.js.map → chunk-357SIWOH.js.map} +0 -0
- /package/dist/{chunk-64OYCDBV.js.map → chunk-6KIB5IEZ.js.map} +0 -0
- /package/dist/{chunk-PDPVC2OX.js.map → chunk-6XQIQFSZ.js.map} +0 -0
- /package/dist/{chunk-X7ESU7NR.js.map → chunk-AJVKSAL4.js.map} +0 -0
- /package/dist/{chunk-SMYENAUF.js.map → chunk-BQEHURYG.js.map} +0 -0
- /package/dist/{chunk-TURKS6GI.js.map → chunk-DO63GVEY.js.map} +0 -0
- /package/dist/{chunk-PIMUNS74.js.map → chunk-EIEC22PA.js.map} +0 -0
- /package/dist/{chunk-2HWSN5MU.js.map → chunk-FGEGUND2.js.map} +0 -0
- /package/dist/{chunk-N4ZVNOYN.js.map → chunk-GLIEFVVU.js.map} +0 -0
- /package/dist/{chunk-VEWMQCWS.js.map → chunk-GZTMRQCU.js.map} +0 -0
- /package/dist/{chunk-LG46AWH2.js.map → chunk-HJQK55Y3.js.map} +0 -0
- /package/dist/{chunk-5XV6E3ZG.js.map → chunk-HMMDFXWP.js.map} +0 -0
- /package/dist/{chunk-VHNL7SEV.js.map → chunk-HVNAQEXZ.js.map} +0 -0
- /package/dist/{chunk-UGJD6VAO.js.map → chunk-I7CJQVAU.js.map} +0 -0
- /package/dist/{chunk-BGW474Z7.js.map → chunk-KHJACO7N.js.map} +0 -0
- /package/dist/{chunk-45544EK4.js.map → chunk-MNL3WLSK.js.map} +0 -0
- /package/dist/{chunk-RO5PBERK.js.map → chunk-MSOUT5RH.js.map} +0 -0
- /package/dist/{chunk-NNHBAG24.js.map → chunk-MSYJ6PXM.js.map} +0 -0
- /package/dist/{chunk-GZ4HYAEA.js.map → chunk-NQKOEST5.js.map} +0 -0
- /package/dist/{chunk-YG7CNXSA.js.map → chunk-PNUKI2ME.js.map} +0 -0
- /package/dist/{chunk-WBDV5YEW.js.map → chunk-QILEDL6U.js.map} +0 -0
- /package/dist/{chunk-XUVTH4KP.js.map → chunk-SAHC533U.js.map} +0 -0
- /package/dist/{chunk-BNEQG7PP.js.map → chunk-SZZAVOGX.js.map} +0 -0
- /package/dist/{chunk-C3BE2YNZ.js.map → chunk-T22TMAIG.js.map} +0 -0
- /package/dist/{chunk-YIMWO55G.js.map → chunk-TXVM5B3N.js.map} +0 -0
- /package/dist/{chunk-AOWHPHH5.js.map → chunk-UGBTAJIZ.js.map} +0 -0
- /package/dist/{chunk-QYYH6J2J.js.map → chunk-VBR2WGUN.js.map} +0 -0
- /package/dist/{chunk-L5VUMXDA.js.map → chunk-XUQY3DRD.js.map} +0 -0
- /package/dist/{chunk-AHMLCRHA.js.map → chunk-Z2JGBVLF.js.map} +0 -0
- /package/dist/{chunk-2D3BRT4W.js.map → chunk-ZVBGJJHJ.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-4LN2Y7W2.js.map → cli-circuit-breaker-KB4D3ZQJ.js.map} +0 -0
- /package/dist/{composite-router-NUDAZQVG.js.map → composite-router-EHJLO5VJ.js.map} +0 -0
- /package/dist/{consensus-vote-QRF2VFTE.js.map → consensus-vote-TMWNYIHD.js.map} +0 -0
- /package/dist/{context-retriever-3SZVQJ2Y.js.map → context-retriever-6OBOSRB6.js.map} +0 -0
- /package/dist/{doctor-deep-EZRNR7DV.js.map → doctor-deep-LPSVGBF2.js.map} +0 -0
- /package/dist/{doctor-live-Z73GHTJS.js.map → doctor-live-A6OJPJF7.js.map} +0 -0
- /package/dist/{expert-bridge-XOFUAAI7.js.map → expert-bridge-CNT6CMBD.js.map} +0 -0
- /package/dist/{factory-3HFIT5Y6.js.map → factory-I2VVLBIF.js.map} +0 -0
- /package/dist/{factory-QIODQUMI.js.map → factory-JBI4JQBU.js.map} +0 -0
- /package/dist/{improvement-review-7RC42LWW.js.map → improvement-review-SZTIX2IL.js.map} +0 -0
- /package/dist/{init-opencode-O54HSBQY.js.map → init-opencode-3NZVCAQX.js.map} +0 -0
- /package/dist/{issue-triage-AHYTWMTZ.js.map → issue-triage-7P3FSETT.js.map} +0 -0
- /package/dist/{pr-reviewer-helpers-OY6Y6ALX.js.map → pr-reviewer-helpers-OQLT6XRH.js.map} +0 -0
- /package/dist/{registry-command-KNQTC6PH.js.map → registry-command-CYDFEOLI.js.map} +0 -0
- /package/dist/{repo-security-plan-VSEJRFA6.js.map → repo-security-plan-ICJBDJHL.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-2XX7MRD2.js.map → research-helpers-synthesize-RGXQKUDE.js.map} +0 -0
- /package/dist/{routing-memory-NCUTBJWR.js.map → routing-memory-MB4HBNZU.js.map} +0 -0
- /package/dist/{session-memory-E2HZZQVR.js.map → session-memory-P2WTGEFO.js.map} +0 -0
- /package/dist/{setup-config-TZSIS3CV.js.map → setup-config-SE6RBMRL.js.map} +0 -0
- /package/dist/{setup-custom-api-YGDDTJ3R.js.map → setup-custom-api-XWWHUIWI.js.map} +0 -0
- /package/dist/{setup-data-dir-ATYDEUSH.js.map → setup-data-dir-PFCBRVZ5.js.map} +0 -0
- /package/dist/{tool-memory-QHQI2HTQ.js.map → tool-memory-5FSWU4LY.js.map} +0 -0
- /package/dist/{unified-registry-25EVXQKI.js.map → unified-registry-QYKA5N3R.js.map} +0 -0
- /package/dist/{weather-report-UTQ4DSZP.js.map → weather-report-QCAOIHI2.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-BQEHURYG.js";
|
|
13
|
+
import "./chunk-ZCF3WKIB.js";
|
|
14
14
|
import "./chunk-7WJGV5DN.js";
|
|
15
15
|
import "./chunk-J7QCZRVK.js";
|
|
16
16
|
import "./chunk-ZPWHCABL.js";
|
|
@@ -26,4 +26,4 @@ export {
|
|
|
26
26
|
loadRules,
|
|
27
27
|
runAstQaRules
|
|
28
28
|
};
|
|
29
|
-
//# sourceMappingURL=ast-rule-runner-
|
|
29
|
+
//# sourceMappingURL=ast-rule-runner-KUJFW47X.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-DKHBIJO4.js";
|
|
4
4
|
import {
|
|
5
5
|
createLogger
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZCF3WKIB.js";
|
|
7
7
|
import "./chunk-7WJGV5DN.js";
|
|
8
8
|
import "./chunk-J7QCZRVK.js";
|
|
9
9
|
import "./chunk-ZPWHCABL.js";
|
|
@@ -62,4 +62,4 @@ export {
|
|
|
62
62
|
generateMcpConfig,
|
|
63
63
|
getDefaultAllowedTools
|
|
64
64
|
};
|
|
65
|
-
//# sourceMappingURL=child-mcp-config-
|
|
65
|
+
//# sourceMappingURL=child-mcp-config-IYTNL7BL.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
getErrorMessage,
|
|
5
5
|
getTimeProvider,
|
|
6
6
|
ok
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZCF3WKIB.js";
|
|
8
8
|
|
|
9
9
|
// src/context/session-memory.ts
|
|
10
10
|
import * as fs from "node:fs";
|
|
@@ -366,4 +366,4 @@ export {
|
|
|
366
366
|
SessionMemory,
|
|
367
367
|
createSessionMemory
|
|
368
368
|
};
|
|
369
|
-
//# sourceMappingURL=chunk-
|
|
369
|
+
//# sourceMappingURL=chunk-34RAZYMS.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
toolStructuredError,
|
|
8
8
|
toolSuccessStructured,
|
|
9
9
|
wrapToolWithTimeout
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GZTMRQCU.js";
|
|
11
11
|
import {
|
|
12
12
|
JsonlStore,
|
|
13
13
|
SECURITY_KEYWORDS,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
getTimeProvider,
|
|
21
21
|
isDeclaredNeverDeprecate,
|
|
22
22
|
isRegisteredToolName
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-ZCF3WKIB.js";
|
|
24
24
|
import {
|
|
25
25
|
getNexusDataDir,
|
|
26
26
|
nexusDataPath
|
|
@@ -2159,4 +2159,4 @@ export {
|
|
|
2159
2159
|
runImprovementReview,
|
|
2160
2160
|
registerImprovementReviewTool
|
|
2161
2161
|
};
|
|
2162
|
-
//# sourceMappingURL=chunk-
|
|
2162
|
+
//# sourceMappingURL=chunk-357SIWOH.js.map
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
createGetRetryConfig,
|
|
12
12
|
createGetTimeout,
|
|
13
13
|
createGetToolRateLimit
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ZCF3WKIB.js";
|
|
15
15
|
|
|
16
16
|
// src/config/defaults.ts
|
|
17
17
|
var CUSTOM_API_DEFAULT_MODEL = "gpt-5.5";
|
|
@@ -230,4 +230,4 @@ export {
|
|
|
230
230
|
CUSTOM_API_DEFAULT_MODEL,
|
|
231
231
|
DEFAULTS
|
|
232
232
|
};
|
|
233
|
-
//# sourceMappingURL=chunk-
|
|
233
|
+
//# sourceMappingURL=chunk-6KIB5IEZ.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getErrorMessage,
|
|
7
7
|
ok,
|
|
8
8
|
parseBoolEnv
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZCF3WKIB.js";
|
|
10
10
|
import {
|
|
11
11
|
findRepoRoot,
|
|
12
12
|
getActiveWorkspaceRoot,
|
|
@@ -223,4 +223,4 @@ export {
|
|
|
223
223
|
loadPapersRegistry,
|
|
224
224
|
savePapersRegistry
|
|
225
225
|
};
|
|
226
|
-
//# sourceMappingURL=chunk-
|
|
226
|
+
//# sourceMappingURL=chunk-6XQIQFSZ.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAutoAdapter
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-I7CJQVAU.js";
|
|
4
4
|
import {
|
|
5
5
|
getDefaultCliCircuitBreakerRegistry,
|
|
6
6
|
mapModelErrorToCategory
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SAHC533U.js";
|
|
8
8
|
import {
|
|
9
9
|
CLI_NAMES,
|
|
10
10
|
CircularBuffer,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
recordRateLimitEvent,
|
|
25
25
|
resolveModelIdentitySync,
|
|
26
26
|
toRateLimitError
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-ZCF3WKIB.js";
|
|
28
28
|
|
|
29
29
|
// src/config/model-equivalence.ts
|
|
30
30
|
function canonicalModelKey(modelId) {
|
|
@@ -904,4 +904,4 @@ export {
|
|
|
904
904
|
getGlobalRegistry,
|
|
905
905
|
resetGlobalRegistry
|
|
906
906
|
};
|
|
907
|
-
//# sourceMappingURL=chunk-
|
|
907
|
+
//# sourceMappingURL=chunk-AJVKSAL4.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ValidationError,
|
|
4
4
|
createLogger,
|
|
5
5
|
formatZodError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZCF3WKIB.js";
|
|
7
7
|
|
|
8
8
|
// src/security/ast-rule-runner.ts
|
|
9
9
|
import { existsSync } from "node:fs";
|
|
@@ -241,4 +241,4 @@ export {
|
|
|
241
241
|
collectAstQaFindings,
|
|
242
242
|
runAstQaRules
|
|
243
243
|
};
|
|
244
|
-
//# sourceMappingURL=chunk-
|
|
244
|
+
//# sourceMappingURL=chunk-BQEHURYG.js.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readOpenAICompatEnv
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-T22TMAIG.js";
|
|
4
4
|
import {
|
|
5
5
|
allOf
|
|
6
6
|
} from "./chunk-OQB3XC5O.js";
|
|
7
7
|
import {
|
|
8
8
|
VERSION
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-GLIEFVVU.js";
|
|
10
10
|
import {
|
|
11
11
|
capitalize
|
|
12
12
|
} from "./chunk-6T3EPABN.js";
|
|
13
13
|
import {
|
|
14
14
|
createAllAdapters,
|
|
15
15
|
probeCli
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-I7CJQVAU.js";
|
|
17
17
|
import {
|
|
18
18
|
getNexusTmpDir
|
|
19
19
|
} from "./chunk-DKHBIJO4.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
ok,
|
|
29
29
|
symbols,
|
|
30
30
|
writeLine
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-ZCF3WKIB.js";
|
|
32
32
|
import {
|
|
33
33
|
getLearningDir,
|
|
34
34
|
getOutcomesFile,
|
|
@@ -1201,13 +1201,13 @@ async function runDoctorFix(result) {
|
|
|
1201
1201
|
writeLine2("\u2500".repeat(40));
|
|
1202
1202
|
let fixCount = 0;
|
|
1203
1203
|
if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
|
|
1204
|
-
const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-
|
|
1204
|
+
const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-PFCBRVZ5.js");
|
|
1205
1205
|
const outcome = describeDataDirFix2(initDataDirectories2());
|
|
1206
1206
|
writeLine2(outcome.line);
|
|
1207
1207
|
if (outcome.counted) fixCount++;
|
|
1208
1208
|
}
|
|
1209
1209
|
if (!result.configFile.found) {
|
|
1210
|
-
const { runConfigInitSync } = await import("./setup-config-
|
|
1210
|
+
const { runConfigInitSync } = await import("./setup-config-SE6RBMRL.js");
|
|
1211
1211
|
const configResult = runConfigInitSync(process.cwd(), false, false);
|
|
1212
1212
|
if (configResult.success && configResult.created) {
|
|
1213
1213
|
writeLine2(`\u2713 Generated config: ${configResult.path}`);
|
|
@@ -1303,4 +1303,4 @@ export {
|
|
|
1303
1303
|
startStdioServer,
|
|
1304
1304
|
closeServer
|
|
1305
1305
|
};
|
|
1306
|
-
//# sourceMappingURL=chunk-
|
|
1306
|
+
//# sourceMappingURL=chunk-DO63GVEY.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
createLogger,
|
|
4
4
|
getDefaultRegistry,
|
|
5
5
|
roundToMicroUsd
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZCF3WKIB.js";
|
|
7
7
|
import {
|
|
8
8
|
getNexusDataDir
|
|
9
9
|
} from "./chunk-J7QCZRVK.js";
|
|
@@ -42,12 +42,21 @@ function recordUsageEvent(event) {
|
|
|
42
42
|
} catch {
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
+
function describeReadError(error) {
|
|
46
|
+
return error instanceof Error ? error.message : String(error);
|
|
47
|
+
}
|
|
45
48
|
function listUsageFiles(dir) {
|
|
46
|
-
if (!existsSync(dir)) return [];
|
|
49
|
+
if (!existsSync(dir)) return { files: [], readErrors: [] };
|
|
47
50
|
try {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
const files = readdirSync(dir).filter(
|
|
52
|
+
(file) => file.startsWith("usage-") && file.endsWith(".jsonl")
|
|
53
|
+
);
|
|
54
|
+
return { files, readErrors: [] };
|
|
55
|
+
} catch (error) {
|
|
56
|
+
return {
|
|
57
|
+
files: [],
|
|
58
|
+
readErrors: [`usage ledger unreadable: failed to list ${dir}: ${describeReadError(error)}`]
|
|
59
|
+
};
|
|
51
60
|
}
|
|
52
61
|
}
|
|
53
62
|
var logger = createLogger({ component: "usage-log" });
|
|
@@ -92,8 +101,8 @@ function parseFileLines(filePath, filter) {
|
|
|
92
101
|
let content;
|
|
93
102
|
try {
|
|
94
103
|
content = readFileSync(filePath, "utf-8");
|
|
95
|
-
} catch {
|
|
96
|
-
return [];
|
|
104
|
+
} catch (error) {
|
|
105
|
+
return { events: [], readError: `${filePath}: ${describeReadError(error)}` };
|
|
97
106
|
}
|
|
98
107
|
const out = [];
|
|
99
108
|
let rejected = 0;
|
|
@@ -117,12 +126,14 @@ function parseFileLines(filePath, filter) {
|
|
|
117
126
|
if (rejected > 0) {
|
|
118
127
|
logger.warn("Usage ledger lines rejected as unreadable", { filePath, rejected });
|
|
119
128
|
}
|
|
120
|
-
return out;
|
|
129
|
+
return { events: out };
|
|
121
130
|
}
|
|
122
131
|
function loadUsageEvents(opts = {}) {
|
|
123
132
|
const dir = join(getNexusDataDir(), "usage");
|
|
124
|
-
const
|
|
125
|
-
if (files.length === 0)
|
|
133
|
+
const listed = listUsageFiles(dir);
|
|
134
|
+
if (listed.files.length === 0) {
|
|
135
|
+
return { events: [], complete: listed.readErrors.length === 0, readErrors: listed.readErrors };
|
|
136
|
+
}
|
|
126
137
|
const filter = {
|
|
127
138
|
sinceMs: opts.sinceIso !== void 0 ? Date.parse(opts.sinceIso) : Number.NEGATIVE_INFINITY,
|
|
128
139
|
untilMs: opts.untilIso !== void 0 ? Date.parse(opts.untilIso) : Number.POSITIVE_INFINITY,
|
|
@@ -130,12 +141,19 @@ function loadUsageEvents(opts = {}) {
|
|
|
130
141
|
category: opts.category
|
|
131
142
|
};
|
|
132
143
|
const events = [];
|
|
133
|
-
|
|
134
|
-
|
|
144
|
+
const readErrors = [];
|
|
145
|
+
for (const file of listed.files) {
|
|
146
|
+
const parsed = parseFileLines(join(dir, file), filter);
|
|
147
|
+
events.push(...parsed.events);
|
|
148
|
+
if (parsed.readError !== void 0) readErrors.push(parsed.readError);
|
|
149
|
+
}
|
|
150
|
+
if (readErrors.length === listed.files.length) {
|
|
151
|
+
readErrors[0] = `usage ledger unreadable: no files readable; ${readErrors[0] ?? ""}`;
|
|
135
152
|
}
|
|
136
|
-
return events;
|
|
153
|
+
return { events, complete: readErrors.length === 0, readErrors };
|
|
137
154
|
}
|
|
138
155
|
function rollupByModel(events) {
|
|
156
|
+
if (events.length === 0) return [];
|
|
139
157
|
const groups = /* @__PURE__ */ new Map();
|
|
140
158
|
for (const e of events) {
|
|
141
159
|
const arr = groups.get(e.modelId);
|
|
@@ -149,10 +167,11 @@ function rollupByModel(events) {
|
|
|
149
167
|
const totalInputTokens = group.reduce((s, e) => s + e.inputTokens, 0);
|
|
150
168
|
const totalOutputTokens = group.reduce((s, e) => s + e.outputTokens, 0);
|
|
151
169
|
const totalUsdCost = group.reduce((s, e) => s + e.usdCost, 0);
|
|
170
|
+
const unpricedCallCount = group.filter((event) => event.priced === false).length;
|
|
152
171
|
const totalLatency = group.reduce((s, e) => s + e.latencyMs, 0);
|
|
153
172
|
const successRate = callCount === 0 ? 0 : successCount / callCount;
|
|
154
173
|
const avgLatencyMs = callCount === 0 ? 0 : totalLatency / callCount;
|
|
155
|
-
const costPerSuccessUsd = successCount === 0 ?
|
|
174
|
+
const costPerSuccessUsd = successCount === 0 ? null : totalUsdCost / successCount;
|
|
156
175
|
rollups.push({
|
|
157
176
|
modelId,
|
|
158
177
|
providerId: group[0]?.providerId ?? "unknown",
|
|
@@ -162,6 +181,7 @@ function rollupByModel(events) {
|
|
|
162
181
|
totalInputTokens,
|
|
163
182
|
totalOutputTokens,
|
|
164
183
|
totalUsdCost,
|
|
184
|
+
unpricedCallCount,
|
|
165
185
|
avgLatencyMs,
|
|
166
186
|
costPerSuccessUsd
|
|
167
187
|
});
|
|
@@ -176,4 +196,4 @@ export {
|
|
|
176
196
|
loadUsageEvents,
|
|
177
197
|
rollupByModel
|
|
178
198
|
};
|
|
179
|
-
//# sourceMappingURL=chunk-
|
|
199
|
+
//# sourceMappingURL=chunk-DVYY5WN6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/learning/usage-log.ts"],"sourcesContent":["/**\n * usage-log — append-only per-call usage events with cost.\n *\n * Source: Issue #2469 (epic #2467 child).\n *\n * For operators running against metered API gateways, per-call cost +\n * tokens + latency is the data they need to manage spend. This module\n * provides three things:\n *\n * 1. `recordUsageEvent(event)` — append a per-call record to a JSONL\n * log under <NEXUS_DATA_DIR>/usage/usage-YYYY-MM.jsonl.\n * 2. `loadUsageEvents({...})` — read events for a window, filtered\n * by model / category.\n * 3. `computeCostDetail(modelId, inputTokens, outputTokens)` (and its\n * thin wrapper `computeCostUSD`) — compute cost from the FULL model\n * registry pricing chain (manifest > in-tree > models.dev > generated\n * LiteLLM catalog), including the #4164 normalized/identity resolution\n * tier for decorated gateway model ids. A model with no pricing\n * anywhere in the chain is reported as `priced: false` so consumers\n * can treat the missing cost as UNMEASURED (#3855), never a real $0.\n *\n * The `usage` CLI command (cli/usage-command.ts) consumes this for the\n * operator dashboard. Existing OutcomeStore is intentionally untouched\n * — its schema is for routing/learning signals, not billing.\n */\n\nimport { z } from 'zod';\nimport { appendFileSync, existsSync, mkdirSync, readFileSync, readdirSync } from 'node:fs';\nimport { computeTokenCost, roundToMicroUsd } from './token-cost-core.js';\nimport { dirname, join } from 'node:path';\n\nimport { getNexusDataDir } from '../config/nexus-data-dir.js';\nimport { createLogger } from '../core/logger.js';\n// NOTE: only the FUNCTION is imported here — `getDefaultRegistry()` must never\n// be CALLED at module scope (#3185 bootstrap hazard: first construction reads\n// the manifest overlay/snapshot from disk). All calls happen at invocation\n// time inside computeCostDetail.\nimport { getDefaultRegistry, type MatchedVia } from '../config/model-registry.js';\nimport type { PriceBasis } from '../core/price-basis.js';\n\nexport interface UsageEvent {\n /** ISO 8601 timestamp of the call. */\n readonly timestamp: string;\n /** Model identifier (e.g., 'claude-sonnet-4', 'gpt-4o'). */\n readonly modelId: string;\n /** Provider/adapter (e.g., 'anthropic', 'openai', 'openai-compat'). */\n readonly providerId: string;\n /** Token counts. */\n readonly inputTokens: number;\n readonly outputTokens: number;\n /**\n * Cost in USD. Computed at write time from the full model-registry pricing\n * chain (see `computeCostDetail`). 0 with `priced: false` means the model\n * was UNPRICED (cost unknown), not a real $0 — check `priced` before\n * treating this as a measured figure.\n */\n readonly usdCost: number;\n /** Wall-clock latency in milliseconds. */\n readonly latencyMs: number;\n /** Whether the call succeeded. */\n readonly success: boolean;\n /**\n * Optional task category — populated when the call was made on behalf of\n * a routed task (so aggregation can roll up by category).\n */\n readonly category?: string;\n /** Optional failure code when success === false. */\n readonly errorCode?: string;\n /**\n * Whether pricing data existed for the model at write time (#4165), so\n * audit can distinguish a real $0 from an unpriced model. Absent on lines\n * written before this field existed.\n */\n readonly priced?: boolean;\n /**\n * Pricing provenance: the canonical registry id whose pricing was applied\n * (the entry's `resolvedFrom` when the #4164 fuzzy tier matched a decorated\n * id, else the caller's model id). Present only when `priced` is true.\n */\n readonly priceSource?: string;\n}\n\n/** Result of a pricing-aware cost computation (#4165). */\nexport interface CostDetail {\n /** Cost in USD. Always 0 when `priced` is false — an unknown, not a $0. */\n readonly costUsd: number;\n /** Whether the resolved registry entry carried pricing data. */\n readonly priced: boolean;\n /**\n * Canonical id the pricing/metadata came from: the entry's `resolvedFrom`\n * when the #4164 fuzzy tier matched a decorated id, else the caller's id.\n */\n readonly resolvedId: string;\n /** Fuzzy-resolution provenance (#4164), passed through from the entry. */\n readonly matchedVia?: MatchedVia;\n}\n\n/**\n * Compute cost in USD given a model and token counts, with pricing\n * provenance. Reads the FULL registry chain via\n * `getDefaultRegistry().getEntry()` — manifest > in-tree > models.dev >\n * generated LiteLLM catalog, plus the #4164 normalized/identity tier that\n * resolves decorated model names from OpenAI-compatible gateways to their\n * canonical entry's pricing.\n *\n * `priced: false` (with `costUsd: 0`) means NO pricing existed anywhere in\n * the chain — consumers must treat the cost as UNMEASURED (#3855), never a\n * real $0. Operators can add pricing for gateway-only models via the\n * models-manifest overlay.\n */\nexport function computeCostDetail(\n modelId: string,\n inputTokens: number,\n outputTokens: number\n): CostDetail {\n // Registry read happens at INVOCATION time, never module load — first\n // construction touches the filesystem (#3185 bootstrap hazard).\n const entry = getDefaultRegistry().getEntry(modelId);\n const resolvedId = entry.resolvedFrom ?? modelId;\n const provenance = entry.matchedVia !== undefined ? { matchedVia: entry.matchedVia } : {};\n if (entry.pricing === undefined) {\n return { costUsd: 0, priced: false, resolvedId, ...provenance };\n }\n // The arithmetic lives in the shared core (#5122); this function is the\n // REGISTRY-BACKED, LEDGER-ROUNDED wrapper over it. Rounding to micro-USD\n // stays here rather than in the core: it exists so this log's JSONL does not\n // drift into floating-point noise across many small calls, which is a ledger\n // requirement, not a property of cost.\n const { costUsd } = computeTokenCost(\n { input: inputTokens, output: outputTokens },\n { inputPer1M: entry.pricing.inputPer1M, outputPer1M: entry.pricing.outputPer1M }\n );\n return { costUsd: roundToMicroUsd(costUsd), priced: true, resolvedId, ...provenance };\n}\n\n/**\n * The {@link PriceBasis} the cost in a {@link CostDetail} rests on (#4406).\n *\n * DELIBERATELY derived rather than stored, because `CostDetail.priced` already\n * carries the only distinction the current two-member union can express: the\n * chain resolved a rate, or it did not. A `priceBasis` property beside `priced`\n * would be a second spelling of the same boolean.\n *\n * WHAT THE `'list'` VALUE ASSERTS. Only that a rate was resolved, and that it\n * should be read as an assumed published rate. It is NOT a guarantee that the\n * number is a vendor's advertised public rate — at least two paths put\n * something else behind the label, and one puts a real published rate behind\n * `'unknown'`:\n *\n * - The operator manifest overlay is the highest-precedence tier and passes\n * `pricing` through; overriding pricing is its purpose. A negotiated rate\n * entered there reports `'list'`, and the caveat then warns the reader their\n * contract may differ over the contract rate.\n * - The normalized/fuzzy identity tier lets a decorated gateway id inherit a\n * DIFFERENT canonical entry's rate.\n * - `config/models-generated-loader.ts` discards a published $0/$0 rate unless\n * the id ends `:free`, so `'unknown'` does not mean no price exists.\n *\n * The derivation is therefore an assumption about the chain, not a fact about\n * it — conservative in the right direction (it invites a caveat rather than\n * suppressing one), and honest only if described this way. Narrowing it needs a\n * per-entry label the registry does not carry today; see {@link PriceBasis}.\n *\n * `priceSource`, the other provenance field, answers a different question: WHICH\n * registry entry supplied the number, not what KIND of rate it is. It does not\n * encode the basis, which is why the basis has to travel separately into records\n * (the decision-cost store) that persist neither field.\n */\nexport function priceBasisOf(detail: CostDetail): PriceBasis {\n return detail.priced ? 'list' : 'unknown';\n}\n\n/**\n * Thin wrapper over {@link computeCostDetail} returning only the USD figure.\n * Returns 0 both for a genuinely free model and for a model with no pricing\n * data — callers that must tell those apart (unpriced ⇒ UNMEASURED, #3855)\n * should use `computeCostDetail` and check `priced`.\n */\nexport function computeCostUSD(modelId: string, inputTokens: number, outputTokens: number): number {\n return computeCostDetail(modelId, inputTokens, outputTokens).costUsd;\n}\n\n/** Resolve the active usage log path for the current month. */\nexport function getUsageLogPath(date: Date = new Date()): string {\n const year = date.getUTCFullYear();\n const month = String(date.getUTCMonth() + 1).padStart(2, '0');\n return join(getNexusDataDir(), 'usage', `usage-${String(year)}-${month}.jsonl`);\n}\n\n/**\n * Append a usage event to the current month's log. Best-effort — failures\n * are silent (we don't want to fail a successful model call because we\n * couldn't write a log line).\n */\nexport function recordUsageEvent(event: UsageEvent): void {\n try {\n const path = getUsageLogPath(new Date(event.timestamp));\n mkdirSync(dirname(path), { recursive: true });\n appendFileSync(path, `${JSON.stringify(event)}\\n`, 'utf-8');\n } catch {\n // Intentionally silent — telemetry must not break user calls.\n }\n}\n\nexport interface LoadUsageOptions {\n /** Restrict to events at or after this ISO timestamp. */\n readonly sinceIso?: string;\n /** Restrict to events before this ISO timestamp. */\n readonly untilIso?: string;\n /** Only events for this model. */\n readonly modelId?: string;\n /** Only events for this category. */\n readonly category?: string;\n}\n\ninterface UsageFileList {\n readonly files: readonly string[];\n readonly readErrors: readonly string[];\n}\n\nfunction describeReadError(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nfunction listUsageFiles(dir: string): UsageFileList {\n if (!existsSync(dir)) return { files: [], readErrors: [] };\n try {\n const files = readdirSync(dir).filter(\n (file) => file.startsWith('usage-') && file.endsWith('.jsonl')\n );\n return { files, readErrors: [] };\n } catch (error) {\n return {\n files: [],\n readErrors: [`usage ledger unreadable: failed to list ${dir}: ${describeReadError(error)}`],\n };\n }\n}\n\ninterface LoadFilter {\n readonly sinceMs: number;\n readonly untilMs: number;\n readonly modelId: string | undefined;\n readonly category: string | undefined;\n}\n\nconst logger = createLogger({ component: 'usage-log' });\n\n/**\n * Validate a ledger line before it is trusted (#5328).\n *\n * The read path did `JSON.parse(line) as UsageEvent` — a cast. `eventMatches`\n * only inspects `timestamp` / `modelId` / `category`, so a corrupt `usdCost`\n * reached `rollupByModel`'s `reduce((s, e) => s + e.usdCost, 0)`: a string\n * concatenates, a missing value yields `NaN`, and neither throws. Every sibling\n * JSONL reader here validates; this one did not, and it is the cost ledger.\n *\n * Optional fields stay optional ON PURPOSE. `category`, `errorCode`, `priced`\n * and `priceSource` all postdate the original format — `priced` is documented\n * as \"Absent on lines written before this field existed\" — so requiring them\n * would silently discard real spend history, which is worse than the corruption\n * being fixed.\n *\n * Not `.strict()`, for the same forward-compatibility reason: a line carrying a\n * field a newer version writes must still load in an older one.\n *\n * `z.number()` already rejects `NaN` and infinities in zod v4, which is the\n * property that matters here: a cost that is not a real number cannot be summed,\n * and JSON renders `NaN` as `null`, which this also rejects.\n */\nconst UsageEventSchema = z.object({\n timestamp: z.string(),\n modelId: z.string(),\n providerId: z.string(),\n inputTokens: z.number(),\n outputTokens: z.number(),\n usdCost: z.number(),\n latencyMs: z.number(),\n success: z.boolean(),\n category: z.string().optional(),\n errorCode: z.string().optional(),\n priced: z.boolean().optional(),\n priceSource: z.string().optional(),\n});\n\n/**\n * Narrow a validated line to {@link UsageEvent}.\n *\n * Zod's `.optional()` yields `T | undefined`, which `exactOptionalPropertyTypes`\n * will not assign to a `?: T` property — an absent key and a present-but-\n * undefined key are different things under that flag, and the distinction is\n * the right one for a ledger: a line that omits `priced` is legacy, whereas one\n * that sets it to `undefined` is malformed.\n */\nfunction toUsageEvent(v: z.infer<typeof UsageEventSchema>): UsageEvent {\n return {\n timestamp: v.timestamp,\n modelId: v.modelId,\n providerId: v.providerId,\n inputTokens: v.inputTokens,\n outputTokens: v.outputTokens,\n usdCost: v.usdCost,\n latencyMs: v.latencyMs,\n success: v.success,\n ...(v.category !== undefined && { category: v.category }),\n ...(v.errorCode !== undefined && { errorCode: v.errorCode }),\n ...(v.priced !== undefined && { priced: v.priced }),\n ...(v.priceSource !== undefined && { priceSource: v.priceSource }),\n };\n}\n\nfunction eventMatches(parsed: UsageEvent, f: LoadFilter): boolean {\n const ts = Date.parse(parsed.timestamp);\n if (ts < f.sinceMs || ts >= f.untilMs) return false;\n if (f.modelId !== undefined && parsed.modelId !== f.modelId) return false;\n if (f.category !== undefined && parsed.category !== f.category) return false;\n return true;\n}\n\ninterface ParsedUsageFile {\n readonly events: readonly UsageEvent[];\n readonly readError?: string;\n}\n\nfunction parseFileLines(filePath: string, filter: LoadFilter): ParsedUsageFile {\n let content: string;\n try {\n content = readFileSync(filePath, 'utf-8');\n } catch (error) {\n return { events: [], readError: `${filePath}: ${describeReadError(error)}` };\n }\n const out: UsageEvent[] = [];\n let rejected = 0;\n for (const line of content.split('\\n')) {\n if (line.trim() === '') continue;\n let raw: unknown;\n try {\n raw = JSON.parse(line);\n } catch {\n // Skip malformed line; keep reading.\n rejected++;\n continue;\n }\n const parsed = UsageEventSchema.safeParse(raw);\n if (!parsed.success) {\n rejected++;\n continue;\n }\n const event = toUsageEvent(parsed.data);\n if (eventMatches(event, filter)) out.push(event);\n }\n // Say so rather than quietly returning a shorter list: a ledger that drops\n // lines silently under-reports spend, and the operator has no way to tell.\n if (rejected > 0) {\n logger.warn('Usage ledger lines rejected as unreadable', { filePath, rejected });\n }\n return { events: out };\n}\n\ninterface UsageLedgerLoadResult {\n /** Valid events recovered from every readable ledger file. */\n readonly events: readonly UsageEvent[];\n /** True only when the ledger directory and every discovered file were readable. */\n readonly complete: boolean;\n /** Human-readable directory/file failures that made the result incomplete. */\n readonly readErrors: readonly string[];\n}\n\n/**\n * Load all usage events from disk that match the filter, preserving whether\n * every ledger file was readable. A missing usage directory is a complete,\n * empty ledger. For sub-second filtering at scale a future PR can index by\n * month, but linear scan is fine at the \"operator dashboard\" scale.\n */\nexport function loadUsageEvents(opts: LoadUsageOptions = {}): UsageLedgerLoadResult {\n const dir = join(getNexusDataDir(), 'usage');\n const listed = listUsageFiles(dir);\n if (listed.files.length === 0) {\n return { events: [], complete: listed.readErrors.length === 0, readErrors: listed.readErrors };\n }\n const filter: LoadFilter = {\n sinceMs: opts.sinceIso !== undefined ? Date.parse(opts.sinceIso) : Number.NEGATIVE_INFINITY,\n untilMs: opts.untilIso !== undefined ? Date.parse(opts.untilIso) : Number.POSITIVE_INFINITY,\n modelId: opts.modelId,\n category: opts.category,\n };\n const events: UsageEvent[] = [];\n const readErrors: string[] = [];\n for (const file of listed.files) {\n const parsed = parseFileLines(join(dir, file), filter);\n events.push(...parsed.events);\n if (parsed.readError !== undefined) readErrors.push(parsed.readError);\n }\n if (readErrors.length === listed.files.length) {\n readErrors[0] = `usage ledger unreadable: no files readable; ${readErrors[0] ?? ''}`;\n }\n return { events, complete: readErrors.length === 0, readErrors };\n}\n\nexport interface ModelRollup {\n readonly modelId: string;\n readonly providerId: string;\n readonly callCount: number;\n readonly successCount: number;\n readonly successRate: number;\n readonly totalInputTokens: number;\n readonly totalOutputTokens: number;\n readonly totalUsdCost: number;\n /** Calls whose cost is unknown; legacy events without `priced` do not count. */\n readonly unpricedCallCount: number;\n readonly avgLatencyMs: number;\n /** Null when there were no successful calls. */\n readonly costPerSuccessUsd: number | null;\n}\n\n/**\n * Aggregate events into per-model rollups. Sorted by total cost descending\n * — the model burning the most money at top. Useful for \"where is my spend\n * going?\" investigations.\n */\nexport function rollupByModel(events: readonly UsageEvent[]): readonly ModelRollup[] {\n if (events.length === 0) return [];\n const groups = new Map<string, UsageEvent[]>();\n for (const e of events) {\n const arr = groups.get(e.modelId);\n if (arr === undefined) groups.set(e.modelId, [e]);\n else arr.push(e);\n }\n const rollups: ModelRollup[] = [];\n for (const [modelId, group] of groups) {\n const callCount = group.length;\n const successCount = group.filter((e) => e.success).length;\n const totalInputTokens = group.reduce((s, e) => s + e.inputTokens, 0);\n const totalOutputTokens = group.reduce((s, e) => s + e.outputTokens, 0);\n const totalUsdCost = group.reduce((s, e) => s + e.usdCost, 0);\n // Legacy ledger lines predate `priced`; only an explicit false is unpriced.\n const unpricedCallCount = group.filter((event) => event.priced === false).length;\n const totalLatency = group.reduce((s, e) => s + e.latencyMs, 0);\n const successRate = callCount === 0 ? 0 : successCount / callCount;\n const avgLatencyMs = callCount === 0 ? 0 : totalLatency / callCount;\n const costPerSuccessUsd = successCount === 0 ? null : totalUsdCost / successCount;\n rollups.push({\n modelId,\n providerId: group[0]?.providerId ?? 'unknown',\n callCount,\n successCount,\n successRate,\n totalInputTokens,\n totalOutputTokens,\n totalUsdCost,\n unpricedCallCount,\n avgLatencyMs,\n costPerSuccessUsd,\n });\n }\n return rollups.sort((a, b) => b.totalUsdCost - a.totalUsdCost);\n}\n"],"mappings":";;;;;;;;;;;AA0BA,SAAS,SAAS;AAClB,SAAS,gBAAgB,YAAY,WAAW,cAAc,mBAAmB;AAEjF,SAAS,SAAS,YAAY;AAiFvB,SAAS,kBACd,SACA,aACA,cACY;AAGZ,QAAM,QAAQ,mBAAmB,EAAE,SAAS,OAAO;AACnD,QAAM,aAAa,MAAM,gBAAgB;AACzC,QAAM,aAAa,MAAM,eAAe,SAAY,EAAE,YAAY,MAAM,WAAW,IAAI,CAAC;AACxF,MAAI,MAAM,YAAY,QAAW;AAC/B,WAAO,EAAE,SAAS,GAAG,QAAQ,OAAO,YAAY,GAAG,WAAW;AAAA,EAChE;AAMA,QAAM,EAAE,QAAQ,IAAI;AAAA,IAClB,EAAE,OAAO,aAAa,QAAQ,aAAa;AAAA,IAC3C,EAAE,YAA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AM,cAAc,cAAc,IAAI,IAAI,eAAe;AACzD,UAAM,eAAe,cAAc,IAAI,IAAI,eAAe;AAC1D,UAAM,oBAAoB,iBAAiB,IAAI,OAAO,eAAe;AACrE,YAAQ,KAAK;AAAA,MACX;AAAA,MACA,YAAY,MAAM,CAAC,GAAG,cAAc;AAAA,MACpC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AACA,SAAO,QAAQ,KAAK,CAAC,GAAG,MAAM,EAAE,eAAe,EAAE,YAAY;AAC/D;","names":[]}
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
CACHE_TIMEOUTS,
|
|
3
3
|
createLogger,
|
|
4
4
|
getTimeProvider
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZCF3WKIB.js";
|
|
6
6
|
|
|
7
7
|
// src/security/trust-types.ts
|
|
8
8
|
import { z } from "zod";
|
|
@@ -580,4 +580,4 @@ export {
|
|
|
580
580
|
resolveReputationGatingMode,
|
|
581
581
|
gateWithReputation
|
|
582
582
|
};
|
|
583
|
-
//# sourceMappingURL=chunk-
|
|
583
|
+
//# sourceMappingURL=chunk-EIEC22PA.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
createLogger,
|
|
6
6
|
getTimeProvider
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZCF3WKIB.js";
|
|
8
8
|
|
|
9
9
|
// src/mcp/tools/scanner-registry-fetcher.ts
|
|
10
10
|
import { z } from "zod";
|
|
@@ -721,4 +721,4 @@ export {
|
|
|
721
721
|
generateSecurityPlan,
|
|
722
722
|
buildPlanFromAnalysis
|
|
723
723
|
};
|
|
724
|
-
//# sourceMappingURL=chunk-
|
|
724
|
+
//# sourceMappingURL=chunk-FGEGUND2.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GLIEFVVU.js";
|
|
4
4
|
import {
|
|
5
5
|
emitClawGuardViolation
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KHJACO7N.js";
|
|
7
7
|
import {
|
|
8
8
|
CACHE_TIMEOUTS,
|
|
9
9
|
MCP_TIMEOUTS,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
getTimeProvider,
|
|
20
20
|
ok,
|
|
21
21
|
resolveToolClassGuardMs
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-ZCF3WKIB.js";
|
|
23
23
|
import {
|
|
24
24
|
getNexusDataDir
|
|
25
25
|
} from "./chunk-J7QCZRVK.js";
|
|
@@ -2246,4 +2246,4 @@ export {
|
|
|
2246
2246
|
VOTING_THRESHOLDS,
|
|
2247
2247
|
ConsensusMetricsSchema
|
|
2248
2248
|
};
|
|
2249
|
-
//# sourceMappingURL=chunk-
|
|
2249
|
+
//# sourceMappingURL=chunk-GZTMRQCU.js.map
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
lookupInTreeCapability,
|
|
14
14
|
ok,
|
|
15
15
|
resolveRetryAfterMs
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ZCF3WKIB.js";
|
|
17
17
|
|
|
18
18
|
// src/config/model-parameter-support.ts
|
|
19
19
|
function parseClaudeMajorMinor(bareId) {
|
|
@@ -834,4 +834,4 @@ export {
|
|
|
834
834
|
DEFAULT_COLLECT_STREAM_MAX_CHUNKS,
|
|
835
835
|
collectStream
|
|
836
836
|
};
|
|
837
|
-
//# sourceMappingURL=chunk-
|
|
837
|
+
//# sourceMappingURL=chunk-HJQK55Y3.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getErrorMessage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZCF3WKIB.js";
|
|
4
4
|
|
|
5
5
|
// src/cli/setup-config.ts
|
|
6
6
|
import { copyFileSync, existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
@@ -77,4 +77,4 @@ function ensureBackup(outputPath) {
|
|
|
77
77
|
export {
|
|
78
78
|
runConfigInitSync
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-HMMDFXWP.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-6T3EPABN.js";
|
|
6
6
|
import {
|
|
7
7
|
SessionMemory
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-34RAZYMS.js";
|
|
9
9
|
import {
|
|
10
10
|
StatsOnlyAdapter,
|
|
11
11
|
ensureSharedMemoryRegistry
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./chunk-YYJFZ7TO.js";
|
|
16
16
|
import {
|
|
17
17
|
generateId
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-MSYJ6PXM.js";
|
|
19
19
|
import {
|
|
20
20
|
ErrorCode,
|
|
21
21
|
NexusError,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
ok,
|
|
30
30
|
openSqliteDatabase,
|
|
31
31
|
setSharedMobiMemDbPathResolver
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-ZCF3WKIB.js";
|
|
33
33
|
import {
|
|
34
34
|
nexusDataPath
|
|
35
35
|
} from "./chunk-J7QCZRVK.js";
|
|
@@ -5660,4 +5660,4 @@ export {
|
|
|
5660
5660
|
reinitializeMemoryBackends,
|
|
5661
5661
|
ToolMemoryManager
|
|
5662
5662
|
};
|
|
5663
|
-
//# sourceMappingURL=chunk-
|
|
5663
|
+
//# sourceMappingURL=chunk-HVNAQEXZ.js.map
|
|
@@ -5,34 +5,34 @@ import {
|
|
|
5
5
|
planOptionalParams,
|
|
6
6
|
requireApiKey,
|
|
7
7
|
validateApiKeyPresence
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-HJQK55Y3.js";
|
|
9
9
|
import {
|
|
10
10
|
CUSTOM_API_DEFAULT_MODEL
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6KIB5IEZ.js";
|
|
12
12
|
import {
|
|
13
13
|
CUSTOM_API_BASE_URL_ENV,
|
|
14
14
|
PROVIDER_ENV_KEYS,
|
|
15
15
|
assertCustomApiHostResolvesPublic,
|
|
16
16
|
validateCustomApiBaseUrl
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-NQKOEST5.js";
|
|
18
18
|
import {
|
|
19
19
|
nexusMkdtempSync
|
|
20
20
|
} from "./chunk-DKHBIJO4.js";
|
|
21
21
|
import {
|
|
22
22
|
getAvailabilityCache
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-VBR2WGUN.js";
|
|
24
24
|
import {
|
|
25
25
|
extractSystemPrompt
|
|
26
26
|
} from "./chunk-QZUG667L.js";
|
|
27
27
|
import {
|
|
28
28
|
generateHyphenId
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-MSYJ6PXM.js";
|
|
30
30
|
import {
|
|
31
31
|
CliCircuitBreaker,
|
|
32
32
|
DEFAULT_CIRCUIT_BREAKER_CONFIG,
|
|
33
33
|
getCliCircuitBreakerSnapshot,
|
|
34
34
|
getDefaultCliCircuitBreakerRegistry
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-SAHC533U.js";
|
|
36
36
|
import {
|
|
37
37
|
CLI_SUBPROCESS_TIMEOUTS,
|
|
38
38
|
CLI_TIMEOUTS,
|
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
resolveCliAlias,
|
|
73
73
|
resolveRetryAfterMs,
|
|
74
74
|
retryAfterMsFromContext
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-ZCF3WKIB.js";
|
|
76
76
|
|
|
77
77
|
// src/cli-adapters/cli-to-model-adapter.ts
|
|
78
78
|
var CliToModelAdapter = class {
|
|
@@ -4946,4 +4946,4 @@ export {
|
|
|
4946
4946
|
SdkAdapter,
|
|
4947
4947
|
createAutoAdapter
|
|
4948
4948
|
};
|
|
4949
|
-
//# sourceMappingURL=chunk-
|
|
4949
|
+
//# sourceMappingURL=chunk-I7CJQVAU.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getTimeProvider
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZCF3WKIB.js";
|
|
4
4
|
|
|
5
5
|
// src/security/audit-trail.ts
|
|
6
6
|
var MAX_EVENTS = 1e4;
|
|
@@ -205,4 +205,4 @@ export {
|
|
|
205
205
|
createGraphAuditBridge,
|
|
206
206
|
createAuditTrail
|
|
207
207
|
};
|
|
208
|
-
//# sourceMappingURL=chunk-
|
|
208
|
+
//# sourceMappingURL=chunk-KHJACO7N.js.map
|