/** * Streaming-polish layer for Teams' post-then-edit streaming. * * While an agent is mid-stream the buffer is usually an *unfinished* markdown * document: an open code fence, an unclosed `**`, etc. Teams renders message * text as markdown, so editing the message with unbalanced text makes the rest * of the bubble render broken (a stray ``` turns the remainder into a code * block until the closer arrives, a dangling `**` bolds the rest, and so on). * * `autoCloseOpenMarkdown` returns a balanced copy of the buffer by appending the * minimum set of closers needed for well-formed display. When the agent later * emits the real closer the buffer balances on its own and this adds nothing, * so the *committed* (finalized) message has no synthetic closers. * * Handled, in priority order: * 1. Unclosed fenced code blocks ``` (most severe: leaks code styling) * 2. Unclosed inline code * 3. Unclosed bold `**` / `__`, italic `*` / `_`, strike `~~` * * Heuristics: * - A marker with no content after it (trailing `**`) is NOT closed. The * agent may just be opening it; closing would flash a transient `****`. * - Markers inside code/fence regions don't count. * - Closers are emitted innermost-first so the structure nests correctly. */ export declare function autoCloseOpenMarkdown(text: string): string; //# sourceMappingURL=auto-close.d.ts.map