@henryqw/pi-footer 0.3.0 → 0.4.0
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 -1
- package/extensions/footer.ts +11 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,6 +25,7 @@ pi install npm:@henryqw/pi-footer
|
|
|
25
25
|
pi-packages · clear-field-f8d2 · PR #123 · approved
|
|
26
26
|
↑ 12.4k · ↓ 2.1k · ↺ 84.3% · ⚡ 87.4 t/s · $ 0.127 · ◔ 36.8% gpt-5.6-luna • high
|
|
27
27
|
Codex #1 · 50% · 7d 1d 1h 22m
|
|
28
|
+
● 🐴 ponytail: ⚡ FULL
|
|
28
29
|
```
|
|
29
30
|
|
|
30
31
|
First line shows repository, branch, and pull request status (`pi-pr`) after clickable checkout link. Linked-worktree branches drop generated `worktree/` prefix.
|
|
@@ -33,7 +34,7 @@ Second line shows cumulative input tokens, output tokens, latest cache-hit rate,
|
|
|
33
34
|
|
|
34
35
|
`off` uses the same dim grey as the model name. Active levels use an ANSI-256 gradient: green `minimal`, yellow-green `low`, lime `medium`, yellow `high`, orange `xhigh`, and red `max`. `ultra` renders as a rainbow when the runtime supplies it. Pi 0.84.2 does not yet accept `ultra`, so that footer path remains unreachable until Pi adds it.
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
Third line is reserved for non-empty statuses from `@henryqw` extensions, currently Codex quota. Fourth line renders statuses from all other extensions, including Ponytail and `pi-rewind`. If only external statuses exist, third line stays blank so external output remains on line four. Statuses are sorted by key; producer text, spacing, colors, links, and glyphs are preserved.
|
|
37
38
|
|
|
38
39
|
## Clickable checkout
|
|
39
40
|
|
package/extensions/footer.ts
CHANGED
|
@@ -12,6 +12,7 @@ const THINKING_COLORS = {
|
|
|
12
12
|
xhigh: 208,
|
|
13
13
|
max: 196,
|
|
14
14
|
} as const;
|
|
15
|
+
const HENRY_STATUS_KEYS = new Set(["pi-multi-codex"]);
|
|
15
16
|
|
|
16
17
|
function formatTokens(count: number): string {
|
|
17
18
|
if (count < 1_000) return `${count}`;
|
|
@@ -119,8 +120,14 @@ export default function footerExtension(pi: ExtensionAPI): void {
|
|
|
119
120
|
const statuses = [...extensionStatuses]
|
|
120
121
|
.filter(([key]) => key !== "pi-pr")
|
|
121
122
|
.sort(([a], [b]) => a.localeCompare(b))
|
|
122
|
-
.map(([, text]) => sanitizeStatus(text))
|
|
123
|
-
.filter(Boolean);
|
|
123
|
+
.map(([key, text]) => [key, sanitizeStatus(text)] as const)
|
|
124
|
+
.filter(([, text]) => Boolean(text));
|
|
125
|
+
const henryStatuses = statuses
|
|
126
|
+
.filter(([key]) => HENRY_STATUS_KEYS.has(key))
|
|
127
|
+
.map(([, text]) => text);
|
|
128
|
+
const externalStatuses = statuses
|
|
129
|
+
.filter(([key]) => !HENRY_STATUS_KEYS.has(key))
|
|
130
|
+
.map(([, text]) => text);
|
|
124
131
|
const thinking = String(ctx.thinkingLevel ?? "off");
|
|
125
132
|
const thinkingColor = THINKING_COLORS[thinking as keyof typeof THINKING_COLORS];
|
|
126
133
|
const ellipsis = theme.fg("dim", "…");
|
|
@@ -144,7 +151,8 @@ export default function footerExtension(pi: ExtensionAPI): void {
|
|
|
144
151
|
firstLine,
|
|
145
152
|
align(usage, model, width, ellipsis),
|
|
146
153
|
];
|
|
147
|
-
if (
|
|
154
|
+
if (henryStatuses.length || externalStatuses.length) lines.push(henryStatuses.join(" "));
|
|
155
|
+
if (externalStatuses.length) lines.push(externalStatuses.join(" "));
|
|
148
156
|
return lines.map((line) => truncateToWidth(line, width, ellipsis));
|
|
149
157
|
},
|
|
150
158
|
};
|