@fyeeme/pi-statusline 1.2.2 → 1.2.4
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 +18 -0
- package/README.md +3 -1
- package/index.ts +27 -1
- package/package.json +7 -7
- package/pricing/deepseek.ts +15 -11
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,24 @@ 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.4] - 2026-09-10
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Follow DeepSeek's DeepSeek-V4.1-Flash price revision: the Flash column is now ¥0.02/0.04 cache-hit input, ¥1/2 cache-miss input, ¥4/8 output per million tokens (peak values; off-peak is half). `deepseek-flash` is the canonical id for these rates, and the retired `deepseek-v4-flash` / `deepseek-v4-flash-vision-exp` ids still work and are billed at the same Flash rates, so all three share one price entry. V4 Pro (`deepseek-v4-pro`, DeepSeek-V4-Pro-0813) is unchanged.
|
|
15
|
+
|
|
16
|
+
## [1.2.3] - 2026-09-09
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- 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.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Peer/dev dependencies bumped to pi 0.84.4 (the `ui_prompt` events require >= 0.84.4).
|
|
25
|
+
|
|
8
26
|
## [1.2.2] - 2026-08-23
|
|
9
27
|
|
|
10
28
|
### Changed
|
package/README.md
CHANGED
|
@@ -29,9 +29,11 @@ DeepSeek now bills in two periods — **peak hours are 9:00-12:00 and 14:00-18:0
|
|
|
29
29
|
|
|
30
30
|
| Model | Period | Cache-hit input | Cache-miss input | Output |
|
|
31
31
|
|---|---|---|---|---|
|
|
32
|
-
| deepseek-
|
|
32
|
+
| deepseek-flash | off-peak / peak | ¥0.02 / ¥0.04 | ¥1 / ¥2 | ¥4 / ¥8 |
|
|
33
33
|
| deepseek-v4-pro | off-peak / peak | ¥0.15 / ¥0.30 | ¥4.5 / ¥9.0 | ¥13.5 / ¥27.0 |
|
|
34
34
|
|
|
35
|
+
- **Legacy model ids** — `deepseek-v4-flash` and `deepseek-v4-flash-vision-exp` are retired but still callable; requests are served by DeepSeek-V4.1-Flash and billed at the Flash rates, so they share the `deepseek-flash` prices.
|
|
36
|
+
|
|
35
37
|
- **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
38
|
- **Peak/off-peak indicator** — the footer appends the current period so you always know which rate is in effect: `peak` during weekday 9:00-12:00 / 14:00-18:00 Beijing time, `off-peak` otherwise (including all day on weekends since 2026-08-23):
|
|
37
39
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "1.2.4",
|
|
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.
|
|
52
|
-
"@earendil-works/pi-ai": ">=0.84.
|
|
53
|
-
"@earendil-works/pi-tui": ">=0.84.
|
|
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.
|
|
57
|
-
"@earendil-works/pi-ai": "0.84.
|
|
58
|
-
"@earendil-works/pi-tui": "0.84.
|
|
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
|
}
|
package/pricing/deepseek.ts
CHANGED
|
@@ -31,19 +31,23 @@ export interface DeepSeekCnyPrice {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
* DeepSeek 官方 CNY 单价(元 / 百万 tokens
|
|
35
|
-
*
|
|
34
|
+
* DeepSeek 官方 CNY 单价(元 / 百万 tokens):2026-08-17 起峰谷计价生效;flash 单价随后按官方定价页的
|
|
35
|
+
* DeepSeek-V4.1-Flash 档位下调(高峰 ¥2 输入 / ¥8 输出 / ¥0.04 缓存命中,空闲为其一半),pro
|
|
36
|
+
* (DeepSeek-V4-Pro-0813)维持原价。字段为缓存命中输入 / 未命中输入 / 输出;cacheWrite 官方未单列(按 0 计)。
|
|
36
37
|
*/
|
|
38
|
+
|
|
39
|
+
/** Flash 档单价:`deepseek-flash` 与其两个已下线旧 id 均由 DeepSeek-V4.1-Flash 提供服务,价格一致。 */
|
|
40
|
+
const DEEPSEEK_FLASH_PRICES: DeepSeekCnyPrice = {
|
|
41
|
+
peak: { input: 2.0, output: 8.0, cacheRead: 0.04, cacheWrite: 0 },
|
|
42
|
+
offPeak: { input: 1.0, output: 4.0, cacheRead: 0.02, cacheWrite: 0 },
|
|
43
|
+
};
|
|
44
|
+
|
|
37
45
|
export const DEEPSEEK_CNY_PRICES: Record<string, DeepSeekCnyPrice> = {
|
|
38
|
-
"deepseek-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"deepseek-v4-flash-vision-exp": {
|
|
44
|
-
peak: { input: 3.0, output: 9.0, cacheRead: 0.1, cacheWrite: 0 },
|
|
45
|
-
offPeak: { input: 1.5, output: 4.5, cacheRead: 0.05, cacheWrite: 0 },
|
|
46
|
-
},
|
|
46
|
+
"deepseek-flash": DEEPSEEK_FLASH_PRICES,
|
|
47
|
+
// 旧 id:模型已下线,但请求仍可发出,由 DeepSeek-V4.1-Flash 提供服务并按 Flash 价计费;
|
|
48
|
+
// vision 变体亦然(官方未单列视觉费用,图片按 token 计费,单张最高 384 tokens)。
|
|
49
|
+
"deepseek-v4-flash": DEEPSEEK_FLASH_PRICES,
|
|
50
|
+
"deepseek-v4-flash-vision-exp": DEEPSEEK_FLASH_PRICES,
|
|
47
51
|
"deepseek-v4-pro": {
|
|
48
52
|
peak: { input: 9.0, output: 27.0, cacheRead: 0.3, cacheWrite: 0 },
|
|
49
53
|
offPeak: { input: 4.5, output: 13.5, cacheRead: 0.15, cacheWrite: 0 },
|