useful-pi-extensions 1.10.1 → 1.10.2
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": "useful-pi-extensions",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.2",
|
|
4
4
|
"description": "A small collection of pi extensions, installed with one command — a labelled status line with context pressure, cache, cost, effort, TTFT and tokens/sec.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bun",
|
|
@@ -8,7 +8,7 @@ Replaces pi's footer with a labelled two-row one. Every value carries a word, so
|
|
|
8
8
|
decoded from a symbol or remembered from a legend.
|
|
9
9
|
|
|
10
10
|
```text
|
|
11
|
-
Context █████████▍░░░░░░░░░░ 47% 471k / 1.0M Input 194k · Output 89k | Cache hit 99.9% | Cost $0.
|
|
11
|
+
Context █████████▍░░░░░░░░░░ 47% 471k / 1.0M Input 194k · Output 89k | Cache hit 99.9% | Cost $0.23 · 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
|
|
14
14
|
```
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
替换 pi 的 footer,改成带文字标签的两行。每个值都带一个词,不需要靠符号猜、也不需要记图例。
|
|
8
8
|
|
|
9
9
|
```text
|
|
10
|
-
Context █████████▍░░░░░░░░░░ 47% 471k / 1.0M Input 194k · Output 89k | Cache hit 99.9% | Cost $0.
|
|
10
|
+
Context █████████▍░░░░░░░░░░ 47% 471k / 1.0M Input 194k · Output 89k | Cache hit 99.9% | Cost $0.23 · 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
|
|
13
13
|
```
|
|
@@ -326,15 +326,15 @@ export function withCachedRates(
|
|
|
326
326
|
return `${JSON.stringify({ ...config, rates, fetchedAt }, null, 2)}\n`
|
|
327
327
|
}
|
|
328
328
|
|
|
329
|
-
/**
|
|
329
|
+
/** Two decimals, with padding zeros trimmed so `$0.30` renders as `$0.3`. */
|
|
330
330
|
/**
|
|
331
|
-
*
|
|
331
|
+
* Two decimals, with the padding zeros trimmed so `$0.30` renders as `$0.3`.
|
|
332
332
|
*
|
|
333
|
-
* All of them, not just one: a converted amount lands on `¥17.
|
|
334
|
-
* trailing zero would show up as `¥17.
|
|
333
|
+
* All of them, not just one: a converted amount lands on `¥17.80` often enough that a single
|
|
334
|
+
* trailing zero would show up as `¥17.8` beside `¥2.71` and read as a different precision.
|
|
335
335
|
*/
|
|
336
336
|
export function formatCost(cost: number, currency: Currency = USD): string {
|
|
337
|
-
return `${currency.symbol}${(cost * currency.perUsd).toFixed(
|
|
337
|
+
return `${currency.symbol}${(cost * currency.perUsd).toFixed(2).replace(/\.?0+$/, '')}`
|
|
338
338
|
}
|
|
339
339
|
|
|
340
340
|
/**
|