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