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