Users on Codex or Claude Code subscriptions could not see how much quota was left or when it resets without leaving T3 Code. A user whose CLIs route through a CLIProxyAPI hub could not see it at all. Each driver now returns `usageLimits` on its own snapshot (Codex from `account/rateLimits/read`, Claude from the SDK's `get_usage`), adapters normalise turn-driven rate-limit events at the boundary, and a driver-blind ingestion layer folds them onto the owning instance. The Usage page gains a Limits tab (mobile a card) with a bar per window, elapsed marker, pace, and reset countdown. CLIProxyAPI hubs can be added as read-only usage-limit sources; their accounts show badged "via CLIProxyAPI" with emails blurred. Distilled from #1732 (server model, provider rows) and #9421 (Limits tab, window bars, pace maths). Closes #228. Co-authored-by: Aditya Mer <[email protected]> Co-authored-by: Wout Stiens <[email protected]> Co-authored-by: Claude Code <[email protected]>
10 lines
380 B
TypeScript
10 lines
380 B
TypeScript
import * as Schema from "effect/Schema";
|
|
|
|
/**
|
|
* Key of one `settings.usageLimitSources` entry. Lives in its own module so
|
|
* both the settings and the usage-limit contracts can import it without
|
|
* importing each other.
|
|
*/
|
|
export const UsageLimitSourceId = Schema.String.pipe(Schema.brand("UsageLimitSourceId"));
|
|
export type UsageLimitSourceId = typeof UsageLimitSourceId.Type;
|