pi-bar 0.3.33 → 0.3.34
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 +6 -6
- package/extensions/status-footer.ts +73 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
claude-opus-4.7 ❯ think:med ❯ 2.6% / 1.0M ❯ Reviewing package structure ❯ plan:active
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-

|
|
13
|
+

|
|
14
|
+

|
|
15
15
|
|
|
16
16
|
## Why use it?
|
|
17
17
|
|
|
@@ -37,13 +37,13 @@ If pi is already running after install, reload resources:
|
|
|
37
37
|
|
|
38
38
|
## Customization
|
|
39
39
|
|
|
40
|
-
pi-bar works out of the box. Run `/bar` inside pi to choose which footer segments are shown:
|
|
40
|
+
pi-bar works out of the box. Run `/bar` inside pi to choose which footer segments and extension statuses are shown:
|
|
41
41
|
|
|
42
42
|
```text
|
|
43
43
|
/bar
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
Toggle `Model`, `Thinking level`, `Context usage`, `Progress update`, and `Extension statuses` between `shown` and `hidden`. You can also use commands:
|
|
46
|
+
Toggle `Model`, `Thinking level`, `Context usage`, `Progress update`, and `Extension statuses` between `shown` and `hidden`. If other extensions have published status badges, `/bar` also shows fine-grained `Status: <key>` rows plus a `New extension statuses` default. You can also use commands:
|
|
47
47
|
|
|
48
48
|
```text
|
|
49
49
|
/bar segments list
|
|
@@ -75,7 +75,7 @@ Or in pi settings: `bar.progressModel`. Otherwise pi-bar picks a fast model you
|
|
|
75
75
|
|
|
76
76
|
### Configure extension statuses
|
|
77
77
|
|
|
78
|
-
Other pi extensions can publish small status badges. Pi-bar collects them into the `extensions` segment. Run `/bar status` inside pi to pick which ones to show:
|
|
78
|
+
Other pi extensions can publish small status badges. Pi-bar collects them into the `extensions` segment. Run `/bar` or `/bar status` inside pi to pick which ones to show:
|
|
79
79
|
|
|
80
80
|
```text
|
|
81
81
|
/bar status
|
|
@@ -1679,33 +1679,83 @@ export default function (pi: ExtensionAPI) {
|
|
|
1679
1679
|
};
|
|
1680
1680
|
const openSegmentConfigurator = async (ctx: ExtensionContext) => {
|
|
1681
1681
|
await ctx.ui.custom((tui, theme, _kb, done) => {
|
|
1682
|
+
const knownStatusKeys = getKnownStatusKeys(statusFilter, seenStatusKeys);
|
|
1682
1683
|
const segmentVisibility = new Map(
|
|
1683
1684
|
ALL_SEGMENTS.map(
|
|
1684
1685
|
(segment): [SegmentName, boolean] => [segment, visibleSegments.includes(segment)],
|
|
1685
1686
|
),
|
|
1686
1687
|
);
|
|
1687
|
-
|
|
1688
|
+
let futureShown = statusFilter.mode === "all";
|
|
1689
|
+
const statusVisibility = new Map(
|
|
1690
|
+
knownStatusKeys.map((key): [string, boolean] => [
|
|
1691
|
+
key,
|
|
1692
|
+
shouldShowStatus(key, statusFilter),
|
|
1693
|
+
]),
|
|
1694
|
+
);
|
|
1695
|
+
const persistSegmentsFromVisibility = () => {
|
|
1688
1696
|
setVisibleSegments(
|
|
1689
1697
|
ALL_SEGMENTS.filter((segment) => segmentVisibility.get(segment)),
|
|
1690
1698
|
ctx,
|
|
1691
1699
|
);
|
|
1692
1700
|
};
|
|
1701
|
+
const persistStatusesFromVisibility = () => {
|
|
1702
|
+
if (futureShown) {
|
|
1703
|
+
statusFilter = {
|
|
1704
|
+
mode: "all",
|
|
1705
|
+
hidden: new Set(
|
|
1706
|
+
knownStatusKeys.filter((key) => !statusVisibility.get(key)),
|
|
1707
|
+
),
|
|
1708
|
+
};
|
|
1709
|
+
} else {
|
|
1710
|
+
statusFilter = {
|
|
1711
|
+
mode: "only",
|
|
1712
|
+
shown: new Set(
|
|
1713
|
+
knownStatusKeys.filter((key) => statusVisibility.get(key)),
|
|
1714
|
+
),
|
|
1715
|
+
};
|
|
1716
|
+
}
|
|
1717
|
+
persistStatusFilter();
|
|
1718
|
+
};
|
|
1693
1719
|
|
|
1694
|
-
const
|
|
1695
|
-
id: segment
|
|
1720
|
+
const segmentItems: SettingItem[] = ALL_SEGMENTS.map((segment): SettingItem => ({
|
|
1721
|
+
id: `segment:${segment}`,
|
|
1696
1722
|
label: SEGMENT_LABELS[segment],
|
|
1697
1723
|
description: "Footer segment visibility",
|
|
1698
1724
|
currentValue: segmentVisibility.get(segment) ? "shown" : "hidden",
|
|
1699
1725
|
values: ["shown", "hidden"],
|
|
1700
1726
|
}));
|
|
1727
|
+
const statusItems: SettingItem[] = knownStatusKeys.length > 0
|
|
1728
|
+
? [
|
|
1729
|
+
{
|
|
1730
|
+
id: "status:__future",
|
|
1731
|
+
label: "New extension statuses",
|
|
1732
|
+
description: "Default visibility for status keys discovered later",
|
|
1733
|
+
currentValue: futureShown ? "shown" : "hidden",
|
|
1734
|
+
values: ["shown", "hidden"],
|
|
1735
|
+
},
|
|
1736
|
+
...knownStatusKeys.map((key): SettingItem => ({
|
|
1737
|
+
id: `status:${key}`,
|
|
1738
|
+
label: `Status: ${key}`,
|
|
1739
|
+
description: "Extension status visibility",
|
|
1740
|
+
currentValue: statusVisibility.get(key) ? "shown" : "hidden",
|
|
1741
|
+
values: ["shown", "hidden"],
|
|
1742
|
+
})),
|
|
1743
|
+
]
|
|
1744
|
+
: [];
|
|
1745
|
+
const items: SettingItem[] = [...segmentItems, ...statusItems];
|
|
1701
1746
|
|
|
1702
1747
|
const container = new Container();
|
|
1703
1748
|
container.addChild(
|
|
1704
1749
|
new (class {
|
|
1705
1750
|
render(_width: number) {
|
|
1706
1751
|
return [
|
|
1707
|
-
theme.fg("accent", theme.bold("pi-bar
|
|
1708
|
-
theme.fg(
|
|
1752
|
+
theme.fg("accent", theme.bold("pi-bar visibility")),
|
|
1753
|
+
theme.fg(
|
|
1754
|
+
"dim",
|
|
1755
|
+
knownStatusKeys.length > 0
|
|
1756
|
+
? "Footer segments + extension statuses · Enter/Space toggles · Esc closes"
|
|
1757
|
+
: "Footer segments · no extension statuses seen yet · Esc closes",
|
|
1758
|
+
),
|
|
1709
1759
|
"",
|
|
1710
1760
|
];
|
|
1711
1761
|
}
|
|
@@ -1715,12 +1765,26 @@ export default function (pi: ExtensionAPI) {
|
|
|
1715
1765
|
|
|
1716
1766
|
const settingsList = new SettingsList(
|
|
1717
1767
|
items,
|
|
1718
|
-
Math.min(items.length + 2,
|
|
1768
|
+
Math.min(items.length + 2, 18),
|
|
1719
1769
|
getSettingsListTheme(),
|
|
1720
1770
|
(id, newValue) => {
|
|
1721
|
-
if (
|
|
1722
|
-
|
|
1723
|
-
|
|
1771
|
+
if (id.startsWith("segment:")) {
|
|
1772
|
+
const segment = id.slice("segment:".length);
|
|
1773
|
+
if (!isSegmentName(segment)) return;
|
|
1774
|
+
segmentVisibility.set(segment, newValue === "shown");
|
|
1775
|
+
persistSegmentsFromVisibility();
|
|
1776
|
+
return;
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
if (id === "status:__future") {
|
|
1780
|
+
futureShown = newValue === "shown";
|
|
1781
|
+
persistStatusesFromVisibility();
|
|
1782
|
+
return;
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
if (id.startsWith("status:")) {
|
|
1786
|
+
statusVisibility.set(id.slice("status:".length), newValue === "shown");
|
|
1787
|
+
persistStatusesFromVisibility();
|
|
1724
1788
|
}
|
|
1725
1789
|
},
|
|
1726
1790
|
() => done(undefined),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-bar",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.34",
|
|
4
4
|
"description": "Pi footer/statusline showing active model, thinking level, context pressure, live progress updates, 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.34/assets/screenshot-yellow.png"
|
|
55
55
|
}
|
|
56
56
|
}
|