modelrig 0.8.1 → 0.10.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 +324 -0
- package/README.md +55 -29
- package/data/PROVENANCE.md +14 -0
- package/data/pricing-map.json +26 -0
- package/dist/adapters/attempt-meta-map.d.ts +8 -1
- package/dist/adapters/attempt-meta-map.d.ts.map +1 -1
- package/dist/adapters/attempt-meta-map.js +4 -0
- package/dist/adapters/build-adapters.js +2 -2
- package/dist/adapters/gemini.d.ts +28 -1
- package/dist/adapters/gemini.d.ts.map +1 -1
- package/dist/adapters/gemini.js +38 -9
- package/dist/adapters/grok.d.ts.map +1 -1
- package/dist/adapters/grok.js +53 -4
- package/dist/adapters/openai-compat.d.ts +8 -2
- package/dist/adapters/openai-compat.d.ts.map +1 -1
- package/dist/adapters/openai-compat.js +8 -1
- package/dist/adapters/openai-stream.d.ts +10 -2
- package/dist/adapters/openai-stream.d.ts.map +1 -1
- package/dist/adapters/openai-stream.js +5 -1
- package/dist/adapters/openai.d.ts +10 -1
- package/dist/adapters/openai.d.ts.map +1 -1
- package/dist/adapters/openai.js +57 -7
- package/dist/adapters/responses-api.d.ts +61 -0
- package/dist/adapters/responses-api.d.ts.map +1 -0
- package/dist/adapters/responses-api.js +124 -0
- package/dist/artifacts/artifact.d.ts +31 -12
- package/dist/artifacts/artifact.d.ts.map +1 -1
- package/dist/artifacts/artifact.js +218 -188
- package/dist/artifacts/index.d.ts +15 -5
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +19 -5
- package/dist/artifacts/run-context.d.ts +3 -24
- package/dist/artifacts/run-context.d.ts.map +1 -1
- package/dist/artifacts/run-context.js +3 -39
- package/dist/bakeoff/engine.d.ts +29 -0
- package/dist/bakeoff/engine.d.ts.map +1 -1
- package/dist/bakeoff/engine.js +47 -0
- package/dist/bakeoff/eval-cases-rig.d.ts +36 -0
- package/dist/bakeoff/eval-cases-rig.d.ts.map +1 -0
- package/dist/bakeoff/eval-cases-rig.js +27 -0
- package/dist/bakeoff/eval-cases.d.ts +19 -0
- package/dist/bakeoff/eval-cases.d.ts.map +1 -1
- package/dist/bakeoff/eval-cases.js +18 -1
- package/dist/bakeoff/golden-judge.d.ts +47 -0
- package/dist/bakeoff/golden-judge.d.ts.map +1 -0
- package/dist/bakeoff/golden-judge.js +49 -0
- package/dist/bakeoff/groundedness.d.ts +58 -0
- package/dist/bakeoff/groundedness.d.ts.map +1 -0
- package/dist/bakeoff/groundedness.js +165 -0
- package/dist/bakeoff/quality.d.ts +43 -0
- package/dist/bakeoff/quality.d.ts.map +1 -1
- package/dist/bakeoff/quality.js +31 -0
- package/dist/bakeoff/replay.d.ts +11 -0
- package/dist/bakeoff/replay.d.ts.map +1 -1
- package/dist/bakeoff/replay.js +12 -0
- package/dist/bakeoff/report.d.ts +7 -0
- package/dist/bakeoff/report.d.ts.map +1 -1
- package/dist/bakeoff/report.js +26 -0
- package/dist/cli-judge.d.ts +12 -0
- package/dist/cli-judge.d.ts.map +1 -0
- package/dist/cli-judge.js +48 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +22 -42
- package/dist/config.d.ts +85 -29
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +109 -47
- package/dist/detect/detector.d.ts +4 -2
- package/dist/detect/detector.d.ts.map +1 -1
- package/dist/detect/safe-harbor.d.ts +57 -0
- package/dist/detect/safe-harbor.d.ts.map +1 -0
- package/dist/detect/safe-harbor.js +278 -0
- package/dist/doctor-cli.d.ts +7 -0
- package/dist/doctor-cli.d.ts.map +1 -0
- package/dist/doctor-cli.js +67 -0
- package/dist/doctor-preflight.d.ts +52 -0
- package/dist/doctor-preflight.d.ts.map +1 -0
- package/dist/doctor-preflight.js +112 -0
- package/dist/feedback/coverage.d.ts +11 -8
- package/dist/feedback/coverage.d.ts.map +1 -1
- package/dist/feedback/coverage.js +29 -16
- package/dist/feedback/grade.d.ts +58 -0
- package/dist/feedback/grade.d.ts.map +1 -0
- package/dist/feedback/grade.js +67 -0
- package/dist/gateway/http-protocol.d.ts +20 -1
- package/dist/gateway/http-protocol.d.ts.map +1 -1
- package/dist/gateway/http-protocol.js +1 -1
- package/dist/gateway/serve-client.d.ts +99 -0
- package/dist/gateway/serve-client.d.ts.map +1 -0
- package/dist/gateway/serve-client.js +360 -0
- package/dist/index.d.ts +68 -29
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +167 -46
- package/dist/init/observe-cli.js +1 -1
- package/dist/init/observe.d.ts +2 -2
- package/dist/init/observe.d.ts.map +1 -1
- package/dist/init/observe.js +11 -7
- package/dist/mask/arm.d.ts +112 -0
- package/dist/mask/arm.d.ts.map +1 -0
- package/dist/mask/arm.js +179 -0
- package/dist/mask/index.d.ts +2 -0
- package/dist/mask/index.d.ts.map +1 -1
- package/dist/mask/index.js +7 -1
- package/dist/mask/mask-policy-cli.d.ts +12 -4
- package/dist/mask/mask-policy-cli.d.ts.map +1 -1
- package/dist/mask/mask-policy-cli.js +34 -9
- package/dist/prompts/manifest.d.ts +128 -0
- package/dist/prompts/manifest.d.ts.map +1 -0
- package/dist/prompts/manifest.js +214 -0
- package/dist/prompts/prompt-fetch.d.ts +84 -0
- package/dist/prompts/prompt-fetch.d.ts.map +1 -0
- package/dist/prompts/prompt-fetch.js +120 -0
- package/dist/prompts/prompt-resolve.d.ts +76 -0
- package/dist/prompts/prompt-resolve.d.ts.map +1 -0
- package/dist/prompts/prompt-resolve.js +93 -0
- package/dist/prompts/slot-resolver.d.ts +91 -0
- package/dist/prompts/slot-resolver.d.ts.map +1 -0
- package/dist/prompts/slot-resolver.js +135 -0
- package/dist/prompts/tools-register.d.ts +60 -0
- package/dist/prompts/tools-register.d.ts.map +1 -0
- package/dist/prompts/tools-register.js +48 -0
- package/dist/prompts/version-hash.d.ts +29 -0
- package/dist/prompts/version-hash.d.ts.map +1 -0
- package/dist/prompts/version-hash.js +54 -0
- package/dist/prompts-export-cli.d.ts +21 -0
- package/dist/prompts-export-cli.d.ts.map +1 -0
- package/dist/prompts-export-cli.js +130 -0
- package/dist/query/grammar.d.ts +2 -2
- package/dist/query/grammar.d.ts.map +1 -1
- package/dist/query/grammar.js +3 -1
- package/dist/query/saved.d.ts +13 -0
- package/dist/query/saved.d.ts.map +1 -1
- package/dist/query/saved.js +67 -1
- package/dist/receipts/types.d.ts +1 -1
- package/dist/receipts/types.d.ts.map +1 -1
- package/dist/receipts/types.js +1 -0
- package/dist/registry/build.d.ts +43 -1
- package/dist/registry/build.d.ts.map +1 -1
- package/dist/registry/build.js +52 -0
- package/dist/registry/cache-policy.d.ts.map +1 -1
- package/dist/registry/cache-policy.js +22 -0
- package/dist/registry/pricing-shape.d.ts +67 -8
- package/dist/registry/pricing-shape.d.ts.map +1 -1
- package/dist/registry/pricing-shape.js +50 -13
- package/dist/registry/pricing.d.ts +6 -5
- package/dist/registry/pricing.d.ts.map +1 -1
- package/dist/registry/pricing.js +9 -5
- package/dist/registry/rows.d.ts.map +1 -1
- package/dist/registry/rows.js +1 -0
- package/dist/registry/select.d.ts +6 -1
- package/dist/registry/select.d.ts.map +1 -1
- package/dist/registry/select.js +11 -0
- package/dist/routes/call-config.d.ts +199 -0
- package/dist/routes/call-config.d.ts.map +1 -0
- package/dist/routes/call-config.js +343 -0
- package/dist/routes/destination-loader.d.ts +16 -0
- package/dist/routes/destination-loader.d.ts.map +1 -0
- package/dist/routes/destination-loader.js +29 -0
- package/dist/routes/draft.d.ts +7 -0
- package/dist/routes/draft.d.ts.map +1 -1
- package/dist/routes/draft.js +12 -0
- package/dist/routes/loader.d.ts.map +1 -1
- package/dist/routes/loader.js +31 -56
- package/dist/routes/objective-loader.d.ts +12 -0
- package/dist/routes/objective-loader.d.ts.map +1 -1
- package/dist/routes/objective-loader.js +82 -0
- package/dist/routes/output-loader.d.ts +42 -0
- package/dist/routes/output-loader.d.ts.map +1 -0
- package/dist/routes/output-loader.js +112 -0
- package/dist/routes/prompt-loader.d.ts +49 -0
- package/dist/routes/prompt-loader.d.ts.map +1 -0
- package/dist/routes/prompt-loader.js +113 -0
- package/dist/routes/resolved-bundle.d.ts +69 -0
- package/dist/routes/resolved-bundle.d.ts.map +1 -1
- package/dist/routes/resolved-bundle.js +76 -0
- package/dist/routes/screen-loader.d.ts +29 -1
- package/dist/routes/screen-loader.d.ts.map +1 -1
- package/dist/routes/screen-loader.js +59 -1
- package/dist/run/accept.d.ts +5 -0
- package/dist/run/accept.d.ts.map +1 -1
- package/dist/run/accept.js +2 -0
- package/dist/run/cost.d.ts +31 -2
- package/dist/run/cost.d.ts.map +1 -1
- package/dist/run/cost.js +57 -2
- package/dist/run/destination.d.ts +39 -0
- package/dist/run/destination.d.ts.map +1 -0
- package/dist/run/destination.js +45 -0
- package/dist/run/dispatch.d.ts +67 -16
- package/dist/run/dispatch.d.ts.map +1 -1
- package/dist/run/dispatch.js +133 -29
- package/dist/run/grounding.d.ts +28 -2
- package/dist/run/grounding.d.ts.map +1 -1
- package/dist/run/grounding.js +54 -10
- package/dist/run/raw-defaults.d.ts.map +1 -1
- package/dist/run/raw-defaults.js +6 -1
- package/dist/run/raw-finalize.d.ts +50 -0
- package/dist/run/raw-finalize.d.ts.map +1 -0
- package/dist/run/raw-finalize.js +266 -0
- package/dist/run/raw-knobs.d.ts +36 -0
- package/dist/run/raw-knobs.d.ts.map +1 -0
- package/dist/run/raw-knobs.js +99 -0
- package/dist/run/raw-request.d.ts +24 -0
- package/dist/run/raw-request.d.ts.map +1 -0
- package/dist/run/raw-request.js +69 -0
- package/dist/run/raw-schema.d.ts +76 -0
- package/dist/run/raw-schema.d.ts.map +1 -0
- package/dist/run/raw-schema.js +166 -0
- package/dist/run/raw-search-cost.d.ts +48 -0
- package/dist/run/raw-search-cost.d.ts.map +1 -0
- package/dist/run/raw-search-cost.js +78 -0
- package/dist/run/raw-support.d.ts +64 -6
- package/dist/run/raw-support.d.ts.map +1 -1
- package/dist/run/raw-support.js +84 -11
- package/dist/run/raw.d.ts +25 -26
- package/dist/run/raw.d.ts.map +1 -1
- package/dist/run/raw.js +30 -351
- package/dist/run/record-attempt.d.ts +12 -0
- package/dist/run/record-attempt.d.ts.map +1 -1
- package/dist/run/record-attempt.js +30 -12
- package/dist/run/repair-attempt.d.ts +68 -0
- package/dist/run/repair-attempt.d.ts.map +1 -0
- package/dist/run/repair-attempt.js +180 -0
- package/dist/run/resolve-destination.d.ts +49 -0
- package/dist/run/resolve-destination.d.ts.map +1 -0
- package/dist/run/resolve-destination.js +76 -0
- package/dist/run/routing-docs.d.ts.map +1 -1
- package/dist/run/routing-docs.js +10 -5
- package/dist/run/run.d.ts +30 -1
- package/dist/run/run.d.ts.map +1 -1
- package/dist/run/run.js +94 -172
- package/dist/run/telemetry-row.d.ts +92 -0
- package/dist/run/telemetry-row.d.ts.map +1 -0
- package/dist/run/telemetry-row.js +81 -0
- package/dist/run/validate.d.ts +12 -1
- package/dist/run/validate.d.ts.map +1 -1
- package/dist/run/validate.js +31 -0
- package/dist/run/web-search-pricing.d.ts +43 -0
- package/dist/run/web-search-pricing.d.ts.map +1 -0
- package/dist/run/web-search-pricing.js +56 -0
- package/dist/savings/odometer.d.ts +4 -0
- package/dist/savings/odometer.d.ts.map +1 -1
- package/dist/savings/odometer.js +20 -1
- package/dist/savings/swap-execute.d.ts +7 -0
- package/dist/savings/swap-execute.d.ts.map +1 -1
- package/dist/savings/swap-execute.js +30 -0
- package/dist/savings/swaps-client.d.ts +10 -0
- package/dist/savings/swaps-client.d.ts.map +1 -1
- package/dist/screen/fixtures/probe-corpora.d.ts +23 -0
- package/dist/screen/fixtures/probe-corpora.d.ts.map +1 -0
- package/dist/screen/fixtures/probe-corpora.js +69 -0
- package/dist/screen/index.d.ts +21 -0
- package/dist/screen/index.d.ts.map +1 -0
- package/dist/screen/index.js +64 -0
- package/dist/screen/model-screen.d.ts +111 -0
- package/dist/screen/model-screen.d.ts.map +1 -0
- package/dist/screen/model-screen.js +178 -0
- package/dist/screen/patterns.d.ts +51 -0
- package/dist/screen/patterns.d.ts.map +1 -0
- package/dist/screen/patterns.js +151 -0
- package/dist/screen/phi-gate.d.ts +52 -0
- package/dist/screen/phi-gate.d.ts.map +1 -0
- package/dist/screen/phi-gate.js +86 -0
- package/dist/screen/policy.d.ts +71 -0
- package/dist/screen/policy.d.ts.map +1 -0
- package/dist/screen/policy.js +334 -0
- package/dist/screen/probe.d.ts +118 -0
- package/dist/screen/probe.d.ts.map +1 -0
- package/dist/screen/probe.js +132 -0
- package/dist/screen/screen-cli.d.ts +16 -0
- package/dist/screen/screen-cli.d.ts.map +1 -0
- package/dist/screen/screen-cli.js +178 -0
- package/dist/screen/screen.d.ts +99 -0
- package/dist/screen/screen.d.ts.map +1 -0
- package/dist/screen/screen.js +0 -0
- package/dist/screen/sidecar.d.ts +69 -0
- package/dist/screen/sidecar.d.ts.map +1 -0
- package/dist/screen/sidecar.js +145 -0
- package/dist/screen/types.d.ts +43 -2
- package/dist/screen/types.d.ts.map +1 -1
- package/dist/settings/api-fetcher.d.ts +14 -3
- package/dist/settings/api-fetcher.d.ts.map +1 -1
- package/dist/settings/api-fetcher.js +61 -10
- package/dist/settings/grading-guide.d.ts +102 -0
- package/dist/settings/grading-guide.d.ts.map +1 -0
- package/dist/settings/grading-guide.js +23 -0
- package/dist/settings/index.d.ts +3 -2
- package/dist/settings/index.d.ts.map +1 -1
- package/dist/settings/index.js +2 -1
- package/dist/settings/task-settings.d.ts +44 -7
- package/dist/settings/task-settings.d.ts.map +1 -1
- package/dist/settings/task-settings.js +53 -12
- package/dist/status.d.ts +32 -20
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +51 -30
- package/dist/telemetry/artifact-store.d.ts +5 -6
- package/dist/telemetry/artifact-store.d.ts.map +1 -1
- package/dist/telemetry/artifact-store.js +21 -24
- package/dist/telemetry/attempt-meta.d.ts +76 -1
- package/dist/telemetry/attempt-meta.d.ts.map +1 -1
- package/dist/telemetry/attempt-meta.js +33 -1
- package/dist/telemetry/exporter-setup.d.ts +2 -0
- package/dist/telemetry/exporter-setup.d.ts.map +1 -1
- package/dist/telemetry/exporter-setup.js +6 -1
- package/dist/telemetry/exporter.d.ts +2 -2
- package/dist/telemetry/exporter.d.ts.map +1 -1
- package/dist/telemetry/exporter.js +22 -41
- package/dist/telemetry/grade-mappers.d.ts +25 -0
- package/dist/telemetry/grade-mappers.d.ts.map +1 -0
- package/dist/telemetry/grade-mappers.js +64 -0
- package/dist/telemetry/grades-sql.d.ts +56 -0
- package/dist/telemetry/grades-sql.d.ts.map +1 -0
- package/dist/telemetry/grades-sql.js +156 -0
- package/dist/telemetry/ingest-protocol.d.ts +55 -48
- package/dist/telemetry/ingest-protocol.d.ts.map +1 -1
- package/dist/telemetry/ingest-protocol.js +48 -83
- package/dist/telemetry/org-identity.d.ts +44 -0
- package/dist/telemetry/org-identity.d.ts.map +1 -0
- package/dist/telemetry/org-identity.js +98 -0
- package/dist/telemetry/route-registration.d.ts +48 -0
- package/dist/telemetry/route-registration.d.ts.map +1 -0
- package/dist/telemetry/route-registration.js +77 -0
- package/dist/telemetry/sinks.d.ts +10 -1
- package/dist/telemetry/sinks.d.ts.map +1 -1
- package/dist/telemetry/sinks.js +52 -6
- package/dist/telemetry/store-migrations.d.ts.map +1 -1
- package/dist/telemetry/store-migrations.js +64 -0
- package/dist/telemetry/store.d.ts +9 -6
- package/dist/telemetry/store.d.ts.map +1 -1
- package/dist/telemetry/store.js +8 -50
- package/dist/tenancy/api-key-format.d.ts +45 -1
- package/dist/tenancy/api-key-format.d.ts.map +1 -1
- package/dist/tenancy/api-key-format.js +50 -1
- package/dist/types/provider.d.ts +23 -3
- package/dist/types/provider.d.ts.map +1 -1
- package/dist/types/provider.js +26 -0
- package/dist/types/route.d.ts +154 -2
- package/dist/types/route.d.ts.map +1 -1
- package/dist/types/telemetry.d.ts +73 -48
- package/dist/types/telemetry.d.ts.map +1 -1
- package/dist/validate-cli.d.ts.map +1 -1
- package/dist/validate-cli.js +32 -0
- package/dist/verify/verify.d.ts +5 -0
- package/dist/verify/verify.d.ts.map +1 -1
- package/dist/verify/verify.js +2 -0
- package/dist/watch/evaluate.d.ts +84 -1
- package/dist/watch/evaluate.d.ts.map +1 -1
- package/dist/watch/evaluate.js +28 -0
- package/dist/watch/monitor.d.ts +8 -2
- package/dist/watch/monitor.d.ts.map +1 -1
- package/dist/watch/monitor.js +13 -5
- package/dist/watch/regret-monitor-cli.d.ts +16 -0
- package/dist/watch/regret-monitor-cli.d.ts.map +1 -0
- package/dist/watch/regret-monitor-cli.js +137 -0
- package/dist/watch/regret-monitor.d.ts +168 -0
- package/dist/watch/regret-monitor.d.ts.map +1 -0
- package/dist/watch/regret-monitor.js +304 -0
- package/dist/watch/upgrade.d.ts +62 -0
- package/dist/watch/upgrade.d.ts.map +1 -0
- package/dist/watch/upgrade.js +57 -0
- package/docs/agent-skill/SKILL.md +181 -9
- package/docs/how-it-fits.md +3 -2
- package/docs/instrumentation.md +219 -46
- package/docs/llms.txt +158 -35
- package/docs/managed-serving.md +150 -0
- package/docs/mcp-oracle.md +322 -0
- package/docs/migration-playbook.md +5 -4
- package/docs/quickstart.md +263 -89
- package/package.json +18 -4
- package/registry/leaderboard.json +74 -0
- package/registry/registry.json +232 -112
- package/screen.d.ts +16 -0
- package/templates/call-disposition-qa.json +77 -0
- package/templates/catalog-cleansing.json +77 -0
- package/templates/compliance-review.json +76 -0
- package/templates/cs-next-action.json +76 -0
- package/templates/document-extraction.json +78 -0
- package/templates/financial-classification.json +75 -0
- package/templates/lead-qualification.json +76 -0
- package/templates/medical-classification.json +71 -0
- package/templates/ticket-triage.json +76 -0
- package/dist/feedback/feedback.d.ts +0 -35
- package/dist/feedback/feedback.d.ts.map +0 -1
- package/dist/feedback/feedback.js +0 -39
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Raw-lane finalize + telemetry (spec §4.2/§4.3), extracted from raw.ts (Unified
|
|
3
|
+
* Route U4) to keep raw.ts under the 700-LOC cap (dev-rule P1). PURE MOVE in
|
|
4
|
+
* Phase A — `prepareRawStep`, `finalizeRaw`, `recordRawRow`, and the tier-aware
|
|
5
|
+
* timeout fixHint are byte-identical to their former raw.ts definitions.
|
|
6
|
+
*
|
|
7
|
+
* Raw-lane no-hard-hot-path-dependency invariant preserved: this module imports
|
|
8
|
+
* cost/telemetry/run-context/attempt-meta helpers and the native-search cost
|
|
9
|
+
* recorder — NO route/registry/capability-gate dependency.
|
|
10
|
+
*/
|
|
11
|
+
import { type ActiveRunContext } from "../artifacts/run-context";
|
|
12
|
+
import type { AdapterResult, ServiceTier } from "../types/provider";
|
|
13
|
+
import type { RunResult } from "../types/route";
|
|
14
|
+
import type { RawRunDeps, RawRunInput } from "./raw";
|
|
15
|
+
/** R1 — the teaching `fixHint` attached to a `timeout` failure on the raw lane:
|
|
16
|
+
* it names the elapsed budget, the tier, that tier's advertised target, and the
|
|
17
|
+
* two fixes (raise `timeoutMs`, or drop to `standard`). Built from
|
|
18
|
+
* `RAW_TIMEOUT_DEFAULT_MS` so the default it quotes can never drift. */
|
|
19
|
+
export declare function rawTimeoutFixHint(input: RawRunInput, tier: ServiceTier): string;
|
|
20
|
+
/** The active-run-context binding a raw call resolves ONCE at entry (the ALS
|
|
21
|
+
* boundary — read synchronously before the stream generator defers), so
|
|
22
|
+
* `finalizeRaw` can mirror the call into a ground-truth step (G1 spec §4). Null
|
|
23
|
+
* when there is no `run.start` on this path (the common, uninstrumented case). */
|
|
24
|
+
export interface RawStepContext {
|
|
25
|
+
readonly runCtx: ActiveRunContext;
|
|
26
|
+
readonly stepKey: string;
|
|
27
|
+
readonly startedAtIso: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Read the ambient run context at the ENTRY of a raw call (spec §4) and, if
|
|
31
|
+
* present, resolve the step key `input.stepKey ?? tags.step ?? provider/model#n`
|
|
32
|
+
* (validated) — so `finalizeRaw` records a ground-truth step exactly like the
|
|
33
|
+
* routed lane. Also runs the required-dimension hygiene warning (spec §4),
|
|
34
|
+
* unconditionally, as the routed lane does. Fail-open: no context ⇒ null and no
|
|
35
|
+
* step is ever recorded; the dispatch is byte-identical to pre-G1.
|
|
36
|
+
*/
|
|
37
|
+
export declare function prepareRawStep(deps: RawRunDeps, input: RawRunInput): RawStepContext | null;
|
|
38
|
+
/**
|
|
39
|
+
* Turn an `AdapterResult` into a RunResult, recording exactly one telemetry row.
|
|
40
|
+
* Shared by the buffered and streaming paths so cost/telemetry are byte-identical.
|
|
41
|
+
* On a failure result: record the (possibly billed) row, then throw
|
|
42
|
+
* `RigFailureError` — the server maps it to a status exactly like the slug lane.
|
|
43
|
+
*
|
|
44
|
+
* G1: when a run context was captured at entry (`step`), a ground-truth step is
|
|
45
|
+
* emitted after the telemetry row on BOTH branches (success and failure) —
|
|
46
|
+
* fail-open, so a buffer error there never affects the returned result. No
|
|
47
|
+
* artifact CONTENT is written on the raw lane (spec F3): steps are metadata.
|
|
48
|
+
*/
|
|
49
|
+
export declare function finalizeRaw(deps: RawRunDeps, input: RawRunInput, result: AdapterResult, latencyMs: number, step: RawStepContext | null): RunResult;
|
|
50
|
+
//# sourceMappingURL=raw-finalize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raw-finalize.d.ts","sourceRoot":"","sources":["../../src/run/raw-finalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EACV,aAAa,EAGb,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAW,SAAS,EAAW,MAAM,gBAAgB,CAAC;AAKlE,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAErD;;;wEAGwE;AACxE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,GAAG,MAAM,CAS/E;AA6ED;;;kFAGkF;AAClF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,GAAG,cAAc,GAAG,IAAI,CAU1F;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,cAAc,GAAG,IAAI,GAC1B,SAAS,CA6JX"}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Raw-lane finalize + telemetry (spec §4.2/§4.3), extracted from raw.ts (Unified
|
|
4
|
+
* Route U4) to keep raw.ts under the 700-LOC cap (dev-rule P1). PURE MOVE in
|
|
5
|
+
* Phase A — `prepareRawStep`, `finalizeRaw`, `recordRawRow`, and the tier-aware
|
|
6
|
+
* timeout fixHint are byte-identical to their former raw.ts definitions.
|
|
7
|
+
*
|
|
8
|
+
* Raw-lane no-hard-hot-path-dependency invariant preserved: this module imports
|
|
9
|
+
* cost/telemetry/run-context/attempt-meta helpers and the native-search cost
|
|
10
|
+
* recorder — NO route/registry/capability-gate dependency.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.rawTimeoutFixHint = rawTimeoutFixHint;
|
|
14
|
+
exports.prepareRawStep = prepareRawStep;
|
|
15
|
+
exports.finalizeRaw = finalizeRaw;
|
|
16
|
+
const node_crypto_1 = require("node:crypto");
|
|
17
|
+
const cost_1 = require("./cost");
|
|
18
|
+
const raw_defaults_1 = require("./raw-defaults");
|
|
19
|
+
const raw_request_1 = require("./raw-request");
|
|
20
|
+
const raw_search_cost_1 = require("./raw-search-cost");
|
|
21
|
+
const raw_schema_1 = require("./raw-schema");
|
|
22
|
+
const failures_1 = require("../types/failures");
|
|
23
|
+
const run_context_1 = require("../artifacts/run-context");
|
|
24
|
+
const manifest_1 = require("../routes/manifest");
|
|
25
|
+
const attempt_meta_1 = require("../telemetry/attempt-meta");
|
|
26
|
+
const telemetry_row_1 = require("./telemetry-row");
|
|
27
|
+
/** R1 — the teaching `fixHint` attached to a `timeout` failure on the raw lane:
|
|
28
|
+
* it names the elapsed budget, the tier, that tier's advertised target, and the
|
|
29
|
+
* two fixes (raise `timeoutMs`, or drop to `standard`). Built from
|
|
30
|
+
* `RAW_TIMEOUT_DEFAULT_MS` so the default it quotes can never drift. */
|
|
31
|
+
function rawTimeoutFixHint(input, tier) {
|
|
32
|
+
const deadlineSec = (0, raw_request_1.resolveRawTimeoutMs)(input) / 1000;
|
|
33
|
+
const budgetMin = raw_defaults_1.RAW_TIMEOUT_DEFAULT_MS[tier] / 60000;
|
|
34
|
+
const defaultSec = raw_defaults_1.RAW_TIMEOUT_DEFAULT_MS[tier] / 1000;
|
|
35
|
+
// Only flex has a cheaper-latency tier to drop to; at standard/priority the
|
|
36
|
+
// only fix is a longer deadline (never tell a caller to switch to the tier
|
|
37
|
+
// they are already on).
|
|
38
|
+
const tail = tier === "flex" ? ' or use serviceTier: "standard"' : "";
|
|
39
|
+
return `timed out at the ${deadlineSec}s deadline at tier ${tier} — ${tier} targets up to ${budgetMin} min; raise timeoutMs (default ${defaultSec}s)${tail}`;
|
|
40
|
+
}
|
|
41
|
+
/** Write the metered raw-lane telemetry row. Mirrors the run loop's minimal
|
|
42
|
+
* `recordSearchCostRow` shape: only load-bearing fields set, route = the
|
|
43
|
+
* `provider/model` handle the caller used, lane + key_ownership riding in
|
|
44
|
+
* `tags_json`. The exporter mirrors it on its normal cadence — no lane column,
|
|
45
|
+
* no schema change (telemetry map, 2026-08-10). */
|
|
46
|
+
function recordRawRow(telemetry, p) {
|
|
47
|
+
// U4: assembled by the ONE shared builder (./telemetry-row.ts). The raw lane's
|
|
48
|
+
// former hardcodes are now EXPLICIT inputs to the shared builder rather than
|
|
49
|
+
// literals hidden here: routeVersion 0, attemptsJson "{}", servedVariant null,
|
|
50
|
+
// rung "primary", attemptSeq 1, candidateIndex 0. `lane: "raw"` rides p.tags.
|
|
51
|
+
const row = (0, telemetry_row_1.buildTelemetryRow)({
|
|
52
|
+
id: p.id,
|
|
53
|
+
route: p.rawModelId,
|
|
54
|
+
routeVersion: 0,
|
|
55
|
+
provider: p.provider,
|
|
56
|
+
model: p.model,
|
|
57
|
+
requestedTier: p.requestedTier,
|
|
58
|
+
servedTier: p.usage?.servedTier ?? "standard",
|
|
59
|
+
tokensIn: p.usage?.tokensIn ?? 0,
|
|
60
|
+
tokensOut: p.usage?.tokensOut ?? 0,
|
|
61
|
+
tokensCached: p.usage?.tokensCached ?? 0,
|
|
62
|
+
tokensCacheWrite: p.usage?.tokensCacheWrite ?? 0,
|
|
63
|
+
tokensCacheWrite1h: p.usage?.tokensCacheWrite1h ?? 0,
|
|
64
|
+
costEstimateUsd: p.costUsd,
|
|
65
|
+
latencyMs: p.latencyMs,
|
|
66
|
+
ttfbMs: p.usage?.ttfbMs ?? null,
|
|
67
|
+
failureClass: p.failureClass,
|
|
68
|
+
attemptsJson: "{}",
|
|
69
|
+
// Rung tag (R1 review, F1): the raw lane is a single primary dispatch. Raw
|
|
70
|
+
// rows carry `lane: "raw"` (in p.tags) and are excluded from route rollups,
|
|
71
|
+
// but every row gets a rung for a uniform contract.
|
|
72
|
+
baseTags: p.tags,
|
|
73
|
+
rung: "primary",
|
|
74
|
+
fingerprintCell: null,
|
|
75
|
+
servedVariant: null,
|
|
76
|
+
repairedBy: null,
|
|
77
|
+
pricingMissing: p.pricingMissing,
|
|
78
|
+
// CE-1: a customer cache handle (if supplied) stamps `cache_key`; the raw
|
|
79
|
+
// lane runs no WS-C stamping, so `prefix_fingerprint` is always null and the
|
|
80
|
+
// provenance rule reads any non-null key here as `customer`.
|
|
81
|
+
cacheKey: p.cacheKey ?? null,
|
|
82
|
+
prefixFingerprint: null,
|
|
83
|
+
// Ladder key (spec §2.1 R0): raw lane = one row per call, seq 1, index 0.
|
|
84
|
+
callId: p.callId,
|
|
85
|
+
attemptSeq: 1,
|
|
86
|
+
candidateIndex: 0,
|
|
87
|
+
meta: p.meta,
|
|
88
|
+
});
|
|
89
|
+
telemetry.record(row);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Read the ambient run context at the ENTRY of a raw call (spec §4) and, if
|
|
93
|
+
* present, resolve the step key `input.stepKey ?? tags.step ?? provider/model#n`
|
|
94
|
+
* (validated) — so `finalizeRaw` records a ground-truth step exactly like the
|
|
95
|
+
* routed lane. Also runs the required-dimension hygiene warning (spec §4),
|
|
96
|
+
* unconditionally, as the routed lane does. Fail-open: no context ⇒ null and no
|
|
97
|
+
* step is ever recorded; the dispatch is byte-identical to pre-G1.
|
|
98
|
+
*/
|
|
99
|
+
function prepareRawStep(deps, input) {
|
|
100
|
+
const runCtx = (0, run_context_1.getActiveRunContext)();
|
|
101
|
+
// Warn on the EFFECTIVE tags: an auto-stamped run_id (RC-1) is not missing.
|
|
102
|
+
(0, manifest_1.warnMissingRequiredDimensions)(deps.manifest ?? null, (0, run_context_1.withRunIdTag)(input.tags ?? {}, runCtx));
|
|
103
|
+
if (runCtx === null)
|
|
104
|
+
return null;
|
|
105
|
+
const rawModelId = `${input.provider}/${input.model}`;
|
|
106
|
+
const stepKey = (0, run_context_1.resolveStepKey)(input.stepKey, input.tags?.step, () => runCtx.nextStepKey(rawModelId));
|
|
107
|
+
return { runCtx, stepKey, startedAtIso: new Date().toISOString() };
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Turn an `AdapterResult` into a RunResult, recording exactly one telemetry row.
|
|
111
|
+
* Shared by the buffered and streaming paths so cost/telemetry are byte-identical.
|
|
112
|
+
* On a failure result: record the (possibly billed) row, then throw
|
|
113
|
+
* `RigFailureError` — the server maps it to a status exactly like the slug lane.
|
|
114
|
+
*
|
|
115
|
+
* G1: when a run context was captured at entry (`step`), a ground-truth step is
|
|
116
|
+
* emitted after the telemetry row on BOTH branches (success and failure) —
|
|
117
|
+
* fail-open, so a buffer error there never affects the returned result. No
|
|
118
|
+
* artifact CONTENT is written on the raw lane (spec F3): steps are metadata.
|
|
119
|
+
*/
|
|
120
|
+
function finalizeRaw(deps, input, result, latencyMs, step) {
|
|
121
|
+
const unpricedRatePerTok = (deps.unpricedRateUsdPerMTok ?? cost_1.DEFAULT_UNPRICED_RATE_USD_PER_MTOK) / 1000000;
|
|
122
|
+
const rawModelId = `${input.provider}/${input.model}`;
|
|
123
|
+
// One call_id for this raw invocation — shared by the (single) recorded row and
|
|
124
|
+
// the returned meta (spec §2.1 R0).
|
|
125
|
+
const callId = (0, node_crypto_1.randomUUID)();
|
|
126
|
+
// CE-2 F2: the declared tier is reported truthfully on the row AND the meta.
|
|
127
|
+
const requestedTier = input.serviceTier ?? "standard";
|
|
128
|
+
// RC-1: `run_id` from the ambient run (caller's value wins); lane is SDK-owned
|
|
129
|
+
// and cannot be overridden by a caller-supplied tag.
|
|
130
|
+
// GS-1: `tags.step` from the ambient step key (step.stepKey = caller's stepKey
|
|
131
|
+
// ?? tags.step ?? the auto provider/model#n key) when a run is active and the
|
|
132
|
+
// caller set none — spread FIRST so a caller value wins, and omitted entirely
|
|
133
|
+
// outside a run context so the row stays byte-identical (parity with RC-1).
|
|
134
|
+
const stepTag = step !== null ? { step: step.stepKey } : {};
|
|
135
|
+
const tags = { ...stepTag, ...(0, run_context_1.withRunIdTag)(input.tags ?? {}, step?.runCtx ?? null), lane: "raw" };
|
|
136
|
+
// WI-1 (spec §2, §6.3 lane parity): the attempt envelope, built by the SAME
|
|
137
|
+
// producer + rendered-request canonicalization the routed lane uses. R2: a
|
|
138
|
+
// declared `responseSchema` joins the input_hash exactly as a route schema
|
|
139
|
+
// does (lane parity), and its canonical sha rides `meta.schema_sha`; absent ⇒
|
|
140
|
+
// schema null and no key — byte-identical to pre-R2.
|
|
141
|
+
const schema = input.responseSchema ?? null;
|
|
142
|
+
const schemaSha = schema !== null ? (0, raw_schema_1.rawSchemaSha)(schema) : undefined;
|
|
143
|
+
const declaredToolNames = input.tools?.map((t) => t.function.name);
|
|
144
|
+
const rawMeta = (usage) => (0, attempt_meta_1.summarizeAttemptMeta)({
|
|
145
|
+
...(result.meta !== undefined ? { adapterMeta: result.meta } : {}),
|
|
146
|
+
renderedRequest: (0, attempt_meta_1.renderRequestForHash)({ system: input.systemPrompt, user: input.userPrompt, schema }),
|
|
147
|
+
outputText: result.ok ? result.text : null,
|
|
148
|
+
...(declaredToolNames !== undefined ? { declaredToolNames } : {}),
|
|
149
|
+
...(schemaSha !== undefined ? { schemaSha } : {}),
|
|
150
|
+
provider: input.provider,
|
|
151
|
+
model: input.model,
|
|
152
|
+
...(usage !== undefined ? { usage } : {}),
|
|
153
|
+
});
|
|
154
|
+
// G1: mirror this raw inference into a ground-truth step (parity with the
|
|
155
|
+
// routed lane's record-attempt). task = tags.step ?? provider/model (spec F1).
|
|
156
|
+
// Fail-open is handled inside emitGroundTruthStep (buffer errors are swallowed).
|
|
157
|
+
const emitStep = (inferenceId, failureClass) => {
|
|
158
|
+
if (step === null)
|
|
159
|
+
return;
|
|
160
|
+
step.runCtx.emitGroundTruthStep({
|
|
161
|
+
stepKey: step.stepKey,
|
|
162
|
+
task: input.tags?.step ?? rawModelId,
|
|
163
|
+
inferenceId,
|
|
164
|
+
startedAt: step.startedAtIso,
|
|
165
|
+
endedAt: new Date().toISOString(),
|
|
166
|
+
failureClass,
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
if (!result.ok) {
|
|
170
|
+
let costUsd = 0;
|
|
171
|
+
let pricingMissing = false;
|
|
172
|
+
if (result.usage !== undefined) {
|
|
173
|
+
const settled = (0, cost_1.attemptCost)(input.provider, input.model, result.usage, unpricedRatePerTok);
|
|
174
|
+
costUsd = settled.costUsd;
|
|
175
|
+
pricingMissing = settled.pricingMissing;
|
|
176
|
+
}
|
|
177
|
+
const failId = (0, node_crypto_1.randomUUID)();
|
|
178
|
+
recordRawRow(deps.telemetry, {
|
|
179
|
+
id: failId,
|
|
180
|
+
rawModelId,
|
|
181
|
+
provider: input.provider,
|
|
182
|
+
model: input.model,
|
|
183
|
+
...(result.usage !== undefined ? { usage: result.usage } : {}),
|
|
184
|
+
costUsd,
|
|
185
|
+
latencyMs,
|
|
186
|
+
requestedTier,
|
|
187
|
+
failureClass: result.failure.class,
|
|
188
|
+
tags,
|
|
189
|
+
pricingMissing,
|
|
190
|
+
callId,
|
|
191
|
+
meta: rawMeta(result.usage),
|
|
192
|
+
...(input.cache !== undefined ? { cacheKey: input.cache.key } : {}),
|
|
193
|
+
});
|
|
194
|
+
emitStep(failId, result.failure.class);
|
|
195
|
+
// R1: a raw-lane timeout is the #245 footgun — attach the tier-aware teaching
|
|
196
|
+
// hint (the customer is looking at THIS error). Any other failure surfaces
|
|
197
|
+
// unchanged. Overrides any adapter-set hint: the tier + budget is the fix.
|
|
198
|
+
if (result.failure.class === "timeout") {
|
|
199
|
+
throw new failures_1.RigFailureError({
|
|
200
|
+
...result.failure,
|
|
201
|
+
fixHint: rawTimeoutFixHint(input, requestedTier),
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
throw new failures_1.RigFailureError(result.failure);
|
|
205
|
+
}
|
|
206
|
+
const { costUsd, pricingMissing } = (0, cost_1.attemptCost)(input.provider, input.model, result.usage, unpricedRatePerTok);
|
|
207
|
+
const id = (0, node_crypto_1.randomUUID)();
|
|
208
|
+
const toolCalls = result.toolCalls;
|
|
209
|
+
const isToolTurn = toolCalls !== undefined && toolCalls.length > 0;
|
|
210
|
+
// R2 (issue #6): a declared responseSchema is checked HERE, client-side, on a
|
|
211
|
+
// text turn (a tool-call turn is not schema-validated — parity with the run
|
|
212
|
+
// loop). A miss is a BILLED row of class content_invalid (the provider served
|
|
213
|
+
// and charged) + a thrown RigFailureError; the raw lane never repairs/retries.
|
|
214
|
+
const schemaOutcome = schema !== null && !isToolTurn ? (0, raw_schema_1.validateRawOutput)(schema, result.text) : { ok: true };
|
|
215
|
+
recordRawRow(deps.telemetry, {
|
|
216
|
+
id,
|
|
217
|
+
rawModelId,
|
|
218
|
+
provider: input.provider,
|
|
219
|
+
model: input.model,
|
|
220
|
+
usage: result.usage,
|
|
221
|
+
costUsd,
|
|
222
|
+
latencyMs,
|
|
223
|
+
requestedTier,
|
|
224
|
+
failureClass: schemaOutcome.ok ? null : "content_invalid",
|
|
225
|
+
tags,
|
|
226
|
+
pricingMissing,
|
|
227
|
+
callId,
|
|
228
|
+
meta: rawMeta(result.usage),
|
|
229
|
+
...(input.cache !== undefined ? { cacheKey: input.cache.key } : {}),
|
|
230
|
+
});
|
|
231
|
+
emitStep(id, schemaOutcome.ok ? null : "content_invalid");
|
|
232
|
+
if (!schemaOutcome.ok)
|
|
233
|
+
throw new failures_1.RigFailureError((0, raw_schema_1.rawSchemaMismatchFailure)(input, schemaOutcome.errors));
|
|
234
|
+
// NWS N3: a NATIVE-grounded success writes one extra, legible `rung:"search"`
|
|
235
|
+
// cost row (the `web_search` surcharge) beside the token row — ZERO DDL,
|
|
236
|
+
// recorder in raw-search-cost.ts. Gated on native grounding (a non-grounded
|
|
237
|
+
// success writes none); searchCalls from the Responses usage, else 1 (disclosed).
|
|
238
|
+
if (input.grounding?.mode === "native") {
|
|
239
|
+
(0, raw_search_cost_1.recordRawSearchCostRow)(deps.telemetry, { provider: input.provider, rawModelId, tags, callId, searchCalls: result.searchCalls ?? 1 });
|
|
240
|
+
}
|
|
241
|
+
const meta = {
|
|
242
|
+
inferenceId: id,
|
|
243
|
+
route: rawModelId,
|
|
244
|
+
routeVersion: 0,
|
|
245
|
+
provider: input.provider,
|
|
246
|
+
model: input.model,
|
|
247
|
+
requestedTier,
|
|
248
|
+
servedTier: result.usage.servedTier,
|
|
249
|
+
tokensIn: result.usage.tokensIn,
|
|
250
|
+
tokensOut: result.usage.tokensOut,
|
|
251
|
+
tokensCached: result.usage.tokensCached,
|
|
252
|
+
costEstimateUsd: costUsd,
|
|
253
|
+
latencyMs,
|
|
254
|
+
validated: false, // raw is NEVER validated — the central product claim
|
|
255
|
+
attemptsByClass: {},
|
|
256
|
+
servedVariant: null,
|
|
257
|
+
repairedBy: null,
|
|
258
|
+
callId,
|
|
259
|
+
...(isToolTurn ? { toolCalls } : {}),
|
|
260
|
+
// NWS N2: first native citations on the raw lane (url_citation shape; a
|
|
261
|
+
// grounded response may carry an empty array — surfaced, never thrown). Absent
|
|
262
|
+
// on every non-grounded call ⇒ key omitted (byte-identical meta).
|
|
263
|
+
...(result.citations !== undefined ? { citations: result.citations } : {}),
|
|
264
|
+
};
|
|
265
|
+
return { output: isToolTurn ? null : result.text, meta };
|
|
266
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Raw-lane fail-closed knob guard (CE-2/CE-9, spec §3 F1/F3, CE-9 R1/R2/R4),
|
|
3
|
+
* extracted from raw.ts (Unified Route U4) to keep raw.ts under the 700-LOC cap
|
|
4
|
+
* (dev-rule P1). PURE MOVE — behavior-preserving: the guard's checks, throw
|
|
5
|
+
* conditions, and teaching fixHints are byte-identical to the former inline
|
|
6
|
+
* `assertRawKnobsSupported`. Re-exported from ./raw so existing importers
|
|
7
|
+
* (`import { assertRawKnobsSupported } from "./raw"`) are unchanged.
|
|
8
|
+
*
|
|
9
|
+
* The raw lane's no-hard-hot-path-dependency invariant is preserved: this module
|
|
10
|
+
* pulls in only the capability vocabulary (`raw-support.ts`) and failure types —
|
|
11
|
+
* no route/registry/capability-gate dependency.
|
|
12
|
+
*/
|
|
13
|
+
import type { RawRunInput } from "./raw";
|
|
14
|
+
/**
|
|
15
|
+
* CE-2/CE-9 fail-closed guard (spec §3 F1/F3, CE-9 R1/R2/R4). A DECLARED
|
|
16
|
+
* directive is NEVER silently dropped: a `grounding`/`responseFormat` on a
|
|
17
|
+
* provider that cannot honor it, a `reasoning` on a provider with NO effort
|
|
18
|
+
* control (deepseek/anthropic), or a `grounding.mode` other than the
|
|
19
|
+
* v1-supported `"native"` throws `RigFailureError` `invariant_violation` (the
|
|
20
|
+
* existing TERMINAL class; no new FailureClass member) BEFORE any adapter is
|
|
21
|
+
* built, any provider call is made, or any telemetry row is written.
|
|
22
|
+
*
|
|
23
|
+
* The support facts come from `RAW_KNOB_SUPPORT` (run/raw-support.ts) — the ONE
|
|
24
|
+
* table the published docs matrix also reads, so the guard and the docs can
|
|
25
|
+
* never disagree (R5). What the guard does NOT reject (and why):
|
|
26
|
+
* - reasoning on openai/deepinfra/fireworks is FORWARDED verbatim
|
|
27
|
+
* (`kind: "forward"`) and the provider enforces — a rejection is classified
|
|
28
|
+
* teachably by the adapter (no per-model allowlist, R1).
|
|
29
|
+
* - reasoning on grok is a DISCLOSED coarsening (`kind: "coarsen"`).
|
|
30
|
+
* - reasoning on gemini is model-gated (`kind: "model-gated"`) — the adapter
|
|
31
|
+
* rejects a non-thinking model (`geminiReasoningUnsupported`).
|
|
32
|
+
* Exported so the guard is unit-testable without a network. Idempotent and
|
|
33
|
+
* side-effect-free.
|
|
34
|
+
*/
|
|
35
|
+
export declare function assertRawKnobsSupported(input: RawRunInput): void;
|
|
36
|
+
//# sourceMappingURL=raw-knobs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raw-knobs.d.ts","sourceRoot":"","sources":["../../src/run/raw-knobs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAUH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAkEhE"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Raw-lane fail-closed knob guard (CE-2/CE-9, spec §3 F1/F3, CE-9 R1/R2/R4),
|
|
4
|
+
* extracted from raw.ts (Unified Route U4) to keep raw.ts under the 700-LOC cap
|
|
5
|
+
* (dev-rule P1). PURE MOVE — behavior-preserving: the guard's checks, throw
|
|
6
|
+
* conditions, and teaching fixHints are byte-identical to the former inline
|
|
7
|
+
* `assertRawKnobsSupported`. Re-exported from ./raw so existing importers
|
|
8
|
+
* (`import { assertRawKnobsSupported } from "./raw"`) are unchanged.
|
|
9
|
+
*
|
|
10
|
+
* The raw lane's no-hard-hot-path-dependency invariant is preserved: this module
|
|
11
|
+
* pulls in only the capability vocabulary (`raw-support.ts`) and failure types —
|
|
12
|
+
* no route/registry/capability-gate dependency.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.assertRawKnobsSupported = assertRawKnobsSupported;
|
|
16
|
+
const failures_1 = require("../types/failures");
|
|
17
|
+
const raw_support_1 = require("./raw-support");
|
|
18
|
+
const raw_schema_1 = require("./raw-schema");
|
|
19
|
+
/**
|
|
20
|
+
* CE-2/CE-9 fail-closed guard (spec §3 F1/F3, CE-9 R1/R2/R4). A DECLARED
|
|
21
|
+
* directive is NEVER silently dropped: a `grounding`/`responseFormat` on a
|
|
22
|
+
* provider that cannot honor it, a `reasoning` on a provider with NO effort
|
|
23
|
+
* control (deepseek/anthropic), or a `grounding.mode` other than the
|
|
24
|
+
* v1-supported `"native"` throws `RigFailureError` `invariant_violation` (the
|
|
25
|
+
* existing TERMINAL class; no new FailureClass member) BEFORE any adapter is
|
|
26
|
+
* built, any provider call is made, or any telemetry row is written.
|
|
27
|
+
*
|
|
28
|
+
* The support facts come from `RAW_KNOB_SUPPORT` (run/raw-support.ts) — the ONE
|
|
29
|
+
* table the published docs matrix also reads, so the guard and the docs can
|
|
30
|
+
* never disagree (R5). What the guard does NOT reject (and why):
|
|
31
|
+
* - reasoning on openai/deepinfra/fireworks is FORWARDED verbatim
|
|
32
|
+
* (`kind: "forward"`) and the provider enforces — a rejection is classified
|
|
33
|
+
* teachably by the adapter (no per-model allowlist, R1).
|
|
34
|
+
* - reasoning on grok is a DISCLOSED coarsening (`kind: "coarsen"`).
|
|
35
|
+
* - reasoning on gemini is model-gated (`kind: "model-gated"`) — the adapter
|
|
36
|
+
* rejects a non-thinking model (`geminiReasoningUnsupported`).
|
|
37
|
+
* Exported so the guard is unit-testable without a network. Idempotent and
|
|
38
|
+
* side-effect-free.
|
|
39
|
+
*/
|
|
40
|
+
function assertRawKnobsSupported(input) {
|
|
41
|
+
const support = raw_support_1.RAW_KNOB_SUPPORT[input.provider];
|
|
42
|
+
const groundingMode = input.grounding?.mode;
|
|
43
|
+
if (groundingMode !== undefined) {
|
|
44
|
+
if (groundingMode !== "native") {
|
|
45
|
+
throw new failures_1.RigFailureError({
|
|
46
|
+
class: "invariant_violation",
|
|
47
|
+
message: `unsupported raw-lane grounding mode "${groundingMode}"`,
|
|
48
|
+
provider: input.provider,
|
|
49
|
+
model: input.model,
|
|
50
|
+
fixHint: 'only { mode: "native" } grounding is supported on the raw lane in v1',
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
if (!support.grounding.supported) {
|
|
54
|
+
throw new failures_1.RigFailureError({
|
|
55
|
+
class: "invariant_violation",
|
|
56
|
+
message: `native grounding on the raw lane is not supported for provider "${input.provider}"`,
|
|
57
|
+
provider: input.provider,
|
|
58
|
+
model: input.model,
|
|
59
|
+
fixHint: `native grounding on the raw lane is supported on ${(0, raw_support_1.groundingSupportedProviders)().join(", ")} only; remove grounding or switch provider`,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (input.reasoning !== undefined && support.reasoning.kind === "fail-closed") {
|
|
64
|
+
throw new failures_1.RigFailureError({
|
|
65
|
+
class: "invariant_violation",
|
|
66
|
+
message: `reasoning control on the raw lane is not supported for provider "${input.provider}"`,
|
|
67
|
+
provider: input.provider,
|
|
68
|
+
model: input.model,
|
|
69
|
+
// Provider-specific teaching straight from the matrix (deepseek →
|
|
70
|
+
// deepseek-reasoner; anthropic → extended thinking unwired).
|
|
71
|
+
fixHint: support.reasoning.fixHint ??
|
|
72
|
+
"reasoning control is not available for this provider on the raw lane; remove reasoning",
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
if (input.responseFormat !== undefined && !support.responseFormat.supported) {
|
|
76
|
+
throw new failures_1.RigFailureError({
|
|
77
|
+
class: "invariant_violation",
|
|
78
|
+
message: `responseFormat on the raw lane is not supported for provider "${input.provider}"`,
|
|
79
|
+
provider: input.provider,
|
|
80
|
+
model: input.model,
|
|
81
|
+
fixHint: `responseFormat: "json_object" on the raw lane is supported on ${(0, raw_support_1.responseFormatSupportedProviders)().join(", ")} only; remove responseFormat or switch provider`,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
// R2 (issue #6): a declared JSON Schema on a provider whose adapter has no
|
|
85
|
+
// NATIVE schema path (deepseek, the compat hosts) is rejected here — it would
|
|
86
|
+
// otherwise be silently dropped or degraded to json_object. Provider list from
|
|
87
|
+
// the matrix, so widening a cell widens the error. Then the SHAPE check (plain
|
|
88
|
+
// object, compiles, not alongside responseFormat) — raw-schema.ts.
|
|
89
|
+
if (input.responseSchema !== undefined && !support.responseSchema.supported) {
|
|
90
|
+
throw new failures_1.RigFailureError({
|
|
91
|
+
class: "invariant_violation",
|
|
92
|
+
message: `responseSchema on the raw lane is not supported for provider "${input.provider}"`,
|
|
93
|
+
provider: input.provider,
|
|
94
|
+
model: input.model,
|
|
95
|
+
fixHint: `responseSchema on the raw lane is supported on ${(0, raw_support_1.responseSchemaSupportedProviders)().join(", ")} only (native structured output); remove responseSchema, use responseFormat: "json_object" (mime-shaping only), or switch provider`,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
(0, raw_schema_1.assertRawResponseSchemaShape)(input);
|
|
99
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Raw-lane request shaping (spec §4.2), extracted from raw.ts (Unified Route U4)
|
|
3
|
+
* to keep raw.ts under the 700-LOC cap (dev-rule P1). PURE MOVE — the effective
|
|
4
|
+
* timeout resolution and the `AdapterRequest` shaping are byte-identical to the
|
|
5
|
+
* former inline `resolveRawTimeoutMs` / `buildRawRequest`. `buildRawRequest` is
|
|
6
|
+
* re-exported from ./raw so existing importers are unchanged.
|
|
7
|
+
*
|
|
8
|
+
* No route/registry/capability-gate dependency (raw-lane invariant preserved):
|
|
9
|
+
* only the tier-aware timeout table and provider types.
|
|
10
|
+
*/
|
|
11
|
+
import type { AdapterRequest, CandidateRef } from "../types/provider";
|
|
12
|
+
import type { RawRunInput } from "./raw";
|
|
13
|
+
/**
|
|
14
|
+
* R1 — resolve the effective raw-lane timeout. An explicit `timeoutMs` always
|
|
15
|
+
* wins; absent, the fallback is TIER-AWARE (`RAW_TIMEOUT_DEFAULT_MS`), because a
|
|
16
|
+
* passthrough should not be shorter-fused than the tier it advertises (a flex
|
|
17
|
+
* grounded prompt needs minutes, not the old 120 s). No pre-dispatch rejection —
|
|
18
|
+
* a short explicit timeout is a choice, and the teaching arrives on the first
|
|
19
|
+
* `timeout` failure (`rawTimeoutFixHint`), which is when the caller is looking.
|
|
20
|
+
*/
|
|
21
|
+
export declare function resolveRawTimeoutMs(input: RawRunInput): number;
|
|
22
|
+
/** Pure raw-lane request shaping — exported for unit tests (no network). */
|
|
23
|
+
export declare function buildRawRequest(candidate: CandidateRef, input: RawRunInput): AdapterRequest;
|
|
24
|
+
//# sourceMappingURL=raw-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raw-request.d.ts","sourceRoot":"","sources":["../../src/run/raw-request.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEzC;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAE9D;AAED,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,GAAG,cAAc,CA0C3F"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Raw-lane request shaping (spec §4.2), extracted from raw.ts (Unified Route U4)
|
|
4
|
+
* to keep raw.ts under the 700-LOC cap (dev-rule P1). PURE MOVE — the effective
|
|
5
|
+
* timeout resolution and the `AdapterRequest` shaping are byte-identical to the
|
|
6
|
+
* former inline `resolveRawTimeoutMs` / `buildRawRequest`. `buildRawRequest` is
|
|
7
|
+
* re-exported from ./raw so existing importers are unchanged.
|
|
8
|
+
*
|
|
9
|
+
* No route/registry/capability-gate dependency (raw-lane invariant preserved):
|
|
10
|
+
* only the tier-aware timeout table and provider types.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.resolveRawTimeoutMs = resolveRawTimeoutMs;
|
|
14
|
+
exports.buildRawRequest = buildRawRequest;
|
|
15
|
+
const raw_defaults_1 = require("./raw-defaults");
|
|
16
|
+
/**
|
|
17
|
+
* R1 — resolve the effective raw-lane timeout. An explicit `timeoutMs` always
|
|
18
|
+
* wins; absent, the fallback is TIER-AWARE (`RAW_TIMEOUT_DEFAULT_MS`), because a
|
|
19
|
+
* passthrough should not be shorter-fused than the tier it advertises (a flex
|
|
20
|
+
* grounded prompt needs minutes, not the old 120 s). No pre-dispatch rejection —
|
|
21
|
+
* a short explicit timeout is a choice, and the teaching arrives on the first
|
|
22
|
+
* `timeout` failure (`rawTimeoutFixHint`), which is when the caller is looking.
|
|
23
|
+
*/
|
|
24
|
+
function resolveRawTimeoutMs(input) {
|
|
25
|
+
return input.timeoutMs ?? raw_defaults_1.RAW_TIMEOUT_DEFAULT_MS[input.serviceTier ?? "standard"];
|
|
26
|
+
}
|
|
27
|
+
/** Pure raw-lane request shaping — exported for unit tests (no network). */
|
|
28
|
+
function buildRawRequest(candidate, input) {
|
|
29
|
+
// CE-6: forward temperature/topP through AdapterRequest.sampling ONLY when the
|
|
30
|
+
// caller declared at least one — absent, no `sampling` key is added and the
|
|
31
|
+
// request is byte-identical to pre-CE-6. maxOutputTokens keeps its top-level
|
|
32
|
+
// channel (the adapter resolves sampling.maxOutputTokens ?? maxOutputTokens).
|
|
33
|
+
const sampling = input.temperature !== undefined || input.topP !== undefined
|
|
34
|
+
? {
|
|
35
|
+
...(input.temperature !== undefined ? { temperature: input.temperature } : {}),
|
|
36
|
+
...(input.topP !== undefined ? { topP: input.topP } : {}),
|
|
37
|
+
}
|
|
38
|
+
: undefined;
|
|
39
|
+
return {
|
|
40
|
+
candidate,
|
|
41
|
+
systemPrompt: input.systemPrompt,
|
|
42
|
+
userPrompt: input.userPrompt,
|
|
43
|
+
// R2 (issue #6): a declared `responseSchema` rides the adapters' existing
|
|
44
|
+
// NATIVE schema path (outputSchema) — gemini responseJsonSchema, openai/grok
|
|
45
|
+
// strict json_schema, anthropic forced tool. Absent ⇒ null, byte-identical:
|
|
46
|
+
// the raw lane stays unvalidated unless the caller declares a schema.
|
|
47
|
+
outputSchema: input.responseSchema ?? null,
|
|
48
|
+
// CE-2 F2: forward the DECLARED tier (default "standard"); the meta/row
|
|
49
|
+
// honesty fix in finalizeRaw reports this same value, never a hardcode.
|
|
50
|
+
requestedTier: input.serviceTier ?? "standard",
|
|
51
|
+
// R1: tier-aware default (RAW_TIMEOUT_DEFAULT_MS); explicit timeoutMs wins.
|
|
52
|
+
timeoutMs: resolveRawTimeoutMs(input),
|
|
53
|
+
...(input.maxOutputTokens !== undefined ? { maxOutputTokens: input.maxOutputTokens } : {}),
|
|
54
|
+
...(sampling !== undefined ? { sampling } : {}),
|
|
55
|
+
// CE-2 F1: `{ mode: "native" }` → the adapter's native-grounding directive.
|
|
56
|
+
// Any other mode / unsupported provider never reaches here — the guard
|
|
57
|
+
// (assertRawKnobsSupported) rejects it pre-dispatch. Absent ⇒ no key added.
|
|
58
|
+
...(input.grounding?.mode === "native" ? { grounding: true } : {}),
|
|
59
|
+
// CE-2 F3: forward reasoning verbatim; absent ⇒ no key added (byte-identical).
|
|
60
|
+
...(input.reasoning !== undefined ? { reasoning: input.reasoning } : {}),
|
|
61
|
+
// CE-9 R4: forward the json_object directive verbatim; absent ⇒ no key added
|
|
62
|
+
// (byte-identical). An unsupported provider (anthropic) never reaches here —
|
|
63
|
+
// the guard (assertRawKnobsSupported) rejects it pre-dispatch.
|
|
64
|
+
...(input.responseFormat !== undefined ? { responseFormat: input.responseFormat } : {}),
|
|
65
|
+
...(input.tools !== undefined ? { tools: input.tools } : {}),
|
|
66
|
+
...(input.toolChoice !== undefined ? { toolChoice: input.toolChoice } : {}),
|
|
67
|
+
...(input.cache !== undefined ? { cache: input.cache } : {}),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* R2 (GitLab issue #6) — `responseSchema` on the raw lane: the schema helpers
|
|
3
|
+
* the guard (raw-knobs.ts) and the finalize path (raw-finalize.ts) share.
|
|
4
|
+
*
|
|
5
|
+
* What the knob IS: a JSON Schema the caller declares on `rig.runRaw`. It is
|
|
6
|
+
* forwarded as the provider's NATIVE structured-output directive (the adapters'
|
|
7
|
+
* existing `AdapterRequest.outputSchema` path — gemini `responseJsonSchema`,
|
|
8
|
+
* openai/grok strict `json_schema`, anthropic a forced tool call) AND the
|
|
9
|
+
* returned text is checked client-side by the SAME Ajv instance the routed lane
|
|
10
|
+
* uses (`createModelrigAjv`, 2020-12 + draft-07). A miss is `content_invalid`.
|
|
11
|
+
*
|
|
12
|
+
* What the knob is NOT: a ladder. The raw lane never repairs, never retries,
|
|
13
|
+
* and never falls through — a schema miss is a terminal, billed `content_invalid`
|
|
14
|
+
* row and a thrown `RigFailureError` whose `fixHint` names the first errors. F4
|
|
15
|
+
* is narrowed, not reversed: `meta.validated` stays `false` because no ladder
|
|
16
|
+
* stands behind the check (routing-docs.ts B2 states the boundary).
|
|
17
|
+
*
|
|
18
|
+
* Why its own file: raw-finalize.ts and raw-knobs.ts both sit under the 700-LOC
|
|
19
|
+
* cap (P1) and neither should pull Ajv + hashing into its header story; this
|
|
20
|
+
* module keeps the raw lane's no-route/registry dependency invariant (it imports
|
|
21
|
+
* only the shared Ajv factory and failure types).
|
|
22
|
+
*/
|
|
23
|
+
import type { RigFailure } from "../types/failures";
|
|
24
|
+
import type { ProviderId } from "../types/provider";
|
|
25
|
+
/** Canonical JSON — object keys sorted recursively, arrays in order, no
|
|
26
|
+
* whitespace — so two authored spellings of ONE schema hash identically and a
|
|
27
|
+
* reordered key never reads as drift. Pure; exported for the hash tests. */
|
|
28
|
+
export declare function canonicalJson(value: unknown): string;
|
|
29
|
+
/** `sha256:<hex>` of the canonical schema JSON — the value stamped on
|
|
30
|
+
* `inferences.meta.schema_sha` (a hash, never content; meta-safe by shape). */
|
|
31
|
+
export declare function rawSchemaSha(schema: object): string;
|
|
32
|
+
/** Root `type` of a schema when it declares one (the openai strict-mode
|
|
33
|
+
* object-root check reads this). `undefined` when absent or non-string. */
|
|
34
|
+
export declare function schemaRootType(schema: object): string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Pre-dispatch SHAPE check (called from the knob guard): the schema must be a
|
|
37
|
+
* plain JSON-Schema object that Ajv can compile. Anything else throws the
|
|
38
|
+
* existing terminal class `invariant_violation` BEFORE any adapter is built —
|
|
39
|
+
* no meter, no provider call, no telemetry row — with a teaching fixHint. Also
|
|
40
|
+
* the one place the openai strict-root warning lives: strict `json_schema`
|
|
41
|
+
* requires an object root; a non-object root is WARNED (the provider enforces
|
|
42
|
+
* and its rejection is classified teachably by the adapter), never silently
|
|
43
|
+
* rewritten. Idempotent; side-effect-free apart from the warning + compile cache.
|
|
44
|
+
*/
|
|
45
|
+
export declare function assertRawResponseSchemaShape(input: {
|
|
46
|
+
readonly provider: ProviderId;
|
|
47
|
+
readonly model: string;
|
|
48
|
+
readonly responseSchema?: object;
|
|
49
|
+
readonly responseFormat?: string;
|
|
50
|
+
}): void;
|
|
51
|
+
export type RawSchemaOutcome = {
|
|
52
|
+
readonly ok: true;
|
|
53
|
+
} | {
|
|
54
|
+
readonly ok: false;
|
|
55
|
+
readonly errors: readonly string[];
|
|
56
|
+
};
|
|
57
|
+
/** The one terminal-error rendering the raw lane makes (parity with run.ts's
|
|
58
|
+
* `content_invalid` message shape); exported for the finalize tests. */
|
|
59
|
+
export declare const RAW_SCHEMA_MAX_ERRORS = 5;
|
|
60
|
+
/**
|
|
61
|
+
* Validate the raw output text against the declared schema with the shared
|
|
62
|
+
* Ajv. Parity with the routed lane's `validateOutput`: a non-JSON body is a
|
|
63
|
+
* schema miss (one `parse` error), and Ajv errors render as `instancePath
|
|
64
|
+
* message`. Never throws — the shape check above already compiled the schema;
|
|
65
|
+
* a late compile failure (cache cleared + a schema that stopped compiling, which
|
|
66
|
+
* cannot happen for the same object) is reported as a miss, not a crash.
|
|
67
|
+
*/
|
|
68
|
+
export declare function validateRawOutput(schema: object, text: string): RawSchemaOutcome;
|
|
69
|
+
/** The `content_invalid` failure a raw schema miss raises — the EXISTING class
|
|
70
|
+
* (its table teaching + docsUrl apply via `teach()`), with a raw-lane fixHint:
|
|
71
|
+
* this lane never repairs, so the fix is the prompt/schema or a route. */
|
|
72
|
+
export declare function rawSchemaMismatchFailure(input: {
|
|
73
|
+
readonly provider: ProviderId;
|
|
74
|
+
readonly model: string;
|
|
75
|
+
}, errors: readonly string[]): RigFailure;
|
|
76
|
+
//# sourceMappingURL=raw-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raw-schema.d.ts","sourceRoot":"","sources":["../../src/run/raw-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;4EAE4E;AAC5E,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CASpD;AAED;+EAC+E;AAC/E,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;2EAC2E;AAC3E,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGjE;AAmBD;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE;IAClD,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC,GAAG,IAAI,CAqCP;AAED,MAAM,MAAM,gBAAgB,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAElH;wEACwE;AACxE,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAgBhF;AAED;;0EAE0E;AAC1E,wBAAgB,wBAAwB,CACtC,KAAK,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAChE,MAAM,EAAE,SAAS,MAAM,EAAE,GACxB,UAAU,CAWZ"}
|