@simonyea/holysheep-cli 2.1.70 → 2.1.71

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.
@@ -4135,11 +4135,11 @@ var require_package = __commonJS({
4135
4135
  "package.json"(exports2, module2) {
4136
4136
  module2.exports = {
4137
4137
  name: "@simonyea/holysheep-cli",
4138
- version: "2.1.70",
4138
+ version: "2.1.71",
4139
4139
  description: "Claude Code/Cursor/Cline API relay for China \u2014 \xA51=$1, WeChat/Alipay payment, no credit card, no VPN. One command setup for all AI coding tools.",
4140
4140
  scripts: {
4141
4141
  build: "node scripts/build.mjs",
4142
- test: "node tests/droid.test.js && node tests/workspace-store.test.js && node tests/runtime-stale-upgrade.test.js && node tests/hermes.test.js && node tests/preflight.test.js && node tests/opencode-auth-purge.test.js && node tests/shell-winpath.test.js && node tests/openclaw-atomic-write.test.js && node tests/openclaw-disable-auth-direct.test.js && node tests/opencode-default-model.test.js && node tests/paths-bundled.test.js && node tests/aionui-runtime-resources.test.js && node tests/aionui-wrapper-claude-proxy.test.js && node tests/aionui-wrapper-probe.test.js && node tests/aionui-wrapper-proxy-integration.test.js && node tests/aionui-wrapper-all-clis-autoconf.test.js && node tests/aionui-wrapper-env-signal.test.js && node tests/aionui-wrapper-csp-rewrite.test.js && node tests/aionui-wrapper-version-status.test.js && node tests/claude-proxy-daemon.test.js && node tests/claude-proxy-vscode-settings.test.js && node tests/claude-proxy-vscode-env.test.js && node tests/acptypes-patch.test.js && node tests/codex-approval-policy.test.js && node tests/version-check.test.js && node tests/runclaude-missing-binary.test.js && node tests/claude-code-configure-preserve.test.js && node tests/webui-claude-proxy-virtual-tool.test.js && node tests/webui-claude-proxy-ui.test.js && node tests/webui-response-consumer.test.js",
4142
+ test: "node tests/droid.test.js && node tests/workspace-store.test.js && node tests/runtime-stale-upgrade.test.js && node tests/hermes.test.js && node tests/preflight.test.js && node tests/opencode-auth-purge.test.js && node tests/shell-winpath.test.js && node tests/openclaw-atomic-write.test.js && node tests/openclaw-disable-auth-direct.test.js && node tests/opencode-default-model.test.js && node tests/paths-bundled.test.js && node tests/aionui-runtime-resources.test.js && node tests/aionui-wrapper-claude-proxy.test.js && node tests/aionui-wrapper-probe.test.js && node tests/aionui-wrapper-proxy-integration.test.js && node tests/aionui-wrapper-all-clis-autoconf.test.js && node tests/aionui-wrapper-env-signal.test.js && node tests/aionui-wrapper-csp-rewrite.test.js && node tests/aionui-wrapper-version-status.test.js && node tests/claude-proxy-daemon.test.js && node tests/claude-proxy-vscode-settings.test.js && node tests/claude-proxy-vscode-env.test.js && node tests/acptypes-patch.test.js && node tests/codex-approval-policy.test.js && node tests/version-check.test.js && node tests/runclaude-missing-binary.test.js && node tests/claude-code-configure-preserve.test.js && node tests/webui-claude-proxy-virtual-tool.test.js && node tests/webui-claude-proxy-ui.test.js && node tests/webui-response-consumer.test.js && node tests/webui-claude-proxy-install-gating.test.js",
4143
4143
  prepublishOnly: "npm run build && npm test && node scripts/check-tarball-size.js"
4144
4144
  },
4145
4145
  keywords: [
package/dist/index.html CHANGED
@@ -1120,7 +1120,7 @@ function renderTools() {
1120
1120
  <div class="panel-header">
1121
1121
  <div>
1122
1122
  <h2>CLI 管理</h2>
1123
- <p>统一管理本地 AI CLI、MCP 与 VS Code Claude 代理;代理作为 Claude Code 的子状态展示。</p>
1123
+ <p>统一管理本地 AI CLI、MCP 与 VS Code Claude 代理;Claude Code 未安装时先安装 CLI,再启动代理。</p>
1124
1124
  </div>
1125
1125
  </div>
1126
1126
  <div class="panel-body tool-grid">
@@ -1136,12 +1136,11 @@ function renderTools() {
1136
1136
  </div>
1137
1137
  </div>
1138
1138
  <div class="inline-actions">
1139
- <button class="btn" onclick="launchTool('${tool.id}')">Launch</button>
1140
- <button class="btn primary" onclick="configureTool('${tool.id}')">${tool.configured ? 'Reconfigure' : 'Configure'}</button>
1139
+ ${renderToolActions(tool)}
1141
1140
  </div>
1142
1141
  </div>
1143
1142
  <div class="tool-hint">${esc(tool.hint || 'No additional hint')}</div>
1144
- ${tool.id === 'claude-code' ? renderClaudeProxySubstatus(tool.vsCodeProxy) : ''}
1143
+ ${tool.id === 'claude-code' ? renderClaudeProxySubstatus(tool) : ''}
1145
1144
  </div>
1146
1145
  `).join('')}
1147
1146
  </div>
@@ -1149,19 +1148,40 @@ function renderTools() {
1149
1148
  `
1150
1149
  }
1151
1150
 
1152
- function renderClaudeProxySubstatus(proxy) {
1153
- const running = !!proxy?.running
1151
+ function renderToolActions(tool) {
1152
+ if (tool.id === 'claude-code' && tool.requiresInstall) {
1153
+ return `<button class="btn primary" onclick="installTool('claude-code')">${esc(tool.installLabel || '安装 Claude Code CLI')}</button>`
1154
+ }
1155
+ const launchButton = tool.launchCmd ? `<button class="btn" onclick="launchTool('${tool.id}')">Launch</button>` : ''
1156
+ const configureButton = tool.installed ? `<button class="btn primary" onclick="configureTool('${tool.id}')">${tool.configured ? 'Reconfigure' : 'Configure'}</button>` : ''
1157
+ const installButton = !tool.installed && tool.canAutoInstall ? `<button class="btn primary" onclick="installTool('${tool.id}')">Install</button>` : ''
1158
+ return `${installButton}${launchButton}${configureButton}` || '<span class="task-meta">Manual setup required</span>'
1159
+ }
1160
+
1161
+ function renderClaudeProxySubstatus(tool) {
1162
+ if (tool?.requiresInstall || !tool?.installed || !tool?.vsCodeProxy) {
1163
+ return `
1164
+ <div class="tool-substatus install-first" data-requires-install="true">
1165
+ <div>
1166
+ <div class="tool-substatus-title">先安装 Claude Code CLI</div>
1167
+ <div class="tool-substatus-meta">${esc(tool?.installHint || '不存在单独的 vscode-claudecode 插件;VS Code 里使用官方 Claude Code 扩展 + HolySheep 本地代理。')}</div>
1168
+ </div>
1169
+ </div>
1170
+ `
1171
+ }
1172
+ const proxy = tool.vsCodeProxy
1173
+ const running = !!proxy.running
1154
1174
  const meta = running
1155
1175
  ? `127.0.0.1:${proxy.port || '?'} · PID ${proxy.pid || '?'}`
1156
1176
  : '未启动 · Windows 启动后需要完全退出 Code.exe 再重开 VS Code'
1157
1177
  return `
1158
1178
  <div class="tool-substatus">
1159
1179
  <div>
1160
- <div class="tool-substatus-title">VS Code Claude 代理</div>
1180
+ <div class="tool-substatus-title">${esc(proxy.label || 'VS Code Claude 代理(hs claude-proxy)')}</div>
1161
1181
  <div class="tool-substatus-meta">${esc(meta)}</div>
1162
1182
  </div>
1163
1183
  <div class="inline-actions">
1164
- <button class="btn ${running ? '' : 'primary'}" onclick="startClaudeProxy()">${running ? '重新校准' : '启动代理'}</button>
1184
+ <button class="btn ${running ? '' : 'primary'}" onclick="startClaudeProxy()">${running ? '重新校准' : '启动 VS Code 代理'}</button>
1165
1185
  ${running ? '<button class="btn danger" onclick="stopClaudeProxy()">停止</button>' : ''}
1166
1186
  </div>
1167
1187
  </div>
@@ -1537,6 +1557,10 @@ async function consumeSse(path, body, title) {
1537
1557
  await postMaybeSse(path, body, title)
1538
1558
  }
1539
1559
 
1560
+ function installTool(toolId) {
1561
+ consumeSse('tool/install', { toolId }, `Install ${toolNames[toolId] || toolId}`).then(() => refreshWorkspace(false))
1562
+ }
1563
+
1540
1564
  function configureTool(toolId) {
1541
1565
  consumeSse('tool/configure', { toolId }, `Configure ${toolNames[toolId] || toolId}`).then(() => refreshWorkspace(false))
1542
1566
  }
package/dist/index.js CHANGED
@@ -12,11 +12,11 @@ var require_package = __commonJS({
12
12
  "package.json"(exports2, module2) {
13
13
  module2.exports = {
14
14
  name: "@simonyea/holysheep-cli",
15
- version: "2.1.70",
15
+ version: "2.1.71",
16
16
  description: "Claude Code/Cursor/Cline API relay for China \u2014 \xA51=$1, WeChat/Alipay payment, no credit card, no VPN. One command setup for all AI coding tools.",
17
17
  scripts: {
18
18
  build: "node scripts/build.mjs",
19
- test: "node tests/droid.test.js && node tests/workspace-store.test.js && node tests/runtime-stale-upgrade.test.js && node tests/hermes.test.js && node tests/preflight.test.js && node tests/opencode-auth-purge.test.js && node tests/shell-winpath.test.js && node tests/openclaw-atomic-write.test.js && node tests/openclaw-disable-auth-direct.test.js && node tests/opencode-default-model.test.js && node tests/paths-bundled.test.js && node tests/aionui-runtime-resources.test.js && node tests/aionui-wrapper-claude-proxy.test.js && node tests/aionui-wrapper-probe.test.js && node tests/aionui-wrapper-proxy-integration.test.js && node tests/aionui-wrapper-all-clis-autoconf.test.js && node tests/aionui-wrapper-env-signal.test.js && node tests/aionui-wrapper-csp-rewrite.test.js && node tests/aionui-wrapper-version-status.test.js && node tests/claude-proxy-daemon.test.js && node tests/claude-proxy-vscode-settings.test.js && node tests/claude-proxy-vscode-env.test.js && node tests/acptypes-patch.test.js && node tests/codex-approval-policy.test.js && node tests/version-check.test.js && node tests/runclaude-missing-binary.test.js && node tests/claude-code-configure-preserve.test.js && node tests/webui-claude-proxy-virtual-tool.test.js && node tests/webui-claude-proxy-ui.test.js && node tests/webui-response-consumer.test.js",
19
+ test: "node tests/droid.test.js && node tests/workspace-store.test.js && node tests/runtime-stale-upgrade.test.js && node tests/hermes.test.js && node tests/preflight.test.js && node tests/opencode-auth-purge.test.js && node tests/shell-winpath.test.js && node tests/openclaw-atomic-write.test.js && node tests/openclaw-disable-auth-direct.test.js && node tests/opencode-default-model.test.js && node tests/paths-bundled.test.js && node tests/aionui-runtime-resources.test.js && node tests/aionui-wrapper-claude-proxy.test.js && node tests/aionui-wrapper-probe.test.js && node tests/aionui-wrapper-proxy-integration.test.js && node tests/aionui-wrapper-all-clis-autoconf.test.js && node tests/aionui-wrapper-env-signal.test.js && node tests/aionui-wrapper-csp-rewrite.test.js && node tests/aionui-wrapper-version-status.test.js && node tests/claude-proxy-daemon.test.js && node tests/claude-proxy-vscode-settings.test.js && node tests/claude-proxy-vscode-env.test.js && node tests/acptypes-patch.test.js && node tests/codex-approval-policy.test.js && node tests/version-check.test.js && node tests/runclaude-missing-binary.test.js && node tests/claude-code-configure-preserve.test.js && node tests/webui-claude-proxy-virtual-tool.test.js && node tests/webui-claude-proxy-ui.test.js && node tests/webui-response-consumer.test.js && node tests/webui-claude-proxy-install-gating.test.js",
20
20
  prepublishOnly: "npm run build && npm test && node scripts/check-tarball-size.js"
21
21
  },
22
22
  keywords: [
@@ -7685,29 +7685,37 @@ var require_server = __commonJS({
7685
7685
  async function buildToolSummary(tool) {
7686
7686
  var _a, _b;
7687
7687
  const installed = await detectToolInstalled(tool);
7688
+ const isClaudeCode = tool.id === "claude-code";
7688
7689
  const summary = {
7689
7690
  id: tool.id,
7690
- name: tool.name,
7691
+ name: isClaudeCode ? "Claude Code CLI" : tool.name,
7691
7692
  installed,
7692
7693
  configured: installed ? ((_a = tool.isConfigured) == null ? void 0 : _a.call(tool)) || false : false,
7693
7694
  version: installed ? await getVersionAsync(tool) : null,
7694
7695
  installCmd: tool.installCmd,
7695
- hint: tool.hint || null,
7696
- launchCmd: tool.launchCmd || null,
7696
+ hint: isClaudeCode ? "\u5B98\u65B9 Claude Code CLI\uFF1BVS Code \u91CC\u4F7F\u7528\u5B98\u65B9 Claude Code \u6269\u5C55 + HolySheep \u672C\u5730\u4EE3\u7406\uFF0C\u4E0D\u5B58\u5728\u5355\u72EC\u7684 vscode-claudecode \u63D2\u4EF6\u3002" : tool.hint || null,
7697
+ launchCmd: installed ? tool.launchCmd || null : null,
7697
7698
  canAutoInstall: !!AUTO_INSTALL[tool.id],
7698
- canUpgrade: !!UPGRADABLE_TOOLS.find((item) => item.id === tool.id),
7699
+ canUpgrade: installed && !!UPGRADABLE_TOOLS.find((item) => item.id === tool.id),
7699
7700
  npmPkg: ((_b = UPGRADABLE_TOOLS.find((item) => item.id === tool.id)) == null ? void 0 : _b.npmPkg) || null
7700
7701
  };
7701
- if (tool.id === "claude-code") {
7702
- const proxyState = isClaudeProxyRunning();
7703
- summary.vsCodeProxy = {
7704
- running: proxyState.running,
7705
- configured: proxyState.running,
7706
- port: proxyState.port || null,
7707
- pid: proxyState.pid || null,
7708
- launchCmd: "hs claude-proxy --daemon",
7709
- hint: proxyState.running ? `VS Code \u4EE3\u7406\u8FD0\u884C\u4E2D\uFF1A127.0.0.1:${proxyState.port}` : "VS Code Claude Code \u9700\u8981\u542F\u52A8\u672C\u5730\u4EE3\u7406\uFF1B\u542F\u52A8\u540E\u8BF7\u5B8C\u5168\u9000\u51FA\u5E76\u91CD\u5F00 VS Code\u3002"
7710
- };
7702
+ if (isClaudeCode) {
7703
+ summary.requiresInstall = !installed;
7704
+ summary.installLabel = "\u5B89\u88C5 Claude Code CLI";
7705
+ summary.installHint = process.platform === "win32" ? "Windows \u5C06\u8FD0\u884C\u5B98\u65B9\u5B89\u88C5\u811A\u672C\uFF1Airm https://claude.ai/install.ps1 | iex\u3002\u5B89\u88C5\u540E\u8BF7\u91CD\u65B0\u6253\u5F00 PowerShell/VS Code\u3002" : "\u5B89\u88C5\u5B98\u65B9 Claude Code CLI \u540E\uFF0C\u624D\u80FD\u542F\u52A8 VS Code Claude \u4EE3\u7406\uFF08hs claude-proxy\uFF09\u3002";
7706
+ if (installed) {
7707
+ const proxyState = isClaudeProxyRunning();
7708
+ summary.vsCodeProxy = {
7709
+ running: proxyState.running,
7710
+ configured: proxyState.running,
7711
+ requiresInstall: false,
7712
+ port: proxyState.port || null,
7713
+ pid: proxyState.pid || null,
7714
+ launchCmd: "hs claude-proxy --daemon",
7715
+ label: "VS Code Claude \u4EE3\u7406\uFF08hs claude-proxy\uFF09",
7716
+ hint: proxyState.running ? `VS Code Claude \u4EE3\u7406\u8FD0\u884C\u4E2D\uFF1A127.0.0.1:${proxyState.port}` : "\u5DF2\u5B89\u88C5 Claude Code CLI\u3002\u542F\u52A8 VS Code Claude \u4EE3\u7406\u540E\uFF0C\u8BF7\u5B8C\u5168\u9000\u51FA\u6240\u6709 Code.exe\uFF0C\u518D\u91CD\u65B0\u6253\u5F00 VS Code\u3002"
7717
+ };
7718
+ }
7711
7719
  }
7712
7720
  return summary;
7713
7721
  }
@@ -9742,10 +9750,14 @@ var require_aionui_wrapper = __commonJS({
9742
9750
  // [v2.1.63] \u542F\u52A8 button \u2014 installed + has launchCmd (covers OpenClaw etc.)
9743
9751
  if(t.installed&&t.launchCmd)btns+='<button data-act="launch" data-id="'+t.id+'" style="'+btnSty+';background:#f59e0b">\u542F\u52A8</button>';
9744
9752
  var proxy='';
9745
- if(t.id==='claude-code'&&t.vsCodeProxy){
9746
- var p=t.vsCodeProxy;
9747
- var pText=p.running?('\u8FD0\u884C\u4E2D 127.0.0.1:'+p.port+' \xB7 PID '+p.pid):'\u672A\u542F\u52A8\uFF08Windows \u542F\u52A8\u540E\u9700\u5B8C\u5168\u9000\u51FA Code.exe \u518D\u91CD\u5F00 VS Code\uFF09';
9748
- proxy='<div style="margin-top:6px;padding:6px 8px;background:#fff7ed;border:1px solid #fed7aa;border-radius:6px;font-size:11px;color:#9a3412">VS Code \u4EE3\u7406\uFF1A'+pText+' <button data-act="launch" data-id="claude-proxy" style="'+btnSty+';background:#f59e0b">'+(p.running?'\u91CD\u65B0\u6821\u51C6':'\u542F\u52A8\u4EE3\u7406')+'</button>'+(p.running?' <button data-act="reset" data-id="claude-proxy" style="'+btnSty+';background:#dc2626">\u505C\u6B62</button>':'')+'</div>';
9753
+ if(t.id==='claude-code'){
9754
+ if(t.requiresInstall||!t.installed||!t.vsCodeProxy){
9755
+ proxy='<div style="margin-top:6px;padding:6px 8px;background:#eff6ff;border:1px solid #bfdbfe;border-radius:6px;font-size:11px;color:#1d4ed8" data-requires-install="true">\u5148\u5B89\u88C5 Claude Code CLI\uFF1B\u4E0D\u5B58\u5728\u5355\u72EC\u7684 vscode-claudecode \u63D2\u4EF6\uFF0CVS Code \u91CC\u4F7F\u7528\u5B98\u65B9 Claude Code \u6269\u5C55 + HolySheep \u672C\u5730\u4EE3\u7406\u3002</div>';
9756
+ }else{
9757
+ var p=t.vsCodeProxy;
9758
+ var pText=p.running?('\u8FD0\u884C\u4E2D 127.0.0.1:'+p.port+' \xB7 PID '+p.pid):'\u672A\u542F\u52A8\uFF08Windows \u542F\u52A8\u540E\u9700\u5B8C\u5168\u9000\u51FA Code.exe \u518D\u91CD\u5F00 VS Code\uFF09';
9759
+ proxy='<div style="margin-top:6px;padding:6px 8px;background:#fff7ed;border:1px solid #fed7aa;border-radius:6px;font-size:11px;color:#9a3412">VS Code Claude \u4EE3\u7406\uFF08hs claude-proxy\uFF09\uFF1A'+pText+' <button data-act="launch" data-id="claude-proxy" style="'+btnSty+';background:#f59e0b">'+(p.running?'\u91CD\u65B0\u6821\u51C6':'\u542F\u52A8 VS Code \u4EE3\u7406')+'</button>'+(p.running?' <button data-act="reset" data-id="claude-proxy" style="'+btnSty+';background:#dc2626">\u505C\u6B62</button>':'')+'</div>';
9760
+ }
9749
9761
  }
9750
9762
  return '<div style="padding:8px 0;border-bottom:1px solid #eee"><div style="display:flex;justify-content:space-between;align-items:center"><div><b>'+t.name+'</b> '+statusBadge+' '+verText+'</div><div>'+btns+'</div></div>'+proxy+'</div>';
9751
9763
  }).join('')+'<div style="padding-top:10px"><button id="hs-cli-upgrade-all" style="width:100%;padding:8px;background:#16a34a;color:#fff;border:0;border-radius:4px;cursor:pointer;font-weight:600">\u4E00\u952E\u5347\u7EA7\u5168\u90E8\u5DF2\u5B89\u88C5\u7684 CLI</button></div>';
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@simonyea/holysheep-cli",
3
- "version": "2.1.70",
3
+ "version": "2.1.71",
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
  "scripts": {
6
6
  "build": "node scripts/build.mjs",
7
- "test": "node tests/droid.test.js && node tests/workspace-store.test.js && node tests/runtime-stale-upgrade.test.js && node tests/hermes.test.js && node tests/preflight.test.js && node tests/opencode-auth-purge.test.js && node tests/shell-winpath.test.js && node tests/openclaw-atomic-write.test.js && node tests/openclaw-disable-auth-direct.test.js && node tests/opencode-default-model.test.js && node tests/paths-bundled.test.js && node tests/aionui-runtime-resources.test.js && node tests/aionui-wrapper-claude-proxy.test.js && node tests/aionui-wrapper-probe.test.js && node tests/aionui-wrapper-proxy-integration.test.js && node tests/aionui-wrapper-all-clis-autoconf.test.js && node tests/aionui-wrapper-env-signal.test.js && node tests/aionui-wrapper-csp-rewrite.test.js && node tests/aionui-wrapper-version-status.test.js && node tests/claude-proxy-daemon.test.js && node tests/claude-proxy-vscode-settings.test.js && node tests/claude-proxy-vscode-env.test.js && node tests/acptypes-patch.test.js && node tests/codex-approval-policy.test.js && node tests/version-check.test.js && node tests/runclaude-missing-binary.test.js && node tests/claude-code-configure-preserve.test.js && node tests/webui-claude-proxy-virtual-tool.test.js && node tests/webui-claude-proxy-ui.test.js && node tests/webui-response-consumer.test.js",
7
+ "test": "node tests/droid.test.js && node tests/workspace-store.test.js && node tests/runtime-stale-upgrade.test.js && node tests/hermes.test.js && node tests/preflight.test.js && node tests/opencode-auth-purge.test.js && node tests/shell-winpath.test.js && node tests/openclaw-atomic-write.test.js && node tests/openclaw-disable-auth-direct.test.js && node tests/opencode-default-model.test.js && node tests/paths-bundled.test.js && node tests/aionui-runtime-resources.test.js && node tests/aionui-wrapper-claude-proxy.test.js && node tests/aionui-wrapper-probe.test.js && node tests/aionui-wrapper-proxy-integration.test.js && node tests/aionui-wrapper-all-clis-autoconf.test.js && node tests/aionui-wrapper-env-signal.test.js && node tests/aionui-wrapper-csp-rewrite.test.js && node tests/aionui-wrapper-version-status.test.js && node tests/claude-proxy-daemon.test.js && node tests/claude-proxy-vscode-settings.test.js && node tests/claude-proxy-vscode-env.test.js && node tests/acptypes-patch.test.js && node tests/codex-approval-policy.test.js && node tests/version-check.test.js && node tests/runclaude-missing-binary.test.js && node tests/claude-code-configure-preserve.test.js && node tests/webui-claude-proxy-virtual-tool.test.js && node tests/webui-claude-proxy-ui.test.js && node tests/webui-response-consumer.test.js && node tests/webui-claude-proxy-install-gating.test.js",
8
8
  "prepublishOnly": "npm run build && npm test && node scripts/check-tarball-size.js"
9
9
  },
10
10
  "keywords": [