/** * TtsTextChunker, turns a stream of provider content deltas into speech-sized * chunks at sentence boundaries, with a max-length cut and a latency flush so a * long unpunctuated run still starts speaking. This is pure policy (no I/O, no * timers of its own, the caller drives `flushDue()` on its own clock), so it * lives in the SDK and is shared verbatim by every voice consumer. * * Assistant text is markdown; a synthesizer has no renderer for it. Deltas run * through a {@link StreamingCodeFenceFilter} on the way into the buffer (so a * fenced code block can never straddle a chunk boundary, the boundary logic * only ever sees " Code block omitted. " where the code was), and each * outgoing chunk runs through {@link stripMarkdownForSpeech} before the * existing whitespace collapse. */ export interface TtsTextChunkerOptions { readonly minBoundaryChars?: number | undefined; readonly maxChunkChars?: number | undefined; readonly maxLatencyMs?: number | undefined; readonly now?: (() => number) | undefined; } export declare class TtsTextChunker { private buffer; private firstBufferedAt; private readonly fenceFilter; private readonly minBoundaryChars; private readonly maxChunkChars; private readonly maxLatencyMs; private readonly now; constructor(options?: TtsTextChunkerOptions); push(delta: string): string[]; flushDue(): string[]; flushAll(): string[]; reset(): void; private drainReady; private findBoundary; private findLatestSentenceBoundary; private findWordBoundaryBefore; private takeChunk; } export declare function normalizeSpeechText(text: string): string; //# sourceMappingURL=text-chunker.d.ts.map