openclawsetup 2.8.0 → 2.8.1

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
@@ -100,7 +100,7 @@ npx openclawsetup@latest --check --strong
100
100
  - 官方 `doctor --fix` + onboard 深度回收
101
101
  - 模型连通性探测(检测到异常会给出明确修复入口)
102
102
 
103
- 管理菜单也提供 `9. 强力检查修复`。
103
+ 管理菜单也提供 `3. 强力检查修复`。
104
104
 
105
105
  ## Token 优化(降低每次输入 token)
106
106
 
package/bin/cli.mjs CHANGED
@@ -2338,24 +2338,46 @@ async function showStatusInfo(cliName) {
2338
2338
 
2339
2339
  console.log(colors.bold(colors.cyan('\n📊 OpenClaw 状态信息\n')));
2340
2340
 
2341
- // 服务状态
2342
- const statusResult = safeExec(`${cliName} status`);
2343
- const output = statusResult.ok ? statusResult.output : '';
2344
- const isRunning = output.toLowerCase().includes('running') || output.toLowerCase().includes('active');
2341
+ // 服务状态(兼容不同 CLI 版本,避免 Windows 下误判)
2342
+ const statusAttempts = [
2343
+ { cmd: `${cliName} status`, label: 'status' },
2344
+ { cmd: `${cliName} gateway status`, label: 'gateway status' },
2345
+ ];
2346
+ let statusState = 'unknown';
2347
+ let statusOutput = '';
2348
+
2349
+ for (const attempt of statusAttempts) {
2350
+ const statusResult = safeExec(attempt.cmd);
2351
+ if (!statusResult.ok || !statusResult.output) continue;
2352
+ statusOutput = statusResult.output;
2353
+ const parsed = parseStatusOutput(statusResult.output);
2354
+ if (parsed === 'running') {
2355
+ statusState = 'running';
2356
+ break;
2357
+ }
2358
+ if (parsed === 'stopped') {
2359
+ statusState = 'stopped';
2360
+ }
2361
+ }
2362
+
2363
+ // 端口检查(作为状态命令兜底)
2364
+ const portResult = getPortCheckOutput(port);
2365
+ const portListening = Boolean(portResult.ok && portResult.output);
2345
2366
 
2346
- if (isRunning) {
2367
+ if (statusState === 'running') {
2347
2368
  console.log(colors.green(' ✓ Gateway 服务正在运行'));
2369
+ } else if (portListening) {
2370
+ console.log(colors.yellow(' ⚠ 状态命令显示未运行,但端口可访问'));
2371
+ console.log(colors.gray(' 兼容模式判定:Gateway 可能正在运行(常见于旧版/Windows)'));
2348
2372
  } else {
2349
2373
  console.log(colors.red(' ✗ Gateway 服务未运行'));
2374
+ if (statusOutput) {
2375
+ console.log(colors.gray(` 状态输出: ${statusOutput.split('\n')[0].slice(0, 100)}`));
2376
+ }
2350
2377
  console.log(colors.yellow(' → 请先选择「检查修复」自动修复此问题\n'));
2351
2378
  return;
2352
2379
  }
2353
2380
 
2354
- // 端口检查
2355
- const portCmd = platform() === 'win32'
2356
- ? `netstat -an | findstr :${port}`
2357
- : `lsof -i :${port} 2>/dev/null || netstat -tlnp 2>/dev/null | grep :${port}`;
2358
- const portResult = safeExec(portCmd);
2359
2381
  if (portResult.ok && portResult.output) {
2360
2382
  console.log(colors.green(` ✓ 端口 ${port} 正在监听`));
2361
2383
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclawsetup",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "OpenClaw 安装向导 - 智能安装、诊断、自动修复",
5
5
  "type": "module",
6
6
  "bin": {
@@ -141,7 +141,7 @@ npx openclawsetup@latest
141
141
  进入菜单后可直接选择:
142
142
 
143
143
  ```text
144
- 9. 强力检查修复(多轮深度修复)
144
+ 3. 强力检查修复(多轮深度修复)
145
145
  ```
146
146
 
147
147
  也可在菜单选择: