/** * Line reassembly for piped harness output. * * The old tees did `chunk.toString().split(/\r?\n/)` per stdout chunk with no * carry-over buffer. Windows pipe reads cap at 64KB per chunk, so any NDJSON * event larger than that (every `read` of a decent-size file, big `write`s) * was cut into fragments; each fragment failed JSON.parse and was printed * RAW into the agent console - the giant "Can not find script file"-style * JSON dump that flooded/broke console streaming (see gotchas.md, "console * stream floods with raw NDJSON"). * * `createLineSink` buffers across chunks and only emits COMPLETE lines * (trailing \r stripped, blank lines dropped - same semantics as the old * per-chunk split). A runaway line without a newline is truncated at * `maxLine` so memory stays bounded, and the rest of that line is discarded * up to the next newline. */ export interface LineSink { /** Feed a decoded chunk (any size, lines may span chunks). */ push(chunk: string): void; /** Emit the trailing partial line (call on child close). */ flush(): void; } /** Memory guard for a single line with no newline (2 MB — real events are whole NDJSON lines). */ export declare const ASSEMBLER_MAX_LINE: number; export declare function createLineSink(onLine: (line: string) => void, opts?: { maxLine?: number; }): LineSink;