/** * Configuration management for AI Patch */ interface SavedConfig { apiKey?: string; baseUrl?: string; provider?: string; installId?: string; telemetryEnabled?: boolean; } /** Metadata for a single LLM provider. */ export interface ProviderDef { /** Environment variable holding the API key for this provider. */ apiKeyVar: string; /** Environment variable holding the base URL that the SDK reads. * OpenAI-compatible providers share OPENAI_BASE_URL so the standard * OpenAI SDK picks up a gateway URL automatically. */ baseUrlVar: string; /** Default base URL used when the env var is absent. */ defaultBaseUrl: string; /** Default model used when MODEL env var is absent. */ defaultModel: string; /** Human-readable label shown in the UI. */ label: string; } /** * Central registry of all supported LLM providers. * * Providers that are OpenAI-compatible (use the OpenAI SDK) share * OPENAI_BASE_URL so pointing that variable to a gateway URL works * for all of them without any code changes. * * Providers with their own SDKs (anthropic, gemini) have dedicated * base URL vars that their respective SDKs honour. */ export declare const PROVIDER_DEFS: Record; export declare class Config { baseUrl: string; apiKey: string; provider: string; model?: string | undefined; constructor(baseUrl: string, apiKey: string, provider: string, model?: string | undefined); static autoDetect(provider?: string): Config; isValid(): boolean; getMissingVars(): string; } /** * Load saved configuration from home directory (~/.ai-patch/config.json) * Returns null if file doesn't exist or can't be read */ export declare function loadSavedConfig(): SavedConfig | null; /** * Save configuration to home directory (~/.ai-patch/config.json) * Creates directory if it doesn't exist * Sets permissions to 0600 on Unix systems * Returns list of fields that were saved */ export declare function saveConfig(config: SavedConfig): string[]; /** * Auto-detect provider from environment variables. * * Returns tuple of [provider, detectedKeys, selectedKeyName, warningMessage] */ export declare function autoDetectProvider(providerFlag?: string, canPrompt?: boolean): [string, string[], string | null, string | null]; /** * Get or create install_id for telemetry * * - Loads from config if exists * - Generates new UUID if not * - Saves to config automatically * * Returns: [installId, isFirstRun] */ export declare function getOrCreateInstallId(): [string, boolean]; export {}; //# sourceMappingURL=config.d.ts.map