import { type KeyConfig, type KeyHandle, type LoadBalanceStrategy, type PoolStatus, type ProviderPoolConfig } from "./key-pool.js";
export type RegistryChangeCallback = () => void;
export type ReasoningMode = "none" | "adaptive" | "collapsed" | "effort";
export type ModelPurpose = "textGeneration" | "smallModel" | "stt" | "tts" | "imageGeneration" | "imageUnderstanding" | "videoGeneration" | "videoUnderstanding" | "threeDGeneration" | "embedding" | "voiceClone" | "musicGeneration" | "realtimeAudio" | "realtimeVideo";
export interface ModelInfo {
    id: string;
    name?: string;
    contextWindow?: number;
    maxOutput?: number;
    streamRequired?: boolean;
    toolCall?: boolean;
    vision?: boolean;
    mediaType?: string | null;
}
export interface ProviderDef {
    id: string;
    name: string;
    transport: string;
    baseUrl: string;
    defaultModel?: string;
    group?: string;
    models?: ModelInfo[];
}
export interface ModelEntry {
    id: string;
    provider: string;
    model: string;
    displayName: string;
    routeIntents: ModelPurpose[];
    baseUrl?: string;
    enabled: boolean;
    nativeModelId?: string;
    transport?: string;
    contextWindow?: number;
    maxOutput?: number;
    streamRequired?: boolean;
    toolCall?: boolean;
    mediaType?: string | null;
    capabilityProfile?: ModelCapabilityProfile;
    pricing?: Record<string, unknown>;
    /** Thinking-strength control class for the UI (see ReasoningMode). */
    reasoningMode?: ReasoningMode;
}
export interface ModelCapabilityProfile {
    tasks?: string[];
    input_modalities?: string[];
    output_modalities?: string[];
    traits?: string[];
    verification?: {
        state?: string;
        source?: string;
    };
    cost?: {
        tier?: string;
        requires_confirmation?: boolean;
        default_selectable?: boolean;
    };
}
export type PurposeBindings = Partial<Record<ModelPurpose, string>>;
export interface ModelRegistryConfig {
    providers: ProviderPoolConfig[];
    models: Array<{
        id: string;
        enabled?: boolean;
    }>;
    bindings: PurposeBindings;
    tunables?: Record<string, unknown>;
    injectedKeys?: Record<string, InjectedKeyState>;
}
export interface InjectedKeyState {
    enabled?: boolean;
    removed?: boolean;
}
export interface ResolvedModel {
    provider: string;
    model: string;
    apiKey: string;
    baseUrl?: string;
    keyHandle: KeyHandle;
}
export declare const ALL_PURPOSES: ModelPurpose[];
export declare class ModelRegistry {
    private keyPool;
    private catalogProviders;
    private models;
    private modelEnabledOverrides;
    private bindings;
    private injectedKeyStates;
    private settingsPath;
    private changeListeners;
    constructor(config?: ModelRegistryConfig);
    getActiveModel(purpose: ModelPurpose): ResolvedModel | null;
    peekActiveModel(purpose: ModelPurpose): ModelEntry | null;
    isAvailable(purpose: ModelPurpose): boolean;
    resolveModelForPurpose(purpose: ModelPurpose): string | null;
    addProvider(providerId: string, opts?: {
        baseUrl?: string;
        strategy?: LoadBalanceStrategy;
        rateLimit?: {
            rpm?: number;
            tpm?: number;
        };
    }): void;
    removeProvider(providerId: string): void;
    addKey(providerId: string, key: string, opts?: {
        label?: string;
        weight?: number;
    }): string;
    removeKey(keyId: string): boolean;
    getKeyById(keyId: string): string | null;
    updateKey(keyId: string, updates: Partial<Pick<KeyConfig, "label" | "weight" | "enabled">>): boolean;
    setKeyHealth(keyId: string, status: "healthy" | "degraded" | "cooldown" | "disabled"): void;
    setStrategy(providerId: string, strategy: LoadBalanceStrategy): void;
    addModel(entry: Omit<ModelEntry, "id"> & {
        id?: string;
    }): string;
    replaceCatalogProviders(providers: ProviderDef[]): void;
    replaceCatalogModels(entries: ModelEntry[]): void;
    replaceProviderModels(providerId: string, entries: ModelEntry[]): void;
    removeModel(id: string): void;
    enableModel(id: string): void;
    disableModel(id: string): void;
    listModels(filter?: {
        purpose?: ModelPurpose;
        provider?: string;
        enabledOnly?: boolean;
    }): ModelEntry[];
    getModel(id: string): ModelEntry | null;
    setBinding(purpose: ModelPurpose, modelId: string): void;
    removeBinding(purpose: ModelPurpose): void;
    getBinding(purpose: ModelPurpose): ModelEntry | null;
    getAllBindings(): Record<string, ModelEntry | null>;
    getProviderStatus(providerId: string): PoolStatus | null;
    getAllProviderStatus(): PoolStatus[];
    save(): void;
    load(): boolean;
    exportConfig(): ModelRegistryConfig;
    getTunable<T = unknown>(key: string): T | undefined;
    getModelInfo(providerId: string, modelId: string): ModelInfo | undefined;
    getProviderDefaultModel(providerId: string): string | undefined;
    hasConfiguredKeyForProviderVariant(providerId: string): boolean;
    hasAvailableKeyForProviderVariant(providerId: string): boolean;
    listProviderDefs(): ProviderDef[];
    getKnownProviderDef(providerId: string): ProviderDef | null;
    resolveProviderApiKey(providerId: string): string | undefined;
    onChange(callback: RegistryChangeCallback): () => void;
    getKeyForProvider(providerId: string): string | null;
    snapshotProviderKeys(): Record<string, string>;
    private getProviderBaseUrl;
    private acquireKeyForProviderVariant;
    private resolveTechnicalVariant;
    private providerVariantKeyCandidates;
    private hasLlmrouterEnvKey;
    private hasEnabledLlmrouterEnvKey;
    private getInjectedKeyState;
    private setInjectedKeyState;
    private loadModelState;
    private exportModelState;
    private exportInjectedKeyStates;
    private emitChange;
}
export declare function getModelRegistry(): ModelRegistry;
export declare function resetModelRegistry(): void;
