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

Function enqueueSdkEvent

source code/utils/sdkEventQueue.ts:79–89  ·  view source on GitHub ↗
(event: SdkEvent)

Source from the content-addressed store, hash-verified

77const queue: SdkEvent[] = []
78
79export 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
91export function drainSdkEvents(): Array<
92 SdkEvent & { uuid: UUID; session_id: string }

Callers 5

callFunction · 0.85
emitTaskTerminatedSdkFunction · 0.85
emitTaskProgressFunction · 0.85
registerTaskFunction · 0.85

Calls 2

shiftMethod · 0.80

Tested by

no test coverage detected