/** * Canonical inference-provider registry. * * Provider selection is deliberately fail-closed. A URL is usable only when * it matches a known provider, names a provider explicitly, supplies a * protocol explicitly, or carries an unambiguous legacy backend type. */ export type ProviderProtocol = "ollama" | "openai-chat" | "anthropic-messages"; export type ProviderAuthStrategy = "none" | "bearer" | "anthropic-api-key"; export type ProviderCapability = "chat" | "streaming" | "models" | "embeddings" | "tools" | "structured-output"; export type ProviderPathKind = "chat" | "models" | "embeddings" | "health" | "nativeChat"; export interface ProviderAuthDescriptor { strategy: ProviderAuthStrategy; required: boolean; keyPrefix?: string; staticHeaders?: Readonly>; } export interface ProviderDescriptor { id: string; aliases: readonly string[]; label: string; protocol: ProviderProtocol; local: boolean; apiPrefix: string; paths: Readonly>>; auth: Readonly; capabilities: readonly ProviderCapability[]; defaultUrl?: string; apiKeyUrl?: string; docsUrl?: string; description: string; } export interface ResolveProviderOptions { baseUrl?: string; providerId?: string; protocol?: ProviderProtocol; /** * Compatibility bridge for persisted configurations written before * protocols were first-class. Only deterministic values are accepted. */ legacyBackendType?: string; } export interface ResolvedProviderTransport { descriptor: ProviderDescriptor; providerId: string; protocol: ProviderProtocol; /** Service root before the provider's API prefix. */ serviceBaseUrl: string; /** Service root plus the provider's API prefix. */ endpointBaseUrl: string; urls: Readonly>>; source: "known-url" | "provider-id" | "explicit-protocol" | "legacy-backend-type"; } export declare class UnknownProviderProtocolError extends Error { readonly code = "OMNIUS_PROVIDER_PROTOCOL_REQUIRED"; constructor(message: string); } /** Return immutable copies of all known, directly selectable providers. */ export declare function listProviderDescriptors(): ProviderDescriptor[]; /** Detect a known provider. Unknown URLs return undefined, never a fallback. */ export declare function detectProviderDescriptor(rawUrl: string): ProviderDescriptor | undefined; /** * Resolve only the provider metadata. Unknown endpoints require an explicit * protocol (or an unambiguous legacy backend type) and otherwise throw. */ export declare function resolveProviderDescriptor(options: ResolveProviderOptions): ProviderDescriptor; /** * Resolve provider metadata and concrete URLs. This function performs no * network requests, so callers can fail before fetch on ambiguous endpoints. */ export declare function resolveProviderTransport(options: ResolveProviderOptions): ResolvedProviderTransport; export interface ProviderHeaderOptions { apiKey?: string; clientVersion?: string; includeJsonContentType?: boolean; } /** Build provider-correct authentication and client headers. */ export declare function buildProviderHeaders(provider: ProviderDescriptor | ResolvedProviderTransport, options?: ProviderHeaderOptions): Record; export declare function providerUrl(provider: ResolvedProviderTransport, kind: ProviderPathKind): string; //# sourceMappingURL=providerRegistry.d.ts.map