Skip to main content

Module data

Module data 

Source
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§

AgentInfo
Per-agent fields the UI reads to render the roster + drive selection / detail-pane streaming.
ChannelInfo
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. id is <project>:<name> (matches the broker’s channels.id); name is the short label rendered as #name.
TeamSnapshot

Functions§

agent_label
Return the operator-facing label for agent_id: the agent’s display_name when set, otherwise agent_id itself. Read-only borrow into the snapshot — callers that need an owned String can .to_string() at the use-site. Unknown ids fall through to agent_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 None when the limit is in the past, at the current instant, or unset — the indicator hides in those cases. For active limits, formats as 42s (under a minute), 5m 12s (under an hour), or 1h 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.