@vtstech/pi-status 1.0.8 → 1.0.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/package.json +2 -2
- package/status.js +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtstech/pi-status",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "System monitor / status bar extension for Pi Coding Agent",
|
|
5
5
|
"main": "status.js",
|
|
6
6
|
"keywords": ["pi-extensions"],
|
|
@@ -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.9"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"@mariozechner/pi-coding-agent": ">=0.66"
|
package/status.js
CHANGED
|
@@ -144,7 +144,11 @@ function status_temp_default(pi) {
|
|
|
144
144
|
const ollamaBase = getOllamaBaseUrl();
|
|
145
145
|
const out = execSync(`curl -s "${ollamaBase}/api/ps"`, { encoding: "utf-8", timeout: 5e3 });
|
|
146
146
|
if (out.trim()) {
|
|
147
|
-
|
|
147
|
+
let data;
|
|
148
|
+
try {
|
|
149
|
+
data = JSON.parse(out.trim());
|
|
150
|
+
} catch {
|
|
151
|
+
}
|
|
148
152
|
const models = data?.models || [];
|
|
149
153
|
if (Array.isArray(models) && models.length > 0) {
|
|
150
154
|
ollamaLoadedCache = models[0].name || models[0].model || "unknown";
|
|
@@ -364,6 +368,7 @@ function status_temp_default(pi) {
|
|
|
364
368
|
const out = usage.output ?? usage.completionTokens ?? usage.completion_tokens;
|
|
365
369
|
if (inp != null) lastUpstream = inp;
|
|
366
370
|
if (out != null) lastDownstream = out;
|
|
371
|
+
if (tuiRef) tuiRef.requestRender();
|
|
367
372
|
}
|
|
368
373
|
pi.on("message_end", captureUsage);
|
|
369
374
|
pi.on("turn_end", captureUsage);
|