/** * Bounding command output to protect server memory and the model's token budget. * * Output over budget keeps its head and tail with an elision marker in between. * The process runner bounds every stream while it streams; the commands that * parse a JSON envelope (`query`, `cicd`, `exec`) capture stdout with the much * larger `ENVELOPE_CAPTURE_CHARS` instead, because a cut envelope cannot be * parsed, and bound the result to the normal size only after reading it. */ /** Default cap on the output a tool returns, per stream (characters). */ export declare const DEFAULT_MAX_OUTPUT_CHARS = 60000; /** * Stdout capture cap for commands that parse a JSON envelope (characters). * A query of 100 full records easily passes the default cap, and `exec` allows * 50,001 output lines. */ export declare const ENVELOPE_CAPTURE_CHARS = 8000000; /** * Accumulates streamed text while retaining at most `maxChars` characters — the * head (start of output) plus a sliding tail (most recent output). Memory stays * bounded regardless of how much a child process emits; when output exceeds the * budget the middle is dropped and reported via an elision marker. * `.toString()` reconstructs head + marker + tail. */ export declare class BoundedBuffer { private readonly headMax; private readonly tailMax; private head; private tail; private total; constructor(maxChars?: number); append(text: string): void; private pushTail; /** True when the middle of the output was dropped. */ get truncated(): boolean; toString(): string; } /** Bound already-captured text exactly as the runner bounds a stream. */ export declare function boundText(text: string, maxChars?: number): string; //# sourceMappingURL=boundedOutput.d.ts.map