/**
* Tool Description Manager
*
* Manages externalized tool descriptions with graceful fallback to defaults.
* Methodology-specific overlays are sourced solely from runtime YAML definitions (SOT); config
* may define baseline/non-methodology text but methodology entries are ignored (warned).
* Follows established ConfigManager pattern for consistency with existing architecture.
*/
import { EventEmitter } from 'events';
import { ConfigManager } from '../config/index.js';
import { FrameworkStateManager } from '../frameworks/framework-state-manager.js';
import { Logger } from '../logging/index.js';
import type { ToolDescription } from '../types/index.js';
export declare function getDefaultToolDescription(toolName: string): ToolDescription | undefined;
/**
* Manages tool descriptions loaded from external configuration with hot-reload support
*/
export declare class ToolDescriptionManager extends EventEmitter {
private logger;
private configPath;
private activeConfigPath;
private fallbackConfigPath;
private legacyFallbackPath;
private descriptions;
private defaults;
private methodologyDescriptions;
private isInitialized;
private fileWatcher;
private isWatching;
private reloadDebounceTimer;
private configManager;
private frameworksConfig;
private frameworksConfigListener;
private frameworkStateManager?;
private lastLoadSource;
private frameworkSwitchedListener?;
private frameworkToggledListener?;
constructor(logger: Logger, configManager: ConfigManager);
/**
* Normalize methodology keys for consistent lookup (case-insensitive)
*/
private normalizeMethodologyKey;
/**
* Create default descriptions as fallback
*/
private createDefaults;
/**
* Warn if config attempts to define methodology-specific overlays (YAML is SOT for methodology).
*/
private warnOnMethodologyConfigLeak;
/**
* Pre-load all methodology descriptions for dynamic switching
* Uses RuntimeMethodologyLoader for YAML-based methodology loading
*/
private preloadMethodologyDescriptions;
private readToolDescriptionsConfig;
private createConfigFromMap;
private loadBaseConfig;
private setDescriptionsFromConfig;
private getActiveFrameworkContext;
private buildActiveConfig;
private maybePersistActiveConfig;
private synchronizeActiveConfig;
setFrameworkStateManager(frameworkStateManager: FrameworkStateManager): void;
/**
* Initialize by loading descriptions from external config file
*/
initialize(): Promise<void>;
/**
* Get description for a specific tool with corrected priority hierarchy
*/
getDescription(toolName: string, frameworkEnabled?: boolean, activeMethodology?: string, options?: {
applyMethodologyOverride?: boolean;
}): string;
/**
* Get parameter description for a specific tool parameter
*/
getParameterDescription(toolName: string, paramName: string, frameworkEnabled?: boolean, activeMethodology?: string, options?: {
applyMethodologyOverride?: boolean;
}): string | undefined;
/**
* Get all available tool names
*/
getAvailableTools(): string[];
/**
* Check if manager is properly initialized
*/
isReady(): boolean;
/**
* Get configuration path for debugging
*/
getConfigPath(): string;
/**
* Get statistics about loaded descriptions
*/
getStats(): {
totalDescriptions: number;
loadedFromFile: number;
usingDefaults: number;
configPath: string;
isInitialized: boolean;
source: string;
};
/**
* Start watching the tool descriptions file for changes
*/
startWatching(): void;
/**
* Stop watching the tool descriptions file
*/
stopWatching(): void;
/**
* Handle file change event with debouncing
*/
private handleFileChange;
/**
* Reload descriptions from file
*/
reload(): Promise<void>;
/**
* Check if file watching is active
*/
isWatchingFile(): boolean;
/**
* Cleanup resources on shutdown
*/
shutdown(): void;
}
/**
* Factory function following established pattern
*/
export declare function createToolDescriptionManager(logger: Logger, configManager: ConfigManager): ToolDescriptionManager;