feat: add Kiro (AWS CodeWhisperer) quota display support

- Add Kiro quota types (KiroFreeTrialInfo, KiroUsageBreakdown, KiroQuotaPayload, KiroQuotaState)
- Add Kiro API constants and request headers
- Add isKiroFile validator and parseKiroQuotaPayload parser
- Add KIRO_CONFIG with fetchKiroQuota and renderKiroItems
- Add kiroQuota state to useQuotaStore
- Add Kiro QuotaSection to QuotaPage
- Add Kiro styles (.kiroGrid, .kiroControls, .kiroControl, .kiroCard)
- Add i18n translations for kiro_quota (zh-CN and en)

Features:
- Separate display for base credits and bonus credits (freeTrialInfo)
- Total credits summary
- Correct parsing of seconds timestamp (scientific notation like 1.769904E9)
- Reset time display
- Subscription type display
This commit is contained in:
Lany798
2026-01-31 19:02:44 +08:00
parent dcdb20159b
commit f77cbad98e
11 changed files with 460 additions and 11 deletions

View File

@@ -145,3 +145,58 @@ export interface CodexQuotaState {
error?: string;
errorStatus?: number;
}
// Kiro (AWS CodeWhisperer) quota types
export interface KiroFreeTrialInfo {
freeTrialStatus?: string;
usageLimit?: number;
currentUsage?: number;
usageLimitWithPrecision?: number;
currentUsageWithPrecision?: number;
}
export interface KiroUsageBreakdown {
usageLimit?: number;
currentUsage?: number;
usageLimitWithPrecision?: number;
currentUsageWithPrecision?: number;
nextDateReset?: number;
displayName?: string;
resourceType?: string;
freeTrialInfo?: KiroFreeTrialInfo;
}
export interface KiroQuotaPayload {
daysUntilReset?: number;
nextDateReset?: number;
userInfo?: {
email?: string;
userId?: string;
};
subscriptionInfo?: {
subscriptionTitle?: string;
type?: string;
};
usageBreakdownList?: KiroUsageBreakdown[];
}
export interface KiroQuotaState {
status: 'idle' | 'loading' | 'success' | 'error';
// Base quota (原本额度)
baseUsage: number | null;
baseLimit: number | null;
baseRemaining: number | null;
// Free trial/bonus quota (赠送额度)
bonusUsage: number | null;
bonusLimit: number | null;
bonusRemaining: number | null;
bonusStatus?: string;
// Total (合计)
currentUsage: number | null;
usageLimit: number | null;
remainingCredits: number | null;
nextReset?: string;
subscriptionType?: string;
error?: string;
errorStatus?: number;
}