(event: SdkEvent)
| 77 | const queue: SdkEvent[] = [] |
| 78 | |
| 79 | export function enqueueSdkEvent(event: SdkEvent): void { |
| 80 | // SDK events are only consumed (drained) in headless/streaming mode. |
| 81 | // In TUI mode they would accumulate up to the cap and never be read. |
| 82 | if (!getIsNonInteractiveSession()) { |
| 83 | return |
| 84 | } |
| 85 | if (queue.length >= MAX_QUEUE_SIZE) { |
| 86 | queue.shift() |
| 87 | } |
| 88 | queue.push(event) |
| 89 | } |
| 90 | |
| 91 | export function drainSdkEvents(): Array< |
| 92 | SdkEvent & { uuid: UUID; session_id: string } |
no test coverage detected