(event: CursorEvent)
| 249 | } |
| 250 | |
| 251 | function extractAssistantText(event: CursorEvent): string { |
| 252 | const blocks = event.message?.content; |
| 253 | if (!Array.isArray(blocks)) { |
| 254 | return ''; |
| 255 | } |
| 256 | |
| 257 | return blocks |
| 258 | .map((block) => (block?.type === 'text' && typeof block.text === 'string' ? block.text : '')) |
| 259 | .filter(Boolean) |
| 260 | .join(''); |
| 261 | } |
| 262 | |
| 263 | type AssistantStreamerOptions = { |
| 264 | initialMessageId?: string | null; |