MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / drainSdkEvents

Function drainSdkEvents

source code/utils/sdkEventQueue.ts:91–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89}
90
91export 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.

Callers 2

drainCommandQueueFunction · 0.85
runFunction · 0.85

Calls 1

getSessionIdFunction · 0.85

Tested by

no test coverage detected