mcp-adr-analysis-server
Version:
MCP server for analyzing Architectural Decision Records and project architecture
95 lines • 2.59 kB
TypeScript
/**
* CE-MCP Prompt Catalog
*
* Provides lazy loading of prompts - instead of importing all 6,145 lines
* of prompt code upfront, this catalog allows on-demand loading of specific
* prompt sections, reducing token usage by ~96%.
*
* @see ADR-014: CE-MCP Architecture
*/
import { PromptCatalog, PromptCatalogEntry } from '../types/ce-mcp.js';
/**
* Prompt catalog with metadata for lazy loading
*
* Token estimates based on ~4 chars per token average
*/
export declare const PROMPT_CATALOG: PromptCatalog;
/**
* Get total token count if all prompts were loaded
*/
export declare function getTotalPromptTokens(): number;
/**
* Get prompts by category
*/
export declare function getPromptsByCategory(category: PromptCatalogEntry['category']): string[];
/**
* Get prompt metadata
*/
export declare function getPromptMetadata(promptName: string): PromptCatalogEntry | undefined;
/**
* Prompt Loader Service
*
* Handles lazy loading of prompts with caching
*/
export declare class PromptLoader {
private cache;
private cacheTTL;
constructor(cacheTTL?: number);
/**
* Load a specific prompt section
*
* @param promptName - Name of the prompt (e.g., 'adr-suggestion')
* @param section - Optional section within the prompt
* @returns Promise resolving to the prompt content
*/
loadPrompt(promptName: string, section?: string): Promise<string>;
/**
* Load prompt file content
*/
private loadPromptFile;
/**
* Parse sections from prompt content
*/
private parseSections;
/**
* Preload prompts that are commonly used together
*/
preloadPromptGroup(promptNames: string[]): Promise<void>;
/**
* Get estimated tokens for a prompt
*/
getEstimatedTokens(promptName: string, section?: string): number;
/**
* Get recommendations for which prompts to load
*/
getLoadRecommendations(taskType: string): string[];
/**
* Clear cache
*/
clearCache(): void;
/**
* Get cache statistics
*/
getCacheStats(): {
size: number;
entries: string[];
};
}
/**
* Get or create the global prompt loader
*/
export declare function getPromptLoader(cacheTTL?: number): PromptLoader;
/**
* Reset the global prompt loader
*/
export declare function resetPromptLoader(): void;
/**
* Token savings calculation
*/
export declare function calculateTokenSavings(loadedPrompts: string[]): {
loaded: number;
total: number;
saved: number;
percentage: number;
};
//# sourceMappingURL=prompt-catalog.d.ts.map