nexus-agents 3.7.0 → 3.8.1

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 (125) hide show
  1. package/dist/{child-mcp-config-RERUXZJS.js → child-mcp-config-6NPPPUVY.js} +2 -2
  2. package/dist/{chunk-ZHVVLJFQ.js → chunk-222AX67B.js} +4 -4
  3. package/dist/{chunk-4LMP452D.js → chunk-24KV7AHU.js} +7 -7
  4. package/dist/{chunk-V7EFU7LB.js → chunk-2CTS47RO.js} +6 -2
  5. package/dist/chunk-2CTS47RO.js.map +1 -0
  6. package/dist/{chunk-ZYL6RNBZ.js → chunk-2IFBPQX2.js} +5 -5
  7. package/dist/{chunk-7TJVDU2S.js → chunk-2VYSPAPK.js} +3 -3
  8. package/dist/{chunk-6YLKVLI4.js → chunk-5NP5JIA7.js} +35 -35
  9. package/dist/{chunk-MBNECNPL.js → chunk-A4DFWNLB.js} +15 -10
  10. package/dist/{chunk-MBNECNPL.js.map → chunk-A4DFWNLB.js.map} +1 -1
  11. package/dist/{chunk-3BKFXSHM.js → chunk-A7NXSL62.js} +3 -3
  12. package/dist/{chunk-KEO6QJE6.js → chunk-ATOORYKU.js} +2 -2
  13. package/dist/{chunk-TDXJYLRP.js → chunk-BIG3SAUY.js} +2 -2
  14. package/dist/{chunk-D2SKFK4W.js → chunk-CYGJGP52.js} +5 -5
  15. package/dist/{chunk-PXJDALVM.js → chunk-DVVYK7AU.js} +2 -2
  16. package/dist/{chunk-ETEGV2NG.js → chunk-E25DVSOH.js} +2 -2
  17. package/dist/{chunk-CZC4FIVH.js → chunk-FG3BJ3EG.js} +4 -4
  18. package/dist/{chunk-4DXZJJK3.js → chunk-FH5GVIUB.js} +2 -2
  19. package/dist/{chunk-TZGM6BXE.js → chunk-FN4IJNEL.js} +3 -3
  20. package/dist/{chunk-JFZP7IA4.js → chunk-K4PIBH4M.js} +2 -2
  21. package/dist/{chunk-YKEBDGCK.js → chunk-LIYYP74L.js} +2 -2
  22. package/dist/{chunk-VYWHIQHX.js → chunk-LLO24WNM.js} +2 -2
  23. package/dist/{chunk-UK2HVVTQ.js → chunk-NDIEJ2IW.js} +2 -2
  24. package/dist/{chunk-6QBCTIKD.js → chunk-NEEDICVD.js} +2 -2
  25. package/dist/{chunk-DOT3TG4T.js → chunk-OVDMUJJJ.js} +3 -3
  26. package/dist/{chunk-V24NAR5C.js → chunk-PRMJRGTB.js} +2 -2
  27. package/dist/{chunk-5FMDEEV7.js → chunk-Q4N2AMUH.js} +262 -230
  28. package/dist/chunk-Q4N2AMUH.js.map +1 -0
  29. package/dist/{chunk-XFQMSO3R.js → chunk-RCCGQNCI.js} +5 -5
  30. package/dist/{chunk-NC6CLKIB.js → chunk-RH2XESKI.js} +2 -2
  31. package/dist/{chunk-Y3CGQUCQ.js → chunk-SDKH4DZS.js} +5 -5
  32. package/dist/{chunk-WT6JCD3E.js → chunk-SIAT5KIP.js} +2 -2
  33. package/dist/{chunk-7KHCQPHO.js → chunk-TSCF7SCI.js} +343 -314
  34. package/dist/chunk-TSCF7SCI.js.map +1 -0
  35. package/dist/{chunk-TOBIDJ3V.js → chunk-UA6OYKZL.js} +8 -8
  36. package/dist/{chunk-ISF7BEHM.js → chunk-WN4GPQEW.js} +4 -4
  37. package/dist/{chunk-J2F5E3DF.js → chunk-YCJVIYXU.js} +2 -2
  38. package/dist/{chunk-JF7YUXZX.js → chunk-YIMAWNZF.js} +2 -2
  39. package/dist/{cli-circuit-breaker-AR6SXY4G.js → cli-circuit-breaker-GGDXSODU.js} +3 -3
  40. package/dist/cli.d.ts +1 -1
  41. package/dist/cli.js +41 -41
  42. package/dist/{composite-router-NQ4UCMV6.js → composite-router-3JTQWELQ.js} +2 -2
  43. package/dist/{consensus-vote-ILSS373K.js → consensus-vote-VIVMYSH7.js} +16 -16
  44. package/dist/{consensus-vote-types-BC2vWQKe.d.ts → consensus-vote-types-b-KD-0g_.d.ts} +102 -0
  45. package/dist/{context-retriever-CCGMXTGJ.js → context-retriever-CD4M2XZI.js} +8 -8
  46. package/dist/{doctor-deep-VMTFQG7N.js → doctor-deep-DGIEA3BS.js} +3 -3
  47. package/dist/{doctor-live-IAQOG6LI.js → doctor-live-UAXCKP2P.js} +9 -9
  48. package/dist/{expert-bridge-JOM5P4I4.js → expert-bridge-NJ7ROLKV.js} +4 -4
  49. package/dist/{factory-MYQRDKOJ.js → factory-HXTWV5M2.js} +9 -9
  50. package/dist/{factory-6A6TGK6D.js → factory-YQTOTSAG.js} +5 -5
  51. package/dist/{improvement-review-CFBMX6BL.js → improvement-review-BXMMAIF7.js} +5 -5
  52. package/dist/index.d.ts +10 -2
  53. package/dist/index.js +30 -30
  54. package/dist/{init-opencode-J7GUKZF4.js → init-opencode-5JABJDNL.js} +6 -6
  55. package/dist/{issue-triage-T3L7CAUV.js → issue-triage-EV64NQRS.js} +6 -6
  56. package/dist/{pr-reviewer-helpers-XMTT5K4E.js → pr-reviewer-helpers-MDLLZ2XR.js} +4 -4
  57. package/dist/{registry-command-5QPDC5SH.js → registry-command-LP7HOKWD.js} +2 -2
  58. package/dist/{repo-security-plan-WQG7G4H6.js → repo-security-plan-CJNJQNIM.js} +3 -3
  59. package/dist/{research-helpers-synthesize-6FPLB3UK.js → research-helpers-synthesize-J5ZVG6PP.js} +4 -4
  60. package/dist/{routing-memory-HNZRMLXC.js → routing-memory-UPCTNDFG.js} +2 -2
  61. package/dist/{session-memory-SXYFTZYM.js → session-memory-K67JAZTU.js} +3 -3
  62. package/dist/{setup-command-X7EJ7LBU.js → setup-command-L7DSQ25Y.js} +14 -14
  63. package/dist/{setup-config-4UPPIMTI.js → setup-config-UEQMYXQ5.js} +3 -3
  64. package/dist/{setup-custom-api-U5WEZRQO.js → setup-custom-api-SHMT2T3M.js} +4 -4
  65. package/dist/{tool-memory-BT7VS5N5.js → tool-memory-J2RP3FTT.js} +5 -5
  66. package/dist/{unified-registry-L2T5UJHQ.js → unified-registry-2JCOLE4F.js} +10 -10
  67. package/dist/{weather-report-2T3OIAJS.js → weather-report-XHGOK6E7.js} +2 -2
  68. package/package.json +1 -1
  69. package/dist/chunk-5FMDEEV7.js.map +0 -1
  70. package/dist/chunk-7KHCQPHO.js.map +0 -1
  71. package/dist/chunk-V7EFU7LB.js.map +0 -1
  72. /package/dist/{child-mcp-config-RERUXZJS.js.map → child-mcp-config-6NPPPUVY.js.map} +0 -0
  73. /package/dist/{chunk-ZHVVLJFQ.js.map → chunk-222AX67B.js.map} +0 -0
  74. /package/dist/{chunk-4LMP452D.js.map → chunk-24KV7AHU.js.map} +0 -0
  75. /package/dist/{chunk-ZYL6RNBZ.js.map → chunk-2IFBPQX2.js.map} +0 -0
  76. /package/dist/{chunk-7TJVDU2S.js.map → chunk-2VYSPAPK.js.map} +0 -0
  77. /package/dist/{chunk-6YLKVLI4.js.map → chunk-5NP5JIA7.js.map} +0 -0
  78. /package/dist/{chunk-3BKFXSHM.js.map → chunk-A7NXSL62.js.map} +0 -0
  79. /package/dist/{chunk-KEO6QJE6.js.map → chunk-ATOORYKU.js.map} +0 -0
  80. /package/dist/{chunk-TDXJYLRP.js.map → chunk-BIG3SAUY.js.map} +0 -0
  81. /package/dist/{chunk-D2SKFK4W.js.map → chunk-CYGJGP52.js.map} +0 -0
  82. /package/dist/{chunk-PXJDALVM.js.map → chunk-DVVYK7AU.js.map} +0 -0
  83. /package/dist/{chunk-ETEGV2NG.js.map → chunk-E25DVSOH.js.map} +0 -0
  84. /package/dist/{chunk-CZC4FIVH.js.map → chunk-FG3BJ3EG.js.map} +0 -0
  85. /package/dist/{chunk-4DXZJJK3.js.map → chunk-FH5GVIUB.js.map} +0 -0
  86. /package/dist/{chunk-TZGM6BXE.js.map → chunk-FN4IJNEL.js.map} +0 -0
  87. /package/dist/{chunk-JFZP7IA4.js.map → chunk-K4PIBH4M.js.map} +0 -0
  88. /package/dist/{chunk-YKEBDGCK.js.map → chunk-LIYYP74L.js.map} +0 -0
  89. /package/dist/{chunk-VYWHIQHX.js.map → chunk-LLO24WNM.js.map} +0 -0
  90. /package/dist/{chunk-UK2HVVTQ.js.map → chunk-NDIEJ2IW.js.map} +0 -0
  91. /package/dist/{chunk-6QBCTIKD.js.map → chunk-NEEDICVD.js.map} +0 -0
  92. /package/dist/{chunk-DOT3TG4T.js.map → chunk-OVDMUJJJ.js.map} +0 -0
  93. /package/dist/{chunk-V24NAR5C.js.map → chunk-PRMJRGTB.js.map} +0 -0
  94. /package/dist/{chunk-XFQMSO3R.js.map → chunk-RCCGQNCI.js.map} +0 -0
  95. /package/dist/{chunk-NC6CLKIB.js.map → chunk-RH2XESKI.js.map} +0 -0
  96. /package/dist/{chunk-Y3CGQUCQ.js.map → chunk-SDKH4DZS.js.map} +0 -0
  97. /package/dist/{chunk-WT6JCD3E.js.map → chunk-SIAT5KIP.js.map} +0 -0
  98. /package/dist/{chunk-TOBIDJ3V.js.map → chunk-UA6OYKZL.js.map} +0 -0
  99. /package/dist/{chunk-ISF7BEHM.js.map → chunk-WN4GPQEW.js.map} +0 -0
  100. /package/dist/{chunk-J2F5E3DF.js.map → chunk-YCJVIYXU.js.map} +0 -0
  101. /package/dist/{chunk-JF7YUXZX.js.map → chunk-YIMAWNZF.js.map} +0 -0
  102. /package/dist/{cli-circuit-breaker-AR6SXY4G.js.map → cli-circuit-breaker-GGDXSODU.js.map} +0 -0
  103. /package/dist/{composite-router-NQ4UCMV6.js.map → composite-router-3JTQWELQ.js.map} +0 -0
  104. /package/dist/{consensus-vote-ILSS373K.js.map → consensus-vote-VIVMYSH7.js.map} +0 -0
  105. /package/dist/{context-retriever-CCGMXTGJ.js.map → context-retriever-CD4M2XZI.js.map} +0 -0
  106. /package/dist/{doctor-deep-VMTFQG7N.js.map → doctor-deep-DGIEA3BS.js.map} +0 -0
  107. /package/dist/{doctor-live-IAQOG6LI.js.map → doctor-live-UAXCKP2P.js.map} +0 -0
  108. /package/dist/{expert-bridge-JOM5P4I4.js.map → expert-bridge-NJ7ROLKV.js.map} +0 -0
  109. /package/dist/{factory-6A6TGK6D.js.map → factory-HXTWV5M2.js.map} +0 -0
  110. /package/dist/{factory-MYQRDKOJ.js.map → factory-YQTOTSAG.js.map} +0 -0
  111. /package/dist/{improvement-review-CFBMX6BL.js.map → improvement-review-BXMMAIF7.js.map} +0 -0
  112. /package/dist/{init-opencode-J7GUKZF4.js.map → init-opencode-5JABJDNL.js.map} +0 -0
  113. /package/dist/{issue-triage-T3L7CAUV.js.map → issue-triage-EV64NQRS.js.map} +0 -0
  114. /package/dist/{pr-reviewer-helpers-XMTT5K4E.js.map → pr-reviewer-helpers-MDLLZ2XR.js.map} +0 -0
  115. /package/dist/{registry-command-5QPDC5SH.js.map → registry-command-LP7HOKWD.js.map} +0 -0
  116. /package/dist/{repo-security-plan-WQG7G4H6.js.map → repo-security-plan-CJNJQNIM.js.map} +0 -0
  117. /package/dist/{research-helpers-synthesize-6FPLB3UK.js.map → research-helpers-synthesize-J5ZVG6PP.js.map} +0 -0
  118. /package/dist/{routing-memory-HNZRMLXC.js.map → routing-memory-UPCTNDFG.js.map} +0 -0
  119. /package/dist/{session-memory-SXYFTZYM.js.map → session-memory-K67JAZTU.js.map} +0 -0
  120. /package/dist/{setup-command-X7EJ7LBU.js.map → setup-command-L7DSQ25Y.js.map} +0 -0
  121. /package/dist/{setup-config-4UPPIMTI.js.map → setup-config-UEQMYXQ5.js.map} +0 -0
  122. /package/dist/{setup-custom-api-U5WEZRQO.js.map → setup-custom-api-SHMT2T3M.js.map} +0 -0
  123. /package/dist/{tool-memory-BT7VS5N5.js.map → tool-memory-J2RP3FTT.js.map} +0 -0
  124. /package/dist/{unified-registry-L2T5UJHQ.js.map → unified-registry-2JCOLE4F.js.map} +0 -0
  125. /package/dist/{weather-report-2T3OIAJS.js.map → weather-report-XHGOK6E7.js.map} +0 -0
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-SNJNRDKZ.js";
4
4
  import {
5
5
  createLogger
6
- } from "./chunk-7KHCQPHO.js";
6
+ } from "./chunk-TSCF7SCI.js";
7
7
  import "./chunk-2HUC6NZN.js";
8
8
  import "./chunk-OQLFRJCW.js";
9
9
  import "./chunk-ZPWHCABL.js";
@@ -62,4 +62,4 @@ export {
62
62
  generateMcpConfig,
63
63
  getDefaultAllowedTools
64
64
  };
65
- //# sourceMappingURL=child-mcp-config-RERUXZJS.js.map
65
+ //# sourceMappingURL=child-mcp-config-6NPPPUVY.js.map
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-6T3EPABN.js";
6
6
  import {
7
7
  SessionMemory
8
- } from "./chunk-JFZP7IA4.js";
8
+ } from "./chunk-K4PIBH4M.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-4DXZJJK3.js";
18
+ } from "./chunk-FH5GVIUB.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-7KHCQPHO.js";
31
+ } from "./chunk-TSCF7SCI.js";
32
32
  import {
33
33
  nexusDataPath
34
34
  } from "./chunk-OQLFRJCW.js";
@@ -5552,4 +5552,4 @@ export {
5552
5552
  reinitializeMemoryBackends,
5553
5553
  ToolMemoryManager
5554
5554
  };
5555
- //# sourceMappingURL=chunk-ZHVVLJFQ.js.map
5555
+ //# sourceMappingURL=chunk-222AX67B.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  resolveCliSlot
3
- } from "./chunk-J2F5E3DF.js";
3
+ } from "./chunk-YCJVIYXU.js";
4
4
  import {
5
5
  createLogger,
6
6
  getTimeProvider,
7
7
  isRateLimitText
8
- } from "./chunk-7KHCQPHO.js";
8
+ } from "./chunk-TSCF7SCI.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-RERUXZJS.js");
24
+ const { generateMcpConfig } = await import("./child-mcp-config-6NPPPUVY.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-MYQRDKOJ.js");
97
- const { createCompositeRouter } = await import("./composite-router-NQ4UCMV6.js");
96
+ const { createAllAdapters } = await import("./factory-HXTWV5M2.js");
97
+ const { createCompositeRouter } = await import("./composite-router-3JTQWELQ.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-AR6SXY4G.js");
105
+ const { createCliCircuitBreakerIntegration } = await import("./cli-circuit-breaker-GGDXSODU.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-4LMP452D.js.map
216
+ //# sourceMappingURL=chunk-24KV7AHU.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getDefaultRegistry
3
- } from "./chunk-7KHCQPHO.js";
3
+ } from "./chunk-TSCF7SCI.js";
4
4
  import {
5
5
  getNexusDataDir
6
6
  } from "./chunk-OQLFRJCW.js";
@@ -20,6 +20,9 @@ function computeCostDetail(modelId, inputTokens, outputTokens) {
20
20
  );
21
21
  return { costUsd: microUsd / 1e6, priced: true, resolvedId, ...provenance };
22
22
  }
23
+ function priceBasisOf(detail) {
24
+ return detail.priced ? "list" : "unknown";
25
+ }
23
26
  function getUsageLogPath(date = /* @__PURE__ */ new Date()) {
24
27
  const year = date.getUTCFullYear();
25
28
  const month = String(date.getUTCMonth() + 1).padStart(2, "0");
@@ -120,8 +123,9 @@ function rollupByModel(events) {
120
123
 
121
124
  export {
122
125
  computeCostDetail,
126
+ priceBasisOf,
123
127
  recordUsageEvent,
124
128
  loadUsageEvents,
125
129
  rollupByModel
126
130
  };
127
- //# sourceMappingURL=chunk-V7EFU7LB.js.map
131
+ //# sourceMappingURL=chunk-2CTS47RO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/learning/usage-log.ts"],"sourcesContent":["/**\n * usage-log — append-only per-call usage events with cost.\n *\n * Source: Issue #2469 (epic #2467 child).\n *\n * For operators running against metered API gateways, per-call cost +\n * tokens + latency is the data they need to manage spend. This module\n * provides three things:\n *\n * 1. `recordUsageEvent(event)` — append a per-call record to a JSONL\n * log under <NEXUS_DATA_DIR>/usage/usage-YYYY-MM.jsonl.\n * 2. `loadUsageEvents({...})` — read events for a window, filtered\n * by model / category.\n * 3. `computeCostDetail(modelId, inputTokens, outputTokens)` (and its\n * thin wrapper `computeCostUSD`) — compute cost from the FULL model\n * registry pricing chain (manifest > in-tree > models.dev > generated\n * LiteLLM catalog), including the #4164 normalized/identity resolution\n * tier for decorated gateway model ids. A model with no pricing\n * anywhere in the chain is reported as `priced: false` so consumers\n * can treat the missing cost as UNMEASURED (#3855), never a real $0.\n *\n * The `usage` CLI command (cli/usage-command.ts) consumes this for the\n * operator dashboard. Existing OutcomeStore is intentionally untouched\n * — its schema is for routing/learning signals, not billing.\n */\n\nimport { appendFileSync, existsSync, mkdirSync, readFileSync, readdirSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\n\nimport { getNexusDataDir } from '../config/nexus-data-dir.js';\n// NOTE: only the FUNCTION is imported here — `getDefaultRegistry()` must never\n// be CALLED at module scope (#3185 bootstrap hazard: first construction reads\n// the manifest overlay/snapshot from disk). All calls happen at invocation\n// time inside computeCostDetail.\nimport { getDefaultRegistry, type MatchedVia } from '../config/model-registry.js';\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 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,19 +1,19 @@
1
1
  import {
2
2
  resolveToken
3
- } from "./chunk-UK2HVVTQ.js";
3
+ } from "./chunk-NDIEJ2IW.js";
4
4
  import {
5
5
  REGISTRY_PATH,
6
6
  getProjectRoot,
7
7
  loadPapersRegistry,
8
8
  loadTechniquesRegistry,
9
9
  savePapersRegistry
10
- } from "./chunk-6QBCTIKD.js";
10
+ } from "./chunk-NEEDICVD.js";
11
11
  import {
12
12
  resolveInsideRoot
13
13
  } from "./chunk-NUBSJGQZ.js";
14
14
  import {
15
15
  getToolMemory
16
- } from "./chunk-ZHVVLJFQ.js";
16
+ } from "./chunk-222AX67B.js";
17
17
  import {
18
18
  capitalizeWords,
19
19
  truncateSentence
@@ -38,7 +38,7 @@ import {
38
38
  getTimeProvider,
39
39
  ok,
40
40
  registerPersistentDistillerFactory
41
- } from "./chunk-7KHCQPHO.js";
41
+ } from "./chunk-TSCF7SCI.js";
42
42
  import {
43
43
  ensureLearningDir,
44
44
  getRulesFile
@@ -4090,4 +4090,4 @@ export {
4090
4090
  DEFAULT_CONTEXT_BUDGET_TOKENS,
4091
4091
  getContextPromptPrefix
4092
4092
  };
4093
- //# sourceMappingURL=chunk-ZYL6RNBZ.js.map
4093
+ //# sourceMappingURL=chunk-2IFBPQX2.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  loadPapersRegistry
3
- } from "./chunk-6QBCTIKD.js";
3
+ } from "./chunk-NEEDICVD.js";
4
4
  import {
5
5
  getErrorMessage
6
- } from "./chunk-7KHCQPHO.js";
6
+ } from "./chunk-TSCF7SCI.js";
7
7
 
8
8
  // src/cli/research-helpers-synthesize.ts
9
9
  import { z } from "zod";
@@ -876,4 +876,4 @@ export {
876
876
  AttributedInsightSchema,
877
877
  synthesizeResearch
878
878
  };
879
- //# sourceMappingURL=chunk-7TJVDU2S.js.map
879
+ //# sourceMappingURL=chunk-2VYSPAPK.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  generateSecurityPlan
3
- } from "./chunk-VYWHIQHX.js";
3
+ } from "./chunk-LLO24WNM.js";
4
4
  import {
5
5
  analyzeGitHubRepo
6
6
  } from "./chunk-HFOQKCD2.js";
@@ -22,10 +22,10 @@ import {
22
22
  DEFAULT_TASK_TTL_MS,
23
23
  DEFAULT_TOOL_RATE_LIMITS,
24
24
  clampTaskTtl
25
- } from "./chunk-TOBIDJ3V.js";
25
+ } from "./chunk-UA6OYKZL.js";
26
26
  import {
27
27
  executeExpert
28
- } from "./chunk-4LMP452D.js";
28
+ } from "./chunk-24KV7AHU.js";
29
29
  import {
30
30
  JobStatusSchema,
31
31
  abortJob,
@@ -46,24 +46,24 @@ import {
46
46
  simulationDeniedResult,
47
47
  toJobSummary,
48
48
  writeJobCancelled
49
- } from "./chunk-MBNECNPL.js";
49
+ } from "./chunk-A4DFWNLB.js";
50
50
  import {
51
51
  allOf
52
52
  } from "./chunk-OQB3XC5O.js";
53
53
  import {
54
54
  normalizeTopicToCanonical,
55
55
  synthesizeResearch
56
- } from "./chunk-7TJVDU2S.js";
56
+ } from "./chunk-2VYSPAPK.js";
57
57
  import {
58
58
  IssueTriage
59
- } from "./chunk-Y3CGQUCQ.js";
59
+ } from "./chunk-SDKH4DZS.js";
60
60
  import {
61
61
  resolveEnvMode,
62
62
  sanitizeInput
63
- } from "./chunk-ETEGV2NG.js";
63
+ } from "./chunk-E25DVSOH.js";
64
64
  import {
65
65
  withPrerequisite
66
- } from "./chunk-DOT3TG4T.js";
66
+ } from "./chunk-OVDMUJJJ.js";
67
67
  import {
68
68
  NOOP_NOTIFIER,
69
69
  RateLimiter,
@@ -86,18 +86,18 @@ import {
86
86
  withAuditTrail,
87
87
  withProgressHeartbeat,
88
88
  wrapToolWithTimeout
89
- } from "./chunk-3BKFXSHM.js";
89
+ } from "./chunk-A7NXSL62.js";
90
90
  import {
91
91
  createAuditTrail,
92
92
  createGraphAuditBridge,
93
93
  emitPipelinePolicyEvent
94
- } from "./chunk-YKEBDGCK.js";
94
+ } from "./chunk-LIYYP74L.js";
95
95
  import {
96
96
  EventTopics,
97
97
  createEvent,
98
98
  getGlobalEventBus,
99
99
  getGlobalRegistry
100
- } from "./chunk-CZC4FIVH.js";
100
+ } from "./chunk-FG3BJ3EG.js";
101
101
  import {
102
102
  IDENTIFIER_RE,
103
103
  LANG_VALUES,
@@ -130,15 +130,15 @@ import {
130
130
  parseRegistry,
131
131
  sourceExistsInRegistry,
132
132
  summarizeContextForPrompt
133
- } from "./chunk-ZYL6RNBZ.js";
133
+ } from "./chunk-2IFBPQX2.js";
134
134
  import {
135
135
  getTokenEnvVars,
136
136
  resolveToken
137
- } from "./chunk-UK2HVVTQ.js";
137
+ } from "./chunk-NDIEJ2IW.js";
138
138
  import {
139
139
  loadPapersRegistry,
140
140
  loadTechniquesRegistry
141
- } from "./chunk-6QBCTIKD.js";
141
+ } from "./chunk-NEEDICVD.js";
142
142
  import {
143
143
  resolveInsideRoot
144
144
  } from "./chunk-NUBSJGQZ.js";
@@ -147,14 +147,14 @@ import {
147
147
  MemoryImportance,
148
148
  calculateTextJaccardSimilarity,
149
149
  getToolMemory
150
- } from "./chunk-ZHVVLJFQ.js";
150
+ } from "./chunk-222AX67B.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-JFZP7IA4.js";
157
+ } from "./chunk-K4PIBH4M.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-5FMDEEV7.js";
175
+ } from "./chunk-Q4N2AMUH.js";
176
176
  import {
177
177
  BaseAdapter,
178
178
  createStream,
179
179
  requireApiKey,
180
180
  validateApiKeyPresence
181
- } from "./chunk-V24NAR5C.js";
181
+ } from "./chunk-PRMJRGTB.js";
182
182
  import {
183
183
  DEFAULTS
184
- } from "./chunk-TDXJYLRP.js";
184
+ } from "./chunk-BIG3SAUY.js";
185
185
  import {
186
186
  getAvailabilityCache,
187
187
  getCliForModelId,
188
188
  resolveFallback
189
- } from "./chunk-J2F5E3DF.js";
189
+ } from "./chunk-YCJVIYXU.js";
190
190
  import {
191
191
  generateHyphenId,
192
192
  generateUUID
193
- } from "./chunk-4DXZJJK3.js";
193
+ } from "./chunk-FH5GVIUB.js";
194
194
  import {
195
195
  AGENT_ROUTER_TIMEOUTS,
196
196
  API_TIMEOUTS,
@@ -289,7 +289,7 @@ import {
289
289
  selectStrategyByManifest,
290
290
  toExpertTaskAnalysisResult,
291
291
  withStep
292
- } from "./chunk-7KHCQPHO.js";
292
+ } from "./chunk-TSCF7SCI.js";
293
293
  import {
294
294
  ensureLearningDir,
295
295
  getMetaOutcomesFile,
@@ -28371,7 +28371,7 @@ function execIdFields(executionId) {
28371
28371
  async function populateUnifiedContextOnState(state, options) {
28372
28372
  const taskCandidate = state["task"];
28373
28373
  if (typeof taskCandidate !== "string" || taskCandidate === "") return;
28374
- const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-CCGMXTGJ.js");
28374
+ const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-CD4M2XZI.js");
28375
28375
  const category = inferTaskCategory2(taskCandidate);
28376
28376
  const executionId = options?.executionId;
28377
28377
  const execFields = execIdFields(executionId);
@@ -43976,7 +43976,7 @@ async function tryIssueTriage(task) {
43976
43976
  try {
43977
43977
  const issueMatch = task.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);
43978
43978
  if (issueMatch === null) return null;
43979
- const { createIssueTriage } = await import("./issue-triage-T3L7CAUV.js");
43979
+ const { createIssueTriage } = await import("./issue-triage-EV64NQRS.js");
43980
43980
  const triage = createIssueTriage();
43981
43981
  const owner = issueMatch[1] ?? "";
43982
43982
  const num = issueMatch[2] ?? "";
@@ -44004,7 +44004,7 @@ var VALID_TEMPLATES = /* @__PURE__ */ new Set([
44004
44004
  ]);
44005
44005
  async function classifyWithLLM(task) {
44006
44006
  try {
44007
- const { executeExpert: executeExpert2 } = await import("./expert-bridge-JOM5P4I4.js");
44007
+ const { executeExpert: executeExpert2 } = await import("./expert-bridge-NJ7ROLKV.js");
44008
44008
  const prompt = [
44009
44009
  "Classify this task into exactly one pipeline template.",
44010
44010
  "Templates: dev (implementation/bug fix/refactor), research (investigate/evaluate/compare),",
@@ -45730,7 +45730,7 @@ var memoryInitPromise = null;
45730
45730
  async function initPipelineMemory() {
45731
45731
  if (cachedMemory !== null) return cachedMemory;
45732
45732
  try {
45733
- const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-SXYFTZYM.js");
45733
+ const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-K67JAZTU.js");
45734
45734
  const { getLearningDir } = await import("./learning-persistence-EGY4VKKO.js");
45735
45735
  const mem = createSessionMemory2(getLearningDir());
45736
45736
  mem.startSession(`pipeline-${String(getTimeProvider().now())}`);
@@ -45792,7 +45792,7 @@ function recordRoutingExperience(category, success, durationMs, tokensUsed = 0,
45792
45792
  callRecord(routingMemoryCache);
45793
45793
  return;
45794
45794
  }
45795
- routingMemoryInitPromise ??= import("./routing-memory-HNZRMLXC.js").then(({ createRoutingMemory }) => {
45795
+ routingMemoryInitPromise ??= import("./routing-memory-UPCTNDFG.js").then(({ createRoutingMemory }) => {
45796
45796
  routingMemoryCache ??= createRoutingMemory();
45797
45797
  return routingMemoryCache;
45798
45798
  }).catch((error) => {
@@ -45826,7 +45826,7 @@ ${text}` : "";
45826
45826
  }
45827
45827
  async function getWeatherContext() {
45828
45828
  try {
45829
- const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-2T3OIAJS.js");
45829
+ const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-XHGOK6E7.js");
45830
45830
  const report = generateWeatherReport2({ includeAdaptive: true });
45831
45831
  const mappings = "recommendedMappings" in report ? report.recommendedMappings : [];
45832
45832
  if (!Array.isArray(mappings) || mappings.length === 0) return "";
@@ -45844,7 +45844,7 @@ ${lines}
45844
45844
  }
45845
45845
  async function getMemoryContext(task) {
45846
45846
  try {
45847
- const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-SXYFTZYM.js");
45847
+ const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-K67JAZTU.js");
45848
45848
  const { getLearningDir } = await import("./learning-persistence-EGY4VKKO.js");
45849
45849
  const memory = createSessionMemory2(getLearningDir(), { maxLearningsInContext: 10 });
45850
45850
  const learnings = memory.searchLearnings(task.slice(0, 200));
@@ -45959,7 +45959,7 @@ ${contextBlock}`;
45959
45959
  const strategy = config.votingStrategy ?? "higher_order";
45960
45960
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
45961
45961
  try {
45962
- const { executeVoting } = await import("./consensus-vote-ILSS373K.js");
45962
+ const { executeVoting } = await import("./consensus-vote-VIVMYSH7.js");
45963
45963
  const votingResult = await executeVoting(
45964
45964
  {
45965
45965
  proposal: buildVoteProposal(plan, research),
@@ -46398,7 +46398,7 @@ async function searchCodebaseForTask(task) {
46398
46398
  }
46399
46399
  async function queryResearchRegistry(task) {
46400
46400
  try {
46401
- const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-6FPLB3UK.js");
46401
+ const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-J5ZVG6PP.js");
46402
46402
  const topic = task.split(/[.!?\n]/).filter((s) => s.trim().length > 10)[0]?.trim();
46403
46403
  if (topic === void 0) return null;
46404
46404
  const result = await synthesizeResearch2(topic.slice(0, 50));
@@ -46469,7 +46469,7 @@ function createScanStageWrapper() {
46469
46469
  try {
46470
46470
  const slug = ctx.task.match(/([a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+)/)?.[1];
46471
46471
  if (slug !== void 0) {
46472
- const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-WQG7G4H6.js");
46472
+ const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-CJNJQNIM.js");
46473
46473
  const plan = await generateSecurityPlan2({ repo: slug, maxScanners: 10 });
46474
46474
  const recs = plan.recommendations.slice(0, 5).map((r) => `${r.priority}: ${r.displayName} (${r.category})`).join("; ");
46475
46475
  return output(PIPELINE_STATE_KEYS.FINDINGS, recs, getTimeProvider().now() - start, true);
@@ -49474,7 +49474,7 @@ var GitHubTaskTracker = class {
49474
49474
  cachedProvider = null;
49475
49475
  async getProvider() {
49476
49476
  if (this.cachedProvider !== null) return this.cachedProvider;
49477
- const { createScmProvider } = await import("./factory-6A6TGK6D.js");
49477
+ const { createScmProvider } = await import("./factory-YQTOTSAG.js");
49478
49478
  const result = await createScmProvider({ repo: this.config.repo ?? "" });
49479
49479
  if (!result.ok) throw new Error(`SCM provider error: ${result.error.message}`);
49480
49480
  this.cachedProvider = result.value;
@@ -50316,7 +50316,7 @@ async function probeSource(source, includeModelIds) {
50316
50316
  }
50317
50317
  }
50318
50318
  async function defaultSources(includeOpenRouter) {
50319
- const { createAllAdapters: createAllAdapters2 } = await import("./factory-MYQRDKOJ.js");
50319
+ const { createAllAdapters: createAllAdapters2 } = await import("./factory-HXTWV5M2.js");
50320
50320
  const adapters = createAllAdapters2();
50321
50321
  return buildDefaultModelSources(adapters, { includeOpenRouter });
50322
50322
  }
@@ -54348,4 +54348,4 @@ export {
54348
54348
  shutdownFeedbackSubscriber,
54349
54349
  createEventBusBridge
54350
54350
  };
54351
- //# sourceMappingURL=chunk-6YLKVLI4.js.map
54351
+ //# sourceMappingURL=chunk-5NP5JIA7.js.map
@@ -1,6 +1,7 @@
1
1
  import {
2
- computeCostDetail
3
- } from "./chunk-V7EFU7LB.js";
2
+ computeCostDetail,
3
+ priceBasisOf
4
+ } from "./chunk-2CTS47RO.js";
4
5
  import {
5
6
  allOf
6
7
  } from "./chunk-OQB3XC5O.js";
@@ -21,20 +22,20 @@ import {
21
22
  toolSuccess,
22
23
  withProgressHeartbeat,
23
24
  wrapToolWithTimeout
24
- } from "./chunk-3BKFXSHM.js";
25
+ } from "./chunk-A7NXSL62.js";
25
26
  import {
26
27
  createEvent,
27
28
  getGlobalRegistry
28
- } from "./chunk-CZC4FIVH.js";
29
+ } from "./chunk-FG3BJ3EG.js";
29
30
  import {
30
31
  getToolMemory
31
- } from "./chunk-ZHVVLJFQ.js";
32
+ } from "./chunk-222AX67B.js";
32
33
  import {
33
34
  authRemediation,
34
35
  delay,
35
36
  getAvailableClis,
36
37
  withTimeout
37
- } from "./chunk-5FMDEEV7.js";
38
+ } from "./chunk-Q4N2AMUH.js";
38
39
  import {
39
40
  AgentError,
40
41
  CLI_NAMES,
@@ -63,7 +64,7 @@ import {
63
64
  resolveClassGuardMs,
64
65
  resolveModelIdentitySync,
65
66
  resolveVoteTimeout
66
- } from "./chunk-7KHCQPHO.js";
67
+ } from "./chunk-TSCF7SCI.js";
67
68
  import {
68
69
  ensureLearningDir,
69
70
  getOutcomesFile
@@ -5344,7 +5345,11 @@ function votesToCostInputs(votes) {
5344
5345
  role: v.role,
5345
5346
  model: v.model,
5346
5347
  ...reportedTokenFields(v),
5347
- ...detail?.priced === true ? { costUsd: detail.costUsd } : {}
5348
+ ...detail?.priced === true ? { costUsd: detail.costUsd } : {},
5349
+ // #4406 — state what kind of rate the cost rests on, but only when we
5350
+ // actually consulted the registry. No lookup ⇒ no claim (absent), which
5351
+ // is distinct from 'unknown' ("we looked and there is no price").
5352
+ ...detail !== void 0 ? { priceBasis: priceBasisOf(detail) } : {}
5348
5353
  };
5349
5354
  return input;
5350
5355
  });
@@ -6185,7 +6190,7 @@ async function processVotesWithCascade(engineVotes, opts) {
6185
6190
  var CONTRARIAN_ESCALATION_THRESHOLD = 0.8;
6186
6191
  async function runContrarianCheck(proposal, log) {
6187
6192
  try {
6188
- const { executeExpert } = await import("./expert-bridge-JOM5P4I4.js");
6193
+ const { executeExpert } = await import("./expert-bridge-NJ7ROLKV.js");
6189
6194
  const prompt = [
6190
6195
  "You are a contrarian analyst. Your job is to find reasons this proposal should be REJECTED.",
6191
6196
  "Look for: YAGNI (not needed), MISALIGNED (wrong tech/architecture), SECURITY_RISK, SCOPE_CREEP.",
@@ -6751,4 +6756,4 @@ export {
6751
6756
  CONSENSUS_VOTE_TOOL_SCHEMA,
6752
6757
  registerConsensusVoteTool
6753
6758
  };
6754
- //# sourceMappingURL=chunk-MBNECNPL.js.map
6759
+ //# sourceMappingURL=chunk-A4DFWNLB.js.map