@fyeeme/pi-statusline 1.2.2 → 1.2.3

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/index.ts +27 -1
  3. package/package.json +7 -7
package/CHANGELOG.md CHANGED
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ## [1.2.3] - 2026-09-09
11
+
12
+ ### Added
13
+
14
+ - Footer subscribes to `ui_prompt_start`/`ui_prompt_end`: the elapsed timer freezes while a blocking dialog (ask_user, permission gates, ...) is open and the footer shows "waiting for user" instead of running time.
15
+
16
+ ### Changed
17
+
18
+ - Peer/dev dependencies bumped to pi 0.84.4 (the `ui_prompt` events require >= 0.84.4).
19
+
8
20
  ## [1.2.2] - 2026-08-23
9
21
 
10
22
  ### Changed
package/index.ts CHANGED
@@ -46,6 +46,11 @@ let lastModel: ExtensionContext["model"] = undefined;
46
46
  let agentRunning = false;
47
47
  let lastElapsedSec = 0;
48
48
  let lastTps = 0;
49
+ /** True while a blocking ctx.ui dialog (select/confirm/input/editor/custom)
50
+ * span is open (ui_prompt_start → ui_prompt_end). Elapsed time freezes and
51
+ * the footer says "waiting for user" instead of showing a running timer —
52
+ * the doc-intended status-integration use of the ui_prompt events. */
53
+ let waitingForUser = false;
49
54
 
50
55
  const tokenCalculator = new SessionTokenUsageCalculator(() => deepSeekPricing.getCurrencyOverride());
51
56
 
@@ -90,6 +95,25 @@ export default function (pi: ExtensionAPI) {
90
95
  }
91
96
  });
92
97
 
98
+ // ---- Blocking-dialog spans: freeze the elapsed timer + surface the wait ----
99
+ pi.on("ui_prompt_start", () => {
100
+ // Nested/overlapping prompts coalesce into one span (doc), so these are
101
+ // balanced set/reset pairs. Freeze first so user think-time never counts
102
+ // as agent work; resume on the matching end.
103
+ if (agentRunning && agentStartMs !== null) {
104
+ lastElapsedSec += (Date.now() - agentStartMs) / 1000;
105
+ agentStartMs = null;
106
+ }
107
+ waitingForUser = true;
108
+ });
109
+
110
+ pi.on("ui_prompt_end", () => {
111
+ if (agentRunning && agentStartMs === null) {
112
+ agentStartMs = Date.now();
113
+ }
114
+ waitingForUser = false;
115
+ });
116
+
93
117
  // ---- /status-debug ----
94
118
  pi.registerCommand("status-debug", {
95
119
  description: "Dump session stats to /tmp/pi-status-debug.log + console.error",
@@ -237,8 +261,10 @@ export default function (pi: ExtensionAPI) {
237
261
  }
238
262
 
239
263
  // Line 1: tokens + cost + provider usage + context + elapsed + tps + mcp
264
+ let statLine = dim(buildStatLine(stats, cu, providerResult, providers, getElapsedSec, lastTps));
265
+ if (waitingForUser) statLine += theme.fg("warning", " · waiting for user");
240
266
  lines.push(truncateToWidth(
241
- dim(buildStatLine(stats, cu, providerResult, providers, getElapsedSec, lastTps)),
267
+ statLine,
242
268
  width,
243
269
  dim("..."),
244
270
  ));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fyeeme/pi-statusline",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "Rich custom status bar for pi with token usage, cost, DeepSeek balance, context window, and timing.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -48,14 +48,14 @@
48
48
  "typecheck": "tsc"
49
49
  },
50
50
  "peerDependencies": {
51
- "@earendil-works/pi-coding-agent": ">=0.84.1",
52
- "@earendil-works/pi-ai": ">=0.84.1",
53
- "@earendil-works/pi-tui": ">=0.84.1"
51
+ "@earendil-works/pi-coding-agent": ">=0.84.4",
52
+ "@earendil-works/pi-ai": ">=0.84.4",
53
+ "@earendil-works/pi-tui": ">=0.84.4"
54
54
  },
55
55
  "devDependencies": {
56
- "@earendil-works/pi-coding-agent": "0.84.1",
57
- "@earendil-works/pi-ai": "0.84.1",
58
- "@earendil-works/pi-tui": "0.84.1",
56
+ "@earendil-works/pi-coding-agent": "0.84.4",
57
+ "@earendil-works/pi-ai": "0.84.4",
58
+ "@earendil-works/pi-tui": "0.84.4",
59
59
  "@types/node": "22.19.19",
60
60
  "typescript": "5.9.3"
61
61
  }