chore: 停发并归档 Electron 桌面版,产品只保留便携 U 盘版

桌面 Electron 版是商业版 ClawX 已做得更好的事的劣化版,且启动坑多
(冷启动建编译缓存 >30s 撞写死的 30s 硬超时,绿色版每次解压 837MB
永远冷启动)。U-Claw 的本质是「插上 U 盘解压即用」,故停发桌面版,
只发便携版。

- release.yml: 删除 desktop-windows / desktop-mac 两个 job;publish
  只依赖 portable-windows-full;发布说明去掉桌面安装版/dmg,只留便携版
- u-claw-app/DEPRECATED.md: 新增归档说明(停发原因、坑、如何捡回)
- u-claw-app/src/main.js: 顺带修 gateway 超时 30s→180s + spawn 加固定
  NODE_COMPILE_CACHE(让归档代码处于可用状态)
- 删除 usb-release/: portable/ 的老前身,2026-04 后无人维护、全仓库零
  引用,是「为什么有两个 U 盘版」的混乱源
- README.md / CLAUDE.md: 分发形态更新为便携版唯一主发

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
hfshfg
2026-06-20 00:15:32 +08:00
parent 2697b893d5
commit 8cd5dbfea4
24 changed files with 70 additions and 3021 deletions

20
u-claw-app/DEPRECATED.md Normal file
View File

@@ -0,0 +1,20 @@
# ⚠️ 已归档Electron 桌面版不再发布2026-06-19 起)
`u-claw-app/`Electron 打包的桌面版,产出 `U-Claw Setup *.exe` 安装版、`U-Claw *.exe` 绿色版、`U-Claw-*.dmg`**已停止发布**。代码保留在仓库中仅作存档CI 不再构建它。
## 为什么停发
1. **是商业版 ClawX 已做得更好的事的劣化版**——桌面体验打磨不过专门做这件事的 ClawX。
2. **与产品定位相悖**——U-Claw 的本质是「插上 U 盘就能用」(`portable/``.bat`/`.command`Electron 桌面版是跑偏的妥协。
3. **启动坑多**。实测2026-06-19
- OpenClaw 首次冷启动要建 V8 编译缓存,可达 3060s+;旧版 `main.js` 写死 `GATEWAY_STARTUP_TIMEOUT=30000`30s 硬超时)→ **冷启动必弹「Gateway startup timeout」错误框**
- **绿色版**electron-builder portable target每次双击都自解压 837MB 到随机临时目录 → **永远冷启动**,且热重启易因解压目录冲突卡死。
- 已把超时调到 180s + 给 spawn 加固定 `NODE_COMPILE_CACHE`(见本目录 `src/main.js` 的改动)——安装版可用(冷启 50s→热启 9s但绿色版仍是「每次解压重型 app」的先天硬伤。
## 现在的产品形态
唯一主推 **`portable/`**(便携 U 盘版,`.bat`/`.command` 解压即用,已有 U 盘启动加速)。发布只产出 `u-claw-portable-windows-*.zip`,见 `.github/workflows/release.yml`
## 想捡回来怎么办
代码原封不动还在这个目录。构建命令仍是 `cd u-claw-app && bash setup.sh && npm run build:win`。若要重新发布,把 `release.yml` 里删掉的 `desktop-windows`/`desktop-mac` 两个 job 恢复即可(翻 git 历史 commit 即可找回)。重新发布前务必先解决「绿色版每次冷启动」的体验问题,否则会复现上述坑。

View File

@@ -8,7 +8,12 @@ const http = require('http');
const APP_NAME = 'U-Claw';
const DEFAULT_PORT = 18789;
const MAX_PORT = 18799;
const GATEWAY_STARTUP_TIMEOUT = 30000;
// First cold start builds the V8 compile cache for OpenClaw (a large app) — on a
// fresh machine / freshly-extracted portable exe this can take 3060s+. Give it
// room so we never hard-fail with a scary dialog before the engine is up. The
// loading.html splash polls and the window navigates as soon as the gateway is
// ready, so a long ceiling only matters on a genuinely stuck start.
const GATEWAY_STARTUP_TIMEOUT = 180000;
// ── Paths ──
const isDev = process.argv.includes('--dev');
@@ -214,12 +219,20 @@ function startGateway(port) {
const nodeBin = getNodeBin();
console.log(`[${APP_NAME}] Using Node.js: ${nodeBin}`);
// Persist the V8 compile cache to a fixed local dir under userData so the
// gateway's heavy first-run compile is paid only once. userDataPath is stable
// across launches even for the portable exe (which self-extracts to a random
// temp dir each time), so the cache survives and subsequent starts are fast.
const compileCacheDir = path.join(userDataPath, '.cache', 'v8-compile-cache');
try { fs.mkdirSync(compileCacheDir, { recursive: true }); } catch {}
const env = {
...process.env,
OPENCLAW_HOME: userDataPath,
OPENCLAW_STATE_DIR: configDir,
OPENCLAW_CONFIG_PATH: configPath,
OPENCLAW_EMBEDDED_IN: APP_NAME,
NODE_COMPILE_CACHE: compileCacheDir,
};
if (process.platform === 'win32') {