@pi-unipi/footer 2.17.2 → 2.19.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/footer",
3
- "version": "2.17.2",
3
+ "version": "2.19.0",
4
4
  "description": "Persistent status bar for Unipi — subscribes to UNIPI_EVENTS and renders key stats from all unipi packages",
5
5
  "type": "module",
6
6
  "main": "index.ts",
@@ -32,8 +32,8 @@
32
32
  "access": "public"
33
33
  },
34
34
  "dependencies": {
35
- "@pi-unipi/core": "2.17.0",
36
- "@pi-unipi/background-tasks": "2.17.0"
35
+ "@pi-unipi/core": "2.19.0",
36
+ "@pi-unipi/background-tasks": "2.19.0"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@earendil-works/pi-coding-agent": "^0.84.0",
@@ -40,7 +40,7 @@ export interface GlanceStatus {
40
40
  * `Fusion · <lead> <effort> ◆ <sidekick>` — lead lit, sidekick muted —
41
41
  * and the plain thinking slot is suppressed (efforts are inline).
42
42
  */
43
- fusion: { leadName: string; leadEffort: string; sidekickName: string; sidekickEffort: string; savedUsd?: number } | null;
43
+ fusion: { leadName: string; leadEffort: string; sidekickName: string; sidekickEffort: string; savedUsd?: number; busy?: boolean; leadToolCalls?: number; sidekickToolCalls?: number } | null;
44
44
  }
45
45
 
46
46
  const BORDER = {
@@ -57,6 +57,26 @@ const RESET = "\x1b[0m";
57
57
  const LEAD_FG = "\x1b[1m\x1b[38;2;181;189;104m"; // bold accent (matches success tint)
58
58
  const DIM_FG = "\x1b[38;2;120;124;134m"; // muted grey
59
59
 
60
+ type FusionDisplay = NonNullable<GlanceStatus["fusion"]>;
61
+
62
+ export function renderFusionStatus(fusion: FusionDisplay): string {
63
+ const lead = `${fusion.leadName}${fusion.leadEffort ? ` ${fusion.leadEffort}` : ""}`;
64
+ const side = `${fusion.sidekickName}${fusion.sidekickEffort ? ` ${fusion.sidekickEffort}` : ""}`;
65
+ const busy = fusion.busy === true;
66
+ const leadCalls = fusion.leadToolCalls ?? 0;
67
+ const sidekickCalls = fusion.sidekickToolCalls ?? 0;
68
+ const totalCalls = leadCalls + sidekickCalls;
69
+ const saved = fusion.savedUsd !== undefined && fusion.savedUsd > 0.005
70
+ ? ` · saved $${fusion.savedUsd.toFixed(2)}`
71
+ : "";
72
+ const split = totalCalls > 0 ? ` · ${String(sidekickCalls)}/${String(totalCalls)} calls` : "";
73
+ const core = busy
74
+ ? `${DIM_FG}Fusion · ${lead}${RESET} ${LEAD_FG}◆ ${side} · working${RESET}`
75
+ : `${LEAD_FG}Fusion · ${lead}${RESET} ${DIM_FG}◆ ${side}${RESET}`;
76
+ const tail = `${split}${saved}`;
77
+ return tail ? `${core}${DIM_FG}${tail}${RESET}` : core;
78
+ }
79
+
60
80
  /**
61
81
  * Every invisible sequence pi-tui embeds in editor lines: CSI SGR, OSC 133
62
82
  * prompt-zone markers (`\x1b]133;A\x07`), and CURSOR_MARKER (`\x1b_pi:c\x07`,
@@ -226,13 +246,7 @@ export class GlanceEditor extends CustomEditor {
226
246
  const winLabel = st.contextWindow > 0 ? `/${fmtTokens(st.contextWindow)}` : "";
227
247
  rightParts.push(`${pctLabel}${winLabel}`);
228
248
  if (st.fusion) {
229
- // The working lead is lit; the sidekick stays muted. Efforts are
230
- // inline so the separate thinking slot is dropped.
231
- const lead = `${st.fusion.leadName}${st.fusion.leadEffort ? ` ${st.fusion.leadEffort}` : ""}`;
232
- const side = `${st.fusion.sidekickName}${st.fusion.sidekickEffort ? ` ${st.fusion.sidekickEffort}` : ""}`;
233
- rightParts.push(
234
- `${LEAD_FG}Fusion · ${lead}${RESET} ${DIM_FG}◆ ${side}${st.fusion.savedUsd !== undefined && st.fusion.savedUsd > 0.005 ? ` · saved $${st.fusion.savedUsd.toFixed(2)}` : ""}${RESET}`,
235
- );
249
+ rightParts.push(renderFusionStatus(st.fusion));
236
250
  } else {
237
251
  if (st.modelName) rightParts.push(st.modelName);
238
252
  if (st.thinkingLevel && st.thinkingLevel !== "off") {