/** * 认知锚点加载 — 从 middleware.ts 抽出的独立关切。 * * 职责边界: * - 负责:从 cognitive.map.json 加载与查询匹配的认知锚点 * - 不负责:锚点的写入、陈旧检测算法本身(仅调用 lazyAnchor 暴露的算法) * * 被谁调用:middleware.createToolRegistrar 返回的 loadRelevantAnchors 闭包 * 调用谁:lazyAnchor(懒加载锚点模块)、shared/io/fs * * 数据流:(query, stateDir, projectPath) → 锚点数组 | undefined * 持久化:只读 cognitive.map.json * * 必须提供 query.module 或 query.file_paths,否则返回 undefined(禁止全量加载)。 */ /** 锚点查询参数 */ export interface AnchorQuery { module?: string; file_paths?: string[]; } /** 锚点返回项 */ export interface AnchorResult { anchor_id: string; module: string; summary: string; stale_anchor?: boolean; } /** * 加载与查询匹配的认知锚点。 * * @param query 查询条件(module 或 file_paths 至少一个) * @param stateDir .soloforge// 状态目录路径(cognitive.map.json 所在位置) * @param projectPath 项目根路径(用于校验 file_ref 是否存在) * @returns 锚点数组或 undefined(无匹配/无查询条件/无 map 时) */ export declare function loadRelevantAnchors(query: AnchorQuery, stateDir: string, projectPath: string): Promise;