import type { DiscoveredServer } from '../discovery/index.js';
import { HelperModel, type HelperModelDeps } from '../config/helper-model.js';
import { type BenchmarkStore, type ModelBenchmarks, type QualityTier } from './model-benchmarks.js';
import type { MinimalModelDefinition, SyntheticModelInfo } from './model-catalog.js';
import type { FavoritesStore } from './favorites.js';
import type { LLMProvider, ProviderRuntimeMetadata } from './interface.js';
import type { ModelDefinition } from './registry-types.js';
import { type ProviderRuntimeSnapshot, type ProviderUsageSnapshot } from './runtime-snapshot.js';
export interface ProviderApiModelReference {
    readonly modelId: string;
    readonly providerId: string;
    readonly registryKey: string;
}
export interface ProviderApiFavoriteState {
    readonly pinned: boolean;
    readonly recent: boolean;
    readonly pinnedAt?: string | undefined;
    readonly lastUsed?: string | undefined;
    readonly useCount?: number | undefined;
}
export interface ProviderApiSyntheticRouting {
    readonly backendCount: number;
    readonly keyedBackendCount: number;
    readonly tier: string;
    readonly bestCompositeScore: number | null;
}
export interface ProviderApiModelRouting {
    readonly kind: 'direct' | 'synthetic';
    readonly failoverStrategy: 'none' | 'synthetic-wrapper' | 'same-tier-provider' | 'intra-synthetic';
    readonly alternative?: ProviderApiModelReference | undefined;
    readonly synthetic?: ProviderApiSyntheticRouting | undefined;
}
export interface ProviderApiCatalogBenchmarkRecord extends ProviderApiModelReference {
    readonly kind: 'catalog';
    readonly available: boolean;
    readonly displayName?: string | undefined;
    readonly organization: string;
    readonly sourceName: string;
    readonly benchmarks: ModelBenchmarks;
    readonly compositeScore: number | null;
    readonly qualityTier: QualityTier;
}
export interface ProviderApiSyntheticBenchmarkRecord extends ProviderApiModelReference {
    readonly kind: 'synthetic';
    readonly available: boolean;
    readonly displayName?: string | undefined;
    readonly backendCount: number;
    readonly keyedBackendCount: number;
    readonly tier: string;
    readonly compositeScore: number | null;
    readonly qualityTier?: QualityTier | undefined;
}
export type ProviderApiBenchmarkRecord = ProviderApiCatalogBenchmarkRecord | ProviderApiSyntheticBenchmarkRecord;
export interface ProviderApiModelRecord extends ProviderApiModelReference {
    readonly displayName: string;
    readonly description: string;
    readonly selectable: boolean;
    readonly current: boolean;
    readonly capabilities: ModelDefinition['capabilities'];
    readonly contextWindow: number;
    readonly tier?: ModelDefinition['tier'] | undefined;
    readonly reasoningEffort?: readonly string[] | undefined;
    readonly favorite: ProviderApiFavoriteState;
    readonly benchmark?: ProviderApiBenchmarkRecord | undefined;
    readonly routing: ProviderApiModelRouting;
}
export interface ProviderApiFavoriteRecord {
    readonly registryKey: string;
    readonly available: boolean;
    readonly modelId?: string | undefined;
    readonly providerId?: string | undefined;
    readonly displayName?: string | undefined;
    readonly pinnedAt?: string | undefined;
    readonly lastUsed?: string | undefined;
    readonly useCount?: number | undefined;
}
export interface ProviderApiFavoritesSnapshot {
    readonly pinned: readonly ProviderApiFavoriteRecord[];
    readonly recent: readonly ProviderApiFavoriteRecord[];
}
export interface ProviderApiModelQuery {
    readonly providerId?: string | undefined;
    readonly selectableOnly?: boolean | undefined;
    readonly favorites?: 'all' | 'pinned' | 'recent' | undefined;
}
export interface ProviderApiBenchmarkQuery {
    readonly registryKeys?: readonly string[] | undefined;
    readonly limit?: number | undefined;
}
export interface ProviderApiCatalogRefreshResult {
    readonly modelCount: number;
    readonly providerCount: number;
}
export type ProviderApiRuntimeQuery = {
    readonly scope: 'all';
} | {
    readonly scope: 'provider';
    readonly providerId: string;
} | {
    readonly scope: 'usage';
    readonly providerId: string;
};
export type ProviderApiRuntimeQueryResult = {
    readonly scope: 'all';
    readonly snapshots: readonly ProviderRuntimeSnapshot[];
} | {
    readonly scope: 'provider';
    readonly snapshot: ProviderRuntimeSnapshot | null;
} | {
    readonly scope: 'usage';
    readonly snapshot: ProviderUsageSnapshot | null;
};
export interface ProviderApi {
    listProviderIds(): readonly string[];
    getCurrentModel(): Promise<ProviderApiModelRecord>;
    listModels(query?: ProviderApiModelQuery): Promise<readonly ProviderApiModelRecord[]>;
    selectModel(registryKey: string): Promise<ProviderApiModelRecord>;
    registerDiscoveredProviders(servers: readonly DiscoveredServer[]): Promise<void>;
    refreshCatalog(): Promise<ProviderApiCatalogRefreshResult>;
    refreshBenchmarks(): Promise<number>;
    refreshModelLimits(): Promise<number>;
    getFavorites(): Promise<ProviderApiFavoritesSnapshot>;
    pinModel(registryKey: string): Promise<ProviderApiFavoritesSnapshot>;
    unpinModel(registryKey: string): Promise<ProviderApiFavoritesSnapshot>;
    recordModelUsage(registryKey: string): Promise<ProviderApiFavoritesSnapshot>;
    listBenchmarks(query?: ProviderApiBenchmarkQuery): Promise<readonly ProviderApiBenchmarkRecord[]>;
    queryRuntimeMetadata(query: ProviderApiRuntimeQuery): Promise<ProviderApiRuntimeQueryResult>;
    createHelperModel(configManager: HelperModelDeps['configManager']): HelperModel;
}
export interface ProviderApiRegistry {
    describeRuntime(name: string): Promise<ProviderRuntimeMetadata | null>;
    findAlternativeModel(currentRegistryKey: string): ModelDefinition | null;
    getCostFromCatalog(modelId: string): {
        input: number;
        output: number;
    };
    getPricingForModel(modelId: string, provider: string): {
        prompt: number;
        completion: number;
    } | null;
    getCatalogModelDefinitions(): readonly MinimalModelDefinition[];
    has(id: string): boolean;
    get?(id: string): LLMProvider | undefined;
    require(id: string): LLMProvider;
    tryGet(name: string): LLMProvider | undefined;
    getCurrentModel(): ModelDefinition;
    getContextWindowForModel(modelDef: ModelDefinition): number;
    getForModel(modelId: string, provider?: string): LLMProvider;
    getRegistered(name: string): LLMProvider;
    getSelectableModels(): ModelDefinition[];
    getSyntheticModelInfoFromCatalog(modelId: string): SyntheticModelInfo | null;
    listModels(): ModelDefinition[];
    listProviders(): readonly LLMProvider[];
    registerDiscoveredProviders(servers: DiscoveredServer[]): void;
    refreshCatalog(): Promise<void>;
    refreshModelLimits(): Promise<number>;
    setCurrentModel(registryKey: string): void;
}
export interface ProviderApiFavoritesStore extends Pick<FavoritesStore, 'load' | 'pinModel' | 'recordUsage' | 'unpinModel'> {
}
export interface ProviderApiBenchmarkStore extends Pick<BenchmarkStore, 'getBenchmarks' | 'refreshBenchmarks'> {
}
export interface ProviderApiDependencies {
    readonly providerRegistry: ProviderApiRegistry;
    readonly favoritesStore: ProviderApiFavoritesStore;
    readonly benchmarkStore: ProviderApiBenchmarkStore;
}
export declare function createProviderApi(deps: ProviderApiDependencies): ProviderApi;
export type { ProviderRuntimeSnapshot, ProviderUsageSnapshot };
//# sourceMappingURL=provider-api.d.ts.map