@simonyea/holysheep-cli 1.7.133 → 1.7.135
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/README.md +2 -0
- package/package.json +4 -1
- package/src/tools/droid.js +11 -2
- package/tests/droid.test.js +75 -0
package/README.md
CHANGED
|
@@ -225,6 +225,8 @@ A: OpenClaw 需要 Node.js 20+,运行 `node --version` 确认版本后重试
|
|
|
225
225
|
|
|
226
226
|
## Changelog
|
|
227
227
|
|
|
228
|
+
- **v1.7.135** — Droid CLI 的 GPT-5.4 配置切回官方要求的 `provider=openai + https://api.holysheep.ai/v1`,配合服务端 Responses API 修复避免 BYOK provider 校验失败
|
|
229
|
+
- **v1.7.134** — 修复并发配置/Worker 路径下 Droid CLI 的 GPT-5.4 BYOK 配置:GPT 走 `generic-chat-completion-api + https://api.holysheep.ai/v1`,避免误走 Anthropic `/v1/messages`
|
|
228
230
|
- **v1.7.53** — 修复 `hs claude` 在绝对 URL 代理路径下未透传 `x-hs-node-proxied` 的问题,避免同一会话里部分 Claude 请求被后端误判为非可信代理请求并随机触发 403
|
|
229
231
|
- **v1.7.52** — 将 `hs claude` 重构为本地 API 入口 + CONNECT 兜底代理:Claude Anthropic 请求默认先进入本地 process proxy,再补齐 HolySheep 会话头后转发,降低独立二进制 Claude Code 漏代理导致的 403
|
|
230
232
|
- **v1.7.51** — 修复 `hs claude` 在 Claude Code 独立二进制版本上的整进程代理:自动识别脚本入口 / 独立二进制并切换到 `NODE_OPTIONS` 注入或 `HTTP(S)_PROXY` 模式;同时增强 `hs doctor` 的 Claude 代理诊断
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simonyea/holysheep-cli",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.135",
|
|
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
|
+
"scripts": {
|
|
6
|
+
"test": "node tests/droid.test.js"
|
|
7
|
+
},
|
|
5
8
|
"keywords": [
|
|
6
9
|
"openai-china",
|
|
7
10
|
"claude-china",
|
package/src/tools/droid.js
CHANGED
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
* - GPT 走 OpenAI 兼容入口: https://api.holysheep.ai/v1
|
|
7
7
|
* - Claude 走 Anthropic 入口: https://api.holysheep.ai
|
|
8
8
|
* - MiniMax 走 Anthropic 入口: https://api.holysheep.ai/minimax
|
|
9
|
+
*
|
|
10
|
+
* Droid 的 GPT-5+ BYOK 校验要求 provider=openai。OpenAI provider 会使用
|
|
11
|
+
* Responses API,因此 baseUrl 必须是 https://api.holysheep.ai/v1。
|
|
9
12
|
*/
|
|
10
13
|
const fs = require('fs')
|
|
11
14
|
const path = require('path')
|
|
@@ -21,7 +24,8 @@ const DEFAULT_MODELS = [
|
|
|
21
24
|
id: 'custom:gpt-5.4-0',
|
|
22
25
|
baseUrlSuffix: '',
|
|
23
26
|
displayName: 'GPT-5.4',
|
|
24
|
-
provider: '
|
|
27
|
+
provider: 'openai',
|
|
28
|
+
route: 'openai',
|
|
25
29
|
},
|
|
26
30
|
{
|
|
27
31
|
model: 'claude-sonnet-4-6',
|
|
@@ -29,6 +33,7 @@ const DEFAULT_MODELS = [
|
|
|
29
33
|
baseUrlSuffix: '',
|
|
30
34
|
displayName: 'Sonnet 4.6',
|
|
31
35
|
provider: 'anthropic',
|
|
36
|
+
route: 'anthropic',
|
|
32
37
|
},
|
|
33
38
|
{
|
|
34
39
|
model: 'claude-opus-4-6',
|
|
@@ -36,6 +41,7 @@ const DEFAULT_MODELS = [
|
|
|
36
41
|
baseUrlSuffix: '',
|
|
37
42
|
displayName: 'Opus 4.6',
|
|
38
43
|
provider: 'anthropic',
|
|
44
|
+
route: 'anthropic',
|
|
39
45
|
},
|
|
40
46
|
{
|
|
41
47
|
model: 'MiniMax-M2.7-highspeed',
|
|
@@ -43,6 +49,7 @@ const DEFAULT_MODELS = [
|
|
|
43
49
|
baseUrlSuffix: '/minimax',
|
|
44
50
|
displayName: 'MiniMax 2.7 Highspeed',
|
|
45
51
|
provider: 'anthropic',
|
|
52
|
+
route: 'anthropic',
|
|
46
53
|
},
|
|
47
54
|
{
|
|
48
55
|
model: 'claude-haiku-4-5',
|
|
@@ -50,6 +57,7 @@ const DEFAULT_MODELS = [
|
|
|
50
57
|
baseUrlSuffix: '',
|
|
51
58
|
displayName: 'Haiku 4.5',
|
|
52
59
|
provider: 'anthropic',
|
|
60
|
+
route: 'anthropic',
|
|
53
61
|
},
|
|
54
62
|
]
|
|
55
63
|
|
|
@@ -98,6 +106,7 @@ function normalizeSelectedModels(selectedModels) {
|
|
|
98
106
|
baseUrlSuffix: item.baseUrlSuffix,
|
|
99
107
|
displayName: item.displayName,
|
|
100
108
|
provider: item.provider,
|
|
109
|
+
route: item.route,
|
|
101
110
|
}))
|
|
102
111
|
|
|
103
112
|
return models.length > 0 ? models : DEFAULT_MODELS.map((item, index) => ({ ...item, index }))
|
|
@@ -111,7 +120,7 @@ function buildCustomModels(apiKey, baseUrlAnthropic, baseUrlOpenAI, selectedMode
|
|
|
111
120
|
id: item.id,
|
|
112
121
|
index: item.index,
|
|
113
122
|
baseUrl:
|
|
114
|
-
item.
|
|
123
|
+
item.route === 'openai'
|
|
115
124
|
? `${openaiRootUrl}${item.baseUrlSuffix}`
|
|
116
125
|
: `${anthropicRootUrl}${item.baseUrlSuffix}`,
|
|
117
126
|
apiKey,
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
const assert = require('assert')
|
|
2
|
+
const fs = require('fs')
|
|
3
|
+
const os = require('os')
|
|
4
|
+
const path = require('path')
|
|
5
|
+
|
|
6
|
+
const tempHome = fs.mkdtempSync(path.join(os.tmpdir(), 'hs-droid-test-'))
|
|
7
|
+
process.env.HOME = tempHome
|
|
8
|
+
|
|
9
|
+
const droid = require('../src/tools/droid')
|
|
10
|
+
|
|
11
|
+
const factoryDir = path.join(tempHome, '.factory')
|
|
12
|
+
const settingsFile = path.join(factoryDir, 'settings.json')
|
|
13
|
+
const configFile = path.join(factoryDir, 'config.json')
|
|
14
|
+
|
|
15
|
+
fs.mkdirSync(factoryDir, { recursive: true })
|
|
16
|
+
fs.writeFileSync(settingsFile, JSON.stringify({
|
|
17
|
+
customModels: [
|
|
18
|
+
{
|
|
19
|
+
model: 'gpt-5.4',
|
|
20
|
+
id: 'custom:gpt-5.4-0',
|
|
21
|
+
baseUrl: 'https://api.holysheep.ai',
|
|
22
|
+
provider: 'anthropic',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
model: 'local-test',
|
|
26
|
+
id: 'custom:local-test',
|
|
27
|
+
baseUrl: 'http://localhost:11434/v1',
|
|
28
|
+
provider: 'generic-chat-completion-api',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
}, null, 2))
|
|
32
|
+
fs.writeFileSync(configFile, JSON.stringify({
|
|
33
|
+
customModels: [
|
|
34
|
+
{
|
|
35
|
+
model: 'gpt-5.4',
|
|
36
|
+
id: 'custom:gpt-5.4-0',
|
|
37
|
+
baseUrl: 'https://api.holysheep.ai',
|
|
38
|
+
provider: 'anthropic',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
}, null, 2))
|
|
42
|
+
|
|
43
|
+
droid.configure(
|
|
44
|
+
'cr_test',
|
|
45
|
+
'https://api.holysheep.ai',
|
|
46
|
+
'https://api.holysheep.ai/v1',
|
|
47
|
+
'gpt-5.4',
|
|
48
|
+
['gpt-5.4', 'claude-sonnet-4-6', 'MiniMax-M2.7-highspeed'],
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
const settings = JSON.parse(fs.readFileSync(settingsFile, 'utf8'))
|
|
52
|
+
const legacy = JSON.parse(fs.readFileSync(configFile, 'utf8'))
|
|
53
|
+
|
|
54
|
+
for (const config of [settings, legacy]) {
|
|
55
|
+
const gpt = config.customModels.find((entry) => entry.id === 'custom:gpt-5.4-0')
|
|
56
|
+
assert.ok(gpt, 'GPT-5.4 custom model should be present')
|
|
57
|
+
assert.strictEqual(gpt.model, 'gpt-5.4')
|
|
58
|
+
assert.strictEqual(gpt.provider, 'openai')
|
|
59
|
+
assert.strictEqual(gpt.baseUrl, 'https://api.holysheep.ai/v1')
|
|
60
|
+
|
|
61
|
+
const sonnet = config.customModels.find((entry) => entry.id === 'custom:claude-sonnet-4-6-0')
|
|
62
|
+
assert.ok(sonnet, 'Sonnet custom model should be present')
|
|
63
|
+
assert.strictEqual(sonnet.provider, 'anthropic')
|
|
64
|
+
assert.strictEqual(sonnet.baseUrl, 'https://api.holysheep.ai')
|
|
65
|
+
|
|
66
|
+
const minimax = config.customModels.find((entry) => entry.id === 'custom:MiniMax-M2.7-highspeed-0')
|
|
67
|
+
assert.ok(minimax, 'MiniMax custom model should be present')
|
|
68
|
+
assert.strictEqual(minimax.provider, 'anthropic')
|
|
69
|
+
assert.strictEqual(minimax.baseUrl, 'https://api.holysheep.ai/minimax')
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const preserved = settings.customModels.find((entry) => entry.id === 'custom:local-test')
|
|
73
|
+
assert.ok(preserved, 'non-HolySheep custom models should be preserved')
|
|
74
|
+
|
|
75
|
+
console.log('droid config test passed')
|