@lark-apaas/openclaw-scripts-diagnose-cli 0.1.13-alpha.2 → 0.1.13-alpha.3

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 (2) hide show
  1. package/dist/index.cjs +30 -9
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -52,7 +52,7 @@ node_assert = __toESM(node_assert);
52
52
  * it terse and parseable.
53
53
  */
54
54
  function getVersion() {
55
- return "0.1.13-alpha.2";
55
+ return "0.1.13-alpha.3";
56
56
  }
57
57
  //#endregion
58
58
  //#region src/rule-engine/base.ts
@@ -10132,7 +10132,7 @@ async function reportCliRun(opts) {
10132
10132
  //#region src/help.ts
10133
10133
  const BIN = "mclaw-diagnose";
10134
10134
  function versionBanner() {
10135
- return `v0.1.13-alpha.2`;
10135
+ return `v0.1.13-alpha.3`;
10136
10136
  }
10137
10137
  const COMMANDS = [
10138
10138
  {
@@ -10834,9 +10834,17 @@ function runUpgradeLark(opts) {
10834
10834
  log
10835
10835
  };
10836
10836
  const cliScript = opts.cliScript ?? process.argv[1];
10837
- log(`=== upgrade-lark started runId=${opts.runId} cwd=${cwd} configPath=${configPath} ===`);
10837
+ const statusCheckDelayMs = opts.statusCheckDelayMs ?? 5e3;
10838
+ log(`${"=".repeat(60)}`);
10839
+ log(`upgrade-lark started runId=${opts.runId}`);
10840
+ log(` cwd : ${cwd}`);
10841
+ log(` configPath : ${configPath}`);
10842
+ log(`${"=".repeat(60)}`);
10843
+ log("");
10844
+ log("── [1/6] 升级前状态快照 ──────────────────────────────────");
10838
10845
  log(`before-state: botCount=${countFeishuBots(configPath)}`);
10839
- log("--- backup ---");
10846
+ log("");
10847
+ log("── [2/6] 文件备份 ────────────────────────────────────────");
10840
10848
  const backup = backupFiles(fsOpts);
10841
10849
  if (!backup.ok) {
10842
10850
  log(`ERROR: ${backup.error}`);
@@ -10848,7 +10856,8 @@ function runUpgradeLark(opts) {
10848
10856
  }
10849
10857
  log("backup: ok");
10850
10858
  logVersionSnapshot("before-versions", snapshotVersions(cwd), log);
10851
- log("--- npx @larksuite/openclaw-lark-tools update ---");
10859
+ log("");
10860
+ log("── [3/6] npx install (@larksuite/openclaw-lark-tools update) ──");
10852
10861
  const npxResult = (0, node_child_process.spawnSync)("npx", [
10853
10862
  "-y",
10854
10863
  "@larksuite/openclaw-lark-tools",
@@ -10870,7 +10879,14 @@ function runUpgradeLark(opts) {
10870
10879
  if (npxStderr) log(`npx stderr:\n${npxStderr}`);
10871
10880
  log(`npx exit: ${npxExitCode}${npxResult.error ? ` error: ${npxResult.error.message}` : ""}`);
10872
10881
  logVersionSnapshot("after-versions", snapshotVersions(cwd), log);
10873
- log("--- openclaw gateway status ---");
10882
+ if (statusCheckDelayMs > 0) {
10883
+ log("");
10884
+ log(`── 等待 ${statusCheckDelayMs / 1e3}s(让 openclaw 服务完成重启) ─────────────`);
10885
+ Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, statusCheckDelayMs);
10886
+ log("wait done");
10887
+ }
10888
+ log("");
10889
+ log("── [4/6] openclaw gateway status ────────────────────────");
10874
10890
  const gatewayStatusResult = (0, node_child_process.spawnSync)("openclaw", ["gateway", "status"], {
10875
10891
  cwd,
10876
10892
  encoding: "utf-8",
@@ -10884,7 +10900,8 @@ function runUpgradeLark(opts) {
10884
10900
  if (gatewayStatusResult.stdout?.trim()) log(`gateway stdout:\n${gatewayStatusResult.stdout.trim()}`);
10885
10901
  if (gatewayStatusResult.stderr?.trim()) log(`gateway stderr:\n${gatewayStatusResult.stderr.trim()}`);
10886
10902
  log(`gateway status exit: ${gatewayStatusResult.status ?? "null"}${gatewayStatusResult.error ? ` error: ${gatewayStatusResult.error.message}` : ""}`);
10887
- log("--- doctor check ---");
10903
+ log("");
10904
+ log("── [5/6] doctor check ────────────────────────────────────");
10888
10905
  const doctorArgs = ["doctor"];
10889
10906
  if (opts.scene) doctorArgs.push(`--scene=${opts.scene}`);
10890
10907
  const doctorResult = (0, node_child_process.spawnSync)(process.execPath, [cliScript, ...doctorArgs], {
@@ -10901,7 +10918,8 @@ function runUpgradeLark(opts) {
10901
10918
  if (doctorResult.stdout?.trim()) log(`doctor stdout:\n${doctorResult.stdout.trim()}`);
10902
10919
  if (doctorResult.stderr?.trim()) log(`doctor stderr:\n${doctorResult.stderr.trim()}`);
10903
10920
  log(`doctor exit: ${doctorResult.status ?? "null"}${doctorResult.error ? ` error: ${doctorResult.error.message}` : ""}`);
10904
- log("--- channels probe ---");
10921
+ log("");
10922
+ log("── [6/6] channels probe ──────────────────────────────────");
10905
10923
  try {
10906
10924
  const channelsResult = runChannelsProbe(3e4);
10907
10925
  log(`channels available: ${channelsResult.available}`);
@@ -10912,7 +10930,10 @@ function runUpgradeLark(opts) {
10912
10930
  } catch (e) {
10913
10931
  log(`channels probe threw: ${e.message}`);
10914
10932
  }
10915
- log("=== upgrade-lark completed (validation disabled) ===");
10933
+ log("");
10934
+ log(`${"=".repeat(60)}`);
10935
+ log("upgrade-lark completed (validation disabled)");
10936
+ log(`${"=".repeat(60)}`);
10916
10937
  return {
10917
10938
  ok: true,
10918
10939
  stdout: npxStdout,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/openclaw-scripts-diagnose-cli",
3
- "version": "0.1.13-alpha.2",
3
+ "version": "0.1.13-alpha.3",
4
4
  "description": "CLI for OpenClaw config diagnose and repair with JSON5 support",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {