@vtstech/pi-status 1.0.4 → 1.0.5
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 +50 -0
- package/package.json +3 -3
- package/status.js +19 -0
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# @vtstech/pi-status
|
|
2
|
+
|
|
3
|
+
System monitor / status bar extension for the [Pi Coding Agent](https://github.com/badlogic/pi-mono).
|
|
4
|
+
|
|
5
|
+
Replaces the Pi footer with a unified status bar showing system metrics, model info, and generation params.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pi install "npm:@vtstech/pi-status"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## How It Works
|
|
14
|
+
|
|
15
|
+
Automatically loaded — no commands needed. Displays a 2-line status bar at the bottom of the Pi interface.
|
|
16
|
+
|
|
17
|
+
**Line 1:**
|
|
18
|
+
```
|
|
19
|
+
~/.pi/agent · main · qwen3:0.6b · medium · 5.6%/128k · CPU 9% · RAM 2.2G/15.1G · Resp 5m24s · temp:0.0
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Line 2:**
|
|
23
|
+
```
|
|
24
|
+
⏱ bash (12s)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## What's Displayed
|
|
28
|
+
|
|
29
|
+
- **Working directory** — compact `~`-relative path
|
|
30
|
+
- **Git branch** — current branch name (cached)
|
|
31
|
+
- **Active model** — the model Pi is currently using
|
|
32
|
+
- **Thinking level** — shown when active (off is hidden)
|
|
33
|
+
- **Context usage** — percentage and window size (`5.6%/128k`)
|
|
34
|
+
- **CPU%** — per-core delta (updates every 3s)
|
|
35
|
+
- **RAM** — used/total
|
|
36
|
+
- **Swap** — shown only when active
|
|
37
|
+
- **Loaded model** — Ollama model in memory via `/api/ps` (cached 15s)
|
|
38
|
+
- **Response time** — agent loop duration
|
|
39
|
+
- **Generation params** — temperature, top_p, top_k, max tokens, num_predict, context size
|
|
40
|
+
- **Security indicator** — 3s flash on blocked tools + persistent blocked count
|
|
41
|
+
- **Active tool timing** — live elapsed timer for running tool
|
|
42
|
+
|
|
43
|
+
## Links
|
|
44
|
+
|
|
45
|
+
- [Full Documentation](https://github.com/VTSTech/pi-coding-agent#system-monitor-status-ts)
|
|
46
|
+
- [Changelog](https://github.com/VTSTech/pi-coding-agent/blob/main/CHANGELOG.md)
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
MIT — [VTSTech](https://www.vts-tech.org)
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtstech/pi-status",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "System monitor / status bar extension for Pi Coding Agent",
|
|
5
5
|
"main": "status.js",
|
|
6
|
-
"keywords": ["pi-
|
|
6
|
+
"keywords": ["pi-extensions"],
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"access": "public",
|
|
9
9
|
"type": "module",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"url": "https://github.com/VTSTech/pi-coding-agent"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@vtstech/pi-shared": "1.0.
|
|
17
|
+
"@vtstech/pi-shared": "1.0.5"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"@mariozechner/pi-coding-agent": ">=0.66"
|
package/status.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// .build-npm/status/status.temp.ts
|
|
2
2
|
import os from "node:os";
|
|
3
|
+
import * as fs from "node:fs";
|
|
4
|
+
import * as path from "node:path";
|
|
3
5
|
import { execSync } from "node:child_process";
|
|
4
6
|
import { getOllamaBaseUrl } from "@vtstech/pi-shared/ollama";
|
|
5
7
|
import { fmtBytes, fmtDur } from "@vtstech/pi-shared/format";
|
|
@@ -159,6 +161,23 @@ function status_temp_default(pi) {
|
|
|
159
161
|
} else {
|
|
160
162
|
footerCtxPct = "";
|
|
161
163
|
}
|
|
164
|
+
const modelId = currentCtx.model?.id || "";
|
|
165
|
+
if (modelId && !footerCtxPct) {
|
|
166
|
+
try {
|
|
167
|
+
const modelsJson = JSON.parse(fs.readFileSync(
|
|
168
|
+
path.join(os.homedir(), ".pi", "agent", "models.json"),
|
|
169
|
+
"utf-8"
|
|
170
|
+
));
|
|
171
|
+
for (const prov of Object.values(modelsJson.providers || {})) {
|
|
172
|
+
const match = (prov.models || []).find((m) => m.id === modelId);
|
|
173
|
+
if (match?.contextLength) {
|
|
174
|
+
footerCtxPct = `${(match.contextLength / 1e3).toFixed(0)}k ctx`;
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
} catch {
|
|
179
|
+
}
|
|
180
|
+
}
|
|
162
181
|
}
|
|
163
182
|
refreshBlockedCount();
|
|
164
183
|
}
|