/** * Problem: * When background subagents or tasks execute concurrently while an assistant message is streaming * (or when tool calls, plan updates, or notices arrive during `agent_message_chunk` emissions), * upstream `agy_acp_server` pushes these timeline-interrupting events directly into the middle of * the streaming text. Editor clients (such as Paseo and Zed) render ACP streams sequentially, * splitting the assistant message into broken fragments and severing Markdown links/syntax mid-token. * * Solution: * Buffers incoming concurrent timeline updates (`tool_call`, `tool_call_update`, `plan`, * `plan_update`, `plan_removed`, `notice`) while an assistant message is actively streaming, * flushing them immediately once the text stream completes (or settles), ensuring text messages * remain contiguous and unsevered. */ import { type AcpFix, type AcpStreamMessage, type InboundContext } from "../../core/types.js"; export declare const DEFAULT_STREAM_IDLE_TIMEOUT_MS = 150; export interface InterleavedStreamToolCallsOptions { idleTimeoutMs?: number; } export declare function isTimelineInterruptingUpdate(kind?: string): boolean; export declare class ConcurrentToolCallBuffer { private readonly states; private readonly idleTimeoutMs; constructor(options?: InterleavedStreamToolCallsOptions); private getOrCreateState; isStreaming(sessionId: string): boolean; hasBuffered(sessionId: string): boolean; getBufferedCount(sessionId: string): number; onMessageChunk(sessionId: string, context?: InboundContext): void; settleStream(sessionId: string, context?: InboundContext): AcpStreamMessage[]; bufferTimelineUpdate(sessionId: string, msg: AcpStreamMessage, toolCallId?: string): void; isToolCallBuffered(sessionId: string, toolCallId: string): boolean; flush(sessionId: string): AcpStreamMessage[]; clear(sessionId: string): AcpStreamMessage[]; dispose(): void; } export declare function createInterleavedStreamToolCallsFix(options?: InterleavedStreamToolCallsOptions): AcpFix; export declare const interleavedStreamToolCallsFix: AcpFix; //# sourceMappingURL=index.d.ts.map