limbo-ai 1.18.3 → 1.18.4
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/cli.js +26 -5
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -545,6 +545,24 @@ const warn = (msg) => console.log(`${c.yellow}[limbo]${c.reset} ${msg}`);
|
|
|
545
545
|
const die = (msg) => { console.error(`${c.red}[limbo] ERROR:${c.reset} ${msg}`); process.exit(1); };
|
|
546
546
|
const header = (msg) => console.log(`\n${c.bold}${msg}${c.reset}`);
|
|
547
547
|
|
|
548
|
+
// Single-line spinner: overwrites the same line on TTY, falls back to log() on pipe/CI.
|
|
549
|
+
const SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
550
|
+
let _spinnerFrame = 0;
|
|
551
|
+
function spinnerWrite(msg) {
|
|
552
|
+
if (process.stdout.isTTY) {
|
|
553
|
+
const frame = SPINNER_FRAMES[_spinnerFrame++ % SPINNER_FRAMES.length];
|
|
554
|
+
const line = `\r${c.cyan}[limbo]${c.reset} ${frame} ${msg}`;
|
|
555
|
+
process.stdout.write(line.padEnd(process.stdout.columns || 80));
|
|
556
|
+
} else {
|
|
557
|
+
log(msg);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
function spinnerClear() {
|
|
561
|
+
if (process.stdout.isTTY) {
|
|
562
|
+
process.stdout.write('\r' + ' '.repeat(process.stdout.columns || 80) + '\r');
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
548
566
|
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
549
567
|
|
|
550
568
|
function t(lang, key, ...args) {
|
|
@@ -732,11 +750,12 @@ function waitForHealthy(lang, maxAttempts = 12) {
|
|
|
732
750
|
for (let i = 1; i <= maxAttempts; i++) {
|
|
733
751
|
try {
|
|
734
752
|
const raw = runQuiet('docker compose ps --format json');
|
|
735
|
-
if (raw.includes('"healthy"')) return true;
|
|
753
|
+
if (raw.includes('"healthy"')) { spinnerClear(); return true; }
|
|
736
754
|
} catch {}
|
|
737
|
-
|
|
755
|
+
spinnerWrite(`${t(lang, 'waitingHealth', i, maxAttempts)}`);
|
|
738
756
|
sleep(5000);
|
|
739
757
|
}
|
|
758
|
+
spinnerClear();
|
|
740
759
|
return false;
|
|
741
760
|
}
|
|
742
761
|
|
|
@@ -1099,12 +1118,12 @@ async function createSetupTunnel(port, tunnelDomain) {
|
|
|
1099
1118
|
// Warmup: wait for DNS to propagate AND tunnel to respond before returning.
|
|
1100
1119
|
// Chrome uses its own DoH resolver and won't see the URL until DNS is globally propagated.
|
|
1101
1120
|
// We check DNS resolution (not just HTTP reachability) to ensure browsers can reach it.
|
|
1102
|
-
log('Waiting for tunnel to be reachable...');
|
|
1103
1121
|
const https = require('https');
|
|
1104
1122
|
const dns = require('dns').promises;
|
|
1105
1123
|
const tunnelHost = tunnelUrl.replace('https://', '');
|
|
1106
1124
|
let reachable = false;
|
|
1107
1125
|
for (let i = 0; i < 30; i++) {
|
|
1126
|
+
spinnerWrite(`Waiting for tunnel to be reachable... (${i + 1}/30)`);
|
|
1108
1127
|
try {
|
|
1109
1128
|
// First verify DNS resolves (catches DoH propagation issues)
|
|
1110
1129
|
await dns.lookup(tunnelHost);
|
|
@@ -1121,6 +1140,7 @@ async function createSetupTunnel(port, tunnelDomain) {
|
|
|
1121
1140
|
} catch {}
|
|
1122
1141
|
sleep(2000);
|
|
1123
1142
|
}
|
|
1143
|
+
spinnerClear();
|
|
1124
1144
|
if (!reachable) {
|
|
1125
1145
|
warn('Tunnel created but DNS has not fully propagated. The URL may take a moment to work.');
|
|
1126
1146
|
}
|
|
@@ -1553,11 +1573,12 @@ function extractWizardUrl(maxAttempts = 15) {
|
|
|
1553
1573
|
});
|
|
1554
1574
|
const output = logs.stdout || '';
|
|
1555
1575
|
const match = output.match(/SETUP_URL=(https?:\/\/\S+)/);
|
|
1556
|
-
if (match) return match[1];
|
|
1576
|
+
if (match) { spinnerClear(); return match[1]; }
|
|
1557
1577
|
} catch {}
|
|
1558
|
-
|
|
1578
|
+
spinnerWrite(`Waiting for setup wizard URL... (${i}/${maxAttempts})`);
|
|
1559
1579
|
sleep(2000);
|
|
1560
1580
|
}
|
|
1581
|
+
spinnerClear();
|
|
1561
1582
|
return null;
|
|
1562
1583
|
}
|
|
1563
1584
|
|