diff --git a/Makefile b/Makefile index 8c75263..df45c89 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,8 @@ MANIFESTS := \ plugins/zero/.claude-plugin/plugin.json \ plugins/zero/.codex-plugin/plugin.json \ plugins/zero/.factory-plugin/plugin.json \ - plugins/zero-gemini/gemini-extension.json + plugins/zero-gemini/gemini-extension.json \ + plugins/zero-antigravity/plugin.json # The manifest read for the current version (all of MANIFESTS stay in lockstep). VERSION_SOURCE := plugins/zero/.claude-plugin/plugin.json diff --git a/README.md b/README.md index d799ec2..4272537 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ installation, use the guides below. Pick your agent: - **[Codex (CLI)](guides/codex.md)** - **[Codex app](guides/codex-app.md)** - **[Droid](guides/droid.md)** +- **[Google Antigravity CLI](guides/antigravity.md)** - **[Gemini CLI](guides/gemini-cli.md)** - **Anything else** — the standalone installer works in any agent with a shell (and for humans at a terminal): @@ -72,7 +73,9 @@ plugins/zero/ # the shared plugin: skill + hooks (+ Claude's ├── .claude-plugin/ # Claude Code manifest ├── .codex-plugin/ # Codex manifest └── .factory-plugin/ # Droid manifest +plugins/zero-antigravity/ # thin Antigravity overlay (manifest + hook/MCP/rule wiring) plugins/zero-gemini/ # thin Gemini-only overlay (manifest + hook wiring) +scripts/build-antigravity.sh # assembles the installable Antigravity plugin into dist/ scripts/build-gemini.sh # assembles the installable Gemini extension into dist/ guides/ # per-host install guides + the agent install runbook ``` @@ -83,5 +86,6 @@ mechanics — live in the per-host guides. ## Status This repo is built up iteratively, one carefully reviewed PR at a time. Today -it ships the **Claude Code**, **Codex**, **Droid**, and **Gemini CLI** plugins; -additional hosts (Cursor) will land in subsequent PRs. +it ships the **Claude Code**, **Codex**, **Droid**, **Google Antigravity CLI**, +and **Gemini CLI** plugins; additional hosts (Cursor) will land in subsequent +PRs. diff --git a/guides/antigravity.md b/guides/antigravity.md new file mode 100644 index 0000000..f0d1dcb --- /dev/null +++ b/guides/antigravity.md @@ -0,0 +1,38 @@ +# Zero for Google Antigravity CLI + +How to install Zero in Google Antigravity CLI and keep it up to date. + +## Install + +### Install Antigravity CLI + +```bash +curl -fsSL https://antigravity.google/cli/install.sh | bash +``` + +Open a fresh terminal so `agy` is on PATH. + +### Install Zero + +From a checkout of `officialzeroxyz/zero-plugins`: + +```bash +scripts/build-antigravity.sh +agy plugin install dist/zero-antigravity +``` + +That's it — Zero sets itself up automatically. Start Antigravity CLI in your +project with `agy`, then ask: *"Help me set up and test Zero."* It walks you +through signing in. + +## Staying up to date + +- The Zero runner updates before Antigravity model invocations. +- To update the plugin itself from a fresh checkout of this repo, rebuild and + reinstall it: + + ```bash + git pull + scripts/build-antigravity.sh + agy plugin install dist/zero-antigravity + ``` diff --git a/plugins/zero-antigravity/hooks.json b/plugins/zero-antigravity/hooks.json new file mode 100644 index 0000000..5fd73ac --- /dev/null +++ b/plugins/zero-antigravity/hooks.json @@ -0,0 +1,25 @@ +{ + "zero-runner": { + "PreInvocation": [ + { + "type": "command", + "command": "bash ./hooks/ensure-runner-antigravity.sh", + "timeout": 120 + } + ] + }, + "zero-auto-approve": { + "PreToolUse": [ + { + "matcher": "run_command", + "hooks": [ + { + "type": "command", + "command": "bash ./hooks/auto-approve-zero-antigravity.sh", + "timeout": 5 + } + ] + } + ] + } +} diff --git a/plugins/zero-antigravity/hooks/auto-approve-zero-antigravity.sh b/plugins/zero-antigravity/hooks/auto-approve-zero-antigravity.sh new file mode 100755 index 0000000..a422d2e --- /dev/null +++ b/plugins/zero-antigravity/hooks/auto-approve-zero-antigravity.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash +# +# Antigravity PreToolUse hook. +# +# Auto-approves safe, read-only Zero commands in Antigravity's camelCase hook +# contract. Paid calls (`zero fetch`) and wallet/funding commands are left for +# normal review. + +set -euo pipefail + +input="$(cat)" + +case "$input" in + *'"name":"run_command"'* | *'"name": "run_command"'*) ;; + *) exit 0 ;; +esac + +after="${input#*\"CommandLine\":}" +[ "$after" = "$input" ] && exit 0 +after="${after#"${after%%[![:space:]]*}"}" +case "$after" in \"*) after="${after#\"}" ;; *) exit 0 ;; esac +lead="${after%%\"*}" +lead="${lead%\\}" + +lead="${lead//\\/}" +lead="${lead//\'/}" +IFS=' ' read -r -a toks <<<"$lead" || true + +idx=0 +while [ "$idx" -lt "${#toks[@]}" ]; do + case "${toks[$idx]}" in + [A-Za-z_]*=*) idx=$((idx + 1)) ;; + *) break ;; + esac +done + +exe="${toks[$idx]:-}" +sub="${toks[$((idx + 1))]:-}" +base="${exe##*/}" + +case "$base" in + zero | zerocli) ;; + *) exit 0 ;; +esac + +case "$sub" in + search | get | review | runs) ;; + config) case "$lead" in *--set*) exit 0 ;; esac ;; + init) ;; + *) exit 0 ;; +esac + +cat <<'JSON' +{"decision":"allow","reason":"Zero read-only operation auto-approved"} +JSON diff --git a/plugins/zero-antigravity/hooks/ensure-runner-antigravity.sh b/plugins/zero-antigravity/hooks/ensure-runner-antigravity.sh new file mode 100755 index 0000000..9bd84c8 --- /dev/null +++ b/plugins/zero-antigravity/hooks/ensure-runner-antigravity.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# Antigravity PreInvocation hook. +# +# Antigravity does not have a SessionStart hook. Run the shared Zero runner +# provisioner here, discard its Claude/Codex-shaped JSON, then emit the +# Antigravity PreInvocation shape with a short reminder. + +set -euo pipefail + +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +bash "$DIR/ensure-runner.sh" >/dev/null || true + +cat <<'JSON' +{"injectSteps":[{"ephemeralMessage":"Zero is available for external paid capabilities. Use the zero skill for the search -> inspect -> call flow. Resolve the runner as zero on PATH, $ZERO_RUNNER, or ~/.zero/runtime/bin/zero; the Antigravity Zero plugin provisions ~/.zero/runtime/bin/zero before model invocations."}]} +JSON diff --git a/plugins/zero-antigravity/mcp_config.json b/plugins/zero-antigravity/mcp_config.json new file mode 100644 index 0000000..608ade1 --- /dev/null +++ b/plugins/zero-antigravity/mcp_config.json @@ -0,0 +1,7 @@ +{ + "mcpServers": { + "zero": { + "serverUrl": "https://mcp.zero.xyz" + } + } +} diff --git a/plugins/zero-antigravity/plugin.json b/plugins/zero-antigravity/plugin.json new file mode 100644 index 0000000..2145415 --- /dev/null +++ b/plugins/zero-antigravity/plugin.json @@ -0,0 +1,5 @@ +{ + "name": "zero", + "version": "1.4.0", + "description": "Discover and call paid AI capabilities (x402 / MPP) with automatic, wallet-backed payment. Search a live index of external services — image/video/audio generation, web scraping, data enrichment, real-time data, messaging — then call them and pay per use. Bundles the 'zero' skill and the Zero MCP connector." +} diff --git a/plugins/zero-antigravity/rules/zero.md b/plugins/zero-antigravity/rules/zero.md new file mode 100644 index 0000000..105e442 --- /dev/null +++ b/plugins/zero-antigravity/rules/zero.md @@ -0,0 +1,16 @@ +# Zero + +Zero is available in this Antigravity environment for paid external capabilities. +Use it only when the requested outcome requires a capability outside the agent's +native tools, such as image/video/audio generation, scraping, real-time data, +messaging, or other external services. + +Prefer the `zero` CLI runner for the whole flow: + +1. `zero search ""` +2. `zero get ` +3. `zero fetch ... --max-pay ` + +If `zero` is not on PATH, resolve it from `$ZERO_RUNNER` or +`~/.zero/runtime/bin/zero`. The Zero plugin provisions that runtime before +Antigravity model invocations. diff --git a/plugins/zero-gemini/gemini-extension.json b/plugins/zero-gemini/gemini-extension.json index 69ea920..ac48f52 100644 --- a/plugins/zero-gemini/gemini-extension.json +++ b/plugins/zero-gemini/gemini-extension.json @@ -1,6 +1,6 @@ { "name": "zero", - "version": "1.3.3", + "version": "1.4.0", "description": "Discover and call paid AI capabilities (x402 / MPP) with automatic, wallet-backed payment. Search a live index of external services — image/video/audio generation, web scraping, data enrichment, real-time data, messaging — then call them and pay per use. Bundles the 'zero' skill and the Zero MCP connector.", "mcpServers": { "zero": { diff --git a/plugins/zero/.claude-plugin/plugin.json b/plugins/zero/.claude-plugin/plugin.json index 6b83198..59e52a7 100644 --- a/plugins/zero/.claude-plugin/plugin.json +++ b/plugins/zero/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "zero", - "version": "1.3.3", + "version": "1.4.0", "description": "Discover and call paid AI capabilities (x402 / MPP) with automatic, wallet-backed payment. Search a live index of external services — image/video/audio generation, web scraping, data enrichment, real-time data, messaging — then call them and pay per use. Bundles the 'zero' skill and the Zero MCP connector.", "author": { "name": "Zero", "url": "https://zero.xyz" }, "homepage": "https://zero.xyz", diff --git a/plugins/zero/.codex-plugin/plugin.json b/plugins/zero/.codex-plugin/plugin.json index e90630a..3a8d304 100644 --- a/plugins/zero/.codex-plugin/plugin.json +++ b/plugins/zero/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "zero", - "version": "1.3.3", + "version": "1.4.0", "description": "Discover and call paid AI capabilities (x402 / MPP) with automatic, wallet-backed payment. Search a live index of external services — image/video/audio generation, web scraping, data enrichment, real-time data, messaging — then call them and pay per use. Bundles the 'zero' skill.", "author": { "name": "Zero", "url": "https://zero.xyz" }, "homepage": "https://zero.xyz", diff --git a/plugins/zero/.factory-plugin/plugin.json b/plugins/zero/.factory-plugin/plugin.json index 6b83198..59e52a7 100644 --- a/plugins/zero/.factory-plugin/plugin.json +++ b/plugins/zero/.factory-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "zero", - "version": "1.3.3", + "version": "1.4.0", "description": "Discover and call paid AI capabilities (x402 / MPP) with automatic, wallet-backed payment. Search a live index of external services — image/video/audio generation, web scraping, data enrichment, real-time data, messaging — then call them and pay per use. Bundles the 'zero' skill and the Zero MCP connector.", "author": { "name": "Zero", "url": "https://zero.xyz" }, "homepage": "https://zero.xyz", diff --git a/scripts/build-antigravity.sh b/scripts/build-antigravity.sh new file mode 100755 index 0000000..67d9c05 --- /dev/null +++ b/scripts/build-antigravity.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash +# +# Assemble the Antigravity plugin into dist/zero-antigravity/. +# +# Antigravity consumes a plugin directory with plugin.json at the root. The +# source overlay in plugins/zero-antigravity/ contains only Antigravity-specific +# manifests, hook declarations, and hook adapters; shared Zero skill and runner +# scripts are copied from plugins/zero/ at build time. + +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +SHARED="$ROOT/plugins/zero" +OVERLAY="$ROOT/plugins/zero-antigravity" +OUT="$ROOT/dist/zero-antigravity" + +TARBALL="" +if [ "${1:-}" = "--tar" ]; then + TARBALL="${2:?--tar requires an output path}" +fi + +for f in \ + "$OVERLAY/plugin.json" \ + "$OVERLAY/mcp_config.json" \ + "$OVERLAY/hooks.json" \ + "$OVERLAY/hooks/ensure-runner-antigravity.sh" \ + "$OVERLAY/hooks/auto-approve-zero-antigravity.sh" \ + "$OVERLAY/rules/zero.md" \ + "$SHARED/hooks/ensure-runner.sh" \ + "$SHARED/skills/zero/SKILL.md"; do + [ -f "$f" ] || { echo "build-antigravity: missing required input: $f" >&2; exit 1; } +done + +rm -rf "$OUT" +mkdir -p "$OUT/hooks" + +cp "$OVERLAY/plugin.json" "$OUT/plugin.json" +cp "$OVERLAY/mcp_config.json" "$OUT/mcp_config.json" +cp "$OVERLAY/hooks.json" "$OUT/hooks.json" +cp "$OVERLAY/hooks/ensure-runner-antigravity.sh" "$OUT/hooks/ensure-runner-antigravity.sh" +cp "$OVERLAY/hooks/auto-approve-zero-antigravity.sh" "$OUT/hooks/auto-approve-zero-antigravity.sh" +cp "$SHARED/hooks/ensure-runner.sh" "$OUT/hooks/ensure-runner.sh" +cp -R "$OVERLAY/rules" "$OUT/rules" +cp -R "$SHARED/skills" "$OUT/skills" +chmod +x "$OUT/hooks/ensure-runner-antigravity.sh" "$OUT/hooks/auto-approve-zero-antigravity.sh" "$OUT/hooks/ensure-runner.sh" + +echo "build-antigravity: assembled $OUT" +find "$OUT" -type f | sed "s#^$ROOT/##" | sort + +if [ -n "$TARBALL" ]; then + mkdir -p "$(dirname "$TARBALL")" + tar -czf "$TARBALL" -C "$OUT" . + echo "build-antigravity: wrote $TARBALL" +fi