/**
 * Model provider module - integrates built-in models with custom models from models.json
 */
import { type Model, type Api } from '@earendil-works/pi-ai';
import type { Config } from '../config/schema.js';
import type { ProviderModelDefinition } from '../extensions/types/providers.js';
export { getApiKeyFromEnv, PROVIDER_ENV_MAP } from './env-keys.js';
/** Sentinel base URL: model is served by an extension {@link ProviderPluginRegistry} provider. */
export declare const EXTENSION_PROVIDER_BASE_URL = "extension://provider-plugin";
/** Map a plugin registry model to the pi-ai {@link Model} shape. */
export declare function pluginModelToModel(providerId: string, definition: ProviderModelDefinition): Model<Api>;
/**
 * Get API key synchronously: checks registry (models.json) first, then environment variables.
 * Use this for Agent's getApiKey callback which must be synchronous.
 */
export declare function getApiKeySync(provider: string): string | undefined;
/**
 * Resolve model reference. Supports:
 * - "provider/modelId" format
 * - "modelId" auto-detection via pi-ai or custom models
 * @throws if model not found
 */
export declare function resolveModel(ref: string): Model<Api>;
export declare function getModelsByProvider(provider: string): readonly Model<Api>[];
export declare function getAllProviders(): string[];
export declare function getApiKey(provider: string): Promise<string | undefined>;
/**
 * Synchronous version for use in non-async contexts
 * Only checks environment variables and registry, not credential system
 */
export declare function isProviderConfiguredSync(provider: string): boolean;
export declare function isProviderConfigured(provider: string): Promise<boolean>;
/** Where runtime {@link getApiKey} resolves the key from (no secret values). */
export type ProviderActiveKeySource = 'none' | 'agent' | 'gateway' | 'oauth' | 'env' | 'models_json' | 'extension';
export declare function getProviderActiveKeySource(provider: string): Promise<ProviderActiveKeySource>;
export declare function getConfiguredProviders(): Promise<string[]>;
export declare function getAllModels(): readonly Model<Api>[];
export declare function getAvailableModels(): Promise<readonly Model<Api>[]>;
export type { Model, Api } from '@earendil-works/pi-ai';
export type ProviderCategory = 'common' | 'specialty' | 'oauth' | 'enterprise' | 'extension';
export interface ProviderMeta {
    name: string;
    category: ProviderCategory;
    supportsOAuth?: boolean;
    supportsApiKey?: boolean;
}
export declare const PROVIDER_META: Record<string, ProviderMeta>;
export declare function getSortedProviders(): string[];
export declare function getProviderDisplayName(provider: string): string;
export declare function providerSupportsOAuth(provider: string): boolean;
export declare function providerSupportsApiKey(provider: string): boolean;
/**
 * Get a default model reference.
 * Priority:
 * 1. Explicitly configured model in agents.defaults.model (if set and available)
 * 2. Default fallback: deepseek/deepseek-v4-flash
 */
export declare function getDefaultModel(config?: Config | null | undefined): Promise<string>;
/**
 * Synchronous default model resolution for constructors and sync code paths.
 * Uses catalog/registry only (no async credential checks).
 *
 * When no model is explicitly configured, returns the preferred default
 * (`deepseek/deepseek-v4-flash`) rather than picking an arbitrary first
 * model from the full catalog.
 */
export declare function getDefaultModelSync(config?: Config | null | undefined): string;
export { ModelRegistry, getModelRegistry, resetModelRegistry, prewarmModelRegistry } from './model-registry.js';
