| 1 | //! Route Contract: the runtime path for provider/model identity (Phase 1). |
| 2 | //! |
| 3 | //! `RouteResolver` is the sole producer of [`ReadyRouteCandidate`]. Config and |
| 4 | //! CLI resolution now go through it. Catalog rows are keyed by open kebab |
| 5 | //! [`ids::RouteId`] strings; `ProviderKind` remains the bespoke-transport |
| 6 | //! classification plus serde aliases for retired spellings. |
| 7 | //! |
| 8 | //! Layering: |
| 9 | //! - [`ids`] — provider/model/wire string newtypes + namespace hints. |
| 10 | //! - [`descriptor`] — route-facing view over the static provider registry. |
| 11 | //! - [`offering`] — provider/model offering seam (wire-id binding). |
| 12 | //! - [`capabilities`] — three-state provider/model capability facts. |
| 13 | //! - [`candidate`] — the runtime-resolved executable route + its parts. |
| 14 | //! - [`errors`] — route resolution errors. |
| 15 | //! - [`resolver`] — the sole producer of [`candidate::ReadyRouteCandidate`]. |
| 16 | //! |
| 17 | //! Naming: the request/response wire shape is spelled [`RequestProtocol`], |
| 18 | //! which is a re-export alias of [`crate::provider::WireFormat`] rather than a |
| 19 | //! fourth protocol synonym. |
| 20 | |
| 21 | /// The selected endpoint's request/response wire shape. |
| 22 | /// |
| 23 | /// Alias of [`crate::provider::WireFormat`]; intentionally NOT a new enum, to |
| 24 | /// avoid introducing yet another protocol synonym. |
| 25 | pub use crate::provider::WireFormat as RequestProtocol; |
| 26 | |
| 27 | pub mod auth; |
| 28 | pub mod authority; |
| 29 | pub mod candidate; |
| 30 | pub mod capabilities; |
| 31 | pub mod descriptor; |
| 32 | pub mod errors; |
| 33 | pub mod export; |
| 34 | pub mod ids; |
| 35 | pub mod offering; |
| 36 | pub mod policy; |
| 37 | pub mod resolver; |
| 38 | |
| 39 | pub use auth::{ |
| 40 | AuthKind, AuthMethod, AuthMethodExport, Choice, ChoiceExport, Op, Prompt, PromptExport, When, |
| 41 | WhenExport, |
| 42 | }; |
| 43 | pub use authority::{ |
| 44 | AuthorityResolution, CatalogOfferingReceipt, RouteAuthoritySnapshot, RouteCatalogScope, |
| 45 | }; |
| 46 | pub use candidate::{ |
| 47 | LimitField, OverrideSource, PricingSku, ReadyRouteCandidate, ResolvedAuthSource, |
| 48 | ResolvedEndpoint, SourcedLimitOverride, ValidationReport, |
| 49 | }; |
| 50 | pub(crate) use capabilities::documented_server_side_web_search; |
| 51 | pub use capabilities::{CapabilityState, RouteCapabilities}; |
| 52 | pub use descriptor::{ |
| 53 | EndpointDescriptor, ProviderDescriptor, TransportKind, auth_methods_for, family_for, |
| 54 | }; |
| 55 | pub use errors::RouteError; |
| 56 | pub use export::{ |
| 57 | PROVIDERS_EXPORT_SCHEMA_VERSION, ProvidersExport, RouteExport, RouteModelExport, |
| 58 | parse_route_kind, route_id_for, |
| 59 | }; |
| 60 | pub use ids::{LogicalModelRef, ModelId, NamespaceHint, ProviderId, RouteId, WireModelId}; |
| 61 | pub use offering::{ |
| 62 | CODEWHALE_FALLBACK_MODELS, ProviderModelOffering, RouteLimits, bundled_offerings, |
| 63 | codewhale_endpoint_key_for_model, opencode_zen_picker_models, |
| 64 | }; |
| 65 | pub use policy::{CatalogPolicy, PolicyAction, PolicyEffect, PolicyRule}; |
| 66 | pub use resolver::{RouteRequest, RouteResolver}; |
| 67 | |
| 68 | #[cfg(test)] |
| 69 | mod conformance_tests; |
| 70 | #[cfg(test)] |
| 71 | mod tests; |
| 72 |