MCPcopy Create free account
hub / github.com/astercloud/aster / handleMonitorEvent

Function handleMonitorEvent

examples/agent/main.go:166–178  ·  view source on GitHub ↗
(event any)

Source from the content-addressed store, hash-verified

164}
165
166func handleMonitorEvent(event any) {
167 switch e := event.(type) {
168 case *types.MonitorStateChangedEvent:
169 fmt.Printf("[State Changed] %s\n", e.State)
170 case *types.MonitorTokenUsageEvent:
171 fmt.Printf("[Token Usage] Input: %d, Output: %d, Total: %d\n",
172 e.InputTokens, e.OutputTokens, e.TotalTokens)
173 case *types.MonitorErrorEvent:
174 fmt.Printf("[Error] [%s] %s: %s\n", e.Severity, e.Phase, e.Message)
175 case *types.MonitorBreakpointChangedEvent:
176 fmt.Printf("[Breakpoint] %v -> %v\n", e.Previous, e.Current)
177 }
178}

Callers 1

mainFunction · 0.70

Calls 1

PrintfMethod · 0.80

Tested by

no test coverage detected