pi-for-antigravity 0.0.0-stage → 0.2.1
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.
- package/LICENSE +21 -0
- package/README.md +111 -2
- package/build/antigravity/LICENSE +21 -0
- package/build/antigravity/README.md +112 -0
- package/build/antigravity/THIRD_PARTY_NOTICES.txt +2298 -0
- package/build/antigravity/assets/logo.png +0 -0
- package/build/antigravity/config.example.json +20 -0
- package/build/antigravity/install.cjs +19962 -0
- package/build/antigravity/mcp_config.json +21 -0
- package/build/antigravity/plugin.json +26 -0
- package/build/antigravity/rules/pi-delegation.md +12 -0
- package/build/antigravity/server.cjs +37417 -0
- package/build/antigravity/zh.md +112 -0
- package/config.example.json +20 -0
- package/dist/config.js +121 -0
- package/dist/index.js +56 -0
- package/dist/install-cli.js +15 -0
- package/dist/install.js +102 -0
- package/dist/pi-launch.js +81 -0
- package/dist/process.js +123 -0
- package/dist/review.js +78 -0
- package/dist/runner.js +107 -0
- package/dist/server.js +38 -0
- package/dist/sessions.js +74 -0
- package/dist/version.js +1 -0
- package/package.json +63 -4
- package/zh.md +112 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jay Shen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,112 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Pi for Antigravity
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<img src="assets/logo.png" alt="Pi for Antigravity logo" width="128" height="128">
|
|
4
|
+
|
|
5
|
+
[English](README.md) · [简体中文](zh.md)
|
|
6
|
+
|
|
7
|
+
Unofficial Antigravity App / CLI plugin and local stdio MCP bridging Antigravity to your **existing local `pi` CLI**.
|
|
8
|
+
|
|
9
|
+
- **`execute`** — delegate broad codebase search, multi-file edits/refactors, tests, and log analysis to `pi`.
|
|
10
|
+
- **`review`** — optional, fresh, read-only code review of working-tree changes against a Git baseline (default `HEAD`) plus untracked files.
|
|
11
|
+
|
|
12
|
+
The main agent keeps planning, coordination, native tools/Browser, and final judgment.
|
|
13
|
+
|
|
14
|
+
```text
|
|
15
|
+
Antigravity → local stdio MCP → local pi CLI → your configured model provider
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Requirements
|
|
19
|
+
|
|
20
|
+
- **Node.js >= 22.19**
|
|
21
|
+
- A working, authenticated local **`pi`** CLI (tested with `pi 1.5.2`). Verify `pi --version` and a normal prompt before installing.
|
|
22
|
+
- **Git** for Git-based reviews (on Windows, Git for Windows also provides Git Bash for `pi`).
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
### Option 1: Official Antigravity CLI (`agy`)
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
agy plugin install https://github.com/shenjiecode/pi-for-antigravity
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Installs directly from GitHub and launches the MCP server via `npx -y pi-for-antigravity@<version>`.
|
|
33
|
+
|
|
34
|
+
### Option 2: npm one-liner (Antigravity App & CLI, pinned Node)
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx pi-for-antigravity install
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Installs a self-contained copy (`server.cjs`) pinned to your local Node executable into `~/.gemini/config/plugins/pi-for-antigravity/` (Windows: `%USERPROFILE%\.gemini\config\plugins\pi-for-antigravity\`). Supports `--config /abs/path/config.json` and `--target /abs/path/plugin-dir`.
|
|
41
|
+
|
|
42
|
+
### Option 3: GitHub Release ZIP (offline / no npm)
|
|
43
|
+
|
|
44
|
+
Download `pi-for-antigravity-<version>.zip` from [Releases](https://github.com/shenjiecode/pi-for-antigravity/releases), extract it, enter `pi-for-antigravity/`, and run:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
node ./install.cjs
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Restart Antigravity App and check **Customizations → Installed**. Update by re-running the installer; personal config is preserved. Disable or uninstall via **Customizations → Installed** or `agy plugin disable|uninstall pi-for-antigravity`.
|
|
51
|
+
|
|
52
|
+
## Configuration
|
|
53
|
+
|
|
54
|
+
In plugin mode, configuration and state live in the host-provided `PLUGIN_DATA` directory:
|
|
55
|
+
|
|
56
|
+
- `${PLUGIN_DATA}/config.json` — initialized from `config.example.json` on first MCP start (edit to pick models configured in your `pi`).
|
|
57
|
+
- `${PLUGIN_DATA}/state/` — session metadata and per-run logs (`runs/` grows over time; prune old run folders as needed).
|
|
58
|
+
|
|
59
|
+
Find the active config path in MCP initialization instructions, startup stderr, or the `config_path` tool result field.
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"pi": { "command": "pi" },
|
|
64
|
+
"stateDir": "./state",
|
|
65
|
+
"roles": {
|
|
66
|
+
"executor": {
|
|
67
|
+
"provider": "zai-coding-cn",
|
|
68
|
+
"model": "glm-5.3-flash",
|
|
69
|
+
"thinking": "high"
|
|
70
|
+
},
|
|
71
|
+
"reviewer": {
|
|
72
|
+
"enabled": true,
|
|
73
|
+
"provider": "zai-coding-cn",
|
|
74
|
+
"model": "glm-5.4",
|
|
75
|
+
"thinking": "high"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
- `pi.command`: command name, native executable, or `.js`/`.mjs`/`.cjs` entry. `pi.agentDir` optionally overrides `PI_CODING_AGENT_DIR`.
|
|
82
|
+
- `roles.<name>`: `provider`, `model`, `thinking`, and optional `prompt`. Set `"reviewer": { "enabled": false }` and reconnect MCP to hide `review`.
|
|
83
|
+
- New calls reload config; resumed executor sessions keep their saved settings.
|
|
84
|
+
- Config precedence: `--config` → `PI_FOR_ANTIGRAVITY_CONFIG` → `${PLUGIN_DATA}/config.json` → standalone default (`~/.config/pi-for-antigravity/config.json` on Linux/macOS; `%APPDATA%\pi-for-antigravity\config.json` on Windows; XDG overrides supported). Relative paths resolve from the config file's directory.
|
|
85
|
+
- **Windows `pi` lookup**: checks `PATH`, `%USERPROFILE%\.pi\agent\bin`, `%APPDATA%\npm`, and Node's directory. Managed `pi-launcher.js` and npm `pi.cmd` shims launch their JS entry directly under Node without `cmd.exe`.
|
|
86
|
+
|
|
87
|
+
## Tools & scope
|
|
88
|
+
|
|
89
|
+
| Tool | Args | Behavior |
|
|
90
|
+
| --- | --- | --- |
|
|
91
|
+
| `execute` | `prompt`, absolute `cwd`, optional `session_id` | Full builtin tools; concurrent sessions share `cwd` (same session rejects overlap). |
|
|
92
|
+
| `review` | `prompt`, absolute `cwd`, optional `base_ref` | Fresh context; read-only tools (`read,grep,find,ls`); includes diff summary and untracked files. |
|
|
93
|
+
|
|
94
|
+
- Both roles run `pi --print --no-extensions --no-mcp` (provider-extension-only models are unsupported).
|
|
95
|
+
- Long results truncate at 24,000 chars inline; full text is saved at `output_path`.
|
|
96
|
+
- Antigravity registers the server as `pi-for-antigravity_pi` with eager loading and host background execution. In headless `agy`, allow tools explicitly via `--settings '{"permissions":{"allow":["mcp(pi-for-antigravity_pi/review)"]}}'`.
|
|
97
|
+
- Scope limits: no bundled `pi`/SDK, no credential/account management, no workflow/retry loops, and no remote/WSL bridge.
|
|
98
|
+
|
|
99
|
+
## Standalone MCP & development
|
|
100
|
+
|
|
101
|
+
Other stdio MCP clients can launch `npx -y pi-for-antigravity --config /abs/path/config.json` directly.
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npm ci
|
|
105
|
+
npm run check # version sync + TypeScript check
|
|
106
|
+
npm test # offline test suite
|
|
107
|
+
npm run validate:agy # validate repo root and bundled plugin via agy CLI
|
|
108
|
+
npm run package:plugin # build portable ZIP + SHA-256
|
|
109
|
+
npm run test:live -- --config /abs/path/config.json # calls real models
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
See [design](docs/design.md), [verification](docs/verification.md), [releasing](docs/releasing.md), and [contributing](CONTRIBUTING.md). Licensed under [MIT](LICENSE).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jay Shen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Pi for Antigravity
|
|
2
|
+
|
|
3
|
+
<img src="assets/logo.png" alt="Pi for Antigravity logo" width="128" height="128">
|
|
4
|
+
|
|
5
|
+
[English](README.md) · [简体中文](zh.md)
|
|
6
|
+
|
|
7
|
+
Unofficial Antigravity App / CLI plugin and local stdio MCP bridging Antigravity to your **existing local `pi` CLI**.
|
|
8
|
+
|
|
9
|
+
- **`execute`** — delegate broad codebase search, multi-file edits/refactors, tests, and log analysis to `pi`.
|
|
10
|
+
- **`review`** — optional, fresh, read-only code review of working-tree changes against a Git baseline (default `HEAD`) plus untracked files.
|
|
11
|
+
|
|
12
|
+
The main agent keeps planning, coordination, native tools/Browser, and final judgment.
|
|
13
|
+
|
|
14
|
+
```text
|
|
15
|
+
Antigravity → local stdio MCP → local pi CLI → your configured model provider
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Requirements
|
|
19
|
+
|
|
20
|
+
- **Node.js >= 22.19**
|
|
21
|
+
- A working, authenticated local **`pi`** CLI (tested with `pi 1.5.2`). Verify `pi --version` and a normal prompt before installing.
|
|
22
|
+
- **Git** for Git-based reviews (on Windows, Git for Windows also provides Git Bash for `pi`).
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
### Option 1: Official Antigravity CLI (`agy`)
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
agy plugin install https://github.com/shenjiecode/pi-for-antigravity
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Installs directly from GitHub and launches the MCP server via `npx -y pi-for-antigravity@<version>`.
|
|
33
|
+
|
|
34
|
+
### Option 2: npm one-liner (Antigravity App & CLI, pinned Node)
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx pi-for-antigravity install
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Installs a self-contained copy (`server.cjs`) pinned to your local Node executable into `~/.gemini/config/plugins/pi-for-antigravity/` (Windows: `%USERPROFILE%\.gemini\config\plugins\pi-for-antigravity\`). Supports `--config /abs/path/config.json` and `--target /abs/path/plugin-dir`.
|
|
41
|
+
|
|
42
|
+
### Option 3: GitHub Release ZIP (offline / no npm)
|
|
43
|
+
|
|
44
|
+
Download `pi-for-antigravity-<version>.zip` from [Releases](https://github.com/shenjiecode/pi-for-antigravity/releases), extract it, enter `pi-for-antigravity/`, and run:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
node ./install.cjs
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Restart Antigravity App and check **Customizations → Installed**. Update by re-running the installer; personal config is preserved. Disable or uninstall via **Customizations → Installed** or `agy plugin disable|uninstall pi-for-antigravity`.
|
|
51
|
+
|
|
52
|
+
## Configuration
|
|
53
|
+
|
|
54
|
+
In plugin mode, configuration and state live in the host-provided `PLUGIN_DATA` directory:
|
|
55
|
+
|
|
56
|
+
- `${PLUGIN_DATA}/config.json` — initialized from `config.example.json` on first MCP start (edit to pick models configured in your `pi`).
|
|
57
|
+
- `${PLUGIN_DATA}/state/` — session metadata and per-run logs (`runs/` grows over time; prune old run folders as needed).
|
|
58
|
+
|
|
59
|
+
Find the active config path in MCP initialization instructions, startup stderr, or the `config_path` tool result field.
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"pi": { "command": "pi" },
|
|
64
|
+
"stateDir": "./state",
|
|
65
|
+
"roles": {
|
|
66
|
+
"executor": {
|
|
67
|
+
"provider": "zai-coding-cn",
|
|
68
|
+
"model": "glm-5.3-flash",
|
|
69
|
+
"thinking": "high"
|
|
70
|
+
},
|
|
71
|
+
"reviewer": {
|
|
72
|
+
"enabled": true,
|
|
73
|
+
"provider": "zai-coding-cn",
|
|
74
|
+
"model": "glm-5.4",
|
|
75
|
+
"thinking": "high"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
- `pi.command`: command name, native executable, or `.js`/`.mjs`/`.cjs` entry. `pi.agentDir` optionally overrides `PI_CODING_AGENT_DIR`.
|
|
82
|
+
- `roles.<name>`: `provider`, `model`, `thinking`, and optional `prompt`. Set `"reviewer": { "enabled": false }` and reconnect MCP to hide `review`.
|
|
83
|
+
- New calls reload config; resumed executor sessions keep their saved settings.
|
|
84
|
+
- Config precedence: `--config` → `PI_FOR_ANTIGRAVITY_CONFIG` → `${PLUGIN_DATA}/config.json` → standalone default (`~/.config/pi-for-antigravity/config.json` on Linux/macOS; `%APPDATA%\pi-for-antigravity\config.json` on Windows; XDG overrides supported). Relative paths resolve from the config file's directory.
|
|
85
|
+
- **Windows `pi` lookup**: checks `PATH`, `%USERPROFILE%\.pi\agent\bin`, `%APPDATA%\npm`, and Node's directory. Managed `pi-launcher.js` and npm `pi.cmd` shims launch their JS entry directly under Node without `cmd.exe`.
|
|
86
|
+
|
|
87
|
+
## Tools & scope
|
|
88
|
+
|
|
89
|
+
| Tool | Args | Behavior |
|
|
90
|
+
| --- | --- | --- |
|
|
91
|
+
| `execute` | `prompt`, absolute `cwd`, optional `session_id` | Full builtin tools; concurrent sessions share `cwd` (same session rejects overlap). |
|
|
92
|
+
| `review` | `prompt`, absolute `cwd`, optional `base_ref` | Fresh context; read-only tools (`read,grep,find,ls`); includes diff summary and untracked files. |
|
|
93
|
+
|
|
94
|
+
- Both roles run `pi --print --no-extensions --no-mcp` (provider-extension-only models are unsupported).
|
|
95
|
+
- Long results truncate at 24,000 chars inline; full text is saved at `output_path`.
|
|
96
|
+
- Antigravity registers the server as `pi-for-antigravity_pi` with eager loading and host background execution. In headless `agy`, allow tools explicitly via `--settings '{"permissions":{"allow":["mcp(pi-for-antigravity_pi/review)"]}}'`.
|
|
97
|
+
- Scope limits: no bundled `pi`/SDK, no credential/account management, no workflow/retry loops, and no remote/WSL bridge.
|
|
98
|
+
|
|
99
|
+
## Standalone MCP & development
|
|
100
|
+
|
|
101
|
+
Other stdio MCP clients can launch `npx -y pi-for-antigravity --config /abs/path/config.json` directly.
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npm ci
|
|
105
|
+
npm run check # version sync + TypeScript check
|
|
106
|
+
npm test # offline test suite
|
|
107
|
+
npm run validate:agy # validate repo root and bundled plugin via agy CLI
|
|
108
|
+
npm run package:plugin # build portable ZIP + SHA-256
|
|
109
|
+
npm run test:live -- --config /abs/path/config.json # calls real models
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
See [design](docs/design.md), [verification](docs/verification.md), [releasing](docs/releasing.md), and [contributing](CONTRIBUTING.md). Licensed under [MIT](LICENSE).
|