/** * Delta Spec 解析器 — 移植自 OpenSpec specs-apply.ts * * 结构化解析 Delta Spec 文件,支持: * - ADDED / MODIFIED / REMOVED / RENAMED 四种操作 * - 需求块提取与规范化 * - 冲突检测(跨段冲突、重复名称、RENAMED+REMOVED 矛盾) * - 幂等性比较(normalizeBlockRaw) */ export type DeltaAction = 'ADDED' | 'MODIFIED' | 'REMOVED' | 'RENAMED'; export interface DeltaBlock { action: DeltaAction; name: string; content: string; rawLines: string[]; } export interface RenameMapping { oldName: string; newName: string; } export interface ParsedDelta { added: DeltaBlock[]; modified: DeltaBlock[]; removed: DeltaBlock[]; renamed: RenameMapping[]; conflicts: string[]; } /** * 解析 Delta Spec 文件内容 */ export declare function parseDelta(content: string): ParsedDelta; /** * 规范化 block 内容(用于幂等性比较) * * - 去除首尾空白 * - 规范化换行符 * - 移除多余空行 */ export declare function normalizeBlockContent(content: string): string; /** * 从现有 spec 文件中提取指定需求块 */ export declare function extractRequirementBlock(content: string, requirementName: string): string | null; /** * 检查两个 block 是否内容相同(幂等性) */ export declare function isBlockIdentical(a: string, b: string): boolean; //# sourceMappingURL=delta-parser.d.ts.map