import { AdkError } from '@botpress/analytics';
import type { Agent0CatalogModel, Agent0Warning, Agent0ProviderCatalogEntry } from '../types.js';
import { type BotpressCognitiveModelsFetch } from '../../cognitive/models.js';
export interface Agent0ProviderCatalogSourceListOptions {
    refresh?: boolean;
}
export interface Agent0ProviderCatalogSourceModelResult {
    models: Agent0CatalogModel[];
    warnings: Agent0Warning[];
}
export interface Agent0ProviderCatalogSource {
    readonly id?: string;
    listProviders(): Promise<Agent0ProviderCatalogEntry[]>;
    listModels(options?: Agent0ProviderCatalogSourceListOptions): Promise<Agent0CatalogModel[]>;
    listModelsWithStatus?(options?: Agent0ProviderCatalogSourceListOptions): Promise<Agent0ProviderCatalogSourceModelResult>;
    refresh?(): Promise<void>;
}
export interface Agent0CompositeProviderCatalogSourceOptions {
    sources: Agent0ProviderCatalogSource[];
}
export interface Agent0CognitiveAuth {
    token?: string;
    botId?: string;
    apiUrl?: string;
}
export interface Agent0CognitiveCatalogSourceOptions {
    auth?: Agent0CognitiveAuth;
    resolveAuth?: () => Promise<Agent0CognitiveAuth | undefined>;
    fetch?: BotpressCognitiveModelsFetch;
    now?: () => number;
    cacheTtlMs?: number;
    timeoutMs?: number;
}
export interface Agent0DefaultProviderCatalogSourceOptions {
    cognitive?: Agent0CognitiveCatalogSourceOptions;
    modelsDev?: Agent0ModelsDevCatalogSourceOptions;
}
export interface Agent0ModelsDevFetchResponse {
    ok: boolean;
    status: number;
    text(): Promise<string>;
}
export type Agent0ModelsDevFetch = (url: string, init: {
    headers: Record<string, string>;
    signal?: AbortSignal;
}) => Promise<Agent0ModelsDevFetchResponse>;
export interface Agent0ModelsDevCatalogSourceOptions {
    url?: string;
    fetch?: Agent0ModelsDevFetch;
    now?: () => number;
    cacheTtlMs?: number;
    timeoutMs?: number;
    userAgent?: string;
}
/**
 * The provider catalog comes from an external service (models.dev); fetch,
 * parse, and shape failures are all environment conditions — callers fall
 * back to the bundled static catalog.
 */
export declare class Agent0ProviderCatalogSourceError extends AdkError<'AGENT0_PROVIDER_CATALOG_UNAVAILABLE'> {
    constructor(message: string, cause?: unknown);
}
export declare class Agent0CompositeProviderCatalogSource implements Agent0ProviderCatalogSource {
    readonly id = "agent0-composite";
    private readonly sources;
    constructor(options: Agent0CompositeProviderCatalogSourceOptions);
    listProviders(): Promise<Agent0ProviderCatalogEntry[]>;
    listModels(options?: Agent0ProviderCatalogSourceListOptions): Promise<Agent0CatalogModel[]>;
    listModelsWithStatus(options?: Agent0ProviderCatalogSourceListOptions): Promise<Agent0ProviderCatalogSourceModelResult>;
    refresh(): Promise<void>;
}
export declare class Agent0CognitiveCatalogSource implements Agent0ProviderCatalogSource {
    readonly id = "cognitive";
    private readonly auth;
    private readonly resolveAuth;
    private readonly fetchImpl;
    private readonly now;
    private readonly cacheTtlMs;
    private readonly timeoutMs;
    private cache;
    constructor(options?: Agent0CognitiveCatalogSourceOptions);
    listProviders(): Promise<Agent0ProviderCatalogEntry[]>;
    listModels(options?: Agent0ProviderCatalogSourceListOptions): Promise<Agent0CatalogModel[]>;
    listModelsWithStatus(options?: Agent0ProviderCatalogSourceListOptions): Promise<Agent0ProviderCatalogSourceModelResult>;
    refresh(): Promise<void>;
    private getAuth;
}
export declare class Agent0ModelsDevCatalogSource implements Agent0ProviderCatalogSource {
    readonly id = "models.dev";
    private readonly url;
    private readonly fetchImpl;
    private readonly now;
    private readonly cacheTtlMs;
    private readonly timeoutMs;
    private readonly userAgent;
    private cache;
    constructor(options?: Agent0ModelsDevCatalogSourceOptions);
    listProviders(): Promise<Agent0ProviderCatalogEntry[]>;
    listModels(options?: Agent0ProviderCatalogSourceListOptions): Promise<Agent0CatalogModel[]>;
    refresh(): Promise<void>;
    private fetchModelsDevCatalog;
}
export declare function mapModelsDevCatalog(data: unknown, providers?: Agent0ProviderCatalogEntry[]): Agent0CatalogModel[];
export declare function createAgent0DefaultProviderCatalogSource(options?: Agent0DefaultProviderCatalogSourceOptions): Agent0ProviderCatalogSource;
//# sourceMappingURL=source.d.ts.map