UNPKG

@yeepay/coderocket-mcp

Version:

CodeRocket MCP - Independent AI-powered code review server for Model Context Protocol

76 lines 2.14 kB
/** * 提示词管理器 * * 支持层级查找和coderocket-cli兼容的提示词管理: * 1. 项目级提示词 (./prompts/) * 2. 全局级提示词 (~/.coderocket/prompts/) * 3. 默认提示词 (内置) * * 兼容coderocket-cli的文件命名方式,支持两个项目共享提示词文件 */ export declare class PromptManager { private static prompts; private static initialized; private static readonly PROMPT_FILE_MAPPING; /** * 初始化提示词系统 */ static initialize(): Promise<void>; /** * 加载所有提示词 */ private static loadPrompts; /** * 层级加载提示词文件:项目级 -> 全局级 -> 默认值 */ private static loadPromptWithFallback; /** * 尝试从指定目录加载提示词文件 */ private static tryLoadPromptFile; /** * 设置默认提示词 */ private static setDefaultPrompt; /** * 加载单个提示词(公共方法,用于测试) */ static loadPrompt(key: string): Promise<string | null>; /** * 清除缓存(用于测试) */ static clearCache(): void; /** * 获取默认提示词(用于测试) */ static getDefaultPrompt(): string; /** * 获取提示词文件的查找路径(用于调试) */ static getPromptPaths(filename: string): string[]; /** * 获取提示词 */ static getPrompt(key: string, variables?: Record<string, string>): string; /** * 构建完整的提示词 */ static buildPrompt(toolKey: string, content: string, customPrompt?: string, language?: string): string; /** * 获取所有可用的提示词键 */ static getAvailablePrompts(): string[]; /** * 检查提示词是否存在 */ static hasPrompt(key: string): boolean; /** * 动态设置提示词(用于测试或运行时修改) */ static setPrompt(key: string, content: string): void; /** * 清除所有提示词(用于测试) */ static clear(): void; } //# sourceMappingURL=PromptManager.d.ts.map