@simonyea/holysheep-cli 2.1.57 → 2.1.59
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 +2 -2
- package/dist/index.js +227 -14
- package/package.json +2 -2
package/dist/configure-worker.js
CHANGED
|
@@ -4086,11 +4086,11 @@ var require_package = __commonJS({
|
|
|
4086
4086
|
"package.json"(exports2, module2) {
|
|
4087
4087
|
module2.exports = {
|
|
4088
4088
|
name: "@simonyea/holysheep-cli",
|
|
4089
|
-
version: "2.1.
|
|
4089
|
+
version: "2.1.59",
|
|
4090
4090
|
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.",
|
|
4091
4091
|
scripts: {
|
|
4092
4092
|
build: "node scripts/build.mjs",
|
|
4093
|
-
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/version-check.test.js && node tests/runclaude-missing-binary.test.js",
|
|
4093
|
+
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/acptypes-patch.test.js && node tests/version-check.test.js && node tests/runclaude-missing-binary.test.js",
|
|
4094
4094
|
prepublishOnly: "npm run build && npm test && node scripts/check-tarball-size.js"
|
|
4095
4095
|
},
|
|
4096
4096
|
keywords: [
|
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.
|
|
15
|
+
version: "2.1.59",
|
|
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/version-check.test.js && node tests/runclaude-missing-binary.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/acptypes-patch.test.js && node tests/version-check.test.js && node tests/runclaude-missing-binary.test.js",
|
|
20
20
|
prepublishOnly: "npm run build && npm test && node scripts/check-tarball-size.js"
|
|
21
21
|
},
|
|
22
22
|
keywords: [
|
|
@@ -7578,15 +7578,19 @@ var require_server = __commonJS({
|
|
|
7578
7578
|
"claude-code": {
|
|
7579
7579
|
cmd: process.platform === "win32" ? 'powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "irm https://claude.ai/install.ps1 | iex"' : "curl -fsSL https://claude.ai/install.sh | bash"
|
|
7580
7580
|
},
|
|
7581
|
-
|
|
7581
|
+
// [v2.1.58] @openai/codex v0.111+ ships a Rust binary via postinstall.
|
|
7582
|
+
// --foreground-scripts forces npm to stream postinstall stdout (otherwise
|
|
7583
|
+
// npm hides it in non-TTY → Windows users see "正在安装" forever while the
|
|
7584
|
+
// binary download silently blocks). --no-fund/audit cuts noise.
|
|
7585
|
+
"codex": { cmd: "npm install -g @openai/codex --foreground-scripts --no-fund --no-audit" },
|
|
7582
7586
|
"droid": {
|
|
7583
7587
|
// 2.1.14 fix: Windows/Linux now have official installers; previously
|
|
7584
7588
|
// the WebUI piped the macOS-only brew command on every platform.
|
|
7585
7589
|
cmd: process.platform === "win32" ? "winget install --id Factory.Droid -e --accept-source-agreements --accept-package-agreements" : process.platform === "darwin" ? "brew install --cask droid" : "curl -fsSL https://app.factory.ai/install.sh | bash"
|
|
7586
7590
|
},
|
|
7587
|
-
"gemini-cli": { cmd: "npm install -g @google/gemini-cli" },
|
|
7588
|
-
"opencode": { cmd: "npm install -g opencode-ai" },
|
|
7589
|
-
"openclaw": { cmd: "npm install -g openclaw@latest" },
|
|
7591
|
+
"gemini-cli": { cmd: "npm install -g @google/gemini-cli --foreground-scripts --no-fund --no-audit" },
|
|
7592
|
+
"opencode": { cmd: "npm install -g opencode-ai --foreground-scripts --no-fund --no-audit" },
|
|
7593
|
+
"openclaw": { cmd: "npm install -g openclaw@latest --foreground-scripts --no-fund --no-audit" },
|
|
7590
7594
|
"aider": { cmd: "pip install aider-chat" },
|
|
7591
7595
|
// Hermes Agent (Nous Research). Python-based, installed via uv. Windows
|
|
7592
7596
|
// requires WSL2 (the installer explicitly rejects native Windows). On
|
|
@@ -7999,14 +8003,67 @@ var require_server = __commonJS({
|
|
|
7999
8003
|
}
|
|
8000
8004
|
sseStart(res);
|
|
8001
8005
|
sseEmit(res, { type: "progress", message: `\u6B63\u5728\u5B89\u88C5 ${toolId}...` });
|
|
8006
|
+
const installCmd = AUTO_INSTALL[toolId].cmd;
|
|
8007
|
+
const isNpmInstall = /^\s*npm\s+install\b/.test(installCmd);
|
|
8008
|
+
if (isNpmInstall) {
|
|
8009
|
+
let npmOk = false;
|
|
8010
|
+
try {
|
|
8011
|
+
const { commandExists: commandExists2 } = require_which();
|
|
8012
|
+
npmOk = commandExists2("npm") && commandExists2("node");
|
|
8013
|
+
} catch {
|
|
8014
|
+
}
|
|
8015
|
+
if (!npmOk) {
|
|
8016
|
+
sseEmit(res, {
|
|
8017
|
+
type: "output",
|
|
8018
|
+
text: `\u274C \u68C0\u6D4B\u4E0D\u5230 npm / node \u2014 \u8BF7\u5148\u5B89\u88C5 Node.js (https://nodejs.org)\uFF0C\u518D\u91CD\u542F hs web\u3002
|
|
8019
|
+
\u4E0B\u8F7D\u5B89\u88C5\u540E\uFF0C\u65B0\u5F00\u7EC8\u7AEF\u8FD0\u884C \`node --version\` \u5E94\u770B\u5230\u7248\u672C\u53F7\u3002
|
|
8020
|
+
`
|
|
8021
|
+
});
|
|
8022
|
+
sseEmit(res, { type: "done", success: false, message: "node-not-found" });
|
|
8023
|
+
return res.end();
|
|
8024
|
+
}
|
|
8025
|
+
}
|
|
8026
|
+
sseEmit(res, { type: "output", text: `> ${installCmd}
|
|
8027
|
+
` });
|
|
8002
8028
|
const INSTALL_TIMEOUT_MS = 10 * 60 * 1e3;
|
|
8029
|
+
const isWin = process.platform === "win32";
|
|
8003
8030
|
const ok = await new Promise((resolve) => {
|
|
8004
8031
|
var _a, _b;
|
|
8005
|
-
const
|
|
8032
|
+
const env = {
|
|
8033
|
+
...process.env,
|
|
8034
|
+
FORCE_COLOR: "0",
|
|
8035
|
+
NPM_CONFIG_FUND: "false",
|
|
8036
|
+
NPM_CONFIG_AUDIT: "false",
|
|
8037
|
+
NPM_CONFIG_PROGRESS: "false",
|
|
8038
|
+
NPM_CONFIG_LOGLEVEL: "http"
|
|
8039
|
+
// not too quiet, not too noisy
|
|
8040
|
+
};
|
|
8041
|
+
const spawnOpts = isWin ? { shell: process.env.ComSpec || "cmd.exe", windowsHide: true, env, stdio: ["ignore", "pipe", "pipe"] } : { shell: true, env, stdio: ["ignore", "pipe", "pipe"] };
|
|
8042
|
+
const cmdToRun = isWin && isNpmInstall ? `chcp 65001 >NUL & ${installCmd}` : installCmd;
|
|
8043
|
+
let child;
|
|
8044
|
+
try {
|
|
8045
|
+
child = spawn(cmdToRun, [], spawnOpts);
|
|
8046
|
+
} catch (e) {
|
|
8047
|
+
sseEmit(res, { type: "output", text: `
|
|
8048
|
+
\u274C spawn \u5931\u8D25: ${e.message}
|
|
8049
|
+
` });
|
|
8050
|
+
return resolve(false);
|
|
8051
|
+
}
|
|
8052
|
+
sseEmit(res, { type: "output", text: `[hs] \u5B50\u8FDB\u7A0B\u5DF2\u542F\u52A8 pid=${child.pid || "?"}\uFF0C\u7B49\u5F85\u8F93\u51FA\u2026
|
|
8053
|
+
` });
|
|
8054
|
+
let lastChunkAt = Date.now();
|
|
8055
|
+
const heartbeat = setInterval(() => {
|
|
8056
|
+
const idleSec = Math.round((Date.now() - lastChunkAt) / 1e3);
|
|
8057
|
+
if (idleSec >= 8) {
|
|
8058
|
+
sseEmit(res, { type: "output", text: `[hs] \u2026\u4ECD\u5728\u8FD0\u884C\uFF0C\u6700\u8FD1 ${idleSec}s \u65E0\u8F93\u51FA\uFF08postinstall \u4E0B\u8F7D\u4E8C\u8FDB\u5236\u4E2D\uFF1F\uFF09
|
|
8059
|
+
` });
|
|
8060
|
+
}
|
|
8061
|
+
}, 1e4);
|
|
8006
8062
|
const timer = setTimeout(() => {
|
|
8063
|
+
clearInterval(heartbeat);
|
|
8007
8064
|
sseEmit(res, { type: "output", text: `
|
|
8008
8065
|
\u26A0\uFE0F \u5B89\u88C5\u8D85\u65F6\uFF0810\u5206\u949F\uFF09\uFF0C\u8BF7\u624B\u52A8\u8FD0\u884C:
|
|
8009
|
-
${
|
|
8066
|
+
${installCmd}
|
|
8010
8067
|
` });
|
|
8011
8068
|
try {
|
|
8012
8069
|
child.kill("SIGKILL");
|
|
@@ -8014,14 +8071,41 @@ ${AUTO_INSTALL[toolId].cmd}
|
|
|
8014
8071
|
}
|
|
8015
8072
|
resolve(false);
|
|
8016
8073
|
}, INSTALL_TIMEOUT_MS);
|
|
8017
|
-
(_a = child.stdout) == null ? void 0 : _a.on("data", (chunk) =>
|
|
8018
|
-
|
|
8019
|
-
|
|
8074
|
+
(_a = child.stdout) == null ? void 0 : _a.on("data", (chunk) => {
|
|
8075
|
+
lastChunkAt = Date.now();
|
|
8076
|
+
sseEmit(res, { type: "output", text: chunk.toString("utf8") });
|
|
8077
|
+
});
|
|
8078
|
+
(_b = child.stderr) == null ? void 0 : _b.on("data", (chunk) => {
|
|
8079
|
+
lastChunkAt = Date.now();
|
|
8080
|
+
sseEmit(res, { type: "output", text: chunk.toString("utf8") });
|
|
8081
|
+
});
|
|
8082
|
+
child.on("close", (code, signal) => {
|
|
8020
8083
|
clearTimeout(timer);
|
|
8084
|
+
clearInterval(heartbeat);
|
|
8085
|
+
if (code !== 0) {
|
|
8086
|
+
sseEmit(res, { type: "output", text: `
|
|
8087
|
+
\u274C \u8FDB\u7A0B\u9000\u51FA code=${code} signal=${signal || "none"}
|
|
8088
|
+
` });
|
|
8089
|
+
if (isWin && isNpmInstall) {
|
|
8090
|
+
sseEmit(res, {
|
|
8091
|
+
type: "output",
|
|
8092
|
+
text: `\u5E38\u89C1\u539F\u56E0 (Windows):
|
|
8093
|
+
\u2022 postinstall \u4E0B\u8F7D\u4E8C\u8FDB\u5236\u88AB\u9632\u706B\u5899/\u6740\u6BD2\u62E6\u622A \u2192 \u5173\u95ED\u6740\u6BD2\u91CD\u8BD5\uFF0C\u6216\u5728\u7BA1\u7406\u5458 PowerShell \u8FD0\u884C\uFF1A
|
|
8094
|
+
${installCmd}
|
|
8095
|
+
\u2022 \u672C\u5730 HTTP \u4EE3\u7406 (Clash/Surge) \u5E72\u6270 \u2192 \u4E34\u65F6\u5173\u95ED\u4EE3\u7406\u6216\u8BBE HTTP_PROXY="" \u91CD\u8BD5
|
|
8096
|
+
\u2022 \u56FD\u5185\u7F51\u7EDC\u62C9 npm \u6162 \u2192 \u5207\u6362\u955C\u50CF\uFF1Anpm config set registry https://registry.npmmirror.com
|
|
8097
|
+
`
|
|
8098
|
+
});
|
|
8099
|
+
}
|
|
8100
|
+
}
|
|
8021
8101
|
resolve(code === 0);
|
|
8022
8102
|
});
|
|
8023
|
-
child.on("error", () => {
|
|
8103
|
+
child.on("error", (err) => {
|
|
8024
8104
|
clearTimeout(timer);
|
|
8105
|
+
clearInterval(heartbeat);
|
|
8106
|
+
sseEmit(res, { type: "output", text: `
|
|
8107
|
+
\u274C \u5B50\u8FDB\u7A0B\u9519\u8BEF: ${err.message}
|
|
8108
|
+
` });
|
|
8025
8109
|
resolve(false);
|
|
8026
8110
|
});
|
|
8027
8111
|
});
|
|
@@ -8861,12 +8945,15 @@ ${AUTO_INSTALL[toolId].cmd}
|
|
|
8861
8945
|
handleToolConfigure,
|
|
8862
8946
|
handleToolReset,
|
|
8863
8947
|
handleToolLaunch,
|
|
8948
|
+
handleToolUpgrade,
|
|
8949
|
+
handleUpgrade,
|
|
8864
8950
|
handleBalance,
|
|
8865
8951
|
handleDoctor,
|
|
8866
8952
|
handleWhoami,
|
|
8867
8953
|
handleStatus,
|
|
8868
8954
|
handleModels,
|
|
8869
|
-
handleEnv
|
|
8955
|
+
handleEnv,
|
|
8956
|
+
UPGRADABLE_TOOLS
|
|
8870
8957
|
};
|
|
8871
8958
|
}
|
|
8872
8959
|
});
|
|
@@ -9318,6 +9405,87 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9318
9405
|
d.addEventListener('click',function(){if(d.parentNode)d.parentNode.removeChild(d);sessionStorage.setItem(DISMISS_KEY,'1')});
|
|
9319
9406
|
setTimeout(function(){if(d.parentNode)d.parentNode.removeChild(d);},30000);
|
|
9320
9407
|
})();
|
|
9408
|
+
// [v2.1.59] CLI upgrade panel \u2014 floating "\u{1F527} CLI \u5DE5\u5177" button bottom-left
|
|
9409
|
+
(function(){
|
|
9410
|
+
var btn=el('div','position:fixed;bottom:16px;left:16px;z-index:99998;background:#2d3748;color:#fff;padding:8px 14px;border-radius:20px;font-size:12px;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.2);user-select:none','\u{1F527} CLI \u5DE5\u5177');
|
|
9411
|
+
btn.title='\u67E5\u770B/\u5347\u7EA7\u6240\u6709 CLI \u5DE5\u5177';
|
|
9412
|
+
document.body.appendChild(btn);
|
|
9413
|
+
var panel=null;
|
|
9414
|
+
btn.addEventListener('click',function(){
|
|
9415
|
+
if(panel){if(panel.parentNode)panel.parentNode.removeChild(panel);panel=null;return}
|
|
9416
|
+
panel=el('div','position:fixed;bottom:56px;left:16px;z-index:99998;background:#fff;color:#222;width:420px;max-height:70vh;overflow-y:auto;border-radius:8px;box-shadow:0 4px 20px rgba(0,0,0,.25);padding:16px;font-size:13px',
|
|
9417
|
+
'<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:12px"><b>CLI \u5DE5\u5177\u7BA1\u7406</b><span id="hs-cli-close" style="cursor:pointer;font-size:16px;color:#999">\xD7</span></div>'+
|
|
9418
|
+
'<div id="hs-cli-list" style="color:#666">\u52A0\u8F7D\u4E2D...</div>'+
|
|
9419
|
+
'<div id="hs-cli-log" style="margin-top:12px;font-size:11px;background:#1e1e1e;color:#0f0;padding:8px;border-radius:4px;max-height:200px;overflow-y:auto;display:none;font-family:monospace;white-space:pre-wrap"></div>');
|
|
9420
|
+
document.body.appendChild(panel);
|
|
9421
|
+
panel.querySelector('#hs-cli-close').addEventListener('click',function(){panel.parentNode.removeChild(panel);panel=null});
|
|
9422
|
+
var listEl=panel.querySelector('#hs-cli-list');
|
|
9423
|
+
var logEl=panel.querySelector('#hs-cli-log');
|
|
9424
|
+
function renderTools(tools){
|
|
9425
|
+
if(!tools.length){listEl.innerHTML='<i>\u6CA1\u6709\u53EF\u7528\u7684\u5DE5\u5177\u6570\u636E</i>';return}
|
|
9426
|
+
listEl.innerHTML=tools.map(function(t){
|
|
9427
|
+
var statusBadge=t.installed?(t.configured?'<span style="color:#22c55e">\u25CF\u5DF2\u914D\u7F6E</span>':'<span style="color:#f59e0b">\u25CF\u5DF2\u88C5\u672A\u914D\u7F6E</span>'):'<span style="color:#9ca3af">\u25CB\u672A\u5B89\u88C5</span>';
|
|
9428
|
+
var verText=t.version?'<span style="color:#888;font-size:11px">v'+t.version+'</span>':'';
|
|
9429
|
+
var btns='';
|
|
9430
|
+
if(!t.installed&&t.canAutoInstall)btns+='<button data-act="install" data-id="'+t.id+'" style="margin-left:6px;padding:3px 8px;font-size:11px;background:#3b82f6;color:#fff;border:0;border-radius:3px;cursor:pointer">\u5B89\u88C5</button>';
|
|
9431
|
+
if(t.installed&&t.canUpgrade)btns+='<button data-act="upgrade" data-id="'+t.id+'" style="margin-left:6px;padding:3px 8px;font-size:11px;background:#22c55e;color:#fff;border:0;border-radius:3px;cursor:pointer">\u5347\u7EA7</button>';
|
|
9432
|
+
if(t.installed&&!t.configured)btns+='<button data-act="configure" data-id="'+t.id+'" style="margin-left:6px;padding:3px 8px;font-size:11px;background:#8b5cf6;color:#fff;border:0;border-radius:3px;cursor:pointer">\u914D\u7F6E</button>';
|
|
9433
|
+
return '<div style="padding:8px 0;border-bottom:1px solid #eee;display:flex;justify-content:space-between;align-items:center"><div><b>'+t.name+'</b> '+statusBadge+' '+verText+'</div><div>'+btns+'</div></div>';
|
|
9434
|
+
}).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>';
|
|
9435
|
+
Array.prototype.forEach.call(panel.querySelectorAll('button[data-act]'),function(b){
|
|
9436
|
+
b.addEventListener('click',function(){runAction(b.dataset.act,b.dataset.id,b)});
|
|
9437
|
+
});
|
|
9438
|
+
var allBtn=panel.querySelector('#hs-cli-upgrade-all');
|
|
9439
|
+
if(allBtn)allBtn.addEventListener('click',function(){runAllUpgrade(allBtn)});
|
|
9440
|
+
}
|
|
9441
|
+
function runAction(act,id,b){
|
|
9442
|
+
b.disabled=true;b.style.opacity='.5';b.textContent=act==='install'?'\u5B89\u88C5\u4E2D...':act==='upgrade'?'\u5347\u7EA7\u4E2D...':'\u914D\u7F6E\u4E2D...';
|
|
9443
|
+
logEl.style.display='block';logEl.textContent='';
|
|
9444
|
+
var path=act==='install'?'tool/install':act==='upgrade'?'tool/upgrade':'tool/configure';
|
|
9445
|
+
consumeSse('/api/holysheep/'+path,{toolId:id},logEl,function(ok){
|
|
9446
|
+
b.disabled=false;b.style.opacity='1';b.textContent=ok?'\u2713 \u5B8C\u6210':'\u2717 \u5931\u8D25 (\u91CD\u8BD5)';
|
|
9447
|
+
setTimeout(loadTools,500);
|
|
9448
|
+
});
|
|
9449
|
+
}
|
|
9450
|
+
function runAllUpgrade(b){
|
|
9451
|
+
b.disabled=true;b.style.opacity='.5';b.textContent='\u5347\u7EA7\u4E2D...';
|
|
9452
|
+
logEl.style.display='block';logEl.textContent='';
|
|
9453
|
+
consumeSse('/api/holysheep/upgrade',{},logEl,function(ok){
|
|
9454
|
+
b.disabled=false;b.style.opacity='1';b.textContent=ok?'\u2713 \u5168\u90E8\u5347\u7EA7\u5B8C\u6210':'\u2717 \u90E8\u5206\u5931\u8D25';
|
|
9455
|
+
setTimeout(loadTools,500);
|
|
9456
|
+
});
|
|
9457
|
+
}
|
|
9458
|
+
function consumeSse(url,body,logEl,done){
|
|
9459
|
+
fetch(url,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(body||{})}).then(function(r){
|
|
9460
|
+
var reader=r.body.getReader();var dec=new TextDecoder();var buf='';var ok=true;
|
|
9461
|
+
function pump(){
|
|
9462
|
+
reader.read().then(function(s){
|
|
9463
|
+
if(s.done){return done(ok)}
|
|
9464
|
+
buf+=dec.decode(s.value,{stream:true});
|
|
9465
|
+
var parts=buf.split('\\n\\n');buf=parts.pop();
|
|
9466
|
+
parts.forEach(function(p){
|
|
9467
|
+
var line=p.split('\\n').find(function(l){return l.startsWith('data:')});
|
|
9468
|
+
if(!line)return;
|
|
9469
|
+
try{
|
|
9470
|
+
var ev=JSON.parse(line.slice(5).trim());
|
|
9471
|
+
if(ev.type==='output'&&ev.text){logEl.textContent+=ev.text;logEl.scrollTop=logEl.scrollHeight}
|
|
9472
|
+
else if(ev.type==='progress'&&ev.message){logEl.textContent+='\u2192 '+ev.message+'\\n';logEl.scrollTop=logEl.scrollHeight}
|
|
9473
|
+
else if(ev.type==='tool'&&ev.status){logEl.textContent+='['+ev.name+'] '+ev.status+(ev.newVer?' v'+ev.newVer:'')+'\\n'}
|
|
9474
|
+
else if(ev.type==='done'){if(ev.success===false)ok=false}
|
|
9475
|
+
}catch(e){}
|
|
9476
|
+
});
|
|
9477
|
+
pump();
|
|
9478
|
+
}).catch(function(e){logEl.textContent+='\\n[\u9519\u8BEF] '+e.message;done(false)})
|
|
9479
|
+
}
|
|
9480
|
+
pump();
|
|
9481
|
+
}).catch(function(e){logEl.textContent='\u8BF7\u6C42\u5931\u8D25: '+e.message;done(false)});
|
|
9482
|
+
}
|
|
9483
|
+
function loadTools(){
|
|
9484
|
+
fetch('/api/holysheep/tools').then(function(r){return r.json()}).then(renderTools).catch(function(e){listEl.innerHTML='<i style="color:#dc2626">\u52A0\u8F7D\u5931\u8D25: '+e.message+'</i>'});
|
|
9485
|
+
}
|
|
9486
|
+
loadTools();
|
|
9487
|
+
});
|
|
9488
|
+
})();
|
|
9321
9489
|
// 2) AionUi/CLI upgrade banner \u2014 async fetch
|
|
9322
9490
|
(function(){
|
|
9323
9491
|
if(sessionStorage.getItem(UPGRADE_DISMISS_KEY))return;
|
|
@@ -9362,6 +9530,24 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9362
9530
|
</script>`;
|
|
9363
9531
|
}
|
|
9364
9532
|
__name(_buildStartupBannerScript, "_buildStartupBannerScript");
|
|
9533
|
+
function _patchAcpTypesJs(src) {
|
|
9534
|
+
if (!src || typeof src !== "string") return src;
|
|
9535
|
+
let out = src;
|
|
9536
|
+
for (const id of ["qwen", "codebuddy"]) {
|
|
9537
|
+
const re = new RegExp(`(${id}:\\{[^{}]*?enabled:)!0`, "g");
|
|
9538
|
+
out = out.replace(re, "$1!1");
|
|
9539
|
+
}
|
|
9540
|
+
const PRIORITY = ["codex", "claude", "opencode"];
|
|
9541
|
+
const priorityJs = JSON.stringify(PRIORITY);
|
|
9542
|
+
const filterMapRe = /(Object\.entries\([a-z]\)\.filter\(\([^)]*\)=>[^)]*\))\.map\(/;
|
|
9543
|
+
const m = out.match(filterMapRe);
|
|
9544
|
+
if (m) {
|
|
9545
|
+
const sortFn = `.sort(function(a,b){var P=${priorityJs};var ai=P.indexOf(a[0]);var bi=P.indexOf(b[0]);if(ai===-1&&bi===-1)return 0;if(ai===-1)return 1;if(bi===-1)return -1;return ai-bi})`;
|
|
9546
|
+
out = out.replace(filterMapRe, m[1] + sortFn + ".map(");
|
|
9547
|
+
}
|
|
9548
|
+
return out;
|
|
9549
|
+
}
|
|
9550
|
+
__name(_patchAcpTypesJs, "_patchAcpTypesJs");
|
|
9365
9551
|
var BODYLESS_METHODS = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
|
|
9366
9552
|
function proxyHttp(req, res, internalPort) {
|
|
9367
9553
|
const headers = { ...req.headers };
|
|
@@ -9412,6 +9598,25 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9412
9598
|
});
|
|
9413
9599
|
return;
|
|
9414
9600
|
}
|
|
9601
|
+
const isAcpTypes = /\/assets\/acpTypes-[^/]+\.js(\?|$)/.test(req.url || "");
|
|
9602
|
+
if (isAcpTypes && (upRes.statusCode || 0) < 400) {
|
|
9603
|
+
delete outHeaders["content-length"];
|
|
9604
|
+
delete outHeaders["content-encoding"];
|
|
9605
|
+
res.writeHead(upRes.statusCode, upRes.statusMessage, outHeaders);
|
|
9606
|
+
const chunks = [];
|
|
9607
|
+
upRes.on("data", (c) => chunks.push(c));
|
|
9608
|
+
upRes.on("end", () => {
|
|
9609
|
+
const src = Buffer.concat(chunks).toString("utf8");
|
|
9610
|
+
res.end(_patchAcpTypesJs(src));
|
|
9611
|
+
});
|
|
9612
|
+
upRes.on("error", () => {
|
|
9613
|
+
try {
|
|
9614
|
+
res.end();
|
|
9615
|
+
} catch {
|
|
9616
|
+
}
|
|
9617
|
+
});
|
|
9618
|
+
return;
|
|
9619
|
+
}
|
|
9415
9620
|
res.writeHead(upRes.statusCode, upRes.statusMessage, outHeaders);
|
|
9416
9621
|
upRes.pipe(res);
|
|
9417
9622
|
});
|
|
@@ -9584,6 +9789,12 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9584
9789
|
if (route === "/api/holysheep/tool/launch" && req.method === "POST") {
|
|
9585
9790
|
return await legacy().handleToolLaunch(req, res);
|
|
9586
9791
|
}
|
|
9792
|
+
if (route === "/api/holysheep/tool/upgrade" && req.method === "POST") {
|
|
9793
|
+
return await legacy().handleToolUpgrade(req, res);
|
|
9794
|
+
}
|
|
9795
|
+
if (route === "/api/holysheep/upgrade" && req.method === "POST") {
|
|
9796
|
+
return await legacy().handleUpgrade(req, res);
|
|
9797
|
+
}
|
|
9587
9798
|
if (route === "/api/holysheep/__wrapper/healthz") {
|
|
9588
9799
|
return sendJson(res, 200, {
|
|
9589
9800
|
ok: true,
|
|
@@ -10230,7 +10441,9 @@ ${tail.split(/\r?\n/).map((ln) => ` ${ln}`).join("\n")}
|
|
|
10230
10441
|
_getVersionStatus,
|
|
10231
10442
|
_semverCmp,
|
|
10232
10443
|
_readNpmCacheLatest,
|
|
10233
|
-
VERSION_CACHE_FILE
|
|
10444
|
+
VERSION_CACHE_FILE,
|
|
10445
|
+
// [HolySheep v2.1.59] acpTypes JS rewrite for agent ordering / hiding
|
|
10446
|
+
_patchAcpTypesJs
|
|
10234
10447
|
};
|
|
10235
10448
|
}
|
|
10236
10449
|
});
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simonyea/holysheep-cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.59",
|
|
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/version-check.test.js && node tests/runclaude-missing-binary.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/acptypes-patch.test.js && node tests/version-check.test.js && node tests/runclaude-missing-binary.test.js",
|
|
8
8
|
"prepublishOnly": "npm run build && npm test && node scripts/check-tarball-size.js"
|
|
9
9
|
},
|
|
10
10
|
"keywords": [
|