/** * 额度管理 (quota-manage) — Coding Plan card, laid out as: * * 「额度管理」 blue title * 「115% 账期 10-10」 big figure under the title, the grey 账期 line * to its RIGHT, bottom-aligned with the figure * 「今日用量 24.7M 今日推荐 200M」 today's tokens beside the day's budget * * The pool view is NOT labelled on the head (the stacked `AllUser` + 账期 block was * rejected as ugly): tapping the card still cycles the pool, the figures just move * with it silently. * * The percent is a RUN-RATE projection of the month end: percent consumed so * far ÷ elapsed share of the period (one day at 3% ⇒ thirty days at 90%). The * budget is the remaining balance converted at the period's realised local * token-per-credit rate and split over the days left, so following it lands the * period at exactly 100%. * * Past 100% the number itself escalates: error red + a slow blink * (`valuePulse`) — deliberately NOT a card-wide red glow. * * The card never prints an error message — whatever is missing is FILLED. No * payload yet → `-%` beside the 账期 line it can still read; a period too young * to project (a pool member added today) → its real consumed percent, its real * budget, and 0 tokens; an unused member → zeros everywhere except the budget, * which is remaining credits ÷ days left at the POOL's realised rate (it has no * rate of its own yet). * * The plan numbers come from the Command Code account payload through * `cc-view`'s monthly window (the same official-matching percent the * cc-window-monthly card prints) and the shared daily token log SCOPE-LIMITED to * the Command Code route; the math lives in `client/lib/quota-math` (pure, * probe-able). * * Scope: every token figure here is the machine's log folded to the * `commandcode` route alone (`stats.commandCodeDaily`, served by * `/api/widgets-usage-daily?provider=commandcode`). The card's credits and * billing period describe that ONE plan, so reading the machine-wide log charged * it for every other provider the harness talked to that day (measured * 2026-09-20: 今日用量 758M where the plan itself served 474M — the rest was a * parallel OpenCode Go pool). When that scoped map is unavailable the token * figures print `—`, never a number measured on the wrong traffic. */ import { defineWidget } from '../../client/lib/contract/helpers'; import type { WidgetRenderMeta, WidgetStats } from '../../client/lib/contract/types'; declare function quotaRender(stats: WidgetStats, meta?: WidgetRenderMeta): ReturnType['render']>>; /** Widget-owned preview: a live-shaped account (period ending 26 days out) plus * a deterministic 14-day log, so the preview shows plausible M figures instead * of the shared mock's tiny token counts. The pace is sized so the run-rate * projects a CALM month (measured 2026-09-20: ≈70%, so the default preview is * not already in the red) — the over-budget state is the one the preview click * adds. */ declare function previewStats(): Partial; declare const _default: { id: string; name: () => string; desc: () => string; builtin: true; group: string; render: typeof quotaRender; simToggle: () => string; example: { stats: typeof previewStats; sim: { over: boolean; }; simSteps: { over: boolean; }[]; }; }; export default _default;