/** * plan-parser.ts — Parse GSD-1 PLAN.md files into structured data. * * Extracts YAML frontmatter, XML task bodies, and markdown sections * (, , ) from plan files. * * Ported from get-shit-done/bin/lib/frontmatter.cjs with TypeScript types. */ import type { PlanTask, ParsedPlan } from './types.js'; /** * Extract frontmatter from a PLAN.md content string. * * Uses a stack-based parser that handles nested objects, inline arrays, * multi-line arrays, and boolean/numeric coercion. Ported from the CJS * reference implementation with the same edge-case coverage. * * Anchored at the start of the file — only the leading `---...---` block is * considered canonical frontmatter. Body `---` separators and embedded YAML * inside fenced code blocks are never picked up. */ export declare function extractFrontmatter(content: string): Record; /** * Parse XML task blocks from the section. * * Uses a regex to match ... blocks, then extracts * inner elements (name, files, read_first, action, verify, * acceptance_criteria, done). * * Handles: * - Multiline blocks (including code snippets with angle brackets) * - Optional elements (missing elements → empty string/array) * - Both auto and checkpoint task types */ export declare function parseTasks(content: string): PlanTask[]; /** * Parse a GSD-1 PLAN.md content string into a structured ParsedPlan. * * Extracts: * - YAML frontmatter (phase, wave, depends_on, must_haves, etc.) * - section * - references * - file references * - blocks with all inner elements * * Handles edge cases: * - Empty input → empty frontmatter, no tasks * - Missing frontmatter → empty object with defaults * - Malformed XML → partial extraction, no crash */ export declare function parsePlan(content: string): ParsedPlan; /** * Convenience wrapper — reads a PLAN.md file from disk and parses it. */ export declare function parsePlanFile(filePath: string): Promise; //# sourceMappingURL=plan-parser.d.ts.map