/**
 * Environment variable builder for CLIProxy
 * Handles env var construction, merging, and remote URL rewriting
 */
/// <reference types="node" />
/// <reference types="bun-types" />
import type { CLIProxyProvider, ProviderModelMapping } from '../types';
import type { CompositeTierConfig } from '../../config/unified-config-types';
/** Remote proxy configuration for URL rewriting */
export interface RemoteProxyRewriteConfig {
    host: string;
    port?: number;
    protocol: 'http' | 'https';
    authToken?: string;
}
/**
 * Get model mapping for provider
 * Loads from config/base-{provider}.settings.json
 */
export declare function getModelMapping(provider: CLIProxyProvider): ProviderModelMapping;
/**
 * Get environment variables for Claude CLI (bundled defaults)
 * Uses provider-specific endpoint (e.g., /api/provider/gemini) for explicit routing.
 * This enables concurrent gemini/codex usage - each session routes to its provider via URL path.
 */
export declare function getClaudeEnvVars(provider: CLIProxyProvider, port?: number): NodeJS.ProcessEnv;
/**
 * Resolve the provider settings path, migrating legacy Cursor provider settings into
 * the dedicated cliproxy/providers namespace on first access.
 */
export declare function resolveProviderSettingsPath(provider: CLIProxyProvider): string;
/**
 * Get effective environment variables for provider
 *
 * Priority order:
 * 1. Custom settings path (for user-defined CLIProxy variants)
 * 2. User settings file (~/.ccs/{provider}.settings.json) if exists
 * 3. Bundled defaults from PROVIDER_CONFIGS
 *
 * All results are merged with global_env vars (telemetry/reporting disables).
 * User takes full responsibility for custom settings.
 *
 * If remoteRewriteConfig is provided, localhost URLs are rewritten to remote server.
 */
export declare function getEffectiveEnvVars(provider: CLIProxyProvider, port?: number, customSettingsPath?: string, remoteRewriteConfig?: RemoteProxyRewriteConfig): NodeJS.ProcessEnv;
/**
 * Copy bundled settings template to user directory if not exists
 * Called during installation/first run
 */
export declare function ensureProviderSettings(provider: CLIProxyProvider): void;
/**
 * Get environment variables for remote proxy mode.
 * Uses the remote proxy's provider endpoint as the base URL.
 * Respects user model settings from custom settings path or provider settings file.
 *
 * @param provider CLIProxy provider (gemini, codex, agy, qwen, iflow)
 * @param remoteConfig Remote proxy connection details
 * @param customSettingsPath Optional path to user's custom settings file
 * @returns Environment variables for Claude CLI
 */
export declare function getRemoteEnvVars(provider: CLIProxyProvider, remoteConfig: {
    host: string;
    port?: number;
    protocol: 'http' | 'https';
    authToken?: string;
}, customSettingsPath?: string): Record<string, string>;
/** Remote config for composite variant (passed from env-resolver) */
export interface CompositeRemoteConfig {
    host: string;
    port: number;
    protocol: 'http' | 'https';
    authToken?: string;
}
/**
 * Get environment variables for composite variant.
 * Uses root URL (no /api/provider/ path) for model-based routing.
 * Each tier maps to a different provider's model, routed by CLIProxyAPI.
 *
 * @param tiers Per-tier provider+model mappings
 * @param defaultTier Which tier ANTHROPIC_MODEL equals
 * @param port Local CLIProxy port (ignored if remoteConfig provided)
 * @param customSettingsPath Optional path to user's custom settings file
 * @param remoteConfig Optional remote proxy config (overrides localhost URL/auth)
 */
export declare function getCompositeEnvVars(tiers: {
    opus: CompositeTierConfig;
    sonnet: CompositeTierConfig;
    haiku: CompositeTierConfig;
}, defaultTier: 'opus' | 'sonnet' | 'haiku', port?: number, customSettingsPath?: string, remoteConfig?: CompositeRemoteConfig): Record<string, string>;
//# sourceMappingURL=env-builder.d.ts.map