@simonyea/holysheep-cli 1.7.84 → 1.7.85

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.84",
3
+ "version": "1.7.85",
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",
@@ -489,12 +489,18 @@ async function handleToolInstall(req, res) {
489
489
  sseStart(res)
490
490
  sseEmit(res, { type: 'progress', message: `正在安装 ${toolId}...` })
491
491
 
492
+ const INSTALL_TIMEOUT_MS = 10 * 60 * 1000 // 10 分钟
492
493
  const ok = await new Promise(resolve => {
493
494
  const child = spawn(AUTO_INSTALL[toolId].cmd, [], { shell: true })
495
+ const timer = setTimeout(() => {
496
+ sseEmit(res, { type: 'output', text: `\n⚠️ 安装超时(10分钟),请手动运行:\n${AUTO_INSTALL[toolId].cmd}\n` })
497
+ try { child.kill('SIGKILL') } catch {}
498
+ resolve(false)
499
+ }, INSTALL_TIMEOUT_MS)
494
500
  child.stdout?.on('data', chunk => sseEmit(res, { type: 'output', text: chunk.toString() }))
495
501
  child.stderr?.on('data', chunk => sseEmit(res, { type: 'output', text: chunk.toString() }))
496
- child.on('close', code => resolve(code === 0))
497
- child.on('error', () => resolve(false))
502
+ child.on('close', code => { clearTimeout(timer); resolve(code === 0) })
503
+ child.on('error', () => { clearTimeout(timer); resolve(false) })
498
504
  })
499
505
 
500
506
  sseEmit(res, { type: 'done', success: ok })