@silicaclaw/cli 1.0.0-beta.32 → 1.0.0-beta.33

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.
@@ -4,6 +4,7 @@
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "dev": "tsx watch src/server.ts",
7
+ "start": "tsx src/server.ts",
7
8
  "build": "tsc -p tsconfig.json",
8
9
  "check": "tsc -p tsconfig.json --noEmit"
9
10
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silicaclaw/cli",
3
- "version": "1.0.0-beta.32",
3
+ "version": "1.0.0-beta.33",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -54,7 +54,7 @@
54
54
  "onboard": "node scripts/silicaclaw-cli.mjs onboard",
55
55
  "quickstart": "bash scripts/quickstart.sh",
56
56
  "gateway": "node scripts/silicaclaw-gateway.mjs",
57
- "local-console": "npm run --workspace @silicaclaw/local-console dev",
57
+ "local-console": "npm run --workspace @silicaclaw/local-console start",
58
58
  "public-explorer": "npm run --workspace @silicaclaw/public-explorer dev",
59
59
  "logo": "bash scripts/install-logo.sh",
60
60
  "webrtc-signaling": "node scripts/webrtc-signaling-server.mjs",
@@ -85,6 +85,15 @@ function runInherit(cmd, args, extra = {}) {
85
85
  return result;
86
86
  }
87
87
 
88
+ function compactOutput(text, limit = 18) {
89
+ const lines = String(text || "")
90
+ .split(/\r?\n/)
91
+ .map((line) => line.trimEnd())
92
+ .filter(Boolean);
93
+ if (lines.length <= limit) return lines.join("\n");
94
+ return lines.slice(-limit).join("\n");
95
+ }
96
+
88
97
  function readVersion() {
89
98
  const versionFile = resolve(ROOT_DIR, "VERSION");
90
99
  if (!existsSync(versionFile)) return "unknown";
@@ -434,6 +443,33 @@ function update() {
434
443
  }
435
444
  }
436
445
 
446
+ function doctor() {
447
+ const steps = [
448
+ { label: "Check", cmd: "npm", args: ["run", "-ws", "check"] },
449
+ { label: "Build", cmd: "npm", args: ["run", "-ws", "build"] },
450
+ { label: "Functional", cmd: "node", args: ["scripts/functional-check.mjs"] },
451
+ ];
452
+
453
+ headline();
454
+ console.log("");
455
+
456
+ for (const step of steps) {
457
+ const result = runCapture(step.cmd, step.args, { cwd: ROOT_DIR });
458
+ if ((result.status ?? 1) === 0) {
459
+ kv(step.label, paint("ok", COLOR.green));
460
+ continue;
461
+ }
462
+
463
+ kv(step.label, paint("failed", COLOR.yellow));
464
+ const detail = compactOutput(`${result.stdout || ""}\n${result.stderr || ""}`);
465
+ if (detail) {
466
+ console.log("");
467
+ console.log(detail);
468
+ }
469
+ process.exit(result.status ?? 1);
470
+ }
471
+ }
472
+
437
473
  function help() {
438
474
  headline();
439
475
  console.log("");
@@ -454,21 +490,9 @@ const cmd = String(process.argv[2] || "help").trim().toLowerCase();
454
490
 
455
491
  switch (cmd) {
456
492
  case "onboard":
457
- headline();
458
- console.log("");
459
- section("Opening onboarding");
460
- kv("Mode", "interactive setup");
461
- kv("Focus", "install command, profile, internet relay");
462
- console.log("");
463
493
  run("bash", [resolve(ROOT_DIR, "scripts", "quickstart.sh")]);
464
494
  break;
465
495
  case "connect":
466
- headline();
467
- console.log("");
468
- section("Opening connect wizard");
469
- kv("Mode", "global-preview first");
470
- kv("Relay", "https://relay.silicaclaw.com");
471
- console.log("");
472
496
  run("bash", [resolve(ROOT_DIR, "scripts", "quickstart.sh")], {
473
497
  env: {
474
498
  ...process.env,
@@ -510,11 +534,7 @@ switch (cmd) {
510
534
  run("npm", ["run", "webrtc-signaling"]);
511
535
  break;
512
536
  case "doctor":
513
- headline();
514
- console.log("");
515
- section("Running health checks");
516
- console.log("");
517
- run("npm", ["run", "health"]);
537
+ doctor();
518
538
  break;
519
539
  case "version":
520
540
  case "-v":
@@ -230,18 +230,20 @@ function buildStatusPayload() {
230
230
  const localPid = readPid(CONSOLE_PID_FILE);
231
231
  const sigPid = readPid(SIGNALING_PID_FILE);
232
232
  const state = readState();
233
+ const localListener = listeningProcessOnPort(4310);
234
+ const signalingListener = listeningProcessOnPort(4510);
233
235
  return {
234
236
  app_dir: APP_DIR,
235
237
  mode: state?.mode || "unknown",
236
238
  adapter: state?.adapter || "unknown",
237
239
  local_console: {
238
240
  pid: localPid,
239
- running: isRunning(localPid),
241
+ running: Boolean(localListener),
240
242
  log_file: CONSOLE_LOG_FILE,
241
243
  },
242
244
  signaling: {
243
245
  pid: sigPid,
244
- running: isRunning(sigPid),
246
+ running: Boolean(signalingListener),
245
247
  log_file: SIGNALING_LOG_FILE,
246
248
  url: state?.signaling_url || null,
247
249
  room: state?.room || null,