woaru
Version:
Universal Project Setup Autopilot - Analyze and automatically configure development tools for ANY programming language
168 lines • 5.37 kB
TypeScript
import { type AIConfigFile } from '../schemas/ai-config.schema';
/**
* ConfigManager - Secure management of WOARU configuration and API keys
* Handles global .env file creation, security measures, and key storage
*/
export declare class ConfigManager {
private static instance;
private woaruDir;
private configDir;
private envFile;
private aiConfigFile;
private userConfigFile;
private constructor();
static getInstance(): ConfigManager;
/**
* Initialize the WOARU configuration directory and security measures
*/
initialize(): Promise<void>;
/**
* Store an API key securely in the global .env file
*/
storeApiKey(provider: string, apiKey: string): Promise<void>;
/**
* Load all environment variables from the global .env file
*/
loadEnvironmentVariables(): Promise<void>;
/**
* Get the path to the .env file
*/
getEnvFilePath(): string;
/**
* Check if an API key exists for a provider
*/
hasApiKey(provider: string): Promise<boolean>;
/**
* Alias for storeApiKey to maintain API compatibility
*/
saveApiKey(provider: string, apiKey: string): Promise<void>;
/**
* Get an API key for a provider
*/
getApiKey(provider: string): Promise<string | undefined>;
/**
* List all configured providers
*/
getConfiguredProviders(): Promise<string[]>;
/**
* Remove an API key for a provider
*/
removeApiKey(provider: string): Promise<void>;
/**
* Store AI configuration in global config file with Zod schema validation
* 🛡️ REGEL: Alle Konfigurationsdateien MÜSSEN vor dem Speichern validiert werden
*/
storeAiConfig(config: Record<string, unknown>): Promise<void>;
/**
* Load AI configuration from global config file with Zod schema validation
* 🛡️ REGEL: Alle Konfigurationsdateien MÜSSEN validiert werden
*/
loadAiConfig(): Promise<AIConfigFile | Record<string, unknown>>;
/**
* Save AI configuration to global config file
*/
saveAiConfig(config: Record<string, unknown>): Promise<void>;
/**
* Check if a key is a metadata or configuration key (not a provider)
*/
private isMetadataKey;
/**
* Get all configured AI providers
*/
getConfiguredAiProviders(): Promise<string[]>;
/**
* Get AI config file path
*/
getAiConfigFilePath(): string;
/**
* @deprecated Use storeAiConfig() instead
* Backward compatibility alias for storing AI configuration
*/
storeLlmConfig(config: Record<string, unknown>): Promise<void>;
/**
* @deprecated Use loadAiConfig() instead
* Backward compatibility alias for loading AI configuration
*/
loadLlmConfig(): Promise<Record<string, unknown>>;
/**
* @deprecated Use getConfiguredAiProviders() instead
* Backward compatibility alias for getting configured providers
*/
getConfiguredLlmProviders(): Promise<string[]>;
/**
* @deprecated Use getAiConfigFilePath() instead
* Backward compatibility alias for getting config file path
*/
getLlmConfigFilePath(): string;
/**
* Get config directory path
*/
getConfigDirPath(): string;
/**
* Get Multi-AI Review configuration
*/
getMultiAiReviewConfig(): Promise<{
enabled: boolean;
primaryProvider: string | null;
}>;
/**
* Update Multi-AI Review configuration
*/
updateMultiAiReviewConfig(enabled: boolean, primaryProvider?: string | null): Promise<void>;
/**
* Get all enabled AI providers
*/
getEnabledAiProviders(): Promise<string[]>;
/**
* Count configured AI providers
*/
getConfiguredProviderCount(): Promise<number>;
/**
* Create an empty .env file with header
*/
private createEmptyEnvFile;
/**
* Create an empty AI config file
*/
private createEmptyAiConfigFile;
/**
* Set secure file permissions (600 - owner read/write only)
*/
private setSecurePermissions;
/**
* Setup git ignore protection to prevent accidental commits
*/
private setupGitIgnoreProtection;
/**
* Add .env protection to gitignore file
*/
private addToGitIgnore;
/**
* Migration function: Automatically migrate legacy llm_config.json to ai_config.json
* This ensures existing user configurations are not lost during refactoring
*/
private migrateLegacyConfiguration;
/**
* Load user configuration from global user config file with schema validation
* 🛡️ REGEL: Alle User-Konfigurationen MÜSSEN validiert werden
*/
loadUserConfig(): Promise<Record<string, unknown>>;
/**
* Store user configuration in global user config file with schema validation
* 🛡️ REGEL: Alle User-Konfigurationen MÜSSEN vor dem Speichern validiert werden
*/
storeUserConfig(config: Record<string, unknown>): Promise<void>;
/**
* Set user's preferred language
*/
setUserLanguage(language: string): Promise<void>;
/**
* Get user's preferred language
*/
getUserLanguage(): Promise<string | null>;
/**
* Get user config file path
*/
getUserConfigFilePath(): string;
}
//# sourceMappingURL=ConfigManager.d.ts.map