@simonyea/holysheep-cli 2.1.47 → 2.1.48

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.
@@ -3993,11 +3993,11 @@ var require_package = __commonJS({
3993
3993
  "package.json"(exports2, module2) {
3994
3994
  module2.exports = {
3995
3995
  name: "@simonyea/holysheep-cli",
3996
- version: "2.1.47",
3996
+ version: "2.1.48",
3997
3997
  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
3998
  scripts: {
3999
3999
  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-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",
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-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",
4001
4001
  prepublishOnly: "npm run build && npm test && node scripts/check-tarball-size.js"
4002
4002
  },
4003
4003
  keywords: [
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.47",
15
+ version: "2.1.48",
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",
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",
20
20
  prepublishOnly: "npm run build && npm test && node scripts/check-tarball-size.js"
21
21
  },
22
22
  keywords: [
@@ -5878,6 +5878,123 @@ var require_openclaw2 = __commonJS({
5878
5878
  }
5879
5879
  });
5880
5880
 
5881
+ // src/utils/version-check.js
5882
+ var require_version_check = __commonJS({
5883
+ "src/utils/version-check.js"(exports2, module2) {
5884
+ "use strict";
5885
+ var fs = require("fs");
5886
+ var os = require("os");
5887
+ var path = require("path");
5888
+ var { exec } = require("child_process");
5889
+ var chalk2 = require("chalk");
5890
+ var PACKAGE_NAME = "@simonyea/holysheep-cli";
5891
+ var CACHE_PATH = path.join(os.homedir(), ".holysheep", "last-version-check.json");
5892
+ var CACHE_TTL_MS = 6 * 60 * 60 * 1e3;
5893
+ var NPM_VIEW_TIMEOUT_MS = 3e3;
5894
+ function parseSemver(v) {
5895
+ if (!v || typeof v !== "string") return null;
5896
+ const m = v.trim().replace(/^v/, "").match(/^(\d+)\.(\d+)\.(\d+)/);
5897
+ if (!m) return null;
5898
+ return [Number(m[1]), Number(m[2]), Number(m[3])];
5899
+ }
5900
+ __name(parseSemver, "parseSemver");
5901
+ function compareSemver(a, b) {
5902
+ const pa = parseSemver(a);
5903
+ const pb = parseSemver(b);
5904
+ if (!pa || !pb) return 0;
5905
+ for (let i = 0; i < 3; i++) {
5906
+ if (pa[i] !== pb[i]) return pa[i] - pb[i];
5907
+ }
5908
+ return 0;
5909
+ }
5910
+ __name(compareSemver, "compareSemver");
5911
+ function readCache() {
5912
+ try {
5913
+ const raw = fs.readFileSync(CACHE_PATH, "utf8");
5914
+ const j = JSON.parse(raw);
5915
+ if (j && typeof j.ts === "number" && typeof j.remote === "string") return j;
5916
+ } catch {
5917
+ }
5918
+ return null;
5919
+ }
5920
+ __name(readCache, "readCache");
5921
+ function writeCache(remote) {
5922
+ try {
5923
+ const dir = path.dirname(CACHE_PATH);
5924
+ if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
5925
+ fs.writeFileSync(CACHE_PATH, JSON.stringify({ ts: Date.now(), remote }) + "\n", { mode: 384 });
5926
+ } catch {
5927
+ }
5928
+ }
5929
+ __name(writeCache, "writeCache");
5930
+ function fetchLatestFromNpm() {
5931
+ return new Promise((resolve) => {
5932
+ const p = exec(
5933
+ `npm view ${PACKAGE_NAME} version --silent`,
5934
+ { timeout: NPM_VIEW_TIMEOUT_MS, windowsHide: true },
5935
+ (err, stdout) => {
5936
+ if (err) return resolve(null);
5937
+ const ver = String(stdout || "").trim();
5938
+ if (parseSemver(ver)) resolve(ver);
5939
+ else resolve(null);
5940
+ }
5941
+ );
5942
+ setTimeout(() => {
5943
+ try {
5944
+ p.kill("SIGKILL");
5945
+ } catch {
5946
+ }
5947
+ resolve(null);
5948
+ }, NPM_VIEW_TIMEOUT_MS + 500);
5949
+ });
5950
+ }
5951
+ __name(fetchLatestFromNpm, "fetchLatestFromNpm");
5952
+ function printBanner2(localVersion, remoteVersion) {
5953
+ const line = "\u2501".repeat(54);
5954
+ console.log();
5955
+ console.log(chalk2.yellow(line));
5956
+ console.log(chalk2.yellow.bold(`\u26A0 HolySheep CLI \u6709\u65B0\u7248\u672C: ${localVersion} \u2192 ${remoteVersion}`));
5957
+ console.log(chalk2.yellow(" \u542B\u5173\u952E\u4FEE\u590D\uFF08\u542B Windows aionui Claude 403 \u8BA4\u8BC1\u4FEE\u590D\uFF09"));
5958
+ console.log(chalk2.yellow.bold(" \u5347\u7EA7\u547D\u4EE4: ") + chalk2.cyan.bold(`npm i -g ${PACKAGE_NAME}@latest`));
5959
+ console.log(chalk2.gray(" \u8DF3\u8FC7\u6B64\u68C0\u67E5: HOLYSHEEP_SKIP_VERSION_CHECK=1"));
5960
+ console.log(chalk2.yellow(line));
5961
+ console.log();
5962
+ }
5963
+ __name(printBanner2, "printBanner");
5964
+ function scheduleUpgradeBannerCheck({ localVersion }) {
5965
+ if (process.env.HOLYSHEEP_SKIP_VERSION_CHECK === "1") return;
5966
+ if (!parseSemver(localVersion)) return;
5967
+ (async () => {
5968
+ try {
5969
+ const cached = readCache();
5970
+ const now = Date.now();
5971
+ let remote = null;
5972
+ if (cached && now - cached.ts < CACHE_TTL_MS && parseSemver(cached.remote)) {
5973
+ remote = cached.remote;
5974
+ } else {
5975
+ remote = await fetchLatestFromNpm();
5976
+ if (remote) writeCache(remote);
5977
+ }
5978
+ if (!remote) return;
5979
+ if (compareSemver(remote, localVersion) > 0) {
5980
+ printBanner2(localVersion, remote);
5981
+ }
5982
+ } catch {
5983
+ }
5984
+ })();
5985
+ }
5986
+ __name(scheduleUpgradeBannerCheck, "scheduleUpgradeBannerCheck");
5987
+ module2.exports = {
5988
+ scheduleUpgradeBannerCheck,
5989
+ // exported for tests
5990
+ _parseSemver: parseSemver,
5991
+ _compareSemver: compareSemver,
5992
+ CACHE_PATH,
5993
+ CACHE_TTL_MS
5994
+ };
5995
+ }
5996
+ });
5997
+
5881
5998
  // src/webui/aionui-runtime-fetcher.js
5882
5999
  var require_aionui_runtime_fetcher = __commonJS({
5883
6000
  "src/webui/aionui-runtime-fetcher.js"(exports2, module2) {
@@ -5890,9 +6007,9 @@ var require_aionui_runtime_fetcher = __commonJS({
5890
6007
  var http = require("http");
5891
6008
  var USER_CACHE_DIR = path.join(os.homedir(), ".holysheep", "aionui-runtime");
5892
6009
  var VENDOR_DIR = path.join(__dirname, "vendor", "aionui");
5893
- var DEFAULT_RUNTIME_URL = "https://mail.holysheep.ai/app/cli/aionui-runtime-v1.9.18-holysheep-hs34.tar.gz";
5894
- var DEFAULT_RUNTIME_SHA256 = "5f656f6c049c935a26b76a70539147e7af17325817fe539a65ca46315590ecb1";
5895
- var DEFAULT_RUNTIME_VERSION = "1.9.18-holysheep-hs34";
6010
+ var DEFAULT_RUNTIME_URL = "https://mail.holysheep.ai/app/cli/aionui-runtime-v1.9.18-holysheep-hs35.tar.gz";
6011
+ var DEFAULT_RUNTIME_SHA256 = "8f0378f8e15d7668429b02e196877e93d8b773055ce6953d83f9b2567b493a99";
6012
+ var DEFAULT_RUNTIME_VERSION = "1.9.18-holysheep-hs35";
5896
6013
  function isValidRuntimeDir(dir) {
5897
6014
  if (!dir) return false;
5898
6015
  try {
@@ -6897,6 +7014,12 @@ var require_claude = __commonJS({
6897
7014
  if (!apiKey) {
6898
7015
  throw new Error("Missing API Key. Run hs setup first.");
6899
7016
  }
7017
+ try {
7018
+ const { scheduleUpgradeBannerCheck } = require_version_check();
7019
+ const pkg2 = require_package();
7020
+ scheduleUpgradeBannerCheck({ localVersion: pkg2.version });
7021
+ } catch {
7022
+ }
6900
7023
  ensureClaudeProxyConfig(apiKey);
6901
7024
  const settings = claudeCodeTool.readSettings();
6902
7025
  if ((_a = settings.env) == null ? void 0 : _a.ANTHROPIC_BASE_URL) {
@@ -9502,6 +9625,7 @@ var require_webui = __commonJS({
9502
9625
  var fs = require("fs");
9503
9626
  var path = require("path");
9504
9627
  var http = require("http");
9628
+ var { scheduleUpgradeBannerCheck } = require_version_check();
9505
9629
  function isLegacy(opts) {
9506
9630
  return process.env.HOLYSHEEP_WEBUI_LEGACY === "1";
9507
9631
  }
@@ -9855,6 +9979,11 @@ var require_webui = __commonJS({
9855
9979
  console.log(chalk2.bold("\u{1F310} HolySheep WebUI"));
9856
9980
  console.log(chalk2.gray("\u2501".repeat(50)));
9857
9981
  console.log();
9982
+ try {
9983
+ const pkg2 = require_package();
9984
+ scheduleUpgradeBannerCheck({ localVersion: pkg2.version });
9985
+ } catch {
9986
+ }
9858
9987
  try {
9859
9988
  if (isLegacy(opts) && !opts.aionui) {
9860
9989
  console.log(chalk2.gray(`[mode=legacy platform=${process.platform}]`));
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@simonyea/holysheep-cli",
3
- "version": "2.1.47",
3
+ "version": "2.1.48",
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",
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",
8
8
  "prepublishOnly": "npm run build && npm test && node scripts/check-tarball-size.js"
9
9
  },
10
10
  "keywords": [