robot-resources 1.3.2 → 1.3.3
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/lib/wizard.js +33 -0
- package/package.json +1 -1
package/lib/wizard.js
CHANGED
|
@@ -165,6 +165,39 @@ export async function runWizard({ nonInteractive = false } = {}) {
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
// ── Step 4.5: Healthcheck ─────────────────────────────────────────────
|
|
169
|
+
|
|
170
|
+
if (results.service) {
|
|
171
|
+
blank();
|
|
172
|
+
step('Verifying Router is responding...');
|
|
173
|
+
|
|
174
|
+
let healthy = false;
|
|
175
|
+
// Retry a few times — the service may need a moment to start
|
|
176
|
+
for (let attempt = 0; attempt < 3; attempt++) {
|
|
177
|
+
try {
|
|
178
|
+
const res = await fetch('http://127.0.0.1:3838/health', {
|
|
179
|
+
signal: AbortSignal.timeout(3000),
|
|
180
|
+
});
|
|
181
|
+
if (res.ok) {
|
|
182
|
+
const data = await res.json();
|
|
183
|
+
if (data.status === 'healthy' || data.status === 'degraded') {
|
|
184
|
+
success(`Router healthy (v${data.version || 'unknown'})`);
|
|
185
|
+
healthy = true;
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
} catch {
|
|
190
|
+
// Wait before retrying
|
|
191
|
+
await new Promise((r) => setTimeout(r, 2000));
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (!healthy) {
|
|
196
|
+
warn('Router not responding yet — it may need a few more seconds to start');
|
|
197
|
+
info('Check manually: curl http://localhost:3838/health');
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
168
201
|
// ── Summary ─────────────────────────────────────────────────────────────
|
|
169
202
|
|
|
170
203
|
const somethingInstalled = results.router || results.service
|