app
Google Antigravity
Public Made by Adomby adom
Google Antigravity in Adom Hydrogen: the editor extension, the agy CLI and a dock dashboard that installs both into your container.
← Commit history
usage widget works without an Antigravity tab: starts a private hub for the reading (0.2.7)
2 files changed
+45−3
bin/hydrogen-widget-antigravity-usage+44−2@@ -21,6 +21,37 @@ def hubs(): if p and c: found.append((int(p.group(1)), c.group(1))) return found +AGY = os.path.expanduser('~/.gemini/bin/agy')++def own_hub():+ """No Antigravity hub running (no Antigravity tab open, or the editor just restarted): start a+ private one just for this reading, the same way the extension does (AGY_ENABLE_HUB and+ ANTIGRAVITY_VSCODE_HOST make agy run headless; without them it wants a terminal). John+ 2026-10-19: "i should NEVER have to go open an antigravity tab just to get this widget to work".+ Returns (port, csrf, process) once it answers, or None. The caller stops it after the reading:+ a hub holds about 200 MB, too much to leave running for a title-bar number."""+ import shutil, socket, uuid+ exe = AGY if os.path.exists(AGY) else shutil.which('agy')+ if not exe: return None+ s = socket.socket(); s.bind(('127.0.0.1', 0)); port = s.getsockname()[1]; s.close()+ csrf = str(uuid.uuid4())+ env = dict(os.environ, AGY_ENABLE_HUB='1', ANTIGRAVITY_VSCODE_HOST='1')+ p = subprocess.Popen([exe, '--hub', f'--hub-port={port}', '--app_data_dir=antigravity', f'--csrf_token={csrf}'],+ env=env, stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, start_new_session=True)+ for _ in range(60):+ if p.poll() is not None: return None+ try:+ rpc(port, csrf, 'GetUserStatus'); return port, csrf, p+ except Exception: time.sleep(0.5)+ stop(p); return None++def stop(p):+ try:+ p.terminate(); p.wait(timeout=5)+ except Exception:+ try: p.kill()+ except Exception: pass+ 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')@@ -33,9 +64,20 @@ def epoch(s): except Exception: return None def data():- hs = hubs()- if not hs: return {'error': 'open Antigravity in this workspace'}+ hs = [] if os.environ.get('HW_AGY_OWN_HUB') else hubs() # HW_AGY_OWN_HUB: test the private-hub path+ mine = None+ if not hs:+ mine = own_hub()+ if not mine:+ return {'error': 'Antigravity is not installed in this workspace' if not (os.path.exists(AGY) or __import__('shutil').which('agy')) else 'Antigravity did not start; retrying'}+ hs = [mine[:2]] port, csrf = hs[0]+ try:+ return reading(port, csrf, hs, mine is not None)+ finally:+ if mine: stop(mine[2])++def reading(port, csrf, hs, private): q = rpc(port, csrf, 'RetrieveUserQuotaSummary') plan = None try: plan = (rpc(port, csrf, 'GetLoadCodeAssist').get('paidTier') or {}).get('name')
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.6",+ "version": "0.2.7", "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,