// Lifecycle vocabulary for the dashboard: the status labels, pill severities // and "needs you" grouping the shell and the stage rail draw. // // The single binary serves no catalogue for this, so the vocabulary is the // snapshot in task-meta-snapshot.ts. Keep it in step with the statuses the // binary reports; a status it doesn't list renders as its own id. import type { StatusKind } from "./status"; import { DEFAULT_STATUSES, type StatusMeta } from "./task-meta-snapshot"; const statusById = new Map(DEFAULT_STATUSES.map((s) => [s.id, s])); /** statusLabel is the human-readable name for a lifecycle status. */ export function statusLabel(id: string): string { return statusById.get(id)?.label || id || "Unknown"; } /** statusKind is the pill severity token (idle, info, ok, warn, danger). */ export function statusKind(id: string): StatusKind { return (statusById.get(id)?.kind || "idle") as StatusKind; } /** * attentionStatusIds is the set of statuses that count toward the "Needs you" * filter (work that needs attention). */ export function attentionStatusIds(): Set { return new Set((DEFAULT_STATUSES as StatusMeta[]).filter((s) => s.needs_attention).map((s) => s.id)); }