Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(agentic-ide): add a Subscriptions side panel tab
rubenluetke10-beep5777ffce666e
diff --git a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/sidePanelTabs.tsx b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/sidePanelTabs.tsxindex d6df066c5e..e998c3248b 100644--- a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/sidePanelTabs.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/sidePanelTabs.tsx@@ -1,11 +1,12 @@import type { ReactNode } from "react";-import { Bot, Building2, FileDiff, Files, FolderTree, GitBranch, type LucideIcon } from "lucide-react";+import { Bot, Building2, CreditCard, FileDiff, Files, FolderTree, GitBranch, type LucideIcon } from "lucide-react";import type { SidePanelTabId } from "@/store/ideSidePanel";import { AgentsOverview } from "./AgentsOverview";import { ExplorerPanel } from "./explorer/ExplorerPanel";import { GitOverviewTab } from "./git/GitOverviewTab";import { OfficeTab } from "./OfficeTab";import { SkillsTab } from "./skills/SkillsTab";+import { SubscriptionsTab } from "./subscriptions/SubscriptionsTab";/** One function the side panel can show. */export interface SidePanelTabDef {@@ -54,6 +55,12 @@ export const SIDE_PANEL_TABS: readonly SidePanelTabDef[] = [icon: Files,render: () => <SkillsTab />,},+ {+ id: "subscriptions",+ labelKey: "ide_side_panel.tabs.subscriptions",+ icon: CreditCard,+ render: () => <SubscriptionsTab />,+ },{id: "office",labelKey: "ide_side_panel.tabs.office",diff --git a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/SubscriptionsTab.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/SubscriptionsTab.test.tsxnew file mode 100644index 0000000000..60604ddb57--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/SubscriptionsTab.test.tsx@@ -0,0 +1,175 @@+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";+import { cleanup, fireEvent, render, screen, within } from "@testing-library/react";+import { fetchAgentAccounts, fetchAgentUsage, type AgentAccount } from "@/lib/agentAccountsApi";+import { useEventStore } from "@/store/events";+import { SubscriptionsTab } from "./SubscriptionsTab";+import { groupSubscriptions, resetText, windowLength } from "./subscriptionsModel";++vi.mock("@/lib/agentAccountsApi", async () => {+ const actual = await vi.importActual<typeof import("@/lib/agentAccountsApi")>("@/lib/agentAccountsApi");+ return { ...actual, fetchAgentAccounts: vi.fn(), fetchAgentUsage: vi.fn() };+});++function account(id: string, platform: string, extra: Partial<AgentAccount> = {}): AgentAccount {+ return {+ id,+ platform,+ label: `Seat ${id}`,+ config_dir: `/home/u/${id}`,+ builtin: false,+ connected: true,+ mode: "subscription",+ message: "",+ email: `${id}@example.com`,+ tier: null,+ ...extra,+ };+}++const ACCOUNTS = {+ platforms: [+ {+ platform: "claude",+ display_name: "Claude Code",+ active_account: "c2",+ accounts: [account("c1", "claude"), account("c2", "claude"), account("c3", "claude", { connected: false })],+ },+ {+ platform: "codex",+ display_name: "Codex",+ active_account: "x1",+ accounts: [account("x1", "codex", { tier: "Pro" })],+ },+ {+ platform: "gemini",+ display_name: "Gemini CLI",+ active_account: "g1",+ accounts: [account("g1", "gemini", { connected: false })],+ },+ ],+};++const USAGE = {+ accounts: [+ {+ account_id: "c1",+ platform: "claude",+ status: "ok",+ windows: [+ {+ kind: "session",+ percent: 42,+ severity: "normal",+ resets_at: new Date(Date.now() + 90 * 60_000).toISOString(),+ window_minutes: 300,+ scope_label: null,+ raw_label: null,+ },+ {+ kind: "weekly",+ percent: 81,+ severity: "warning",+ resets_at: null,+ window_minutes: null,+ scope_label: null,+ raw_label: null,+ },+ ],+ source: "live",+ as_of: null,+ message: "",+ plan: "Max 20x",+ },+ {+ account_id: "x1",+ platform: "codex",+ status: "unsupported",+ windows: [],+ source: "live",+ as_of: null,+ message: "",+ plan: null,+ },+ ],+ ttl_seconds: 60,+ generated_at: 0,+};++beforeEach(() => {+ useEventStore.setState({ activeSection: "agentic-ide" });+ vi.mocked(fetchAgentAccounts).mockResolvedValue(ACCOUNTS);+ vi.mocked(fetchAgentUsage).mockResolvedValue(USAGE);+});++afterEach(() => {+ cleanup();+ vi.mocked(fetchAgentAccounts).mockReset();+ vi.mocked(fetchAgentUsage).mockReset();+});++describe("SubscriptionsTab", () => {+ it("groups signed-in subscriptions into one block per tool", async () => {+ render(<SubscriptionsTab />);+ const groups = await screen.findAllByTestId("subscription-group");+ expect(groups.map((group) => group.dataset.platform)).toEqual(["claude", "codex"]);+ const claudeRows = within(groups[0]).getAllByTestId("subscription-row");+ expect(claudeRows.map((row) => row.dataset.account)).toEqual(["c1", "c2"]);+ expect(claudeRows[1].dataset.active).toBe("true");+ expect(within(groups[0]).getByText("[email protected]")).toBeTruthy();+ expect(within(groups[0]).getByText("Seat c1 · Max 20x")).toBeTruthy();+ });++ it("shows plan usage only after a row is expanded", async () => {+ render(<SubscriptionsTab />);+ const [row] = await screen.findAllByTestId("subscription-row");+ await screen.findByTestId("subscription-peak");+ expect(within(row).queryByTestId("subscription-details")).toBeNull();+ const toggle = within(row).getByRole("button");+ fireEvent.click(toggle);+ expect(toggle.getAttribute("aria-expanded")).toBe("true");+ const bars = within(row).getAllByRole("progressbar");+ expect(bars.map((bar) => bar.getAttribute("aria-valuenow"))).toEqual(["42", "81"]);+ expect(within(row).getByText("Current session (5 h)")).toBeTruthy();+ expect(within(row).getByText("Resets in 1 h 30 min")).toBeTruthy();+ });++ it("says so when a tool reports no usage", async () => {+ render(<SubscriptionsTab />);+ const groups = await screen.findAllByTestId("subscription-group");+ await screen.findByTestId("subscription-peak");+ fireEvent.click(within(groups[1]).getByRole("button"));+ expect(within(groups[1]).getByTestId("subscription-usage-status").textContent).toBe(+ "This tool does not report plan usage.",+ );+ });++ it("shows an empty state when nothing is signed in", async () => {+ vi.mocked(fetchAgentAccounts).mockResolvedValue({ platforms: [ACCOUNTS.platforms[2]] });+ render(<SubscriptionsTab />);+ expect(await screen.findByTestId("subscriptions-empty")).toBeTruthy();+ });+});++describe("subscriptionsModel", () => {+ it("drops tools without a signed-in subscription", () => {+ expect(groupSubscriptions(ACCOUNTS, []).map((group) => group.platform)).toEqual(["claude", "codex"]);+ expect(groupSubscriptions(null, [])).toEqual([]);+ });++ it("words reset times as a countdown inside a day", () => {+ const now = Date.parse("2026-10-05T12:00:00Z");+ expect(resetText(null, now, "en")).toBeNull();+ expect(resetText("garbage", now, "en")).toBeNull();+ expect(resetText("2026-10-05T12:00:20Z", now, "en")).toEqual({ key: "reset_soon" });+ expect(resetText("2026-10-05T12:45:00Z", now, "en")).toEqual({ key: "reset_in_minutes", vars: { m: 45 } });+ expect(resetText("2026-10-05T15:10:00Z", now, "en")).toEqual({ key: "reset_in_hours", vars: { h: 3, m: 10 } });+ expect(resetText("2026-10-08T12:00:00Z", now, "en")?.key).toBe("reset_on");+ });++ it("writes window lengths compactly", () => {+ expect(windowLength(300)).toBe("5 h");+ expect(windowLength(10080)).toBe("7 d");+ expect(windowLength(30)).toBe("30 min");+ expect(windowLength(null)).toBe("");+ });+});diff --git a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/SubscriptionsTab.tsx b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/SubscriptionsTab.tsxnew file mode 100644index 0000000000..f9a55670d3--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/SubscriptionsTab.tsx@@ -0,0 +1,333 @@+import { useCallback, useEffect, useId, useState } from "react";+import { AlertTriangle, ChevronRight, Loader2, RefreshCw } from "lucide-react";+import { fill, useT, useUiLanguage } from "@/i18n";+import {+ fetchAgentAccounts,+ fetchAgentUsage,+ type AccountUsage,+ type AgentAccountsResponse,+ type UsageWindow,+} from "@/lib/agentAccountsApi";+import { cn } from "@/lib/utils";+import { ProviderLogo } from "@/components/providers/ProviderLogo";+import { QuickTooltip } from "@/components/ui/tooltip";+import { useEventStore } from "@/store/events";+import {+ groupSubscriptions,+ planName,+ resetText,+ tightestWindow,+ windowLength,+ type SubscriptionGroup,+ type SubscriptionRow,+} from "./subscriptionsModel";++/**+ * The floor of the poll interval. The server states its usage cache lifetime+ * and the poll follows it, but never faster than this: a reading that changes+ * every few minutes does not need a request every few seconds.+ */+const MIN_POLL_MS = 60_000;+const POLL_JITTER_MS = 10_000;++const BAR_TONE: Record<string, string> = {+ normal: "bg-primary",+ warning: "bg-warning",+ critical: "bg-destructive",+};++const TEXT_TONE: Record<string, string> = {+ normal: "text-muted-foreground",+ warning: "text-warning",+ critical: "text-destructive",+};++/**+ * Accounts and their plan usage, polled while the Agentic IDE is in front.+ * Every tick is jittered (AP-33); a failed tick keeps the last answer on screen.+ */+function useSubscriptions() {+ const [accounts, setAccounts] = useState<AgentAccountsResponse | null>(null);+ const [usage, setUsage] = useState<AccountUsage[]>([]);+ const [error, setError] = useState("");+ const [loading, setLoading] = useState(true);+ const [force, setForce] = useState(0);+ useEffect(() => {+ let alive = true;+ let timer: number | undefined;+ let refresh = force > 0;+ let pollMs = MIN_POLL_MS;+ const tick = async () => {+ if (useEventStore.getState().activeSection === "agentic-ide") {+ setLoading(true);+ try {+ const [nextAccounts, nextUsage] = await Promise.all([fetchAgentAccounts(), fetchAgentUsage(refresh)]);+ refresh = false;+ if (nextUsage) pollMs = Math.max(MIN_POLL_MS, nextUsage.ttl_seconds * 1000);+ if (alive) {+ setAccounts(nextAccounts);+ // A backend without the usage route answers null: the rows still+ // show, just without numbers.+ setUsage(nextUsage?.accounts ?? []);+ setError("");+ }+ } catch (err) {+ if (alive) setError((err as Error).message);+ } finally {+ if (alive) setLoading(false);+ }+ }+ if (alive) timer = window.setTimeout(tick, pollMs + Math.random() * POLL_JITTER_MS);+ };+ void tick();+ return () => {+ alive = false;+ window.clearTimeout(timer);+ };+ }, [force]);+ const refresh = useCallback(() => setForce((value) => value + 1), []);+ return { accounts, usage, error, loading, refresh };+}++/** Wall-clock minutes, so reset countdowns stay true between polls. */+function useMinuteClock(): number {+ const [now, setNow] = useState(() => Date.now());+ useEffect(() => {+ const id = window.setInterval(() => setNow(Date.now()), 60_000);+ return () => window.clearInterval(id);+ }, []);+ return now;+}++function windowLabel(t: (key: string) => string, window: UsageWindow): string {+ const base = "ide_side_panel.subscriptions.window";+ if (window.kind === "session") {+ const length = windowLength(window.window_minutes);+ return length ? fill(t(`${base}.session_length`), { length }) : t(`${base}.session`);+ }+ if (window.kind === "weekly") return t(`${base}.weekly`);+ if (window.kind === "monthly") return t(`${base}.monthly`);+ if (window.kind === "weekly_scoped") {+ return window.scope_label ? fill(t(`${base}.weekly_scoped`), { scope: window.scope_label }) : t(`${base}.weekly`);+ }+ return window.raw_label || t(`${base}.other`);+}++function UsageBar({ window, now }: { window: UsageWindow; now: number }) {+ const t = useT();+ const lang = useUiLanguage();+ const percent = Math.round(Math.min(100, Math.max(0, window.percent)));+ const label = windowLabel(t, window);+ const reset = resetText(window.resets_at, now, lang);+ return (+ <li data-testid="subscription-window" data-kind={window.kind} className="space-y-1">+ <div className="flex items-baseline justify-between gap-2 text-[11.5px]">+ <span className="truncate text-foreground">{label}</span>+ <span className={cn("shrink-0 tabular-nums", TEXT_TONE[window.severity] ?? TEXT_TONE.normal)}>+ {fill(t("ide_side_panel.subscriptions.used"), { percent })}+ </span>+ </div>+ <div+ role="progressbar"+ aria-label={label}+ aria-valuemin={0}+ aria-valuemax={100}+ aria-valuenow={percent}+ className="h-1.5 overflow-hidden rounded-full bg-muted"+ >+ <div+ className={cn("h-full rounded-full", BAR_TONE[window.severity] ?? BAR_TONE.normal)}+ style={{ width: `${percent}%` }}+ />+ </div>+ {reset && (+ <p className="text-[10.5px] text-muted-foreground">+ {"vars" in reset+ ? fill(t(`ide_side_panel.subscriptions.${reset.key}`), reset.vars)+ : t(`ide_side_panel.subscriptions.${reset.key}`)}+ </p>+ )}+ </li>+ );+}++/** The expanded part of a row: every limit of the plan, or why there is none. */+function UsageDetails({ usage, now }: { usage: AccountUsage | null; now: number }) {+ const t = useT();+ const lang = useUiLanguage();+ if (!usage) {+ return <p className="text-[11.5px] text-muted-foreground">{t("ide_side_panel.subscriptions.usage_pending")}</p>;+ }+ if (usage.status !== "ok" || usage.windows.length === 0) {+ const key =+ usage.status === "unsupported"+ ? "usage_unsupported"+ : usage.status === "signed_out"+ ? "usage_signed_out"+ : "usage_unavailable";+ return (+ <p data-testid="subscription-usage-status" className="text-[11.5px] text-muted-foreground">+ {t(`ide_side_panel.subscriptions.${key}`)}+ </p>+ );+ }+ const asOf =+ usage.source === "cached" && usage.as_of+ ? new Intl.DateTimeFormat(lang, { weekday: "short", hour: "2-digit", minute: "2-digit" }).format(usage.as_of * 1000)+ : "";+ return (+ <div className="space-y-2">+ <ul className="space-y-2.5">+ {usage.windows.map((window) => (+ <UsageBar key={`${window.kind}:${window.scope_label ?? window.raw_label ?? ""}`} window={window} now={now} />+ ))}+ </ul>+ {asOf && (+ <p data-testid="subscription-cached" className="text-[10.5px] text-muted-foreground">+ {fill(t("ide_side_panel.subscriptions.cached"), { when: asOf })}+ </p>+ )}+ </div>+ );+}++function SubscriptionLine({ row, now }: { row: SubscriptionRow; now: number }) {+ const t = useT();+ const [open, setOpen] = useState(false);+ const detailsId = useId();+ const { account } = row;+ const title = account.email || account.label;+ const plan = planName(row);+ const subtitle = [account.email ? account.label : "", plan].filter(Boolean).join(" · ");+ const tightest = tightestWindow(row.usage);+ return (+ <li data-testid="subscription-row" data-account={account.id} data-active={row.active || undefined}>+ <button+ type="button"+ aria-expanded={open}+ aria-controls={detailsId}+ onClick={() => setOpen((value) => !value)}+ className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"+ >+ <ChevronRight+ className={cn(+ "h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none",+ open && "rotate-90",+ )}+ aria-hidden+ />+ <span className="flex min-w-0 flex-1 flex-col leading-tight">+ <span className="flex min-w-0 items-center gap-1.5">+ <span className="truncate text-[12.5px] font-medium text-foreground">{title}</span>+ {row.active && (+ <QuickTooltip content={t("ide_side_panel.subscriptions.active_tip")} side="bottom" className="inline-flex shrink-0">+ <span className="rounded border border-border px-1 text-[9.5px] uppercase tracking-wide text-muted-foreground">+ {t("ide_side_panel.subscriptions.active")}+ </span>+ </QuickTooltip>+ )}+ {account.warning && (+ <QuickTooltip content={account.warning} side="bottom" className="inline-flex shrink-0">+ <AlertTriangle+ data-testid="subscription-warning"+ className="h-3.5 w-3.5 text-warning"+ aria-label={account.warning}+ />+ </QuickTooltip>+ )}+ </span>+ {subtitle && <span className="truncate text-[11px] text-muted-foreground">{subtitle}</span>}+ </span>+ {tightest && (+ <span+ data-testid="subscription-peak"+ className={cn("shrink-0 text-[11px] tabular-nums", TEXT_TONE[tightest.severity] ?? TEXT_TONE.normal)}+ >+ {Math.round(tightest.percent)}%+ </span>+ )}+ </button>+ {open && (+ <div id={detailsId} data-testid="subscription-details" className="pb-2 pl-7 pr-2 pt-1">+ <UsageDetails usage={row.usage} now={now} />+ </div>+ )}+ </li>+ );+}++function SubscriptionBlock({ group, now }: { group: SubscriptionGroup; now: number }) {+ return (+ <section data-testid="subscription-group" data-platform={group.platform} className="px-2 py-2">+ <header className="flex items-center gap-2 px-2 pb-1">+ <ProviderLogo providerId={group.platform} label={group.displayName} size="sm" />+ <h3 className="min-w-0 flex-1 truncate text-[12px] font-semibold text-foreground">{group.displayName}</h3>+ <span className="shrink-0 text-[11px] tabular-nums text-muted-foreground">{group.rows.length}</span>+ </header>+ <ul className="space-y-0.5">+ {group.rows.map((row) => (+ <SubscriptionLine key={row.account.id} row={row} now={now} />+ ))}+ </ul>+ </section>+ );+}++/**+ * The Subscriptions tab: every signed-in coding-CLI subscription, one block per+ * CLI. A row is the account at a glance; opening it shows how much of the+ * plan's limits is spent and when each one refills.+ */+export function SubscriptionsTab() {+ const t = useT();+ const { accounts, usage, error, loading, refresh } = useSubscriptions();+ const now = useMinuteClock();+ const groups = groupSubscriptions(accounts, usage);+ return (+ <div data-testid="ide-subscriptions-tab" className="flex h-full min-h-0 flex-col">+ <div className="flex h-9 shrink-0 items-center gap-2 border-b border-border/60 px-3">+ <span className="min-w-0 flex-1 truncate text-[11.5px] text-muted-foreground">+ {t("ide_side_panel.subscriptions.hint")}+ </span>+ <QuickTooltip content={t("ide_side_panel.subscriptions.refresh")} side="bottom" className="inline-flex shrink-0">+ <button+ type="button"+ data-testid="subscriptions-refresh"+ aria-label={t("ide_side_panel.subscriptions.refresh")}+ disabled={loading}+ onClick={refresh}+ className="inline-flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:bg-secondary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-60"+ >+ {loading ? (+ <Loader2 className="h-3.5 w-3.5 animate-spin motion-reduce:animate-none" aria-hidden />+ ) : (+ <RefreshCw className="h-3.5 w-3.5" aria-hidden />+ )}+ </button>+ </QuickTooltip>+ </div>+ <div className="min-h-0 flex-1 overflow-y-auto">+ {error && (+ <p data-testid="subscriptions-error" className="mx-3 mt-3 text-[11.5px] text-destructive">+ {fill(t("ide_side_panel.subscriptions.error"), { error })}+ </p>+ )}+ {!accounts && !error && (+ <div className="flex justify-center py-6">+ <Loader2 className="h-4 w-4 animate-spin text-muted-foreground motion-reduce:animate-none" aria-hidden />+ </div>+ )}+ {accounts && groups.length === 0 && (+ <p data-testid="subscriptions-empty" className="mx-3 mt-3 text-[12px] text-muted-foreground">+ {t("ide_side_panel.subscriptions.empty")}+ </p>+ )}+ <div className="divide-y divide-border/60">+ {groups.map((group) => (+ <SubscriptionBlock key={group.platform} group={group} now={now} />+ ))}+ </div>+ </div>+ </div>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/subscriptionsModel.ts b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/subscriptionsModel.tsnew file mode 100644index 0000000000..f6ec0c7e53--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/subscriptionsModel.ts@@ -0,0 +1,90 @@+import type {+ AccountUsage,+ AgentAccount,+ AgentAccountsResponse,+ UsageWindow,+} from "@/lib/agentAccountsApi";++/** One signed-in subscription, ready to draw. */+export interface SubscriptionRow {+ account: AgentAccount;+ /** Whether new terminals of this CLI start on this subscription. */+ active: boolean;+ usage: AccountUsage | null;+}++/** Every signed-in subscription of one coding CLI — one block in the tab. */+export interface SubscriptionGroup {+ platform: string;+ displayName: string;+ rows: SubscriptionRow[];+}++/**+ * The tab's blocks: one per CLI, holding only subscriptions that are signed in.+ *+ * A registered seat that never finished signing in is not a subscription the+ * user has, so it is left to the settings dialog that manages seats. A CLI with+ * no signed-in seat gets no block at all. The backend's order is kept — both+ * for the blocks and inside them — so a row never jumps when another one+ * becomes the active seat.+ */+export function groupSubscriptions(+ accounts: AgentAccountsResponse | null,+ usage: readonly AccountUsage[],+): SubscriptionGroup[] {+ const byId = new Map(usage.map((reading) => [reading.account_id, reading]));+ return (accounts?.platforms ?? []).flatMap((group) => {+ const rows = (group.accounts ?? [])+ .filter((account) => account.connected)+ .map((account) => ({+ account,+ active: account.id === group.active_account,+ usage: byId.get(account.id) ?? null,+ }));+ if (rows.length === 0) return [];+ return [{ platform: group.platform, displayName: group.display_name || group.platform, rows }];+ });+}++/** The plan name to show: the usage reading's, else the one the login reports. */+export function planName(row: SubscriptionRow): string {+ return row.usage?.plan?.trim() || row.account.tier?.trim() || "";+}++/** The limit closest to running out, or null when nothing was measured. */+export function tightestWindow(usage: AccountUsage | null): UsageWindow | null {+ if (!usage || usage.status !== "ok" || usage.windows.length === 0) return null;+ return usage.windows.reduce((worst, window) => (window.percent > worst.percent ? window : worst));+}++export type ResetText =+ | { key: "reset_soon" }+ | { key: "reset_in_minutes"; vars: { m: number } }+ | { key: "reset_in_hours"; vars: { h: number; m: number } }+ | { key: "reset_on"; vars: { when: string } };++/**+ * When a limit refills, worded for the panel: a countdown inside the next day,+ * a weekday and time beyond it. Null for a missing or unreadable timestamp —+ * no reset line is better than an invented one.+ */+export function resetText(resetsAt: string | null, nowMs: number, locale: string): ResetText | null {+ if (!resetsAt) return null;+ const at = Date.parse(resetsAt);+ if (Number.isNaN(at)) return null;+ const minutes = Math.round((at - nowMs) / 60_000);+ if (minutes < 1) return { key: "reset_soon" };+ if (minutes < 60) return { key: "reset_in_minutes", vars: { m: minutes } };+ if (minutes < 24 * 60) return { key: "reset_in_hours", vars: { h: Math.floor(minutes / 60), m: minutes % 60 } };+ const when = new Intl.DateTimeFormat(locale, { weekday: "short", hour: "2-digit", minute: "2-digit" }).format(at);+ return { key: "reset_on", vars: { when } };+}++/** "5 h" or "30 min" for a window length the provider stated, else "". */+export function windowLength(minutes: number | null): string {+ if (!minutes || minutes <= 0) return "";+ if (minutes % (24 * 60) === 0) return `${minutes / (24 * 60)} d`;+ if (minutes % 60 === 0) return `${minutes / 60} h`;+ return `${minutes} min`;+}diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.jsonindex b9f05909ee..1f4cda4477 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json@@ -6161,8 +6161,35 @@"agents": "Agents","files": "Ordner","changes": "Änderungen",+ "subscriptions": "Abos","office": "Jarvis Verse"},+ "subscriptions": {+ "hint": "Angemeldete Abos, nach Tool",+ "refresh": "Verbrauch aktualisieren",+ "empty": "Noch kein Abo angemeldet. Füge eines in den Workspace-Einstellungen hinzu.",+ "error": "Abos konnten nicht geladen werden ({error}).",+ "active": "Aktiv",+ "active_tip": "Neue Terminals dieses Tools starten mit diesem Abo.",+ "used": "{percent} % verbraucht",+ "usage_pending": "Verbrauch wird gelesen…",+ "usage_unsupported": "Dieses Tool meldet keinen Planverbrauch.",+ "usage_signed_out": "Nicht angemeldet, daher kein Verbrauch.",+ "usage_unavailable": "Der Verbrauch konnte gerade nicht gelesen werden.",+ "cached": "Zuletzt gemeldet {when}",+ "reset_soon": "Wird jetzt zurückgesetzt",+ "reset_in_minutes": "Zurückgesetzt in {m} Min.",+ "reset_in_hours": "Zurückgesetzt in {h} Std. {m} Min.",+ "reset_on": "Zurückgesetzt {when}",+ "window": {+ "session": "Aktuelle Sitzung",+ "session_length": "Aktuelle Sitzung ({length})",+ "weekly": "Wochenlimit",+ "weekly_scoped": "Wochenlimit · {scope}",+ "monthly": "Monatslimit",+ "other": "Weiteres Limit"+ }+ },"git": {"aria": "Branches, Pull Requests und CI","needs_restart": "Jarvis braucht dafür einmal einen Neustart. Danach wählst du einmal das Repository für diesen Ordner.",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.jsonindex 21e2d6ba75..9be0b44836 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json@@ -6194,8 +6194,35 @@"agents": "Agents","files": "Folder","changes": "Changes",+ "subscriptions": "Subscriptions","office": "Jarvis Verse"},+ "subscriptions": {+ "hint": "Signed-in subscriptions, by tool",+ "refresh": "Refresh usage",+ "empty": "No subscription is signed in yet. Add one in the workspace settings.",+ "error": "Subscriptions could not be loaded ({error}).",+ "active": "Active",+ "active_tip": "New terminals of this tool start on this subscription.",+ "used": "{percent}% used",+ "usage_pending": "Reading usage…",+ "usage_unsupported": "This tool does not report plan usage.",+ "usage_signed_out": "Not signed in, so there is no usage to show.",+ "usage_unavailable": "Usage could not be read right now.",+ "cached": "Last reported {when}",+ "reset_soon": "Resets now",+ "reset_in_minutes": "Resets in {m} min",+ "reset_in_hours": "Resets in {h} h {m} min",+ "reset_on": "Resets {when}",+ "window": {+ "session": "Current session",+ "session_length": "Current session ({length})",+ "weekly": "Weekly limit",+ "weekly_scoped": "Weekly limit · {scope}",+ "monthly": "Monthly limit",+ "other": "Other limit"+ }+ },"git": {"aria": "Branches, pull requests and CI","needs_restart": "Jarvis needs one restart to turn this on. After that you pick this folder's repository once.",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.jsonindex a9f045208d..50642c6e65 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json@@ -6161,8 +6161,35 @@"agents": "Agentes","files": "Carpeta","changes": "Cambios",+ "subscriptions": "Suscripciones","office": "Jarvis Verse"},+ "subscriptions": {+ "hint": "Suscripciones con sesión iniciada, por herramienta",+ "refresh": "Actualizar uso",+ "empty": "Aún no hay ninguna suscripción con sesión iniciada. Añade una en los ajustes del espacio de trabajo.",+ "error": "No se pudieron cargar las suscripciones ({error}).",+ "active": "Activa",+ "active_tip": "Los terminales nuevos de esta herramienta usan esta suscripción.",+ "used": "{percent} % usado",+ "usage_pending": "Leyendo el uso…",+ "usage_unsupported": "Esta herramienta no informa del uso del plan.",+ "usage_signed_out": "Sin sesión iniciada, así que no hay uso que mostrar.",+ "usage_unavailable": "No se pudo leer el uso en este momento.",+ "cached": "Último dato {when}",+ "reset_soon": "Se restablece ahora",+ "reset_in_minutes": "Se restablece en {m} min",+ "reset_in_hours": "Se restablece en {h} h {m} min",+ "reset_on": "Se restablece el {when}",+ "window": {+ "session": "Sesión actual",+ "session_length": "Sesión actual ({length})",+ "weekly": "Límite semanal",+ "weekly_scoped": "Límite semanal · {scope}",+ "monthly": "Límite mensual",+ "other": "Otro límite"+ }+ },"git": {"aria": "Ramas, pull requests y CI","needs_restart": "Jarvis necesita reiniciarse una vez para activarlo. Después eliges una sola vez el repositorio de esta carpeta.",diff --git a/jarvis/ui/web/frontend/src/store/ideSidePanel.ts b/jarvis/ui/web/frontend/src/store/ideSidePanel.tsindex abaa008aca..46c7025f7f 100644--- a/jarvis/ui/web/frontend/src/store/ideSidePanel.ts+++ b/jarvis/ui/web/frontend/src/store/ideSidePanel.ts@@ -10,7 +10,7 @@ import { create } from "zustand";*//** Every function the panel can show. A new one is a new id plus a registry entry. */-export type SidePanelTabId = "agents" | "changes" | "files" | "git" | "skills" | "office" | `terminal:${string}`;+export type SidePanelTabId = "agents" | "changes" | "files" | "git" | "skills" | "subscriptions" | "office" | `terminal:${string}`;export interface SidePanelTerminal {id: `terminal:${string}`;@@ -21,7 +21,7 @@ export interface SidePanelTerminal {export const MAX_TERMINAL_TABS = 16;-export const SIDE_PANEL_TAB_IDS: readonly SidePanelTabId[] = ["agents", "changes", "files", "git", "skills", "office"];+export const SIDE_PANEL_TAB_IDS: readonly SidePanelTabId[] = ["agents", "changes", "files", "git", "skills", "subscriptions", "office"];const OPEN_KEY = "jarvis.agenticIde.sidePanelOpen";// v4: the panel starts with Agents alone and the other tabs are added from