/** * Live Configuration Manager * * Orchestrates live configuration reload functionality including: * - Hook configuration watching and reloading * - Configuration file watching for settings.json files * - Coordination between file watchers and configuration updates */ import { Container } from "../utils/container.js"; import type { WaveConfiguration } from "../types/configuration.js"; export interface LiveConfigManagerOptions { workdir: string; onReload?: (config: WaveConfiguration) => void; } export declare class LiveConfigManager { private container; private options; private readonly workdir; private isInitialized; private currentConfiguration; private lastValidConfiguration; private fileWatcher; private userConfigPaths?; private projectConfigPaths?; private isWatching; private reloadInProgress; constructor(container: Container, options: LiveConfigManagerOptions); private get hookManager(); private get permissionManager(); private get configurationService(); /** * Initialize configuration watching * Maps to FR-004: System MUST watch settings.json files * Supports watching multiple file paths (e.g., local settings.local.json and settings.json) */ private initializeWatching; /** * Get current configuration */ getCurrentConfiguration(): WaveConfiguration | null; /** * Initialize configuration management with file watching */ initialize(): Promise; /** * Shutdown configuration management and cleanup resources */ shutdown(): Promise; /** * Reload configuration from files * Maps to FR-008: Continue with previous valid configuration on errors */ private reloadConfiguration; /** * Reload configuration from files (public method) */ reload(): Promise; /** * Check if watching is active */ isWatchingActive(): boolean; /** * Get watcher status for monitoring */ getWatcherStatus(): { isActive: boolean; configurationLoaded: boolean; hasValidConfiguration: boolean; reloadInProgress: boolean; watchedFiles: { path: string; isActive: boolean; method: "failed" | "native" | "polling"; errorCount: number; }[]; }; private setupFileWatcherEvents; private handleFileChange; private detectChanges; /** * Get configuration file paths for user and project settings * Returns paths in priority order (local.json first, then .json) */ private getConfigurationPaths; }