@reedchan/statusline 1.10.0 → 1.10.1

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 CHANGED
@@ -7,7 +7,7 @@ English | [中文](README_CN.md)
7
7
  Replaces pi's footer with a labelled two-row one. Every value carries a word, so nothing has to be
8
8
  decoded from a symbol or remembered from a legend.
9
9
 
10
- ```
10
+ ```text
11
11
  Context █████████▍░░░░░░░░░░ 47% 471k / 1.0M Input 194k · Output 89k | Cache hit 99.9% | Cost $0.229 · Today $1.63
12
12
  ~/.pi (master) deepseek-flash · Effort high | TTFT 482ms · Avg TTFT 612ms | Last 729 tok/s · Avg 512 tok/s
13
13
  LSP Active: typescript
package/README_CN.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  替换 pi 的 footer,改成带文字标签的两行。每个值都带一个词,不需要靠符号猜、也不需要记图例。
8
8
 
9
- ```
9
+ ```text
10
10
  Context █████████▍░░░░░░░░░░ 47% 471k / 1.0M Input 194k · Output 89k | Cache hit 99.9% | Cost $0.229 · Today $1.63
11
11
  ~/.pi (master) deepseek-flash · Effort high | TTFT 482ms · Avg TTFT 612ms | Last 729 tok/s · Avg 512 tok/s
12
12
  LSP Active: typescript
@@ -706,6 +706,10 @@ export default function (pi: ExtensionAPI) {
706
706
  ttftCount += 1
707
707
  persist(ctx.sessionManager.getSessionFile() ?? null)
708
708
  publish((tokens / decodeMs) * 1000, output > 0, measured)
709
+ } else if (measured !== null && decodeMs > 0) {
710
+ // The frozen Last must be this message's whole-message rate, never the last live
711
+ // sliding-window sample: a buffered burst of chunks mid-stream reads triple.
712
+ publish((tokens / decodeMs) * 1000, output > 0, measured)
709
713
  }
710
714
  // Null it with the stream: a request that has produced its message is no longer in flight, and
711
715
  // a stale anchor would let the live branch count against nothing until the next turn.
@@ -65,7 +65,9 @@ export function formatLatency(ms: number): string {
65
65
  const clamped = Math.max(0, ms)
66
66
  if (clamped < 1000) return `${Math.round(clamped)}ms`
67
67
  const seconds = clamped / 1000
68
- return `${seconds < 10 ? Math.round(seconds * 10) / 10 : Math.round(seconds)}s`
68
+ // Fixed one decimal under 10s: dropping the ".0" costs two columns, and the whole row would
69
+ // twitch every time a ticking count crossed an integer.
70
+ return `${seconds < 10 ? seconds.toFixed(1) : Math.round(seconds)}s`
69
71
  }
70
72
 
71
73
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reedchan/statusline",
3
- "version": "1.10.0",
3
+ "version": "1.10.1",
4
4
  "description": "Replaces pi's footer with a labelled two-row status line: context pressure as a fixed-size meter, cache and cost, the model and effort level, and the latest turn's TTFT and decode throughput in tokens/second.",
5
5
  "keywords": [
6
6
  "bun",