modelrig 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/CHANGELOG.md +158 -0
  2. package/README.md +53 -11
  3. package/data/PROVENANCE.md +19 -0
  4. package/data/pricing-manual.json +22 -0
  5. package/data/pricing-map.json +46362 -0
  6. package/data/pricing-overlay.json +419 -0
  7. package/dist/adapters/anthropic.d.ts +50 -6
  8. package/dist/adapters/anthropic.d.ts.map +1 -1
  9. package/dist/adapters/anthropic.js +123 -29
  10. package/dist/adapters/build-adapters.d.ts +11 -0
  11. package/dist/adapters/build-adapters.d.ts.map +1 -0
  12. package/dist/adapters/build-adapters.js +45 -0
  13. package/dist/adapters/deepseek.d.ts +6 -0
  14. package/dist/adapters/deepseek.d.ts.map +1 -1
  15. package/dist/adapters/deepseek.js +54 -1
  16. package/dist/adapters/gemini.d.ts +10 -0
  17. package/dist/adapters/gemini.d.ts.map +1 -1
  18. package/dist/adapters/gemini.js +78 -7
  19. package/dist/adapters/grok.d.ts +9 -0
  20. package/dist/adapters/grok.d.ts.map +1 -1
  21. package/dist/adapters/grok.js +67 -3
  22. package/dist/adapters/openai-compat.d.ts +6 -0
  23. package/dist/adapters/openai-compat.d.ts.map +1 -1
  24. package/dist/adapters/openai-compat.js +58 -1
  25. package/dist/adapters/openai-stream.d.ts +58 -0
  26. package/dist/adapters/openai-stream.d.ts.map +1 -0
  27. package/dist/adapters/openai-stream.js +120 -0
  28. package/dist/adapters/openai.d.ts +6 -0
  29. package/dist/adapters/openai.d.ts.map +1 -1
  30. package/dist/adapters/openai.js +60 -1
  31. package/dist/adapters/sampling.d.ts +28 -0
  32. package/dist/adapters/sampling.d.ts.map +1 -0
  33. package/dist/adapters/sampling.js +34 -0
  34. package/dist/adapters/tool-mapping.d.ts +92 -0
  35. package/dist/adapters/tool-mapping.d.ts.map +1 -0
  36. package/dist/adapters/tool-mapping.js +143 -0
  37. package/dist/artifacts/artifact.d.ts +137 -0
  38. package/dist/artifacts/artifact.d.ts.map +1 -0
  39. package/dist/artifacts/artifact.js +377 -0
  40. package/dist/artifacts/content-uploader.d.ts +87 -0
  41. package/dist/artifacts/content-uploader.d.ts.map +1 -0
  42. package/dist/artifacts/content-uploader.js +124 -0
  43. package/dist/artifacts/index.d.ts +63 -0
  44. package/dist/artifacts/index.d.ts.map +1 -0
  45. package/dist/artifacts/index.js +80 -0
  46. package/dist/artifacts/run-context.d.ts +129 -0
  47. package/dist/artifacts/run-context.d.ts.map +1 -0
  48. package/dist/artifacts/run-context.js +208 -0
  49. package/dist/artifacts/scrub.d.ts +60 -0
  50. package/dist/artifacts/scrub.d.ts.map +1 -0
  51. package/dist/artifacts/scrub.js +139 -0
  52. package/dist/artifacts/step.d.ts +26 -0
  53. package/dist/artifacts/step.d.ts.map +1 -0
  54. package/dist/artifacts/step.js +37 -0
  55. package/dist/artifacts/taint.d.ts +63 -0
  56. package/dist/artifacts/taint.d.ts.map +1 -0
  57. package/dist/artifacts/taint.js +76 -0
  58. package/dist/bakeoff/cache-sim.d.ts +99 -0
  59. package/dist/bakeoff/cache-sim.d.ts.map +1 -0
  60. package/dist/bakeoff/cache-sim.js +126 -0
  61. package/dist/bakeoff/eval-cases.d.ts +96 -0
  62. package/dist/bakeoff/eval-cases.d.ts.map +1 -0
  63. package/dist/bakeoff/eval-cases.js +105 -0
  64. package/dist/bakeoff/report.d.ts +41 -0
  65. package/dist/bakeoff/report.d.ts.map +1 -0
  66. package/dist/bakeoff/report.js +142 -0
  67. package/dist/bakeoff/samples.d.ts +15 -0
  68. package/dist/bakeoff/samples.d.ts.map +1 -1
  69. package/dist/bakeoff/samples.js +20 -0
  70. package/dist/cli.d.ts +1 -3
  71. package/dist/cli.d.ts.map +1 -1
  72. package/dist/cli.js +134 -116
  73. package/dist/config.d.ts +100 -0
  74. package/dist/config.d.ts.map +1 -1
  75. package/dist/config.js +104 -0
  76. package/dist/deprecations.d.ts +32 -0
  77. package/dist/deprecations.d.ts.map +1 -0
  78. package/dist/deprecations.js +59 -0
  79. package/dist/gateway/http-protocol.d.ts +175 -0
  80. package/dist/gateway/http-protocol.d.ts.map +1 -0
  81. package/dist/gateway/http-protocol.js +105 -0
  82. package/dist/index.d.ts +106 -19
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +266 -138
  85. package/dist/init/finder.d.ts +15 -0
  86. package/dist/init/finder.d.ts.map +1 -1
  87. package/dist/init/finder.js +46 -0
  88. package/dist/init/init-cli.d.ts +10 -0
  89. package/dist/init/init-cli.d.ts.map +1 -0
  90. package/dist/init/init-cli.js +86 -0
  91. package/dist/init/observe-cli.d.ts +19 -0
  92. package/dist/init/observe-cli.d.ts.map +1 -0
  93. package/dist/init/observe-cli.js +73 -0
  94. package/dist/init/observe.d.ts +81 -0
  95. package/dist/init/observe.d.ts.map +1 -0
  96. package/dist/init/observe.js +245 -0
  97. package/dist/registry/build.d.ts +94 -1
  98. package/dist/registry/build.d.ts.map +1 -1
  99. package/dist/registry/build.js +125 -4
  100. package/dist/registry/cache-policy.d.ts +94 -0
  101. package/dist/registry/cache-policy.d.ts.map +1 -0
  102. package/dist/registry/cache-policy.js +238 -0
  103. package/dist/registry/call-notes.d.ts.map +1 -1
  104. package/dist/registry/call-notes.js +40 -2
  105. package/dist/registry/effective-rate.d.ts +151 -0
  106. package/dist/registry/effective-rate.d.ts.map +1 -0
  107. package/dist/registry/effective-rate.js +156 -0
  108. package/dist/registry/facts.d.ts.map +1 -1
  109. package/dist/registry/facts.js +16 -0
  110. package/dist/registry/parity.d.ts +26 -0
  111. package/dist/registry/parity.d.ts.map +1 -1
  112. package/dist/registry/parity.js +43 -2
  113. package/dist/registry/pricing-shape.d.ts +113 -0
  114. package/dist/registry/pricing-shape.d.ts.map +1 -0
  115. package/dist/registry/pricing-shape.js +123 -0
  116. package/dist/registry/pricing.d.ts +25 -1
  117. package/dist/registry/pricing.d.ts.map +1 -1
  118. package/dist/registry/pricing.js +64 -6
  119. package/dist/rigindex/bootstrap.d.ts +36 -0
  120. package/dist/rigindex/bootstrap.d.ts.map +1 -0
  121. package/dist/rigindex/bootstrap.js +97 -0
  122. package/dist/rigindex/fit.d.ts +24 -0
  123. package/dist/rigindex/fit.d.ts.map +1 -0
  124. package/dist/rigindex/fit.js +76 -0
  125. package/dist/rigindex/gates.d.ts +52 -0
  126. package/dist/rigindex/gates.d.ts.map +1 -0
  127. package/dist/rigindex/gates.js +109 -0
  128. package/dist/rigindex/graph.d.ts +31 -0
  129. package/dist/rigindex/graph.d.ts.map +1 -0
  130. package/dist/rigindex/graph.js +120 -0
  131. package/dist/rigindex/index.d.ts +23 -0
  132. package/dist/rigindex/index.d.ts.map +1 -0
  133. package/dist/rigindex/index.js +112 -0
  134. package/dist/rigindex/types.d.ts +76 -0
  135. package/dist/rigindex/types.d.ts.map +1 -0
  136. package/dist/rigindex/types.js +8 -0
  137. package/dist/routes/cache-lint.d.ts +41 -0
  138. package/dist/routes/cache-lint.d.ts.map +1 -0
  139. package/dist/routes/cache-lint.js +81 -0
  140. package/dist/routes/loader.d.ts +48 -0
  141. package/dist/routes/loader.d.ts.map +1 -1
  142. package/dist/routes/loader.js +167 -0
  143. package/dist/routes/resolved-bundle.d.ts +79 -0
  144. package/dist/routes/resolved-bundle.d.ts.map +1 -0
  145. package/dist/routes/resolved-bundle.js +148 -0
  146. package/dist/routes/sampling-config.d.ts +32 -0
  147. package/dist/routes/sampling-config.d.ts.map +1 -0
  148. package/dist/routes/sampling-config.js +91 -0
  149. package/dist/run/ajv.d.ts +22 -0
  150. package/dist/run/ajv.d.ts.map +1 -0
  151. package/dist/run/ajv.js +32 -0
  152. package/dist/run/cache-handle.d.ts +58 -0
  153. package/dist/run/cache-handle.d.ts.map +1 -0
  154. package/dist/run/cache-handle.js +54 -0
  155. package/dist/run/cache-stamp.d.ts +65 -0
  156. package/dist/run/cache-stamp.d.ts.map +1 -0
  157. package/dist/run/cache-stamp.js +0 -0
  158. package/dist/run/capture-write.d.ts +33 -0
  159. package/dist/run/capture-write.d.ts.map +1 -0
  160. package/dist/run/capture-write.js +55 -0
  161. package/dist/run/cost.d.ts.map +1 -1
  162. package/dist/run/cost.js +1 -1
  163. package/dist/run/dispatch.d.ts +99 -0
  164. package/dist/run/dispatch.d.ts.map +1 -0
  165. package/dist/run/dispatch.js +191 -0
  166. package/dist/run/raw.d.ts +130 -0
  167. package/dist/run/raw.d.ts.map +1 -0
  168. package/dist/run/raw.js +363 -0
  169. package/dist/run/record-attempt.d.ts +40 -0
  170. package/dist/run/record-attempt.d.ts.map +1 -0
  171. package/dist/run/record-attempt.js +99 -0
  172. package/dist/run/resolve.d.ts +75 -2
  173. package/dist/run/resolve.d.ts.map +1 -1
  174. package/dist/run/resolve.js +126 -4
  175. package/dist/run/run.d.ts +14 -0
  176. package/dist/run/run.d.ts.map +1 -1
  177. package/dist/run/run.js +0 -0
  178. package/dist/run/stream.d.ts +49 -0
  179. package/dist/run/stream.d.ts.map +1 -0
  180. package/dist/run/stream.js +87 -0
  181. package/dist/run/validate.d.ts.map +1 -1
  182. package/dist/run/validate.js +6 -7
  183. package/dist/savings/cache-ledger.d.ts +108 -0
  184. package/dist/savings/cache-ledger.d.ts.map +1 -0
  185. package/dist/savings/cache-ledger.js +174 -0
  186. package/dist/savings/cache-reconcile.d.ts +64 -0
  187. package/dist/savings/cache-reconcile.d.ts.map +1 -0
  188. package/dist/savings/cache-reconcile.js +59 -0
  189. package/dist/savings/cache-stats.d.ts +63 -0
  190. package/dist/savings/cache-stats.d.ts.map +1 -0
  191. package/dist/savings/cache-stats.js +108 -0
  192. package/dist/savings/emit.d.ts +13 -0
  193. package/dist/savings/emit.d.ts.map +1 -1
  194. package/dist/savings/emit.js +25 -0
  195. package/dist/savings/swap-execute.d.ts +14 -0
  196. package/dist/savings/swap-execute.d.ts.map +1 -1
  197. package/dist/savings/swap-execute.js +44 -1
  198. package/dist/savings/swaps-client.d.ts +14 -0
  199. package/dist/savings/swaps-client.d.ts.map +1 -1
  200. package/dist/savings/swaps-client.js +16 -2
  201. package/dist/settings/api-fetcher.d.ts +39 -0
  202. package/dist/settings/api-fetcher.d.ts.map +1 -0
  203. package/dist/settings/api-fetcher.js +92 -0
  204. package/dist/settings/index.d.ts +10 -0
  205. package/dist/settings/index.d.ts.map +1 -0
  206. package/dist/settings/index.js +15 -0
  207. package/dist/settings/task-settings.d.ts +91 -0
  208. package/dist/settings/task-settings.d.ts.map +1 -0
  209. package/dist/settings/task-settings.js +116 -0
  210. package/dist/status.d.ts +77 -0
  211. package/dist/status.d.ts.map +1 -0
  212. package/dist/status.js +113 -0
  213. package/dist/telemetry/artifact-store.d.ts +48 -0
  214. package/dist/telemetry/artifact-store.d.ts.map +1 -0
  215. package/dist/telemetry/artifact-store.js +189 -0
  216. package/dist/telemetry/cache-miss-streak.d.ts +79 -0
  217. package/dist/telemetry/cache-miss-streak.d.ts.map +1 -0
  218. package/dist/telemetry/cache-miss-streak.js +99 -0
  219. package/dist/telemetry/capture.d.ts +3 -0
  220. package/dist/telemetry/capture.d.ts.map +1 -1
  221. package/dist/telemetry/capture.js +15 -8
  222. package/dist/telemetry/exporter-setup.d.ts +28 -0
  223. package/dist/telemetry/exporter-setup.d.ts.map +1 -0
  224. package/dist/telemetry/exporter-setup.js +34 -0
  225. package/dist/telemetry/exporter.d.ts +75 -0
  226. package/dist/telemetry/exporter.d.ts.map +1 -1
  227. package/dist/telemetry/exporter.js +324 -47
  228. package/dist/telemetry/health.d.ts +76 -0
  229. package/dist/telemetry/health.d.ts.map +1 -0
  230. package/dist/telemetry/health.js +92 -0
  231. package/dist/telemetry/ingest-protocol.d.ts +152 -3
  232. package/dist/telemetry/ingest-protocol.d.ts.map +1 -1
  233. package/dist/telemetry/ingest-protocol.js +204 -4
  234. package/dist/telemetry/load-error-report.d.ts +24 -0
  235. package/dist/telemetry/load-error-report.d.ts.map +1 -0
  236. package/dist/telemetry/load-error-report.js +50 -0
  237. package/dist/telemetry/otel-map.d.ts +121 -0
  238. package/dist/telemetry/otel-map.d.ts.map +1 -0
  239. package/dist/telemetry/otel-map.js +224 -0
  240. package/dist/telemetry/otel-normalize.d.ts +104 -0
  241. package/dist/telemetry/otel-normalize.d.ts.map +1 -0
  242. package/dist/telemetry/otel-normalize.js +530 -0
  243. package/dist/telemetry/otlp-emitter.d.ts +52 -0
  244. package/dist/telemetry/otlp-emitter.d.ts.map +1 -0
  245. package/dist/telemetry/otlp-emitter.js +144 -0
  246. package/dist/telemetry/otlp-proto.d.ts +29 -0
  247. package/dist/telemetry/otlp-proto.d.ts.map +1 -0
  248. package/dist/telemetry/otlp-proto.js +266 -0
  249. package/dist/telemetry/sinks.d.ts +37 -1
  250. package/dist/telemetry/sinks.d.ts.map +1 -1
  251. package/dist/telemetry/sinks.js +121 -30
  252. package/dist/telemetry/store.d.ts +28 -1
  253. package/dist/telemetry/store.d.ts.map +1 -1
  254. package/dist/telemetry/store.js +218 -3
  255. package/dist/tenancy/api-key-format.d.ts +15 -5
  256. package/dist/tenancy/api-key-format.d.ts.map +1 -1
  257. package/dist/tenancy/api-key-format.js +24 -5
  258. package/dist/types/config-teaching.d.ts +62 -0
  259. package/dist/types/config-teaching.d.ts.map +1 -0
  260. package/dist/types/config-teaching.js +183 -0
  261. package/dist/types/provider.d.ts +147 -1
  262. package/dist/types/provider.d.ts.map +1 -1
  263. package/dist/types/provider.js +21 -1
  264. package/dist/types/route.d.ts +79 -1
  265. package/dist/types/route.d.ts.map +1 -1
  266. package/dist/types/telemetry.d.ts +117 -0
  267. package/dist/types/telemetry.d.ts.map +1 -1
  268. package/dist/validate-cli.d.ts +12 -0
  269. package/dist/validate-cli.d.ts.map +1 -0
  270. package/dist/validate-cli.js +57 -0
  271. package/dist/verify/capture.d.ts +66 -0
  272. package/dist/verify/capture.d.ts.map +1 -0
  273. package/dist/verify/capture.js +180 -0
  274. package/dist/verify/cli-run.d.ts +23 -0
  275. package/dist/verify/cli-run.d.ts.map +1 -0
  276. package/dist/verify/cli-run.js +57 -0
  277. package/dist/verify/diff.d.ts +48 -0
  278. package/dist/verify/diff.d.ts.map +1 -0
  279. package/dist/verify/diff.js +157 -0
  280. package/dist/verify/index.d.ts +17 -0
  281. package/dist/verify/index.d.ts.map +1 -0
  282. package/dist/verify/index.js +24 -0
  283. package/dist/verify/report.d.ts +14 -0
  284. package/dist/verify/report.d.ts.map +1 -0
  285. package/dist/verify/report.js +88 -0
  286. package/dist/verify/types.d.ts +101 -0
  287. package/dist/verify/types.d.ts.map +1 -0
  288. package/dist/verify/types.js +17 -0
  289. package/dist/verify/verify.d.ts +29 -0
  290. package/dist/verify/verify.d.ts.map +1 -0
  291. package/dist/verify/verify.js +148 -0
  292. package/dist/watch/evaluate.d.ts +162 -3
  293. package/dist/watch/evaluate.d.ts.map +1 -1
  294. package/dist/watch/evaluate.js +61 -0
  295. package/dist/watch/monitor.d.ts +116 -0
  296. package/dist/watch/monitor.d.ts.map +1 -0
  297. package/dist/watch/monitor.js +199 -0
  298. package/dist/watch/proposals.d.ts +20 -4
  299. package/dist/watch/proposals.d.ts.map +1 -1
  300. package/dist/watch/proposals.js +31 -3
  301. package/dist/watch/run.d.ts +33 -0
  302. package/dist/watch/run.d.ts.map +1 -1
  303. package/dist/watch/run.js +39 -0
  304. package/package.json +7 -1
  305. package/registry/LICENSE +20 -0
  306. package/registry/leaderboard.json +3639 -0
  307. package/registry/registry.json +7263 -0
  308. package/dist/telemetry/supabase-exporter.d.ts +0 -64
  309. package/dist/telemetry/supabase-exporter.d.ts.map +0 -1
  310. package/dist/telemetry/supabase-exporter.js +0 -211
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Errors that teach, for LOAD-TIME config problems — onboarding-redesign §7 G2.
3
+ *
4
+ * The failure taxonomy in failures-teaching.ts classifies inference ATTEMPTS: a
5
+ * request that ran and went wrong. A malformed route bundle never ran — it is a
6
+ * `RouteConfigError`, deliberately outside that taxonomy (loader.ts §26). So
7
+ * the teaching table covered every way a call can fail and NOT the two things a
8
+ * first-time user actually hits first: a schema path that doesn't resolve, and
9
+ * a `{{variable}}` nobody declared. The setup flow's `failed` state and the
10
+ * docs' "when it doesn't work" sections both draw their copy from here, so
11
+ * `failed` has something precise to say exactly when it matters most.
12
+ *
13
+ * A `RouteConfigError` carries `.problems: string[]` — each a message the
14
+ * loader produced. This module classifies each into a SHAPE and attaches the
15
+ * three things a stuck author needs, in order: what it means, what to do, where
16
+ * to read. The completeness test makes every shape carry all three.
17
+ *
18
+ * NOTE what is deliberately NOT here: a `json: native` claim on a model that
19
+ * cannot hold it. The loader ACCEPTS that syntactically — it is a claim about
20
+ * the model, checked against the probed registry, not a config error. It loads
21
+ * and then behaves unlike the code it replaced, which is why the agent prompt
22
+ * (§3.5) states it as a constraint instead.
23
+ */
24
+ import type { RouteConfigError } from "../routes/loader";
25
+ export type ConfigProblemShape = "missing_schema" | "missing_prompt" | "undeclared_variable" | "unknown_provider" | "no_candidates" | "invalid_policy" | "invalid_cache" | "invalid_structure" | "duplicate_route" | "unknown_route" | "other";
26
+ export interface ConfigTeaching {
27
+ readonly shape: ConfigProblemShape;
28
+ /** One sentence: what this problem MEANS, in the author's terms. */
29
+ readonly what: string;
30
+ /** The action to take — an instruction, not a diagnosis. */
31
+ readonly fixHint: string;
32
+ /** A deep link with a per-shape anchor, never a homepage. */
33
+ readonly docsUrl: string;
34
+ }
35
+ export declare const CONFIG_TEACHING: Readonly<Record<ConfigProblemShape, ConfigTeaching>>;
36
+ /** Map one loader problem string to its shape. Ordered most-specific first. */
37
+ export declare function classifyConfigProblem(problem: string): ConfigProblemShape;
38
+ export interface TeachableConfigProblem extends ConfigTeaching {
39
+ /** The raw loader message — this is literally "what we found". */
40
+ readonly problem: string;
41
+ }
42
+ /** Teach every problem a RouteConfigError carries. */
43
+ export declare function teachConfigError(error: RouteConfigError): {
44
+ readonly file: string | null;
45
+ readonly problems: readonly TeachableConfigProblem[];
46
+ };
47
+ /**
48
+ * The `failed`-state triple §3.1 asks for — what we looked for, what we found
49
+ * instead, and the most likely causes — for a route bundle that would not load.
50
+ * This is what the setup flow's `failed` state renders, and it is why that
51
+ * state can now describe its own absence instead of presenting as silence.
52
+ */
53
+ export interface ConfigFailedState {
54
+ readonly lookedFor: string;
55
+ readonly found: readonly string[];
56
+ readonly causes: readonly string[];
57
+ readonly docsUrls: readonly string[];
58
+ }
59
+ export declare function describeConfigFailure(error: RouteConfigError): ConfigFailedState;
60
+ /** Terminal-friendly rendering — parity with renderFailureForTerminal. */
61
+ export declare function renderConfigErrorForTerminal(error: RouteConfigError): string;
62
+ //# sourceMappingURL=config-teaching.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-teaching.d.ts","sourceRoot":"","sources":["../../src/types/config-teaching.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,MAAM,kBAAkB,GAC1B,gBAAgB,GAChB,gBAAgB,GAChB,qBAAqB,GACrB,kBAAkB,GAClB,eAAe,GACf,gBAAgB,GAChB,eAAe,GACf,mBAAmB,GACnB,iBAAiB,GACjB,eAAe,GACf,OAAO,CAAC;AAEZ,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC;IACnC,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAID,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAgHhF,CAAC;AAEF,+EAA+E;AAC/E,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB,CAezE;AAED,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC5D,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,sDAAsD;AACtD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,GAAG;IACzD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,SAAS,sBAAsB,EAAE,CAAC;CACtD,CAWA;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,gBAAgB,GAAG,iBAAiB,CAUhF;AAED,0EAA0E;AAC1E,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAQ5E"}
@@ -0,0 +1,183 @@
1
+ "use strict";
2
+ /**
3
+ * Errors that teach, for LOAD-TIME config problems — onboarding-redesign §7 G2.
4
+ *
5
+ * The failure taxonomy in failures-teaching.ts classifies inference ATTEMPTS: a
6
+ * request that ran and went wrong. A malformed route bundle never ran — it is a
7
+ * `RouteConfigError`, deliberately outside that taxonomy (loader.ts §26). So
8
+ * the teaching table covered every way a call can fail and NOT the two things a
9
+ * first-time user actually hits first: a schema path that doesn't resolve, and
10
+ * a `{{variable}}` nobody declared. The setup flow's `failed` state and the
11
+ * docs' "when it doesn't work" sections both draw their copy from here, so
12
+ * `failed` has something precise to say exactly when it matters most.
13
+ *
14
+ * A `RouteConfigError` carries `.problems: string[]` — each a message the
15
+ * loader produced. This module classifies each into a SHAPE and attaches the
16
+ * three things a stuck author needs, in order: what it means, what to do, where
17
+ * to read. The completeness test makes every shape carry all three.
18
+ *
19
+ * NOTE what is deliberately NOT here: a `json: native` claim on a model that
20
+ * cannot hold it. The loader ACCEPTS that syntactically — it is a claim about
21
+ * the model, checked against the probed registry, not a config error. It loads
22
+ * and then behaves unlike the code it replaced, which is why the agent prompt
23
+ * (§3.5) states it as a constraint instead.
24
+ */
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.CONFIG_TEACHING = void 0;
27
+ exports.classifyConfigProblem = classifyConfigProblem;
28
+ exports.teachConfigError = teachConfigError;
29
+ exports.describeConfigFailure = describeConfigFailure;
30
+ exports.renderConfigErrorForTerminal = renderConfigErrorForTerminal;
31
+ const DOCS_BASE = "https://modelrig.dev/route-bundles.html";
32
+ exports.CONFIG_TEACHING = {
33
+ missing_schema: {
34
+ shape: "missing_schema",
35
+ what: "The bundle's `schema:` names a JSON Schema file, and there is no file at that path relative " +
36
+ "to the bundle. The route can't validate output it can't find the shape for, so it never loads.",
37
+ fixHint: "Create the schema file at the exact path the bundle names (paths resolve relative to the " +
38
+ "bundle's own directory), or set `schema: null` if this task is genuinely free-form.",
39
+ docsUrl: `${DOCS_BASE}#missing_schema`,
40
+ },
41
+ missing_prompt: {
42
+ shape: "missing_prompt",
43
+ what: "The bundle's `prompt.system:` names a template file that isn't at that path. A route with no " +
44
+ "prompt has nothing to send, so it fails at load rather than at the first call.",
45
+ fixHint: "Create the prompt file at the path the bundle names (relative to the bundle), or point " +
46
+ "`prompt.system` at where the file actually is.",
47
+ docsUrl: `${DOCS_BASE}#missing_prompt`,
48
+ },
49
+ undeclared_variable: {
50
+ shape: "undeclared_variable",
51
+ what: "The prompt template references a `{{variable}}` that `prompt.variables` doesn't declare. " +
52
+ "Undeclared references are rejected at load so a typo can't silently ship an empty slot.",
53
+ fixHint: "Add the variable to `prompt.variables`, or fix the reference in the template if it's a typo. " +
54
+ "Every `{{name}}` in the template (and in `grounding.query`) must appear in the declared list.",
55
+ docsUrl: `${DOCS_BASE}#undeclared_variable`,
56
+ },
57
+ unknown_provider: {
58
+ shape: "unknown_provider",
59
+ what: "A candidate names a provider the SDK has no adapter for, so nothing could ever serve that " +
60
+ "candidate.",
61
+ fixHint: "Use a provider the SDK ships an adapter for (gemini, openai, deepseek, anthropic, grok), and " +
62
+ "pick the model from the probed registry rather than from memory.",
63
+ docsUrl: `${DOCS_BASE}#unknown_provider`,
64
+ },
65
+ no_candidates: {
66
+ shape: "no_candidates",
67
+ what: "The route declares no candidates, so it has nothing it is allowed to serve — the candidate " +
68
+ "set is the upper bound, and an empty one bounds it to nothing.",
69
+ fixHint: "List at least one `{provider, model}` under `candidates:`. Every model the route may ever " +
70
+ "use has to be named here; nothing outside this list can serve it.",
71
+ docsUrl: `${DOCS_BASE}#no_candidates`,
72
+ },
73
+ invalid_policy: {
74
+ shape: "invalid_policy",
75
+ what: "A value under `policy` is out of range — a retry count, a timeout, the tier, or the json " +
76
+ "mode — so the route's behaviour would be undefined.",
77
+ fixHint: "Check the policy block against the reference: retries are non-negative integers keyed by a " +
78
+ "retryable failure class, `timeout_ms` is a positive integer, `tier` is standard|flex|priority, " +
79
+ "`json` is native|json_mode.",
80
+ docsUrl: `${DOCS_BASE}#invalid_policy`,
81
+ },
82
+ invalid_cache: {
83
+ shape: "invalid_cache",
84
+ what: "The bundle's `cache:` is set to a value the loader doesn't accept. Request-path caching has " +
85
+ 'exactly one setting in v1 — `cache: auto` — which lets the SDK opt each provider into its ' +
86
+ "native prompt cache (and stamp a stable-prefix fingerprint for savings tracking).",
87
+ fixHint: 'Set `cache: auto` to turn on request-path caching for this route, or remove the `cache:` line ' +
88
+ "to leave it off. Gemini candidates need no opt-in — they cache implicitly and are skipped " +
89
+ "automatically even on an `auto` route.",
90
+ docsUrl: `${DOCS_BASE}#invalid_cache`,
91
+ },
92
+ invalid_structure: {
93
+ shape: "invalid_structure",
94
+ what: "The bundle isn't a well-formed route: it's not valid YAML, not a mapping, or missing the " +
95
+ "`route`/`version` a bundle must carry.",
96
+ fixHint: "Open the file and check it parses as YAML and has a non-empty `route:` and an integer " +
97
+ "`version:` at the top level. Copy the starter bundle if in doubt.",
98
+ docsUrl: `${DOCS_BASE}#invalid_structure`,
99
+ },
100
+ duplicate_route: {
101
+ shape: "duplicate_route",
102
+ what: "Two bundles in the routes directory declare the same `route:` name, so which one wins would " +
103
+ "be ambiguous.",
104
+ fixHint: "Give each route a unique name, or delete the duplicate bundle. Route names are the keys your " +
105
+ "code calls by, so they must be one-to-one with files.",
106
+ docsUrl: `${DOCS_BASE}#duplicate_route`,
107
+ },
108
+ unknown_route: {
109
+ shape: "unknown_route",
110
+ what: "Something asked to run a route no bundle defines — usually a name typo, or a bundle that " +
111
+ "isn't in the routes directory the SDK is reading.",
112
+ fixHint: "Check the route name against the bundles present, and confirm MODELRIG_ROUTES_DIR points at " +
113
+ "the directory that holds them.",
114
+ docsUrl: `${DOCS_BASE}#unknown_route`,
115
+ },
116
+ other: {
117
+ shape: "other",
118
+ what: "The route bundle is invalid in a way the loader reported but this table hasn't shaped yet.",
119
+ fixHint: "Read the exact problem the loader printed — it names the field — and check that field against " +
120
+ "the route-bundle reference.",
121
+ docsUrl: `${DOCS_BASE}#route-bundles`,
122
+ },
123
+ };
124
+ /** Map one loader problem string to its shape. Ordered most-specific first. */
125
+ function classifyConfigProblem(problem) {
126
+ const p = problem.toLowerCase();
127
+ if (/schema file not found/.test(p))
128
+ return "missing_schema";
129
+ if (/prompt\.system file not found/.test(p))
130
+ return "missing_prompt";
131
+ if (/references undeclared variable/.test(p))
132
+ return "undeclared_variable";
133
+ if (/is not a known provider/.test(p))
134
+ return "unknown_provider";
135
+ if (/candidates must be a non-empty list|candidates\[.*\] must be/.test(p))
136
+ return "no_candidates";
137
+ if (/^policy|policy\.|policy /.test(p))
138
+ return "invalid_policy";
139
+ if (/^cache .*is not supported/.test(p))
140
+ return "invalid_cache";
141
+ if (/invalid yaml|must be a yaml mapping|^route must be|^version must be/.test(p)) {
142
+ return "invalid_structure";
143
+ }
144
+ if (/duplicate route/.test(p))
145
+ return "duplicate_route";
146
+ if (/unknown route|routes directory not found/.test(p))
147
+ return "unknown_route";
148
+ return "other";
149
+ }
150
+ /** Teach every problem a RouteConfigError carries. */
151
+ function teachConfigError(error) {
152
+ // A bundle-level error (bad YAML, not a mapping) has no `.problems` entries;
153
+ // its own message is the problem.
154
+ const raw = error.problems.length > 0 ? error.problems : [error.message];
155
+ return {
156
+ file: error.file,
157
+ problems: raw.map((problem) => {
158
+ const teaching = exports.CONFIG_TEACHING[classifyConfigProblem(problem)];
159
+ return { ...teaching, problem };
160
+ }),
161
+ };
162
+ }
163
+ function describeConfigFailure(error) {
164
+ const taught = teachConfigError(error);
165
+ return {
166
+ lookedFor: error.file
167
+ ? `a route bundle that loads at ${error.file}`
168
+ : "a route bundle that loads",
169
+ found: taught.problems.map((p) => p.problem),
170
+ causes: taught.problems.map((p) => p.fixHint),
171
+ docsUrls: [...new Set(taught.problems.map((p) => p.docsUrl))],
172
+ };
173
+ }
174
+ /** Terminal-friendly rendering — parity with renderFailureForTerminal. */
175
+ function renderConfigErrorForTerminal(error) {
176
+ const taught = teachConfigError(error);
177
+ const header = error.file ? `Route bundle did not load: ${error.file}` : "Route bundle did not load";
178
+ const lines = [header, ""];
179
+ for (const p of taught.problems) {
180
+ lines.push(`• ${p.problem}`, ` ${p.what}`, ` Fix: ${p.fixHint}`, ` Docs: ${p.docsUrl}`, "");
181
+ }
182
+ return lines.join("\n").trimEnd();
183
+ }
@@ -5,7 +5,13 @@
5
5
  */
6
6
  import type { RigFailure } from "./failures";
7
7
  export type ProviderId = "gemini" | "openai" | "deepseek" | "anthropic" | "grok" | "deepinfra" | "fireworks";
8
- export type CapabilityFlag = "structured_native" | "json_mode" | "grounded_native" | "context_cache_explicit" | "prompt_cache_key" | "prefix_cache_implicit" | "tier_flex" | "trace_visible";
8
+ /** Runtime enumeration of every ProviderId — the single list a raw-model lane
9
+ * (`provider/model`) validates against (http gateway spec §3.3). Kept in sync
10
+ * with the `ProviderId` union by the two compile-time assertions below: adding
11
+ * a provider to the union without adding it here (or vice-versa) fails the
12
+ * type-check. */
13
+ export declare const PROVIDER_IDS: readonly ["gemini", "openai", "deepseek", "anthropic", "grok", "deepinfra", "fireworks"];
14
+ export type CapabilityFlag = "structured_native" | "json_mode" | "grounded_native" | "context_cache_explicit" | "prompt_cache_key" | "prefix_cache_implicit" | "tier_flex" | "trace_visible" | "zero_retention";
9
15
  /** The canonical flag enumeration — the single list every static capability
10
16
  * materialization iterates (index.ts, template validation, tests). */
11
17
  export declare const ALL_CAPABILITY_FLAGS: readonly CapabilityFlag[];
@@ -21,6 +27,72 @@ export interface CandidateRef {
21
27
  readonly [candidateBrand]: true;
22
28
  }
23
29
  export type ServiceTier = "standard" | "flex" | "priority";
30
+ /**
31
+ * Sampling parameters a route (RoutePolicy.sampling) or the raw lane may
32
+ * declare (CE-6, spec §2). Every field is optional and ADDITIVE:
33
+ * - ABSENT block ⇒ byte-identical to pre-CE-6 — gemini keeps its ported
34
+ * constants (temperature 1.0 / topP 0.95 / topK 40), and the other adapters
35
+ * keep sending nothing (provider defaults win).
36
+ * - PRESENT field ⇒ sent to the provider AS DECLARED, no silent clamp. The
37
+ * provider is the authority on validity; a rejection surfaces through the
38
+ * normal failure ladder (`invalid_request` → network). Loader ranges are a
39
+ * permissive envelope (temperature 0–2, topP (0,1], maxOutputTokens ≥ 1);
40
+ * per-model constraints are the provider's to enforce.
41
+ */
42
+ export interface SamplingParams {
43
+ /** Overrides an adapter's default/constant when set. Loader checks 0–2. */
44
+ readonly temperature?: number;
45
+ /** Nucleus-sampling top_p. Loader checks (0,1] (exclusive-0, inclusive-1). */
46
+ readonly topP?: number;
47
+ /** Routed-lane exposure of the existing adapter max-output-tokens param —
48
+ * previously settable only on the raw lane. Loader checks integer ≥ 1. */
49
+ readonly maxOutputTokens?: number;
50
+ }
51
+ /** Provider-neutral reasoning/thinking effort (CE-2, spec §3 F3). The name is
52
+ * DELIBERATELY not any single provider's field (`thinkingLevel`,
53
+ * `reasoning_effort`): one declared vocabulary maps to each provider's native
54
+ * shape (gemini `thinkingConfig.thinkingLevel` today; OpenAI `reasoning_effort`
55
+ * the natural follow-up). ADDITIVE and declared-only, exactly like sampling:
56
+ * - ABSENT ⇒ byte-identical dispatch — gemini keeps its hardcoded `"high"` for
57
+ * the thinking-capable models, every other adapter keeps sending nothing.
58
+ * - PRESENT ⇒ honored on a supporting provider/model, or FAIL-CLOSED
59
+ * (classified, never silently dropped) on one that cannot serve it. v1
60
+ * support set = { gemini + thinking-capable model }. */
61
+ export type ReasoningLevel = "minimal" | "low" | "medium" | "high";
62
+ export interface ReasoningParams {
63
+ readonly level: ReasoningLevel;
64
+ }
65
+ /** A single callable tool the model may invoke. `parameters` is a JSON Schema
66
+ * describing the arguments (OpenAI `function` shape). */
67
+ export interface ToolDefinition {
68
+ readonly type: "function";
69
+ readonly function: {
70
+ readonly name: string;
71
+ readonly description?: string;
72
+ /** JSON Schema for the arguments object. */
73
+ readonly parameters?: object;
74
+ };
75
+ }
76
+ /** How the model should choose among the supplied tools. String forms mirror
77
+ * OpenAI (`auto`/`none`/`required`); the object form pins a named function. */
78
+ export type ToolChoice = "auto" | "none" | "required" | {
79
+ readonly type: "function";
80
+ readonly function: {
81
+ readonly name: string;
82
+ };
83
+ };
84
+ /** A tool call emitted by the model, normalized to the OpenAI `tool_calls`
85
+ * shape. `arguments` is the raw JSON STRING the model produced (not parsed) —
86
+ * exactly what OpenAI returns, so callers and the HTTP gateway pass it through
87
+ * unchanged. */
88
+ export interface ToolCall {
89
+ readonly id: string;
90
+ readonly type: "function";
91
+ readonly function: {
92
+ readonly name: string;
93
+ readonly arguments: string;
94
+ };
95
+ }
24
96
  export interface AdapterRequest {
25
97
  readonly candidate: CandidateRef;
26
98
  readonly systemPrompt: string;
@@ -43,11 +115,60 @@ export interface AdapterRequest {
43
115
  */
44
116
  readonly grounding?: boolean;
45
117
  readonly maxOutputTokens?: number;
118
+ /**
119
+ * Declared sampling (CE-6, spec §2). Threaded from `RoutePolicy.sampling`
120
+ * (routed lane, run/dispatch.ts) or from the raw lane's temperature/topP
121
+ * (run/raw.ts). Adapters map each present field and keep their current
122
+ * constants/omissions when the block (or a field) is absent. `maxOutputTokens`
123
+ * here takes precedence over the top-level `maxOutputTokens` above — the two
124
+ * are never both set in practice (the routed lane uses this block, the raw
125
+ * lane the top-level field), but the precedence keeps resolution deterministic
126
+ * (adapters/sampling.ts). */
127
+ readonly sampling?: SamplingParams;
128
+ /**
129
+ * Declared reasoning/thinking effort (CE-2, spec §3 F3). Threaded from the raw
130
+ * lane's `RawRunInput.reasoning` (run/raw.ts); the routed lane does not carry
131
+ * it in v1 (`policy.reasoning` can join `policy.sampling` later). Adapters map
132
+ * the neutral `level` to their native field and keep their current default
133
+ * when it is absent (gemini's hardcoded `"high"`). Declared on a provider or
134
+ * model that cannot serve reasoning is FAIL-CLOSED, never silently dropped —
135
+ * the raw-lane guard rejects the wrong provider pre-dispatch (run/raw.ts) and
136
+ * the gemini adapter rejects a non-thinking model (adapters/gemini.ts).
137
+ */
138
+ readonly reasoning?: ReasoningParams;
139
+ /** Unified tool-calling (spec §4.4) — tools the model may call. Adapters map
140
+ * to native tool shapes; absent => no tool surface (identical to today). */
141
+ readonly tools?: readonly ToolDefinition[];
142
+ /** Tool-selection directive; only meaningful alongside `tools`. */
143
+ readonly toolChoice?: ToolChoice;
46
144
  }
47
145
  export interface AdapterUsage {
146
+ /**
147
+ * Total input tokens for this attempt. NORMALIZATION INVARIANT (cache-aware
148
+ * accounting, WS-A / spec §2): `tokensIn` INCLUDES both `tokensCached` (cache
149
+ * reads) and `tokensCacheWrite` (cache creation) as SUBSETS — never a
150
+ * partition. Every adapter maps to this convention (the anthropic adapter
151
+ * adds cache_read + cache_creation back onto its `input_tokens`, which the
152
+ * provider reports EXCLUSIVE of them — research §4). Cost math
153
+ * (`estimateCostUsd`) relies on it: `uncached = tokensIn − cached − write`.
154
+ */
48
155
  readonly tokensIn: number;
49
156
  readonly tokensOut: number;
157
+ /** Cache-READ input tokens — a subset of `tokensIn`, billed at the read rate. */
50
158
  readonly tokensCached: number;
159
+ /**
160
+ * Cache-CREATION (write) input tokens — a subset of `tokensIn`, billed at the
161
+ * write rate (a premium on some providers: Anthropic 1.25× 5m / 2× 1h, OpenAI
162
+ * 5.6+ 1.25×; free elsewhere). OPTIONAL and additive (WS-A): adapters that do
163
+ * not report cache writes (deepseek, gemini, older OpenAI) omit it and it is
164
+ * read as 0 downstream — so those adapters need NO change. Only anthropic and
165
+ * the openai-dialect adapters (GPT-5.6+ `cache_write_tokens`) set it.
166
+ */
167
+ readonly tokensCacheWrite?: number;
168
+ /** The 1h-TTL portion of `tokensCacheWrite` (Anthropic only; bills at the
169
+ * higher 2× multiplier). A subset of `tokensCacheWrite`. Optional/additive:
170
+ * absent ⇒ 0, i.e. all cache-write was the default (5m) tier. */
171
+ readonly tokensCacheWrite1h?: number;
51
172
  readonly servedTier: ServiceTier;
52
173
  /** Time to first body byte, ms (Phase 4 WS3 — headers lie on inference
53
174
  * servers; TTFB is the honest slowness signal). Streaming adapters stamp
@@ -60,6 +181,11 @@ export type AdapterResult = {
60
181
  readonly ok: true;
61
182
  readonly text: string;
62
183
  readonly usage: AdapterUsage;
184
+ /** Normalized tool calls the model emitted (spec §4.4) — present only
185
+ * when the request supplied `tools` and the model chose to call one.
186
+ * A tool-call turn carries these instead of (or alongside) `text`; the
187
+ * run loop surfaces them and does NOT schema-validate the turn. */
188
+ readonly toolCalls?: readonly ToolCall[];
63
189
  }
64
190
  /** F1 (C1 finding, closed Phase 3 step 0): failures that still BILLED
65
191
  * tokens (refusals, truncations, post-stream rejections) carry `usage` so
@@ -70,10 +196,30 @@ export type AdapterResult = {
70
196
  readonly failure: RigFailure;
71
197
  readonly usage?: AdapterUsage;
72
198
  };
199
+ /** One event from an adapter's streaming variant (G-1/G-5 Phase A). A stream
200
+ * emits zero or more `delta` events (raw, pre-validation text) and closes with
201
+ * exactly one `final` carrying the same `AdapterResult` `call()` would return —
202
+ * so the run loop's cost/validation/telemetry logic is identical for streamed
203
+ * and buffered dispatch. */
204
+ export type AdapterStreamEvent = {
205
+ readonly kind: "delta";
206
+ readonly text: string;
207
+ } | {
208
+ readonly kind: "final";
209
+ readonly result: AdapterResult;
210
+ };
73
211
  export interface ProviderAdapter {
74
212
  readonly id: ProviderId;
75
213
  supports(feature: CapabilityFlag, model: string): boolean;
214
+ /** Whether this model exposes native tool-calling (spec §4.4). Optional and
215
+ * additive: absent => unknown/unsupported. Separate from CapabilityFlag on
216
+ * purpose — tool support is a call-shaping fact, not a probed/registry
217
+ * capability, so it stays out of the flag machinery (ZDR, claims, templates). */
218
+ supportsTools?(model: string): boolean;
76
219
  call(req: AdapterRequest): Promise<AdapterResult>;
220
+ /** Optional streaming variant (spec §4.3). Adapters that can stream deltas
221
+ * implement it; the run loop falls back to `call()` (buffered) when absent. */
222
+ stream?(req: AdapterRequest): AsyncIterable<AdapterStreamEvent>;
77
223
  }
78
224
  export {};
79
225
  //# sourceMappingURL=provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/types/provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,MAAM,UAAU,GAClB,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,WAAW,GACX,MAAM,GAGN,WAAW,GACX,WAAW,CAAC;AAEhB,MAAM,MAAM,cAAc,GACtB,mBAAmB,GACnB,WAAW,GACX,iBAAiB,GACjB,wBAAwB,GACxB,kBAAkB,GAClB,uBAAuB,GACvB,WAAW,GACX,eAAe,CAAC;AAEpB;sEACsE;AACtE,eAAO,MAAM,oBAAoB,EAAE,SAAS,cAAc,EASzD,CAAC;AAEF,OAAO,CAAC,MAAM,cAAc,EAAE,OAAO,MAAM,CAAC;AAE5C;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC9B,QAAQ,CAAC,KAAK,EA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M,aAAa,GACrB;IACE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAClB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B;;;uEAGmE;IACnE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;CAC1C;AACH;;;8EAG8E;GAC5E;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAA;CAAE,CAAC;AAExF;;;;4BAI4B;AAC5B,MAAM,MAAM,kBAAkB,GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;CAAE,CAAC;AAE/D,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1D;;;qFAGiF;IACjF,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IACvC,IAAI,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAClD;mFAC+E;IAC/E,MAAM,CAAC,CAAC,GAAG,EAAE,cAAc,GAAG,aAAa,CAAC,kBAAkB,CAAC,CAAC;CACjE"}
@@ -5,7 +5,26 @@
5
5
  * and CandidateRef is a branded type constructible ONLY in run/resolve.ts.
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.ALL_CAPABILITY_FLAGS = void 0;
8
+ exports.ALL_CAPABILITY_FLAGS = exports.PROVIDER_IDS = void 0;
9
+ /** Runtime enumeration of every ProviderId — the single list a raw-model lane
10
+ * (`provider/model`) validates against (http gateway spec §3.3). Kept in sync
11
+ * with the `ProviderId` union by the two compile-time assertions below: adding
12
+ * a provider to the union without adding it here (or vice-versa) fails the
13
+ * type-check. */
14
+ exports.PROVIDER_IDS = [
15
+ "gemini",
16
+ "openai",
17
+ "deepseek",
18
+ "anthropic",
19
+ "grok",
20
+ "deepinfra",
21
+ "fireworks",
22
+ ];
23
+ // Every entry is a valid ProviderId …
24
+ const _providerIdsAreValid = exports.PROVIDER_IDS;
25
+ const _noMissingProviderId = true;
26
+ void _providerIdsAreValid;
27
+ void _noMissingProviderId;
9
28
  /** The canonical flag enumeration — the single list every static capability
10
29
  * materialization iterates (index.ts, template validation, tests). */
11
30
  exports.ALL_CAPABILITY_FLAGS = [
@@ -17,4 +36,5 @@ exports.ALL_CAPABILITY_FLAGS = [
17
36
  "prefix_cache_implicit",
18
37
  "tier_flex",
19
38
  "trace_visible",
39
+ "zero_retention",
20
40
  ];
@@ -3,7 +3,7 @@
3
3
  * routes/loader.ts; frozen after load.
4
4
  */
5
5
  import type { FailureClass } from "./failures";
6
- import type { ProviderId, ServiceTier } from "./provider";
6
+ import type { ProviderId, SamplingParams, ServiceTier, ToolCall, ToolChoice, ToolDefinition } from "./provider";
7
7
  export interface CandidateSpec {
8
8
  readonly provider: ProviderId;
9
9
  readonly model: string;
@@ -16,6 +16,15 @@ export interface RoutePolicy {
16
16
  readonly timeoutMs: number;
17
17
  readonly tier: ServiceTier;
18
18
  readonly json: "native" | "json_mode";
19
+ /**
20
+ * Declared sampling (CE-6, spec §2) — `temperature`/`top_p`/`max_output_tokens`
21
+ * the original call used, parsed+validated at bundle load (config errors,
22
+ * fail-loud). Optional & additive (S3): ABSENT ⇒ every adapter behaves exactly
23
+ * as pre-CE-6 (gemini keeps its ported constants, the rest send nothing). The
24
+ * block is threaded onto `AdapterRequest.sampling` for the primary AND repair
25
+ * attempts (repair/extractor followups inherit the route's sampling — one knob
26
+ * per route, not per rung). */
27
+ readonly sampling?: SamplingParams;
19
28
  }
20
29
  /** Repair rung config (Phase 3 WS2, ladder rung 4). */
21
30
  export interface RepairPolicy {
@@ -67,6 +76,14 @@ export interface RouteBundle {
67
76
  readonly variants: readonly RouteVariant[];
68
77
  /** Local-only replay capture opt-in (Phase 3 WS4) — default false. */
69
78
  readonly capture: boolean;
79
+ /** Request-path caching opt-in (cache-aware-routing WS-C, YAML `cache: auto`)
80
+ * — when true the run loop stamps `AdapterRequest.cache` (gated per provider
81
+ * cache policy) and the stable-prefix fingerprint onto telemetry. Optional &
82
+ * additive (S3): absent ⇒ false ⇒ pre-WS-C behavior (no cache stamping).
83
+ * Gemini candidates on a `cache: auto` route are excluded from request-path
84
+ * stamping and rely on implicit caching — enforced by the policy gate in
85
+ * cache-stamp.ts, not by prose. */
86
+ readonly cache?: boolean;
70
87
  /** Grounding-inject search-query template (Phase 3 WS3) — rendered with
71
88
  * the same variables as the system template; absent = the capped rendered
72
89
  * prompt is used as the query (adequate only for short prompts). */
@@ -85,10 +102,67 @@ export interface RunOptions {
85
102
  readonly tags: RunTags;
86
103
  readonly budget?: {
87
104
  readonly envelope: string;
105
+ /** Budget for this envelope when it is FIRST opened (open-or-get: the first
106
+ * opener's budget wins; a pre-existing envelope is never resized). Omitted →
107
+ * the rig's default `envelopeBudgetUsd`. The hosted gateway's mirror lane
108
+ * sets this to the per-org daily cap so a customer's MANAGED spend is bounded
109
+ * independently of the deployment's own daily envelope (spend-safety). */
110
+ readonly budgetUsd?: number;
88
111
  };
89
112
  /** Named variant to serve (Phase 3 WS1); omitted = the default variant
90
113
  * (the route's base config). Unknown names are config errors. */
91
114
  readonly variant?: string;
115
+ /** Per-run data-governance opt-in (G-3). `true` demands zero-retention
116
+ * routing for THIS run — `zero_retention` is unioned into the run's effective
117
+ * `require`, so it routes only to ZDR-designated endpoints (empty set →
118
+ * the existing no-eligible-candidate error, fail-closed). Additive only: a run
119
+ * may opt INTO the requirement, never opt OUT of a route's declared one
120
+ * (opting out would be a governance downgrade). Absent/false = the route's
121
+ * declared `require` stands. */
122
+ readonly zeroRetention?: boolean;
123
+ /** Per-run price ceiling (G-2). Drops any candidate whose blended in+out
124
+ * snapshot rate exceeds this — the SAME rate `prefer:[cost]` sorts on, so
125
+ * filter and sort agree. Unknown cost + a ceiling set → dropped (fail-closed,
126
+ * like the envelope). Distinct from the per-run envelope, which caps total
127
+ * spend across attempts; this narrows WHICH models are eligible. */
128
+ readonly maxPriceUsdPerMTok?: number;
129
+ /** Per-run provider allow/deny (G-2), applied before capability + ZDR. */
130
+ readonly providers?: {
131
+ readonly only?: readonly ProviderId[];
132
+ readonly ignore?: readonly ProviderId[];
133
+ };
134
+ /** Unified tool-calling (G-1/G-5 Phase A, spec §4.4) — tools the model may
135
+ * call this run. Passed through to the adapter; a tool-call turn is surfaced
136
+ * on `RunMeta.toolCalls` and is NOT schema-validated. ModelRig normalizes the
137
+ * protocol only — the caller executes the tool. */
138
+ readonly tools?: readonly ToolDefinition[];
139
+ readonly toolChoice?: ToolChoice;
140
+ /**
141
+ * Customer-managed cache handle pass-through (CE-1, spec §2). A provider-native
142
+ * cache identifier the CUSTOMER created and OWNS — gemini `cachedContents/<id>`,
143
+ * or a `prompt_cache_key` value for key-hint providers. It rides straight to
144
+ * `AdapterRequest.cache` for the matching-provider candidate; ModelRig passes
145
+ * it through verbatim and **never creates, refreshes, or deletes the underlying
146
+ * resource** — long jobs that outlive the provider's default TTL need the
147
+ * customer's OWN heartbeat (see modelrig.dev/docs/caching-lifecycle). This wins
148
+ * over the WS-C `cache: auto` generated stamp; absent, WS-C behavior stands
149
+ * byte-for-byte.
150
+ */
151
+ readonly cache?: {
152
+ /** The provider-native cache identifier, forwarded unchanged. */
153
+ readonly key: string;
154
+ /** REQUIRED. The handle names a provider-scoped resource, so it is applied
155
+ * ONLY to candidates of this provider; other candidates (fallbacks) dispatch
156
+ * WITHOUT cache rather than with a handle their provider would reject. Note
157
+ * the model-version caveat: gemini caches bind to the exact model+version, so
158
+ * a same-provider fallback to a DIFFERENT gemini model may fail
159
+ * `cache_invalid` — the retry ladder then re-dispatches that candidate
160
+ * without the handle. */
161
+ readonly provider: ProviderId;
162
+ /** Optional TTL hint forwarded on `AdapterRequest.cache`; informational —
163
+ * the customer's own heartbeat governs the actual resource TTL. */
164
+ readonly ttlSeconds?: number;
165
+ };
92
166
  }
93
167
  export interface RunMeta {
94
168
  /** Telemetry row id of the serving attempt — the handle rig.feedback()
@@ -119,6 +193,10 @@ export interface RunMeta {
119
193
  readonly url: string;
120
194
  readonly title?: string;
121
195
  }>;
196
+ /** Normalized tool calls the model emitted (G-1/G-5 Phase A, spec §4.4) —
197
+ * present only on a tool-call turn, where `validated` is false and
198
+ * `RunResult.output` is null. The caller runs the tool(s) and continues. */
199
+ readonly toolCalls?: readonly ToolCall[];
122
200
  }
123
201
  export interface RunResult {
124
202
  readonly output: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../src/types/route.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG,UAAU,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAChG,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;AAE5C,MAAM,WAAW,WAAW;IAC1B,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;IACxD,QAAQ,CAAC,SAAS,EAAE,MAA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