← Commit history

antigravity 0.1.0: Open Antigravity turns the dashboard tab into the hub UI (the side-bar webview is empty under code-server); status reports the hub

John Lauer ·041fdf0225 ·1mo ago ·parent 3d95130
4 files changed +51−8
README.md+4
@@ -22,6 +22,10 @@ adom-antigravity open [--new]        # focus the Antigravity panel (or start a n adom-antigravity serve --print-url   # the dashboard (what a dock click runs) ``` +## Where Antigravity shows up++The extension starts Antigravity's own web UI (a local "hub") inside the container. Under Hydrogen's code-server the extension's side-bar panel renders empty, so the dashboard's **Open Antigravity** turns the dashboard tab into that UI instead; click the dock card again to return. The CLI `agy` works in a terminal tab as usual.+ ## Sign-in  The extension signs in with Google inside its own panel. The CLI opens a browser on first run; inside a container it prints the sign-in link instead, open it on your desktop. For headless or scripted use, set `GEMINI_API_KEY` and `"modelProvider": "gemini"` in `~/.gemini/antigravity-cli/settings.json` ([CLI install and auth](https://antigravity.google/docs/cli/install/)).
adom_antigravity.py+40−3
@@ -76,6 +76,35 @@ def cli_state():             'geminiApiKeySet': bool(os.environ.get('GEMINI_API_KEY'))}  +def hub_state():+    """The extension runs `agy --hub --hub-port=N`: Antigravity's own web UI. In Hydrogen's+    editor (code-server) the extension's side-bar webview renders empty, but the hub page+    itself renders fine as a Hydrogen tab, so the dashboard opens THAT (verified 2026-09-06 on+    AdomLapper: sign-in screen, Continue with Google)."""+    port = None+    try:+        for d in Path('/proc').iterdir():+            if not d.name.isdigit():+                continue+            try:+                cmd = (d / 'cmdline').read_bytes().split(b'\0')+            except Exception:+                continue+            if any(c.endswith(b'/agy') or c == b'agy' for c in cmd[:1]) and b'--hub' in cmd:+                for c in cmd:+                    if c.startswith(b'--hub-port='):+                        port = int(c.split(b'=')[1])+    except Exception:+        pass+    up = False+    if port:+        try:+            up = urllib.request.urlopen(f'http://127.0.0.1:{port}/', timeout=1.5).status == 200+        except Exception:+            up = False+    return {'port': port, 'url': f'http://127.0.0.1:{port}/' if port else None, 'up': up}++ def editor_state():     for port in (8821, 8822, 8823):         try:@@ -88,11 +117,11 @@ def editor_state():   def context():-    ext, cli, ed = extension_state(), cli_state(), editor_state()+    ext, cli, ed, hub = extension_state(), cli_state(), editor_state(), hub_state()     ready = ext['installed'] and cli['installed']     return {'app': 'adom/antigravity', 'version': VERSION, 'runtime': runtime(),             'container': {'system': platform.system(), 'kernel': platform.release(), 'hostname': platform.node(), 'arch': platform.machine()},-            'extension': ext, 'cli': cli, 'editor': ed, 'ready': ready,+            'extension': ext, 'cli': cli, 'editor': ed, 'hub': hub, 'ready': ready,             'tools': {n: shutil.which(n) for n in ['code-server', 'adom-vscode', 'adom-wiki', 'adom-bridge', 'agy']},             '_hint': 'extension.installed = the Google Antigravity VS Code extension is in code-server (reload the editor after a fresh install); cli.installed = agy is on PATH. POST /api/install-extension, /api/install-cli, /api/open, /api/reload-editor drive the same steps the dashboard buttons do.'} @@ -130,11 +159,17 @@ def vscode_command(command, args=None, timeout=20): def open_panel(new_conversation=False):     if not extension_state()['installed']:         return {'ok': False, 'error': 'the Antigravity extension is not installed yet', 'next': 'POST /api/install-extension, then reload the editor'}+    hub = hub_state()+    if hub['up']:+        # The hub is Antigravity's real UI; the dashboard tab navigates to it (top-level, so+        # Google sign-in works; it refuses to run inside a frame).+        return {'ok': True, 'surface': 'hub', 'url': hub['url'], 'hub': hub,+                'note': 'Antigravity\'s own web UI, served by the extension\'s hub inside the container. Open it as a Hydrogen tab (the dashboard navigates there); the extension\'s side-bar panel renders empty under code-server.'}     r = vscode_command('antigravity.startNewConversation' if new_conversation else 'antigravity.panel.focus')     if not r.get('ok') and new_conversation:         r = vscode_command('antigravity.panel.focus')     r['surface'] = 'side bar'-    r['note'] = 'Antigravity lives in the editor side bar (its own activity-bar icon), not in an editor tab.'+    r['note'] = 'The hub is not up yet (the extension starts it after an editor reload); focused the side-bar panel instead.'     return r  @@ -193,6 +228,8 @@ class Handler(SimpleHTTPRequestHandler):         if self.path == '/api/install-cli':             return self.json(install_cli())         if self.path == '/api/open':+            if body.get('panel'):+                r = vscode_command('antigravity.panel.focus'); r['surface'] = 'side bar'; return self.json(r)             return self.json(open_panel(bool(body.get('new'))))         if self.path == '/api/reload-editor':             return self.json(vscode_command('workbench.action.reloadWindow'))
dashboard/index.html+6−5
@@ -27,9 +27,9 @@ dialog{width:min(900px,95vw);background:var(--surface);color:var(--text);border:   <section class="card"><h2>2. The command line</h2><p>The <code>agy</code> CLI runs Antigravity's agent in a terminal, the way Claude and Codex have their TUIs.</p>     <div class="row"><button class="primary" id="install-cli">Install the CLI</button><button id="tui">Open an Antigravity terminal</button></div>     <div class="hint" id="cli-hint">Official installer into ~/.local/bin/agy. First run: <code>agy</code> prints a Google sign-in link when it cannot open a browser. Headless: set <code>GEMINI_API_KEY</code> and <code>modelProvider: gemini</code> in ~/.gemini/antigravity-cli/settings.json.</div></section>-  <section class="card"><h2>3. Use it</h2><p>Open the Antigravity panel, or start a fresh conversation. The AI launch bar in the editor's title bar shows an Antigravity icon once the extension is installed.</p>-    <div class="row"><button class="primary" id="open">Open Antigravity</button><button id="open-new">New conversation</button></div>-    <div class="hint">Antigravity lives in the side bar, not an editor tab. Ctrl+Shift+L starts a new conversation; Ctrl+L adds a selection to the chat.</div></section>+  <section class="card"><h2>3. Use it</h2><p>Open Antigravity right here: this tab becomes Antigravity's own UI (sign in with Google the first time). Click the dock card again to come back to this dashboard.</p>+    <div class="row"><button class="primary" id="open">Open Antigravity</button><button id="open-new">Side-bar panel</button></div>+    <div class="hint" id="open-hint">The editor's side-bar panel for Antigravity renders empty under Hydrogen's code-server today, so the dashboard opens the same UI as a tab instead. The launch bar's Antigravity icon focuses the panel; its TUI entry runs agy.</div></section>   <section class="card"><h2>What it is</h2><p>An agent that plans, writes and verifies across your files and a browser, with its own workflows and artifacts. Free tier from Google; the extension and CLI both need a Google sign-in.</p>     <div class="row"><a href="https://antigravity.google/docs" target="_blank">Antigravity docs</a><a href="https://antigravity.google/docs/cli/install/" target="_blank">CLI install and auth</a><a href="https://open-vsx.org/extension/Google/google-antigravity" target="_blank">The extension on Open VSX</a></div></section> </div>@@ -46,6 +46,7 @@ function render(s){$('#machine').textContent=(s.runtime==='wsl2'?'WSL2':s.runtim  led('#led-cli',s.cli.installed?'ok':'bad',s.cli.installed?(s.cli.version||'installed'):'not installed');  led('#led-editor',s.editor.reachable?'ok':'busy',s.editor.reachable?('adom-vscode '+s.editor.adomVscode):'editor not reachable');  led('#led-rt','ok',s.runtime==='wsl2'?'WSL2 container':s.runtime==='lima'?'Lima container':'Linux container');+ $('#open').disabled=!(s.hub&&s.hub.up);$('#open').title=(s.hub&&s.hub.up)?('Antigravity UI at '+s.hub.url):'The hub is not up yet: install the extension and reload the editor';  $('#install-ext').textContent=s.extension.installed?'Reinstall / update the extension':'Install the extension';  $('#install-cli').textContent=s.cli.installed?'Reinstall the CLI':'Install the CLI';window.__ag=s} async function refresh(){try{const r=await fetch('/api/status');render(await r.json())}catch(e){toast('Status unavailable: '+e.message,'err')}}@@ -53,8 +54,8 @@ async function post(path,body,btn,busyText){const old=btn?btn.textContent:'';if( $('#install-ext').onclick=e=>post('/api/install-extension',{},e.currentTarget,'Installing the extension…'); $('#install-cli').onclick=e=>post('/api/install-cli',{},e.currentTarget,'Installing agy…'); $('#reload').onclick=e=>post('/api/reload-editor',{},e.currentTarget,'Reloading…');-$('#open').onclick=e=>post('/api/open',{},e.currentTarget,'Opening…');-$('#open-new').onclick=e=>post('/api/open',{new:true},e.currentTarget,'Opening…');+$('#open').onclick=async e=>{const j=await post('/api/open',{},e.currentTarget,'Opening…');if(j&&j.ok&&j.url){toast('Opening Antigravity in this tab…','ok');setTimeout(()=>{location.href=j.url},400)}};+$('#open-new').onclick=e=>post('/api/open',{panel:true},e.currentTarget,'Opening…'); $('#tui').onclick=e=>post('/api/tui',{},e.currentTarget,'Opening a terminal…'); async function inspect(){try{const r=await fetch('/api/status');$('#context').textContent=JSON.stringify(await r.json(),null,2);$('#details').showModal()}catch(e){toast(e.message,'err')}} $('#settings').onclick=inspect;$('#close-details').onclick=()=>$('#details').close();
skills/antigravity/SKILL.md+1
@@ -27,6 +27,7 @@ Dashboard routes: `GET /api/status`, `POST /api/install-extension`, `POST /api/i  ## Facts that save time +- Under Hydrogen's code-server the extension's side-bar webview renders EMPTY (2026-09-06, extension 1.2.0). The extension still starts the hub (`agy --hub --hub-port=N`, Antigravity's real web UI); `adom-antigravity status` reports it under `hub`, `POST /api/open` answers `{surface:"hub", url}` and the dashboard navigates its own tab there. Google sign-in refuses to run inside a frame, so never iframe the hub; open it top-level. - Antigravity is a SIDE BAR panel (its own activity-bar icon), not an editor tab. `antigravity.panel.focus` shows it; `antigravity.startNewConversation` (Ctrl+Shift+L) starts a chat; `antigravity.insertSnippet` (Ctrl+L) adds the selection. - A fresh extension install needs one editor reload before the panel exists. - The extension signs in with Google inside its panel. The CLI tries to open a browser; in a container it prints the link. Headless: `GEMINI_API_KEY` plus `"modelProvider": "gemini"` in `~/.gemini/antigravity-cli/settings.json`.