/** * kosha-discovery — Canonical provider catalog. * * I keep provider identity, aliases, transport, credential requirements, * and default base URLs in one place so discovery, credentials, and the * versioned schema do not drift apart. * @module */ import type { KoshaConfig, ProviderCacheBehavior, ProviderOrigin, ProviderTransport } from "./types.js"; /** * Stable provider descriptor used by normalization and v1 schema emission. */ export interface ProviderDescriptor { /** Canonical provider ID exposed to discovery consumers. */ providerId: string; /** Stable canonical ID; repeated for clarity in external schemas. */ canonicalProviderId: string; /** Provider aliases accepted in config and queries. */ aliases: string[]; /** Human-friendly display name. */ name: string; /** High-level origin classification. */ origin: ProviderOrigin; /** True when the runtime is local to the machine. */ isLocal: boolean; /** Transport family exposed by the provider. */ transport: ProviderTransport; /** Default base URL used by the built-in discoverer. */ defaultBaseUrl: string; /** Whether model discovery normally requires credentials. */ credentialRequired: boolean; /** Whether execution/model requests require credentials; defaults to `credentialRequired`. */ executionCredentialRequired?: boolean; /** Environment variables that satisfy the provider credential requirement. */ credentialEnvVars: string[]; /** The single env var that `fallbackRegistryCredential` reads for this provider. */ primaryCredentialEnvVar?: string; /** * Minimum prompt-prefix size (in tokens) required for the provider's prompt * cache to engage. Only set when the provider publishes a documented floor. * Undefined means either "no cache support" or "no documented floor"; the * consumer should fall back to its own conservative default in that case. */ minCachePrefixTokens?: number; /** * Prompt-cache TTL semantics for the provider. Undefined means the policy * has not been curated yet — distinct from `{ mode: "none" }` which asserts * the provider documents no prompt cache. */ cacheBehavior?: ProviderCacheBehavior; } /** * Canonical provider catalog. * * I keep this intentionally compact. When a provider alias is accepted, * it must resolve here first before discovery or config lookup proceeds. */ export declare const PROVIDER_CATALOG: readonly ProviderDescriptor[]; /** * Return the canonical provider ID for a possibly-aliased identifier. */ export declare function normalizeProviderId(providerId: string | undefined): string | undefined; /** * Resolve a provider descriptor from a canonical ID or alias. */ export declare function getProviderDescriptor(providerId: string | undefined): ProviderDescriptor | undefined; /** * Return every known provider descriptor in catalog order. */ export declare function listProviderDescriptors(): ProviderDescriptor[]; /** * Read provider config using canonical IDs and accepted aliases. */ export declare function getProviderConfig(config: KoshaConfig | undefined, providerId: string | undefined): NonNullable[string] | undefined; /** Return true when model execution through this provider needs auth. */ export declare function providerExecutionCredentialRequired(descriptor: Pick): boolean; /** * Return the curated prompt-cache behavior for a provider, or `undefined` * if the policy has not been curated yet. */ export declare function getProviderCacheBehavior(providerId: string | undefined): ProviderCacheBehavior | undefined; /** * True when the provider is a local runtime. */ export declare function isLocalProvider(providerId: string | undefined): boolean; //# sourceMappingURL=provider-catalog.d.ts.map