@narumitw/pi-statusline 0.49.11 → 0.49.12

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.
Files changed (2) hide show
  1. package/README.md +90 -97
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,9 +1,8 @@
1
- # ✨ pi-statusline — A Beautiful, Practical Footer for Pi
1
+ # ✨ pi-statusline — Add a Ready-to-Use Powerline Footer to Pi
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/@narumitw/pi-statusline)](https://www.npmjs.com/package/@narumitw/pi-statusline) [![Pi extension](https://img.shields.io/badge/Pi-extension-blue)](https://pi.dev) [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE)
4
4
 
5
- `@narumitw/pi-statusline` gives [Pi](https://pi.dev) an opinionated powerline footer that looks good
6
- without setup and keeps useful context visible as the terminal narrows.
5
+ Add an opinionated Powerline-style footer that works without setup and keeps the most useful Pi, workspace, Git, usage, and time context visible as the terminal narrows.
7
6
 
8
7
  A representative uncolored layout:
9
8
 
@@ -13,20 +12,19 @@ A representative uncolored layout:
13
12
 
14
13
  ## ✨ Features
15
14
 
16
- - **Fast package startup:** Pi's Jiti loader reads a generated split TypeScript runtime.
17
- - **Zero-config default:** model, thinking, workspace, Git/PR state, context use, and local time.
18
- - **Responsive:** removes lower-priority segments before important information gets clipped.
19
- - **Quiet when idle:** activity appears only while Pi is streaming or running tools.
20
- - **Native-aligned usage:** optional token, prompt-cache, subscription, and cost details.
21
- - **Easy choices:** three information levels and seven previewable color presets.
22
- - **Still flexible:** custom layouts, multiline rows, colors, labels, separators, and status icons stay
23
- available under **Advanced**.
24
-
25
- > **Need more customization?** See
26
- > [`pi-starship`](https://github.com/narumiruna/pi-extensions/tree/main/packages/pi-starship)
27
- > ([npm](https://www.npmjs.com/package/@narumitw/pi-starship)). It uses a
28
- > [Starship-inspired](https://starship.rs/) TOML format and style syntax for deeper control over
29
- > layout, modules, and colors. Choose `pi-statusline` for practical defaults and quick setup.
15
+ - Works immediately with a balanced default for model, thinking, workspace, Git, context, activity, and time.
16
+ - Removes lower-priority segments before important information is clipped.
17
+ - Shows activity only while Pi is streaming or running tools.
18
+ - Adds optional token, prompt-cache, provider usage, and cost details.
19
+ - Offers three information levels, seven previewable palettes, and advanced custom layouts.
20
+ - Loads a generated split runtime to reduce Pi package startup work.
21
+
22
+ > **Need more customization?**
23
+ > See
24
+ > [`pi-starship`](https://github.com/narumiruna/pi-extensions/tree/main/packages/pi-starship) ([npm](https://www.npmjs.com/package/@narumitw/pi-starship)).
25
+ > It uses a
26
+ > [Starship-inspired](https://starship.rs/) TOML format and style syntax for deeper control over layout, modules, and colors.
27
+ > Choose `pi-statusline` for practical defaults and quick setup.
30
28
  >
31
29
  > Do not enable both extensions at the same time because both own Pi's footer.
32
30
 
@@ -46,20 +44,19 @@ Build the generated runtime and try the local package from this repository:
46
44
 
47
45
  ```bash
48
46
  npm --workspace @narumitw/pi-statusline run build
49
- just try statusline
47
+ pi -e ./packages/pi-statusline
50
48
  ```
51
49
 
52
50
  The package declares `dist/index.ts`, so an unbuilt local checkout must run the build before Pi loads the package directory.
53
- `just try statusline` runs that build automatically.
54
51
 
55
52
  For the best result, use a terminal font that includes Powerline glyphs and emoji.
56
53
 
57
54
  ## 🚀 Quick start
58
55
 
59
- 1. Install the extension and start Pi.
60
- 2. Run `/statusline`.
61
- 3. Use the standard Main/Advanced navigation, then choose an appearance or information level;
62
- appearance previews update the extension-owned footer before you apply a choice.
56
+ Install the extension and start Pi to use the balanced default immediately.
57
+ Run `/statusline` to preview and apply an appearance or information level.
58
+
59
+ ## 🎛️ Menu and information levels
63
60
 
64
61
  ```text
65
62
  Appearance (tokyo-night)
@@ -79,8 +76,8 @@ Help
79
76
 
80
77
  ### Information levels
81
78
 
82
- Selecting a level replaces only the `segments` array. Unknown and unrelated JSON fields are
83
- preserved.
79
+ Selecting a level replaces only the `segments` array.
80
+ Unknown and unrelated JSON fields are preserved.
84
81
 
85
82
  | Level | Included segments |
86
83
  | --- | --- |
@@ -89,8 +86,8 @@ preserved.
89
86
  | **Detailed** | `provider model thinking cwd branch tools context tokens cache cost time` |
90
87
  | **Custom** | Any other segment order, including explicit line breaks |
91
88
 
92
- The `tools` segment takes no space while idle. `cache` takes no space when Pi has reported no cache
93
- reads or writes.
89
+ The `tools` segment takes no space while idle.
90
+ `cache` takes no space when Pi has reported no cache reads or writes.
94
91
 
95
92
  ## 💬 Commands
96
93
 
@@ -101,34 +98,33 @@ reads or writes.
101
98
  | `/statusline status` | Show the effective settings and diagnostics |
102
99
  | `/statusline help` | Show command and schema guidance |
103
100
 
104
- The direct `settings`, `status`, and `help` routes remain for compatibility. The root standard menu
105
- is TUI-only; Escape returns from Advanced or closes Main. RPC receives observable notifications
106
- instead of TUI-only controls. Unknown subcommands and trailing arguments are rejected. The standard
107
- palette picker owns navigation and cleanup while pi-statusline still owns footer previews, settings,
108
- and rollback. The width-aware layout editor and JSON editor remain specialized UI.
101
+ The direct `settings`, `status`, and `help` routes remain for compatibility.
102
+ The root standard menu is TUI-only; Escape returns from Advanced or closes Main.
103
+ RPC receives observable notifications instead of TUI-only controls.
104
+ Unknown subcommands and trailing arguments are rejected.
105
+ The standard palette picker owns navigation and cleanup while pi-statusline still owns footer previews, settings, and rollback.
106
+ The width-aware layout editor and JSON editor remain specialized UI.
109
107
 
110
108
  ## 📐 Runtime behavior
111
109
 
112
110
  ### Responsive fitting
113
111
 
114
- Each row keeps its configured segment order. If it is too wide, pi-statusline removes the
115
- lowest-priority segment, recomputes the powerline transitions, and repeats until the row fits.
112
+ Each row keeps its configured segment order.
113
+ If it is too wide, pi-statusline removes the lowest-priority segment, recomputes the powerline transitions, and repeats until the row fits.
116
114
  Retention priority is highest to lowest:
117
115
 
118
116
  ```text
119
117
  context model branch tools cwd thinking cost provider cache tokens time turn brand
120
118
  ```
121
119
 
122
- Explicit `line_break` entries remain row boundaries. If the last remaining segment is itself wider
123
- than the row, that row renders empty rather than emitting an over-width line.
120
+ Explicit `line_break` entries remain row boundaries.
121
+ If the last remaining segment is itself wider than the row, that row renders empty rather than emitting an over-width line.
124
122
 
125
123
  ### Directory, activity, Git, and PR state
126
124
 
127
- - `cwd` uses Starship's directory presentation defaults: contract the home directory to `~`, contract
128
- to the Git repository root when available, then retain at most the last three path components. This
129
- changes display only; the configured segment list and Pi working directory are untouched.
130
- - Repository-root discovery is cached with Git status outside footer rendering; a failed root query
131
- falls back to home/path-component contraction without hiding the segment.
125
+ - `cwd` uses Starship's directory presentation defaults: contract the home directory to `~`, contract to the Git repository root when available, then retain at most the last three path components.
126
+ This changes display only; the configured segment list and Pi working directory are untouched.
127
+ - Repository-root discovery is cached with Git status outside footer rendering; a failed root query falls back to home/path-component contraction without hiding the segment.
132
128
  - During active work, `tools` shows `💭 thinking` or `⚙ <tool>` with parallel counts.
133
129
  - Activity disappears after the agent settles and resets across session replacement or shutdown.
134
130
  - Clean repositories show no Git counters.
@@ -140,17 +136,15 @@ than the row, that row renders empty rather than emitting an over-width line.
140
136
 
141
137
  ### Usage and context
142
138
 
143
- - `context` renders one-decimal current usage and the model window, such as `2.4%/272k`. After
144
- compaction it can temporarily render `?/272k` until the next valid assistant response.
145
- - `tokens`, `cache`, and `cost` total every usage-bearing session entry, matching Pi's native footer:
146
- assistant messages, nested-LLM tool results, compactions, and branch summaries, including abandoned
147
- branches retained in the session.
148
- - Cache tokens are `R<read>`, `W<write>`, and `CH<rate>`. `R` and `W` are cumulative; `CH` uses only
149
- the latest assistant prompt: `cacheRead / (input + cacheRead + cacheWrite) * 100`.
150
- - Subscription-backed OAuth models and `kimi-coding` append `(sub)` to cost. The dollar value is
151
- usage cost, not proof of an amount billed under a subscription.
152
- - Pi's public extension API does not expose the current auto-compaction toggle, so this footer cannot
153
- reliably show the native `(auto)` marker.
139
+ - `context` renders one-decimal current usage and the model window, such as `2.4%/272k`.
140
+ After compaction it can temporarily render `?/272k` until the next valid assistant response.
141
+ - `tokens`, `cache`, and `cost` total every usage-bearing session entry, matching Pi's native footer.
142
+ This includes assistant messages, nested-LLM tool results, compactions, and branch summaries, including abandoned branches retained in the session.
143
+ - Cache tokens are `R<read>`, `W<write>`, and `CH<rate>`.
144
+ `R` and `W` are cumulative; `CH` uses only the latest assistant prompt: `cacheRead / (input + cacheRead + cacheWrite) * 100`.
145
+ - Subscription-backed OAuth models and `kimi-coding` append `(sub)` to cost.
146
+ The dollar value is usage cost, not proof of an amount billed under a subscription.
147
+ - Pi's public extension API does not expose the current auto-compaction toggle, so this footer cannot reliably show the native `(auto)` marker.
154
148
 
155
149
  ## ⚙️ Settings
156
150
 
@@ -160,13 +154,14 @@ The extension uses one user-level file:
160
154
  <getAgentDir()>/pi-statusline.json
161
155
  ```
162
156
 
163
- There are no project or environment overrides. When the file is absent, pi-statusline uses its
164
- built-in defaults without creating the file or parent directory. The first successful settings save
165
- creates a complete editable document atomically. Malformed or unreadable settings are never
166
- overwritten. Settings reload on startup, `/reload`, and session replacement.
157
+ There are no project or environment overrides.
158
+ When the file is absent, pi-statusline uses its built-in defaults without creating the file or parent directory.
159
+ The first successful settings save creates a complete editable document atomically.
160
+ Malformed or unreadable settings are never overwritten.
161
+ Settings reload on startup, `/reload`, and session replacement.
167
162
 
168
- A valid legacy `pi-statusline-settings.json` remains readable with a warning and is never modified
169
- automatically; rename it to `pi-statusline.json`. If both files exist, `pi-statusline.json` wins.
163
+ A valid legacy `pi-statusline-settings.json` remains readable with a warning and is never modified automatically; rename it to `pi-statusline.json`.
164
+ If both files exist, `pi-statusline.json` wins.
170
165
 
171
166
  ### Settings reference
172
167
 
@@ -180,9 +175,10 @@ automatically; rename it to `pi-statusline.json`. If both files exist, `pi-statu
180
175
  | `segmentText` | Per-segment `prefix` and `suffix`; model truncation fields | Format Pi-owned dynamic values |
181
176
  | `extensionStatusIcons` | Raw status key or `namespace:*` to icon string | Customize extension status icons |
182
177
 
183
- All fields are optional in an existing document. Missing fields use defaults. Unknown fields produce a
184
- warning but are preserved by menu saves. Invalid recognized values block saving, leaving the previous
185
- file and live footer unchanged.
178
+ All fields are optional in an existing document.
179
+ Missing fields use defaults.
180
+ Unknown fields produce a warning but are preserved by menu saves.
181
+ Invalid recognized values block saving, leaving the previous file and live footer unchanged.
186
182
 
187
183
  A compact customization example:
188
184
 
@@ -207,13 +203,12 @@ A compact customization example:
207
203
  }
208
204
  ```
209
205
 
210
- Use **Advanced → Edit settings JSON** or `/statusline settings` to edit, validate, atomically save, and
211
- apply the file.
206
+ Use **Advanced → Edit settings JSON** or `/statusline settings` to edit, validate, atomically save, and apply the file.
212
207
 
213
208
  ## 🎨 Appearance
214
209
 
215
- Named palettes provide contrast-checked color ramps. Appearance previews update while the picker
216
- moves, but save only when Enter is pressed; Escape restores the saved palette.
210
+ Named palettes provide contrast-checked color ramps.
211
+ Appearance previews update while the picker moves, but save only when Enter is pressed; Escape restores the saved palette.
217
212
 
218
213
  When `palettePreset` is `custom`, `palette` maps segment names to foreground/background colors:
219
214
 
@@ -235,8 +230,8 @@ When `palettePreset` is `custom`, `palette` maps segment names to foreground/bac
235
230
  - Missing custom colors remain unstyled instead of inheriting Tokyo Night.
236
231
  - Adjacent segments with identical colors share one block; transitions use ``.
237
232
 
238
- `segmentText` values must be single-line text without terminal control characters. Use `line_break`
239
- for another row rather than inserting a newline into a prefix or suffix.
233
+ `segmentText` values must be single-line text without terminal control characters.
234
+ Use `line_break` for another row rather than inserting a newline into a prefix or suffix.
240
235
 
241
236
  ### Model truncation
242
237
 
@@ -254,20 +249,19 @@ Long model IDs are truncated out of the box so the balanced footer can retain us
254
249
  }
255
250
  ```
256
251
 
257
- `truncationLength` counts model grapheme clusters retained before the symbol. The built-in value is
258
- `36`; set it to `0` to display the complete ID. The direction names the removed portion:
252
+ `truncationLength` counts model grapheme clusters retained before the symbol.
253
+ The built-in value is `36`; set it to `0` to display the complete ID.
254
+ The direction names the removed portion:
259
255
 
260
- - `start` retains the suffix and is the default, which is useful for long llama.cpp paths and model
261
- variants.
256
+ - `start` retains the suffix and is the default, which is useful for long llama.cpp paths and model variants.
262
257
  - `middle` retains both ends.
263
258
  - `end` retains the prefix.
264
259
 
265
- Truncation runs after the built-in Claude/GPT shortening rules but before the configured model prefix
266
- and suffix. It changes display only—the provider model ID is untouched. Terminal control sequences
267
- in model IDs are removed at render time, and unsafe configured symbols are rejected. An empty
268
- `truncationSymbol` truncates without a marker. pi-statusline treats model IDs as opaque strings and
269
- does not parse paths, repositories, GGUF suffixes, or quantization names. At very narrow widths, the
270
- existing responsive priorities may still omit the model rather than overflow the terminal.
260
+ Truncation runs after the built-in Claude/GPT shortening rules but before the configured model prefix and suffix.
261
+ It changes display only—the provider model ID is untouched.
262
+ Terminal control sequences in model IDs are removed at render time, and unsafe configured symbols are rejected.
263
+ An empty `truncationSymbol` truncates without a marker. pi-statusline treats model IDs as opaque strings and does not parse paths, repositories, GGUF suffixes, or quantization names.
264
+ At very narrow widths, the existing responsive priorities may still omit the model rather than overflow the terminal.
271
265
 
272
266
  ## 🧩 Advanced layout
273
267
 
@@ -292,10 +286,11 @@ Available data segments:
292
286
  brand provider model thinking cwd branch tools context tokens cache cost time turn
293
287
  ```
294
288
 
295
- Data segments must be unique. `line_break` may repeat when data segments separate occurrences, but
296
- consecutive breaks are invalid. It has no `segmentText` entry. The menu cleans up leading, trailing,
297
- and newly consecutive breaks after visibility changes. Manually authored leading/trailing breaks
298
- represent empty rows.
289
+ Data segments must be unique.
290
+ `line_break` may repeat when data segments separate occurrences, but consecutive breaks are invalid.
291
+ It has no `segmentText` entry.
292
+ The menu cleans up leading, trailing, and newly consecutive breaks after visibility changes.
293
+ Manually authored leading/trailing breaks represent empty rows.
299
294
 
300
295
  ```json
301
296
  {
@@ -303,13 +298,13 @@ represent empty rows.
303
298
  }
304
299
  ```
305
300
 
306
- An empty `segments` array hides the main powerline while extension statuses can still render. The
307
- extension intentionally has no variable or format language; use `pi-starship` when you need one.
301
+ An empty `segments` array hides the main powerline while extension statuses can still render.
302
+ The extension intentionally has no variable or format language; use `pi-starship` when you need one.
308
303
 
309
304
  ## 🔌 Extension statuses and icons
310
305
 
311
- Other extension statuses appear below the main powerline, wrap to terminal width, and are limited to
312
- five items. Icons resolve in this order:
306
+ Other extension statuses appear below the main powerline, wrap to terminal width, and are limited to five items.
307
+ Icons resolve in this order:
313
308
 
314
309
  1. Exact configured raw key, such as `goal` or `foo:server`.
315
310
  2. Longest configured colon wildcard, such as `foo:*` or `foo:server:*`.
@@ -318,9 +313,10 @@ five items. Icons resolve in this order:
318
313
  5. Built-in icon.
319
314
  6. Generic `🔌` fallback.
320
315
 
321
- Set an icon to `""` to hide only the icon. Wildcards match colon namespaces, not slash-delimited keys;
322
- configure slash keys exactly. Compatibility fallbacks retain `codex-usage`, `pisync`, and
323
- `unknown-error-retry`; an explicit canonical key wins.
316
+ Set an icon to `""` to hide only the icon.
317
+ Wildcards match colon namespaces, not slash-delimited keys.
318
+ Configure slash keys exactly.
319
+ Compatibility fallbacks retain `codex-usage`, `pisync`, and `unknown-error-retry`; an explicit canonical key wins.
324
320
 
325
321
  For interoperable extensions, prefer one aggregated key or a stable coexistence slot:
326
322
 
@@ -334,12 +330,9 @@ Put transient activity in the value and always clear the same complete key.
334
330
  ## 🛠️ Troubleshooting
335
331
 
336
332
  - **Powerline symbols look wrong:** use a font with Powerline glyphs; emoji support is also recommended.
337
- - **The footer reports settings warnings:** run `/statusline status`, then `/statusline settings` to fix
338
- invalid recognized fields.
339
- - **The footer appears to be replaced:** disable `pi-starship` or another extension that also calls
340
- Pi's `setFooter()`.
341
- - **A custom segment disappears on a narrow terminal:** check the responsive priority above or add an
342
- explicit `line_break`.
333
+ - **The footer reports settings warnings:** run `/statusline status`, then `/statusline settings` to fix invalid recognized fields.
334
+ - **The footer appears to be replaced:** disable `pi-starship` or another extension that also calls Pi's `setFooter()`.
335
+ - **A custom segment disappears on a narrow terminal:** check the responsive priority above or add an explicit `line_break`.
343
336
 
344
337
  ## 🗂️ Package layout
345
338
 
@@ -376,9 +369,9 @@ The package build emits the sole declared Pi entrypoint at `dist/index.ts` witho
376
369
 
377
370
  ## 🔎 Keywords
378
371
 
379
- Pi extension, Pi coding agent, statusline, Tokyo Night, powerline, responsive terminal footer,
380
- context usage, prompt cache, cache hit rate, model status.
372
+ Pi extension, Pi coding agent, statusline, Tokyo Night, powerline, responsive terminal footer, context usage, prompt cache, cache hit rate, model status.
381
373
 
382
374
  ## 📄 License
383
375
 
384
- MIT. See [`LICENSE`](./LICENSE).
376
+ MIT.
377
+ See [`LICENSE`](./LICENSE).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narumitw/pi-statusline",
3
- "version": "0.49.11",
3
+ "version": "0.49.12",
4
4
  "description": "Pi extension that replaces the footer with an information-rich statusline.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -38,11 +38,11 @@
38
38
  "@earendil-works/pi-tui": "*"
39
39
  },
40
40
  "devDependencies": {
41
- "@biomejs/biome": "2.5.8",
41
+ "@biomejs/biome": "2.5.9",
42
42
  "@earendil-works/pi-coding-agent": "0.84.2",
43
43
  "@earendil-works/pi-tui": "0.84.2",
44
44
  "@types/node": "26.2.0",
45
- "esbuild": "0.28.1",
45
+ "esbuild": "0.28.2",
46
46
  "typescript": "7.0.2"
47
47
  },
48
48
  "repository": {
@@ -51,6 +51,6 @@
51
51
  "directory": "packages/pi-statusline"
52
52
  },
53
53
  "dependencies": {
54
- "@narumitw/pi-tui-kit": "^0.56.0"
54
+ "@narumitw/pi-tui-kit": "^0.57.0"
55
55
  }
56
56
  }