modelrig 0.0.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +94 -0
- package/LICENSE +201 -0
- package/README.md +145 -8
- package/data/PROVENANCE.md +19 -0
- package/data/pricing-manual.json +22 -0
- package/data/pricing-map.json +46362 -0
- package/data/pricing-overlay.json +419 -0
- package/dist/adapters/anthropic.d.ts +90 -0
- package/dist/adapters/anthropic.d.ts.map +1 -0
- package/dist/adapters/anthropic.js +296 -0
- package/dist/adapters/build-adapters.d.ts +11 -0
- package/dist/adapters/build-adapters.d.ts.map +1 -0
- package/dist/adapters/build-adapters.js +45 -0
- package/dist/adapters/deepseek.d.ts +47 -0
- package/dist/adapters/deepseek.d.ts.map +1 -0
- package/dist/adapters/deepseek.js +216 -0
- package/dist/adapters/gemini.d.ts +44 -0
- package/dist/adapters/gemini.d.ts.map +1 -0
- package/dist/adapters/gemini.js +262 -0
- package/dist/adapters/grok.d.ts +53 -0
- package/dist/adapters/grok.d.ts.map +1 -0
- package/dist/adapters/grok.js +232 -0
- package/dist/adapters/openai-compat.d.ts +80 -0
- package/dist/adapters/openai-compat.d.ts.map +1 -0
- package/dist/adapters/openai-compat.js +244 -0
- package/dist/adapters/openai-stream.d.ts +58 -0
- package/dist/adapters/openai-stream.d.ts.map +1 -0
- package/dist/adapters/openai-stream.js +120 -0
- package/dist/adapters/openai.d.ts +55 -0
- package/dist/adapters/openai.d.ts.map +1 -0
- package/dist/adapters/openai.js +281 -0
- package/dist/adapters/sampling.d.ts +28 -0
- package/dist/adapters/sampling.d.ts.map +1 -0
- package/dist/adapters/sampling.js +34 -0
- package/dist/adapters/tool-mapping.d.ts +92 -0
- package/dist/adapters/tool-mapping.d.ts.map +1 -0
- package/dist/adapters/tool-mapping.js +143 -0
- package/dist/artifacts/artifact.d.ts +137 -0
- package/dist/artifacts/artifact.d.ts.map +1 -0
- package/dist/artifacts/artifact.js +377 -0
- package/dist/artifacts/content-uploader.d.ts +87 -0
- package/dist/artifacts/content-uploader.d.ts.map +1 -0
- package/dist/artifacts/content-uploader.js +124 -0
- package/dist/artifacts/index.d.ts +63 -0
- package/dist/artifacts/index.d.ts.map +1 -0
- package/dist/artifacts/index.js +80 -0
- package/dist/artifacts/run-context.d.ts +129 -0
- package/dist/artifacts/run-context.d.ts.map +1 -0
- package/dist/artifacts/run-context.js +208 -0
- package/dist/artifacts/scrub.d.ts +60 -0
- package/dist/artifacts/scrub.d.ts.map +1 -0
- package/dist/artifacts/scrub.js +139 -0
- package/dist/artifacts/step.d.ts +26 -0
- package/dist/artifacts/step.d.ts.map +1 -0
- package/dist/artifacts/step.js +37 -0
- package/dist/artifacts/taint.d.ts +63 -0
- package/dist/artifacts/taint.d.ts.map +1 -0
- package/dist/artifacts/taint.js +76 -0
- package/dist/bakeoff/cache-sim.d.ts +99 -0
- package/dist/bakeoff/cache-sim.d.ts.map +1 -0
- package/dist/bakeoff/cache-sim.js +126 -0
- package/dist/bakeoff/engine.d.ts +52 -0
- package/dist/bakeoff/engine.d.ts.map +1 -0
- package/dist/bakeoff/engine.js +163 -0
- package/dist/bakeoff/eval-cases.d.ts +96 -0
- package/dist/bakeoff/eval-cases.d.ts.map +1 -0
- package/dist/bakeoff/eval-cases.js +105 -0
- package/dist/bakeoff/replay.d.ts +52 -0
- package/dist/bakeoff/replay.d.ts.map +1 -0
- package/dist/bakeoff/replay.js +94 -0
- package/dist/bakeoff/report.d.ts +41 -0
- package/dist/bakeoff/report.d.ts.map +1 -0
- package/dist/bakeoff/report.js +142 -0
- package/dist/bakeoff/samples.d.ts +77 -0
- package/dist/bakeoff/samples.d.ts.map +1 -0
- package/dist/bakeoff/samples.js +148 -0
- package/dist/bakeoff/stats.d.ts +13 -0
- package/dist/bakeoff/stats.d.ts.map +1 -0
- package/dist/bakeoff/stats.js +48 -0
- package/dist/bakeoff/types.d.ts +37 -0
- package/dist/bakeoff/types.d.ts.map +1 -0
- package/dist/bakeoff/types.js +10 -0
- package/dist/cli.d.ts +25 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +590 -0
- package/dist/config.d.ts +204 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +252 -0
- package/dist/deprecations.d.ts +32 -0
- package/dist/deprecations.d.ts.map +1 -0
- package/dist/deprecations.js +59 -0
- package/dist/feedback/coverage.d.ts +32 -0
- package/dist/feedback/coverage.d.ts.map +1 -0
- package/dist/feedback/coverage.js +95 -0
- package/dist/feedback/feedback.d.ts +35 -0
- package/dist/feedback/feedback.d.ts.map +1 -0
- package/dist/feedback/feedback.js +39 -0
- package/dist/gateway/http-protocol.d.ts +175 -0
- package/dist/gateway/http-protocol.d.ts.map +1 -0
- package/dist/gateway/http-protocol.js +105 -0
- package/dist/index.d.ts +242 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +576 -0
- package/dist/init/finder.d.ts +94 -0
- package/dist/init/finder.d.ts.map +1 -0
- package/dist/init/finder.js +343 -0
- package/dist/init/init-cli.d.ts +10 -0
- package/dist/init/init-cli.d.ts.map +1 -0
- package/dist/init/init-cli.js +86 -0
- package/dist/init/observe-cli.d.ts +19 -0
- package/dist/init/observe-cli.d.ts.map +1 -0
- package/dist/init/observe-cli.js +73 -0
- package/dist/init/observe.d.ts +81 -0
- package/dist/init/observe.d.ts.map +1 -0
- package/dist/init/observe.js +245 -0
- package/dist/init/run.d.ts +99 -0
- package/dist/init/run.d.ts.map +1 -0
- package/dist/init/run.js +281 -0
- package/dist/init/signatures.d.ts +39 -0
- package/dist/init/signatures.d.ts.map +1 -0
- package/dist/init/signatures.js +116 -0
- package/dist/matrix/aggregate.d.ts +89 -0
- package/dist/matrix/aggregate.d.ts.map +1 -0
- package/dist/matrix/aggregate.js +186 -0
- package/dist/query/grammar.d.ts +35 -0
- package/dist/query/grammar.d.ts.map +1 -0
- package/dist/query/grammar.js +279 -0
- package/dist/query/run.d.ts +8 -0
- package/dist/query/run.d.ts.map +1 -0
- package/dist/query/run.js +21 -0
- package/dist/registry/build.d.ts +219 -0
- package/dist/registry/build.d.ts.map +1 -0
- package/dist/registry/build.js +313 -0
- package/dist/registry/cache-policy.d.ts +94 -0
- package/dist/registry/cache-policy.d.ts.map +1 -0
- package/dist/registry/cache-policy.js +238 -0
- package/dist/registry/call-notes.d.ts +11 -0
- package/dist/registry/call-notes.d.ts.map +1 -0
- package/dist/registry/call-notes.js +110 -0
- package/dist/registry/claims.d.ts +63 -0
- package/dist/registry/claims.d.ts.map +1 -0
- package/dist/registry/claims.js +107 -0
- package/dist/registry/effective-rate.d.ts +151 -0
- package/dist/registry/effective-rate.d.ts.map +1 -0
- package/dist/registry/effective-rate.js +156 -0
- package/dist/registry/facts.d.ts +32 -0
- package/dist/registry/facts.d.ts.map +1 -0
- package/dist/registry/facts.js +136 -0
- package/dist/registry/fingerprint.d.ts +20 -0
- package/dist/registry/fingerprint.d.ts.map +1 -0
- package/dist/registry/fingerprint.js +150 -0
- package/dist/registry/parity.d.ts +52 -0
- package/dist/registry/parity.d.ts.map +1 -0
- package/dist/registry/parity.js +82 -0
- package/dist/registry/pricing-shape.d.ts +113 -0
- package/dist/registry/pricing-shape.d.ts.map +1 -0
- package/dist/registry/pricing-shape.js +123 -0
- package/dist/registry/pricing.d.ts +43 -0
- package/dist/registry/pricing.d.ts.map +1 -0
- package/dist/registry/pricing.js +127 -0
- package/dist/registry/rows.d.ts +16 -0
- package/dist/registry/rows.d.ts.map +1 -0
- package/dist/registry/rows.js +57 -0
- package/dist/registry/seed.d.ts +43 -0
- package/dist/registry/seed.d.ts.map +1 -0
- package/dist/registry/seed.js +97 -0
- package/dist/registry/select.d.ts +68 -0
- package/dist/registry/select.d.ts.map +1 -0
- package/dist/registry/select.js +141 -0
- package/dist/registry/staleness.d.ts +18 -0
- package/dist/registry/staleness.d.ts.map +1 -0
- package/dist/registry/staleness.js +39 -0
- package/dist/rigindex/bootstrap.d.ts +36 -0
- package/dist/rigindex/bootstrap.d.ts.map +1 -0
- package/dist/rigindex/bootstrap.js +97 -0
- package/dist/rigindex/fit.d.ts +24 -0
- package/dist/rigindex/fit.d.ts.map +1 -0
- package/dist/rigindex/fit.js +76 -0
- package/dist/rigindex/gates.d.ts +52 -0
- package/dist/rigindex/gates.d.ts.map +1 -0
- package/dist/rigindex/gates.js +109 -0
- package/dist/rigindex/graph.d.ts +31 -0
- package/dist/rigindex/graph.d.ts.map +1 -0
- package/dist/rigindex/graph.js +120 -0
- package/dist/rigindex/index.d.ts +23 -0
- package/dist/rigindex/index.d.ts.map +1 -0
- package/dist/rigindex/index.js +112 -0
- package/dist/rigindex/types.d.ts +76 -0
- package/dist/rigindex/types.d.ts.map +1 -0
- package/dist/rigindex/types.js +8 -0
- package/dist/routes/cache-lint.d.ts +41 -0
- package/dist/routes/cache-lint.d.ts.map +1 -0
- package/dist/routes/cache-lint.js +81 -0
- package/dist/routes/draft.d.ts +83 -0
- package/dist/routes/draft.d.ts.map +1 -0
- package/dist/routes/draft.js +135 -0
- package/dist/routes/loader.d.ts +63 -0
- package/dist/routes/loader.d.ts.map +1 -0
- package/dist/routes/loader.js +574 -0
- package/dist/routes/manifest.d.ts +24 -0
- package/dist/routes/manifest.d.ts.map +1 -0
- package/dist/routes/manifest.js +118 -0
- package/dist/routes/resolved-bundle.d.ts +79 -0
- package/dist/routes/resolved-bundle.d.ts.map +1 -0
- package/dist/routes/resolved-bundle.js +148 -0
- package/dist/routes/sampling-config.d.ts +32 -0
- package/dist/routes/sampling-config.d.ts.map +1 -0
- package/dist/routes/sampling-config.js +91 -0
- package/dist/routes/serveability.d.ts +52 -0
- package/dist/routes/serveability.d.ts.map +1 -0
- package/dist/routes/serveability.js +73 -0
- package/dist/routes/template.d.ts +18 -0
- package/dist/routes/template.d.ts.map +1 -0
- package/dist/routes/template.js +94 -0
- package/dist/run/ajv.d.ts +22 -0
- package/dist/run/ajv.d.ts.map +1 -0
- package/dist/run/ajv.js +32 -0
- package/dist/run/cache-handle.d.ts +58 -0
- package/dist/run/cache-handle.d.ts.map +1 -0
- package/dist/run/cache-handle.js +54 -0
- package/dist/run/cache-stamp.d.ts +65 -0
- package/dist/run/cache-stamp.d.ts.map +1 -0
- package/dist/run/cache-stamp.js +0 -0
- package/dist/run/capture-write.d.ts +33 -0
- package/dist/run/capture-write.d.ts.map +1 -0
- package/dist/run/capture-write.js +55 -0
- package/dist/run/cost.d.ts +26 -0
- package/dist/run/cost.d.ts.map +1 -0
- package/dist/run/cost.js +41 -0
- package/dist/run/dispatch.d.ts +99 -0
- package/dist/run/dispatch.d.ts.map +1 -0
- package/dist/run/dispatch.js +191 -0
- package/dist/run/envelope.d.ts +21 -0
- package/dist/run/envelope.d.ts.map +1 -0
- package/dist/run/envelope.js +45 -0
- package/dist/run/grounding.d.ts +56 -0
- package/dist/run/grounding.d.ts.map +1 -0
- package/dist/run/grounding.js +89 -0
- package/dist/run/raw.d.ts +88 -0
- package/dist/run/raw.d.ts.map +1 -0
- package/dist/run/raw.js +286 -0
- package/dist/run/record-attempt.d.ts +40 -0
- package/dist/run/record-attempt.d.ts.map +1 -0
- package/dist/run/record-attempt.js +99 -0
- package/dist/run/repair.d.ts +36 -0
- package/dist/run/repair.d.ts.map +1 -0
- package/dist/run/repair.js +61 -0
- package/dist/run/resolve.d.ts +99 -0
- package/dist/run/resolve.d.ts.map +1 -0
- package/dist/run/resolve.js +203 -0
- package/dist/run/retry.d.ts +19 -0
- package/dist/run/retry.d.ts.map +1 -0
- package/dist/run/retry.js +50 -0
- package/dist/run/run.d.ts +55 -0
- package/dist/run/run.d.ts.map +1 -0
- package/dist/run/run.js +540 -0
- package/dist/run/stream.d.ts +49 -0
- package/dist/run/stream.d.ts.map +1 -0
- package/dist/run/stream.js +87 -0
- package/dist/run/validate.d.ts +15 -0
- package/dist/run/validate.d.ts.map +1 -0
- package/dist/run/validate.js +55 -0
- package/dist/savings/cache-ledger.d.ts +108 -0
- package/dist/savings/cache-ledger.d.ts.map +1 -0
- package/dist/savings/cache-ledger.js +174 -0
- package/dist/savings/cache-reconcile.d.ts +64 -0
- package/dist/savings/cache-reconcile.d.ts.map +1 -0
- package/dist/savings/cache-reconcile.js +59 -0
- package/dist/savings/cache-stats.d.ts +63 -0
- package/dist/savings/cache-stats.d.ts.map +1 -0
- package/dist/savings/cache-stats.js +108 -0
- package/dist/savings/emit.d.ts +38 -0
- package/dist/savings/emit.d.ts.map +1 -0
- package/dist/savings/emit.js +100 -0
- package/dist/savings/odometer.d.ts +32 -0
- package/dist/savings/odometer.d.ts.map +1 -0
- package/dist/savings/odometer.js +70 -0
- package/dist/savings/swap-execute.d.ts +58 -0
- package/dist/savings/swap-execute.d.ts.map +1 -0
- package/dist/savings/swap-execute.js +130 -0
- package/dist/savings/swaps-client.d.ts +55 -0
- package/dist/savings/swaps-client.d.ts.map +1 -0
- package/dist/savings/swaps-client.js +95 -0
- package/dist/settings/api-fetcher.d.ts +39 -0
- package/dist/settings/api-fetcher.d.ts.map +1 -0
- package/dist/settings/api-fetcher.js +92 -0
- package/dist/settings/index.d.ts +10 -0
- package/dist/settings/index.d.ts.map +1 -0
- package/dist/settings/index.js +15 -0
- package/dist/settings/task-settings.d.ts +91 -0
- package/dist/settings/task-settings.d.ts.map +1 -0
- package/dist/settings/task-settings.js +116 -0
- package/dist/status.d.ts +77 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/status.js +113 -0
- package/dist/telemetry/artifact-store.d.ts +48 -0
- package/dist/telemetry/artifact-store.d.ts.map +1 -0
- package/dist/telemetry/artifact-store.js +189 -0
- package/dist/telemetry/cache-miss-streak.d.ts +79 -0
- package/dist/telemetry/cache-miss-streak.d.ts.map +1 -0
- package/dist/telemetry/cache-miss-streak.js +99 -0
- package/dist/telemetry/capture.d.ts +31 -0
- package/dist/telemetry/capture.d.ts.map +1 -0
- package/dist/telemetry/capture.js +81 -0
- package/dist/telemetry/exporter-setup.d.ts +28 -0
- package/dist/telemetry/exporter-setup.d.ts.map +1 -0
- package/dist/telemetry/exporter-setup.js +34 -0
- package/dist/telemetry/exporter.d.ts +137 -0
- package/dist/telemetry/exporter.d.ts.map +1 -0
- package/dist/telemetry/exporter.js +510 -0
- package/dist/telemetry/health.d.ts +76 -0
- package/dist/telemetry/health.d.ts.map +1 -0
- package/dist/telemetry/health.js +92 -0
- package/dist/telemetry/ingest-protocol.d.ts +310 -0
- package/dist/telemetry/ingest-protocol.d.ts.map +1 -0
- package/dist/telemetry/ingest-protocol.js +363 -0
- package/dist/telemetry/load-error-report.d.ts +24 -0
- package/dist/telemetry/load-error-report.d.ts.map +1 -0
- package/dist/telemetry/load-error-report.js +50 -0
- package/dist/telemetry/otel-map.d.ts +121 -0
- package/dist/telemetry/otel-map.d.ts.map +1 -0
- package/dist/telemetry/otel-map.js +224 -0
- package/dist/telemetry/otel-normalize.d.ts +104 -0
- package/dist/telemetry/otel-normalize.d.ts.map +1 -0
- package/dist/telemetry/otel-normalize.js +530 -0
- package/dist/telemetry/otlp-emitter.d.ts +52 -0
- package/dist/telemetry/otlp-emitter.d.ts.map +1 -0
- package/dist/telemetry/otlp-emitter.js +144 -0
- package/dist/telemetry/otlp-proto.d.ts +29 -0
- package/dist/telemetry/otlp-proto.d.ts.map +1 -0
- package/dist/telemetry/otlp-proto.js +266 -0
- package/dist/telemetry/sinks.d.ts +90 -0
- package/dist/telemetry/sinks.d.ts.map +1 -0
- package/dist/telemetry/sinks.js +180 -0
- package/dist/telemetry/store.d.ts +65 -0
- package/dist/telemetry/store.d.ts.map +1 -0
- package/dist/telemetry/store.js +547 -0
- package/dist/tenancy/api-key-format.d.ts +77 -0
- package/dist/tenancy/api-key-format.d.ts.map +1 -0
- package/dist/tenancy/api-key-format.js +110 -0
- package/dist/tenancy/constants.d.ts +23 -0
- package/dist/tenancy/constants.d.ts.map +1 -0
- package/dist/tenancy/constants.js +25 -0
- package/dist/tenancy/scrub.d.ts +47 -0
- package/dist/tenancy/scrub.d.ts.map +1 -0
- package/dist/tenancy/scrub.js +85 -0
- package/dist/types/config-teaching.d.ts +62 -0
- package/dist/types/config-teaching.d.ts.map +1 -0
- package/dist/types/config-teaching.js +183 -0
- package/dist/types/failures-teaching.d.ts +56 -0
- package/dist/types/failures-teaching.d.ts.map +1 -0
- package/dist/types/failures-teaching.js +177 -0
- package/dist/types/failures.d.ts +27 -0
- package/dist/types/failures.d.ts.map +1 -0
- package/dist/types/failures.js +41 -0
- package/dist/types/provider.d.ts +200 -0
- package/dist/types/provider.d.ts.map +1 -0
- package/dist/types/provider.js +40 -0
- package/dist/types/route.d.ts +205 -0
- package/dist/types/route.d.ts.map +1 -0
- package/dist/types/route.js +6 -0
- package/dist/types/telemetry.d.ts +206 -0
- package/dist/types/telemetry.d.ts.map +1 -0
- package/dist/types/telemetry.js +6 -0
- package/dist/validate-cli.d.ts +12 -0
- package/dist/validate-cli.d.ts.map +1 -0
- package/dist/validate-cli.js +57 -0
- package/dist/verify/capture.d.ts +66 -0
- package/dist/verify/capture.d.ts.map +1 -0
- package/dist/verify/capture.js +180 -0
- package/dist/verify/cli-run.d.ts +23 -0
- package/dist/verify/cli-run.d.ts.map +1 -0
- package/dist/verify/cli-run.js +57 -0
- package/dist/verify/diff.d.ts +48 -0
- package/dist/verify/diff.d.ts.map +1 -0
- package/dist/verify/diff.js +157 -0
- package/dist/verify/index.d.ts +17 -0
- package/dist/verify/index.d.ts.map +1 -0
- package/dist/verify/index.js +24 -0
- package/dist/verify/report.d.ts +14 -0
- package/dist/verify/report.d.ts.map +1 -0
- package/dist/verify/report.js +88 -0
- package/dist/verify/types.d.ts +101 -0
- package/dist/verify/types.d.ts.map +1 -0
- package/dist/verify/types.js +17 -0
- package/dist/verify/verify.d.ts +29 -0
- package/dist/verify/verify.d.ts.map +1 -0
- package/dist/verify/verify.js +148 -0
- package/dist/watch/budget.d.ts +19 -0
- package/dist/watch/budget.d.ts.map +1 -0
- package/dist/watch/budget.js +35 -0
- package/dist/watch/evaluate.d.ts +225 -0
- package/dist/watch/evaluate.d.ts.map +1 -0
- package/dist/watch/evaluate.js +155 -0
- package/dist/watch/monitor.d.ts +116 -0
- package/dist/watch/monitor.d.ts.map +1 -0
- package/dist/watch/monitor.js +199 -0
- package/dist/watch/proposals.d.ts +89 -0
- package/dist/watch/proposals.d.ts.map +1 -0
- package/dist/watch/proposals.js +197 -0
- package/dist/watch/run-record.d.ts +64 -0
- package/dist/watch/run-record.d.ts.map +1 -0
- package/dist/watch/run-record.js +86 -0
- package/dist/watch/run-reported.d.ts +20 -0
- package/dist/watch/run-reported.d.ts.map +1 -0
- package/dist/watch/run-reported.js +53 -0
- package/dist/watch/run.d.ts +73 -0
- package/dist/watch/run.d.ts.map +1 -0
- package/dist/watch/run.js +83 -0
- package/dist/watch/state-store.d.ts +48 -0
- package/dist/watch/state-store.d.ts.map +1 -0
- package/dist/watch/state-store.js +86 -0
- package/dist/watch/state.d.ts +21 -0
- package/dist/watch/state.d.ts.map +1 -0
- package/dist/watch/state.js +93 -0
- package/package.json +56 -14
- package/registry/LICENSE +20 -0
- package/registry/leaderboard.json +3639 -0
- package/registry/registry.json +7263 -0
- package/index.js +0 -3
package/dist/run/raw.js
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The RAW LANE — HTTP gateway Phase C (spec §4.2). A zero-margin BYOK
|
|
4
|
+
* passthrough: the caller names a `provider/model` and supplies (server-side,
|
|
5
|
+
* fail-closed) their own provider key; we dispatch DIRECTLY through the matching
|
|
6
|
+
* adapter and meter the call at the provider's list price. There is NO route, NO
|
|
7
|
+
* capability gate, NO validation, NO repair, NO envelope — and, by contract, NO
|
|
8
|
+
* ModelRig margin on the hop (the never-price-the-hop rule; the cost recorded is
|
|
9
|
+
* exactly `attemptCost`'s list price, which is what the verified lane records
|
|
10
|
+
* too). This module is the SDK half; the server half (BYOK resolution + the
|
|
11
|
+
* `key_ownership` tag) lives in `modelrig-server`.
|
|
12
|
+
*
|
|
13
|
+
* WHY THIS IS AN SDK PRIMITIVE, not server code: `AdapterRequest.candidate` is a
|
|
14
|
+
* branded `CandidateRef` mintable only in `run/resolve.ts`, and adapters are
|
|
15
|
+
* constructed with their key baked in — both live here. The server resolves the
|
|
16
|
+
* BYOK key fail-closed and calls `rig.runRaw`/`rig.runRawStream`; it never
|
|
17
|
+
* touches an adapter or the brand.
|
|
18
|
+
*
|
|
19
|
+
* KNOWN LIMITATIONS (flagged for the architect, not hidden):
|
|
20
|
+
* - The adapter contract is single `systemPrompt` + `userPrompt`, not a
|
|
21
|
+
* `messages[]` array, so a multi-turn transcript is flattened by the caller
|
|
22
|
+
* (see `modelrig-server`'s `deriveRawPrompts`).
|
|
23
|
+
* - CE-6: the raw lane now forwards `temperature`/`topP` (via
|
|
24
|
+
* `AdapterRequest.sampling`) when the caller supplies them; absent, they are
|
|
25
|
+
* still dropped and the dispatch is byte-identical to pre-CE-6. `max_tokens`
|
|
26
|
+
* maps to `maxOutputTokens` (unchanged).
|
|
27
|
+
*/
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.buildRawRequest = buildRawRequest;
|
|
30
|
+
exports.runRaw = runRaw;
|
|
31
|
+
exports.runRawStream = runRawStream;
|
|
32
|
+
const node_crypto_1 = require("node:crypto");
|
|
33
|
+
const anthropic_1 = require("../adapters/anthropic");
|
|
34
|
+
const deepseek_1 = require("../adapters/deepseek");
|
|
35
|
+
const gemini_1 = require("../adapters/gemini");
|
|
36
|
+
const grok_1 = require("../adapters/grok");
|
|
37
|
+
const openai_1 = require("../adapters/openai");
|
|
38
|
+
const openai_compat_1 = require("../adapters/openai-compat");
|
|
39
|
+
const cost_1 = require("./cost");
|
|
40
|
+
const resolve_1 = require("./resolve");
|
|
41
|
+
const failures_1 = require("../types/failures");
|
|
42
|
+
/** Absent a route timeout, the raw lane uses a generous default — a passthrough
|
|
43
|
+
* should not be shorter-fused than the underlying provider SDK. */
|
|
44
|
+
const DEFAULT_RAW_TIMEOUT_MS = 120000;
|
|
45
|
+
/** Conservative compat-host capability baseline — parity with createRig's
|
|
46
|
+
* COMPAT_STATIC. Inconsequential for raw calls (outputSchema is always null, so
|
|
47
|
+
* no JSON shaping fires), kept aligned so a raw and a routed compat call shape
|
|
48
|
+
* identically if a schema is ever added. */
|
|
49
|
+
const RAW_COMPAT_PROFILE = new Set(["json_mode"]);
|
|
50
|
+
/** Construct a THROWAWAY adapter bound to the caller's BYOK key for one call.
|
|
51
|
+
* Each adapter builds its provider client fresh inside `call()`/`stream()`, so
|
|
52
|
+
* a per-call instance carries no shared state and leaks no key. Exhaustive over
|
|
53
|
+
* ProviderId — a new provider forces a compile error here. */
|
|
54
|
+
function buildRawAdapter(provider, apiKey) {
|
|
55
|
+
switch (provider) {
|
|
56
|
+
case "openai":
|
|
57
|
+
return (0, openai_1.createOpenAIAdapter)({ apiKey });
|
|
58
|
+
case "anthropic":
|
|
59
|
+
return (0, anthropic_1.createAnthropicAdapter)({ apiKey });
|
|
60
|
+
case "gemini":
|
|
61
|
+
return (0, gemini_1.createGeminiAdapter)({ apiKey });
|
|
62
|
+
case "grok":
|
|
63
|
+
return (0, grok_1.createGrokAdapter)({ apiKey });
|
|
64
|
+
case "deepseek":
|
|
65
|
+
return (0, deepseek_1.createDeepSeekAdapter)({ apiKey });
|
|
66
|
+
case "deepinfra":
|
|
67
|
+
case "fireworks": {
|
|
68
|
+
const host = openai_compat_1.OPENAI_COMPAT_HOSTS[provider];
|
|
69
|
+
return (0, openai_compat_1.createOpenAICompatAdapter)({
|
|
70
|
+
providerId: provider,
|
|
71
|
+
baseUrl: host.baseUrl,
|
|
72
|
+
apiKey,
|
|
73
|
+
...(host.shapeModelId !== undefined ? { shapeModelId: host.shapeModelId } : {}),
|
|
74
|
+
capabilityProfile: () => RAW_COMPAT_PROFILE,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/** Pure raw-lane request shaping — exported for unit tests (no network). */
|
|
80
|
+
function buildRawRequest(candidate, input) {
|
|
81
|
+
// CE-6: forward temperature/topP through AdapterRequest.sampling ONLY when the
|
|
82
|
+
// caller declared at least one — absent, no `sampling` key is added and the
|
|
83
|
+
// request is byte-identical to pre-CE-6. maxOutputTokens keeps its top-level
|
|
84
|
+
// channel (the adapter resolves sampling.maxOutputTokens ?? maxOutputTokens).
|
|
85
|
+
const sampling = input.temperature !== undefined || input.topP !== undefined
|
|
86
|
+
? {
|
|
87
|
+
...(input.temperature !== undefined ? { temperature: input.temperature } : {}),
|
|
88
|
+
...(input.topP !== undefined ? { topP: input.topP } : {}),
|
|
89
|
+
}
|
|
90
|
+
: undefined;
|
|
91
|
+
return {
|
|
92
|
+
candidate,
|
|
93
|
+
systemPrompt: input.systemPrompt,
|
|
94
|
+
userPrompt: input.userPrompt,
|
|
95
|
+
outputSchema: null, // raw lane never validates — the product distinction
|
|
96
|
+
requestedTier: "standard",
|
|
97
|
+
timeoutMs: input.timeoutMs ?? DEFAULT_RAW_TIMEOUT_MS,
|
|
98
|
+
...(input.maxOutputTokens !== undefined ? { maxOutputTokens: input.maxOutputTokens } : {}),
|
|
99
|
+
...(sampling !== undefined ? { sampling } : {}),
|
|
100
|
+
...(input.tools !== undefined ? { tools: input.tools } : {}),
|
|
101
|
+
...(input.toolChoice !== undefined ? { toolChoice: input.toolChoice } : {}),
|
|
102
|
+
...(input.cache !== undefined ? { cache: input.cache } : {}),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/** Write the metered raw-lane telemetry row. Mirrors the run loop's minimal
|
|
106
|
+
* `recordSearchCostRow` shape: only load-bearing fields set, route = the
|
|
107
|
+
* `provider/model` handle the caller used, lane + key_ownership riding in
|
|
108
|
+
* `tags_json`. The exporter mirrors it on its normal cadence — no lane column,
|
|
109
|
+
* no schema change (telemetry map, 2026-08-10). */
|
|
110
|
+
function recordRawRow(telemetry, p) {
|
|
111
|
+
const row = {
|
|
112
|
+
id: p.id,
|
|
113
|
+
ts: new Date().toISOString(),
|
|
114
|
+
route: p.rawModelId,
|
|
115
|
+
routeVersion: 0,
|
|
116
|
+
provider: p.provider,
|
|
117
|
+
model: p.model,
|
|
118
|
+
requestedTier: "standard",
|
|
119
|
+
servedTier: p.usage?.servedTier ?? "standard",
|
|
120
|
+
tokensIn: p.usage?.tokensIn ?? 0,
|
|
121
|
+
tokensOut: p.usage?.tokensOut ?? 0,
|
|
122
|
+
tokensCached: p.usage?.tokensCached ?? 0,
|
|
123
|
+
tokensCacheWrite: p.usage?.tokensCacheWrite ?? 0,
|
|
124
|
+
tokensCacheWrite1h: p.usage?.tokensCacheWrite1h ?? 0,
|
|
125
|
+
costEstimateUsd: p.costUsd,
|
|
126
|
+
latencyMs: p.latencyMs,
|
|
127
|
+
ttfbMs: p.usage?.ttfbMs ?? null,
|
|
128
|
+
failureClass: p.failureClass,
|
|
129
|
+
attemptsJson: "{}",
|
|
130
|
+
tagsJson: JSON.stringify(p.tags),
|
|
131
|
+
fingerprintCell: null,
|
|
132
|
+
servedVariant: null,
|
|
133
|
+
repairedBy: null,
|
|
134
|
+
pricingMissing: p.pricingMissing,
|
|
135
|
+
// CE-1: a customer cache handle (if supplied) stamps `cache_key`; the raw
|
|
136
|
+
// lane runs no WS-C stamping, so `prefix_fingerprint` is always null and the
|
|
137
|
+
// provenance rule reads any non-null key here as `customer`.
|
|
138
|
+
cacheKey: p.cacheKey ?? null,
|
|
139
|
+
prefixFingerprint: null,
|
|
140
|
+
};
|
|
141
|
+
telemetry.record(row);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Turn an `AdapterResult` into a RunResult, recording exactly one telemetry row.
|
|
145
|
+
* Shared by the buffered and streaming paths so cost/telemetry are byte-identical.
|
|
146
|
+
* On a failure result: record the (possibly billed) row, then throw
|
|
147
|
+
* `RigFailureError` — the server maps it to a status exactly like the slug lane.
|
|
148
|
+
*/
|
|
149
|
+
function finalizeRaw(deps, input, result, latencyMs) {
|
|
150
|
+
const unpricedRatePerTok = (deps.unpricedRateUsdPerMTok ?? cost_1.DEFAULT_UNPRICED_RATE_USD_PER_MTOK) / 1000000;
|
|
151
|
+
const rawModelId = `${input.provider}/${input.model}`;
|
|
152
|
+
// lane is SDK-owned and cannot be overridden by a caller-supplied tag.
|
|
153
|
+
const tags = { ...(input.tags ?? {}), lane: "raw" };
|
|
154
|
+
if (!result.ok) {
|
|
155
|
+
let costUsd = 0;
|
|
156
|
+
let pricingMissing = false;
|
|
157
|
+
if (result.usage !== undefined) {
|
|
158
|
+
const settled = (0, cost_1.attemptCost)(input.provider, input.model, result.usage, unpricedRatePerTok);
|
|
159
|
+
costUsd = settled.costUsd;
|
|
160
|
+
pricingMissing = settled.pricingMissing;
|
|
161
|
+
}
|
|
162
|
+
recordRawRow(deps.telemetry, {
|
|
163
|
+
id: (0, node_crypto_1.randomUUID)(),
|
|
164
|
+
rawModelId,
|
|
165
|
+
provider: input.provider,
|
|
166
|
+
model: input.model,
|
|
167
|
+
...(result.usage !== undefined ? { usage: result.usage } : {}),
|
|
168
|
+
costUsd,
|
|
169
|
+
latencyMs,
|
|
170
|
+
failureClass: result.failure.class,
|
|
171
|
+
tags,
|
|
172
|
+
pricingMissing,
|
|
173
|
+
...(input.cache !== undefined ? { cacheKey: input.cache.key } : {}),
|
|
174
|
+
});
|
|
175
|
+
throw new failures_1.RigFailureError(result.failure);
|
|
176
|
+
}
|
|
177
|
+
const { costUsd, pricingMissing } = (0, cost_1.attemptCost)(input.provider, input.model, result.usage, unpricedRatePerTok);
|
|
178
|
+
const id = (0, node_crypto_1.randomUUID)();
|
|
179
|
+
recordRawRow(deps.telemetry, {
|
|
180
|
+
id,
|
|
181
|
+
rawModelId,
|
|
182
|
+
provider: input.provider,
|
|
183
|
+
model: input.model,
|
|
184
|
+
usage: result.usage,
|
|
185
|
+
costUsd,
|
|
186
|
+
latencyMs,
|
|
187
|
+
failureClass: null,
|
|
188
|
+
tags,
|
|
189
|
+
pricingMissing,
|
|
190
|
+
...(input.cache !== undefined ? { cacheKey: input.cache.key } : {}),
|
|
191
|
+
});
|
|
192
|
+
const toolCalls = result.toolCalls;
|
|
193
|
+
const isToolTurn = toolCalls !== undefined && toolCalls.length > 0;
|
|
194
|
+
const meta = {
|
|
195
|
+
inferenceId: id,
|
|
196
|
+
route: rawModelId,
|
|
197
|
+
routeVersion: 0,
|
|
198
|
+
provider: input.provider,
|
|
199
|
+
model: input.model,
|
|
200
|
+
requestedTier: "standard",
|
|
201
|
+
servedTier: result.usage.servedTier,
|
|
202
|
+
tokensIn: result.usage.tokensIn,
|
|
203
|
+
tokensOut: result.usage.tokensOut,
|
|
204
|
+
tokensCached: result.usage.tokensCached,
|
|
205
|
+
costEstimateUsd: costUsd,
|
|
206
|
+
latencyMs,
|
|
207
|
+
validated: false, // raw is NEVER validated — the central product claim
|
|
208
|
+
attemptsByClass: {},
|
|
209
|
+
servedVariant: null,
|
|
210
|
+
repairedBy: null,
|
|
211
|
+
...(isToolTurn ? { toolCalls } : {}),
|
|
212
|
+
};
|
|
213
|
+
return { output: isToolTurn ? null : result.text, meta };
|
|
214
|
+
}
|
|
215
|
+
/** Buffered raw dispatch (spec §4.2). Records telemetry, returns the RunResult,
|
|
216
|
+
* or throws `RigFailureError` on an adapter failure. */
|
|
217
|
+
async function runRaw(deps, input) {
|
|
218
|
+
const adapter = buildRawAdapter(input.provider, input.apiKey);
|
|
219
|
+
const candidate = (0, resolve_1.mintRawCandidate)(input.provider, input.model);
|
|
220
|
+
const started = Date.now();
|
|
221
|
+
const result = await adapter.call(buildRawRequest(candidate, input));
|
|
222
|
+
return finalizeRaw(deps, input, result, Date.now() - started);
|
|
223
|
+
}
|
|
224
|
+
function streamEndedFailure(input) {
|
|
225
|
+
return {
|
|
226
|
+
ok: false,
|
|
227
|
+
failure: {
|
|
228
|
+
class: "network",
|
|
229
|
+
message: "adapter stream ended without a terminal result",
|
|
230
|
+
provider: input.provider,
|
|
231
|
+
model: input.model,
|
|
232
|
+
},
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Streaming raw dispatch (spec §4.3, "raw lane: true streaming, deltas passed
|
|
237
|
+
* through"). Drains the adapter's own stream when it has one, forwarding raw
|
|
238
|
+
* text deltas, and emits a single terminal `final` RunResult; adapters without
|
|
239
|
+
* `stream` (anthropic/gemini) fall back to a buffered `call()` with no deltas.
|
|
240
|
+
* There is NO terminal-validation event — that is a structured-route concept;
|
|
241
|
+
* the raw lane has no schema and the streamed bytes ARE the answer.
|
|
242
|
+
*/
|
|
243
|
+
function runRawStream(deps, input) {
|
|
244
|
+
let settle;
|
|
245
|
+
let fail;
|
|
246
|
+
const result = new Promise((res, rej) => {
|
|
247
|
+
settle = res;
|
|
248
|
+
fail = rej;
|
|
249
|
+
});
|
|
250
|
+
// Mark handled so an unconsumed rejection never becomes an unhandledRejection;
|
|
251
|
+
// the events iterator surfaces the same error to whoever drains it.
|
|
252
|
+
result.catch(() => { });
|
|
253
|
+
async function* events() {
|
|
254
|
+
const adapter = buildRawAdapter(input.provider, input.apiKey);
|
|
255
|
+
const candidate = (0, resolve_1.mintRawCandidate)(input.provider, input.model);
|
|
256
|
+
const req = buildRawRequest(candidate, input);
|
|
257
|
+
const started = Date.now();
|
|
258
|
+
try {
|
|
259
|
+
let adapterResult;
|
|
260
|
+
if (adapter.stream !== undefined) {
|
|
261
|
+
let final = null;
|
|
262
|
+
for await (const ev of adapter.stream(req)) {
|
|
263
|
+
if (ev.kind === "delta") {
|
|
264
|
+
if (ev.text !== "")
|
|
265
|
+
yield { type: "delta", text: ev.text };
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
final = ev.result;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
adapterResult = final ?? streamEndedFailure(input);
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
adapterResult = await adapter.call(req);
|
|
275
|
+
}
|
|
276
|
+
const runResult = finalizeRaw(deps, input, adapterResult, Date.now() - started);
|
|
277
|
+
settle(runResult);
|
|
278
|
+
yield { type: "final", result: runResult };
|
|
279
|
+
}
|
|
280
|
+
catch (err) {
|
|
281
|
+
fail(err);
|
|
282
|
+
throw err;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return { events: events(), result };
|
|
286
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The run loop's per-attempt telemetry recorder, extracted from run.ts (WS-A).
|
|
3
|
+
*
|
|
4
|
+
* run.ts sits at the 700-LOC cap; threading cache-write accounting through the
|
|
5
|
+
* row builder pushed it over, so the recorder — a self-contained mapping from
|
|
6
|
+
* an `AttemptTelemetry` to a persisted `TelemetryRow` plus the ground-truth
|
|
7
|
+
* step mirror — moves here as a factory over the loop's per-run state. Behavior
|
|
8
|
+
* is byte-identical to the former inline closure, save the additive cache
|
|
9
|
+
* fields. Keeping it separate also shrinks the run-loop conflict surface for the
|
|
10
|
+
* in-flight E4 / capture-write work (plan coordination note).
|
|
11
|
+
*/
|
|
12
|
+
import type { AttemptTelemetry } from "./dispatch";
|
|
13
|
+
import type { ActiveRunContext } from "../artifacts/run-context";
|
|
14
|
+
import type { RetryLedger } from "./retry";
|
|
15
|
+
import type { RouteBundle, RunOptions, RunTags } from "../types/route";
|
|
16
|
+
import type { TelemetryStore } from "../types/telemetry";
|
|
17
|
+
export interface RecordAttemptDeps {
|
|
18
|
+
readonly telemetry: TelemetryStore;
|
|
19
|
+
readonly route: RouteBundle;
|
|
20
|
+
readonly ledger: RetryLedger;
|
|
21
|
+
readonly effectiveTags: RunTags;
|
|
22
|
+
readonly servedVariant: string | null;
|
|
23
|
+
/** Active run context (E2 chunk A) or null when the artifact namespace is off. */
|
|
24
|
+
readonly runCtx: ActiveRunContext | null;
|
|
25
|
+
readonly autoStepKey: string | null;
|
|
26
|
+
/** CE-1: the run's customer cache handle (RunOptions.cache), or undefined.
|
|
27
|
+
* The recorder derives the customer key from the SAME pure gate the request
|
|
28
|
+
* builder uses ({@link customerCacheHandle}), so wire and row never disagree. */
|
|
29
|
+
readonly cache?: RunOptions["cache"];
|
|
30
|
+
/** CE-1 retry-drop: candidate keys whose handle was dropped after a
|
|
31
|
+
* `cache_invalid` (live reference — the run loop mutates it between calls). A
|
|
32
|
+
* dropped candidate's later rows carry no customer key (they dispatched
|
|
33
|
+
* uncached), exactly matching the request builder's suppression. */
|
|
34
|
+
readonly droppedCacheHandle: ReadonlySet<string>;
|
|
35
|
+
}
|
|
36
|
+
/** Build the run loop's `recordAttempt(attempt) => inferenceId` over this run's
|
|
37
|
+
* state. Records one inference row and, with an active run context, mirrors it
|
|
38
|
+
* as a ground-truth step (fail-open). */
|
|
39
|
+
export declare function createRecordAttempt(deps: RecordAttemptDeps): (attempt: AttemptTelemetry) => string;
|
|
40
|
+
//# sourceMappingURL=record-attempt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-attempt.d.ts","sourceRoot":"","sources":["../../src/run/record-attempt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,KAAK,EAAgB,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIvE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,kFAAkF;IAClF,QAAQ,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACzC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC;;qFAEiF;IACjF,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IACrC;;;wEAGoE;IACpE,QAAQ,CAAC,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAClD;AAED;;yCAEyC;AACzC,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,CAAC,OAAO,EAAE,gBAAgB,KAAK,MAAM,CA6ElG"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The run loop's per-attempt telemetry recorder, extracted from run.ts (WS-A).
|
|
4
|
+
*
|
|
5
|
+
* run.ts sits at the 700-LOC cap; threading cache-write accounting through the
|
|
6
|
+
* row builder pushed it over, so the recorder — a self-contained mapping from
|
|
7
|
+
* an `AttemptTelemetry` to a persisted `TelemetryRow` plus the ground-truth
|
|
8
|
+
* step mirror — moves here as a factory over the loop's per-run state. Behavior
|
|
9
|
+
* is byte-identical to the former inline closure, save the additive cache
|
|
10
|
+
* fields. Keeping it separate also shrinks the run-loop conflict surface for the
|
|
11
|
+
* in-flight E4 / capture-write work (plan coordination note).
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.createRecordAttempt = createRecordAttempt;
|
|
15
|
+
const node_crypto_1 = require("node:crypto");
|
|
16
|
+
const failures_1 = require("../types/failures");
|
|
17
|
+
const cache_stamp_1 = require("./cache-stamp");
|
|
18
|
+
const cache_handle_1 = require("./cache-handle");
|
|
19
|
+
/** Build the run loop's `recordAttempt(attempt) => inferenceId` over this run's
|
|
20
|
+
* state. Records one inference row and, with an active run context, mirrors it
|
|
21
|
+
* as a ground-truth step (fail-open). */
|
|
22
|
+
function createRecordAttempt(deps) {
|
|
23
|
+
const { telemetry, route, ledger, effectiveTags, servedVariant, runCtx, autoStepKey } = deps;
|
|
24
|
+
const { cache, droppedCacheHandle } = deps;
|
|
25
|
+
return function recordAttempt(attempt) {
|
|
26
|
+
// Request-path cache substrate (WS-C): derived from the SAME pure gate the
|
|
27
|
+
// dispatcher stamps the request with, so `cache_key`/`prefix_fingerprint` on
|
|
28
|
+
// the row match what was sent for this candidate. No-op (both null) unless
|
|
29
|
+
// the route opted into `cache: auto` — pre-WS-C rows are byte-identical.
|
|
30
|
+
// PRIMARY-attempt only: a repair call (repairedBy set) re-asks with a
|
|
31
|
+
// different prompt (error feedback / repair-model framing), so its prefix
|
|
32
|
+
// does not share the route's cacheable identity — stamping it would file a
|
|
33
|
+
// cold, different-prefix call under the primary fingerprint and pollute
|
|
34
|
+
// WS-B's warm-set derivation and the §5.6 streak alert. Repair rows carry
|
|
35
|
+
// neither key nor fingerprint (matching buildRepairAdapterRequest, which
|
|
36
|
+
// sends no cache directive).
|
|
37
|
+
// CE-1 (spec §2.3): derive the customer key from the SAME gate as the request
|
|
38
|
+
// builder — a matching-provider, non-suppressed handle WINS over the WS-C
|
|
39
|
+
// generated stamp. `prefix_fingerprint` is unchanged, so origin stays
|
|
40
|
+
// derivable with NO new column (customer key != fingerprint ⇒ customer;
|
|
41
|
+
// key == fingerprint ⇒ generated — cacheKeyProvenance). Both derivations
|
|
42
|
+
// skip repair rows symmetrically (their prefix differs from the route's).
|
|
43
|
+
const isPrimary = attempt.repairedBy === undefined;
|
|
44
|
+
const cacheStamp = isPrimary ? (0, cache_stamp_1.cacheStampForCandidate)(route, attempt.candidate) : null;
|
|
45
|
+
// The customer key marks rows whose REQUEST carried the handle. A terminal
|
|
46
|
+
// failure (budget_exhausted / invariant_violation) is recorded by failRun
|
|
47
|
+
// BEFORE any dispatch — the wire never carried the handle — so those rows
|
|
48
|
+
// must not claim a customer key. Terminal classes come only from failRun;
|
|
49
|
+
// adapters never return them. (A grounding-search failure is the one
|
|
50
|
+
// non-terminal pre-dispatch path, but a customer cachedContents handle and
|
|
51
|
+
// the inject rung are mutually exclusive, so it is unreachable in practice.)
|
|
52
|
+
const preDispatch = attempt.failure !== null && failures_1.TERMINAL_CLASSES.has(attempt.failure.class);
|
|
53
|
+
const dropped = droppedCacheHandle.has(`${attempt.candidate.provider} ${attempt.candidate.model}`);
|
|
54
|
+
const customer = isPrimary && !preDispatch ? (0, cache_handle_1.customerCacheHandle)(cache, attempt.candidate, dropped) : null;
|
|
55
|
+
const cacheKey = customer?.key ?? cacheStamp?.cacheKey ?? null;
|
|
56
|
+
const row = {
|
|
57
|
+
id: (0, node_crypto_1.randomUUID)(),
|
|
58
|
+
ts: new Date().toISOString(),
|
|
59
|
+
route: route.route,
|
|
60
|
+
routeVersion: route.version,
|
|
61
|
+
provider: attempt.candidate.provider,
|
|
62
|
+
model: attempt.candidate.model,
|
|
63
|
+
requestedTier: route.policy.tier,
|
|
64
|
+
servedTier: attempt.servedTier,
|
|
65
|
+
tokensIn: attempt.tokensIn,
|
|
66
|
+
tokensOut: attempt.tokensOut,
|
|
67
|
+
tokensCached: attempt.tokensCached,
|
|
68
|
+
// Cache-write accounting (WS-A) + request-path substrate (WS-C).
|
|
69
|
+
tokensCacheWrite: attempt.tokensCacheWrite ?? 0,
|
|
70
|
+
tokensCacheWrite1h: attempt.tokensCacheWrite1h ?? 0,
|
|
71
|
+
cacheKey,
|
|
72
|
+
prefixFingerprint: cacheStamp?.prefixFingerprint ?? null,
|
|
73
|
+
costEstimateUsd: attempt.costUsd,
|
|
74
|
+
latencyMs: attempt.latencyMs,
|
|
75
|
+
ttfbMs: attempt.ttfbMs ?? null,
|
|
76
|
+
failureClass: attempt.failure?.class ?? null,
|
|
77
|
+
attemptsJson: JSON.stringify(ledger.snapshot()),
|
|
78
|
+
tagsJson: JSON.stringify(effectiveTags),
|
|
79
|
+
fingerprintCell: route.fingerprintCell,
|
|
80
|
+
servedVariant,
|
|
81
|
+
repairedBy: attempt.repairedBy ?? null,
|
|
82
|
+
pricingMissing: attempt.pricingMissing ?? false,
|
|
83
|
+
};
|
|
84
|
+
telemetry.record(row);
|
|
85
|
+
// Mirror this inference into a ground-truth step attempt (fail-open — the
|
|
86
|
+
// context swallows buffer errors; the run loop is never affected).
|
|
87
|
+
if (runCtx !== null && autoStepKey !== null) {
|
|
88
|
+
runCtx.emitGroundTruthStep({
|
|
89
|
+
stepKey: autoStepKey,
|
|
90
|
+
task: route.route,
|
|
91
|
+
inferenceId: row.id,
|
|
92
|
+
startedAt: row.ts,
|
|
93
|
+
endedAt: new Date().toISOString(),
|
|
94
|
+
failureClass: row.failureClass,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
return row.id;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repair rung (ladder rung 4) — Phase 3 spec WS2, plan §4. Pure pieces only:
|
|
3
|
+
* the repair-attempt state machine and the two repair prompts. Dispatch,
|
|
4
|
+
* cost, and telemetry stay in run.ts (repair calls are ordinary attempts with
|
|
5
|
+
* `repaired_by` stamped).
|
|
6
|
+
*
|
|
7
|
+
* Budget model (plan §4): repair draws from its OWN budget (RepairPolicy.
|
|
8
|
+
* maxRepairs) — a policy key, NOT a failure class. It never consumes the
|
|
9
|
+
* content_invalid budget and vice versa (non-fungibility extends to repair).
|
|
10
|
+
*/
|
|
11
|
+
import type { RepairPolicy, CandidateSpec } from "../types/route";
|
|
12
|
+
export type RepairStep = {
|
|
13
|
+
readonly kind: "same_model";
|
|
14
|
+
} | {
|
|
15
|
+
readonly kind: "repair_model";
|
|
16
|
+
readonly model: CandidateSpec;
|
|
17
|
+
};
|
|
18
|
+
export interface RepairLedger {
|
|
19
|
+
/** The next repair step to take, or null when the budget is spent (or
|
|
20
|
+
* repair is not configured). Each call consumes one unit. */
|
|
21
|
+
next(): RepairStep | null;
|
|
22
|
+
/** Repair attempts consumed so far. */
|
|
23
|
+
used(): number;
|
|
24
|
+
}
|
|
25
|
+
/** Attempt 1 = same model with error feedback; attempt 2 = the designated
|
|
26
|
+
* repair model (only when configured — loader guarantees maxRepairs=2 has
|
|
27
|
+
* repairModel). */
|
|
28
|
+
export declare function createRepairLedger(policy: RepairPolicy | undefined): RepairLedger;
|
|
29
|
+
/** Appended to the ORIGINAL system prompt for the same-model repair retry:
|
|
30
|
+
* the model sees exactly what failed validation and why. */
|
|
31
|
+
export declare function repairFeedbackBlock(errors: readonly string[]): string;
|
|
32
|
+
/** Full system prompt for the designated repair model: it never sees the
|
|
33
|
+
* original task — only {invalid output, errors, schema}. Fixed by design
|
|
34
|
+
* (plan §4); the repair model's job is mechanical correction, not re-answering. */
|
|
35
|
+
export declare function repairModelPrompt(invalidOutput: string, errors: readonly string[], schema: object): string;
|
|
36
|
+
//# sourceMappingURL=repair.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repair.d.ts","sourceRoot":"","sources":["../../src/run/repair.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAElE,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;CAAE,GAC/B;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;CAAE,CAAC;AAErE,MAAM,WAAW,YAAY;IAC3B;iEAC6D;IAC7D,IAAI,IAAI,UAAU,GAAG,IAAI,CAAC;IAC1B,uCAAuC;IACvC,IAAI,IAAI,MAAM,CAAC;CAChB;AAED;;mBAEmB;AACnB,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,GAAG,YAAY,CAejF;AAED;4DAC4D;AAC5D,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAUrE;AAED;;mFAEmF;AACnF,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,MAAM,EAAE,MAAM,GACb,MAAM,CAYR"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Repair rung (ladder rung 4) — Phase 3 spec WS2, plan §4. Pure pieces only:
|
|
4
|
+
* the repair-attempt state machine and the two repair prompts. Dispatch,
|
|
5
|
+
* cost, and telemetry stay in run.ts (repair calls are ordinary attempts with
|
|
6
|
+
* `repaired_by` stamped).
|
|
7
|
+
*
|
|
8
|
+
* Budget model (plan §4): repair draws from its OWN budget (RepairPolicy.
|
|
9
|
+
* maxRepairs) — a policy key, NOT a failure class. It never consumes the
|
|
10
|
+
* content_invalid budget and vice versa (non-fungibility extends to repair).
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.createRepairLedger = createRepairLedger;
|
|
14
|
+
exports.repairFeedbackBlock = repairFeedbackBlock;
|
|
15
|
+
exports.repairModelPrompt = repairModelPrompt;
|
|
16
|
+
/** Attempt 1 = same model with error feedback; attempt 2 = the designated
|
|
17
|
+
* repair model (only when configured — loader guarantees maxRepairs=2 has
|
|
18
|
+
* repairModel). */
|
|
19
|
+
function createRepairLedger(policy) {
|
|
20
|
+
let used = 0;
|
|
21
|
+
return {
|
|
22
|
+
next() {
|
|
23
|
+
if (policy === undefined || used >= policy.maxRepairs)
|
|
24
|
+
return null;
|
|
25
|
+
used += 1;
|
|
26
|
+
if (used === 1)
|
|
27
|
+
return { kind: "same_model" };
|
|
28
|
+
return policy.repairModel !== undefined
|
|
29
|
+
? { kind: "repair_model", model: policy.repairModel }
|
|
30
|
+
: null;
|
|
31
|
+
},
|
|
32
|
+
used() {
|
|
33
|
+
return used;
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/** Appended to the ORIGINAL system prompt for the same-model repair retry:
|
|
38
|
+
* the model sees exactly what failed validation and why. */
|
|
39
|
+
function repairFeedbackBlock(errors) {
|
|
40
|
+
return ("\n\n---\nREPAIR PASS: Your previous response FAILED JSON Schema validation with these " +
|
|
41
|
+
`errors:\n${errors.map((e) => `- ${e}`).join("\n")}\n` +
|
|
42
|
+
"Produce the COMPLETE corrected JSON object now. Fix every listed error, keep all fields " +
|
|
43
|
+
"that were already valid, and output ONLY the JSON object — no commentary, no fences. " +
|
|
44
|
+
"CHARACTER LIMITS ARE EXACT: if an error says a string has too many characters, rewrite " +
|
|
45
|
+
"that string DRASTICALLY shorter — aim near the midpoint of the schema's minLength and " +
|
|
46
|
+
"maxLength for that field; your length estimates run long, so when unsure, cut more.");
|
|
47
|
+
}
|
|
48
|
+
/** Full system prompt for the designated repair model: it never sees the
|
|
49
|
+
* original task — only {invalid output, errors, schema}. Fixed by design
|
|
50
|
+
* (plan §4); the repair model's job is mechanical correction, not re-answering. */
|
|
51
|
+
function repairModelPrompt(invalidOutput, errors, schema) {
|
|
52
|
+
return ("You are a JSON repair specialist. You receive a JSON document that FAILED validation " +
|
|
53
|
+
"against a JSON Schema, plus the validation errors. Emit the corrected document.\n\n" +
|
|
54
|
+
"RULES: Output ONLY a single valid JSON object — no markdown fences, no commentary. " +
|
|
55
|
+
"Preserve every value that does not violate the schema; change ONLY what the errors " +
|
|
56
|
+
"require. Do not invent facts: where a required field is missing and its value cannot be " +
|
|
57
|
+
"derived from the invalid document, use the most conservative schema-valid completion.\n\n" +
|
|
58
|
+
`THE JSON SCHEMA:\n${JSON.stringify(schema)}\n\n` +
|
|
59
|
+
`THE VALIDATION ERRORS:\n${errors.map((e) => `- ${e}`).join("\n")}\n\n` +
|
|
60
|
+
`THE INVALID DOCUMENT:\n${invalidOutput}`);
|
|
61
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Candidate resolution — plan §4. THE ONLY constructor of CandidateRef in the
|
|
3
|
+
* codebase (the candidate-set invariant is enforced here structurally).
|
|
4
|
+
* Phase 1 selection: first candidate whose static capability flags satisfy
|
|
5
|
+
* route.require, ordered by prefer:[cost] via the pricing snapshot; on a
|
|
6
|
+
* retryable failure the run loop asks for the next candidate.
|
|
7
|
+
*/
|
|
8
|
+
import type { RouteBundle, RunOptions } from "../types/route";
|
|
9
|
+
import type { CandidateRef, CapabilityFlag, ProviderId } from "../types/provider";
|
|
10
|
+
/** Static capability stub — replaced by the probed registry in Phase 2. */
|
|
11
|
+
export type CapabilityLookup = (provider: ProviderId, model: string) => ReadonlySet<CapabilityFlag>;
|
|
12
|
+
export interface CandidateIterator {
|
|
13
|
+
/** Next eligible candidate, or null when the set is exhausted. */
|
|
14
|
+
next(): CandidateRef | null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Request-time candidate filters (G-2) — optional, applied by resolveCandidates
|
|
18
|
+
* BEFORE the prefer:[cost] sort. Distinct from route.require (capability + ZDR):
|
|
19
|
+
* these are per-run narrowings a caller passes on RunOptions. `maxPriceUsdPerMTok`
|
|
20
|
+
* reuses the same rate prefer:[cost] sorts on, so filter and sort agree.
|
|
21
|
+
*/
|
|
22
|
+
export interface CandidateFilter {
|
|
23
|
+
readonly maxPriceUsdPerMTok?: number;
|
|
24
|
+
readonly only?: readonly ProviderId[];
|
|
25
|
+
readonly ignore?: readonly ProviderId[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* SHADOW-MODE warmth-aware ordering (cache-aware-routing spec §5.5, WS-B step 8;
|
|
29
|
+
* [Briefing] "auto only after validation"). Opt-in and NON-ACTUATING: when
|
|
30
|
+
* supplied, `resolveCandidates` computes the ordering that ranking by
|
|
31
|
+
* cache-ADJUSTED effective cost WOULD produce, hands the chosen-vs-recommended
|
|
32
|
+
* comparison to `log`, and then returns the UNCHANGED list-cost order. Absent ⇒
|
|
33
|
+
* the resolver is byte-for-byte its pre-WS-B self. No behavior flip ships this
|
|
34
|
+
* mission — the shadow log is reviewed before any warmth ordering activates
|
|
35
|
+
* (post-deploy gate ledger).
|
|
36
|
+
*/
|
|
37
|
+
export interface WarmthShadowOptions {
|
|
38
|
+
/** Cache-adjusted effective cost for a candidate (USD/MTok), or null when
|
|
39
|
+
* unknown — computed by the caller from the derived ledger + effective-rate
|
|
40
|
+
* (kept out of the resolver so this file stays free of pricing/cache logic). */
|
|
41
|
+
readonly effectiveCostUsdPerMTok: (provider: ProviderId, model: string) => number | null;
|
|
42
|
+
/** Sink for the shadow comparison — a logger/telemetry hook. */
|
|
43
|
+
readonly log: (shadow: WarmthShadowLog) => void;
|
|
44
|
+
}
|
|
45
|
+
/** One shadow observation: the order the resolver ACTUALLY returned (list-cost)
|
|
46
|
+
* vs the order warmth-aware ranking would recommend, and whether they diverge. */
|
|
47
|
+
export interface WarmthShadowLog {
|
|
48
|
+
readonly route: string;
|
|
49
|
+
readonly chosen: readonly {
|
|
50
|
+
readonly provider: ProviderId;
|
|
51
|
+
readonly model: string;
|
|
52
|
+
}[];
|
|
53
|
+
readonly recommended: readonly {
|
|
54
|
+
readonly provider: ProviderId;
|
|
55
|
+
readonly model: string;
|
|
56
|
+
}[];
|
|
57
|
+
readonly diverged: boolean;
|
|
58
|
+
}
|
|
59
|
+
export declare function resolveCandidates(route: RouteBundle, capabilities: CapabilityLookup, costUsdPerMTok: (provider: ProviderId, model: string) => number | null, searchAvailable?: boolean, filter?: CandidateFilter, shadowWarmth?: WarmthShadowOptions): CandidateIterator;
|
|
60
|
+
/**
|
|
61
|
+
* Per-run requirement opt-ins (G-3). A caller can demand zero-retention routing
|
|
62
|
+
* for a single run without editing the route bundle: `zero_retention` is unioned
|
|
63
|
+
* into the effective `require`, so the existing satisfiesRequirements filter, the
|
|
64
|
+
* no-eligible-candidate message, and the fail-closed empty-set path all apply
|
|
65
|
+
* unchanged. Additive only — a run opts INTO a stricter requirement, never OUT of
|
|
66
|
+
* a route's declared one (opting out would be a governance downgrade).
|
|
67
|
+
*/
|
|
68
|
+
export declare function applyRunRequirements(route: RouteBundle, zeroRetention: boolean): RouteBundle;
|
|
69
|
+
/** Map a run's RunOptions to a CandidateFilter (G-2), or undefined when no knob
|
|
70
|
+
* is set — so the resolver takes the byte-identical pre-G-2 path (back-compat). */
|
|
71
|
+
export declare function candidateFilterFromOptions(opts: RunOptions): CandidateFilter | undefined;
|
|
72
|
+
/** A human-readable suffix naming the binding request-time filters, for the
|
|
73
|
+
* existing no-eligible-candidate error (spec §4.3 — explainability, not a new
|
|
74
|
+
* error class). Empty when no filter is set. */
|
|
75
|
+
export declare function filterSummary(opts: RunOptions): string;
|
|
76
|
+
/**
|
|
77
|
+
* Mint a CandidateRef for the RAW LANE (http-gateway spec §4.2) — a
|
|
78
|
+
* `provider/model` the caller named explicitly, dispatched at zero margin on
|
|
79
|
+
* the caller's own BYOK key with NO route and NO verified pipeline.
|
|
80
|
+
*
|
|
81
|
+
* The candidate-set invariant guards against substituting a model outside a
|
|
82
|
+
* ROUTE's declared list; a route-free, explicitly-named passthrough is outside
|
|
83
|
+
* that invariant's scope by construction (there is no list to escape). This is
|
|
84
|
+
* the ONE sanctioned brand site for it, so the "no `as CandidateRef`" grep stays
|
|
85
|
+
* clean and the brand stays centralized here. The authorization that replaces
|
|
86
|
+
* route membership lives server-side: the raw lane dispatches only after
|
|
87
|
+
* `resolveProviderKeyForCall` returns a BYOK key fail-closed (spec §4.2).
|
|
88
|
+
*/
|
|
89
|
+
export declare function mintRawCandidate(provider: ProviderId, model: string): CandidateRef;
|
|
90
|
+
/**
|
|
91
|
+
* Mint a CandidateRef for a SPECIFIC declared candidate (the repair rung's
|
|
92
|
+
* designated repair model — loader-validated to be in the route's candidate
|
|
93
|
+
* list; re-checked here). Same brand site, same sanctioned-cast scope.
|
|
94
|
+
*/
|
|
95
|
+
export declare function resolveDeclaredCandidate(route: RouteBundle, spec: {
|
|
96
|
+
readonly provider: ProviderId;
|
|
97
|
+
readonly model: string;
|
|
98
|
+
}): CandidateRef | null;
|
|
99
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/run/resolve.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAElF,2EAA2E;AAC3E,MAAM,MAAM,gBAAgB,GAAG,CAC7B,QAAQ,EAAE,UAAU,EACpB,KAAK,EAAE,MAAM,KACV,WAAW,CAAC,cAAc,CAAC,CAAC;AAEjC,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,IAAI,IAAI,YAAY,GAAG,IAAI,CAAC;CAC7B;AA6CD;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IACtC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;CACzC;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,mBAAmB;IAClC;;oFAEgF;IAChF,QAAQ,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACzF,gEAAgE;IAChE,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;CACjD;AAED;kFACkF;AAClF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,SAAS;QAAE,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACtF,QAAQ,CAAC,WAAW,EAAE,SAAS;QAAE,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC3F,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,WAAW,EAClB,YAAY,EAAE,gBAAgB,EAC9B,cAAc,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,EACtE,eAAe,UAAQ,EACvB,MAAM,CAAC,EAAE,eAAe,EACxB,YAAY,CAAC,EAAE,mBAAmB,GACjC,iBAAiB,CAkFnB;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,GAAG,WAAW,CAM5F;AAED;mFACmF;AACnF,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,UAAU,GAAG,eAAe,GAAG,SAAS,CAUxF;AAED;;gDAEgD;AAChD,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAMtD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,CAElF;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC9D,YAAY,GAAG,IAAI,CAMrB"}
|