nexus-agents 4.29.7 → 4.29.8

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.
Files changed (124) hide show
  1. package/dist/{child-mcp-config-QOBQRH24.js → child-mcp-config-6V3VVIRI.js} +2 -2
  2. package/dist/{chunk-SX2K66SG.js → chunk-2FVC6EBQ.js} +2 -2
  3. package/dist/{chunk-KYTV2JFH.js → chunk-43DT2MDF.js} +4 -4
  4. package/dist/{chunk-WJ5TFKDF.js → chunk-53UUQ6TE.js} +31 -6
  5. package/dist/chunk-53UUQ6TE.js.map +1 -0
  6. package/dist/{chunk-SFZ67DTA.js → chunk-56V5NM2A.js} +2 -2
  7. package/dist/{chunk-VOXVWYD4.js → chunk-5I6WHO2T.js} +8 -8
  8. package/dist/{chunk-CQHUNYJN.js → chunk-5OEEY7PB.js} +2 -2
  9. package/dist/{chunk-3IM3OPZH.js → chunk-6PNL5ETD.js} +2 -2
  10. package/dist/{chunk-Z22LKOBY.js → chunk-7J6WOIBD.js} +2 -2
  11. package/dist/{chunk-WB54CVTG.js → chunk-7TPNJGRU.js} +4 -4
  12. package/dist/{chunk-GXZDUDSD.js → chunk-7WGDDFRR.js} +2 -2
  13. package/dist/{chunk-A4ISLEV6.js → chunk-BX3QH6PC.js} +7 -7
  14. package/dist/{chunk-4ZDNZAGJ.js → chunk-CRJMMNEZ.js} +2 -2
  15. package/dist/{chunk-GZUHLCRE.js → chunk-DUVPQJE7.js} +2 -2
  16. package/dist/{chunk-FWRLD7W7.js → chunk-EZCQ5IJC.js} +6 -6
  17. package/dist/{chunk-ESNNN75Z.js → chunk-FKOS3KV2.js} +3 -3
  18. package/dist/{chunk-KXNT76HR.js → chunk-JJ4DJTP5.js} +2 -2
  19. package/dist/{chunk-ISA73Z6I.js → chunk-JRJIPY7Q.js} +2 -2
  20. package/dist/{chunk-K77KZHXP.js → chunk-JTBLWGRZ.js} +2 -2
  21. package/dist/{chunk-GFNBH2PE.js → chunk-K2MVLVCR.js} +5 -5
  22. package/dist/{chunk-XP5BAFPJ.js → chunk-L3PZGUSD.js} +3 -3
  23. package/dist/{chunk-FQUGR66Z.js → chunk-L4I3MKXA.js} +2 -2
  24. package/dist/chunk-L4KMKIMV.js +7 -0
  25. package/dist/{chunk-XM7LFDFE.js → chunk-LBHR2IAE.js} +4 -4
  26. package/dist/{chunk-JPTB4M6V.js → chunk-OR4C6JXA.js} +3 -3
  27. package/dist/{chunk-S4TJBGI2.js → chunk-P433WM3V.js} +2 -2
  28. package/dist/{chunk-3RZJU5JS.js → chunk-Q5EQTXNF.js} +5 -5
  29. package/dist/{chunk-WRKUNUCA.js → chunk-R5PN2G3U.js} +8 -8
  30. package/dist/{chunk-2DBVUHFA.js → chunk-RBXRJK5P.js} +2 -2
  31. package/dist/{chunk-WIB7TIDY.js → chunk-UXIASVKX.js} +5 -27
  32. package/dist/chunk-UXIASVKX.js.map +1 -0
  33. package/dist/{chunk-46F3UEKW.js → chunk-VB2VPZ6T.js} +35 -35
  34. package/dist/{chunk-ULZFVZFW.js → chunk-XP7ZQTCJ.js} +2 -2
  35. package/dist/{chunk-UPKYWLPL.js → chunk-YANA6P5Y.js} +7 -7
  36. package/dist/{chunk-WYKMINTU.js → chunk-YGOFNCIM.js} +4 -4
  37. package/dist/{cli-circuit-breaker-PQ2FHTJA.js → cli-circuit-breaker-MV45AOXB.js} +3 -3
  38. package/dist/cli.js +41 -41
  39. package/dist/{composite-router-SN7T6PM4.js → composite-router-QBEKQOTT.js} +2 -2
  40. package/dist/{consensus-vote-RJBBB25Z.js → consensus-vote-WYVP3W7E.js} +17 -17
  41. package/dist/{context-retriever-O7ULA6GX.js → context-retriever-VMYUWH65.js} +8 -8
  42. package/dist/{doctor-deep-FC5IBSTN.js → doctor-deep-QBZPVNED.js} +3 -3
  43. package/dist/{doctor-live-EBBM5XGU.js → doctor-live-VRTQ32GF.js} +9 -9
  44. package/dist/{expert-bridge-IARKL3BV.js → expert-bridge-EFV53HJF.js} +4 -4
  45. package/dist/{factory-4EUZKQ3C.js → factory-3KWRSIWC.js} +5 -5
  46. package/dist/{factory-P2G2A5RD.js → factory-62D7CUZM.js} +9 -9
  47. package/dist/{improvement-review-I26ZEHXQ.js → improvement-review-HIPZDX3S.js} +6 -6
  48. package/dist/index.js +31 -31
  49. package/dist/{init-opencode-KWKRUK5D.js → init-opencode-ROVXEFZN.js} +6 -6
  50. package/dist/issue-triage-DDPGH74F.js +17 -0
  51. package/dist/{pr-reviewer-helpers-RGCQ35FL.js → pr-reviewer-helpers-MXC72RTN.js} +4 -4
  52. package/dist/{registry-command-EMN2WD4V.js → registry-command-2MP76REH.js} +2 -2
  53. package/dist/{repo-security-plan-WQCQRNPZ.js → repo-security-plan-CU4GMXVC.js} +3 -3
  54. package/dist/{research-helpers-synthesize-UPDIAIQH.js → research-helpers-synthesize-JRLXQLUB.js} +4 -4
  55. package/dist/{routing-memory-2XTCURFY.js → routing-memory-UMUJZTPR.js} +2 -2
  56. package/dist/{session-memory-6VZAC4FV.js → session-memory-TTORERCM.js} +3 -3
  57. package/dist/{setup-config-SMI2G6UE.js → setup-config-5SKWNAV4.js} +3 -3
  58. package/dist/{setup-custom-api-2AEMLGGD.js → setup-custom-api-OKGPJUIZ.js} +4 -4
  59. package/dist/setup-data-dir-66FLYLML.js +29 -0
  60. package/dist/{tool-memory-7BKRQ64B.js → tool-memory-GBFJGJSJ.js} +5 -5
  61. package/dist/{unified-registry-6DVJR722.js → unified-registry-OSDOMHCB.js} +10 -10
  62. package/dist/{weather-report-UUPXHSXM.js → weather-report-TCVP62XN.js} +2 -2
  63. package/package.json +1 -1
  64. package/dist/chunk-EE53G5Z4.js +0 -7
  65. package/dist/chunk-WIB7TIDY.js.map +0 -1
  66. package/dist/chunk-WJ5TFKDF.js.map +0 -1
  67. package/dist/issue-triage-SDH7RVQ6.js +0 -17
  68. package/dist/setup-data-dir-A6DPGVXF.js +0 -29
  69. /package/dist/{child-mcp-config-QOBQRH24.js.map → child-mcp-config-6V3VVIRI.js.map} +0 -0
  70. /package/dist/{chunk-SX2K66SG.js.map → chunk-2FVC6EBQ.js.map} +0 -0
  71. /package/dist/{chunk-KYTV2JFH.js.map → chunk-43DT2MDF.js.map} +0 -0
  72. /package/dist/{chunk-SFZ67DTA.js.map → chunk-56V5NM2A.js.map} +0 -0
  73. /package/dist/{chunk-VOXVWYD4.js.map → chunk-5I6WHO2T.js.map} +0 -0
  74. /package/dist/{chunk-CQHUNYJN.js.map → chunk-5OEEY7PB.js.map} +0 -0
  75. /package/dist/{chunk-3IM3OPZH.js.map → chunk-6PNL5ETD.js.map} +0 -0
  76. /package/dist/{chunk-Z22LKOBY.js.map → chunk-7J6WOIBD.js.map} +0 -0
  77. /package/dist/{chunk-WB54CVTG.js.map → chunk-7TPNJGRU.js.map} +0 -0
  78. /package/dist/{chunk-GXZDUDSD.js.map → chunk-7WGDDFRR.js.map} +0 -0
  79. /package/dist/{chunk-A4ISLEV6.js.map → chunk-BX3QH6PC.js.map} +0 -0
  80. /package/dist/{chunk-4ZDNZAGJ.js.map → chunk-CRJMMNEZ.js.map} +0 -0
  81. /package/dist/{chunk-GZUHLCRE.js.map → chunk-DUVPQJE7.js.map} +0 -0
  82. /package/dist/{chunk-FWRLD7W7.js.map → chunk-EZCQ5IJC.js.map} +0 -0
  83. /package/dist/{chunk-ESNNN75Z.js.map → chunk-FKOS3KV2.js.map} +0 -0
  84. /package/dist/{chunk-KXNT76HR.js.map → chunk-JJ4DJTP5.js.map} +0 -0
  85. /package/dist/{chunk-ISA73Z6I.js.map → chunk-JRJIPY7Q.js.map} +0 -0
  86. /package/dist/{chunk-K77KZHXP.js.map → chunk-JTBLWGRZ.js.map} +0 -0
  87. /package/dist/{chunk-GFNBH2PE.js.map → chunk-K2MVLVCR.js.map} +0 -0
  88. /package/dist/{chunk-XP5BAFPJ.js.map → chunk-L3PZGUSD.js.map} +0 -0
  89. /package/dist/{chunk-FQUGR66Z.js.map → chunk-L4I3MKXA.js.map} +0 -0
  90. /package/dist/{chunk-EE53G5Z4.js.map → chunk-L4KMKIMV.js.map} +0 -0
  91. /package/dist/{chunk-XM7LFDFE.js.map → chunk-LBHR2IAE.js.map} +0 -0
  92. /package/dist/{chunk-JPTB4M6V.js.map → chunk-OR4C6JXA.js.map} +0 -0
  93. /package/dist/{chunk-S4TJBGI2.js.map → chunk-P433WM3V.js.map} +0 -0
  94. /package/dist/{chunk-3RZJU5JS.js.map → chunk-Q5EQTXNF.js.map} +0 -0
  95. /package/dist/{chunk-WRKUNUCA.js.map → chunk-R5PN2G3U.js.map} +0 -0
  96. /package/dist/{chunk-2DBVUHFA.js.map → chunk-RBXRJK5P.js.map} +0 -0
  97. /package/dist/{chunk-46F3UEKW.js.map → chunk-VB2VPZ6T.js.map} +0 -0
  98. /package/dist/{chunk-ULZFVZFW.js.map → chunk-XP7ZQTCJ.js.map} +0 -0
  99. /package/dist/{chunk-UPKYWLPL.js.map → chunk-YANA6P5Y.js.map} +0 -0
  100. /package/dist/{chunk-WYKMINTU.js.map → chunk-YGOFNCIM.js.map} +0 -0
  101. /package/dist/{cli-circuit-breaker-PQ2FHTJA.js.map → cli-circuit-breaker-MV45AOXB.js.map} +0 -0
  102. /package/dist/{composite-router-SN7T6PM4.js.map → composite-router-QBEKQOTT.js.map} +0 -0
  103. /package/dist/{consensus-vote-RJBBB25Z.js.map → consensus-vote-WYVP3W7E.js.map} +0 -0
  104. /package/dist/{context-retriever-O7ULA6GX.js.map → context-retriever-VMYUWH65.js.map} +0 -0
  105. /package/dist/{doctor-deep-FC5IBSTN.js.map → doctor-deep-QBZPVNED.js.map} +0 -0
  106. /package/dist/{doctor-live-EBBM5XGU.js.map → doctor-live-VRTQ32GF.js.map} +0 -0
  107. /package/dist/{expert-bridge-IARKL3BV.js.map → expert-bridge-EFV53HJF.js.map} +0 -0
  108. /package/dist/{factory-4EUZKQ3C.js.map → factory-3KWRSIWC.js.map} +0 -0
  109. /package/dist/{factory-P2G2A5RD.js.map → factory-62D7CUZM.js.map} +0 -0
  110. /package/dist/{improvement-review-I26ZEHXQ.js.map → improvement-review-HIPZDX3S.js.map} +0 -0
  111. /package/dist/{init-opencode-KWKRUK5D.js.map → init-opencode-ROVXEFZN.js.map} +0 -0
  112. /package/dist/{issue-triage-SDH7RVQ6.js.map → issue-triage-DDPGH74F.js.map} +0 -0
  113. /package/dist/{pr-reviewer-helpers-RGCQ35FL.js.map → pr-reviewer-helpers-MXC72RTN.js.map} +0 -0
  114. /package/dist/{registry-command-EMN2WD4V.js.map → registry-command-2MP76REH.js.map} +0 -0
  115. /package/dist/{repo-security-plan-WQCQRNPZ.js.map → repo-security-plan-CU4GMXVC.js.map} +0 -0
  116. /package/dist/{research-helpers-synthesize-UPDIAIQH.js.map → research-helpers-synthesize-JRLXQLUB.js.map} +0 -0
  117. /package/dist/{routing-memory-2XTCURFY.js.map → routing-memory-UMUJZTPR.js.map} +0 -0
  118. /package/dist/{session-memory-6VZAC4FV.js.map → session-memory-TTORERCM.js.map} +0 -0
  119. /package/dist/{setup-config-SMI2G6UE.js.map → setup-config-5SKWNAV4.js.map} +0 -0
  120. /package/dist/{setup-custom-api-2AEMLGGD.js.map → setup-custom-api-OKGPJUIZ.js.map} +0 -0
  121. /package/dist/{setup-data-dir-A6DPGVXF.js.map → setup-data-dir-66FLYLML.js.map} +0 -0
  122. /package/dist/{tool-memory-7BKRQ64B.js.map → tool-memory-GBFJGJSJ.js.map} +0 -0
  123. /package/dist/{unified-registry-6DVJR722.js.map → unified-registry-OSDOMHCB.js.map} +0 -0
  124. /package/dist/{weather-report-UUPXHSXM.js.map → weather-report-TCVP62XN.js.map} +0 -0
@@ -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 { 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"],"mappings":"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","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  generateSecurityPlan
3
- } from "./chunk-GZUHLCRE.js";
3
+ } from "./chunk-DUVPQJE7.js";
4
4
  import {
5
5
  analyzeGitHubRepo
6
6
  } from "./chunk-HFOQKCD2.js";
@@ -21,10 +21,10 @@ import {
21
21
  import {
22
22
  DEFAULT_TASK_TTL_MS,
23
23
  clampTaskTtl
24
- } from "./chunk-A4ISLEV6.js";
24
+ } from "./chunk-BX3QH6PC.js";
25
25
  import {
26
26
  executeExpert
27
- } from "./chunk-UPKYWLPL.js";
27
+ } from "./chunk-YANA6P5Y.js";
28
28
  import {
29
29
  JobStatusSchema,
30
30
  VOTER_ROLES,
@@ -47,24 +47,24 @@ import {
47
47
  simulationDeniedResult,
48
48
  toJobSummary,
49
49
  writeJobCancelled
50
- } from "./chunk-WRKUNUCA.js";
50
+ } from "./chunk-R5PN2G3U.js";
51
51
  import {
52
52
  allOf
53
53
  } from "./chunk-OQB3XC5O.js";
54
54
  import {
55
55
  normalizeTopicToCanonical,
56
56
  synthesizeResearch
57
- } from "./chunk-JPTB4M6V.js";
57
+ } from "./chunk-OR4C6JXA.js";
58
58
  import {
59
59
  IssueTriage
60
- } from "./chunk-FWRLD7W7.js";
60
+ } from "./chunk-EZCQ5IJC.js";
61
61
  import {
62
62
  resolveEnvMode,
63
63
  sanitizeInput
64
- } from "./chunk-3IM3OPZH.js";
64
+ } from "./chunk-6PNL5ETD.js";
65
65
  import {
66
66
  withPrerequisite
67
- } from "./chunk-XP5BAFPJ.js";
67
+ } from "./chunk-L3PZGUSD.js";
68
68
  import {
69
69
  NOOP_NOTIFIER,
70
70
  RateLimiter,
@@ -88,18 +88,18 @@ import {
88
88
  withAuditTrail,
89
89
  withProgressHeartbeat,
90
90
  wrapToolWithTimeout
91
- } from "./chunk-WB54CVTG.js";
91
+ } from "./chunk-7TPNJGRU.js";
92
92
  import {
93
93
  createAuditTrail,
94
94
  createGraphAuditBridge,
95
95
  emitPipelinePolicyEvent
96
- } from "./chunk-ULZFVZFW.js";
96
+ } from "./chunk-XP7ZQTCJ.js";
97
97
  import {
98
98
  EventTopics,
99
99
  createEvent,
100
100
  getGlobalEventBus,
101
101
  getGlobalRegistry
102
- } from "./chunk-KYTV2JFH.js";
102
+ } from "./chunk-43DT2MDF.js";
103
103
  import {
104
104
  IDENTIFIER_RE,
105
105
  LANG_VALUES,
@@ -132,29 +132,29 @@ import {
132
132
  parseRegistry,
133
133
  sourceExistsInRegistry,
134
134
  summarizeContextForPrompt
135
- } from "./chunk-3RZJU5JS.js";
135
+ } from "./chunk-Q5EQTXNF.js";
136
136
  import {
137
137
  loadPapersRegistry,
138
138
  loadTechniquesRegistry,
139
139
  resolveInsideRoot
140
- } from "./chunk-SFZ67DTA.js";
140
+ } from "./chunk-56V5NM2A.js";
141
141
  import {
142
142
  getTokenEnvVars,
143
143
  resolveToken
144
- } from "./chunk-KXNT76HR.js";
144
+ } from "./chunk-JJ4DJTP5.js";
145
145
  import {
146
146
  DEFAULT_RELEVANCE_CONFIG,
147
147
  MemoryImportance,
148
148
  calculateTextJaccardSimilarity,
149
149
  getToolMemory
150
- } from "./chunk-WYKMINTU.js";
150
+ } from "./chunk-YGOFNCIM.js";
151
151
  import {
152
152
  STOPWORDS,
153
153
  truncateWithInfo
154
154
  } from "./chunk-6T3EPABN.js";
155
155
  import {
156
156
  createSessionMemory
157
- } from "./chunk-S4TJBGI2.js";
157
+ } from "./chunk-P433WM3V.js";
158
158
  import {
159
159
  BUILT_IN_EXPERTS,
160
160
  BuiltInExpertTypeSchema,
@@ -172,25 +172,25 @@ import {
172
172
  getAvailableClis,
173
173
  sleep,
174
174
  withTimeout
175
- } from "./chunk-VOXVWYD4.js";
175
+ } from "./chunk-5I6WHO2T.js";
176
176
  import {
177
177
  BaseAdapter,
178
178
  createStream,
179
179
  requireApiKey,
180
180
  validateApiKeyPresence
181
- } from "./chunk-CQHUNYJN.js";
181
+ } from "./chunk-5OEEY7PB.js";
182
182
  import {
183
183
  DEFAULTS
184
- } from "./chunk-Z22LKOBY.js";
184
+ } from "./chunk-7J6WOIBD.js";
185
185
  import {
186
186
  getAvailabilityCache,
187
187
  getCliForModelId,
188
188
  resolveFallback
189
- } from "./chunk-SX2K66SG.js";
189
+ } from "./chunk-2FVC6EBQ.js";
190
190
  import {
191
191
  generateHyphenId,
192
192
  generateUUID
193
- } from "./chunk-ISA73Z6I.js";
193
+ } from "./chunk-JRJIPY7Q.js";
194
194
  import {
195
195
  AGENT_ROUTER_TIMEOUTS,
196
196
  API_TIMEOUTS,
@@ -294,7 +294,7 @@ import {
294
294
  selectStrategyByManifest,
295
295
  toExpertTaskAnalysisResult,
296
296
  withStep
297
- } from "./chunk-WJ5TFKDF.js";
297
+ } from "./chunk-53UUQ6TE.js";
298
298
  import {
299
299
  ensureLearningDir,
300
300
  getMetaOutcomesFile,
@@ -29698,7 +29698,7 @@ function execIdFields(executionId) {
29698
29698
  async function populateUnifiedContextOnState(state, options) {
29699
29699
  const taskCandidate = state["task"];
29700
29700
  if (typeof taskCandidate !== "string" || taskCandidate === "") return;
29701
- const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-O7ULA6GX.js");
29701
+ const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-VMYUWH65.js");
29702
29702
  const category = inferTaskCategory2(taskCandidate);
29703
29703
  const executionId = options?.executionId;
29704
29704
  const execFields = execIdFields(executionId);
@@ -45495,7 +45495,7 @@ async function tryIssueTriage(task) {
45495
45495
  try {
45496
45496
  const issueMatch = task.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);
45497
45497
  if (issueMatch === null) return null;
45498
- const { createIssueTriage } = await import("./issue-triage-SDH7RVQ6.js");
45498
+ const { createIssueTriage } = await import("./issue-triage-DDPGH74F.js");
45499
45499
  const triage = createIssueTriage();
45500
45500
  const owner = issueMatch[1] ?? "";
45501
45501
  const num = issueMatch[2] ?? "";
@@ -45523,7 +45523,7 @@ var VALID_TEMPLATES = /* @__PURE__ */ new Set([
45523
45523
  ]);
45524
45524
  async function classifyWithLLM(task) {
45525
45525
  try {
45526
- const { executeExpert: executeExpert2 } = await import("./expert-bridge-IARKL3BV.js");
45526
+ const { executeExpert: executeExpert2 } = await import("./expert-bridge-EFV53HJF.js");
45527
45527
  const prompt = [
45528
45528
  "Classify this task into exactly one pipeline template.",
45529
45529
  "Templates: dev (implementation/bug fix/refactor), research (investigate/evaluate/compare),",
@@ -47304,7 +47304,7 @@ var memoryInitPromise = null;
47304
47304
  async function initPipelineMemory() {
47305
47305
  if (cachedMemory !== null) return cachedMemory;
47306
47306
  try {
47307
- const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-6VZAC4FV.js");
47307
+ const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-TTORERCM.js");
47308
47308
  const { getLearningDir } = await import("./learning-persistence-7O5QYDM7.js");
47309
47309
  const mem = createSessionMemory2(getLearningDir());
47310
47310
  mem.startSession(`pipeline-${String(getTimeProvider().now())}`);
@@ -47366,7 +47366,7 @@ function recordRoutingExperience(category, success, durationMs, tokensUsed = 0,
47366
47366
  callRecord(routingMemoryCache);
47367
47367
  return;
47368
47368
  }
47369
- routingMemoryInitPromise ??= import("./routing-memory-2XTCURFY.js").then(({ createRoutingMemory }) => {
47369
+ routingMemoryInitPromise ??= import("./routing-memory-UMUJZTPR.js").then(({ createRoutingMemory }) => {
47370
47370
  routingMemoryCache ??= createRoutingMemory();
47371
47371
  return routingMemoryCache;
47372
47372
  }).catch((error) => {
@@ -47400,7 +47400,7 @@ ${text}` : "";
47400
47400
  }
47401
47401
  async function getWeatherContext() {
47402
47402
  try {
47403
- const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-UUPXHSXM.js");
47403
+ const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-TCVP62XN.js");
47404
47404
  const report = generateWeatherReport2({ includeAdaptive: true });
47405
47405
  const mappings = "recommendedMappings" in report ? report.recommendedMappings : [];
47406
47406
  if (!Array.isArray(mappings) || mappings.length === 0) return "";
@@ -47418,7 +47418,7 @@ ${lines}
47418
47418
  }
47419
47419
  async function getMemoryContext(task) {
47420
47420
  try {
47421
- const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-6VZAC4FV.js");
47421
+ const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-TTORERCM.js");
47422
47422
  const { getLearningDir } = await import("./learning-persistence-7O5QYDM7.js");
47423
47423
  const memory = createSessionMemory2(getLearningDir(), { maxLearningsInContext: 10 });
47424
47424
  const learnings = memory.searchLearnings(task.slice(0, 200));
@@ -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-RJBBB25Z.js");
47540
+ const { executeVoting } = await import("./consensus-vote-WYVP3W7E.js");
47541
47541
  const votingResult = await executeVoting(
47542
47542
  {
47543
47543
  proposal: buildVoteProposal(plan, research),
@@ -47976,7 +47976,7 @@ async function searchCodebaseForTask(task) {
47976
47976
  }
47977
47977
  async function queryResearchRegistry(task) {
47978
47978
  try {
47979
- const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-UPDIAIQH.js");
47979
+ const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-JRLXQLUB.js");
47980
47980
  const topic = task.split(/[.!?\n]/).filter((s) => s.trim().length > 10)[0]?.trim();
47981
47981
  if (topic === void 0) return null;
47982
47982
  const result = await synthesizeResearch2(topic.slice(0, 50));
@@ -48047,7 +48047,7 @@ function createScanStageWrapper() {
48047
48047
  try {
48048
48048
  const slug = ctx.task.match(/([a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+)/)?.[1];
48049
48049
  if (slug !== void 0) {
48050
- const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-WQCQRNPZ.js");
48050
+ const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-CU4GMXVC.js");
48051
48051
  const plan = await generateSecurityPlan2({ repo: slug, maxScanners: 10 });
48052
48052
  const recs = plan.recommendations.slice(0, 5).map((r) => `${r.priority}: ${r.displayName} (${r.category})`).join("; ");
48053
48053
  return output(PIPELINE_STATE_KEYS.FINDINGS, recs, getTimeProvider().now() - start, true);
@@ -51178,7 +51178,7 @@ var GitHubTaskTracker = class {
51178
51178
  cachedProvider = null;
51179
51179
  async getProvider() {
51180
51180
  if (this.cachedProvider !== null) return this.cachedProvider;
51181
- const { createScmProvider } = await import("./factory-4EUZKQ3C.js");
51181
+ const { createScmProvider } = await import("./factory-3KWRSIWC.js");
51182
51182
  const result = await createScmProvider({ repo: this.config.repo ?? "" });
51183
51183
  if (!result.ok) throw new Error(`SCM provider error: ${result.error.message}`);
51184
51184
  this.cachedProvider = result.value;
@@ -52093,7 +52093,7 @@ async function probeSource(source, includeModelIds) {
52093
52093
  }
52094
52094
  }
52095
52095
  async function defaultSources(includeOpenRouter) {
52096
- const { createAllAdapters: createAllAdapters2 } = await import("./factory-P2G2A5RD.js");
52096
+ const { createAllAdapters: createAllAdapters2 } = await import("./factory-62D7CUZM.js");
52097
52097
  const adapters = createAllAdapters2();
52098
52098
  return buildDefaultModelSources(adapters, { includeOpenRouter });
52099
52099
  }
@@ -56165,4 +56165,4 @@ export {
56165
56165
  shutdownFeedbackSubscriber,
56166
56166
  createEventBusBridge
56167
56167
  };
56168
- //# sourceMappingURL=chunk-46F3UEKW.js.map
56168
+ //# sourceMappingURL=chunk-VB2VPZ6T.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getTimeProvider
3
- } from "./chunk-WJ5TFKDF.js";
3
+ } from "./chunk-53UUQ6TE.js";
4
4
 
5
5
  // src/security/audit-trail.ts
6
6
  var MAX_EVENTS = 1e4;
@@ -205,4 +205,4 @@ export {
205
205
  createGraphAuditBridge,
206
206
  createAuditTrail
207
207
  };
208
- //# sourceMappingURL=chunk-ULZFVZFW.js.map
208
+ //# sourceMappingURL=chunk-XP7ZQTCJ.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  resolveCliSlot
3
- } from "./chunk-SX2K66SG.js";
3
+ } from "./chunk-2FVC6EBQ.js";
4
4
  import {
5
5
  createLogger,
6
6
  getTimeProvider,
7
7
  isRateLimitText
8
- } from "./chunk-WJ5TFKDF.js";
8
+ } from "./chunk-53UUQ6TE.js";
9
9
 
10
10
  // src/pipeline/expert-bridge.ts
11
11
  function resolveCliFromModelString(model) {
@@ -21,7 +21,7 @@ async function getMcpConfigPath() {
21
21
  if (cachedMcpConfigPath !== null) return cachedMcpConfigPath;
22
22
  mcpConfigInitPromise ??= (async () => {
23
23
  try {
24
- const { generateMcpConfig } = await import("./child-mcp-config-QOBQRH24.js");
24
+ const { generateMcpConfig } = await import("./child-mcp-config-6V3VVIRI.js");
25
25
  const config = await generateMcpConfig();
26
26
  cachedMcpConfigPath = config.configPath;
27
27
  cachedMcpConfigCleanup = config.cleanup;
@@ -93,8 +93,8 @@ var routerInitPromise = null;
93
93
  async function getRouter() {
94
94
  if (cachedRouter !== null) return cachedRouter;
95
95
  routerInitPromise ??= (async () => {
96
- const { createAllAdapters } = await import("./factory-P2G2A5RD.js");
97
- const { createCompositeRouter } = await import("./composite-router-SN7T6PM4.js");
96
+ const { createAllAdapters } = await import("./factory-62D7CUZM.js");
97
+ const { createCompositeRouter } = await import("./composite-router-QBEKQOTT.js");
98
98
  const adapters = createAllAdapters();
99
99
  if (adapters.size === 0) {
100
100
  routerInitPromise = null;
@@ -102,7 +102,7 @@ async function getRouter() {
102
102
  }
103
103
  cachedRouter = adaptCompositeRouter(createCompositeRouter(adapters));
104
104
  try {
105
- const { createCliCircuitBreakerIntegration } = await import("./cli-circuit-breaker-PQ2FHTJA.js");
105
+ const { createCliCircuitBreakerIntegration } = await import("./cli-circuit-breaker-MV45AOXB.js");
106
106
  cachedCircuitBreaker = createCliCircuitBreakerIntegration([...adapters.values()]);
107
107
  } catch (error) {
108
108
  const msg = error instanceof Error ? error.message : String(error);
@@ -213,4 +213,4 @@ export {
213
213
  tokenSplitFromUsage,
214
214
  executeExpert
215
215
  };
216
- //# sourceMappingURL=chunk-UPKYWLPL.js.map
216
+ //# sourceMappingURL=chunk-YANA6P5Y.js.map
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-6T3EPABN.js";
6
6
  import {
7
7
  SessionMemory
8
- } from "./chunk-S4TJBGI2.js";
8
+ } from "./chunk-P433WM3V.js";
9
9
  import {
10
10
  StatsOnlyAdapter,
11
11
  ensureSharedMemoryRegistry
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-KSQSWEFH.js";
16
16
  import {
17
17
  generateId
18
- } from "./chunk-ISA73Z6I.js";
18
+ } from "./chunk-JRJIPY7Q.js";
19
19
  import {
20
20
  ErrorCode,
21
21
  NexusError,
@@ -28,7 +28,7 @@ import {
28
28
  getTimeProvider,
29
29
  ok,
30
30
  setSharedMobiMemDbPathResolver
31
- } from "./chunk-WJ5TFKDF.js";
31
+ } from "./chunk-53UUQ6TE.js";
32
32
  import {
33
33
  nexusDataPath
34
34
  } from "./chunk-OGHEKPLD.js";
@@ -5608,4 +5608,4 @@ export {
5608
5608
  reinitializeMemoryBackends,
5609
5609
  ToolMemoryManager
5610
5610
  };
5611
- //# sourceMappingURL=chunk-WYKMINTU.js.map
5611
+ //# sourceMappingURL=chunk-YGOFNCIM.js.map
@@ -3,8 +3,8 @@ import {
3
3
  createCliCircuitBreakerIntegration,
4
4
  getCliCircuitBreakerSnapshot,
5
5
  getDefaultCliCircuitBreakerRegistry
6
- } from "./chunk-4ZDNZAGJ.js";
7
- import "./chunk-WJ5TFKDF.js";
6
+ } from "./chunk-CRJMMNEZ.js";
7
+ import "./chunk-53UUQ6TE.js";
8
8
  import "./chunk-GBHJ37V3.js";
9
9
  import "./chunk-OGHEKPLD.js";
10
10
  import "./chunk-ZPWHCABL.js";
@@ -14,4 +14,4 @@ export {
14
14
  getCliCircuitBreakerSnapshot,
15
15
  getDefaultCliCircuitBreakerRegistry
16
16
  };
17
- //# sourceMappingURL=cli-circuit-breaker-PQ2FHTJA.js.map
17
+ //# sourceMappingURL=cli-circuit-breaker-MV45AOXB.js.map
package/dist/cli.js CHANGED
@@ -18,11 +18,11 @@ import {
18
18
  generateSummary,
19
19
  parseFindings,
20
20
  sumFindings
21
- } from "./chunk-ESNNN75Z.js";
22
- import "./chunk-2DBVUHFA.js";
21
+ } from "./chunk-FKOS3KV2.js";
22
+ import "./chunk-RBXRJK5P.js";
23
23
  import {
24
24
  runConfigInitSync
25
- } from "./chunk-FQUGR66Z.js";
25
+ } from "./chunk-L4I3MKXA.js";
26
26
  import {
27
27
  AuthHandler,
28
28
  CustomExpertDefinitionSchema,
@@ -152,8 +152,8 @@ import {
152
152
  validateNexusEnv,
153
153
  validateWorkflow,
154
154
  wrapInMarkdownFence
155
- } from "./chunk-46F3UEKW.js";
156
- import "./chunk-GZUHLCRE.js";
155
+ } from "./chunk-VB2VPZ6T.js";
156
+ import "./chunk-DUVPQJE7.js";
157
157
  import "./chunk-HFOQKCD2.js";
158
158
  import "./chunk-RSMG2DPB.js";
159
159
  import {
@@ -171,14 +171,14 @@ import {
171
171
  doctorCommand,
172
172
  initDataDirectories,
173
173
  runDoctor
174
- } from "./chunk-A4ISLEV6.js";
174
+ } from "./chunk-BX3QH6PC.js";
175
175
  import {
176
176
  buildOpenAICompatAdapters,
177
177
  readOpenAICompatEnv
178
- } from "./chunk-GFNBH2PE.js";
178
+ } from "./chunk-K2MVLVCR.js";
179
179
  import {
180
180
  shutdownExpertBridge
181
- } from "./chunk-UPKYWLPL.js";
181
+ } from "./chunk-YANA6P5Y.js";
182
182
  import {
183
183
  ConsensusVoteInputSchema,
184
184
  DEFAULT_VOTE_TIMEOUT_MS,
@@ -190,29 +190,29 @@ import {
190
190
  recordAuthenticVote,
191
191
  registerConsensusVoteTool,
192
192
  toRecordDecision
193
- } from "./chunk-WRKUNUCA.js";
193
+ } from "./chunk-R5PN2G3U.js";
194
194
  import {
195
195
  loadUsageEvents,
196
196
  rollupByModel
197
- } from "./chunk-WIB7TIDY.js";
197
+ } from "./chunk-UXIASVKX.js";
198
198
  import {
199
199
  allOf,
200
200
  anyOf
201
201
  } from "./chunk-OQB3XC5O.js";
202
202
  import {
203
203
  synthesizeResearch
204
- } from "./chunk-JPTB4M6V.js";
204
+ } from "./chunk-OR4C6JXA.js";
205
205
  import {
206
206
  classifyTrust,
207
207
  createFullGitHubProvider,
208
208
  evaluatePolicy,
209
209
  parsePRUrl
210
- } from "./chunk-FWRLD7W7.js";
211
- import "./chunk-K77KZHXP.js";
210
+ } from "./chunk-EZCQ5IJC.js";
211
+ import "./chunk-JTBLWGRZ.js";
212
212
  import {
213
213
  ReputationCache,
214
214
  sanitizeInput
215
- } from "./chunk-3IM3OPZH.js";
215
+ } from "./chunk-6PNL5ETD.js";
216
216
  import {
217
217
  ImprovementReviewInputSchema,
218
218
  calculateFitnessScore,
@@ -226,20 +226,20 @@ import {
226
226
  registerImprovementReviewTool,
227
227
  runImprovementReview,
228
228
  scanForSecrets
229
- } from "./chunk-XP5BAFPJ.js";
229
+ } from "./chunk-L3PZGUSD.js";
230
230
  import {
231
231
  createDefaultPolicyFirewall,
232
232
  setGlobalPolicyFirewall,
233
233
  stagePolicyFirewallForRollout
234
- } from "./chunk-WB54CVTG.js";
234
+ } from "./chunk-7TPNJGRU.js";
235
235
  import {
236
236
  VERSION
237
- } from "./chunk-EE53G5Z4.js";
238
- import "./chunk-ULZFVZFW.js";
237
+ } from "./chunk-L4KMKIMV.js";
238
+ import "./chunk-XP7ZQTCJ.js";
239
239
  import {
240
240
  createUnifiedRegistry,
241
241
  getGlobalRegistry
242
- } from "./chunk-KYTV2JFH.js";
242
+ } from "./chunk-43DT2MDF.js";
243
243
  import {
244
244
  CodebaseIndexSchema,
245
245
  PaperStatusSchema,
@@ -265,24 +265,24 @@ import {
265
265
  loadSourcesRegistry,
266
266
  rankDiscoveredItems,
267
267
  saveSourcesRegistry
268
- } from "./chunk-3RZJU5JS.js";
268
+ } from "./chunk-Q5EQTXNF.js";
269
269
  import {
270
270
  loadPapersRegistry,
271
271
  loadTechniquesRegistry,
272
272
  savePapersRegistry
273
- } from "./chunk-SFZ67DTA.js";
273
+ } from "./chunk-56V5NM2A.js";
274
274
  import {
275
275
  resolveToken
276
- } from "./chunk-KXNT76HR.js";
276
+ } from "./chunk-JJ4DJTP5.js";
277
277
  import {
278
278
  MemoryError,
279
279
  shutdownToolMemory
280
- } from "./chunk-WYKMINTU.js";
280
+ } from "./chunk-YGOFNCIM.js";
281
281
  import {
282
282
  capitalize,
283
283
  capitalizeKebab
284
284
  } from "./chunk-6T3EPABN.js";
285
- import "./chunk-S4TJBGI2.js";
285
+ import "./chunk-P433WM3V.js";
286
286
  import {
287
287
  BUILT_IN_EXPERTS
288
288
  } from "./chunk-YPNQPT2F.js";
@@ -295,19 +295,19 @@ import {
295
295
  isRecord,
296
296
  probeAllClis,
297
297
  readSubprocessDepth
298
- } from "./chunk-VOXVWYD4.js";
299
- import "./chunk-CQHUNYJN.js";
298
+ } from "./chunk-5I6WHO2T.js";
299
+ import "./chunk-5OEEY7PB.js";
300
300
  import {
301
301
  DEFAULTS
302
- } from "./chunk-Z22LKOBY.js";
303
- import "./chunk-GXZDUDSD.js";
302
+ } from "./chunk-7J6WOIBD.js";
303
+ import "./chunk-7WGDDFRR.js";
304
304
  import {
305
305
  nexusMkdtempSync
306
306
  } from "./chunk-4OW67KT2.js";
307
- import "./chunk-SX2K66SG.js";
307
+ import "./chunk-2FVC6EBQ.js";
308
308
  import "./chunk-QZUG667L.js";
309
- import "./chunk-ISA73Z6I.js";
310
- import "./chunk-4ZDNZAGJ.js";
309
+ import "./chunk-JRJIPY7Q.js";
310
+ import "./chunk-CRJMMNEZ.js";
311
311
  import {
312
312
  API_TIMEOUTS,
313
313
  AgentCapability,
@@ -384,7 +384,7 @@ import {
384
384
  validateTimeout,
385
385
  writeEmptyLine,
386
386
  writeLine
387
- } from "./chunk-WJ5TFKDF.js";
387
+ } from "./chunk-53UUQ6TE.js";
388
388
  import "./chunk-GBHJ37V3.js";
389
389
  import {
390
390
  applyPortableMode,
@@ -4423,7 +4423,7 @@ ${file.patch}
4423
4423
  violations: policyResult.violations
4424
4424
  });
4425
4425
  }
4426
- const { formatReviewComment: formatReviewComment2 } = await import("./pr-reviewer-helpers-RGCQ35FL.js");
4426
+ const { formatReviewComment: formatReviewComment2 } = await import("./pr-reviewer-helpers-MXC72RTN.js");
4427
4427
  const body = formatReviewComment2(result);
4428
4428
  const postResult = await provider.createReview(pr.prNumber, body, result.decision);
4429
4429
  if (!postResult.ok) {
@@ -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-I26ZEHXQ.js");
19556
+ const { runImprovementReview: runImprovementReview2, ImprovementReviewInputSchema: ImprovementReviewInputSchema2 } = await import("./improvement-review-HIPZDX3S.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", {
@@ -21638,7 +21638,7 @@ function adaptConfigToLibrary(config) {
21638
21638
  }
21639
21639
  function createBeliefPromoter() {
21640
21640
  return async (event) => {
21641
- const { getToolMemory } = await import("./tool-memory-7BKRQ64B.js");
21641
+ const { getToolMemory } = await import("./tool-memory-GBFJGJSJ.js");
21642
21642
  const tm = getToolMemory();
21643
21643
  await tm.recordBelief(
21644
21644
  `skill:${event.name}`,
@@ -22859,7 +22859,7 @@ async function handleResearchCommand(args) {
22859
22859
  }
22860
22860
  }
22861
22861
  async function handleRegistryCommand(args) {
22862
- const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-EMN2WD4V.js");
22862
+ const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-2MP76REH.js");
22863
22863
  const subcommand = args.subcommand;
22864
22864
  if (!isValidRegistrySubcommand(subcommand)) {
22865
22865
  process.stdout.write(`${formatRegistryUsage()}
@@ -22907,12 +22907,12 @@ async function handleVerifyCommand(args) {
22907
22907
  async function handleDoctorCommand(args) {
22908
22908
  const exitCode = await doctorCommand({ fix: args.options.fix });
22909
22909
  if (args.options.deep) {
22910
- const { runDeepDiagnostics: runDeepDiagnostics2, formatDeepDiagnostics: formatDeepDiagnostics2 } = await import("./doctor-deep-FC5IBSTN.js");
22910
+ const { runDeepDiagnostics: runDeepDiagnostics2, formatDeepDiagnostics: formatDeepDiagnostics2 } = await import("./doctor-deep-QBZPVNED.js");
22911
22911
  const diag = runDeepDiagnostics2();
22912
22912
  process.stdout.write(formatDeepDiagnostics2(diag) + "\n");
22913
22913
  }
22914
22914
  if (args.options.live) {
22915
- const { runLiveReadiness, formatLiveReadiness } = await import("./doctor-live-EBBM5XGU.js");
22915
+ const { runLiveReadiness, formatLiveReadiness } = await import("./doctor-live-VRTQ32GF.js");
22916
22916
  const report = await runLiveReadiness();
22917
22917
  process.stdout.write(formatLiveReadiness(report) + "\n");
22918
22918
  if (report.some((r) => r.levels.serves.status === "failed")) {
@@ -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-KWKRUK5D.js");
22968
+ const { runInitOpencode } = await import("./init-opencode-ROVXEFZN.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-KWKRUK5D.js");
22994
+ const { runOpencodeValidate } = await import("./init-opencode-ROVXEFZN.js");
22995
22995
  const result = await runOpencodeValidate(opencodePath);
22996
22996
  if (!result.ok) {
22997
22997
  process.stderr.write(`init --opencode --validate: ${result.reason ?? "failed"}
@@ -23030,7 +23030,7 @@ async function handleSetupCommandAsync(args) {
23030
23030
  return cliExitFromStatus(exitCode);
23031
23031
  }
23032
23032
  async function runCustomApiSetup(args) {
23033
- const { configureCustomApi } = await import("./setup-custom-api-2AEMLGGD.js");
23033
+ const { configureCustomApi } = await import("./setup-custom-api-OKGPJUIZ.js");
23034
23034
  const baseUrl = args.options.customApi;
23035
23035
  if (baseUrl === void 0) return EXIT_CODES.SERVER_START_FAILED;
23036
23036
  const input = {