diff options
| author | Ludovico Magnocavallo <ludo@qix.it> | 2026-08-01 18:32:47 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-01 19:32:47 +0300 |
| commit | 679584fdd49f9dee5ad95755af65eedc7d0f455c (patch) | |
| tree | b21359553af294c2a2d57726e99029d86534cda0 /docs/next | |
| parent | 219e0be351436b5bf1ccf5b7c13dbf6c2cdb0986 (diff) | |
feat: add antigravity-cli integration (#2087)
* feat: add antigravity_cli integration harness
Register the `antigravity_cli` target, resolve its configuration
directory to `~/.gemini/antigravity-cli/`, wire target actions,
and add lifecycle hook scripts for Unix and Windows.
* feat: support session resume for antigravity-cli
* fix: correct antigravity-cli hook config path, shape, and agent label
Antigravity CLI reads global customizations from ~/.gemini/config, keys
hooks.json by hook name, and only accepts the matcher/hooks wrapper for
the tool events. The previous install wrote event arrays at the top level
of ~/.gemini/antigravity-cli/hooks.json, which agy never reads and would
reject anyway, so no Herdr hook ever ran.
Session reports were dropped for a third reason: the hooks reported the
agent as antigravity-cli, but the server normalizes that to the canonical
label agy before matching, so is_official_agent_source never matched and
agy --conversation resume was unreachable.
- Resolve the config dir to ~/.gemini/config
- Nest Herdr entries under a Herdr-owned "herdr" block that install
rewrites and uninstall removes, leaving other named hooks untouched
- Emit grouped entries for PreToolUse/PostToolUse and flat handler lists
for PreInvocation/PostInvocation/Stop
- Report the canonical agy label from both hook assets and match it in
agent_resume
- Compile-gate the hook asset constants and stop shadowing $args in the
PowerShell hook
- Document the real directory, that it must already exist, and the
named-block behavior
refs #1011
refs #1571
* fix: make antigravity-cli integration session-only
antigravity cli cannot express lifecycle safely: there is no blocked
event, postinvocation is skipped on interruption, and stop fires at the
end of a turn rather than on process exit, which left stale state and
released authority at the wrong time.
report only the conversation on preinvocation and let screen detection
own agent state. resume via `agy --conversation <id>` is unchanged.
* fix: update antigravity session after conversation switch
---------
Co-authored-by: Can Celik <ogulcancelik@gmail.com>
Diffstat (limited to 'docs/next')
| -rw-r--r-- | docs/next/api/herdr-api.schema.json | 2 | ||||
| -rw-r--r-- | docs/next/website/src/content/docs/integrations.mdx | 18 | ||||
| -rw-r--r-- | docs/next/website/src/content/docs/session-state.mdx | 1 |
3 files changed, 19 insertions, 2 deletions
diff --git a/docs/next/api/herdr-api.schema.json b/docs/next/api/herdr-api.schema.json index b4704cd1..1a91870b 100644 --- a/docs/next/api/herdr-api.schema.json +++ b/docs/next/api/herdr-api.schema.json @@ -2119,6 +2119,7 @@ "qodercli", "cursor", "mastracode", + "antigravity_cli", "grok" ], "type": "string" @@ -7113,6 +7114,7 @@ "qodercli", "cursor", "mastracode", + "antigravity_cli", "grok" ], "type": "string" diff --git a/docs/next/website/src/content/docs/integrations.mdx b/docs/next/website/src/content/docs/integrations.mdx index fcc908a7..38cea6a1 100644 --- a/docs/next/website/src/content/docs/integrations.mdx +++ b/docs/next/website/src/content/docs/integrations.mdx @@ -60,9 +60,9 @@ Herdr uses integrations in two different ways: Custom socket integrations can also report state when they define state that is not visible in the native terminal UI. -Some integrations report native agent session references. Herdr uses official session references to resume Claude Code, Codex, Devin CLI, Droid, Kimi Code CLI, Qoder CLI, Cursor Agent CLI, Grok CLI, GitHub Copilot CLI, Pi, OMP, Hermes Agent, OpenCode, Kilo Code CLI, and MastraCode panes after a Herdr server restart unless `[session] resume_agents_on_restore = false` disables it. +Some integrations report native agent session references. Herdr uses official session references to resume Claude Code, Codex, Devin CLI, Droid, Kimi Code CLI, Qoder CLI, Cursor Agent CLI, Grok CLI, GitHub Copilot CLI, Pi, OMP, Hermes Agent, OpenCode, Kilo Code CLI, MastraCode, and Antigravity CLI panes after a Herdr server restart unless `[session] resume_agents_on_restore = false` disables it. -Native session restore requires current Herdr integrations: Pi integration version `2`, OMP version `3`, Claude Code version `6`, Codex version `5`, GitHub Copilot CLI version `2`, Devin CLI version `2`, Droid version `2`, Kimi Code CLI version `3`, Qoder CLI version `2`, Cursor Agent CLI version `1`, Grok CLI version `1`, OpenCode version `5`, Kilo Code CLI version `1`, Hermes Agent version `2`, or MastraCode version `1`. Check installed versions with `herdr integration status`. +Native session restore requires current Herdr integrations: Pi integration version `2`, OMP version `3`, Claude Code version `6`, Codex version `5`, GitHub Copilot CLI version `2`, Devin CLI version `2`, Droid version `2`, Kimi Code CLI version `3`, Qoder CLI version `2`, Cursor Agent CLI version `1`, Grok CLI version `1`, OpenCode version `5`, Kilo Code CLI version `1`, Hermes Agent version `2`, MastraCode version `1`, or Antigravity CLI version `1`. Check installed versions with `herdr integration status`. ## Pi @@ -258,6 +258,20 @@ Herdr uses `~/.mastracode`. Install writes `hooks/herdr-agent-state.sh` and adds Herdr resumes stored MastraCode threads with `mastracode --thread <id>`. +## Antigravity CLI + +Install the Antigravity CLI hook: + +```bash +herdr integration install antigravity-cli +``` + +Herdr uses `~/.gemini/config/` by default, or `ANTIGRAVITY_CLI_CONFIG_DIR` when set. This is the directory Antigravity CLI reads global customizations from, and it must already exist. Install writes `hooks/herdr-agent-state.sh` (or `herdr-agent-state.ps1` on Windows) and adds a Herdr-owned `herdr` block to `hooks.json`. Antigravity CLI keys `hooks.json` by hook name, so install rewrites only that block and leaves other named hooks untouched. Uninstall removes the `herdr` block and deletes the hook script. + +This integration is session-only. It reports the conversation the pane is running and does not report agent state, so Herdr keeps deriving working, idle, and blocked from what Antigravity CLI draws on screen. + +The hook runs on `PreInvocation`, so Herdr learns the conversation once the first prompt is sent. From then on Herdr can resume the pane with `agy --conversation <id>` after a Herdr server restart. + ## Grok CLI Install the Grok CLI hook: diff --git a/docs/next/website/src/content/docs/session-state.mdx b/docs/next/website/src/content/docs/session-state.mdx index 222e280b..468557b4 100644 --- a/docs/next/website/src/content/docs/session-state.mdx +++ b/docs/next/website/src/content/docs/session-state.mdx @@ -67,6 +67,7 @@ Native session restore requires these Herdr integration versions or newer: | Agent | Minimum Herdr integration version | Resume command | | --- | --- | --- | | Pi | `2` | `pi --session <path-or-id>` | +| Antigravity CLI | `1` | `agy --conversation <id>` | | OMP | `3` | `omp --resume=<path-or-id>` | | Claude Code | `6` | `claude --resume <id>` | | Codex | `5` | `codex resume <id>` | |
