Files
chainbase-labs__agentkey/tests/antigravity-plugin.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

99 lines
2.6 KiB
Bash

#!/usr/bin/env bats
setup() {
REPO_ROOT="$(cd "$BATS_TEST_DIRNAME/.." && pwd)"
MANIFEST="$REPO_ROOT/plugin.json"
MCP_CONFIG="$REPO_ROOT/mcp_config.json"
}
@test "Antigravity plugin manifest follows the documented schema" {
python3 - "$MANIFEST" <<'PY'
import json
import re
import sys
with open(sys.argv[1], encoding="utf-8") as handle:
manifest = json.load(handle)
assert manifest["$schema"] == "https://antigravity.google/schemas/v1/plugin.json"
assert re.fullmatch(r"[a-zA-Z0-9-_]+", manifest["name"])
assert manifest["name"] == "agentkey"
assert manifest["description"]
assert set(manifest) == {"$schema", "name", "description"}
assert "version" not in manifest
PY
}
@test "Antigravity plugin declares remote MCP with serverUrl" {
python3 - "$MCP_CONFIG" <<'PY'
import json
import sys
with open(sys.argv[1], encoding="utf-8") as handle:
config = json.load(handle)
assert config == {
"mcpServers": {
"agentkey": {
"serverUrl": "https://api.agentkey.app/v1/mcp",
}
}
}
server = config["mcpServers"]["agentkey"]
assert "url" not in server
assert "httpUrl" not in server
PY
}
@test "Antigravity plugin relies on automatic OAuth discovery" {
python3 - "$MCP_CONFIG" <<'PY'
import json
import sys
with open(sys.argv[1], encoding="utf-8") as handle:
server = json.load(handle)["mcpServers"]["agentkey"]
assert "headers" not in server
assert "oauth" not in server
assert "authProviderType" not in server
PY
}
@test "Antigravity desktop and CLI share 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
}
@test "Antigravity endpoint stays synchronized with every plugin client" {
python3 - "$REPO_ROOT" <<'PY'
import json
import os
import sys
root = sys.argv[1]
configs = {
"claude": (".mcp.json", "url"),
"codex": (".codex-plugin/mcp.json", "url"),
"cursor": (".cursor-plugin/plugin.json", "url"),
"kimi": (".kimi-plugin/plugin.json", "url"),
"gemini": ("gemini-extension.json", "httpUrl"),
"antigravity": ("mcp_config.json", "serverUrl"),
}
endpoints = {}
for client, (relative_path, field) in configs.items():
with open(os.path.join(root, relative_path), encoding="utf-8") as handle:
endpoints[client] = json.load(handle)["mcpServers"]["agentkey"][field]
assert set(endpoints.values()) == {"https://api.agentkey.app/v1/mcp"}, endpoints
PY
}