@fyeeme/pi-statusline 1.2.0 → 1.2.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/CHANGELOG.md +6 -0
- package/README.md +26 -4
- package/package.json +1 -1
- package/pricing/deepseek.ts +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.1] - 2026-08-21
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Support `deepseek-v4-flash-vision-exp` (V4 Flash Vision): the model was missing from the CNY price table, so its cost fell back to pi's recorded USD price (understated ~7x for CNY accounts, often rendering `¥0.00`). Official pricing is identical to V4-Flash (images are billed as tokens, no vision surcharge); the model now follows the same peak/off-peak rates.
|
|
15
|
+
|
|
10
16
|
## [1.2.0] - 2026-08-21
|
|
11
17
|
|
|
12
18
|
### Added
|
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@ A rich custom status bar for [pi](https://pi.dev) that replaces the default foot
|
|
|
8
8
|
## Features
|
|
9
9
|
|
|
10
10
|
- **Provider-aware usage** — special support for DeepSeek and GLM/ZAI (see [Provider Support](#provider-support))
|
|
11
|
+
- **DeepSeek peak/off-peak pricing** — session cost follows DeepSeek's 2026-08-17 peak/off-peak billing (peak 9:00-12:00 / 14:00-18:00 Beijing time, off-peak half price), priced per-message by timestamp, with a live `peak`/`off-peak` indicator in the footer (see [DeepSeek](#deepseek))
|
|
11
12
|
- **Token usage**: input, output, cache read/write, total per session, with cache hit rate
|
|
12
13
|
- **Cost**: cumulative session cost with currency auto-detection (¥ for DeepSeek/CNY, $ otherwise)
|
|
13
14
|
- **Context window**: usage percentage and size
|
|
@@ -20,7 +21,29 @@ This extension uses a provider-aware strategy: when the active model belongs to
|
|
|
20
21
|
|
|
21
22
|
### DeepSeek
|
|
22
23
|
|
|
23
|
-
Shows live **account balance** and **
|
|
24
|
+
Shows live **account balance**, **weekly token usage**, and **peak/off-peak aware session cost**. Since DeepSeek introduced peak/off-peak pricing on 2026-08-17, pi-statusline tracks it automatically.
|
|
25
|
+
|
|
26
|
+
#### Peak / Off-peak pricing (since 2026-08-17)
|
|
27
|
+
|
|
28
|
+
DeepSeek now bills in two periods — **peak hours are 9:00-12:00 and 14:00-18:00 Beijing time** (UTC+8), all other hours are off-peak, and **off-peak is half the peak price**. Official CNY prices per million tokens:
|
|
29
|
+
|
|
30
|
+
| Model | Period | Cache-hit input | Cache-miss input | Output |
|
|
31
|
+
|---|---|---|---|---|
|
|
32
|
+
| deepseek-v4-flash / deepseek-v4-flash-vision-exp | off-peak / peak | ¥0.05 / ¥0.10 | ¥1.5 / ¥3.0 | ¥4.5 / ¥9.0 |
|
|
33
|
+
| deepseek-v4-pro | off-peak / peak | ¥0.15 / ¥0.30 | ¥4.5 / ¥9.0 | ¥13.5 / ¥27.0 |
|
|
34
|
+
|
|
35
|
+
- **Per-message pricing by timestamp** — each message is priced at the rate of its own time (`AssistantMessage.timestamp`), so a long session spanning a period boundary (9:00/12:00/14:00/18:00) accounts every message correctly instead of using a single fixed rate.
|
|
36
|
+
- **Peak/off-peak indicator** — the footer appends the current period so you always know which rate is in effect: `peak` during 9:00-12:00 / 14:00-18:00 Beijing time, `off-peak` otherwise:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
¥0.12/50.00 · 7d:1.2M · off-peak
|
|
40
|
+
¥0.12/50.00 · 7d:1.2M · peak
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
- **Registry pricing patch** — for CNY-billed accounts the model registry cost is aligned to the current period at runtime (and re-aligned automatically when the period flips), so pi's recorded `usage.cost` tracks the period too.
|
|
44
|
+
- **USD-billed accounts** keep pi's built-in USD prices (no CNY override, no peak/off-peak indicator).
|
|
45
|
+
|
|
46
|
+
#### Balance & weekly tokens
|
|
24
47
|
|
|
25
48
|
| Segment | Example | Source |
|
|
26
49
|
|---------|---------|--------|
|
|
@@ -28,7 +51,6 @@ Shows live **account balance** and **weekly token usage**.
|
|
|
28
51
|
| Weekly tokens | `7d:1.2M` | Local session file scan (rolling 7 days) |
|
|
29
52
|
|
|
30
53
|
- Currency auto-detected as `¥` (CNY) from the balance API response
|
|
31
|
-
- Session cost follows DeepSeek's peak/off-peak pricing (since 2026-08-17): peak hours are 9:00-12:00 and 14:00-18:00 Beijing time, off-peak is half price. Each message is priced at the rate of its own timestamp; the footer marks the current period (`peak` / `off-peak`).
|
|
32
54
|
- Balance is fetched on startup and refreshed in the background; cached for 5 minutes
|
|
33
55
|
- Triggered when `model.provider === "deepseek"`
|
|
34
56
|
|
|
@@ -97,12 +119,12 @@ See the Pi Packages guide on [pi.dev](https://pi.dev) for the full list of sourc
|
|
|
97
119
|
|
|
98
120
|
```
|
|
99
121
|
~/projects/my-repo (main) deepseek-v4-pro · xhigh
|
|
100
|
-
tokens 65k(in 12k, out 8k, cache 45k) · ¥0.12/50.00 · 7d:1.2M · 45.2%/64k · 2m30s 38.2tok/s
|
|
122
|
+
tokens 65k(in 12k, out 8k, cache 45k) · ¥0.12/50.00 · 7d:1.2M · off-peak · 45.2%/64k · 2m30s 38.2tok/s
|
|
101
123
|
```
|
|
102
124
|
|
|
103
125
|
**Line 1**: cwd + git branch (left) | model + thinking level (right)
|
|
104
126
|
|
|
105
|
-
**Line 2**: token stats · provider usage · context window · timing
|
|
127
|
+
**Line 2**: token stats · provider usage (incl. DeepSeek peak/off-peak indicator) · context window · timing
|
|
106
128
|
|
|
107
129
|
### GLM/ZAI example
|
|
108
130
|
|
package/package.json
CHANGED
package/pricing/deepseek.ts
CHANGED
|
@@ -38,6 +38,11 @@ export const DEEPSEEK_CNY_PRICES: Record<string, DeepSeekCnyPrice> = {
|
|
|
38
38
|
peak: { input: 3.0, output: 9.0, cacheRead: 0.1, cacheWrite: 0 },
|
|
39
39
|
offPeak: { input: 1.5, output: 4.5, cacheRead: 0.05, cacheWrite: 0 },
|
|
40
40
|
},
|
|
41
|
+
// 视觉变体:官方定价与 V4-Flash 完全相同(图片按 token 计费,单张最高 384 tokens,无视觉专项费用)
|
|
42
|
+
"deepseek-v4-flash-vision-exp": {
|
|
43
|
+
peak: { input: 3.0, output: 9.0, cacheRead: 0.1, cacheWrite: 0 },
|
|
44
|
+
offPeak: { input: 1.5, output: 4.5, cacheRead: 0.05, cacheWrite: 0 },
|
|
45
|
+
},
|
|
41
46
|
"deepseek-v4-pro": {
|
|
42
47
|
peak: { input: 9.0, output: 27.0, cacheRead: 0.3, cacheWrite: 0 },
|
|
43
48
|
offPeak: { input: 4.5, output: 13.5, cacheRead: 0.15, cacheWrite: 0 },
|