@simonyea/holysheep-cli 2.1.50 → 2.1.51
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/aionui-resources/assistant/academic-paper/academic-paper.md +25 -0
- package/dist/aionui-resources/assistant/academic-paper/academic-paper.ru-RU.md +25 -0
- package/dist/aionui-resources/assistant/academic-paper/academic-paper.zh-CN.md +25 -0
- package/dist/aionui-resources/assistant/beautiful-mermaid/beautiful-mermaid.md +31 -0
- package/dist/aionui-resources/assistant/beautiful-mermaid/beautiful-mermaid.ru-RU.md +31 -0
- package/dist/aionui-resources/assistant/beautiful-mermaid/beautiful-mermaid.zh-CN.md +31 -0
- package/dist/aionui-resources/assistant/cowork/cowork-skills.md +814 -0
- package/dist/aionui-resources/assistant/cowork/cowork-skills.ru-RU.md +814 -0
- package/dist/aionui-resources/assistant/cowork/cowork-skills.zh-CN.md +803 -0
- package/dist/aionui-resources/assistant/cowork/cowork.md +56 -0
- package/dist/aionui-resources/assistant/cowork/cowork.ru-RU.md +56 -0
- package/dist/aionui-resources/assistant/cowork/cowork.zh-CN.md +409 -0
- package/dist/aionui-resources/assistant/dashboard-creator/dashboard-creator.md +25 -0
- package/dist/aionui-resources/assistant/dashboard-creator/dashboard-creator.ru-RU.md +25 -0
- package/dist/aionui-resources/assistant/dashboard-creator/dashboard-creator.zh-CN.md +25 -0
- package/dist/aionui-resources/assistant/excel-creator/excel-creator.md +33 -0
- package/dist/aionui-resources/assistant/excel-creator/excel-creator.ru-RU.md +33 -0
- package/dist/aionui-resources/assistant/excel-creator/excel-creator.zh-CN.md +33 -0
- package/dist/aionui-resources/assistant/financial-model-creator/financial-model-creator.md +25 -0
- package/dist/aionui-resources/assistant/financial-model-creator/financial-model-creator.ru-RU.md +25 -0
- package/dist/aionui-resources/assistant/financial-model-creator/financial-model-creator.zh-CN.md +25 -0
- package/dist/aionui-resources/assistant/game-3d/game-3d.md +255 -0
- package/dist/aionui-resources/assistant/game-3d/game-3d.ru-RU.md +255 -0
- package/dist/aionui-resources/assistant/game-3d/game-3d.zh-CN.md +255 -0
- package/dist/aionui-resources/assistant/human-3-coach/human-3-coach.md +276 -0
- package/dist/aionui-resources/assistant/human-3-coach/human-3-coach.ru-RU.md +276 -0
- package/dist/aionui-resources/assistant/human-3-coach/human-3-coach.zh-CN.md +276 -0
- package/dist/aionui-resources/assistant/moltbook/moltbook-skills.md +88 -0
- package/dist/aionui-resources/assistant/moltbook/moltbook-skills.ru-RU.md +88 -0
- package/dist/aionui-resources/assistant/moltbook/moltbook-skills.zh-CN.md +88 -0
- package/dist/aionui-resources/assistant/moltbook/moltbook.md +216 -0
- package/dist/aionui-resources/assistant/moltbook/moltbook.ru-RU.md +216 -0
- package/dist/aionui-resources/assistant/moltbook/moltbook.zh-CN.md +216 -0
- package/dist/aionui-resources/assistant/morph-ppt/morph-ppt.md +25 -0
- package/dist/aionui-resources/assistant/morph-ppt/morph-ppt.ru-RU.md +25 -0
- package/dist/aionui-resources/assistant/morph-ppt/morph-ppt.zh-CN.md +25 -0
- package/dist/aionui-resources/assistant/morph-ppt-3d/morph-ppt-3d.md +54 -0
- package/dist/aionui-resources/assistant/morph-ppt-3d/morph-ppt-3d.zh-CN.md +54 -0
- package/dist/aionui-resources/assistant/openclaw-setup/openclaw-setup.md +334 -0
- package/dist/aionui-resources/assistant/openclaw-setup/openclaw-setup.ru-RU.md +334 -0
- package/dist/aionui-resources/assistant/openclaw-setup/openclaw-setup.zh-CN.md +347 -0
- package/dist/aionui-resources/assistant/pitch-deck-creator/pitch-deck-creator.md +23 -0
- package/dist/aionui-resources/assistant/pitch-deck-creator/pitch-deck-creator.ru-RU.md +23 -0
- package/dist/aionui-resources/assistant/pitch-deck-creator/pitch-deck-creator.zh-CN.md +23 -0
- package/dist/aionui-resources/assistant/planning-with-files/planning-with-files.md +395 -0
- package/dist/aionui-resources/assistant/planning-with-files/planning-with-files.ru-RU.md +395 -0
- package/dist/aionui-resources/assistant/planning-with-files/planning-with-files.zh-CN.md +395 -0
- package/dist/aionui-resources/assistant/planning-with-files/templates/findings.md +106 -0
- package/dist/aionui-resources/assistant/planning-with-files/templates/progress.md +126 -0
- package/dist/aionui-resources/assistant/planning-with-files/templates/task_plan.md +156 -0
- package/dist/aionui-resources/assistant/ppt-creator/ppt-creator.md +33 -0
- package/dist/aionui-resources/assistant/ppt-creator/ppt-creator.ru-RU.md +33 -0
- package/dist/aionui-resources/assistant/ppt-creator/ppt-creator.zh-CN.md +33 -0
- package/dist/aionui-resources/assistant/social-job-publisher/social-job-publisher-skills.md +137 -0
- package/dist/aionui-resources/assistant/social-job-publisher/social-job-publisher-skills.ru-RU.md +137 -0
- package/dist/aionui-resources/assistant/social-job-publisher/social-job-publisher-skills.zh-CN.md +137 -0
- package/dist/aionui-resources/assistant/social-job-publisher/social-job-publisher.md +127 -0
- package/dist/aionui-resources/assistant/social-job-publisher/social-job-publisher.ru-RU.md +127 -0
- package/dist/aionui-resources/assistant/social-job-publisher/social-job-publisher.zh-CN.md +131 -0
- package/dist/aionui-resources/assistant/star-office-helper/star-office-helper.md +50 -0
- package/dist/aionui-resources/assistant/star-office-helper/star-office-helper.ru-RU.md +50 -0
- package/dist/aionui-resources/assistant/star-office-helper/star-office-helper.zh-CN.md +50 -0
- package/dist/aionui-resources/assistant/story-roleplay/story-roleplay.md +239 -0
- package/dist/aionui-resources/assistant/story-roleplay/story-roleplay.ru-RU.md +239 -0
- package/dist/aionui-resources/assistant/story-roleplay/story-roleplay.zh-CN.md +239 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/README.md +60 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/data/charts.csv +26 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/data/colors.csv +97 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/data/landing.csv +31 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/data/products.csv +97 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/data/prompts.csv +24 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/data/styles.csv +59 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/data/typography.csv +58 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/scripts/core.py +239 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/scripts/search.py +61 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/ui-ux-pro-max.md +244 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/ui-ux-pro-max.ru-RU.md +244 -0
- package/dist/aionui-resources/assistant/ui-ux-pro-max/ui-ux-pro-max.zh-CN.md +244 -0
- package/dist/aionui-resources/assistant/word-creator/word-creator.md +32 -0
- package/dist/aionui-resources/assistant/word-creator/word-creator.ru-RU.md +32 -0
- package/dist/aionui-resources/assistant/word-creator/word-creator.zh-CN.md +32 -0
- package/dist/configure-worker.js +3 -2
- package/dist/index.js +119 -84
- package/package.json +3 -2
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.51",
|
|
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/opencode-default-model.test.js && node tests/paths-bundled.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/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/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/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: [
|
|
@@ -74,6 +74,7 @@ var require_package = __commonJS({
|
|
|
74
74
|
"dist/process-proxy-inject.js",
|
|
75
75
|
"dist/index.html",
|
|
76
76
|
"dist/pty-hermes-wrapper.py",
|
|
77
|
+
"dist/aionui-resources/assistant",
|
|
77
78
|
"README.md",
|
|
78
79
|
"LICENSE"
|
|
79
80
|
],
|
|
@@ -741,7 +742,7 @@ var require_claude_process_proxy = __commonJS({
|
|
|
741
742
|
"src/tools/claude-process-proxy.js"(exports2, module2) {
|
|
742
743
|
"use strict";
|
|
743
744
|
var fs = require("fs");
|
|
744
|
-
var
|
|
745
|
+
var http2 = require("http");
|
|
745
746
|
var https = require("https");
|
|
746
747
|
var net = require("net");
|
|
747
748
|
var path = require("path");
|
|
@@ -1122,7 +1123,7 @@ var require_claude_process_proxy = __commonJS({
|
|
|
1122
1123
|
})}`
|
|
1123
1124
|
);
|
|
1124
1125
|
}
|
|
1125
|
-
forwardReq =
|
|
1126
|
+
forwardReq = http2.request({
|
|
1126
1127
|
host: upstream.hostname,
|
|
1127
1128
|
port: Number(upstream.port || 80),
|
|
1128
1129
|
method: clientReq.method,
|
|
@@ -1195,7 +1196,7 @@ var require_claude_process_proxy = __commonJS({
|
|
|
1195
1196
|
function createConnectTunnel(proxyUrl, target, headers) {
|
|
1196
1197
|
return new Promise((resolve, reject) => {
|
|
1197
1198
|
const upstream = new URL2(proxyUrl);
|
|
1198
|
-
const request =
|
|
1199
|
+
const request = http2.request({
|
|
1199
1200
|
host: upstream.hostname,
|
|
1200
1201
|
port: Number(upstream.port || 80),
|
|
1201
1202
|
method: "CONNECT",
|
|
@@ -1270,7 +1271,7 @@ var require_claude_process_proxy = __commonJS({
|
|
|
1270
1271
|
}
|
|
1271
1272
|
__name(pipeWithCleanup, "pipeWithCleanup");
|
|
1272
1273
|
function createProcessProxyServer({ sessionId, configPath = CONFIG_PATH, allowAnthropicConnect = false }) {
|
|
1273
|
-
const server =
|
|
1274
|
+
const server = http2.createServer(async (clientReq, clientRes) => {
|
|
1274
1275
|
if (clientReq.method === "GET" && !clientReq.url.startsWith("http")) {
|
|
1275
1276
|
const u = clientReq.url.split("?")[0];
|
|
1276
1277
|
if (u === LOCAL_PING_PATH) {
|
|
@@ -2481,7 +2482,7 @@ var require_openclaw_bridge = __commonJS({
|
|
|
2481
2482
|
"src/tools/openclaw-bridge.js"(exports2, module2) {
|
|
2482
2483
|
"use strict";
|
|
2483
2484
|
var fs = require("fs");
|
|
2484
|
-
var
|
|
2485
|
+
var http2 = require("http");
|
|
2485
2486
|
var path = require("path");
|
|
2486
2487
|
var os = require("os");
|
|
2487
2488
|
var fetch = global.fetch || require("node-fetch");
|
|
@@ -3217,9 +3218,9 @@ var require_openclaw_bridge = __commonJS({
|
|
|
3217
3218
|
const host = config.gatewayHost || "127.0.0.1";
|
|
3218
3219
|
const timeout = Number((_a = config.watchdog) == null ? void 0 : _a.requestTimeoutMs) || DEFAULT_WATCHDOG_REQUEST_TIMEOUT_MS;
|
|
3219
3220
|
try {
|
|
3220
|
-
const
|
|
3221
|
+
const http3 = require("http");
|
|
3221
3222
|
await new Promise((resolve, reject) => {
|
|
3222
|
-
const req =
|
|
3223
|
+
const req = http3.get({ hostname: host, port: gatewayPort, path: "/", family: 4 }, resolve);
|
|
3223
3224
|
req.setTimeout(timeout, () => {
|
|
3224
3225
|
req.destroy();
|
|
3225
3226
|
reject(new Error("timeout"));
|
|
@@ -3276,7 +3277,7 @@ var require_openclaw_bridge = __commonJS({
|
|
|
3276
3277
|
}
|
|
3277
3278
|
__name(startGatewayWatchdog, "startGatewayWatchdog");
|
|
3278
3279
|
function createBridgeServer(configPath = BRIDGE_CONFIG_FILE) {
|
|
3279
|
-
return
|
|
3280
|
+
return http2.createServer(async (req, res) => {
|
|
3280
3281
|
if (req.method === "OPTIONS") {
|
|
3281
3282
|
res.writeHead(204, {
|
|
3282
3283
|
"access-control-allow-origin": "*",
|
|
@@ -6004,7 +6005,7 @@ var require_aionui_runtime_fetcher = __commonJS({
|
|
|
6004
6005
|
var os = require("os");
|
|
6005
6006
|
var crypto = require("crypto");
|
|
6006
6007
|
var https = require("https");
|
|
6007
|
-
var
|
|
6008
|
+
var http2 = require("http");
|
|
6008
6009
|
var USER_CACHE_DIR = path.join(os.homedir(), ".holysheep", "aionui-runtime");
|
|
6009
6010
|
var VENDOR_DIR = path.join(__dirname, "vendor", "aionui");
|
|
6010
6011
|
var DEFAULT_RUNTIME_URL = "https://mail.holysheep.ai/app/cli/aionui-runtime-v1.9.18-holysheep-hs35.tar.gz";
|
|
@@ -6179,7 +6180,7 @@ var require_aionui_runtime_fetcher = __commonJS({
|
|
|
6179
6180
|
return new Promise((resolve, reject) => {
|
|
6180
6181
|
const tmpFile = path.join(os.tmpdir(), `aionui-runtime-${Date.now()}.tar.gz`);
|
|
6181
6182
|
logger(`Downloading HolySheep runtime from ${url}`);
|
|
6182
|
-
const client = url.startsWith("https:") ? https :
|
|
6183
|
+
const client = url.startsWith("https:") ? https : http2;
|
|
6183
6184
|
const file = fs.createWriteStream(tmpFile);
|
|
6184
6185
|
const hasher = crypto.createHash("sha256");
|
|
6185
6186
|
let totalBytes = 0;
|
|
@@ -7325,7 +7326,7 @@ var require_server = __commonJS({
|
|
|
7325
7326
|
"use strict";
|
|
7326
7327
|
var dns = require("dns");
|
|
7327
7328
|
dns.setServers([.../* @__PURE__ */ new Set([...dns.getServers(), "1.1.1.1", "223.5.5.5"])]);
|
|
7328
|
-
var
|
|
7329
|
+
var http2 = require("http");
|
|
7329
7330
|
var fs = require("fs");
|
|
7330
7331
|
var path = require("path");
|
|
7331
7332
|
var { execSync, spawn } = require("child_process");
|
|
@@ -8339,7 +8340,7 @@ ${AUTO_INSTALL[toolId].cmd}
|
|
|
8339
8340
|
}
|
|
8340
8341
|
}
|
|
8341
8342
|
}
|
|
8342
|
-
json(res, { ok: true, type: "terminal", cmd });
|
|
8343
|
+
json(res, { ok: true, type: "terminal", cmd, launchCmd: cmd });
|
|
8343
8344
|
}
|
|
8344
8345
|
__name(handleToolLaunch, "handleToolLaunch");
|
|
8345
8346
|
async function handleClaudeProxyStart(_req, res) {
|
|
@@ -8657,7 +8658,7 @@ ${AUTO_INSTALL[toolId].cmd}
|
|
|
8657
8658
|
__name(handleRequest, "handleRequest");
|
|
8658
8659
|
function startServer(port) {
|
|
8659
8660
|
return new Promise((resolve, reject) => {
|
|
8660
|
-
const server =
|
|
8661
|
+
const server = http2.createServer(handleRequest);
|
|
8661
8662
|
server.on("error", (err) => {
|
|
8662
8663
|
var _a;
|
|
8663
8664
|
if (err.code === "EADDRINUSE") {
|
|
@@ -8677,7 +8678,7 @@ ${AUTO_INSTALL[toolId].cmd}
|
|
|
8677
8678
|
} catch {
|
|
8678
8679
|
}
|
|
8679
8680
|
setTimeout(() => {
|
|
8680
|
-
const retry =
|
|
8681
|
+
const retry = http2.createServer(handleRequest);
|
|
8681
8682
|
retry.on("error", (err2) => reject(err2));
|
|
8682
8683
|
retry.listen(port, "127.0.0.1", () => {
|
|
8683
8684
|
workspaceRuntime.startScheduler();
|
|
@@ -8706,9 +8707,9 @@ ${AUTO_INSTALL[toolId].cmd}
|
|
|
8706
8707
|
const bridgePort = ((_a = openclawTool.getBridgePort) == null ? void 0 : _a.call(openclawTool)) || 18788;
|
|
8707
8708
|
let bridgeAlive = false;
|
|
8708
8709
|
try {
|
|
8709
|
-
const
|
|
8710
|
+
const http3 = require("http");
|
|
8710
8711
|
await new Promise((resolve, reject) => {
|
|
8711
|
-
const req =
|
|
8712
|
+
const req = http3.get({ hostname: "127.0.0.1", port: bridgePort, path: "/health", family: 4 }, resolve);
|
|
8712
8713
|
req.setTimeout(2e3, () => {
|
|
8713
8714
|
req.destroy();
|
|
8714
8715
|
reject();
|
|
@@ -8780,7 +8781,7 @@ ${AUTO_INSTALL[toolId].cmd}
|
|
|
8780
8781
|
var require_aionui_wrapper = __commonJS({
|
|
8781
8782
|
"src/webui/aionui-wrapper.js"(exports2, module2) {
|
|
8782
8783
|
"use strict";
|
|
8783
|
-
var
|
|
8784
|
+
var http2 = require("http");
|
|
8784
8785
|
var net = require("net");
|
|
8785
8786
|
var fs = require("fs");
|
|
8786
8787
|
var path = require("path");
|
|
@@ -8906,6 +8907,79 @@ var require_aionui_wrapper = __commonJS({
|
|
|
8906
8907
|
}
|
|
8907
8908
|
}
|
|
8908
8909
|
__name(loadBridgeCredentials, "loadBridgeCredentials");
|
|
8910
|
+
function copyDirRecursive(src, dest) {
|
|
8911
|
+
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
8912
|
+
fs.cpSync(src, dest, { recursive: true, force: true });
|
|
8913
|
+
}
|
|
8914
|
+
__name(copyDirRecursive, "copyDirRecursive");
|
|
8915
|
+
function countFiles(dir) {
|
|
8916
|
+
let total = 0;
|
|
8917
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
8918
|
+
const p = path.join(dir, entry.name);
|
|
8919
|
+
if (entry.isDirectory()) total += countFiles(p);
|
|
8920
|
+
else if (entry.isFile()) total++;
|
|
8921
|
+
}
|
|
8922
|
+
return total;
|
|
8923
|
+
}
|
|
8924
|
+
__name(countFiles, "countFiles");
|
|
8925
|
+
function findBundledAssistantResources() {
|
|
8926
|
+
try {
|
|
8927
|
+
const { PACKAGE_ROOT } = require_paths();
|
|
8928
|
+
const candidates = [
|
|
8929
|
+
path.join(PACKAGE_ROOT, "dist", "aionui-resources", "assistant"),
|
|
8930
|
+
path.join(PACKAGE_ROOT, "aionui-fork", "src", "process", "resources", "assistant")
|
|
8931
|
+
];
|
|
8932
|
+
return candidates.find((dir) => fs.existsSync(dir)) || null;
|
|
8933
|
+
} catch {
|
|
8934
|
+
return null;
|
|
8935
|
+
}
|
|
8936
|
+
}
|
|
8937
|
+
__name(findBundledAssistantResources, "findBundledAssistantResources");
|
|
8938
|
+
function ensureRuntimeAssistantResources(runtimeDir) {
|
|
8939
|
+
const dest = path.join(runtimeDir, "src", "process", "resources", "assistant");
|
|
8940
|
+
try {
|
|
8941
|
+
if (fs.existsSync(dest) && countFiles(dest) > 0) {
|
|
8942
|
+
return { copied: false, dest, reason: "already-present" };
|
|
8943
|
+
}
|
|
8944
|
+
} catch {
|
|
8945
|
+
}
|
|
8946
|
+
const src = findBundledAssistantResources();
|
|
8947
|
+
if (!src) {
|
|
8948
|
+
log("warn: bundled AionUi assistant resources not found; builtin assistant rules may be unavailable");
|
|
8949
|
+
return { copied: false, dest, reason: "source-missing" };
|
|
8950
|
+
}
|
|
8951
|
+
copyDirRecursive(src, dest);
|
|
8952
|
+
const files = countFiles(dest);
|
|
8953
|
+
log(`hydrated AionUi assistant resources (${files} files) \u2192 ${dest}`);
|
|
8954
|
+
return { copied: true, src, dest, files };
|
|
8955
|
+
}
|
|
8956
|
+
__name(ensureRuntimeAssistantResources, "ensureRuntimeAssistantResources");
|
|
8957
|
+
function ensureRuntimeSkillsResources(runtimeDir) {
|
|
8958
|
+
const dest = path.join(runtimeDir, "src", "process", "resources", "skills");
|
|
8959
|
+
try {
|
|
8960
|
+
if (fs.existsSync(dest) && countFiles(dest) > 0) {
|
|
8961
|
+
return { copied: false, dest, reason: "already-present" };
|
|
8962
|
+
}
|
|
8963
|
+
} catch {
|
|
8964
|
+
}
|
|
8965
|
+
const src = path.join(runtimeDir, "dist-server", "skills");
|
|
8966
|
+
if (!fs.existsSync(src)) {
|
|
8967
|
+
log("warn: AionUi runtime skills resources not found; builtin skills may be unavailable");
|
|
8968
|
+
return { copied: false, dest, reason: "source-missing" };
|
|
8969
|
+
}
|
|
8970
|
+
copyDirRecursive(src, dest);
|
|
8971
|
+
const files = countFiles(dest);
|
|
8972
|
+
log(`hydrated AionUi skills resources (${files} files) \u2192 ${dest}`);
|
|
8973
|
+
return { copied: true, src, dest, files };
|
|
8974
|
+
}
|
|
8975
|
+
__name(ensureRuntimeSkillsResources, "ensureRuntimeSkillsResources");
|
|
8976
|
+
function ensureRuntimeBuiltinResources(runtimeDir) {
|
|
8977
|
+
return {
|
|
8978
|
+
assistant: ensureRuntimeAssistantResources(runtimeDir),
|
|
8979
|
+
skills: ensureRuntimeSkillsResources(runtimeDir)
|
|
8980
|
+
};
|
|
8981
|
+
}
|
|
8982
|
+
__name(ensureRuntimeBuiltinResources, "ensureRuntimeBuiltinResources");
|
|
8909
8983
|
function detectHolySheepAionUi(runtimeDir) {
|
|
8910
8984
|
try {
|
|
8911
8985
|
const serverPath = path.join(runtimeDir, "dist-server", "server.mjs");
|
|
@@ -8933,7 +9007,7 @@ var require_aionui_wrapper = __commonJS({
|
|
|
8933
9007
|
function aionuiInternalLoginWithApiKey({ internalPort, apiKey }) {
|
|
8934
9008
|
return new Promise((resolve, reject) => {
|
|
8935
9009
|
const body = JSON.stringify({ apiKey });
|
|
8936
|
-
const req =
|
|
9010
|
+
const req = http2.request({
|
|
8937
9011
|
host: "127.0.0.1",
|
|
8938
9012
|
port: internalPort,
|
|
8939
9013
|
path: "/login",
|
|
@@ -9051,7 +9125,7 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9051
9125
|
delete headers["trailer"];
|
|
9052
9126
|
delete headers["transfer-encoding"];
|
|
9053
9127
|
delete headers["upgrade"];
|
|
9054
|
-
const upstream =
|
|
9128
|
+
const upstream = http2.request({
|
|
9055
9129
|
host: "127.0.0.1",
|
|
9056
9130
|
port: internalPort,
|
|
9057
9131
|
method: req.method,
|
|
@@ -9139,7 +9213,7 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9139
9213
|
const startedAt = nowMs();
|
|
9140
9214
|
return new Promise((resolve, reject) => {
|
|
9141
9215
|
const tick = /* @__PURE__ */ __name(() => {
|
|
9142
|
-
const req =
|
|
9216
|
+
const req = http2.get({
|
|
9143
9217
|
host: "127.0.0.1",
|
|
9144
9218
|
port: internalPort,
|
|
9145
9219
|
path: "/",
|
|
@@ -9274,7 +9348,7 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9274
9348
|
socket.end();
|
|
9275
9349
|
} catch {
|
|
9276
9350
|
}
|
|
9277
|
-
const req =
|
|
9351
|
+
const req = http2.request({
|
|
9278
9352
|
host: "127.0.0.1",
|
|
9279
9353
|
port,
|
|
9280
9354
|
method: "GET",
|
|
@@ -9454,6 +9528,7 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9454
9528
|
}
|
|
9455
9529
|
__name(ensureClaudeProcessProxyRunning, "ensureClaudeProcessProxyRunning");
|
|
9456
9530
|
async function startWrapper({ port, runtimeDir, runtimeVersion, runtimeSource, bunPath }) {
|
|
9531
|
+
ensureRuntimeBuiltinResources(runtimeDir);
|
|
9457
9532
|
const hsNative = detectHolySheepAionUi(runtimeDir);
|
|
9458
9533
|
log(`/login mode: ${hsNative ? "holysheep-native (apiKey)" : "legacy (username/password bridge)"}`);
|
|
9459
9534
|
if (!hsNative) {
|
|
@@ -9581,7 +9656,7 @@ ${tail.split(/\r?\n/).map((ln) => ` ${ln}`).join("\n")}
|
|
|
9581
9656
|
}
|
|
9582
9657
|
log(`runtime ready (version=${runtimeVersion}, source=${runtimeSource})`);
|
|
9583
9658
|
const ctx = { internalPort, runtimeDir, runtimeVersion, runtimeSource, bunPath };
|
|
9584
|
-
const server =
|
|
9659
|
+
const server = http2.createServer(buildRouter(ctx));
|
|
9585
9660
|
server.on("upgrade", (req, socket, head) => {
|
|
9586
9661
|
try {
|
|
9587
9662
|
proxyWebSocket(req, socket, head, internalPort);
|
|
@@ -9620,6 +9695,9 @@ ${tail.split(/\r?\n/).map((ln) => ` ${ln}`).join("\n")}
|
|
|
9620
9695
|
_tokens: bootstrapTokens,
|
|
9621
9696
|
TOKEN_TTL_MS,
|
|
9622
9697
|
BRIDGE_CRED_FILE,
|
|
9698
|
+
ensureRuntimeAssistantResources,
|
|
9699
|
+
ensureRuntimeSkillsResources,
|
|
9700
|
+
ensureRuntimeBuiltinResources,
|
|
9623
9701
|
// [HolySheep v2.1.43] Exported for aionui-wrapper-claude-proxy.test.js
|
|
9624
9702
|
ensureClaudeProcessProxyRunning,
|
|
9625
9703
|
probeLocalPort
|
|
@@ -9635,7 +9713,6 @@ var require_webui = __commonJS({
|
|
|
9635
9713
|
var { execSync, spawn } = require("child_process");
|
|
9636
9714
|
var fs = require("fs");
|
|
9637
9715
|
var path = require("path");
|
|
9638
|
-
var http = require("http");
|
|
9639
9716
|
var { scheduleUpgradeBannerCheck } = require_version_check();
|
|
9640
9717
|
function isLegacy(opts) {
|
|
9641
9718
|
return process.env.HOLYSHEEP_WEBUI_LEGACY === "1";
|
|
@@ -9742,59 +9819,16 @@ var require_webui = __commonJS({
|
|
|
9742
9819
|
return null;
|
|
9743
9820
|
}
|
|
9744
9821
|
__name(readHolySheepApiKey, "readHolySheepApiKey");
|
|
9745
|
-
function
|
|
9746
|
-
|
|
9747
|
-
|
|
9748
|
-
const chunks = [];
|
|
9749
|
-
res.on("data", (c) => chunks.push(c));
|
|
9750
|
-
res.on("end", () => {
|
|
9751
|
-
const buf = Buffer.concat(chunks);
|
|
9752
|
-
resolve({ status: res.statusCode || 0, headers: res.headers, body: buf.toString("utf8") });
|
|
9753
|
-
});
|
|
9754
|
-
});
|
|
9755
|
-
req.on("error", reject);
|
|
9756
|
-
if (body) req.write(body);
|
|
9757
|
-
req.end();
|
|
9758
|
-
});
|
|
9822
|
+
function maskApiKey(apiKey) {
|
|
9823
|
+
if (!apiKey || apiKey.length < 10) return "****";
|
|
9824
|
+
return `${apiKey.slice(0, 6)}...${apiKey.slice(-4)}`;
|
|
9759
9825
|
}
|
|
9760
|
-
__name(
|
|
9761
|
-
|
|
9762
|
-
|
|
9763
|
-
|
|
9764
|
-
for (const sc of setCookie) {
|
|
9765
|
-
const m = sc.match(/csrfToken=([^;]+);/);
|
|
9766
|
-
if (m) return { csrfToken: m[1], allCookies: setCookie.map((s) => s.split(";")[0]).join("; ") };
|
|
9767
|
-
}
|
|
9768
|
-
return null;
|
|
9769
|
-
}
|
|
9770
|
-
__name(fetchCsrfToken, "fetchCsrfToken");
|
|
9771
|
-
async function loginWithApiKey(port, apiKey) {
|
|
9772
|
-
const csrf = await fetchCsrfToken(port);
|
|
9773
|
-
if (!csrf) throw new Error("Failed to acquire CSRF token from HolySheep runtime");
|
|
9774
|
-
const body = JSON.stringify({ apiKey, csrfToken: decodeURIComponent(csrf.csrfToken) });
|
|
9775
|
-
const r = await httpRequest(
|
|
9776
|
-
{
|
|
9777
|
-
host: "127.0.0.1",
|
|
9778
|
-
port,
|
|
9779
|
-
path: "/login",
|
|
9780
|
-
method: "POST",
|
|
9781
|
-
headers: {
|
|
9782
|
-
"Content-Type": "application/json",
|
|
9783
|
-
"Content-Length": Buffer.byteLength(body),
|
|
9784
|
-
Cookie: csrf.allCookies,
|
|
9785
|
-
"x-csrf-token": decodeURIComponent(csrf.csrfToken)
|
|
9786
|
-
}
|
|
9787
|
-
},
|
|
9788
|
-
body
|
|
9789
|
-
);
|
|
9790
|
-
if (r.status !== 200) {
|
|
9791
|
-
throw new Error(`/login returned ${r.status}: ${r.body.slice(0, 200)}`);
|
|
9792
|
-
}
|
|
9793
|
-
const setCookie = r.headers["set-cookie"] || [];
|
|
9794
|
-
const cookieLine = setCookie.map((s) => s.split(";")[0]).join("; ");
|
|
9795
|
-
return { cookieLine, body: JSON.parse(r.body) };
|
|
9826
|
+
__name(maskApiKey, "maskApiKey");
|
|
9827
|
+
function maskToken(token) {
|
|
9828
|
+
if (!token || token.length < 12) return "****";
|
|
9829
|
+
return `${token.slice(0, 8)}...${token.slice(-6)}`;
|
|
9796
9830
|
}
|
|
9797
|
-
__name(
|
|
9831
|
+
__name(maskToken, "maskToken");
|
|
9798
9832
|
var AIONUI_STARTUP_TIMEOUT_MS = Number(process.env.HS_WEB_STARTUP_TIMEOUT_MS) || 6e4;
|
|
9799
9833
|
async function startAionUiMode(opts) {
|
|
9800
9834
|
const port = Number(opts.port) || 9876;
|
|
@@ -9913,25 +9947,26 @@ var require_webui = __commonJS({
|
|
|
9913
9947
|
return startLegacyMode(opts);
|
|
9914
9948
|
}
|
|
9915
9949
|
const baseUrl = `http://127.0.0.1:${port}`;
|
|
9916
|
-
const internalPort = wrapper.internalPort;
|
|
9917
9950
|
const apiKey = readHolySheepApiKey();
|
|
9918
9951
|
let launchUrl = baseUrl;
|
|
9952
|
+
let displayUrl = baseUrl;
|
|
9919
9953
|
if (apiKey) {
|
|
9920
9954
|
try {
|
|
9921
|
-
const
|
|
9922
|
-
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
}
|
|
9955
|
+
const token = wrapper.mintBootstrapToken();
|
|
9956
|
+
launchUrl = `${baseUrl}/api/auth/holysheep-bootstrap?token=${encodeURIComponent(token)}`;
|
|
9957
|
+
displayUrl = `${baseUrl}/api/auth/holysheep-bootstrap?token=${encodeURIComponent(maskToken(token))}`;
|
|
9958
|
+
console.log(chalk2.green(`\u2713 HolySheep API key detected (${maskApiKey(apiKey)}) \u2014 using one-time browser login link`));
|
|
9926
9959
|
} catch (e) {
|
|
9927
|
-
console.log(chalk2.yellow(` (auto-login
|
|
9960
|
+
console.log(chalk2.yellow(` (auto-login link creation failed: ${e.message} \u2014 will open /login manually)`));
|
|
9928
9961
|
launchUrl = `${baseUrl}/login`;
|
|
9962
|
+
displayUrl = launchUrl;
|
|
9929
9963
|
}
|
|
9930
9964
|
} else {
|
|
9931
9965
|
launchUrl = `${baseUrl}/login`;
|
|
9966
|
+
displayUrl = launchUrl;
|
|
9932
9967
|
console.log(chalk2.yellow(" No HolySheep API key saved yet. Run `hs login` first to enable auto-fill."));
|
|
9933
9968
|
}
|
|
9934
|
-
console.log(chalk2.green(`\u2713 WebUI \u5DF2\u542F\u52A8: ${chalk2.cyan.bold(
|
|
9969
|
+
console.log(chalk2.green(`\u2713 WebUI \u5DF2\u542F\u52A8: ${chalk2.cyan.bold(displayUrl)}`));
|
|
9935
9970
|
console.log(chalk2.gray(" Mode: HolySheep WebUI (HolySheep \u767B\u5F55)"));
|
|
9936
9971
|
console.log(chalk2.gray(" Press Ctrl+C to stop"));
|
|
9937
9972
|
console.log();
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simonyea/holysheep-cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.51",
|
|
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/opencode-default-model.test.js && node tests/paths-bundled.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/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/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/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": [
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"dist/process-proxy-inject.js",
|
|
63
63
|
"dist/index.html",
|
|
64
64
|
"dist/pty-hermes-wrapper.py",
|
|
65
|
+
"dist/aionui-resources/assistant",
|
|
65
66
|
"README.md",
|
|
66
67
|
"LICENSE"
|
|
67
68
|
],
|