feat(antigravity): add weekly quota tracking and free-tier handling (#3892)

This commit is contained in:
Christian Gennari
2026-09-09 09:54:40 +07:00
parent 628ff1eab5
commit e3bf94ee25
10 changed files with 811 additions and 9 deletions

View File

@@ -376,10 +376,12 @@ export function parseQuotaData(provider, data) {
case "antigravity":
if (data.quotas) {
const entries = Object.entries(data.quotas);
const weeklyKeys = new Set(["gemini_weekly", "claude_gpt_weekly"]);
const geminiModels = entries.filter(([k]) => k.startsWith("gemini-") && !k.includes("image"));
const claudeModels = entries.filter(([k]) => k.startsWith("claude-"));
const imageModels = entries.filter(([k]) => k.includes("image"));
const otherModels = entries.filter(([k]) => !k.startsWith("gemini-") && !k.startsWith("claude-") && !k.includes("image"));
const weeklyModels = entries.filter(([k]) => weeklyKeys.has(k));
const otherModels = entries.filter(([k]) => !k.startsWith("gemini-") && !k.startsWith("claude-") && !k.includes("image") && !weeklyKeys.has(k));
if (geminiModels.length > 0) {
const rep = geminiModels.reduce((min, cur) =>
@@ -409,6 +411,17 @@ export function parseQuotaData(provider, data) {
});
}
weeklyModels.forEach(([modelKey, quota]) => {
normalizedQuotas.push({
name: quota.displayName || modelKey,
modelKey,
used: quota.used || 0,
total: quota.total || 0,
resetAt: quota.resetAt || null,
remainingPercentage: quota.remainingPercentage,
});
});
imageModels.forEach(([modelKey, quota]) => {
normalizedQuotas.push({
name: quota.displayName || modelKey,