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
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { capabilitiesFor } from './capabilities.js';
|
|
2
2
|
import { IrUnsupportedError } from './errors.js';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/** Default fix when a capability is simply missing on the dialed wire. */
|
|
4
|
+
const GENERIC_HINT = 'Omit this field or use a protocol that supports it';
|
|
5
|
+
/**
|
|
6
|
+
* Client-visible unsupported_parameter body. One voice for the gate and adapters:
|
|
7
|
+
* feature + dialed protocol + actionable hint. Dial context (model / protocols[])
|
|
8
|
+
* is layered on by `withDialContext` in the registry.
|
|
9
|
+
*/
|
|
10
|
+
export function formatUnsupported(protocol, feature, hint = GENERIC_HINT) {
|
|
11
|
+
const tip = hint.trim().replace(/\.$/, '');
|
|
12
|
+
return `Unsupported on outbound protocol '${protocol}': ${feature}. ${tip}.`;
|
|
5
13
|
}
|
|
6
14
|
/** Carrier shape family. The chat family is the DEFAULT: the three typed
|
|
7
15
|
* carriers are named, and every other protocol id (systemone, an OCR-native
|
|
@@ -9,56 +17,94 @@ function fail(protocol, code, detail) {
|
|
|
9
17
|
function isChatProtocol(protocol) {
|
|
10
18
|
return protocol !== 'openai-responses' && protocol !== 'anthropic-messages' && protocol !== 'google-gemini';
|
|
11
19
|
}
|
|
12
|
-
function
|
|
20
|
+
function fail(protocol, code, feature, hint = GENERIC_HINT) {
|
|
21
|
+
throw new IrUnsupportedError(code, formatUnsupported(protocol, feature, hint), protocol);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Operator-facing copy when a wire rejects non-function tools.
|
|
25
|
+
* OpenAI Platform Chat Completions added `type:"custom"` in 2025-08, but OCR's
|
|
26
|
+
* `openai-chat` id is the *portable* Chat Completions contract used by Xiaomi /
|
|
27
|
+
* DeepSeek / Kimi-style compat endpoints — those accept function tools, not
|
|
28
|
+
* OpenAI's freeform/grammar custom dialect or Responses builtins.
|
|
29
|
+
*/
|
|
30
|
+
export function unsupportedToolKindMessage(protocol, kind, forChoice) {
|
|
31
|
+
const feature = forChoice ? `Forcing a ${kind} tool (tool_choice)` : `${kind} tools`;
|
|
32
|
+
const responsesHint = `Add 'openai-responses' to the model's protocols[] if the vendor can serve it, or use a model whose protocols admit ${kind} tools`;
|
|
33
|
+
if (isChatProtocol(protocol) && (kind === 'custom' || kind === 'builtin')) {
|
|
34
|
+
const chatHint = kind === 'custom'
|
|
35
|
+
? `Portable openai-chat carries function tools only; ${responsesHint}`
|
|
36
|
+
: `Portable openai-chat cannot carry builtin/hosted tools; ${responsesHint}`;
|
|
37
|
+
return formatUnsupported(protocol, feature, chatHint);
|
|
38
|
+
}
|
|
39
|
+
if (kind === 'custom' || kind === 'builtin') {
|
|
40
|
+
return formatUnsupported(protocol, feature, responsesHint);
|
|
41
|
+
}
|
|
42
|
+
return formatUnsupported(protocol, feature);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Layer dial facts onto a gate/adapter refusal so the client sees which model
|
|
46
|
+
* and protocols[] were in play. Same code/protocol; message only.
|
|
47
|
+
*/
|
|
48
|
+
export function withDialContext(err, opts) {
|
|
49
|
+
if (err.message.startsWith('Request for model '))
|
|
50
|
+
return err;
|
|
51
|
+
const list = opts.protocols && opts.protocols.length > 0
|
|
52
|
+
? opts.protocols.join(', ')
|
|
53
|
+
: opts.dialWire;
|
|
54
|
+
const message = `Request for model '${opts.modelId}' (declared protocols: ${list}): ${err.message}`;
|
|
55
|
+
return new IrUnsupportedError(err.code, message, err.protocol ?? opts.dialWire);
|
|
56
|
+
}
|
|
57
|
+
function validateCache(cache, protocol, supported, code, feature, strip, hint = GENERIC_HINT) {
|
|
13
58
|
if (strip)
|
|
14
59
|
return;
|
|
15
60
|
if (!supported)
|
|
16
|
-
fail(protocol, code,
|
|
61
|
+
fail(protocol, code, feature, hint);
|
|
17
62
|
// Responses breakpoints are opaque objects; Anthropic only accepts its own
|
|
18
63
|
// typed cache_control marker. Replaying a foreign marker is not passthrough.
|
|
19
64
|
if (protocol === 'anthropic-messages' && cache.raw && !cache.type) {
|
|
20
|
-
fail(protocol, code, '
|
|
65
|
+
fail(protocol, code, 'Foreign raw cache breakpoints', 'Use an Anthropic cache_control marker');
|
|
21
66
|
}
|
|
22
67
|
if (protocol === 'openai-responses' && cache.type && !cache.raw) {
|
|
23
|
-
fail(protocol, code, '
|
|
68
|
+
fail(protocol, code, 'Anthropic cache_control breakpoints', 'Use a Responses prompt_cache breakpoint');
|
|
24
69
|
}
|
|
25
70
|
}
|
|
26
71
|
function validatePart(part, protocol, caps, stripCarrierExtensions = false) {
|
|
27
72
|
if (part.type === 'extension') {
|
|
28
|
-
if (part.protocol !== protocol)
|
|
29
|
-
fail(protocol, 'extension_part',
|
|
73
|
+
if (part.protocol !== protocol) {
|
|
74
|
+
fail(protocol, 'extension_part', `${part.protocol} extension content`, 'Keep same-carrier extensions only');
|
|
75
|
+
}
|
|
30
76
|
return;
|
|
31
77
|
}
|
|
32
78
|
if (!caps.parts[part.type])
|
|
33
|
-
fail(protocol, `${part.type}_part`,
|
|
79
|
+
fail(protocol, `${part.type}_part`, `${part.type} content parts`);
|
|
34
80
|
if ('cache' in part && part.cache) {
|
|
35
|
-
validateCache(part.cache, protocol, caps.cache.part_breakpoint === true, 'cache_part_breakpoint', '
|
|
81
|
+
validateCache(part.cache, protocol, caps.cache.part_breakpoint === true, 'cache_part_breakpoint', 'Content cache breakpoints', stripCarrierExtensions);
|
|
36
82
|
}
|
|
37
83
|
if ('source' in part) {
|
|
38
84
|
const allowed = caps.sources[part.type] ?? [];
|
|
39
85
|
if (!allowed.includes(part.source.kind)) {
|
|
40
|
-
fail(protocol, `${part.type}_source`,
|
|
86
|
+
fail(protocol, `${part.type}_source`, `${part.source.kind} ${part.type} sources`);
|
|
41
87
|
}
|
|
42
88
|
}
|
|
43
89
|
if ((part.type === 'text' || part.type === 'image' || part.type === 'file' || part.type === 'audio') && part.signature) {
|
|
44
90
|
if (!caps.reasoningSignature)
|
|
45
|
-
fail(protocol, 'content_signature', '
|
|
91
|
+
fail(protocol, 'content_signature', 'Signed content replay');
|
|
46
92
|
}
|
|
47
93
|
if (part.type === 'text' && part.annotations?.length && !caps.annotations) {
|
|
48
|
-
fail(protocol, 'annotations', '
|
|
94
|
+
fail(protocol, 'annotations', 'Text annotations');
|
|
49
95
|
}
|
|
50
96
|
if (part.type === 'text' && part.logprobs?.length && !caps.logprobs) {
|
|
51
|
-
fail(protocol, 'logprobs', '
|
|
97
|
+
fail(protocol, 'logprobs', 'Token log probabilities on content');
|
|
52
98
|
}
|
|
53
99
|
}
|
|
54
100
|
function validateToolChoice(choice, protocol, caps) {
|
|
55
101
|
if (!choice)
|
|
56
102
|
return;
|
|
57
103
|
if (choice.type === 'custom' && !caps.toolKinds.custom) {
|
|
58
|
-
|
|
104
|
+
throw new IrUnsupportedError('tool_choice', unsupportedToolKindMessage(protocol, 'custom', true), protocol);
|
|
59
105
|
}
|
|
60
106
|
if (choice.type === 'allowed' && !caps.allowedToolChoice) {
|
|
61
|
-
fail(protocol, 'allowed_tools', '
|
|
107
|
+
fail(protocol, 'allowed_tools', 'allowed_tools tool_choice');
|
|
62
108
|
}
|
|
63
109
|
}
|
|
64
110
|
/**
|
|
@@ -73,127 +119,131 @@ export function assertCanonicalRequestSupported(ir, protocol, options = {}) {
|
|
|
73
119
|
validateItem(item, protocol, caps, strip, 'request');
|
|
74
120
|
for (const tool of ir.tools ?? []) {
|
|
75
121
|
if (tool.type === 'extension') {
|
|
76
|
-
if (tool.protocol !== protocol)
|
|
77
|
-
fail(protocol, 'extension_tool',
|
|
122
|
+
if (tool.protocol !== protocol) {
|
|
123
|
+
fail(protocol, 'extension_tool', `${tool.protocol} tool definitions`, 'Keep same-carrier tools only');
|
|
124
|
+
}
|
|
78
125
|
continue;
|
|
79
126
|
}
|
|
80
|
-
if (!caps.toolKinds[tool.type])
|
|
81
|
-
|
|
127
|
+
if (!caps.toolKinds[tool.type]) {
|
|
128
|
+
throw new IrUnsupportedError('tool_type', unsupportedToolKindMessage(protocol, tool.type, false), protocol);
|
|
129
|
+
}
|
|
82
130
|
if (tool.type === 'function' && tool.function.strict === true && !caps.toolStrict) {
|
|
83
|
-
fail(protocol, 'tool_strict', '
|
|
131
|
+
fail(protocol, 'tool_strict', 'Strict function schemas');
|
|
84
132
|
}
|
|
85
133
|
const cache = tool.type === 'function' ? tool.function.cache : tool.type === 'custom' ? tool.cache : undefined;
|
|
86
134
|
if (cache) {
|
|
87
|
-
validateCache(cache, protocol, caps.cache.tool_breakpoint === true, 'cache_tool_breakpoint', '
|
|
135
|
+
validateCache(cache, protocol, caps.cache.tool_breakpoint === true, 'cache_tool_breakpoint', 'Tool cache breakpoints', strip);
|
|
88
136
|
}
|
|
89
137
|
}
|
|
90
138
|
validateToolChoice(ir.toolChoice, protocol, caps);
|
|
91
139
|
if (ir.parallelToolCalls === false && !caps.parallelToolCalls) {
|
|
92
|
-
fail(protocol, 'parallel_tool_calls', '
|
|
140
|
+
fail(protocol, 'parallel_tool_calls', 'Disabling parallel tool calls');
|
|
93
141
|
}
|
|
94
142
|
if (ir.text?.format && ir.text.format.type !== 'text' && !caps.responseFormat[ir.text.format.type]) {
|
|
95
|
-
fail(protocol, 'response_format',
|
|
143
|
+
fail(protocol, 'response_format', `${ir.text.format.type} response format`);
|
|
96
144
|
}
|
|
97
145
|
if (ir.text?.verbosity && !caps.textVerbosity)
|
|
98
|
-
fail(protocol, 'text_verbosity', '
|
|
146
|
+
fail(protocol, 'text_verbosity', 'text.verbosity');
|
|
99
147
|
if (ir.reasoning?.budgetTokens !== undefined && !caps.reasoningBudget) {
|
|
100
|
-
fail(protocol, 'reasoning_budget', '
|
|
148
|
+
fail(protocol, 'reasoning_budget', 'Thinking-token budgets');
|
|
101
149
|
}
|
|
102
150
|
if (ir.reasoning?.summary && !caps.reasoningSummary) {
|
|
103
|
-
fail(protocol, 'reasoning_summary', '
|
|
151
|
+
fail(protocol, 'reasoning_summary', 'Reasoning summaries');
|
|
104
152
|
}
|
|
105
153
|
if (ir.n !== undefined && ir.n !== 1 && !caps.candidates) {
|
|
106
|
-
fail(protocol, 'candidates', '
|
|
154
|
+
fail(protocol, 'candidates', 'Multiple candidates (n > 1)');
|
|
107
155
|
}
|
|
108
156
|
if ((ir.logprobs === true || ir.topLogprobs !== undefined) && !caps.logprobs) {
|
|
109
|
-
fail(protocol, 'logprobs', '
|
|
157
|
+
fail(protocol, 'logprobs', 'Log probabilities');
|
|
110
158
|
}
|
|
111
159
|
if (ir.logitBias !== undefined && !isChatProtocol(protocol)) {
|
|
112
|
-
fail(protocol, 'logit_bias', '
|
|
160
|
+
fail(protocol, 'logit_bias', 'Token logit bias');
|
|
113
161
|
}
|
|
114
162
|
if (ir.include !== undefined && protocol !== 'openai-responses') {
|
|
115
|
-
fail(protocol, 'include', '
|
|
163
|
+
fail(protocol, 'include', 'Responses include controls');
|
|
116
164
|
}
|
|
117
165
|
if (ir.store !== undefined || ir.previousResponseId || ir.conversation || ir.prompt) {
|
|
118
166
|
if (!caps.stateful)
|
|
119
|
-
fail(protocol, 'stateful_request', '
|
|
167
|
+
fail(protocol, 'stateful_request', 'Server-side response state controls');
|
|
120
168
|
}
|
|
121
169
|
if (ir.background && !caps.background)
|
|
122
|
-
fail(protocol, 'background', '
|
|
170
|
+
fail(protocol, 'background', 'Background responses');
|
|
123
171
|
if (ir.truncation === 'auto' && !caps.stateful)
|
|
124
|
-
fail(protocol, 'truncation', '
|
|
172
|
+
fail(protocol, 'truncation', 'Server-side truncation');
|
|
125
173
|
if (ir.metadata && !caps.metadata)
|
|
126
|
-
fail(protocol, 'metadata', '
|
|
174
|
+
fail(protocol, 'metadata', 'Opaque request metadata');
|
|
127
175
|
if (ir.serviceTier && !caps.serviceTier)
|
|
128
|
-
fail(protocol, 'service_tier', '
|
|
176
|
+
fail(protocol, 'service_tier', 'Service tier selection');
|
|
129
177
|
if (ir.safetyIdentifier && !caps.safetyIdentifier) {
|
|
130
|
-
fail(protocol, 'safety_identifier', '
|
|
178
|
+
fail(protocol, 'safety_identifier', 'Safety identifiers');
|
|
131
179
|
}
|
|
132
180
|
if (ir.user && !caps.user)
|
|
133
|
-
fail(protocol, 'user', '
|
|
181
|
+
fail(protocol, 'user', 'End-user attribution');
|
|
134
182
|
// streamOptions controls the northbound Chat encoder; it is not an upstream field.
|
|
135
183
|
for (const key of ['key', 'retention', 'options']) {
|
|
136
184
|
if (ir.cache?.[key] !== undefined && !caps.cache[key] && !(strip && key !== 'key')) {
|
|
137
|
-
fail(protocol, `cache_${key}`, `
|
|
185
|
+
fail(protocol, `cache_${key}`, `cache.${key}`);
|
|
138
186
|
}
|
|
139
187
|
}
|
|
140
188
|
if (!strip && ir.vendor?.anthropic?.systemCache && typeof ir.vendor.anthropic.systemCache === 'object') {
|
|
141
|
-
validateCache(ir.vendor.anthropic.systemCache, protocol, caps.cache.item_breakpoint === true, 'cache_system_breakpoint', '
|
|
189
|
+
validateCache(ir.vendor.anthropic.systemCache, protocol, caps.cache.item_breakpoint === true, 'cache_system_breakpoint', 'Anthropic system cache breakpoints', strip);
|
|
142
190
|
}
|
|
143
191
|
if (ir.reasoning?.include && protocol !== 'openai-responses') {
|
|
144
|
-
fail(protocol, 'reasoning_include', '
|
|
192
|
+
fail(protocol, 'reasoning_include', 'Encrypted reasoning content');
|
|
145
193
|
}
|
|
146
194
|
for (const key of Object.keys(ir.generation ?? {})) {
|
|
147
195
|
if (ir.generation?.[key] !== undefined && !caps.generation[key]) {
|
|
148
|
-
fail(protocol, `generation_${key}`, `
|
|
196
|
+
fail(protocol, `generation_${key}`, `generation.${key}`);
|
|
149
197
|
}
|
|
150
198
|
}
|
|
151
199
|
}
|
|
152
200
|
function validateItem(item, protocol, caps, stripCarrierExtensions = false, direction = 'request') {
|
|
153
201
|
if (item.type === 'extension') {
|
|
154
|
-
if (item.protocol !== protocol)
|
|
155
|
-
fail(protocol, 'extension_item',
|
|
202
|
+
if (item.protocol !== protocol) {
|
|
203
|
+
fail(protocol, 'extension_item', `${item.protocol} extension items`, 'Keep same-carrier extensions only');
|
|
204
|
+
}
|
|
156
205
|
return;
|
|
157
206
|
}
|
|
158
207
|
if (item.type === 'item_reference') {
|
|
159
208
|
if (!caps.itemReference)
|
|
160
|
-
fail(protocol, 'item_reference', '
|
|
209
|
+
fail(protocol, 'item_reference', 'Stored item references');
|
|
161
210
|
return;
|
|
162
211
|
}
|
|
163
212
|
if (item.type === 'reasoning') {
|
|
164
213
|
if ((item.signature || item.encrypted) && !caps.reasoningSignature) {
|
|
165
|
-
fail(protocol, 'reasoning_signature', '
|
|
214
|
+
fail(protocol, 'reasoning_signature', 'Signed or encrypted reasoning replay');
|
|
166
215
|
}
|
|
167
216
|
// Responses replays `encrypted_content` on the request wire and may echo a
|
|
168
217
|
// `signature` on northbound output, but a foreign signature has no request
|
|
169
218
|
// field — reject here so the matrix matches `itemToWire`, not only the adapter.
|
|
170
219
|
if (direction === 'request' && protocol === 'openai-responses' && item.signature) {
|
|
171
|
-
fail(protocol, 'reasoning_signature', 'Responses
|
|
220
|
+
fail(protocol, 'reasoning_signature', 'Foreign reasoning signatures', 'Strip signatures before dialing Responses, or stay on the signing carrier');
|
|
172
221
|
}
|
|
173
222
|
if (direction === 'request' && protocol === 'google-gemini' && item.encrypted) {
|
|
174
|
-
fail(protocol, 'reasoning_signature', '
|
|
223
|
+
fail(protocol, 'reasoning_signature', 'Encrypted OpenAI/Anthropic thought blobs', 'Strip encrypted reasoning before dialing Gemini');
|
|
175
224
|
}
|
|
176
225
|
if (item.summary?.length && !caps.reasoningSummary) {
|
|
177
|
-
fail(protocol, 'reasoning_summary', '
|
|
226
|
+
fail(protocol, 'reasoning_summary', 'Structured reasoning summaries');
|
|
178
227
|
}
|
|
179
228
|
return;
|
|
180
229
|
}
|
|
181
230
|
if (item.type === 'tool_call') {
|
|
182
|
-
if (item.signature && !caps.reasoningSignature)
|
|
183
|
-
fail(protocol, 'tool_call_signature', '
|
|
231
|
+
if (item.signature && !caps.reasoningSignature) {
|
|
232
|
+
fail(protocol, 'tool_call_signature', 'Signed tool-call replay');
|
|
233
|
+
}
|
|
184
234
|
if (direction === 'request' && protocol === 'openai-responses' && item.signature) {
|
|
185
|
-
fail(protocol, 'tool_call_signature', 'Responses
|
|
235
|
+
fail(protocol, 'tool_call_signature', 'Foreign tool-call signatures', 'Strip signatures before dialing Responses, or stay on the signing carrier');
|
|
186
236
|
}
|
|
187
237
|
if (item.cache) {
|
|
188
|
-
validateCache(item.cache, protocol, caps.cache.item_breakpoint === true, 'cache_item_breakpoint', '
|
|
238
|
+
validateCache(item.cache, protocol, caps.cache.item_breakpoint === true, 'cache_item_breakpoint', 'Item-level cache breakpoints', stripCarrierExtensions);
|
|
189
239
|
}
|
|
190
240
|
return;
|
|
191
241
|
}
|
|
192
242
|
if (item.type === 'tool_result' && item.isError && protocol !== 'anthropic-messages') {
|
|
193
|
-
fail(protocol, 'tool_result_error', '
|
|
243
|
+
fail(protocol, 'tool_result_error', 'Tool-result error markers');
|
|
194
244
|
}
|
|
195
245
|
if ('cache' in item && item.cache) {
|
|
196
|
-
validateCache(item.cache, protocol, caps.cache.item_breakpoint === true, 'cache_item_breakpoint', '
|
|
246
|
+
validateCache(item.cache, protocol, caps.cache.item_breakpoint === true, 'cache_item_breakpoint', 'Item-level cache breakpoints', stripCarrierExtensions);
|
|
197
247
|
}
|
|
198
248
|
for (const part of item.content)
|
|
199
249
|
validatePart(part, protocol, caps, stripCarrierExtensions);
|
|
@@ -201,22 +251,22 @@ function validateItem(item, protocol, caps, stripCarrierExtensions = false, dire
|
|
|
201
251
|
function validateOutputPart(part, protocol, caps) {
|
|
202
252
|
validatePart(part, protocol, caps);
|
|
203
253
|
if (part.type !== 'extension' && part.type !== 'text' && part.type !== 'refusal') {
|
|
204
|
-
fail(protocol, 'output_part',
|
|
254
|
+
fail(protocol, 'output_part', `${part.type} output content`);
|
|
205
255
|
}
|
|
206
256
|
if (part.type !== 'text')
|
|
207
257
|
return;
|
|
208
258
|
for (const annotation of part.annotations ?? []) {
|
|
209
259
|
if (annotation.type === 'extension' && annotation.protocol !== protocol) {
|
|
210
|
-
fail(protocol, 'annotation',
|
|
260
|
+
fail(protocol, 'annotation', `${annotation.protocol} annotations`);
|
|
211
261
|
}
|
|
212
262
|
if (protocol === 'anthropic-messages' && (annotation.type !== 'extension' || annotation.protocol !== protocol)) {
|
|
213
|
-
fail(protocol, 'annotation', 'Anthropic output requires carrier-native citation payloads
|
|
263
|
+
fail(protocol, 'annotation', 'Non-native annotations', 'Anthropic output requires carrier-native citation payloads');
|
|
214
264
|
}
|
|
215
265
|
}
|
|
216
266
|
// Chat logprobs have a token-aligned stream shape that this output adapter
|
|
217
267
|
// does not synthesize from Responses-span data. Reject instead of dropping.
|
|
218
268
|
if (isChatProtocol(protocol) && part.logprobs?.length) {
|
|
219
|
-
fail(protocol, 'output_logprobs', '
|
|
269
|
+
fail(protocol, 'output_logprobs', 'Responses token log probabilities on Chat output');
|
|
220
270
|
}
|
|
221
271
|
}
|
|
222
272
|
function validateOutputItem(item, protocol, caps) {
|
|
@@ -233,7 +283,7 @@ export function assertCanonicalResponseSupported(response, protocol) {
|
|
|
233
283
|
index: 0, status: response.status, ...(response.reason ? { reason: response.reason } : {}), output: response.output,
|
|
234
284
|
}];
|
|
235
285
|
if (candidates.length > 1 && !caps.candidates) {
|
|
236
|
-
fail(protocol, 'candidates', '
|
|
286
|
+
fail(protocol, 'candidates', 'Multiple candidates');
|
|
237
287
|
}
|
|
238
288
|
for (const candidate of candidates) {
|
|
239
289
|
for (const item of candidate.output)
|
|
@@ -244,7 +294,7 @@ export function assertCanonicalResponseSupported(response, protocol) {
|
|
|
244
294
|
export function assertCanonicalStreamEventSupported(event, protocol) {
|
|
245
295
|
const caps = capabilitiesFor(protocol);
|
|
246
296
|
if ((event.candidateIndex ?? 0) !== 0 && !caps.candidates) {
|
|
247
|
-
fail(protocol, 'candidates', '
|
|
297
|
+
fail(protocol, 'candidates', 'Streaming multiple candidates');
|
|
248
298
|
}
|
|
249
299
|
if (event.type === 'response.output_item.added' || event.type === 'response.output_item.done') {
|
|
250
300
|
validateOutputItem(event.item, protocol, caps);
|
|
@@ -263,10 +313,10 @@ export function assertCanonicalStreamEventSupported(event, protocol) {
|
|
|
263
313
|
return;
|
|
264
314
|
}
|
|
265
315
|
if ((event.type === 'response.refusal.delta' || event.type === 'response.refusal.done') && !caps.parts.refusal) {
|
|
266
|
-
fail(protocol, 'refusal_part', '
|
|
316
|
+
fail(protocol, 'refusal_part', 'Streaming refusal content');
|
|
267
317
|
return;
|
|
268
318
|
}
|
|
269
319
|
if (event.type.startsWith('response.reasoning_summary') && !caps.reasoningSummary) {
|
|
270
|
-
fail(protocol, 'reasoning_summary', '
|
|
320
|
+
fail(protocol, 'reasoning_summary', 'Streaming structured reasoning summaries');
|
|
271
321
|
}
|
|
272
322
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type LocalRunLogLine, type LocalRunSpawnLike } from './runner.js';
|
|
2
|
+
export type BuildJobStatus = 'building' | 'done' | 'failed';
|
|
3
|
+
export interface BuildJob {
|
|
4
|
+
id: string;
|
|
5
|
+
modelId: string;
|
|
6
|
+
engine: string;
|
|
7
|
+
status: BuildJobStatus;
|
|
8
|
+
startedAt: number;
|
|
9
|
+
finishedAt?: number;
|
|
10
|
+
error?: string;
|
|
11
|
+
/** Machine-readable error class for `error` (`build-leg-exited`), so the
|
|
12
|
+
* console localizes instead of showing the backend sentence raw — the same
|
|
13
|
+
* `code` + `error` pair `LocalRun.lastErrorCode` carries (ADR-0046). */
|
|
14
|
+
errorCode?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Test seam, mirroring setLocalRunnerDepsForTests. */
|
|
17
|
+
export declare function setBuildJobDepsForTests(deps: {
|
|
18
|
+
spawnImpl?: LocalRunSpawnLike;
|
|
19
|
+
} | null): void;
|
|
20
|
+
export declare function appendBuildLog(id: string, stream: LocalRunLogLine['stream'], raw: string): void;
|
|
21
|
+
export declare function buildLogs(id: string, limit?: number): LocalRunLogLine[];
|
|
22
|
+
/** Newest first; finished history is capped, building jobs are always listed. */
|
|
23
|
+
export declare function listBuildJobs(): BuildJob[];
|
|
24
|
+
export declare function getBuildJob(id: string): BuildJob | null;
|
|
25
|
+
export type StartBuildResult = {
|
|
26
|
+
ok: true;
|
|
27
|
+
job: BuildJob;
|
|
28
|
+
} | {
|
|
29
|
+
ok: false;
|
|
30
|
+
code: string;
|
|
31
|
+
error: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Start one build for one (model, engine). The legs come from the engine's
|
|
35
|
+
* runtime; a refusal (incomplete workspace, missing tool) surfaces as the
|
|
36
|
+
* error rather than spawning something half-formed.
|
|
37
|
+
*/
|
|
38
|
+
export declare function startBuildJob(opts: {
|
|
39
|
+
modelId: string;
|
|
40
|
+
engine: string;
|
|
41
|
+
}): Promise<StartBuildResult>;
|
|
42
|
+
/**
|
|
43
|
+
* What a catalog download does next, once its files are on disk.
|
|
44
|
+
*
|
|
45
|
+
* "Downloaded" is not "runnable": a model whose launch input the ENGINE derives
|
|
46
|
+
* (a pack, or the in-place tokenizer) is still `serves: false` until that input
|
|
47
|
+
* exists. Asking the engine's own verdict (`buildable`) is what keeps this
|
|
48
|
+
* engine-agnostic — the gateway never decides by name that a model "needs a
|
|
49
|
+
* pack". `null` means nothing to do: the model already runs, or no engine can
|
|
50
|
+
* derive what it is missing (the console's Pack button covers that case).
|
|
51
|
+
*
|
|
52
|
+
* A start that fails is returned, not thrown, and it changes nothing about the
|
|
53
|
+
* model: `startBuildJob` only registers a job on success, so a failure leaves
|
|
54
|
+
* the model `buildable` and its Pack button in place — that IS the retry path.
|
|
55
|
+
*/
|
|
56
|
+
export declare function prepareAfterDownload(model: {
|
|
57
|
+
id: string;
|
|
58
|
+
filePath: string;
|
|
59
|
+
}, engineId: string): Promise<{
|
|
60
|
+
status: 'started';
|
|
61
|
+
jobId: string;
|
|
62
|
+
} | {
|
|
63
|
+
status: 'refused';
|
|
64
|
+
code: string;
|
|
65
|
+
error: string;
|
|
66
|
+
} | undefined>;
|