next-issue 14.5.0 → 14.7.0

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.
@@ -5,6 +5,13 @@ import { must, optionalFlag, run } from './exec.mjs';
5
5
  const NETWORK_TRIES = 3;
6
6
  const NETWORK_FAULT = /unexpected EOF|connection reset|connection refused|i\/o timeout|TLS handshake timeout|HTTP 50[234]/i;
7
7
  export const GITHUB_HOST = 'github.com';
8
+ const realSleep = async (ms) => {
9
+ await delay(ms);
10
+ };
11
+ let retrySleep = realSleep;
12
+ export function setRetrySleep(next = realSleep) {
13
+ retrySleep = next;
14
+ }
8
15
  export function slug(repo) {
9
16
  return `${repo.owner}/${repo.name}`;
10
17
  }
@@ -26,7 +33,7 @@ export async function repeatable(repo, args) {
26
33
  if (attempt >= NETWORK_TRIES || !errorMatches(error, NETWORK_FAULT)) {
27
34
  throw error;
28
35
  }
29
- await delay(secondsToMs(attempt));
36
+ await retrySleep(secondsToMs(attempt));
30
37
  }
31
38
  }
32
39
  }
@@ -1,5 +1,3 @@
1
- import { stopChildren } from './children.mjs';
2
- import { wakeableSleep } from './durations.mjs';
3
1
  export const NOTES = {
4
2
  hunt: 'Stopping after the current hunt. Press Ctrl-C twice more to stop now.',
5
3
  wait: 'Stopping now.',
@@ -28,33 +26,3 @@ export function onPresses(handle) {
28
26
  process.off('SIGINT', press);
29
27
  };
30
28
  }
31
- export function listenForInterrupts(say) {
32
- let presses = 0;
33
- const sleeper = {};
34
- let hunting = () => false;
35
- const stopListening = onPresses((count) => {
36
- presses = count;
37
- if (presses === 1 && sleeper.wake !== undefined) {
38
- say(hunting() ? NOTES.hunt : NOTES.wait);
39
- sleeper.wake();
40
- }
41
- else if (presses === 1) {
42
- say(NOTES.issue);
43
- }
44
- else if (presses === 2) {
45
- say(NOTES.round);
46
- }
47
- else {
48
- stopListening();
49
- stopChildren('SIGINT');
50
- }
51
- });
52
- return {
53
- afterIssue: () => presses >= 1,
54
- afterRound: () => presses >= 2,
55
- sleep: (ms, busy = () => false, refreshed) => {
56
- hunting = busy;
57
- return wakeableSleep(sleeper, ms, presses >= 1, refreshed);
58
- },
59
- };
60
- }
@@ -2,11 +2,16 @@ import { truncate } from './text.mjs';
2
2
  export function render(record) {
3
3
  const time = new Date(String(record.ts)).toTimeString().slice(0, 8);
4
4
  const issue = record.issue === undefined ? '' : ` #${record.issue}`;
5
+ const role = record.role === undefined ? '' : `${String(record.role)}.`;
6
+ const kind = String(record.kind);
5
7
  const extras = Object.entries(record)
6
- .filter(([key]) => !['ts', 'runId', 'kind', 'issue'].includes(key))
7
- .map(([key, value]) => `${key}=${short(value)}`)
8
+ .filter(([key]) => !['ts', 'runId', 'kind', 'issue', 'role'].includes(key))
9
+ .map(([key, value]) => `${label(kind, key)}=${key === 'command' ? oneLine(value) : short(value)}`)
8
10
  .join(' ');
9
- return `${time}${issue} ${String(record.kind)}${extras.length > 0 ? ` ${extras}` : ''}\n`;
11
+ return `${time}${issue} ${role}${kind}${extras.length > 0 ? ` ${extras}` : ''}\n`;
12
+ }
13
+ function label(kind, key) {
14
+ return key === 'tool' && (kind === 'tool' || kind === 'tool.error') ? 'name' : key;
10
15
  }
11
16
  function short(value) {
12
17
  if (value === undefined || value === null) {
@@ -15,5 +20,8 @@ function short(value) {
15
20
  if (typeof value === 'number') {
16
21
  return Number.isInteger(value) ? String(value) : String(Number(value.toFixed(6)));
17
22
  }
18
- return truncate(String(value).replace(/\s+/g, ' '), 120, '...');
23
+ return truncate(oneLine(value), 120, '...');
24
+ }
25
+ function oneLine(value) {
26
+ return String(value).replace(/\s+/g, ' ');
19
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "14.5.0",
3
+ "version": "14.7.0",
4
4
  "description": "Autonomous issue harness driven by the Claude Agent SDK",
5
5
  "keywords": [
6
6
  "github",