MCPcopy Create free account
hub / github.com/anus-dev/ANUS / addEvent

Method addEvent

packages/core/src/telemetry/uiTelemetry.ts:106–126  ·  view source on GitHub ↗
(event: UiEvent)

Source from the content-addressed store, hash-verified

104 #lastPromptTokenCount = 0;
105
106 addEvent(event: UiEvent) {
107 switch (event['event.name']) {
108 case EVENT_API_RESPONSE:
109 this.processApiResponse(event);
110 break;
111 case EVENT_API_ERROR:
112 this.processApiError(event);
113 break;
114 case EVENT_TOOL_CALL:
115 this.processToolCall(event);
116 break;
117 default:
118 // We should not emit update for any other event metric.
119 return;
120 }
121
122 this.emit('update', {
123 metrics: this.#metrics,
124 lastPromptTokenCount: this.#lastPromptTokenCount,
125 });
126 }
127
128 getMetrics(): SessionMetrics {
129 return this.#metrics;

Callers 4

logToolCallFunction · 0.80
logApiErrorFunction · 0.80
logApiResponseFunction · 0.80

Calls 3

processApiResponseMethod · 0.95
processApiErrorMethod · 0.95
processToolCallMethod · 0.95

Tested by

no test coverage detected