pi-powerline 0.7.1 → 0.8.0
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 +7 -0
- package/extensions/footer.ts +9 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [0.8.0](https://github.com/jwu/pi-powerline/compare/v0.7.1...v0.8.0) (2026-06-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **footer:** show cache hit rate ([e2c5535](https://github.com/jwu/pi-powerline/commit/e2c5535577792432e7007d504cfb1f9a37d86562))
|
|
7
|
+
|
|
1
8
|
## [0.7.1](https://github.com/jwu/pi-powerline/compare/v0.7.0...v0.7.1) (2026-05-27)
|
|
2
9
|
|
|
3
10
|
|
package/extensions/footer.ts
CHANGED
|
@@ -90,6 +90,11 @@ function getUsageTokenTotal(usage: SessionAssistantUsage): number {
|
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
function getCacheHitRate(usage: SessionAssistantUsage): number | undefined {
|
|
94
|
+
const promptTokens = usage.input + usage.cacheRead + usage.cacheWrite;
|
|
95
|
+
return promptTokens > 0 ? (usage.cacheRead / promptTokens) * 100 : undefined;
|
|
96
|
+
}
|
|
97
|
+
|
|
93
98
|
function isSessionAssistantMessage(value: unknown): value is AssistantMessage {
|
|
94
99
|
return (
|
|
95
100
|
typeof value === 'object' &&
|
|
@@ -209,6 +214,10 @@ function createFooterRenderer(ctx: ExtensionContext) {
|
|
|
209
214
|
if (totalOutput) statsParts.push(`↓${formatTokens(totalOutput)}`);
|
|
210
215
|
if (totalCacheRead) statsParts.push(`R${formatTokens(totalCacheRead)}`);
|
|
211
216
|
if (totalCacheWrite) statsParts.push(`W${formatTokens(totalCacheWrite)}`);
|
|
217
|
+
const latestCacheHitRate = latestUsage ? getCacheHitRate(latestUsage) : undefined;
|
|
218
|
+
if ((totalCacheRead > 0 || totalCacheWrite > 0) && latestCacheHitRate !== undefined) {
|
|
219
|
+
statsParts.push(`CH${latestCacheHitRate.toFixed(1)}%`);
|
|
220
|
+
}
|
|
212
221
|
|
|
213
222
|
const usingSubscription = ctx.model ? ctx.modelRegistry.isUsingOAuth(ctx.model) : false;
|
|
214
223
|
if (totalCost || usingSubscription) {
|
package/package.json
CHANGED