49 lines
2.1 KiB
TypeScript
49 lines
2.1 KiB
TypeScript
// Labels and colour tones of task and runner statuses, shared by badges, rows and the side panel.
|
||
// Labels are Russian dictionary keys (PEP-98): render them through `t(label)`.
|
||
import { m } from "@peppa/shared/i18n";
|
||
|
||
export type Tone = "primary" | "ok" | "warn" | "info" | "danger" | "muted";
|
||
|
||
export const TASK_STATUS: Record<string, { label: string; tone: Tone }> = {
|
||
backlog: { label: m("Бэклог"), tone: "muted" },
|
||
proposing: { label: m("Составляет план"), tone: "primary" },
|
||
awaiting_approval: { label: m("Ждёт одобрения"), tone: "primary" },
|
||
in_progress: { label: m("В работе"), tone: "info" },
|
||
review: { label: m("Ревью"), tone: "ok" },
|
||
done: { label: m("Готово"), tone: "ok" },
|
||
// PEP-278: not a status of its own — `done` whose changes do not run yet (`rollout.wait`).
|
||
rollout: { label: m("Принято, ждёт обновления"), tone: "info" },
|
||
blocked: { label: m("Блок"), tone: "danger" },
|
||
};
|
||
|
||
// PEP-89: said about an agent, in plain words — the reader is a product manager.
|
||
export const SESSION_STATUS: Record<string, { label: string; tone: Tone }> = {
|
||
starting: { label: m("запускается"), tone: "info" },
|
||
running: { label: m("работает"), tone: "info" },
|
||
waiting_input: { label: m("ждёт вашего ответа"), tone: "primary" },
|
||
idle: { label: m("свободен"), tone: "muted" },
|
||
stalled: { label: m("остановился — нужна помощь"), tone: "warn" },
|
||
rate_limited: { label: m("ждёт сброса лимита"), tone: "warn" },
|
||
done: { label: m("закончил"), tone: "ok" },
|
||
failed: { label: m("остановился с ошибкой"), tone: "danger" },
|
||
};
|
||
|
||
/** Text colour per tone, e.g. for status dots. */
|
||
export const TONE_TEXT: Record<Tone, string> = {
|
||
primary: "text-primary",
|
||
ok: "text-ok",
|
||
warn: "text-warn",
|
||
info: "text-info",
|
||
danger: "text-destructive",
|
||
muted: "text-muted-foreground",
|
||
};
|
||
|
||
export const TONE_BG: Record<Tone, string> = {
|
||
primary: "bg-primary",
|
||
ok: "bg-ok",
|
||
warn: "bg-warn",
|
||
info: "bg-info",
|
||
danger: "bg-destructive",
|
||
muted: "bg-muted-foreground",
|
||
};
|