@ravshansbox/pi-next-issue 2.14.0 → 2.15.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/index.ts +14 -9
- package/package.json +1 -1
- package/src/worker.ts +8 -4
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ Run this in pi, inside a git repository:
|
|
|
16
16
|
- The `next_issue_start` tool lets the model start a run. When no run is going, it starts a run like `/next-issue`. When a run is going, it starts nothing and reports the current run, which picks up new issues by itself. It never stops a run, and it does not ask for confirmation. Its result says whether it started a run.
|
|
17
17
|
- The `next_issue_status` tool lets the model see the run of this repository. It returns the footer line, then one line per handled issue with its outcome, for example `#190 done`. When the worker has no run of this repository, it returns `next-issue · no run of <root>`. When no worker is going, it returns `next-issue · no worker is running` and does not start one. It reports no other repository.
|
|
18
18
|
|
|
19
|
-
The footer shows
|
|
19
|
+
The footer shows each running issue with its stage, the number of tool calls and the time spent on it, for example `next-issue #12 · review 1 · 37 tools · 4m12s | #13 · implement · 5 tools · 40s`. After a run ends, it keeps the last summary. In the terminal, it uses the dim colour of the theme, like the rest of the footer. A note appears when an issue is done, needs a human or fails while pi is open. Pi does not repeat the notes of a run that ended before it opened.
|
|
20
20
|
|
|
21
21
|
## Answer questions
|
|
22
22
|
|
package/index.ts
CHANGED
|
@@ -68,20 +68,25 @@ function outcomes(progress: Progress): string {
|
|
|
68
68
|
const OUTCOME_NOTES = { done: 'done', 'needs-human': 'needs a human', error: 'failed' } as const;
|
|
69
69
|
|
|
70
70
|
export function formatStatus(progress: Progress, now: number): string {
|
|
71
|
+
const running = progress.issues ?? [];
|
|
71
72
|
switch (progress.status) {
|
|
72
73
|
case 'running': {
|
|
73
|
-
if (
|
|
74
|
+
if (running.length === 0) {
|
|
74
75
|
return 'next-issue · looking for issues';
|
|
75
76
|
}
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
const lines = running.map((item) => {
|
|
78
|
+
const parts = [`#${item.issue}`, item.stage ?? 'prepare', `${item.tools} tools`];
|
|
79
|
+
if (item.startedAt !== undefined) {
|
|
80
|
+
parts.push(duration(now - item.startedAt));
|
|
81
|
+
}
|
|
82
|
+
return parts.join(' · ');
|
|
83
|
+
});
|
|
84
|
+
return `next-issue ${lines.join(' | ')}`;
|
|
85
|
+
}
|
|
86
|
+
case 'stopping': {
|
|
87
|
+
const issues = running.map((item) => `#${item.issue}`);
|
|
88
|
+
return `next-issue ${issues.length === 0 ? '#?' : issues.join(' ')} · stopping`;
|
|
82
89
|
}
|
|
83
|
-
case 'stopping':
|
|
84
|
-
return `next-issue #${progress.issue ?? '?'} · stopping`;
|
|
85
90
|
case 'stopped':
|
|
86
91
|
return `next-issue · stopped: ${outcomes(progress)}`;
|
|
87
92
|
case 'finished':
|
package/package.json
CHANGED
package/src/worker.ts
CHANGED
|
@@ -7,14 +7,18 @@ export type RunStatus = 'running' | 'stopping' | 'finished' | 'stopped' | 'faile
|
|
|
7
7
|
|
|
8
8
|
export type Handled = { issue: number; outcome: 'done' | 'needs-human' | 'error' };
|
|
9
9
|
|
|
10
|
-
export type
|
|
11
|
-
|
|
12
|
-
issue?: number;
|
|
10
|
+
export type IssueProgress = {
|
|
11
|
+
issue: number;
|
|
13
12
|
title?: string;
|
|
14
13
|
stage?: string;
|
|
15
14
|
tools: number;
|
|
16
15
|
lastTool?: string;
|
|
17
|
-
|
|
16
|
+
startedAt?: number;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type Progress = {
|
|
20
|
+
status: RunStatus;
|
|
21
|
+
issues: IssueProgress[];
|
|
18
22
|
handled: Handled[];
|
|
19
23
|
error?: string;
|
|
20
24
|
};
|