← Commit history
bin/__pycache__/hydrogen-widget-antigravity-usagecpython-312.pyc
⋯ 1 unchanged line ⋯
bin/__pycache__/hydrogen-widget-lib.cpython-312.pycadded
⋯ 1 unchanged line ⋯
bin/hydrogen-widget-antigravity-usage+16−8
@@ -12,28 +12,30 @@ HERE = os.path.dirname(os.path.realpath(__file__)) marks = SourceFileLoader('agmarks', os.path.join(HERE, 'hydrogen-widget-marks.py')).load_module() lib = SourceFileLoader('hwlib', os.path.join(HERE, 'hydrogen-widget-lib.py')).load_module() -def hub():+def hubs():     out = subprocess.run(['ps', '-eo', 'args'], capture_output=True, text=True).stdout+    found = []     for line in out.splitlines():         if re.search(r'(^|/)agy\s.*--hub', line):             p = re.search(r'--hub-port[= ](\d+)', line); c = re.search(r'--csrf_token[= ](\S+)', line)-            if p and c: return int(p.group(1)), c.group(1)-    return None+            if p and c: found.append((int(p.group(1)), c.group(1)))+    return found  def rpc(port, csrf, method):     req = urllib.request.Request(f'http://127.0.0.1:{port}/exa.language_server_pb.LanguageServerService/{method}', data=b'{}',                                  headers={'Content-Type': 'application/json', 'x-codeium-csrf-token': csrf}, method='POST')     with urllib.request.urlopen(req, timeout=15) as r:-        return json.loads(r.read().decode()).get('response') or {}+        j = json.loads(r.read().decode())+        return j.get('response') or j   # most calls wrap the answer in 'response'; GetUserStatus does not  def epoch(s):     try: return int(datetime.fromisoformat(s.replace('Z', '+00:00')).timestamp())     except Exception: return None  def data():-    h = hub()-    if not h: return {'error': 'open Antigravity in this workspace'}-    port, csrf = h+    hs = hubs()+    if not hs: return {'error': 'open Antigravity in this workspace'}+    port, csrf = hs[0]     q = rpc(port, csrf, 'RetrieveUserQuotaSummary')     plan = None     try: plan = (rpc(port, csrf, 'GetLoadCodeAssist').get('paidTier') or {}).get('name')@@ -49,7 +51,13 @@ def data():                           'name': ('Gemini ' if gem else 'Claude and GPT ') + ('this week' if weekly else 'five-hour window'),                           'resets_at': epoch(b.get('resetTime') or ''), 'window_s': 7 * 86400 if weekly else 5 * 3600, 'gemini': gem})     items.sort(key=lambda i: (not i.pop('gemini'),))-    return {'plan': plan, 'items': items}+    # Which Google account these numbers belong to (GetUserStatus), so a second sign-in is never a+    # mystery (John 2026-10-18: this showed 0% for his own account while the team account was at 14%).+    account = None+    try: account = (rpc(port, csrf, 'GetUserStatus').get('userStatus') or {}).get('email')+    except Exception: pass+    if account and len(hs) > 1: account += f' (the first of {len(hs)} Antigravity hubs running here)'+    return {'plan': plan, 'account': account, 'items': items}  RENDER = r"""(d.error?`<span class="err">${d.error}</span>`:(d.items||[]).slice(0,2).map(b=>bar(b.label,b.pct,b.severity)).join(''))""" lib.serve('Antigravity usage', data, RENDER, 180000, mark=marks.MARKS['antigravity'], default_view='nums')
bin/hydrogen-widget-lib.py+7−2
@@ -194,9 +194,11 @@ X_CSS = r""" @media (min-height:100px){.w{display:none!important}.x{display:block}} .xhd{display:flex;align-items:center;justify-content:space-between;gap:9px;font-size:11px;color:rgba(230,235,239,.6)} .xhd .pl{padding:1px 7px;border-radius:9px;border:1px solid rgba(255,255,255,.14);color:rgba(230,235,239,.8)}+.xac{padding-top:3px;font-size:11px;color:rgba(230,235,239,.6);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}+.xac b{font-weight:500;color:rgba(230,235,239,.85)} .xl{display:grid;grid-template-columns:54px minmax(0,1fr);gap:12px;align-items:center;padding:10px 0;border-top:1px solid rgba(255,255,255,.07)} .xl.nr{grid-template-columns:minmax(0,1fr)}-.xhd+.xl,.xe+.xl{border-top:0}+.xhd+.xl,.xac+.xl,.xe+.xl{border-top:0} .cd{position:relative;width:54px;height:54px} .cd svg{width:100%;height:100%;transform:rotate(-90deg);display:block} .cd circle{fill:none;stroke-width:4.5}@@ -269,9 +271,12 @@ function renderX(d0){const x=document.getElementById('x');if(!x)return;      the card keeps its plain brief. */   if(!items.length&&!(d0&&d0.error)){x.innerHTML='';withdrawExpand();return;}   /* No title here: Hydrogen's card already shows the widget's name and mark right above this view.-     One quiet line instead: how fresh the numbers are, and the plan when the provider says. */+     One quiet line instead: how fresh the numbers are, and the plan when the provider says. Under+     it, which account the numbers belong to (d.account), so a second sign-in is never a mystery+     (John 2026-10-18: Antigravity showed 0% for one account while the team account was at 14%). */   const plan=d&&d.plan?esc(String(d.plan).charAt(0).toUpperCase()+String(d.plan).slice(1))+' plan':'';   let h=`<div class="xhd"><span class="ag"></span>${plan?`<span class="pl">${plan}</span>`:''}</div>`;+  if(d&&d.account)h+=`<div class="xac" title="${esc(d.account)}">Signed in as <b>${esc(d.account)}</b></div>`;   if(d0&&d0.error){const msg=d0.error==='starting'?'Checking your limits…':d0.error;     h+=`<div class="xe"><span>${esc(msg.charAt(0).toUpperCase()+msg.slice(1))}${items.length&&d0.at?'. Showing the numbers from '+new Date(d0.at*1000).toLocaleTimeString([],{hour:'numeric',minute:'2-digit'})+'.':''}</span>${d0.error==='starting'?'':'<button class="xr">Check now</button>'}</div>`;}   h+=items.map(limRow).join('');
bin/hydrogen-widget-marks.py

  
package.json+1−1
@@ -4,7 +4,7 @@   "type": "app",   "title": "Google Antigravity",   "brief": "Google Antigravity in Adom Hydrogen: the editor extension, the agy CLI and a dock dashboard that installs both into your container.",-  "version": "0.2.4",+  "version": "0.2.5",   "description": "Try Google Antigravity inside your Adom workspace. The dock dashboard installs the Google Antigravity VS Code extension into Hydrogen's editor and the agy command line into your WSL2 or Lima container, opens the panel, and reports what is installed and signed in.",   "org": "adom",   "needs_sudo": false,
page.json+1−1
@@ -4,7 +4,7 @@   "type": "app",   "title": "Google Antigravity",   "brief": "Google Antigravity in Adom Hydrogen: the editor extension, the agy CLI and a dock dashboard that installs both into your container.",-  "version": "0.2.4",+  "version": "0.2.5",   "hero": {     "type": "image",     "path": "screenshots/hero.png"