decharge-scout 4.0.4 → 4.0.5
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/index.js +12 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -463,9 +463,19 @@ async function runQueryCycle(wallet, agentName, location, options) {
|
|
|
463
463
|
console.log(chalk.gray(' • "7-9PM peak in Lagos" (evening peak)'));
|
|
464
464
|
console.log(chalk.gray(' • "1-5AM cheap in Berlin" (off-peak)'));
|
|
465
465
|
console.log(chalk.gray(' • "5-8PM peak in Mumbai" (dinner time surge)'));
|
|
466
|
-
console.log(chalk.gray(' • "2-6AM cheap in Texas" (wind energy overnight)
|
|
466
|
+
console.log(chalk.gray(' • "2-6AM cheap in Texas" (wind energy overnight)'));
|
|
467
|
+
console.log(chalk.gray(' (Will auto-skip in 15 seconds if no input)\n'));
|
|
467
468
|
|
|
468
|
-
|
|
469
|
+
// Add timeout to prevent hanging
|
|
470
|
+
const alphaInput = await Promise.race([
|
|
471
|
+
question(chalk.blue('Share local peak times (or press Enter to skip): ')),
|
|
472
|
+
new Promise((resolve) => {
|
|
473
|
+
setTimeout(() => {
|
|
474
|
+
console.log(chalk.yellow('\n⏱️ Timeout - skipping alpha contribution'));
|
|
475
|
+
resolve('');
|
|
476
|
+
}, 15000); // 15 second timeout
|
|
477
|
+
})
|
|
478
|
+
]);
|
|
469
479
|
|
|
470
480
|
if (alphaInput.trim()) {
|
|
471
481
|
const parsed = parseAlphaContribution(alphaInput, location);
|