nexus-agents 2.157.1 → 2.158.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/{child-mcp-config-3YUKLM5F.js → child-mcp-config-ODAUXUWE.js} +2 -2
- package/dist/{chunk-PZDDA6IW.js → chunk-2O63LDYB.js} +3 -3
- package/dist/{chunk-BM26VPV5.js → chunk-42ZSRIEX.js} +2 -2
- package/dist/{chunk-5ULXLPVP.js → chunk-4IXC6V6O.js} +2 -2
- package/dist/{chunk-JZ4PCEEN.js → chunk-55ZDYUBT.js} +2 -2
- package/dist/{chunk-YZQXCCEA.js → chunk-6B5VQ2SY.js} +5 -5
- package/dist/{chunk-5FH7QZIT.js → chunk-6MCSD37T.js} +2 -2
- package/dist/{chunk-NELFMLLR.js → chunk-7J3AAPH5.js} +2 -2
- package/dist/{chunk-EJ3MAR5M.js → chunk-CSHFTQA7.js} +3 -3
- package/dist/{chunk-6ZKQRTTQ.js → chunk-CTL5HUZZ.js} +10 -7
- package/dist/chunk-CTL5HUZZ.js.map +1 -0
- package/dist/{chunk-IILTUCFB.js → chunk-DSUFV2ZN.js} +2 -2
- package/dist/{chunk-SCJ2EB6Z.js → chunk-FWW5GCEH.js} +2 -2
- package/dist/{chunk-7YOJXOFN.js → chunk-GG7MGRQ6.js} +4 -4
- package/dist/{chunk-TNRTP5FW.js → chunk-I32MYAT5.js} +2 -2
- package/dist/{chunk-ENPYELJM.js → chunk-IQVHJD4O.js} +5 -5
- package/dist/{chunk-47WFM6QH.js → chunk-J2JP35S3.js} +4 -4
- package/dist/{chunk-RHUKGSH7.js → chunk-J6OUXCR3.js} +7 -7
- package/dist/{chunk-LZ2LHYDO.js → chunk-K6HJLOPA.js} +3 -3
- package/dist/{chunk-HUN7CEAU.js → chunk-KS622JST.js} +3 -3
- package/dist/{chunk-BGAK4N74.js → chunk-LSWGHIJK.js} +7 -7
- package/dist/{chunk-XGUZ2OQK.js → chunk-OOGGQ2NA.js} +3 -3
- package/dist/{chunk-RCSDD2QY.js → chunk-Q4JNYY2Y.js} +4 -4
- package/dist/{chunk-RCSDD2QY.js.map → chunk-Q4JNYY2Y.js.map} +1 -1
- package/dist/{chunk-JWCD3JCB.js → chunk-Q7TALELN.js} +11 -10
- package/dist/{chunk-JWCD3JCB.js.map → chunk-Q7TALELN.js.map} +1 -1
- package/dist/{chunk-O7VPOR5A.js → chunk-R76LLKT2.js} +5 -5
- package/dist/{chunk-YGYJUPVX.js → chunk-RI3BFANI.js} +2 -2
- package/dist/{chunk-UAGYCCHY.js → chunk-S3H4VWN5.js} +2 -2
- package/dist/{chunk-M532SJS6.js → chunk-S7PFS6PX.js} +7 -7
- package/dist/{chunk-VEINXCXS.js → chunk-SPOES3DZ.js} +34 -34
- package/dist/{chunk-MYSS22Q2.js → chunk-U5KSLUZ6.js} +2 -2
- package/dist/{chunk-3NT6NAXD.js → chunk-UQOJ2KGW.js} +13 -12
- package/dist/chunk-UQOJ2KGW.js.map +1 -0
- package/dist/{chunk-TKCXD36G.js → chunk-VKVJSPHJ.js} +4 -4
- package/dist/{chunk-3S2OPUGU.js → chunk-XLJCXM7L.js} +2 -2
- package/dist/{chunk-HWG437YQ.js → chunk-YH5U3XCP.js} +2 -2
- package/dist/{chunk-AEPCCXMK.js → chunk-YMMX6ELC.js} +3 -3
- package/dist/{chunk-GYWYCCJC.js → chunk-YQRP5NST.js} +2 -2
- package/dist/{cli-circuit-breaker-Q43YSBCB.js → cli-circuit-breaker-MLVJXLK6.js} +4 -4
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +41 -41
- package/dist/{composite-router-5UHJFOB3.js → composite-router-FTECAR4U.js} +2 -2
- package/dist/{consensus-vote-ZYZMDGT5.js → consensus-vote-MMZTCPL7.js} +15 -15
- package/dist/{consensus-vote-types-BNBMB415.d.ts → consensus-vote-types-DB3SmULO.d.ts} +16 -10
- package/dist/{context-retriever-33SGXV33.js → context-retriever-MPZ7T4VA.js} +8 -8
- package/dist/{doctor-deep-RAN4HGOH.js → doctor-deep-KUB4HPCS.js} +3 -3
- package/dist/{expert-bridge-RJP57L75.js → expert-bridge-EK362QGQ.js} +4 -4
- package/dist/{factory-C5PY7R6O.js → factory-GOO7MH5G.js} +8 -8
- package/dist/{factory-YOUM5MCV.js → factory-XBUQP3UB.js} +5 -5
- package/dist/{improvement-review-H5BQ2JXK.js → improvement-review-XXRDVOJT.js} +5 -5
- package/dist/index.d.ts +2 -2
- package/dist/index.js +30 -30
- package/dist/{init-opencode-KHODCXA6.js → init-opencode-RNSCHZIW.js} +6 -6
- package/dist/{issue-triage-OP3FDRKY.js → issue-triage-7TWTN6LI.js} +6 -6
- package/dist/{pr-reviewer-helpers-UF42XZB6.js → pr-reviewer-helpers-VT4DR5BC.js} +4 -4
- package/dist/{registry-command-EZ7735GC.js → registry-command-QVBYBBWR.js} +2 -2
- package/dist/{repo-security-plan-D62HB5PK.js → repo-security-plan-VSQWMONM.js} +3 -3
- package/dist/{research-helpers-synthesize-KUA53BAD.js → research-helpers-synthesize-VCUOMHPD.js} +4 -4
- package/dist/{routing-memory-FE4EQUXO.js → routing-memory-PP4UJVH4.js} +2 -2
- package/dist/{session-memory-RA7KE6CX.js → session-memory-TVV2IOGB.js} +3 -3
- package/dist/{setup-command-AX3B46CE.js → setup-command-4GOUS52A.js} +11 -11
- package/dist/{setup-config-SHG2DMZJ.js → setup-config-HZHL4QMD.js} +3 -3
- package/dist/{setup-custom-api-NVS4EPBG.js → setup-custom-api-H6FJ5VWL.js} +3 -3
- package/dist/{tool-memory-UQH2FTAS.js → tool-memory-YLCJZVMV.js} +5 -5
- package/dist/{unified-registry-MMQXU622.js → unified-registry-ZUPTC7OR.js} +9 -9
- package/dist/{weather-report-HRQCJEU5.js → weather-report-XPDW6LGI.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-3NT6NAXD.js.map +0 -1
- package/dist/chunk-6ZKQRTTQ.js.map +0 -1
- /package/dist/{child-mcp-config-3YUKLM5F.js.map → child-mcp-config-ODAUXUWE.js.map} +0 -0
- /package/dist/{chunk-PZDDA6IW.js.map → chunk-2O63LDYB.js.map} +0 -0
- /package/dist/{chunk-BM26VPV5.js.map → chunk-42ZSRIEX.js.map} +0 -0
- /package/dist/{chunk-5ULXLPVP.js.map → chunk-4IXC6V6O.js.map} +0 -0
- /package/dist/{chunk-JZ4PCEEN.js.map → chunk-55ZDYUBT.js.map} +0 -0
- /package/dist/{chunk-YZQXCCEA.js.map → chunk-6B5VQ2SY.js.map} +0 -0
- /package/dist/{chunk-5FH7QZIT.js.map → chunk-6MCSD37T.js.map} +0 -0
- /package/dist/{chunk-NELFMLLR.js.map → chunk-7J3AAPH5.js.map} +0 -0
- /package/dist/{chunk-EJ3MAR5M.js.map → chunk-CSHFTQA7.js.map} +0 -0
- /package/dist/{chunk-IILTUCFB.js.map → chunk-DSUFV2ZN.js.map} +0 -0
- /package/dist/{chunk-SCJ2EB6Z.js.map → chunk-FWW5GCEH.js.map} +0 -0
- /package/dist/{chunk-7YOJXOFN.js.map → chunk-GG7MGRQ6.js.map} +0 -0
- /package/dist/{chunk-TNRTP5FW.js.map → chunk-I32MYAT5.js.map} +0 -0
- /package/dist/{chunk-ENPYELJM.js.map → chunk-IQVHJD4O.js.map} +0 -0
- /package/dist/{chunk-47WFM6QH.js.map → chunk-J2JP35S3.js.map} +0 -0
- /package/dist/{chunk-RHUKGSH7.js.map → chunk-J6OUXCR3.js.map} +0 -0
- /package/dist/{chunk-LZ2LHYDO.js.map → chunk-K6HJLOPA.js.map} +0 -0
- /package/dist/{chunk-HUN7CEAU.js.map → chunk-KS622JST.js.map} +0 -0
- /package/dist/{chunk-BGAK4N74.js.map → chunk-LSWGHIJK.js.map} +0 -0
- /package/dist/{chunk-XGUZ2OQK.js.map → chunk-OOGGQ2NA.js.map} +0 -0
- /package/dist/{chunk-O7VPOR5A.js.map → chunk-R76LLKT2.js.map} +0 -0
- /package/dist/{chunk-YGYJUPVX.js.map → chunk-RI3BFANI.js.map} +0 -0
- /package/dist/{chunk-UAGYCCHY.js.map → chunk-S3H4VWN5.js.map} +0 -0
- /package/dist/{chunk-M532SJS6.js.map → chunk-S7PFS6PX.js.map} +0 -0
- /package/dist/{chunk-VEINXCXS.js.map → chunk-SPOES3DZ.js.map} +0 -0
- /package/dist/{chunk-MYSS22Q2.js.map → chunk-U5KSLUZ6.js.map} +0 -0
- /package/dist/{chunk-TKCXD36G.js.map → chunk-VKVJSPHJ.js.map} +0 -0
- /package/dist/{chunk-3S2OPUGU.js.map → chunk-XLJCXM7L.js.map} +0 -0
- /package/dist/{chunk-HWG437YQ.js.map → chunk-YH5U3XCP.js.map} +0 -0
- /package/dist/{chunk-AEPCCXMK.js.map → chunk-YMMX6ELC.js.map} +0 -0
- /package/dist/{chunk-GYWYCCJC.js.map → chunk-YQRP5NST.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-Q43YSBCB.js.map → cli-circuit-breaker-MLVJXLK6.js.map} +0 -0
- /package/dist/{composite-router-5UHJFOB3.js.map → composite-router-FTECAR4U.js.map} +0 -0
- /package/dist/{consensus-vote-ZYZMDGT5.js.map → consensus-vote-MMZTCPL7.js.map} +0 -0
- /package/dist/{context-retriever-33SGXV33.js.map → context-retriever-MPZ7T4VA.js.map} +0 -0
- /package/dist/{doctor-deep-RAN4HGOH.js.map → doctor-deep-KUB4HPCS.js.map} +0 -0
- /package/dist/{expert-bridge-RJP57L75.js.map → expert-bridge-EK362QGQ.js.map} +0 -0
- /package/dist/{factory-C5PY7R6O.js.map → factory-GOO7MH5G.js.map} +0 -0
- /package/dist/{factory-YOUM5MCV.js.map → factory-XBUQP3UB.js.map} +0 -0
- /package/dist/{improvement-review-H5BQ2JXK.js.map → improvement-review-XXRDVOJT.js.map} +0 -0
- /package/dist/{init-opencode-KHODCXA6.js.map → init-opencode-RNSCHZIW.js.map} +0 -0
- /package/dist/{issue-triage-OP3FDRKY.js.map → issue-triage-7TWTN6LI.js.map} +0 -0
- /package/dist/{pr-reviewer-helpers-UF42XZB6.js.map → pr-reviewer-helpers-VT4DR5BC.js.map} +0 -0
- /package/dist/{registry-command-EZ7735GC.js.map → registry-command-QVBYBBWR.js.map} +0 -0
- /package/dist/{repo-security-plan-D62HB5PK.js.map → repo-security-plan-VSQWMONM.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-KUA53BAD.js.map → research-helpers-synthesize-VCUOMHPD.js.map} +0 -0
- /package/dist/{routing-memory-FE4EQUXO.js.map → routing-memory-PP4UJVH4.js.map} +0 -0
- /package/dist/{session-memory-RA7KE6CX.js.map → session-memory-TVV2IOGB.js.map} +0 -0
- /package/dist/{setup-command-AX3B46CE.js.map → setup-command-4GOUS52A.js.map} +0 -0
- /package/dist/{setup-config-SHG2DMZJ.js.map → setup-config-HZHL4QMD.js.map} +0 -0
- /package/dist/{setup-custom-api-NVS4EPBG.js.map → setup-custom-api-H6FJ5VWL.js.map} +0 -0
- /package/dist/{tool-memory-UQH2FTAS.js.map → tool-memory-YLCJZVMV.js.map} +0 -0
- /package/dist/{unified-registry-MMQXU622.js.map → unified-registry-ZUPTC7OR.js.map} +0 -0
- /package/dist/{weather-report-HRQCJEU5.js.map → weather-report-XPDW6LGI.js.map} +0 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveToken
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XLJCXM7L.js";
|
|
4
4
|
import {
|
|
5
5
|
REGISTRY_PATH,
|
|
6
6
|
getProjectRoot,
|
|
7
7
|
loadPapersRegistry,
|
|
8
8
|
loadTechniquesRegistry,
|
|
9
9
|
savePapersRegistry
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YH5U3XCP.js";
|
|
11
11
|
import {
|
|
12
12
|
resolveInsideRoot
|
|
13
13
|
} from "./chunk-NUBSJGQZ.js";
|
|
14
14
|
import {
|
|
15
15
|
getToolMemory
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-GG7MGRQ6.js";
|
|
17
17
|
import {
|
|
18
18
|
capitalizeWords
|
|
19
19
|
} from "./chunk-6T3EPABN.js";
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
getOutcomeStore,
|
|
28
28
|
getTimeProvider,
|
|
29
29
|
registerPersistentDistillerFactory
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-Q4JNYY2Y.js";
|
|
31
31
|
import {
|
|
32
32
|
ensureLearningDir,
|
|
33
33
|
getRulesFile
|
|
@@ -2686,4 +2686,4 @@ export {
|
|
|
2686
2686
|
summarizeContextForPrompt,
|
|
2687
2687
|
getContextPromptPrefix
|
|
2688
2688
|
};
|
|
2689
|
-
//# sourceMappingURL=chunk-
|
|
2689
|
+
//# sourceMappingURL=chunk-R76LLKT2.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
MODEL_IDS,
|
|
4
4
|
getTimeProvider,
|
|
5
5
|
resolveModelIdentitySync
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Q4JNYY2Y.js";
|
|
7
7
|
|
|
8
8
|
// src/config/model-availability.ts
|
|
9
9
|
var DEFAULT_TTL_MS = 6e4;
|
|
@@ -150,4 +150,4 @@ export {
|
|
|
150
150
|
resetAvailabilityCache,
|
|
151
151
|
filterAvailableModels
|
|
152
152
|
};
|
|
153
|
-
//# sourceMappingURL=chunk-
|
|
153
|
+
//# sourceMappingURL=chunk-RI3BFANI.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
CACHE_TIMEOUTS,
|
|
3
3
|
createLogger,
|
|
4
4
|
getTimeProvider
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Q4JNYY2Y.js";
|
|
6
6
|
|
|
7
7
|
// src/security/trust-types.ts
|
|
8
8
|
import { z } from "zod";
|
|
@@ -560,4 +560,4 @@ export {
|
|
|
560
560
|
resolveReputationGatingMode,
|
|
561
561
|
gateWithReputation
|
|
562
562
|
};
|
|
563
|
-
//# sourceMappingURL=chunk-
|
|
563
|
+
//# sourceMappingURL=chunk-S3H4VWN5.js.map
|
|
@@ -5,24 +5,24 @@ import {
|
|
|
5
5
|
planOptionalParams,
|
|
6
6
|
requireApiKey,
|
|
7
7
|
validateApiKeyPresence
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-55ZDYUBT.js";
|
|
9
9
|
import {
|
|
10
10
|
CUSTOM_API_BASE_URL_ENV,
|
|
11
11
|
CUSTOM_API_DEFAULT_MODEL,
|
|
12
12
|
PROVIDER_ENV_KEYS,
|
|
13
13
|
assertCustomApiHostResolvesPublic,
|
|
14
14
|
validateCustomApiBaseUrl
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-I32MYAT5.js";
|
|
16
16
|
import {
|
|
17
17
|
CliCircuitBreaker,
|
|
18
18
|
DEFAULT_CIRCUIT_BREAKER_CONFIG
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-YQRP5NST.js";
|
|
20
20
|
import {
|
|
21
21
|
getAvailabilityCache
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-RI3BFANI.js";
|
|
23
23
|
import {
|
|
24
24
|
generateHyphenId
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-U5KSLUZ6.js";
|
|
26
26
|
import {
|
|
27
27
|
CLI_SUBPROCESS_TIMEOUTS,
|
|
28
28
|
CLI_TIMEOUTS,
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
loadModelsDevSnapshot,
|
|
59
59
|
ok,
|
|
60
60
|
resolveCliAlias
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-Q4JNYY2Y.js";
|
|
62
62
|
|
|
63
63
|
// src/cli-adapters/cli-to-model-adapter.ts
|
|
64
64
|
var CliToModelAdapter = class {
|
|
@@ -4867,4 +4867,4 @@ export {
|
|
|
4867
4867
|
SdkAdapter,
|
|
4868
4868
|
createAutoAdapter
|
|
4869
4869
|
};
|
|
4870
|
-
//# sourceMappingURL=chunk-
|
|
4870
|
+
//# sourceMappingURL=chunk-S7PFS6PX.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateSecurityPlan
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6MCSD37T.js";
|
|
4
4
|
import {
|
|
5
5
|
analyzeGitHubRepo
|
|
6
6
|
} from "./chunk-HFOQKCD2.js";
|
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
DEFAULT_TASK_TTL_MS,
|
|
19
19
|
DEFAULT_TOOL_RATE_LIMITS,
|
|
20
20
|
clampTaskTtl
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-J6OUXCR3.js";
|
|
22
22
|
import {
|
|
23
23
|
executeExpert
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-LSWGHIJK.js";
|
|
25
25
|
import {
|
|
26
26
|
JobStatusSchema,
|
|
27
27
|
abortJob,
|
|
@@ -42,21 +42,21 @@ import {
|
|
|
42
42
|
simulationDeniedResult,
|
|
43
43
|
toJobSummary,
|
|
44
44
|
writeJobCancelled
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-Q7TALELN.js";
|
|
46
46
|
import {
|
|
47
47
|
normalizeTopicToCanonical,
|
|
48
48
|
synthesizeResearch
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-OOGGQ2NA.js";
|
|
50
50
|
import {
|
|
51
51
|
IssueTriage
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-6B5VQ2SY.js";
|
|
53
53
|
import {
|
|
54
54
|
resolveEnvMode,
|
|
55
55
|
sanitizeInput
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-S3H4VWN5.js";
|
|
57
57
|
import {
|
|
58
58
|
withPrerequisite
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-K6HJLOPA.js";
|
|
60
60
|
import {
|
|
61
61
|
NOOP_NOTIFIER,
|
|
62
62
|
RateLimiter,
|
|
@@ -79,12 +79,12 @@ import {
|
|
|
79
79
|
withAuditTrail,
|
|
80
80
|
withProgressHeartbeat,
|
|
81
81
|
wrapToolWithTimeout
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-2O63LDYB.js";
|
|
83
83
|
import {
|
|
84
84
|
createAuditTrail,
|
|
85
85
|
createGraphAuditBridge,
|
|
86
86
|
emitPipelinePolicyEvent
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-42ZSRIEX.js";
|
|
88
88
|
import {
|
|
89
89
|
addResearchPaper,
|
|
90
90
|
addSourceToRegistry,
|
|
@@ -112,15 +112,15 @@ import {
|
|
|
112
112
|
parseRegistry,
|
|
113
113
|
sourceExistsInRegistry,
|
|
114
114
|
summarizeContextForPrompt
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-R76LLKT2.js";
|
|
116
116
|
import {
|
|
117
117
|
getTokenEnvVars,
|
|
118
118
|
resolveToken
|
|
119
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-XLJCXM7L.js";
|
|
120
120
|
import {
|
|
121
121
|
loadPapersRegistry,
|
|
122
122
|
loadTechniquesRegistry
|
|
123
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-YH5U3XCP.js";
|
|
124
124
|
import {
|
|
125
125
|
resolveInsideRoot
|
|
126
126
|
} from "./chunk-NUBSJGQZ.js";
|
|
@@ -129,14 +129,14 @@ import {
|
|
|
129
129
|
MemoryImportance,
|
|
130
130
|
calculateTextJaccardSimilarity,
|
|
131
131
|
getToolMemory
|
|
132
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-GG7MGRQ6.js";
|
|
133
133
|
import {
|
|
134
134
|
STOPWORDS,
|
|
135
135
|
truncateWithInfo
|
|
136
136
|
} from "./chunk-6T3EPABN.js";
|
|
137
137
|
import {
|
|
138
138
|
createSessionMemory
|
|
139
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-DSUFV2ZN.js";
|
|
140
140
|
import {
|
|
141
141
|
BUILT_IN_EXPERTS,
|
|
142
142
|
BuiltInExpertTypeSchema,
|
|
@@ -151,7 +151,7 @@ import {
|
|
|
151
151
|
createEvent,
|
|
152
152
|
getGlobalEventBus,
|
|
153
153
|
getGlobalRegistry
|
|
154
|
-
} from "./chunk-
|
|
154
|
+
} from "./chunk-VKVJSPHJ.js";
|
|
155
155
|
import {
|
|
156
156
|
CliDetectionCache,
|
|
157
157
|
asRecord,
|
|
@@ -159,19 +159,19 @@ import {
|
|
|
159
159
|
getAvailableClis,
|
|
160
160
|
sleep,
|
|
161
161
|
withTimeout
|
|
162
|
-
} from "./chunk-
|
|
162
|
+
} from "./chunk-S7PFS6PX.js";
|
|
163
163
|
import {
|
|
164
164
|
DEFAULTS
|
|
165
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-I32MYAT5.js";
|
|
166
166
|
import {
|
|
167
167
|
getAvailabilityCache,
|
|
168
168
|
getCliForModelId,
|
|
169
169
|
resolveFallback
|
|
170
|
-
} from "./chunk-
|
|
170
|
+
} from "./chunk-RI3BFANI.js";
|
|
171
171
|
import {
|
|
172
172
|
generateHyphenId,
|
|
173
173
|
generateUUID
|
|
174
|
-
} from "./chunk-
|
|
174
|
+
} from "./chunk-U5KSLUZ6.js";
|
|
175
175
|
import {
|
|
176
176
|
AGENT_ROUTER_TIMEOUTS,
|
|
177
177
|
API_TIMEOUTS,
|
|
@@ -263,7 +263,7 @@ import {
|
|
|
263
263
|
selectStrategyByManifest,
|
|
264
264
|
toExpertTaskAnalysisResult,
|
|
265
265
|
withStep
|
|
266
|
-
} from "./chunk-
|
|
266
|
+
} from "./chunk-Q4JNYY2Y.js";
|
|
267
267
|
import {
|
|
268
268
|
ensureLearningDir,
|
|
269
269
|
getMetaOutcomesFile,
|
|
@@ -26298,7 +26298,7 @@ function execIdFields(executionId) {
|
|
|
26298
26298
|
async function populateUnifiedContextOnState(state, options) {
|
|
26299
26299
|
const taskCandidate = state["task"];
|
|
26300
26300
|
if (typeof taskCandidate !== "string" || taskCandidate === "") return;
|
|
26301
|
-
const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-
|
|
26301
|
+
const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-MPZ7T4VA.js");
|
|
26302
26302
|
const category = inferTaskCategory2(taskCandidate);
|
|
26303
26303
|
const executionId = options?.executionId;
|
|
26304
26304
|
const execFields = execIdFields(executionId);
|
|
@@ -41572,7 +41572,7 @@ async function tryIssueTriage(task) {
|
|
|
41572
41572
|
try {
|
|
41573
41573
|
const issueMatch = task.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);
|
|
41574
41574
|
if (issueMatch === null) return null;
|
|
41575
|
-
const { createIssueTriage } = await import("./issue-triage-
|
|
41575
|
+
const { createIssueTriage } = await import("./issue-triage-7TWTN6LI.js");
|
|
41576
41576
|
const triage = createIssueTriage();
|
|
41577
41577
|
const owner = issueMatch[1] ?? "";
|
|
41578
41578
|
const num = issueMatch[2] ?? "";
|
|
@@ -41600,7 +41600,7 @@ var VALID_TEMPLATES = /* @__PURE__ */ new Set([
|
|
|
41600
41600
|
]);
|
|
41601
41601
|
async function classifyWithLLM(task) {
|
|
41602
41602
|
try {
|
|
41603
|
-
const { executeExpert: executeExpert2 } = await import("./expert-bridge-
|
|
41603
|
+
const { executeExpert: executeExpert2 } = await import("./expert-bridge-EK362QGQ.js");
|
|
41604
41604
|
const prompt = [
|
|
41605
41605
|
"Classify this task into exactly one pipeline template.",
|
|
41606
41606
|
"Templates: dev (implementation/bug fix/refactor), research (investigate/evaluate/compare),",
|
|
@@ -43241,7 +43241,7 @@ var memoryInitPromise = null;
|
|
|
43241
43241
|
async function initPipelineMemory() {
|
|
43242
43242
|
if (cachedMemory !== null) return cachedMemory;
|
|
43243
43243
|
try {
|
|
43244
|
-
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-
|
|
43244
|
+
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-TVV2IOGB.js");
|
|
43245
43245
|
const { getLearningDir } = await import("./learning-persistence-M3OTCCNI.js");
|
|
43246
43246
|
const mem = createSessionMemory2(getLearningDir());
|
|
43247
43247
|
mem.startSession(`pipeline-${String(getTimeProvider().now())}`);
|
|
@@ -43303,7 +43303,7 @@ function recordRoutingExperience(category, success, durationMs, tokensUsed = 0,
|
|
|
43303
43303
|
callRecord(routingMemoryCache);
|
|
43304
43304
|
return;
|
|
43305
43305
|
}
|
|
43306
|
-
routingMemoryInitPromise ??= import("./routing-memory-
|
|
43306
|
+
routingMemoryInitPromise ??= import("./routing-memory-PP4UJVH4.js").then(({ createRoutingMemory }) => {
|
|
43307
43307
|
routingMemoryCache ??= createRoutingMemory();
|
|
43308
43308
|
return routingMemoryCache;
|
|
43309
43309
|
}).catch((error) => {
|
|
@@ -43337,7 +43337,7 @@ ${text}` : "";
|
|
|
43337
43337
|
}
|
|
43338
43338
|
async function getWeatherContext() {
|
|
43339
43339
|
try {
|
|
43340
|
-
const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-
|
|
43340
|
+
const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-XPDW6LGI.js");
|
|
43341
43341
|
const report = generateWeatherReport2({ includeAdaptive: true });
|
|
43342
43342
|
const mappings = "recommendedMappings" in report ? report.recommendedMappings : [];
|
|
43343
43343
|
if (!Array.isArray(mappings) || mappings.length === 0) return "";
|
|
@@ -43355,7 +43355,7 @@ ${lines}
|
|
|
43355
43355
|
}
|
|
43356
43356
|
async function getMemoryContext(task) {
|
|
43357
43357
|
try {
|
|
43358
|
-
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-
|
|
43358
|
+
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-TVV2IOGB.js");
|
|
43359
43359
|
const { getLearningDir } = await import("./learning-persistence-M3OTCCNI.js");
|
|
43360
43360
|
const memory = createSessionMemory2(getLearningDir(), { maxLearningsInContext: 10 });
|
|
43361
43361
|
const learnings = memory.searchLearnings(task.slice(0, 200));
|
|
@@ -43467,7 +43467,7 @@ ${contextBlock}`;
|
|
|
43467
43467
|
const strategy = config.votingStrategy ?? "higher_order";
|
|
43468
43468
|
await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
|
|
43469
43469
|
try {
|
|
43470
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
43470
|
+
const { executeVoting } = await import("./consensus-vote-MMZTCPL7.js");
|
|
43471
43471
|
const votingResult = await executeVoting(
|
|
43472
43472
|
{
|
|
43473
43473
|
proposal: buildVoteProposal(plan, research),
|
|
@@ -43904,7 +43904,7 @@ async function searchCodebaseForTask(task) {
|
|
|
43904
43904
|
}
|
|
43905
43905
|
async function queryResearchRegistry(task) {
|
|
43906
43906
|
try {
|
|
43907
|
-
const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-
|
|
43907
|
+
const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-VCUOMHPD.js");
|
|
43908
43908
|
const topic = task.split(/[.!?\n]/).filter((s) => s.trim().length > 10)[0]?.trim();
|
|
43909
43909
|
if (topic === void 0) return null;
|
|
43910
43910
|
const result = await synthesizeResearch2(topic.slice(0, 50));
|
|
@@ -43975,7 +43975,7 @@ function createScanStageWrapper() {
|
|
|
43975
43975
|
try {
|
|
43976
43976
|
const slug = ctx.task.match(/([a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+)/)?.[1];
|
|
43977
43977
|
if (slug !== void 0) {
|
|
43978
|
-
const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-
|
|
43978
|
+
const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-VSQWMONM.js");
|
|
43979
43979
|
const plan = await generateSecurityPlan2({ repo: slug, maxScanners: 10 });
|
|
43980
43980
|
const recs = plan.recommendations.slice(0, 5).map((r) => `${r.priority}: ${r.displayName} (${r.category})`).join("; ");
|
|
43981
43981
|
return output(PIPELINE_STATE_KEYS.FINDINGS, recs, getTimeProvider().now() - start, true);
|
|
@@ -46935,7 +46935,7 @@ var GitHubTaskTracker = class {
|
|
|
46935
46935
|
cachedProvider = null;
|
|
46936
46936
|
async getProvider() {
|
|
46937
46937
|
if (this.cachedProvider !== null) return this.cachedProvider;
|
|
46938
|
-
const { createScmProvider } = await import("./factory-
|
|
46938
|
+
const { createScmProvider } = await import("./factory-XBUQP3UB.js");
|
|
46939
46939
|
const result = await createScmProvider({ repo: this.config.repo ?? "" });
|
|
46940
46940
|
if (!result.ok) throw new Error(`SCM provider error: ${result.error.message}`);
|
|
46941
46941
|
this.cachedProvider = result.value;
|
|
@@ -47742,7 +47742,7 @@ async function probeSource(source, includeModelIds) {
|
|
|
47742
47742
|
}
|
|
47743
47743
|
}
|
|
47744
47744
|
async function defaultSources(includeOpenRouter) {
|
|
47745
|
-
const { createAllAdapters: createAllAdapters2 } = await import("./factory-
|
|
47745
|
+
const { createAllAdapters: createAllAdapters2 } = await import("./factory-GOO7MH5G.js");
|
|
47746
47746
|
const adapters = createAllAdapters2();
|
|
47747
47747
|
return buildDefaultModelSources(adapters, { includeOpenRouter });
|
|
47748
47748
|
}
|
|
@@ -51809,4 +51809,4 @@ export {
|
|
|
51809
51809
|
shutdownFeedbackSubscriber,
|
|
51810
51810
|
createEventBusBridge
|
|
51811
51811
|
};
|
|
51812
|
-
//# sourceMappingURL=chunk-
|
|
51812
|
+
//# sourceMappingURL=chunk-SPOES3DZ.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getRandomProvider,
|
|
3
3
|
getTimeProvider
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Q4JNYY2Y.js";
|
|
5
5
|
|
|
6
6
|
// src/utils/id-utils.ts
|
|
7
7
|
import { randomUUID } from "crypto";
|
|
@@ -24,4 +24,4 @@ export {
|
|
|
24
24
|
generateHyphenId,
|
|
25
25
|
generateUUID
|
|
26
26
|
};
|
|
27
|
-
//# sourceMappingURL=chunk-
|
|
27
|
+
//# sourceMappingURL=chunk-U5KSLUZ6.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
getDefaultRegistry
|
|
3
|
+
} from "./chunk-Q4JNYY2Y.js";
|
|
4
4
|
import {
|
|
5
5
|
getNexusDataDir
|
|
6
6
|
} from "./chunk-DHVMSIT5.js";
|
|
@@ -8,16 +8,17 @@ import {
|
|
|
8
8
|
// src/learning/usage-log.ts
|
|
9
9
|
import { appendFileSync, existsSync, mkdirSync, readFileSync, readdirSync } from "fs";
|
|
10
10
|
import { dirname, join } from "path";
|
|
11
|
-
function
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
11
|
+
function computeCostDetail(modelId, inputTokens, outputTokens) {
|
|
12
|
+
const entry = getDefaultRegistry().getEntry(modelId);
|
|
13
|
+
const resolvedId = entry.resolvedFrom ?? modelId;
|
|
14
|
+
const provenance = entry.matchedVia !== void 0 ? { matchedVia: entry.matchedVia } : {};
|
|
15
|
+
if (entry.pricing === void 0) {
|
|
16
|
+
return { costUsd: 0, priced: false, resolvedId, ...provenance };
|
|
17
|
+
}
|
|
16
18
|
const microUsd = Math.round(
|
|
17
|
-
inputTokens * inputPer1M + outputTokens * outputPer1M
|
|
18
|
-
// micro-USD per million scaled
|
|
19
|
+
inputTokens * entry.pricing.inputPer1M + outputTokens * entry.pricing.outputPer1M
|
|
19
20
|
);
|
|
20
|
-
return microUsd / 1e6;
|
|
21
|
+
return { costUsd: microUsd / 1e6, priced: true, resolvedId, ...provenance };
|
|
21
22
|
}
|
|
22
23
|
function getUsageLogPath(date = /* @__PURE__ */ new Date()) {
|
|
23
24
|
const year = date.getUTCFullYear();
|
|
@@ -118,9 +119,9 @@ function rollupByModel(events) {
|
|
|
118
119
|
}
|
|
119
120
|
|
|
120
121
|
export {
|
|
121
|
-
|
|
122
|
+
computeCostDetail,
|
|
122
123
|
recordUsageEvent,
|
|
123
124
|
loadUsageEvents,
|
|
124
125
|
rollupByModel
|
|
125
126
|
};
|
|
126
|
-
//# sourceMappingURL=chunk-
|
|
127
|
+
//# sourceMappingURL=chunk-UQOJ2KGW.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 { appendFileSync, existsSync, mkdirSync, readFileSync, readdirSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\n\nimport { getNexusDataDir } from '../config/nexus-data-dir.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';\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 // Multiply token counts by per-million rate then divide. Use Math.round\n // at micro-USD precision so JSONL files don't drift to floating-point\n // noise on small calls.\n const microUsd = Math.round(\n inputTokens * entry.pricing.inputPer1M + outputTokens * entry.pricing.outputPer1M\n );\n return { costUsd: microUsd / 1_000_000, priced: true, resolvedId, ...provenance };\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\nfunction listUsageFiles(dir: string): readonly string[] {\n if (!existsSync(dir)) return [];\n try {\n return readdirSync(dir).filter((f) => f.startsWith('usage-') && f.endsWith('.jsonl'));\n } catch {\n return [];\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\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\nfunction parseFileLines(filePath: string, filter: LoadFilter): readonly UsageEvent[] {\n let content: string;\n try {\n content = readFileSync(filePath, 'utf-8');\n } catch {\n return [];\n }\n const out: UsageEvent[] = [];\n for (const line of content.split('\\n')) {\n if (line.trim() === '') continue;\n try {\n const parsed = JSON.parse(line) as UsageEvent;\n if (eventMatches(parsed, filter)) out.push(parsed);\n } catch {\n // Skip malformed line; keep reading.\n continue;\n }\n }\n return out;\n}\n\n/**\n * Load all usage events from disk that match the filter. Reads every\n * monthly log file under the data dir; for sub-second filtering at scale\n * a future PR can index by month, but linear scan is fine at the\n * \"operator dashboard\" scale this command targets.\n */\nexport function loadUsageEvents(opts: LoadUsageOptions = {}): readonly UsageEvent[] {\n const dir = join(getNexusDataDir(), 'usage');\n const files = listUsageFiles(dir);\n if (files.length === 0) return [];\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 for (const f of files) {\n events.push(...parseFileLines(join(dir, f), filter));\n }\n return events;\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 readonly avgLatencyMs: number;\n readonly costPerSuccessUsd: number;\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 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 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 ? totalUsdCost : 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 avgLatencyMs,\n costPerSuccessUsd,\n });\n }\n return rollups.sort((a, b) => b.totalUsdCost - a.totalUsdCost);\n}\n"],"mappings":"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","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAutoAdapter
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-S7PFS6PX.js";
|
|
4
4
|
import {
|
|
5
5
|
mapModelErrorToCategory
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YQRP5NST.js";
|
|
7
7
|
import {
|
|
8
8
|
CLI_NAMES,
|
|
9
9
|
CircularBuffer,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
ok,
|
|
25
25
|
recordRateLimitEvent,
|
|
26
26
|
toRateLimitError
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-Q4JNYY2Y.js";
|
|
28
28
|
|
|
29
29
|
// src/agents/collaboration/event-bus-helpers.ts
|
|
30
30
|
import { randomUUID } from "crypto";
|
|
@@ -1041,4 +1041,4 @@ export {
|
|
|
1041
1041
|
getGlobalRegistry,
|
|
1042
1042
|
resetGlobalRegistry
|
|
1043
1043
|
};
|
|
1044
|
-
//# sourceMappingURL=chunk-
|
|
1044
|
+
//# sourceMappingURL=chunk-VKVJSPHJ.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
createLogger,
|
|
3
3
|
err,
|
|
4
4
|
ok
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Q4JNYY2Y.js";
|
|
6
6
|
|
|
7
7
|
// src/scm/token-resolver.ts
|
|
8
8
|
import { execFile } from "child_process";
|
|
@@ -87,4 +87,4 @@ export {
|
|
|
87
87
|
hasToken,
|
|
88
88
|
getTokenEnvVars
|
|
89
89
|
};
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-XLJCXM7L.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
getErrorMessage,
|
|
9
9
|
ok,
|
|
10
10
|
parseBoolEnv
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-Q4JNYY2Y.js";
|
|
12
12
|
|
|
13
13
|
// src/cli/research-helpers-io.ts
|
|
14
14
|
import * as fs2 from "fs/promises";
|
|
@@ -146,4 +146,4 @@ export {
|
|
|
146
146
|
loadPapersRegistry,
|
|
147
147
|
savePapersRegistry
|
|
148
148
|
};
|
|
149
|
-
//# sourceMappingURL=chunk-
|
|
149
|
+
//# sourceMappingURL=chunk-YH5U3XCP.js.map
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
CircuitBreakerRegistry,
|
|
3
3
|
CircuitError,
|
|
4
4
|
mapCliErrorToCategory
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YQRP5NST.js";
|
|
6
6
|
import {
|
|
7
7
|
createLogger,
|
|
8
8
|
err,
|
|
9
9
|
getFallbackChainForCategory,
|
|
10
10
|
getTimeProvider,
|
|
11
11
|
ok
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-Q4JNYY2Y.js";
|
|
13
13
|
|
|
14
14
|
// src/cli-adapters/cli-circuit-breaker.ts
|
|
15
15
|
var CATEGORY_TO_FALLBACK = {
|
|
@@ -152,4 +152,4 @@ export {
|
|
|
152
152
|
CliCircuitBreakerIntegration,
|
|
153
153
|
createCliCircuitBreakerIntegration
|
|
154
154
|
};
|
|
155
|
-
//# sourceMappingURL=chunk-
|
|
155
|
+
//# sourceMappingURL=chunk-YMMX6ELC.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getErrorMessage,
|
|
6
6
|
getTimeProvider,
|
|
7
7
|
ok
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-Q4JNYY2Y.js";
|
|
9
9
|
|
|
10
10
|
// src/cli-adapters/circuit-breaker-types.ts
|
|
11
11
|
var CircuitErrorCode = {
|
|
@@ -375,4 +375,4 @@ export {
|
|
|
375
375
|
mapCliErrorToCategory,
|
|
376
376
|
mapModelErrorToCategory
|
|
377
377
|
};
|
|
378
|
-
//# sourceMappingURL=chunk-
|
|
378
|
+
//# sourceMappingURL=chunk-YQRP5NST.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CliCircuitBreakerIntegration,
|
|
3
3
|
createCliCircuitBreakerIntegration
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-YMMX6ELC.js";
|
|
5
|
+
import "./chunk-YQRP5NST.js";
|
|
6
|
+
import "./chunk-Q4JNYY2Y.js";
|
|
7
7
|
import "./chunk-NL7SZQPW.js";
|
|
8
8
|
import "./chunk-DHVMSIT5.js";
|
|
9
9
|
import "./chunk-ZPWHCABL.js";
|
|
@@ -11,4 +11,4 @@ export {
|
|
|
11
11
|
CliCircuitBreakerIntegration,
|
|
12
12
|
createCliCircuitBreakerIntegration
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=cli-circuit-breaker-
|
|
14
|
+
//# sourceMappingURL=cli-circuit-breaker-MLVJXLK6.js.map
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as CliNameLiteral, K as VoteThreshold, E as ErrorPolicy, N as NoQuorumPolicy } from './consensus-vote-types-
|
|
2
|
+
import { C as CliNameLiteral, K as VoteThreshold, E as ErrorPolicy, N as NoQuorumPolicy } from './consensus-vote-types-DB3SmULO.js';
|
|
3
3
|
import 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|