/** * Exec result formatting, turns an ExecCommandResult into the record the tool * returns, honoring the caller's verbosity. * * Split out of runtime.ts so the denial branch below has room to state its * reasoning; runtime.ts is at a shrink-only line ceiling. * * Shaping rule for this module: it may show LESS, but it may never let the * caller believe it showed everything. `minimal` used to return * `stdout.split('\n')[0]` bare, so a 42-line device listing arrived as one line * that read exactly like a complete answer, and the reader concluded the other * 41 devices did not exist. Every drop this module performs, line clamping for * verbosity, or an upstream overflow cut, now leaves a counted marker in the * stream text itself, at every verbosity, for stdout and stderr both. */ import type { ExecCommandResult, ExecVerbosity } from './schema.js'; /** * Shape one stream for a verbosity and disclose whatever the shaping removed. * * Two different things can remove content, and both used to be invisible at * `minimal`: * - verbosity line clamping (this function), and * - the upstream overflow cut that sets `stdout_truncated`/`stderr_truncated` * (runtime.ts `truncate`), which `minimal` did not even forward as a flag. * * A trailing newline is not counted as a line, so the reported count is the * number of real lines the caller cannot see. * * @param text - The full stream text as captured. * @param stream - Which stream, named in the marker. * @param keptLines - Leading lines to keep, or null for all. * @param overflowTruncated - Whether the stream was already cut for size. * @returns The shaped text (markers appended) and the dropped line count. */ export declare function shapeStream(text: string, stream: 'stdout' | 'stderr', keptLines: number | null, overflowTruncated: boolean): { text: string; droppedLines: number; }; export declare function formatResult(result: ExecCommandResult, verbosity: ExecVerbosity): Record; //# sourceMappingURL=result-format.d.ts.map