peppa/apps/web/components/WorkLine.tsx
peppa-bot 0097cb07f7 PEP-182: не больше 9 агентов на подписку — ёмкость, очередь задач, «Делается · В очереди»
Ёмкость подписки (core/capacity.ts, по умолчанию 9, суперадмин меняет на набор 1–20);
pickSubscription, ротация и ручной перевод агентов уважают ёмкость; без места задача
ждёт в очереди и запускается сама по порядку доски (capacityQueueTick); команда растёт
только в пределах ёмкости; экраны «Подписки», Главная, доска, страница задачи; ru/kk/en;
тест subscription-capacity.test.ts; OpenSpec change archived.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 02:55:40 +05:00

24 lines
992 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { WorkLine as Line } from "@peppa/core";
import { cn } from "@/lib/utils";
import { getT } from "@/lib/i18n";
/**
* PEP-182: «Делается: 4 · В очереди: 3» — how many tasks agents work on now and how many wait
* for a free agent. No subscriptions and no capacity numbers: that is the superadmin's page.
*/
export async function WorkLine({ line, className }: { line: Line; className?: string }) {
const t = await getT();
if (!line.doing && !line.queued) return null;
return (
<p className={cn("m-0 text-sm text-muted-foreground", className)} data-work-line>
{t("Делается: {n}", { n: line.doing })}
{line.queued > 0 && (
<>
{" · "}
<span className="text-warn" title={t("Все агенты заняты — задачи начнутся по порядку, когда агент освободится")}>{t("В очереди: {n}", { n: line.queued })}</span>
</>
)}
</p>
);
}