MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / emitEvent

Method emitEvent

apps/cli/src/agent/json-event-emitter.ts:820–829  ·  view source on GitHub ↗

* Emit a JSON event. * For stream-json mode: immediately output to stdout * For json mode: accumulate for final output

(event: JsonEvent)

Source from the content-addressed store, hash-verified

818 * For json mode: accumulate for final output
819 */
820 private emitEvent(event: JsonEvent): void {
821 const requestId = event.requestId ?? this.requestIdProvider()
822 const payload = requestId ? { ...event, requestId } : event
823
824 this.events.push(payload)
825
826 if (this.mode === "stream-json") {
827 this.outputLine(payload)
828 }
829 }
830
831 /**
832 * Output a single JSON line (NDJSON format).

Callers 10

attachToClientMethod · 0.95
emitControlMethod · 0.95
emitQueueMethod · 0.95
handleSayMessageMethod · 0.95
handleAskMessageMethod · 0.95
handleToolUseAskMethod · 0.95
handleTaskCompletedMethod · 0.95
handleErrorMethod · 0.95

Calls 1

outputLineMethod · 0.95

Tested by

no test coverage detected