I have a complete picture. The detection cascade derives from the registry and delegates to each adapter's detectInstalled(), so adding a platform is just a registry entry plus the adapter file. Now I'll produce the decisive plan.
- Upgrade the existing
antigravityadapter frommcp-only→json-stdiowith full content surfaces (hooks + commands/workflows + skills + subagents). The "mcp-only / no hooks" framing is stale as of Antigravity 2.0. - Add ONE new platform:
antigravity-cli(agy). It is a distinct binary with its own global dir and its own usage store, so it gets its own adapter + PlatformId + usage reader. The two adapters share rendering logic (same JSON/hooks.json/SKILL.md formats) but differ in user-scope paths and runtime markers. - Keep
gemini-cliexactly as-is. Enterprise + API-key users persist past the 2026-06-18 consumer cutoff. Only document the shared-~/.geminicaveats. - Fix two confirmed bugs in the current adapter regardless of scope decisions: the remote-server key (
url→serverUrl) and the stale-first user MCP path order. - Antigravity is fast-moving and its docs render JS-only (research confidence = medium). Every user-scope path and every "new in 2.0" surface must be path-probed at runtime with doctor reporting, never hard-coded to a single guess.
Format for both IDE and CLI: plain JSON, root key "mcpServers". stdio = { command, args, env }. Remote = { "serverUrl": "...", "headers": {...} } — NOT url, and not Gemini CLI's httpUrl. No ${workspaceFolder} / native env-token support → keep resolving env refs to literals at install time (resolveEnvRefsDeep). [confidence: MCP shape HIGH; exact paths MEDIUM]
| Scope | IDE (antigravity) |
CLI (antigravity-cli) |
Confidence |
|---|---|---|---|
| User/global | ~/.gemini/config/mcp_config.json (canonical shared, current 2.0) |
same ~/.gemini/config/mcp_config.json, plus CLI-only alt ~/.gemini/antigravity-cli/mcp_config.json |
MEDIUM |
| Legacy user | ~/.gemini/antigravity/mcp_config.json (Nov-2025 launch path; still read by older builds) |
— | MEDIUM |
| Project | <proj>/.agents/mcp_config.json (plural .agents) |
<proj>/.agents/mcp_config.json |
HIGH |
| Generated (DO NOT WRITE) | ~/.gemini/antigravity-ide/mcp/ |
~/.gemini/antigravity-cli/mcp/ |
— |
WRONG in current adapter — must change:
- BUG 1 (remote key).
AntigravityHttpServer+renderServerEntryemit{ url }. Antigravity usesserverUrl. Fix the interface to{ serverUrl: string; headers? }and the render toserverUrl. (The currenttransports: ["stdio","sse","http"]is otherwise fine.) - BUG 2 (user path order).
USER_CONFIG_CANDIDATES[0]is the legacy.gemini/antigravity/path, andresolveUserConfigPath()falls back tocandidate[0]on a fresh install → writes to the stale path. Reorder so candidate[0] =.gemini/config/mcp_config.json(canonical shared), then.gemini/antigravity/(legacy), then.gemini/antigravity-cli/mcp_config.json(CLI-only). Keep "prefer an existing candidate, else default to the new candidate[0]." The CLI adapter's candidate list =[.gemini/config/, .gemini/antigravity-cli/].
SUPPORTED as of Antigravity 2.0. Declared as JSON in a hooks.json file in the customization dir: project <proj>/.agents/hooks.json or global ~/.gemini/config/hooks.json (and at plugin roots). Shape:
{ "hooks": { "<Event>": [ { "matcher": "<regex>", "hooks": [ { "type": "command", "command": "..." } ] } ] } }Events: PreToolUse, PostToolUse, SessionStart, Stop (matcher-based); PreInvocation, PostInvocation (handler list directly under event, matcher ignored). I/O is stdin/stdout JSON, camelCase fields. Categories: Inspect (read-only), Decide (blocking approve/deny), Transform (modifying). [confidence: MEDIUM — event names corroborated by secondary sources + official doc URL, not quoted from live docs]
- Commands = "Workflows": markdown
.md. Project<proj>/.agent/workflows/*.md(note singular.agentin launch-era docs), global~/.gemini/antigravity/global_workflows/*.md. CLI also surfaces skills-as-slash-commands. [MEDIUM] - Skills = Agent Skills (
SKILL.md), Claude-compatible. Project<proj>/.agents/skills/<name>/SKILL.md(plural). Global (CLI)~/.gemini/antigravity-cli/skills/<name>/SKILL.md; shared 2.0~/.gemini/skills/. Official~/.gemini/antigravity/skills/reportedly does NOT work — avoid it. [skill format HIGH; global dir MEDIUM-LOW] - Subagents: two flavors. (a) runtime/dynamic (orchestrator-defined, not user files — out of scope). (b) declarative, only inside a plugin bundle at
<plugin>/agents/. There is no documented standalone top-level subagents dir outside the plugin model. [MEDIUM]
.agent (singular) vs .agents (plural) quirk: skills/plugins/mcp use plural .agents; rules/workflows in launch-era docs use singular .agent. Both appear in the wild. Handle both via probing (see §5).
Both antigravity (IDE) and antigravity-cli get the same capability profile (they share the harness and formats):
- paradigm:
json-stdio(wasmcp-only). - MCP: yes — stdio + remote (
serverUrl).transports: ["stdio","sse","http"]. - Hooks (
installHooks/uninstallHooks+parseEvent/formatReply): write tohooks.json(NOT the mcp_config.json). Capability flags:preToolUse: true,postToolUse: true,sessionStart: true,stop: true.preCompact: false,sessionEnd: false,userPromptSubmit: false,notification: false(no documented equivalents — keep false; warn-skip like gemini-cli does forStop).canModifyArgs: true,canModifyOutput: true(Transform category),canInjectSessionContext: true(SessionStart).- Map normalized events → Antigravity events (1:1 for the four supported; everything else warn-skips). camelCase stdout payload;
parseEventreads camelCase stdin.
- Commands:
supportsCommands: true— write Workflows.mdunder the workflows dir (markdown body; no TOML, unlike gemini-cli). - Skills:
supportsSkills: true— uniformSKILL.mdwriter (reuserenderSkill/writeContentFile, same as gemini-cli/pi). - Subagents:
supportsSubagents: falsefor v1. Declarative subagents only exist inside a plugin bundle; agent-connector does not currently emit plugin bundles, and there is no standalone subagent dir. Inherit BaseAdapter skip/warn. Revisit if/when a plugin-bundle writer is added.
This is a real upgrade: the adapter moves from the Warp-style mcp-only template to the gemini-cli-style json-stdio + content-surface template.
LOW-CONFIDENCE GUARD: because hook event names and the exact hooks.json location are MEDIUM confidence, gate hook + workflow installation behind path-probing and emit doctor warnings rather than silently writing to a guessed path (§5).
Decision: distinct platform. Rationale:
- Different binary (
agy, Go) vs the IDE/desktop app; sunsets Gemini CLI separately. - Different user-scope install root (
~/.gemini/antigravity-cli/and the CLI-onlymcp_config.jsonalt) and different runtime markers fordetectRuntimeHost(the universal hook entrypoint must know which host injected the stdin payload). A single adapter cannot report two distinctinstalled/scopeanswers or two distinct usage stores. - Different usage store (
~/.gemini/antigravity-cli/brain|history.jsonl|conversations), which the IDE doesn't own in the same shape.
They share project scope (<proj>/.agents/…) and all rendering formats, so factor the shared render/parse logic into a small internal module (or have AntigravityCliAdapter extends AntigravityAdapter, overriding only name, id, user-scope path resolution, and detection markers). Keep the IDE adapter's id antigravity; add antigravity-cli.
No code change. Enterprise + API-key users keep Gemini CLI past 2026-06-18; the Apache-2.0 repo persists. Caveats to document only:
- Gemini CLI and both Antigravity adapters share
~/.gemini/.~/.gemini/GEMINI.mdis read/written by both (gemini-cli issue #16058 conflict) — agent-connector doesn't write GEMINI.md, so no direct collision, but note it. - gemini-cli writes MCP into
~/.gemini/settings.jsonundermcpServers; the Antigravity adapters write into~/.gemini/config/mcp_config.json(+ tool-specific dirs). Different files → no clobber. Keep them separate; do not let the Antigravity adapter touchsettings.json. - A user with all three installed will get three separate registrations under one
~/.geminitree; that is correct and intended.
src/core/types.ts— add"antigravity-cli"to thePlatformIdunion (nearantigravity). Update themcp-onlyparadigm comment (line ~62) to dropantigravityfrom the mcp-only list.src/adapters/registry.ts— add anantigravity-clifactory entry. Order: placeantigravity-clibeforeantigravityand both aftergemini-cli(registry order drives runtime-host detection; the more-specific CLI marker must be checked before the IDE/parent).src/usage/registry.ts— add anantigravity-clireader entry in the synced/cloud (U4) group (format: "synced-cache",kind: "synced") ORkind: "local"if reading the native~/.gemini/antigravity-cli/store directly (see task C).src/usage/paths.ts— add acase "antigravity-cli":inhostRoots(and fix/extendantigravity— see C). Honors the existingAGENT_CONNECTOR_ANTIGRAVITY_CLI_DIRenv override automatically via the existingenvOverridemachinery.
- Rewrite header comment (remove "mcp-only / no hooks"; state 2.0 hooks + surfaces, and that paths are probed because docs are JS-rendered/medium-confidence).
paradigm: "json-stdio"; flip capability flags per §2.- Fix BUG 1:
AntigravityHttpServer { serverUrl: string; headers? };renderServerEntryemitsserverUrl. (Keep stdio rendering + telemetry wrap unchanged.) - Fix BUG 2: reorder
USER_CONFIG_CANDIDATES→config/first, thenantigravity/(legacy), thenantigravity-cli/. - Add
getHookConfigPath→hooks.jsonin the customization dir (project<proj>/.agents/hooks.json; user<resolvedUserConfigDir>/hooks.json), separate from mcp_config.json (currently it aliases mcp_config — change it). - Implement
installHooks/uninstallHookswriting the{ hooks: { Event: [{matcher, hooks:[{type:"command",command}]}] } }shape (reusebuildHomeBinHookCommand, the gemini-cli upsert/strip pattern, theisHomeBinHookCommandguard). Warn-skip unsupported events. - Implement
parseEvent(camelCase stdin → normalized) andformatReply(normalized → camelCase stdout: Decide deny/approve, Transform modify-args/output, SessionStart context inject). - Add content surfaces:
installCommands/uninstallCommands(Workflows.mdunder probed workflows dir),installSkills/uninstallSkills(SKILL.md, reuse base helpers). Leave subagents to BaseAdapter default (unsupported v1). - Extend
getHealthChecks: mcp_config present + server entry; hooks.json present + our hook command; workflow/skill file presence (mirror gemini-cli's per-surface checks). Add doctor warnings noting "path probed; verify against your Antigravity version." - Path-probing helpers (guard for medium confidence): a
resolveWorkflowsDir()andresolveSkillsDir()that prefer an existing.agents/.agent(or globalantigravity-cli/skillsvsskills) variant and default to the documented current-2.0 path when none exists. Same prefer-existing-else-canonical pattern already used forresolveUserConfigPath.
class AntigravityCliAdapter extends AntigravityAdapter(or shared-module composition). Override:id="antigravity-cli",name="Antigravity CLI"; user-scopeUSER_CONFIG_CANDIDATES = [.gemini/config/mcp_config.json, .gemini/antigravity-cli/mcp_config.json]; global skills dir →~/.gemini/antigravity-cli/skills/;detectInstalledprobes~/.gemini/antigravity-cli/(and theagybinary in~/.local/bin). Project scope identical (.agents).export default new AntigravityCliAdapter().
src/usage/readers/antigravity.ts(fix location). Current reader targets~/.config/tokscale/antigravity-cache+~antigravity*dirs — that's a tokscale-cache indirection, not Antigravity's real store. Decision: keep the tokscale-cache path as a fallback (defensible: reads a tokscale mirror) BUT add the native root~/.gemini/antigravity-ide/brain/**/transcript*.jsonl. Update the header to say "reads tokscale cache AND native brain transcripts." The existing JSONL row schema (session_meta/usage) and alias table are reusable; note native transcripts embed tokens inusage_metadataper-turn (prompt/candidate/cached/thinking), which is a different shape than the tokscale{input,output,cacheRead,...}rows — a native parser path may be needed (guard: if native shape, mapusage_metadata; the.pbprotobuf has no public schema → skip).- New
src/usage/readers/antigravity-cli.ts. Reads~/.gemini/antigravity-cli/brain/<conv>/transcript*.jsonl+history.jsonlindex; skip.pb. Same alias table (factor out the sharedMODEL_ALIASES+parseUsageRowinto a shared helper to avoid duplication). Fail-open when absent. Mark confidence honestly: native JSONL shape = MEDIUM; treatusage_metadataextraction as best-effort.
tests/adapters/wave1-render.test.ts— move antigravity out of the mcp-only block; assertserverUrl(noturl) for remote, and the corrected user path order.tests/adapters/phase2-render.test.ts(json-stdio block) — add antigravity + antigravity-cli: hooks.json round-trip,parseEvent/formatReplyfor PreToolUse/PostToolUse/SessionStart/Stop, warn-skip for unsupported events.tests/adapters/surfaces-s1.test.ts— add workflow.md+SKILL.mdwrite/idempotent/uninstall for both adapters; assert subagents warn-skip.tests/usage/u4-readers.test.ts(or u1 if reclassified local) — add antigravity-cli reader fixtures (synthetictranscript.jsonl), and a native-brain fixture for the updated antigravity reader. Assert fail-open on empty.- New
tests/adapters/antigravity-paths.test.ts— exercise the prefer-existing-else-canonical probing for user MCP, hooks.json, workflows (.agentvs.agents), and global skills dirs.
- Exact hook event names +
hooks.jsonlocation (MEDIUM): probe for an existinghooks.json(project.agents/then.agent/, userconfig/); default to.agents/hooks.jsononly when none exists; doctor prints the resolved path + a "verify for your version" note. Unsupported normalized events warn-skip (never throw at install). - Global skills dir (the documented
~/.gemini/antigravity/skills/reportedly broken): prefer existing~/.gemini/antigravity-cli/skills/or~/.gemini/skills/; never write to~/.gemini/antigravity/skills/. .agentvs.agentsfor workflows/rules: probe both, prefer existing, default to the 2.0 plural for skills/mcp and singular.agent/workflowsfor workflows per launch-era docs (doctor reports which was chosen).- User MCP canonical path: prefer existing candidate; the reordered default (
.gemini/config/) is a best-guess for fresh installs. - Native usage store shape (
transcript.jsonlusage_metadatavs tokscale rows;.pbopaque): best-effort parse, skip protobuf, fail-open to[]. - Subagents: deliberately unsupported v1 (plugin-bundle-only model) — documented, not guessed.
- Edit:
/home/ubuntu/workspace/github/agent-connector/src/core/types.ts - Edit:
/home/ubuntu/workspace/github/agent-connector/src/adapters/registry.ts - Edit:
/home/ubuntu/workspace/github/agent-connector/src/adapters/antigravity/index.ts - Create:
/home/ubuntu/workspace/github/agent-connector/src/adapters/antigravity-cli/index.ts - Edit:
/home/ubuntu/workspace/github/agent-connector/src/usage/registry.ts - Edit:
/home/ubuntu/workspace/github/agent-connector/src/usage/paths.ts - Edit:
/home/ubuntu/workspace/github/agent-connector/src/usage/readers/antigravity.ts - Create:
/home/ubuntu/workspace/github/agent-connector/src/usage/readers/antigravity-cli.ts - Edit tests:
/home/ubuntu/workspace/github/agent-connector/tests/adapters/wave1-render.test.ts,/home/ubuntu/workspace/github/agent-connector/tests/adapters/phase2-render.test.ts,/home/ubuntu/workspace/github/agent-connector/tests/adapters/surfaces-s1.test.ts,/home/ubuntu/workspace/github/agent-connector/tests/usage/u4-readers.test.ts - No change:
/home/ubuntu/workspace/github/agent-connector/src/adapters/gemini-cli/index.ts(keep as-is; document shared~/.geminicaveats only).