feat(tui): Task 3.5 — decode + render router.narration as bright narration_llm lines

Add TypeRouterNarration constant, mark it event-bearing, decode golden test,
applyServer case appending RouterEntry{Role:"narration_llm"} with metrics, and
routerRows render branch showing bright ◆ prefix with FgStrong content + metrics suffix.
This commit is contained in:
2026-06-03 19:09:28 +04:00
parent da1aca411a
commit 2bef4b96a5
4 changed files with 33 additions and 1 deletions
+6
View File
@@ -92,6 +92,12 @@ func (m *Model) applyServer(msg protocol.ServerMessage) {
switch msg.Type {
case protocol.TypeSessionAnnounced:
m.onSessionAnnounced(msg)
case protocol.TypeRouterNarration:
entry := RouterEntry{Role: "narration_llm", Content: msg.Content}
if msg.LatencyMs != nil && msg.TotalTokens != nil {
entry.Metrics = &TurnMetrics{LatencyMs: *msg.LatencyMs, TotalTokens: *msg.TotalTokens}
}
m.appendRouter(msg.SessionID, entry)
case protocol.TypeChatTurn:
m.routerConnected = true
role := "router"