/** * Parser for the Codex apply-patch format. * Faithful port of Codex codex-rs/apply-patch/src/parser.rs */ import { type ParsedPatch, type UpdateFileChunk } from "./types"; /** * Parse a complete patch string into a ParsedPatch. * Supports optional heredoc wrapping (<<'EOF'...EOF). * Matches Codex lenient parsing mode. */ export declare function parsePatch(patch: string): ParsedPatch; /** * Parse a single update chunk. * Faithful port of Codex parse_update_file_chunk. * * In Codex: * - `@@` or `@@ text` → change_context (single string or null) * - Space-prefixed lines go into BOTH old_lines and new_lines * - Empty lines go into BOTH old_lines and new_lines * - `+` lines go into new_lines only * - `-` lines go into old_lines only * - Other prefixes (or *** markers) terminate the chunk */ export declare function parseUpdateFileChunk(lines: string[], lineNumber: number, allowMissingContext: boolean): { chunk: UpdateFileChunk; linesConsumed: number; };