MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / ApplyUIEvent

Method ApplyUIEvent

ui/runtime.go:319–344  ·  view source on GitHub ↗
(event UiEvent)

Source from the content-addressed store, hash-verified

317}
318
319func (r *UiRuntime) ApplyUIEvent(event UiEvent) {
320 switch event.Type {
321 case "assistant_delta":
322 r.appendTranscriptEntry("assistant", event.Content)
323 r.markDirty()
324 case "thinking_delta":
325 if event.Content != "" {
326 r.Frame.InputPlaceholder = "Agent is thinking..."
327 r.markDirty()
328 }
329 case "tool_call_started":
330 r.recordInlineActivity("tool_call", FormatToolCallEntry(event))
331 case "tool_call_finished":
332 r.recordInlineActivity("tool_result", FormatToolResultEntry(event))
333 case "ui_warning":
334 if event.Content != "" {
335 r.Frame.Warnings = append(r.Frame.Warnings, event.Content)
336 r.markDirty()
337 }
338 case "ui_fatal":
339 if event.Content != "" {
340 r.Frame.Errors = append(r.Frame.Errors, event.Content)
341 r.markDirty()
342 }
343 }
344}
345
346func (r *UiRuntime) DrainTaskEvents() {
347 updated := false

Callers 2

RunSubmitMessageMethod · 0.95

Calls 5

appendTranscriptEntryMethod · 0.95
markDirtyMethod · 0.95
recordInlineActivityMethod · 0.95
FormatToolCallEntryFunction · 0.85
FormatToolResultEntryFunction · 0.85

Tested by 1