/** * Shared rendering helpers for grep-style tool outputs. * * Used by both the sandbox (`sandbox-fs.ts`) and host (`host-fs.ts`) * implementations so that agents see a consistent, token-efficient format: * * Found N matches * path/to/file.ts: * L12: * L47: * ... */ export interface GrepMatch { /** 1-based line number. */ line: number; /** Rendered snippet (already clipped to the desired length). */ text: string; } export interface GrepFileMatches { path: string; matches: GrepMatch[]; } export interface RenderOptions { /** When true, append the "Results truncated" footer. */ truncated?: boolean; /** Limit used upstream (shown in the truncation footer). */ limit?: number; } /** Render grouped grep output. `totalMatches` counts pre-group rows. */ export declare function renderGrepResults(grouped: GrepFileMatches[], totalMatches: number, opts?: RenderOptions): string; /** Clip a line of text to a max length, preserving a truncation marker. */ export declare function clipLine(text: string, maxLen: number): string; /** * Given the full matched line and the submatch byte offsets, return a window * of `contextChars` characters around the first submatch. Used to avoid dumping * entire minified lines into the context window. */ export declare function windowAroundSubmatch(line: string, submatchStart: number, submatchEnd: number, contextChars?: number): string; //# sourceMappingURL=search-render.d.ts.map