@simonyea/holysheep-cli 2.1.57 → 2.1.58
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 +1 -1
- package/dist/index.js +95 -11
- package/package.json +1 -1
package/dist/configure-worker.js
CHANGED
|
@@ -4086,7 +4086,7 @@ 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.58",
|
|
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",
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ 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.58",
|
|
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",
|
|
@@ -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
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simonyea/holysheep-cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.58",
|
|
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",
|