@silicaclaw/cli 2026.3.19-6 → 2026.3.19-7

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.
@@ -1 +1 @@
1
- 2026.3.19-6
1
+ 2026.3.19-7
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "silicaclaw-broadcast",
3
- "version": "2026.3.19-6",
3
+ "version": "2026.3.19-7",
4
4
  "display_name": "SilicaClaw Broadcast",
5
5
  "description": "OpenClaw skill for reading SilicaClaw public broadcasts, publishing public broadcasts, and forwarding relevant updates to the owner through OpenClaw's native social channel.",
6
6
  "entrypoints": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silicaclaw/cli",
3
- "version": "2026.3.19-6",
3
+ "version": "2026.3.19-7",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -102,6 +102,10 @@ function detectAppDir() {
102
102
  return resolve(cwd);
103
103
  }
104
104
 
105
+ if (isSilicaClawDir(ROOT_DIR)) {
106
+ return resolve(ROOT_DIR);
107
+ }
108
+
105
109
  const homeCandidate = join(homedir(), "silicaclaw");
106
110
  if (isSilicaClawDir(homeCandidate)) {
107
111
  return resolve(homeCandidate);
@@ -486,6 +490,18 @@ async function waitForPort(port, timeoutMs = 5000) {
486
490
  return null;
487
491
  }
488
492
 
493
+ async function waitForCurrentAppListener(port, kind, timeoutMs = 5000) {
494
+ const startedAt = Date.now();
495
+ let lastListener = null;
496
+ while (Date.now() - startedAt < timeoutMs) {
497
+ const listener = listeningProcessOnPort(port);
498
+ lastListener = listener;
499
+ if (listener && isCurrentAppListener(listener, kind)) return listener;
500
+ await sleep(200);
501
+ }
502
+ return lastListener;
503
+ }
504
+
489
505
  async function waitForPortToClear(port, timeoutMs = 5000) {
490
506
  const startedAt = Date.now();
491
507
  while (Date.now() - startedAt < timeoutMs) {
@@ -523,6 +539,25 @@ function isOwnedListener(listener, kind) {
523
539
  return false;
524
540
  }
525
541
 
542
+ function isCurrentAppListener(listener, kind) {
543
+ if (!listener?.command) return false;
544
+ const command = normalizePathForMatch(listener.command).toLowerCase();
545
+ const appDir = normalizePathForMatch(APP_DIR).toLowerCase();
546
+ if (!command.includes(appDir)) return false;
547
+ if (kind === "local-console") {
548
+ return (
549
+ command.includes("@silicaclaw/local-console") ||
550
+ command.includes("/apps/local-console/") ||
551
+ command.includes("src/server.ts") ||
552
+ command.includes("dist/server.js")
553
+ );
554
+ }
555
+ if (kind === "signaling") {
556
+ return command.includes("webrtc-signaling-server.mjs") || command.includes("npm run webrtc-signaling");
557
+ }
558
+ return false;
559
+ }
560
+
526
561
  async function stopOwnedListener(port, kind) {
527
562
  const listener = listeningProcessOnPort(port);
528
563
  if (!listener || !isOwnedListener(listener, kind)) return false;
@@ -755,11 +790,15 @@ async function main() {
755
790
  }
756
791
  if (cmd === "start") {
757
792
  await startAll();
758
- const listener = await waitForPort(4310, 15000);
759
- if (!listener) {
793
+ const listener = await waitForCurrentAppListener(4310, "local-console", 15000);
794
+ if (!listener || !isCurrentAppListener(listener, "local-console")) {
760
795
  headline();
761
796
  console.log("");
762
797
  kv("Status", paint("failed to start", COLOR.red));
798
+ if (listener) {
799
+ kv("Conflict", `port 4310 is occupied by pid=${listener.pid}`);
800
+ kv("Inspect", "lsof -nP -iTCP:4310 -sTCP:LISTEN");
801
+ }
763
802
  const recent = tailText(CONSOLE_LOG_FILE, 18);
764
803
  if (recent) {
765
804
  console.log("");
@@ -780,11 +819,15 @@ async function main() {
780
819
  if (cmd === "restart") {
781
820
  await stopAll();
782
821
  await startAll();
783
- const listener = await waitForPort(4310, 15000);
784
- if (!listener) {
822
+ const listener = await waitForCurrentAppListener(4310, "local-console", 15000);
823
+ if (!listener || !isCurrentAppListener(listener, "local-console")) {
785
824
  headline();
786
825
  console.log("");
787
826
  kv("Status", paint("failed to restart", COLOR.red));
827
+ if (listener) {
828
+ kv("Conflict", `port 4310 is occupied by pid=${listener.pid}`);
829
+ kv("Inspect", "lsof -nP -iTCP:4310 -sTCP:LISTEN");
830
+ }
788
831
  const recent = tailText(CONSOLE_LOG_FILE, 18);
789
832
  if (recent) {
790
833
  console.log("");