@simonyea/holysheep-cli 2.1.50 → 2.1.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/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 +38 -10
- package/dist/index.js +257 -93
- 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.52",
|
|
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/aionui-wrapper-csp-rewrite.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");
|
|
@@ -2540,7 +2541,13 @@ var require_openclaw_bridge = __commonJS({
|
|
|
2540
2541
|
function sendJson(res, statusCode, payload) {
|
|
2541
2542
|
res.writeHead(statusCode, {
|
|
2542
2543
|
"content-type": "application/json; charset=utf-8",
|
|
2543
|
-
"cache-control": "no-store"
|
|
2544
|
+
"cache-control": "no-store",
|
|
2545
|
+
// [hs36] Mirror the OPTIONS preflight ACAO so browsers can read the
|
|
2546
|
+
// response from a different-port origin (e.g. the AionUi WebUI on :9876
|
|
2547
|
+
// fetching /v1/models from the bridge on :18788). Without this header on
|
|
2548
|
+
// the actual GET/POST response, Chrome/Firefox treat it as ERR_FAILED
|
|
2549
|
+
// even though the OPTIONS preflight succeeds.
|
|
2550
|
+
"access-control-allow-origin": "*"
|
|
2544
2551
|
});
|
|
2545
2552
|
res.end(JSON.stringify(payload));
|
|
2546
2553
|
}
|
|
@@ -2554,7 +2561,10 @@ var require_openclaw_bridge = __commonJS({
|
|
|
2554
2561
|
res.writeHead(200, {
|
|
2555
2562
|
"content-type": "text/event-stream; charset=utf-8",
|
|
2556
2563
|
"cache-control": "no-cache, no-transform",
|
|
2557
|
-
connection: "keep-alive"
|
|
2564
|
+
connection: "keep-alive",
|
|
2565
|
+
// [hs36] Mirror sendJson's ACAO so SSE streams reach the WebUI from a
|
|
2566
|
+
// cross-port loopback origin. See sendJson comment for rationale.
|
|
2567
|
+
"access-control-allow-origin": "*"
|
|
2558
2568
|
});
|
|
2559
2569
|
const firstChunk = {
|
|
2560
2570
|
id: payload.id,
|
|
@@ -2974,7 +2984,9 @@ var require_openclaw_bridge = __commonJS({
|
|
|
2974
2984
|
res.writeHead(200, {
|
|
2975
2985
|
"content-type": "text/event-stream; charset=utf-8",
|
|
2976
2986
|
"cache-control": "no-cache, no-transform",
|
|
2977
|
-
connection: "keep-alive"
|
|
2987
|
+
connection: "keep-alive",
|
|
2988
|
+
// [hs36] CORS for SSE byte-passthrough relay path.
|
|
2989
|
+
"access-control-allow-origin": "*"
|
|
2978
2990
|
});
|
|
2979
2991
|
try {
|
|
2980
2992
|
await pipeStream(upstream.body, (chunk) => res.write(chunk));
|
|
@@ -3048,7 +3060,10 @@ var require_openclaw_bridge = __commonJS({
|
|
|
3048
3060
|
res.writeHead(200, {
|
|
3049
3061
|
"content-type": "text/event-stream; charset=utf-8",
|
|
3050
3062
|
"cache-control": "no-cache, no-transform",
|
|
3051
|
-
connection: "keep-alive"
|
|
3063
|
+
connection: "keep-alive",
|
|
3064
|
+
// [hs36] Mirror sendJson's ACAO so SSE streams reach the WebUI from a
|
|
3065
|
+
// cross-port loopback origin. See sendJson comment for rationale.
|
|
3066
|
+
"access-control-allow-origin": "*"
|
|
3052
3067
|
});
|
|
3053
3068
|
const msgId = `chatcmpl_${Date.now()}`;
|
|
3054
3069
|
const created = Math.floor(Date.now() / 1e3);
|
|
@@ -3217,9 +3232,9 @@ var require_openclaw_bridge = __commonJS({
|
|
|
3217
3232
|
const host = config.gatewayHost || "127.0.0.1";
|
|
3218
3233
|
const timeout = Number((_a = config.watchdog) == null ? void 0 : _a.requestTimeoutMs) || DEFAULT_WATCHDOG_REQUEST_TIMEOUT_MS;
|
|
3219
3234
|
try {
|
|
3220
|
-
const
|
|
3235
|
+
const http3 = require("http");
|
|
3221
3236
|
await new Promise((resolve, reject) => {
|
|
3222
|
-
const req =
|
|
3237
|
+
const req = http3.get({ hostname: host, port: gatewayPort, path: "/", family: 4 }, resolve);
|
|
3223
3238
|
req.setTimeout(timeout, () => {
|
|
3224
3239
|
req.destroy();
|
|
3225
3240
|
reject(new Error("timeout"));
|
|
@@ -3276,7 +3291,7 @@ var require_openclaw_bridge = __commonJS({
|
|
|
3276
3291
|
}
|
|
3277
3292
|
__name(startGatewayWatchdog, "startGatewayWatchdog");
|
|
3278
3293
|
function createBridgeServer(configPath = BRIDGE_CONFIG_FILE) {
|
|
3279
|
-
return
|
|
3294
|
+
return http2.createServer(async (req, res) => {
|
|
3280
3295
|
if (req.method === "OPTIONS") {
|
|
3281
3296
|
res.writeHead(204, {
|
|
3282
3297
|
"access-control-allow-origin": "*",
|
|
@@ -4268,6 +4283,18 @@ var require_hermes = __commonJS({
|
|
|
4268
4283
|
__name(readConfig, "readConfig");
|
|
4269
4284
|
function patchConfigYaml(apiKey, baseUrlOpenAI, primaryModel) {
|
|
4270
4285
|
if (!fs.existsSync(CONFIG_YAML)) {
|
|
4286
|
+
const cleanBase2 = String(baseUrlOpenAI || "https://api.holysheep.ai/v1").replace(/\/+$/, "");
|
|
4287
|
+
const model2 = primaryModel || "claude-sonnet-4-6";
|
|
4288
|
+
const minimal = `model:
|
|
4289
|
+
base_url: ${cleanBase2}
|
|
4290
|
+
api_key: ${apiKey}
|
|
4291
|
+
default: ${model2}
|
|
4292
|
+
providers:
|
|
4293
|
+
custom:
|
|
4294
|
+
base_url: ${cleanBase2}
|
|
4295
|
+
api_key: ${apiKey}
|
|
4296
|
+
`;
|
|
4297
|
+
fs.writeFileSync(CONFIG_YAML, minimal, "utf8");
|
|
4271
4298
|
return;
|
|
4272
4299
|
}
|
|
4273
4300
|
const cleanBase = String(baseUrlOpenAI || "https://api.holysheep.ai/v1").replace(/\/+$/, "");
|
|
@@ -4311,7 +4338,6 @@ var require_hermes = __commonJS({
|
|
|
4311
4338
|
" custom:",
|
|
4312
4339
|
` base_url: ${cleanBase}`,
|
|
4313
4340
|
` api_key: ${apiKey}`,
|
|
4314
|
-
` default_model: ${model}`,
|
|
4315
4341
|
" type: openai"
|
|
4316
4342
|
];
|
|
4317
4343
|
let start = -1, end = -1;
|
|
@@ -4424,7 +4450,7 @@ var require_hermes = __commonJS({
|
|
|
4424
4450
|
__name(writeConfig, "writeConfig");
|
|
4425
4451
|
function buildHolySheepBlock(apiKey, baseUrlOpenAI, primaryModel) {
|
|
4426
4452
|
const cleanBase = String(baseUrlOpenAI || "https://api.holysheep.ai/v1").replace(/\/+$/, "");
|
|
4427
|
-
const model = primaryModel || "gpt-
|
|
4453
|
+
const model = primaryModel || "gpt-4o";
|
|
4428
4454
|
return [
|
|
4429
4455
|
"[providers.holysheep]",
|
|
4430
4456
|
"# Managed by @simonyea/holysheep-cli. Do not edit by hand \u2014 run `hs setup`.",
|
|
@@ -4491,10 +4517,11 @@ var require_hermes = __commonJS({
|
|
|
4491
4517
|
return commandExists2("hermes");
|
|
4492
4518
|
},
|
|
4493
4519
|
isConfigured() {
|
|
4494
|
-
return isConfiguredInToml(readConfig());
|
|
4520
|
+
return isConfiguredInToml(readConfig()) && fs.existsSync(CONFIG_YAML);
|
|
4495
4521
|
},
|
|
4496
4522
|
configure(apiKey, _baseUrlAnthropic, baseUrlOpenAI, primaryModel) {
|
|
4497
|
-
const
|
|
4523
|
+
const THINKING_MODELS = /^(gpt-5|o[0-9]|claude-)/i;
|
|
4524
|
+
const hermesPrimaryModel = THINKING_MODELS.test(primaryModel || "") ? "gpt-4o" : primaryModel || "gpt-4o";
|
|
4498
4525
|
const merged = mergeConfig(apiKey, baseUrlOpenAI, hermesPrimaryModel);
|
|
4499
4526
|
writeConfig(merged);
|
|
4500
4527
|
try {
|
|
@@ -4626,6 +4653,7 @@ var require_env_config = __commonJS({
|
|
|
4626
4653
|
module2.exports = {
|
|
4627
4654
|
name: "\u5168\u5C40\u73AF\u5883\u53D8\u91CF",
|
|
4628
4655
|
id: "env-config",
|
|
4656
|
+
installCmd: "\u5185\u7F6E\u529F\u80FD\uFF08\u65E0\u9700\u5B89\u88C5\uFF09",
|
|
4629
4657
|
checkInstalled() {
|
|
4630
4658
|
return true;
|
|
4631
4659
|
},
|
|
@@ -6004,7 +6032,7 @@ var require_aionui_runtime_fetcher = __commonJS({
|
|
|
6004
6032
|
var os = require("os");
|
|
6005
6033
|
var crypto = require("crypto");
|
|
6006
6034
|
var https = require("https");
|
|
6007
|
-
var
|
|
6035
|
+
var http2 = require("http");
|
|
6008
6036
|
var USER_CACHE_DIR = path.join(os.homedir(), ".holysheep", "aionui-runtime");
|
|
6009
6037
|
var VENDOR_DIR = path.join(__dirname, "vendor", "aionui");
|
|
6010
6038
|
var DEFAULT_RUNTIME_URL = "https://mail.holysheep.ai/app/cli/aionui-runtime-v1.9.18-holysheep-hs35.tar.gz";
|
|
@@ -6179,7 +6207,7 @@ var require_aionui_runtime_fetcher = __commonJS({
|
|
|
6179
6207
|
return new Promise((resolve, reject) => {
|
|
6180
6208
|
const tmpFile = path.join(os.tmpdir(), `aionui-runtime-${Date.now()}.tar.gz`);
|
|
6181
6209
|
logger(`Downloading HolySheep runtime from ${url}`);
|
|
6182
|
-
const client = url.startsWith("https:") ? https :
|
|
6210
|
+
const client = url.startsWith("https:") ? https : http2;
|
|
6183
6211
|
const file = fs.createWriteStream(tmpFile);
|
|
6184
6212
|
const hasher = crypto.createHash("sha256");
|
|
6185
6213
|
let totalBytes = 0;
|
|
@@ -7325,7 +7353,7 @@ var require_server = __commonJS({
|
|
|
7325
7353
|
"use strict";
|
|
7326
7354
|
var dns = require("dns");
|
|
7327
7355
|
dns.setServers([.../* @__PURE__ */ new Set([...dns.getServers(), "1.1.1.1", "223.5.5.5"])]);
|
|
7328
|
-
var
|
|
7356
|
+
var http2 = require("http");
|
|
7329
7357
|
var fs = require("fs");
|
|
7330
7358
|
var path = require("path");
|
|
7331
7359
|
var { execSync, spawn } = require("child_process");
|
|
@@ -8339,7 +8367,7 @@ ${AUTO_INSTALL[toolId].cmd}
|
|
|
8339
8367
|
}
|
|
8340
8368
|
}
|
|
8341
8369
|
}
|
|
8342
|
-
json(res, { ok: true, type: "terminal", cmd });
|
|
8370
|
+
json(res, { ok: true, type: "terminal", cmd, launchCmd: cmd });
|
|
8343
8371
|
}
|
|
8344
8372
|
__name(handleToolLaunch, "handleToolLaunch");
|
|
8345
8373
|
async function handleClaudeProxyStart(_req, res) {
|
|
@@ -8657,7 +8685,7 @@ ${AUTO_INSTALL[toolId].cmd}
|
|
|
8657
8685
|
__name(handleRequest, "handleRequest");
|
|
8658
8686
|
function startServer(port) {
|
|
8659
8687
|
return new Promise((resolve, reject) => {
|
|
8660
|
-
const server =
|
|
8688
|
+
const server = http2.createServer(handleRequest);
|
|
8661
8689
|
server.on("error", (err) => {
|
|
8662
8690
|
var _a;
|
|
8663
8691
|
if (err.code === "EADDRINUSE") {
|
|
@@ -8677,7 +8705,7 @@ ${AUTO_INSTALL[toolId].cmd}
|
|
|
8677
8705
|
} catch {
|
|
8678
8706
|
}
|
|
8679
8707
|
setTimeout(() => {
|
|
8680
|
-
const retry =
|
|
8708
|
+
const retry = http2.createServer(handleRequest);
|
|
8681
8709
|
retry.on("error", (err2) => reject(err2));
|
|
8682
8710
|
retry.listen(port, "127.0.0.1", () => {
|
|
8683
8711
|
workspaceRuntime.startScheduler();
|
|
@@ -8706,9 +8734,9 @@ ${AUTO_INSTALL[toolId].cmd}
|
|
|
8706
8734
|
const bridgePort = ((_a = openclawTool.getBridgePort) == null ? void 0 : _a.call(openclawTool)) || 18788;
|
|
8707
8735
|
let bridgeAlive = false;
|
|
8708
8736
|
try {
|
|
8709
|
-
const
|
|
8737
|
+
const http3 = require("http");
|
|
8710
8738
|
await new Promise((resolve, reject) => {
|
|
8711
|
-
const req =
|
|
8739
|
+
const req = http3.get({ hostname: "127.0.0.1", port: bridgePort, path: "/health", family: 4 }, resolve);
|
|
8712
8740
|
req.setTimeout(2e3, () => {
|
|
8713
8741
|
req.destroy();
|
|
8714
8742
|
reject();
|
|
@@ -8780,7 +8808,7 @@ ${AUTO_INSTALL[toolId].cmd}
|
|
|
8780
8808
|
var require_aionui_wrapper = __commonJS({
|
|
8781
8809
|
"src/webui/aionui-wrapper.js"(exports2, module2) {
|
|
8782
8810
|
"use strict";
|
|
8783
|
-
var
|
|
8811
|
+
var http2 = require("http");
|
|
8784
8812
|
var net = require("net");
|
|
8785
8813
|
var fs = require("fs");
|
|
8786
8814
|
var path = require("path");
|
|
@@ -8801,6 +8829,7 @@ var require_aionui_wrapper = __commonJS({
|
|
|
8801
8829
|
var codexTool = require_codex();
|
|
8802
8830
|
var droidTool = require_droid();
|
|
8803
8831
|
var hermesTool = require_hermes();
|
|
8832
|
+
var openclawTool = require_openclaw();
|
|
8804
8833
|
var BRIDGE_DIR = path.join(os.homedir(), ".holysheep");
|
|
8805
8834
|
var BRIDGE_CRED_FILE = path.join(BRIDGE_DIR, "aionui-bridge.json");
|
|
8806
8835
|
var TOKEN_TTL_MS = 3e4;
|
|
@@ -8906,6 +8935,79 @@ var require_aionui_wrapper = __commonJS({
|
|
|
8906
8935
|
}
|
|
8907
8936
|
}
|
|
8908
8937
|
__name(loadBridgeCredentials, "loadBridgeCredentials");
|
|
8938
|
+
function copyDirRecursive(src, dest) {
|
|
8939
|
+
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
8940
|
+
fs.cpSync(src, dest, { recursive: true, force: true });
|
|
8941
|
+
}
|
|
8942
|
+
__name(copyDirRecursive, "copyDirRecursive");
|
|
8943
|
+
function countFiles(dir) {
|
|
8944
|
+
let total = 0;
|
|
8945
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
8946
|
+
const p = path.join(dir, entry.name);
|
|
8947
|
+
if (entry.isDirectory()) total += countFiles(p);
|
|
8948
|
+
else if (entry.isFile()) total++;
|
|
8949
|
+
}
|
|
8950
|
+
return total;
|
|
8951
|
+
}
|
|
8952
|
+
__name(countFiles, "countFiles");
|
|
8953
|
+
function findBundledAssistantResources() {
|
|
8954
|
+
try {
|
|
8955
|
+
const { PACKAGE_ROOT } = require_paths();
|
|
8956
|
+
const candidates = [
|
|
8957
|
+
path.join(PACKAGE_ROOT, "dist", "aionui-resources", "assistant"),
|
|
8958
|
+
path.join(PACKAGE_ROOT, "aionui-fork", "src", "process", "resources", "assistant")
|
|
8959
|
+
];
|
|
8960
|
+
return candidates.find((dir) => fs.existsSync(dir)) || null;
|
|
8961
|
+
} catch {
|
|
8962
|
+
return null;
|
|
8963
|
+
}
|
|
8964
|
+
}
|
|
8965
|
+
__name(findBundledAssistantResources, "findBundledAssistantResources");
|
|
8966
|
+
function ensureRuntimeAssistantResources(runtimeDir) {
|
|
8967
|
+
const dest = path.join(runtimeDir, "src", "process", "resources", "assistant");
|
|
8968
|
+
try {
|
|
8969
|
+
if (fs.existsSync(dest) && countFiles(dest) > 0) {
|
|
8970
|
+
return { copied: false, dest, reason: "already-present" };
|
|
8971
|
+
}
|
|
8972
|
+
} catch {
|
|
8973
|
+
}
|
|
8974
|
+
const src = findBundledAssistantResources();
|
|
8975
|
+
if (!src) {
|
|
8976
|
+
log("warn: bundled AionUi assistant resources not found; builtin assistant rules may be unavailable");
|
|
8977
|
+
return { copied: false, dest, reason: "source-missing" };
|
|
8978
|
+
}
|
|
8979
|
+
copyDirRecursive(src, dest);
|
|
8980
|
+
const files = countFiles(dest);
|
|
8981
|
+
log(`hydrated AionUi assistant resources (${files} files) \u2192 ${dest}`);
|
|
8982
|
+
return { copied: true, src, dest, files };
|
|
8983
|
+
}
|
|
8984
|
+
__name(ensureRuntimeAssistantResources, "ensureRuntimeAssistantResources");
|
|
8985
|
+
function ensureRuntimeSkillsResources(runtimeDir) {
|
|
8986
|
+
const dest = path.join(runtimeDir, "src", "process", "resources", "skills");
|
|
8987
|
+
try {
|
|
8988
|
+
if (fs.existsSync(dest) && countFiles(dest) > 0) {
|
|
8989
|
+
return { copied: false, dest, reason: "already-present" };
|
|
8990
|
+
}
|
|
8991
|
+
} catch {
|
|
8992
|
+
}
|
|
8993
|
+
const src = path.join(runtimeDir, "dist-server", "skills");
|
|
8994
|
+
if (!fs.existsSync(src)) {
|
|
8995
|
+
log("warn: AionUi runtime skills resources not found; builtin skills may be unavailable");
|
|
8996
|
+
return { copied: false, dest, reason: "source-missing" };
|
|
8997
|
+
}
|
|
8998
|
+
copyDirRecursive(src, dest);
|
|
8999
|
+
const files = countFiles(dest);
|
|
9000
|
+
log(`hydrated AionUi skills resources (${files} files) \u2192 ${dest}`);
|
|
9001
|
+
return { copied: true, src, dest, files };
|
|
9002
|
+
}
|
|
9003
|
+
__name(ensureRuntimeSkillsResources, "ensureRuntimeSkillsResources");
|
|
9004
|
+
function ensureRuntimeBuiltinResources(runtimeDir) {
|
|
9005
|
+
return {
|
|
9006
|
+
assistant: ensureRuntimeAssistantResources(runtimeDir),
|
|
9007
|
+
skills: ensureRuntimeSkillsResources(runtimeDir)
|
|
9008
|
+
};
|
|
9009
|
+
}
|
|
9010
|
+
__name(ensureRuntimeBuiltinResources, "ensureRuntimeBuiltinResources");
|
|
8909
9011
|
function detectHolySheepAionUi(runtimeDir) {
|
|
8910
9012
|
try {
|
|
8911
9013
|
const serverPath = path.join(runtimeDir, "dist-server", "server.mjs");
|
|
@@ -8933,7 +9035,7 @@ var require_aionui_wrapper = __commonJS({
|
|
|
8933
9035
|
function aionuiInternalLoginWithApiKey({ internalPort, apiKey }) {
|
|
8934
9036
|
return new Promise((resolve, reject) => {
|
|
8935
9037
|
const body = JSON.stringify({ apiKey });
|
|
8936
|
-
const req =
|
|
9038
|
+
const req = http2.request({
|
|
8937
9039
|
host: "127.0.0.1",
|
|
8938
9040
|
port: internalPort,
|
|
8939
9041
|
path: "/login",
|
|
@@ -9040,6 +9142,58 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9040
9142
|
return legacyModule;
|
|
9041
9143
|
}
|
|
9042
9144
|
__name(legacy, "legacy");
|
|
9145
|
+
var _cachedOpenClawOrigins = null;
|
|
9146
|
+
var _cachedOpenClawOriginsAt = 0;
|
|
9147
|
+
var OPENCLAW_ORIGIN_TTL_MS = 6e4;
|
|
9148
|
+
function getOpenClawOrigins() {
|
|
9149
|
+
if (_cachedOpenClawOrigins && nowMs() - _cachedOpenClawOriginsAt < OPENCLAW_ORIGIN_TTL_MS) {
|
|
9150
|
+
return _cachedOpenClawOrigins;
|
|
9151
|
+
}
|
|
9152
|
+
const origins = [];
|
|
9153
|
+
try {
|
|
9154
|
+
const bridgePort = openclawTool.getBridgePort();
|
|
9155
|
+
const gatewayPort = openclawTool.getGatewayPort();
|
|
9156
|
+
if (bridgePort) origins.push(`http://127.0.0.1:${bridgePort}`);
|
|
9157
|
+
if (gatewayPort) origins.push(`http://127.0.0.1:${gatewayPort}`);
|
|
9158
|
+
} catch {
|
|
9159
|
+
}
|
|
9160
|
+
_cachedOpenClawOrigins = origins;
|
|
9161
|
+
_cachedOpenClawOriginsAt = nowMs();
|
|
9162
|
+
return origins;
|
|
9163
|
+
}
|
|
9164
|
+
__name(getOpenClawOrigins, "getOpenClawOrigins");
|
|
9165
|
+
function appendOriginsToDirective(directiveValue, origins) {
|
|
9166
|
+
const tokens = new Set(directiveValue.trim().split(/\s+/).filter(Boolean));
|
|
9167
|
+
for (const o of origins) tokens.add(o);
|
|
9168
|
+
return Array.from(tokens).join(" ");
|
|
9169
|
+
}
|
|
9170
|
+
__name(appendOriginsToDirective, "appendOriginsToDirective");
|
|
9171
|
+
function rewriteCspHeaders(outHeaders) {
|
|
9172
|
+
const origins = getOpenClawOrigins();
|
|
9173
|
+
if (origins.length === 0) return;
|
|
9174
|
+
for (const key of Object.keys(outHeaders)) {
|
|
9175
|
+
const lower = key.toLowerCase();
|
|
9176
|
+
if (lower !== "content-security-policy" && lower !== "content-security-policy-report-only") {
|
|
9177
|
+
continue;
|
|
9178
|
+
}
|
|
9179
|
+
const value = outHeaders[key];
|
|
9180
|
+
const cspString = Array.isArray(value) ? value.join("; ") : String(value || "");
|
|
9181
|
+
if (!cspString) continue;
|
|
9182
|
+
const directives = cspString.split(";").map((s) => s.trim()).filter(Boolean);
|
|
9183
|
+
let foundConnect = false;
|
|
9184
|
+
const rewritten = directives.map((d) => {
|
|
9185
|
+
const m = d.match(/^(connect-src)\s+(.*)$/i);
|
|
9186
|
+
if (!m) return d;
|
|
9187
|
+
foundConnect = true;
|
|
9188
|
+
return `connect-src ${appendOriginsToDirective(m[2], origins)}`;
|
|
9189
|
+
});
|
|
9190
|
+
if (!foundConnect) {
|
|
9191
|
+
rewritten.push(`connect-src 'self' ws: wss: blob: ${origins.join(" ")}`);
|
|
9192
|
+
}
|
|
9193
|
+
outHeaders[key] = rewritten.join("; ");
|
|
9194
|
+
}
|
|
9195
|
+
}
|
|
9196
|
+
__name(rewriteCspHeaders, "rewriteCspHeaders");
|
|
9043
9197
|
var BODYLESS_METHODS = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
|
|
9044
9198
|
function proxyHttp(req, res, internalPort) {
|
|
9045
9199
|
const headers = { ...req.headers };
|
|
@@ -9051,7 +9205,7 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9051
9205
|
delete headers["trailer"];
|
|
9052
9206
|
delete headers["transfer-encoding"];
|
|
9053
9207
|
delete headers["upgrade"];
|
|
9054
|
-
const upstream =
|
|
9208
|
+
const upstream = http2.request({
|
|
9055
9209
|
host: "127.0.0.1",
|
|
9056
9210
|
port: internalPort,
|
|
9057
9211
|
method: req.method,
|
|
@@ -9063,6 +9217,7 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9063
9217
|
delete outHeaders["connection"];
|
|
9064
9218
|
delete outHeaders["keep-alive"];
|
|
9065
9219
|
delete outHeaders["proxy-connection"];
|
|
9220
|
+
rewriteCspHeaders(outHeaders);
|
|
9066
9221
|
res.writeHead(upRes.statusCode, upRes.statusMessage, outHeaders);
|
|
9067
9222
|
upRes.pipe(res);
|
|
9068
9223
|
});
|
|
@@ -9139,7 +9294,7 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9139
9294
|
const startedAt = nowMs();
|
|
9140
9295
|
return new Promise((resolve, reject) => {
|
|
9141
9296
|
const tick = /* @__PURE__ */ __name(() => {
|
|
9142
|
-
const req =
|
|
9297
|
+
const req = http2.get({
|
|
9143
9298
|
host: "127.0.0.1",
|
|
9144
9299
|
port: internalPort,
|
|
9145
9300
|
path: "/",
|
|
@@ -9274,7 +9429,7 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9274
9429
|
socket.end();
|
|
9275
9430
|
} catch {
|
|
9276
9431
|
}
|
|
9277
|
-
const req =
|
|
9432
|
+
const req = http2.request({
|
|
9278
9433
|
host: "127.0.0.1",
|
|
9279
9434
|
port,
|
|
9280
9435
|
method: "GET",
|
|
@@ -9453,7 +9608,50 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9453
9608
|
}
|
|
9454
9609
|
}
|
|
9455
9610
|
__name(ensureClaudeProcessProxyRunning, "ensureClaudeProcessProxyRunning");
|
|
9611
|
+
function ensureOpenClawBridgeRunning() {
|
|
9612
|
+
let bridgePort;
|
|
9613
|
+
try {
|
|
9614
|
+
if (typeof openclawTool.isConfigured === "function" && !openclawTool.isConfigured()) {
|
|
9615
|
+
log("OpenClaw bridge pre-start skipped: openclaw not configured (run `hs setup` to enable)");
|
|
9616
|
+
return { skipped: true, reason: "not-configured" };
|
|
9617
|
+
}
|
|
9618
|
+
bridgePort = openclawTool.getBridgePort();
|
|
9619
|
+
} catch (e) {
|
|
9620
|
+
log(`OpenClaw bridge pre-start skipped: cannot read openclaw config (${e && e.message ? e.message : e})`);
|
|
9621
|
+
return { skipped: true, reason: "config-read-failed" };
|
|
9622
|
+
}
|
|
9623
|
+
try {
|
|
9624
|
+
disableBridgeWatchdog();
|
|
9625
|
+
} catch (e) {
|
|
9626
|
+
log(`warn: failed to disable bridge watchdog (continuing): ${e && e.message ? e.message : e}`);
|
|
9627
|
+
}
|
|
9628
|
+
try {
|
|
9629
|
+
const ok = openclawTool.ensureBridgeRunning(bridgePort);
|
|
9630
|
+
if (ok) {
|
|
9631
|
+
log(`OpenClaw bridge ready on 127.0.0.1:${bridgePort} (watchdog disabled \u2014 gateway-less mode)`);
|
|
9632
|
+
return { started: true, port: bridgePort };
|
|
9633
|
+
}
|
|
9634
|
+
log(`OpenClaw bridge failed to start on :${bridgePort} \u2014 OpenClaw chat panel will be unavailable`);
|
|
9635
|
+
return { skipped: true, reason: "start-failed", port: bridgePort };
|
|
9636
|
+
} catch (e) {
|
|
9637
|
+
log(`OpenClaw bridge pre-start error (continuing): ${e && e.message ? e.message : e}`);
|
|
9638
|
+
return { skipped: true, reason: "spawn-error" };
|
|
9639
|
+
}
|
|
9640
|
+
}
|
|
9641
|
+
__name(ensureOpenClawBridgeRunning, "ensureOpenClawBridgeRunning");
|
|
9642
|
+
function disableBridgeWatchdog() {
|
|
9643
|
+
const { BRIDGE_CONFIG_FILE } = require_openclaw_bridge();
|
|
9644
|
+
if (!fs.existsSync(BRIDGE_CONFIG_FILE)) return;
|
|
9645
|
+
const raw = JSON.parse(fs.readFileSync(BRIDGE_CONFIG_FILE, "utf8"));
|
|
9646
|
+
if (!raw.watchdog) raw.watchdog = {};
|
|
9647
|
+
if (raw.watchdog.enabled === false && raw.gatewayPid == null) return;
|
|
9648
|
+
raw.watchdog.enabled = false;
|
|
9649
|
+
raw.gatewayPid = null;
|
|
9650
|
+
fs.writeFileSync(BRIDGE_CONFIG_FILE, JSON.stringify(raw, null, 2), "utf8");
|
|
9651
|
+
}
|
|
9652
|
+
__name(disableBridgeWatchdog, "disableBridgeWatchdog");
|
|
9456
9653
|
async function startWrapper({ port, runtimeDir, runtimeVersion, runtimeSource, bunPath }) {
|
|
9654
|
+
ensureRuntimeBuiltinResources(runtimeDir);
|
|
9457
9655
|
const hsNative = detectHolySheepAionUi(runtimeDir);
|
|
9458
9656
|
log(`/login mode: ${hsNative ? "holysheep-native (apiKey)" : "legacy (username/password bridge)"}`);
|
|
9459
9657
|
if (!hsNative) {
|
|
@@ -9475,6 +9673,7 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9475
9673
|
log("warn: CLI auto-config error (continuing): " + (e && e.message ? e.message : e));
|
|
9476
9674
|
}
|
|
9477
9675
|
const claudeProxyHandle = await ensureClaudeProcessProxyRunning();
|
|
9676
|
+
ensureOpenClawBridgeRunning();
|
|
9478
9677
|
const debug = process.env.HS_WEB_DEBUG === "1";
|
|
9479
9678
|
const { PACKAGE_ROOT, cliVersion, ptyHermesWrapperPath } = require_paths();
|
|
9480
9679
|
const cliRoot = PACKAGE_ROOT;
|
|
@@ -9581,7 +9780,7 @@ ${tail.split(/\r?\n/).map((ln) => ` ${ln}`).join("\n")}
|
|
|
9581
9780
|
}
|
|
9582
9781
|
log(`runtime ready (version=${runtimeVersion}, source=${runtimeSource})`);
|
|
9583
9782
|
const ctx = { internalPort, runtimeDir, runtimeVersion, runtimeSource, bunPath };
|
|
9584
|
-
const server =
|
|
9783
|
+
const server = http2.createServer(buildRouter(ctx));
|
|
9585
9784
|
server.on("upgrade", (req, socket, head) => {
|
|
9586
9785
|
try {
|
|
9587
9786
|
proxyWebSocket(req, socket, head, internalPort);
|
|
@@ -9620,9 +9819,17 @@ ${tail.split(/\r?\n/).map((ln) => ` ${ln}`).join("\n")}
|
|
|
9620
9819
|
_tokens: bootstrapTokens,
|
|
9621
9820
|
TOKEN_TTL_MS,
|
|
9622
9821
|
BRIDGE_CRED_FILE,
|
|
9822
|
+
ensureRuntimeAssistantResources,
|
|
9823
|
+
ensureRuntimeSkillsResources,
|
|
9824
|
+
ensureRuntimeBuiltinResources,
|
|
9623
9825
|
// [HolySheep v2.1.43] Exported for aionui-wrapper-claude-proxy.test.js
|
|
9624
9826
|
ensureClaudeProcessProxyRunning,
|
|
9625
|
-
probeLocalPort
|
|
9827
|
+
probeLocalPort,
|
|
9828
|
+
// [HolySheep v2.1.51 / hs36] Exported for tests
|
|
9829
|
+
ensureOpenClawBridgeRunning,
|
|
9830
|
+
rewriteCspHeaders,
|
|
9831
|
+
getOpenClawOrigins,
|
|
9832
|
+
appendOriginsToDirective
|
|
9626
9833
|
};
|
|
9627
9834
|
}
|
|
9628
9835
|
});
|
|
@@ -9635,7 +9842,6 @@ var require_webui = __commonJS({
|
|
|
9635
9842
|
var { execSync, spawn } = require("child_process");
|
|
9636
9843
|
var fs = require("fs");
|
|
9637
9844
|
var path = require("path");
|
|
9638
|
-
var http = require("http");
|
|
9639
9845
|
var { scheduleUpgradeBannerCheck } = require_version_check();
|
|
9640
9846
|
function isLegacy(opts) {
|
|
9641
9847
|
return process.env.HOLYSHEEP_WEBUI_LEGACY === "1";
|
|
@@ -9742,59 +9948,16 @@ var require_webui = __commonJS({
|
|
|
9742
9948
|
return null;
|
|
9743
9949
|
}
|
|
9744
9950
|
__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
|
-
});
|
|
9759
|
-
}
|
|
9760
|
-
__name(httpRequest, "httpRequest");
|
|
9761
|
-
async function fetchCsrfToken(port) {
|
|
9762
|
-
const r = await httpRequest({ host: "127.0.0.1", port, path: "/", method: "GET" });
|
|
9763
|
-
const setCookie = r.headers["set-cookie"] || [];
|
|
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;
|
|
9951
|
+
function maskApiKey(apiKey) {
|
|
9952
|
+
if (!apiKey || apiKey.length < 10) return "****";
|
|
9953
|
+
return `${apiKey.slice(0, 6)}...${apiKey.slice(-4)}`;
|
|
9769
9954
|
}
|
|
9770
|
-
__name(
|
|
9771
|
-
|
|
9772
|
-
|
|
9773
|
-
|
|
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) };
|
|
9955
|
+
__name(maskApiKey, "maskApiKey");
|
|
9956
|
+
function maskToken(token) {
|
|
9957
|
+
if (!token || token.length < 12) return "****";
|
|
9958
|
+
return `${token.slice(0, 8)}...${token.slice(-6)}`;
|
|
9796
9959
|
}
|
|
9797
|
-
__name(
|
|
9960
|
+
__name(maskToken, "maskToken");
|
|
9798
9961
|
var AIONUI_STARTUP_TIMEOUT_MS = Number(process.env.HS_WEB_STARTUP_TIMEOUT_MS) || 6e4;
|
|
9799
9962
|
async function startAionUiMode(opts) {
|
|
9800
9963
|
const port = Number(opts.port) || 9876;
|
|
@@ -9913,25 +10076,26 @@ var require_webui = __commonJS({
|
|
|
9913
10076
|
return startLegacyMode(opts);
|
|
9914
10077
|
}
|
|
9915
10078
|
const baseUrl = `http://127.0.0.1:${port}`;
|
|
9916
|
-
const internalPort = wrapper.internalPort;
|
|
9917
10079
|
const apiKey = readHolySheepApiKey();
|
|
9918
10080
|
let launchUrl = baseUrl;
|
|
10081
|
+
let displayUrl = baseUrl;
|
|
9919
10082
|
if (apiKey) {
|
|
9920
10083
|
try {
|
|
9921
|
-
const
|
|
9922
|
-
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
}
|
|
10084
|
+
const token = wrapper.mintBootstrapToken();
|
|
10085
|
+
launchUrl = `${baseUrl}/api/auth/holysheep-bootstrap?token=${encodeURIComponent(token)}`;
|
|
10086
|
+
displayUrl = `${baseUrl}/api/auth/holysheep-bootstrap?token=${encodeURIComponent(maskToken(token))}`;
|
|
10087
|
+
console.log(chalk2.green(`\u2713 HolySheep API key detected (${maskApiKey(apiKey)}) \u2014 using one-time browser login link`));
|
|
9926
10088
|
} catch (e) {
|
|
9927
|
-
console.log(chalk2.yellow(` (auto-login
|
|
10089
|
+
console.log(chalk2.yellow(` (auto-login link creation failed: ${e.message} \u2014 will open /login manually)`));
|
|
9928
10090
|
launchUrl = `${baseUrl}/login`;
|
|
10091
|
+
displayUrl = launchUrl;
|
|
9929
10092
|
}
|
|
9930
10093
|
} else {
|
|
9931
10094
|
launchUrl = `${baseUrl}/login`;
|
|
10095
|
+
displayUrl = launchUrl;
|
|
9932
10096
|
console.log(chalk2.yellow(" No HolySheep API key saved yet. Run `hs login` first to enable auto-fill."));
|
|
9933
10097
|
}
|
|
9934
|
-
console.log(chalk2.green(`\u2713 WebUI \u5DF2\u542F\u52A8: ${chalk2.cyan.bold(
|
|
10098
|
+
console.log(chalk2.green(`\u2713 WebUI \u5DF2\u542F\u52A8: ${chalk2.cyan.bold(displayUrl)}`));
|
|
9935
10099
|
console.log(chalk2.gray(" Mode: HolySheep WebUI (HolySheep \u767B\u5F55)"));
|
|
9936
10100
|
console.log(chalk2.gray(" Press Ctrl+C to stop"));
|
|
9937
10101
|
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.52",
|
|
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/aionui-wrapper-csp-rewrite.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
|
],
|