next-issue 14.4.12 → 14.4.13

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.
@@ -9,6 +9,7 @@ export const NOTES = {
9
9
  export function onPresses(handle) {
10
10
  let presses = 0;
11
11
  let lastPress = -Infinity;
12
+ let ending;
12
13
  const press = () => {
13
14
  const now = performance.now();
14
15
  if (now - lastPress < 100) {
@@ -17,18 +18,21 @@ export function onPresses(handle) {
17
18
  lastPress = now;
18
19
  presses += 1;
19
20
  if (presses >= 3) {
20
- process.off('SIGINT', press);
21
+ ending = setTimeout(() => process.off('SIGINT', press), 100).unref();
21
22
  }
22
23
  handle(presses);
23
24
  };
24
25
  process.on('SIGINT', press);
25
- return () => process.off('SIGINT', press);
26
+ return () => {
27
+ clearTimeout(ending);
28
+ process.off('SIGINT', press);
29
+ };
26
30
  }
27
31
  export function listenForInterrupts(say) {
28
32
  let presses = 0;
29
33
  const sleeper = {};
30
34
  let hunting = () => false;
31
- onPresses((count) => {
35
+ const stopListening = onPresses((count) => {
32
36
  presses = count;
33
37
  if (presses === 1 && sleeper.wake !== undefined) {
34
38
  say(hunting() ? NOTES.hunt : NOTES.wait);
@@ -41,6 +45,7 @@ export function listenForInterrupts(say) {
41
45
  say(NOTES.round);
42
46
  }
43
47
  else {
48
+ stopListening();
44
49
  stopChildren('SIGINT');
45
50
  }
46
51
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "14.4.12",
3
+ "version": "14.4.13",
4
4
  "description": "Autonomous issue harness driven by the Claude Agent SDK",
5
5
  "keywords": [
6
6
  "github",