nexus-agents 2.157.0 → 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-553QYRXJ.js → chunk-IQVHJD4O.js} +5 -5
- package/dist/{chunk-47WFM6QH.js → chunk-J2JP35S3.js} +4 -4
- package/dist/{chunk-OXYGRB4C.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-TT4ZITRU.js → chunk-Q7TALELN.js} +15 -44
- package/dist/chunk-Q7TALELN.js.map +1 -0
- 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-3SE57WOV.js → chunk-SPOES3DZ.js} +34 -34
- package/dist/{chunk-3SE57WOV.js.map → chunk-SPOES3DZ.js.map} +1 -1
- 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-7EBYYBCQ.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-FJ2II5YH.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/chunk-TT4ZITRU.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-553QYRXJ.js.map → chunk-IQVHJD4O.js.map} +0 -0
- /package/dist/{chunk-47WFM6QH.js.map → chunk-J2JP35S3.js.map} +0 -0
- /package/dist/{chunk-OXYGRB4C.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-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-7EBYYBCQ.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-FJ2II5YH.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,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
|
/**
|
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
buildOpenAICompatAdapters,
|
|
4
4
|
readOpenAICompatEnv
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CTL5HUZZ.js";
|
|
6
6
|
import {
|
|
7
7
|
calculateConsensus,
|
|
8
8
|
countByCategory,
|
|
@@ -17,13 +17,13 @@ import {
|
|
|
17
17
|
generateSummary,
|
|
18
18
|
parseFindings,
|
|
19
19
|
sumFindings
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-KS622JST.js";
|
|
21
|
+
import "./chunk-FWW5GCEH.js";
|
|
22
22
|
import {
|
|
23
23
|
setupCommandAsync,
|
|
24
24
|
verifyCommand
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-IQVHJD4O.js";
|
|
26
|
+
import "./chunk-4IXC6V6O.js";
|
|
27
27
|
import {
|
|
28
28
|
AuthHandler,
|
|
29
29
|
DEFAULT_EXPERTS,
|
|
@@ -142,9 +142,9 @@ import {
|
|
|
142
142
|
validateCommand,
|
|
143
143
|
validateWorkflow,
|
|
144
144
|
wrapInMarkdownFence
|
|
145
|
-
} from "./chunk-
|
|
146
|
-
import "./chunk-
|
|
147
|
-
import "./chunk-
|
|
145
|
+
} from "./chunk-SPOES3DZ.js";
|
|
146
|
+
import "./chunk-CSHFTQA7.js";
|
|
147
|
+
import "./chunk-6MCSD37T.js";
|
|
148
148
|
import "./chunk-HFOQKCD2.js";
|
|
149
149
|
import "./chunk-3ACDP4E6.js";
|
|
150
150
|
import {
|
|
@@ -170,11 +170,11 @@ import {
|
|
|
170
170
|
loadConfig,
|
|
171
171
|
runDoctor,
|
|
172
172
|
validateNexusEnv
|
|
173
|
-
} from "./chunk-
|
|
174
|
-
import "./chunk-
|
|
173
|
+
} from "./chunk-J6OUXCR3.js";
|
|
174
|
+
import "./chunk-YMMX6ELC.js";
|
|
175
175
|
import {
|
|
176
176
|
shutdownExpertBridge
|
|
177
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-LSWGHIJK.js";
|
|
178
178
|
import {
|
|
179
179
|
ConsensusVoteInputSchema,
|
|
180
180
|
DEFAULT_VOTE_TIMEOUT_MS,
|
|
@@ -184,25 +184,25 @@ import {
|
|
|
184
184
|
executeVoting,
|
|
185
185
|
mapOutcomeToDecision,
|
|
186
186
|
registerConsensusVoteTool
|
|
187
|
-
} from "./chunk-
|
|
187
|
+
} from "./chunk-Q7TALELN.js";
|
|
188
188
|
import {
|
|
189
189
|
loadUsageEvents,
|
|
190
190
|
rollupByModel
|
|
191
|
-
} from "./chunk-
|
|
191
|
+
} from "./chunk-UQOJ2KGW.js";
|
|
192
192
|
import {
|
|
193
193
|
synthesizeResearch
|
|
194
|
-
} from "./chunk-
|
|
194
|
+
} from "./chunk-OOGGQ2NA.js";
|
|
195
195
|
import {
|
|
196
196
|
classifyTrust,
|
|
197
197
|
createFullGitHubProvider,
|
|
198
198
|
evaluatePolicy,
|
|
199
199
|
parsePRUrl
|
|
200
|
-
} from "./chunk-
|
|
201
|
-
import "./chunk-
|
|
200
|
+
} from "./chunk-6B5VQ2SY.js";
|
|
201
|
+
import "./chunk-7J3AAPH5.js";
|
|
202
202
|
import {
|
|
203
203
|
ReputationCache,
|
|
204
204
|
sanitizeInput
|
|
205
|
-
} from "./chunk-
|
|
205
|
+
} from "./chunk-S3H4VWN5.js";
|
|
206
206
|
import {
|
|
207
207
|
ImprovementReviewInputSchema,
|
|
208
208
|
calculateFitnessScore,
|
|
@@ -216,11 +216,11 @@ import {
|
|
|
216
216
|
registerImprovementReviewTool,
|
|
217
217
|
runImprovementReview,
|
|
218
218
|
scanForSecrets
|
|
219
|
-
} from "./chunk-
|
|
219
|
+
} from "./chunk-K6HJLOPA.js";
|
|
220
220
|
import {
|
|
221
221
|
createDefaultPolicyFirewall
|
|
222
|
-
} from "./chunk-
|
|
223
|
-
import "./chunk-
|
|
222
|
+
} from "./chunk-2O63LDYB.js";
|
|
223
|
+
import "./chunk-42ZSRIEX.js";
|
|
224
224
|
import {
|
|
225
225
|
PaperStatusSchema,
|
|
226
226
|
createResearchIssue,
|
|
@@ -243,32 +243,32 @@ import {
|
|
|
243
243
|
loadSourcesRegistry,
|
|
244
244
|
rankDiscoveredItems,
|
|
245
245
|
saveSourcesRegistry
|
|
246
|
-
} from "./chunk-
|
|
246
|
+
} from "./chunk-R76LLKT2.js";
|
|
247
247
|
import {
|
|
248
248
|
resolveToken
|
|
249
|
-
} from "./chunk-
|
|
249
|
+
} from "./chunk-XLJCXM7L.js";
|
|
250
250
|
import {
|
|
251
251
|
loadPapersRegistry,
|
|
252
252
|
loadTechniquesRegistry,
|
|
253
253
|
savePapersRegistry
|
|
254
|
-
} from "./chunk-
|
|
254
|
+
} from "./chunk-YH5U3XCP.js";
|
|
255
255
|
import "./chunk-NUBSJGQZ.js";
|
|
256
256
|
import {
|
|
257
257
|
MemoryError,
|
|
258
258
|
shutdownToolMemory
|
|
259
|
-
} from "./chunk-
|
|
259
|
+
} from "./chunk-GG7MGRQ6.js";
|
|
260
260
|
import {
|
|
261
261
|
capitalize,
|
|
262
262
|
capitalizeKebab,
|
|
263
263
|
truncateSentence
|
|
264
264
|
} from "./chunk-6T3EPABN.js";
|
|
265
|
-
import "./chunk-
|
|
265
|
+
import "./chunk-DSUFV2ZN.js";
|
|
266
266
|
import "./chunk-ZM4O442V.js";
|
|
267
267
|
import "./chunk-PINS44XA.js";
|
|
268
268
|
import "./chunk-KSQSWEFH.js";
|
|
269
269
|
import {
|
|
270
270
|
createUnifiedRegistry
|
|
271
|
-
} from "./chunk-
|
|
271
|
+
} from "./chunk-VKVJSPHJ.js";
|
|
272
272
|
import {
|
|
273
273
|
NEXUS_SUBPROCESS_DEPTH_ENV,
|
|
274
274
|
createAllAdapters,
|
|
@@ -276,14 +276,14 @@ import {
|
|
|
276
276
|
isRecord,
|
|
277
277
|
probeAllClis,
|
|
278
278
|
readSubprocessDepth
|
|
279
|
-
} from "./chunk-
|
|
280
|
-
import "./chunk-
|
|
279
|
+
} from "./chunk-S7PFS6PX.js";
|
|
280
|
+
import "./chunk-55ZDYUBT.js";
|
|
281
281
|
import {
|
|
282
282
|
DEFAULTS
|
|
283
|
-
} from "./chunk-
|
|
284
|
-
import "./chunk-
|
|
285
|
-
import "./chunk-
|
|
286
|
-
import "./chunk-
|
|
283
|
+
} from "./chunk-I32MYAT5.js";
|
|
284
|
+
import "./chunk-YQRP5NST.js";
|
|
285
|
+
import "./chunk-RI3BFANI.js";
|
|
286
|
+
import "./chunk-U5KSLUZ6.js";
|
|
287
287
|
import {
|
|
288
288
|
API_TIMEOUTS,
|
|
289
289
|
AgentCapability,
|
|
@@ -357,7 +357,7 @@ import {
|
|
|
357
357
|
validateTimeout,
|
|
358
358
|
writeEmptyLine,
|
|
359
359
|
writeLine
|
|
360
|
-
} from "./chunk-
|
|
360
|
+
} from "./chunk-Q4JNYY2Y.js";
|
|
361
361
|
import "./chunk-NL7SZQPW.js";
|
|
362
362
|
import {
|
|
363
363
|
applyPortableMode,
|
|
@@ -4035,7 +4035,7 @@ ${file.patch}
|
|
|
4035
4035
|
violations: policyResult.violations
|
|
4036
4036
|
});
|
|
4037
4037
|
}
|
|
4038
|
-
const { formatReviewComment: formatReviewComment2 } = await import("./pr-reviewer-helpers-
|
|
4038
|
+
const { formatReviewComment: formatReviewComment2 } = await import("./pr-reviewer-helpers-VT4DR5BC.js");
|
|
4039
4039
|
const body = formatReviewComment2(result);
|
|
4040
4040
|
const postResult = await provider.createReview(pr.prNumber, body, result.decision);
|
|
4041
4041
|
if (!postResult.ok) {
|
|
@@ -17859,7 +17859,7 @@ function startImprovementReviewScheduler(options) {
|
|
|
17859
17859
|
let running = false;
|
|
17860
17860
|
const runOnce = async () => {
|
|
17861
17861
|
try {
|
|
17862
|
-
const { runImprovementReview: runImprovementReview2, ImprovementReviewInputSchema: ImprovementReviewInputSchema2 } = await import("./improvement-review-
|
|
17862
|
+
const { runImprovementReview: runImprovementReview2, ImprovementReviewInputSchema: ImprovementReviewInputSchema2 } = await import("./improvement-review-XXRDVOJT.js");
|
|
17863
17863
|
const input = ImprovementReviewInputSchema2.parse({ fileIssues });
|
|
17864
17864
|
const result = await runImprovementReview2(input, { logger: logger19 });
|
|
17865
17865
|
logger19.info("Scheduled improvement_review complete", {
|
|
@@ -19898,7 +19898,7 @@ function adaptConfigToLibrary(config) {
|
|
|
19898
19898
|
}
|
|
19899
19899
|
function createBeliefPromoter() {
|
|
19900
19900
|
return async (event) => {
|
|
19901
|
-
const { getToolMemory } = await import("./tool-memory-
|
|
19901
|
+
const { getToolMemory } = await import("./tool-memory-YLCJZVMV.js");
|
|
19902
19902
|
const tm = getToolMemory();
|
|
19903
19903
|
await tm.recordBelief(
|
|
19904
19904
|
`skill:${event.name}`,
|
|
@@ -21010,7 +21010,7 @@ async function handleResearchCommand(args) {
|
|
|
21010
21010
|
}
|
|
21011
21011
|
}
|
|
21012
21012
|
async function handleRegistryCommand(args) {
|
|
21013
|
-
const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-
|
|
21013
|
+
const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-QVBYBBWR.js");
|
|
21014
21014
|
const subcommand = args.subcommand;
|
|
21015
21015
|
if (!isValidRegistrySubcommand(subcommand)) {
|
|
21016
21016
|
process.stdout.write(`${formatRegistryUsage()}
|
|
@@ -21058,7 +21058,7 @@ async function handleVerifyCommand(args) {
|
|
|
21058
21058
|
async function handleDoctorCommand(args) {
|
|
21059
21059
|
const exitCode = await doctorCommand({ fix: args.options.fix });
|
|
21060
21060
|
if (args.options.deep) {
|
|
21061
|
-
const { runDeepDiagnostics: runDeepDiagnostics2, formatDeepDiagnostics: formatDeepDiagnostics2 } = await import("./doctor-deep-
|
|
21061
|
+
const { runDeepDiagnostics: runDeepDiagnostics2, formatDeepDiagnostics: formatDeepDiagnostics2 } = await import("./doctor-deep-KUB4HPCS.js");
|
|
21062
21062
|
const diag = runDeepDiagnostics2();
|
|
21063
21063
|
process.stdout.write(formatDeepDiagnostics2(diag) + "\n");
|
|
21064
21064
|
}
|
|
@@ -21108,7 +21108,7 @@ async function runInitPortableFlow(args) {
|
|
|
21108
21108
|
return cliExit(result.success ? EXIT_CODES.SUCCESS : EXIT_CODES.SERVER_START_FAILED);
|
|
21109
21109
|
}
|
|
21110
21110
|
async function runInitOpencodeFlow(args) {
|
|
21111
|
-
const { runInitOpencode } = await import("./init-opencode-
|
|
21111
|
+
const { runInitOpencode } = await import("./init-opencode-RNSCHZIW.js");
|
|
21112
21112
|
const opencodePath = args.options.opencode;
|
|
21113
21113
|
if (opencodePath === void 0 || opencodePath === "") {
|
|
21114
21114
|
process.stderr.write("Error: --opencode requires a path argument.\n");
|
|
@@ -21134,7 +21134,7 @@ async function runInitOpencodeFlow(args) {
|
|
|
21134
21134
|
return cliExit(EXIT_CODES.SUCCESS);
|
|
21135
21135
|
}
|
|
21136
21136
|
async function renderOpencodeValidate(opencodePath) {
|
|
21137
|
-
const { runOpencodeValidate } = await import("./init-opencode-
|
|
21137
|
+
const { runOpencodeValidate } = await import("./init-opencode-RNSCHZIW.js");
|
|
21138
21138
|
const result = await runOpencodeValidate(opencodePath);
|
|
21139
21139
|
if (!result.ok) {
|
|
21140
21140
|
process.stderr.write(`init --opencode --validate: ${result.reason ?? "failed"}
|
|
@@ -21173,7 +21173,7 @@ async function handleSetupCommandAsync(args) {
|
|
|
21173
21173
|
return cliExitFromStatus(exitCode);
|
|
21174
21174
|
}
|
|
21175
21175
|
async function runCustomApiSetup(args) {
|
|
21176
|
-
const { configureCustomApi } = await import("./setup-custom-api-
|
|
21176
|
+
const { configureCustomApi } = await import("./setup-custom-api-H6FJ5VWL.js");
|
|
21177
21177
|
const baseUrl = args.options.customApi;
|
|
21178
21178
|
if (baseUrl === void 0) return EXIT_CODES.SERVER_START_FAILED;
|
|
21179
21179
|
const input = {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
CompositeRoutingError,
|
|
5
5
|
DEFAULT_COMPOSITE_CONFIG,
|
|
6
6
|
createCompositeRouter
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Q4JNYY2Y.js";
|
|
8
8
|
import "./chunk-NL7SZQPW.js";
|
|
9
9
|
import "./chunk-DHVMSIT5.js";
|
|
10
10
|
import "./chunk-ZPWHCABL.js";
|
|
@@ -15,4 +15,4 @@ export {
|
|
|
15
15
|
DEFAULT_COMPOSITE_CONFIG,
|
|
16
16
|
createCompositeRouter
|
|
17
17
|
};
|
|
18
|
-
//# sourceMappingURL=composite-router-
|
|
18
|
+
//# sourceMappingURL=composite-router-FTECAR4U.js.map
|
|
@@ -8,23 +8,23 @@ import {
|
|
|
8
8
|
registerConsensusVoteTool,
|
|
9
9
|
resetCorrelationTracker,
|
|
10
10
|
runConsensusForGoal
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-Q7TALELN.js";
|
|
12
|
+
import "./chunk-UQOJ2KGW.js";
|
|
13
|
+
import "./chunk-2O63LDYB.js";
|
|
14
|
+
import "./chunk-42ZSRIEX.js";
|
|
15
|
+
import "./chunk-GG7MGRQ6.js";
|
|
16
16
|
import "./chunk-6T3EPABN.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-DSUFV2ZN.js";
|
|
18
18
|
import "./chunk-PINS44XA.js";
|
|
19
19
|
import "./chunk-KSQSWEFH.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-VKVJSPHJ.js";
|
|
21
|
+
import "./chunk-S7PFS6PX.js";
|
|
22
|
+
import "./chunk-55ZDYUBT.js";
|
|
23
|
+
import "./chunk-I32MYAT5.js";
|
|
24
|
+
import "./chunk-YQRP5NST.js";
|
|
25
|
+
import "./chunk-RI3BFANI.js";
|
|
26
|
+
import "./chunk-U5KSLUZ6.js";
|
|
27
|
+
import "./chunk-Q4JNYY2Y.js";
|
|
28
28
|
import "./chunk-NL7SZQPW.js";
|
|
29
29
|
import "./chunk-DHVMSIT5.js";
|
|
30
30
|
import "./chunk-ZPWHCABL.js";
|
|
@@ -39,4 +39,4 @@ export {
|
|
|
39
39
|
resetCorrelationTracker,
|
|
40
40
|
runConsensusForGoal
|
|
41
41
|
};
|
|
42
|
-
//# sourceMappingURL=consensus-vote-
|
|
42
|
+
//# sourceMappingURL=consensus-vote-MMZTCPL7.js.map
|
|
@@ -86,12 +86,14 @@ type Pricing = z.infer<typeof PricingSchema>;
|
|
|
86
86
|
*
|
|
87
87
|
* Design decisions that the fixture tests pin (#3855 acceptance criteria):
|
|
88
88
|
*
|
|
89
|
-
* - **Missing cost is UNMEASURED, not zero.** A voter with no
|
|
90
|
-
* (
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
89
|
+
* - **Missing cost is UNMEASURED, not zero.** A voter with no computable cost
|
|
90
|
+
* — no usage report at all (a CLI-subscription adapter, an error vote that
|
|
91
|
+
* never reached the model) or a model with no pricing anywhere in the
|
|
92
|
+
* registry chain (#4165) — is counted in `unmeasuredVoters` and contributes
|
|
93
|
+
* 0 to the COST totals (reported tokens still count toward consumption) —
|
|
94
|
+
* but the summary records that the total is a floor, not an exact figure
|
|
95
|
+
* (`measured` < `voterCount`). Treating unmeasured as a true $0 would
|
|
96
|
+
* silently understate spend; this keeps the honesty.
|
|
95
97
|
* - **Plan mode records 0-cost but keeps tokens.** Under `NEXUS_BILLING_MODE=plan`
|
|
96
98
|
* the spend is pre-covered by a subscription, so cost is recorded as $0 while
|
|
97
99
|
* token counts are preserved (so the operator can still see consumption and
|
|
@@ -113,8 +115,9 @@ interface VoterCostBreakdown {
|
|
|
113
115
|
/** Effective cost after billing-mode application (0 in plan mode). */
|
|
114
116
|
readonly costUsd: number;
|
|
115
117
|
/**
|
|
116
|
-
* True when this voter
|
|
117
|
-
*
|
|
118
|
+
* True when no cost was computable for this voter — no usage report at all,
|
|
119
|
+
* or a token-reporting call on an unpriced model (#4165). Its cost zero is a
|
|
120
|
+
* placeholder, not a measured $0.
|
|
118
121
|
*/
|
|
119
122
|
readonly unmeasured: boolean;
|
|
120
123
|
}
|
|
@@ -136,9 +139,12 @@ interface DecisionCostSummary {
|
|
|
136
139
|
readonly billingMode: DecisionBillingMode;
|
|
137
140
|
/** Total voters folded into this decision. */
|
|
138
141
|
readonly voterCount: number;
|
|
139
|
-
/** Voters
|
|
142
|
+
/** Voters with a computable cost (`costUsd` present on the input). */
|
|
140
143
|
readonly measuredVoters: number;
|
|
141
|
-
/**
|
|
144
|
+
/**
|
|
145
|
+
* Voters whose cost could not be computed — no usage report, or an unpriced
|
|
146
|
+
* model (#4165). Counted, not zeroed-as-fact.
|
|
147
|
+
*/
|
|
142
148
|
readonly unmeasuredVoters: number;
|
|
143
149
|
readonly totalInputTokens: number;
|
|
144
150
|
readonly totalOutputTokens: number;
|
|
@@ -5,17 +5,17 @@ import {
|
|
|
5
5
|
inferTaskCategory,
|
|
6
6
|
selectRelevantResearch,
|
|
7
7
|
summarizeContextForPrompt
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-R76LLKT2.js";
|
|
9
|
+
import "./chunk-XLJCXM7L.js";
|
|
10
|
+
import "./chunk-YH5U3XCP.js";
|
|
11
11
|
import "./chunk-NUBSJGQZ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-GG7MGRQ6.js";
|
|
13
13
|
import "./chunk-6T3EPABN.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-DSUFV2ZN.js";
|
|
15
15
|
import "./chunk-PINS44XA.js";
|
|
16
16
|
import "./chunk-KSQSWEFH.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-U5KSLUZ6.js";
|
|
18
|
+
import "./chunk-Q4JNYY2Y.js";
|
|
19
19
|
import "./chunk-NL7SZQPW.js";
|
|
20
20
|
import "./chunk-DHVMSIT5.js";
|
|
21
21
|
import "./chunk-ZPWHCABL.js";
|
|
@@ -27,4 +27,4 @@ export {
|
|
|
27
27
|
selectRelevantResearch,
|
|
28
28
|
summarizeContextForPrompt
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=context-retriever-
|
|
30
|
+
//# sourceMappingURL=context-retriever-MPZ7T4VA.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
formatDeepDiagnostics,
|
|
3
3
|
runDeepDiagnostics
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-FWW5GCEH.js";
|
|
5
|
+
import "./chunk-Q4JNYY2Y.js";
|
|
6
6
|
import "./chunk-NL7SZQPW.js";
|
|
7
7
|
import "./chunk-DHVMSIT5.js";
|
|
8
8
|
import "./chunk-ZPWHCABL.js";
|
|
@@ -10,4 +10,4 @@ export {
|
|
|
10
10
|
formatDeepDiagnostics,
|
|
11
11
|
runDeepDiagnostics
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=doctor-deep-
|
|
13
|
+
//# sourceMappingURL=doctor-deep-KUB4HPCS.js.map
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
shutdownExpertBridge,
|
|
4
4
|
tokenSplitFromUsage,
|
|
5
5
|
totalTokensFromUsage
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-LSWGHIJK.js";
|
|
7
|
+
import "./chunk-RI3BFANI.js";
|
|
8
|
+
import "./chunk-Q4JNYY2Y.js";
|
|
9
9
|
import "./chunk-NL7SZQPW.js";
|
|
10
10
|
import "./chunk-DHVMSIT5.js";
|
|
11
11
|
import "./chunk-ZPWHCABL.js";
|
|
@@ -15,4 +15,4 @@ export {
|
|
|
15
15
|
tokenSplitFromUsage,
|
|
16
16
|
totalTokensFromUsage
|
|
17
17
|
};
|
|
18
|
-
//# sourceMappingURL=expert-bridge-
|
|
18
|
+
//# sourceMappingURL=expert-bridge-EK362QGQ.js.map
|