pi-powerline 0.7.0 → 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 +14 -0
- package/extensions/footer.ts +9 -0
- package/extensions/header.ts +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
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
|
+
|
|
8
|
+
## [0.7.1](https://github.com/jwu/pi-powerline/compare/v0.7.0...v0.7.1) (2026-05-27)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **header:** resolve user-scoped npm package dir with npm/ prefix ([5e5bb18](https://github.com/jwu/pi-powerline/commit/5e5bb189602e68488d57cc211a806f6c5a6d6a1b))
|
|
14
|
+
|
|
1
15
|
# [0.7.0](https://github.com/jwu/pi-powerline/compare/v0.6.3...v0.7.0) (2026-05-24)
|
|
2
16
|
|
|
3
17
|
|
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/extensions/header.ts
CHANGED
|
@@ -432,8 +432,8 @@ function resolvePackageDir(source: string, cwd: string, home = getHomeDir()): st
|
|
|
432
432
|
// project-scoped install (.pi/npm/node_modules/<name>)
|
|
433
433
|
const projectDir = join(cwd, '.pi', 'npm', 'node_modules', name);
|
|
434
434
|
if (existsSync(projectDir)) return projectDir;
|
|
435
|
-
// user-scoped install (~/.pi/agent/node_modules/<name>)
|
|
436
|
-
const userDir = join(home, '.pi', 'agent', 'node_modules', name);
|
|
435
|
+
// user-scoped install (~/.pi/agent/npm/node_modules/<name>)
|
|
436
|
+
const userDir = join(home, '.pi', 'agent', 'npm', 'node_modules', name);
|
|
437
437
|
if (existsSync(userDir)) return userDir;
|
|
438
438
|
// global npm root
|
|
439
439
|
if (npmRoot) {
|
package/package.json
CHANGED