/**
 * SF file parser type definitions.
 *
 * Types for the native Rust parser that handles `.sf/` directory files
 * containing YAML-like frontmatter and markdown sections.
 */

export interface FrontmatterResult {
	/** Parsed frontmatter as a JSON string of key-value pairs. */
	metadata: string;
	/** Body content after the frontmatter block. */
	body: string;
}

export interface SectionResult {
	/** The section content, or empty string if not found. */
	content: string;
	/** Whether the section was found. */
	found: boolean;
}

export interface ParsedSfFile {
	/** Relative path from the base directory. */
	path: string;
	/** Parsed frontmatter as JSON string. */
	metadata: string;
	/** Body content after frontmatter. */
	body: string;
	/** Map of section heading to content, serialized as JSON. */
	sections: string;
	/** Original raw file content. */
	rawContent: string;
}

export interface BatchParseResult {
	/** All parsed files. */
	files: ParsedSfFile[];
	/** Number of files processed. */
	count: number;
}

export interface NativeRoadmapSlice {
	id: string;
	title: string;
	risk: string;
	depends: string[];
	done: boolean;
	demo: string;
}

export interface NativeBoundaryMapEntry {
	fromSlice: string;
	toSlice: string;
	produces: string;
	consumes: string;
}

export interface NativeRoadmap {
	title: string;
	vision: string;
	successCriteria: string[];
	slices: NativeRoadmapSlice[];
	boundaryMap: NativeBoundaryMapEntry[];
}

export interface SfTreeEntry {
	path: string;
	name: string;
	isDir: boolean;
}

export interface JsonlParseResult {
	entries: string;
	count: number;
	truncated: boolean;
}

export interface NativeTaskEntry {
	id: string;
	title: string;
	description: string;
	done: boolean;
	estimate: string;
	files: string[];
	verify: string;
}

export interface NativePlan {
	id: string;
	title: string;
	goal: string;
	demo: string;
	mustHaves: string[];
	tasks: NativeTaskEntry[];
	filesLikelyTouched: string[];
}

export interface NativeSummaryRequires {
	slice: string;
	provides: string;
}

export interface NativeSummaryFrontmatter {
	id: string;
	parent: string;
	milestone: string;
	provides: string[];
	requires: NativeSummaryRequires[];
	affects: string[];
	keyFiles: string[];
	keyDecisions: string[];
	patternsEstablished: string[];
	drillDownPaths: string[];
	observabilitySurfaces: string[];
	duration: string;
	verificationResult: string;
	completedAt: string;
	blockerDiscovered: boolean;
}

export interface NativeFileModified {
	path: string;
	description: string;
}

export interface NativeSummary {
	frontmatter: NativeSummaryFrontmatter;
	title: string;
	oneLiner: string;
	whatHappened: string;
	deviations: string;
	filesModified: NativeFileModified[];
}
