@coboot/headless 0.2.2-rc.8 → 0.2.2-rc.9

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.
Files changed (4) hide show
  1. package/README.md +33 -14
  2. package/entry.mjs +289 -288
  3. package/package.json +1 -1
  4. package/updater.mjs +4 -4
package/README.md CHANGED
@@ -6,7 +6,7 @@ Headless 业务运行时要求 Node.js 20+;当入口检测到 Node.js 18/19
6
6
  首次启动只需一次性设备 token:
7
7
 
8
8
  ```bash
9
- npx -y @coboot/headless@0.2.2-rc.8 '<device-token>'
9
+ npx -y @coboot/headless@0.2.2-rc.9 '<device-token>'
10
10
  ```
11
11
 
12
12
  Siboot 和 Coboot 都继承入口进程的运行身份:入口是 root 就以 root 运行,入口是普通用户就以该用户运行。
@@ -38,10 +38,10 @@ detached daemon 并退出。不需要设置 `BACKEND_URL`、`CLIENT_UID`。终
38
38
  并重新启动旧 client,不会让两个 Headless 进程争抢同一台物理机的 Driver 锁。
39
39
 
40
40
  ```bash
41
- npx -y @coboot/headless@0.2.2-rc.8 status
42
- npx -y @coboot/headless@0.2.2-rc.8 logs
43
- npx -y @coboot/headless@0.2.2-rc.8 restart
44
- npx -y @coboot/headless@0.2.2-rc.8 stop
41
+ npx -y @coboot/headless@0.2.2-rc.9 status
42
+ npx -y @coboot/headless@0.2.2-rc.9 logs
43
+ npx -y @coboot/headless@0.2.2-rc.9 restart
44
+ npx -y @coboot/headless@0.2.2-rc.9 stop
45
45
  ```
46
46
 
47
47
  更新到 npm `latest` 并重启:
@@ -53,6 +53,25 @@ npx -y @coboot/headless@latest update
53
53
  `update` 会先完成 Node.js 版本、设备凭证和新包完整性预检,再停止旧进程并切换版本;新版本启动失败时
54
54
  会自动恢复并重启旧版本。`restart` 只重启已经安装的版本,不再隐式替换运行时。
55
55
 
56
+
57
+ 页面下发更新时,端侧 updater 使用显式包名和可执行文件调用:
58
+
59
+ ```bash
60
+ npx -y --package=@coboot/headless@<target-version> coboot-headless update
61
+ ```
62
+
63
+ 这样不会把 Node.js 18/19 引导遗留的 `npm_config_package=node@22` 当成更新包,避免出现
64
+ `sh: @coboot/headless@<version>: No such file or directory`(退出码 127)。更新失败且仍在旧版本时,
65
+ 只有本次调用日志明确记录 `runtime_replace phase=rolled_back` 才上报已回滚;安装前失败上报失败,
66
+ 当天历史日志中的回滚记录不作为本次回滚证据。
67
+
68
+ 该修复需要重新发布 npm 包;仅合入源码不会修复已安装的 updater。旧版本应先使用上面的显式命令
69
+ 安装包含修复的新版本,再验收后续页面更新。测试环境继续传入匹配的 endpoint 覆盖变量,
70
+ 并保持同一运行账号、数据根和工作目录。验收时核对 `.coboot/current/manifest.json` 的版本、
71
+ `run/status.json` 的 `client_ready` 与 `client_version`,以及 `run/runtime-update-state.json`
72
+ 的 `phase` 和 `actual_version`;日志位于 `.coboot/logs/update/`。
73
+
74
+
56
75
  一般不需要修改数据目录。确需放到其他位置时,用 `COBOOT_DATA_ROOT` 指定一个当前用户可写的绝对路径。
57
76
 
58
77
 
@@ -66,8 +85,8 @@ Coboot 将安装位置写入用户默认应用目录的 `installation.json`(
66
85
  Agent 默认工作目录可在首次绑定或重启时单独指定,必须是已存在的绝对目录:
67
86
 
68
87
  ```bash
69
- npx -y @coboot/headless@0.2.2-rc.8 '<device-token>' --workspace-dir /home/demo/project
70
- npx -y @coboot/headless@0.2.2-rc.8 restart --workspace-dir /home/demo/another-project
88
+ npx -y @coboot/headless@0.2.2-rc.9 '<device-token>' --workspace-dir /home/demo/project
89
+ npx -y @coboot/headless@0.2.2-rc.9 restart --workspace-dir /home/demo/another-project
71
90
  ```
72
91
 
73
92
  该设置会保存;任务明确选中的本机目录优先于安装默认值。Bash cwd 和相对文件路径使用同一默认值,
@@ -85,13 +104,13 @@ Coboot daemon 默认禁用 updater 和浏览器预热,第一次调用 `browser
85
104
 
86
105
  ```bash
87
106
  HEADLESS_BROWSER_EXECUTABLE=/absolute/path/to/chrome \
88
- npx -y @coboot/headless@0.2.2-rc.8 '<device-token>'
107
+ npx -y @coboot/headless@0.2.2-rc.9 '<device-token>'
89
108
  ```
90
109
 
91
110
  需要安装浏览器时,由用户执行:
92
111
 
93
112
  ```bash
94
- npx -y @coboot/headless@0.2.2-rc.8 install-browser
113
+ npx -y @coboot/headless@0.2.2-rc.9 install-browser
95
114
  ```
96
115
 
97
116
  该命令不需要设备 token,也不要求 root。它会先检查现有浏览器并执行启动验证;浏览器已经可用时
@@ -129,7 +148,7 @@ dnf/yum 先试仓库中的 `chromium`,x86_64 回退到官方 RPM 并关闭 wea
129
148
  自动化或排障需要显式表达重新注册时,也可以使用:
130
149
 
131
150
  ```bash
132
- npx -y @coboot/headless@0.2.2-rc.8 --force-enroll '<device-token>'
151
+ npx -y @coboot/headless@0.2.2-rc.9 --force-enroll '<device-token>'
133
152
  ```
134
153
 
135
154
  当本地已经存在设备身份时,该命令与再次传入 positional token 使用同一套事务式替换流程。
@@ -166,7 +185,7 @@ HTTP 与 WebSocket 必须同域并与设备 token 匹配:
166
185
  HEADLESS_ALLOW_ENDPOINT_OVERRIDE=1 \
167
186
  BACKEND_URL=https://example.com \
168
187
  WS_URL=wss://example.com/wsschat \
169
- npx -y @coboot/headless@0.2.2-rc.8 '<device-token>'
188
+ npx -y @coboot/headless@0.2.2-rc.9 '<device-token>'
170
189
  ```
171
190
 
172
191
  WebSocket 覆盖变量名是 `WS_URL`,不是 `WSS_URL`。
@@ -180,7 +199,7 @@ endpoint 覆盖同样不会写入配置;后续执行 `restart` 时必须再次
180
199
  CU_EDITION=coboot \
181
200
  PKG_NAME=@coboot/headless \
182
201
  PKG_BIN_NAME=coboot-headless \
183
- PKG_VERSION=0.2.2-rc.8 \
202
+ PKG_VERSION=0.2.2-rc.9 \
184
203
  pnpm build:headless:npm
185
204
  ```
186
205
 
@@ -188,8 +207,8 @@ pnpm build:headless:npm
188
207
 
189
208
  ```bash
190
209
  npm pack --dry-run --json ./dist-headless
191
- tar -xOf dist-headless/coboot-headless-0.2.2-rc.8.tgz package/package.json
192
- sha256sum dist-headless/coboot-headless-0.2.2-rc.8.tgz
210
+ tar -xOf dist-headless/coboot-headless-0.2.2-rc.9.tgz package/package.json
211
+ sha256sum dist-headless/coboot-headless-0.2.2-rc.9.tgz
193
212
  ```
194
213
 
195
214