/** * Split a rendered tool response into result blocks. Blocks are delimited by * `## path:lines` or `## path (…)` headers — the convention used by every * search-family tool. Anything before the first `##` is treated as preamble * (header text, result count) and preserved verbatim. */ export declare function splitBlocks(text: string): { preamble: string; blocks: string[]; trailer: string; }; /** * Keep only blocks whose body matches the given regex. Returns the rebuilt * text plus a one-line "filtered N→K" footer. */ export declare function grepResults(text: string, pattern: string): { text: string; kept: number; total: number; }; /** * Keep only the first N blocks. No-op when N >= total. */ export declare function headResults(text: string, n: number): { text: string; kept: number; total: number; }; /** * Byte-slice into a single block (by zero-based index). Returns the slice plus * the header line for context. */ export declare function ctxPeek(text: string, hitIndex: number, offset: number, len: number): { text: string; found: boolean; };