hedgequantx 2.7.72 → 2.7.74
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/package.json +1 -1
- package/src/menus/dashboard.js +12 -3
- package/src/pages/ai-agents.js +20 -10
package/package.json
CHANGED
package/src/menus/dashboard.js
CHANGED
|
@@ -242,9 +242,18 @@ const handleUpdate = async () => {
|
|
|
242
242
|
|
|
243
243
|
spinner.succeed(`UPDATED TO V${latestVersion}!`);
|
|
244
244
|
console.log(chalk.green('\n ✓ UPDATE SUCCESSFUL!'));
|
|
245
|
-
console.log(chalk.
|
|
246
|
-
|
|
247
|
-
|
|
245
|
+
console.log(chalk.cyan('\n RESTARTING HQX...'));
|
|
246
|
+
|
|
247
|
+
// Restart CLI with new version using spawn detached
|
|
248
|
+
const { spawn } = require('child_process');
|
|
249
|
+
const child = spawn('hqx', [], {
|
|
250
|
+
detached: true,
|
|
251
|
+
stdio: 'inherit',
|
|
252
|
+
shell: true
|
|
253
|
+
});
|
|
254
|
+
child.unref();
|
|
255
|
+
|
|
256
|
+
// Exit current process to let new one take over
|
|
248
257
|
process.exit(0);
|
|
249
258
|
|
|
250
259
|
} catch (error) {
|
package/src/pages/ai-agents.js
CHANGED
|
@@ -222,19 +222,29 @@ const handleCliProxyConnection = async (provider, config, boxWidth) => {
|
|
|
222
222
|
spinner.text = 'EXCHANGING TOKEN...';
|
|
223
223
|
|
|
224
224
|
// Wait for login process to exit naturally (it saves auth file then exits)
|
|
225
|
+
// Process typically exits 1-2 seconds after callback
|
|
225
226
|
await new Promise((resolve) => {
|
|
226
227
|
if (!loginResult.childProcess) return resolve();
|
|
227
228
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
229
|
+
// Check every 500ms if process is still running, max 15s
|
|
230
|
+
let elapsed = 0;
|
|
231
|
+
const checkInterval = setInterval(() => {
|
|
232
|
+
elapsed += 500;
|
|
233
|
+
|
|
234
|
+
// Check if process exited (exitCode is set when process exits)
|
|
235
|
+
if (loginResult.childProcess.exitCode !== null || loginResult.childProcess.killed) {
|
|
236
|
+
clearInterval(checkInterval);
|
|
237
|
+
resolve();
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// Safety timeout after 15s
|
|
242
|
+
if (elapsed >= 15000) {
|
|
243
|
+
clearInterval(checkInterval);
|
|
244
|
+
try { loginResult.childProcess.kill(); } catch (e) { /* ignore */ }
|
|
245
|
+
resolve();
|
|
246
|
+
}
|
|
247
|
+
}, 500);
|
|
238
248
|
});
|
|
239
249
|
|
|
240
250
|
spinner.succeed('AUTHENTICATION SUCCESSFUL!');
|