antigravity-autopilot 1.4.1 → 1.4.3
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/.github/workflows/release.yml +50 -0
- package/README.md +1 -1
- package/cli.js +42 -1
- package/package.json +1 -1
- package/patcher.js +41 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
release:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Setup Node.js
|
|
19
|
+
uses: actions/setup-node@v4
|
|
20
|
+
with:
|
|
21
|
+
node-version: '20'
|
|
22
|
+
|
|
23
|
+
- name: Install vsce
|
|
24
|
+
run: npm install -g @vscode/vsce
|
|
25
|
+
|
|
26
|
+
- name: Build VSIX
|
|
27
|
+
run: |
|
|
28
|
+
VERSION=${GITHUB_REF_NAME#v}
|
|
29
|
+
vsce package --no-dependencies -o "antigravity-autopilot-${VERSION}.vsix"
|
|
30
|
+
|
|
31
|
+
- name: Create GitHub Release
|
|
32
|
+
uses: softprops/action-gh-release@v2
|
|
33
|
+
with:
|
|
34
|
+
files: '*.vsix'
|
|
35
|
+
generate_release_notes: true
|
|
36
|
+
body: |
|
|
37
|
+
## Antigravity AutoPilot ${{ github.ref_name }}
|
|
38
|
+
|
|
39
|
+
### Install
|
|
40
|
+
|
|
41
|
+
**CLI (npm):**
|
|
42
|
+
```bash
|
|
43
|
+
npm i -g antigravity-autopilot
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**VS Code Extension:**
|
|
47
|
+
Download the `.vsix` file below and install:
|
|
48
|
+
```bash
|
|
49
|
+
antigravity --install-extension antigravity-autopilot-*.vsix
|
|
50
|
+
```
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Antigravity AutoPilot
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
<img src="icon.png" width="128" alt="Antigravity AutoPilot Logo">
|
|
4
|
+
<img src="https://raw.githubusercontent.com/nguyenhx2/Antigravity-AutoPilot/master/icon.png" width="128" alt="Antigravity AutoPilot Logo">
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
> Automatically execute all tool calls and terminal commands in Antigravity — no manual confirmation needed.
|
package/cli.js
CHANGED
|
@@ -103,30 +103,71 @@ function section(title, icon) {
|
|
|
103
103
|
|
|
104
104
|
// ─── Installation Detection ───────────────────────────────────────────────────
|
|
105
105
|
|
|
106
|
+
function resolveFromBinary() {
|
|
107
|
+
try {
|
|
108
|
+
const { execFileSync } = require('child_process');
|
|
109
|
+
const cmd = process.platform === 'win32' ? 'where' : 'which';
|
|
110
|
+
const binPath = execFileSync(cmd, ['antigravity'], { encoding: 'utf8', timeout: 5000 }).trim().split('\n')[0].trim();
|
|
111
|
+
if (!binPath) return null;
|
|
112
|
+
const realBin = fs.realpathSync(binPath);
|
|
113
|
+
// Binary is typically at <installDir>/bin/antigravity or <installDir>/antigravity
|
|
114
|
+
let dir = path.dirname(realBin);
|
|
115
|
+
// Walk up to find the directory containing 'resources/app'
|
|
116
|
+
for (let i = 0; i < 5; i++) {
|
|
117
|
+
const check = path.join(dir, 'resources', 'app', 'out', 'vs', 'workbench', 'workbench.desktop.main.js');
|
|
118
|
+
if (fs.existsSync(check)) return dir;
|
|
119
|
+
const parent = path.dirname(dir);
|
|
120
|
+
if (parent === dir) break;
|
|
121
|
+
dir = parent;
|
|
122
|
+
}
|
|
123
|
+
} catch { /* binary not in PATH or not installed */ }
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
|
|
106
127
|
function findAntigravityPath() {
|
|
107
128
|
const candidates = [];
|
|
108
129
|
if (process.platform === 'win32') {
|
|
109
130
|
candidates.push(
|
|
110
131
|
path.join(process.env.LOCALAPPDATA || '', 'Programs', 'Antigravity'),
|
|
111
132
|
path.join(process.env.PROGRAMFILES || '', 'Antigravity'),
|
|
133
|
+
path.join(process.env['PROGRAMFILES(X86)'] || '', 'Antigravity'),
|
|
112
134
|
);
|
|
113
135
|
} else if (process.platform === 'darwin') {
|
|
114
136
|
candidates.push(
|
|
115
137
|
'/Applications/Antigravity.app/Contents/Resources',
|
|
116
138
|
path.join(os.homedir(), 'Applications', 'Antigravity.app', 'Contents', 'Resources'),
|
|
139
|
+
// Homebrew cask installs
|
|
140
|
+
'/opt/homebrew/Caskroom/antigravity',
|
|
117
141
|
);
|
|
142
|
+
// Dynamically scan Homebrew cask versions
|
|
143
|
+
try {
|
|
144
|
+
const caskDir = '/opt/homebrew/Caskroom/antigravity';
|
|
145
|
+
if (fs.existsSync(caskDir)) {
|
|
146
|
+
const versions = fs.readdirSync(caskDir).filter(v => v !== '.metadata');
|
|
147
|
+
for (const v of versions) {
|
|
148
|
+
candidates.push(path.join(caskDir, v, 'Antigravity.app', 'Contents', 'Resources'));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
} catch { /* ignore */ }
|
|
118
152
|
} else {
|
|
119
153
|
candidates.push(
|
|
120
154
|
'/usr/share/antigravity',
|
|
155
|
+
'/usr/lib/antigravity',
|
|
121
156
|
'/opt/antigravity',
|
|
122
157
|
path.join(os.homedir(), '.local', 'share', 'antigravity'),
|
|
158
|
+
// Snap install
|
|
159
|
+
'/snap/antigravity/current',
|
|
160
|
+
// Flatpak install
|
|
161
|
+
'/var/lib/flatpak/app/com.antigravity.Antigravity/current/active/files',
|
|
162
|
+
path.join(os.homedir(), '.local', 'share', 'flatpak', 'app', 'com.antigravity.Antigravity', 'current', 'active', 'files'),
|
|
123
163
|
);
|
|
124
164
|
}
|
|
125
165
|
for (const c of candidates) {
|
|
126
166
|
const f = path.join(c, 'resources', 'app', 'out', 'vs', 'workbench', 'workbench.desktop.main.js');
|
|
127
167
|
if (fs.existsSync(f)) return c;
|
|
128
168
|
}
|
|
129
|
-
|
|
169
|
+
// Fallback: resolve from the antigravity binary in PATH
|
|
170
|
+
return resolveFromBinary();
|
|
130
171
|
}
|
|
131
172
|
|
|
132
173
|
function getTargetFiles(basePath) {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "antigravity-autopilot",
|
|
3
3
|
"displayName": "Antigravity AutoPilot",
|
|
4
4
|
"description": "Enables autopilot mode for Antigravity: automatically executes all tool calls and terminal commands without manual confirmation. Patches the runtime JS bundle to inject auto-accept logic whenever the 'Always Proceed' policy is active — regex-based and version-agnostic.",
|
|
5
|
-
"version": "1.4.
|
|
5
|
+
"version": "1.4.3",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"publisher": "nguyen-hoang",
|
|
8
8
|
"bin": {
|
package/patcher.js
CHANGED
|
@@ -8,6 +8,27 @@ const os = require('os');
|
|
|
8
8
|
|
|
9
9
|
// ─── Installation Detection ──────────────────────────────────────────────────
|
|
10
10
|
|
|
11
|
+
function resolveFromBinary() {
|
|
12
|
+
try {
|
|
13
|
+
const { execFileSync } = require('child_process');
|
|
14
|
+
const cmd = process.platform === 'win32' ? 'where' : 'which';
|
|
15
|
+
const binPath = execFileSync(cmd, ['antigravity'], { encoding: 'utf8', timeout: 5000 }).trim().split('\n')[0].trim();
|
|
16
|
+
if (!binPath) return null;
|
|
17
|
+
const realBin = fs.realpathSync(binPath);
|
|
18
|
+
// Binary is typically at <installDir>/bin/antigravity or <installDir>/antigravity
|
|
19
|
+
let dir = path.dirname(realBin);
|
|
20
|
+
// Walk up to find the directory containing 'resources/app'
|
|
21
|
+
for (let i = 0; i < 5; i++) {
|
|
22
|
+
const check = path.join(dir, 'resources', 'app', 'out', 'vs', 'workbench', 'workbench.desktop.main.js');
|
|
23
|
+
if (fs.existsSync(check)) return dir;
|
|
24
|
+
const parent = path.dirname(dir);
|
|
25
|
+
if (parent === dir) break;
|
|
26
|
+
dir = parent;
|
|
27
|
+
}
|
|
28
|
+
} catch { /* binary not in PATH or not installed */ }
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
11
32
|
function findAntigravityPath() {
|
|
12
33
|
const candidates = [];
|
|
13
34
|
if (process.platform === 'win32') {
|
|
@@ -20,19 +41,38 @@ function findAntigravityPath() {
|
|
|
20
41
|
candidates.push(
|
|
21
42
|
'/Applications/Antigravity.app/Contents/Resources',
|
|
22
43
|
path.join(os.homedir(), 'Applications', 'Antigravity.app', 'Contents', 'Resources'),
|
|
44
|
+
// Homebrew cask installs
|
|
45
|
+
'/opt/homebrew/Caskroom/antigravity',
|
|
23
46
|
);
|
|
47
|
+
// Dynamically scan Homebrew cask versions
|
|
48
|
+
try {
|
|
49
|
+
const caskDir = '/opt/homebrew/Caskroom/antigravity';
|
|
50
|
+
if (fs.existsSync(caskDir)) {
|
|
51
|
+
const versions = fs.readdirSync(caskDir).filter(v => v !== '.metadata');
|
|
52
|
+
for (const v of versions) {
|
|
53
|
+
candidates.push(path.join(caskDir, v, 'Antigravity.app', 'Contents', 'Resources'));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
} catch { /* ignore */ }
|
|
24
57
|
} else {
|
|
25
58
|
candidates.push(
|
|
26
59
|
'/usr/share/antigravity',
|
|
60
|
+
'/usr/lib/antigravity',
|
|
27
61
|
'/opt/antigravity',
|
|
28
62
|
path.join(os.homedir(), '.local', 'share', 'antigravity'),
|
|
63
|
+
// Snap install
|
|
64
|
+
'/snap/antigravity/current',
|
|
65
|
+
// Flatpak install
|
|
66
|
+
'/var/lib/flatpak/app/com.antigravity.Antigravity/current/active/files',
|
|
67
|
+
path.join(os.homedir(), '.local', 'share', 'flatpak', 'app', 'com.antigravity.Antigravity', 'current', 'active', 'files'),
|
|
29
68
|
);
|
|
30
69
|
}
|
|
31
70
|
for (const c of candidates) {
|
|
32
71
|
const f = path.join(c, 'resources', 'app', 'out', 'vs', 'workbench', 'workbench.desktop.main.js');
|
|
33
72
|
if (fs.existsSync(f)) return c;
|
|
34
73
|
}
|
|
35
|
-
|
|
74
|
+
// Fallback: resolve from the antigravity binary in PATH
|
|
75
|
+
return resolveFromBinary();
|
|
36
76
|
}
|
|
37
77
|
|
|
38
78
|
function getTargetFiles(basePath) {
|