Skip to content

feat(antigravity): add Google Antigravity support - #59

Merged
hellolib merged 2 commits into
hellolib:mainfrom
xiao10ma:feat/antigravity-support
Nov 27, 2026
Merged

hellolib merged 2 commits into
hellolib:mainfrom
xiao10ma:feat/antigravity-support

Conversation

@xiao10ma

Copy link
Copy Markdown
Contributor

Summary

Adds Google Antigravity (Antigravity CLI, Antigravity App, and Antigravity IDE) as a supported agent in agent-notify, following the existing per-agent package architecture.

Hook Integration Details

  • Config locations (per Antigravity Hooks docs):
    • User scope: ~/.gemini/config/hooks.json (shared across Antigravity App, CLI, and IDE)
    • Project scope: .agents/hooks.json
  • Dedicated named hook key ("agent-notify"): writes SessionStart, PreToolUse (matcher: "ask_question|ask_permission"), and Stop under "agent-notify" without touching user-defined hooks; Uninstall removes only agent-notify entries and deletes the file if empty.
  • Event mapping:
    • SessionStart → session_start (click-to-focus window capture only, never notifies)
    • PreToolUse (ask_permission) → permission_required
    • PreToolUse (ask_question) → input_required
    • Stop → run_completed / run_failed (by terminationReason / error; user-initiated USER_CANCELED without error is skipped)
  • Strict stdout JSON contract: Antigravity parses hook stdout as JSON ({"decision":"allow"} for PreToolUse/Stop, {} for SessionStart). handle-antigravity-hook always emits valid JSON even when skipping or encountering malformed input, never blocking or breaking the agent.
  • Detection: detects agy / antigravity on PATH or Antigravity directories (~/.gemini/antigravity-cli, ~/.gemini/antigravity, ~/.gemini/antigravity-ide, ~/.config/antigravity), intentionally avoiding false positives on bare ~/.gemini.
  • CLI & TUI wiring: setup wizard, doctor, view, clean, send --agent antigravity (aliases agy, google-antigravity), agent-notify antigravity print-hooks|install-hooks|uninstall-hooks, i18n, docs, and 64×64 agent logo (assist/logo/agentlogo/antigravity.png).

Verification

  • go vet ./...
  • go test -count=1 ./... (all packages pass, including new unit tests in internal/antigravityhooks, internal/agentintegrations, internal/agenthooks, internal/config, internal/app/setup, internal/app/doctor, internal/cli, and internal/notify)
  • Cross-platform builds verified for linux/amd64, darwin/amd64, and windows/amd64
  • Local end-to-end smoke test of install-hooks, handle-antigravity-hook stdin/stdout JSON contract, and doctor

@hellolib
hellolib merged commit 541a2b4 into hellolib:main Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants