export interface AssistantStreamSplit { flushedText: string; remainingText: string; } /** * Estimate how many terminal rows `text` occupies when wrapped at `columns`. * * A heuristic (counts characters, not grapheme/display width, and ignores * Markdown re-rendering) used only to decide whether in-flight streamed text is * about to overflow the live region. Over-counting slightly is fine — it just * flushes marginally earlier. Each newline-separated line wraps independently; * an empty line still occupies one row. * * Markdown table lines are counted at double height plus a fixed border * overhead per table block: the box-drawing renderer adds borders and column * padding wraps cells onto extra rows, so raw character math systematically * UNDER-counts tables. Under-counting here delays the mid-stream flush until * the live region has already overflowed the terminal, which strands * unerasable rows in scrollback (orphaned ⏺ lines above the redrawn frame). */ export declare function estimateRenderedRows(text: string, columns: number): number; /** * Decide how much of the in-flight assistant text can be flushed to terminal * scrollback while streaming, keeping the trailing in-progress block live. * * Flushing progressively (instead of dumping the whole response at the end) * keeps the live region small so it never has to scroll the full response into * scrollback in one shot — that single large write is what makes the TUI * "jump up" when the agent finishes. * * Splits ONLY at paragraph boundaries (blank lines) that sit OUTSIDE code * fences, and never trims interior whitespace, so each flushed chunk is a * self-contained set of Markdown blocks that renders identically whether shown * alone in history or as part of the whole response. (An earlier version split * mid-sentence and trimmed whitespace, which broke live/history parity.) * * Guarantees `flushedText + remainingText === text`. */ export declare function splitAssistantStreamingText(text: string): AssistantStreamSplit; //# sourceMappingURL=assistant-stream-split.d.ts.map