@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 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`: `checks passing`, `<n> failing`, `<n> pending`, or `no checks`.
495
- - `$review`: `approved`, `changes requested`, `review required`, or empty when unknown.
496
- - `$status`: one compact result selected in this order: merged, closed, draft, failing, changes
497
- requested, pending, approved, review required, passing, then no checks.
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.50.3",
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.7.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.7",
47
- "@earendil-works/pi-coding-agent": "0.84.1",
48
- "@earendil-works/pi-tui": "0.84.1",
49
- "@types/node": "26.1.2",
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": {
@@ -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 "no checks";
184
- if (checks.failed > 0) return `${checks.failed} failing`;
185
- if (checks.pending > 0) return `${checks.pending} pending`;
186
- return "checks passing";
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 "approved";
191
- if (review === "CHANGES_REQUESTED") return "changes requested";
192
- if (review === "REVIEW_REQUIRED") return "review required";
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" || state === "closed" || state === "draft") return state;
203
- if (checks.failed > 0) return checksText;
204
- if (review === "changes requested") return review;
205
- if (checks.pending > 0) return checksText;
206
- if (review === "approved" || review === "review required") return 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