feat(quota): separate Gemini 4 Argon pool, support Neon/Hydrogen/Claude 5.5 (v1.0.2)
AuthorPico <picobot@scorpioplayer.com>
Date2026-11-22 07:53:55
Commitaef840a9
Parents065f3fac
Changed files
plugin.json+1−1■■
src/plugin_google_quota.c+18−3■■■■■
src/ui.html+20−4■■■■■
src/ui_html.h+20−4■■■■■
tests/mock_quota.sh+5−0■■■■■
tests/run.sh+5−5■■■■■
6 files+69−17
Diff
plugin.json+1−1■■
index 49f1b9a..71cfa44 100644
--- a/plugin.json
+++ b/plugin.json
@@ -2,7 +2,7 @@
22 "slug": "google-quota",
33 "id": "plugin_google_quota",
44 "title": "Google Account Quotas",
5- "version": "1.0.1",
5+ "version": "1.0.2",
66 "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.",
77 "category": "devtools",
88 "license": "MIT",
src/plugin_google_quota.c+18−3■■■■■
index b1bbb8e..496d539 100644
--- a/src/plugin_google_quota.c
+++ b/src/plugin_google_quota.c
@@ -77,7 +77,7 @@
7777
7878 #define PLUGIN_SLUG "google-quota"
7979 #define PLUGIN_ID "plugin_google_quota"
80-#define PLUGIN_VER "1.0.1"
80+#define PLUGIN_VER "1.0.2"
8181 #define PLUGIN_NAME "google quota"
8282 #define PLUGIN_DESC "Account quotas"
8383 #define DEFAULT_QUOTA_BIN "scorpiox-google-quota"
@@ -91,7 +91,7 @@
9191 #define FIELD_SZ 512
9292 #define OUT_MAX (512 * 1024)
9393 #define MAX_ACCOUNTS 64
94-#define MAX_MODELS 64
94+#define MAX_MODELS 128
9595 #define MAX_WORKERS 8
9696
9797 /* ------------------------------------------------------------------ */
@@ -867,6 +867,7 @@ typedef struct {
867867 char error[64];
868868 char project[PROJ_SZ];
869869 pool_summary_t gemini;
870+ pool_summary_t argon;
870871 pool_summary_t claude;
871872 model_quota_t models[MAX_MODELS];
872873 int model_count;
@@ -915,6 +916,7 @@ static void parse_quota_output(const buf_t *raw, int run_rc, acct_quota_t *q)
915916
916917 memset(q, 0, sizeof(*q));
917918 pool_init(&q->gemini);
919+ pool_init(&q->argon);
918920 pool_init(&q->claude);
919921
920922 if (run_rc == -1) {
@@ -982,7 +984,10 @@ static void parse_quota_output(const buf_t *raw, int run_rc, acct_quota_t *q)
982984 exhausted = 1;
983985 }
984986
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) {
986991 pool_name = "gemini";
987992 pool_add(&q->gemini, pct, exhausted, rst);
988993 } 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
13111316 buf_json(b, q->project);
13121317 buf_adds(b, ",\"gemini\":");
13131318 emit_pool_json(b, &q->gemini, now_epoch);
1319+ buf_adds(b, ",\"argon\":");
1320+ emit_pool_json(b, &q->argon, now_epoch);
13141321 buf_adds(b, ",\"claude\":");
13151322 emit_pool_json(b, &q->claude, now_epoch);
13161323 buf_adds(b, ",\"models\":[");
@@ -1432,8 +1439,10 @@ static int action_quota(const char *target_email)
14321439 {
14331440 acct_quota_t *qs = NULL;
14341441 const char *best_g = "";
1442+ const char *best_a = "";
14351443 const char *best_c = "";
14361444 double best_gp = -1.0;
1445+ double best_ap = -1.0;
14371446 double best_cp = -1.0;
14381447
14391448 if (count > 0) {
@@ -1457,6 +1466,10 @@ static int action_quota(const char *target_email)
14571466 best_gp = qs[i].gemini.pct;
14581467 best_g = accts[i].email;
14591468 }
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+ }
14601473 if (qs[i].claude.present && !qs[i].claude.exhausted && qs[i].claude.pct > best_cp) {
14611474 best_cp = qs[i].claude.pct;
14621475 best_c = accts[i].email;
@@ -1469,6 +1482,8 @@ static int action_quota(const char *target_email)
14691482 buf_json(&b, selected);
14701483 buf_adds(&b, ",\"best_gemini\":");
14711484 buf_json(&b, best_g);
1485+ buf_adds(&b, ",\"best_argon\":");
1486+ buf_json(&b, best_a);
14721487 buf_adds(&b, ",\"best_claude\":");
14731488 buf_json(&b, best_c);
14741489 buf_addf(&b, ",\"count\":%d,\"accounts\":[", count);
src/ui.html+20−4■■■■■
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
2828 #themeToggle{background:var(--surface-2);border:1px solid var(--line);color:var(--text);
2929 border-radius:980px;padding:5px 12px;font-size:12px;font-weight:600;cursor:pointer;
3030 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}
3232 .kpi{background:var(--bg-card);border:1px solid var(--line);border-radius:12px;padding:12px 14px;min-width:0}
3333 .kpi .lbl{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-2)}
3434 .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
5656 background:var(--surface-2);color:var(--text-2);border:1px solid var(--line)}
5757 .tag.sel{color:var(--blue);border-color:rgba(10,132,255,.4)}
5858 .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}
6060 .pool{background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:10px 12px}
6161 .pool-hd{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:6px}
6262 .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
129129 <div class="val" id="kpiGemini">-</div>
130130 <div class="meta" id="kpiGeminiMeta">Waiting for quota</div>
131131 </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>
132137 <div class="kpi">
133138 <div class="lbl">Best Claude</div>
134139 <div class="val" id="kpiClaude">-</div>
@@ -263,18 +268,21 @@ function el(tag,cls,txt){
263268 }
264269
265270 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='';
267272 state.accounts.forEach(function(a){
268273 var qd=state.quotas[a.email];
269274 if(!qd||!qd.ok)return;
270275 if(qd.gemini&&!qd.gemini.exhausted&&qd.gemini.pct>bestGP){
271276 bestGP=qd.gemini.pct;bestG=a.email;bestGR=qd.gemini.reset_time||'';
272277 }
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+ }
273281 if(qd.claude&&!qd.claude.exhausted&&qd.claude.pct>bestCP){
274282 bestCP=qd.claude.pct;bestC=a.email;bestCR=qd.claude.reset_time||'';
275283 }
276284 });
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};
278286 }
279287
280288 function renderPool(label,pool,loading){
@@ -329,6 +337,10 @@ function render(){
329337 $('kpiGemini').title=best.gemini||'';
330338 $('kpiGeminiMeta').textContent=best.gemini?(best.geminiPct.toFixed(1)+'% remaining'+(best.geminiReset?(' · resets in '+fmtResetShort(best.geminiReset)):'')):(state.loading?'Checking...':'No quota data');
331339
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+
332344 $('kpiClaude').textContent=best.claude?shortEmail(best.claude):'-';
333345 $('kpiClaude').title=best.claude||'';
334346 $('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(){
351363 var badges=el('div','badges');
352364 if(isSel)badges.appendChild(el('span','tag sel','Selected'));
353365 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'));
354367 if(best.claude===a.email)badges.appendChild(el('span','tag best','Best Claude'));
355368 if(!a.has_refresh)badges.appendChild(el('span','tag','No refresh token'));
356369 top.appendChild(badges);
@@ -367,6 +380,9 @@ function render(){
367380 }else{
368381 var pools=el('div','pools');
369382 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+ }
370386 pools.appendChild(renderPool('Claude Pool',qd?qd.claude:null,state.loading));
371387 card.appendChild(pools);
372388
src/ui_html.h+20−4■■■■■
index eb9099c..d605958 100644
--- a/src/ui_html.h
+++ b/src/ui_html.h
@@ -33,7 +33,7 @@ static const char *UI_HTML =
3333 "#themeToggle{background:var(--surface-2);border:1px solid var(--line);color:var(--text);\n"
3434 " border-radius:980px;padding:5px 12px;font-size:12px;font-weight:600;cursor:pointer;\n"
3535 " 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"
3737 ".kpi{background:var(--bg-card);border:1px solid var(--line);border-radius:12px;padding:12px 14px;min-width:0}\n"
3838 ".kpi .lbl{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-2)}\n"
3939 ".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 =
6161 " background:var(--surface-2);color:var(--text-2);border:1px solid var(--line)}\n"
6262 ".tag.sel{color:var(--blue);border-color:rgba(10,132,255,.4)}\n"
6363 ".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"
6565 ".pool{background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:10px 12px}\n"
6666 ".pool-hd{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:6px}\n"
6767 ".pool-name{font-size:12px;font-weight:650;color:var(--text)}\n"
@@ -135,6 +135,11 @@ static const char *UI_HTML =
135135 " <div class=\"meta\" id=\"kpiGeminiMeta\">Waiting for quota</div>\n"
136136 " </div>\n"
137137 " <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"
138143 " <div class=\"lbl\">Best Claude</div>\n"
139144 " <div class=\"val\" id=\"kpiClaude\">-</div>\n"
140145 " <div class=\"meta\" id=\"kpiClaudeMeta\">Waiting for quota</div>\n"
@@ -268,18 +273,21 @@ static const char *UI_HTML =
268273 "}\n"
269274 "\n"
270275 "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"
272277 " state.accounts.forEach(function(a){\n"
273278 " var qd=state.quotas[a.email];\n"
274279 " if(!qd||!qd.ok)return;\n"
275280 " if(qd.gemini&&!qd.gemini.exhausted&&qd.gemini.pct>bestGP){\n"
276281 " bestGP=qd.gemini.pct;bestG=a.email;bestGR=qd.gemini.reset_time||'';\n"
277282 " }\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"
278286 " if(qd.claude&&!qd.claude.exhausted&&qd.claude.pct>bestCP){\n"
279287 " bestCP=qd.claude.pct;bestC=a.email;bestCR=qd.claude.reset_time||'';\n"
280288 " }\n"
281289 " });\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"
283291 "}\n"
284292 "\n"
285293 "function renderPool(label,pool,loading){\n"
@@ -334,6 +342,10 @@ static const char *UI_HTML =
334342 " $('kpiGemini').title=best.gemini||'';\n"
335343 " $('kpiGeminiMeta').textContent=best.gemini?(best.geminiPct.toFixed(1)+'% remaining'+(best.geminiReset?(' · resets in '+fmtResetShort(best.geminiReset)):'')):(state.loading?'Checking...':'No quota data');\n"
336344 "\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"
337349 " $('kpiClaude').textContent=best.claude?shortEmail(best.claude):'-';\n"
338350 " $('kpiClaude').title=best.claude||'';\n"
339351 " $('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 =
356368 " var badges=el('div','badges');\n"
357369 " if(isSel)badges.appendChild(el('span','tag sel','Selected'));\n"
358370 " 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"
359372 " if(best.claude===a.email)badges.appendChild(el('span','tag best','Best Claude'));\n"
360373 " if(!a.has_refresh)badges.appendChild(el('span','tag','No refresh token'));\n"
361374 " top.appendChild(badges);\n"
@@ -372,6 +385,9 @@ static const char *UI_HTML =
372385 " }else{\n"
373386 " var pools=el('div','pools');\n"
374387 " 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"
375391 " pools.appendChild(renderPool('Claude Pool',qd?qd.claude:null,state.loading));\n"
376392 " card.appendChild(pools);\n"
377393 "\n"
tests/mock_quota.sh+5−0■■■■■
index 33af6e9..875750e 100755
--- a/tests/mock_quota.sh
+++ b/tests/mock_quota.sh
@@ -35,9 +35,14 @@ case "$acct" in
3535 "buckets": [
3636 {"tokenType": "WTUS", "modelId": "chat_20706", "remainingFraction": 1},
3737 {"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},
3839 {"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},
3941 {"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},
4044 {"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},
4146 {"tokenType": "WTUS", "modelId": "tab_flash_lite_preview", "remainingFraction": 1}
4247 ]
4348 }
tests/run.sh+5−5■■■■■
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)
102102 check "SX_PLUGIN_META=1 works without auth" '{"name":"google quota","desc":"Account quotas"}' "$META_ENV"
103103
104104 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"
106106 UNAUTH=$(BOT_PASSWORD=secret-pass QUERY_STRING="action=status" $BIN)
107107 check "missing password returns 401" "Status: 401 Unauthorized" "$UNAUTH"
108108
@@ -134,8 +134,8 @@ json_ok "missing CLI sets cli_present false" "$ST_NOCLI" "d['ok'] is True and d[
134134 # ---------------------------------------------------------------- quota
135135 section "quota"
136136 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'])"
139139 check_not "single quota never leaks token" "MOCK-TOKEN" "$Q_ONE"
140140 check_not "single quota never leaks refresh token" "MOCK-REFRESH-TOKEN" "$Q_ONE"
141141
@@ -143,8 +143,8 @@ Q_EXH=$(GOOGLE_ACCOUNTS_FILE="$FIX/full/antigravity_accounts.json" api "action=q
143143 json_ok "null/missing remainingFraction marks gemini pool exhausted with reset remaining" "$Q_EXH" \
144144 "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']"
145145 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"
148148 check_not "all-accounts quota never leaks token" "MOCK-TOKEN" "$Q_ALL"
149149
150150 Q_FMT=$(GOOGLE_ACCOUNTS_FILE="$FIX/full/antigravity_accounts.json" api "format=json")
151151
plugin.json+1−1■■
index 49f1b9a..71cfa44 100644index 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",
src/plugin_google_quota.c+18−3■■■■■
index b1bbb8e..496d539 100644index 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 51291 #define FIELD_SZ 512
92 #define OUT_MAX (512 * 1024)92 #define OUT_MAX (512 * 1024)
93 #define MAX_ACCOUNTS 6493 #define MAX_ACCOUNTS 64
94-#define MAX_MODELS 6494+#define MAX_MODELS 128
95 #define MAX_WORKERS 895 #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);
src/ui.html+20−4■■■■■
index f291e1b..02dcd58 100644index 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
src/ui_html.h+20−4■■■■■
index eb9099c..d605958 100644index 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"
tests/mock_quota.sh+5−0■■■■■
index 33af6e9..875750e 100755index 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 }
tests/run.sh+5−5■■■■■
index cc47abc..6f4d62d 100755index 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 # ---------------------------------------------------------------- quota134 # ---------------------------------------------------------------- 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")
151151