/** * speech-markdown, strips markdown formatting out of assistant text before it * reaches a speech synthesizer. Assistant responses are markdown; a TTS engine * has no renderer, so without this a synthesizer reads formatting characters * aloud verbatim ("asterisk asterisk bold asterisk asterisk", "hash", "pipe"). * Everything here is plain-text policy, no I/O, so it is shared verbatim by * every voice consumer through {@link TtsTextChunker}. */ /** * Strips markdown formatting for speech, keeping the words. Pure and * single-shot: run it once over a whole chunk (it expects any newlines still * in the text, since heading/list/table/blockquote handling is line-anchored). * Nested constructs (bold link text, bold inside a heading) come out as plain * words because line-level stripping runs before inline stripping, and inline * stripping runs links/images before the emphasis markers wrapping them. */ export declare function stripMarkdownForSpeech(text: string): string; /** * StreamingCodeFenceFilter, swallows fenced code blocks (```) out of a * streamed delta sequence, replacing each whole block with one spoken phrase. * Code is unreadable aloud, and a stream never hands us a fence in one piece * (the delta boundary can land mid-backtick), so this carries the small * amount of state needed to recognize a fence marker that arrives split * across `push()` calls: the fence-relevant prefix of the CURRENT line only * (up to 3 spaces of indent, then a run of backtick/tilde chars), everything * else streams straight through the moment it is no longer part of that * prefix, so latency-sensitive prose never waits on a line's `\n`. * * ~~~-style fences are handled too (same recognizer, either fence char), on * the same terms as backtick fences: opening char sets which one closes it. */ export declare class StreamingCodeFenceFilter { private prefixBuf; private indentSeen; private fenceRunChar; private fenceRunLen; private inPassthroughLine; private inSwallowLine; /** While inSwallowLine: whether the line being swallowed is the closing fence marker (its newline surfaces) vs. the opener or plain code content (fully silent). */ private swallowLineIsCloser; private inFence; private openFenceChar; private openFenceLen; push(delta: string): string; /** Whatever undecided line-start text never resolved (no more input coming) passes through as plain text; a dangling open fence stays swallowed, its placeholder already went out when it opened. */ flush(): string; reset(): void; private consumeChar; private consumePrefixChar; private resolveNotFence; private resolveFenceLine; private resetLineState; } //# sourceMappingURL=speech-markdown.d.ts.map