Files
archie/ui/src/lib/task-meta.ts
T
sam ea6385879f fix(ui): stop calling operations the binary does not serve (#2121)
The dashboard is embedded in the single binary, which serves api/openapi.yaml.
It was still calling the old services' routes, so pages that read them answered
with a not-found: the task board, its activity feed and setup panel, logs,
alerts, audit and its export, bindings, schedules, channels, repositories,
skills, curators, the control-plane settings pages, identities and org agents,
the org switcher, secret-reference checks, task metadata, and the audit, usage,
summary and version reads.

Each of those surfaces is removed, and a test compares every /api path in the
dashboard's source with api/openapi.yaml so the next one fails the gate
instead of the browser. Settings that the binary does serve (model providers,
instructions, policies, members) keep their pages.
2026-11-27 19:03:02 +11:00

30 lines
1.2 KiB
TypeScript

// 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<string> {
return new Set((DEFAULT_STATUSES as StatusMeta[]).filter((s) => s.needs_attention).map((s) => s.id));
}