@autonoma-ai/planner 0.1.6 → 0.1.7

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/dist/index.js CHANGED
@@ -6439,6 +6439,7 @@ var RESET = "\x1B[0m";
6439
6439
  var SHOW_CURSOR = "\x1B[?25h";
6440
6440
  var EXIT_HINT = `${DIM}(press Ctrl+C again to exit)${RESET}`;
6441
6441
  var ARM_WINDOW_MS = 3e3;
6442
+ var FORCE_EXIT_MS = 2500;
6442
6443
  var installed = false;
6443
6444
  var armed = false;
6444
6445
  var armTimer = null;
@@ -6449,11 +6450,19 @@ function disarm() {
6449
6450
  armTimer = null;
6450
6451
  armed = false;
6451
6452
  }
6453
+ function forceExit() {
6454
+ restoreTerminal();
6455
+ process.exit(130);
6456
+ }
6452
6457
  function handleInterrupt() {
6453
- if (quitting) return;
6458
+ if (quitting) {
6459
+ forceExit();
6460
+ return;
6461
+ }
6454
6462
  if (armed) {
6455
6463
  quitting = true;
6456
6464
  disarm();
6465
+ setTimeout(forceExit, FORCE_EXIT_MS).unref?.();
6457
6466
  onExit?.();
6458
6467
  return;
6459
6468
  }