Scope / research status
P2 feature expansion. Researched 2026-09-06 against official Gemini CLI documentation. Agent Bundle baseline 5fc8de37c9695b816d55bdcf18a6bcb1dfee69f5; no Gemini installation or authenticated test executed. Pin the actual supported CLI/source revision during implementation. This issue covers Gemini CLI; Antigravity product/CLI compatibility must be established separately, not inferred from Ponytail's renaming claim.
Authoritative references
Host contract
A native extension has root gemini-extension.json; installed extensions live beneath ~/.gemini/extensions. The manifest provides identity, optional context-file selection, and MCP configuration. ${extensionPath} is the supported relocatable anchor. Commands use TOML; skills use skills/<name>/SKILL.md. Hooks are discovered from hooks/hooks.json, not an invented manifest hooks property.
Hook input is JSON on stdin; stdout is the result protocol, not a logging channel. Event output semantics differ: BeforeTool can block or adjust tool input; AfterTool can affect returned content; lifecycle/notification events have distinct control capabilities. Do not map every nonzero exit or continue field to the same canonical behavior. Unsupported control effects must be diagnosed rather than silently discarded.
MCP supports local and remote transports through host configuration. Credentials, OAuth and trust belong to Gemini. Extension settings may declare required environment inputs; sanitized host environments mean blindly inheriting the developer shell is not a valid runtime contract.
Example output and configuration
Illustrative generated layout (not an implemented Agent Bundle API):
composite-root/
gemini-extension.json
GEMINI.md
commands/review.toml
skills/review/SKILL.md
hooks/hooks.json # Gemini-specific native document
hooks/tool-before.gemini.mjs
mcp/example.mjs # only when MCP is declared
{
"name": "example-plugin",
"version": "1.0.0",
"contextFileName": "GEMINI.md",
"mcpServers": {
"example": {
"command": "node",
"args": ["${extensionPath}/mcp/example.mjs"],
"cwd": "${extensionPath}"
}
}
}
A simple commands/review.toml contains an authored description and prompt:
description = "Review the selected change"
prompt = "Review the selected change using the plugin's review guidance."
Do not convert arbitrary application strings into command shell interpolation. Any argument/file/shell expansion syntax must follow the native command parser and trust semantics.
Installation / development / removal
gemini extensions install ./composite-root
gemini extensions install https://github.com/example/plugin --ref v1.0.0
gemini extensions link ./composite-root
gemini extensions disable example-plugin --scope workspace
gemini extensions enable example-plugin --scope workspace
gemini extensions update example-plugin
gemini extensions uninstall example-plugin
Ordinary install copies content; local link is a separate development mode. Restart/session adoption rules matter: do not promise that every edit changes an already running session. Preserve native prompts; do not add --consent as an automatic approval bypass. Use normal host commands and record only registrations/data Agent Bundle actually owns.
Critical composite conflict
Agent Bundle's existing Claude projection requires conventional hooks/hooks.json. Gemini also auto-discovers that filename but expects its own event names and result codec. Ponytail avoids the conflict by moving its Claude/Codex hook file; that does not prove Agent Bundle can move every native conventional path.
The adapter must establish an effective-discovery contract for a combined selection. If both hosts' hooks cannot coexist without leakage under documented rules, reject that particular combination with a precise diagnostic or expose an explicitly separate installable projection. Never emit a merged foreign event map and call it composite support. Static/skills/MCP-only combinations may still be valid; test them separately.
Also test user/workspace MCP name precedence and extension-command collisions rather than silently renaming canonical operation identities.
Implementation plan
- Add a versioned native extension projection over existing content/operation/executable records; initially enable only verified capabilities.
- Generate TOML commands and a deterministic context artifact from authored content. Preserve intentional variants; no automatic summarization.
- Add Gemini hook input/output codecs with per-event block/observe/transform capability metadata.
- Lower MCP launch records using
${extensionPath}, preserving argv, cwd and declared environment without embedding secrets.
- Keep preflight cheap and reuse canonical execution; no standalone Gemini orchestration runtime.
- Teach install/inspect/Workbench to report exact supported projections and absent capabilities without spawning unnecessary processes.
Acceptance
Reuse src/adapters, src/build/compose.ts, canonical manifest/evidence, existing install receipts, #651 conformance and #652 small-plugin tests. No global relaxation of AB4106, credential storage, terminal UI requirement, or domain-policy ownership.
Scope / research status
P2 feature expansion. Researched 2026-09-06 against official Gemini CLI documentation. Agent Bundle baseline
5fc8de37c9695b816d55bdcf18a6bcb1dfee69f5; no Gemini installation or authenticated test executed. Pin the actual supported CLI/source revision during implementation. This issue covers Gemini CLI; Antigravity product/CLI compatibility must be established separately, not inferred from Ponytail's renaming claim.Authoritative references
Host contract
A native extension has root
gemini-extension.json; installed extensions live beneath~/.gemini/extensions. The manifest provides identity, optional context-file selection, and MCP configuration.${extensionPath}is the supported relocatable anchor. Commands use TOML; skills useskills/<name>/SKILL.md. Hooks are discovered fromhooks/hooks.json, not an invented manifesthooksproperty.Hook input is JSON on stdin; stdout is the result protocol, not a logging channel. Event output semantics differ:
BeforeToolcan block or adjust tool input;AfterToolcan affect returned content; lifecycle/notification events have distinct control capabilities. Do not map every nonzero exit orcontinuefield to the same canonical behavior. Unsupported control effects must be diagnosed rather than silently discarded.MCP supports local and remote transports through host configuration. Credentials, OAuth and trust belong to Gemini. Extension settings may declare required environment inputs; sanitized host environments mean blindly inheriting the developer shell is not a valid runtime contract.
Example output and configuration
Illustrative generated layout (not an implemented Agent Bundle API):
{ "name": "example-plugin", "version": "1.0.0", "contextFileName": "GEMINI.md", "mcpServers": { "example": { "command": "node", "args": ["${extensionPath}/mcp/example.mjs"], "cwd": "${extensionPath}" } } }A simple
commands/review.tomlcontains an authored description and prompt:Do not convert arbitrary application strings into command shell interpolation. Any argument/file/shell expansion syntax must follow the native command parser and trust semantics.
Installation / development / removal
gemini extensions install ./composite-root gemini extensions install https://github.com/example/plugin --ref v1.0.0 gemini extensions link ./composite-root gemini extensions disable example-plugin --scope workspace gemini extensions enable example-plugin --scope workspace gemini extensions update example-plugin gemini extensions uninstall example-pluginOrdinary install copies content; local link is a separate development mode. Restart/session adoption rules matter: do not promise that every edit changes an already running session. Preserve native prompts; do not add
--consentas an automatic approval bypass. Use normal host commands and record only registrations/data Agent Bundle actually owns.Critical composite conflict
Agent Bundle's existing Claude projection requires conventional
hooks/hooks.json. Gemini also auto-discovers that filename but expects its own event names and result codec. Ponytail avoids the conflict by moving its Claude/Codex hook file; that does not prove Agent Bundle can move every native conventional path.The adapter must establish an effective-discovery contract for a combined selection. If both hosts' hooks cannot coexist without leakage under documented rules, reject that particular combination with a precise diagnostic or expose an explicitly separate installable projection. Never emit a merged foreign event map and call it composite support. Static/skills/MCP-only combinations may still be valid; test them separately.
Also test user/workspace MCP name precedence and extension-command collisions rather than silently renaming canonical operation identities.
Implementation plan
${extensionPath}, preserving argv, cwd and declared environment without embedding secrets.Acceptance
Reuse
src/adapters,src/build/compose.ts, canonical manifest/evidence, existing install receipts, #651 conformance and #652 small-plugin tests. No global relaxation of AB4106, credential storage, terminal UI requirement, or domain-policy ownership.