@erichll/pi-statusline 0.6.0 → 0.6.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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.1 - 2026-10-16
4
+
5
+ ### Changed
6
+
7
+ - Mute the runtime row so it no longer competes with the editor: the duration,
8
+ run metrics, session age and tokens use Pi's muted color, and the running
9
+ (`●`) and done (`✓`) symbols are muted too. Only problems stay colored: a
10
+ failed run (`✗`), `awaiting input`, `no content`, `compacting…`, compaction
11
+ failures and cache below 50%. Cache is no longer green from 80%. Explicit
12
+ `session`/`tokens` segment colors still apply.
13
+ - Show run counts label first, like `avg` and `cache`: `turns 4` and
14
+ `compactions 1` instead of `4 turns` and `1 compaction`.
15
+
3
16
  ## 0.6.0 - 2026-10-16
4
17
 
5
18
  ### Added
package/README.md CHANGED
@@ -6,7 +6,7 @@ activity and live configuration preview. Leaves the editor intact.
6
6
  ```text
7
7
   Example model(high)  󰆼 █░░░░░░░░░ 11.9%  󰉋 pi-packages   main ● *2 ↑2
8
8
  ◐ bash npm test 12s · ✓ read ×5 · ✓ edit ×2
9
- ● 5m 42s · avg 45 tok/s · cache 86% · 3 turns · 1 compaction · 󰥔 2h 6m · 󰊄 49.4k
9
+ ● 5m 42s · avg 45 tok/s · cache 86% · turns 3 · compactions 1 · 󰥔 2h 6m · 󰊄 49.4k
10
10
  ```
11
11
 
12
12
  Rows, top to bottom: the main segments, tool activity for the current run
@@ -144,9 +144,10 @@ or RPM/TPM rate limit.
144
144
  - The bottom row starts with the run status (`●` running, `✓` done, `✗` failed,
145
145
  `⊘` cancelled) and its duration, which spans retries, tools, UI waits and
146
146
  compaction. `avg` is assistant output tokens / total run seconds, **not
147
- inference speed**; `cache` is cache-read / (input + cache-read + cache-write),
148
- green from 80% and warning below 50%. `turns` counts Pi turns, not upstream
149
- requests; `compactions` counts successful session entries.
147
+ inference speed**; `cache` is cache-read / (input + cache-read + cache-write).
148
+ `turns` counts Pi turns, not upstream requests; `compactions` counts
149
+ successful session entries. The row stays muted; only a failed run, waits,
150
+ compaction problems and cache below 50% are colored.
150
151
  - The run duration (to the second) covers one run, from your message until the
151
152
  agent settles, across all its turns. The session age (`󰥔 2h 6m`, to the
152
153
  minute) counts from the session header's creation time: it survives reloads
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erichll/pi-statusline",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Configurable Pi statusline with live preview, Git and session usage",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/render.ts CHANGED
@@ -180,12 +180,12 @@ function setQuota(part: Part, data: StatuslineSnapshot, config: StatuslineConfig
180
180
  }).join(paint(quotaSeparator(ascii), "dim"));
181
181
  };
182
182
  }
183
- /** Session-wide values for the runtime row: dim icon, plain value. */
183
+ /** Session-wide values for the runtime row: dim icon, muted value. */
184
184
  function sessionText(segment: SegmentConfig, data: StatuslineSnapshot, config: StatuslineConfig, theme: RenderTheme): string | undefined {
185
185
  const icon = cleanText(segment.icon ?? ICONS[config.icons][segment.id] ?? "");
186
186
  const value = segmentText(segment.id, data, config);
187
187
  if (value === undefined) return undefined;
188
- const styled = theme.style(value, { fg: color(segment.color ?? "text", theme) });
188
+ const styled = theme.style(value, { fg: color(segment.color ?? "muted", theme) });
189
189
  return icon ? `${theme.style(icon, { fg: color(segment.iconColor ?? "dim", theme) })} ${styled}` : styled;
190
190
  }
191
191
 
@@ -18,7 +18,6 @@ function short(ms: number): string {
18
18
  const total = Math.floor(ms / 1000);
19
19
  return total < 60 ? `${total}s` : `${Math.floor(total / 60)}m${total % 60}s`;
20
20
  }
21
- function plural(count: number, word: string): string { return `${word}${count === 1 ? "" : "s"}`; }
22
21
 
23
22
  type Color = "text" | "muted" | "dim" | "accent" | "success" | "warning" | "error";
24
23
  type Span = [text: string, color: Color];
@@ -39,8 +38,8 @@ function fit(parts: Part[], dropOrder: string[], width: number, separator: strin
39
38
  }
40
39
 
41
40
  const STATUS: Partial<Record<RuntimeSnapshot["status"], { icon: string; ascii: string; color: Color }>> = {
42
- Running: { icon: "●", ascii: "*", color: "accent" },
43
- Done: { icon: "✓", ascii: "ok", color: "success" },
41
+ Running: { icon: "●", ascii: "*", color: "muted" },
42
+ Done: { icon: "✓", ascii: "ok", color: "muted" },
44
43
  Failed: { icon: "✗", ascii: "x", color: "error" },
45
44
  Cancelled: { icon: "⊘", ascii: "-", color: "muted" },
46
45
  };
@@ -56,17 +55,21 @@ export interface RuntimeExtras {
56
55
  elapsedStatus?: string;
57
56
  }
58
57
 
59
- /** The bottom row: run status and duration, run metrics, then session age, tokens and extension statuses. */
58
+ /**
59
+ * The bottom row: run status and duration, run metrics, then session age, tokens and extension statuses.
60
+ * It stays muted so it does not compete with the editor; only problems (failure, waits, low cache) are colored.
61
+ */
60
62
  export function renderRuntime(width: number, data: StatuslineSnapshot, config: StatuslineConfig, theme: RenderTheme, extras: RuntimeExtras = {}): string | undefined {
61
63
  const parts: Part[] = [];
62
64
  const runtime = data.runtime, compact = data.compaction;
63
65
  const enabled = config.runtime.enabled, ascii = config.icons === "ascii";
64
66
  const add = (id: string, ...spans: Span[]) => parts.push({ id, spans });
65
- const count = (id: string, value: number, word: string) => add(id, [String(value), "text"], [` ${plural(value, word)}`, "dim"]);
67
+ // Label first, like `avg` and `cache`: `turns 4`, `compactions 1`.
68
+ const count = (id: "turns" | "compactions", value: number) => add(id, [`${id} `, "dim"], [String(value), "muted"]);
66
69
  const duration = extras.elapsedStatus?.replace(/^Elapsed /, "") ?? (runtime?.runId ? elapsed(runtime.elapsedMs) : undefined);
67
70
  const state = enabled && config.runtime.status && runtime?.runId ? STATUS[runtime.status] : undefined;
68
- if (state && duration) add("elapsed", [ascii ? state.ascii : state.icon, state.color], [` ${duration}`, "text"]);
69
- else if (extras.elapsedStatus) add("elapsed", ["elapsed ", "dim"], [duration!, "text"]);
71
+ if (state && duration) add("elapsed", [ascii ? state.ascii : state.icon, state.color], [` ${duration}`, "muted"]);
72
+ else if (extras.elapsedStatus) add("elapsed", ["elapsed ", "dim"], [duration!, "muted"]);
70
73
  const compacting = enabled && !!compact?.active;
71
74
  if (compacting) {
72
75
  add("activity", [`${ascii ? "compacting..." : "compacting…"} ${seconds(compact!.elapsedMs)}`, "warning"]);
@@ -76,14 +79,14 @@ export function renderRuntime(width: number, data: StatuslineSnapshot, config: S
76
79
  else if (config.runtime.noContent && runtime.noContentMs !== null && runtime.noContentMs >= config.runtime.noContentSeconds * 1000) {
77
80
  add("activity", [`no content ${seconds(runtime.noContentMs)}`, "warning"]);
78
81
  }
79
- if (config.runtime.avg && runtime.avg !== null) add("avg", ["avg ", "dim"], [`${Math.round(runtime.avg)} tok/s`, "text"]);
82
+ if (config.runtime.avg && runtime.avg !== null) add("avg", ["avg ", "dim"], [`${Math.round(runtime.avg)} tok/s`, "muted"]);
80
83
  if (config.runtime.cache && runtime.cache !== null) {
81
84
  const percent = Math.round(runtime.cache * 100);
82
- add("cache", ["cache ", "dim"], [`${percent}%`, percent >= 80 ? "success" : percent >= 50 ? "text" : "warning"]);
85
+ add("cache", ["cache ", "dim"], [`${percent}%`, percent < 50 ? "warning" : "muted"]);
83
86
  }
84
- if (config.runtime.counts && runtime.runId) count("turns", runtime.turns, "turn");
87
+ if (config.runtime.counts && runtime.runId) count("turns", runtime.turns);
85
88
  }
86
- if (enabled && config.runtime.counts && compact && compact.count > 0) count("compactions", compact.count, "compaction");
89
+ if (enabled && config.runtime.counts && compact && compact.count > 0) count("compactions", compact.count);
87
90
  if (extras.session) parts.push({ id: "session", spans: [], styled: extras.session });
88
91
  if (extras.tokens) parts.push({ id: "tokens", spans: [], styled: extras.tokens });
89
92
  if (extras.statuses && !compacting) parts.push({ id: "statuses", spans: [], styled: extras.statuses });