nexus-agents 4.29.6 → 4.29.7
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/{chunk-IIKPFM4S.js → chunk-46F3UEKW.js} +6 -6
- package/dist/{chunk-7BX54AST.js → chunk-A4ISLEV6.js} +4 -4
- package/dist/chunk-EE53G5Z4.js +7 -0
- package/dist/{chunk-MLPECOSS.js → chunk-GFNBH2PE.js} +2 -2
- package/dist/{chunk-6FQTJHBL.js → chunk-WB54CVTG.js} +2 -2
- package/dist/{chunk-HTDLKLLP.js → chunk-WIB7TIDY.js} +29 -4
- package/dist/chunk-WIB7TIDY.js.map +1 -0
- package/dist/{chunk-T6GDTQPM.js → chunk-WRKUNUCA.js} +3 -3
- package/dist/{chunk-UMT3WDMH.js → chunk-XP5BAFPJ.js} +2 -2
- package/dist/cli.js +11 -11
- package/dist/{consensus-vote-6GHVEPJO.js → consensus-vote-RJBBB25Z.js} +5 -5
- package/dist/{improvement-review-Z6CAUHEY.js → improvement-review-I26ZEHXQ.js} +4 -4
- package/dist/index.js +9 -9
- package/dist/{init-opencode-Y2L2ZW3Q.js → init-opencode-KWKRUK5D.js} +3 -3
- package/dist/{setup-data-dir-I35NTAVH.js → setup-data-dir-A6DPGVXF.js} +5 -5
- package/package.json +1 -1
- package/dist/chunk-HTDLKLLP.js.map +0 -1
- package/dist/chunk-RN2LHUXX.js +0 -7
- /package/dist/{chunk-IIKPFM4S.js.map → chunk-46F3UEKW.js.map} +0 -0
- /package/dist/{chunk-7BX54AST.js.map → chunk-A4ISLEV6.js.map} +0 -0
- /package/dist/{chunk-RN2LHUXX.js.map → chunk-EE53G5Z4.js.map} +0 -0
- /package/dist/{chunk-MLPECOSS.js.map → chunk-GFNBH2PE.js.map} +0 -0
- /package/dist/{chunk-6FQTJHBL.js.map → chunk-WB54CVTG.js.map} +0 -0
- /package/dist/{chunk-T6GDTQPM.js.map → chunk-WRKUNUCA.js.map} +0 -0
- /package/dist/{chunk-UMT3WDMH.js.map → chunk-XP5BAFPJ.js.map} +0 -0
- /package/dist/{consensus-vote-6GHVEPJO.js.map → consensus-vote-RJBBB25Z.js.map} +0 -0
- /package/dist/{improvement-review-Z6CAUHEY.js.map → improvement-review-I26ZEHXQ.js.map} +0 -0
- /package/dist/{init-opencode-Y2L2ZW3Q.js.map → init-opencode-KWKRUK5D.js.map} +0 -0
- /package/dist/{setup-data-dir-I35NTAVH.js.map → setup-data-dir-A6DPGVXF.js.map} +0 -0
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
import {
|
|
22
22
|
DEFAULT_TASK_TTL_MS,
|
|
23
23
|
clampTaskTtl
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-A4ISLEV6.js";
|
|
25
25
|
import {
|
|
26
26
|
executeExpert
|
|
27
27
|
} from "./chunk-UPKYWLPL.js";
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
simulationDeniedResult,
|
|
48
48
|
toJobSummary,
|
|
49
49
|
writeJobCancelled
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-WRKUNUCA.js";
|
|
51
51
|
import {
|
|
52
52
|
allOf
|
|
53
53
|
} from "./chunk-OQB3XC5O.js";
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
} from "./chunk-3IM3OPZH.js";
|
|
65
65
|
import {
|
|
66
66
|
withPrerequisite
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-XP5BAFPJ.js";
|
|
68
68
|
import {
|
|
69
69
|
NOOP_NOTIFIER,
|
|
70
70
|
RateLimiter,
|
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
withAuditTrail,
|
|
89
89
|
withProgressHeartbeat,
|
|
90
90
|
wrapToolWithTimeout
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-WB54CVTG.js";
|
|
92
92
|
import {
|
|
93
93
|
createAuditTrail,
|
|
94
94
|
createGraphAuditBridge,
|
|
@@ -47537,7 +47537,7 @@ ${contextBlock}`;
|
|
|
47537
47537
|
const strategy = config.votingStrategy ?? "higher_order";
|
|
47538
47538
|
await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
|
|
47539
47539
|
try {
|
|
47540
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
47540
|
+
const { executeVoting } = await import("./consensus-vote-RJBBB25Z.js");
|
|
47541
47541
|
const votingResult = await executeVoting(
|
|
47542
47542
|
{
|
|
47543
47543
|
proposal: buildVoteProposal(plan, research),
|
|
@@ -56165,4 +56165,4 @@ export {
|
|
|
56165
56165
|
shutdownFeedbackSubscriber,
|
|
56166
56166
|
createEventBusBridge
|
|
56167
56167
|
};
|
|
56168
|
-
//# sourceMappingURL=chunk-
|
|
56168
|
+
//# sourceMappingURL=chunk-46F3UEKW.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readOpenAICompatEnv
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GFNBH2PE.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-EE53G5Z4.js";
|
|
10
10
|
import {
|
|
11
11
|
capitalize
|
|
12
12
|
} from "./chunk-6T3EPABN.js";
|
|
@@ -1201,7 +1201,7 @@ 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-A6DPGVXF.js");
|
|
1205
1205
|
const outcome = describeDataDirFix2(initDataDirectories2());
|
|
1206
1206
|
writeLine2(outcome.line);
|
|
1207
1207
|
if (outcome.counted) fixCount++;
|
|
@@ -1303,4 +1303,4 @@ export {
|
|
|
1303
1303
|
startStdioServer,
|
|
1304
1304
|
closeServer
|
|
1305
1305
|
};
|
|
1306
|
-
//# sourceMappingURL=chunk-
|
|
1306
|
+
//# sourceMappingURL=chunk-A4ISLEV6.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
computeCostDetail,
|
|
3
3
|
recordUsageEvent
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WIB7TIDY.js";
|
|
5
5
|
import {
|
|
6
6
|
BaseAdapter,
|
|
7
7
|
createStream,
|
|
@@ -833,4 +833,4 @@ export {
|
|
|
833
833
|
discoverModels,
|
|
834
834
|
buildOpenAICompatAdapters
|
|
835
835
|
};
|
|
836
|
-
//# sourceMappingURL=chunk-
|
|
836
|
+
//# sourceMappingURL=chunk-GFNBH2PE.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EE53G5Z4.js";
|
|
4
4
|
import {
|
|
5
5
|
emitClawGuardViolation
|
|
6
6
|
} from "./chunk-ULZFVZFW.js";
|
|
@@ -2116,4 +2116,4 @@ export {
|
|
|
2116
2116
|
VOTING_THRESHOLDS,
|
|
2117
2117
|
ConsensusMetricsSchema
|
|
2118
2118
|
};
|
|
2119
|
-
//# sourceMappingURL=chunk-
|
|
2119
|
+
//# sourceMappingURL=chunk-WB54CVTG.js.map
|
|
@@ -7,6 +7,30 @@ import {
|
|
|
7
7
|
|
|
8
8
|
// src/learning/usage-log.ts
|
|
9
9
|
import { appendFileSync, existsSync, mkdirSync, readFileSync, readdirSync } from "fs";
|
|
10
|
+
|
|
11
|
+
// src/learning/token-cost-core.ts
|
|
12
|
+
function componentCost(tokens, perMillion) {
|
|
13
|
+
return tokens * perMillion / 1e6;
|
|
14
|
+
}
|
|
15
|
+
function computeTokenCost(tokens, rates) {
|
|
16
|
+
const unpriced = [];
|
|
17
|
+
let costUsd = componentCost(tokens.input, rates.inputPer1M);
|
|
18
|
+
costUsd += componentCost(tokens.output, rates.outputPer1M);
|
|
19
|
+
if (tokens.cacheRead !== void 0 && tokens.cacheRead > 0) {
|
|
20
|
+
if (rates.cacheReadPer1M === void 0) unpriced.push("cacheRead");
|
|
21
|
+
else costUsd += componentCost(tokens.cacheRead, rates.cacheReadPer1M);
|
|
22
|
+
}
|
|
23
|
+
if (tokens.cacheWrite !== void 0 && tokens.cacheWrite > 0) {
|
|
24
|
+
if (rates.cacheWritePer1M === void 0) unpriced.push("cacheWrite");
|
|
25
|
+
else costUsd += componentCost(tokens.cacheWrite, rates.cacheWritePer1M);
|
|
26
|
+
}
|
|
27
|
+
return { costUsd, unpricedComponents: unpriced, complete: unpriced.length === 0 };
|
|
28
|
+
}
|
|
29
|
+
function roundToMicroUsd(costUsd) {
|
|
30
|
+
return Math.round(costUsd * 1e6) / 1e6;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// src/learning/usage-log.ts
|
|
10
34
|
import { dirname, join } from "path";
|
|
11
35
|
function computeCostDetail(modelId, inputTokens, outputTokens) {
|
|
12
36
|
const entry = getDefaultRegistry().getEntry(modelId);
|
|
@@ -15,10 +39,11 @@ function computeCostDetail(modelId, inputTokens, outputTokens) {
|
|
|
15
39
|
if (entry.pricing === void 0) {
|
|
16
40
|
return { costUsd: 0, priced: false, resolvedId, ...provenance };
|
|
17
41
|
}
|
|
18
|
-
const
|
|
19
|
-
|
|
42
|
+
const { costUsd } = computeTokenCost(
|
|
43
|
+
{ input: inputTokens, output: outputTokens },
|
|
44
|
+
{ inputPer1M: entry.pricing.inputPer1M, outputPer1M: entry.pricing.outputPer1M }
|
|
20
45
|
);
|
|
21
|
-
return { costUsd:
|
|
46
|
+
return { costUsd: roundToMicroUsd(costUsd), priced: true, resolvedId, ...provenance };
|
|
22
47
|
}
|
|
23
48
|
function priceBasisOf(detail) {
|
|
24
49
|
return detail.priced ? "list" : "unknown";
|
|
@@ -128,4 +153,4 @@ export {
|
|
|
128
153
|
loadUsageEvents,
|
|
129
154
|
rollupByModel
|
|
130
155
|
};
|
|
131
|
-
//# sourceMappingURL=chunk-
|
|
156
|
+
//# sourceMappingURL=chunk-WIB7TIDY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/learning/usage-log.ts","../src/learning/token-cost-core.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 { computeTokenCost, roundToMicroUsd } from './token-cost-core.js';\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';\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\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","/**\n * The one place token counts become USD (#5122, epic #5121).\n *\n * An audit found ELEVEN implementations of this arithmetic across the tree,\n * disagreeing by **3.3x on identical usage**: 1M input + 1M output on\n * `claude-sonnet` gave $18.00 from six of them, $20.00 from three, and $6.00\n * from one. They also disagreed on rounding — one input token at $2.50/1M\n * returned `0.000003` from the usage-log path and `0.0000025` from the trace\n * path, off the same registry rate.\n *\n * The panel that ratified this shape (6/6 on the option) separated two causes\n * that need opposite treatment:\n *\n * - **Arithmetic drift** — per-1M vs per-1K, blended vs split, rounded vs not.\n * Pure duplication. It lives here, once.\n * - **Unpriced policy** — return `0` with `priced:false`, return `undefined`,\n * or substitute a conservative non-$0 rate. These are *deliberate and\n * different per call site*, so they stay in named wrappers where a reader can\n * see which one they get. A policy enum on one function was explicitly\n * rejected: it makes picking the wrong policy a one-character mistake that\n * typechecks and ships green, which is how #4165/#4196 happened.\n *\n * WHAT THIS MODULE DOES NOT DO, deliberately:\n *\n * - **No registry lookup.** Rates are injected. That is what lets the routing\n * profile (`topsis-helpers`) and the operator-configured rate\n * (`orchestration-observer-helpers`) share this arithmetic instead of\n * reimplementing it.\n * - **No rounding.** The usage log rounds to micro-USD so its JSONL does not\n * drift into floating-point noise; that is a *ledger* requirement, not a\n * property of cost. Rounding here would impose it on every consumer and bake\n * in the upward bias on sub-micro calls.\n * - **No unpriced policy.** A caller with no rate must not reach this function.\n *\n * @module learning/token-cost-core\n */\n\n/**\n * Token counts for one call, split by how each component bills.\n *\n * `cacheRead` and `cacheWrite` are separate fields rather than folded into\n * `input` because vendors bill them at genuinely different rates — a cache read\n * at a discount, a cache write at a premium — and because providers report them\n * as counts SEPARATE from `input_tokens`, so adding them to `input` would double\n * count. Both optional: absent means the provider reported none, which is\n * different from zero of them (#5170).\n */\nexport interface TokenCounts {\n readonly input: number;\n readonly output: number;\n /** Tokens served from cache, billed at a discount when a rate is known. */\n readonly cacheRead?: number | undefined;\n /** Tokens written to cache, billed at a premium when a rate is known. */\n readonly cacheWrite?: number | undefined;\n}\n\n/**\n * Per-million-token rates in USD.\n *\n * Cache rates are optional because the registry cannot yet supply them: the\n * internal `PricingSchema` carries only `inputPer1M`/`outputPer1M`, even though\n * `models-dev-client.ts` already fetches `cache_read` from upstream and drops it\n * (#5170). The signature takes them from day one on the panel's binding\n * condition — consolidating onto an input/output-only shape would guarantee a\n * second sweeping refactor the moment those rates land.\n */\nexport interface TokenRates {\n readonly inputPer1M: number;\n readonly outputPer1M: number;\n readonly cacheReadPer1M?: number | undefined;\n readonly cacheWritePer1M?: number | undefined;\n}\n\n/**\n * A cost and an honest account of what it covers.\n *\n * `unpricedComponents` is the load-bearing field. A cache-heavy call whose cache\n * rates are unknown yields a cost computed from input and output alone — a real\n * number that is nonetheless a LOWER BOUND, and one that today's callers present\n * as a finished total. Naming the gap is what stops a partial from reading as\n * complete; per this repo's rule, an instrument must be able to represent what\n * it did not measure.\n */\nexport interface TokenCostBreakdown {\n /** Cost in USD of the components that had a rate. Never rounded. */\n readonly costUsd: number;\n /**\n * Components the caller reported tokens for but supplied no rate for.\n * Empty means the cost covers every reported component.\n */\n readonly unpricedComponents: readonly (keyof TokenCounts)[];\n /** True when `unpricedComponents` is empty — the cost is a total, not a floor. */\n readonly complete: boolean;\n}\n\n/** USD for `tokens` at `perMillion`. */\nfunction componentCost(tokens: number, perMillion: number): number {\n return (tokens * perMillion) / 1_000_000;\n}\n\n/**\n * Convert token counts to USD at the supplied rates.\n *\n * Pure: no registry, no rounding, no fallback. A component with tokens but no\n * rate contributes nothing to `costUsd` and is named in `unpricedComponents`,\n * so a caller can tell a complete total from a floor.\n *\n * @example\n * // 1M in + 1M out on claude-sonnet's 3/15 rates — the audit's golden value.\n * computeTokenCost({ input: 1e6, output: 1e6 }, { inputPer1M: 3, outputPer1M: 15 })\n * // → { costUsd: 18, unpricedComponents: [], complete: true }\n */\nexport function computeTokenCost(tokens: TokenCounts, rates: TokenRates): TokenCostBreakdown {\n const unpriced: (keyof TokenCounts)[] = [];\n let costUsd = componentCost(tokens.input, rates.inputPer1M);\n costUsd += componentCost(tokens.output, rates.outputPer1M);\n\n // A component is unpriced only when tokens were actually reported for it.\n // Zero cache-read tokens with no cache-read rate is not a measurement gap —\n // there was nothing to price. Naming it anyway would make `complete` false\n // for every ordinary uncached call and render the flag useless.\n if (tokens.cacheRead !== undefined && tokens.cacheRead > 0) {\n if (rates.cacheReadPer1M === undefined) unpriced.push('cacheRead');\n else costUsd += componentCost(tokens.cacheRead, rates.cacheReadPer1M);\n }\n if (tokens.cacheWrite !== undefined && tokens.cacheWrite > 0) {\n if (rates.cacheWritePer1M === undefined) unpriced.push('cacheWrite');\n else costUsd += componentCost(tokens.cacheWrite, rates.cacheWritePer1M);\n }\n\n return { costUsd, unpricedComponents: unpriced, complete: unpriced.length === 0 };\n}\n\n/**\n * Round a USD figure to whole micro-USD.\n *\n * Ledger-only. The usage log needs it so its JSONL does not accumulate\n * floating-point noise across many small calls; nothing else should, and it is\n * NOT applied inside {@link computeTokenCost}. It rounds half away from zero,\n * so a sub-micro call biases upward — pinned by test so the bias is a recorded\n * decision rather than an artefact.\n */\nexport function roundToMicroUsd(costUsd: number): number {\n return Math.round(costUsd * 1_000_000) / 1_000_000;\n}\n"],"mappings":";;;;;;;;AA0BA,SAAS,gBAAgB,YAAY,WAAW,cAAc,mBAAmB;;;ACsEjF,SAAS,cAAc,QAAgB,YAA4B;AACjE,SAAQ,SAAS,aAAc;AACjC;AAcO,SAAS,iBAAiB,QAAqB,OAAuC;AAC3F,QAAM,WAAkC,CAAC;AACzC,MAAI,UAAU,cAAc,OAAO,OAAO,MAAM,UAAU;AAC1D,aAAW,cAAc,OAAO,QAAQ,MAAM,WAAW;AAMzD,MAAI,OAAO,cAAc,UAAa,OAAO,YAAY,GAAG;AAC1D,QAAI,MAAM,mBAAmB,OAAW,UAAS,KAAK,WAAW;AAAA,QAC5D,YAAW,cAAc,OAAO,WAAW,MAAM,cAAc;AAAA,EACtE;AACA,MAAI,OAAO,eAAe,UAAa,OAAO,aAAa,GAAG;AAC5D,QAAI,MAAM,oBAAoB,OAAW,UAAS,KAAK,YAAY;AAAA,QAC9D,YAAW,cAAc,OAAO,YAAY,MAAM,eAAe;AAAA,EACxE;AAEA,SAAO,EAAE,SAAS,oBAAoB,UAAU,UAAU,SAAS,WAAW,EAAE;AAClF;AAWO,SAA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D;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
computeCostDetail,
|
|
3
3
|
priceBasisOf
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WIB7TIDY.js";
|
|
5
5
|
import {
|
|
6
6
|
allOf
|
|
7
7
|
} from "./chunk-OQB3XC5O.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
toolSuccessStructured,
|
|
24
24
|
withProgressHeartbeat,
|
|
25
25
|
wrapToolWithTimeout
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-WB54CVTG.js";
|
|
27
27
|
import {
|
|
28
28
|
assessPanelIndependence,
|
|
29
29
|
countDistinctModels,
|
|
@@ -6803,4 +6803,4 @@ export {
|
|
|
6803
6803
|
CONSENSUS_VOTE_TOOL_SCHEMA,
|
|
6804
6804
|
registerConsensusVoteTool
|
|
6805
6805
|
};
|
|
6806
|
-
//# sourceMappingURL=chunk-
|
|
6806
|
+
//# sourceMappingURL=chunk-WRKUNUCA.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
toolStructuredError,
|
|
8
8
|
toolSuccessStructured,
|
|
9
9
|
wrapToolWithTimeout
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-WB54CVTG.js";
|
|
11
11
|
import {
|
|
12
12
|
JsonlStore,
|
|
13
13
|
SECURITY_KEYWORDS,
|
|
@@ -2159,4 +2159,4 @@ export {
|
|
|
2159
2159
|
runImprovementReview,
|
|
2160
2160
|
registerImprovementReviewTool
|
|
2161
2161
|
};
|
|
2162
|
-
//# sourceMappingURL=chunk-
|
|
2162
|
+
//# sourceMappingURL=chunk-XP5BAFPJ.js.map
|
package/dist/cli.js
CHANGED
|
@@ -152,7 +152,7 @@ import {
|
|
|
152
152
|
validateNexusEnv,
|
|
153
153
|
validateWorkflow,
|
|
154
154
|
wrapInMarkdownFence
|
|
155
|
-
} from "./chunk-
|
|
155
|
+
} from "./chunk-46F3UEKW.js";
|
|
156
156
|
import "./chunk-GZUHLCRE.js";
|
|
157
157
|
import "./chunk-HFOQKCD2.js";
|
|
158
158
|
import "./chunk-RSMG2DPB.js";
|
|
@@ -171,11 +171,11 @@ import {
|
|
|
171
171
|
doctorCommand,
|
|
172
172
|
initDataDirectories,
|
|
173
173
|
runDoctor
|
|
174
|
-
} from "./chunk-
|
|
174
|
+
} from "./chunk-A4ISLEV6.js";
|
|
175
175
|
import {
|
|
176
176
|
buildOpenAICompatAdapters,
|
|
177
177
|
readOpenAICompatEnv
|
|
178
|
-
} from "./chunk-
|
|
178
|
+
} from "./chunk-GFNBH2PE.js";
|
|
179
179
|
import {
|
|
180
180
|
shutdownExpertBridge
|
|
181
181
|
} from "./chunk-UPKYWLPL.js";
|
|
@@ -190,11 +190,11 @@ import {
|
|
|
190
190
|
recordAuthenticVote,
|
|
191
191
|
registerConsensusVoteTool,
|
|
192
192
|
toRecordDecision
|
|
193
|
-
} from "./chunk-
|
|
193
|
+
} from "./chunk-WRKUNUCA.js";
|
|
194
194
|
import {
|
|
195
195
|
loadUsageEvents,
|
|
196
196
|
rollupByModel
|
|
197
|
-
} from "./chunk-
|
|
197
|
+
} from "./chunk-WIB7TIDY.js";
|
|
198
198
|
import {
|
|
199
199
|
allOf,
|
|
200
200
|
anyOf
|
|
@@ -226,15 +226,15 @@ import {
|
|
|
226
226
|
registerImprovementReviewTool,
|
|
227
227
|
runImprovementReview,
|
|
228
228
|
scanForSecrets
|
|
229
|
-
} from "./chunk-
|
|
229
|
+
} from "./chunk-XP5BAFPJ.js";
|
|
230
230
|
import {
|
|
231
231
|
createDefaultPolicyFirewall,
|
|
232
232
|
setGlobalPolicyFirewall,
|
|
233
233
|
stagePolicyFirewallForRollout
|
|
234
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-WB54CVTG.js";
|
|
235
235
|
import {
|
|
236
236
|
VERSION
|
|
237
|
-
} from "./chunk-
|
|
237
|
+
} from "./chunk-EE53G5Z4.js";
|
|
238
238
|
import "./chunk-ULZFVZFW.js";
|
|
239
239
|
import {
|
|
240
240
|
createUnifiedRegistry,
|
|
@@ -19553,7 +19553,7 @@ function startImprovementReviewScheduler(options) {
|
|
|
19553
19553
|
let running = false;
|
|
19554
19554
|
const runOnce = async () => {
|
|
19555
19555
|
try {
|
|
19556
|
-
const { runImprovementReview: runImprovementReview2, ImprovementReviewInputSchema: ImprovementReviewInputSchema2 } = await import("./improvement-review-
|
|
19556
|
+
const { runImprovementReview: runImprovementReview2, ImprovementReviewInputSchema: ImprovementReviewInputSchema2 } = await import("./improvement-review-I26ZEHXQ.js");
|
|
19557
19557
|
const input = ImprovementReviewInputSchema2.parse({ fileIssues });
|
|
19558
19558
|
const result = await runImprovementReview2(input, { logger: logger22 });
|
|
19559
19559
|
logger22.info("Scheduled improvement_review complete", {
|
|
@@ -22965,7 +22965,7 @@ async function runInitPortableFlow(args) {
|
|
|
22965
22965
|
return cliExit(result.success ? EXIT_CODES.SUCCESS : EXIT_CODES.SERVER_START_FAILED);
|
|
22966
22966
|
}
|
|
22967
22967
|
async function runInitOpencodeFlow(args) {
|
|
22968
|
-
const { runInitOpencode } = await import("./init-opencode-
|
|
22968
|
+
const { runInitOpencode } = await import("./init-opencode-KWKRUK5D.js");
|
|
22969
22969
|
const opencodePath = args.options.opencode;
|
|
22970
22970
|
if (opencodePath === void 0 || opencodePath === "") {
|
|
22971
22971
|
process.stderr.write("Error: --opencode requires a path argument.\n");
|
|
@@ -22991,7 +22991,7 @@ async function runInitOpencodeFlow(args) {
|
|
|
22991
22991
|
return cliExit(EXIT_CODES.SUCCESS);
|
|
22992
22992
|
}
|
|
22993
22993
|
async function renderOpencodeValidate(opencodePath) {
|
|
22994
|
-
const { runOpencodeValidate } = await import("./init-opencode-
|
|
22994
|
+
const { runOpencodeValidate } = await import("./init-opencode-KWKRUK5D.js");
|
|
22995
22995
|
const result = await runOpencodeValidate(opencodePath);
|
|
22996
22996
|
if (!result.ok) {
|
|
22997
22997
|
process.stderr.write(`init --opencode --validate: ${result.reason ?? "failed"}
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
resetCorrelationTracker,
|
|
12
12
|
runConsensusForGoal,
|
|
13
13
|
unwrapVoteOrThrow
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-WRKUNUCA.js";
|
|
15
|
+
import "./chunk-WIB7TIDY.js";
|
|
16
16
|
import "./chunk-OQB3XC5O.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-WB54CVTG.js";
|
|
18
|
+
import "./chunk-EE53G5Z4.js";
|
|
19
19
|
import "./chunk-ULZFVZFW.js";
|
|
20
20
|
import "./chunk-KYTV2JFH.js";
|
|
21
21
|
import "./chunk-WYKMINTU.js";
|
|
@@ -50,4 +50,4 @@ export {
|
|
|
50
50
|
runConsensusForGoal,
|
|
51
51
|
unwrapVoteOrThrow
|
|
52
52
|
};
|
|
53
|
-
//# sourceMappingURL=consensus-vote-
|
|
53
|
+
//# sourceMappingURL=consensus-vote-RJBBB25Z.js.map
|
|
@@ -11,9 +11,9 @@ import {
|
|
|
11
11
|
loadSelfEvalSignals,
|
|
12
12
|
registerImprovementReviewTool,
|
|
13
13
|
runImprovementReview
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-XP5BAFPJ.js";
|
|
15
|
+
import "./chunk-WB54CVTG.js";
|
|
16
|
+
import "./chunk-EE53G5Z4.js";
|
|
17
17
|
import "./chunk-ULZFVZFW.js";
|
|
18
18
|
import "./chunk-WJ5TFKDF.js";
|
|
19
19
|
import "./chunk-GBHJ37V3.js";
|
|
@@ -33,4 +33,4 @@ export {
|
|
|
33
33
|
registerImprovementReviewTool,
|
|
34
34
|
runImprovementReview
|
|
35
35
|
};
|
|
36
|
-
//# sourceMappingURL=improvement-review-
|
|
36
|
+
//# sourceMappingURL=improvement-review-I26ZEHXQ.js.map
|
package/dist/index.js
CHANGED
|
@@ -553,7 +553,7 @@ import {
|
|
|
553
553
|
withLogging,
|
|
554
554
|
withRetry,
|
|
555
555
|
withRetryWrapper
|
|
556
|
-
} from "./chunk-
|
|
556
|
+
} from "./chunk-46F3UEKW.js";
|
|
557
557
|
import {
|
|
558
558
|
FALLBACK_SCANNER_DATA,
|
|
559
559
|
buildPlanFromAnalysis,
|
|
@@ -574,13 +574,13 @@ import {
|
|
|
574
574
|
connectTransport,
|
|
575
575
|
createServer,
|
|
576
576
|
startStdioServer
|
|
577
|
-
} from "./chunk-
|
|
577
|
+
} from "./chunk-A4ISLEV6.js";
|
|
578
578
|
import {
|
|
579
579
|
OPENAI_MODELS,
|
|
580
580
|
OPENAI_MODEL_ALIASES,
|
|
581
581
|
OpenAIAdapter,
|
|
582
582
|
createOpenAIAdapter
|
|
583
|
-
} from "./chunk-
|
|
583
|
+
} from "./chunk-GFNBH2PE.js";
|
|
584
584
|
import {
|
|
585
585
|
executeExpert
|
|
586
586
|
} from "./chunk-UPKYWLPL.js";
|
|
@@ -632,8 +632,8 @@ import {
|
|
|
632
632
|
generateProposalId,
|
|
633
633
|
parseAgentPairKey,
|
|
634
634
|
registerConsensusVoteTool
|
|
635
|
-
} from "./chunk-
|
|
636
|
-
import "./chunk-
|
|
635
|
+
} from "./chunk-WRKUNUCA.js";
|
|
636
|
+
import "./chunk-WIB7TIDY.js";
|
|
637
637
|
import {
|
|
638
638
|
allOf
|
|
639
639
|
} from "./chunk-OQB3XC5O.js";
|
|
@@ -683,7 +683,7 @@ import {
|
|
|
683
683
|
import {
|
|
684
684
|
ImprovementReviewInputSchema,
|
|
685
685
|
registerImprovementReviewTool
|
|
686
|
-
} from "./chunk-
|
|
686
|
+
} from "./chunk-XP5BAFPJ.js";
|
|
687
687
|
import {
|
|
688
688
|
AgentPerformanceSchema,
|
|
689
689
|
ConsensusAlgorithmSchema,
|
|
@@ -719,10 +719,10 @@ import {
|
|
|
719
719
|
toolSuccess,
|
|
720
720
|
toolSuccessStructured,
|
|
721
721
|
validateToolInput
|
|
722
|
-
} from "./chunk-
|
|
722
|
+
} from "./chunk-WB54CVTG.js";
|
|
723
723
|
import {
|
|
724
724
|
VERSION
|
|
725
|
-
} from "./chunk-
|
|
725
|
+
} from "./chunk-EE53G5Z4.js";
|
|
726
726
|
import {
|
|
727
727
|
AuditTrail,
|
|
728
728
|
MAX_STRIPPED_ELEMENTS_PER_EVENT,
|
|
@@ -4729,7 +4729,7 @@ function buildVotingInput(plan, config) {
|
|
|
4729
4729
|
}
|
|
4730
4730
|
async function executeSingleVote(plan, config, log) {
|
|
4731
4731
|
try {
|
|
4732
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
4732
|
+
const { executeVoting } = await import("./consensus-vote-RJBBB25Z.js");
|
|
4733
4733
|
const input = buildVotingInput(plan, config);
|
|
4734
4734
|
const result = await executeVoting(input, log);
|
|
4735
4735
|
return parseVotingResult(result);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
discoverModels,
|
|
3
3
|
readOpencodeGateway
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-GFNBH2PE.js";
|
|
5
|
+
import "./chunk-WIB7TIDY.js";
|
|
6
6
|
import "./chunk-CQHUNYJN.js";
|
|
7
7
|
import "./chunk-GXZDUDSD.js";
|
|
8
8
|
import {
|
|
@@ -176,4 +176,4 @@ export {
|
|
|
176
176
|
runInitOpencode,
|
|
177
177
|
runOpencodeValidate
|
|
178
178
|
};
|
|
179
|
-
//# sourceMappingURL=init-opencode-
|
|
179
|
+
//# sourceMappingURL=init-opencode-KWKRUK5D.js.map
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
NEXUS_DATA_DIR,
|
|
3
3
|
describeDataDirFix,
|
|
4
4
|
initDataDirectories
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-A4ISLEV6.js";
|
|
6
|
+
import "./chunk-GFNBH2PE.js";
|
|
7
|
+
import "./chunk-WIB7TIDY.js";
|
|
8
8
|
import "./chunk-OQB3XC5O.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-EE53G5Z4.js";
|
|
10
10
|
import "./chunk-6T3EPABN.js";
|
|
11
11
|
import "./chunk-VOXVWYD4.js";
|
|
12
12
|
import "./chunk-CQHUNYJN.js";
|
|
@@ -26,4 +26,4 @@ export {
|
|
|
26
26
|
describeDataDirFix,
|
|
27
27
|
initDataDirectories
|
|
28
28
|
};
|
|
29
|
-
//# sourceMappingURL=setup-data-dir-
|
|
29
|
+
//# sourceMappingURL=setup-data-dir-A6DPGVXF.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nexus-agents",
|
|
3
|
-
"version": "4.29.
|
|
3
|
+
"version": "4.29.7",
|
|
4
4
|
"description": "Governance substrate for AI coding agents — adversarial PR review, drift-detected rules, tamper-evident audit, and closed-loop outcome routing for Claude, Codex, Gemini, and OpenCode",
|
|
5
5
|
"mcpName": "io.github.nexus-substrate/nexus-agents",
|
|
6
6
|
"license": "MIT",
|
|
@@ -1 +0,0 @@
|
|
|
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';\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 // 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 * 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\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 successR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CAAC,GAAG,MAAM,EAAE,eAAe,EAAE,YAAY;AAC/D;","names":[]}
|
package/dist/chunk-RN2LHUXX.js
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|