@simonyea/holysheep-cli 1.7.54 → 1.7.55
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 +2 -2
- package/src/commands/webui.js +7 -14
- package/src/index.js +2 -2
- package/src/tools/codex.js +6 -8
- package/src/webui/index.html +406 -743
- package/src/webui/server.js +123 -8
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simonyea/holysheep-cli",
|
|
3
|
-
"version": "1.7.
|
|
4
|
-
"description": "Claude Code/Cursor/Cline API relay for China
|
|
3
|
+
"version": "1.7.55",
|
|
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",
|
|
7
7
|
"claude-china",
|
package/src/commands/webui.js
CHANGED
|
@@ -15,9 +15,8 @@ async function webui(opts) {
|
|
|
15
15
|
console.log(chalk.gray('━'.repeat(50)))
|
|
16
16
|
console.log()
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
server.on('listening', () => {
|
|
18
|
+
try {
|
|
19
|
+
const server = await startServer(port)
|
|
21
20
|
const url = `http://127.0.0.1:${port}`
|
|
22
21
|
console.log(chalk.green(`✓ WebUI 已启动: ${chalk.cyan.bold(url)}`))
|
|
23
22
|
console.log(chalk.gray(' 按 Ctrl+C 停止'))
|
|
@@ -31,19 +30,13 @@ async function webui(opts) {
|
|
|
31
30
|
else execSync(`xdg-open "${url}"`)
|
|
32
31
|
} catch {}
|
|
33
32
|
}
|
|
34
|
-
})
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
console.log(chalk.red(`✗ 启动失败: ${err.message}`))
|
|
41
|
-
}
|
|
34
|
+
// Keep alive
|
|
35
|
+
await new Promise(() => {})
|
|
36
|
+
} catch (err) {
|
|
37
|
+
console.log(chalk.red(`✗ 启动失败: ${err.message}`))
|
|
42
38
|
process.exit(1)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Keep alive
|
|
46
|
-
await new Promise(() => {})
|
|
39
|
+
}
|
|
47
40
|
}
|
|
48
41
|
|
|
49
42
|
module.exports = webui
|
package/src/index.js
CHANGED
|
@@ -172,8 +172,8 @@ program
|
|
|
172
172
|
|
|
173
173
|
// ── webui ──────────────────────────────────────────────────────────────────
|
|
174
174
|
program
|
|
175
|
-
.command('
|
|
176
|
-
.alias('
|
|
175
|
+
.command('web')
|
|
176
|
+
.alias('webui')
|
|
177
177
|
.description('启动 WebUI 本地管理面板')
|
|
178
178
|
.option('-p, --port <port>', '指定端口', '9876')
|
|
179
179
|
.option('--no-open', '不自动打开浏览器')
|
package/src/tools/codex.js
CHANGED
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
* [model_providers.holysheep]
|
|
13
13
|
* name = "HolySheep"
|
|
14
14
|
* base_url = "https://api.holysheep.ai/v1"
|
|
15
|
-
*
|
|
15
|
+
* api_key = "cr_xxx"
|
|
16
16
|
* wire_api = "responses"
|
|
17
17
|
*
|
|
18
18
|
* 注意:旧的 config.json 会被 Rust Codex 忽略!
|
|
19
|
-
* 注意:
|
|
19
|
+
* 注意:api_key 直接写入配置文件,不再写入 shell 环境变量。
|
|
20
20
|
*/
|
|
21
21
|
const fs = require('fs')
|
|
22
22
|
const path = require('path')
|
|
@@ -89,8 +89,7 @@ function isConfiguredInToml() {
|
|
|
89
89
|
const content = readTomlConfig()
|
|
90
90
|
return content.includes('model_provider = "holysheep"') &&
|
|
91
91
|
content.includes('base_url') &&
|
|
92
|
-
content.includes('holysheep.ai')
|
|
93
|
-
content.includes('env_key = "OPENAI_API_KEY"')
|
|
92
|
+
content.includes('holysheep.ai')
|
|
94
93
|
}
|
|
95
94
|
|
|
96
95
|
/**
|
|
@@ -113,7 +112,7 @@ function writeTomlConfig(apiKey, baseUrlOpenAI, model) {
|
|
|
113
112
|
`[model_providers.holysheep]`,
|
|
114
113
|
`name = "HolySheep"`,
|
|
115
114
|
`base_url = "${baseUrlOpenAI}"`,
|
|
116
|
-
`
|
|
115
|
+
`api_key = "${apiKey}"`,
|
|
117
116
|
`wire_api = "responses"`,
|
|
118
117
|
'',
|
|
119
118
|
].join('\n')
|
|
@@ -138,13 +137,13 @@ function writeJsonConfigIfNeeded(apiKey, baseUrlOpenAI, model) {
|
|
|
138
137
|
jsonConfig.model_providers.holysheep = {
|
|
139
138
|
name: 'HolySheep',
|
|
140
139
|
base_url: baseUrlOpenAI,
|
|
141
|
-
|
|
140
|
+
api_key: apiKey,
|
|
142
141
|
wire_api: 'responses',
|
|
143
142
|
}
|
|
144
143
|
jsonConfig.providers.holysheep = {
|
|
145
144
|
name: 'HolySheep',
|
|
146
145
|
baseURL: baseUrlOpenAI,
|
|
147
|
-
|
|
146
|
+
apiKey: apiKey,
|
|
148
147
|
}
|
|
149
148
|
fs.writeFileSync(CONFIG_FILE_JSON, JSON.stringify(jsonConfig, null, 2), 'utf8')
|
|
150
149
|
} catch {}
|
|
@@ -171,7 +170,6 @@ module.exports = {
|
|
|
171
170
|
return {
|
|
172
171
|
file: CONFIG_FILE,
|
|
173
172
|
hot: false,
|
|
174
|
-
envVars: { OPENAI_API_KEY: apiKey },
|
|
175
173
|
}
|
|
176
174
|
},
|
|
177
175
|
reset() {
|