nexus-agents 3.7.0 → 3.8.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-RERUXZJS.js → child-mcp-config-R4GQMDAV.js} +2 -2
- package/dist/{chunk-KEO6QJE6.js → chunk-2XFBHREJ.js} +2 -2
- package/dist/{chunk-J2F5E3DF.js → chunk-5CXAYPSU.js} +2 -2
- package/dist/{chunk-WT6JCD3E.js → chunk-5LFB77LA.js} +2 -2
- package/dist/{chunk-JFZP7IA4.js → chunk-5WGOPKHZ.js} +2 -2
- package/dist/{chunk-5FMDEEV7.js → chunk-6G4FMCXS.js} +8 -8
- package/dist/{chunk-PXJDALVM.js → chunk-6Y4QIIQD.js} +2 -2
- package/dist/{chunk-NC6CLKIB.js → chunk-7ILVQDUT.js} +2 -2
- package/dist/{chunk-7TJVDU2S.js → chunk-A5P7Y4SB.js} +3 -3
- package/dist/{chunk-UK2HVVTQ.js → chunk-C5O7Z4P7.js} +2 -2
- package/dist/{chunk-TDXJYLRP.js → chunk-C62JS6A7.js} +2 -2
- package/dist/{chunk-MBNECNPL.js → chunk-D55LWKBW.js} +15 -10
- package/dist/{chunk-MBNECNPL.js.map → chunk-D55LWKBW.js.map} +1 -1
- package/dist/{chunk-DOT3TG4T.js → chunk-DHWEXVCJ.js} +3 -3
- package/dist/{chunk-4LMP452D.js → chunk-GJDNMK3G.js} +7 -7
- package/dist/{chunk-4DXZJJK3.js → chunk-GX3QJX7X.js} +2 -2
- package/dist/{chunk-ETEGV2NG.js → chunk-H5G4N5UL.js} +2 -2
- package/dist/{chunk-CZC4FIVH.js → chunk-IJXJGQUY.js} +4 -4
- package/dist/{chunk-D2SKFK4W.js → chunk-JIZ7B6FX.js} +5 -5
- package/dist/{chunk-V7EFU7LB.js → chunk-MB2T54VO.js} +6 -2
- package/dist/chunk-MB2T54VO.js.map +1 -0
- package/dist/{chunk-TZGM6BXE.js → chunk-NTBGFI5Q.js} +3 -3
- package/dist/{chunk-3BKFXSHM.js → chunk-OIBSPO6Q.js} +3 -3
- package/dist/{chunk-6YLKVLI4.js → chunk-P3XQMXIW.js} +35 -35
- package/dist/{chunk-VYWHIQHX.js → chunk-P4QFJ7OX.js} +2 -2
- package/dist/{chunk-TOBIDJ3V.js → chunk-PPZTSOSH.js} +8 -8
- package/dist/{chunk-XFQMSO3R.js → chunk-PQCKQKKP.js} +5 -5
- package/dist/{chunk-Y3CGQUCQ.js → chunk-Q4L2DXA4.js} +5 -5
- package/dist/{chunk-YKEBDGCK.js → chunk-QWI4VF5L.js} +2 -2
- package/dist/{chunk-JF7YUXZX.js → chunk-R3ZNOB3V.js} +2 -2
- package/dist/{chunk-6QBCTIKD.js → chunk-RYJ2VU7E.js} +2 -2
- package/dist/{chunk-V24NAR5C.js → chunk-RYOQ3WJR.js} +2 -2
- package/dist/{chunk-ZYL6RNBZ.js → chunk-SJGNFNFT.js} +5 -5
- package/dist/{chunk-ZHVVLJFQ.js → chunk-SQ35C5SD.js} +4 -4
- package/dist/{chunk-7KHCQPHO.js → chunk-YSE3VQ4A.js} +343 -314
- package/dist/chunk-YSE3VQ4A.js.map +1 -0
- package/dist/{chunk-ISF7BEHM.js → chunk-YUPUHMWP.js} +4 -4
- package/dist/{cli-circuit-breaker-AR6SXY4G.js → cli-circuit-breaker-YKY7NCQ5.js} +3 -3
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +41 -41
- package/dist/{composite-router-NQ4UCMV6.js → composite-router-63QDM6CQ.js} +2 -2
- package/dist/{consensus-vote-ILSS373K.js → consensus-vote-C7QTJJH7.js} +16 -16
- package/dist/{consensus-vote-types-BC2vWQKe.d.ts → consensus-vote-types-b-KD-0g_.d.ts} +102 -0
- package/dist/{context-retriever-CCGMXTGJ.js → context-retriever-DIKQ7QZA.js} +8 -8
- package/dist/{doctor-deep-VMTFQG7N.js → doctor-deep-JVUEAUAG.js} +3 -3
- package/dist/{doctor-live-IAQOG6LI.js → doctor-live-CT2SKNLI.js} +9 -9
- package/dist/{expert-bridge-JOM5P4I4.js → expert-bridge-G5WXRNUH.js} +4 -4
- package/dist/{factory-6A6TGK6D.js → factory-72QUNWLV.js} +5 -5
- package/dist/{factory-MYQRDKOJ.js → factory-LYRONJ3P.js} +9 -9
- package/dist/{improvement-review-CFBMX6BL.js → improvement-review-CJMYGUDM.js} +5 -5
- package/dist/index.d.ts +10 -2
- package/dist/index.js +30 -30
- package/dist/{init-opencode-J7GUKZF4.js → init-opencode-UATS6Q6W.js} +6 -6
- package/dist/{issue-triage-T3L7CAUV.js → issue-triage-CZWWJSOT.js} +6 -6
- package/dist/{pr-reviewer-helpers-XMTT5K4E.js → pr-reviewer-helpers-OLEK46AR.js} +4 -4
- package/dist/{registry-command-5QPDC5SH.js → registry-command-FKRZFXYQ.js} +2 -2
- package/dist/{repo-security-plan-WQG7G4H6.js → repo-security-plan-BULZVX3A.js} +3 -3
- package/dist/{research-helpers-synthesize-6FPLB3UK.js → research-helpers-synthesize-LTMSKVUB.js} +4 -4
- package/dist/{routing-memory-HNZRMLXC.js → routing-memory-H7DT3HVY.js} +2 -2
- package/dist/{session-memory-SXYFTZYM.js → session-memory-UTPN4MCS.js} +3 -3
- package/dist/{setup-command-X7EJ7LBU.js → setup-command-TGGSIV6F.js} +14 -14
- package/dist/{setup-config-4UPPIMTI.js → setup-config-WIXJT5YV.js} +3 -3
- package/dist/{setup-custom-api-U5WEZRQO.js → setup-custom-api-36BFRFWO.js} +4 -4
- package/dist/{tool-memory-BT7VS5N5.js → tool-memory-YQTO4WUG.js} +5 -5
- package/dist/{unified-registry-L2T5UJHQ.js → unified-registry-N2BQJSLK.js} +10 -10
- package/dist/{weather-report-2T3OIAJS.js → weather-report-AOX6RULO.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-7KHCQPHO.js.map +0 -1
- package/dist/chunk-V7EFU7LB.js.map +0 -1
- /package/dist/{child-mcp-config-RERUXZJS.js.map → child-mcp-config-R4GQMDAV.js.map} +0 -0
- /package/dist/{chunk-KEO6QJE6.js.map → chunk-2XFBHREJ.js.map} +0 -0
- /package/dist/{chunk-J2F5E3DF.js.map → chunk-5CXAYPSU.js.map} +0 -0
- /package/dist/{chunk-WT6JCD3E.js.map → chunk-5LFB77LA.js.map} +0 -0
- /package/dist/{chunk-JFZP7IA4.js.map → chunk-5WGOPKHZ.js.map} +0 -0
- /package/dist/{chunk-5FMDEEV7.js.map → chunk-6G4FMCXS.js.map} +0 -0
- /package/dist/{chunk-PXJDALVM.js.map → chunk-6Y4QIIQD.js.map} +0 -0
- /package/dist/{chunk-NC6CLKIB.js.map → chunk-7ILVQDUT.js.map} +0 -0
- /package/dist/{chunk-7TJVDU2S.js.map → chunk-A5P7Y4SB.js.map} +0 -0
- /package/dist/{chunk-UK2HVVTQ.js.map → chunk-C5O7Z4P7.js.map} +0 -0
- /package/dist/{chunk-TDXJYLRP.js.map → chunk-C62JS6A7.js.map} +0 -0
- /package/dist/{chunk-DOT3TG4T.js.map → chunk-DHWEXVCJ.js.map} +0 -0
- /package/dist/{chunk-4LMP452D.js.map → chunk-GJDNMK3G.js.map} +0 -0
- /package/dist/{chunk-4DXZJJK3.js.map → chunk-GX3QJX7X.js.map} +0 -0
- /package/dist/{chunk-ETEGV2NG.js.map → chunk-H5G4N5UL.js.map} +0 -0
- /package/dist/{chunk-CZC4FIVH.js.map → chunk-IJXJGQUY.js.map} +0 -0
- /package/dist/{chunk-D2SKFK4W.js.map → chunk-JIZ7B6FX.js.map} +0 -0
- /package/dist/{chunk-TZGM6BXE.js.map → chunk-NTBGFI5Q.js.map} +0 -0
- /package/dist/{chunk-3BKFXSHM.js.map → chunk-OIBSPO6Q.js.map} +0 -0
- /package/dist/{chunk-6YLKVLI4.js.map → chunk-P3XQMXIW.js.map} +0 -0
- /package/dist/{chunk-VYWHIQHX.js.map → chunk-P4QFJ7OX.js.map} +0 -0
- /package/dist/{chunk-TOBIDJ3V.js.map → chunk-PPZTSOSH.js.map} +0 -0
- /package/dist/{chunk-XFQMSO3R.js.map → chunk-PQCKQKKP.js.map} +0 -0
- /package/dist/{chunk-Y3CGQUCQ.js.map → chunk-Q4L2DXA4.js.map} +0 -0
- /package/dist/{chunk-YKEBDGCK.js.map → chunk-QWI4VF5L.js.map} +0 -0
- /package/dist/{chunk-JF7YUXZX.js.map → chunk-R3ZNOB3V.js.map} +0 -0
- /package/dist/{chunk-6QBCTIKD.js.map → chunk-RYJ2VU7E.js.map} +0 -0
- /package/dist/{chunk-V24NAR5C.js.map → chunk-RYOQ3WJR.js.map} +0 -0
- /package/dist/{chunk-ZYL6RNBZ.js.map → chunk-SJGNFNFT.js.map} +0 -0
- /package/dist/{chunk-ZHVVLJFQ.js.map → chunk-SQ35C5SD.js.map} +0 -0
- /package/dist/{chunk-ISF7BEHM.js.map → chunk-YUPUHMWP.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-AR6SXY4G.js.map → cli-circuit-breaker-YKY7NCQ5.js.map} +0 -0
- /package/dist/{composite-router-NQ4UCMV6.js.map → composite-router-63QDM6CQ.js.map} +0 -0
- /package/dist/{consensus-vote-ILSS373K.js.map → consensus-vote-C7QTJJH7.js.map} +0 -0
- /package/dist/{context-retriever-CCGMXTGJ.js.map → context-retriever-DIKQ7QZA.js.map} +0 -0
- /package/dist/{doctor-deep-VMTFQG7N.js.map → doctor-deep-JVUEAUAG.js.map} +0 -0
- /package/dist/{doctor-live-IAQOG6LI.js.map → doctor-live-CT2SKNLI.js.map} +0 -0
- /package/dist/{expert-bridge-JOM5P4I4.js.map → expert-bridge-G5WXRNUH.js.map} +0 -0
- /package/dist/{factory-6A6TGK6D.js.map → factory-72QUNWLV.js.map} +0 -0
- /package/dist/{factory-MYQRDKOJ.js.map → factory-LYRONJ3P.js.map} +0 -0
- /package/dist/{improvement-review-CFBMX6BL.js.map → improvement-review-CJMYGUDM.js.map} +0 -0
- /package/dist/{init-opencode-J7GUKZF4.js.map → init-opencode-UATS6Q6W.js.map} +0 -0
- /package/dist/{issue-triage-T3L7CAUV.js.map → issue-triage-CZWWJSOT.js.map} +0 -0
- /package/dist/{pr-reviewer-helpers-XMTT5K4E.js.map → pr-reviewer-helpers-OLEK46AR.js.map} +0 -0
- /package/dist/{registry-command-5QPDC5SH.js.map → registry-command-FKRZFXYQ.js.map} +0 -0
- /package/dist/{repo-security-plan-WQG7G4H6.js.map → repo-security-plan-BULZVX3A.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-6FPLB3UK.js.map → research-helpers-synthesize-LTMSKVUB.js.map} +0 -0
- /package/dist/{routing-memory-HNZRMLXC.js.map → routing-memory-H7DT3HVY.js.map} +0 -0
- /package/dist/{session-memory-SXYFTZYM.js.map → session-memory-UTPN4MCS.js.map} +0 -0
- /package/dist/{setup-command-X7EJ7LBU.js.map → setup-command-TGGSIV6F.js.map} +0 -0
- /package/dist/{setup-config-4UPPIMTI.js.map → setup-config-WIXJT5YV.js.map} +0 -0
- /package/dist/{setup-custom-api-U5WEZRQO.js.map → setup-custom-api-36BFRFWO.js.map} +0 -0
- /package/dist/{tool-memory-BT7VS5N5.js.map → tool-memory-YQTO4WUG.js.map} +0 -0
- /package/dist/{unified-registry-L2T5UJHQ.js.map → unified-registry-N2BQJSLK.js.map} +0 -0
- /package/dist/{weather-report-2T3OIAJS.js.map → weather-report-AOX6RULO.js.map} +0 -0
|
@@ -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';\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":";;;;;;;;AA0BA,SAAS,gBAAgB,YAAY,WAAW,cAAc,mBAAmB;AACjF,SAAS,SAAS,YAAY;AA+EvB,SAAS,kBACd,SACA,aACA,cACY;AAGZ,QAAM,QAAQ,mBAAmB,EAAE,SAAS,OAAO;AACnD,QAAM,aAAa,MAAM,gBAAgB;AACzC,QAAM,aAAa,MAAM,eAAe,SAAY,EAAE,YAAY,MAAM,WAAW,IAAI,CAAC;AACxF,MAAI,MAAM,YAAY,QAAW;AAC/B,WAAO,EAAE,SAAS,GAAG,QAAQ,OAAO,YAAY,GAAG,WAAW;AAAA,EAChE;AAIA,QAAM,WAAW,KAAK;AAAA,IACpB,cAAc,MAAM,QAAQ,aAAa,eAAe,MAAM,QAAQ;AAAA,EACxE;AACA,SAAO,EAAE,SAAS,WAAW,KAAW,QAAQ,MAAM,YAAY,GAAG,WAAW;AAClF;AAaO,SAAS,gBAAgB,OAAa,oBAAI,KAAK,GAAW;AAC/D,QAAM,OAAO,KAAK,eAAe;AACjC,QAAM,QAAQ,OAAO,KAAK,YAAY,IAAI,CAAC,EAAE,SAAS,GAAG,GAAG;AAC5D,SAAO,KAAK,gBAAgB,GAAG,SAAS,SAAS,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ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,eAAe;AAC1D,UAAM,oBAAoB,iBAAiB,IAAI,eAAe,eAAe;AAC7E,YAAQ,KAAK;AAAA,MACX;AAAA,MACA,YAAY,MAAM,CAAC,GAAG,cAAc;AAAA,MACpC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AACA,SAAO,QAAQ,KAAK,CAAC,GAAG,MAAM,EAAE,eAAe,EAAE,YAAY;AAC/D;","names":[]}
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|