@firstpick/pi-extension-git-footer-status 0.1.7 โ 0.1.9
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 +9 -0
- package/index.ts +1 -18
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -36,3 +36,12 @@ No required configuration.
|
|
|
36
36
|
## Tools
|
|
37
37
|
|
|
38
38
|
None.
|
|
39
|
+
|
|
40
|
+
## Example view
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
๐ช โ126k ยท โ11k โ ๐พ R1.4M โ PI: 6.8k tok โ โก 48.6 tok/s โ ๐ธ $1.667 (sub) โ ๐ง 19.0%/272k (openai-codex) gpt-5.5 โข low
|
|
44
|
+
~/npm-packages (main) โ โ15 โ โฑ15m ยท Agent
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
At a glance you can see token flow, cache reads, prompt-injection size, streaming speed, cost/subscription state, context pressure, model/reasoning level, current repo/branch, dirty-file count, and session time without running `git status`.
|
package/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { homedir } from "node:os";
|
|
|
3
3
|
import { isAbsolute, resolve, sep } from "node:path";
|
|
4
4
|
import type { AssistantMessage } from "@earendil-works/pi-ai";
|
|
5
5
|
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
6
|
+
import { formatTokens, estimatePromptInjectionTokens, estimateTokensFromCharCount } from "@firstpick/pi-utils";
|
|
6
7
|
import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
7
8
|
|
|
8
9
|
type GitSnapshot = {
|
|
@@ -62,14 +63,6 @@ function formatCwd(cwd: string): string {
|
|
|
62
63
|
return cwd;
|
|
63
64
|
}
|
|
64
65
|
|
|
65
|
-
function formatTokens(count: number): string {
|
|
66
|
-
if (count < 1000) return count.toString();
|
|
67
|
-
if (count < 10000) return `${(count / 1000).toFixed(1)}k`;
|
|
68
|
-
if (count < 1000000) return `${Math.round(count / 1000)}k`;
|
|
69
|
-
if (count < 10000000) return `${(count / 1000000).toFixed(1)}M`;
|
|
70
|
-
return `${Math.round(count / 1000000)}M`;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
66
|
function normalizeTimestampMs(timestamp: number): number {
|
|
74
67
|
// Handle mixed timestamp units from different session formats.
|
|
75
68
|
// seconds -> ms (e.g. 1715000000)
|
|
@@ -97,16 +90,6 @@ type LiveTokenSample = {
|
|
|
97
90
|
tokens: number;
|
|
98
91
|
};
|
|
99
92
|
|
|
100
|
-
function estimateTokensFromCharCount(charCount: number): number {
|
|
101
|
-
// Provider tokenizers differ and streaming usage is normally only available at message end.
|
|
102
|
-
// chars/4 is the common rough estimate for live display; final usage uses provider counts.
|
|
103
|
-
return Math.max(0, Math.round(charCount / 4));
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function estimatePromptInjectionTokens(systemPrompt: string): number {
|
|
107
|
-
return estimateTokensFromCharCount(systemPrompt.length);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
93
|
function formatTokenSpeed(tokensPerSecond: number): string {
|
|
111
94
|
if (tokensPerSecond < 100) {
|
|
112
95
|
if (tokensPerSecond >= 10) return tokensPerSecond.toFixed(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firstpick/pi-extension-git-footer-status",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Enhanced Pi footer with git status, token usage, context usage, and model telemetry.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
"./index.ts"
|
|
15
15
|
]
|
|
16
16
|
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@firstpick/pi-utils": "^0.1.3"
|
|
19
|
+
},
|
|
17
20
|
"peerDependencies": {
|
|
18
21
|
"@earendil-works/pi-coding-agent": "*",
|
|
19
22
|
"@earendil-works/pi-ai": "*",
|