import { z } from "zod"; import { type CanonicalModelId, type ProviderId } from "./canonical-model.js"; /** * Policy order and semantics are versioned; the version string travels into * telemetry (LLM Provider Routing PRD §4.2) so a routing-behavior change is * distinguishable from a configuration change after the fact. */ export declare const ROUTE_POLICY_VERSION = "provider-router-v1"; export type RoutePolicyVersion = typeof ROUTE_POLICY_VERSION; /** * `ordered` tries each listed provider in order, skipping unavailable or * incapable endpoints. `only` is a hard fence: the marked canonical model is * never attempted through another provider. A separately configured fallback * model still expands under its own policy (PRD §4.2). */ export declare const providerPolicySchema: z.ZodDiscriminatedUnion<[z.ZodReadonly; providers: z.ZodArray>; }, z.core.$strict>>, z.ZodReadonly; provider: z.core.$ZodBranded; }, z.core.$strict>>], "mode">; export type ProviderPolicy = z.infer; /** * The checked-in route registry. It contains policy only — never endpoints, * deployment names, credentials, prices, quota, or tenant-specific values. * * Naming note: the PRD draft called the bound default `azureBoundDefault`. * The harness is provider-agnostic, so the registry generalizes it to * `boundDefault`, applied when the host reports at least one provider * binding for the model (see `resolveProviderPolicy`). */ export declare const modelRouteRegistrySchema: z.ZodReadonly; /** Used when a model has no explicit policy and no provider binding. */ unboundDefault: z.ZodDiscriminatedUnion<[z.ZodReadonly; providers: z.ZodArray>; }, z.core.$strict>>, z.ZodReadonly; provider: z.core.$ZodBranded; }, z.core.$strict>>], "mode">; /** Used when a model has no explicit policy but has ≥1 provider binding. */ boundDefault: z.ZodDiscriminatedUnion<[z.ZodReadonly; providers: z.ZodArray>; }, z.core.$strict>>, z.ZodReadonly; provider: z.core.$ZodBranded; }, z.core.$strict>>], "mode">; /** Keys are canonical model ids; parsing rejects deployment names. */ models: z.ZodRecord, z.ZodDiscriminatedUnion<[z.ZodReadonly; providers: z.ZodArray>; }, z.core.$strict>>, z.ZodReadonly; provider: z.core.$ZodBranded; }, z.core.$strict>>], "mode">>; }, z.core.$strict>>; export type ModelRouteRegistry = z.infer; /** * Parse and freeze a checked-in registry object at module initialization. * `satisfies` on the literal is not a runtime-validation substitute * (PRD §4.2) — hosts must call this on their checked-in object. */ export declare function parseModelRouteRegistry(input: unknown): ModelRouteRegistry; /** * Policy precedence (PRD §4.2): exact canonical-model entry, then the bound * default when the host reports a provider binding for this model, then the * unbound default. An explicit policy always wins — in particular, an * explicit single-provider model does not become bound-first merely because * a binding is later added. * * `boundProviders` is the host's report of which providers have an explicit * binding for this model (e.g. an Azure deployment mapping). A catch-all * transport that serves every model without per-model configuration should * not be reported as a binding. */ export declare function resolveProviderPolicy(registry: ModelRouteRegistry, model: CanonicalModelId, boundProviders: ReadonlySet): ProviderPolicy; /** The provider order a policy prescribes; `only` is a single-entry order. */ export declare function policyProviderOrder(policy: ProviderPolicy): readonly ProviderId[];