(event agent.StreamEvent)
| 296 | } |
| 297 | |
| 298 | func (b *FullscreenRendererBackend) RenderEvent(event agent.StreamEvent) { |
| 299 | switch event.Type { |
| 300 | case "text": |
| 301 | b.AppendTranscript(event.Content) |
| 302 | case "tool_call": |
| 303 | b.appendTaskActivityLine("[tool] " + event.Content) |
| 304 | case "tool_result": |
| 305 | result := event.Content |
| 306 | if metadataResult := stringFromAny(event.Metadata["result"]); metadataResult != "" { |
| 307 | result = metadataResult |
| 308 | } |
| 309 | if truthy(event.Metadata["denied"]) { |
| 310 | b.appendTaskActivityLine("[tool denied]") |
| 311 | } else if result != "" { |
| 312 | b.appendTaskActivityLine("[tool result] " + truncateString(result, 200)) |
| 313 | } |
| 314 | case "error": |
| 315 | b.StatusText = strings.TrimSpace(event.Content) |
| 316 | b.refreshControls() |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | func (b *FullscreenRendererBackend) SetInputDraft(draft string) { |
| 321 | b.InputDraft = draft |
nothing calls this directly
no test coverage detected