antigravity-autopilot 1.4.10 → 1.4.12

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/README.md CHANGED
@@ -105,7 +105,7 @@ Install the extension directly into Antigravity for a UI-based experience (sideb
105
105
 
106
106
  ```bash
107
107
  # Download .vsix from GitHub Releases, then:
108
- antigravity --install-extension antigravity-autopilot-1.4.8.vsix
108
+ antigravity --install-extension antigravity-autopilot-1.4.12.vsix
109
109
  ```
110
110
 
111
111
  **Extension features:**
package/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * Antigravity AutoPilot — CLI v1.4.0
4
+ * Antigravity AutoPilot — CLI v1.4.12
5
5
  * ====================================
6
6
  * npx antigravity-autopilot Apply all patches
7
7
  * npx antigravity-autopilot --only terminal Patch terminal only
@@ -17,6 +17,7 @@
17
17
  const fs = require('fs');
18
18
  const path = require('path');
19
19
  const os = require('os');
20
+ const crypto = require('crypto');
20
21
 
21
22
  // ─── ANSI Colors (auto-disable when not a TTY) ───────────────────────────────
22
23
 
@@ -195,6 +196,54 @@ function getVersion(basePath) {
195
196
  } catch { return 'unknown'; }
196
197
  }
197
198
 
199
+ // ─── Checksum Update ─────────────────────────────────────────────────────────
200
+
201
+ /**
202
+ * Map from getTargetFiles label to the checksum key used in product.json.
203
+ * product.json stores checksums relative to resources/app/out/.
204
+ */
205
+ const CHECKSUM_KEY_MAP = {
206
+ workbench: 'vs/workbench/workbench.desktop.main.js',
207
+ jetskiAgent: 'jetskiAgent/main.js',
208
+ };
209
+
210
+ /**
211
+ * Recalculates SHA-256 Base64 checksums for the target files and writes
212
+ * them back into product.json so the "jes" integrity service no longer
213
+ * flags the installation as corrupt.
214
+ */
215
+ function updateProductChecksums(basePath, files) {
216
+ const productPath = path.join(basePath, 'resources', 'app', 'product.json');
217
+ try {
218
+ const product = JSON.parse(fs.readFileSync(productPath, 'utf8'));
219
+ if (!product.checksums || typeof product.checksums !== 'object') {
220
+ row('⊘', c.gray, '[checksums]', 'No checksums object in product.json — skipping');
221
+ return;
222
+ }
223
+
224
+ let updated = 0;
225
+ for (const { filePath, label } of files) {
226
+ const key = CHECKSUM_KEY_MAP[label];
227
+ if (!key || !product.checksums.hasOwnProperty(key)) continue;
228
+ if (!fs.existsSync(filePath)) continue;
229
+
230
+ const content = fs.readFileSync(filePath);
231
+ const hash = crypto.createHash('sha256').update(content).digest('base64');
232
+ product.checksums[key] = hash;
233
+ updated++;
234
+ }
235
+
236
+ if (updated > 0) {
237
+ fs.writeFileSync(productPath, JSON.stringify(product, null, '\t'), 'utf8');
238
+ row('✔', c.green, '[checksums]', `Updated ${updated} checksum(s) in product.json`);
239
+ } else {
240
+ row('⊘', c.gray, '[checksums]', 'No matching checksum keys found — skipping');
241
+ }
242
+ } catch (err) {
243
+ row('⊘', c.yellow, '[checksums]', `Could not update checksums: ${err.message}`);
244
+ }
245
+ }
246
+
198
247
  // ─── Analyze: Terminal Auto-Execute ───────────────────────────────────────────
199
248
 
200
249
  function analyzeTerminal(content) {
@@ -237,7 +286,7 @@ function analyzeTerminal(content) {
237
286
  }
238
287
  if (!useEffectAlias) return null;
239
288
 
240
- const patchCode = `_aep=${useEffectAlias}(()=>{${policyVar}===${enumAlias}.EAGER&&!${secureVar}&&${confirmFn}(!0)},[]),`;
289
+ const patchCode = `_aep=${useEffectAlias}(()=>{${policyVar}===${enumAlias}.EAGER&&!${secureVar}&&${confirmFn}(!0)},[])`;
241
290
  return {
242
291
  target: fullMatch,
243
292
  replacement: fullMatch + ',' + patchCode,
@@ -280,7 +329,7 @@ function analyzeBrowser(content) {
280
329
  }
281
330
  if (!useEffectAlias) return null;
282
331
 
283
- const patchCode = `_abp=${useEffectAlias}(()=>{${confirmVar}()},[${confirmVar}]),`;
332
+ const patchCode = `_abp=${useEffectAlias}(()=>{${confirmVar}()},[${confirmVar}])`;
284
333
  return {
285
334
  target: fullMatch,
286
335
  replacement: fullMatch + ',' + patchCode,
@@ -329,7 +378,7 @@ function analyzeFile_(content) {
329
378
  }
330
379
  if (!useEffectAlias) return null;
331
380
 
332
- const patchCode = `_afp=${useEffectAlias}(()=>{${senderVar}(!0,${scopeEnum}.CONVERSATION)},[${senderVar}]),`;
381
+ const patchCode = `_afp=${useEffectAlias}(()=>{${senderVar}(!0,${scopeEnum}.CONVERSATION)},[${senderVar}])`;
333
382
  return {
334
383
  target: fullMatch,
335
384
  replacement: fullMatch + ',' + patchCode,
@@ -527,6 +576,7 @@ function main() {
527
576
  section('Reverting Patch', '↩');
528
577
  console.log('');
529
578
  files.forEach(f => revertFile(f.filePath, f.label));
579
+ updateProductChecksums(basePath, files);
530
580
  console.log('');
531
581
  console.log(' ' + c.green + c.bold + '✔ Restored!' + c.reset + c.white + ' Restart Antigravity to apply changes.' + c.reset);
532
582
  console.log('');
@@ -539,6 +589,7 @@ function main() {
539
589
  section(`Applying AutoPilot Patch (${typeLabel})`, '⚡');
540
590
  console.log('');
541
591
  const ok = files.every(f => patchFile(f.filePath, f.label, onlyTypes));
592
+ updateProductChecksums(basePath, files);
542
593
  console.log('');
543
594
  if (ok) {
544
595
  console.log(' +' + repeat('-', W - 2) + '+');
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.10",
5
+ "version": "1.4.12",
6
6
  "license": "MIT",
7
7
  "publisher": "nguyenhx2",
8
8
  "bin": {
package/patcher.js CHANGED
@@ -179,7 +179,7 @@ function analyzeFile(content, label) {
179
179
  log(` useEffect=${useEffectAlias} (confidence: ${maxCount} hits)`);
180
180
 
181
181
  // 5. Build patch — exact same logic as original
182
- const patchCode = `_aep=${useEffectAlias}(()=>{${policyVar}===${enumAlias}.EAGER&&!${secureVar}&&${confirmFn}(!0)},[]),`;
182
+ const patchCode = `_aep=${useEffectAlias}(()=>{${policyVar}===${enumAlias}.EAGER&&!${secureVar}&&${confirmFn}(!0)},[])`;
183
183
 
184
184
  return {
185
185
  target: fullMatch,
@@ -250,7 +250,7 @@ function analyzeBrowserAction(content, label) {
250
250
  log(` useEffect=${useEffectAlias} (confidence: ${maxCount} hits)`);
251
251
 
252
252
  // 3. Build patch — auto-call confirmVar() on mount
253
- const patchCode = `_abp=${useEffectAlias}(()=>{${confirmVar}()},[${confirmVar}]),`;
253
+ const patchCode = `_abp=${useEffectAlias}(()=>{${confirmVar}()},[${confirmVar}])`;
254
254
 
255
255
  return {
256
256
  target: fullMatch,
@@ -333,7 +333,7 @@ function analyzeFilePermission(content, label) {
333
333
  log(` useEffect=${useEffectAlias} (confidence: ${maxCount} hits)`);
334
334
 
335
335
  // 4. Build patch — auto-call senderVar(!0, scopeEnum.CONVERSATION) on mount
336
- const patchCode = `_afp=${useEffectAlias}(()=>{${senderVar}(!0,${scopeEnum}.CONVERSATION)},[${senderVar}]),`;
336
+ const patchCode = `_afp=${useEffectAlias}(()=>{${senderVar}(!0,${scopeEnum}.CONVERSATION)},[${senderVar}])`;
337
337
 
338
338
  return {
339
339
  target: fullMatch,