@simonyea/holysheep-cli 2.1.52 → 2.1.53
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 +4 -4
- package/dist/index.js +122 -8
- package/package.json +1 -1
package/dist/configure-worker.js
CHANGED
|
@@ -1399,7 +1399,7 @@ var require_codex = __commonJS({
|
|
|
1399
1399
|
}
|
|
1400
1400
|
const content = stripManagedTomlConfig(readTomlConfig());
|
|
1401
1401
|
const newConfig = [
|
|
1402
|
-
`model = "${model || "gpt-5.
|
|
1402
|
+
`model = "${model || "gpt-5.5"}"`,
|
|
1403
1403
|
`model_provider = "holysheep"`,
|
|
1404
1404
|
"",
|
|
1405
1405
|
content,
|
|
@@ -1422,7 +1422,7 @@ var require_codex = __commonJS({
|
|
|
1422
1422
|
if (fs.existsSync(CONFIG_FILE_JSON)) {
|
|
1423
1423
|
jsonConfig = JSON.parse(fs.readFileSync(CONFIG_FILE_JSON, "utf8"));
|
|
1424
1424
|
}
|
|
1425
|
-
jsonConfig.model = model || "gpt-5.
|
|
1425
|
+
jsonConfig.model = model || "gpt-5.5";
|
|
1426
1426
|
jsonConfig.model_provider = "holysheep";
|
|
1427
1427
|
jsonConfig.provider = "holysheep";
|
|
1428
1428
|
if (!jsonConfig.model_providers) jsonConfig.model_providers = {};
|
|
@@ -1479,7 +1479,7 @@ var require_codex = __commonJS({
|
|
|
1479
1479
|
return isConfiguredInToml();
|
|
1480
1480
|
},
|
|
1481
1481
|
configure(apiKey, _baseUrlAnthropicNoV1, baseUrlOpenAI) {
|
|
1482
|
-
const model = "gpt-5.
|
|
1482
|
+
const model = "gpt-5.5";
|
|
1483
1483
|
writeTomlConfig(apiKey, baseUrlOpenAI, model);
|
|
1484
1484
|
writeJsonConfigIfNeeded(apiKey, baseUrlOpenAI, model);
|
|
1485
1485
|
neutralizeAuthJson();
|
|
@@ -4019,7 +4019,7 @@ var require_package = __commonJS({
|
|
|
4019
4019
|
"package.json"(exports2, module2) {
|
|
4020
4020
|
module2.exports = {
|
|
4021
4021
|
name: "@simonyea/holysheep-cli",
|
|
4022
|
-
version: "2.1.
|
|
4022
|
+
version: "2.1.53",
|
|
4023
4023
|
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.",
|
|
4024
4024
|
scripts: {
|
|
4025
4025
|
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.53",
|
|
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",
|
|
@@ -1945,7 +1945,7 @@ var require_codex = __commonJS({
|
|
|
1945
1945
|
}
|
|
1946
1946
|
const content = stripManagedTomlConfig(readTomlConfig());
|
|
1947
1947
|
const newConfig = [
|
|
1948
|
-
`model = "${model || "gpt-5.
|
|
1948
|
+
`model = "${model || "gpt-5.5"}"`,
|
|
1949
1949
|
`model_provider = "holysheep"`,
|
|
1950
1950
|
"",
|
|
1951
1951
|
content,
|
|
@@ -1968,7 +1968,7 @@ var require_codex = __commonJS({
|
|
|
1968
1968
|
if (fs.existsSync(CONFIG_FILE_JSON)) {
|
|
1969
1969
|
jsonConfig = JSON.parse(fs.readFileSync(CONFIG_FILE_JSON, "utf8"));
|
|
1970
1970
|
}
|
|
1971
|
-
jsonConfig.model = model || "gpt-5.
|
|
1971
|
+
jsonConfig.model = model || "gpt-5.5";
|
|
1972
1972
|
jsonConfig.model_provider = "holysheep";
|
|
1973
1973
|
jsonConfig.provider = "holysheep";
|
|
1974
1974
|
if (!jsonConfig.model_providers) jsonConfig.model_providers = {};
|
|
@@ -2025,7 +2025,7 @@ var require_codex = __commonJS({
|
|
|
2025
2025
|
return isConfiguredInToml();
|
|
2026
2026
|
},
|
|
2027
2027
|
configure(apiKey, _baseUrlAnthropicNoV1, baseUrlOpenAI) {
|
|
2028
|
-
const model = "gpt-5.
|
|
2028
|
+
const model = "gpt-5.5";
|
|
2029
2029
|
writeTomlConfig(apiKey, baseUrlOpenAI, model);
|
|
2030
2030
|
writeJsonConfigIfNeeded(apiKey, baseUrlOpenAI, model);
|
|
2031
2031
|
neutralizeAuthJson();
|
|
@@ -8849,6 +8849,11 @@ var require_aionui_wrapper = __commonJS({
|
|
|
8849
8849
|
var cachedAionUiCookie = null;
|
|
8850
8850
|
var cachedAionUiCookieAt = 0;
|
|
8851
8851
|
var AIONUI_COOKIE_TTL_MS = 10 * 60 * 1e3;
|
|
8852
|
+
var _startupWarnings = {
|
|
8853
|
+
notInstalled: [],
|
|
8854
|
+
// tool ids that are installed but not configured
|
|
8855
|
+
openclawNeedsPairing: false
|
|
8856
|
+
};
|
|
8852
8857
|
function log(msg) {
|
|
8853
8858
|
console.log(`[holysheep-web] ${msg}`);
|
|
8854
8859
|
}
|
|
@@ -9194,6 +9199,38 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9194
9199
|
}
|
|
9195
9200
|
}
|
|
9196
9201
|
__name(rewriteCspHeaders, "rewriteCspHeaders");
|
|
9202
|
+
function _buildStartupBannerScript() {
|
|
9203
|
+
const notInstalled = _startupWarnings.notInstalled || [];
|
|
9204
|
+
const needsPairing = _startupWarnings.openclawNeedsPairing;
|
|
9205
|
+
if (notInstalled.length === 0 && !needsPairing) return "";
|
|
9206
|
+
const lines = [];
|
|
9207
|
+
if (notInstalled.length > 0) {
|
|
9208
|
+
const names = notInstalled.map((id) => {
|
|
9209
|
+
const map = { codex: "Codex", droid: "Droid", hermes: "Hermes", "gemini-cli": "Gemini CLI" };
|
|
9210
|
+
return map[id] || id;
|
|
9211
|
+
});
|
|
9212
|
+
lines.push(`\u26A0\uFE0F \u4EE5\u4E0B CLI \u5DE5\u5177\u672A\u5B89\u88C5\uFF1A${names.join("\u3001")}\u3002\u8BF7\u8FD0\u884C <code>hs setup</code> \u5B89\u88C5\u5E76\u914D\u7F6E\u3002`);
|
|
9213
|
+
}
|
|
9214
|
+
if (needsPairing) {
|
|
9215
|
+
lines.push("\u26A0\uFE0F OpenClaw Gateway \u9700\u8981 Pairing \u8BA4\u8BC1\u3002\u8BF7\u8FD0\u884C <code>hs openclaw</code> \u5B8C\u6210\u914D\u7F6E\uFF0C\u5426\u5219 OpenClaw \u5BF9\u8BDD\u5C06\u6301\u7EED\u62A5\u9519\u3002");
|
|
9216
|
+
}
|
|
9217
|
+
const msgJson = JSON.stringify(lines);
|
|
9218
|
+
return `<script>
|
|
9219
|
+
(function(){
|
|
9220
|
+
var KEY='hs-startup-banner-dismissed';
|
|
9221
|
+
if(sessionStorage.getItem(KEY)) return;
|
|
9222
|
+
var msgs=${msgJson};
|
|
9223
|
+
if(!msgs||!msgs.length) return;
|
|
9224
|
+
var d=document.createElement('div');
|
|
9225
|
+
d.style.cssText='position:fixed;bottom:16px;right:16px;z-index:99999;max-width:420px;background:#ff8c00;color:#fff;padding:12px 16px;border-radius:8px;font-size:13px;line-height:1.5;box-shadow:0 4px 16px rgba(0,0,0,.3);cursor:pointer';
|
|
9226
|
+
d.innerHTML=msgs.join('<br><br>')+'<br><span style="font-size:11px;opacity:.8">\u70B9\u51FB\u5173\u95ED (\u672C\u6B21\u4F1A\u8BDD\u4E0D\u518D\u663E\u793A)</span>';
|
|
9227
|
+
d.addEventListener('click',function(){document.body.removeChild(d);sessionStorage.setItem(KEY,'1')});
|
|
9228
|
+
setTimeout(function(){if(d.parentNode)document.body.removeChild(d);},30000);
|
|
9229
|
+
document.body.appendChild(d);
|
|
9230
|
+
})();
|
|
9231
|
+
</script>`;
|
|
9232
|
+
}
|
|
9233
|
+
__name(_buildStartupBannerScript, "_buildStartupBannerScript");
|
|
9197
9234
|
var BODYLESS_METHODS = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
|
|
9198
9235
|
function proxyHttp(req, res, internalPort) {
|
|
9199
9236
|
const headers = { ...req.headers };
|
|
@@ -9218,6 +9255,32 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9218
9255
|
delete outHeaders["keep-alive"];
|
|
9219
9256
|
delete outHeaders["proxy-connection"];
|
|
9220
9257
|
rewriteCspHeaders(outHeaders);
|
|
9258
|
+
const contentType = (outHeaders["content-type"] || "").toLowerCase();
|
|
9259
|
+
const isHtml = contentType.includes("text/html");
|
|
9260
|
+
const bannerScript = isHtml ? _buildStartupBannerScript() : "";
|
|
9261
|
+
if (bannerScript) {
|
|
9262
|
+
delete outHeaders["content-length"];
|
|
9263
|
+
res.writeHead(upRes.statusCode, upRes.statusMessage, outHeaders);
|
|
9264
|
+
const chunks = [];
|
|
9265
|
+
upRes.on("data", (c) => chunks.push(c));
|
|
9266
|
+
upRes.on("end", () => {
|
|
9267
|
+
let html = Buffer.concat(chunks).toString("utf8");
|
|
9268
|
+
const idx = html.lastIndexOf("</body>");
|
|
9269
|
+
if (idx !== -1) {
|
|
9270
|
+
html = html.slice(0, idx) + bannerScript + html.slice(idx);
|
|
9271
|
+
} else {
|
|
9272
|
+
html += bannerScript;
|
|
9273
|
+
}
|
|
9274
|
+
res.end(html);
|
|
9275
|
+
});
|
|
9276
|
+
upRes.on("error", () => {
|
|
9277
|
+
try {
|
|
9278
|
+
res.end();
|
|
9279
|
+
} catch {
|
|
9280
|
+
}
|
|
9281
|
+
});
|
|
9282
|
+
return;
|
|
9283
|
+
}
|
|
9221
9284
|
res.writeHead(upRes.statusCode, upRes.statusMessage, outHeaders);
|
|
9222
9285
|
upRes.pipe(res);
|
|
9223
9286
|
});
|
|
@@ -9398,6 +9461,12 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9398
9461
|
aionuiSource: ctx.runtimeSource
|
|
9399
9462
|
});
|
|
9400
9463
|
}
|
|
9464
|
+
if (route === "/api/holysheep/__wrapper/startup-warnings" && req.method === "GET") {
|
|
9465
|
+
return sendJson(res, 200, {
|
|
9466
|
+
notInstalled: _startupWarnings.notInstalled,
|
|
9467
|
+
openclawNeedsPairing: _startupWarnings.openclawNeedsPairing
|
|
9468
|
+
});
|
|
9469
|
+
}
|
|
9401
9470
|
return proxyHttp(req, res, ctx.internalPort);
|
|
9402
9471
|
} catch (e) {
|
|
9403
9472
|
try {
|
|
@@ -9479,7 +9548,7 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9479
9548
|
log("skipping auto-config for all CLI tools: no HolySheep apiKey available");
|
|
9480
9549
|
return;
|
|
9481
9550
|
}
|
|
9482
|
-
const summary = { configured: [], skipped: [], failed: [] };
|
|
9551
|
+
const summary = { configured: [], skipped: [], failed: [], notInstalled: [] };
|
|
9483
9552
|
try {
|
|
9484
9553
|
_ensureClaudeProxyConfig(apiKey);
|
|
9485
9554
|
summary.configured.push("claude-code");
|
|
@@ -9515,6 +9584,17 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9515
9584
|
];
|
|
9516
9585
|
for (const s of siblings) {
|
|
9517
9586
|
try {
|
|
9587
|
+
let installed = true;
|
|
9588
|
+
try {
|
|
9589
|
+
installed = typeof s.tool.checkInstalled === "function" ? Boolean(s.tool.checkInstalled()) : true;
|
|
9590
|
+
} catch {
|
|
9591
|
+
installed = true;
|
|
9592
|
+
}
|
|
9593
|
+
if (!installed) {
|
|
9594
|
+
summary.notInstalled.push(s.id);
|
|
9595
|
+
log(`${s.id} not installed \u2014 skipping auto-config (binary not found)`);
|
|
9596
|
+
continue;
|
|
9597
|
+
}
|
|
9518
9598
|
let already = false;
|
|
9519
9599
|
try {
|
|
9520
9600
|
already = typeof s.tool.isConfigured === "function" ? Boolean(s.tool.isConfigured()) : false;
|
|
@@ -9539,10 +9619,30 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9539
9619
|
log(`warn: auto-config ${s.id} failed: ${err && err.message ? err.message : err}`);
|
|
9540
9620
|
}
|
|
9541
9621
|
}
|
|
9542
|
-
log(`CLI auto-config summary: configured=[${summary.configured.join(",")}] skipped=[${summary.skipped.join(",")}] failed=[${summary.failed.map((f) => f.tool).join(",")}]`);
|
|
9622
|
+
log(`CLI auto-config summary: configured=[${summary.configured.join(",")}] skipped=[${summary.skipped.join(",")}] failed=[${summary.failed.map((f) => f.tool).join(",")}] notInstalled=[${summary.notInstalled.join(",")}]`);
|
|
9543
9623
|
return summary;
|
|
9544
9624
|
}
|
|
9545
9625
|
__name(_ensureAllClisConfigured, "_ensureAllClisConfigured");
|
|
9626
|
+
function _checkOpenClawPairingNeeded() {
|
|
9627
|
+
var _a, _b;
|
|
9628
|
+
try {
|
|
9629
|
+
if (typeof openclawTool.checkInstalled !== "function" || !openclawTool.checkInstalled()) return false;
|
|
9630
|
+
if (typeof openclawTool.isConfigured !== "function" || !openclawTool.isConfigured()) return false;
|
|
9631
|
+
const OPENCLAW_CONFIG_FILE = path.join(os.homedir(), ".openclaw", "openclaw.json");
|
|
9632
|
+
if (!fs.existsSync(OPENCLAW_CONFIG_FILE)) return false;
|
|
9633
|
+
let cfg;
|
|
9634
|
+
try {
|
|
9635
|
+
cfg = JSON.parse(fs.readFileSync(OPENCLAW_CONFIG_FILE, "utf8"));
|
|
9636
|
+
} catch {
|
|
9637
|
+
return false;
|
|
9638
|
+
}
|
|
9639
|
+
const authMode = (_b = (_a = cfg == null ? void 0 : cfg.gateway) == null ? void 0 : _a.auth) == null ? void 0 : _b.mode;
|
|
9640
|
+
return authMode !== void 0 && authMode !== "none";
|
|
9641
|
+
} catch {
|
|
9642
|
+
return false;
|
|
9643
|
+
}
|
|
9644
|
+
}
|
|
9645
|
+
__name(_checkOpenClawPairingNeeded, "_checkOpenClawPairingNeeded");
|
|
9546
9646
|
function _ensureClaudeProxyConfig(apiKey) {
|
|
9547
9647
|
const config = claudeProcessProxy.readConfig();
|
|
9548
9648
|
const next = claudeCodeTool.buildBridgeConfig(apiKey, BASE_URL_ANTHROPIC, {
|
|
@@ -9667,11 +9767,25 @@ var require_aionui_wrapper = __commonJS({
|
|
|
9667
9767
|
return null;
|
|
9668
9768
|
}
|
|
9669
9769
|
})();
|
|
9670
|
-
if (__apiKeyForAutoConfig)
|
|
9671
|
-
|
|
9770
|
+
if (__apiKeyForAutoConfig) {
|
|
9771
|
+
const summary = _ensureAllClisConfigured(__apiKeyForAutoConfig);
|
|
9772
|
+
if (summary && summary.notInstalled && summary.notInstalled.length > 0) {
|
|
9773
|
+
_startupWarnings.notInstalled = summary.notInstalled;
|
|
9774
|
+
}
|
|
9775
|
+
} else {
|
|
9776
|
+
log("CLI auto-config skipped: no HolySheep apiKey (run `hs login`)");
|
|
9777
|
+
}
|
|
9672
9778
|
} catch (e) {
|
|
9673
9779
|
log("warn: CLI auto-config error (continuing): " + (e && e.message ? e.message : e));
|
|
9674
9780
|
}
|
|
9781
|
+
try {
|
|
9782
|
+
_startupWarnings.openclawNeedsPairing = _checkOpenClawPairingNeeded();
|
|
9783
|
+
if (_startupWarnings.openclawNeedsPairing) {
|
|
9784
|
+
log('warn: OpenClaw gateway auth.mode is not "none" \u2014 users will see "pairing required" errors. Run `hs openclaw` to fix.');
|
|
9785
|
+
}
|
|
9786
|
+
} catch (e) {
|
|
9787
|
+
log("warn: OpenClaw pairing check failed (continuing): " + (e && e.message ? e.message : e));
|
|
9788
|
+
}
|
|
9675
9789
|
const claudeProxyHandle = await ensureClaudeProcessProxyRunning();
|
|
9676
9790
|
ensureOpenClawBridgeRunning();
|
|
9677
9791
|
const debug = process.env.HS_WEB_DEBUG === "1";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simonyea/holysheep-cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.53",
|
|
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",
|