/** * index-guard — 统一命令前索引新鲜度门禁 * * 在 analyze / split / execute / change 等命令执行前, * 检查所有索引层(RAG / 代码 / 知识图谱)是否过期, * 返回标准化的变更摘要供 AI 展示给用户确认。 * * 设计目标: * - 一个入口函数 ensureIndexFresh() 覆盖所有命令 * - 输出标准化格式,AI 可直接展示 * - 非阻塞:只 warn 不阻止执行,但明确提示需要刷新 */ export interface IndexFreshnessResult { /** 是否全部新鲜 */ allFresh: boolean; /** 各层状态 */ layers: { rag: LayerStatus; code: LayerStatus; graph: LayerStatus; }; /** 标准化变更摘要(可直接展示给用户) */ summary: string; /** 建议的刷新命令 */ suggestedCommand: string; } export interface LayerStatus { /** 层名称 */ name: string; /** 是否新鲜 */ fresh: boolean; /** 变更文件数 */ changedCount: number; /** 变更文件列表(最多显示 5 个) */ changedFiles: string[]; /** 人可读的描述 */ message: string; } /** * 统一检查所有索引层的新鲜度 * * 在 analyze / split / execute / change 命令入口调用。 * 返回标准化结果,调用方决定如何展示。 * * @param cwd 工作目录 * @param command 当前执行的命令名(用于生成建议) * @param iteration 迭代名(可选,自动推断) */ export declare function ensureIndexFresh(cwd: string, command: string, iteration?: string): Promise; /** * 在命令入口输出新鲜度检查(非阻塞,只 warn) * * 用法: * await warnIfIndexStale(cwd, 'analyze'); */ export declare function warnIfIndexStale(cwd: string, command: string, iteration?: string): Promise; //# sourceMappingURL=index-guard.d.ts.map