pi-bar 0.3.8 → 0.3.10

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
@@ -6,10 +6,10 @@
6
6
  **Never accidentally run Opus on a typo again.** pi-bar puts the active model, thinking level, context usage, live TLDR, and extension statuses in pi's footer so you catch wrong-model / wrong-reasoning / context-pressure problems before they cost you.
7
7
 
8
8
  ```text
9
- ◈ claude-opus-4.7 ❯ ✦ think:med ❯ ◷ 2.6% / 1.0M ❯ ⓘ Inspecting package structure ❯ ✧ plan:active
9
+ ◈ claude-opus-4.7 ❯ ✦ think:med ❯ ◷ 2.6% / 1.0M ❯ Inspecting package structure ❯ ✧ plan:active
10
10
  ```
11
11
 
12
- ![pi-bar screenshot, three rows showing green, yellow, and red context usage](https://cdn.jsdelivr.net/npm/pi-bar@0.3.8/assets/screenshot.png)
12
+ ![pi-bar screenshot, three rows showing green, yellow, and red context usage](https://cdn.jsdelivr.net/npm/pi-bar@0.3.10/assets/screenshot.png)
13
13
 
14
14
  ## Why use it?
15
15
 
@@ -48,13 +48,7 @@ Allowed segments are `model`, `thinking`, `context`, `tldr`, and `extensions`. T
48
48
 
49
49
  ### Configure live TLDR
50
50
 
51
- pi-bar generates live footer TLDRs from recent prompt, assistant, tool, and result activity. TLDR state resets when you navigate the session tree so stale summaries do not follow you across branches. It uses a fast authenticated model and stays quiet when none is available. Limit segment width with:
52
-
53
- ```bash
54
- PI_BAR_TLDR_MAX_WIDTH=48 pi
55
- ```
56
-
57
- Default is `64`. Set `PI_BAR_SHOW` without `tldr` to hide it.
51
+ pi-bar generates live footer TLDRs from recent prompt, assistant, tool, and result activity. TLDR state resets when you navigate the session tree so stale summaries do not follow you across branches. It uses a fast authenticated model and stays quiet when none is available. Set `PI_BAR_SHOW` without `tldr` to hide it.
58
52
 
59
53
  By default, pi-bar uses the first authenticated fast model from its fallback list. Override with:
60
54
 
@@ -95,10 +89,10 @@ PI_BAR_ICONS=nerdfont pi
95
89
 
96
90
  Supported presets:
97
91
 
98
- - `unicode` — default, e.g. `◈ gpt-5.5 ❯ ✦ think:medium ❯ ◷ 42.7% / 272k ❯ ⓘ Reading files ❯ ✧ plan:active`
99
- - `plain` — maximum compatibility, e.g. `model:gpt-5.5 | think:medium | ctx:42.7% / 272k | tldr:Reading files | ext:plan:active`
100
- - `emoji` — colorful emoji markers, e.g. `🤖 gpt-5.5 › ✨ think:medium › 🧭 42.7% / 272k › 📝 Reading files › 🧩 plan:active`
101
- - `nerdfont` — icon-font glyphs for terminals configured with a Nerd Font, e.g. `󰚩 gpt-5.5  󰧑 think:medium  󰍛 42.7% / 272k  󰦨 Reading files  󰐱 plan:active`
92
+ - `unicode` — default, e.g. `◈ gpt-5.5 ❯ ✦ think:medium ❯ ◷ 42.7% / 272k ❯ Reading files ❯ ✧ plan:active`
93
+ - `plain` — maximum compatibility, e.g. `model:gpt-5.5 | think:medium | ctx:42.7% / 272k | Reading files | ext:plan:active`
94
+ - `emoji` — colorful emoji markers, e.g. `🤖 gpt-5.5 › ✨ think:medium › 🧭 42.7% / 272k › Reading files › 🧩 plan:active`
95
+ - `nerdfont` — icon-font glyphs for terminals configured with a Nerd Font, e.g. `󰚩 gpt-5.5  󰧑 think:medium  󰍛 42.7% / 272k  Reading files  󰐱 plan:active`
102
96
 
103
97
  ## Compatibility
104
98
 
@@ -14,7 +14,6 @@
14
14
  * PI_BAR_SHOW=model,thinking,context,tldr,extensions
15
15
  * PI_BAR_THRESHOLDS=70,90
16
16
  * PI_BAR_ICONS=unicode|plain|emoji|nerdfont
17
- * PI_BAR_TLDR_MAX_WIDTH=64
18
17
  */
19
18
 
20
19
  import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
@@ -75,7 +74,6 @@ type FastModelAuth = {
75
74
  };
76
75
 
77
76
  const STATUS_FILTER_ENTRY_TYPE = "pi-bar-status-filter";
78
- const DEFAULT_TLDR_MAX_WIDTH = 64;
79
77
  const SETTINGS_TLDR_KEY = "tldr";
80
78
  const SETTINGS_BAR_KEY = "bar";
81
79
  const MAX_ACTIVITY_TEXT_CHARS = 1_500;
@@ -242,15 +240,6 @@ function parseIconPreset(): IconPreset {
242
240
  return "unicode";
243
241
  }
244
242
 
245
- function parseTldrMaxWidth(): number {
246
- const raw = process.env.PI_BAR_TLDR_MAX_WIDTH;
247
- if (!raw) return DEFAULT_TLDR_MAX_WIDTH;
248
-
249
- const value = Number.parseInt(raw, 10);
250
- if (Number.isFinite(value) && value >= 10 && value <= 500) return value;
251
- return DEFAULT_TLDR_MAX_WIDTH;
252
- }
253
-
254
243
  function parseTldrModelSpec(value: string): TldrModelPreference | undefined {
255
244
  const trimmed = value.trim();
256
245
  if (!trimmed || trimmed === "auto") return undefined;
@@ -491,8 +480,8 @@ class FooterTldrEngine {
491
480
 
492
481
  constructor(private readonly requestRender: () => void) {}
493
482
 
494
- text(maxWidth: number): string | null {
495
- return this.currentText ? truncateToWidth(this.currentText, maxWidth) : null;
483
+ text(): string | null {
484
+ return this.currentText;
496
485
  }
497
486
 
498
487
  startSession(cwd: string): void {
@@ -1097,7 +1086,6 @@ export default function (pi: ExtensionAPI) {
1097
1086
  const iconPreset = parseIconPreset();
1098
1087
  const icons = ICON_PRESETS[iconPreset];
1099
1088
  const { warningThreshold, errorThreshold } = parseThresholds();
1100
- const tldrMaxWidth = parseTldrMaxWidth();
1101
1089
 
1102
1090
  ctx.ui.setFooter((tui, theme, footerData) => {
1103
1091
  requestRender = () => tui.requestRender();
@@ -1125,7 +1113,7 @@ export default function (pi: ExtensionAPI) {
1125
1113
  const contextText = usage
1126
1114
  ? `${usage.percent !== null ? `${usage.percent.toFixed(1)}%` : "—%"} / ${formatTokens(usage.contextWindow)}`
1127
1115
  : "—";
1128
- const tldrText = tldr.text(tldrMaxWidth);
1116
+ const tldrText = tldr.text();
1129
1117
 
1130
1118
  const segmentRenderers: Record<SegmentName, string | null> = {
1131
1119
  model: theme.fg(
@@ -1140,9 +1128,7 @@ export default function (pi: ExtensionAPI) {
1140
1128
  contextSegmentColor,
1141
1129
  prefixed(icons.context, contextText, iconPreset),
1142
1130
  ),
1143
- tldr: tldrText
1144
- ? theme.fg("muted", prefixed(icons.tldr, tldrText, iconPreset))
1145
- : null,
1131
+ tldr: tldrText ? theme.fg("muted", tldrText) : null,
1146
1132
  extensions: extensionStatuses
1147
1133
  ? theme.fg(
1148
1134
  "muted",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-bar",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "description": "Never accidentally run Opus on a typo. Pi footer/statusline showing active model, thinking level, context usage, live TLDR, and extension statuses.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -51,6 +51,6 @@
51
51
  "extensions": [
52
52
  "./extensions/status-footer.ts"
53
53
  ],
54
- "image": "https://cdn.jsdelivr.net/npm/pi-bar@0.3.8/assets/screenshot.png"
54
+ "image": "https://cdn.jsdelivr.net/npm/pi-bar@0.3.10/assets/screenshot.png"
55
55
  }
56
56
  }