import { EventEmitter } from 'events'; import { ValidationResult } from '../types/index.js'; import { McpRuleBase } from '../types/rules.js'; /** * Class responsible for loading and monitoring external .mcprules files * (previously called .clinerules files, renamed for MCP-server independence) */ export declare class ExternalRulesLoader extends EventEmitter { private projectDir; private rules; private watchers; /** * Creates a new instance of the external rules loader * @param projectDir Project directory (default: current directory) */ constructor(projectDir?: string); /** * Gets a writable directory for storing .mcprules files * Uses only the specified project directory without fallbacks * @returns A writable directory path */ private getWritableDirectory; /** * Validates that all required .mcprules files exist. * Does NOT auto-create missing files — use createMissingMcpRules() explicitly. * Also checks for legacy .clinerules files for backward compatibility. * @returns Validation result with missing and existing files */ validateRequiredFiles(): Promise; /** * Detects and loads all .mcprules files in the project directory * Also supports legacy .clinerules files for backward compatibility */ detectAndLoadRules(): Promise>; /** * Parses the content of a rule file * @param content File content * @returns Parsed rule object or null if invalid */ private parseRuleContent; /** * Sets up a watcher for a rule file * @param filePath File path * @param mode Mode associated with the file */ private watchRuleFile; /** * Stops watching all rule files */ stopWatching(): void; /** * Gets the rules for a specific mode * @param mode Mode name * @returns Rules for the specified mode or null if not found */ getRulesForMode(mode: string): McpRuleBase | null; /** * Checks if a specific mode is available * @param mode Mode name * @returns true if the mode is available, false otherwise */ hasModeRules(mode: string): boolean; /** * Gets all available modes * @returns Array with the names of available modes */ getAvailableModes(): string[]; /** * Cleans up all resources */ dispose(): void; /** * Creates missing .mcprules files * @param missingFiles Array of missing file names * @returns Array of created file names */ createMissingMcpRules(missingFiles: string[]): Promise; /** * @deprecated Use createMissingMcpRules instead */ createMissingClinerules(missingFiles: string[]): Promise; } //# sourceMappingURL=ExternalRulesLoader.d.ts.map