@simonyea/holysheep-cli 1.7.83 → 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 +1 -1
- package/src/utils/shell.js +1 -0
- package/src/webui/server.js +8 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simonyea/holysheep-cli",
|
|
3
|
-
"version": "1.7.
|
|
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",
|
package/src/utils/shell.js
CHANGED
|
@@ -213,6 +213,7 @@ function removeWindowsUserEnvVars(keys = []) {
|
|
|
213
213
|
`powershell.exe -NoProfile -Command "[Environment]::SetEnvironmentVariable('${key}', $null, 'User')"`,
|
|
214
214
|
{ stdio: 'ignore' }
|
|
215
215
|
)
|
|
216
|
+
delete process.env[key]
|
|
216
217
|
removed.push(`[系统环境变量] ${key}`)
|
|
217
218
|
} catch {}
|
|
218
219
|
}
|
package/src/webui/server.js
CHANGED
|
@@ -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 })
|