@simonyea/holysheep-cli 1.7.114 → 1.7.115

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.114",
3
+ "version": "1.7.115",
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",
@@ -82,7 +82,7 @@ const AUTO_INSTALL = {
82
82
  'codex': { cmd: 'npm install -g @openai/codex', mgr: 'npm' },
83
83
  'gemini-cli': { cmd: 'npm install -g @google/gemini-cli', mgr: 'npm' },
84
84
  'opencode': { cmd: 'npm install -g opencode-ai', mgr: 'npm' },
85
- 'openclaw': { cmd: 'npm install -g openclaw@latest --ignore-scripts', mgr: 'npm' },
85
+ 'openclaw': { cmd: 'npm install -g openclaw@latest', mgr: 'npm' },
86
86
  'aider': { cmd: 'pip install aider-chat', mgr: 'pip' },
87
87
  }
88
88
 
@@ -120,7 +120,7 @@ const AUTO_INSTALL = {
120
120
  'codex': { cmd: 'npm install -g @openai/codex' },
121
121
  'gemini-cli': { cmd: 'npm install -g @google/gemini-cli' },
122
122
  'opencode': { cmd: 'npm install -g opencode-ai' },
123
- 'openclaw': { cmd: 'npm install -g openclaw@latest --ignore-scripts' },
123
+ 'openclaw': { cmd: 'npm install -g openclaw@latest' },
124
124
  'aider': { cmd: 'pip install aider-chat' },
125
125
  }
126
126
 
@@ -138,7 +138,7 @@ const UPGRADABLE_TOOLS = [
138
138
  { name: 'Codex CLI', id: 'codex', command: 'codex', versionCmd: 'codex --version', npmPkg: '@openai/codex', installCmd: 'npm install -g @openai/codex@latest' },
139
139
  { name: 'Droid CLI', id: 'droid', command: 'droid', versionCmd: 'droid --version', npmPkg: null, installCmd: process.platform === 'win32' ? 'winget upgrade --id Droid.Droid' : 'brew install --cask droid' },
140
140
  { name: 'OpenCode', id: 'opencode', command: 'opencode', versionCmd: 'opencode --version', npmPkg: 'opencode-ai', installCmd: 'npm install -g opencode-ai@latest' },
141
- { name: 'OpenClaw', id: 'openclaw', command: 'openclaw', versionCmd: 'openclaw --version', npmPkg: 'openclaw', installCmd: 'npm install -g openclaw@latest --ignore-scripts' },
141
+ { name: 'OpenClaw', id: 'openclaw', command: 'openclaw', versionCmd: 'openclaw --version', npmPkg: 'openclaw', installCmd: 'npm install -g openclaw@latest' },
142
142
  { name: 'Gemini CLI', id: 'gemini-cli', command: 'gemini', versionCmd: 'gemini --version', npmPkg: '@google/gemini-cli', installCmd: 'npm install -g @google/gemini-cli@latest' },
143
143
  ]
144
144
 
@@ -502,6 +502,12 @@ async function handleUpgrade(_req, res) {
502
502
  newVer = m ? m[1] : null
503
503
  } catch {}
504
504
 
505
+ // OpenClaw 升级后自动重启网关
506
+ if (ok && tool.id === 'openclaw' && commandExists('openclaw')) {
507
+ try { execSync('openclaw daemon stop', { stdio: 'ignore', timeout: 10000 }) } catch {}
508
+ try { execSync('openclaw daemon start', { stdio: 'ignore', timeout: 30000 }) } catch {}
509
+ }
510
+
505
511
  sseEmit(res, { type: 'tool', name: tool.name, status: ok ? 'ok' : 'error', localVer, newVer })
506
512
  }
507
513
 
@@ -653,6 +659,19 @@ async function handleToolUpgrade(req, res) {
653
659
 
654
660
  if (ok) {
655
661
  sseEmit(res, { type: 'progress', message: `✓ ${entry.name} 升级成功: ${localVer || '?'} → ${newVer || 'latest'}` })
662
+ // OpenClaw 升级后自动重启网关,否则运行中的进程还是旧版本
663
+ if (entry.id === 'openclaw' && commandExists('openclaw')) {
664
+ sseEmit(res, { type: 'progress', message: '正在重启 OpenClaw 网关...' })
665
+ try {
666
+ execSync('openclaw daemon stop', { stdio: 'ignore', timeout: 10000 })
667
+ } catch {}
668
+ try {
669
+ execSync('openclaw daemon start', { stdio: 'ignore', timeout: 30000 })
670
+ sseEmit(res, { type: 'progress', message: '✓ OpenClaw 网关已重启' })
671
+ } catch {
672
+ sseEmit(res, { type: 'progress', message: '⚠️ 网关重启失败,请手动运行: openclaw daemon start' })
673
+ }
674
+ }
656
675
  } else {
657
676
  sseEmit(res, { type: 'progress', message: `✗ ${entry.name} 升级失败` })
658
677
  }