@openllmsh/sdk 2.10.12-alpha.1 → 2.10.12
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 +27 -7
- package/dist/client/chat.d.ts +38 -0
- package/dist/client/chat.js +77 -0
- package/dist/client/devices.d.ts +70 -0
- package/dist/client/devices.js +172 -0
- package/dist/client/http.d.ts +24 -0
- package/dist/client/http.js +34 -0
- package/dist/client/index.d.ts +43 -0
- package/dist/client/index.js +57 -0
- package/dist/client/relay-mux.d.ts +71 -0
- package/dist/client/relay-mux.js +394 -0
- package/dist/client/types.d.ts +47 -0
- package/dist/client/types.js +5 -0
- package/dist/client/vault.d.ts +68 -0
- package/dist/client/vault.js +113 -0
- package/dist/connect/chat.d.ts +24 -0
- package/dist/connect/chat.js +25 -0
- package/dist/connect/client.d.ts +50 -0
- package/dist/connect/client.js +141 -0
- package/dist/connect/config.d.ts +22 -0
- package/dist/connect/config.js +22 -0
- package/dist/connect/errors.d.ts +32 -0
- package/dist/connect/errors.js +85 -0
- package/{connect/index.ts → dist/connect/index.d.ts} +7 -7
- package/dist/connect/index.js +23 -0
- package/dist/connect/oauth.d.ts +51 -0
- package/dist/connect/oauth.js +150 -0
- package/dist/connect/routes.d.ts +38 -0
- package/dist/connect/routes.js +175 -0
- package/dist/connect/store.d.ts +26 -0
- package/dist/connect/store.js +65 -0
- package/dist/mcp/handle.d.ts +6 -0
- package/dist/mcp/handle.js +6 -0
- package/dist/mcp/index.d.ts +15 -0
- package/dist/mcp/index.js +10 -0
- package/dist/mcp/server.d.ts +84 -0
- package/dist/mcp/server.js +168 -0
- package/dist/mcp/tools/marketplace.d.ts +94 -0
- package/dist/mcp/tools/marketplace.js +303 -0
- package/dist/mcp/tools/memory-client.d.ts +109 -0
- package/dist/mcp/tools/memory-client.js +200 -0
- package/dist/mcp/tools/memory-config.d.ts +29 -0
- package/dist/mcp/tools/memory-config.js +12 -0
- package/dist/mcp/tools/memory.d.ts +92 -0
- package/dist/mcp/tools/memory.js +312 -0
- package/dist/mcp/tools/model-priority.d.ts +16 -0
- package/dist/mcp/tools/model-priority.js +87 -0
- package/dist/mcp/tools/openllm.d.ts +75 -0
- package/dist/mcp/tools/openllm.js +715 -0
- package/dist/mcp/types.d.ts +25 -0
- package/dist/mcp/types.js +7 -0
- package/dist/openapi/call.d.ts +26 -0
- package/dist/openapi/call.js +56 -0
- package/dist/openapi/index.d.ts +2 -0
- package/dist/openapi/index.js +2 -0
- package/dist/openapi/openapi.json +80213 -0
- package/dist/openapi/operations.d.ts +14 -0
- package/dist/openapi/operations.js +2060 -0
- package/dist/protocol/access.d.ts +81 -0
- package/dist/protocol/access.js +125 -0
- package/dist/protocol/agent-prompt-text.d.ts +15 -0
- package/{protocol/agent-prompt-text.ts → dist/protocol/agent-prompt-text.js} +9 -14
- package/dist/protocol/agent.d.ts +1487 -0
- package/dist/protocol/agent.js +787 -0
- package/dist/protocol/api-key-syntax.d.ts +58 -0
- package/dist/protocol/api-key-syntax.js +73 -0
- package/dist/protocol/audio.d.ts +18 -0
- package/dist/protocol/audio.js +21 -0
- package/dist/protocol/auth.d.ts +126 -0
- package/dist/protocol/auth.js +119 -0
- package/dist/protocol/changelog.d.ts +69 -0
- package/dist/protocol/changelog.js +107 -0
- package/dist/protocol/chat.d.ts +789 -0
- package/dist/protocol/chat.js +394 -0
- package/dist/protocol/client-registry.d.ts +151 -0
- package/dist/protocol/client-registry.js +238 -0
- package/dist/protocol/config.d.ts +508 -0
- package/dist/protocol/config.js +289 -0
- package/dist/protocol/control-channel.d.ts +102 -0
- package/{protocol/control-channel.ts → dist/protocol/control-channel.js} +33 -61
- package/dist/protocol/cooldown-reason.d.ts +30 -0
- package/dist/protocol/cooldown-reason.js +44 -0
- package/dist/protocol/cost.d.ts +9 -0
- package/dist/protocol/cost.js +8 -0
- package/dist/protocol/daemon-port.d.ts +2 -0
- package/dist/protocol/daemon-port.js +28 -0
- package/dist/protocol/daemon.d.ts +2034 -0
- package/dist/protocol/daemon.js +1286 -0
- package/dist/protocol/default-chains.d.ts +15 -0
- package/dist/protocol/default-chains.js +21 -0
- package/dist/protocol/device-state.d.ts +223 -0
- package/dist/protocol/device-state.js +52 -0
- package/dist/protocol/doctor-report-local.d.ts +105 -0
- package/{protocol/doctor-report-local.ts → dist/protocol/doctor-report-local.js} +92 -196
- package/dist/protocol/doctor-report-policy.d.ts +62 -0
- package/{protocol/doctor-report-policy.ts → dist/protocol/doctor-report-policy.js} +23 -76
- package/dist/protocol/doctor-report.d.ts +406 -0
- package/dist/protocol/doctor-report.js +645 -0
- package/dist/protocol/errors.d.ts +17 -0
- package/dist/protocol/errors.js +10 -0
- package/dist/protocol/execution-selection.d.ts +92 -0
- package/{protocol/execution-selection.ts → dist/protocol/execution-selection.js} +38 -63
- package/dist/protocol/hop-grant.d.ts +28 -0
- package/{protocol/hop-grant.ts → dist/protocol/hop-grant.js} +7 -13
- package/dist/protocol/image-edit-parse.d.ts +25 -0
- package/dist/protocol/image-edit-parse.js +196 -0
- package/dist/protocol/images.d.ts +288 -0
- package/dist/protocol/images.js +229 -0
- package/dist/protocol/index.d.ts +69 -0
- package/dist/protocol/index.js +74 -0
- package/dist/protocol/inference-headers.d.ts +3 -0
- package/dist/protocol/keepalive.d.ts +36 -0
- package/dist/protocol/keepalive.js +51 -0
- package/dist/protocol/local-auth.d.ts +125 -0
- package/dist/protocol/local-auth.js +227 -0
- package/dist/protocol/local-device-control.d.ts +108 -0
- package/{protocol/local-device-control.ts → dist/protocol/local-device-control.js} +40 -70
- package/dist/protocol/local-provider.d.ts +105 -0
- package/dist/protocol/local-provider.js +213 -0
- package/dist/protocol/local-session.d.ts +70 -0
- package/dist/protocol/local-session.js +87 -0
- package/dist/protocol/marketplace.d.ts +190 -0
- package/dist/protocol/marketplace.js +140 -0
- package/{protocol/media-attempt.ts → dist/protocol/media-attempt.d.ts} +11 -50
- package/dist/protocol/media-attempt.js +50 -0
- package/dist/protocol/media-bytes.d.ts +8 -0
- package/dist/protocol/media-bytes.js +21 -0
- package/dist/protocol/media-default.d.ts +56 -0
- package/dist/protocol/media-default.js +302 -0
- package/{protocol/media-dimensions.ts → dist/protocol/media-dimensions.d.ts} +11 -78
- package/dist/protocol/media-dimensions.js +90 -0
- package/dist/protocol/media-input.d.ts +20 -0
- package/dist/protocol/media-input.js +29 -0
- package/dist/protocol/media-model.d.ts +77 -0
- package/dist/protocol/media-model.js +89 -0
- package/{protocol/media-option-issue.ts → dist/protocol/media-option-issue.d.ts} +25 -53
- package/dist/protocol/media-option-issue.js +50 -0
- package/dist/protocol/media-types.d.ts +14 -0
- package/dist/protocol/media-types.js +61 -0
- package/dist/protocol/model-match.d.ts +254 -0
- package/dist/protocol/model-match.js +760 -0
- package/dist/protocol/model-settings.d.ts +153 -0
- package/dist/protocol/model-settings.js +246 -0
- package/dist/protocol/models.d.ts +1065 -0
- package/dist/protocol/models.js +638 -0
- package/dist/protocol/mux.d.ts +350 -0
- package/dist/protocol/mux.js +595 -0
- package/{protocol/plan-surface.ts → dist/protocol/plan-surface.d.ts} +12 -26
- package/dist/protocol/plan-surface.js +39 -0
- package/dist/protocol/provider-models.d.ts +8 -0
- package/{protocol/provider-models.ts → dist/protocol/provider-models.js} +7 -9
- package/dist/protocol/provider-status.d.ts +59 -0
- package/dist/protocol/provider-status.js +142 -0
- package/dist/protocol/provider-tier.d.ts +34 -0
- package/{protocol/provider-tier.ts → dist/protocol/provider-tier.js} +9 -34
- package/dist/protocol/provider-usage.d.ts +230 -0
- package/dist/protocol/provider-usage.js +214 -0
- package/dist/protocol/providers.d.ts +2496 -0
- package/dist/protocol/providers.js +723 -0
- package/dist/protocol/public-usage-index.d.ts +449 -0
- package/dist/protocol/public-usage-index.js +279 -0
- package/dist/protocol/realtime-generated.d.ts +29 -0
- package/{protocol/realtime-generated.ts → dist/protocol/realtime-generated.js} +3 -5
- package/dist/protocol/realtime.d.ts +241 -0
- package/{protocol/realtime.ts → dist/protocol/realtime.js} +88 -155
- package/dist/protocol/registry-pointer.d.ts +24 -0
- package/dist/protocol/registry-pointer.js +78 -0
- package/dist/protocol/relay.d.ts +1152 -0
- package/{protocol/relay.ts → dist/protocol/relay.js} +237 -370
- package/dist/protocol/replay-session.d.ts +4 -0
- package/{protocol/replay-session.ts → dist/protocol/replay-session.js} +1 -8
- package/dist/protocol/responses.d.ts +303 -0
- package/dist/protocol/responses.js +240 -0
- package/dist/protocol/semver.d.ts +59 -0
- package/dist/protocol/semver.js +171 -0
- package/{protocol/setup-mode.ts → dist/protocol/setup-mode.d.ts} +4 -12
- package/dist/protocol/setup-mode.js +18 -0
- package/dist/protocol/sha256-hex.d.ts +2 -0
- package/dist/protocol/sha256-hex.js +93 -0
- package/dist/protocol/stats.d.ts +711 -0
- package/dist/protocol/stats.js +353 -0
- package/dist/protocol/streaming.d.ts +16 -0
- package/dist/protocol/streaming.js +15 -0
- package/{protocol/subscription-daemon-floors.ts → dist/protocol/subscription-daemon-floors.d.ts} +8 -14
- package/dist/protocol/subscription-daemon-floors.js +4 -0
- package/dist/protocol/subscription-provider-compat.d.ts +44 -0
- package/dist/protocol/subscription-provider-compat.js +67 -0
- package/dist/protocol/subscription-provider.d.ts +15 -0
- package/dist/protocol/subscription-provider.js +17 -0
- package/dist/protocol/team-grant.d.ts +14 -0
- package/{protocol/team-grant.ts → dist/protocol/team-grant.js} +0 -3
- package/dist/protocol/team-shareable.d.ts +6 -0
- package/{protocol/team-shareable.ts → dist/protocol/team-shareable.js} +29 -33
- package/dist/protocol/transcription-encoding.d.ts +25 -0
- package/dist/protocol/transcription-encoding.js +47 -0
- package/{protocol/url-locality-dns.ts → dist/protocol/url-locality-dns.d.ts} +1 -23
- package/dist/protocol/url-locality-dns.js +33 -0
- package/dist/protocol/url-locality.d.ts +45 -0
- package/dist/protocol/url-locality.js +288 -0
- package/dist/protocol/usage-snapshots.d.ts +8 -0
- package/{protocol/usage-snapshots.ts → dist/protocol/usage-snapshots.js} +1 -2
- package/dist/protocol/vendor-cli-install.d.ts +20 -0
- package/{protocol/vendor-cli-install.ts → dist/protocol/vendor-cli-install.js} +10 -15
- package/dist/protocol/video-job-plan.d.ts +18 -0
- package/dist/protocol/video-job-plan.js +44 -0
- package/dist/protocol/videos.d.ts +107 -0
- package/dist/protocol/videos.js +154 -0
- package/dist/tunnel/channel-envelope.d.ts +53 -0
- package/dist/tunnel/channel-envelope.js +100 -0
- package/dist/tunnel/codec.d.ts +71 -0
- package/dist/tunnel/codec.js +151 -0
- package/dist/tunnel/device-anchor.d.ts +62 -0
- package/dist/tunnel/device-anchor.js +168 -0
- package/dist/tunnel/device-control.d.ts +50 -0
- package/dist/tunnel/device-control.js +88 -0
- package/dist/tunnel/device-grant.d.ts +91 -0
- package/dist/tunnel/device-grant.js +105 -0
- package/dist/tunnel/fleet.d.ts +28 -0
- package/dist/tunnel/fleet.js +41 -0
- package/dist/tunnel/index.d.ts +22 -0
- package/dist/tunnel/index.js +22 -0
- package/dist/tunnel/mux.d.ts +64 -0
- package/dist/tunnel/mux.js +449 -0
- package/dist/tunnel/peer-link.d.ts +88 -0
- package/dist/tunnel/peer-link.js +271 -0
- package/dist/tunnel/rtc-auth.d.ts +159 -0
- package/dist/tunnel/rtc-auth.js +340 -0
- package/dist/tunnel/rtc-duplex.d.ts +52 -0
- package/dist/tunnel/rtc-duplex.js +148 -0
- package/dist/tunnel/rtc-ice.d.ts +55 -0
- package/dist/tunnel/rtc-ice.js +100 -0
- package/dist/tunnel/secure.d.ts +179 -0
- package/dist/tunnel/secure.js +936 -0
- package/dist/tunnel/stream-reset-error.d.ts +6 -0
- package/dist/tunnel/stream-reset-error.js +9 -0
- package/dist/tunnel/streams.d.ts +244 -0
- package/dist/tunnel/streams.js +1071 -0
- package/dist/tunnel/team-grant.d.ts +90 -0
- package/dist/tunnel/team-grant.js +226 -0
- package/dist/tunnel/wire-bytes.d.ts +32 -0
- package/dist/tunnel/wire-bytes.js +90 -0
- package/dist/vault/api-key.d.ts +71 -0
- package/dist/vault/api-key.js +130 -0
- package/{vault/argon2.ts → dist/vault/argon2.d.ts} +18 -53
- package/dist/vault/argon2.js +82 -0
- package/dist/vault/cli-auth-seal.d.ts +35 -0
- package/dist/vault/cli-auth-seal.js +78 -0
- package/dist/vault/cred-seal.d.ts +18 -0
- package/dist/vault/cred-seal.js +86 -0
- package/dist/vault/credential.d.ts +21 -0
- package/dist/vault/credential.js +26 -0
- package/dist/vault/crypto.d.ts +51 -0
- package/dist/vault/crypto.js +156 -0
- package/dist/vault/daemon-attest.d.ts +68 -0
- package/dist/vault/daemon-attest.js +147 -0
- package/dist/vault/derive.d.ts +34 -0
- package/dist/vault/derive.js +84 -0
- package/dist/vault/device-access.d.ts +17 -0
- package/dist/vault/device-access.js +77 -0
- package/dist/vault/device-anchor.d.ts +42 -0
- package/dist/vault/device-anchor.js +90 -0
- package/dist/vault/device-control.d.ts +80 -0
- package/{vault/device-control.ts → dist/vault/device-control.js} +46 -104
- package/dist/vault/handoff.d.ts +102 -0
- package/dist/vault/handoff.js +236 -0
- package/dist/vault/index.d.ts +21 -0
- package/dist/vault/index.js +21 -0
- package/dist/vault/passkey.d.ts +82 -0
- package/{vault/passkey.ts → dist/vault/passkey.js} +63 -153
- package/dist/vault/phrase.d.ts +40 -0
- package/{vault/phrase.ts → dist/vault/phrase.js} +17 -23
- package/dist/vault/pin.d.ts +46 -0
- package/dist/vault/pin.js +92 -0
- package/dist/vault/public-key-seal.d.ts +17 -0
- package/dist/vault/public-key-seal.js +59 -0
- package/dist/vault/seed.d.ts +96 -0
- package/dist/vault/seed.js +179 -0
- package/dist/vault/team.d.ts +134 -0
- package/dist/vault/team.js +217 -0
- package/dist/vault/vault-item.d.ts +45 -0
- package/dist/vault/vault-item.js +62 -0
- package/dist/vault/vault-migrate-digest.d.ts +10 -0
- package/dist/vault/vault-migrate-digest.js +22 -0
- package/dist/vault/wrapped.d.ts +19 -0
- package/dist/vault/wrapped.js +52 -0
- package/dist/wire/adapters/messages/anthropic-map.d.ts +8 -0
- package/dist/wire/adapters/messages/anthropic-map.js +32 -0
- package/dist/wire/adapters/messages/index.d.ts +7 -0
- package/dist/wire/adapters/messages/index.js +7 -0
- package/dist/wire/adapters/messages/reasoning-from-items.d.ts +14 -0
- package/dist/wire/adapters/messages/reasoning-from-items.js +39 -0
- package/dist/wire/adapters/messages/reasoning-signature.d.ts +81 -0
- package/dist/wire/adapters/messages/reasoning-signature.js +180 -0
- package/dist/wire/adapters/messages/request.d.ts +28 -0
- package/dist/wire/adapters/messages/request.js +490 -0
- package/dist/wire/adapters/messages/response.d.ts +10 -0
- package/dist/wire/adapters/messages/response.js +177 -0
- package/dist/wire/adapters/messages/streaming.d.ts +134 -0
- package/dist/wire/adapters/messages/streaming.js +791 -0
- package/dist/wire/adapters/messages/usage.d.ts +20 -0
- package/dist/wire/adapters/messages/usage.js +10 -0
- package/dist/wire/adapters/responses/index.d.ts +3 -0
- package/dist/wire/adapters/responses/index.js +3 -0
- package/dist/wire/adapters/responses/request.d.ts +2 -0
- package/dist/wire/adapters/responses/request.js +287 -0
- package/dist/wire/adapters/responses/response.d.ts +11 -0
- package/dist/wire/adapters/responses/response.js +69 -0
- package/dist/wire/adapters/responses/streaming.d.ts +2 -0
- package/dist/wire/adapters/responses/streaming.js +267 -0
- package/dist/wire/features/account-rank.d.ts +61 -0
- package/dist/wire/features/account-rank.js +109 -0
- package/dist/wire/features/compaction/compact-request.d.ts +69 -0
- package/dist/wire/features/compaction/compact-request.js +667 -0
- package/dist/wire/features/compaction/compaction-text.d.ts +17 -0
- package/dist/wire/features/compaction/compaction-text.js +29 -0
- package/dist/wire/features/context-demote.d.ts +15 -0
- package/dist/wire/features/context-demote.js +45 -0
- package/dist/wire/features/context-overflow-strategy.d.ts +12 -0
- package/dist/wire/features/context-overflow-strategy.js +8 -0
- package/dist/wire/features/context-skip.d.ts +120 -0
- package/{wire/features/context-skip.ts → dist/wire/features/context-skip.js} +23 -57
- package/dist/wire/features/conversation-affinity.d.ts +49 -0
- package/dist/wire/features/conversation-affinity.js +121 -0
- package/dist/wire/features/max-tokens-backfill.d.ts +50 -0
- package/dist/wire/features/max-tokens-backfill.js +118 -0
- package/dist/wire/features/model-caps.d.ts +7 -0
- package/dist/wire/features/model-caps.js +40 -0
- package/dist/wire/features/model-settings.d.ts +3 -0
- package/dist/wire/features/model-settings.js +13 -0
- package/dist/wire/features/output-limit-clamp.d.ts +14 -0
- package/dist/wire/features/output-limit-clamp.js +36 -0
- package/dist/wire/features/quota-gate.d.ts +16 -0
- package/dist/wire/features/quota-gate.js +48 -0
- package/dist/wire/index.d.ts +44 -0
- package/dist/wire/index.js +44 -0
- package/dist/wire/lib/attempt-outcome.d.ts +19 -0
- package/dist/wire/lib/attempt-outcome.js +18 -0
- package/{wire/lib/canonical/content-part.ts → dist/wire/lib/canonical/content-part.d.ts} +12 -18
- package/dist/wire/lib/canonical/content-part.js +11 -0
- package/dist/wire/lib/canonical/count-tokens-capability.d.ts +52 -0
- package/dist/wire/lib/canonical/count-tokens-capability.js +109 -0
- package/{wire/lib/canonical/encoding-select.ts → dist/wire/lib/canonical/encoding-select.d.ts} +7 -24
- package/dist/wire/lib/canonical/encoding-select.js +26 -0
- package/dist/wire/lib/canonical/image-signature.d.ts +20 -0
- package/dist/wire/lib/canonical/image-signature.js +184 -0
- package/dist/wire/lib/canonical/image-sse.d.ts +88 -0
- package/dist/wire/lib/canonical/image-sse.js +173 -0
- package/{wire/lib/canonical/message.ts → dist/wire/lib/canonical/message.d.ts} +2 -20
- package/dist/wire/lib/canonical/message.js +31 -0
- package/dist/wire/lib/canonical/token-estimate.d.ts +98 -0
- package/dist/wire/lib/canonical/token-estimate.js +230 -0
- package/dist/wire/lib/encrypted-content.d.ts +22 -0
- package/dist/wire/lib/encrypted-content.js +55 -0
- package/dist/wire/lib/error-class.d.ts +57 -0
- package/dist/wire/lib/error-class.js +97 -0
- package/dist/wire/lib/error-envelope.d.ts +20 -0
- package/dist/wire/lib/error-envelope.js +53 -0
- package/dist/wire/lib/forwarded-headers.d.ts +16 -0
- package/{wire/lib/forwarded-headers.ts → dist/wire/lib/forwarded-headers.js} +62 -72
- package/dist/wire/lib/provider-error-rules.d.ts +21 -0
- package/dist/wire/lib/provider-error-rules.js +20 -0
- package/{wire/lib/refusal.ts → dist/wire/lib/refusal.d.ts} +3 -13
- package/dist/wire/lib/refusal.js +27 -0
- package/dist/wire/lib/responses-apply-patch.d.ts +57 -0
- package/dist/wire/lib/responses-apply-patch.js +81 -0
- package/dist/wire/lib/responses-namespace.d.ts +27 -0
- package/{wire/lib/responses-namespace.ts → dist/wire/lib/responses-namespace.js} +16 -32
- package/dist/wire/lib/secret-scrub.d.ts +23 -0
- package/dist/wire/lib/secret-scrub.js +72 -0
- package/dist/wire/lib/streaming/accumulate.d.ts +12 -0
- package/dist/wire/lib/streaming/accumulate.js +187 -0
- package/dist/wire/lib/streaming/finish-reason.d.ts +20 -0
- package/dist/wire/lib/streaming/finish-reason.js +15 -0
- package/{wire/lib/streaming/peek.ts → dist/wire/lib/streaming/peek.d.ts} +13 -82
- package/dist/wire/lib/streaming/peek.js +100 -0
- package/dist/wire/lib/streaming/provider-decode.d.ts +57 -0
- package/dist/wire/lib/streaming/provider-decode.js +210 -0
- package/dist/wire/lib/streaming/response-stream.d.ts +16 -0
- package/dist/wire/lib/streaming/response-stream.js +64 -0
- package/dist/wire/lib/streaming/sse.d.ts +130 -0
- package/dist/wire/lib/streaming/sse.js +600 -0
- package/dist/wire/lib/streaming/strip-tool-calls.d.ts +14 -0
- package/dist/wire/lib/streaming/strip-tool-calls.js +75 -0
- package/dist/wire/lib/streaming/upstream-error.d.ts +32 -0
- package/dist/wire/lib/streaming/upstream-error.js +45 -0
- package/dist/wire/lib/strip-subagent-isolation.d.ts +16 -0
- package/dist/wire/lib/strip-subagent-isolation.js +240 -0
- package/dist/wire/lib/thinking-signature.d.ts +56 -0
- package/{wire/lib/thinking-signature.ts → dist/wire/lib/thinking-signature.js} +77 -84
- package/dist/wire/lib/token-ruler/bpe-core.d.ts +105 -0
- package/dist/wire/lib/token-ruler/bpe-core.js +398 -0
- package/dist/wire/lib/token-ruler/index.d.ts +2 -0
- package/dist/wire/lib/token-ruler/index.js +2 -0
- package/dist/wire/lib/token-ruler/ruler.d.ts +36 -0
- package/dist/wire/lib/token-ruler/ruler.js +50 -0
- package/dist/wire/lib/token-ruler/vocab/claude-ranks.d.ts +14 -0
- package/dist/wire/lib/token-ruler/vocab/claude-ranks.js +16 -0
- package/{wire/lib/token-ruler/vocab/claude.ts → dist/wire/lib/token-ruler/vocab/claude.d.ts} +2 -12
- package/dist/wire/lib/token-ruler/vocab/claude.js +8 -0
- package/dist/wire/lib/token-ruler/vocab/o200k-ranks.d.ts +3 -0
- package/dist/wire/lib/token-ruler/vocab/o200k-ranks.js +18 -0
- package/dist/wire/lib/token-ruler/vocab/o200k.d.ts +11 -0
- package/dist/wire/lib/token-ruler/vocab/o200k.js +6 -0
- package/dist/wire/lib/tool-name-map.d.ts +44 -0
- package/dist/wire/lib/tool-name-map.js +186 -0
- package/dist/wire/lib/tool-schema.d.ts +15 -0
- package/dist/wire/lib/tool-schema.js +307 -0
- package/dist/wire/lib/usage-observer.d.ts +9 -0
- package/dist/wire/lib/usage-observer.js +108 -0
- package/dist/wire/providers/anthropic/adaptive-thinking.d.ts +125 -0
- package/dist/wire/providers/anthropic/adaptive-thinking.js +221 -0
- package/dist/wire/providers/anthropic/beta-headers.d.ts +44 -0
- package/{wire/providers/anthropic/beta-headers.ts → dist/wire/providers/anthropic/beta-headers.js} +57 -79
- package/dist/wire/providers/anthropic/index.d.ts +6 -0
- package/{wire/providers/anthropic/index.ts → dist/wire/providers/anthropic/index.js} +6 -6
- package/dist/wire/providers/anthropic/request.d.ts +12 -0
- package/dist/wire/providers/anthropic/request.js +456 -0
- package/dist/wire/providers/anthropic/response.d.ts +3 -0
- package/dist/wire/providers/anthropic/response.js +126 -0
- package/dist/wire/providers/anthropic/streaming.d.ts +28 -0
- package/dist/wire/providers/anthropic/streaming.js +268 -0
- package/dist/wire/providers/anthropic/web-search-domains.d.ts +7 -0
- package/dist/wire/providers/anthropic/web-search-domains.js +36 -0
- package/dist/wire/providers/chatgpt/common.d.ts +27 -0
- package/{wire/providers/chatgpt/common.ts → dist/wire/providers/chatgpt/common.js} +69 -89
- package/dist/wire/providers/chatgpt/index.d.ts +4 -0
- package/{wire/providers/chatgpt/index.ts → dist/wire/providers/chatgpt/index.js} +4 -4
- package/dist/wire/providers/chatgpt/request.d.ts +132 -0
- package/dist/wire/providers/chatgpt/request.js +696 -0
- package/dist/wire/providers/chatgpt/streaming.d.ts +69 -0
- package/dist/wire/providers/chatgpt/streaming.js +761 -0
- package/dist/wire/providers/chatgpt/web-search.d.ts +19 -0
- package/dist/wire/providers/chatgpt/web-search.js +55 -0
- package/dist/wire/providers/grok/web-search.d.ts +23 -0
- package/dist/wire/providers/grok/web-search.js +74 -0
- package/dist/wire/providers/kimi/web-search.d.ts +48 -0
- package/dist/wire/providers/kimi/web-search.js +106 -0
- package/dist/wire/providers/upstream-deny.d.ts +61 -0
- package/dist/wire/providers/upstream-deny.js +293 -0
- package/dist/wire/providers/upstream-request.d.ts +104 -0
- package/dist/wire/providers/upstream-request.js +411 -0
- package/package.json +105 -23
- package/ARCHITECTURE.md +0 -43
- package/client/chat.ts +0 -140
- package/client/devices.ts +0 -269
- package/client/http.ts +0 -72
- package/client/index.ts +0 -129
- package/client/relay-mux.ts +0 -547
- package/client/types.ts +0 -51
- package/client/vault.ts +0 -239
- package/connect/chat.ts +0 -58
- package/connect/client.ts +0 -240
- package/connect/config.ts +0 -47
- package/connect/errors.ts +0 -121
- package/connect/oauth.ts +0 -265
- package/connect/routes.ts +0 -234
- package/connect/store.ts +0 -107
- package/mcp/handle.ts +0 -24
- package/mcp/index.ts +0 -76
- package/mcp/server.ts +0 -319
- package/mcp/tools/marketplace.ts +0 -439
- package/mcp/tools/memory-client.ts +0 -297
- package/mcp/tools/memory-config.ts +0 -32
- package/mcp/tools/memory.ts +0 -369
- package/mcp/tools/model-priority.ts +0 -88
- package/mcp/tools/openllm.ts +0 -883
- package/mcp/types.ts +0 -28
- package/openapi/call.ts +0 -90
- package/openapi/index.ts +0 -8
- package/openapi/openapi.json +0 -80213
- package/openapi/operations.ts +0 -2075
- package/protocol/CONTRIBUTING.md +0 -21
- package/protocol/README.md +0 -134
- package/protocol/access.ts +0 -186
- package/protocol/agent.ts +0 -991
- package/protocol/api-key-syntax.ts +0 -105
- package/protocol/assets/openllm-light.svg +0 -18
- package/protocol/assets/openllm.svg +0 -18
- package/protocol/audio.ts +0 -29
- package/protocol/auth.ts +0 -142
- package/protocol/changelog.ts +0 -155
- package/protocol/chat.ts +0 -458
- package/protocol/client-registry.ts +0 -356
- package/protocol/config.ts +0 -345
- package/protocol/cooldown-reason.ts +0 -78
- package/protocol/cost.ts +0 -10
- package/protocol/daemon-port.ts +0 -31
- package/protocol/daemon.ts +0 -1524
- package/protocol/default-chains.ts +0 -66
- package/protocol/device-state.ts +0 -85
- package/protocol/doctor-report.ts +0 -947
- package/protocol/errors.ts +0 -14
- package/protocol/image-edit-parse.ts +0 -263
- package/protocol/images.ts +0 -298
- package/protocol/index.ts +0 -74
- package/protocol/keepalive.ts +0 -69
- package/protocol/local-auth.ts +0 -300
- package/protocol/local-provider.ts +0 -288
- package/protocol/local-session.ts +0 -118
- package/protocol/marketplace.ts +0 -187
- package/protocol/media-bytes.ts +0 -28
- package/protocol/media-default.ts +0 -357
- package/protocol/media-input.ts +0 -61
- package/protocol/media-model.ts +0 -142
- package/protocol/media-types.ts +0 -70
- package/protocol/model-match.ts +0 -1051
- package/protocol/model-settings.ts +0 -327
- package/protocol/models.ts +0 -767
- package/protocol/mux.ts +0 -722
- package/protocol/provider-status.ts +0 -206
- package/protocol/provider-usage.ts +0 -263
- package/protocol/providers.ts +0 -901
- package/protocol/public-usage-index.ts +0 -354
- package/protocol/registry-pointer.ts +0 -118
- package/protocol/responses.ts +0 -280
- package/protocol/semver.ts +0 -182
- package/protocol/sha256-hex.ts +0 -98
- package/protocol/stats.ts +0 -406
- package/protocol/streaming.ts +0 -19
- package/protocol/subscription-provider-compat.ts +0 -104
- package/protocol/subscription-provider.ts +0 -32
- package/protocol/transcription-encoding.ts +0 -76
- package/protocol/url-locality.ts +0 -288
- package/protocol/video-job-plan.ts +0 -50
- package/protocol/videos.ts +0 -227
- package/tsconfig.json +0 -14
- package/tunnel/ARCHITECTURE.md +0 -111
- package/tunnel/assets/openllm-light.svg +0 -18
- package/tunnel/assets/openllm.svg +0 -18
- package/tunnel/channel-envelope.ts +0 -139
- package/tunnel/codec.ts +0 -191
- package/tunnel/device-anchor.ts +0 -229
- package/tunnel/device-control.ts +0 -118
- package/tunnel/device-grant.ts +0 -173
- package/tunnel/fleet.ts +0 -77
- package/tunnel/index.ts +0 -22
- package/tunnel/mux.ts +0 -580
- package/tunnel/peer-link.ts +0 -390
- package/tunnel/rtc-auth.ts +0 -415
- package/tunnel/rtc-duplex.ts +0 -187
- package/tunnel/rtc-ice.ts +0 -136
- package/tunnel/secure.ts +0 -1298
- package/tunnel/stream-reset-error.ts +0 -14
- package/tunnel/streams.ts +0 -1430
- package/tunnel/team-grant.ts +0 -302
- package/tunnel/wire-bytes.ts +0 -102
- package/vault/ARCHITECTURE.md +0 -470
- package/vault/api-key.ts +0 -190
- package/vault/cli-auth-seal.ts +0 -157
- package/vault/cred-seal.ts +0 -146
- package/vault/credential.ts +0 -55
- package/vault/crypto.ts +0 -210
- package/vault/daemon-attest.ts +0 -229
- package/vault/derive.ts +0 -113
- package/vault/device-access.ts +0 -87
- package/vault/device-anchor.ts +0 -185
- package/vault/handoff.ts +0 -396
- package/vault/index.ts +0 -21
- package/vault/pin.ts +0 -153
- package/vault/public-key-seal.ts +0 -131
- package/vault/seed.ts +0 -272
- package/vault/team.ts +0 -355
- package/vault/vault-item.ts +0 -131
- package/vault/vault-migrate-digest.ts +0 -29
- package/vault/wrapped.ts +0 -77
- package/wire/ARCHITECTURE.md +0 -90
- package/wire/CONTRIBUTING.md +0 -19
- package/wire/adapters/messages/anthropic-map.ts +0 -37
- package/wire/adapters/messages/index.ts +0 -7
- package/wire/adapters/messages/reasoning-from-items.ts +0 -38
- package/wire/adapters/messages/reasoning-signature.ts +0 -243
- package/wire/adapters/messages/request.ts +0 -574
- package/wire/adapters/messages/response.ts +0 -215
- package/wire/adapters/messages/streaming.ts +0 -1027
- package/wire/adapters/messages/usage.ts +0 -43
- package/wire/adapters/responses/index.ts +0 -3
- package/wire/adapters/responses/request.ts +0 -395
- package/wire/adapters/responses/response.ts +0 -88
- package/wire/adapters/responses/streaming.ts +0 -344
- package/wire/assets/openllm-light.svg +0 -18
- package/wire/assets/openllm.svg +0 -18
- package/wire/features/account-rank.ts +0 -166
- package/wire/features/compaction/compact-request.ts +0 -862
- package/wire/features/compaction/compaction-text.ts +0 -43
- package/wire/features/context-demote.ts +0 -47
- package/wire/features/context-overflow-strategy.ts +0 -26
- package/wire/features/conversation-affinity.ts +0 -144
- package/wire/features/max-tokens-backfill.ts +0 -141
- package/wire/features/model-caps.ts +0 -53
- package/wire/features/model-settings.ts +0 -24
- package/wire/features/output-limit-clamp.ts +0 -64
- package/wire/features/quota-gate.ts +0 -85
- package/wire/index.ts +0 -44
- package/wire/lib/attempt-outcome.ts +0 -43
- package/wire/lib/canonical/count-tokens-capability.ts +0 -138
- package/wire/lib/canonical/image-signature.ts +0 -202
- package/wire/lib/canonical/image-sse.ts +0 -216
- package/wire/lib/canonical/token-estimate.ts +0 -266
- package/wire/lib/encrypted-content.ts +0 -66
- package/wire/lib/error-class.ts +0 -154
- package/wire/lib/error-envelope.ts +0 -56
- package/wire/lib/provider-error-rules.ts +0 -48
- package/wire/lib/responses-apply-patch.ts +0 -104
- package/wire/lib/secret-scrub.ts +0 -101
- package/wire/lib/streaming/accumulate.ts +0 -221
- package/wire/lib/streaming/finish-reason.ts +0 -33
- package/wire/lib/streaming/provider-decode.ts +0 -259
- package/wire/lib/streaming/response-stream.ts +0 -71
- package/wire/lib/streaming/sse.ts +0 -699
- package/wire/lib/streaming/strip-tool-calls.ts +0 -95
- package/wire/lib/streaming/upstream-error.ts +0 -58
- package/wire/lib/strip-subagent-isolation.ts +0 -284
- package/wire/lib/token-ruler/bpe-core.ts +0 -426
- package/wire/lib/token-ruler/index.ts +0 -2
- package/wire/lib/token-ruler/ruler.ts +0 -79
- package/wire/lib/token-ruler/vocab/claude-ranks.ts +0 -16
- package/wire/lib/token-ruler/vocab/o200k-ranks.ts +0 -18
- package/wire/lib/token-ruler/vocab/o200k.ts +0 -19
- package/wire/lib/tool-name-map.ts +0 -271
- package/wire/lib/tool-schema.ts +0 -353
- package/wire/lib/usage-observer.ts +0 -125
- package/wire/providers/anthropic/adaptive-thinking.ts +0 -291
- package/wire/providers/anthropic/request.ts +0 -607
- package/wire/providers/anthropic/response.ts +0 -155
- package/wire/providers/anthropic/streaming.ts +0 -315
- package/wire/providers/anthropic/web-search-domains.ts +0 -49
- package/wire/providers/chatgpt/request.ts +0 -959
- package/wire/providers/chatgpt/streaming.ts +0 -1007
- package/wire/providers/chatgpt/web-search.ts +0 -63
- package/wire/providers/grok/web-search.ts +0 -87
- package/wire/providers/kimi/web-search.ts +0 -145
- package/wire/providers/upstream-deny.ts +0 -355
- package/wire/providers/upstream-request.ts +0 -619
- /package/{protocol/inference-headers.ts → dist/protocol/inference-headers.js} +0 -0
|
@@ -0,0 +1,1065 @@
|
|
|
1
|
+
import { Schema as S } from "effect";
|
|
2
|
+
export declare const ModelCapability: S.Literals<readonly ["chat", "embedding", "transcription", "speech", "image_generation", "image_editing", "video_generation", "realtime", "vision", "tools", "json_mode", "streaming", "reasoning"]>;
|
|
3
|
+
export type TModelCapability = S.Schema.Type<typeof ModelCapability>;
|
|
4
|
+
/**
|
|
5
|
+
* Capability literals published before image_editing/realtime. Bootstrap
|
|
6
|
+
* payloads sent to older daemons MUST be filtered to this set — a closed
|
|
7
|
+
* `ModelCapability` decoder rejects the entire catalog if it sees an
|
|
8
|
+
* unknown string.
|
|
9
|
+
*/
|
|
10
|
+
export declare const BOOTSTRAP_SAFE_MODEL_CAPABILITIES: readonly ["chat", "embedding", "transcription", "speech", "image_generation", "video_generation", "vision", "tools", "json_mode", "streaming", "reasoning"];
|
|
11
|
+
export declare const isBootstrapSafeModelCapability: (capability: string) => capability is (typeof BOOTSTRAP_SAFE_MODEL_CAPABILITIES)[number];
|
|
12
|
+
export declare const toBootstrapSafeCapabilities: (capabilities: ReadonlyArray<string>) => TModelCapability[];
|
|
13
|
+
/**
|
|
14
|
+
* Advertises that the requesting daemon's `DaemonCatalogEntry.capabilities`
|
|
15
|
+
* decoder accepts the OPEN string array (post image_editing/realtime
|
|
16
|
+
* widening) rather than the older closed {@link ModelCapability} literal
|
|
17
|
+
* set. Sent as the value of `DAEMON_BOOTSTRAP_CAPS_HEADER` (see
|
|
18
|
+
* `./daemon`) by a daemon binary compiled after the widening landed. An
|
|
19
|
+
* old compiled daemon never sends this — the bootstrap encoder MUST treat
|
|
20
|
+
* its absence as "closed literal decoder only" and filter via
|
|
21
|
+
* {@link toBootstrapSafeCapabilities}. Never inferred from a package/binary
|
|
22
|
+
* version string, which an unbumped daemon build would leave stale.
|
|
23
|
+
*/
|
|
24
|
+
export declare const MODEL_CAPABILITIES_OPEN_CAP = "model-capabilities-open1";
|
|
25
|
+
/** Returns whether a negotiated capability list includes {@link MODEL_CAPABILITIES_OPEN_CAP}. */
|
|
26
|
+
export declare const hasOpenModelCapabilitiesCap: (caps: readonly string[] | undefined) => boolean;
|
|
27
|
+
export declare const isKnownModelCapability: (capability: string) => capability is TModelCapability;
|
|
28
|
+
/**
|
|
29
|
+
* Discoverable audio/realtime option metadata. Presence on a catalog
|
|
30
|
+
* card is not a billing claim — subscription media may still consume
|
|
31
|
+
* vendor quota.
|
|
32
|
+
*/
|
|
33
|
+
export declare const ModelAudioSupport: S.Struct<{
|
|
34
|
+
readonly input_formats: S.optional<S.$Array<S.String>>;
|
|
35
|
+
readonly output_formats: S.optional<S.$Array<S.String>>;
|
|
36
|
+
readonly voices: S.optional<S.$Array<S.String>>;
|
|
37
|
+
/**
|
|
38
|
+
* Verified realtime operations only. Grok currently advertises
|
|
39
|
+
* `text_to_audio`; microphone / interruption legs are omitted until
|
|
40
|
+
* verified.
|
|
41
|
+
*/
|
|
42
|
+
readonly realtime_operations: S.optional<S.$Array<S.String>>;
|
|
43
|
+
}>;
|
|
44
|
+
export type TModelAudioSupport = S.Schema.Type<typeof ModelAudioSupport>;
|
|
45
|
+
/** Canonical reference fields shared by request schemas. */
|
|
46
|
+
export declare const VideoReferenceInputs: S.Struct<{
|
|
47
|
+
readonly input_image: S.optionalKey<S.String>;
|
|
48
|
+
readonly reference_images: S.decodeTo<S.optionalKey<S.$Array<S.String>>, S.optionalKey<S.$Array<S.String>>, never, never>;
|
|
49
|
+
readonly reference_voices: S.decodeTo<S.optionalKey<S.$Array<S.String>>, S.optionalKey<S.$Array<S.String>>, never, never>;
|
|
50
|
+
}>;
|
|
51
|
+
/** Finite receipt vocabulary; not an author-maintained model allowlist. */
|
|
52
|
+
export declare const VideoInputMode: S.Literals<readonly ["text", "starting_image", "subject_images", "voices", "starting_image+subject_images", "starting_image+voices", "subject_images+voices", "starting_image+subject_images+voices"]>;
|
|
53
|
+
export type TVideoInputMode = S.Schema.Type<typeof VideoInputMode>;
|
|
54
|
+
export declare const DEFAULT_TIER_ALIASES: readonly ["ultra", "plus", "lite"];
|
|
55
|
+
export declare const DefaultTier: S.Literals<readonly ["ultra", "plus", "lite"]>;
|
|
56
|
+
export type TDefaultTier = S.Schema.Type<typeof DefaultTier>;
|
|
57
|
+
/** Chat tiers plus the one implicit media default class (not a user alias). */
|
|
58
|
+
export declare const MEDIA_DEFAULT_CLASS = "media";
|
|
59
|
+
export declare const DEFAULT_CHAIN_CLASSES: readonly ["ultra", "plus", "lite", "media"];
|
|
60
|
+
export declare const DefaultChainClass: S.Literals<readonly ["ultra", "plus", "lite", "media"]>;
|
|
61
|
+
export type TDefaultChainClass = S.Schema.Type<typeof DefaultChainClass>;
|
|
62
|
+
/**
|
|
63
|
+
* Canonical classification of a *direct* catalog/live/custom card.
|
|
64
|
+
* `subscription` still consumes vendor quota (oauth variant). `api_key` is
|
|
65
|
+
* BYOK auth — not a claim that usage is metered. `local` is a
|
|
66
|
+
* device-discovered loopback server (cost 0, live-only). Omit on fallback
|
|
67
|
+
* aliases: mixed chains are neither a subscription guarantee nor
|
|
68
|
+
* API-key-only.
|
|
69
|
+
*/
|
|
70
|
+
export declare const ModelProviderType: S.Literals<readonly ["subscription", "api_key", "local"]>;
|
|
71
|
+
export type TModelProviderType = S.Schema.Type<typeof ModelProviderType>;
|
|
72
|
+
export declare const ModelCard: S.Struct<{
|
|
73
|
+
readonly id: S.String;
|
|
74
|
+
readonly object: S.Literals<readonly ["model"]>;
|
|
75
|
+
readonly created: S.Number;
|
|
76
|
+
readonly owned_by: S.String;
|
|
77
|
+
}>;
|
|
78
|
+
export type TModelCard = S.Schema.Type<typeof ModelCard>;
|
|
79
|
+
export declare const ModelList: S.Struct<{
|
|
80
|
+
readonly object: S.Literals<readonly ["list"]>;
|
|
81
|
+
readonly data: S.$Array<S.Struct<{
|
|
82
|
+
readonly id: S.String;
|
|
83
|
+
readonly object: S.Literals<readonly ["model"]>;
|
|
84
|
+
readonly created: S.Number;
|
|
85
|
+
readonly owned_by: S.String;
|
|
86
|
+
}>>;
|
|
87
|
+
}>;
|
|
88
|
+
export type TModelList = S.Schema.Type<typeof ModelList>;
|
|
89
|
+
export declare const ExtendedModelCard: S.Struct<{
|
|
90
|
+
readonly id: S.String;
|
|
91
|
+
readonly object: S.Literals<readonly ["model"]>;
|
|
92
|
+
readonly created: S.Number;
|
|
93
|
+
readonly owned_by: S.String;
|
|
94
|
+
readonly provider: S.String;
|
|
95
|
+
readonly provider_model_id: S.String;
|
|
96
|
+
readonly display_name: S.String;
|
|
97
|
+
readonly settings: S.optional<S.Struct<{
|
|
98
|
+
readonly service_tier: S.optional<S.Struct<{
|
|
99
|
+
readonly label: S.String;
|
|
100
|
+
readonly description: S.String;
|
|
101
|
+
readonly options: S.$Array<S.Struct<{
|
|
102
|
+
readonly value: S.Literals<readonly ["auto", "default", "flex", "priority"]>;
|
|
103
|
+
readonly label: S.String;
|
|
104
|
+
}>>;
|
|
105
|
+
readonly default: S.optional<S.Literals<readonly ["auto", "default", "flex", "priority"]>>;
|
|
106
|
+
readonly inherit_to_successors: S.optional<S.Boolean>;
|
|
107
|
+
}>>;
|
|
108
|
+
readonly input_token_limit: S.optional<S.Struct<{
|
|
109
|
+
readonly label: S.String;
|
|
110
|
+
readonly description: S.String;
|
|
111
|
+
readonly options: S.$Array<S.Struct<{
|
|
112
|
+
readonly value: S.Int;
|
|
113
|
+
readonly label: S.String;
|
|
114
|
+
}>>;
|
|
115
|
+
readonly reported: S.optional<S.Int>;
|
|
116
|
+
}>>;
|
|
117
|
+
readonly min_reasoning_effort: S.optional<S.Struct<{
|
|
118
|
+
readonly label: S.String;
|
|
119
|
+
readonly description: S.String;
|
|
120
|
+
readonly options: S.$Array<S.Struct<{
|
|
121
|
+
readonly value: S.Literals<readonly ["low", "medium", "high", "xhigh"]>;
|
|
122
|
+
readonly label: S.String;
|
|
123
|
+
}>>;
|
|
124
|
+
}>>;
|
|
125
|
+
}>>;
|
|
126
|
+
readonly capabilities: S.$Array<S.Literals<readonly ["chat", "embedding", "transcription", "speech", "image_generation", "image_editing", "video_generation", "realtime", "vision", "tools", "json_mode", "streaming", "reasoning"]>>;
|
|
127
|
+
/**
|
|
128
|
+
* Optional audio/realtime support advertised on `/v1/models`. Catalog
|
|
129
|
+
* capability is access, not billing inclusion.
|
|
130
|
+
*/
|
|
131
|
+
readonly audio_support: S.optional<S.Struct<{
|
|
132
|
+
readonly input_formats: S.optional<S.$Array<S.String>>;
|
|
133
|
+
readonly output_formats: S.optional<S.$Array<S.String>>;
|
|
134
|
+
readonly voices: S.optional<S.$Array<S.String>>;
|
|
135
|
+
/**
|
|
136
|
+
* Verified realtime operations only. Grok currently advertises
|
|
137
|
+
* `text_to_audio`; microphone / interruption legs are omitted until
|
|
138
|
+
* verified.
|
|
139
|
+
*/
|
|
140
|
+
readonly realtime_operations: S.optional<S.$Array<S.String>>;
|
|
141
|
+
}>>;
|
|
142
|
+
readonly dimension_presets: S.optional<S.$Array<S.Number>>;
|
|
143
|
+
readonly max_input_tokens: S.optional<S.Number>;
|
|
144
|
+
readonly max_output_tokens: S.optional<S.Number>;
|
|
145
|
+
/**
|
|
146
|
+
* Direct-card auth class. Absent on fallback aliases. `api_key` is
|
|
147
|
+
* not necessarily usage-billed.
|
|
148
|
+
*/
|
|
149
|
+
readonly provider_type: S.optional<S.Literals<readonly ["subscription", "api_key", "local"]>>;
|
|
150
|
+
/**
|
|
151
|
+
* Daemon-only variant when `provider_type` is `subscription` (`oauth`)
|
|
152
|
+
* or `local` (`local`). Absent on API-key cards and mixed aliases.
|
|
153
|
+
*/
|
|
154
|
+
readonly provider_variant: S.optional<S.Literals<readonly ["oauth", "local", "local_key"]>>;
|
|
155
|
+
/**
|
|
156
|
+
* Catalog default-chain membership + rank, so clients can apply the
|
|
157
|
+
* same ordering policy as the server without importing the catalog.
|
|
158
|
+
*/
|
|
159
|
+
readonly default_tiers: S.optional<S.$Array<S.Literals<readonly ["ultra", "plus", "lite", "media"]>>>;
|
|
160
|
+
readonly tier_rank: S.optional<S.Number>;
|
|
161
|
+
/** Prompt/context budget; equals `max_input_tokens` when present. */
|
|
162
|
+
readonly context_window: S.optional<S.Number>;
|
|
163
|
+
readonly meta: S.optional<S.Struct<{
|
|
164
|
+
readonly n_ctx: S.optional<S.Number>;
|
|
165
|
+
}>>;
|
|
166
|
+
}>;
|
|
167
|
+
export type TExtendedModelCard = S.Schema.Type<typeof ExtendedModelCard>;
|
|
168
|
+
export declare const ExtendedModelList: S.Struct<{
|
|
169
|
+
readonly object: S.Literals<readonly ["list"]>;
|
|
170
|
+
readonly data: S.$Array<S.Struct<{
|
|
171
|
+
readonly id: S.String;
|
|
172
|
+
readonly object: S.Literals<readonly ["model"]>;
|
|
173
|
+
readonly created: S.Number;
|
|
174
|
+
readonly owned_by: S.String;
|
|
175
|
+
readonly provider: S.String;
|
|
176
|
+
readonly provider_model_id: S.String;
|
|
177
|
+
readonly display_name: S.String;
|
|
178
|
+
readonly settings: S.optional<S.Struct<{
|
|
179
|
+
readonly service_tier: S.optional<S.Struct<{
|
|
180
|
+
readonly label: S.String;
|
|
181
|
+
readonly description: S.String;
|
|
182
|
+
readonly options: S.$Array<S.Struct<{
|
|
183
|
+
readonly value: S.Literals<readonly ["auto", "default", "flex", "priority"]>;
|
|
184
|
+
readonly label: S.String;
|
|
185
|
+
}>>;
|
|
186
|
+
readonly default: S.optional<S.Literals<readonly ["auto", "default", "flex", "priority"]>>;
|
|
187
|
+
readonly inherit_to_successors: S.optional<S.Boolean>;
|
|
188
|
+
}>>;
|
|
189
|
+
readonly input_token_limit: S.optional<S.Struct<{
|
|
190
|
+
readonly label: S.String;
|
|
191
|
+
readonly description: S.String;
|
|
192
|
+
readonly options: S.$Array<S.Struct<{
|
|
193
|
+
readonly value: S.Int;
|
|
194
|
+
readonly label: S.String;
|
|
195
|
+
}>>;
|
|
196
|
+
readonly reported: S.optional<S.Int>;
|
|
197
|
+
}>>;
|
|
198
|
+
readonly min_reasoning_effort: S.optional<S.Struct<{
|
|
199
|
+
readonly label: S.String;
|
|
200
|
+
readonly description: S.String;
|
|
201
|
+
readonly options: S.$Array<S.Struct<{
|
|
202
|
+
readonly value: S.Literals<readonly ["low", "medium", "high", "xhigh"]>;
|
|
203
|
+
readonly label: S.String;
|
|
204
|
+
}>>;
|
|
205
|
+
}>>;
|
|
206
|
+
}>>;
|
|
207
|
+
readonly capabilities: S.$Array<S.Literals<readonly ["chat", "embedding", "transcription", "speech", "image_generation", "image_editing", "video_generation", "realtime", "vision", "tools", "json_mode", "streaming", "reasoning"]>>;
|
|
208
|
+
/**
|
|
209
|
+
* Optional audio/realtime support advertised on `/v1/models`. Catalog
|
|
210
|
+
* capability is access, not billing inclusion.
|
|
211
|
+
*/
|
|
212
|
+
readonly audio_support: S.optional<S.Struct<{
|
|
213
|
+
readonly input_formats: S.optional<S.$Array<S.String>>;
|
|
214
|
+
readonly output_formats: S.optional<S.$Array<S.String>>;
|
|
215
|
+
readonly voices: S.optional<S.$Array<S.String>>;
|
|
216
|
+
/**
|
|
217
|
+
* Verified realtime operations only. Grok currently advertises
|
|
218
|
+
* `text_to_audio`; microphone / interruption legs are omitted until
|
|
219
|
+
* verified.
|
|
220
|
+
*/
|
|
221
|
+
readonly realtime_operations: S.optional<S.$Array<S.String>>;
|
|
222
|
+
}>>;
|
|
223
|
+
readonly dimension_presets: S.optional<S.$Array<S.Number>>;
|
|
224
|
+
readonly max_input_tokens: S.optional<S.Number>;
|
|
225
|
+
readonly max_output_tokens: S.optional<S.Number>;
|
|
226
|
+
/**
|
|
227
|
+
* Direct-card auth class. Absent on fallback aliases. `api_key` is
|
|
228
|
+
* not necessarily usage-billed.
|
|
229
|
+
*/
|
|
230
|
+
readonly provider_type: S.optional<S.Literals<readonly ["subscription", "api_key", "local"]>>;
|
|
231
|
+
/**
|
|
232
|
+
* Daemon-only variant when `provider_type` is `subscription` (`oauth`)
|
|
233
|
+
* or `local` (`local`). Absent on API-key cards and mixed aliases.
|
|
234
|
+
*/
|
|
235
|
+
readonly provider_variant: S.optional<S.Literals<readonly ["oauth", "local", "local_key"]>>;
|
|
236
|
+
/**
|
|
237
|
+
* Catalog default-chain membership + rank, so clients can apply the
|
|
238
|
+
* same ordering policy as the server without importing the catalog.
|
|
239
|
+
*/
|
|
240
|
+
readonly default_tiers: S.optional<S.$Array<S.Literals<readonly ["ultra", "plus", "lite", "media"]>>>;
|
|
241
|
+
readonly tier_rank: S.optional<S.Number>;
|
|
242
|
+
/** Prompt/context budget; equals `max_input_tokens` when present. */
|
|
243
|
+
readonly context_window: S.optional<S.Number>;
|
|
244
|
+
readonly meta: S.optional<S.Struct<{
|
|
245
|
+
readonly n_ctx: S.optional<S.Number>;
|
|
246
|
+
}>>;
|
|
247
|
+
}>>;
|
|
248
|
+
}>;
|
|
249
|
+
export type TExtendedModelList = S.Schema.Type<typeof ExtendedModelList>;
|
|
250
|
+
export declare const ModelPricing: S.Struct<{
|
|
251
|
+
readonly input_per_million: S.optional<S.Number>;
|
|
252
|
+
readonly output_per_million: S.optional<S.Number>;
|
|
253
|
+
readonly cache_read_per_million: S.optional<S.Number>;
|
|
254
|
+
readonly cache_write_per_million: S.optional<S.Number>;
|
|
255
|
+
readonly image_input_per_unit: S.optional<S.Number>;
|
|
256
|
+
readonly audio_input_per_minute: S.optional<S.Number>;
|
|
257
|
+
}>;
|
|
258
|
+
export type TModelPricing = S.Schema.Type<typeof ModelPricing>;
|
|
259
|
+
export declare const PricingEntry: S.Struct<{
|
|
260
|
+
readonly input_per_million: S.optional<S.Number>;
|
|
261
|
+
readonly output_per_million: S.optional<S.Number>;
|
|
262
|
+
readonly cache_read_per_million: S.optional<S.Number>;
|
|
263
|
+
readonly cache_write_per_million: S.optional<S.Number>;
|
|
264
|
+
readonly image_input_per_unit: S.optional<S.Number>;
|
|
265
|
+
readonly audio_input_per_minute: S.optional<S.Number>;
|
|
266
|
+
readonly model_id: S.String;
|
|
267
|
+
readonly provider: S.String;
|
|
268
|
+
}>;
|
|
269
|
+
export type TPricingEntry = S.Schema.Type<typeof PricingEntry>;
|
|
270
|
+
export declare const SubscriptionMeter: S.Struct<{
|
|
271
|
+
/**
|
|
272
|
+
* Stable provider-namespaced machine id — "claude_code:fable",
|
|
273
|
+
* "chatgpt:codex-spark". Never a display label.
|
|
274
|
+
*/
|
|
275
|
+
readonly meter_id: S.String;
|
|
276
|
+
/**
|
|
277
|
+
* Exact vendor-payload identities that resolve to this meter (Claude
|
|
278
|
+
* scope display_name + legacy key; Codex limit_name + metered_feature).
|
|
279
|
+
* Matched exactly, never fuzzy.
|
|
280
|
+
*/
|
|
281
|
+
readonly aliases: S.optional<S.$Array<S.String>>;
|
|
282
|
+
}>;
|
|
283
|
+
export type TSubscriptionMeter = S.Schema.Type<typeof SubscriptionMeter>;
|
|
284
|
+
/**
|
|
285
|
+
* Per-model / per-family facts an adapter cannot derive from the wire.
|
|
286
|
+
*
|
|
287
|
+
* This is the ONE carrier: it already rides `ExtendedModel.caps` to chat
|
|
288
|
+
* (`TBuildUpstreamRequestInput.caps`, `TResolvedHop.caps`) AND to media
|
|
289
|
+
* (`TResolvedModel.caps`), so adapters consume resolved traits instead
|
|
290
|
+
* of matching model ids themselves. Do not add a parallel structure.
|
|
291
|
+
*
|
|
292
|
+
* EVERY field is optional and absent means UNKNOWN, which must behave as
|
|
293
|
+
* ALLOW/ATTEMPT — never inferred-unsupported. A model we do not
|
|
294
|
+
* recognise (a custom endpoint, a passthrough vendor, something the
|
|
295
|
+
* provider ships tomorrow) is forwarded untouched. Populate only from a
|
|
296
|
+
* vendor's published contract, never from an observed upstream error: a
|
|
297
|
+
* rejection can mean a malformed body rather than a missing capability.
|
|
298
|
+
*
|
|
299
|
+
* Provider-WIDE request domains (enums, integer ranges, array bounds)
|
|
300
|
+
* belong in the shared schema layer, not here. This struct carries only
|
|
301
|
+
* facts that genuinely vary BY MODEL within a provider.
|
|
302
|
+
*/
|
|
303
|
+
export declare const ModelCaps: S.Struct<{
|
|
304
|
+
readonly deniedParams: S.optional<S.$Array<S.String>>;
|
|
305
|
+
readonly maxTokensField: S.optional<S.Literals<readonly ["max_tokens", "max_completion_tokens"]>>;
|
|
306
|
+
readonly temperature: S.optional<S.Literals<readonly ["only-1", "clamp-0-1", "drop"]>>;
|
|
307
|
+
/**
|
|
308
|
+
* Thinking modes this model accepts. Support is non-monotonic within a
|
|
309
|
+
* family (4.5 extended-only → 4.6 both → 4.7+ adaptive-only), so a
|
|
310
|
+
* boolean or a name prefix cannot encode it.
|
|
311
|
+
*
|
|
312
|
+
* `supportsAdaptiveThinking` = includes("adaptive");
|
|
313
|
+
* `rejectsExtendedThinking` = present AND !includes("enabled").
|
|
314
|
+
* Absent/empty stays permissive on BOTH, so an unknown model never
|
|
315
|
+
* manufactures a local validation error the upstream might accept.
|
|
316
|
+
*/
|
|
317
|
+
readonly thinkingModes: S.optional<S.$Array<S.Literals<readonly ["enabled", "adaptive", "disabled"]>>>;
|
|
318
|
+
/**
|
|
319
|
+
* Values this model accepts for the Responses `reasoning.context` knob.
|
|
320
|
+
*
|
|
321
|
+
* The Codex `spark` family 400s on `all_turns` and accepts only `auto` /
|
|
322
|
+
* `current_turn`; every other Codex model REQUIRES `all_turns`. The knob is
|
|
323
|
+
* nested under `reasoning`, so `deniedParams` (which addresses top-level
|
|
324
|
+
* keys) cannot express it — hence a trait of its own.
|
|
325
|
+
*
|
|
326
|
+
* An accepted-VALUE LIST rather than a boolean, matching `thinkingModes` /
|
|
327
|
+
* `videoResolutions`: absent = unknown = PERMISSIVE, so an un-catalogued id
|
|
328
|
+
* keeps the `all_turns` every non-spark Codex model needs and no adapter
|
|
329
|
+
* invents a restriction the upstream might not have.
|
|
330
|
+
*/
|
|
331
|
+
readonly reasoningContexts: S.optional<S.$Array<S.Literals<readonly ["auto", "current_turn", "all_turns"]>>>;
|
|
332
|
+
/**
|
|
333
|
+
* Whether this model accepts a `tool_addition` block inline in an
|
|
334
|
+
* inline system turn (`inline-tools-2026-09-15`, sent by Claude Code when a
|
|
335
|
+
* tool appears mid-session). Not derivable from family or version — measured
|
|
336
|
+
* live by `tests/server/inline-system-capability.e2e.test.ts`. When false the
|
|
337
|
+
* passthrough moves the tool definition into top-level `tools` instead
|
|
338
|
+
* (one cache rebuild per added tool). Absent = unknown = PERMISSIVE: the
|
|
339
|
+
* block is forwarded as the client sent it.
|
|
340
|
+
*/
|
|
341
|
+
readonly inlineToolAdditions: S.optional<S.Boolean>;
|
|
342
|
+
/**
|
|
343
|
+
* Whether this model accepts a mid-conversation `role: "system"` turn in
|
|
344
|
+
* `messages` natively (Anthropic "mid-conversation system messages"; no
|
|
345
|
+
* beta header). When true the anthropic passthrough forwards those turns
|
|
346
|
+
* untouched, which is what keeps the prompt cache warm: the cache prefix is
|
|
347
|
+
* `tools → system → messages`, so hoisting a NEW inline turn into top-level
|
|
348
|
+
* `system` invalidates every cached message after it (a full-conversation
|
|
349
|
+
* cache rewrite each time Claude Code appends a reminder). Measured live by
|
|
350
|
+
* `tests/server/inline-system-capability.e2e.test.ts`; the API docs list the
|
|
351
|
+
* supporting models. Absent = unknown = HOIST: the inline turns move into
|
|
352
|
+
* top-level `system`, which every Anthropic model accepts — correct but
|
|
353
|
+
* cache-hostile, so mark every model that accepts the inline form.
|
|
354
|
+
*/
|
|
355
|
+
readonly inlineSystemMessages: S.optional<S.Boolean>;
|
|
356
|
+
/**
|
|
357
|
+
* Whether `response_format` is a real knob on this model's upstream.
|
|
358
|
+
* When false the adapter OMITS the field — this is NOT a refusal: the
|
|
359
|
+
* gateway persists every image and builds `data[]` itself, so the
|
|
360
|
+
* caller's choice is still honoured.
|
|
361
|
+
*/
|
|
362
|
+
readonly upstreamAcceptsResponseFormat: S.optional<S.Boolean>;
|
|
363
|
+
/**
|
|
364
|
+
* Whether `stream` is a real knob on this model's upstream image request.
|
|
365
|
+
* When false the adapter OMITS the field — NOT a refusal: the gateway wraps
|
|
366
|
+
* the final JSON in one genuine SSE completion event itself, so a streaming
|
|
367
|
+
* caller is still served.
|
|
368
|
+
*
|
|
369
|
+
* DISTINCT from `nativeProgressiveImages`, deliberately. That trait says
|
|
370
|
+
* whether real partial frames exist; this one says whether the request field
|
|
371
|
+
* is accepted at all. A vendor can accept `stream` and answer with a single
|
|
372
|
+
* final frame, and a model can emit partials on a wire that spells the knob
|
|
373
|
+
* differently — so conflating them would either leak an unknown param into a
|
|
374
|
+
* guaranteed 400 or silently stop streaming for a provider that streams.
|
|
375
|
+
*/
|
|
376
|
+
readonly upstreamAcceptsStream: S.optional<S.Boolean>;
|
|
377
|
+
/** `style` (vivid|natural). False is a genuine pre-dispatch refusal. */
|
|
378
|
+
readonly supportsStyle: S.optional<S.Boolean>;
|
|
379
|
+
/** GPT-image output group: output_format, output_compression, moderation, background. */
|
|
380
|
+
readonly supportsGptImageOutputOptions: S.optional<S.Boolean>;
|
|
381
|
+
/** Upstream always returns base64, which is what makes omitting `response_format` safe. */
|
|
382
|
+
readonly alwaysReturnsBase64: S.optional<S.Boolean>;
|
|
383
|
+
/**
|
|
384
|
+
* Whether the model emits genuinely PROGRESSIVE image bytes upstream.
|
|
385
|
+
*
|
|
386
|
+
* This does NOT gate whether the gateway will stream: the gateway
|
|
387
|
+
* always supports an honest SSE response and emits a single real
|
|
388
|
+
* completion event for a final-only provider. This trait only says
|
|
389
|
+
* whether real partial frames can be forwarded — so a provider that
|
|
390
|
+
* cannot produce them degrades honestly instead of us fabricating
|
|
391
|
+
* partials from a buffered final image.
|
|
392
|
+
*/
|
|
393
|
+
readonly nativeProgressiveImages: S.optional<S.Boolean>;
|
|
394
|
+
/** Upper bound on genuine partial frames, when the model emits them. */
|
|
395
|
+
readonly maxNativePartialImages: S.optional<S.Number>;
|
|
396
|
+
/**
|
|
397
|
+
* Which upstream wire serves this model, when one provider exposes
|
|
398
|
+
* more than one. Lets an adapter refuse a model it structurally
|
|
399
|
+
* cannot carry (a `predict`-family id handed to a `generateContent`
|
|
400
|
+
* adapter) WITHOUT any claim about that model's availability.
|
|
401
|
+
*/
|
|
402
|
+
readonly nativeWire: S.optional<S.Literals<readonly ["generateContent", "predict"]>>;
|
|
403
|
+
/**
|
|
404
|
+
* Output resolutions this specific model serves.
|
|
405
|
+
*/
|
|
406
|
+
readonly videoResolutions: S.optional<S.$Array<S.String>>;
|
|
407
|
+
/** Exact clip lengths accepted, e.g. Veo's [4, 6, 8]. */
|
|
408
|
+
readonly mediaVideoDurationsSeconds: S.optional<S.$Array<S.Number>>;
|
|
409
|
+
/** Inclusive duration bounds, for a surface that takes a range. */
|
|
410
|
+
readonly mediaVideoDurationRange: S.optional<S.Struct<{
|
|
411
|
+
readonly min: S.Number;
|
|
412
|
+
readonly max: S.Number;
|
|
413
|
+
}>>;
|
|
414
|
+
/**
|
|
415
|
+
* Duration this model REQUIRES when the request carries reference
|
|
416
|
+
* images or a high resolution. Applies only to a duration the caller
|
|
417
|
+
* actually sent: an omitted duration stays omitted so the provider's
|
|
418
|
+
* own default applies.
|
|
419
|
+
*/
|
|
420
|
+
readonly mediaVideoDurationWithReferences: S.optional<S.Number>;
|
|
421
|
+
/** Accepted output aspect ratios, in the provider's own spelling. */
|
|
422
|
+
readonly mediaVideoAspectRatios: S.optional<S.$Array<S.String>>;
|
|
423
|
+
/** Upper bound on subject-reference images. */
|
|
424
|
+
readonly mediaVideoMaxReferenceImages: S.optional<S.Number>;
|
|
425
|
+
/** Upper bound on voice/audio references. */
|
|
426
|
+
readonly mediaVideoMaxReferenceVoices: S.optional<S.Number>;
|
|
427
|
+
/** Reference-type discriminator this surface accepts (e.g. "asset"). */
|
|
428
|
+
readonly mediaVideoReferenceType: S.optional<S.String>;
|
|
429
|
+
/** True when a starting frame and subject references are exclusive. */
|
|
430
|
+
readonly mediaVideoStartingImageExclusiveWithReferences: S.optional<S.Boolean>;
|
|
431
|
+
/** Accepted image aspect ratios, in the provider's own spelling. */
|
|
432
|
+
readonly mediaImageAspectRatios: S.optional<S.$Array<S.String>>;
|
|
433
|
+
/** Accepted image resolution tier names, e.g. ["1k", "2k", "1.5k"]. */
|
|
434
|
+
readonly mediaImageResolutions: S.optional<S.$Array<S.String>>;
|
|
435
|
+
/**
|
|
436
|
+
* Published pixel meaning of a tier, e.g. 1k = ~1024 long edge. Only
|
|
437
|
+
* tiers with a DOCUMENTED size belong here: a tier the vendor names
|
|
438
|
+
* without defining is left out so no caller size maps onto it.
|
|
439
|
+
*/
|
|
440
|
+
readonly mediaImageResolutionTiers: S.optional<S.$Array<S.Struct<{
|
|
441
|
+
readonly resolution: S.String;
|
|
442
|
+
readonly longEdge: S.Number;
|
|
443
|
+
}>>>;
|
|
444
|
+
/** Tier applied when the caller sends no size. */
|
|
445
|
+
readonly mediaImageDefaultResolution: S.optional<S.String>;
|
|
446
|
+
/**
|
|
447
|
+
* Canonical `WIDTHxHEIGHT` → provider aspect-ratio map, for a surface
|
|
448
|
+
* that takes a ratio rather than pixels.
|
|
449
|
+
*/
|
|
450
|
+
readonly mediaImageSizeAspectRatios: S.optional<S.$Record<S.String, S.String>>;
|
|
451
|
+
/** Inclusive bounds on the image count per request. */
|
|
452
|
+
readonly mediaImageCountRange: S.optional<S.Struct<{
|
|
453
|
+
readonly min: S.Number;
|
|
454
|
+
readonly max: S.Number;
|
|
455
|
+
}>>;
|
|
456
|
+
/**
|
|
457
|
+
* Which ruler counts this model's tokens. One model fact that is
|
|
458
|
+
* currently re-derived three different ways — by client surface
|
|
459
|
+
* (`canonical/encoding-select`), by upstream wire (the daemon walker),
|
|
460
|
+
* and by `provider === "anthropic"` (`handlers/count-tokens`). That
|
|
461
|
+
* last one misses subscription twins: a `claude_code/*` hop is a
|
|
462
|
+
* Claude model with provider `claude_code`, so it is counted with
|
|
463
|
+
* o200k against a Claude ruler.
|
|
464
|
+
*
|
|
465
|
+
* Absent keeps each consumer's existing default, so adopting this is
|
|
466
|
+
* incremental and never changes a count until a card declares one.
|
|
467
|
+
*/
|
|
468
|
+
readonly tokenizer: S.optional<S.Literals<readonly ["claude", "o200k"]>>;
|
|
469
|
+
}>;
|
|
470
|
+
export type TModelCaps = S.Schema.Type<typeof ModelCaps>;
|
|
471
|
+
/**
|
|
472
|
+
* A catalog-owned DEFAULT for models that have no card.
|
|
473
|
+
*
|
|
474
|
+
* The un-catalogued set is open-ended — every dated snapshot, every id a
|
|
475
|
+
* user pins, everything a vendor ships next — so it cannot be covered by
|
|
476
|
+
* cards without becoming the exhaustive allowlist we deliberately do not
|
|
477
|
+
* keep. These rules close that gap without one: the catalog owns the
|
|
478
|
+
* DATA (which family, which caps) and every consumer runs the same
|
|
479
|
+
* generic matcher, so no adapter matches a model id itself.
|
|
480
|
+
*
|
|
481
|
+
* `pattern` is a regular-expression SOURCE matched case-insensitively
|
|
482
|
+
* against the bare `provider_model_id`. Rules are consulted in order and
|
|
483
|
+
* the FIRST match wins; a card, when one exists, always outranks them.
|
|
484
|
+
* Absent/no-match stays UNKNOWN, preserving default-allow.
|
|
485
|
+
*/
|
|
486
|
+
export declare const ModelCapsDefaultRule: S.Struct<{
|
|
487
|
+
readonly provider: S.String;
|
|
488
|
+
readonly pattern: S.String;
|
|
489
|
+
readonly caps: S.Struct<{
|
|
490
|
+
readonly deniedParams: S.optional<S.$Array<S.String>>;
|
|
491
|
+
readonly maxTokensField: S.optional<S.Literals<readonly ["max_tokens", "max_completion_tokens"]>>;
|
|
492
|
+
readonly temperature: S.optional<S.Literals<readonly ["only-1", "clamp-0-1", "drop"]>>;
|
|
493
|
+
/**
|
|
494
|
+
* Thinking modes this model accepts. Support is non-monotonic within a
|
|
495
|
+
* family (4.5 extended-only → 4.6 both → 4.7+ adaptive-only), so a
|
|
496
|
+
* boolean or a name prefix cannot encode it.
|
|
497
|
+
*
|
|
498
|
+
* `supportsAdaptiveThinking` = includes("adaptive");
|
|
499
|
+
* `rejectsExtendedThinking` = present AND !includes("enabled").
|
|
500
|
+
* Absent/empty stays permissive on BOTH, so an unknown model never
|
|
501
|
+
* manufactures a local validation error the upstream might accept.
|
|
502
|
+
*/
|
|
503
|
+
readonly thinkingModes: S.optional<S.$Array<S.Literals<readonly ["enabled", "adaptive", "disabled"]>>>;
|
|
504
|
+
/**
|
|
505
|
+
* Values this model accepts for the Responses `reasoning.context` knob.
|
|
506
|
+
*
|
|
507
|
+
* The Codex `spark` family 400s on `all_turns` and accepts only `auto` /
|
|
508
|
+
* `current_turn`; every other Codex model REQUIRES `all_turns`. The knob is
|
|
509
|
+
* nested under `reasoning`, so `deniedParams` (which addresses top-level
|
|
510
|
+
* keys) cannot express it — hence a trait of its own.
|
|
511
|
+
*
|
|
512
|
+
* An accepted-VALUE LIST rather than a boolean, matching `thinkingModes` /
|
|
513
|
+
* `videoResolutions`: absent = unknown = PERMISSIVE, so an un-catalogued id
|
|
514
|
+
* keeps the `all_turns` every non-spark Codex model needs and no adapter
|
|
515
|
+
* invents a restriction the upstream might not have.
|
|
516
|
+
*/
|
|
517
|
+
readonly reasoningContexts: S.optional<S.$Array<S.Literals<readonly ["auto", "current_turn", "all_turns"]>>>;
|
|
518
|
+
/**
|
|
519
|
+
* Whether this model accepts a `tool_addition` block inline in an
|
|
520
|
+
* inline system turn (`inline-tools-2026-09-15`, sent by Claude Code when a
|
|
521
|
+
* tool appears mid-session). Not derivable from family or version — measured
|
|
522
|
+
* live by `tests/server/inline-system-capability.e2e.test.ts`. When false the
|
|
523
|
+
* passthrough moves the tool definition into top-level `tools` instead
|
|
524
|
+
* (one cache rebuild per added tool). Absent = unknown = PERMISSIVE: the
|
|
525
|
+
* block is forwarded as the client sent it.
|
|
526
|
+
*/
|
|
527
|
+
readonly inlineToolAdditions: S.optional<S.Boolean>;
|
|
528
|
+
/**
|
|
529
|
+
* Whether this model accepts a mid-conversation `role: "system"` turn in
|
|
530
|
+
* `messages` natively (Anthropic "mid-conversation system messages"; no
|
|
531
|
+
* beta header). When true the anthropic passthrough forwards those turns
|
|
532
|
+
* untouched, which is what keeps the prompt cache warm: the cache prefix is
|
|
533
|
+
* `tools → system → messages`, so hoisting a NEW inline turn into top-level
|
|
534
|
+
* `system` invalidates every cached message after it (a full-conversation
|
|
535
|
+
* cache rewrite each time Claude Code appends a reminder). Measured live by
|
|
536
|
+
* `tests/server/inline-system-capability.e2e.test.ts`; the API docs list the
|
|
537
|
+
* supporting models. Absent = unknown = HOIST: the inline turns move into
|
|
538
|
+
* top-level `system`, which every Anthropic model accepts — correct but
|
|
539
|
+
* cache-hostile, so mark every model that accepts the inline form.
|
|
540
|
+
*/
|
|
541
|
+
readonly inlineSystemMessages: S.optional<S.Boolean>;
|
|
542
|
+
/**
|
|
543
|
+
* Whether `response_format` is a real knob on this model's upstream.
|
|
544
|
+
* When false the adapter OMITS the field — this is NOT a refusal: the
|
|
545
|
+
* gateway persists every image and builds `data[]` itself, so the
|
|
546
|
+
* caller's choice is still honoured.
|
|
547
|
+
*/
|
|
548
|
+
readonly upstreamAcceptsResponseFormat: S.optional<S.Boolean>;
|
|
549
|
+
/**
|
|
550
|
+
* Whether `stream` is a real knob on this model's upstream image request.
|
|
551
|
+
* When false the adapter OMITS the field — NOT a refusal: the gateway wraps
|
|
552
|
+
* the final JSON in one genuine SSE completion event itself, so a streaming
|
|
553
|
+
* caller is still served.
|
|
554
|
+
*
|
|
555
|
+
* DISTINCT from `nativeProgressiveImages`, deliberately. That trait says
|
|
556
|
+
* whether real partial frames exist; this one says whether the request field
|
|
557
|
+
* is accepted at all. A vendor can accept `stream` and answer with a single
|
|
558
|
+
* final frame, and a model can emit partials on a wire that spells the knob
|
|
559
|
+
* differently — so conflating them would either leak an unknown param into a
|
|
560
|
+
* guaranteed 400 or silently stop streaming for a provider that streams.
|
|
561
|
+
*/
|
|
562
|
+
readonly upstreamAcceptsStream: S.optional<S.Boolean>;
|
|
563
|
+
/** `style` (vivid|natural). False is a genuine pre-dispatch refusal. */
|
|
564
|
+
readonly supportsStyle: S.optional<S.Boolean>;
|
|
565
|
+
/** GPT-image output group: output_format, output_compression, moderation, background. */
|
|
566
|
+
readonly supportsGptImageOutputOptions: S.optional<S.Boolean>;
|
|
567
|
+
/** Upstream always returns base64, which is what makes omitting `response_format` safe. */
|
|
568
|
+
readonly alwaysReturnsBase64: S.optional<S.Boolean>;
|
|
569
|
+
/**
|
|
570
|
+
* Whether the model emits genuinely PROGRESSIVE image bytes upstream.
|
|
571
|
+
*
|
|
572
|
+
* This does NOT gate whether the gateway will stream: the gateway
|
|
573
|
+
* always supports an honest SSE response and emits a single real
|
|
574
|
+
* completion event for a final-only provider. This trait only says
|
|
575
|
+
* whether real partial frames can be forwarded — so a provider that
|
|
576
|
+
* cannot produce them degrades honestly instead of us fabricating
|
|
577
|
+
* partials from a buffered final image.
|
|
578
|
+
*/
|
|
579
|
+
readonly nativeProgressiveImages: S.optional<S.Boolean>;
|
|
580
|
+
/** Upper bound on genuine partial frames, when the model emits them. */
|
|
581
|
+
readonly maxNativePartialImages: S.optional<S.Number>;
|
|
582
|
+
/**
|
|
583
|
+
* Which upstream wire serves this model, when one provider exposes
|
|
584
|
+
* more than one. Lets an adapter refuse a model it structurally
|
|
585
|
+
* cannot carry (a `predict`-family id handed to a `generateContent`
|
|
586
|
+
* adapter) WITHOUT any claim about that model's availability.
|
|
587
|
+
*/
|
|
588
|
+
readonly nativeWire: S.optional<S.Literals<readonly ["generateContent", "predict"]>>;
|
|
589
|
+
/**
|
|
590
|
+
* Output resolutions this specific model serves.
|
|
591
|
+
*/
|
|
592
|
+
readonly videoResolutions: S.optional<S.$Array<S.String>>;
|
|
593
|
+
/** Exact clip lengths accepted, e.g. Veo's [4, 6, 8]. */
|
|
594
|
+
readonly mediaVideoDurationsSeconds: S.optional<S.$Array<S.Number>>;
|
|
595
|
+
/** Inclusive duration bounds, for a surface that takes a range. */
|
|
596
|
+
readonly mediaVideoDurationRange: S.optional<S.Struct<{
|
|
597
|
+
readonly min: S.Number;
|
|
598
|
+
readonly max: S.Number;
|
|
599
|
+
}>>;
|
|
600
|
+
/**
|
|
601
|
+
* Duration this model REQUIRES when the request carries reference
|
|
602
|
+
* images or a high resolution. Applies only to a duration the caller
|
|
603
|
+
* actually sent: an omitted duration stays omitted so the provider's
|
|
604
|
+
* own default applies.
|
|
605
|
+
*/
|
|
606
|
+
readonly mediaVideoDurationWithReferences: S.optional<S.Number>;
|
|
607
|
+
/** Accepted output aspect ratios, in the provider's own spelling. */
|
|
608
|
+
readonly mediaVideoAspectRatios: S.optional<S.$Array<S.String>>;
|
|
609
|
+
/** Upper bound on subject-reference images. */
|
|
610
|
+
readonly mediaVideoMaxReferenceImages: S.optional<S.Number>;
|
|
611
|
+
/** Upper bound on voice/audio references. */
|
|
612
|
+
readonly mediaVideoMaxReferenceVoices: S.optional<S.Number>;
|
|
613
|
+
/** Reference-type discriminator this surface accepts (e.g. "asset"). */
|
|
614
|
+
readonly mediaVideoReferenceType: S.optional<S.String>;
|
|
615
|
+
/** True when a starting frame and subject references are exclusive. */
|
|
616
|
+
readonly mediaVideoStartingImageExclusiveWithReferences: S.optional<S.Boolean>;
|
|
617
|
+
/** Accepted image aspect ratios, in the provider's own spelling. */
|
|
618
|
+
readonly mediaImageAspectRatios: S.optional<S.$Array<S.String>>;
|
|
619
|
+
/** Accepted image resolution tier names, e.g. ["1k", "2k", "1.5k"]. */
|
|
620
|
+
readonly mediaImageResolutions: S.optional<S.$Array<S.String>>;
|
|
621
|
+
/**
|
|
622
|
+
* Published pixel meaning of a tier, e.g. 1k = ~1024 long edge. Only
|
|
623
|
+
* tiers with a DOCUMENTED size belong here: a tier the vendor names
|
|
624
|
+
* without defining is left out so no caller size maps onto it.
|
|
625
|
+
*/
|
|
626
|
+
readonly mediaImageResolutionTiers: S.optional<S.$Array<S.Struct<{
|
|
627
|
+
readonly resolution: S.String;
|
|
628
|
+
readonly longEdge: S.Number;
|
|
629
|
+
}>>>;
|
|
630
|
+
/** Tier applied when the caller sends no size. */
|
|
631
|
+
readonly mediaImageDefaultResolution: S.optional<S.String>;
|
|
632
|
+
/**
|
|
633
|
+
* Canonical `WIDTHxHEIGHT` → provider aspect-ratio map, for a surface
|
|
634
|
+
* that takes a ratio rather than pixels.
|
|
635
|
+
*/
|
|
636
|
+
readonly mediaImageSizeAspectRatios: S.optional<S.$Record<S.String, S.String>>;
|
|
637
|
+
/** Inclusive bounds on the image count per request. */
|
|
638
|
+
readonly mediaImageCountRange: S.optional<S.Struct<{
|
|
639
|
+
readonly min: S.Number;
|
|
640
|
+
readonly max: S.Number;
|
|
641
|
+
}>>;
|
|
642
|
+
/**
|
|
643
|
+
* Which ruler counts this model's tokens. One model fact that is
|
|
644
|
+
* currently re-derived three different ways — by client surface
|
|
645
|
+
* (`canonical/encoding-select`), by upstream wire (the daemon walker),
|
|
646
|
+
* and by `provider === "anthropic"` (`handlers/count-tokens`). That
|
|
647
|
+
* last one misses subscription twins: a `claude_code/*` hop is a
|
|
648
|
+
* Claude model with provider `claude_code`, so it is counted with
|
|
649
|
+
* o200k against a Claude ruler.
|
|
650
|
+
*
|
|
651
|
+
* Absent keeps each consumer's existing default, so adopting this is
|
|
652
|
+
* incremental and never changes a count until a card declares one.
|
|
653
|
+
*/
|
|
654
|
+
readonly tokenizer: S.optional<S.Literals<readonly ["claude", "o200k"]>>;
|
|
655
|
+
}>;
|
|
656
|
+
}>;
|
|
657
|
+
export type TModelCapsDefaultRule = S.Schema.Type<typeof ModelCapsDefaultRule>;
|
|
658
|
+
/**
|
|
659
|
+
* Resolve family defaults for an un-catalogued `provider/model`.
|
|
660
|
+
*
|
|
661
|
+
* Pure and total: an invalid pattern is skipped rather than thrown, so a
|
|
662
|
+
* bad rule can never take down resolution for every model. Shared by the
|
|
663
|
+
* cloud resolver and the daemon walker so the two cannot drift.
|
|
664
|
+
*/
|
|
665
|
+
export declare const resolveDefaultModelCaps: (rules: ReadonlyArray<TModelCapsDefaultRule>, provider: string, providerModelId: string) => TModelCaps | undefined;
|
|
666
|
+
/**
|
|
667
|
+
* Fold a LIVE OBSERVATION into authored caps.
|
|
668
|
+
*
|
|
669
|
+
* Some facts are only knowable from a vendor's own live model list (an
|
|
670
|
+
* xAI row that omits `supports_reasoning_effort`). They are expressed in
|
|
671
|
+
* this same vocabulary so a consumer never learns a second policy shape,
|
|
672
|
+
* and they may only NARROW: `deniedParams` is a union (deduped, authored
|
|
673
|
+
* order first), so an observation can add a denial and can never clear
|
|
674
|
+
* one the catalog authored. Every other field takes the observation only
|
|
675
|
+
* where the authored caps said nothing.
|
|
676
|
+
*
|
|
677
|
+
* Pure, and the caller re-derives it per request — an observation is a
|
|
678
|
+
* snapshot, never accumulated state.
|
|
679
|
+
*/
|
|
680
|
+
export declare const mergeObservedModelCaps: (authored: TModelCaps | undefined, observed: TModelCaps | null | undefined) => TModelCaps | undefined;
|
|
681
|
+
/**
|
|
682
|
+
* Per-plan-tier monthly allowance for a model OpenLLM serves on its own key,
|
|
683
|
+
* as ONE budget in input-token units. Output and cache-read tokens are
|
|
684
|
+
* weighted by their price relative to fresh input — read from the model's
|
|
685
|
+
* `api_equivalent_pricing` by {@link includedWeights}, never authored
|
|
686
|
+
* separately — so the budget tracks what the tokens actually cost. Any
|
|
687
|
+
* input/output mix fits: all-input gets the full budget, all-output gets
|
|
688
|
+
* `budget / output weight`; output-heavy use can't beat the price ratio and
|
|
689
|
+
* input-heavy use is never cut early by an unused output cap.
|
|
690
|
+
* Tier keys mirror the billing tiers (`free` / `trial` / `pro`).
|
|
691
|
+
*/
|
|
692
|
+
export declare const IncludedUsage: S.Struct<{
|
|
693
|
+
readonly free: S.Int;
|
|
694
|
+
readonly trial: S.Int;
|
|
695
|
+
readonly pro: S.Int;
|
|
696
|
+
}>;
|
|
697
|
+
export type TIncludedUsage = S.Schema.Type<typeof IncludedUsage>;
|
|
698
|
+
/** Cost of one output / cache-read token, in fresh-input-token units. */
|
|
699
|
+
export type TIncludedWeights = {
|
|
700
|
+
readonly output: number;
|
|
701
|
+
readonly cacheRead: number;
|
|
702
|
+
};
|
|
703
|
+
/**
|
|
704
|
+
* Weights from a price sheet: `output_per_million / input_per_million` and
|
|
705
|
+
* `cache_read_per_million / input_per_million`. A missing price — or no
|
|
706
|
+
* positive input price to divide by — weighs 1 (charged like fresh input),
|
|
707
|
+
* which never under-charges.
|
|
708
|
+
*/
|
|
709
|
+
export declare const includedWeights: (pricing: TModelPricing | undefined) => TIncludedWeights;
|
|
710
|
+
/** Token counts one spend is computed from. */
|
|
711
|
+
export type TIncludedSpendTokens = {
|
|
712
|
+
/** Fresh (uncached) input tokens. */
|
|
713
|
+
readonly input: number;
|
|
714
|
+
readonly cachedInput: number;
|
|
715
|
+
readonly output: number;
|
|
716
|
+
};
|
|
717
|
+
/** Budget units spent, each token class at its price-derived weight. */
|
|
718
|
+
export declare const includedSpend: (pricing: TModelPricing | undefined, tokens: TIncludedSpendTokens) => number;
|
|
719
|
+
export declare const ExtendedModel: S.Struct<{
|
|
720
|
+
readonly settings: S.optional<S.Struct<{
|
|
721
|
+
readonly service_tier: S.optional<S.Struct<{
|
|
722
|
+
readonly label: S.String;
|
|
723
|
+
readonly description: S.String;
|
|
724
|
+
readonly options: S.$Array<S.Struct<{
|
|
725
|
+
readonly value: S.Literals<readonly ["auto", "default", "flex", "priority"]>;
|
|
726
|
+
readonly label: S.String;
|
|
727
|
+
}>>;
|
|
728
|
+
readonly default: S.optional<S.Literals<readonly ["auto", "default", "flex", "priority"]>>;
|
|
729
|
+
readonly inherit_to_successors: S.optional<S.Boolean>;
|
|
730
|
+
}>>;
|
|
731
|
+
readonly input_token_limit: S.optional<S.Struct<{
|
|
732
|
+
readonly label: S.String;
|
|
733
|
+
readonly description: S.String;
|
|
734
|
+
readonly options: S.$Array<S.Struct<{
|
|
735
|
+
readonly value: S.Int;
|
|
736
|
+
readonly label: S.String;
|
|
737
|
+
}>>;
|
|
738
|
+
readonly reported: S.optional<S.Int>;
|
|
739
|
+
}>>;
|
|
740
|
+
readonly min_reasoning_effort: S.optional<S.Struct<{
|
|
741
|
+
readonly label: S.String;
|
|
742
|
+
readonly description: S.String;
|
|
743
|
+
readonly options: S.$Array<S.Struct<{
|
|
744
|
+
readonly value: S.Literals<readonly ["low", "medium", "high", "xhigh"]>;
|
|
745
|
+
readonly label: S.String;
|
|
746
|
+
}>>;
|
|
747
|
+
}>>;
|
|
748
|
+
}>>;
|
|
749
|
+
readonly id: S.String;
|
|
750
|
+
readonly provider: S.String;
|
|
751
|
+
readonly provider_model_id: S.String;
|
|
752
|
+
readonly display_name: S.String;
|
|
753
|
+
readonly capabilities: S.$Array<S.Literals<readonly ["chat", "embedding", "transcription", "speech", "image_generation", "image_editing", "video_generation", "realtime", "vision", "tools", "json_mode", "streaming", "reasoning"]>>;
|
|
754
|
+
/** @deprecated Prefer `max_input_tokens`; kept for older dashboard reads. */
|
|
755
|
+
readonly context_window: S.optional<S.Number>;
|
|
756
|
+
readonly max_input_tokens: S.optional<S.Number>;
|
|
757
|
+
readonly max_output_tokens: S.optional<S.Number>;
|
|
758
|
+
readonly caps: S.optional<S.Struct<{
|
|
759
|
+
readonly deniedParams: S.optional<S.$Array<S.String>>;
|
|
760
|
+
readonly maxTokensField: S.optional<S.Literals<readonly ["max_tokens", "max_completion_tokens"]>>;
|
|
761
|
+
readonly temperature: S.optional<S.Literals<readonly ["only-1", "clamp-0-1", "drop"]>>;
|
|
762
|
+
/**
|
|
763
|
+
* Thinking modes this model accepts. Support is non-monotonic within a
|
|
764
|
+
* family (4.5 extended-only → 4.6 both → 4.7+ adaptive-only), so a
|
|
765
|
+
* boolean or a name prefix cannot encode it.
|
|
766
|
+
*
|
|
767
|
+
* `supportsAdaptiveThinking` = includes("adaptive");
|
|
768
|
+
* `rejectsExtendedThinking` = present AND !includes("enabled").
|
|
769
|
+
* Absent/empty stays permissive on BOTH, so an unknown model never
|
|
770
|
+
* manufactures a local validation error the upstream might accept.
|
|
771
|
+
*/
|
|
772
|
+
readonly thinkingModes: S.optional<S.$Array<S.Literals<readonly ["enabled", "adaptive", "disabled"]>>>;
|
|
773
|
+
/**
|
|
774
|
+
* Values this model accepts for the Responses `reasoning.context` knob.
|
|
775
|
+
*
|
|
776
|
+
* The Codex `spark` family 400s on `all_turns` and accepts only `auto` /
|
|
777
|
+
* `current_turn`; every other Codex model REQUIRES `all_turns`. The knob is
|
|
778
|
+
* nested under `reasoning`, so `deniedParams` (which addresses top-level
|
|
779
|
+
* keys) cannot express it — hence a trait of its own.
|
|
780
|
+
*
|
|
781
|
+
* An accepted-VALUE LIST rather than a boolean, matching `thinkingModes` /
|
|
782
|
+
* `videoResolutions`: absent = unknown = PERMISSIVE, so an un-catalogued id
|
|
783
|
+
* keeps the `all_turns` every non-spark Codex model needs and no adapter
|
|
784
|
+
* invents a restriction the upstream might not have.
|
|
785
|
+
*/
|
|
786
|
+
readonly reasoningContexts: S.optional<S.$Array<S.Literals<readonly ["auto", "current_turn", "all_turns"]>>>;
|
|
787
|
+
/**
|
|
788
|
+
* Whether this model accepts a `tool_addition` block inline in an
|
|
789
|
+
* inline system turn (`inline-tools-2026-09-15`, sent by Claude Code when a
|
|
790
|
+
* tool appears mid-session). Not derivable from family or version — measured
|
|
791
|
+
* live by `tests/server/inline-system-capability.e2e.test.ts`. When false the
|
|
792
|
+
* passthrough moves the tool definition into top-level `tools` instead
|
|
793
|
+
* (one cache rebuild per added tool). Absent = unknown = PERMISSIVE: the
|
|
794
|
+
* block is forwarded as the client sent it.
|
|
795
|
+
*/
|
|
796
|
+
readonly inlineToolAdditions: S.optional<S.Boolean>;
|
|
797
|
+
/**
|
|
798
|
+
* Whether this model accepts a mid-conversation `role: "system"` turn in
|
|
799
|
+
* `messages` natively (Anthropic "mid-conversation system messages"; no
|
|
800
|
+
* beta header). When true the anthropic passthrough forwards those turns
|
|
801
|
+
* untouched, which is what keeps the prompt cache warm: the cache prefix is
|
|
802
|
+
* `tools → system → messages`, so hoisting a NEW inline turn into top-level
|
|
803
|
+
* `system` invalidates every cached message after it (a full-conversation
|
|
804
|
+
* cache rewrite each time Claude Code appends a reminder). Measured live by
|
|
805
|
+
* `tests/server/inline-system-capability.e2e.test.ts`; the API docs list the
|
|
806
|
+
* supporting models. Absent = unknown = HOIST: the inline turns move into
|
|
807
|
+
* top-level `system`, which every Anthropic model accepts — correct but
|
|
808
|
+
* cache-hostile, so mark every model that accepts the inline form.
|
|
809
|
+
*/
|
|
810
|
+
readonly inlineSystemMessages: S.optional<S.Boolean>;
|
|
811
|
+
/**
|
|
812
|
+
* Whether `response_format` is a real knob on this model's upstream.
|
|
813
|
+
* When false the adapter OMITS the field — this is NOT a refusal: the
|
|
814
|
+
* gateway persists every image and builds `data[]` itself, so the
|
|
815
|
+
* caller's choice is still honoured.
|
|
816
|
+
*/
|
|
817
|
+
readonly upstreamAcceptsResponseFormat: S.optional<S.Boolean>;
|
|
818
|
+
/**
|
|
819
|
+
* Whether `stream` is a real knob on this model's upstream image request.
|
|
820
|
+
* When false the adapter OMITS the field — NOT a refusal: the gateway wraps
|
|
821
|
+
* the final JSON in one genuine SSE completion event itself, so a streaming
|
|
822
|
+
* caller is still served.
|
|
823
|
+
*
|
|
824
|
+
* DISTINCT from `nativeProgressiveImages`, deliberately. That trait says
|
|
825
|
+
* whether real partial frames exist; this one says whether the request field
|
|
826
|
+
* is accepted at all. A vendor can accept `stream` and answer with a single
|
|
827
|
+
* final frame, and a model can emit partials on a wire that spells the knob
|
|
828
|
+
* differently — so conflating them would either leak an unknown param into a
|
|
829
|
+
* guaranteed 400 or silently stop streaming for a provider that streams.
|
|
830
|
+
*/
|
|
831
|
+
readonly upstreamAcceptsStream: S.optional<S.Boolean>;
|
|
832
|
+
/** `style` (vivid|natural). False is a genuine pre-dispatch refusal. */
|
|
833
|
+
readonly supportsStyle: S.optional<S.Boolean>;
|
|
834
|
+
/** GPT-image output group: output_format, output_compression, moderation, background. */
|
|
835
|
+
readonly supportsGptImageOutputOptions: S.optional<S.Boolean>;
|
|
836
|
+
/** Upstream always returns base64, which is what makes omitting `response_format` safe. */
|
|
837
|
+
readonly alwaysReturnsBase64: S.optional<S.Boolean>;
|
|
838
|
+
/**
|
|
839
|
+
* Whether the model emits genuinely PROGRESSIVE image bytes upstream.
|
|
840
|
+
*
|
|
841
|
+
* This does NOT gate whether the gateway will stream: the gateway
|
|
842
|
+
* always supports an honest SSE response and emits a single real
|
|
843
|
+
* completion event for a final-only provider. This trait only says
|
|
844
|
+
* whether real partial frames can be forwarded — so a provider that
|
|
845
|
+
* cannot produce them degrades honestly instead of us fabricating
|
|
846
|
+
* partials from a buffered final image.
|
|
847
|
+
*/
|
|
848
|
+
readonly nativeProgressiveImages: S.optional<S.Boolean>;
|
|
849
|
+
/** Upper bound on genuine partial frames, when the model emits them. */
|
|
850
|
+
readonly maxNativePartialImages: S.optional<S.Number>;
|
|
851
|
+
/**
|
|
852
|
+
* Which upstream wire serves this model, when one provider exposes
|
|
853
|
+
* more than one. Lets an adapter refuse a model it structurally
|
|
854
|
+
* cannot carry (a `predict`-family id handed to a `generateContent`
|
|
855
|
+
* adapter) WITHOUT any claim about that model's availability.
|
|
856
|
+
*/
|
|
857
|
+
readonly nativeWire: S.optional<S.Literals<readonly ["generateContent", "predict"]>>;
|
|
858
|
+
/**
|
|
859
|
+
* Output resolutions this specific model serves.
|
|
860
|
+
*/
|
|
861
|
+
readonly videoResolutions: S.optional<S.$Array<S.String>>;
|
|
862
|
+
/** Exact clip lengths accepted, e.g. Veo's [4, 6, 8]. */
|
|
863
|
+
readonly mediaVideoDurationsSeconds: S.optional<S.$Array<S.Number>>;
|
|
864
|
+
/** Inclusive duration bounds, for a surface that takes a range. */
|
|
865
|
+
readonly mediaVideoDurationRange: S.optional<S.Struct<{
|
|
866
|
+
readonly min: S.Number;
|
|
867
|
+
readonly max: S.Number;
|
|
868
|
+
}>>;
|
|
869
|
+
/**
|
|
870
|
+
* Duration this model REQUIRES when the request carries reference
|
|
871
|
+
* images or a high resolution. Applies only to a duration the caller
|
|
872
|
+
* actually sent: an omitted duration stays omitted so the provider's
|
|
873
|
+
* own default applies.
|
|
874
|
+
*/
|
|
875
|
+
readonly mediaVideoDurationWithReferences: S.optional<S.Number>;
|
|
876
|
+
/** Accepted output aspect ratios, in the provider's own spelling. */
|
|
877
|
+
readonly mediaVideoAspectRatios: S.optional<S.$Array<S.String>>;
|
|
878
|
+
/** Upper bound on subject-reference images. */
|
|
879
|
+
readonly mediaVideoMaxReferenceImages: S.optional<S.Number>;
|
|
880
|
+
/** Upper bound on voice/audio references. */
|
|
881
|
+
readonly mediaVideoMaxReferenceVoices: S.optional<S.Number>;
|
|
882
|
+
/** Reference-type discriminator this surface accepts (e.g. "asset"). */
|
|
883
|
+
readonly mediaVideoReferenceType: S.optional<S.String>;
|
|
884
|
+
/** True when a starting frame and subject references are exclusive. */
|
|
885
|
+
readonly mediaVideoStartingImageExclusiveWithReferences: S.optional<S.Boolean>;
|
|
886
|
+
/** Accepted image aspect ratios, in the provider's own spelling. */
|
|
887
|
+
readonly mediaImageAspectRatios: S.optional<S.$Array<S.String>>;
|
|
888
|
+
/** Accepted image resolution tier names, e.g. ["1k", "2k", "1.5k"]. */
|
|
889
|
+
readonly mediaImageResolutions: S.optional<S.$Array<S.String>>;
|
|
890
|
+
/**
|
|
891
|
+
* Published pixel meaning of a tier, e.g. 1k = ~1024 long edge. Only
|
|
892
|
+
* tiers with a DOCUMENTED size belong here: a tier the vendor names
|
|
893
|
+
* without defining is left out so no caller size maps onto it.
|
|
894
|
+
*/
|
|
895
|
+
readonly mediaImageResolutionTiers: S.optional<S.$Array<S.Struct<{
|
|
896
|
+
readonly resolution: S.String;
|
|
897
|
+
readonly longEdge: S.Number;
|
|
898
|
+
}>>>;
|
|
899
|
+
/** Tier applied when the caller sends no size. */
|
|
900
|
+
readonly mediaImageDefaultResolution: S.optional<S.String>;
|
|
901
|
+
/**
|
|
902
|
+
* Canonical `WIDTHxHEIGHT` → provider aspect-ratio map, for a surface
|
|
903
|
+
* that takes a ratio rather than pixels.
|
|
904
|
+
*/
|
|
905
|
+
readonly mediaImageSizeAspectRatios: S.optional<S.$Record<S.String, S.String>>;
|
|
906
|
+
/** Inclusive bounds on the image count per request. */
|
|
907
|
+
readonly mediaImageCountRange: S.optional<S.Struct<{
|
|
908
|
+
readonly min: S.Number;
|
|
909
|
+
readonly max: S.Number;
|
|
910
|
+
}>>;
|
|
911
|
+
/**
|
|
912
|
+
* Which ruler counts this model's tokens. One model fact that is
|
|
913
|
+
* currently re-derived three different ways — by client surface
|
|
914
|
+
* (`canonical/encoding-select`), by upstream wire (the daemon walker),
|
|
915
|
+
* and by `provider === "anthropic"` (`handlers/count-tokens`). That
|
|
916
|
+
* last one misses subscription twins: a `claude_code/*` hop is a
|
|
917
|
+
* Claude model with provider `claude_code`, so it is counted with
|
|
918
|
+
* o200k against a Claude ruler.
|
|
919
|
+
*
|
|
920
|
+
* Absent keeps each consumer's existing default, so adopting this is
|
|
921
|
+
* incremental and never changes a count until a card declares one.
|
|
922
|
+
*/
|
|
923
|
+
readonly tokenizer: S.optional<S.Literals<readonly ["claude", "o200k"]>>;
|
|
924
|
+
}>>;
|
|
925
|
+
/**
|
|
926
|
+
* Catalog-internal: optional alternate input budgets a model can be
|
|
927
|
+
* configured to use (e.g. Codex dual-window Sol/Astra at 272k / 1.05M).
|
|
928
|
+
* Own list wins; absent inherits from the appropriate same-family donor;
|
|
929
|
+
* explicit `[]` blocks inheritance. Not a live observation and not part of
|
|
930
|
+
* the public `/v1/models` card — the card projects the effective window.
|
|
931
|
+
*/
|
|
932
|
+
readonly alternative_input_limits: S.optional<S.$Array<S.Int>>;
|
|
933
|
+
/**
|
|
934
|
+
* Codex v2 multi-agent models (gpt-5.6 sol/terra) emit a hierarchical
|
|
935
|
+
* subagent-spawn shape that Claude Code materializes into isolated git
|
|
936
|
+
* worktrees and loops. When true, the core `strip-subagent-isolation`
|
|
937
|
+
* feature removes the `isolation`/`cwd` args from Task/Agent tool calls in
|
|
938
|
+
* the response. Catalog-owned; not part of the public `/v1/models` card.
|
|
939
|
+
*/
|
|
940
|
+
readonly strip_subagent_isolation: S.optional<S.Boolean>;
|
|
941
|
+
readonly pricing: S.optional<S.Struct<{
|
|
942
|
+
readonly input_per_million: S.optional<S.Number>;
|
|
943
|
+
readonly output_per_million: S.optional<S.Number>;
|
|
944
|
+
readonly cache_read_per_million: S.optional<S.Number>;
|
|
945
|
+
readonly cache_write_per_million: S.optional<S.Number>;
|
|
946
|
+
readonly image_input_per_unit: S.optional<S.Number>;
|
|
947
|
+
readonly audio_input_per_minute: S.optional<S.Number>;
|
|
948
|
+
}>>;
|
|
949
|
+
/**
|
|
950
|
+
* Subscription models only: what the same tokens would cost at
|
|
951
|
+
* metered API pricing. Distinct from `pricing` — subscription usage
|
|
952
|
+
* bills $0 per token (flat vendor subscription), so `pricing` stays
|
|
953
|
+
* unset while this field feeds the overview savings computation.
|
|
954
|
+
* Derived from the metered sibling's `pricing` where one exists
|
|
955
|
+
* (see `subscriptionTwin` in the api catalog).
|
|
956
|
+
*/
|
|
957
|
+
readonly api_equivalent_pricing: S.optional<S.Struct<{
|
|
958
|
+
readonly input_per_million: S.optional<S.Number>;
|
|
959
|
+
readonly output_per_million: S.optional<S.Number>;
|
|
960
|
+
readonly cache_read_per_million: S.optional<S.Number>;
|
|
961
|
+
readonly cache_write_per_million: S.optional<S.Number>;
|
|
962
|
+
readonly image_input_per_unit: S.optional<S.Number>;
|
|
963
|
+
readonly audio_input_per_minute: S.optional<S.Number>;
|
|
964
|
+
}>>;
|
|
965
|
+
/**
|
|
966
|
+
* Subscription models only: the vendor usage meter this model draws on
|
|
967
|
+
* beyond the shared plan windows, so routing can skip a model whose own
|
|
968
|
+
* pool is exhausted while the shared window is open (Fable, Codex Spark).
|
|
969
|
+
* Omitted for models metered only by the shared window.
|
|
970
|
+
*/
|
|
971
|
+
readonly subscription_meter: S.optional<S.Struct<{
|
|
972
|
+
/**
|
|
973
|
+
* Stable provider-namespaced machine id — "claude_code:fable",
|
|
974
|
+
* "chatgpt:codex-spark". Never a display label.
|
|
975
|
+
*/
|
|
976
|
+
readonly meter_id: S.String;
|
|
977
|
+
/**
|
|
978
|
+
* Exact vendor-payload identities that resolve to this meter (Claude
|
|
979
|
+
* scope display_name + legacy key; Codex limit_name + metered_feature).
|
|
980
|
+
* Matched exactly, never fuzzy.
|
|
981
|
+
*/
|
|
982
|
+
readonly aliases: S.optional<S.$Array<S.String>>;
|
|
983
|
+
}>>;
|
|
984
|
+
/**
|
|
985
|
+
* Host-paid included models only: the monthly token allowance each plan
|
|
986
|
+
* tier gets on OpenLLM's own key. Catalog-owned so a limit change ships
|
|
987
|
+
* with a catalog update. An included model also LEADS every default chain
|
|
988
|
+
* it belongs to (see `compareDefaultChainMembers`).
|
|
989
|
+
*/
|
|
990
|
+
readonly included_usage: S.optional<S.Struct<{
|
|
991
|
+
readonly free: S.Int;
|
|
992
|
+
readonly trial: S.Int;
|
|
993
|
+
readonly pro: S.Int;
|
|
994
|
+
}>>;
|
|
995
|
+
readonly deprecated: S.optional<S.Boolean>;
|
|
996
|
+
readonly dimension_presets: S.optional<S.$Array<S.Number>>;
|
|
997
|
+
readonly audio_support: S.optional<S.Struct<{
|
|
998
|
+
readonly input_formats: S.optional<S.$Array<S.String>>;
|
|
999
|
+
readonly output_formats: S.optional<S.$Array<S.String>>;
|
|
1000
|
+
readonly voices: S.optional<S.$Array<S.String>>;
|
|
1001
|
+
/**
|
|
1002
|
+
* Verified realtime operations only. Grok currently advertises
|
|
1003
|
+
* `text_to_audio`; microphone / interruption legs are omitted until
|
|
1004
|
+
* verified.
|
|
1005
|
+
*/
|
|
1006
|
+
readonly realtime_operations: S.optional<S.$Array<S.String>>;
|
|
1007
|
+
}>>;
|
|
1008
|
+
readonly default_tiers: S.optional<S.$Array<S.Literals<readonly ["ultra", "plus", "lite", "media"]>>>;
|
|
1009
|
+
readonly tier_rank: S.optional<S.Number>;
|
|
1010
|
+
/**
|
|
1011
|
+
* Auth class of this catalog/live entry. Subscription twins must set
|
|
1012
|
+
* `subscription` even if derived from an API-key sibling. Omitted on
|
|
1013
|
+
* mixed aliases.
|
|
1014
|
+
*/
|
|
1015
|
+
readonly provider_type: S.optional<S.Literals<readonly ["subscription", "api_key", "local"]>>;
|
|
1016
|
+
/**
|
|
1017
|
+
* Daemon-only variant when `provider_type` is `subscription` (`oauth`)
|
|
1018
|
+
* or `local` (`local`). Absent on API-key cards and mixed aliases.
|
|
1019
|
+
*/
|
|
1020
|
+
readonly provider_variant: S.optional<S.Literals<readonly ["oauth", "local", "local_key"]>>;
|
|
1021
|
+
}>;
|
|
1022
|
+
export type TExtendedModel = S.Schema.Type<typeof ExtendedModel>;
|
|
1023
|
+
export declare const AliasMap: S.$Record<S.String, S.String>;
|
|
1024
|
+
export type TAliasMap = S.Schema.Type<typeof AliasMap>;
|
|
1025
|
+
export declare const ProviderModelEntry: S.Struct<{
|
|
1026
|
+
/** Upstream model id, e.g. `gpt-5.2` — NOT the catalog `provider/model` id. */
|
|
1027
|
+
readonly provider_model_id: S.String;
|
|
1028
|
+
readonly display_name: S.optional<S.String>;
|
|
1029
|
+
readonly created: S.optional<S.Number>;
|
|
1030
|
+
readonly context_window: S.optional<S.Number>;
|
|
1031
|
+
/**
|
|
1032
|
+
* Vendor-reported completion (output) ceiling for this model, when the
|
|
1033
|
+
* provider's own list endpoint exposes one. Mirrors `context_window`'s
|
|
1034
|
+
* role for the input side — optional because most list endpoints only
|
|
1035
|
+
* report the input/context budget. A writer that never populates this
|
|
1036
|
+
* field leaves request output-cap backfill fail-open. Static catalog limits
|
|
1037
|
+
* remain display/config metadata only.
|
|
1038
|
+
*/
|
|
1039
|
+
readonly max_output_tokens: S.optional<S.Number>;
|
|
1040
|
+
}>;
|
|
1041
|
+
export type TProviderModelEntry = S.Schema.Type<typeof ProviderModelEntry>;
|
|
1042
|
+
export declare const ProviderModelList: S.$Array<S.Struct<{
|
|
1043
|
+
/** Upstream model id, e.g. `gpt-5.2` — NOT the catalog `provider/model` id. */
|
|
1044
|
+
readonly provider_model_id: S.String;
|
|
1045
|
+
readonly display_name: S.optional<S.String>;
|
|
1046
|
+
readonly created: S.optional<S.Number>;
|
|
1047
|
+
readonly context_window: S.optional<S.Number>;
|
|
1048
|
+
/**
|
|
1049
|
+
* Vendor-reported completion (output) ceiling for this model, when the
|
|
1050
|
+
* provider's own list endpoint exposes one. Mirrors `context_window`'s
|
|
1051
|
+
* role for the input side — optional because most list endpoints only
|
|
1052
|
+
* report the input/context budget. A writer that never populates this
|
|
1053
|
+
* field leaves request output-cap backfill fail-open. Static catalog limits
|
|
1054
|
+
* remain display/config metadata only.
|
|
1055
|
+
*/
|
|
1056
|
+
readonly max_output_tokens: S.optional<S.Number>;
|
|
1057
|
+
}>>;
|
|
1058
|
+
export type TProviderModelList = S.Schema.Type<typeof ProviderModelList>;
|
|
1059
|
+
/**
|
|
1060
|
+
* Bound on any model-list fetch against a provider's own list endpoint
|
|
1061
|
+
* — shared by the cloud refresher (`packages/api`) and the daemon
|
|
1062
|
+
* delegates (`packages/cli/daemon`), which can't import each other, so the
|
|
1063
|
+
* constant lives on the wire package both depend on.
|
|
1064
|
+
*/
|
|
1065
|
+
export declare const MODEL_LIST_FETCH_TIMEOUT_MS = 10000;
|