Expand description
TeamSnapshot — point-in-time read of the dogfood team that the UI
renders against. Built by walking up to the nearest .team/,
parsing team-compose.yaml, querying the supervisor for each
agent’s process state, and aggregating a small set of mailbox
counters (unread + pending approvals).
Read by both App::tick() (live refresh every second) and the
snapshot tests (constructed manually). The snapshot is intentionally
cheap to build — every field is derived from a single SQL query
per agent — so refresh cadence stays well under tmux’s own
capture-pane cost.
Structs§
- Agent
Info - Per-agent fields the UI reads to render the roster + drive selection / detail-pane streaming.
- Channel
Info - One channel exposed in
team-compose.yaml. Used by PR-UI-6’s per-channel broadcast picker and by the Mailbox-first layout’s channel list.idis<project>:<name>(matches the broker’schannels.id);nameis the short label rendered as#name. - Team
Snapshot
Functions§
- agent_
label - Return the operator-facing label for
agent_id: the agent’sdisplay_namewhen set, otherwiseagent_iditself. Read-only borrow into the snapshot — callers that need an ownedStringcan.to_string()at the use-site. Unknown ids fall through toagent_id(the canonical id is always a valid label). - format_
rate_ limit_ window - T-212: format a rate-limit reset timestamp as a short label for
the status bar. Returns
Nonewhen the limit is in the past, at the current instant, or unset — the indicator hides in those cases. For active limits, formats as42s(under a minute),5m 12s(under an hour), or1h 23m(an hour or more). Operator-facing string; not for parsing. - state_
glyph - Single-cell glyph for an agent’s primary state — derived from the
triplet (
state,pending_approvals,unread_mail) in priority order: pending approval beats unread mail beats process state. Plain ASCII fallback when the caller signals a monochrome / no-symbol terminal.