Skip to content

feat(antigravity): add cross-platform Windows support for agy CLI and Antigravity 2.0 - #184

Open
Joy Mondal (Equlient-Joy) wants to merge 1 commit into
microsoft:mainfrom
Equlient-Joy:feat/antigravity-crossplatform-windows
Open

Joy Mondal (Equlient-Joy) wants to merge 1 commit into
microsoft:mainfrom
Equlient-Joy:feat/antigravity-crossplatform-windows

Conversation

@Equlient-Joy

Copy link
Copy Markdown

Extends the experimental antigravity host adapter (#147) with full cross-platform Windows support and compatibility with Antigravity 2.0.

Background & Motivation

In #147, the Antigravity CLI host was introduced with a limitation noting "macOS and Linux only: on Windows agy runs hook commands through cmd /c, and this plugin's launcher is a POSIX shell script." On Windows machines, cmd.exe fails to run ./scripts/te-hook, preventing hook execution. Additionally, Antigravity 2.0 native tool signatures (write_file and edit_file with parameter Path) were unmapped.

Key Changes

  1. Windows Launchers (plugin/scripts/te-hook.cmd & te.cmd):
    • Implemented native Windows batch launchers matching the te-hook and te shell scripts.
    • Includes dynamic Python 3 discovery: checks TE_PYTHON, searches PATH for python.exe / py.exe (skipping non-functional WindowsApps stubs), and fails open ({}) on errors.
  2. Cross-Platform plugin/hooks.json:
    • Updated hook execution to run scripts\te-hook.cmd ... 2>nul || ./scripts/te-hook ..., allowing transparent execution under both Windows (cmd.exe /c) and Unix (sh -c).
  3. Antigravity 2.0 Tool Vocabulary:
    • Added native mappings for write_file and edit_file in tokeneconomizer/trace/antigravity.py to correctly track file writes and edits as Write and Edit actions.
  4. Host Detection:
    • Improved detect() in tokeneconomizer/plugin/hosts.py to identify both antigravity (Desktop) and antigravity-cli.
  5. Testing & Documentation:
    • Extended tests/test_antigravity.py with tests for modern Antigravity tools and launcher script presence.
    • Updated README.md, plugin/README.md, and docs/PLUGIN.md to reflect cross-platform support.

Verification

  • python -m pytest tests/test_antigravity.py tests/test_plugin_package.py: 53 passed, 3 skipped.
  • Live verified on Windows with both agy CLI and Antigravity 2.0.

… Antigravity 2.0

Add Windows batch hook and CLI launchers (plugin/scripts/te-hook.cmd, te.cmd) to support cmd.exe /c execution. Update plugin/hooks.json to execute cleanly across Windows, macOS, and Linux. Add support for Antigravity 2.0 native tool signatures (write_file, edit_file) and document universal cross-platform support.
Copilot AI balanced review requested due to automatic review settings November 9, 2026 14:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@Equlient-Joy

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@aaron-jx-li Aaron Li (aaron-jx-li) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. This PR needs a bit of refinements before it can be merged:

  1. plugin/hooks.json is what agy runs on macOS and Linux too, through sh -c. There, scripts\te-hook.cmd becomes scriptste-hook.cmd, which is not found, and 2>nul writes a file named nul into the plugin directory on every hook call. One option to try (we haven't tested it on Windows): put the POSIX launcher first (./scripts/te-hook … || scripts\te-hook.cmd …). te-hook fails open with exit 0, so sh never reaches the Windows half.
  2. In both .cmd files, every exit /b %ERRORLEVEL% sits inside a ( … ) block. cmd expands it when it reads the block, before Python runs, so the launcher always exits 0. Please use setlocal EnableDelayedExpansion with !ERRORLEVEL!, or move the call out of the block.
  3. Please have the Windows launcher pick the first Python >= 3.10, as #194 does for POSIX.
  4. Please keep the docs to what was tested: the agy version and Windows version you ran, and no "dual .cmd/.sh launchers" (there is no .sh launcher). The docs also still send Windows users to ~/.tokeneconomizer/bin/te, which is a /bin/sh script.
  5. Please move the Antigravity 2.0 parts (write_file/edit_file, the product detection) to a separate PR, with a redacted real transcript showing those tool names. Nothing in the repo shows them yet, and the product branch never runs because hooks.json always passes --host antigravity.
  6. Please mark the .cmd files eol=crlf in .gitattributes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants