toolbase 0.9.1__tar.gz → 0.10.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. {toolbase-0.9.1 → toolbase-0.10.0}/CHANGELOG.md +8 -0
  2. {toolbase-0.9.1 → toolbase-0.10.0}/PKG-INFO +8 -5
  3. {toolbase-0.9.1 → toolbase-0.10.0}/README.md +7 -4
  4. {toolbase-0.9.1 → toolbase-0.10.0}/pyproject.toml +1 -1
  5. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/cli.py +11 -9
  6. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/connect/__init__.py +7 -2
  7. toolbase-0.10.0/toolbase/connect/antigravity.py +242 -0
  8. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/skills.py +1 -0
  9. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase.egg-info/SOURCES.txt +1 -0
  10. {toolbase-0.9.1 → toolbase-0.10.0}/LICENSE +0 -0
  11. {toolbase-0.9.1 → toolbase-0.10.0}/MANIFEST.in +0 -0
  12. {toolbase-0.9.1 → toolbase-0.10.0}/setup.cfg +0 -0
  13. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/__init__.py +0 -0
  14. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/_setup_host.py +0 -0
  15. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/_toolkit_host.py +0 -0
  16. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/astro.py +0 -0
  17. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/auth.py +0 -0
  18. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/config.py +0 -0
  19. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/connect/base.py +0 -0
  20. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/connect/claude_code.py +0 -0
  21. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/connect/codex.py +0 -0
  22. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/connect/opencode.py +0 -0
  23. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/connect/orchestral.py +0 -0
  24. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/envs/__init__.py +0 -0
  25. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/envs/bundle_deps.py +0 -0
  26. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/envs/cache.py +0 -0
  27. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/envs/config.py +0 -0
  28. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/envs/discovery.py +0 -0
  29. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/envs/manifest.py +0 -0
  30. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/envs/paths.py +0 -0
  31. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/envs/schema.py +0 -0
  32. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/hep.py +0 -0
  33. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/ingest.py +0 -0
  34. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/logging/__init__.py +0 -0
  35. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/logging/logger.py +0 -0
  36. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/naming.py +0 -0
  37. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/neutrino.py +0 -0
  38. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/quantum.py +0 -0
  39. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/serve/__init__.py +0 -0
  40. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/serve/bundles.py +0 -0
  41. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/serve/config.py +0 -0
  42. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/serve/orchestrator.py +0 -0
  43. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/serve/profile_scaffold.py +0 -0
  44. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/serve/profiles.py +0 -0
  45. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/serve/proxy_tool.py +0 -0
  46. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/setup/__init__.py +0 -0
  47. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/setup/_rpc.py +0 -0
  48. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/setup/context.py +0 -0
  49. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/setup/declarative.py +0 -0
  50. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/setup/downloads.py +0 -0
  51. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/setup/prompts.py +0 -0
  52. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/setup/runner.py +0 -0
  53. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/setup/schema.py +0 -0
  54. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/setup/storage.py +0 -0
  55. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/setup/validate_cache.py +0 -0
  56. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/templates/Dockerfile.template +0 -0
  57. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/templates/README.md.template +0 -0
  58. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/templates/__init__.py.template +0 -0
  59. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/templates/mcp/__init__.py.template +0 -0
  60. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/templates/mcp/server_stdio.py.template +0 -0
  61. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/templates/requirements.txt.template +0 -0
  62. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/templates/setup.py.template +0 -0
  63. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/templates/skills/example_skill.md +0 -0
  64. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/templates/tool_example.py +0 -0
  65. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/templates/toolkit.yaml.template +0 -0
  66. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/toolkit.py +0 -0
  67. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/validation.py +0 -0
  68. {toolbase-0.9.1 → toolbase-0.10.0}/toolbase/versioning.py +0 -0
@@ -8,6 +8,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/), and this
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [0.10.0] — 2026-07-30
12
+
13
+ ### Added
14
+
15
+ - **`tb connect antigravity` wires Google Antigravity.** One adapter covers the `agy` CLI, the Antigravity IDE, and the SDK, because all three read the same MCP config. Scopes follow Antigravity's two customization roots: `-g` writes the global `~/.gemini/config/mcp_config.json`, project scope writes the workspace `.agents/mcp_config.json`. Skills surface natively — `~/.gemini/config/skills/<toolkit>__<skill>/SKILL.md`, the same directory-plus-frontmatter layout Claude Code uses, so a toolkit's guides are loaded on demand rather than reduced to slash commands.
16
+
17
+ Two Antigravity quirks are handled: a zero-byte `mcp_config.json` (which the IDE creates on first launch) is read as an empty config rather than refused as malformed, and project scope prints a warning that only the IDE and SDK honor a workspace config today — the CLI discovers and then ignores it ([antigravity-cli#60](https://github.com/google-antigravity/antigravity-cli/issues/60)), so CLI users should connect with `-g`.
18
+
11
19
  ## [0.9.1] — 2026-07-29
12
20
 
13
21
  ### Changed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: toolbase
3
- Version: 0.9.1
3
+ Version: 0.10.0
4
4
  Summary: The community registry and CLI for AI agent toolkits - discover, share, and serve tools to AI agents over MCP
5
5
  Author-email: Alex Roman <toolbase.dev@gmail.com>
6
6
  License: MIT
@@ -87,9 +87,9 @@ directory's `.toolbase/` by default, `-g` writes to the user-wide
87
87
  profile instead.
88
88
 
89
89
  **`tb connect` writes the MCP config for you.** Claude Code, Codex,
90
- OpenCode, and Orchestral are all supported (`tb connect --harnesses`
91
- lists them); Claude Code, Codex, and OpenCode are MCP clients (`tb
92
- connect` edits their config file), while Orchestral gets a runnable agent
90
+ OpenCode, Antigravity, and Orchestral are all supported (`tb connect
91
+ --harnesses` lists them); the first four are MCP clients (`tb connect`
92
+ edits their config file), while Orchestral gets a runnable agent
93
93
  script you launch yourself. It also surfaces the activated toolkits'
94
94
  **skills** into the harness — see
95
95
  [Skills](#skills-guides-that-travel-with-the-toolkit).
@@ -144,6 +144,9 @@ format:
144
144
  - **OpenCode** → `~/.config/opencode/command/<toolkit>__<skill>.md` — a
145
145
  `/<toolkit>__<skill>` slash-command prompt (its `description` shows in
146
146
  the TUI).
147
+ - **Antigravity** → `~/.gemini/config/skills/<toolkit>__<skill>/` — a
148
+ native skill in the global customization root, loaded on demand by the
149
+ `agy` CLI and the IDE alike.
147
150
 
148
151
  Skills follow the same curation as tools: a guide is surfaced only when
149
152
  its toolkit is active, and you toggle a single one with the activation
@@ -228,7 +231,7 @@ Full reference with all flags: <https://toolbase-ai.com/docs/reference/commands>
228
231
  | `tb list` | Installed toolkits (`-v` for a per-tool view) |
229
232
  | `tb activate ITEM` | Expose a toolkit / `toolkit/bundle` / `toolkit__tool` / `toolkit__skill` (project-local; `-g` for user-wide) |
230
233
  | `tb deactivate ITEM` | Hide a toolkit / bundle / tool / skill |
231
- | `tb connect HARNESS` | Wire toolbase into Claude Code, Codex, OpenCode, or scaffold an Orchestral agent script (also surfaces skills; `--no-skills` to skip) |
234
+ | `tb connect HARNESS` | Wire toolbase into Claude Code, Codex, OpenCode, Antigravity, or scaffold an Orchestral agent script (also surfaces skills; `--no-skills` to skip) |
232
235
  | `tb disconnect HARNESS` | Remove toolbase from a harness (and its surfaced skills) |
233
236
  | `tb logs` | Tail the serve log, live |
234
237
  | `tb profile …` | Manage named profiles: `list \| show \| create \| edit \| delete \| set-default \| path \| tools` |
@@ -46,9 +46,9 @@ directory's `.toolbase/` by default, `-g` writes to the user-wide
46
46
  profile instead.
47
47
 
48
48
  **`tb connect` writes the MCP config for you.** Claude Code, Codex,
49
- OpenCode, and Orchestral are all supported (`tb connect --harnesses`
50
- lists them); Claude Code, Codex, and OpenCode are MCP clients (`tb
51
- connect` edits their config file), while Orchestral gets a runnable agent
49
+ OpenCode, Antigravity, and Orchestral are all supported (`tb connect
50
+ --harnesses` lists them); the first four are MCP clients (`tb connect`
51
+ edits their config file), while Orchestral gets a runnable agent
52
52
  script you launch yourself. It also surfaces the activated toolkits'
53
53
  **skills** into the harness — see
54
54
  [Skills](#skills-guides-that-travel-with-the-toolkit).
@@ -103,6 +103,9 @@ format:
103
103
  - **OpenCode** → `~/.config/opencode/command/<toolkit>__<skill>.md` — a
104
104
  `/<toolkit>__<skill>` slash-command prompt (its `description` shows in
105
105
  the TUI).
106
+ - **Antigravity** → `~/.gemini/config/skills/<toolkit>__<skill>/` — a
107
+ native skill in the global customization root, loaded on demand by the
108
+ `agy` CLI and the IDE alike.
106
109
 
107
110
  Skills follow the same curation as tools: a guide is surfaced only when
108
111
  its toolkit is active, and you toggle a single one with the activation
@@ -187,7 +190,7 @@ Full reference with all flags: <https://toolbase-ai.com/docs/reference/commands>
187
190
  | `tb list` | Installed toolkits (`-v` for a per-tool view) |
188
191
  | `tb activate ITEM` | Expose a toolkit / `toolkit/bundle` / `toolkit__tool` / `toolkit__skill` (project-local; `-g` for user-wide) |
189
192
  | `tb deactivate ITEM` | Hide a toolkit / bundle / tool / skill |
190
- | `tb connect HARNESS` | Wire toolbase into Claude Code, Codex, OpenCode, or scaffold an Orchestral agent script (also surfaces skills; `--no-skills` to skip) |
193
+ | `tb connect HARNESS` | Wire toolbase into Claude Code, Codex, OpenCode, Antigravity, or scaffold an Orchestral agent script (also surfaces skills; `--no-skills` to skip) |
191
194
  | `tb disconnect HARNESS` | Remove toolbase from a harness (and its surfaced skills) |
192
195
  | `tb logs` | Tail the serve log, live |
193
196
  | `tb profile …` | Manage named profiles: `list \| show \| create \| edit \| delete \| set-default \| path \| tools` |
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "toolbase"
7
- version = "0.9.1"
7
+ version = "0.10.0"
8
8
  description = "The community registry and CLI for AI agent toolkits - discover, share, and serve tools to AI agents over MCP"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -4145,7 +4145,7 @@ def _note_skills_available(name: str, slot: Path, no_skills: bool = False) -> No
4145
4145
  if not no_skills:
4146
4146
  console.print(
4147
4147
  "[dim]Surface them with [/dim][cyan]tb connect <harness>[/cyan]"
4148
- "[dim] (claude-code, codex, opencode); toggle one with [/dim]"
4148
+ "[dim] (claude-code, codex, opencode, antigravity); toggle one with [/dim]"
4149
4149
  "[cyan]tb deactivate <toolkit>__<skill>[/cyan][dim].[/dim]"
4150
4150
  )
4151
4151
 
@@ -7025,14 +7025,15 @@ def connect(harness, global_scope, local_scope, profile_name, remove, dry_run,
7025
7025
  """Wire toolbase into an agent harness.
7026
7026
 
7027
7027
  \b
7028
- Claude Code, Codex, and OpenCode are MCP clients: this writes a server entry
7029
- into the harness's config. Orchestral is a Python library, not a config-file
7030
- harness, so it writes a runnable agent script you launch yourself.
7028
+ Claude Code, Codex, OpenCode, and Antigravity are MCP clients: this writes a
7029
+ server entry into the harness's config. Orchestral is a Python library, not a
7030
+ config-file harness, so it writes a runnable agent script you launch yourself.
7031
7031
 
7032
7032
  \b
7033
7033
  Examples:
7034
7034
  tb connect claude-code # project: .mcp.json here (default)
7035
7035
  tb connect claude-code -g # user: ~/.claude.json (every session)
7036
+ tb connect antigravity -g # agy CLI + IDE: ~/.gemini/config/
7036
7037
  tb connect claude-code --profile paper
7037
7038
  tb connect claude-code --remove
7038
7039
  tb connect orchestral # write .toolbase/agent.py
@@ -7618,10 +7619,10 @@ def create_tarball(source_dir: Path, output_path: Path, toolkit_name: str):
7618
7619
 
7619
7620
  Excludes build/VCS/editor cruft AND consumer-side state that a dir
7620
7621
  accumulates when it doubles as a place you install/serve the toolkit
7621
- from: .toolbase/ (manifest, profiles, project config), .mcp.json and
7622
- .codex/ (harness wiring with machine-specific paths), and .claude/
7623
- (local agent settings). Publishing those would leak local state and
7624
- absolute paths into the public package.
7622
+ from: .toolbase/ (manifest, profiles, project config), .mcp.json,
7623
+ .codex/ and .agents/ (harness wiring with machine-specific paths), and
7624
+ .claude/ (local agent settings). Publishing those would leak local
7625
+ state and absolute paths into the public package.
7625
7626
 
7626
7627
  Args:
7627
7628
  source_dir: Source directory to package
@@ -7634,7 +7635,8 @@ def create_tarball(source_dir: Path, output_path: Path, toolkit_name: str):
7634
7635
  '.egg-info', 'dist', 'build', '.tox', 'htmlcov',
7635
7636
  '.coverage', '.env', '.vscode', '.idea',
7636
7637
  # Consumer/harness state — never part of the published toolkit.
7637
- '.toolbase', '.mcp.json', '.claude', '.codex', 'node_modules',
7638
+ '.toolbase', '.mcp.json', '.claude', '.codex', '.agents',
7639
+ 'node_modules',
7638
7640
  }
7639
7641
 
7640
7642
  def should_exclude(path: Path) -> bool:
@@ -3,7 +3,8 @@ agent harness so the user never copy-pastes config by hand.
3
3
 
4
4
  Two shapes of harness:
5
5
 
6
- - **Config-file harnesses** (Claude Code writes JSON; Codex writes TOML) connect
6
+ - **Config-file harnesses** (Claude Code and Antigravity write JSON; Codex
7
+ writes TOML) connect
7
8
  as MCP clients and get a ``HarnessAdapter`` (see ``base.py``). The adapter
8
9
  knows the harness's config-file location, format, scope vocabulary, and merge
9
10
  rules; the CLI surface is shared.
@@ -18,14 +19,17 @@ from __future__ import annotations
18
19
  from typing import Dict, List
19
20
 
20
21
  from .base import HarnessAdapter, RegistrationEntry, AvailabilityStatus
22
+ from .antigravity import AntigravityAdapter
21
23
  from .claude_code import ClaudeCodeAdapter
22
24
  from .codex import CodexAdapter
23
25
  from .opencode import OpenCodeAdapter
24
26
 
25
27
 
26
28
  # Registry of config-file harness adapters, keyed by the name the user types
27
- # (``tb connect <name>``).
29
+ # (``tb connect <name>``). One Antigravity entry covers the agy CLI, the IDE,
30
+ # and the SDK -- they share a config file.
28
31
  _ADAPTERS: Dict[str, HarnessAdapter] = {
32
+ "antigravity": AntigravityAdapter(),
29
33
  "claude-code": ClaudeCodeAdapter(),
30
34
  "codex": CodexAdapter(),
31
35
  "opencode": OpenCodeAdapter(),
@@ -49,6 +53,7 @@ __all__ = [
49
53
  "HarnessAdapter",
50
54
  "RegistrationEntry",
51
55
  "AvailabilityStatus",
56
+ "AntigravityAdapter",
52
57
  "ClaudeCodeAdapter",
53
58
  "CodexAdapter",
54
59
  "OpenCodeAdapter",
@@ -0,0 +1,242 @@
1
+ """Antigravity adapter for ``tb connect``.
2
+
3
+ Google's Antigravity keeps *one* MCP config shared by the ``agy`` CLI, the
4
+ Antigravity IDE, and the SDK, so a single adapter wires all three.
5
+
6
+ Config lives at a **customization root** — the directory that holds
7
+ ``mcp_config.json``, ``skills/``, ``rules/``, ``plugins/`` and ``hooks.json``.
8
+ There are two roots, which is our scope map:
9
+
10
+ - ``user`` -> ``~/.gemini/config/mcp_config.json`` (global root)
11
+ - ``project`` -> ``<root>/.agents/mcp_config.json`` (workspace root)
12
+
13
+ The entry is a stdio MCP server under the top-level ``mcpServers`` key::
14
+
15
+ {
16
+ "mcpServers": {
17
+ "toolbase": {
18
+ "command": "toolbase",
19
+ "args": ["serve"]
20
+ }
21
+ }
22
+ }
23
+
24
+ Two Antigravity-specific wrinkles:
25
+
26
+ - The IDE creates ``~/.gemini/config/mcp_config.json`` as a **zero-byte file**.
27
+ An empty (or whitespace-only) file is read as ``{}`` rather than refused, so
28
+ a first connect on a fresh install just works.
29
+ - Workspace scope is honored by the IDE and the SDK, but the CLI currently
30
+ discovers and then *ignores* a workspace ``mcp_config.json``
31
+ (google-antigravity/antigravity-cli#60), hence ``project_scope_note``.
32
+
33
+ Writes are a non-destructive merge (only the toolbase entry under
34
+ ``mcpServers`` is touched) and atomic (tmp file + rename). Malformed existing
35
+ JSON is refused rather than clobbered.
36
+ """
37
+
38
+ from __future__ import annotations
39
+
40
+ import json
41
+ import os
42
+ import shutil
43
+ from pathlib import Path
44
+ from typing import Dict, List, Optional
45
+
46
+ from .base import (
47
+ AvailabilityStatus, HarnessAdapter, HarnessConfigError, RegistrationEntry,
48
+ )
49
+
50
+ # Workspace customization root, relative to the project root.
51
+ WORKSPACE_ROOT_DIR = ".agents"
52
+ _CONFIG_NAME = "mcp_config.json"
53
+
54
+
55
+ class AntigravityConfigError(HarnessConfigError):
56
+ """Existing Antigravity config is unreadable / malformed."""
57
+
58
+
59
+ def _global_root() -> Path:
60
+ """The global customization root, ``~/.gemini/config``."""
61
+ return Path.home() / ".gemini" / "config"
62
+
63
+
64
+ class AntigravityAdapter(HarnessAdapter):
65
+ name = "antigravity"
66
+
67
+ def project_scope_note(self) -> str:
68
+ return (
69
+ "the Antigravity IDE and SDK read a workspace .agents/mcp_config.json, "
70
+ "but the agy CLI currently ignores it (upstream bug) — use "
71
+ "`tb connect antigravity -g` if you're on the CLI."
72
+ )
73
+
74
+ # ── detection ────────────────────────────────────────────────────
75
+
76
+ def is_available(self) -> AvailabilityStatus:
77
+ if shutil.which("agy"):
78
+ return AvailabilityStatus(True, "agy CLI found on PATH")
79
+ # ~/.gemini alone means the Gemini CLI, not Antigravity -- key on the
80
+ # customization root and Antigravity's own state dirs instead.
81
+ if (_global_root() / _CONFIG_NAME).exists():
82
+ return AvailabilityStatus(True, "found ~/.gemini/config/mcp_config.json")
83
+ gemini = Path.home() / ".gemini"
84
+ for d in ("antigravity", "antigravity-cli", "antigravity-ide"):
85
+ if (gemini / d).exists():
86
+ return AvailabilityStatus(True, f"found ~/.gemini/{d}")
87
+ return AvailabilityStatus(
88
+ False, "no `agy` CLI on PATH and no ~/.gemini/config"
89
+ )
90
+
91
+ def supported_scopes(self) -> Dict[str, str]:
92
+ return {"user": "global", "project": "workspace"}
93
+
94
+ def skill_target(self):
95
+ # ~/.gemini/config/skills/<toolkit>__<skill>/SKILL.md -- Antigravity's
96
+ # native skill layout is Claude Code's: a directory per skill holding a
97
+ # SKILL.md with name+description frontmatter, loaded on demand. Skills
98
+ # sit in the customization root next to mcp_config.json; we use the
99
+ # global root, matching the other harnesses' user-global surfacing.
100
+ from ..skills import SkillTarget
101
+ return SkillTarget(
102
+ harness=self.name, root=_global_root() / "skills",
103
+ layout="dir", keep_frontmatter=True,
104
+ )
105
+
106
+ # ── paths ────────────────────────────────────────────────────────
107
+
108
+ def config_path(self, scope: str, project_root: Optional[Path]) -> Path:
109
+ if scope == "user":
110
+ return _global_root() / _CONFIG_NAME
111
+ if scope == "project":
112
+ if project_root is None:
113
+ raise ValueError("project scope requires a project_root")
114
+ return project_root / WORKSPACE_ROOT_DIR / _CONFIG_NAME
115
+ raise ValueError(f"unknown scope {scope!r}")
116
+
117
+ # ── read / write ─────────────────────────────────────────────────
118
+
119
+ @staticmethod
120
+ def _read(path: Path) -> dict:
121
+ if not path.exists():
122
+ return {}
123
+ text = path.read_text(encoding="utf-8")
124
+ # The IDE ships a zero-byte mcp_config.json; that's an empty config,
125
+ # not a malformed one.
126
+ if not text.strip():
127
+ return {}
128
+ try:
129
+ data = json.loads(text)
130
+ except json.JSONDecodeError as e:
131
+ hint = ""
132
+ if "//" in text or "/*" in text:
133
+ hint = (
134
+ " Antigravity's mcp_config.json doesn't support comments — "
135
+ "remove them and re-run."
136
+ )
137
+ raise AntigravityConfigError(
138
+ f"{path} is not valid JSON ({e}); refusing to overwrite.{hint}"
139
+ ) from e
140
+ if not isinstance(data, dict):
141
+ raise AntigravityConfigError(
142
+ f"{path} must be a JSON object at the top level."
143
+ )
144
+ return data
145
+
146
+ @staticmethod
147
+ def _write_atomic(path: Path, data: dict) -> None:
148
+ path.parent.mkdir(parents=True, exist_ok=True)
149
+ tmp = path.with_suffix(path.suffix + ".tmp")
150
+ with open(tmp, "w", encoding="utf-8") as f:
151
+ json.dump(data, f, indent=2, sort_keys=False)
152
+ f.write("\n")
153
+ f.flush()
154
+ os.fsync(f.fileno())
155
+ os.replace(tmp, path)
156
+
157
+ @staticmethod
158
+ def _entry(command: str, args: List[str], env: Optional[Dict[str, str]]) -> dict:
159
+ entry: dict = {"command": command, "args": list(args)}
160
+ if env:
161
+ entry["env"] = dict(env)
162
+ return entry
163
+
164
+ # ── install / uninstall ──────────────────────────────────────────
165
+
166
+ def install(
167
+ self,
168
+ *,
169
+ scope: str,
170
+ project_root: Optional[Path],
171
+ server_name: str,
172
+ command: str,
173
+ args: List[str],
174
+ env: Optional[Dict[str, str]] = None,
175
+ dry_run: bool = False,
176
+ ) -> Path:
177
+ path = self.config_path(scope, project_root)
178
+ data = self._read(path)
179
+ servers = data.get("mcpServers")
180
+ if servers is None:
181
+ servers = {}
182
+ elif not isinstance(servers, dict):
183
+ raise AntigravityConfigError(
184
+ f"{path}: 'mcpServers' must be a JSON object."
185
+ )
186
+ servers[server_name] = self._entry(command, args, env)
187
+ data["mcpServers"] = servers
188
+ if not dry_run:
189
+ self._write_atomic(path, data)
190
+ return path
191
+
192
+ def uninstall(
193
+ self,
194
+ *,
195
+ scope: str,
196
+ project_root: Optional[Path],
197
+ server_name: str,
198
+ ) -> bool:
199
+ path = self.config_path(scope, project_root)
200
+ if not path.exists():
201
+ return False
202
+ data = self._read(path)
203
+ servers = data.get("mcpServers")
204
+ if not isinstance(servers, dict) or server_name not in servers:
205
+ return False
206
+ del servers[server_name]
207
+ # Leave an empty mcpServers object rather than reshaping the file.
208
+ data["mcpServers"] = servers
209
+ self._write_atomic(path, data)
210
+ return True
211
+
212
+ # ── status ───────────────────────────────────────────────────────
213
+
214
+ def status(self, project_root: Optional[Path]) -> List[RegistrationEntry]:
215
+ out: List[RegistrationEntry] = []
216
+ scopes = [("user", None)]
217
+ if project_root is not None:
218
+ scopes.append(("project", project_root))
219
+ for scope, root in scopes:
220
+ path = self.config_path(scope, root)
221
+ present = False
222
+ command = ""
223
+ args: Optional[List[str]] = None
224
+ if path.exists():
225
+ try:
226
+ data = self._read(path)
227
+ except AntigravityConfigError:
228
+ data = {}
229
+ servers = data.get("mcpServers")
230
+ if isinstance(servers, dict) and "toolbase" in servers:
231
+ entry = servers["toolbase"]
232
+ if isinstance(entry, dict):
233
+ present = True
234
+ command = str(entry.get("command", ""))
235
+ raw = entry.get("args")
236
+ if isinstance(raw, list):
237
+ args = [str(a) for a in raw]
238
+ out.append(RegistrationEntry(
239
+ harness=self.name, scope=scope, path=path,
240
+ present=present, command=command, args=args,
241
+ ))
242
+ return out
@@ -11,6 +11,7 @@ expects.
11
11
  Two layouts, one per supported harness:
12
12
 
13
13
  Claude Code (dir) ~/.claude/skills/<toolkit>__<skill>/SKILL.md
14
+ Antigravity (dir) ~/.gemini/config/skills/<toolkit>__<skill>/SKILL.md
14
15
  Codex (flat) ~/.codex/prompts/<toolkit>__<skill>.md
15
16
 
16
17
  Claude Code watches its dir and both auto-surfaces each skill to the model
@@ -20,6 +20,7 @@ toolbase/toolkit.py
20
20
  toolbase/validation.py
21
21
  toolbase/versioning.py
22
22
  toolbase/connect/__init__.py
23
+ toolbase/connect/antigravity.py
23
24
  toolbase/connect/base.py
24
25
  toolbase/connect/claude_code.py
25
26
  toolbase/connect/codex.py
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes