/** 文档目录类型——对应 .pt/ 下三类文档目录 */ export type DocKind = "issue" | "manual" | "design"; /** 扫描结果——单文档的 frontmatter 提取记录 * - filePath:相对 cwd 的路径 * - fileName:去掉 .md 后缀的文件名 * - kind:文档类型 * - frontmatter:parsed YAML;null = 无 frontmatter 或解析失败 * - parseError:YAML 解析错误信息(容错记录,不抛) */ export interface DocRecord { filePath: string; fileName: string; kind: DocKind; frontmatter: Record | null; parseError?: string; } /** 扫描指定 kind 目录的 .md 文件,返回 DocRecord[]。 * - 目录不存在 → 返回 [](不抛,记空) * - 单文件读失败 / frontmatter 解析失败 → frontmatter=null + parseError,继续扫 * - 性能:229 文件 × readFile(全文) + yaml.parse ≈ 50-100ms,无感 */ export declare function scanDocs(cwd: string, kind: DocKind): Promise; /** 按 active profile 过滤。profile 字段形态: * - 缺省 / undefined:全 profile 可见(降级兼容未迁移文档) * - 字符串:`profile === activeProfile` 则包含 * - 数组:`profile.includes(activeProfile)` 则包含 * - activeProfile=null:不激活 profile 模式,返回全部(不过滤) */ export declare function filterByProfile(docs: DocRecord[], activeProfile: string | null): DocRecord[]; /** 按 status 过滤(issue/design/manual 的 status 枚举不同——命令层统一处理)。 * - status=null:不过滤 */ export declare function filterByStatus(docs: DocRecord[], status: string | null): DocRecord[]; /** 统计 parseError 数(命令输出"X parse errors"用) */ export declare function countParseErrors(docs: DocRecord[]): number;