import type { StreamChunk } from '@n8n/agents'; import type { Thread } from 'chat'; import type { Logger } from 'n8n-workflow'; import type { BridgeStatusHandle } from './agent-chat-integration'; type SuspendedChunk = Extract; type MessageChunk = Extract; export type SuspensionHandlingResult = 'posted' | 'skipped' | 'failed'; interface AgentChatStreamConsumerOptions { disableStreaming: boolean; logger: Logger; postErrorToThread: (thread: Thread | null, error: unknown) => Promise; handleSuspension: (chunk: SuspendedChunk, thread: Thread) => Promise; handleMessage: (chunk: MessageChunk, thread: Thread) => Promise; } interface ConsumeStreamOptions { forceBuffered?: boolean; statusHandle?: BridgeStatusHandle; } export declare class AgentChatStreamConsumer { private readonly options; constructor(options: AgentChatStreamConsumerOptions); consume(stream: AsyncGenerator, thread: Thread, options?: ConsumeStreamOptions): Promise; private createResponseLifecycle; private postFallbackIfNeeded; private consumeBuffered; } export {};