/**
 * Provider Manager
 *
 * Central manager for multi-LLM provider orchestration.
 * Handles provider registration, selection, routing, and lifecycle management.
 * Acts as the single point of entry for the application to access AI capabilities.
 */
import { EventEmitter } from 'events';
import type { AIProvider } from './base-provider.js';
import type { ProviderType, ProviderConfig, CompletionOptions, LLMResponse, StreamChunk } from './types.js';
/**
 * Manages the lifecycle and selection of AI providers.
 * Allows switching between providers (Grok, Claude, OpenAI) at runtime
 * and selecting the best provider based on task requirements.
 */
export declare class ProviderManager extends EventEmitter {
    private providers;
    private activeProvider;
    private configs;
    /**
     * Registers and initializes a new provider.
     * If the provider is already registered, it will be re-initialized with the new config.
     *
     * @param type - The type of provider to register (e.g., 'grok', 'claude').
     * @param config - The configuration for the provider.
     * @throws Error if initialization fails.
     */
    registerProvider(type: ProviderType, config: ProviderConfig): Promise<void>;
    /**
     * Factory method to create provider instances.
     */
    private createProvider;
    /**
     * Sets the currently active provider for general queries.
     *
     * @param type - The provider type to make active.
     * @throws Error if the provider is not registered.
     */
    setActiveProvider(type: ProviderType): void;
    /**
     * Retrieves the currently active provider instance.
     *
     * @returns The active AIProvider.
     * @throws Error if no provider is active.
     */
    getActiveProvider(): AIProvider;
    /**
     * Retrieves a specific provider instance by type.
     *
     * @param type - The provider type to retrieve.
     * @returns The provider instance or undefined if not registered.
     */
    getProvider(type: ProviderType): AIProvider | undefined;
    /**
     * Returns a list of all currently registered provider types.
     */
    getRegisteredProviders(): ProviderType[];
    /**
     * Returns the type identifier of the currently active provider.
     */
    getActiveProviderType(): ProviderType;
    /**
     * Automatically selects the best provider based on specific requirements.
     * Useful for routing tasks to the most capable or cost-effective model.
     *
     * Logic:
     * 1. Checks for vision requirements.
     * 2. Checks for long context requirements.
     * 3. Checks for cost sensitivity.
     * 4. Fallbacks to the active provider.
     *
     * @param options - Requirements for the task.
     * @returns The type of the selected provider.
     */
    selectBestProvider(options: {
        requiresToolUse?: boolean;
        requiresVision?: boolean;
        requiresLongContext?: boolean;
        costSensitive?: boolean;
    }): Promise<ProviderType>;
    /**
     * Sends a completion request to the active provider.
     *
     * @param options - Completion options.
     * @returns The LLM response.
     */
    complete(options: CompletionOptions): Promise<LLMResponse>;
    /**
     * Streams a completion response from the active provider.
     *
     * @param options - Completion options.
     * @returns Async iterable of stream chunks.
     */
    stream(options: CompletionOptions): AsyncIterable<StreamChunk>;
    /**
     * Cleans up all providers and resets the manager.
     */
    dispose(): void;
}
/**
 * Gets the singleton instance of the ProviderManager.
 * Creates a new instance if one doesn't exist.
 */
export declare function getProviderManager(): ProviderManager;
/**
 * Resets the singleton instance (useful for testing).
 */
export declare function resetProviderManager(): void;
/**
 * Automatically configures providers based on available environment variables.
 * Scans for GROK_API_KEY, ANTHROPIC_API_KEY, OPENAI_API_KEY, and GEMINI_API_KEY.
 *
 * @returns The configured ProviderManager instance.
 */
export declare function autoConfigureProviders(): Promise<ProviderManager>;
