import type { Readable, Writable } from "node:stream"; import type { AdmittedChatSession, CloseReport } from "./session.js"; /** Bound on buffered output records waiting for a slow reader before input is paused. Provisional. */ export declare const MAX_PENDING_OUTPUT_BYTES: number; /** * Split decoded text into complete lines. A line longer than {@link MAX_REQUEST_LINE} is discarded * up to its next newline, and reported once with no content. A trailing `\r` before `\n` is dropped * (CRLF input). StringDecoder decodes invalid UTF-8 as U+FFFD, which never splits a line. In ordinary * string content it can reach the request as U+FFFD; in an escape sequence or outside a string it * makes the JSON parse refuse. */ export declare class LineFramer { private readonly onLine; private readonly onOversize; private readonly decoder; private buffer; private discarding; constructor(onLine: (line: string) => void, onOversize: () => void); push(chunk: Buffer | string): void; /** End of input: flush a final unterminated line, if any. */ end(): void; private feed; } /** * Run one `--stdio` session over the given streams until stdin ends or the session ends. * Returns the close report. The caller owns admission (it passes an already admitted session) * and the process exit code; this function never exits the process. */ export declare function runStdio(opts: { session: AdmittedChatSession; stdin: Readable; stdout: Writable; diagnostic: (line: string) => void; }): Promise; //# sourceMappingURL=stdio-io.d.ts.map