feat(tui): event-derived ordering + retire Kotlin TUI
Rebuild the Go TUI transcript from the event stream instead of optimistic local echoes. ChatTurnEvent now maps to ServerMessage.ChatTurn (chat.turn); the TUI auto-vivifies sessions and renders user+router turns from events. SessionStarted is de-special-cased into SessionAnnounced (still carries workflowId), dropping the router.response shadow and optimistic echoes. Delete the unused Kotlin TUI (apps/tui) and add a kotlinx<->Go golden-fixture test to lock the wire protocol. Gitignore server runtime logs.
This commit is contained in:
@@ -237,6 +237,19 @@ func (m Model) session(id string) *Session {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ensureSession returns the session with id, creating an ACTIVE entry if absent.
|
||||
// Session existence is derived from the event stream (any event for an unknown
|
||||
// session vivifies it) rather than a dedicated control frame.
|
||||
func (m *Model) ensureSession(id string) *Session {
|
||||
if s := m.session(id); s != nil {
|
||||
return s
|
||||
}
|
||||
m.sessions = append(m.sessions, Session{
|
||||
ID: id, Status: "ACTIVE", LastEventAt: nowMillis(),
|
||||
})
|
||||
return &m.sessions[len(m.sessions)-1]
|
||||
}
|
||||
|
||||
// filteredSessions applies the workflow-id filter.
|
||||
func (m Model) filteredSessions() []Session {
|
||||
if m.filter == "" {
|
||||
|
||||
Reference in New Issue
Block a user