@simonyea/holysheep-cli 2.1.40 → 2.1.41
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/dist/configure-worker.js +4491 -0
- package/dist/index.js +9591 -0
- package/dist/process-proxy-inject.js +117 -0
- package/package.json +20 -7
- package/.gitea/workflows/sanity.yml +0 -125
- package/scripts/check-tarball-size.js +0 -44
- package/src/commands/balance.js +0 -57
- package/src/commands/claude-proxy.js +0 -248
- package/src/commands/claude.js +0 -135
- package/src/commands/doctor.js +0 -282
- package/src/commands/login.js +0 -211
- package/src/commands/openclaw.js +0 -258
- package/src/commands/reset.js +0 -53
- package/src/commands/setup.js +0 -493
- package/src/commands/upgrade.js +0 -168
- package/src/commands/webui.js +0 -622
- package/src/index.js +0 -226
- package/src/tools/aider.js +0 -78
- package/src/tools/antigravity.js +0 -42
- package/src/tools/claude-code.js +0 -228
- package/src/tools/claude-process-proxy.js +0 -1030
- package/src/tools/codex.js +0 -254
- package/src/tools/continue.js +0 -146
- package/src/tools/cursor.js +0 -71
- package/src/tools/droid.js +0 -281
- package/src/tools/env-config.js +0 -185
- package/src/tools/gemini-cli.js +0 -82
- package/src/tools/hermes.js +0 -354
- package/src/tools/index.js +0 -13
- package/src/tools/openclaw-bridge.js +0 -987
- package/src/tools/openclaw.js +0 -925
- package/src/tools/opencode.js +0 -227
- package/src/tools/process-proxy-inject.js +0 -142
- package/src/utils/config.js +0 -54
- package/src/utils/shell.js +0 -342
- package/src/utils/which.js +0 -176
- package/src/webui/aionui-runtime-fetcher.js +0 -429
- package/src/webui/aionui-runtime.js +0 -139
- package/src/webui/aionui-wrapper.js +0 -734
- package/src/webui/configure-worker.js +0 -67
- package/src/webui/server.js +0 -1572
- package/src/webui/workspace-runtime.js +0 -288
- package/src/webui/workspace-store.js +0 -325
- /package/{src/webui → dist}/index.html +0 -0
- /package/{src/tools → dist}/pty-hermes-wrapper.py +0 -0
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 子进程 worker — 在独立进程中运行 tool.configure()
|
|
3
|
-
* 避免 spawnSync/busy-wait 阻塞主进程事件循环
|
|
4
|
-
*
|
|
5
|
-
* IPC 协议:
|
|
6
|
-
* 父→子: { toolId, apiKey, baseUrlAnthropic, baseUrlOpenAI, primaryModel, allModelIds }
|
|
7
|
-
* 子→父: { type: 'progress'|'result'|'error', ... }
|
|
8
|
-
*/
|
|
9
|
-
'use strict'
|
|
10
|
-
|
|
11
|
-
process.on('message', (msg) => {
|
|
12
|
-
const TOOLS = require('../tools')
|
|
13
|
-
const { writeEnvToShell, removeEnvFromShell } = require('../utils/shell')
|
|
14
|
-
|
|
15
|
-
const tool = TOOLS.find(t => t.id === msg.toolId)
|
|
16
|
-
if (!tool) {
|
|
17
|
-
process.send({ type: 'error', message: '未知工具: ' + msg.toolId })
|
|
18
|
-
process.exit(1)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// 劫持 console.log/warn → IPC 回传进度
|
|
22
|
-
const stripAnsi = (s) => String(s).replace(/\x1b\[[0-9;]*m/g, '')
|
|
23
|
-
console.log = (...args) => {
|
|
24
|
-
const text = stripAnsi(args.join(' ')).trim()
|
|
25
|
-
if (text) process.send({ type: 'progress', message: text })
|
|
26
|
-
}
|
|
27
|
-
console.warn = console.log
|
|
28
|
-
|
|
29
|
-
try {
|
|
30
|
-
const result = tool.configure(
|
|
31
|
-
msg.apiKey,
|
|
32
|
-
msg.baseUrlAnthropic,
|
|
33
|
-
msg.baseUrlOpenAI,
|
|
34
|
-
msg.primaryModel,
|
|
35
|
-
msg.allModelIds,
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
// 写入 shell 环境变量(如果工具需要)
|
|
39
|
-
if (result.envVars && Object.keys(result.envVars).length > 0) {
|
|
40
|
-
writeEnvToShell(result.envVars)
|
|
41
|
-
process.send({ type: 'progress', message: '已写入环境变量到 shell 配置' })
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// 清理冲突环境变量(env-config 工具本身就是写环境变量的,不清理)
|
|
45
|
-
if (msg.toolId !== 'env-config') {
|
|
46
|
-
try {
|
|
47
|
-
removeEnvFromShell(['ANTHROPIC_API_KEY', 'ANTHROPIC_BASE_URL', 'OPENAI_API_KEY', 'OPENAI_BASE_URL'])
|
|
48
|
-
} catch {}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
process.send({
|
|
52
|
-
type: 'result',
|
|
53
|
-
status: result.manual ? 'manual' : result.warning ? 'warning' : 'ok',
|
|
54
|
-
message: result.manual ? `${tool.name} 需要手动完成配置`
|
|
55
|
-
: result.warning ? result.warning
|
|
56
|
-
: `${tool.name} 配置成功`,
|
|
57
|
-
file: result.file || null,
|
|
58
|
-
hot: result.hot || false,
|
|
59
|
-
steps: result.steps || null,
|
|
60
|
-
dashboardUrl: result.dashboardUrl || null,
|
|
61
|
-
})
|
|
62
|
-
} catch (e) {
|
|
63
|
-
process.send({ type: 'error', message: e.message })
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
process.exit(0)
|
|
67
|
-
})
|