import type { DashboardAccount } from './render.js'; /** * Whether an account can be used right now, and if not, what is stopping it. * * Lives on its own because more than one surface answers this question: the * terminal dashboard draws it, and `ccx state` hands it to whatever is reading * ccx from outside. The last time two places worked out the same thing * separately they drifted, and the table ended up printing "ready" beside a * window reading 100% while rotation refused to use that account. So the rule * is written once and both callers take the answer rather than recomputing it. * * The rule itself: a window is spent at 100% while it is still open, which is * exactly `usableCapacity`'s test, so this can never disagree with the planner * either. */ export interface Constraint { /** `capped`, `5h`, `week`, or a model name. */ label: string; /** When it lifts, if that is known. */ until?: number | null; } export type AccountState = /** Nothing is stopping it. */ 'ready' /** Turned off by the operator. */ | 'disabled' /** Signed out, so nothing can run on it. */ | 'logged-out' /** A window is spent, or ccx was refused. `constraints` says which. */ | 'blocked'; export interface AccountStatus { state: AccountState; /** Everything currently blocking, empty when ready. */ constraints: Constraint[]; /** What to name: the model when the model is blocked, else what lifts last. */ label: string | null; /** When the account can be used again, ie. when the LAST constraint lifts. */ until: number | null; } /** Everything blocking this account right now, judged on the usage as it stands. */ export declare function constraintsOn(a: DashboardAccount, model: string | null, now: number): Constraint[]; /** The whole answer: usable or not, what is stopping it, and until when. */ export declare function accountStatus(a: DashboardAccount, model: string | null, now: number): AccountStatus;