@ravshansbox/pi-next-issue 1.0.1 → 1.0.2
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 +2 -0
- package/package.json +1 -1
- package/src/github.ts +5 -2
package/README.md
CHANGED
|
@@ -35,6 +35,8 @@ Each loop fetches the open issues and takes the oldest one with saved state, els
|
|
|
35
35
|
|
|
36
36
|
An issue that cannot go on gets `status:needs-human` and a comment with the reason. Its worktree stays for you to look at.
|
|
37
37
|
|
|
38
|
+
The implementer and the reviewer read the issue title, the body and the comments. They get only comments by the owner, members and collaborators of the repository. The body is passed as it is, and its author can edit it after you add the label, so check the body before you add the label.
|
|
39
|
+
|
|
38
40
|
Each agent is a pi session in the worktree. It uses the model and thinking level from your pi settings, and loads all of your extensions except this one.
|
|
39
41
|
|
|
40
42
|
The state of each issue is saved in `.worktrees/<n>.json`. The extension adds `/.worktrees/` to `.git/info/exclude`.
|
package/package.json
CHANGED
package/src/github.ts
CHANGED
|
@@ -9,6 +9,7 @@ type Check = { name: string; bucket: string; link: string };
|
|
|
9
9
|
const POLL_MS = 15_000;
|
|
10
10
|
const GRACE_MS = 60_000;
|
|
11
11
|
const READ_TRIES = 3;
|
|
12
|
+
const TRUSTED = ['OWNER', 'MEMBER', 'COLLABORATOR'];
|
|
12
13
|
|
|
13
14
|
function gh(repo: Repo, args: string[], input?: string): Promise<string> {
|
|
14
15
|
return must('gh', [...args, '--repo', repo.slug], {
|
|
@@ -58,9 +59,11 @@ export async function openIssues(repo: Repo): Promise<Issue[]> {
|
|
|
58
59
|
export async function comments(repo: Repo, issue: number): Promise<string[]> {
|
|
59
60
|
const raw = await gh(repo, ['issue', 'view', String(issue), '--json', 'comments']);
|
|
60
61
|
const parsed = JSON.parse(raw) as {
|
|
61
|
-
comments: Array<{ author: { login: string }; body: string }>;
|
|
62
|
+
comments: Array<{ author: { login: string }; authorAssociation: string; body: string }>;
|
|
62
63
|
};
|
|
63
|
-
return parsed.comments
|
|
64
|
+
return parsed.comments
|
|
65
|
+
.filter((comment) => TRUSTED.includes(comment.authorAssociation))
|
|
66
|
+
.map((comment) => `@${comment.author.login}: ${comment.body}`);
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
export async function setLabel(
|