| 36 | * Strategy for determining when to emit text updates |
| 37 | */ |
| 38 | export interface ChunkStrategy { |
| 39 | /** |
| 40 | * Called for each text chunk received |
| 41 | * @param chunk - The new chunk of text (delta) |
| 42 | * @param accumulated - All text accumulated so far |
| 43 | * @returns true if an update should be emitted now |
| 44 | */ |
| 45 | shouldEmit: (chunk: string, accumulated: string) => boolean |
| 46 | |
| 47 | /** |
| 48 | * Optional: Reset strategy state (called when streaming starts) |
| 49 | */ |
| 50 | reset?: () => void |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Per-message streaming state. |
nothing calls this directly
no outgoing calls
no test coverage detected