/** * Thin parse-diff wrapper for `diff-semantic-index`. * * Converts raw `git diff` text into a structured summary that the LLM * handler can use as a pre-processed prompt prefix (paths, line counts, roles) * instead of forcing the model to scan raw unified-diff bytes. * * parse-diff v0.12 handles unified diff output from standard `git diff`. * Binary files come back with zero additions/deletions — we surface them * with `lines_changed: 0` and skip their bytes in the prompt. * * Never throws: a try/catch around the third-party call returns an empty * result on parse failure so the caller can still attempt the LLM call * with the raw text as a fallback. */ export interface DiffFileSummary { path: string; role: 'added' | 'modified' | 'deleted' | 'renamed'; lines_changed: number; /** True when the path looks like a test/spec file. Used to compute * test_coverage_hint without requiring the LLM to infer it. */ is_test: boolean; } export interface ParsedDiff { files: DiffFileSummary[]; total_additions: number; total_deletions: number; } /** * Parse raw unified diff text (typically `git diff` or `git diff --staged` * output) into a typed summary. * * @param diffText Raw diff string. May be empty — returns empty result. * @returns Structured summary; never throws. */ export declare function parseDiffText(diffText: string): ParsedDiff; /** * Derive `test_coverage_hint` from a parsed diff without running the LLM. * Result fed into the output schema so the model can confirm or correct it. */ export declare function deriveTestCoverageHint(parsed: ParsedDiff): 'tests_added' | 'tests_modified' | 'no_test_change' | 'unclear'; /** * Format a ParsedDiff as a compact prompt section the LLM can read quickly. * Placed before the raw diff in the user message so the model has a * structured index before scanning the raw hunks. */ export declare function formatParsedDiffForPrompt(parsed: ParsedDiff): string; //# sourceMappingURL=parse.d.ts.map