pi-extensions 0.1.27 → 0.1.28
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,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.1 - 2026-04-17
|
|
4
|
+
- Add a one-line formula footer to the `/usage` dashboard (`Tokens = Input + Output + CacheWrite · ↑In = Input + CacheWrite`)
|
|
5
|
+
- README now calls out the 0.2.0 formula change explicitly under the columns table
|
|
6
|
+
|
|
3
7
|
## 0.2.0 - 2026-04-17
|
|
4
8
|
- Include `cacheWrite` in the main `Tokens` total and in the `↑In` column so providers like Anthropic that report fresh prompt work under `cacheWrite` are no longer undercounted
|
|
5
9
|
- Keep `cacheRead` out of `Tokens` so repeated cache hits do not swamp the dashboard
|
|
@@ -7,7 +7,7 @@ A Pi extension that displays aggregated usage statistics across all sessions.
|
|
|
7
7
|
## Compatibility
|
|
8
8
|
|
|
9
9
|
- **Pi version:** 0.42.4+
|
|
10
|
-
- **Last updated:** 2026-04-17
|
|
10
|
+
- **Last updated:** 2026-04-17 (0.2.1)
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
@@ -83,6 +83,8 @@ Time periods are calculated in the local timezone where Pi runs. If you want to
|
|
|
83
83
|
| **↓Out** | Output tokens *(dimmed)* |
|
|
84
84
|
| **Cache** | Cache read + write tokens *(dimmed; informational)* |
|
|
85
85
|
|
|
86
|
+
> **As of 0.2.0:** `Tokens = Input + Output + CacheWrite` and `↑In = Input + CacheWrite`. `CacheRead` stays out of `Tokens` so repeated cache hits don't swamp the dashboard. The dashboard itself shows a one-line footer reminder.
|
|
87
|
+
|
|
86
88
|
On narrow terminals, `/usage` automatically switches to a compact table instead of overflowing the terminal. Hidden columns reappear as soon as you widen the terminal.
|
|
87
89
|
|
|
88
90
|
### Navigation
|
package/usage-extension/index.ts
CHANGED
|
@@ -590,6 +590,7 @@ class UsageComponent {
|
|
|
590
590
|
...this.renderHeader(layout),
|
|
591
591
|
...this.renderRows(layout),
|
|
592
592
|
...this.renderTotals(layout),
|
|
593
|
+
...this.renderFormulaNote(width),
|
|
593
594
|
...this.renderHelp(width),
|
|
594
595
|
],
|
|
595
596
|
width
|
|
@@ -711,6 +712,16 @@ class UsageComponent {
|
|
|
711
712
|
return [th.fg("border", "─".repeat(layout.tableWidth)), totalRow, ""];
|
|
712
713
|
}
|
|
713
714
|
|
|
715
|
+
private renderFormulaNote(width: number): string[] {
|
|
716
|
+
const line = pickFittingText(width, [
|
|
717
|
+
"Tokens = Input + Output + CacheWrite · ↑In = Input + CacheWrite (as of 0.2.0)",
|
|
718
|
+
"Tokens = In + Out + CacheWrite · ↑In = In + CacheWrite (v0.2.0+)",
|
|
719
|
+
"Tokens & ↑In include CacheWrite (v0.2.0+)",
|
|
720
|
+
"Incl. CacheWrite (v0.2.0+)",
|
|
721
|
+
]);
|
|
722
|
+
return [this.theme.fg("dim", line), ""];
|
|
723
|
+
}
|
|
724
|
+
|
|
714
725
|
private renderHelp(width: number): string[] {
|
|
715
726
|
const line = pickFittingText(width, [
|
|
716
727
|
"[Tab/←→] period [↑↓] select [Enter] expand [q] close",
|