@narumitw/pi-starship 0.50.3 → 0.51.1
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 +52 -4
- package/package.json +6 -6
- package/src/runtime/github-pr.ts +23 -12
package/README.md
CHANGED
|
@@ -491,10 +491,58 @@ Variables have these values:
|
|
|
491
491
|
- `$number`: digits such as `123`.
|
|
492
492
|
- `$link`: an OSC 8 `#123` link for a safe HTTP(S) URL, otherwise plain `#123`.
|
|
493
493
|
- `$state`: `open`, `draft`, `merged`, or `closed`.
|
|
494
|
-
- `$checks`:
|
|
495
|
-
- `$review`: `approved
|
|
496
|
-
|
|
497
|
-
|
|
494
|
+
- `$checks`: all non-zero check counts in passed, failed, pending order, or `-` when no checks exist.
|
|
495
|
+
- `$review`: `R✓` for approved, `R×` for changes requested, `R?` for review required, or empty
|
|
496
|
+
when unknown.
|
|
497
|
+
- `$status`: one result selected in this order: merged, closed, draft, failing checks, changes
|
|
498
|
+
requested, pending checks, approved, review required, passing checks, then no checks.
|
|
499
|
+
|
|
500
|
+
The compact symbols are font-safe and distinct from Git's default `$`, `!`, and `?` worktree markers:
|
|
501
|
+
|
|
502
|
+
| Compact value | Meaning |
|
|
503
|
+
| --- | --- |
|
|
504
|
+
| `✓<n>` | Checks that passed, including successful, skipped, and neutral conclusions |
|
|
505
|
+
| `×<n>` | Checks that failed |
|
|
506
|
+
| `…<n>` | Checks that are pending |
|
|
507
|
+
| `R✓` | Review approved |
|
|
508
|
+
| `R×` | Changes requested |
|
|
509
|
+
| `R?` | Review required |
|
|
510
|
+
| `M` / `C` / `D` | Merged, closed, or draft PR |
|
|
511
|
+
| `-` | No checks |
|
|
512
|
+
|
|
513
|
+
The unchanged default module format uses `$status` and now renders compact output:
|
|
514
|
+
|
|
515
|
+
```text
|
|
516
|
+
PR #123 · ×2
|
|
517
|
+
PR #123 · R✓
|
|
518
|
+
PR #123 · M
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
Use the existing `$checks` and `$review` variables together when every check category and the review
|
|
522
|
+
result should remain visible:
|
|
523
|
+
|
|
524
|
+
```toml
|
|
525
|
+
[github_pr]
|
|
526
|
+
format = "[$symbol$link( $checks)( $review) ]($style)"
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
```text
|
|
530
|
+
PR #123 ✓12 ×2 …7 R×
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
This is a breaking display migration for custom formats that use these variables:
|
|
534
|
+
|
|
535
|
+
| Previous value | Compact value |
|
|
536
|
+
| --- | --- |
|
|
537
|
+
| `checks passing` | `✓<n>` |
|
|
538
|
+
| `<n> failing` | `×<n>` |
|
|
539
|
+
| `<n> pending` | `…<n>` |
|
|
540
|
+
| `no checks` | `-` |
|
|
541
|
+
| `approved` / `changes requested` / `review required` | `R✓` / `R×` / `R?` |
|
|
542
|
+
| `merged` / `closed` / `draft` | `M` / `C` / `D` |
|
|
543
|
+
|
|
544
|
+
The old English values have no verbose aliases.
|
|
545
|
+
The variable names and default module format remain unchanged, so no TOML field migration is needed.
|
|
498
546
|
|
|
499
547
|
The query runs only in TUI sessions when the enabled module is reachable from the root format. It
|
|
500
548
|
refreshes at session start, immediately after a branch change, after each agent run, after accepted
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@narumitw/pi-starship",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.1",
|
|
4
4
|
"description": "Native Starship-style TOML statusline for the Pi coding agent.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@narumitw/pi-tui-kit": "^0.54.0",
|
|
38
|
-
"smol-toml": "^1.
|
|
38
|
+
"smol-toml": "^1.8.0",
|
|
39
39
|
"yaml": "^2.9.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"@earendil-works/pi-tui": "*"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@biomejs/biome": "2.5.
|
|
47
|
-
"@earendil-works/pi-coding-agent": "0.84.
|
|
48
|
-
"@earendil-works/pi-tui": "0.84.
|
|
49
|
-
"@types/node": "26.
|
|
46
|
+
"@biomejs/biome": "2.5.8",
|
|
47
|
+
"@earendil-works/pi-coding-agent": "0.84.2",
|
|
48
|
+
"@earendil-works/pi-tui": "0.84.2",
|
|
49
|
+
"@types/node": "26.2.0",
|
|
50
50
|
"typescript": "7.0.2"
|
|
51
51
|
},
|
|
52
52
|
"repository": {
|
package/src/runtime/github-pr.ts
CHANGED
|
@@ -180,16 +180,25 @@ function summarizeChecks(value: unknown): CheckSummary {
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
function formatChecks(checks: CheckSummary): string {
|
|
183
|
-
if (checks.total === 0) return "
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
183
|
+
if (checks.total === 0) return "-";
|
|
184
|
+
const passed = checks.total - checks.failed - checks.pending;
|
|
185
|
+
return [
|
|
186
|
+
compactCount("✓", passed),
|
|
187
|
+
compactCount("×", checks.failed),
|
|
188
|
+
compactCount("…", checks.pending),
|
|
189
|
+
]
|
|
190
|
+
.filter(Boolean)
|
|
191
|
+
.join(" ");
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function compactCount(symbol: string, count: number): string {
|
|
195
|
+
return count > 0 ? `${symbol}${count}` : "";
|
|
187
196
|
}
|
|
188
197
|
|
|
189
198
|
function formatReview(review: ReviewDecision): string {
|
|
190
|
-
if (review === "APPROVED") return "
|
|
191
|
-
if (review === "CHANGES_REQUESTED") return "
|
|
192
|
-
if (review === "REVIEW_REQUIRED") return "
|
|
199
|
+
if (review === "APPROVED") return "R✓";
|
|
200
|
+
if (review === "CHANGES_REQUESTED") return "R×";
|
|
201
|
+
if (review === "REVIEW_REQUIRED") return "R?";
|
|
193
202
|
return "";
|
|
194
203
|
}
|
|
195
204
|
|
|
@@ -199,11 +208,13 @@ function compactStatus(
|
|
|
199
208
|
checksText: string,
|
|
200
209
|
review: string,
|
|
201
210
|
): string {
|
|
202
|
-
if (state === "merged"
|
|
203
|
-
if (
|
|
204
|
-
if (
|
|
205
|
-
if (checks.
|
|
206
|
-
if (review === "
|
|
211
|
+
if (state === "merged") return "M";
|
|
212
|
+
if (state === "closed") return "C";
|
|
213
|
+
if (state === "draft") return "D";
|
|
214
|
+
if (checks.failed > 0) return compactCount("×", checks.failed);
|
|
215
|
+
if (review === "R×") return review;
|
|
216
|
+
if (checks.pending > 0) return compactCount("…", checks.pending);
|
|
217
|
+
if (review === "R✓" || review === "R?") return review;
|
|
207
218
|
return checksText;
|
|
208
219
|
}
|
|
209
220
|
|