@henryqw/pi-footer 5.1.3 → 5.1.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/README.md +2 -1
- package/extensions/footer.ts +5 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,9 +30,10 @@ Select `extensions/footer.ts` for only the footer, or use `pi config` to toggle
|
|
|
30
30
|
| Package | Relationship | Purpose |
|
|
31
31
|
| --- | --- | --- |
|
|
32
32
|
| [`@henryqw/pi-codegraph`](https://pi.henry.wang/extensions/pi-codegraph) | Improves | Shows CodeGraph index status, quiet setup progress, and direct tool activity when loaded. |
|
|
33
|
-
| [`@henryqw/pi-config-store`](https://pi.henry.wang/
|
|
33
|
+
| [`@henryqw/pi-config-store`](https://pi.henry.wang/packages/pi-config-store) | Required | Owns config-home resolution and storage. |
|
|
34
34
|
| [`@henryqw/pi-multi-codex`](https://pi.henry.wang/extensions/pi-multi-codex) | Improves | Adds active Codex subscription quota and reset status. |
|
|
35
35
|
| [`@henryqw/pi-pr`](https://pi.henry.wang/extensions/pi-pr) | Improves | Adds current-branch pull-request status. |
|
|
36
|
+
| [`@henryqw/pi-subagent`](https://pi.henry.wang/extensions/pi-subagent) | Improves | Adds completed background workflow usage to the token and cost totals. |
|
|
36
37
|
|
|
37
38
|
## Use
|
|
38
39
|
|
package/extensions/footer.ts
CHANGED
|
@@ -298,9 +298,11 @@ export default function footerExtension(pi: ExtensionAPI): void {
|
|
|
298
298
|
tps = milliseconds >= MIN_TPS_WINDOW_MS ? output / (milliseconds / 1000) : undefined;
|
|
299
299
|
});
|
|
300
300
|
|
|
301
|
-
// Session entries are append-only; the leaf also changes on tree navigation.
|
|
301
|
+
// Session entries are append-only; the leaf also changes on tree navigation. The routed model comes from
|
|
302
|
+
// the branch, so the selected model completes the context window identity.
|
|
302
303
|
let usageKey: string | undefined;
|
|
303
304
|
let routed: ReturnType<typeof latestResponse>;
|
|
305
|
+
let context: number | null | undefined;
|
|
304
306
|
let input = 0;
|
|
305
307
|
let output = 0;
|
|
306
308
|
let cost = 0;
|
|
@@ -352,16 +354,16 @@ export default function footerExtension(pi: ExtensionAPI): void {
|
|
|
352
354
|
invalidate() { },
|
|
353
355
|
render(width: number): string[] {
|
|
354
356
|
const entries = ctx.sessionManager.getEntries();
|
|
355
|
-
const key = `${entries.length}:${ctx.sessionManager.getLeafId()}`;
|
|
357
|
+
const key = `${entries.length}:${ctx.sessionManager.getLeafId()}:${ctx.model?.provider}/${ctx.model?.id}`;
|
|
356
358
|
if (key !== usageKey) {
|
|
357
359
|
usageKey = key;
|
|
358
360
|
computeUsage(entries);
|
|
359
361
|
routed = latestResponse(ctx);
|
|
362
|
+
context = ctx.getContextUsage()?.percent;
|
|
360
363
|
}
|
|
361
364
|
|
|
362
365
|
const reportedBranch = data.getGitBranch()?.replace(/^worktree\//, "");
|
|
363
366
|
const branch = reportedBranch === "detached" && gitSummary.detachedOid ? `@${gitSummary.detachedOid}` : reportedBranch;
|
|
364
|
-
const context = ctx.getContextUsage()?.percent;
|
|
365
367
|
const openUri = configuredOpenUri(ctx.cwd);
|
|
366
368
|
const extensionStatuses = data.getExtensionStatuses();
|
|
367
369
|
const prStatus = sanitizeStatus(extensionStatuses.get("pi-pr") ?? "");
|