@simonyea/holysheep-cli 1.7.82 → 1.7.83

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.82",
3
+ "version": "1.7.83",
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",
@@ -594,12 +594,18 @@ async function handleToolUpgrade(req, res) {
594
594
 
595
595
  sseEmit(res, { type: 'progress', message: `正在升级 ${entry.name}...` })
596
596
 
597
+ const UPGRADE_TIMEOUT_MS = 10 * 60 * 1000 // 10 分钟
597
598
  const ok = await new Promise(resolve => {
598
599
  const child = spawn(entry.installCmd, [], { shell: true })
600
+ const timer = setTimeout(() => {
601
+ sseEmit(res, { type: 'progress', message: `⚠️ 升级超时(10分钟),请手动运行: ${entry.installCmd}` })
602
+ try { child.kill('SIGKILL') } catch {}
603
+ resolve(false)
604
+ }, UPGRADE_TIMEOUT_MS)
599
605
  child.stdout?.on('data', chunk => sseEmit(res, { type: 'output', text: chunk.toString() }))
600
606
  child.stderr?.on('data', chunk => sseEmit(res, { type: 'output', text: chunk.toString() }))
601
- child.on('close', code => resolve(code === 0))
602
- child.on('error', () => resolve(false))
607
+ child.on('close', code => { clearTimeout(timer); resolve(code === 0) })
608
+ child.on('error', () => { clearTimeout(timer); resolve(false) })
603
609
  })
604
610
 
605
611
  let newVer = null