/** Host settings schema and routing helpers. */ export declare const ProxyHostSchema: any; export interface ProxyHost { id: string; name: string; proxyUrl: string; /** Credentials-service entry ("user:password") for this proxy host. */ credentialRef?: string; } export declare const ProxyRuleSchema: any; export type HeaderValueSource = 'fixed' | 'sessionId' | 'provider' | 'model' | 'purpose'; export interface ProxyRule { /** Optional card key for the UI; hand-written yaml rules may omit it. */ id?: string; provider: string; model: string; /** Reusable proxy host selected for this rule; absent means direct. */ proxyHostId?: string; /** Legacy inline proxy URL; used only when proxyHostId is absent. */ proxyUrl?: string; enabled: boolean; /** When set, the rule only applies to LLM calls carrying this purpose. */ purpose?: string; /** Credentials-service entry ("user:password") overriding proxyUrl userinfo. */ credentialRef?: string; /** * Fixed extra HTTP headers injected for this rule, including direct mode. * Example: `{ "x-opencode-session": "" }` for opencode-go. */ headers?: Record; /** Optional per-header source; values read from the current request context. */ headerValueSources?: Record; } /** Host-computed provider/model directory mirror; never contains secrets. */ export interface DirectoryModel { id: string; name?: string; } export interface DirectoryProvider { provider: string; displayName?: string; /** Live route membership; unknown/absent renders as dormant, never hidden. */ active?: boolean; } export interface DirectoryCatalog { providers: DirectoryProvider[]; models: Array<{ provider: string; models: DirectoryModel[]; }>; } export declare const DirectoryModelSchema: any; export declare const DirectoryProviderSchema: any; export declare const DirectoryCatalogSchema: any; export declare const ModelProxyConfigSchema: any; export interface ModelProxyConfig { enabled: boolean; proxyHosts: ProxyHost[]; rules: ProxyRule[]; defaultProxyHostId?: string; /** Legacy inline fallback URL; empty when defaultProxyHostId is used. */ defaultProxy: string; debug: boolean; /** Host-computed directory mirror; absent until the first mirror pass. */ catalog?: DirectoryCatalog; } export declare const ModelProxyConfig: any; /** Loader-facing alias; tests and host internals keep the `ModelProxyConfig` name. */ export declare const Config: any; /** A live config field handle; each read yields the current committed snapshot. */ export interface VolatileRef { get(): T; } /** `apply` receives one stable volatile reference per Config field. */ export interface ModelProxyConfigRef { enabled: VolatileRef; proxyHosts: VolatileRef; rules: VolatileRef; defaultProxyHostId: VolatileRef; defaultProxy: VolatileRef; debug: VolatileRef; catalog: VolatileRef; } /** * Cross-field validation that the schema alone cannot express. * Throws with a human-readable message listing the offending rule/host index. */ export declare function assertServiceable(config: ModelProxyConfig): void; export interface HeaderRequestContext { sessionId?: string; provider?: string; model?: string; purpose?: string; } /** Resolved transport route and fixed extra headers. */ export interface ResolvedRoute { proxyUrl?: string; headers?: Record; } /** Resolve exact, prefix, then wildcard rules; disabled rules are skipped. */ export declare function resolveRoute(config: ModelProxyConfig, provider: string, model: string, purpose?: string, composeUrl?: (rule: ProxyRule) => string | undefined, request?: HeaderRequestContext | string): ResolvedRoute; export declare function resolveProxy(config: ModelProxyConfig, provider: string, model: string, purpose?: string, composeUrl?: (rule: ProxyRule) => string | undefined): string | undefined; /** Redact proxy credentials and query/fragment data for logging. */ export declare function redactProxyUrl(url: string): string; //# sourceMappingURL=config.d.ts.map