@henryqw/pi-pr 0.3.3 → 0.3.5
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 +30 -5
- package/extensions/pr.ts +3 -2
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Show the current branch pull request's lifecycle, CI, mergeability, and review s
|
|
|
4
4
|
|
|
5
5
|
## Why
|
|
6
6
|
|
|
7
|
-
- **Created for**:
|
|
7
|
+
- **Created for**: Avoid repeated `gh` commands just to check pull-request status during work.
|
|
8
8
|
- **Advantage**: Branch lifecycle, CI, mergeability, and review state appear at a glance in the footer.
|
|
9
9
|
|
|
10
10
|
## Install
|
|
@@ -15,15 +15,40 @@ pi install npm:@henryqw/pi-pr
|
|
|
15
15
|
|
|
16
16
|
Requires authenticated GitHub CLI access (`gh auth login`) in a GitHub repository checkout.
|
|
17
17
|
|
|
18
|
+
## With
|
|
19
|
+
|
|
20
|
+
`@henryqw/pi-footer` improves this package by showing current-branch pull-request status in the footer.
|
|
21
|
+
|
|
18
22
|
## Use
|
|
19
23
|
|
|
20
24
|
| Surface | Type | Purpose |
|
|
21
25
|
| --- | --- | --- |
|
|
22
|
-
| Footer |
|
|
26
|
+
| Footer | ui | Show the current branch pull request. |
|
|
23
27
|
| `/pr` | command | Open current branch PR, or start PR workflow when absent. |
|
|
24
28
|
|
|
25
|
-
Each entry is one linked `PR #number` plus one plain-language state
|
|
29
|
+
Each entry is one linked `PR #number` plus one plain-language state. Possible states are:
|
|
30
|
+
|
|
31
|
+
- `<count> unresolved`, `draft`, `open`, `approved`, and `CI running`
|
|
32
|
+
- `CI failed`, `changes requested`, `merge conflict`, `merged`, and `closed`
|
|
33
|
+
|
|
34
|
+
Colors support text. They do not carry meaning alone.
|
|
35
|
+
|
|
36
|
+
Known states have this priority:
|
|
37
|
+
|
|
38
|
+
1. `<count> unresolved` for known unresolved review threads
|
|
39
|
+
2. `merge conflict`
|
|
40
|
+
3. `changes requested`
|
|
41
|
+
4. `CI failed`
|
|
42
|
+
5. `CI running` for CI progress
|
|
43
|
+
|
|
44
|
+
The status loads at session start and polls every 30 seconds. It refreshes after an agent successfully runs `gh pr create`, `git push`, or `/pr`.
|
|
45
|
+
|
|
46
|
+
Unresolved review threads are checked every 30 seconds for 20 minutes after an open PR is first found. Each new push or remote PR update, including new comments, restarts that window.
|
|
47
|
+
|
|
48
|
+
The footer and warning notification show the unresolved count when first found or increased. The last known footer count remains after review checks stop. No pull request leaves the footer blank.
|
|
49
|
+
|
|
50
|
+
`/pr` finds an open PR for the current branch. When absent, it starts bundled `/skill:pi-pr-create` workflow.
|
|
26
51
|
|
|
27
|
-
The
|
|
52
|
+
The agent resolves the base and inspects and commits scoped changes. It runs relevant validation, pushes the branch, and creates or updates the PR with a live title and body.
|
|
28
53
|
|
|
29
|
-
|
|
54
|
+
This workflow handles dirty worktrees. It never silently commits unrelated changes.
|
package/extensions/pr.ts
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
type ExtensionAPI,
|
|
4
4
|
type ExtensionContext,
|
|
5
5
|
} from "@earendil-works/pi-coding-agent";
|
|
6
|
-
import { hyperlink } from "@earendil-works/pi-tui";
|
|
6
|
+
import { getCapabilities, hyperlink } from "@earendil-works/pi-tui";
|
|
7
7
|
|
|
8
8
|
const POLL_INTERVAL_MS = 30_000;
|
|
9
9
|
const REVIEW_POLL_WINDOW_MS = 20 * 60_000;
|
|
@@ -142,7 +142,8 @@ function statusFor(pullRequest: PullRequest, ci: CiStatus): Status {
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
export function formatPullRequest(pullRequest: PullRequest, theme: ExtensionContext["ui"]["theme"], unresolved = 0): string {
|
|
145
|
-
const
|
|
145
|
+
const prText = theme.fg("text", `PR #${pullRequest.number}`);
|
|
146
|
+
const link = getCapabilities().hyperlinks ? hyperlink(prText, pullRequest.url.href) : prText;
|
|
146
147
|
const status = unresolved > 0
|
|
147
148
|
? { text: `${unresolved} unresolved`, color: "warning" as const }
|
|
148
149
|
: statusFor(pullRequest, ciStatus(pullRequest.statusCheckRollup));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@henryqw/pi-pr",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "Show the current branch pull request status in the Pi footer.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
},
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"files": [
|
|
18
|
+
"LICENSE",
|
|
18
19
|
"extensions",
|
|
19
20
|
"skills",
|
|
20
|
-
"README.md"
|
|
21
|
-
"LICENSE"
|
|
21
|
+
"README.md"
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
24
|
"test": "node --test test/*.test.ts",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"pack:check": "npm pack --dry-run"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@earendil-works/pi-coding-agent": "^0.84.
|
|
30
|
-
"@earendil-works/pi-tui": "^0.84.
|
|
29
|
+
"@earendil-works/pi-coding-agent": "^0.84.4",
|
|
30
|
+
"@earendil-works/pi-tui": "^0.84.4"
|
|
31
31
|
},
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|