/**
 * Model registry - manages built-in and custom models, provides API key resolution.
 */
import { type Api, type Model } from "@earendil-works/pi-ai/compat";
import type { AuthStatus, AuthStorage } from "./auth-storage.ts";
import type { ProviderConfigInput, ResolvedRequestAuth } from "./model-registry-types.ts";
import { clearConfigValueCache } from "./resolve-config-value.ts";
export type { ProviderConfigInput, ResolvedRequestAuth } from "./model-registry-types.ts";
/** Clear the config value command cache. Exported for testing. */
export declare const clearApiKeyCache: typeof clearConfigValueCache;
/**
 * Model registry - loads and manages models, resolves API keys via AuthStorage.
 */
export declare class ModelRegistry {
    private models;
    private modelOverrides;
    private providerRequestConfigs;
    private modelRequestHeaders;
    private registeredProviders;
    private builtInProviders;
    private customOpenAICompatibleProviders;
    private loadError;
    readonly authStorage: AuthStorage;
    private modelsJsonPaths;
    private constructor();
    private seedCopilotModelCatalogFromCache;
    static create(authStorage: AuthStorage, modelsJsonPath?: string | string[]): ModelRegistry;
    static inMemory(authStorage: AuthStorage): ModelRegistry;
    /**
     * Reload models from disk (built-in + custom from models.json).
     */
    refresh(): void;
    /**
     * Get any error from loading models.json (undefined if no error).
     */
    getError(): string | undefined;
    private loadModels;
    /**
     * Get all models (built-in + custom).
     * If models.json had errors, returns only built-in models.
     */
    getAll(): Model<Api>[];
    /**
     * Get only models that have auth configured.
     * This is a fast check that doesn't refresh OAuth tokens.
     */
    getAvailable(): Model<Api>[];
    /**
     * Find a model by provider and ID.
     */
    find(provider: string, modelId: string): Model<Api> | undefined;
    /** Whether an authenticated provider may reconstruct an absent saved model ID. */
    canRestoreUnknownModel(provider: string): boolean;
    /**
     * Get API key for a model.
     */
    hasConfiguredAuth(model: Model<Api>): boolean;
    private getModelRequestKey;
    private storeProviderRequestConfig;
    private storeModelHeaders;
    /**
     * Get API key and request headers for a model.
     */
    getApiKeyAndHeaders(model: Model<Api>): Promise<ResolvedRequestAuth>;
    /**
     * Return auth status for a provider, including request auth configured in models.json.
     * This intentionally does not execute command-backed config values.
     */
    getProviderAuthStatus(provider: string): AuthStatus;
    /**
     * Get display name for a provider.
     */
    getProviderDisplayName(provider: string): string;
    /**
     * Get API key for a provider.
     */
    getApiKeyForProvider(provider: string): Promise<string | undefined>;
    /**
     * Check if a model is using OAuth credentials (subscription).
     */
    isUsingOAuth(model: Model<Api>): boolean;
    /**
     * Register a provider dynamically (from extensions).
     */
    registerProvider(providerName: string, config: ProviderConfigInput): void;
    /**
     * Check whether extensions have registered custom streamSimple dispatch for an API.
     */
    hasRegisteredStreamSimpleForApi(api: Api): boolean;
    /**
     * Unregister a previously registered provider.
     */
    unregisterProvider(providerName: string): void;
    private upsertRegisteredProvider;
    private applyProviderConfig;
}
//# sourceMappingURL=model-registry.d.ts.map