pi-bar 0.3.7 → 0.3.9
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 +2 -8
- package/extensions/status-footer.ts +7 -15
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
◈ claude-opus-4.7 ❯ ✦ think:med ❯ ◷ 2.6% / 1.0M ❯ ⓘ Inspecting package structure ❯ ✧ plan:active
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-

|
|
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. It uses a fast authenticated model and stays quiet when none is available.
|
|
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
|
|
|
@@ -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(
|
|
495
|
-
return this.currentText
|
|
483
|
+
text(): string | null {
|
|
484
|
+
return this.currentText;
|
|
496
485
|
}
|
|
497
486
|
|
|
498
487
|
startSession(cwd: string): void {
|
|
@@ -1078,7 +1067,11 @@ export default function (pi: ExtensionAPI) {
|
|
|
1078
1067
|
tldr.recordMessageEnd(ctx, event.message);
|
|
1079
1068
|
refresh();
|
|
1080
1069
|
});
|
|
1070
|
+
pi.on("session_before_tree", async () => {
|
|
1071
|
+
tldr.shutdown();
|
|
1072
|
+
});
|
|
1081
1073
|
pi.on("session_tree", async (_event, ctx) => {
|
|
1074
|
+
tldr.startSession(ctx.cwd);
|
|
1082
1075
|
restoreStatusFilter(ctx);
|
|
1083
1076
|
refresh();
|
|
1084
1077
|
});
|
|
@@ -1093,7 +1086,6 @@ export default function (pi: ExtensionAPI) {
|
|
|
1093
1086
|
const iconPreset = parseIconPreset();
|
|
1094
1087
|
const icons = ICON_PRESETS[iconPreset];
|
|
1095
1088
|
const { warningThreshold, errorThreshold } = parseThresholds();
|
|
1096
|
-
const tldrMaxWidth = parseTldrMaxWidth();
|
|
1097
1089
|
|
|
1098
1090
|
ctx.ui.setFooter((tui, theme, footerData) => {
|
|
1099
1091
|
requestRender = () => tui.requestRender();
|
|
@@ -1121,7 +1113,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1121
1113
|
const contextText = usage
|
|
1122
1114
|
? `${usage.percent !== null ? `${usage.percent.toFixed(1)}%` : "—%"} / ${formatTokens(usage.contextWindow)}`
|
|
1123
1115
|
: "—";
|
|
1124
|
-
const tldrText = tldr.text(
|
|
1116
|
+
const tldrText = tldr.text();
|
|
1125
1117
|
|
|
1126
1118
|
const segmentRenderers: Record<SegmentName, string | null> = {
|
|
1127
1119
|
model: theme.fg(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-bar",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
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.
|
|
54
|
+
"image": "https://cdn.jsdelivr.net/npm/pi-bar@0.3.9/assets/screenshot.png"
|
|
55
55
|
}
|
|
56
56
|
}
|