/** * Liveness checks for the stdio streams the logging layer writes to. * * Shared by `StdoutSink` (which stops writing to a dead stream) and the * runner's `watchOutputStream` (which stops the loop, and exits only when its * caller owns the process), so the two cannot disagree about what "dead" means. * See `_devlog/notes/2026-09-07-stdout-epipe-log-loop.md`. */ /** * Structural subset of `process.stdout` these helpers need. Declared instead of * `NodeJS.WriteStream` so tests and embedders can pass an ordinary `Writable`. */ export type OutputStream = NodeJS.WritableStream & { isTTY?: boolean; destroyed?: boolean; writableEnded?: boolean; }; /** * True only for `EPIPE` — the reader closed its end. * * Deliberately narrow, because callers act on it by killing the process: a * wider set would let an unrelated bad descriptor take a whole session down. * Use {@link isUnwritableStreamError} to decide whether to stop *writing*. */ export declare function isBrokenPipeError(err: unknown): boolean; /** True when a further write to this stream can only fail the same way. */ export declare function isUnwritableStreamError(err: unknown): boolean; /** False once the stream has been destroyed or ended. */ export declare function isStreamOpen(stream: { destroyed?: boolean; writableEnded?: boolean; }): boolean; /** Record that a stream will never accept another write. Idempotent. */ export declare function markStreamBroken(stream: object): void; /** * Forget every broken-stream mark. Test-only — the registry is process-wide by * design, so a suite that breaks a stream would otherwise leak that verdict. * @internal */ export declare function __resetBrokenStreams(): void; /** True while a stream is worth writing to. */ export declare function isStreamUsable(stream: { destroyed?: boolean; writableEnded?: boolean; }): boolean; //# sourceMappingURL=stream-health.d.ts.map