()
| 89 | } |
| 90 | |
| 91 | export function drainSdkEvents(): Array< |
| 92 | SdkEvent & { uuid: UUID; session_id: string } |
| 93 | > { |
| 94 | if (queue.length === 0) { |
| 95 | return [] |
| 96 | } |
| 97 | const events = queue.splice(0) |
| 98 | return events.map(e => ({ |
| 99 | ...e, |
| 100 | uuid: randomUUID(), |
| 101 | session_id: getSessionId(), |
| 102 | })) |
| 103 | } |
| 104 | |
| 105 | /** |
| 106 | * Emit a task_notification SDK event for a task reaching a terminal state. |
no test coverage detected