@simonyea/holysheep-cli 2.1.51 → 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.
@@ -1995,7 +1995,13 @@ var require_openclaw_bridge = __commonJS({
1995
1995
  function sendJson(res, statusCode, payload) {
1996
1996
  res.writeHead(statusCode, {
1997
1997
  "content-type": "application/json; charset=utf-8",
1998
- "cache-control": "no-store"
1998
+ "cache-control": "no-store",
1999
+ // [hs36] Mirror the OPTIONS preflight ACAO so browsers can read the
2000
+ // response from a different-port origin (e.g. the AionUi WebUI on :9876
2001
+ // fetching /v1/models from the bridge on :18788). Without this header on
2002
+ // the actual GET/POST response, Chrome/Firefox treat it as ERR_FAILED
2003
+ // even though the OPTIONS preflight succeeds.
2004
+ "access-control-allow-origin": "*"
1999
2005
  });
2000
2006
  res.end(JSON.stringify(payload));
2001
2007
  }
@@ -2009,7 +2015,10 @@ var require_openclaw_bridge = __commonJS({
2009
2015
  res.writeHead(200, {
2010
2016
  "content-type": "text/event-stream; charset=utf-8",
2011
2017
  "cache-control": "no-cache, no-transform",
2012
- connection: "keep-alive"
2018
+ connection: "keep-alive",
2019
+ // [hs36] Mirror sendJson's ACAO so SSE streams reach the WebUI from a
2020
+ // cross-port loopback origin. See sendJson comment for rationale.
2021
+ "access-control-allow-origin": "*"
2013
2022
  });
2014
2023
  const firstChunk = {
2015
2024
  id: payload.id,
@@ -2429,7 +2438,9 @@ var require_openclaw_bridge = __commonJS({
2429
2438
  res.writeHead(200, {
2430
2439
  "content-type": "text/event-stream; charset=utf-8",
2431
2440
  "cache-control": "no-cache, no-transform",
2432
- connection: "keep-alive"
2441
+ connection: "keep-alive",
2442
+ // [hs36] CORS for SSE byte-passthrough relay path.
2443
+ "access-control-allow-origin": "*"
2433
2444
  });
2434
2445
  try {
2435
2446
  await pipeStream(upstream.body, (chunk) => res.write(chunk));
@@ -2503,7 +2514,10 @@ var require_openclaw_bridge = __commonJS({
2503
2514
  res.writeHead(200, {
2504
2515
  "content-type": "text/event-stream; charset=utf-8",
2505
2516
  "cache-control": "no-cache, no-transform",
2506
- connection: "keep-alive"
2517
+ connection: "keep-alive",
2518
+ // [hs36] Mirror sendJson's ACAO so SSE streams reach the WebUI from a
2519
+ // cross-port loopback origin. See sendJson comment for rationale.
2520
+ "access-control-allow-origin": "*"
2507
2521
  });
2508
2522
  const msgId = `chatcmpl_${Date.now()}`;
2509
2523
  const created = Math.floor(Date.now() / 1e3);
@@ -3723,6 +3737,18 @@ var require_hermes = __commonJS({
3723
3737
  __name(readConfig, "readConfig");
3724
3738
  function patchConfigYaml(apiKey, baseUrlOpenAI, primaryModel) {
3725
3739
  if (!fs.existsSync(CONFIG_YAML)) {
3740
+ const cleanBase2 = String(baseUrlOpenAI || "https://api.holysheep.ai/v1").replace(/\/+$/, "");
3741
+ const model2 = primaryModel || "claude-sonnet-4-6";
3742
+ const minimal = `model:
3743
+ base_url: ${cleanBase2}
3744
+ api_key: ${apiKey}
3745
+ default: ${model2}
3746
+ providers:
3747
+ custom:
3748
+ base_url: ${cleanBase2}
3749
+ api_key: ${apiKey}
3750
+ `;
3751
+ fs.writeFileSync(CONFIG_YAML, minimal, "utf8");
3726
3752
  return;
3727
3753
  }
3728
3754
  const cleanBase = String(baseUrlOpenAI || "https://api.holysheep.ai/v1").replace(/\/+$/, "");
@@ -3766,7 +3792,6 @@ var require_hermes = __commonJS({
3766
3792
  " custom:",
3767
3793
  ` base_url: ${cleanBase}`,
3768
3794
  ` api_key: ${apiKey}`,
3769
- ` default_model: ${model}`,
3770
3795
  " type: openai"
3771
3796
  ];
3772
3797
  let start = -1, end = -1;
@@ -3879,7 +3904,7 @@ var require_hermes = __commonJS({
3879
3904
  __name(writeConfig, "writeConfig");
3880
3905
  function buildHolySheepBlock(apiKey, baseUrlOpenAI, primaryModel) {
3881
3906
  const cleanBase = String(baseUrlOpenAI || "https://api.holysheep.ai/v1").replace(/\/+$/, "");
3882
- const model = primaryModel || "gpt-5.4";
3907
+ const model = primaryModel || "gpt-4o";
3883
3908
  return [
3884
3909
  "[providers.holysheep]",
3885
3910
  "# Managed by @simonyea/holysheep-cli. Do not edit by hand \u2014 run `hs setup`.",
@@ -3946,10 +3971,11 @@ var require_hermes = __commonJS({
3946
3971
  return commandExists("hermes");
3947
3972
  },
3948
3973
  isConfigured() {
3949
- return isConfiguredInToml(readConfig());
3974
+ return isConfiguredInToml(readConfig()) && fs.existsSync(CONFIG_YAML);
3950
3975
  },
3951
3976
  configure(apiKey, _baseUrlAnthropic, baseUrlOpenAI, primaryModel) {
3952
- const hermesPrimaryModel = /^claude-/i.test(primaryModel || "") ? "gpt-5.4" : primaryModel || "gpt-5.4";
3977
+ const THINKING_MODELS = /^(gpt-5|o[0-9]|claude-)/i;
3978
+ const hermesPrimaryModel = THINKING_MODELS.test(primaryModel || "") ? "gpt-4o" : primaryModel || "gpt-4o";
3953
3979
  const merged = mergeConfig(apiKey, baseUrlOpenAI, hermesPrimaryModel);
3954
3980
  writeConfig(merged);
3955
3981
  try {
@@ -3993,11 +4019,11 @@ var require_package = __commonJS({
3993
4019
  "package.json"(exports2, module2) {
3994
4020
  module2.exports = {
3995
4021
  name: "@simonyea/holysheep-cli",
3996
- version: "2.1.51",
4022
+ version: "2.1.52",
3997
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.",
3998
4024
  scripts: {
3999
4025
  build: "node scripts/build.mjs",
4000
- 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",
4026
+ 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",
4001
4027
  prepublishOnly: "npm run build && npm test && node scripts/check-tarball-size.js"
4002
4028
  },
4003
4029
  keywords: [
@@ -4445,6 +4471,7 @@ var require_env_config = __commonJS({
4445
4471
  module2.exports = {
4446
4472
  name: "\u5168\u5C40\u73AF\u5883\u53D8\u91CF",
4447
4473
  id: "env-config",
4474
+ installCmd: "\u5185\u7F6E\u529F\u80FD\uFF08\u65E0\u9700\u5B89\u88C5\uFF09",
4448
4475
  checkInstalled() {
4449
4476
  return true;
4450
4477
  },
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.51",
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-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",
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: [
@@ -2541,7 +2541,13 @@ var require_openclaw_bridge = __commonJS({
2541
2541
  function sendJson(res, statusCode, payload) {
2542
2542
  res.writeHead(statusCode, {
2543
2543
  "content-type": "application/json; charset=utf-8",
2544
- "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": "*"
2545
2551
  });
2546
2552
  res.end(JSON.stringify(payload));
2547
2553
  }
@@ -2555,7 +2561,10 @@ var require_openclaw_bridge = __commonJS({
2555
2561
  res.writeHead(200, {
2556
2562
  "content-type": "text/event-stream; charset=utf-8",
2557
2563
  "cache-control": "no-cache, no-transform",
2558
- 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": "*"
2559
2568
  });
2560
2569
  const firstChunk = {
2561
2570
  id: payload.id,
@@ -2975,7 +2984,9 @@ var require_openclaw_bridge = __commonJS({
2975
2984
  res.writeHead(200, {
2976
2985
  "content-type": "text/event-stream; charset=utf-8",
2977
2986
  "cache-control": "no-cache, no-transform",
2978
- connection: "keep-alive"
2987
+ connection: "keep-alive",
2988
+ // [hs36] CORS for SSE byte-passthrough relay path.
2989
+ "access-control-allow-origin": "*"
2979
2990
  });
2980
2991
  try {
2981
2992
  await pipeStream(upstream.body, (chunk) => res.write(chunk));
@@ -3049,7 +3060,10 @@ var require_openclaw_bridge = __commonJS({
3049
3060
  res.writeHead(200, {
3050
3061
  "content-type": "text/event-stream; charset=utf-8",
3051
3062
  "cache-control": "no-cache, no-transform",
3052
- 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": "*"
3053
3067
  });
3054
3068
  const msgId = `chatcmpl_${Date.now()}`;
3055
3069
  const created = Math.floor(Date.now() / 1e3);
@@ -4269,6 +4283,18 @@ var require_hermes = __commonJS({
4269
4283
  __name(readConfig, "readConfig");
4270
4284
  function patchConfigYaml(apiKey, baseUrlOpenAI, primaryModel) {
4271
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");
4272
4298
  return;
4273
4299
  }
4274
4300
  const cleanBase = String(baseUrlOpenAI || "https://api.holysheep.ai/v1").replace(/\/+$/, "");
@@ -4312,7 +4338,6 @@ var require_hermes = __commonJS({
4312
4338
  " custom:",
4313
4339
  ` base_url: ${cleanBase}`,
4314
4340
  ` api_key: ${apiKey}`,
4315
- ` default_model: ${model}`,
4316
4341
  " type: openai"
4317
4342
  ];
4318
4343
  let start = -1, end = -1;
@@ -4425,7 +4450,7 @@ var require_hermes = __commonJS({
4425
4450
  __name(writeConfig, "writeConfig");
4426
4451
  function buildHolySheepBlock(apiKey, baseUrlOpenAI, primaryModel) {
4427
4452
  const cleanBase = String(baseUrlOpenAI || "https://api.holysheep.ai/v1").replace(/\/+$/, "");
4428
- const model = primaryModel || "gpt-5.4";
4453
+ const model = primaryModel || "gpt-4o";
4429
4454
  return [
4430
4455
  "[providers.holysheep]",
4431
4456
  "# Managed by @simonyea/holysheep-cli. Do not edit by hand \u2014 run `hs setup`.",
@@ -4492,10 +4517,11 @@ var require_hermes = __commonJS({
4492
4517
  return commandExists2("hermes");
4493
4518
  },
4494
4519
  isConfigured() {
4495
- return isConfiguredInToml(readConfig());
4520
+ return isConfiguredInToml(readConfig()) && fs.existsSync(CONFIG_YAML);
4496
4521
  },
4497
4522
  configure(apiKey, _baseUrlAnthropic, baseUrlOpenAI, primaryModel) {
4498
- const hermesPrimaryModel = /^claude-/i.test(primaryModel || "") ? "gpt-5.4" : primaryModel || "gpt-5.4";
4523
+ const THINKING_MODELS = /^(gpt-5|o[0-9]|claude-)/i;
4524
+ const hermesPrimaryModel = THINKING_MODELS.test(primaryModel || "") ? "gpt-4o" : primaryModel || "gpt-4o";
4499
4525
  const merged = mergeConfig(apiKey, baseUrlOpenAI, hermesPrimaryModel);
4500
4526
  writeConfig(merged);
4501
4527
  try {
@@ -4627,6 +4653,7 @@ var require_env_config = __commonJS({
4627
4653
  module2.exports = {
4628
4654
  name: "\u5168\u5C40\u73AF\u5883\u53D8\u91CF",
4629
4655
  id: "env-config",
4656
+ installCmd: "\u5185\u7F6E\u529F\u80FD\uFF08\u65E0\u9700\u5B89\u88C5\uFF09",
4630
4657
  checkInstalled() {
4631
4658
  return true;
4632
4659
  },
@@ -8802,6 +8829,7 @@ var require_aionui_wrapper = __commonJS({
8802
8829
  var codexTool = require_codex();
8803
8830
  var droidTool = require_droid();
8804
8831
  var hermesTool = require_hermes();
8832
+ var openclawTool = require_openclaw();
8805
8833
  var BRIDGE_DIR = path.join(os.homedir(), ".holysheep");
8806
8834
  var BRIDGE_CRED_FILE = path.join(BRIDGE_DIR, "aionui-bridge.json");
8807
8835
  var TOKEN_TTL_MS = 3e4;
@@ -9114,6 +9142,58 @@ var require_aionui_wrapper = __commonJS({
9114
9142
  return legacyModule;
9115
9143
  }
9116
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");
9117
9197
  var BODYLESS_METHODS = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
9118
9198
  function proxyHttp(req, res, internalPort) {
9119
9199
  const headers = { ...req.headers };
@@ -9137,6 +9217,7 @@ var require_aionui_wrapper = __commonJS({
9137
9217
  delete outHeaders["connection"];
9138
9218
  delete outHeaders["keep-alive"];
9139
9219
  delete outHeaders["proxy-connection"];
9220
+ rewriteCspHeaders(outHeaders);
9140
9221
  res.writeHead(upRes.statusCode, upRes.statusMessage, outHeaders);
9141
9222
  upRes.pipe(res);
9142
9223
  });
@@ -9527,6 +9608,48 @@ var require_aionui_wrapper = __commonJS({
9527
9608
  }
9528
9609
  }
9529
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");
9530
9653
  async function startWrapper({ port, runtimeDir, runtimeVersion, runtimeSource, bunPath }) {
9531
9654
  ensureRuntimeBuiltinResources(runtimeDir);
9532
9655
  const hsNative = detectHolySheepAionUi(runtimeDir);
@@ -9550,6 +9673,7 @@ var require_aionui_wrapper = __commonJS({
9550
9673
  log("warn: CLI auto-config error (continuing): " + (e && e.message ? e.message : e));
9551
9674
  }
9552
9675
  const claudeProxyHandle = await ensureClaudeProcessProxyRunning();
9676
+ ensureOpenClawBridgeRunning();
9553
9677
  const debug = process.env.HS_WEB_DEBUG === "1";
9554
9678
  const { PACKAGE_ROOT, cliVersion, ptyHermesWrapperPath } = require_paths();
9555
9679
  const cliRoot = PACKAGE_ROOT;
@@ -9700,7 +9824,12 @@ ${tail.split(/\r?\n/).map((ln) => ` ${ln}`).join("\n")}
9700
9824
  ensureRuntimeBuiltinResources,
9701
9825
  // [HolySheep v2.1.43] Exported for aionui-wrapper-claude-proxy.test.js
9702
9826
  ensureClaudeProcessProxyRunning,
9703
- probeLocalPort
9827
+ probeLocalPort,
9828
+ // [HolySheep v2.1.51 / hs36] Exported for tests
9829
+ ensureOpenClawBridgeRunning,
9830
+ rewriteCspHeaders,
9831
+ getOpenClawOrigins,
9832
+ appendOriginsToDirective
9704
9833
  };
9705
9834
  }
9706
9835
  });
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@simonyea/holysheep-cli",
3
- "version": "2.1.51",
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-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",
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": [