robot-resources 1.5.1 → 1.5.2
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/tool-config.js +6 -4
- package/lib/wizard.js +3 -2
- package/package.json +1 -1
package/lib/tool-config.js
CHANGED
|
@@ -6,8 +6,9 @@ import { isOpenClawInstalled, isOpenClawPluginInstalled, getOpenClawAuthMode } f
|
|
|
6
6
|
import { stripJson5 } from './json5.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Run a command with a heartbeat
|
|
10
|
-
*
|
|
9
|
+
* Run a command with a heartbeat to keep agent sessions alive.
|
|
10
|
+
* OC kills processes after 5s of no output (noOutputTimeoutMs).
|
|
11
|
+
* Prints immediately, then every 4s (safely under the 5s threshold).
|
|
11
12
|
*/
|
|
12
13
|
function spawnWithHeartbeat(cmd, args, { label, timeout = 30_000 } = {}) {
|
|
13
14
|
return new Promise((resolve, reject) => {
|
|
@@ -16,11 +17,12 @@ function spawnWithHeartbeat(cmd, args, { label, timeout = 30_000 } = {}) {
|
|
|
16
17
|
timeout,
|
|
17
18
|
});
|
|
18
19
|
|
|
20
|
+
process.stdout.write(` ${label}...\n`);
|
|
19
21
|
let seconds = 0;
|
|
20
22
|
const heartbeat = setInterval(() => {
|
|
21
|
-
seconds +=
|
|
23
|
+
seconds += 4;
|
|
22
24
|
process.stdout.write(` ${label}... ${seconds}s\n`);
|
|
23
|
-
},
|
|
25
|
+
}, 4000);
|
|
24
26
|
|
|
25
27
|
proc.on('close', (code) => {
|
|
26
28
|
clearInterval(heartbeat);
|
package/lib/wizard.js
CHANGED
|
@@ -243,11 +243,12 @@ export async function runWizard({ nonInteractive = false } = {}) {
|
|
|
243
243
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
244
244
|
timeout: 15_000,
|
|
245
245
|
});
|
|
246
|
+
process.stdout.write(' Restarting gateway...\n');
|
|
246
247
|
let seconds = 0;
|
|
247
248
|
const hb = setInterval(() => {
|
|
248
|
-
seconds +=
|
|
249
|
+
seconds += 4;
|
|
249
250
|
process.stdout.write(` Restarting gateway... ${seconds}s\n`);
|
|
250
|
-
},
|
|
251
|
+
}, 4000);
|
|
251
252
|
proc.on('close', (code) => { clearInterval(hb); code === 0 ? resolve() : reject(new Error(`exit ${code}`)); });
|
|
252
253
|
proc.on('error', (err) => { clearInterval(hb); reject(err); });
|
|
253
254
|
});
|