next-issue 14.2.0 → 14.3.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.
package/README.md CHANGED
@@ -80,6 +80,7 @@ A field that is not in the file keeps its default. See [Configuration](https://g
80
80
  | `start` | Start a run: claim issues, fix them and push them to the base branch |
81
81
  | `watch on\|off` | Switch watching of the going run |
82
82
  | `hunt on\|off` | Switch hunting of the going run |
83
+ | `refresh` | Ask the going run to check for new issues now |
83
84
  | `init` | Write the config file with the defaults |
84
85
  | `serve` | Run the worker of this repository that the clients talk to |
85
86
  | `stop` | Stop the worker of this repository |
@@ -26,6 +26,32 @@ export async function switchInWorker(root, name, on) {
26
26
  connection.close();
27
27
  }
28
28
  }
29
+ export async function refreshInWorker(root) {
30
+ const connection = await findWorker(root);
31
+ if (connection === undefined) {
32
+ return NO_RUN;
33
+ }
34
+ const progress = connection.runs[root];
35
+ if (!going(progress)) {
36
+ connection.close();
37
+ return NO_RUN;
38
+ }
39
+ if (isNewer(await packageVersion(), connection.version)) {
40
+ connection.close();
41
+ throw new Error('the worker of the going run is older than next-issue, so it cannot refresh. Stop the run, then start it again');
42
+ }
43
+ if (progress.status === 'stopping') {
44
+ connection.close();
45
+ return 'next-issue: the run is stopping, so nothing was asked\n';
46
+ }
47
+ if (progress.watching === false) {
48
+ connection.close();
49
+ return 'next-issue: the run does not watch for new issues, so nothing was asked\n';
50
+ }
51
+ connection.send({ type: 'refresh', root });
52
+ await connection.end();
53
+ return 'next-issue: asked the run to check for new issues now\n';
54
+ }
29
55
  function switched(connection, root, name, on) {
30
56
  const id = randomUUID();
31
57
  let sent = false;
package/dist/cli.mjs CHANGED
@@ -10,7 +10,7 @@ import { followLog, newestRunLog } from './cli/logs.mjs';
10
10
  import { serve } from './worker/serve.mjs';
11
11
  import { startInWorker } from './cli/start.mjs';
12
12
  import { STATE_DIR } from './shared/state.mjs';
13
- import { switchInWorker } from './cli/switch-run.mjs';
13
+ import { refreshInWorker, switchInWorker } from './cli/switch-run.mjs';
14
14
  import { workerPaths } from './shared/worker-paths.mjs';
15
15
  import { WORKTREE_DIR } from './shared/worktree.mjs';
16
16
  function write(stream, text) {
@@ -41,6 +41,10 @@ async function main() {
41
41
  await write(process.stdout, await switchInWorker(root, args.command, args.on));
42
42
  return 0;
43
43
  }
44
+ if (args.command === 'refresh') {
45
+ await write(process.stdout, await refreshInWorker(root));
46
+ return 0;
47
+ }
44
48
  if (args.command === 'logs') {
45
49
  return logs(root);
46
50
  }
@@ -7,7 +7,7 @@ const RUN_FLAGS = new Map([
7
7
  ['--watch', 'watch'],
8
8
  ['--hunt', 'hunt'],
9
9
  ]);
10
- const COMMANDS = ['start', 'init', 'serve', 'stop', 'logs', 'watch', 'hunt'];
10
+ const COMMANDS = ['start', 'init', 'serve', 'stop', 'logs', 'watch', 'hunt', 'refresh'];
11
11
  export const USAGE = `next-issue <command> [options]
12
12
 
13
13
  start start a run: claim issues, fix them and push them to the base branch
@@ -15,6 +15,7 @@ export const USAGE = `next-issue <command> [options]
15
15
  --hunt on|off hunt the repository for bugs and file issues alongside the issues, needs watching (default off)
16
16
  watch on|off switch watching of the going run; off also turns hunting off
17
17
  hunt on|off switch hunting of the going run; on also turns watching on
18
+ refresh ask the going run to check for new issues now
18
19
  init write ${CONFIG_FILE} with the defaults and add .next-issue/ and .worktrees/ to info/exclude
19
20
  serve run the worker of this repository that the clients talk to
20
21
  stop stop the worker of this repository
@@ -86,6 +86,10 @@ function open(socketPath, version) {
86
86
  },
87
87
  closed,
88
88
  close: () => socket.terminate(),
89
+ end: () => {
90
+ socket.close();
91
+ return closed;
92
+ },
89
93
  });
90
94
  }
91
95
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "14.2.0",
3
+ "version": "14.3.0",
4
4
  "description": "Autonomous issue harness driven by the Claude Agent SDK",
5
5
  "keywords": [
6
6
  "github",