@simonyea/holysheep-cli 1.7.51 → 1.7.52

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 CHANGED
@@ -225,6 +225,7 @@ A: OpenClaw 需要 Node.js 20+,运行 `node --version` 确认版本后重试
225
225
 
226
226
  ## Changelog
227
227
 
228
+ - **v1.7.52** — 将 `hs claude` 重构为本地 API 入口 + CONNECT 兜底代理:Claude Anthropic 请求默认先进入本地 process proxy,再补齐 HolySheep 会话头后转发,降低独立二进制 Claude Code 漏代理导致的 403
228
229
  - **v1.7.51** — 修复 `hs claude` 在 Claude Code 独立二进制版本上的整进程代理:自动识别脚本入口 / 独立二进制并切换到 `NODE_OPTIONS` 注入或 `HTTP(S)_PROXY` 模式;同时增强 `hs doctor` 的 Claude 代理诊断
229
230
  - **v1.6.14** — OpenClaw 新增 `gpt-5.3-codex-spark` 模型,通过本地 bridge 路由到 HolySheep `/v1`
230
231
  - **v1.6.13** — Codex 配置改为直接写 `api_key` 到 config.toml,不再依赖环境变量,修复 Windows 上 setup 后无需重启终端即可使用;同时精简工具列表,只保留 Claude Code / Codex / Droid / OpenClaw
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simonyea/holysheep-cli",
3
- "version": "1.7.51",
3
+ "version": "1.7.52",
4
4
  "description": "Claude Code/Cursor/Cline API relay for China \u2014 \u00a51=$1, WeChat/Alipay payment, no credit card, no VPN. One command setup for all AI coding tools.",
5
5
  "keywords": [
6
6
  "openai-china",
@@ -65,27 +65,31 @@ async function runClaude(args = []) {
65
65
  const runtime = typeof claudeCodeTool.detectClaudeRuntime === 'function'
66
66
  ? claudeCodeTool.detectClaudeRuntime()
67
67
  : { kind: 'unknown', launchMode: 'env-proxy' }
68
+ const launchMode = runtime.launchMode === 'node-inject'
69
+ ? 'local-api + connect-fallback + node-inject'
70
+ : 'local-api + connect-fallback'
68
71
 
69
72
  const env = {
70
73
  ...process.env,
71
74
  ANTHROPIC_API_KEY: undefined,
72
75
  ANTHROPIC_AUTH_TOKEN: apiKey,
73
- ANTHROPIC_BASE_URL: BASE_URL_ANTHROPIC,
76
+ // Force Anthropic API traffic through the local process proxy instead of
77
+ // relying on the Claude binary to honor HTTP(S)_PROXY on every code path.
78
+ ANTHROPIC_BASE_URL: proxyUrl,
74
79
  CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: '1',
75
80
  HOLYSHEEP_CLAUDE_PROCESS_PROXY: '1',
76
81
  HOLYSHEEP_CLAUDE_SESSION_ID: sessionId,
77
82
  HS_PROXY_URL: proxyUrl,
78
83
  HOLYSHEEP_CLAUDE_RUNTIME_KIND: runtime.kind || 'unknown',
79
- HOLYSHEEP_CLAUDE_LAUNCH_MODE: runtime.launchMode || 'env-proxy',
84
+ HOLYSHEEP_CLAUDE_LAUNCH_MODE: launchMode,
85
+ HTTP_PROXY: proxyUrl,
86
+ HTTPS_PROXY: proxyUrl,
87
+ ALL_PROXY: proxyUrl,
88
+ NO_PROXY: mergeNoProxy(process.env.NO_PROXY, ['127.0.0.1', 'localhost']),
80
89
  }
81
90
 
82
91
  if (runtime.launchMode === 'node-inject') {
83
92
  env.NODE_OPTIONS = appendNodeRequire(process.env.NODE_OPTIONS, INJECT_PATH)
84
- } else {
85
- env.HTTP_PROXY = proxyUrl
86
- env.HTTPS_PROXY = proxyUrl
87
- env.ALL_PROXY = proxyUrl
88
- env.NO_PROXY = mergeNoProxy(process.env.NO_PROXY, ['127.0.0.1', 'localhost'])
89
93
  }
90
94
 
91
95
  const child = spawn('claude', args, {
@@ -210,14 +210,20 @@ function printClaudeProcessProxyDetails(tool) {
210
210
  const hasBridgeSecret = Boolean(proxyConfig.bridgeSecret)
211
211
  const hasBridgeIds = Boolean(proxyConfig.bridgeId && proxyConfig.deviceId)
212
212
  const hasProcessPort = Boolean(proxyConfig.processProxyPort)
213
+ const launchPath = runtime.launchMode === 'node-inject'
214
+ ? 'local-api + connect-fallback + node-inject'
215
+ : 'local-api + connect-fallback'
213
216
  console.log(` ${chalk.gray('↳')} ${chalk.gray(`Claude 启动方式:hs claude`)}`)
214
217
  console.log(` ${chalk.gray('↳')} ${chalk.gray(`Claude 代理模式:${mode}`)}`)
215
218
  console.log(` ${chalk.gray('↳')} ${chalk.gray(`Claude 可执行类型:${runtime.display}`)}`)
216
- console.log(` ${chalk.gray('↳')} ${chalk.gray(`Claude 启动代理路径:${runtime.launchMode}`)}`)
219
+ console.log(` ${chalk.gray('↳')} ${chalk.gray(`Claude 启动代理路径:${launchPath}`)}`)
217
220
  console.log(` ${chalk.gray('↳')} ${chalk.gray(`Claude Relay: ${relayUrl || '未配置'}`)}`)
218
221
  console.log(` ${hasBridgeSecret ? chalk.green('↳') : chalk.yellow('↳')} ${hasBridgeSecret ? chalk.green('Bridge secret 已配置') : chalk.yellow('Bridge secret 缺失')}`)
219
222
  console.log(` ${hasBridgeIds ? chalk.green('↳') : chalk.yellow('↳')} ${hasBridgeIds ? chalk.green('Bridge ID / Device ID 已配置') : chalk.yellow('Bridge ID / Device ID 缺失')}`)
220
223
  console.log(` ${hasProcessPort ? chalk.green('↳') : chalk.yellow('↳')} ${hasProcessPort ? chalk.green(`Claude process proxy 端口:${proxyConfig.processProxyPort}`) : chalk.yellow('Claude process proxy 端口缺失')}`)
224
+ if (hasProcessPort) {
225
+ console.log(` ${chalk.gray('↳')} ${chalk.gray(`Claude 本地 API 入口:http://127.0.0.1:${proxyConfig.processProxyPort}`)}`)
226
+ }
221
227
  if (runtime.path) {
222
228
  console.log(` ${chalk.gray('↳')} ${chalk.gray(`Claude 路径:${runtime.path}`)}`)
223
229
  }