next-issue 16.0.0 → 16.2.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 +1 -1
- package/dist/cli/switch-run.mjs +20 -0
- package/dist/cli.mjs +5 -1
- package/dist/shared/args.mjs +12 -2
- package/dist/worker/progress.mjs +34 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -91,8 +91,8 @@ A field that is not in the file keeps its default. See [Configuration](https://g
|
|
|
91
91
|
| `watch on\|off` | Switch watching of the going run |
|
|
92
92
|
| `hunt on\|off` | Switch hunting of the going run |
|
|
93
93
|
| `init` | Write the config file with the defaults |
|
|
94
|
-
| `serve` | Run the worker of this repository that the clients talk to |
|
|
95
94
|
| `stop` | Stop the going run after its current issues |
|
|
95
|
+
| `status` | Show the going run, its worker and its running issues |
|
|
96
96
|
| `logs` | Show the latest run log and follow it |
|
|
97
97
|
| `update` | Install the `create-issue` and `answer-hand-over` skills for Claude Code |
|
|
98
98
|
| `--force` | With `init`: replace an existing config file |
|
package/dist/cli/switch-run.mjs
CHANGED
|
@@ -66,3 +66,23 @@ export function stopInWorker(root) {
|
|
|
66
66
|
return 'next-issue: the run will stop after its current issues\n';
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
+
export function statusInWorker(root) {
|
|
70
|
+
return inWorker(root, async (connection, progress) => {
|
|
71
|
+
const lines = [
|
|
72
|
+
`next-issue: the run is ${progress.status} in worker ${connection.version}`,
|
|
73
|
+
`watching ${onOffText(progress.watching)}, hunting ${onOffText(progress.hunting)}`,
|
|
74
|
+
];
|
|
75
|
+
if (progress.upgrade !== undefined) {
|
|
76
|
+
lines.push(`stopping for an upgrade to ${progress.upgrade.to}`);
|
|
77
|
+
}
|
|
78
|
+
if (progress.issues.length === 0) {
|
|
79
|
+
lines.push('no issue is running');
|
|
80
|
+
}
|
|
81
|
+
lines.push(...progress.issues.map(issueLine));
|
|
82
|
+
return `${lines.join('\n')}\n`;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function issueLine({ issue, step, round }) {
|
|
86
|
+
const roundText = round === undefined ? '' : ` (round ${round})`;
|
|
87
|
+
return `#${issue} ${step?.replaceAll('-', ' ') ?? 'starting'}${roundText}`;
|
|
88
|
+
}
|
package/dist/cli.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import { followLog, newestRunLog } from './cli/logs.mjs';
|
|
|
9
9
|
import { serve } from './worker/serve.mjs';
|
|
10
10
|
import { startInWorker } from './cli/start.mjs';
|
|
11
11
|
import { STATE_DIR } from './shared/state.mjs';
|
|
12
|
-
import { stopInWorker, switchInWorker } from './cli/switch-run.mjs';
|
|
12
|
+
import { statusInWorker, stopInWorker, switchInWorker } from './cli/switch-run.mjs';
|
|
13
13
|
import { chooseScope, installSkills } from './cli/update.mjs';
|
|
14
14
|
import { WORKTREE_DIR } from './shared/worktree.mjs';
|
|
15
15
|
function write(stream, text) {
|
|
@@ -40,6 +40,10 @@ async function main() {
|
|
|
40
40
|
await write(process.stdout, await stopInWorker(root));
|
|
41
41
|
return 0;
|
|
42
42
|
}
|
|
43
|
+
if (args.command === 'status') {
|
|
44
|
+
await write(process.stdout, await statusInWorker(root));
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
|
43
47
|
if (args.command === 'watch' || args.command === 'hunt') {
|
|
44
48
|
await write(process.stdout, await switchInWorker(root, args.command, args.on));
|
|
45
49
|
return 0;
|
package/dist/shared/args.mjs
CHANGED
|
@@ -7,7 +7,17 @@ const RUN_FLAGS = new Map([
|
|
|
7
7
|
['--watch', 'watch'],
|
|
8
8
|
['--hunt', 'hunt'],
|
|
9
9
|
]);
|
|
10
|
-
const COMMANDS = [
|
|
10
|
+
const COMMANDS = [
|
|
11
|
+
'start',
|
|
12
|
+
'init',
|
|
13
|
+
'serve',
|
|
14
|
+
'stop',
|
|
15
|
+
'status',
|
|
16
|
+
'logs',
|
|
17
|
+
'watch',
|
|
18
|
+
'hunt',
|
|
19
|
+
'update',
|
|
20
|
+
];
|
|
11
21
|
export const USAGE = `next-issue <command> [options]
|
|
12
22
|
|
|
13
23
|
start start a run: claim issues, fix them and push them to the base branch
|
|
@@ -16,8 +26,8 @@ export const USAGE = `next-issue <command> [options]
|
|
|
16
26
|
watch on|off switch watching of the going run; off also turns hunting off
|
|
17
27
|
hunt on|off switch hunting of the going run; on also turns watching on
|
|
18
28
|
init write ${CONFIG_FILE} with the defaults and add .next-issue/ and .worktrees/ to info/exclude
|
|
19
|
-
serve run the worker of this repository that the clients talk to
|
|
20
29
|
stop stop the going run after its current issues
|
|
30
|
+
status show the going run, its worker and its running issues
|
|
21
31
|
logs show the latest run log and follow it
|
|
22
32
|
update install the create-issue and answer-hand-over skills for Claude Code
|
|
23
33
|
--scope user|project
|
package/dist/worker/progress.mjs
CHANGED
|
@@ -1,9 +1,40 @@
|
|
|
1
|
+
const STEPS = {
|
|
2
|
+
'implement.start': 'implementing',
|
|
3
|
+
'review.start': 'reviewing',
|
|
4
|
+
'fix.start': 'fixing',
|
|
5
|
+
'commit-fix.start': 'fixing',
|
|
6
|
+
'land.start': 'landing',
|
|
7
|
+
'ci-checks.start': 'waiting-for-checks',
|
|
8
|
+
};
|
|
1
9
|
export function startProgress(hunting = false) {
|
|
2
|
-
return { status: 'running', hunting };
|
|
10
|
+
return { status: 'running', hunting, issues: [] };
|
|
3
11
|
}
|
|
4
12
|
export function applyEvent(progress, record) {
|
|
5
|
-
|
|
13
|
+
const kind = record['kind'];
|
|
14
|
+
if (kind === 'issues.fail') {
|
|
6
15
|
return { ...progress, error: String(record['error']) };
|
|
7
16
|
}
|
|
8
|
-
|
|
17
|
+
const issue = record['issue'];
|
|
18
|
+
if (typeof kind !== 'string' || typeof issue !== 'number') {
|
|
19
|
+
return progress;
|
|
20
|
+
}
|
|
21
|
+
if (kind === 'issue.start') {
|
|
22
|
+
return { ...progress, issues: [...withoutIssue(progress, issue), { issue }] };
|
|
23
|
+
}
|
|
24
|
+
if (kind === 'issue.end' || kind === 'issue.error') {
|
|
25
|
+
return { ...progress, issues: withoutIssue(progress, issue) };
|
|
26
|
+
}
|
|
27
|
+
const step = STEPS[kind];
|
|
28
|
+
if (step === undefined || !progress.issues.some((running) => running.issue === issue)) {
|
|
29
|
+
return progress;
|
|
30
|
+
}
|
|
31
|
+
const round = step === 'reviewing' && typeof record['round'] === 'number' ? record['round'] : undefined;
|
|
32
|
+
const entry = { issue, step, ...(round === undefined ? {} : { round }) };
|
|
33
|
+
return {
|
|
34
|
+
...progress,
|
|
35
|
+
issues: progress.issues.map((running) => (running.issue === issue ? entry : running)),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function withoutIssue(progress, issue) {
|
|
39
|
+
return progress.issues.filter((running) => running.issue !== issue);
|
|
9
40
|
}
|