@simonyea/holysheep-cli 1.7.87 → 1.7.88

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simonyea/holysheep-cli",
3
- "version": "1.7.87",
3
+ "version": "1.7.88",
4
4
  "description": "Claude Code/Cursor/Cline API relay for China — ¥1=$1, WeChat/Alipay payment, no credit card, no VPN. One command setup for all AI coding tools.",
5
5
  "keywords": [
6
6
  "openai-china",
@@ -35,19 +35,19 @@ const INSTALL_CMD = process.platform === 'win32'
35
35
  ? 'brew install --cask antigravity'
36
36
  : 'flatpak install flathub com.google.Antigravity'
37
37
 
38
- // Windows 常见安装路径(桌面应用,无 CLI)
39
- function findWindowsApp() {
40
- const localAppData = process.env.LOCALAPPDATA || ''
41
- const programFiles = process.env.ProgramFiles || 'C:\\Program Files'
42
- const candidates = [
43
- path.join(localAppData, 'Antigravity'),
44
- path.join(localAppData, 'Google', 'Antigravity'),
45
- path.join(localAppData, 'Programs', 'Antigravity'),
46
- path.join(localAppData, 'Programs', 'Google Antigravity'),
47
- path.join(programFiles, 'Antigravity'),
48
- path.join(programFiles, 'Google', 'Antigravity'),
49
- ]
50
- return candidates.find(p => fs.existsSync(p)) || null
38
+ // Windows:通过注册表检测已安装的桌面应用(winget/MSI 安装均会注册)
39
+ function isWindowsAppInstalled() {
40
+ const { execSync } = require('child_process')
41
+ for (const hive of ['HKLM', 'HKCU']) {
42
+ try {
43
+ const out = execSync(
44
+ `reg query "${hive}\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall" /s /f "Antigravity" /d`,
45
+ { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'], timeout: 3000 }
46
+ )
47
+ if (out.includes('Antigravity')) return true
48
+ } catch {}
49
+ }
50
+ return false
51
51
  }
52
52
 
53
53
  module.exports = {
@@ -57,8 +57,8 @@ module.exports = {
57
57
  checkInstalled() {
58
58
  // CLI in PATH
59
59
  if (commandExists('agy')) return true
60
- // Windows: 桌面应用检测
61
- if (process.platform === 'win32') return !!findWindowsApp()
60
+ // Windows: 注册表检测桌面应用
61
+ if (process.platform === 'win32') return isWindowsAppInstalled()
62
62
  // macOS: .app 检测
63
63
  if (process.platform === 'darwin') return fs.existsSync('/Applications/Antigravity.app')
64
64
  return false