/**
 * Environment Resolver - Build environment variables for Claude CLI
 *
 * Handles:
 * - Remote proxy environment configuration
 * - Local proxy environment configuration
 * - HTTPS tunnel integration
 * - Proxy chain configuration (CodexReasoning, ToolSanitization)
 * - WebSearch and ImageAnalysis hook integration
 */
import { CLIProxyProvider } from '../types';
import { CompositeTierConfig } from '../../config/unified-config-types';
import { getImageAnalysisHookEnv } from '../../utils/hooks/get-image-analysis-hook-env';
import { resolveImageAnalysisRuntimeStatus } from '../../utils/hooks/image-analysis-runtime-status';
import { hasImageAnalysisProfileHook } from '../../utils/hooks/image-analyzer-profile-hook-injector';
import { hasImageAnalyzerHook } from '../../utils/hooks/image-analyzer-hook-installer';
import { CodexReasoningProxy } from '../ai-providers/codex-reasoning-proxy';
import { ToolSanitizationProxy } from '../proxy/tool-sanitization-proxy';
import { HttpsTunnelProxy } from '../proxy/https-tunnel-proxy';
import type { ProxyTarget } from '../proxy/proxy-target-resolver';
import { getEffectiveApiKey } from '../auth/auth-token-manager';
export interface RemoteProxyConfig {
    host: string;
    port: number;
    protocol: 'http' | 'https';
    authToken?: string;
}
export interface ProxyChainConfig {
    provider: CLIProxyProvider;
    useRemoteProxy: boolean;
    remoteConfig?: RemoteProxyConfig;
    httpsTunnel?: HttpsTunnelProxy;
    tunnelPort?: number;
    codexReasoningProxy?: CodexReasoningProxy;
    codexReasoningPort?: number;
    toolSanitizationProxy?: ToolSanitizationProxy;
    toolSanitizationPort?: number;
    localPort: number;
    customSettingsPath?: string;
    thinkingOverride?: string | number;
    /** Extended context override: true = force on, false = force off, undefined = auto */
    extendedContextOverride?: boolean;
    verbose: boolean;
    /** Composite variant: true when mixing providers per tier */
    isComposite?: boolean;
    /** Composite variant: per-tier provider+model mappings */
    compositeTiers?: {
        opus: CompositeTierConfig;
        sonnet: CompositeTierConfig;
        haiku: CompositeTierConfig;
    };
    /** Composite variant: which tier is the default */
    compositeDefaultTier?: 'opus' | 'sonnet' | 'haiku';
    /** Optional inherited continuity directory from mapped account profile */
    claudeConfigDir?: string;
    /** Execution-aware image analysis env prepared by the caller */
    imageAnalysisEnv?: Record<string, string>;
    /** Optional browser runtime env for Claude browser MCP reuse. */
    browserRuntimeEnv?: Record<string, string>;
}
interface CliproxyImageAnalysisDeps {
    getImageAnalysisHookEnv: typeof getImageAnalysisHookEnv;
    hasImageAnalysisProfileHook: typeof hasImageAnalysisProfileHook;
    hasImageAnalyzerHook: typeof hasImageAnalyzerHook;
    resolveImageAnalysisRuntimeStatus: typeof resolveImageAnalysisRuntimeStatus;
    getLocalRuntimeApiKey: typeof getEffectiveApiKey;
}
interface ResolveCliproxyImageAnalysisEnvOptions {
    profileName: string;
    provider: CLIProxyProvider;
    profileSettingsPath?: string;
    isComposite?: boolean;
    proxyTarget: ProxyTarget;
    tunnelPort?: number | null;
    proxyReachable: boolean;
}
export interface CliproxyImageAnalysisResolution {
    env: Record<string, string>;
    warning: string | null;
}
export declare function resolveCliproxyImageAnalysisEnv(options: ResolveCliproxyImageAnalysisEnvOptions, deps?: Partial<CliproxyImageAnalysisDeps>): Promise<CliproxyImageAnalysisResolution>;
/**
 * Build final environment variables for Claude CLI execution
 * Handles proxy chain ordering and integration with hooks
 */
export declare function buildClaudeEnvironment(config: ProxyChainConfig): Record<string, string>;
/**
 * Log environment configuration for debugging
 */
export declare function logEnvironment(env: Record<string, string>, webSearchEnv: Record<string, string>, verbose: boolean): void;
/** Apply fallback provider config to env vars for a failed tier */
export declare function applyFallback(env: Record<string, string>, failedTier: 'opus' | 'sonnet' | 'haiku', fallback: {
    provider: string;
    model: string;
}): Record<string, string>;
export {};
//# sourceMappingURL=env-resolver.d.ts.map