@whobot/cli 2.0.4 → 2.0.5
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 +2 -2
- package/bin/install.mjs +12 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ npx --yes @whobot/cli@latest install
|
|
|
20
20
|
npx --yes @whobot/cli@2.0.0 install
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
首次迁移不要运行旧的 `update apply`,也不要直接复用 `npx @whobot/cli@latest install
|
|
23
|
+
首次迁移不要运行旧的 `update apply`,也不要直接复用 `npx @whobot/cli@latest install`。已发布 v1 的全局程序可能软链接到同一标签的 npx 缓存;再次解析同标签可能在安装器启动前覆盖旧程序,使活动检查和原凭据端点校验失去依据。固定的新版本使用独立缓存入口,安装器先检查旧身份、原编译端点和活动通话,再替换程序。新安装的全局包与 npx 缓存分离。
|
|
24
24
|
|
|
25
25
|
v2 后续更新:
|
|
26
26
|
|
|
@@ -53,4 +53,4 @@ SHA-256 用于核对下载内容与 manifest 一致,不声称提供公开签
|
|
|
53
53
|
bun test
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
发布人员在启用最低版本前,应对实际发行源执行仓库的 `bun deploy/check-upgrade-release.mjs latest
|
|
56
|
+
发布人员在启用最低版本前,应对实际发行源执行仓库的 `bun deploy/check-upgrade-release.mjs latest`,验证两项门槛可满足、完整 Skill 包和说明可取,以及隔离 npm/native 安装成功。配置、先制品后门槛的顺序与用户人工宿主清单见仓库 `docs/releases/skill-cli-v2-cutover.md`;检查通过只覆盖当前平台,不表示真实宿主已验收。
|
package/bin/install.mjs
CHANGED
|
@@ -113,7 +113,7 @@ function writeJSONFailure(code, message) {
|
|
|
113
113
|
|
|
114
114
|
function bakedChannel() {
|
|
115
115
|
const ch = String(bootstrap.channel || "").trim();
|
|
116
|
-
if (ch !== "
|
|
116
|
+
if (ch !== "latest") {
|
|
117
117
|
throw new InstallerError("发行渠道缺失或非法", "CHANNEL_INVALID");
|
|
118
118
|
}
|
|
119
119
|
return ch;
|
|
@@ -720,6 +720,9 @@ export async function runExplicitInstall(argv, env) {
|
|
|
720
720
|
reportViaNative(stagedNative, "install_started", "ok", { attrs: reportAttrs }, env);
|
|
721
721
|
verifyNpmEntryVersion(stagedNative, pkg.version, env);
|
|
722
722
|
if (resetLocal) runResetLocal(stagedNative, env);
|
|
723
|
+
// An install stopped after moving the old program aside leaves only its
|
|
724
|
+
// backup; restore it as the installed command does before it runs.
|
|
725
|
+
await recoverNativeBackup(packageNativeBinary(prefix));
|
|
723
726
|
runInstallPhase(stagedNative, ["update", "check-install", "--previous-binary", packageNativeBinary(prefix)], env, "binding", registered);
|
|
724
727
|
runInstallPhase(stagedNative, updateArgs, env, "preflight", registered);
|
|
725
728
|
prepared = await prepareNativeReplace(packageNativeBinary(prefix));
|
|
@@ -765,8 +768,10 @@ export function reportViaNative(native, name, result, { errorCode = "", attrs =
|
|
|
765
768
|
}
|
|
766
769
|
|
|
767
770
|
function failureCode(err) {
|
|
768
|
-
const code
|
|
769
|
-
|
|
771
|
+
for (const code of [err?.reportCode, err?.code]) {
|
|
772
|
+
if (typeof code === "string" && /^[A-Z][A-Z0-9_]{0,63}$/.test(code)) return code;
|
|
773
|
+
}
|
|
774
|
+
return "";
|
|
770
775
|
}
|
|
771
776
|
|
|
772
777
|
function runInstallPhase(native, args, env, phase, previous, wantVersion = pkg.version) {
|
|
@@ -782,7 +787,10 @@ function runInstallPhase(native, args, env, phase, previous, wantVersion = pkg.v
|
|
|
782
787
|
const code = response.error?.code || "UPDATE_VERIFY_FAILED";
|
|
783
788
|
// These two already name the recovery (install --reset-local, then sign in again).
|
|
784
789
|
const tail = RESET_LOCAL_CODES.has(code) ? "。" : ";请按上述原因处理后重试,不要删除客户端安装身份。";
|
|
785
|
-
|
|
790
|
+
const err = new InstallerError(`安装未完成: ${code} ${response.error?.detail || response.error?.userMessage || "目标程序未通过验收"}${tail}`, "UPDATE_VERIFY_FAILED");
|
|
791
|
+
// Analytics only: the launcher output and exit code stay UPDATE_VERIFY_FAILED.
|
|
792
|
+
err.reportCode = code;
|
|
793
|
+
throw err;
|
|
786
794
|
}
|
|
787
795
|
return response;
|
|
788
796
|
}
|