/**
 * Configuration Resolver
 *
 * Resolves configuration with the correct priority:
 * 1. CLI Arguments (highest priority)
 * 2. Active Profile (user selection)
 * 3. Environment Variables (fallback)
 * 4. Defaults (lowest priority)
 *
 * This replaces the old system where env vars always overrode user settings.
 */
import { EventEmitter } from 'events';
import { ConnectionConfig, ConnectionProfile, ResolvedConfig, CLIOverrides, ServerDetectionResult, ProfileEvents } from './types.js';
/**
 * Resolves configuration with proper priority handling
 */
export declare class ConfigResolver extends EventEmitter {
    private profiles;
    private activeProfileId;
    private envVarsFallback;
    private autoSwitchLocal;
    constructor(config?: Partial<ConnectionConfig>);
    /**
     * Ensure default profiles exist
     */
    private ensureDefaultProfiles;
    /**
     * Resolve configuration with proper priority
     *
     * Priority order (highest to lowest):
     * 1. CLI overrides
     * 2. Active profile
     * 3. Environment variables (if envVarsFallback is true)
     * 4. Built-in defaults
     */
    resolve(cliOverrides?: CLIOverrides): ResolvedConfig;
    /**
     * Resolve from CLI arguments
     */
    private resolveFromCLI;
    /**
     * Resolve from a profile, applying any CLI overrides
     */
    private resolveFromProfile;
    /**
     * Resolve from environment variables
     * Priority: Gemini > Grok > OpenAI > Anthropic
     */
    private resolveFromEnv;
    /**
     * Get built-in default configuration
     */
    private getBuiltinDefault;
    /**
     * Detect provider from URL
     */
    private detectProvider;
    /**
     * Get the active profile
     */
    getActiveProfile(): ConnectionProfile | undefined;
    /**
     * Get active profile ID
     */
    getActiveProfileId(): string;
    /**
     * Set the active profile
     */
    setActiveProfile(profileId: string): boolean;
    /**
     * Get all profiles
     */
    getProfiles(): ConnectionProfile[];
    /**
     * Get enabled profiles only
     */
    getEnabledProfiles(): ConnectionProfile[];
    /**
     * Get a profile by ID
     */
    getProfile(profileId: string): ConnectionProfile | undefined;
    /**
     * Add a new profile
     */
    addProfile(profile: ConnectionProfile): void;
    /**
     * Update an existing profile
     */
    updateProfile(profileId: string, updates: Partial<ConnectionProfile>): boolean;
    /**
     * Remove a profile
     */
    removeProfile(profileId: string): boolean;
    /**
     * Auto-detect available local servers
     */
    autoDetectLocalServers(): Promise<ServerDetectionResult[]>;
    /**
     * Detect if a specific server is available
     */
    detectServer(profile: ConnectionProfile): Promise<ServerDetectionResult>;
    /**
     * Test connection for the active profile
     */
    testConnection(): Promise<ServerDetectionResult>;
    /**
     * Export current configuration
     */
    toConfig(): ConnectionConfig;
    /**
     * Import configuration
     */
    fromConfig(config: ConnectionConfig): void;
    on<K extends keyof ProfileEvents>(event: K, listener: ProfileEvents[K]): this;
    emit<K extends keyof ProfileEvents>(event: K, ...args: Parameters<ProfileEvents[K]>): boolean;
}
/**
 * Get the singleton ConfigResolver instance
 */
export declare function getConfigResolver(): ConfigResolver;
/**
 * Initialize ConfigResolver with custom configuration
 */
export declare function initConfigResolver(config: ConnectionConfig): ConfigResolver;
/**
 * Reset the ConfigResolver singleton (for testing)
 */
export declare function resetConfigResolver(): void;
