omnicell-router 0.8.2 → 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/README.md +26 -7
- package/README.zh-CN.md +18 -5
- package/backend/dist/auth/api-keys.js +11 -0
- package/backend/dist/auth/key-models.d.ts +36 -0
- package/backend/dist/auth/key-models.js +99 -0
- package/backend/dist/capture/recorder.d.ts +4 -10
- package/backend/dist/capture/recorder.js +6 -58
- package/backend/dist/cli/clients/activity.js +2 -0
- package/backend/dist/cli/clients/base.d.ts +36 -11
- package/backend/dist/cli/clients/base.js +31 -15
- package/backend/dist/cli/clients/claude.d.ts +9 -0
- package/backend/dist/cli/clients/claude.js +6 -0
- package/backend/dist/cli/clients/codex.d.ts +78 -0
- package/backend/dist/cli/clients/codex.js +475 -57
- package/backend/dist/cli/clients/core-adapters.d.ts +1 -1
- package/backend/dist/cli/clients/core-adapters.js +1 -1
- package/backend/dist/cli/clients/dsh.d.ts +8 -0
- package/backend/dist/cli/clients/dsh.js +5 -0
- package/backend/dist/cli/clients/follow-catalog-sync.d.ts +62 -0
- package/backend/dist/cli/clients/follow-catalog-sync.js +435 -0
- package/backend/dist/cli/clients/grok.d.ts +15 -1
- package/backend/dist/cli/clients/grok.js +16 -2
- package/backend/dist/cli/clients/index.d.ts +13 -1
- package/backend/dist/cli/clients/index.js +97 -19
- package/backend/dist/cli/clients/kimi.d.ts +6 -0
- package/backend/dist/cli/clients/kimi.js +3 -0
- package/backend/dist/cli/clients/launcher.d.ts +1 -1
- package/backend/dist/cli/clients/model-meta.js +6 -3
- package/backend/dist/cli/clients/omp.d.ts +6 -0
- package/backend/dist/cli/clients/omp.js +3 -0
- package/backend/dist/cli/clients/openclaw.d.ts +6 -0
- package/backend/dist/cli/clients/openclaw.js +3 -0
- package/backend/dist/cli/clients/opencode.d.ts +8 -0
- package/backend/dist/cli/clients/opencode.js +8 -2
- package/backend/dist/cli/clients/pi.d.ts +6 -0
- package/backend/dist/cli/clients/pi.js +3 -0
- package/backend/dist/cli/clients/reserved.js +2 -0
- package/backend/dist/cli/clients/update-check.d.ts +37 -0
- package/backend/dist/cli/clients/update-check.js +309 -0
- package/backend/dist/cli/clients/workbuddy.d.ts +19 -0
- package/backend/dist/cli/clients/workbuddy.js +66 -0
- package/backend/dist/cli/index.js +5 -4
- package/backend/dist/cli/paths.js +8 -0
- package/backend/dist/cli/types.d.ts +101 -16
- package/backend/dist/config/comments-en.js +34 -25
- package/backend/dist/config/comments-zh.js +33 -24
- package/backend/dist/config/defaults.d.ts +280 -22
- package/backend/dist/config/defaults.js +279 -21
- package/backend/dist/config/env.d.ts +10 -0
- package/backend/dist/config/env.js +3 -2
- package/backend/dist/config/index.d.ts +22 -1
- package/backend/dist/config/index.js +218 -43
- package/backend/dist/config/migrations/v0-to-v1.d.ts +2 -2
- package/backend/dist/config/migrations/v10-to-v11.d.ts +38 -0
- package/backend/dist/config/migrations/v10-to-v11.js +43 -0
- package/backend/dist/config/migrations/v4-to-v5.d.ts +36 -0
- package/backend/dist/config/migrations/v4-to-v5.js +42 -0
- package/backend/dist/config/migrations/v5-to-v6.d.ts +27 -0
- package/backend/dist/config/migrations/v5-to-v6.js +29 -0
- package/backend/dist/config/migrations/v6-to-v7.d.ts +45 -0
- package/backend/dist/config/migrations/v6-to-v7.js +97 -0
- package/backend/dist/config/migrations/v7-to-v8.d.ts +36 -0
- package/backend/dist/config/migrations/v7-to-v8.js +43 -0
- package/backend/dist/config/migrations/v8-to-v9.d.ts +38 -0
- package/backend/dist/config/migrations/v8-to-v9.js +43 -0
- package/backend/dist/config/migrations/v9-to-v10.d.ts +51 -0
- package/backend/dist/config/migrations/v9-to-v10.js +71 -0
- package/backend/dist/config/runtime.js +1 -1
- package/backend/dist/config/schema.d.ts +3 -3
- package/backend/dist/config/schema.js +18 -4
- package/backend/dist/config/types.d.ts +221 -41
- package/backend/dist/egress-proxy/asset-download.d.ts +54 -0
- package/backend/dist/egress-proxy/asset-download.js +420 -0
- package/backend/dist/egress-proxy/manual-node-spec.d.ts +92 -0
- package/backend/dist/egress-proxy/manual-node-spec.js +408 -0
- package/backend/dist/egress-proxy/mihomo-binary.d.ts +54 -0
- package/backend/dist/egress-proxy/mihomo-binary.js +278 -0
- package/backend/dist/egress-proxy/mihomo-client.d.ts +94 -0
- package/backend/dist/egress-proxy/mihomo-client.js +308 -0
- package/backend/dist/egress-proxy/mihomo-config.d.ts +40 -0
- package/backend/dist/egress-proxy/mihomo-config.js +161 -0
- package/backend/dist/egress-proxy/mihomo-geo.d.ts +87 -0
- package/backend/dist/egress-proxy/mihomo-geo.js +213 -0
- package/backend/dist/egress-proxy/mihomo-logs.d.ts +43 -0
- package/backend/dist/egress-proxy/mihomo-logs.js +84 -0
- package/backend/dist/egress-proxy/mihomo-pac.d.ts +37 -0
- package/backend/dist/egress-proxy/mihomo-pac.js +75 -0
- package/backend/dist/egress-proxy/mihomo-rules-import.d.ts +43 -0
- package/backend/dist/egress-proxy/mihomo-rules-import.js +193 -0
- package/backend/dist/egress-proxy/mihomo-sidecar.d.ts +81 -0
- package/backend/dist/egress-proxy/mihomo-sidecar.js +637 -0
- package/backend/dist/forward-proxy/egress.d.ts +50 -11
- package/backend/dist/forward-proxy/egress.js +63 -17
- package/backend/dist/forward-proxy/h2-forward.js +42 -15
- package/backend/dist/forward-proxy/index.d.ts +11 -8
- package/backend/dist/forward-proxy/index.js +27 -60
- package/backend/dist/forward-proxy/interceptor.d.ts +3 -2
- package/backend/dist/forward-proxy/interceptor.js +4 -4
- package/backend/dist/forward-proxy/relay.js +3 -3
- package/backend/dist/forward-proxy/rules.d.ts +4 -4
- package/backend/dist/forward-proxy/rules.js +25 -4
- package/backend/dist/forward-proxy/server.d.ts +12 -16
- package/backend/dist/forward-proxy/server.js +237 -171
- package/backend/dist/harness/host/hosts.js +3 -2
- package/backend/dist/index.js +59 -19
- package/backend/dist/ingress-proxy/access-log.d.ts +176 -0
- package/backend/dist/ingress-proxy/access-log.js +774 -0
- package/backend/dist/ingress-proxy/ca-inventory.d.ts +106 -0
- package/backend/dist/ingress-proxy/ca-inventory.js +525 -0
- package/backend/dist/ingress-proxy/ca-trust.d.ts +96 -0
- package/backend/dist/ingress-proxy/ca-trust.js +315 -0
- package/backend/dist/ingress-proxy/ca.d.ts +104 -0
- package/backend/dist/ingress-proxy/ca.js +273 -0
- package/backend/dist/ingress-proxy/data-dir.d.ts +28 -0
- package/backend/dist/ingress-proxy/data-dir.js +45 -0
- package/backend/dist/ingress-proxy/egress.d.ts +151 -0
- package/backend/dist/ingress-proxy/egress.js +364 -0
- package/backend/dist/ingress-proxy/h2-forward.d.ts +66 -0
- package/backend/dist/ingress-proxy/h2-forward.js +561 -0
- package/backend/dist/ingress-proxy/index.d.ts +24 -0
- package/backend/dist/ingress-proxy/index.js +144 -0
- package/backend/dist/ingress-proxy/interceptor.d.ts +25 -0
- package/backend/dist/ingress-proxy/interceptor.js +52 -0
- package/backend/dist/ingress-proxy/ordered-relay.d.ts +29 -0
- package/backend/dist/ingress-proxy/ordered-relay.js +46 -0
- package/backend/dist/ingress-proxy/relay.d.ts +54 -0
- package/backend/dist/ingress-proxy/relay.js +188 -0
- package/backend/dist/ingress-proxy/rules.d.ts +195 -0
- package/backend/dist/ingress-proxy/rules.js +348 -0
- package/backend/dist/ingress-proxy/server.d.ts +153 -0
- package/backend/dist/ingress-proxy/server.js +2065 -0
- package/backend/dist/ingress-proxy/sni.d.ts +35 -0
- package/backend/dist/ingress-proxy/sni.js +124 -0
- package/backend/dist/ingress-proxy/status.d.ts +32 -0
- package/backend/dist/ingress-proxy/status.js +15 -0
- package/backend/dist/ingress-proxy/system-proxy.d.ts +112 -0
- package/backend/dist/ingress-proxy/system-proxy.js +481 -0
- package/backend/dist/ingress-proxy/traffic-delete.d.ts +21 -0
- package/backend/dist/ingress-proxy/traffic-delete.js +64 -0
- package/backend/dist/ingress-proxy/traffic-delete.worker.d.ts +44 -0
- package/backend/dist/ingress-proxy/traffic-delete.worker.js +228 -0
- package/backend/dist/ingress-proxy/traffic-files.d.ts +10 -0
- package/backend/dist/ingress-proxy/traffic-files.js +10 -0
- package/backend/dist/ingress-proxy/upstream-tls.d.ts +46 -0
- package/backend/dist/ingress-proxy/upstream-tls.js +105 -0
- package/backend/dist/ingress-proxy/ws-frames.d.ts +45 -0
- package/backend/dist/ingress-proxy/ws-frames.js +153 -0
- package/backend/dist/ir/adapters/anthropic-messages-stream.js +6 -1
- package/backend/dist/ir/adapters/anthropic-messages.js +12 -5
- package/backend/dist/ir/adapters/google-gemini-stream.js +7 -2
- package/backend/dist/ir/adapters/google-gemini.js +5 -2
- package/backend/dist/ir/adapters/openai-chat-stream.js +5 -1
- package/backend/dist/ir/adapters/openai-chat.d.ts +25 -0
- package/backend/dist/ir/adapters/openai-chat.js +50 -6
- package/backend/dist/ir/adapters/openai-responses-output.d.ts +1 -0
- package/backend/dist/ir/adapters/openai-responses-output.js +67 -21
- package/backend/dist/ir/adapters/openai-responses-stream.d.ts +13 -0
- package/backend/dist/ir/adapters/openai-responses-stream.js +34 -1
- package/backend/dist/ir/adapters/openai-responses.d.ts +92 -1
- package/backend/dist/ir/adapters/openai-responses.js +163 -12
- package/backend/dist/ir/capabilities.js +4 -0
- package/backend/dist/ir/media.d.ts +20 -0
- package/backend/dist/ir/media.js +41 -0
- package/backend/dist/ir/tool-identity.d.ts +35 -0
- package/backend/dist/ir/tool-identity.js +40 -0
- package/backend/dist/ir/types.d.ts +9 -1
- package/backend/dist/ir/validate.d.ts +24 -0
- package/backend/dist/ir/validate.js +113 -63
- package/backend/dist/local/build-jobs.d.ts +66 -0
- package/backend/dist/local/build-jobs.js +243 -0
- package/backend/dist/local/detect.d.ts +32 -0
- package/backend/dist/local/detect.js +145 -0
- package/backend/dist/local/draft-match.d.ts +58 -0
- package/backend/dist/local/draft-match.js +124 -0
- package/backend/dist/local/engine-runtime.d.ts +522 -0
- package/backend/dist/local/engine-runtime.js +1 -0
- package/backend/dist/local/engines.d.ts +241 -0
- package/backend/dist/local/engines.js +651 -0
- package/backend/dist/local/gguf.d.ts +35 -0
- package/backend/dist/local/gguf.js +314 -0
- package/backend/dist/local/hf.d.ts +120 -0
- package/backend/dist/local/hf.js +304 -0
- package/backend/dist/local/install.d.ts +90 -0
- package/backend/dist/local/install.js +421 -0
- package/backend/dist/local/llamacpp.d.ts +55 -0
- package/backend/dist/local/llamacpp.js +177 -0
- package/backend/dist/local/local-provider.d.ts +81 -0
- package/backend/dist/local/local-provider.js +301 -0
- package/backend/dist/local/machine-stats.d.ts +87 -0
- package/backend/dist/local/machine-stats.js +332 -0
- package/backend/dist/local/model-store.d.ts +347 -0
- package/backend/dist/local/model-store.js +1215 -0
- package/backend/dist/local/part-sweep.d.ts +32 -0
- package/backend/dist/local/part-sweep.js +156 -0
- package/backend/dist/local/plan.d.ts +65 -0
- package/backend/dist/local/plan.js +146 -0
- package/backend/dist/local/resources.d.ts +49 -0
- package/backend/dist/local/resources.js +64 -0
- package/backend/dist/local/run-stats.d.ts +95 -0
- package/backend/dist/local/run-stats.js +195 -0
- package/backend/dist/local/runner.d.ts +235 -0
- package/backend/dist/local/runner.js +1392 -0
- package/backend/dist/local/settings.d.ts +79 -0
- package/backend/dist/local/settings.js +180 -0
- package/backend/dist/local/strata-catalog.d.ts +30 -0
- package/backend/dist/local/strata-catalog.js +511 -0
- package/backend/dist/local/strata-drafting.d.ts +46 -0
- package/backend/dist/local/strata-drafting.js +265 -0
- package/backend/dist/local/strata.d.ts +278 -0
- package/backend/dist/local/strata.js +1392 -0
- package/backend/dist/local/tar.d.ts +20 -0
- package/backend/dist/local/tar.js +367 -0
- package/backend/dist/local/transport.d.ts +35 -0
- package/backend/dist/local/transport.js +89 -0
- package/backend/dist/local/tune.d.ts +58 -0
- package/backend/dist/local/tune.js +324 -0
- package/backend/dist/observability/http-exchange.d.ts +2 -2
- package/backend/dist/opencode/catalog/auto-pull.d.ts +14 -3
- package/backend/dist/opencode/catalog/auto-pull.js +284 -77
- package/backend/dist/opencode/catalog/ocr-store.d.ts +7 -6
- package/backend/dist/opencode/catalog/ocr-store.js +4 -2
- package/backend/dist/opencode/catalog/overrides-store.d.ts +15 -4
- package/backend/dist/opencode/catalog/overrides-store.js +28 -19
- package/backend/dist/opencode/catalog/reasoning-declaration.d.ts +35 -0
- package/backend/dist/opencode/catalog/reasoning-declaration.js +66 -0
- package/backend/dist/opencode/catalog/repository.js +28 -5
- package/backend/dist/opencode/catalog/sources/models-dev.d.ts +3 -3
- package/backend/dist/opencode/catalog/sources/models-dev.js +42 -14
- package/backend/dist/opencode/catalog/types.d.ts +42 -12
- package/backend/dist/opencode/catalog/types.js +38 -1
- package/backend/dist/opencode/credentials/def-materialize.js +27 -21
- package/backend/dist/opencode/credentials/ocr-store.js +11 -2
- package/backend/dist/opencode/credentials/sync.js +12 -3
- package/backend/dist/opencode/credentials/types.d.ts +31 -4
- package/backend/dist/opencode/credentials/types.js +25 -0
- package/backend/dist/opencode/migrate/engine.d.ts +20 -0
- package/backend/dist/opencode/migrate/engine.js +71 -0
- package/backend/dist/opencode/migrate/migrator.d.ts +11 -0
- package/backend/dist/opencode/migrate/migrator.js +6 -0
- package/backend/dist/opencode/migrate/steps/overrides-v1-to-v2.d.ts +6 -0
- package/backend/dist/opencode/migrate/steps/overrides-v1-to-v2.js +31 -0
- package/backend/dist/opencode/migrate/steps/providers-v1-to-v2.d.ts +6 -0
- package/backend/dist/opencode/migrate/steps/providers-v1-to-v2.js +62 -0
- package/backend/dist/opencode/probe.d.ts +21 -4
- package/backend/dist/opencode/probe.js +34 -10
- package/backend/dist/opencode/provider-def-adapters.d.ts +12 -11
- package/backend/dist/opencode/provider-def-adapters.js +43 -27
- package/backend/dist/opencode/provider-defs.d.ts +10 -16
- package/backend/dist/opencode/provider-defs.js +45 -45
- package/backend/dist/opencode/user-config.d.ts +23 -26
- package/backend/dist/opencode/user-config.js +95 -77
- package/backend/dist/pipeline/directives.d.ts +9 -4
- package/backend/dist/pipeline/directives.js +14 -10
- package/backend/dist/pipeline/orchestrator.d.ts +42 -13
- package/backend/dist/pipeline/orchestrator.js +514 -172
- package/backend/dist/plugins/builtin/model-gateway.js +38 -12
- package/backend/dist/plugins/environment-ack.d.ts +51 -0
- package/backend/dist/plugins/environment-ack.js +81 -0
- package/backend/dist/plugins/gateways.d.ts +6 -6
- package/backend/dist/plugins/gateways.js +2 -2
- package/backend/dist/plugins/host.d.ts +100 -16
- package/backend/dist/plugins/host.js +637 -99
- package/backend/dist/plugins/install-run.d.ts +27 -0
- package/backend/dist/plugins/install-run.js +99 -0
- package/backend/dist/plugins/manifest.d.ts +84 -32
- package/backend/dist/plugins/manifest.js +149 -45
- package/backend/dist/plugins/market-install.d.ts +18 -0
- package/backend/dist/plugins/market-install.js +111 -0
- package/backend/dist/plugins/market-source.d.ts +100 -0
- package/backend/dist/plugins/market-source.js +449 -0
- package/backend/dist/plugins/market-updates.d.ts +70 -0
- package/backend/dist/plugins/market-updates.js +97 -0
- package/backend/dist/plugins/market.d.ts +677 -0
- package/backend/dist/plugins/market.js +2113 -0
- package/backend/dist/plugins/source-index.d.ts +155 -0
- package/backend/dist/plugins/source-index.js +217 -0
- package/backend/dist/plugins/types.d.ts +402 -37
- package/backend/dist/projects/worktrees.d.ts +88 -0
- package/backend/dist/projects/worktrees.js +220 -0
- package/backend/dist/providers/boot-direct.d.ts +41 -7
- package/backend/dist/providers/boot-direct.js +284 -44
- package/backend/dist/providers/compat/tool-markup-recovery.js +31 -6
- package/backend/dist/providers/dial-wire.d.ts +17 -0
- package/backend/dist/providers/dial-wire.js +49 -0
- package/backend/dist/providers/executors/dispatch.d.ts +17 -7
- package/backend/dist/providers/executors/dispatch.js +28 -9
- package/backend/dist/providers/executors/openai-chat.js +14 -2
- package/backend/dist/providers/executors/plugin-adapter.d.ts +23 -1
- package/backend/dist/providers/executors/plugin-adapter.js +59 -3
- package/backend/dist/providers/member-match.d.ts +32 -9
- package/backend/dist/providers/member-match.js +65 -21
- package/backend/dist/providers/model-resolution.d.ts +62 -0
- package/backend/dist/providers/model-resolution.js +62 -0
- package/backend/dist/providers/price-order.d.ts +51 -0
- package/backend/dist/providers/price-order.js +54 -0
- package/backend/dist/providers/protocols-field.d.ts +24 -0
- package/backend/dist/providers/protocols-field.js +66 -0
- package/backend/dist/providers/provider-takedown.d.ts +5 -2
- package/backend/dist/providers/registry.d.ts +87 -26
- package/backend/dist/providers/registry.js +232 -121
- package/backend/dist/providers/selection.d.ts +91 -0
- package/backend/dist/providers/selection.js +158 -0
- package/backend/dist/providers/virtual-meta.d.ts +33 -2
- package/backend/dist/providers/virtual-meta.js +74 -18
- package/backend/dist/quota/cli-login.d.ts +25 -4
- package/backend/dist/quota/cli-login.js +38 -6
- package/backend/dist/quota/coverage-generation.d.ts +24 -0
- package/backend/dist/quota/coverage-generation.js +29 -0
- package/backend/dist/quota/declarations.js +8 -4
- package/backend/dist/quota/engine.js +2 -2
- package/backend/dist/quota/prober.d.ts +43 -2
- package/backend/dist/quota/prober.js +97 -22
- package/backend/dist/ratelimit/rate-limiter.d.ts +1 -1
- package/backend/dist/resilience/error-classifier.js +29 -0
- package/backend/dist/router/index.d.ts +1 -1
- package/backend/dist/router/index.js +17 -1
- package/backend/dist/router/layer2-decision.d.ts +1 -1
- package/backend/dist/router/layer2-decision.js +2 -2
- package/backend/dist/routes/console.js +1043 -405
- package/backend/dist/routes/environments.js +1 -1
- package/backend/dist/routes/local-models.d.ts +2 -0
- package/backend/dist/routes/local-models.js +1414 -0
- package/backend/dist/routes/mihomo.d.ts +2 -2
- package/backend/dist/routes/mihomo.js +20 -11
- package/backend/dist/routes/projects.js +121 -0
- package/backend/dist/server.js +409 -15
- package/backend/dist/session/session-manager.d.ts +42 -5
- package/backend/dist/session/session-manager.js +64 -11
- package/backend/dist/session/session-row.d.ts +29 -8
- package/backend/dist/session/session-row.js +18 -13
- package/backend/dist/snapshot/bundle.d.ts +40 -0
- package/backend/dist/snapshot/bundle.js +177 -0
- package/backend/dist/snapshot/handoff/compress.d.ts +46 -0
- package/backend/dist/snapshot/handoff/compress.js +77 -0
- package/backend/dist/snapshot/handoff/index.d.ts +119 -0
- package/backend/dist/snapshot/handoff/index.js +160 -0
- package/backend/dist/snapshot/handoff/jsonl-writer.d.ts +78 -0
- package/backend/dist/snapshot/handoff/jsonl-writer.js +175 -0
- package/backend/dist/snapshot/handoff/opencode-writer.d.ts +51 -0
- package/backend/dist/snapshot/handoff/opencode-writer.js +214 -0
- package/backend/dist/snapshot/handoff/summarize.d.ts +39 -0
- package/backend/dist/snapshot/handoff/summarize.js +118 -0
- package/backend/dist/snapshot/handoff/transcript.d.ts +71 -0
- package/backend/dist/snapshot/handoff/transcript.js +167 -0
- package/backend/dist/snapshot/media-fs.d.ts +10 -0
- package/backend/dist/snapshot/media-fs.js +50 -0
- package/backend/dist/snapshot/media.d.ts +32 -0
- package/backend/dist/snapshot/media.js +87 -0
- package/backend/dist/snapshot/store.d.ts +226 -0
- package/backend/dist/snapshot/store.js +887 -0
- package/backend/dist/snapshot/tree.d.ts +112 -0
- package/backend/dist/snapshot/tree.js +207 -0
- package/backend/dist/snapshot/types.d.ts +212 -0
- package/backend/dist/snapshot/types.js +14 -0
- package/backend/dist/snapshot/view.d.ts +19 -0
- package/backend/dist/snapshot/view.js +57 -0
- package/backend/dist/snapshot/write-worker.d.ts +67 -0
- package/backend/dist/snapshot/write-worker.js +129 -0
- package/backend/dist/surfaces/anthropic.js +4 -1
- package/backend/dist/surfaces/body-admission.d.ts +344 -0
- package/backend/dist/surfaces/body-admission.js +818 -0
- package/backend/dist/surfaces/chat-pipeline.js +8 -0
- package/backend/dist/surfaces/decision-pipeline.js +10 -7
- package/backend/dist/surfaces/gateway-catalog.d.ts +26 -0
- package/backend/dist/surfaces/gateway-catalog.js +202 -0
- package/backend/dist/surfaces/gateway-chat.d.ts +7 -11
- package/backend/dist/surfaces/gateway-chat.js +50 -12
- package/backend/dist/surfaces/ocr-headers.d.ts +6 -4
- package/backend/dist/surfaces/ocr-headers.js +11 -7
- package/backend/dist/surfaces/systemone.js +1 -1
- package/backend/dist/surfaces/transport-fastify.js +32 -5
- package/backend/dist/surfaces/transport-node-http.d.ts +51 -6
- package/backend/dist/surfaces/transport-node-http.js +76 -16
- package/backend/dist/surfaces/types.d.ts +11 -3
- package/backend/dist/trace/persist.js +21 -1
- package/backend/dist/trace/tracker.d.ts +35 -3
- package/backend/dist/trace/tracker.js +23 -0
- package/backend/dist/types/openai.d.ts +8 -0
- package/backend/dist/types/router.d.ts +17 -6
- package/backend/dist/types/router.js +14 -2
- package/backend/dist/utils/client-families.d.ts +66 -0
- package/backend/dist/utils/client-families.js +127 -0
- package/backend/dist/utils/event-ring.d.ts +1 -1
- package/backend/dist/utils/event-ring.js +1 -1
- package/backend/dist/utils/proxy-node.js +1 -1
- package/backend/dist/utils/proxy.d.ts +135 -11
- package/backend/dist/utils/proxy.js +144 -29
- package/backend/dist/utils/run-command.d.ts +21 -1
- package/backend/dist/utils/run-command.js +64 -4
- package/backend/dist/utils/server-liveness.d.ts +28 -0
- package/backend/dist/utils/server-liveness.js +32 -0
- package/backend/dist/utils/session-file.d.ts +28 -0
- package/backend/dist/utils/session-file.js +34 -0
- package/frontend/dist/assets/antigravity.color-DXFfVr6X.svg +39 -0
- package/frontend/dist/assets/gemini-cli.color-BfquLd1p.svg +1 -0
- package/frontend/dist/assets/index-CTZNvn1d.js +1707 -0
- package/frontend/dist/assets/{index-DxZ9MHKB.css → index-CqDSOPQ0.css} +1 -1
- package/frontend/dist/index.html +2 -2
- package/package.json +3 -1
- package/frontend/dist/assets/index-55VVwfFQ.js +0 -1521
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration v5 → v6 — follow-catalog auto-resync kill switch.
|
|
3
|
+
*
|
|
4
|
+
* schemaVersion 5 had no operator lever for whether Key/pool mutations rewrite
|
|
5
|
+
* follow-mode client catalogs. v6 adds `client.autoResyncFollowCatalogs` (default
|
|
6
|
+
* ON): an event-driven N-setup service keyed by clientProfileMemory.modelMode
|
|
7
|
+
* and gateway modelListMode=follow — not a profile write-through (ADR-0031).
|
|
8
|
+
*
|
|
9
|
+
* The step MOVES NOTHING and RENAMES NOTHING: `migrate` is the identity. The
|
|
10
|
+
* layout row is what makes the knob persist; bumping SCHEMA_VERSION declares
|
|
11
|
+
* the layout the file was written under.
|
|
12
|
+
*
|
|
13
|
+
* FROZEN after release: later schema versions MUST NOT edit this file — the
|
|
14
|
+
* chain only appends. schema.ts binds SECTION_MOVES_V6 as the CURRENT layout.
|
|
15
|
+
*/
|
|
16
|
+
import { type DiskConfigV5 } from './v4-to-v5.js';
|
|
17
|
+
import type { SectionMove } from '../layout.js';
|
|
18
|
+
import type { Migration } from '../schema.js';
|
|
19
|
+
/** THE v6 layout: the v5 moves plus the follow-catalog auto-resync switch. */
|
|
20
|
+
export declare const SECTION_MOVES_V6: ReadonlyArray<SectionMove>;
|
|
21
|
+
/** Disk format of schemaVersion 6: v5 with the auto-resync switch available. */
|
|
22
|
+
export type DiskConfigV6 = DiskConfigV5 & {
|
|
23
|
+
client?: DiskConfigV5['client'] & {
|
|
24
|
+
autoResyncFollowCatalogs?: boolean;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare const migrationV5ToV6: Migration;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration v5 → v6 — follow-catalog auto-resync kill switch.
|
|
3
|
+
*
|
|
4
|
+
* schemaVersion 5 had no operator lever for whether Key/pool mutations rewrite
|
|
5
|
+
* follow-mode client catalogs. v6 adds `client.autoResyncFollowCatalogs` (default
|
|
6
|
+
* ON): an event-driven N-setup service keyed by clientProfileMemory.modelMode
|
|
7
|
+
* and gateway modelListMode=follow — not a profile write-through (ADR-0031).
|
|
8
|
+
*
|
|
9
|
+
* The step MOVES NOTHING and RENAMES NOTHING: `migrate` is the identity. The
|
|
10
|
+
* layout row is what makes the knob persist; bumping SCHEMA_VERSION declares
|
|
11
|
+
* the layout the file was written under.
|
|
12
|
+
*
|
|
13
|
+
* FROZEN after release: later schema versions MUST NOT edit this file — the
|
|
14
|
+
* chain only appends. schema.ts binds SECTION_MOVES_V6 as the CURRENT layout.
|
|
15
|
+
*/
|
|
16
|
+
import { SECTION_MOVES_V5 } from './v4-to-v5.js';
|
|
17
|
+
/** THE v6 layout: the v5 moves plus the follow-catalog auto-resync switch. */
|
|
18
|
+
export const SECTION_MOVES_V6 = [
|
|
19
|
+
...SECTION_MOVES_V5,
|
|
20
|
+
['client.autoResyncFollowCatalogs', 'autoResyncFollowCatalogs'],
|
|
21
|
+
];
|
|
22
|
+
export const migrationV5ToV6 = {
|
|
23
|
+
from: 5,
|
|
24
|
+
to: 6,
|
|
25
|
+
warn: [
|
|
26
|
+
'schemaVersion 6 adds client.autoResyncFollowCatalogs (default true): event-driven rewrite of follow-mode client/gateway catalogs after Key modelAccess or model-pool changes',
|
|
27
|
+
],
|
|
28
|
+
migrate: (raw) => ({ ...raw }),
|
|
29
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration v6 → v7 — the retired selection vocabulary becomes the
|
|
3
|
+
* industry-standard trio.
|
|
4
|
+
*
|
|
5
|
+
* v6 could store three strategies: `priority`, `weighted` (a weighted RANDOM
|
|
6
|
+
* draw) and `round_robin` (a rotating table of `weight` CONSECUTIVE slots per
|
|
7
|
+
* member — bursty weighted rotation, not equal turns). v7 replaces that
|
|
8
|
+
* vocabulary (ADR-0003): `weighted_round_robin` is smooth weighted round-robin
|
|
9
|
+
* and `round_robin` is PLAIN equal rotation with weights ignored.
|
|
10
|
+
*
|
|
11
|
+
* Both v6 weighting mechanisms therefore become `weighted_round_robin`, which
|
|
12
|
+
* preserves the operator's declared weight proportions while smoothing the
|
|
13
|
+
* order:
|
|
14
|
+
* - `weighted` → `weighted_round_robin` (random draw → deterministic
|
|
15
|
+
* weighted rotation, the requested replacement);
|
|
16
|
+
* - `round_robin` → `weighted_round_robin` (the old value WAS weighted, so
|
|
17
|
+
* letting it keep its name would silently turn a 3:1 pool
|
|
18
|
+
* into 1:1; with every weight at 1 the smooth core
|
|
19
|
+
* degenerates to exactly the old equal rotation).
|
|
20
|
+
* `priority` is untouched. A v6 file cannot carry the v7 meaning of
|
|
21
|
+
* `round_robin`, so this step consumes every occurrence of it; the new
|
|
22
|
+
* equal-turn strategy is an explicit post-upgrade choice.
|
|
23
|
+
*
|
|
24
|
+
* The step rewrites ONLY an existing `selection` value under
|
|
25
|
+
* `routing.tiers.<tier>` and `routing.combos[]`. It never creates a section the
|
|
26
|
+
* file did not carry, and it leaves unknown spellings alone — value cleaning
|
|
27
|
+
* stays in loadConfig; migrations move shapes/vocabulary, never enforce
|
|
28
|
+
* semantics (the same contract as v3→v4's `modelMode: none → default`).
|
|
29
|
+
*
|
|
30
|
+
* The layout is unchanged (no section moved), so `SECTION_MOVES_V7` is the v6
|
|
31
|
+
* table verbatim — derived, never re-declared, so the frozen tables stay the
|
|
32
|
+
* single source.
|
|
33
|
+
*
|
|
34
|
+
* FROZEN after release: later schema versions MUST NOT edit this file — the
|
|
35
|
+
* chain v0→…→v6→v7→… only appends. schema.ts binds `SECTION_MOVES_V7` as the
|
|
36
|
+
* CURRENT layout (see LATEST_LAYOUT there) — bump that pointer when v8 ships.
|
|
37
|
+
*/
|
|
38
|
+
import { type DiskConfigV6 } from './v5-to-v6.js';
|
|
39
|
+
import type { SectionMove } from '../layout.js';
|
|
40
|
+
import type { Migration } from '../schema.js';
|
|
41
|
+
/** THE v7 layout: identical to v6 (the section paths did not move). */
|
|
42
|
+
export declare const SECTION_MOVES_V7: ReadonlyArray<SectionMove>;
|
|
43
|
+
/** Disk format of schemaVersion 7: v6 with the weighted selection values folded into `weighted_round_robin`. */
|
|
44
|
+
export type DiskConfigV7 = DiskConfigV6;
|
|
45
|
+
export declare const migrationV6ToV7: Migration;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration v6 → v7 — the retired selection vocabulary becomes the
|
|
3
|
+
* industry-standard trio.
|
|
4
|
+
*
|
|
5
|
+
* v6 could store three strategies: `priority`, `weighted` (a weighted RANDOM
|
|
6
|
+
* draw) and `round_robin` (a rotating table of `weight` CONSECUTIVE slots per
|
|
7
|
+
* member — bursty weighted rotation, not equal turns). v7 replaces that
|
|
8
|
+
* vocabulary (ADR-0003): `weighted_round_robin` is smooth weighted round-robin
|
|
9
|
+
* and `round_robin` is PLAIN equal rotation with weights ignored.
|
|
10
|
+
*
|
|
11
|
+
* Both v6 weighting mechanisms therefore become `weighted_round_robin`, which
|
|
12
|
+
* preserves the operator's declared weight proportions while smoothing the
|
|
13
|
+
* order:
|
|
14
|
+
* - `weighted` → `weighted_round_robin` (random draw → deterministic
|
|
15
|
+
* weighted rotation, the requested replacement);
|
|
16
|
+
* - `round_robin` → `weighted_round_robin` (the old value WAS weighted, so
|
|
17
|
+
* letting it keep its name would silently turn a 3:1 pool
|
|
18
|
+
* into 1:1; with every weight at 1 the smooth core
|
|
19
|
+
* degenerates to exactly the old equal rotation).
|
|
20
|
+
* `priority` is untouched. A v6 file cannot carry the v7 meaning of
|
|
21
|
+
* `round_robin`, so this step consumes every occurrence of it; the new
|
|
22
|
+
* equal-turn strategy is an explicit post-upgrade choice.
|
|
23
|
+
*
|
|
24
|
+
* The step rewrites ONLY an existing `selection` value under
|
|
25
|
+
* `routing.tiers.<tier>` and `routing.combos[]`. It never creates a section the
|
|
26
|
+
* file did not carry, and it leaves unknown spellings alone — value cleaning
|
|
27
|
+
* stays in loadConfig; migrations move shapes/vocabulary, never enforce
|
|
28
|
+
* semantics (the same contract as v3→v4's `modelMode: none → default`).
|
|
29
|
+
*
|
|
30
|
+
* The layout is unchanged (no section moved), so `SECTION_MOVES_V7` is the v6
|
|
31
|
+
* table verbatim — derived, never re-declared, so the frozen tables stay the
|
|
32
|
+
* single source.
|
|
33
|
+
*
|
|
34
|
+
* FROZEN after release: later schema versions MUST NOT edit this file — the
|
|
35
|
+
* chain v0→…→v6→v7→… only appends. schema.ts binds `SECTION_MOVES_V7` as the
|
|
36
|
+
* CURRENT layout (see LATEST_LAYOUT there) — bump that pointer when v8 ships.
|
|
37
|
+
*/
|
|
38
|
+
import { SECTION_MOVES_V6 } from './v5-to-v6.js';
|
|
39
|
+
/** THE v7 layout: identical to v6 (the section paths did not move). */
|
|
40
|
+
export const SECTION_MOVES_V7 = SECTION_MOVES_V6;
|
|
41
|
+
/** Plain-object guard for the hand-edited YAML this step must tolerate. */
|
|
42
|
+
function isPlainObject(value) {
|
|
43
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
44
|
+
}
|
|
45
|
+
const LEGACY_WEIGHTED = 'weighted';
|
|
46
|
+
const LEGACY_ROUND_ROBIN = 'round_robin';
|
|
47
|
+
const WEIGHTED_ROUND_ROBIN = 'weighted_round_robin';
|
|
48
|
+
/** The v6 selection values that meant "serve by weight" — both become the smooth rotation. */
|
|
49
|
+
function mapsToWeightedRotation(value) {
|
|
50
|
+
return value === LEGACY_WEIGHTED || value === LEGACY_ROUND_ROBIN;
|
|
51
|
+
}
|
|
52
|
+
export const migrationV6ToV7 = {
|
|
53
|
+
from: 6,
|
|
54
|
+
to: 7,
|
|
55
|
+
warn: [
|
|
56
|
+
'selection strategies `weighted` (weighted random) and `round_robin` (bursty weighted slots) both became `weighted_round_robin` (smooth weighted round-robin); `priority` is unchanged, and the new equal-turn `round_robin` is an explicit choice after upgrade',
|
|
57
|
+
],
|
|
58
|
+
migrate: (raw) => {
|
|
59
|
+
const disk = { ...raw };
|
|
60
|
+
const routing = disk.routing;
|
|
61
|
+
if (!isPlainObject(routing))
|
|
62
|
+
return disk;
|
|
63
|
+
let changed = false;
|
|
64
|
+
// Tier policies: routing.tiers.<lite|plus|pro|ultra>.selection — `exclude`
|
|
65
|
+
// is an array and is skipped by the plain-object guard.
|
|
66
|
+
let nextTiers;
|
|
67
|
+
const tiers = routing.tiers;
|
|
68
|
+
if (isPlainObject(tiers)) {
|
|
69
|
+
nextTiers = { ...tiers };
|
|
70
|
+
for (const [tier, entry] of Object.entries(tiers)) {
|
|
71
|
+
if (!isPlainObject(entry) || !mapsToWeightedRotation(entry.selection))
|
|
72
|
+
continue;
|
|
73
|
+
nextTiers[tier] = { ...entry, selection: WEIGHTED_ROUND_ROBIN };
|
|
74
|
+
changed = true;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Combos: routing.combos[].selection (array order preserved).
|
|
78
|
+
let nextCombos;
|
|
79
|
+
const combos = routing.combos;
|
|
80
|
+
if (Array.isArray(combos)) {
|
|
81
|
+
nextCombos = combos.map((entry) => {
|
|
82
|
+
if (!isPlainObject(entry) || !mapsToWeightedRotation(entry.selection))
|
|
83
|
+
return entry;
|
|
84
|
+
changed = true;
|
|
85
|
+
return { ...entry, selection: WEIGHTED_ROUND_ROBIN };
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
if (!changed)
|
|
89
|
+
return disk;
|
|
90
|
+
disk.routing = {
|
|
91
|
+
...routing,
|
|
92
|
+
...(nextTiers ? { tiers: nextTiers } : {}),
|
|
93
|
+
...(nextCombos ? { combos: nextCombos } : {}),
|
|
94
|
+
};
|
|
95
|
+
return disk;
|
|
96
|
+
},
|
|
97
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration v7 → v8 — a combo MEMBER can carry its own thinking-level
|
|
3
|
+
* translation (ADR-0003).
|
|
4
|
+
*
|
|
5
|
+
* schemaVersion 7 let a TIER MEMBER RULE declare `effortMap` (client-requested
|
|
6
|
+
* → upstream value), but a combo member ref — the other composition surface —
|
|
7
|
+
* had no such table, so a directly-addressed combo could only inherit each
|
|
8
|
+
* member's home tier translation. v8 adds `routing.combos[].models[].effortMap`
|
|
9
|
+
* (`ComboModelRef.effortMap`), ONE table per model, because a composition may
|
|
10
|
+
* mix models with different ladders — a single block-wide table would flatten
|
|
11
|
+
* them. Resolution by serving context: a `combo:<id>` ref rule inside a tier
|
|
12
|
+
* lets the REF RULE win block-wide and the member table fill in; a
|
|
13
|
+
* directly-addressed combo uses the member table and falls back to that
|
|
14
|
+
* member's home tier. Never a key-wise merge, and it never influences which
|
|
15
|
+
* member serves.
|
|
16
|
+
*
|
|
17
|
+
* The step MOVES NOTHING and RENAMES NOTHING: `migrate` is the identity.
|
|
18
|
+
* `routing.combos` is already a v1 layout row and the new key is nested inside
|
|
19
|
+
* that section, so it round-trips untouched; bumping `SCHEMA_VERSION` is what
|
|
20
|
+
* makes a saved file declare the layout it was written under (the same reason
|
|
21
|
+
* v5 added `client.bodyLimits` and v6 added `client.autoResyncFollowCatalogs`
|
|
22
|
+
* without moving a section). No v7 key disappears, so a v7 file keeps every
|
|
23
|
+
* value it had.
|
|
24
|
+
*
|
|
25
|
+
* FROZEN after release: later schema versions MUST NOT edit this file — the
|
|
26
|
+
* chain v0→…→v7→v8→… only appends. schema.ts binds `SECTION_MOVES_V8` as the
|
|
27
|
+
* CURRENT layout (see LATEST_LAYOUT there) — bump that pointer when v9 ships.
|
|
28
|
+
*/
|
|
29
|
+
import { type DiskConfigV7 } from './v6-to-v7.js';
|
|
30
|
+
import type { SectionMove } from '../layout.js';
|
|
31
|
+
import type { Migration } from '../schema.js';
|
|
32
|
+
/** THE v8 layout: identical to v7 (the section paths did not move). */
|
|
33
|
+
export declare const SECTION_MOVES_V8: ReadonlyArray<SectionMove>;
|
|
34
|
+
/** Disk format of schemaVersion 8: v7 plus an optional per-member `effortMap` (shape-only; no rewrite). */
|
|
35
|
+
export type DiskConfigV8 = DiskConfigV7;
|
|
36
|
+
export declare const migrationV7ToV8: Migration;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration v7 → v8 — a combo MEMBER can carry its own thinking-level
|
|
3
|
+
* translation (ADR-0003).
|
|
4
|
+
*
|
|
5
|
+
* schemaVersion 7 let a TIER MEMBER RULE declare `effortMap` (client-requested
|
|
6
|
+
* → upstream value), but a combo member ref — the other composition surface —
|
|
7
|
+
* had no such table, so a directly-addressed combo could only inherit each
|
|
8
|
+
* member's home tier translation. v8 adds `routing.combos[].models[].effortMap`
|
|
9
|
+
* (`ComboModelRef.effortMap`), ONE table per model, because a composition may
|
|
10
|
+
* mix models with different ladders — a single block-wide table would flatten
|
|
11
|
+
* them. Resolution by serving context: a `combo:<id>` ref rule inside a tier
|
|
12
|
+
* lets the REF RULE win block-wide and the member table fill in; a
|
|
13
|
+
* directly-addressed combo uses the member table and falls back to that
|
|
14
|
+
* member's home tier. Never a key-wise merge, and it never influences which
|
|
15
|
+
* member serves.
|
|
16
|
+
*
|
|
17
|
+
* The step MOVES NOTHING and RENAMES NOTHING: `migrate` is the identity.
|
|
18
|
+
* `routing.combos` is already a v1 layout row and the new key is nested inside
|
|
19
|
+
* that section, so it round-trips untouched; bumping `SCHEMA_VERSION` is what
|
|
20
|
+
* makes a saved file declare the layout it was written under (the same reason
|
|
21
|
+
* v5 added `client.bodyLimits` and v6 added `client.autoResyncFollowCatalogs`
|
|
22
|
+
* without moving a section). No v7 key disappears, so a v7 file keeps every
|
|
23
|
+
* value it had.
|
|
24
|
+
*
|
|
25
|
+
* FROZEN after release: later schema versions MUST NOT edit this file — the
|
|
26
|
+
* chain v0→…→v7→v8→… only appends. schema.ts binds `SECTION_MOVES_V8` as the
|
|
27
|
+
* CURRENT layout (see LATEST_LAYOUT there) — bump that pointer when v9 ships.
|
|
28
|
+
*/
|
|
29
|
+
import { SECTION_MOVES_V7 } from './v6-to-v7.js';
|
|
30
|
+
/** THE v8 layout: identical to v7 (the section paths did not move). */
|
|
31
|
+
export const SECTION_MOVES_V8 = SECTION_MOVES_V7;
|
|
32
|
+
export const migrationV7ToV8 = {
|
|
33
|
+
from: 7,
|
|
34
|
+
to: 8,
|
|
35
|
+
warn: [
|
|
36
|
+
'schemaVersion 8 adds routing.combos[].models[].effortMap: each combo member may declare its own thinking-level translation; a tier `combo:<id>` ref rule still wins block-wide, and a directly-addressed combo falls back to that member home tier (ADR-0003)',
|
|
37
|
+
],
|
|
38
|
+
// Nothing moved, so nothing to rewrite. The identity is deliberate: reading
|
|
39
|
+
// the tree to "helpfully" materialise an `effortMap` on combo members that never had
|
|
40
|
+
// one would add noise the writer does not need and break the
|
|
41
|
+
// migrate-idempotence contract the migration tests pin.
|
|
42
|
+
migrate: (raw) => ({ ...raw }),
|
|
43
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration v8 → v9 (ADR-0001) — cost mode gets a failure-escalation lever.
|
|
3
|
+
*
|
|
4
|
+
* schemaVersion 8 pinned a `cost` routing mode to lite and let the
|
|
5
|
+
* lite-first cascade / failover tail escalate to `plus` after a failure, but
|
|
6
|
+
* there was no operator control over that policy and no way to hard-pin the
|
|
7
|
+
* tier. v9 adds `routing.costEscalation` (`'to_fallback_tier' | 'never'`):
|
|
8
|
+
* the soft default keeps the bounded escalation (capped at `plus`, never
|
|
9
|
+
* preemptive) and `'never'` makes the lite pin hard. The ceiling itself lives
|
|
10
|
+
* in `types/router.ts` (`COST_MODE_TIER_CEILING`) and is not a config knob.
|
|
11
|
+
*
|
|
12
|
+
* The step MOVES NOTHING and RENAMES NOTHING: `migrate` is the identity, for
|
|
13
|
+
* the same reason v4→v5 (`client.bodyLimits`) and v5→v6
|
|
14
|
+
* (`client.autoResyncFollowCatalogs`) were: the layout tables are frozen per
|
|
15
|
+
* version and `toDiskConfigWith` / `toRuntimeConfigWith` iterate ONLY the rows
|
|
16
|
+
* of the bound table — a new disk path that is not a row is silently dropped
|
|
17
|
+
* in both directions (never persisted, never loaded, and therefore never able
|
|
18
|
+
* to re-persist). Appending the row here is what makes the knob real; bumping
|
|
19
|
+
* `SCHEMA_VERSION` is what makes a saved file declare the layout it was
|
|
20
|
+
* written under. No v8 key disappears, so a v8 file keeps every value it had.
|
|
21
|
+
*
|
|
22
|
+
* FROZEN after release: later schema versions MUST NOT edit this file — the
|
|
23
|
+
* chain v0→…→v8→v9→… only appends. schema.ts binds `SECTION_MOVES_V9` as the
|
|
24
|
+
* CURRENT layout (see LATEST_LAYOUT there) — bump that pointer when v10 ships.
|
|
25
|
+
*/
|
|
26
|
+
import { type DiskConfigV8 } from './v7-to-v8.js';
|
|
27
|
+
import type { CostEscalation } from '../types.js';
|
|
28
|
+
import type { SectionMove } from '../layout.js';
|
|
29
|
+
import type { Migration } from '../schema.js';
|
|
30
|
+
/** THE v9 layout: the v8 moves plus the cost-mode escalation lever. */
|
|
31
|
+
export declare const SECTION_MOVES_V9: ReadonlyArray<SectionMove>;
|
|
32
|
+
/** Disk format of schemaVersion 9: v8 with `routing.costEscalation` available. */
|
|
33
|
+
export type DiskConfigV9 = Omit<DiskConfigV8, 'routing'> & {
|
|
34
|
+
routing?: NonNullable<DiskConfigV8['routing']> & {
|
|
35
|
+
costEscalation?: CostEscalation;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export declare const migrationV8ToV9: Migration;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration v8 → v9 (ADR-0001) — cost mode gets a failure-escalation lever.
|
|
3
|
+
*
|
|
4
|
+
* schemaVersion 8 pinned a `cost` routing mode to lite and let the
|
|
5
|
+
* lite-first cascade / failover tail escalate to `plus` after a failure, but
|
|
6
|
+
* there was no operator control over that policy and no way to hard-pin the
|
|
7
|
+
* tier. v9 adds `routing.costEscalation` (`'to_fallback_tier' | 'never'`):
|
|
8
|
+
* the soft default keeps the bounded escalation (capped at `plus`, never
|
|
9
|
+
* preemptive) and `'never'` makes the lite pin hard. The ceiling itself lives
|
|
10
|
+
* in `types/router.ts` (`COST_MODE_TIER_CEILING`) and is not a config knob.
|
|
11
|
+
*
|
|
12
|
+
* The step MOVES NOTHING and RENAMES NOTHING: `migrate` is the identity, for
|
|
13
|
+
* the same reason v4→v5 (`client.bodyLimits`) and v5→v6
|
|
14
|
+
* (`client.autoResyncFollowCatalogs`) were: the layout tables are frozen per
|
|
15
|
+
* version and `toDiskConfigWith` / `toRuntimeConfigWith` iterate ONLY the rows
|
|
16
|
+
* of the bound table — a new disk path that is not a row is silently dropped
|
|
17
|
+
* in both directions (never persisted, never loaded, and therefore never able
|
|
18
|
+
* to re-persist). Appending the row here is what makes the knob real; bumping
|
|
19
|
+
* `SCHEMA_VERSION` is what makes a saved file declare the layout it was
|
|
20
|
+
* written under. No v8 key disappears, so a v8 file keeps every value it had.
|
|
21
|
+
*
|
|
22
|
+
* FROZEN after release: later schema versions MUST NOT edit this file — the
|
|
23
|
+
* chain v0→…→v8→v9→… only appends. schema.ts binds `SECTION_MOVES_V9` as the
|
|
24
|
+
* CURRENT layout (see LATEST_LAYOUT there) — bump that pointer when v10 ships.
|
|
25
|
+
*/
|
|
26
|
+
import { SECTION_MOVES_V8 } from './v7-to-v8.js';
|
|
27
|
+
/** THE v9 layout: the v8 moves plus the cost-mode escalation lever. */
|
|
28
|
+
export const SECTION_MOVES_V9 = [
|
|
29
|
+
...SECTION_MOVES_V8,
|
|
30
|
+
['routing.costEscalation', 'routing.costEscalation'],
|
|
31
|
+
];
|
|
32
|
+
export const migrationV8ToV9 = {
|
|
33
|
+
from: 8,
|
|
34
|
+
to: 9,
|
|
35
|
+
warn: [
|
|
36
|
+
"schemaVersion 9 adds routing.costEscalation (to_fallback_tier | never, default to_fallback_tier): cost mode's policy after a failing lite answer — bounded escalation to plus, or a hard lite pin (ADR-0001)",
|
|
37
|
+
],
|
|
38
|
+
// Nothing moved, so nothing to rewrite. The identity is deliberate: reading
|
|
39
|
+
// the tree to "helpfully" materialise `routing` on files that never had one
|
|
40
|
+
// would add noise the writer does not need and break the
|
|
41
|
+
// migrate-idempotence contract the migration tests pin.
|
|
42
|
+
migrate: (raw) => ({ ...raw }),
|
|
43
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration v9 → v10 (ADR-0008 §3) — the inbound proxy stops authenticating.
|
|
3
|
+
*
|
|
4
|
+
* v9 still carried `ingressProxy.requireCredential`, the strict-mode switch that
|
|
5
|
+
* demanded an OCR API key as the Basic password on EVERY connection. The
|
|
6
|
+
* inbound proxy is now a loopback-only transport that authenticates nobody, so
|
|
7
|
+
* the key has no meaning left and must not survive into a saved file.
|
|
8
|
+
*
|
|
9
|
+
* This step REMOVES it and says so. Silence would be the worst outcome: an
|
|
10
|
+
* install that had the switch ON believed every connection was credential-gated,
|
|
11
|
+
* and it now lands on a listener whose only boundary is the loopback bind. The
|
|
12
|
+
* warning is the operator's notice that model identity moved to the
|
|
13
|
+
* client-gateway plugin's own bound key (`accountKeyId`).
|
|
14
|
+
*
|
|
15
|
+
* Layout: nothing is added (the key is being retired, not replaced), so the v10
|
|
16
|
+
* layout equals the v9 layout. The transform walks `ingressProxy` and deletes
|
|
17
|
+
* the key, leaving every other value exactly where it was — a file that never
|
|
18
|
+
* had it migrates as the identity (the idempotence contract the migration tests
|
|
19
|
+
* pin).
|
|
20
|
+
*
|
|
21
|
+
* FROZEN after release: later schema versions MUST NOT edit this file — the
|
|
22
|
+
* chain only appends. schema.ts binds `SECTION_MOVES_V10` as the CURRENT layout.
|
|
23
|
+
*/
|
|
24
|
+
import { type DiskConfigV9 } from './v8-to-v9.js';
|
|
25
|
+
import type { SectionMove } from '../layout.js';
|
|
26
|
+
import type { Migration } from '../schema.js';
|
|
27
|
+
import type { IngressProxyConfig } from '../types.js';
|
|
28
|
+
/**
|
|
29
|
+
* THE v10 layout: v9's moves, with the inbound proxy's disk section RENAMED.
|
|
30
|
+
*
|
|
31
|
+
* `client.forwardProxy` becomes `client.ingressProxy` on disk (and the runtime
|
|
32
|
+
* flat key `forwardProxy` becomes `ingressProxy`): the name now says which
|
|
33
|
+
* direction the listener faces, and it pairs with the outbound leg vocabulary
|
|
34
|
+
* (`egressProxyFor` on the host SDK). The RENAME lives here, in the step that
|
|
35
|
+
* ships it, because the chain only appends — v0→v1's table is frozen and still
|
|
36
|
+
* describes a `client.forwardProxy` that `migrate()` below rewrites.
|
|
37
|
+
*/
|
|
38
|
+
export declare const SECTION_MOVES_V10: ReadonlyArray<SectionMove>;
|
|
39
|
+
/**
|
|
40
|
+
* Disk format of schemaVersion 10 = the v9 shape with the section renamed. The
|
|
41
|
+
* retired `requireCredential` key is gone from the shared `IngressProxyConfig`
|
|
42
|
+
* type, so there is nothing to subtract there; the transform below both cleans
|
|
43
|
+
* up a file that still carries it AND moves the section to its new name.
|
|
44
|
+
*/
|
|
45
|
+
export type DiskConfigV10 = Omit<DiskConfigV9, 'client' | 'forwardProxy'> & {
|
|
46
|
+
client?: Omit<NonNullable<DiskConfigV9['client']>, 'forwardProxy'> & {
|
|
47
|
+
ingressProxy?: IngressProxyConfig;
|
|
48
|
+
};
|
|
49
|
+
ingressProxy?: IngressProxyConfig;
|
|
50
|
+
};
|
|
51
|
+
export declare const migrationV9ToV10: Migration;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration v9 → v10 (ADR-0008 §3) — the inbound proxy stops authenticating.
|
|
3
|
+
*
|
|
4
|
+
* v9 still carried `ingressProxy.requireCredential`, the strict-mode switch that
|
|
5
|
+
* demanded an OCR API key as the Basic password on EVERY connection. The
|
|
6
|
+
* inbound proxy is now a loopback-only transport that authenticates nobody, so
|
|
7
|
+
* the key has no meaning left and must not survive into a saved file.
|
|
8
|
+
*
|
|
9
|
+
* This step REMOVES it and says so. Silence would be the worst outcome: an
|
|
10
|
+
* install that had the switch ON believed every connection was credential-gated,
|
|
11
|
+
* and it now lands on a listener whose only boundary is the loopback bind. The
|
|
12
|
+
* warning is the operator's notice that model identity moved to the
|
|
13
|
+
* client-gateway plugin's own bound key (`accountKeyId`).
|
|
14
|
+
*
|
|
15
|
+
* Layout: nothing is added (the key is being retired, not replaced), so the v10
|
|
16
|
+
* layout equals the v9 layout. The transform walks `ingressProxy` and deletes
|
|
17
|
+
* the key, leaving every other value exactly where it was — a file that never
|
|
18
|
+
* had it migrates as the identity (the idempotence contract the migration tests
|
|
19
|
+
* pin).
|
|
20
|
+
*
|
|
21
|
+
* FROZEN after release: later schema versions MUST NOT edit this file — the
|
|
22
|
+
* chain only appends. schema.ts binds `SECTION_MOVES_V10` as the CURRENT layout.
|
|
23
|
+
*/
|
|
24
|
+
import { SECTION_MOVES_V9 } from './v8-to-v9.js';
|
|
25
|
+
/**
|
|
26
|
+
* THE v10 layout: v9's moves, with the inbound proxy's disk section RENAMED.
|
|
27
|
+
*
|
|
28
|
+
* `client.forwardProxy` becomes `client.ingressProxy` on disk (and the runtime
|
|
29
|
+
* flat key `forwardProxy` becomes `ingressProxy`): the name now says which
|
|
30
|
+
* direction the listener faces, and it pairs with the outbound leg vocabulary
|
|
31
|
+
* (`egressProxyFor` on the host SDK). The RENAME lives here, in the step that
|
|
32
|
+
* ships it, because the chain only appends — v0→v1's table is frozen and still
|
|
33
|
+
* describes a `client.forwardProxy` that `migrate()` below rewrites.
|
|
34
|
+
*/
|
|
35
|
+
export const SECTION_MOVES_V10 = SECTION_MOVES_V9.map(([disk, runtime]) => disk === 'client.forwardProxy' ? ['client.ingressProxy', 'ingressProxy'] : [disk, runtime]);
|
|
36
|
+
export const migrationV9ToV10 = {
|
|
37
|
+
from: 9,
|
|
38
|
+
to: 10,
|
|
39
|
+
warn: [
|
|
40
|
+
'schemaVersion 10 retires forwardProxy.requireCredential: the inbound proxy authenticates NOBODY and binds loopback only (ADR-0008 §3). ' +
|
|
41
|
+
'Identity for proxy-borne completions now comes solely from the client-gateway plugin\'s bound key (accountKeyId)',
|
|
42
|
+
'schemaVersion 10 renames the inbound proxy section to `ingressProxy` (was `forwardProxy`): same settings, same values, a name that says which direction the listener faces',
|
|
43
|
+
],
|
|
44
|
+
migrate: (raw) => {
|
|
45
|
+
const disk = { ...raw };
|
|
46
|
+
// The retired switch may sit in either spelling: the flat pre-v1 shape or
|
|
47
|
+
// the grouped one. Clean both, then move the section to its new name.
|
|
48
|
+
const strip = (section) => {
|
|
49
|
+
if (!section || typeof section !== 'object' || Array.isArray(section))
|
|
50
|
+
return undefined;
|
|
51
|
+
const { requireCredential: _retired, ...rest } = section;
|
|
52
|
+
return rest;
|
|
53
|
+
};
|
|
54
|
+
const flat = strip(disk.forwardProxy);
|
|
55
|
+
if (flat) {
|
|
56
|
+
delete disk.forwardProxy;
|
|
57
|
+
disk.ingressProxy = flat;
|
|
58
|
+
}
|
|
59
|
+
const client = disk.client;
|
|
60
|
+
if (client && typeof client === 'object' && !Array.isArray(client)) {
|
|
61
|
+
const grouped = strip(client.forwardProxy);
|
|
62
|
+
if (grouped) {
|
|
63
|
+
const nextClient = { ...client };
|
|
64
|
+
delete nextClient.forwardProxy;
|
|
65
|
+
nextClient.ingressProxy = grouped;
|
|
66
|
+
disk.client = nextClient;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return disk;
|
|
70
|
+
},
|
|
71
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* The live config object registered by createServer.
|
|
3
3
|
*
|
|
4
4
|
* Kept in a leaf module so per-request readers (the gateway plugin host, the
|
|
5
|
-
*
|
|
5
|
+
* ingress proxy) can consult strict runtime flags WITHOUT importing
|
|
6
6
|
* `config/index.ts` — that module pulls in the pipeline and rate-limiter
|
|
7
7
|
* graphs, and importing it from the plugin host creates a load-order cycle
|
|
8
8
|
* whose partial module hides these exports.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type DiskConfigV11 } from './migrations/v10-to-v11.js';
|
|
2
2
|
import type { RouterConfig } from './types.js';
|
|
3
|
-
export declare const SCHEMA_VERSION =
|
|
3
|
+
export declare const SCHEMA_VERSION = 11;
|
|
4
4
|
/** The current disk type — re-exported from the LATEST version's file. */
|
|
5
|
-
export type DiskConfig =
|
|
5
|
+
export type DiskConfig = DiskConfigV11;
|
|
6
6
|
export interface Migration {
|
|
7
7
|
from: number;
|
|
8
8
|
to: number;
|
|
@@ -31,14 +31,21 @@
|
|
|
31
31
|
import { legacySurfaceWarnings, migrationV0ToV1 } from './migrations/v0-to-v1.js';
|
|
32
32
|
import { migrationV1ToV2 } from './migrations/v1-to-v2.js';
|
|
33
33
|
import { migrationV2ToV3 } from './migrations/v2-to-v3.js';
|
|
34
|
-
import { migrationV3ToV4
|
|
34
|
+
import { migrationV3ToV4 } from './migrations/v3-to-v4.js';
|
|
35
|
+
import { migrationV4ToV5 } from './migrations/v4-to-v5.js';
|
|
36
|
+
import { migrationV5ToV6 } from './migrations/v5-to-v6.js';
|
|
37
|
+
import { migrationV6ToV7 } from './migrations/v6-to-v7.js';
|
|
38
|
+
import { migrationV7ToV8 } from './migrations/v7-to-v8.js';
|
|
39
|
+
import { migrationV8ToV9 } from './migrations/v8-to-v9.js';
|
|
40
|
+
import { migrationV9ToV10 } from './migrations/v9-to-v10.js';
|
|
41
|
+
import { migrationV10ToV11, SECTION_MOVES_V11 } from './migrations/v10-to-v11.js';
|
|
35
42
|
import { toDiskConfigWith, toRuntimeConfigWith, toRuntimePathWith, } from './layout.js';
|
|
36
|
-
export const SCHEMA_VERSION =
|
|
43
|
+
export const SCHEMA_VERSION = 11;
|
|
37
44
|
/**
|
|
38
|
-
* The CURRENT layout pointer. Bump to `
|
|
45
|
+
* The CURRENT layout pointer. Bump to `SECTION_MOVES_V10` (etc.) when the
|
|
39
46
|
* newest migration file ships — the single edit a new version makes here.
|
|
40
47
|
*/
|
|
41
|
-
const LATEST_LAYOUT =
|
|
48
|
+
const LATEST_LAYOUT = SECTION_MOVES_V11;
|
|
42
49
|
/**
|
|
43
50
|
* The evolution chain — assembled IN ORDER from the per-version files.
|
|
44
51
|
* v0 = a config.yaml without `schemaVersion` (every file authored before
|
|
@@ -49,6 +56,13 @@ const MIGRATIONS = [
|
|
|
49
56
|
migrationV1ToV2,
|
|
50
57
|
migrationV2ToV3,
|
|
51
58
|
migrationV3ToV4,
|
|
59
|
+
migrationV4ToV5,
|
|
60
|
+
migrationV5ToV6,
|
|
61
|
+
migrationV6ToV7,
|
|
62
|
+
migrationV7ToV8,
|
|
63
|
+
migrationV8ToV9,
|
|
64
|
+
migrationV9ToV10,
|
|
65
|
+
migrationV10ToV11,
|
|
52
66
|
];
|
|
53
67
|
/** Runtime flat config → current-version disk shape. */
|
|
54
68
|
export function toDiskConfig(flat) {
|