voicecc 1.1.8 → 1.1.9

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/bin/voicecc.js CHANGED
@@ -543,6 +543,16 @@ if (isRunning()) {
543
543
  // Start the daemon
544
544
  startDaemon();
545
545
 
546
- // Wait briefly for server to write status.json, then show info
547
- await new Promise((resolve) => setTimeout(resolve, 3000));
546
+ // Poll for status.json until the server is ready
547
+ const tunnelEnabled = readFileSync(ENV_PATH, "utf-8").includes("TUNNEL_ENABLED=true");
548
+ const MAX_WAIT_MS = tunnelEnabled ? 30000 : 10000;
549
+ const POLL_INTERVAL_MS = 500;
550
+ const startTime = Date.now();
551
+
552
+ while (Date.now() - startTime < MAX_WAIT_MS) {
553
+ await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS));
554
+ const status = readStatus();
555
+ if (status && (!tunnelEnabled || status.tunnelUrl)) break;
556
+ }
557
+
548
558
  showInfo();