/** * NDJSON stream consumer utilities — ADR 0039 P0 (Console / SDK). */ import { type AgentStreamEvent, type AgentStreamReduceState } from "./agent-stream.js"; export type AgentStreamNdjsonParserState = { remainder: string; }; export declare function createAgentStreamNdjsonParserState(): AgentStreamNdjsonParserState; /** Parse complete NDJSON lines from a text chunk; keeps trailing partial line in state. */ export declare function parseAgentStreamNdjsonChunk(chunk: string, state?: AgentStreamNdjsonParserState): { events: AgentStreamEvent[]; state: AgentStreamNdjsonParserState; }; /** Flush a final partial line after the stream ends. */ export declare function flushAgentStreamNdjsonParser(state: AgentStreamNdjsonParserState): { events: AgentStreamEvent[]; state: AgentStreamNdjsonParserState; }; type NdjsonBody = ReadableStream | AsyncIterable; /** Iterate Eve-aligned events from an NDJSON response body. */ export declare function iterateAgentStreamNdjson(body: NdjsonBody): AsyncGenerator; export type FoldAgentStreamOptions = { onEvent?: (event: AgentStreamEvent, state: AgentStreamReduceState) => void; }; /** Reduce an NDJSON body to {@link AgentStreamReduceState}. */ export declare function foldAgentStreamNdjson(body: NdjsonBody, options?: FoldAgentStreamOptions): Promise; export {}; //# sourceMappingURL=agent-stream-consumer.d.ts.map