@simonyea/holysheep-cli 2.0.5 → 2.0.6

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/README.md CHANGED
@@ -134,21 +134,32 @@ hs web --aionui
134
134
  2. `<cli>/src/webui/vendor/aionui/` (developer checkout — not shipped to npm)
135
135
  3. `HOLYSHEEP_AIONUI_RUNTIME_URL` env var (advanced escape hatch — downloads + SHA256-verifies into `~/.holysheep/aionui-runtime/`)
136
136
 
137
- **Install the runtime yourself** (npm-only users we do NOT ship a 154 MB bundle):
137
+ **Install the runtime — one-command** (recommended21 MB prebuilt, HolySheep-auth-ready):
138
+
139
+ ```bash
140
+ export HOLYSHEEP_AIONUI_RUNTIME_URL=https://mail.holysheep.ai/app/cli/aionui-runtime-v1.9.17-holysheep.tar.gz
141
+ export HOLYSHEEP_AIONUI_RUNTIME_SHA256=d75adcea3c57c85f64b5db96d18c593f20ad150888f47283dc2da0a440fb652c
142
+ hs web --aionui --setup-runtime
143
+ ```
144
+
145
+ The fetcher downloads to `~/.holysheep/aionui-runtime/`, verifies SHA256, extracts `dist-server/` + `out/` + `package.json`, boots AionUi, and opens your browser at the bootstrap redirect (auto-logged-in with your HS API key). Runs macOS / Linux. Windows support depends on `bun` availability.
146
+
147
+ **Alternative — build from AionUi source** (advanced):
138
148
 
139
149
  ```bash
140
- # Build from AionUi source
141
150
  git clone https://github.com/iOfficeAI/AionUi.git ~/AionUi
142
151
  cd ~/AionUi && bun install && bun run build:renderer:web && bun run build:server
143
152
  mkdir -p ~/.holysheep/aionui-runtime
144
153
  cp -R ~/AionUi/{dist-server,out,package.json} ~/.holysheep/aionui-runtime/
145
154
  hs web --aionui
146
155
  ```
156
+ Note: upstream AionUi's `/login` still expects `{ username, password }`; the legacy wrapper path handles that via an auto-provisioned bridge admin in `~/.holysheep/aionui-bridge.json` (0600).
147
157
 
148
158
  **Recovery / advanced**
149
159
 
150
160
  - `/login` is still reachable at `http://127.0.0.1:9876/login` for direct apiKey entry.
151
- - To rotate credentials: `rm -rf ~/.holysheep/aionui-runtime && hs web --aionui` (or edit `~/.holysheep/config.json`).
161
+ - To rotate credentials: `rm -rf ~/.holysheep/aionui-runtime && hs web --aionui --setup-runtime` (or edit `~/.holysheep/config.json`).
162
+ - Startup logs showing `[AionUi] Could not find builtin src/process/resources/...` are harmless — the prebuilt tarball ships only `dist-server/` + `out/` (not the source tree), so template assistants/skills load from built-in fallbacks instead. The UI works fully; only the "source-tree" assistant templates are unavailable.
152
163
 
153
164
  ---
154
165
 
@@ -268,22 +279,33 @@ hs web --aionui
268
279
  2. `<cli>/src/webui/vendor/aionui/`(开发者本地仓库 —— npm 包不携带)
269
280
  3. `HOLYSHEEP_AIONUI_RUNTIME_URL` 环境变量(高级逃生口 —— 下载 + SHA256 校验后写入 `~/.holysheep/aionui-runtime/`)
270
281
 
271
- **本地安装 runtime**(npm 用户 —— 我们**不**把 154 MB 塞进包里):
282
+ **安装 runtime —— 一条命令**(推荐,21 MB 预编译包,内置 HolySheep Key 登录):
283
+
284
+ ```bash
285
+ export HOLYSHEEP_AIONUI_RUNTIME_URL=https://mail.holysheep.ai/app/cli/aionui-runtime-v1.9.17-holysheep.tar.gz
286
+ export HOLYSHEEP_AIONUI_RUNTIME_SHA256=d75adcea3c57c85f64b5db96d18c593f20ad150888f47283dc2da0a440fb652c
287
+ hs web --aionui --setup-runtime
288
+ ```
289
+
290
+ fetcher 会下载到 `~/.holysheep/aionui-runtime/`,校验 SHA256,解压 `dist-server/ + out/ + package.json`,启动 AionUi,然后直接把浏览器带到 bootstrap 重定向(用你的 HS API Key 自动登录)。macOS / Linux 都行,Windows 视 `bun` 支持情况而定。
291
+
292
+ **备用方案 —— 从 AionUi 源码构建**(高级用户):
272
293
 
273
294
  ```bash
274
- # 从 AionUi 源码构建
275
295
  git clone https://github.com/iOfficeAI/AionUi.git ~/AionUi
276
296
  cd ~/AionUi && bun install && bun run build:renderer:web && bun run build:server
277
297
  mkdir -p ~/.holysheep/aionui-runtime
278
298
  cp -R ~/AionUi/{dist-server,out,package.json} ~/.holysheep/aionui-runtime/
279
299
  hs web --aionui
280
300
  ```
301
+ 注意:上游 AionUi 的 `/login` 仍然是账号密码模式;wrapper 会自动走 legacy 路径,在 `~/.holysheep/aionui-bridge.json` (0600) 建一个桥接管理员账号,不影响使用。
281
302
 
282
303
  **恢复 / 高级**
283
304
 
284
305
  - `/login` 仍可直接访问:`http://127.0.0.1:9876/login`,里面可以手动粘 HS API Key 再登录。
285
- - 要重置:`rm -rf ~/.holysheep/aionui-runtime && hs web --aionui`,或直接编辑 `~/.holysheep/config.json`。
306
+ - 要重置:`rm -rf ~/.holysheep/aionui-runtime && hs web --aionui --setup-runtime`,或直接编辑 `~/.holysheep/config.json`。
286
307
  - runtime 缺失时:`hs web --aionui` 会打印清晰的安装指引并自动回退到 legacy WebUI,不会静默失败。
308
+ - 启动日志里 `[AionUi] Could not find builtin src/process/resources/...` 是已知噪音 —— 预编译 tarball 只带 `dist-server/` 和 `out/`,不含源码目录,所以模板 assistants/skills 会走内置 fallback。界面完全可用,只是少几个"源码级"模板。
287
309
 
288
310
  不设置该环境变量时 `hs web` 走 legacy WebUI,**不会再打印任何黄色警告**。
289
311
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simonyea/holysheep-cli",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
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
  "test": "node tests/droid.test.js && node tests/workspace-store.test.js",
@@ -51,6 +51,16 @@ const UPSTREAM_CONNECT_TIMEOUT_MS = 30_000
51
51
  // Bootstrap token store — Map<token, { createdAt, used }>
52
52
  const bootstrapTokens = new Map()
53
53
 
54
+ // Periodic GC so idle wrappers don't grow memory unboundedly. .unref() so the
55
+ // timer doesn't block process exit on SIGINT. No-op if TTL-cleanup already
56
+ // happened via the lazy path in pruneExpiredTokens().
57
+ let tokenCleanupInterval = null
58
+ function startTokenCleanup() {
59
+ if (tokenCleanupInterval) return
60
+ tokenCleanupInterval = setInterval(() => pruneExpiredTokens(), 60_000)
61
+ if (typeof tokenCleanupInterval.unref === 'function') tokenCleanupInterval.unref()
62
+ }
63
+
54
64
  // Cached AionUi session cookie obtained by internal /login. Refreshed lazily.
55
65
  let cachedAionUiCookie = null
56
66
  let cachedAionUiCookieAt = 0
@@ -610,6 +620,7 @@ async function startWrapper({ port, runtimeDir, runtimeVersion, runtimeSource, b
610
620
  server.listen(port, '127.0.0.1', resolve)
611
621
  })
612
622
  log(`wrapper listening on http://127.0.0.1:${port}`)
623
+ startTokenCleanup()
613
624
 
614
625
  return {
615
626
  server,