@narumitw/pi-statusline 0.49.15 → 0.50.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 +47 -222
- package/dist/chunks/{chunk-74QZGJ7L.js → chunk-J2ZSGEDQ.js} +18 -97
- package/dist/chunks/chunk-J2ZSGEDQ.js.map +7 -0
- package/dist/chunks/{commands-C2G2G7C6.js → commands-PPT3AJTL.js} +14 -58
- package/dist/chunks/commands-PPT3AJTL.js.map +7 -0
- package/dist/index.ts +101 -89
- package/dist/index.ts.map +3 -3
- package/docs/configuration.md +194 -0
- package/package.json +51 -54
- package/src/ansi.ts +23 -18
- package/src/command-contract.ts +6 -6
- package/src/commands.ts +759 -818
- package/src/directory.ts +27 -31
- package/src/extension-status.ts +186 -214
- package/src/git-status.ts +103 -111
- package/src/information-profiles.ts +12 -31
- package/src/powerline.ts +120 -121
- package/src/presets/candy.ts +1 -7
- package/src/presets/create-ramp.ts +21 -23
- package/src/presets/custom.ts +7 -7
- package/src/presets/forest.ts +1 -7
- package/src/presets/index.ts +30 -32
- package/src/presets/mono.ts +1 -7
- package/src/presets/neon.ts +1 -7
- package/src/presets/ocean.ts +1 -7
- package/src/presets/sunset.ts +1 -7
- package/src/presets/tokyo-night.ts +9 -9
- package/src/presets/types.ts +5 -5
- package/src/render.ts +291 -280
- package/src/settings.ts +516 -568
- package/src/statusline.ts +348 -341
- package/src/types.ts +34 -42
- package/src/usage.ts +40 -40
- package/dist/chunks/chunk-74QZGJ7L.js.map +0 -7
- package/dist/chunks/commands-C2G2G7C6.js.map +0 -7
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@narumitw/pi-statusline) [](https://pi.dev) [](./LICENSE)
|
|
4
4
|
|
|
5
|
-
Add
|
|
5
|
+
Add a Powerline-style footer that works without setup and keeps important Pi, workspace, Git, usage, and time context visible as the terminal narrows.
|
|
6
6
|
|
|
7
7
|
A representative uncolored layout:
|
|
8
8
|
|
|
@@ -14,19 +14,16 @@ A representative uncolored layout:
|
|
|
14
14
|
|
|
15
15
|
- Works immediately with a balanced default for model, thinking, workspace, Git, context, activity, and time.
|
|
16
16
|
- Removes lower-priority segments before important information is clipped.
|
|
17
|
-
- Shows
|
|
17
|
+
- Shows when Pi is waiting for an extension UI prompt, streaming, or running tools.
|
|
18
18
|
- Adds optional token, prompt-cache, provider usage, and cost details.
|
|
19
19
|
- Offers three information levels, seven previewable palettes, and advanced custom layouts.
|
|
20
|
+
- Uses ANSI-256 palette colors when Pi's effective terminal capabilities disable true color.
|
|
20
21
|
- Loads a generated split runtime to reduce Pi package startup work.
|
|
21
22
|
|
|
22
23
|
> **Need more customization?**
|
|
23
|
-
> See
|
|
24
|
-
> [
|
|
25
|
-
> It uses a
|
|
26
|
-
> [Starship-inspired](https://starship.rs/) TOML format and style syntax for deeper control over layout, modules, and colors.
|
|
24
|
+
> See [`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 [Starship-inspired](https://starship.rs/) TOML and style syntax for deeper control over layout, modules, and colors.
|
|
27
26
|
> Choose `pi-statusline` for practical defaults and quick setup.
|
|
28
|
-
>
|
|
29
|
-
> Do not enable both extensions at the same time because both own Pi's footer.
|
|
30
27
|
|
|
31
28
|
## 📦 Install
|
|
32
29
|
|
|
@@ -47,9 +44,8 @@ npm --workspace @narumitw/pi-statusline run build
|
|
|
47
44
|
pi -e ./packages/pi-statusline
|
|
48
45
|
```
|
|
49
46
|
|
|
50
|
-
The package declares `dist/index.ts`, so an unbuilt local checkout
|
|
51
|
-
|
|
52
|
-
For the best result, use a terminal font that includes Powerline glyphs and emoji.
|
|
47
|
+
The package declares `dist/index.ts`, so build an unbuilt local checkout before Pi loads the package directory.
|
|
48
|
+
Install only from sources you trust because Pi extensions run with Pi's permissions.
|
|
53
49
|
|
|
54
50
|
## 🚀 Quick start
|
|
55
51
|
|
|
@@ -69,15 +65,14 @@ Help
|
|
|
69
65
|
| Menu item | What it does |
|
|
70
66
|
| --- | --- |
|
|
71
67
|
| **Appearance** | Preview palettes with Up/Down; Enter applies and Escape cancels |
|
|
72
|
-
| **Information** | Preview and apply a curated set
|
|
68
|
+
| **Information** | Preview and apply a curated segment set |
|
|
73
69
|
| **Advanced** | Open Custom layout or Edit settings JSON |
|
|
74
70
|
| **Status** | Show the effective source, path, appearance, layout, and diagnostics |
|
|
75
71
|
| **Help** | Show command and schema guidance |
|
|
76
72
|
|
|
77
73
|
### Information levels
|
|
78
74
|
|
|
79
|
-
Selecting a level replaces only
|
|
80
|
-
Unknown and unrelated JSON fields are preserved.
|
|
75
|
+
Selecting a level replaces only `segments` and preserves unrelated JSON fields.
|
|
81
76
|
|
|
82
77
|
| Level | Included segments |
|
|
83
78
|
| --- | --- |
|
|
@@ -93,17 +88,15 @@ The `tools` segment takes no space while idle.
|
|
|
93
88
|
|
|
94
89
|
| Command | Purpose |
|
|
95
90
|
| --- | --- |
|
|
96
|
-
| `/statusline` |
|
|
97
|
-
| `/statusline settings` |
|
|
98
|
-
| `/statusline status` | Show
|
|
99
|
-
| `/statusline help` | Show command and schema guidance |
|
|
100
|
-
|
|
101
|
-
The
|
|
102
|
-
|
|
103
|
-
RPC receives observable notifications instead of TUI-only controls.
|
|
91
|
+
| `/statusline` | Customize footer appearance, information density, and layout. |
|
|
92
|
+
| `/statusline settings` | Edit the settings JSON. |
|
|
93
|
+
| `/statusline status` | Show effective settings and diagnostics. |
|
|
94
|
+
| `/statusline help` | Show command and schema guidance. |
|
|
95
|
+
|
|
96
|
+
The menu and editor require TUI; RPC receives notifications instead, including the manual settings path for `settings`.
|
|
97
|
+
Status and help support TUI and RPC; print and JSON modes produce no command output.
|
|
104
98
|
Unknown subcommands and trailing arguments are rejected.
|
|
105
|
-
|
|
106
|
-
The width-aware layout editor and JSON editor remain specialized UI.
|
|
99
|
+
Palette previews save on Enter and revert on Escape, but layout changes save immediately and are not undone by closing the editor; see the [configuration guide](./docs/configuration.md).
|
|
107
100
|
|
|
108
101
|
## 📐 Runtime behavior
|
|
109
102
|
|
|
@@ -125,12 +118,14 @@ If the last remaining segment is itself wider than the row, that row renders emp
|
|
|
125
118
|
- `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
119
|
This changes display only; the configured segment list and Pi working directory are untouched.
|
|
127
120
|
- 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.
|
|
128
|
-
- During active work, `tools` shows `💭 thinking
|
|
121
|
+
- During active work, `tools` shows `⌨ waiting for <kind>`, `💭 thinking`, or `⚙️ <tool>` with parallel counts.
|
|
122
|
+
- A sanitized prompt title follows the prompt kind when available.
|
|
123
|
+
- Prompt waiting takes precedence without losing the underlying tool or streaming state, which returns when the prompt closes.
|
|
129
124
|
- Activity disappears after the agent settles and resets across session replacement or shutdown.
|
|
130
125
|
- Clean repositories show no Git counters.
|
|
131
126
|
- Dirty counters are `⇡` ahead, `⇣` behind, `+` staged, `~` modified/deleted, `?` untracked, and `!`
|
|
132
127
|
conflicts.
|
|
133
|
-
- A linked GitHub PR appears with the branch when possible, avoiding a duplicate extension status.
|
|
128
|
+
- A linked or plain GitHub PR reference appears with the branch when possible, avoiding a duplicate extension status.
|
|
134
129
|
- Context color changes to warning at 70% and error at 90%.
|
|
135
130
|
- Git state is cached outside footer rendering and stale session results are ignored.
|
|
136
131
|
|
|
@@ -139,7 +134,7 @@ If the last remaining segment is itself wider than the row, that row renders emp
|
|
|
139
134
|
- `context` renders one-decimal current usage and the model window, such as `2.4%/272k`.
|
|
140
135
|
After compaction it can temporarily render `?/272k` until the next valid assistant response.
|
|
141
136
|
- `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,
|
|
137
|
+
This includes assistant messages, nested-LLM tool results, compactions, branch summaries, and persisted cache-warming usage, including abandoned branches retained in the session.
|
|
143
138
|
- Cache tokens are `R<read>`, `W<write>`, and `CH<rate>`.
|
|
144
139
|
`R` and `W` are cumulative; `CH` uses only the latest assistant prompt: `cacheRead / (input + cacheRead + cacheWrite) * 100`.
|
|
145
140
|
- Subscription-backed OAuth models and `kimi-coding` append `(sub)` to cost.
|
|
@@ -148,190 +143,38 @@ If the last remaining segment is itself wider than the row, that row renders emp
|
|
|
148
143
|
|
|
149
144
|
## ⚙️ Settings
|
|
150
145
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
```text
|
|
154
|
-
<getAgentDir()>/pi-statusline.json
|
|
155
|
-
```
|
|
156
|
-
|
|
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.
|
|
162
|
-
|
|
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.
|
|
146
|
+
Use `/statusline` for appearance and information presets, or **Advanced → Edit settings JSON** (`/statusline settings`) for a custom document.
|
|
147
|
+
The only settings file is `<getAgentDir()>/pi-statusline.json`; there are no project or environment overrides.
|
|
165
148
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
| Field | Accepted values | Purpose |
|
|
169
|
-
| --- | --- | --- |
|
|
170
|
-
| `palettePreset` | `tokyo-night`, `ocean`, `sunset`, `forest`, `candy`, `neon`, `mono`, `custom` | Select the active color preset |
|
|
171
|
-
| `palette` | Per-segment `fg`/`bg` `#RRGGBB` colors | Define colors used by `custom` |
|
|
172
|
-
| `density` | `compact`, `cozy` | Control horizontal padding |
|
|
173
|
-
| `separator` | `none`, `dot`, `bar`, `powerline`, `round` | Separate adjacent segments in one color block |
|
|
174
|
-
| `segments` | Ordered unique segment names and `line_break` | Control visibility, order, and rows |
|
|
175
|
-
| `segmentText` | Per-segment `prefix` and `suffix`; model truncation fields | Format Pi-owned dynamic values |
|
|
176
|
-
| `extensionStatusIcons` | Raw status key or `namespace:*` to icon string | Customize extension status icons |
|
|
177
|
-
|
|
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.
|
|
182
|
-
|
|
183
|
-
A compact customization example:
|
|
149
|
+
A minimal customization selects a palette and a few segments:
|
|
184
150
|
|
|
185
151
|
```json
|
|
186
152
|
{
|
|
187
153
|
"palettePreset": "ocean",
|
|
188
|
-
"
|
|
189
|
-
"separator": "dot",
|
|
190
|
-
"segments": ["model", "thinking", "cwd", "branch", "context", "cache", "cost"],
|
|
191
|
-
"segmentText": {
|
|
192
|
-
"model": {
|
|
193
|
-
"truncationLength": 40,
|
|
194
|
-
"truncationSymbol": "…",
|
|
195
|
-
"truncationDirection": "middle"
|
|
196
|
-
},
|
|
197
|
-
"context": { "prefix": "ctx ", "suffix": "" }
|
|
198
|
-
},
|
|
199
|
-
"extensionStatusIcons": {
|
|
200
|
-
"goal": "◎",
|
|
201
|
-
"foo:*": "🧪"
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
Use **Advanced → Edit settings JSON** or `/statusline settings` to edit, validate, atomically save, and apply the file.
|
|
207
|
-
|
|
208
|
-
## 🎨 Appearance
|
|
209
|
-
|
|
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.
|
|
212
|
-
|
|
213
|
-
When `palettePreset` is `custom`, `palette` maps segment names to foreground/background colors:
|
|
214
|
-
|
|
215
|
-
```json
|
|
216
|
-
{
|
|
217
|
-
"palettePreset": "custom",
|
|
218
|
-
"palette": {
|
|
219
|
-
"model": { "fg": "#090c0c", "bg": "#a3aed2" },
|
|
220
|
-
"context": { "fg": "#c0caf5", "bg": "#1d2230" }
|
|
221
|
-
}
|
|
154
|
+
"segments": ["model", "cwd", "branch", "context"]
|
|
222
155
|
}
|
|
223
156
|
```
|
|
224
157
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
- Missing custom colors remain unstyled instead of inheriting Tokyo Night.
|
|
231
|
-
- Adjacent segments with identical colors share one block; transitions use ``.
|
|
232
|
-
|
|
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.
|
|
158
|
+
A missing file uses the balanced built-in footer without creating the file or its parent directory.
|
|
159
|
+
The first successful save creates an editable document atomically.
|
|
160
|
+
Menu saves preserve unknown fields; invalid recognized values block saving and keep the live footer unchanged.
|
|
161
|
+
Malformed or unreadable files are never overwritten.
|
|
162
|
+
Manual edits load at startup, `/reload`, or session replacement.
|
|
235
163
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
Long model IDs are truncated out of the box so the balanced footer can retain useful model context:
|
|
239
|
-
|
|
240
|
-
```json
|
|
241
|
-
{
|
|
242
|
-
"segmentText": {
|
|
243
|
-
"model": {
|
|
244
|
-
"truncationLength": 36,
|
|
245
|
-
"truncationSymbol": "…",
|
|
246
|
-
"truncationDirection": "start"
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
```
|
|
164
|
+
Appearance previews save only on Enter, while Escape restores the saved palette.
|
|
165
|
+
Custom-layout changes save immediately, so closing that screen does not undo them.
|
|
251
166
|
|
|
252
|
-
|
|
253
|
-
The built-in value is `36`; set it to `0` to display the complete ID.
|
|
254
|
-
The direction names the removed portion:
|
|
167
|
+
Read the [configuration reference](./docs/configuration.md) for all settings, palettes, model truncation, multiline layouts, effective layout controls, extension-status icon precedence, and legacy-file handling.
|
|
255
168
|
|
|
256
|
-
|
|
257
|
-
- `middle` retains both ends.
|
|
258
|
-
- `end` retains the prefix.
|
|
259
|
-
|
|
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.
|
|
265
|
-
|
|
266
|
-
## 🧩 Advanced layout
|
|
267
|
-
|
|
268
|
-
Open **Advanced → Custom layout** when the curated levels are not enough.
|
|
269
|
-
|
|
270
|
-
| Key | Action |
|
|
271
|
-
| --- | --- |
|
|
272
|
-
| Up/Down | Navigate |
|
|
273
|
-
| Page Up/Page Down | Move by one viewport |
|
|
274
|
-
| Enter/Space | Show or hide the selected segment |
|
|
275
|
-
| `M` | Enter or leave Move mode |
|
|
276
|
-
| Up/Down in Move mode | Reorder the selected visible segment |
|
|
277
|
-
| `Alt+Up` / `Alt+Down` | Reorder without entering Move mode |
|
|
278
|
-
| `B` | Add or remove a line break after the selected segment |
|
|
279
|
-
| Configured Back key (Escape by default) | Leave Move mode first, then close the screen |
|
|
280
|
-
| Ctrl+C | Close the screen immediately, including from Move mode |
|
|
281
|
-
|
|
282
|
-
The layout displays the effective Back key and keeps Ctrl+C available when Back is remapped.
|
|
283
|
-
Every successful change saves and applies immediately; closing the screen does not roll it back.
|
|
284
|
-
|
|
285
|
-
Available data segments:
|
|
286
|
-
|
|
287
|
-
```text
|
|
288
|
-
brand provider model thinking cwd branch tools context tokens cache cost time turn
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
Data segments must be unique.
|
|
292
|
-
`line_break` may repeat when data segments separate occurrences, but consecutive breaks are invalid.
|
|
293
|
-
It has no `segmentText` entry.
|
|
294
|
-
The menu cleans up leading, trailing, and newly consecutive breaks after visibility changes.
|
|
295
|
-
Manually authored leading/trailing breaks represent empty rows.
|
|
296
|
-
|
|
297
|
-
```json
|
|
298
|
-
{
|
|
299
|
-
"segments": ["model", "line_break", "cwd", "branch", "context"]
|
|
300
|
-
}
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
An empty `segments` array hides the main powerline while extension statuses can still render.
|
|
304
|
-
The extension intentionally has no variable or format language; use `pi-starship` when you need one.
|
|
305
|
-
|
|
306
|
-
## 🔌 Extension statuses and icons
|
|
307
|
-
|
|
308
|
-
Other extension statuses appear below the main powerline, wrap to terminal width, and are limited to five items.
|
|
309
|
-
Icons resolve in this order:
|
|
310
|
-
|
|
311
|
-
1. Exact configured raw key, such as `goal` or `foo:server`.
|
|
312
|
-
2. Longest configured colon wildcard, such as `foo:*` or `foo:server:*`.
|
|
313
|
-
3. Unambiguous installed-package alias, such as `@vendor/pi-foo`, `pi-foo`, or `foo`.
|
|
314
|
-
4. Leading emoji supplied by the status text.
|
|
315
|
-
5. Built-in icon.
|
|
316
|
-
6. Generic `🔌` fallback.
|
|
317
|
-
|
|
318
|
-
Set an icon to `""` to hide only the icon.
|
|
319
|
-
Wildcards match colon namespaces, not slash-delimited keys.
|
|
320
|
-
Configure slash keys exactly.
|
|
321
|
-
Compatibility fallbacks retain `codex-usage`, `pisync`, and `unknown-error-retry`; an explicit canonical key wins.
|
|
322
|
-
|
|
323
|
-
For interoperable extensions, prefer one aggregated key or a stable coexistence slot:
|
|
324
|
-
|
|
325
|
-
```text
|
|
326
|
-
<extension-id>
|
|
327
|
-
<extension-id>:<stable-slot>
|
|
328
|
-
```
|
|
169
|
+
## 🚧 Limitations
|
|
329
170
|
|
|
330
|
-
|
|
171
|
+
- The footer needs Powerline glyphs and emoji for its intended appearance.
|
|
172
|
+
- Pi does not arbitrate footer ownership, so another footer extension can replace pi-statusline.
|
|
173
|
+
- Custom layouts support ordered segments and line breaks, not a variable or format language.
|
|
331
174
|
|
|
332
175
|
## 🛠️ Troubleshooting
|
|
333
176
|
|
|
334
|
-
- **Powerline symbols look wrong:** use a font with Powerline glyphs
|
|
177
|
+
- **Powerline symbols look wrong:** use a font with Powerline glyphs and emoji support.
|
|
335
178
|
- **The footer reports settings warnings:** run `/statusline status`, then `/statusline settings` to fix invalid recognized fields.
|
|
336
179
|
- **The footer appears to be replaced:** disable `pi-starship` or another extension that also calls Pi's `setFooter()`.
|
|
337
180
|
- **A custom segment disappears on a narrow terminal:** check the responsive priority above or add an explicit `line_break`.
|
|
@@ -340,34 +183,16 @@ Put transient activity in the value and always clear the same complete key.
|
|
|
340
183
|
|
|
341
184
|
```text
|
|
342
185
|
packages/pi-statusline/
|
|
343
|
-
├──
|
|
344
|
-
├──
|
|
345
|
-
│ └──
|
|
346
|
-
├──
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
│ ├── render.ts
|
|
351
|
-
│ ├── directory.ts
|
|
352
|
-
│ ├── usage.ts
|
|
353
|
-
│ ├── powerline.ts
|
|
354
|
-
│ ├── information-profiles.ts
|
|
355
|
-
│ ├── commands.ts
|
|
356
|
-
│ ├── settings.ts
|
|
357
|
-
│ ├── extension-status.ts
|
|
358
|
-
│ ├── git-status.ts
|
|
359
|
-
│ ├── ansi.ts
|
|
360
|
-
│ ├── types.ts
|
|
361
|
-
│ └── presets/
|
|
362
|
-
├── test/
|
|
363
|
-
├── README.md
|
|
364
|
-
├── LICENSE
|
|
365
|
-
├── tsconfig.json
|
|
366
|
-
└── package.json
|
|
186
|
+
├── src/ # Authoritative implementation and helpers
|
|
187
|
+
│ ├── index.ts # Thin Pi entrypoint
|
|
188
|
+
│ └── statusline.ts # Responsive footer lifecycle
|
|
189
|
+
├── dist/ # Generated Jiti runtime
|
|
190
|
+
├── scripts/build-runtime.mjs # Runtime builder
|
|
191
|
+
├── docs/ # Published reference documentation
|
|
192
|
+
└── test/ # Behavior and lifecycle coverage
|
|
367
193
|
```
|
|
368
194
|
|
|
369
|
-
|
|
370
|
-
The package build emits the sole declared Pi entrypoint at `dist/index.ts` without forwarding back into `src`.
|
|
195
|
+
The generated runtime is built from `src/index.ts` and does not import back into `src`.
|
|
371
196
|
|
|
372
197
|
## 🔎 Keywords
|
|
373
198
|
|
|
@@ -30,15 +30,7 @@ var SEGMENT_NAMES = [
|
|
|
30
30
|
"turn"
|
|
31
31
|
];
|
|
32
32
|
var LINE_BREAK_SEGMENT_NAME = "line_break";
|
|
33
|
-
var PALETTE_NAMES = [
|
|
34
|
-
"tokyo-night",
|
|
35
|
-
"ocean",
|
|
36
|
-
"sunset",
|
|
37
|
-
"forest",
|
|
38
|
-
"candy",
|
|
39
|
-
"neon",
|
|
40
|
-
"mono"
|
|
41
|
-
];
|
|
33
|
+
var PALETTE_NAMES = ["tokyo-night", "ocean", "sunset", "forest", "candy", "neon", "mono"];
|
|
42
34
|
var PALETTE_PRESET_NAMES = [...PALETTE_NAMES, "custom"];
|
|
43
35
|
var DENSITIES = ["compact", "cozy"];
|
|
44
36
|
var SEPARATOR_NAMES = ["none", "dot", "bar", "powerline", "round"];
|
|
@@ -77,13 +69,7 @@ function relativeLuminance(hex) {
|
|
|
77
69
|
}
|
|
78
70
|
|
|
79
71
|
// src/presets/candy.ts
|
|
80
|
-
var CANDY_PRESET = createRampPreset([
|
|
81
|
-
"#f5c2e7",
|
|
82
|
-
"#cba6f7",
|
|
83
|
-
"#89b4fa",
|
|
84
|
-
"#745f9a",
|
|
85
|
-
"#403a5c"
|
|
86
|
-
]);
|
|
72
|
+
var CANDY_PRESET = createRampPreset(["#f5c2e7", "#cba6f7", "#89b4fa", "#745f9a", "#403a5c"]);
|
|
87
73
|
|
|
88
74
|
// src/presets/custom.ts
|
|
89
75
|
var CUSTOM_PRESET = {
|
|
@@ -97,49 +83,19 @@ var CUSTOM_PRESET = {
|
|
|
97
83
|
};
|
|
98
84
|
|
|
99
85
|
// src/presets/forest.ts
|
|
100
|
-
var FOREST_PRESET = createRampPreset([
|
|
101
|
-
"#a7c080",
|
|
102
|
-
"#83c092",
|
|
103
|
-
"#5f9f75",
|
|
104
|
-
"#3f6f55",
|
|
105
|
-
"#293f35"
|
|
106
|
-
]);
|
|
86
|
+
var FOREST_PRESET = createRampPreset(["#a7c080", "#83c092", "#5f9f75", "#3f6f55", "#293f35"]);
|
|
107
87
|
|
|
108
88
|
// src/presets/mono.ts
|
|
109
|
-
var MONO_PRESET = createRampPreset([
|
|
110
|
-
"#d4d4d4",
|
|
111
|
-
"#a3a3a3",
|
|
112
|
-
"#686868",
|
|
113
|
-
"#404040",
|
|
114
|
-
"#262626"
|
|
115
|
-
]);
|
|
89
|
+
var MONO_PRESET = createRampPreset(["#d4d4d4", "#a3a3a3", "#686868", "#404040", "#262626"]);
|
|
116
90
|
|
|
117
91
|
// src/presets/neon.ts
|
|
118
|
-
var NEON_PRESET = createRampPreset([
|
|
119
|
-
"#39ff14",
|
|
120
|
-
"#00f5ff",
|
|
121
|
-
"#ff4fd8",
|
|
122
|
-
"#7a2cf3",
|
|
123
|
-
"#29134f"
|
|
124
|
-
]);
|
|
92
|
+
var NEON_PRESET = createRampPreset(["#39ff14", "#00f5ff", "#ff4fd8", "#7a2cf3", "#29134f"]);
|
|
125
93
|
|
|
126
94
|
// src/presets/ocean.ts
|
|
127
|
-
var OCEAN_PRESET = createRampPreset([
|
|
128
|
-
"#7dcfff",
|
|
129
|
-
"#4f9fba",
|
|
130
|
-
"#2d6f88",
|
|
131
|
-
"#23475b",
|
|
132
|
-
"#182b3a"
|
|
133
|
-
]);
|
|
95
|
+
var OCEAN_PRESET = createRampPreset(["#7dcfff", "#4f9fba", "#2d6f88", "#23475b", "#182b3a"]);
|
|
134
96
|
|
|
135
97
|
// src/presets/sunset.ts
|
|
136
|
-
var SUNSET_PRESET = createRampPreset([
|
|
137
|
-
"#ffcf70",
|
|
138
|
-
"#f59e6f",
|
|
139
|
-
"#dc718a",
|
|
140
|
-
"#8f5b78",
|
|
141
|
-
"#493447"
|
|
142
|
-
]);
|
|
98
|
+
var SUNSET_PRESET = createRampPreset(["#ffcf70", "#f59e6f", "#dc718a", "#8f5b78", "#493447"]);
|
|
143
99
|
|
|
144
100
|
// src/presets/tokyo-night.ts
|
|
145
101
|
var TOKYO_NIGHT_PRESET = {
|
|
@@ -185,9 +141,7 @@ function resolvePreset(preset) {
|
|
|
185
141
|
}
|
|
186
142
|
function segmentPaletteForPreset(preset) {
|
|
187
143
|
const blocks = PRESETS[preset].blocks;
|
|
188
|
-
return Object.fromEntries(
|
|
189
|
-
SEGMENT_NAMES.map((name) => [name, { ...blocks[SEGMENT_BLOCKS[name]] }])
|
|
190
|
-
);
|
|
144
|
+
return Object.fromEntries(SEGMENT_NAMES.map((name) => [name, { ...blocks[SEGMENT_BLOCKS[name]] }]));
|
|
191
145
|
}
|
|
192
146
|
|
|
193
147
|
// src/information-profiles.ts
|
|
@@ -195,19 +149,7 @@ var INFORMATION_PROFILE_NAMES = ["minimal", "balanced", "detailed"];
|
|
|
195
149
|
var INFORMATION_PROFILES = {
|
|
196
150
|
minimal: ["model", "cwd", "branch", "context"],
|
|
197
151
|
balanced: ["model", "thinking", "cwd", "branch", "tools", "context", "time"],
|
|
198
|
-
detailed: [
|
|
199
|
-
"provider",
|
|
200
|
-
"model",
|
|
201
|
-
"thinking",
|
|
202
|
-
"cwd",
|
|
203
|
-
"branch",
|
|
204
|
-
"tools",
|
|
205
|
-
"context",
|
|
206
|
-
"tokens",
|
|
207
|
-
"cache",
|
|
208
|
-
"cost",
|
|
209
|
-
"time"
|
|
210
|
-
]
|
|
152
|
+
detailed: ["provider", "model", "thinking", "cwd", "branch", "tools", "context", "tokens", "cache", "cost", "time"]
|
|
211
153
|
};
|
|
212
154
|
function inferInformationProfile(segments) {
|
|
213
155
|
for (const name of INFORMATION_PROFILE_NAMES) {
|
|
@@ -289,11 +231,7 @@ var DEFAULT_STATUSLINE_DOCUMENT_CONFIG = {
|
|
|
289
231
|
segmentText: DEFAULT_STATUSLINE_CONFIG.segmentText,
|
|
290
232
|
extensionStatusIcons: DEFAULT_DOCUMENT_EXTENSION_STATUS_ICONS
|
|
291
233
|
};
|
|
292
|
-
var DEFAULT_STATUSLINE_DOCUMENT = `${JSON.stringify(
|
|
293
|
-
DEFAULT_STATUSLINE_DOCUMENT_CONFIG,
|
|
294
|
-
null,
|
|
295
|
-
" "
|
|
296
|
-
)}
|
|
234
|
+
var DEFAULT_STATUSLINE_DOCUMENT = `${JSON.stringify(DEFAULT_STATUSLINE_DOCUMENT_CONFIG, null, " ")}
|
|
297
235
|
`;
|
|
298
236
|
var pendingSettingsNotice;
|
|
299
237
|
function settingsFilePath(agentDir = getAgentDir()) {
|
|
@@ -344,9 +282,7 @@ function normalizeStatuslineConfig(value) {
|
|
|
344
282
|
}
|
|
345
283
|
if (item === LINE_BREAK_SEGMENT_NAME) {
|
|
346
284
|
if (segments.at(-1) === LINE_BREAK_SEGMENT_NAME) {
|
|
347
|
-
diagnostics.push(
|
|
348
|
-
invalidDiagnostic(path, "Consecutive line_break segments are not allowed")
|
|
349
|
-
);
|
|
285
|
+
diagnostics.push(invalidDiagnostic(path, "Consecutive line_break segments are not allowed"));
|
|
350
286
|
continue;
|
|
351
287
|
}
|
|
352
288
|
segments.push(item);
|
|
@@ -529,10 +465,7 @@ function saveStatuslineSettingsDocument(settingsPath, rawDocument, overrides = {
|
|
|
529
465
|
};
|
|
530
466
|
}
|
|
531
467
|
function removeStatuslineSettingsDocumentIfMatches(settingsPath, expectedRawDocument, expectedIdentity) {
|
|
532
|
-
const quarantinePath = join(
|
|
533
|
-
dirname(settingsPath),
|
|
534
|
-
`.${SETTINGS_FILE_NAME}.${randomUUID()}.rollback`
|
|
535
|
-
);
|
|
468
|
+
const quarantinePath = join(dirname(settingsPath), `.${SETTINGS_FILE_NAME}.${randomUUID()}.rollback`);
|
|
536
469
|
const before = lstatSync(settingsPath);
|
|
537
470
|
if (before.dev !== expectedIdentity.dev || before.ino !== expectedIdentity.ino) {
|
|
538
471
|
throw new Error("Statusline settings changed concurrently; the newer file was preserved");
|
|
@@ -562,10 +495,7 @@ function normalizePalette(value, config, diagnostics) {
|
|
|
562
495
|
if (typeof value === "string") {
|
|
563
496
|
if (!PALETTE_NAMES.includes(value)) {
|
|
564
497
|
diagnostics.push(
|
|
565
|
-
invalidDiagnostic(
|
|
566
|
-
"palette",
|
|
567
|
-
`Expected a palette object or one of: ${PALETTE_NAMES.join(", ")}`
|
|
568
|
-
)
|
|
498
|
+
invalidDiagnostic("palette", `Expected a palette object or one of: ${PALETTE_NAMES.join(", ")}`)
|
|
569
499
|
);
|
|
570
500
|
return;
|
|
571
501
|
}
|
|
@@ -611,9 +541,7 @@ function normalizeModelTruncation(presentation, config, diagnostics) {
|
|
|
611
541
|
const length = presentation.truncationLength;
|
|
612
542
|
if (length !== void 0) {
|
|
613
543
|
if (typeof length !== "number" || !Number.isInteger(length) || length < 0 || length > 1e3) {
|
|
614
|
-
diagnostics.push(
|
|
615
|
-
invalidDiagnostic(`${path}.truncationLength`, "Expected an integer from 0 through 1000")
|
|
616
|
-
);
|
|
544
|
+
diagnostics.push(invalidDiagnostic(`${path}.truncationLength`, "Expected an integer from 0 through 1000"));
|
|
617
545
|
} else config.segmentText.model.truncationLength = length;
|
|
618
546
|
}
|
|
619
547
|
const symbol = presentation.truncationSymbol;
|
|
@@ -624,10 +552,7 @@ function normalizeModelTruncation(presentation, config, diagnostics) {
|
|
|
624
552
|
if (direction !== void 0) {
|
|
625
553
|
if (typeof direction !== "string" || !TRUNCATION_DIRECTIONS.includes(direction)) {
|
|
626
554
|
diagnostics.push(
|
|
627
|
-
invalidDiagnostic(
|
|
628
|
-
`${path}.truncationDirection`,
|
|
629
|
-
`Expected one of: ${TRUNCATION_DIRECTIONS.join(", ")}`
|
|
630
|
-
)
|
|
555
|
+
invalidDiagnostic(`${path}.truncationDirection`, `Expected one of: ${TRUNCATION_DIRECTIONS.join(", ")}`)
|
|
631
556
|
);
|
|
632
557
|
} else {
|
|
633
558
|
config.segmentText.model.truncationDirection = direction;
|
|
@@ -653,17 +578,13 @@ function normalizeEnum(value, field, accepted, config, diagnostics) {
|
|
|
653
578
|
const candidate = value[field];
|
|
654
579
|
if (candidate === void 0) return;
|
|
655
580
|
if (typeof candidate !== "string" || !accepted.includes(candidate)) {
|
|
656
|
-
diagnostics.push(
|
|
657
|
-
invalidDiagnostic(field, `Expected one of: ${accepted.map(String).join(", ")}`)
|
|
658
|
-
);
|
|
581
|
+
diagnostics.push(invalidDiagnostic(field, `Expected one of: ${accepted.map(String).join(", ")}`));
|
|
659
582
|
return;
|
|
660
583
|
}
|
|
661
584
|
config[field] = candidate;
|
|
662
585
|
}
|
|
663
586
|
function cloneSegmentPalette(palette) {
|
|
664
|
-
return Object.fromEntries(
|
|
665
|
-
Object.entries(palette).map(([name, colors]) => [name, { ...colors }])
|
|
666
|
-
);
|
|
587
|
+
return Object.fromEntries(Object.entries(palette).map(([name, colors]) => [name, { ...colors }]));
|
|
667
588
|
}
|
|
668
589
|
function cloneConfig(config) {
|
|
669
590
|
return {
|
|
@@ -765,4 +686,4 @@ export {
|
|
|
765
686
|
removeStatuslineSettingsDocumentIfMatches,
|
|
766
687
|
consumeStatuslineSettingsNotice
|
|
767
688
|
};
|
|
768
|
-
//# sourceMappingURL=chunk-
|
|
689
|
+
//# sourceMappingURL=chunk-J2ZSGEDQ.js.map
|