pi-antigravity-acp-provider
First-class Google Antigravity ACP provider for Pi
Package details
Install pi-antigravity-acp-provider from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-antigravity-acp-provider- Package
pi-antigravity-acp-provider- Version
0.1.25- Published
- Dec 2, 2026
- Downloads
- 4,608/mo · 1,296/wk
- Author
- zacbemis
- License
- MIT
- Types
- extension
- Size
- 323.6 KB
- Dependencies
- 5 dependencies · 3 peers
Pi manifest JSON
{
"extensions": [
"./extensions/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-antigravity-acp-provider
A Pi provider for Google Antigravity backed by its official ACP server.
Features
- Registers
antigravity-acp/*models with dynamic Shift+Tab reasoning effort selection for advertised tiers. - Uses ACP protocol v1 over the official TypeScript SDK (
@agentclientprotocol/sdk). - Supports streaming, cancellation, usage/quota reporting, persisted session restoration, and cost estimation from reference catalog rates.
- Bridges compatible Pi tools over an authenticated loopback MCP server;
doctor/statuslists any omitted tools and reasons. - Answers native Antigravity questions through Pi selectors and text inputs, returning the answer to the same running ACP prompt. Dismissed, blocked, or headless questions are cancelled instead of leaving the agent waiting.
- Supports persisted
default,auto-edit, andyolopermission modes (default:yolo) with a single-use, fail-closed Pi permission broker for prompting modes. - Verifies managed ACP runtime installs and updates against an Ed25519-signed catalog (
automatic,notify, ormanualupdate modes). - Supports interactive browser OAuth, automatic SSH/headless OAuth relay, and
GEMINI_API_KEYauthentication.
Install & setup
Install from npm:
pi install npm:pi-antigravity-acp-provider
pi
Or run from source:
git clone https://github.com/zacbemis/pi-antigravity-acp-provider.git
cd pi-antigravity-acp-provider
npm install
pi --no-extensions -e ./extensions/index.ts
In Pi:
- Run
/login, choose Sign in with an account, then Google Antigravity (ACP) (or Enter an API key / setGEMINI_API_KEY). - Wait for the official ACP server download and extraction if not already installed (~850 MB unpacked on Linux).
- Complete Google sign-in in the browser.
- Run
/antigravity-acp setupto verify auth and refresh discovered models. - Run
/modelto select anantigravity-acpmodel and press Shift+Tab to pick an advertised reasoning effort.
Runtime discovery & environment
- Binary order:
AGY_ACP_BIN→ managed~/.local/opt/agy-acp/current/→~/.local/bin/agy_acp_server.par→PATH→ automatic download from the official ACP registry (a globalagycommand is not required). - Proxies: Loopback MCP traffic bypasses proxies.
HTTP_PROXY,HTTPS_PROXY,ALL_PROXY, andNO_PROXYare preserved. On macOS with no explicit proxy env, enabled system HTTP proxies are probed to avoid unsupported SOCKS auto-selection. SetPI_ANTIGRAVITY_ACP_PROXYto an HTTP/HTTPS URL to override child proxy settings without modifying the parent environment. - Node & TLS: Standalone Pi builds need
node/nodejsonPATH(orNODEset).SSL_CERT_FILEis preserved, falling back toNIX_SSL_CERT_FILEor a system CA bundle.
Intel macOS setup caveat
Google's standalone Intel macOS (darwin-x86_64) ACP builds (including 1.5.2) have an upstream Hardened Runtime/libffi startup hang where initialize never answers (upstream #1393). A SyntaxWarning on stderr is unrelated, and retrying or raising timeouts will not fix an affected binary. This provider does not strip or replace Google's code signatures.
While awaiting a fixed standalone build, use the official agy CLI directly, or opt into an executable wrapper script via AGY_ACP_BIN (bare executable path, not a shell command):
#!/bin/sh
exec /absolute/path/to/agy acp "$@"
Then select /antigravity-acp permissions default (the host CLI may reject yolo and use different mode IDs). This wrapper is a best-effort workaround, not full host CLI backend support: sign in via agy itself; this provider's login/logout, credential preflight, and quota commands are not authoritative for that backend. Do not pass permission-bypass flags.
SSH and headless Google login
Over SSH, or on Linux without DISPLAY/WAYLAND_DISPLAY, /login automatically switches to a manual loopback relay:
- Pi prints the Google authorization URL.
- Open it in a local browser and finish sign-in.
- Copy the complete final
127.0.0.1redirect URL from the browser address bar (the page itself may show a connection error). - Paste the URL into Pi. The provider validates host, port, path, and OAuth state and relays it to the server's loopback listener (no SSH port-forward needed).
Set PI_ANTIGRAVITY_ACP_OAUTH_MODE=manual or browser to override auto-detection. Manual relay is not supported on Windows.
Credentials & switching Google accounts
Each Pi profile stores its Google token under $PI_CODING_AGENT_DIR/antigravity-acp-provider/gemini/antigravity-acp/ (Pi's auth store holds only a non-secret marker). Credentials are isolated per profile and are not shared with GEMINI_HOME, macOS Keychain, or other Antigravity clients.
- Switch accounts: Close other Pi processes using the profile and run
/login antigravity-acp(clears the profile's previous cached token and ACP bindings before sign-in). - Logout: Run
/antigravity-acp logout(oraccount) to immediately delete the profile's Google token and saved bindings, plus Pi's/logoutto remove the auth marker or stored API key.
Models & reasoning
- Models are discovered from the ACP server and cached in Pi's model store so newly advertised models remain selectable at startup before background refresh completes.
- Effort-qualified IDs are collapsed into one model entry per family; only advertised tiers are exposed via Shift+Tab.
- Listing a model does not guarantee account eligibility (e.g., some Gemini 4 models require AI Ultra or eligible Enterprise plans). If a model returns
Requested entity was not found, verify access in the official Antigravity app/CLI and select another advertised model.
Commands & configuration
Type /antigravity-acp in Pi for subcommand and option tab-completion:
/antigravity-acp setup
/antigravity-acp doctor [--verbose]
/antigravity-acp status
/antigravity-acp quota
/antigravity-acp update
/antigravity-acp updates [automatic|notify|manual]
/antigravity-acp logout | account
/antigravity-acp permissions [default|auto-edit|yolo]
/antigravity-acp tool-activity [off|compact|full]
Settings live in $PI_CODING_AGENT_DIR/antigravity-acp-provider/config.json (default PI_CODING_AGENT_DIR: ~/.pi/agent):
permissions:yolo(default),auto_edit, ordefaultruntimeUpdates:automatic(default),notify, ormanual— seedocs/RUNTIME-UPDATES.mdtoolActivity:compact(default),off, orfullnativeWorkflows:false(default) — excludesrun_workflowso Antigravity does not generateskills/system/run-workflow/SKILL.mdin your workspace (see upstream #1330). Set totrueto let the tool lists below control its availability.enabledTools: unset by default — allow only the listed Antigravity built-in tool IDs, e.g.["search_web", "read_url_content"]. An empty array or a non-array value disables all built-in tools and leaves Pi MCP tools available.disabledTools:[](default) — deny the listed Antigravity built-in tool IDs, e.g.["run_command", "generate_image"]. The denylist wins when both lists are set.run_workflowis added to it whilenativeWorkflowsisfalse.
Restart Pi after changing tool settings. These filters apply to new, loaded, and resumed ACP sessions. They do not filter Pi's pi_* MCP tools or replace permission controls, and require an ACP runtime that honors the metadata (verified on managed ACP 1.5.2).
Saved ACP session bindings are stored beside config.json in sessions.json. Utility sessions (model discovery, quota, auth) run in utility-cwd/ beside the config so they do not write into your workspace.
Quota event API
Other Pi extensions can request the cached (60s) quota snapshot from the event bus:
pi.events.emit("antigravity-acp:quota:request", { reply: (result) => { /* { ok: true, quota } | { ok: false, error } */ } });
AntigravityQuotaSnapshot is exported from extensions/index.ts:
{ at: number; groups: { displayName: string; buckets: { window: string; remainingFraction: number; resetTime?: string }[] }[] }.
Error diagnostics
A turn that fails with a provider error also carries one entry in the assistant message's diagnostics, so hosts and extensions can branch on fields instead of parsing errorMessage:
{ type: "antigravity-acp:error", timestamp, error: { name, message, code }, details? }
error.code is one of auth, model, protocol, quota, spawn, timeout, process_exit, invalid_input or aborted. Quota errors add details:
- Account quota exhausted:
{ reason: "account_exhausted", model, resetAt? }, withresetAtas an ISO 8601 time. - Persistent 429
RESOURCE_EXHAUSTED:{ reason: "rate_limited", retries, nextRetryMs? }.
Reliability & diagnostics
- Early lifecycle & debug logs: Valid requests emit Pi's
startevent before setup begins. SetPI_ANTIGRAVITY_ACP_DEBUG=1to write private, bounded JSONL phase/timing metadata logs under$PI_CODING_AGENT_DIR/antigravity-acp-provider/debug/(paths are listed instatus/doctor). Seedocs/DIAGNOSTICS.md. - Timeouts & recovery: Prompts use inactivity watchdogs (10 minutes idle while streaming; 60 minutes while a tool or permission request is active; configurable via
promptIdleTimeoutMs/promptWorkIdleTimeoutMs). Cancellation sendssession/cancelwith a 1.5s force-close grace period. Warm bindings default to capacity 4 and 5-minute idle expiry. - Rate limits & quota errors: Account quota exhaustion and persistent HTTP 429
RESOURCE_EXHAUSTEDretry loops (beyond 2 retries or 15s of announced retry delay) fail with aquotaerror starting withAntigravity quota exceededso Pi does not auto-retry them. - Slash commands in prompts: Leading slashes (and
/plan,/usage,/logout) are prefixed with an invisibleU+200Bso the ACP server passes them to the model as text rather than intercepting them. - System instructions: Kept outside truncated history (256 KiB UTF-8 limit); mid-turn instruction changes complete the active prompt and force a fresh session on the next turn.
- Steering: A steer queued during a Pi-handled tool call is sent as the next request, with the tool result kept in history. Tools that run entirely inside Antigravity don't create a Pi tool boundary, so queued messages during those calls wait until the ACP turn returns. To use Pi tool boundaries instead, set
enabledToolsto[]and restart Pi. The task must have an equivalent Pi tool exposed through MCP.
Security boundary
This provider launches a full coding agent with your OS privileges. The default yolo mode allows Antigravity-native commands and edits without confirmation. Use /antigravity-acp permissions default for confirmation prompts.
- Disabling ACP filesystem/terminal client callbacks is not a sandbox for Antigravity-native tools.
- Pi hooks govern tools routed through the
pi_MCP namespace; native tools are governed by Antigravity policy and ACP permission requests. - New and restored sessions must advertise and confirm the requested mode.
auto-editnegotiatesauto_editor an advertisedaccept-editsalias; unsupported modes (such asyoloon a host CLI exposing onlyauto/plan) fail closed with advertised mode names rather than silently falling back. - Failed mode switches or unexpected mode-change notifications immediately close and invalidate the affected session.
Compatibility
- Node.js:
>=22.19.0(CI tests 22.19.0 and 24). - Pi & ACP: Supports Pi 1.5.x+ (CI uses Pi 1.7.0), ACP SDK 2.12.0, and ACP protocol 1 (uses the full-v1
/unstableentrypoint for draft usage/lifecycle fields; does not enable experimental ACP v2). - Platforms: Linux x64/ARM64 (glibc only; Alpine/musl is rejected), macOS ARM64/Intel (see Intel macOS caveat), and Windows x64/ARM64. Bundled signed catalog approves Antigravity ACP releases through
1.5.2.
Development
npm run check # typecheck + unit tests
npm run test:packed # isolated npm pack + install smoke test
npm run test:real-acp # initialize installed Antigravity ACP server (opt-in)
npm run test:live # real authenticated prompt (opt-in)
npm run test:qualify # live cancel, restore, MCP, model, permission checks (opt-in)
npm audit --audit-level=moderate
See docs/MAINTENANCE.md for release, CI, and runtime-catalog signing workflows.
License
MIT