@hank-warren/pi-statusline 0.6.0 → 0.7.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/CHANGELOG.md +6 -0
- package/README.md +2 -2
- package/index.ts +6 -0
- package/package.json +1 -1
- package/settings-menu.ts +1 -0
- package/settings.ts +3 -0
- package/themes.ts +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @hank-warren/pi-statusline
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 70c8ef9: Add an optional provider segment. A new `Provider` toggle in `/statusline` renders the active model's provider id between the model and the directory (`claude-opus-5 | anthropic-team | pi-extensions:main | 0/1.0m`), so a `pi-multi-login` alias names the login actually spending — something a model id never carries. It is off by default, has its own colour role in every theme, and is omitted entirely when the model reports no provider.
|
|
8
|
+
|
|
3
9
|
## 0.6.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ gpt-5.6-sol | pi-extensions:main* ⇣1 | 40k/1.0m | 97·54 80
|
|
|
10
10
|
|
|
11
11
|
## What it shows
|
|
12
12
|
|
|
13
|
-
- **Line 1** — active model ID, current directory basename and Git branch, current context usage/window, and subscription usage headroom (see below). A yellow `*` marks a dirty checkout and `⇣N` shows how many commits it is behind its locally known upstream ref. Unknown context usage is rendered as `?/<window>` until Pi can provide an estimate. Exceptional prompt-cache hits trigger the celebration described below.
|
|
13
|
+
- **Line 1** — active model ID, optionally the provider of that model, current directory basename and Git branch, current context usage/window, and subscription usage headroom (see below). A yellow `*` marks a dirty checkout and `⇣N` shows how many commits it is behind its locally known upstream ref. Unknown context usage is rendered as `?/<window>` until Pi can provide an estimate. Exceptional prompt-cache hits trigger the celebration described below.
|
|
14
14
|
- **Worktree lines** — when the session works in or sends tool calls into linked worktrees, one line shows the same branch/dirty/behind state for each worktree plus its associated PR number.
|
|
15
15
|
- **Final line** — the full Pi session ID.
|
|
16
16
|
|
|
@@ -22,7 +22,7 @@ Colors come from a selectable [theme](#themes), with context warning thresholds.
|
|
|
22
22
|
|
|
23
23
|
- **Theme** — the color palette, cycled with Enter or Space. See [Themes](#themes).
|
|
24
24
|
- **Cache celebration** — `off` or one of five badge animations, cycled with Enter or Space and previewed live in the statusline below. See [Animation styles](#animation-styles).
|
|
25
|
-
- **Model**, **Directory & git**, **Context**, **Subscription usage**, **Worktree line**, **Session ID line** — `on`/`off`, cycled with Enter or Space. Disabled segments are dropped from line 1 without leaving a stray ` | ` separator; hiding the worktree line also stops its `git`/`gh` polling, and hiding usage stops the usage poller. With every element off the footer collapses to a single blank row.
|
|
25
|
+
- **Model**, **Provider**, **Directory & git**, **Context**, **Subscription usage**, **Worktree line**, **Session ID line** — `on`/`off`, cycled with Enter or Space. **Provider** is the only one that starts `off`; it shows the provider id exactly as Pi reports it, so a [pi-multi-login](../pi-multi-login) alias renders as `anthropic-team` and names the login actually spending — something a model id like `claude-opus-5` never carries. With no model, or a model reporting no provider, the segment is simply absent. Disabled segments are dropped from line 1 without leaving a stray ` | ` separator; hiding the worktree line also stops its `git`/`gh` polling, and hiding usage stops the usage poller. With every element off the footer collapses to a single blank row.
|
|
26
26
|
- **Worktree root** — the directory whose immediate children are tracked as session worktrees (default `~/repos/worktrees`). `~` and `$HOME` are expanded; a relative path is rejected and the previous value kept.
|
|
27
27
|
- **Repo aliases** — short display names for repositories on the worktree line. Enter edits the selected `repo → alias` pair, `d` deletes it, and `Add alias…` creates one from a `repo=alias` line.
|
|
28
28
|
|
package/index.ts
CHANGED
|
@@ -40,6 +40,8 @@ import {
|
|
|
40
40
|
|
|
41
41
|
export interface StatuslineData {
|
|
42
42
|
model: string;
|
|
43
|
+
/** Provider id of the active model; absent when there is no model. */
|
|
44
|
+
provider?: string;
|
|
43
45
|
cwd: string;
|
|
44
46
|
cwdGit: GitRepositoryStatus | null;
|
|
45
47
|
contextTokens: number | null;
|
|
@@ -177,6 +179,9 @@ export function renderStatusline(
|
|
|
177
179
|
const usageSegment = settings.showUsage && data.usage ? renderUsageSegment(data.usage, palette) : undefined;
|
|
178
180
|
const segments = [
|
|
179
181
|
settings.showModel ? styled(palette.model, data.model) : undefined,
|
|
182
|
+
// No provider is a missing segment, not a placeholder: the model id already
|
|
183
|
+
// says "no-model" in that state, and a second one would only add noise.
|
|
184
|
+
settings.showProvider && data.provider ? styled(palette.provider, data.provider) : undefined,
|
|
180
185
|
settings.showDirectory
|
|
181
186
|
? data.cwdGit
|
|
182
187
|
? renderRepository(data.cwd, data.cwdGit, palette)
|
|
@@ -424,6 +429,7 @@ export default function statuslineExtension(pi: ExtensionAPI): void {
|
|
|
424
429
|
renderStatusline(
|
|
425
430
|
{
|
|
426
431
|
model,
|
|
432
|
+
provider: ctx.model?.provider,
|
|
427
433
|
cwd,
|
|
428
434
|
cwdGit,
|
|
429
435
|
contextTokens: usage?.tokens ?? null,
|
package/package.json
CHANGED
package/settings-menu.ts
CHANGED
|
@@ -32,6 +32,7 @@ export interface BooleanRow {
|
|
|
32
32
|
/** Toggle rows, in statusline render order. */
|
|
33
33
|
export const BOOLEAN_ROWS: readonly BooleanRow[] = [
|
|
34
34
|
{ id: "showModel", label: "Model", description: "Show the active model id." },
|
|
35
|
+
{ id: "showProvider", label: "Provider", description: "Show the provider of the active model." },
|
|
35
36
|
{ id: "showDirectory", label: "Directory & git", description: "Show the working directory and its git branch." },
|
|
36
37
|
{ id: "showContext", label: "Context", description: "Show context tokens used against the window." },
|
|
37
38
|
{ id: "showUsage", label: "Subscription usage", description: "Show Claude/Codex remaining-headroom meters." },
|
package/settings.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { DEFAULT_THEME, isThemeName, type StatuslineThemeName } from "./themes.t
|
|
|
12
12
|
/** Toggle keys, in the order the `/statusline` menu lists them. */
|
|
13
13
|
export const BOOLEAN_SETTING_KEYS = [
|
|
14
14
|
"showModel",
|
|
15
|
+
"showProvider",
|
|
15
16
|
"showDirectory",
|
|
16
17
|
"showContext",
|
|
17
18
|
"showUsage",
|
|
@@ -40,6 +41,8 @@ export function defaultWorktreeRoot(home: string = homedir()): string {
|
|
|
40
41
|
export function defaultSettings(home: string = homedir()): StatuslineSettings {
|
|
41
42
|
return {
|
|
42
43
|
showModel: true,
|
|
44
|
+
// Opt-in: the provider is redundant for anyone with a single login per family.
|
|
45
|
+
showProvider: false,
|
|
43
46
|
showDirectory: true,
|
|
44
47
|
showContext: true,
|
|
45
48
|
showUsage: true,
|
package/themes.ts
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
export interface StatuslinePalette {
|
|
6
6
|
/** Active model id. */
|
|
7
7
|
model: string;
|
|
8
|
+
/** Provider id of the active model. */
|
|
9
|
+
provider: string;
|
|
8
10
|
/** Repository and directory names. */
|
|
9
11
|
path: string;
|
|
10
12
|
/** Git branch names. */
|
|
@@ -35,6 +37,7 @@ const rgb = (hex: string): string => {
|
|
|
35
37
|
/** The palette this package shipped before themes existed. */
|
|
36
38
|
const DEFAULT: StatuslinePalette = {
|
|
37
39
|
model: rgb("#0099ff"),
|
|
40
|
+
provider: rgb("#7aa2c8"),
|
|
38
41
|
path: rgb("#dcdcdc"),
|
|
39
42
|
branch: rgb("#56b6c2"),
|
|
40
43
|
text: rgb("#dcdcdc"),
|
|
@@ -50,6 +53,7 @@ const DEFAULT: StatuslinePalette = {
|
|
|
50
53
|
/** Dracula, with the pink branch colour from Hank's Herdr sidebar config. */
|
|
51
54
|
const DRACULA: StatuslinePalette = {
|
|
52
55
|
model: rgb("#bd93f9"),
|
|
56
|
+
provider: rgb("#9580c9"),
|
|
53
57
|
path: rgb("#f8f8f2"),
|
|
54
58
|
branch: rgb("#ff79c6"),
|
|
55
59
|
text: rgb("#f8f8f2"),
|
|
@@ -64,6 +68,7 @@ const DRACULA: StatuslinePalette = {
|
|
|
64
68
|
|
|
65
69
|
const GITHUB_DARK: StatuslinePalette = {
|
|
66
70
|
model: rgb("#58a6ff"),
|
|
71
|
+
provider: rgb("#6e8bb5"),
|
|
67
72
|
path: rgb("#c9d1d9"),
|
|
68
73
|
branch: rgb("#39c5cf"),
|
|
69
74
|
text: rgb("#c9d1d9"),
|
|
@@ -78,6 +83,7 @@ const GITHUB_DARK: StatuslinePalette = {
|
|
|
78
83
|
|
|
79
84
|
const CATPPUCCIN_MOCHA: StatuslinePalette = {
|
|
80
85
|
model: rgb("#cba6f7"),
|
|
86
|
+
provider: rgb("#a58fc4"),
|
|
81
87
|
path: rgb("#cdd6f4"),
|
|
82
88
|
branch: rgb("#89dceb"),
|
|
83
89
|
text: rgb("#cdd6f4"),
|
|
@@ -93,6 +99,7 @@ const CATPPUCCIN_MOCHA: StatuslinePalette = {
|
|
|
93
99
|
/** No colour at all: white text, dimmed punctuation, a grey badge flash. */
|
|
94
100
|
const WHITE: StatuslinePalette = {
|
|
95
101
|
model: rgb("#ffffff"),
|
|
102
|
+
provider: rgb("#ffffff"),
|
|
96
103
|
path: rgb("#ffffff"),
|
|
97
104
|
branch: rgb("#ffffff"),
|
|
98
105
|
text: rgb("#ffffff"),
|