mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-30 02:14:43 +08:00
feat: display official subscription quota on Claude provider cards
Read Claude OAuth credentials from macOS Keychain (with file fallback) and query the Anthropic usage API to show quota utilization inline on official provider cards. Includes compact countdown timer for reset windows and hides the rarely-used seven_day_sonnet tier in inline mode.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
export type CredentialStatus =
|
||||
| "valid"
|
||||
| "expired"
|
||||
| "not_found"
|
||||
| "parse_error";
|
||||
|
||||
export interface QuotaTier {
|
||||
name: string;
|
||||
utilization: number; // 0-100
|
||||
resetsAt: string | null;
|
||||
}
|
||||
|
||||
export interface ExtraUsage {
|
||||
isEnabled: boolean;
|
||||
monthlyLimit: number | null;
|
||||
usedCredits: number | null;
|
||||
utilization: number | null;
|
||||
currency: string | null;
|
||||
}
|
||||
|
||||
export interface SubscriptionQuota {
|
||||
tool: string;
|
||||
credentialStatus: CredentialStatus;
|
||||
credentialMessage: string | null;
|
||||
success: boolean;
|
||||
tiers: QuotaTier[];
|
||||
extraUsage: ExtraUsage | null;
|
||||
error: string | null;
|
||||
queriedAt: number | null;
|
||||
}
|
||||
Reference in New Issue
Block a user