| index 49f1b9a..71cfa44 100644 | ||
| --- a/plugin.json | ||
| +++ b/plugin.json | ||
| @@ -2,7 +2,7 @@ | ||
| 2 | 2 | "slug": "google-quota", |
| 3 | 3 | "id": "plugin_google_quota", |
| 4 | 4 | "title": "Google Account Quotas", |
| 5 | - "version": "1.0.1", | |
| 5 | + "version": "1.0.2", | |
| 6 | 6 | "summary": "Zero-dependency Google Antigravity multi-account quota monitor and active-account switcher for your node. Reads the local antigravity_accounts.json and selected_account.txt files, queries per-model quota pools through the node's scorpiox-google-quota CLI, and lets you switch the active account in one click. Holds no OAuth client secret and never prints, logs or returns any refresh or access token.", |
| 7 | 7 | "category": "devtools", |
| 8 | 8 | "license": "MIT", |
| index b1bbb8e..496d539 100644 | ||
| --- a/src/plugin_google_quota.c | ||
| +++ b/src/plugin_google_quota.c | ||
| @@ -77,7 +77,7 @@ | ||
| 77 | 77 | |
| 78 | 78 | #define PLUGIN_SLUG "google-quota" |
| 79 | 79 | #define PLUGIN_ID "plugin_google_quota" |
| 80 | -#define PLUGIN_VER "1.0.1" | |
| 80 | +#define PLUGIN_VER "1.0.2" | |
| 81 | 81 | #define PLUGIN_NAME "google quota" |
| 82 | 82 | #define PLUGIN_DESC "Account quotas" |
| 83 | 83 | #define DEFAULT_QUOTA_BIN "scorpiox-google-quota" |
| @@ -91,7 +91,7 @@ | ||
| 91 | 91 | #define FIELD_SZ 512 |
| 92 | 92 | #define OUT_MAX (512 * 1024) |
| 93 | 93 | #define MAX_ACCOUNTS 64 |
| 94 | -#define MAX_MODELS 64 | |
| 94 | +#define MAX_MODELS 128 | |
| 95 | 95 | #define MAX_WORKERS 8 |
| 96 | 96 | |
| 97 | 97 | /* ------------------------------------------------------------------ */ |
| @@ -867,6 +867,7 @@ typedef struct { | ||
| 867 | 867 | char error[64]; |
| 868 | 868 | char project[PROJ_SZ]; |
| 869 | 869 | pool_summary_t gemini; |
| 870 | + pool_summary_t argon; | |
| 870 | 871 | pool_summary_t claude; |
| 871 | 872 | model_quota_t models[MAX_MODELS]; |
| 872 | 873 | int model_count; |
| @@ -915,6 +916,7 @@ static void parse_quota_output(const buf_t *raw, int run_rc, acct_quota_t *q) | ||
| 915 | 916 | |
| 916 | 917 | memset(q, 0, sizeof(*q)); |
| 917 | 918 | pool_init(&q->gemini); |
| 919 | + pool_init(&q->argon); | |
| 918 | 920 | pool_init(&q->claude); |
| 919 | 921 | |
| 920 | 922 | if (run_rc == -1) { |
| @@ -982,7 +984,10 @@ static void parse_quota_output(const buf_t *raw, int run_rc, acct_quota_t *q) | ||
| 982 | 984 | exhausted = 1; |
| 983 | 985 | } |
| 984 | 986 | |
| 985 | - if (strncmp(mid, "gemini-", 7) == 0) { | |
| 987 | + if (strncmp(mid, "gemini-4-argon", 14) == 0) { | |
| 988 | + pool_name = "argon"; | |
| 989 | + pool_add(&q->argon, pct, exhausted, rst); | |
| 990 | + } else if (strncmp(mid, "gemini-", 7) == 0) { | |
| 986 | 991 | pool_name = "gemini"; |
| 987 | 992 | pool_add(&q->gemini, pct, exhausted, rst); |
| 988 | 993 | } else if (strncmp(mid, "claude-", 7) == 0) { |
| @@ -1311,6 +1316,8 @@ static void emit_acct_quota_json(buf_t *b, const acct_entry_t *a, const acct_quo | ||
| 1311 | 1316 | buf_json(b, q->project); |
| 1312 | 1317 | buf_adds(b, ",\"gemini\":"); |
| 1313 | 1318 | emit_pool_json(b, &q->gemini, now_epoch); |
| 1319 | + buf_adds(b, ",\"argon\":"); | |
| 1320 | + emit_pool_json(b, &q->argon, now_epoch); | |
| 1314 | 1321 | buf_adds(b, ",\"claude\":"); |
| 1315 | 1322 | emit_pool_json(b, &q->claude, now_epoch); |
| 1316 | 1323 | buf_adds(b, ",\"models\":["); |
| @@ -1432,8 +1439,10 @@ static int action_quota(const char *target_email) | ||
| 1432 | 1439 | { |
| 1433 | 1440 | acct_quota_t *qs = NULL; |
| 1434 | 1441 | const char *best_g = ""; |
| 1442 | + const char *best_a = ""; | |
| 1435 | 1443 | const char *best_c = ""; |
| 1436 | 1444 | double best_gp = -1.0; |
| 1445 | + double best_ap = -1.0; | |
| 1437 | 1446 | double best_cp = -1.0; |
| 1438 | 1447 | |
| 1439 | 1448 | if (count > 0) { |
| @@ -1457,6 +1466,10 @@ static int action_quota(const char *target_email) | ||
| 1457 | 1466 | best_gp = qs[i].gemini.pct; |
| 1458 | 1467 | best_g = accts[i].email; |
| 1459 | 1468 | } |
| 1469 | + if (qs[i].argon.present && !qs[i].argon.exhausted && qs[i].argon.pct > best_ap) { | |
| 1470 | + best_ap = qs[i].argon.pct; | |
| 1471 | + best_a = accts[i].email; | |
| 1472 | + } | |
| 1460 | 1473 | if (qs[i].claude.present && !qs[i].claude.exhausted && qs[i].claude.pct > best_cp) { |
| 1461 | 1474 | best_cp = qs[i].claude.pct; |
| 1462 | 1475 | best_c = accts[i].email; |
| @@ -1469,6 +1482,8 @@ static int action_quota(const char *target_email) | ||
| 1469 | 1482 | buf_json(&b, selected); |
| 1470 | 1483 | buf_adds(&b, ",\"best_gemini\":"); |
| 1471 | 1484 | buf_json(&b, best_g); |
| 1485 | + buf_adds(&b, ",\"best_argon\":"); | |
| 1486 | + buf_json(&b, best_a); | |
| 1472 | 1487 | buf_adds(&b, ",\"best_claude\":"); |
| 1473 | 1488 | buf_json(&b, best_c); |
| 1474 | 1489 | buf_addf(&b, ",\"count\":%d,\"accounts\":[", count); |
| index f291e1b..02dcd58 100644 | ||
| --- a/src/ui.html | ||
| +++ b/src/ui.html | ||
| @@ -28,7 +28,7 @@ body{background:var(--bg);color:var(--text);font-family:var(--font);font-size:14 | ||
| 28 | 28 | #themeToggle{background:var(--surface-2);border:1px solid var(--line);color:var(--text); |
| 29 | 29 | border-radius:980px;padding:5px 12px;font-size:12px;font-weight:600;cursor:pointer; |
| 30 | 30 | font-family:inherit} |
| 31 | -.kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:12px} | |
| 31 | +.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;margin-bottom:12px} | |
| 32 | 32 | .kpi{background:var(--bg-card);border:1px solid var(--line);border-radius:12px;padding:12px 14px;min-width:0} |
| 33 | 33 | .kpi .lbl{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-2)} |
| 34 | 34 | .kpi .val{margin-top:4px;font-size:15px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis} |
| @@ -56,7 +56,7 @@ body{background:var(--bg);color:var(--text);font-family:var(--font);font-size:14 | ||
| 56 | 56 | background:var(--surface-2);color:var(--text-2);border:1px solid var(--line)} |
| 57 | 57 | .tag.sel{color:var(--blue);border-color:rgba(10,132,255,.4)} |
| 58 | 58 | .tag.best{color:var(--green);border-color:rgba(48,209,88,.35)} |
| 59 | -.pools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px} | |
| 59 | +.pools{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px} | |
| 60 | 60 | .pool{background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:10px 12px} |
| 61 | 61 | .pool-hd{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:6px} |
| 62 | 62 | .pool-name{font-size:12px;font-weight:650;color:var(--text)} |
| @@ -129,6 +129,11 @@ body{background:var(--bg);color:var(--text);font-family:var(--font);font-size:14 | ||
| 129 | 129 | <div class="val" id="kpiGemini">-</div> |
| 130 | 130 | <div class="meta" id="kpiGeminiMeta">Waiting for quota</div> |
| 131 | 131 | </div> |
| 132 | + <div class="kpi"> | |
| 133 | + <div class="lbl">Best Argon</div> | |
| 134 | + <div class="val" id="kpiArgon">-</div> | |
| 135 | + <div class="meta" id="kpiArgonMeta">Waiting for quota</div> | |
| 136 | + </div> | |
| 132 | 137 | <div class="kpi"> |
| 133 | 138 | <div class="lbl">Best Claude</div> |
| 134 | 139 | <div class="val" id="kpiClaude">-</div> |
| @@ -263,18 +268,21 @@ function el(tag,cls,txt){ | ||
| 263 | 268 | } |
| 264 | 269 | |
| 265 | 270 | function computeBest(){ |
| 266 | - var bestG=null,bestGP=-1,bestGR='',bestC=null,bestCP=-1,bestCR=''; | |
| 271 | + var bestG=null,bestGP=-1,bestGR='',bestA=null,bestAP=-1,bestAR='',bestC=null,bestCP=-1,bestCR=''; | |
| 267 | 272 | state.accounts.forEach(function(a){ |
| 268 | 273 | var qd=state.quotas[a.email]; |
| 269 | 274 | if(!qd||!qd.ok)return; |
| 270 | 275 | if(qd.gemini&&!qd.gemini.exhausted&&qd.gemini.pct>bestGP){ |
| 271 | 276 | bestGP=qd.gemini.pct;bestG=a.email;bestGR=qd.gemini.reset_time||''; |
| 272 | 277 | } |
| 278 | + if(qd.argon&&qd.argon.count>0&&!qd.argon.exhausted&&qd.argon.pct>bestAP){ | |
| 279 | + bestAP=qd.argon.pct;bestA=a.email;bestAR=qd.argon.reset_time||''; | |
| 280 | + } | |
| 273 | 281 | if(qd.claude&&!qd.claude.exhausted&&qd.claude.pct>bestCP){ |
| 274 | 282 | bestCP=qd.claude.pct;bestC=a.email;bestCR=qd.claude.reset_time||''; |
| 275 | 283 | } |
| 276 | 284 | }); |
| 277 | - return {gemini:bestG,geminiPct:bestGP,geminiReset:bestGR,claude:bestC,claudePct:bestCP,claudeReset:bestCR}; | |
| 285 | + return {gemini:bestG,geminiPct:bestGP,geminiReset:bestGR,argon:bestA,argonPct:bestAP,argonReset:bestAR,claude:bestC,claudePct:bestCP,claudeReset:bestCR}; | |
| 278 | 286 | } |
| 279 | 287 | |
| 280 | 288 | function renderPool(label,pool,loading){ |
| @@ -329,6 +337,10 @@ function render(){ | ||
| 329 | 337 | $('kpiGemini').title=best.gemini||''; |
| 330 | 338 | $('kpiGeminiMeta').textContent=best.gemini?(best.geminiPct.toFixed(1)+'% remaining'+(best.geminiReset?(' · resets in '+fmtResetShort(best.geminiReset)):'')):(state.loading?'Checking...':'No quota data'); |
| 331 | 339 | |
| 340 | + $('kpiArgon').textContent=best.argon?shortEmail(best.argon):'-'; | |
| 341 | + $('kpiArgon').title=best.argon||''; | |
| 342 | + $('kpiArgonMeta').textContent=best.argon?(best.argonPct.toFixed(1)+'% remaining'+(best.argonReset?(' · resets in '+fmtResetShort(best.argonReset)):'')):(state.loading?'Checking...':'No Argon quota'); | |
| 343 | + | |
| 332 | 344 | $('kpiClaude').textContent=best.claude?shortEmail(best.claude):'-'; |
| 333 | 345 | $('kpiClaude').title=best.claude||''; |
| 334 | 346 | $('kpiClaudeMeta').textContent=best.claude?(best.claudePct.toFixed(1)+'% remaining'+(best.claudeReset?(' · resets in '+fmtResetShort(best.claudeReset)):'')):(state.loading?'Checking...':'No quota data'); |
| @@ -351,6 +363,7 @@ function render(){ | ||
| 351 | 363 | var badges=el('div','badges'); |
| 352 | 364 | if(isSel)badges.appendChild(el('span','tag sel','Selected')); |
| 353 | 365 | if(best.gemini===a.email)badges.appendChild(el('span','tag best','Best Gemini')); |
| 366 | + if(best.argon===a.email)badges.appendChild(el('span','tag best','Best Argon')); | |
| 354 | 367 | if(best.claude===a.email)badges.appendChild(el('span','tag best','Best Claude')); |
| 355 | 368 | if(!a.has_refresh)badges.appendChild(el('span','tag','No refresh token')); |
| 356 | 369 | top.appendChild(badges); |
| @@ -367,6 +380,9 @@ function render(){ | ||
| 367 | 380 | }else{ |
| 368 | 381 | var pools=el('div','pools'); |
| 369 | 382 | pools.appendChild(renderPool('Gemini Pool',qd?qd.gemini:null,state.loading)); |
| 383 | + if(qd&&qd.argon&&qd.argon.count>0){ | |
| 384 | + pools.appendChild(renderPool('Argon Pool',qd.argon,state.loading)); | |
| 385 | + } | |
| 370 | 386 | pools.appendChild(renderPool('Claude Pool',qd?qd.claude:null,state.loading)); |
| 371 | 387 | card.appendChild(pools); |
| 372 | 388 |
| index eb9099c..d605958 100644 | ||
| --- a/src/ui_html.h | ||
| +++ b/src/ui_html.h | ||
| @@ -33,7 +33,7 @@ static const char *UI_HTML = | ||
| 33 | 33 | "#themeToggle{background:var(--surface-2);border:1px solid var(--line);color:var(--text);\n" |
| 34 | 34 | " border-radius:980px;padding:5px 12px;font-size:12px;font-weight:600;cursor:pointer;\n" |
| 35 | 35 | " font-family:inherit}\n" |
| 36 | - ".kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:12px}\n" | |
| 36 | + ".kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;margin-bottom:12px}\n" | |
| 37 | 37 | ".kpi{background:var(--bg-card);border:1px solid var(--line);border-radius:12px;padding:12px 14px;min-width:0}\n" |
| 38 | 38 | ".kpi .lbl{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-2)}\n" |
| 39 | 39 | ".kpi .val{margin-top:4px;font-size:15px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n" |
| @@ -61,7 +61,7 @@ static const char *UI_HTML = | ||
| 61 | 61 | " background:var(--surface-2);color:var(--text-2);border:1px solid var(--line)}\n" |
| 62 | 62 | ".tag.sel{color:var(--blue);border-color:rgba(10,132,255,.4)}\n" |
| 63 | 63 | ".tag.best{color:var(--green);border-color:rgba(48,209,88,.35)}\n" |
| 64 | - ".pools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}\n" | |
| 64 | + ".pools{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px}\n" | |
| 65 | 65 | ".pool{background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:10px 12px}\n" |
| 66 | 66 | ".pool-hd{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:6px}\n" |
| 67 | 67 | ".pool-name{font-size:12px;font-weight:650;color:var(--text)}\n" |
| @@ -135,6 +135,11 @@ static const char *UI_HTML = | ||
| 135 | 135 | " <div class=\"meta\" id=\"kpiGeminiMeta\">Waiting for quota</div>\n" |
| 136 | 136 | " </div>\n" |
| 137 | 137 | " <div class=\"kpi\">\n" |
| 138 | + " <div class=\"lbl\">Best Argon</div>\n" | |
| 139 | + " <div class=\"val\" id=\"kpiArgon\">-</div>\n" | |
| 140 | + " <div class=\"meta\" id=\"kpiArgonMeta\">Waiting for quota</div>\n" | |
| 141 | + " </div>\n" | |
| 142 | + " <div class=\"kpi\">\n" | |
| 138 | 143 | " <div class=\"lbl\">Best Claude</div>\n" |
| 139 | 144 | " <div class=\"val\" id=\"kpiClaude\">-</div>\n" |
| 140 | 145 | " <div class=\"meta\" id=\"kpiClaudeMeta\">Waiting for quota</div>\n" |
| @@ -268,18 +273,21 @@ static const char *UI_HTML = | ||
| 268 | 273 | "}\n" |
| 269 | 274 | "\n" |
| 270 | 275 | "function computeBest(){\n" |
| 271 | - " var bestG=null,bestGP=-1,bestGR='',bestC=null,bestCP=-1,bestCR='';\n" | |
| 276 | + " var bestG=null,bestGP=-1,bestGR='',bestA=null,bestAP=-1,bestAR='',bestC=null,bestCP=-1,bestCR='';\n" | |
| 272 | 277 | " state.accounts.forEach(function(a){\n" |
| 273 | 278 | " var qd=state.quotas[a.email];\n" |
| 274 | 279 | " if(!qd||!qd.ok)return;\n" |
| 275 | 280 | " if(qd.gemini&&!qd.gemini.exhausted&&qd.gemini.pct>bestGP){\n" |
| 276 | 281 | " bestGP=qd.gemini.pct;bestG=a.email;bestGR=qd.gemini.reset_time||'';\n" |
| 277 | 282 | " }\n" |
| 283 | + " if(qd.argon&&qd.argon.count>0&&!qd.argon.exhausted&&qd.argon.pct>bestAP){\n" | |
| 284 | + " bestAP=qd.argon.pct;bestA=a.email;bestAR=qd.argon.reset_time||'';\n" | |
| 285 | + " }\n" | |
| 278 | 286 | " if(qd.claude&&!qd.claude.exhausted&&qd.claude.pct>bestCP){\n" |
| 279 | 287 | " bestCP=qd.claude.pct;bestC=a.email;bestCR=qd.claude.reset_time||'';\n" |
| 280 | 288 | " }\n" |
| 281 | 289 | " });\n" |
| 282 | - " return {gemini:bestG,geminiPct:bestGP,geminiReset:bestGR,claude:bestC,claudePct:bestCP,claudeReset:bestCR};\n" | |
| 290 | + " return {gemini:bestG,geminiPct:bestGP,geminiReset:bestGR,argon:bestA,argonPct:bestAP,argonReset:bestAR,claude:bestC,claudePct:bestCP,claudeReset:bestCR};\n" | |
| 283 | 291 | "}\n" |
| 284 | 292 | "\n" |
| 285 | 293 | "function renderPool(label,pool,loading){\n" |
| @@ -334,6 +342,10 @@ static const char *UI_HTML = | ||
| 334 | 342 | " $('kpiGemini').title=best.gemini||'';\n" |
| 335 | 343 | " $('kpiGeminiMeta').textContent=best.gemini?(best.geminiPct.toFixed(1)+'% remaining'+(best.geminiReset?(' · resets in '+fmtResetShort(best.geminiReset)):'')):(state.loading?'Checking...':'No quota data');\n" |
| 336 | 344 | "\n" |
| 345 | + " $('kpiArgon').textContent=best.argon?shortEmail(best.argon):'-';\n" | |
| 346 | + " $('kpiArgon').title=best.argon||'';\n" | |
| 347 | + " $('kpiArgonMeta').textContent=best.argon?(best.argonPct.toFixed(1)+'% remaining'+(best.argonReset?(' · resets in '+fmtResetShort(best.argonReset)):'')):(state.loading?'Checking...':'No Argon quota');\n" | |
| 348 | + "\n" | |
| 337 | 349 | " $('kpiClaude').textContent=best.claude?shortEmail(best.claude):'-';\n" |
| 338 | 350 | " $('kpiClaude').title=best.claude||'';\n" |
| 339 | 351 | " $('kpiClaudeMeta').textContent=best.claude?(best.claudePct.toFixed(1)+'% remaining'+(best.claudeReset?(' · resets in '+fmtResetShort(best.claudeReset)):'')):(state.loading?'Checking...':'No quota data');\n" |
| @@ -356,6 +368,7 @@ static const char *UI_HTML = | ||
| 356 | 368 | " var badges=el('div','badges');\n" |
| 357 | 369 | " if(isSel)badges.appendChild(el('span','tag sel','Selected'));\n" |
| 358 | 370 | " if(best.gemini===a.email)badges.appendChild(el('span','tag best','Best Gemini'));\n" |
| 371 | + " if(best.argon===a.email)badges.appendChild(el('span','tag best','Best Argon'));\n" | |
| 359 | 372 | " if(best.claude===a.email)badges.appendChild(el('span','tag best','Best Claude'));\n" |
| 360 | 373 | " if(!a.has_refresh)badges.appendChild(el('span','tag','No refresh token'));\n" |
| 361 | 374 | " top.appendChild(badges);\n" |
| @@ -372,6 +385,9 @@ static const char *UI_HTML = | ||
| 372 | 385 | " }else{\n" |
| 373 | 386 | " var pools=el('div','pools');\n" |
| 374 | 387 | " pools.appendChild(renderPool('Gemini Pool',qd?qd.gemini:null,state.loading));\n" |
| 388 | + " if(qd&&qd.argon&&qd.argon.count>0){\n" | |
| 389 | + " pools.appendChild(renderPool('Argon Pool',qd.argon,state.loading));\n" | |
| 390 | + " }\n" | |
| 375 | 391 | " pools.appendChild(renderPool('Claude Pool',qd?qd.claude:null,state.loading));\n" |
| 376 | 392 | " card.appendChild(pools);\n" |
| 377 | 393 | "\n" |
| index 33af6e9..875750e 100755 | ||
| --- a/tests/mock_quota.sh | ||
| +++ b/tests/mock_quota.sh | ||
| @@ -35,9 +35,14 @@ case "$acct" in | ||
| 35 | 35 | "buckets": [ |
| 36 | 36 | {"tokenType": "WTUS", "modelId": "chat_20706", "remainingFraction": 1}, |
| 37 | 37 | {"resetTime": "$RST_CLAUDE", "tokenType": "WTUS", "modelId": "claude-opus-4-6-thinking", "remainingFraction": 1}, |
| 38 | + {"resetTime": "$RST_CLAUDE", "tokenType": "WTUS", "modelId": "claude-opus-5-5-high", "remainingFraction": 1}, | |
| 38 | 39 | {"resetTime": "$RST_CLAUDE", "tokenType": "WTUS", "modelId": "claude-sonnet-4-6", "remainingFraction": 1}, |
| 40 | + {"resetTime": "$RST_CLAUDE", "tokenType": "WTUS", "modelId": "claude-sonnet-5-5-high", "remainingFraction": 1}, | |
| 39 | 41 | {"resetTime": "$RST_GEMINI", "tokenType": "WTUS", "modelId": "gemini-3.8-flash-tiered", "remainingFraction": 0.855}, |
| 42 | + {"resetTime": "$RST_GEMINI", "tokenType": "WTUS", "modelId": "gemini-4-argon-high", "remainingFraction": 1}, | |
| 43 | + {"resetTime": "$RST_GEMINI", "tokenType": "WTUS", "modelId": "gemini-4-hydrogen-high", "remainingFraction": 0.855}, | |
| 40 | 44 | {"resetTime": "$RST_GEMINI", "tokenType": "WTUS", "modelId": "gemini-4-hydrogen-sonar", "remainingFraction": 0.855}, |
| 45 | + {"resetTime": "$RST_GEMINI", "tokenType": "WTUS", "modelId": "gemini-4-neon-high", "remainingFraction": 0.855}, | |
| 41 | 46 | {"tokenType": "WTUS", "modelId": "tab_flash_lite_preview", "remainingFraction": 1} |
| 42 | 47 | ] |
| 43 | 48 | } |
| index cc47abc..6f4d62d 100755 | ||
| --- a/tests/run.sh | ||
| +++ b/tests/run.sh | ||
| @@ -102,7 +102,7 @@ META_ENV=$(BOT_PASSWORD=secret-pass SX_PLUGIN_META=1 $BIN) | ||
| 102 | 102 | check "SX_PLUGIN_META=1 works without auth" '{"name":"google quota","desc":"Account quotas"}' "$META_ENV" |
| 103 | 103 | |
| 104 | 104 | VER=$($BIN --version) |
| 105 | -check "--version prints plugin id and version" "plugin_google_quota 1.0.1" "$VER" | |
| 105 | +check "--version prints plugin id and version" "plugin_google_quota 1.0.2" "$VER" | |
| 106 | 106 | UNAUTH=$(BOT_PASSWORD=secret-pass QUERY_STRING="action=status" $BIN) |
| 107 | 107 | check "missing password returns 401" "Status: 401 Unauthorized" "$UNAUTH" |
| 108 | 108 | |
| @@ -134,8 +134,8 @@ json_ok "missing CLI sets cli_present false" "$ST_NOCLI" "d['ok'] is True and d[ | ||
| 134 | 134 | # ---------------------------------------------------------------- quota |
| 135 | 135 | section "quota" |
| 136 | 136 | Q_ONE=$(GOOGLE_ACCOUNTS_FILE="$FIX/full/antigravity_accounts.json" api "action=quota&account=alpha@example.com") |
| 137 | -json_ok "single account quota parses gemini and claude pools and remaining hours" "$Q_ONE" \ | |
| 138 | - "d['ok'] is True and d['account']['ok'] is True and abs(d['account']['gemini']['pct'] - 85.5) < 0.01 and abs(d['account']['claude']['pct'] - 100.0) < 0.01 and len(d['account']['models']) == 4 and d['account']['gemini']['reset_in_seconds'] > 500000 and d['account']['gemini']['reset_in_hours'] > 140 and 'h ' in d['account']['gemini']['reset_remaining'] and d['account']['claude']['reset_in_seconds'] > 7000 and 'h ' in d['account']['claude']['reset_remaining'] and all('reset_remaining' in m and 'reset_in_hours' in m for m in d['account']['models'])" | |
| 137 | +json_ok "single account quota parses gemini, argon, and claude pools and remaining hours" "$Q_ONE" \ | |
| 138 | + "d['ok'] is True and d['account']['ok'] is True and abs(d['account']['gemini']['pct'] - 85.5) < 0.01 and abs(d['account']['argon']['pct'] - 100.0) < 0.01 and abs(d['account']['claude']['pct'] - 100.0) < 0.01 and len(d['account']['models']) == 9 and d['account']['gemini']['reset_in_seconds'] > 500000 and d['account']['gemini']['reset_in_hours'] > 140 and 'h ' in d['account']['gemini']['reset_remaining'] and d['account']['claude']['reset_in_seconds'] > 7000 and 'h ' in d['account']['claude']['reset_remaining'] and all('reset_remaining' in m and 'reset_in_hours' in m for m in d['account']['models'])" | |
| 139 | 139 | check_not "single quota never leaks token" "MOCK-TOKEN" "$Q_ONE" |
| 140 | 140 | check_not "single quota never leaks refresh token" "MOCK-REFRESH-TOKEN" "$Q_ONE" |
| 141 | 141 | |
| @@ -143,8 +143,8 @@ Q_EXH=$(GOOGLE_ACCOUNTS_FILE="$FIX/full/antigravity_accounts.json" api "action=q | ||
| 143 | 143 | json_ok "null/missing remainingFraction marks gemini pool exhausted with reset remaining" "$Q_EXH" \ |
| 144 | 144 | "d['ok'] is True and d['account']['gemini']['exhausted'] is True and d['account']['gemini']['pct'] == 0.0 and abs(d['account']['claude']['pct'] - 42.0) < 0.01 and d['account']['gemini']['reset_in_hours'] > 140 and 'h ' in d['account']['gemini']['reset_remaining']" |
| 145 | 145 | Q_ALL=$(GOOGLE_ACCOUNTS_FILE="$FIX/full/antigravity_accounts.json" api "action=quota") |
| 146 | -json_ok "all-accounts quota aggregates best_gemini, best_claude, and broken account" "$Q_ALL" \ | |
| 147 | - "d['ok'] is True and d['count'] == 3 and d['best_gemini'] == 'alpha@example.com' and d['best_claude'] == 'alpha@example.com' and d['accounts'][2]['ok'] is False" | |
| 146 | +json_ok "all-accounts quota aggregates best_gemini, best_argon, best_claude, and broken account" "$Q_ALL" \ | |
| 147 | + "d['ok'] is True and d['count'] == 3 and d['best_gemini'] == 'alpha@example.com' and d['best_argon'] == 'alpha@example.com' and d['best_claude'] == 'alpha@example.com' and d['accounts'][2]['ok'] is False" | |
| 148 | 148 | check_not "all-accounts quota never leaks token" "MOCK-TOKEN" "$Q_ALL" |
| 149 | 149 | |
| 150 | 150 | Q_FMT=$(GOOGLE_ACCOUNTS_FILE="$FIX/full/antigravity_accounts.json" api "format=json") |
| 151 | 151 |
| index 49f1b9a..71cfa44 100644 | index 49f1b9a..71cfa44 100644 | ||
| --- a/plugin.json | --- a/plugin.json | ||
| +++ b/plugin.json | +++ b/plugin.json | ||
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | "slug": "google-quota", | 2 | "slug": "google-quota", |
| 3 | "id": "plugin_google_quota", | 3 | "id": "plugin_google_quota", |
| 4 | "title": "Google Account Quotas", | 4 | "title": "Google Account Quotas", |
| 5 | - "version": "1.0.1", | 5 | + "version": "1.0.2", |
| 6 | "summary": "Zero-dependency Google Antigravity multi-account quota monitor and active-account switcher for your node. Reads the local antigravity_accounts.json and selected_account.txt files, queries per-model quota pools through the node's scorpiox-google-quota CLI, and lets you switch the active account in one click. Holds no OAuth client secret and never prints, logs or returns any refresh or access token.", | 6 | "summary": "Zero-dependency Google Antigravity multi-account quota monitor and active-account switcher for your node. Reads the local antigravity_accounts.json and selected_account.txt files, queries per-model quota pools through the node's scorpiox-google-quota CLI, and lets you switch the active account in one click. Holds no OAuth client secret and never prints, logs or returns any refresh or access token.", |
| 7 | "category": "devtools", | 7 | "category": "devtools", |
| 8 | "license": "MIT", | 8 | "license": "MIT", |
| index b1bbb8e..496d539 100644 | index b1bbb8e..496d539 100644 | ||
| --- a/src/plugin_google_quota.c | --- a/src/plugin_google_quota.c | ||
| +++ b/src/plugin_google_quota.c | +++ b/src/plugin_google_quota.c | ||
| @@ -77,7 +77,7 @@ | @@ -77,7 +77,7 @@ | ||
| 77 | 77 | ||
| 78 | #define PLUGIN_SLUG "google-quota" | 78 | #define PLUGIN_SLUG "google-quota" |
| 79 | #define PLUGIN_ID "plugin_google_quota" | 79 | #define PLUGIN_ID "plugin_google_quota" |
| 80 | -#define PLUGIN_VER "1.0.1" | 80 | +#define PLUGIN_VER "1.0.2" |
| 81 | #define PLUGIN_NAME "google quota" | 81 | #define PLUGIN_NAME "google quota" |
| 82 | #define PLUGIN_DESC "Account quotas" | 82 | #define PLUGIN_DESC "Account quotas" |
| 83 | #define DEFAULT_QUOTA_BIN "scorpiox-google-quota" | 83 | #define DEFAULT_QUOTA_BIN "scorpiox-google-quota" |
| @@ -91,7 +91,7 @@ | @@ -91,7 +91,7 @@ | ||
| 91 | #define FIELD_SZ 512 | 91 | #define FIELD_SZ 512 |
| 92 | #define OUT_MAX (512 * 1024) | 92 | #define OUT_MAX (512 * 1024) |
| 93 | #define MAX_ACCOUNTS 64 | 93 | #define MAX_ACCOUNTS 64 |
| 94 | -#define MAX_MODELS 64 | 94 | +#define MAX_MODELS 128 |
| 95 | #define MAX_WORKERS 8 | 95 | #define MAX_WORKERS 8 |
| 96 | 96 | ||
| 97 | /* ------------------------------------------------------------------ */ | 97 | /* ------------------------------------------------------------------ */ |
| @@ -867,6 +867,7 @@ typedef struct { | @@ -867,6 +867,7 @@ typedef struct { | ||
| 867 | char error[64]; | 867 | char error[64]; |
| 868 | char project[PROJ_SZ]; | 868 | char project[PROJ_SZ]; |
| 869 | pool_summary_t gemini; | 869 | pool_summary_t gemini; |
| 870 | + pool_summary_t argon; | ||
| 870 | pool_summary_t claude; | 871 | pool_summary_t claude; |
| 871 | model_quota_t models[MAX_MODELS]; | 872 | model_quota_t models[MAX_MODELS]; |
| 872 | int model_count; | 873 | int model_count; |
| @@ -915,6 +916,7 @@ static void parse_quota_output(const buf_t *raw, int run_rc, acct_quota_t *q) | @@ -915,6 +916,7 @@ static void parse_quota_output(const buf_t *raw, int run_rc, acct_quota_t *q) | ||
| 915 | 916 | ||
| 916 | memset(q, 0, sizeof(*q)); | 917 | memset(q, 0, sizeof(*q)); |
| 917 | pool_init(&q->gemini); | 918 | pool_init(&q->gemini); |
| 919 | + pool_init(&q->argon); | ||
| 918 | pool_init(&q->claude); | 920 | pool_init(&q->claude); |
| 919 | 921 | ||
| 920 | if (run_rc == -1) { | 922 | if (run_rc == -1) { |
| @@ -982,7 +984,10 @@ static void parse_quota_output(const buf_t *raw, int run_rc, acct_quota_t *q) | @@ -982,7 +984,10 @@ static void parse_quota_output(const buf_t *raw, int run_rc, acct_quota_t *q) | ||
| 982 | exhausted = 1; | 984 | exhausted = 1; |
| 983 | } | 985 | } |
| 984 | 986 | ||
| 985 | - if (strncmp(mid, "gemini-", 7) == 0) { | 987 | + if (strncmp(mid, "gemini-4-argon", 14) == 0) { |
| 988 | + pool_name = "argon"; | ||
| 989 | + pool_add(&q->argon, pct, exhausted, rst); | ||
| 990 | + } else if (strncmp(mid, "gemini-", 7) == 0) { | ||
| 986 | pool_name = "gemini"; | 991 | pool_name = "gemini"; |
| 987 | pool_add(&q->gemini, pct, exhausted, rst); | 992 | pool_add(&q->gemini, pct, exhausted, rst); |
| 988 | } else if (strncmp(mid, "claude-", 7) == 0) { | 993 | } else if (strncmp(mid, "claude-", 7) == 0) { |
| @@ -1311,6 +1316,8 @@ static void emit_acct_quota_json(buf_t *b, const acct_entry_t *a, const acct_quo | @@ -1311,6 +1316,8 @@ static void emit_acct_quota_json(buf_t *b, const acct_entry_t *a, const acct_quo | ||
| 1311 | buf_json(b, q->project); | 1316 | buf_json(b, q->project); |
| 1312 | buf_adds(b, ",\"gemini\":"); | 1317 | buf_adds(b, ",\"gemini\":"); |
| 1313 | emit_pool_json(b, &q->gemini, now_epoch); | 1318 | emit_pool_json(b, &q->gemini, now_epoch); |
| 1319 | + buf_adds(b, ",\"argon\":"); | ||
| 1320 | + emit_pool_json(b, &q->argon, now_epoch); | ||
| 1314 | buf_adds(b, ",\"claude\":"); | 1321 | buf_adds(b, ",\"claude\":"); |
| 1315 | emit_pool_json(b, &q->claude, now_epoch); | 1322 | emit_pool_json(b, &q->claude, now_epoch); |
| 1316 | buf_adds(b, ",\"models\":["); | 1323 | buf_adds(b, ",\"models\":["); |
| @@ -1432,8 +1439,10 @@ static int action_quota(const char *target_email) | @@ -1432,8 +1439,10 @@ static int action_quota(const char *target_email) | ||
| 1432 | { | 1439 | { |
| 1433 | acct_quota_t *qs = NULL; | 1440 | acct_quota_t *qs = NULL; |
| 1434 | const char *best_g = ""; | 1441 | const char *best_g = ""; |
| 1442 | + const char *best_a = ""; | ||
| 1435 | const char *best_c = ""; | 1443 | const char *best_c = ""; |
| 1436 | double best_gp = -1.0; | 1444 | double best_gp = -1.0; |
| 1445 | + double best_ap = -1.0; | ||
| 1437 | double best_cp = -1.0; | 1446 | double best_cp = -1.0; |
| 1438 | 1447 | ||
| 1439 | if (count > 0) { | 1448 | if (count > 0) { |
| @@ -1457,6 +1466,10 @@ static int action_quota(const char *target_email) | @@ -1457,6 +1466,10 @@ static int action_quota(const char *target_email) | ||
| 1457 | best_gp = qs[i].gemini.pct; | 1466 | best_gp = qs[i].gemini.pct; |
| 1458 | best_g = accts[i].email; | 1467 | best_g = accts[i].email; |
| 1459 | } | 1468 | } |
| 1469 | + if (qs[i].argon.present && !qs[i].argon.exhausted && qs[i].argon.pct > best_ap) { | ||
| 1470 | + best_ap = qs[i].argon.pct; | ||
| 1471 | + best_a = accts[i].email; | ||
| 1472 | + } | ||
| 1460 | if (qs[i].claude.present && !qs[i].claude.exhausted && qs[i].claude.pct > best_cp) { | 1473 | if (qs[i].claude.present && !qs[i].claude.exhausted && qs[i].claude.pct > best_cp) { |
| 1461 | best_cp = qs[i].claude.pct; | 1474 | best_cp = qs[i].claude.pct; |
| 1462 | best_c = accts[i].email; | 1475 | best_c = accts[i].email; |
| @@ -1469,6 +1482,8 @@ static int action_quota(const char *target_email) | @@ -1469,6 +1482,8 @@ static int action_quota(const char *target_email) | ||
| 1469 | buf_json(&b, selected); | 1482 | buf_json(&b, selected); |
| 1470 | buf_adds(&b, ",\"best_gemini\":"); | 1483 | buf_adds(&b, ",\"best_gemini\":"); |
| 1471 | buf_json(&b, best_g); | 1484 | buf_json(&b, best_g); |
| 1485 | + buf_adds(&b, ",\"best_argon\":"); | ||
| 1486 | + buf_json(&b, best_a); | ||
| 1472 | buf_adds(&b, ",\"best_claude\":"); | 1487 | buf_adds(&b, ",\"best_claude\":"); |
| 1473 | buf_json(&b, best_c); | 1488 | buf_json(&b, best_c); |
| 1474 | buf_addf(&b, ",\"count\":%d,\"accounts\":[", count); | 1489 | buf_addf(&b, ",\"count\":%d,\"accounts\":[", count); |
| index f291e1b..02dcd58 100644 | index f291e1b..02dcd58 100644 | ||
| --- a/src/ui.html | --- a/src/ui.html | ||
| +++ b/src/ui.html | +++ b/src/ui.html | ||
| @@ -28,7 +28,7 @@ body{background:var(--bg);color:var(--text);font-family:var(--font);font-size:14 | @@ -28,7 +28,7 @@ body{background:var(--bg);color:var(--text);font-family:var(--font);font-size:14 | ||
| 28 | #themeToggle{background:var(--surface-2);border:1px solid var(--line);color:var(--text); | 28 | #themeToggle{background:var(--surface-2);border:1px solid var(--line);color:var(--text); |
| 29 | border-radius:980px;padding:5px 12px;font-size:12px;font-weight:600;cursor:pointer; | 29 | border-radius:980px;padding:5px 12px;font-size:12px;font-weight:600;cursor:pointer; |
| 30 | font-family:inherit} | 30 | font-family:inherit} |
| 31 | -.kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:12px} | 31 | +.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;margin-bottom:12px} |
| 32 | .kpi{background:var(--bg-card);border:1px solid var(--line);border-radius:12px;padding:12px 14px;min-width:0} | 32 | .kpi{background:var(--bg-card);border:1px solid var(--line);border-radius:12px;padding:12px 14px;min-width:0} |
| 33 | .kpi .lbl{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-2)} | 33 | .kpi .lbl{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-2)} |
| 34 | .kpi .val{margin-top:4px;font-size:15px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis} | 34 | .kpi .val{margin-top:4px;font-size:15px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis} |
| @@ -56,7 +56,7 @@ body{background:var(--bg);color:var(--text);font-family:var(--font);font-size:14 | @@ -56,7 +56,7 @@ body{background:var(--bg);color:var(--text);font-family:var(--font);font-size:14 | ||
| 56 | background:var(--surface-2);color:var(--text-2);border:1px solid var(--line)} | 56 | background:var(--surface-2);color:var(--text-2);border:1px solid var(--line)} |
| 57 | .tag.sel{color:var(--blue);border-color:rgba(10,132,255,.4)} | 57 | .tag.sel{color:var(--blue);border-color:rgba(10,132,255,.4)} |
| 58 | .tag.best{color:var(--green);border-color:rgba(48,209,88,.35)} | 58 | .tag.best{color:var(--green);border-color:rgba(48,209,88,.35)} |
| 59 | -.pools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px} | 59 | +.pools{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px} |
| 60 | .pool{background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:10px 12px} | 60 | .pool{background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:10px 12px} |
| 61 | .pool-hd{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:6px} | 61 | .pool-hd{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:6px} |
| 62 | .pool-name{font-size:12px;font-weight:650;color:var(--text)} | 62 | .pool-name{font-size:12px;font-weight:650;color:var(--text)} |
| @@ -129,6 +129,11 @@ body{background:var(--bg);color:var(--text);font-family:var(--font);font-size:14 | @@ -129,6 +129,11 @@ body{background:var(--bg);color:var(--text);font-family:var(--font);font-size:14 | ||
| 129 | <div class="val" id="kpiGemini">-</div> | 129 | <div class="val" id="kpiGemini">-</div> |
| 130 | <div class="meta" id="kpiGeminiMeta">Waiting for quota</div> | 130 | <div class="meta" id="kpiGeminiMeta">Waiting for quota</div> |
| 131 | </div> | 131 | </div> |
| 132 | + <div class="kpi"> | ||
| 133 | + <div class="lbl">Best Argon</div> | ||
| 134 | + <div class="val" id="kpiArgon">-</div> | ||
| 135 | + <div class="meta" id="kpiArgonMeta">Waiting for quota</div> | ||
| 136 | + </div> | ||
| 132 | <div class="kpi"> | 137 | <div class="kpi"> |
| 133 | <div class="lbl">Best Claude</div> | 138 | <div class="lbl">Best Claude</div> |
| 134 | <div class="val" id="kpiClaude">-</div> | 139 | <div class="val" id="kpiClaude">-</div> |
| @@ -263,18 +268,21 @@ function el(tag,cls,txt){ | @@ -263,18 +268,21 @@ function el(tag,cls,txt){ | ||
| 263 | } | 268 | } |
| 264 | 269 | ||
| 265 | function computeBest(){ | 270 | function computeBest(){ |
| 266 | - var bestG=null,bestGP=-1,bestGR='',bestC=null,bestCP=-1,bestCR=''; | 271 | + var bestG=null,bestGP=-1,bestGR='',bestA=null,bestAP=-1,bestAR='',bestC=null,bestCP=-1,bestCR=''; |
| 267 | state.accounts.forEach(function(a){ | 272 | state.accounts.forEach(function(a){ |
| 268 | var qd=state.quotas[a.email]; | 273 | var qd=state.quotas[a.email]; |
| 269 | if(!qd||!qd.ok)return; | 274 | if(!qd||!qd.ok)return; |
| 270 | if(qd.gemini&&!qd.gemini.exhausted&&qd.gemini.pct>bestGP){ | 275 | if(qd.gemini&&!qd.gemini.exhausted&&qd.gemini.pct>bestGP){ |
| 271 | bestGP=qd.gemini.pct;bestG=a.email;bestGR=qd.gemini.reset_time||''; | 276 | bestGP=qd.gemini.pct;bestG=a.email;bestGR=qd.gemini.reset_time||''; |
| 272 | } | 277 | } |
| 278 | + if(qd.argon&&qd.argon.count>0&&!qd.argon.exhausted&&qd.argon.pct>bestAP){ | ||
| 279 | + bestAP=qd.argon.pct;bestA=a.email;bestAR=qd.argon.reset_time||''; | ||
| 280 | + } | ||
| 273 | if(qd.claude&&!qd.claude.exhausted&&qd.claude.pct>bestCP){ | 281 | if(qd.claude&&!qd.claude.exhausted&&qd.claude.pct>bestCP){ |
| 274 | bestCP=qd.claude.pct;bestC=a.email;bestCR=qd.claude.reset_time||''; | 282 | bestCP=qd.claude.pct;bestC=a.email;bestCR=qd.claude.reset_time||''; |
| 275 | } | 283 | } |
| 276 | }); | 284 | }); |
| 277 | - return {gemini:bestG,geminiPct:bestGP,geminiReset:bestGR,claude:bestC,claudePct:bestCP,claudeReset:bestCR}; | 285 | + return {gemini:bestG,geminiPct:bestGP,geminiReset:bestGR,argon:bestA,argonPct:bestAP,argonReset:bestAR,claude:bestC,claudePct:bestCP,claudeReset:bestCR}; |
| 278 | } | 286 | } |
| 279 | 287 | ||
| 280 | function renderPool(label,pool,loading){ | 288 | function renderPool(label,pool,loading){ |
| @@ -329,6 +337,10 @@ function render(){ | @@ -329,6 +337,10 @@ function render(){ | ||
| 329 | $('kpiGemini').title=best.gemini||''; | 337 | $('kpiGemini').title=best.gemini||''; |
| 330 | $('kpiGeminiMeta').textContent=best.gemini?(best.geminiPct.toFixed(1)+'% remaining'+(best.geminiReset?(' · resets in '+fmtResetShort(best.geminiReset)):'')):(state.loading?'Checking...':'No quota data'); | 338 | $('kpiGeminiMeta').textContent=best.gemini?(best.geminiPct.toFixed(1)+'% remaining'+(best.geminiReset?(' · resets in '+fmtResetShort(best.geminiReset)):'')):(state.loading?'Checking...':'No quota data'); |
| 331 | 339 | ||
| 340 | + $('kpiArgon').textContent=best.argon?shortEmail(best.argon):'-'; | ||
| 341 | + $('kpiArgon').title=best.argon||''; | ||
| 342 | + $('kpiArgonMeta').textContent=best.argon?(best.argonPct.toFixed(1)+'% remaining'+(best.argonReset?(' · resets in '+fmtResetShort(best.argonReset)):'')):(state.loading?'Checking...':'No Argon quota'); | ||
| 343 | + | ||
| 332 | $('kpiClaude').textContent=best.claude?shortEmail(best.claude):'-'; | 344 | $('kpiClaude').textContent=best.claude?shortEmail(best.claude):'-'; |
| 333 | $('kpiClaude').title=best.claude||''; | 345 | $('kpiClaude').title=best.claude||''; |
| 334 | $('kpiClaudeMeta').textContent=best.claude?(best.claudePct.toFixed(1)+'% remaining'+(best.claudeReset?(' · resets in '+fmtResetShort(best.claudeReset)):'')):(state.loading?'Checking...':'No quota data'); | 346 | $('kpiClaudeMeta').textContent=best.claude?(best.claudePct.toFixed(1)+'% remaining'+(best.claudeReset?(' · resets in '+fmtResetShort(best.claudeReset)):'')):(state.loading?'Checking...':'No quota data'); |
| @@ -351,6 +363,7 @@ function render(){ | @@ -351,6 +363,7 @@ function render(){ | ||
| 351 | var badges=el('div','badges'); | 363 | var badges=el('div','badges'); |
| 352 | if(isSel)badges.appendChild(el('span','tag sel','Selected')); | 364 | if(isSel)badges.appendChild(el('span','tag sel','Selected')); |
| 353 | if(best.gemini===a.email)badges.appendChild(el('span','tag best','Best Gemini')); | 365 | if(best.gemini===a.email)badges.appendChild(el('span','tag best','Best Gemini')); |
| 366 | + if(best.argon===a.email)badges.appendChild(el('span','tag best','Best Argon')); | ||
| 354 | if(best.claude===a.email)badges.appendChild(el('span','tag best','Best Claude')); | 367 | if(best.claude===a.email)badges.appendChild(el('span','tag best','Best Claude')); |
| 355 | if(!a.has_refresh)badges.appendChild(el('span','tag','No refresh token')); | 368 | if(!a.has_refresh)badges.appendChild(el('span','tag','No refresh token')); |
| 356 | top.appendChild(badges); | 369 | top.appendChild(badges); |
| @@ -367,6 +380,9 @@ function render(){ | @@ -367,6 +380,9 @@ function render(){ | ||
| 367 | }else{ | 380 | }else{ |
| 368 | var pools=el('div','pools'); | 381 | var pools=el('div','pools'); |
| 369 | pools.appendChild(renderPool('Gemini Pool',qd?qd.gemini:null,state.loading)); | 382 | pools.appendChild(renderPool('Gemini Pool',qd?qd.gemini:null,state.loading)); |
| 383 | + if(qd&&qd.argon&&qd.argon.count>0){ | ||
| 384 | + pools.appendChild(renderPool('Argon Pool',qd.argon,state.loading)); | ||
| 385 | + } | ||
| 370 | pools.appendChild(renderPool('Claude Pool',qd?qd.claude:null,state.loading)); | 386 | pools.appendChild(renderPool('Claude Pool',qd?qd.claude:null,state.loading)); |
| 371 | card.appendChild(pools); | 387 | card.appendChild(pools); |
| 372 | 388 |
| index eb9099c..d605958 100644 | index eb9099c..d605958 100644 | ||
| --- a/src/ui_html.h | --- a/src/ui_html.h | ||
| +++ b/src/ui_html.h | +++ b/src/ui_html.h | ||
| @@ -33,7 +33,7 @@ static const char *UI_HTML = | @@ -33,7 +33,7 @@ static const char *UI_HTML = | ||
| 33 | "#themeToggle{background:var(--surface-2);border:1px solid var(--line);color:var(--text);\n" | 33 | "#themeToggle{background:var(--surface-2);border:1px solid var(--line);color:var(--text);\n" |
| 34 | " border-radius:980px;padding:5px 12px;font-size:12px;font-weight:600;cursor:pointer;\n" | 34 | " border-radius:980px;padding:5px 12px;font-size:12px;font-weight:600;cursor:pointer;\n" |
| 35 | " font-family:inherit}\n" | 35 | " font-family:inherit}\n" |
| 36 | - ".kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:12px}\n" | 36 | + ".kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;margin-bottom:12px}\n" |
| 37 | ".kpi{background:var(--bg-card);border:1px solid var(--line);border-radius:12px;padding:12px 14px;min-width:0}\n" | 37 | ".kpi{background:var(--bg-card);border:1px solid var(--line);border-radius:12px;padding:12px 14px;min-width:0}\n" |
| 38 | ".kpi .lbl{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-2)}\n" | 38 | ".kpi .lbl{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-2)}\n" |
| 39 | ".kpi .val{margin-top:4px;font-size:15px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n" | 39 | ".kpi .val{margin-top:4px;font-size:15px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n" |
| @@ -61,7 +61,7 @@ static const char *UI_HTML = | @@ -61,7 +61,7 @@ static const char *UI_HTML = | ||
| 61 | " background:var(--surface-2);color:var(--text-2);border:1px solid var(--line)}\n" | 61 | " background:var(--surface-2);color:var(--text-2);border:1px solid var(--line)}\n" |
| 62 | ".tag.sel{color:var(--blue);border-color:rgba(10,132,255,.4)}\n" | 62 | ".tag.sel{color:var(--blue);border-color:rgba(10,132,255,.4)}\n" |
| 63 | ".tag.best{color:var(--green);border-color:rgba(48,209,88,.35)}\n" | 63 | ".tag.best{color:var(--green);border-color:rgba(48,209,88,.35)}\n" |
| 64 | - ".pools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}\n" | 64 | + ".pools{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px}\n" |
| 65 | ".pool{background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:10px 12px}\n" | 65 | ".pool{background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:10px 12px}\n" |
| 66 | ".pool-hd{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:6px}\n" | 66 | ".pool-hd{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:6px}\n" |
| 67 | ".pool-name{font-size:12px;font-weight:650;color:var(--text)}\n" | 67 | ".pool-name{font-size:12px;font-weight:650;color:var(--text)}\n" |
| @@ -135,6 +135,11 @@ static const char *UI_HTML = | @@ -135,6 +135,11 @@ static const char *UI_HTML = | ||
| 135 | " <div class=\"meta\" id=\"kpiGeminiMeta\">Waiting for quota</div>\n" | 135 | " <div class=\"meta\" id=\"kpiGeminiMeta\">Waiting for quota</div>\n" |
| 136 | " </div>\n" | 136 | " </div>\n" |
| 137 | " <div class=\"kpi\">\n" | 137 | " <div class=\"kpi\">\n" |
| 138 | + " <div class=\"lbl\">Best Argon</div>\n" | ||
| 139 | + " <div class=\"val\" id=\"kpiArgon\">-</div>\n" | ||
| 140 | + " <div class=\"meta\" id=\"kpiArgonMeta\">Waiting for quota</div>\n" | ||
| 141 | + " </div>\n" | ||
| 142 | + " <div class=\"kpi\">\n" | ||
| 138 | " <div class=\"lbl\">Best Claude</div>\n" | 143 | " <div class=\"lbl\">Best Claude</div>\n" |
| 139 | " <div class=\"val\" id=\"kpiClaude\">-</div>\n" | 144 | " <div class=\"val\" id=\"kpiClaude\">-</div>\n" |
| 140 | " <div class=\"meta\" id=\"kpiClaudeMeta\">Waiting for quota</div>\n" | 145 | " <div class=\"meta\" id=\"kpiClaudeMeta\">Waiting for quota</div>\n" |
| @@ -268,18 +273,21 @@ static const char *UI_HTML = | @@ -268,18 +273,21 @@ static const char *UI_HTML = | ||
| 268 | "}\n" | 273 | "}\n" |
| 269 | "\n" | 274 | "\n" |
| 270 | "function computeBest(){\n" | 275 | "function computeBest(){\n" |
| 271 | - " var bestG=null,bestGP=-1,bestGR='',bestC=null,bestCP=-1,bestCR='';\n" | 276 | + " var bestG=null,bestGP=-1,bestGR='',bestA=null,bestAP=-1,bestAR='',bestC=null,bestCP=-1,bestCR='';\n" |
| 272 | " state.accounts.forEach(function(a){\n" | 277 | " state.accounts.forEach(function(a){\n" |
| 273 | " var qd=state.quotas[a.email];\n" | 278 | " var qd=state.quotas[a.email];\n" |
| 274 | " if(!qd||!qd.ok)return;\n" | 279 | " if(!qd||!qd.ok)return;\n" |
| 275 | " if(qd.gemini&&!qd.gemini.exhausted&&qd.gemini.pct>bestGP){\n" | 280 | " if(qd.gemini&&!qd.gemini.exhausted&&qd.gemini.pct>bestGP){\n" |
| 276 | " bestGP=qd.gemini.pct;bestG=a.email;bestGR=qd.gemini.reset_time||'';\n" | 281 | " bestGP=qd.gemini.pct;bestG=a.email;bestGR=qd.gemini.reset_time||'';\n" |
| 277 | " }\n" | 282 | " }\n" |
| 283 | + " if(qd.argon&&qd.argon.count>0&&!qd.argon.exhausted&&qd.argon.pct>bestAP){\n" | ||
| 284 | + " bestAP=qd.argon.pct;bestA=a.email;bestAR=qd.argon.reset_time||'';\n" | ||
| 285 | + " }\n" | ||
| 278 | " if(qd.claude&&!qd.claude.exhausted&&qd.claude.pct>bestCP){\n" | 286 | " if(qd.claude&&!qd.claude.exhausted&&qd.claude.pct>bestCP){\n" |
| 279 | " bestCP=qd.claude.pct;bestC=a.email;bestCR=qd.claude.reset_time||'';\n" | 287 | " bestCP=qd.claude.pct;bestC=a.email;bestCR=qd.claude.reset_time||'';\n" |
| 280 | " }\n" | 288 | " }\n" |
| 281 | " });\n" | 289 | " });\n" |
| 282 | - " return {gemini:bestG,geminiPct:bestGP,geminiReset:bestGR,claude:bestC,claudePct:bestCP,claudeReset:bestCR};\n" | 290 | + " return {gemini:bestG,geminiPct:bestGP,geminiReset:bestGR,argon:bestA,argonPct:bestAP,argonReset:bestAR,claude:bestC,claudePct:bestCP,claudeReset:bestCR};\n" |
| 283 | "}\n" | 291 | "}\n" |
| 284 | "\n" | 292 | "\n" |
| 285 | "function renderPool(label,pool,loading){\n" | 293 | "function renderPool(label,pool,loading){\n" |
| @@ -334,6 +342,10 @@ static const char *UI_HTML = | @@ -334,6 +342,10 @@ static const char *UI_HTML = | ||
| 334 | " $('kpiGemini').title=best.gemini||'';\n" | 342 | " $('kpiGemini').title=best.gemini||'';\n" |
| 335 | " $('kpiGeminiMeta').textContent=best.gemini?(best.geminiPct.toFixed(1)+'% remaining'+(best.geminiReset?(' · resets in '+fmtResetShort(best.geminiReset)):'')):(state.loading?'Checking...':'No quota data');\n" | 343 | " $('kpiGeminiMeta').textContent=best.gemini?(best.geminiPct.toFixed(1)+'% remaining'+(best.geminiReset?(' · resets in '+fmtResetShort(best.geminiReset)):'')):(state.loading?'Checking...':'No quota data');\n" |
| 336 | "\n" | 344 | "\n" |
| 345 | + " $('kpiArgon').textContent=best.argon?shortEmail(best.argon):'-';\n" | ||
| 346 | + " $('kpiArgon').title=best.argon||'';\n" | ||
| 347 | + " $('kpiArgonMeta').textContent=best.argon?(best.argonPct.toFixed(1)+'% remaining'+(best.argonReset?(' · resets in '+fmtResetShort(best.argonReset)):'')):(state.loading?'Checking...':'No Argon quota');\n" | ||
| 348 | + "\n" | ||
| 337 | " $('kpiClaude').textContent=best.claude?shortEmail(best.claude):'-';\n" | 349 | " $('kpiClaude').textContent=best.claude?shortEmail(best.claude):'-';\n" |
| 338 | " $('kpiClaude').title=best.claude||'';\n" | 350 | " $('kpiClaude').title=best.claude||'';\n" |
| 339 | " $('kpiClaudeMeta').textContent=best.claude?(best.claudePct.toFixed(1)+'% remaining'+(best.claudeReset?(' · resets in '+fmtResetShort(best.claudeReset)):'')):(state.loading?'Checking...':'No quota data');\n" | 351 | " $('kpiClaudeMeta').textContent=best.claude?(best.claudePct.toFixed(1)+'% remaining'+(best.claudeReset?(' · resets in '+fmtResetShort(best.claudeReset)):'')):(state.loading?'Checking...':'No quota data');\n" |
| @@ -356,6 +368,7 @@ static const char *UI_HTML = | @@ -356,6 +368,7 @@ static const char *UI_HTML = | ||
| 356 | " var badges=el('div','badges');\n" | 368 | " var badges=el('div','badges');\n" |
| 357 | " if(isSel)badges.appendChild(el('span','tag sel','Selected'));\n" | 369 | " if(isSel)badges.appendChild(el('span','tag sel','Selected'));\n" |
| 358 | " if(best.gemini===a.email)badges.appendChild(el('span','tag best','Best Gemini'));\n" | 370 | " if(best.gemini===a.email)badges.appendChild(el('span','tag best','Best Gemini'));\n" |
| 371 | + " if(best.argon===a.email)badges.appendChild(el('span','tag best','Best Argon'));\n" | ||
| 359 | " if(best.claude===a.email)badges.appendChild(el('span','tag best','Best Claude'));\n" | 372 | " if(best.claude===a.email)badges.appendChild(el('span','tag best','Best Claude'));\n" |
| 360 | " if(!a.has_refresh)badges.appendChild(el('span','tag','No refresh token'));\n" | 373 | " if(!a.has_refresh)badges.appendChild(el('span','tag','No refresh token'));\n" |
| 361 | " top.appendChild(badges);\n" | 374 | " top.appendChild(badges);\n" |
| @@ -372,6 +385,9 @@ static const char *UI_HTML = | @@ -372,6 +385,9 @@ static const char *UI_HTML = | ||
| 372 | " }else{\n" | 385 | " }else{\n" |
| 373 | " var pools=el('div','pools');\n" | 386 | " var pools=el('div','pools');\n" |
| 374 | " pools.appendChild(renderPool('Gemini Pool',qd?qd.gemini:null,state.loading));\n" | 387 | " pools.appendChild(renderPool('Gemini Pool',qd?qd.gemini:null,state.loading));\n" |
| 388 | + " if(qd&&qd.argon&&qd.argon.count>0){\n" | ||
| 389 | + " pools.appendChild(renderPool('Argon Pool',qd.argon,state.loading));\n" | ||
| 390 | + " }\n" | ||
| 375 | " pools.appendChild(renderPool('Claude Pool',qd?qd.claude:null,state.loading));\n" | 391 | " pools.appendChild(renderPool('Claude Pool',qd?qd.claude:null,state.loading));\n" |
| 376 | " card.appendChild(pools);\n" | 392 | " card.appendChild(pools);\n" |
| 377 | "\n" | 393 | "\n" |
| index 33af6e9..875750e 100755 | index 33af6e9..875750e 100755 | ||
| --- a/tests/mock_quota.sh | --- a/tests/mock_quota.sh | ||
| +++ b/tests/mock_quota.sh | +++ b/tests/mock_quota.sh | ||
| @@ -35,9 +35,14 @@ case "$acct" in | @@ -35,9 +35,14 @@ case "$acct" in | ||
| 35 | "buckets": [ | 35 | "buckets": [ |
| 36 | {"tokenType": "WTUS", "modelId": "chat_20706", "remainingFraction": 1}, | 36 | {"tokenType": "WTUS", "modelId": "chat_20706", "remainingFraction": 1}, |
| 37 | {"resetTime": "$RST_CLAUDE", "tokenType": "WTUS", "modelId": "claude-opus-4-6-thinking", "remainingFraction": 1}, | 37 | {"resetTime": "$RST_CLAUDE", "tokenType": "WTUS", "modelId": "claude-opus-4-6-thinking", "remainingFraction": 1}, |
| 38 | + {"resetTime": "$RST_CLAUDE", "tokenType": "WTUS", "modelId": "claude-opus-5-5-high", "remainingFraction": 1}, | ||
| 38 | {"resetTime": "$RST_CLAUDE", "tokenType": "WTUS", "modelId": "claude-sonnet-4-6", "remainingFraction": 1}, | 39 | {"resetTime": "$RST_CLAUDE", "tokenType": "WTUS", "modelId": "claude-sonnet-4-6", "remainingFraction": 1}, |
| 40 | + {"resetTime": "$RST_CLAUDE", "tokenType": "WTUS", "modelId": "claude-sonnet-5-5-high", "remainingFraction": 1}, | ||
| 39 | {"resetTime": "$RST_GEMINI", "tokenType": "WTUS", "modelId": "gemini-3.8-flash-tiered", "remainingFraction": 0.855}, | 41 | {"resetTime": "$RST_GEMINI", "tokenType": "WTUS", "modelId": "gemini-3.8-flash-tiered", "remainingFraction": 0.855}, |
| 42 | + {"resetTime": "$RST_GEMINI", "tokenType": "WTUS", "modelId": "gemini-4-argon-high", "remainingFraction": 1}, | ||
| 43 | + {"resetTime": "$RST_GEMINI", "tokenType": "WTUS", "modelId": "gemini-4-hydrogen-high", "remainingFraction": 0.855}, | ||
| 40 | {"resetTime": "$RST_GEMINI", "tokenType": "WTUS", "modelId": "gemini-4-hydrogen-sonar", "remainingFraction": 0.855}, | 44 | {"resetTime": "$RST_GEMINI", "tokenType": "WTUS", "modelId": "gemini-4-hydrogen-sonar", "remainingFraction": 0.855}, |
| 45 | + {"resetTime": "$RST_GEMINI", "tokenType": "WTUS", "modelId": "gemini-4-neon-high", "remainingFraction": 0.855}, | ||
| 41 | {"tokenType": "WTUS", "modelId": "tab_flash_lite_preview", "remainingFraction": 1} | 46 | {"tokenType": "WTUS", "modelId": "tab_flash_lite_preview", "remainingFraction": 1} |
| 42 | ] | 47 | ] |
| 43 | } | 48 | } |
| index cc47abc..6f4d62d 100755 | index cc47abc..6f4d62d 100755 | ||
| --- a/tests/run.sh | --- a/tests/run.sh | ||
| +++ b/tests/run.sh | +++ b/tests/run.sh | ||
| @@ -102,7 +102,7 @@ META_ENV=$(BOT_PASSWORD=secret-pass SX_PLUGIN_META=1 $BIN) | @@ -102,7 +102,7 @@ META_ENV=$(BOT_PASSWORD=secret-pass SX_PLUGIN_META=1 $BIN) | ||
| 102 | check "SX_PLUGIN_META=1 works without auth" '{"name":"google quota","desc":"Account quotas"}' "$META_ENV" | 102 | check "SX_PLUGIN_META=1 works without auth" '{"name":"google quota","desc":"Account quotas"}' "$META_ENV" |
| 103 | 103 | ||
| 104 | VER=$($BIN --version) | 104 | VER=$($BIN --version) |
| 105 | -check "--version prints plugin id and version" "plugin_google_quota 1.0.1" "$VER" | 105 | +check "--version prints plugin id and version" "plugin_google_quota 1.0.2" "$VER" |
| 106 | UNAUTH=$(BOT_PASSWORD=secret-pass QUERY_STRING="action=status" $BIN) | 106 | UNAUTH=$(BOT_PASSWORD=secret-pass QUERY_STRING="action=status" $BIN) |
| 107 | check "missing password returns 401" "Status: 401 Unauthorized" "$UNAUTH" | 107 | check "missing password returns 401" "Status: 401 Unauthorized" "$UNAUTH" |
| 108 | 108 | ||
| @@ -134,8 +134,8 @@ json_ok "missing CLI sets cli_present false" "$ST_NOCLI" "d['ok'] is True and d[ | @@ -134,8 +134,8 @@ json_ok "missing CLI sets cli_present false" "$ST_NOCLI" "d['ok'] is True and d[ | ||
| 134 | # ---------------------------------------------------------------- quota | 134 | # ---------------------------------------------------------------- quota |
| 135 | section "quota" | 135 | section "quota" |
| 136 | Q_ONE=$(GOOGLE_ACCOUNTS_FILE="$FIX/full/antigravity_accounts.json" api "action=quota&account=alpha@example.com") | 136 | Q_ONE=$(GOOGLE_ACCOUNTS_FILE="$FIX/full/antigravity_accounts.json" api "action=quota&account=alpha@example.com") |
| 137 | -json_ok "single account quota parses gemini and claude pools and remaining hours" "$Q_ONE" \ | 137 | +json_ok "single account quota parses gemini, argon, and claude pools and remaining hours" "$Q_ONE" \ |
| 138 | - "d['ok'] is True and d['account']['ok'] is True and abs(d['account']['gemini']['pct'] - 85.5) < 0.01 and abs(d['account']['claude']['pct'] - 100.0) < 0.01 and len(d['account']['models']) == 4 and d['account']['gemini']['reset_in_seconds'] > 500000 and d['account']['gemini']['reset_in_hours'] > 140 and 'h ' in d['account']['gemini']['reset_remaining'] and d['account']['claude']['reset_in_seconds'] > 7000 and 'h ' in d['account']['claude']['reset_remaining'] and all('reset_remaining' in m and 'reset_in_hours' in m for m in d['account']['models'])" | 138 | + "d['ok'] is True and d['account']['ok'] is True and abs(d['account']['gemini']['pct'] - 85.5) < 0.01 and abs(d['account']['argon']['pct'] - 100.0) < 0.01 and abs(d['account']['claude']['pct'] - 100.0) < 0.01 and len(d['account']['models']) == 9 and d['account']['gemini']['reset_in_seconds'] > 500000 and d['account']['gemini']['reset_in_hours'] > 140 and 'h ' in d['account']['gemini']['reset_remaining'] and d['account']['claude']['reset_in_seconds'] > 7000 and 'h ' in d['account']['claude']['reset_remaining'] and all('reset_remaining' in m and 'reset_in_hours' in m for m in d['account']['models'])" |
| 139 | check_not "single quota never leaks token" "MOCK-TOKEN" "$Q_ONE" | 139 | check_not "single quota never leaks token" "MOCK-TOKEN" "$Q_ONE" |
| 140 | check_not "single quota never leaks refresh token" "MOCK-REFRESH-TOKEN" "$Q_ONE" | 140 | check_not "single quota never leaks refresh token" "MOCK-REFRESH-TOKEN" "$Q_ONE" |
| 141 | 141 | ||
| @@ -143,8 +143,8 @@ Q_EXH=$(GOOGLE_ACCOUNTS_FILE="$FIX/full/antigravity_accounts.json" api "action=q | @@ -143,8 +143,8 @@ Q_EXH=$(GOOGLE_ACCOUNTS_FILE="$FIX/full/antigravity_accounts.json" api "action=q | ||
| 143 | json_ok "null/missing remainingFraction marks gemini pool exhausted with reset remaining" "$Q_EXH" \ | 143 | json_ok "null/missing remainingFraction marks gemini pool exhausted with reset remaining" "$Q_EXH" \ |
| 144 | "d['ok'] is True and d['account']['gemini']['exhausted'] is True and d['account']['gemini']['pct'] == 0.0 and abs(d['account']['claude']['pct'] - 42.0) < 0.01 and d['account']['gemini']['reset_in_hours'] > 140 and 'h ' in d['account']['gemini']['reset_remaining']" | 144 | "d['ok'] is True and d['account']['gemini']['exhausted'] is True and d['account']['gemini']['pct'] == 0.0 and abs(d['account']['claude']['pct'] - 42.0) < 0.01 and d['account']['gemini']['reset_in_hours'] > 140 and 'h ' in d['account']['gemini']['reset_remaining']" |
| 145 | Q_ALL=$(GOOGLE_ACCOUNTS_FILE="$FIX/full/antigravity_accounts.json" api "action=quota") | 145 | Q_ALL=$(GOOGLE_ACCOUNTS_FILE="$FIX/full/antigravity_accounts.json" api "action=quota") |
| 146 | -json_ok "all-accounts quota aggregates best_gemini, best_claude, and broken account" "$Q_ALL" \ | 146 | +json_ok "all-accounts quota aggregates best_gemini, best_argon, best_claude, and broken account" "$Q_ALL" \ |
| 147 | - "d['ok'] is True and d['count'] == 3 and d['best_gemini'] == 'alpha@example.com' and d['best_claude'] == 'alpha@example.com' and d['accounts'][2]['ok'] is False" | 147 | + "d['ok'] is True and d['count'] == 3 and d['best_gemini'] == 'alpha@example.com' and d['best_argon'] == 'alpha@example.com' and d['best_claude'] == 'alpha@example.com' and d['accounts'][2]['ok'] is False" |
| 148 | check_not "all-accounts quota never leaks token" "MOCK-TOKEN" "$Q_ALL" | 148 | check_not "all-accounts quota never leaks token" "MOCK-TOKEN" "$Q_ALL" |
| 149 | 149 | ||
| 150 | Q_FMT=$(GOOGLE_ACCOUNTS_FILE="$FIX/full/antigravity_accounts.json" api "format=json") | 150 | Q_FMT=$(GOOGLE_ACCOUNTS_FILE="$FIX/full/antigravity_accounts.json" api "format=json") |
| 151 | 151 |