From ea4cbed3399dada2510520f3603ff73fd5c78dad Mon Sep 17 00:00:00 2001 From: omartelo Date: Sun, 23 Aug 2026 19:53:19 -0300 Subject: [PATCH 1/4] feat: report Antigravity CLI sessions to lich --- CHANGELOG.md | 8 +++ README.md | 24 ++++++-- docs/providers.md | 42 +++++++++----- docs/session-start.md | 10 ++-- docs/session-state.md | 28 ++++----- docs/session-title.md | 12 ++-- docs/session-touched.md | 6 +- hooks/antigravity-hooks.json | 52 +++++++++++++++++ hooks/detail.jq | 11 ++-- hooks/report-session-start.sh | 5 +- hooks/report-state.sh | 2 +- hooks/report-title.sh | 10 +++- hooks/report-tool.sh | 5 +- tests/fixtures/session-start.jsonl | 1 + tests/hooks.test.mjs | 92 +++++++++++++++++++++++++++--- 15 files changed, 242 insertions(+), 66 deletions(-) create mode 100644 hooks/antigravity-hooks.json diff --git a/CHANGELOG.md b/CHANGELOG.md index cb093f1..529a1a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- **Antigravity CLI sessions report to lich.** A sixth harness: Antigravity CLI + supports native lifecycle hooks (`hooks/antigravity-hooks.json`), progressive + skills, and plugins. It reports session start (`PreInvocation`), session state + (`busy` on `PreInvocation`, `done` on `Stop`), tool executions (`PreToolUse` with + tool details extracted from `toolCall.name` and `toolCall.args`), git-status + refresh (`PostToolUse`), and session title from the first `USER_INPUT` prompt + in `transcriptPath`. + - **A waiting card says what the session is waiting for.** The `waiting` report now carries a `reason`, so the bell says *why* rather than only *that*. Each harness hands over something different to say it with: Claude Code's diff --git a/README.md b/README.md index f6ad3d8..cf52f3c 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ # lich-plugin -The agent side of the [lich](https://github.com/omartelo/lich) integration. lich is a harness that orchestrates agent CLI sessions; this companion plugin gives it eyes and hands inside each session. It installs on **Claude Code**, **OpenAI Codex**, **opencode**, **omp** (oh-my-pi) and **Crush** from this same repository. Every hook implements a contract that is canonical in the lich repository (`docs/hooks/` there); the docs in `docs/` here point at each contract and describe the client side: +The agent side of the [lich](https://github.com/omartelo/lich) integration. lich is a harness that orchestrates agent CLI sessions; this companion plugin gives it eyes and hands inside each session. It installs on **Claude Code**, **OpenAI Codex**, **Antigravity CLI**, **opencode**, **omp** (oh-my-pi) and **Crush** from this same repository. Every hook implements a contract that is canonical in the lich repository (`docs/hooks/` there); the docs in `docs/` here point at each contract and describe the client side: -- **session state** — `busy`/`done` on the session card (`UserPromptSubmit`/`Stop`) -- **session start** — persists the agent's session id on the lich session (`SessionStart`) +- **session state** — `busy`/`done` on the session card (`UserPromptSubmit`/`PreInvocation`/`Stop`) +- **session start** — persists the agent's session id on the lich session (`SessionStart`/`PreInvocation`) - **session title** — names the card after the session's own title (`Stop`) - **session touched** — refreshes the card's git status right after file-mutating tools (`PostToolUse`) -The four are what Claude Code, Codex, opencode and omp report. **Crush reports two of them** — its session id and the git-status refresh — because `PreToolUse` is the only event it has, and a state nothing can end is worse on a card than no state. **omp reports all four minus the bell**: no event of its own for "your turn" has been measured yet, so its card shows a spinner while the agent waits on you. [docs/providers.md](docs/providers.md) has the event mapping per harness. +The four are what Claude Code, Codex, Antigravity, opencode and omp report. **Crush reports two of them** — its session id and the git-status refresh — because `PreToolUse` is the only event it has, and a state nothing can end is worse on a card than no state. **omp reports all four minus the bell**: no event of its own for "your turn" has been measured yet, so its card shows a spinner while the agent waits on you. [docs/providers.md](docs/providers.md) has the event mapping per harness. On **opencode** it also carries the other direction: the seven operations lich offers a session for driving the sessions beside it — list, send, wait, reply, @@ -19,7 +19,7 @@ two cases where they are deliberately absent. It also ships skills for the parts of lich you configure from inside a session: -- **theme** (`/lich:theme` in Claude Code; on Codex the `theme` skill loads from its description) — write, port or fix a lich color theme: the app tokens, the xterm palette, where the file goes, and a validator for the rules that otherwise fail silently +- **theme** (`/lich:theme` in Claude Code; on Codex and Antigravity the `theme` skill loads from its description) — write, port or fix a lich color theme: the app tokens, the xterm palette, where the file goes, and a validator for the rules that otherwise fail silently ## Structure @@ -30,6 +30,7 @@ It also ships skills for the parts of lich you configure from inside a session: .agents/plugins/marketplace.json # marketplace, Codex hooks/hooks.json # hook registration, Claude Code hooks/codex-hooks.json # hook registration, Codex +hooks/antigravity-hooks.json # hook registration, Antigravity CLI hooks/crush-hooks.json # hook registration, Crush (merged into crush.json by hand) hooks/report-state.sh # session-state hook hooks/report-tool.sh # session-state hook: the tool a turn is running @@ -43,7 +44,7 @@ skills/theme/ # theme skill: SKILL.md, template.json, valida tests/ # hook payloads asserted against lich's fixtures ``` -One set of hook scripts serves Claude Code, Codex and Crush — they live in `hooks/` and are referenced via `$CLAUDE_PLUGIN_ROOT/hooks/