import type { CompletionRequest, CompletionResult, ProviderId } from "../types.js"; import type { ReasoningStyle } from "./http.js"; export interface LlmProvider { id: ProviderId; displayName: string; defaultModel: string; reasoningStyle?: ReasoningStyle | undefined; envVar?: string | undefined; validateKey(key: string): boolean; ping(options: ProviderAuth): Promise; complete(request: CompletionRequest, auth: ProviderAuth): Promise; stream?(request: CompletionRequest, auth: ProviderAuth, onToken: (token: string) => void): Promise; listModels?(auth: ProviderAuth): Promise; } export interface ProviderAuth { apiKey?: string | undefined; baseUrl?: string | undefined; } export declare const providerAliases: Record; export declare const defaultModels: Record; export declare const envVars: Record; /** Resolve the env var for any provider, including user-defined custom ones. */ export declare function getEnvVar(provider: ProviderId): string | undefined; export declare function setEnvVarResolver(resolver: ((provider: ProviderId) => string | undefined) | undefined): void; export declare function normalizeProvider(value: string): ProviderId | undefined; export declare function assertProvider(value: string): ProviderId; export declare function getDefaultModel(provider: ProviderId): string; export declare function setCustomProviderResolver(resolver: ((id: string) => boolean) | undefined): void; export declare function sanitizeProviderModel(provider: ProviderId, model: string): string; /** * Normalize a user-supplied OpenAI-compatible base URL so the HTTP helpers can * append `/chat/completions` to it. Idempotent, and tolerant of the three * things people actually paste: a bare host, a trailing slash, or a full * endpoint path. * * x--ep-y.modal.direct → https://x--ep-y.modal.direct/v1 * https://x--ep-y.modal.direct/v1/ → https://x--ep-y.modal.direct/v1 * https://host/v1/chat/completions → https://host/v1 */ export declare function normalizeEndpointUrl(url: string): string; export declare function maskSecret(secret: string): string; /** Short tail for toast/status lines (`…ab12`). Never exposes the full secret. */ export declare function maskSecretTail(secret: string): string; export declare function redactSecrets(value: string): string; export declare const providerInfo: Record; export declare function getProviderInfoText(provider: string): string; export declare function setCustomProviderInfoResolver(resolver: ((provider: string) => string | undefined) | undefined): void; export declare function setCustomDefaultModelResolver(resolver: ((provider: ProviderId) => string | undefined) | undefined): void;