Files
CC-Switch/src/types/subscription.ts
T
Jason b30f3c27ad 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.
2026-04-04 22:53:20 +08:00

31 lines
629 B
TypeScript

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;
}