Files
chainbase-labs__agentkey/tests/gemini-extension.bats
T
zzAllenn 49a015b408 feat: add Cursor, Gemini CLI, and Antigravity plugin support (#91)
## Summary
- add the Cursor-native plugin manifest and marketplace metadata with
inline AgentKey MCP OAuth
- add the root Gemini CLI extension manifest using Streamable HTTP and
native OAuth discovery
- add one root Antigravity plugin package for both Antigravity 2.0 and
Antigravity CLI
- configure Antigravity remote MCP with the required `serverUrl` field
and automatic OAuth discovery
- reuse the existing `skills/agentkey/` package across Gemini and
Antigravity without duplication
- keep endpoint and release/version synchronization across every client
- document Cursor, Gemini, Antigravity 2.0, and Antigravity CLI
onboarding in English and Chinese

## Validation
- `npx -y bats@1.12.0 tests/` (20/20 passing)
- `npx -y @google/gemini-cli@0.54.4 extensions validate .`
- verified all eight version values match `1.13.1`
- verified Claude, Codex, Cursor, Kimi, Gemini, and Antigravity MCP
endpoints remain synchronized
- verified the AgentKey endpoint advertises OAuth protected-resource
metadata
- verified the branch merges cleanly with `chainbase-labs/main`

## Antigravity validation boundary
The `agy` binary is not installed in the current environment, so a live
CLI install was not run. The plugin layout, manifest fields,
`serverUrl`, OAuth configuration, and shared Skill discovery are covered
by automated assertions against the current Antigravity documentation.
The documentation-prescribed `$schema` URL currently returns HTTP 404;
the manifest retains the prescribed value while tests enforce the
published schema locally.

---------

Co-authored-by: Allen <0xfatdog@gmail.com>
2026-08-11 02:28:26 +08:00

56 lines
1.3 KiB
Bash

#!/usr/bin/env bats
setup() {
REPO_ROOT="$(cd "$BATS_TEST_DIRNAME/.." && pwd)"
MANIFEST="$REPO_ROOT/gemini-extension.json"
}
@test "Gemini extension declares the AgentKey Streamable HTTP server inline" {
python3 - "$MANIFEST" <<'PY'
import json
import sys
with open(sys.argv[1], encoding="utf-8") as handle:
manifest = json.load(handle)
assert manifest["name"] == "agentkey"
assert manifest["description"]
assert manifest["mcpServers"] == {
"agentkey": {
"httpUrl": "https://api.agentkey.app/v1/mcp",
}
}
PY
}
@test "Gemini extension relies on native OAuth discovery" {
python3 - "$MANIFEST" <<'PY'
import json
import sys
with open(sys.argv[1], encoding="utf-8") as handle:
manifest = json.load(handle)
assert "settings" not in manifest
server = manifest["mcpServers"]["agentkey"]
assert "headers" not in server
assert "oauth" not in server
assert "authProviderType" not in server
assert "trust" not in server
PY
}
@test "Gemini extension bundles the existing AgentKey skill" {
[ -f "$REPO_ROOT/skills/agentkey/SKILL.md" ]
python3 - "$REPO_ROOT/skills/agentkey/SKILL.md" <<'PY'
import sys
with open(sys.argv[1], encoding="utf-8") as handle:
skill = handle.read()
frontmatter = skill.split("---", 2)[1]
assert "\nname: agentkey\n" in f"\n{frontmatter}\n"
PY
}