@ravshansbox/pi-next-issue 3.0.0 → 5.0.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
@@ -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 `no run of <root>`. When no worker is going, it returns `no worker is running` and does not start one. It reports no other repository.
18
18
 
19
- The footer shows each running issue with the number of open issues at the latest fetch, its stage, the number of tool calls and the time spent on it, for example `#12/7 · review 2/5 · 37 tools · 4m12s | #13/7 · implement · 5 tools · 40s`. The open count includes the running issues and open issues the run skips. It leaves out closed issues that the run resumes after a merge. A stage with a limited number of rounds shows the round and its limit: `review 2/5`, `review fix 2/5`, `checks fix 1/5` or `commit fix 1/10`. Other lines read, for example, `looking for issues`, `finished: 2 done` or `stopped: 1 done, 1 needs a human`. 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.
19
+ The footer shows each running issue with the number of open issues at the latest fetch, its stage, the number of tool calls and the time spent on it, for example `#12/7 · review 2/5 · 37 tools · 4m12s | #13/7 · implement · 5 tools · 40s`. The open count includes the running issues and open issues the run skips. It leaves out closed issues that the run resumes after their change landed. A stage with a limited number of rounds shows the round and its limit: `review 2/5`, `review fix 2/5`, `checks fix 1/5` or `commit fix 1/10`. Other lines read, for example, `looking for issues`, `finished: 2 done` or `stopped: 1 done, 1 needs a human`. 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
 
@@ -24,11 +24,11 @@ When an issue waits for a person, with the `needsHuman` label of the [config](..
24
24
 
25
25
  Run `/next-issue answer` to go through the waiting questions one at a time. Pi suggests `answer` as you type after `/next-issue `. Each shows the issue, the title and the reason of the hand-over. Choose:
26
26
 
27
- - **Retry**: takes the `needsHuman` label off the issue and its pull request, so the next run resumes it.
28
- - **Retry with guidance**: asks for text, posts it as a comment where the worker reads it, on the pull request of the issue or on the issue when it has none, then takes the `needsHuman` label off.
29
- - **Give up**: takes the `needsHuman` label off the issue and its pull request and adds the `skip` label.
27
+ - **Retry**: takes the `needsHuman` label off the issue, so the next run resumes it.
28
+ - **Retry with guidance**: asks for text, posts it as a comment on the issue, where the worker reads it, then takes the `needsHuman` label off.
29
+ - **Give up**: takes the `needsHuman` label off the issue and adds the `skip` label.
30
30
 
31
- Press Escape, or leave the guidance empty, to stop. Pi reads the list again before each question, so it skips a question answered elsewhere in the meantime. The worker sends the repository, the pull request and the label names with each question, from `next-issue.config.json` and its `remote`. Pi uses `gh` for the comment and the labels.
31
+ Press Escape, or leave the guidance empty, to stop. Pi reads the list again before each question, so it skips a question answered elsewhere in the meantime. The worker sends the repository and the label names with each question, from `next-issue.config.json` and its `remote`. Pi uses `gh` for the comment and the labels.
32
32
 
33
33
  ## Create an issue
34
34
 
@@ -56,4 +56,4 @@ The extension does no work itself. On `/next-issue` or `next_issue_start` it con
56
56
  - Versions before one worker per repository ran one worker for the machine, which does not stop by itself and can keep claiming issues alongside the new worker. Stop it once after you upgrade, as the [`next-issue` README](../next-issue/README.md#worker) says.
57
57
  - When the extension is newer than the worker of a repository, that worker closes once no run is going, and the extension starts the newer worker. Workers of other repositories carry on.
58
58
 
59
- Each run asks the worker to merge the pull requests. [ADR 0002](https://github.com/ravshansbox/next-issue/blob/main/docs/adr/0002-merge-setting.md) compares where the merge setting could live. See the [`next-issue` README](../next-issue/README.md) for what a run does, its labels, its state and its config.
59
+ Each run lands approved changes straight on the base branch, with no pull request, as [ADR 0003](https://github.com/ravshansbox/next-issue/blob/main/docs/adr/0003-land-without-pull-requests.md) records. See the [`next-issue` README](../next-issue/README.md) for what a run does, its labels, its state and its config.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ravshansbox/pi-next-issue",
3
- "version": "3.0.0",
3
+ "version": "5.0.0",
4
4
  "description": "Pi extension that works through GitHub issues with the next-issue worker",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/answer.ts CHANGED
@@ -12,11 +12,6 @@ const GIVE_UP = 'Give up';
12
12
 
13
13
  type Answer = { choice: string; guidance: string };
14
14
 
15
- function threadsOf(question: Question): Array<[string, number]> {
16
- const issue: [string, number] = ['issue', question.issue];
17
- return question.pr === undefined ? [issue] : [issue, ['pr', question.pr]];
18
- }
19
-
20
15
  function promptOf(question: Question): string {
21
16
  return `#${question.issue} ${question.title}\n\n${question.reason || 'No reason given.'}`;
22
17
  }
@@ -36,19 +31,15 @@ async function reply(
36
31
  question: Question,
37
32
  { choice, guidance }: Answer,
38
33
  ): Promise<void> {
39
- const threads = threadsOf(question);
34
+ const issue = String(question.issue);
40
35
  const repo = ['--repo', question.repo];
41
36
  if (choice === GUIDE) {
42
- const [kind, number] = threads.at(-1)!;
43
- await gh([kind, 'comment', String(number), ...repo, '--body-file', '-'], {
37
+ await gh(['issue', 'comment', issue, ...repo, '--body-file', '-'], {
44
38
  cwd: root,
45
39
  input: guidance,
46
40
  });
47
41
  }
48
- const labels = labelsOf(question, choice);
49
- for (const [kind, number] of threads) {
50
- await gh([kind, 'edit', String(number), ...repo, ...labels], { cwd: root });
51
- }
42
+ await gh(['issue', 'edit', issue, ...repo, ...labelsOf(question, choice)], { cwd: root });
52
43
  }
53
44
 
54
45
  async function ask(ui: ExtensionContext['ui'], question: Question): Promise<Answer | undefined> {
package/src/protocol.ts CHANGED
@@ -25,13 +25,12 @@ export type Question = {
25
25
  reason: string;
26
26
  url: string;
27
27
  repo: string;
28
- pr?: number;
29
28
  labels: { needsHuman: string; skip: string };
30
29
  };
31
30
 
32
31
  export type ClientMessage =
33
32
  | { type: 'hello'; version: string }
34
- | { type: 'start'; root: string; merge: boolean }
33
+ | { type: 'start'; root: string }
35
34
  | { type: 'stop'; root: string }
36
35
  | { type: 'questions'; root: string; id?: string };
37
36
 
package/src/run.ts CHANGED
@@ -21,7 +21,7 @@ export async function statusOf(client: WorkerClient, root: string) {
21
21
  }
22
22
 
23
23
  function sendStart(client: WorkerClient, root: string): void {
24
- client.send({ type: 'start', root, merge: true });
24
+ client.send({ type: 'start', root });
25
25
  }
26
26
 
27
27
  export async function startRun(