@vtstech/pi-status 1.0.6 → 1.0.7

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/status.js +10 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtstech/pi-status",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
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.6"
17
+ "@vtstech/pi-shared": "1.0.7"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@mariozechner/pi-coding-agent": ">=0.66"
package/status.js CHANGED
@@ -77,19 +77,17 @@ function status_temp_default(pi) {
77
77
  let ollamaLoadedLastCheck = 0;
78
78
  const OLLAMA_LOADED_INTERVAL = 15e3;
79
79
  function detectLocalProvider(modelsJson) {
80
+ const isLocalUrl = (url) => url.includes("localhost") || url.includes("127.0.0.1") || url.includes("0.0.0.0");
80
81
  try {
81
- for (const provider of Object.values(modelsJson.providers || {})) {
82
- const url = provider.baseUrl || "";
83
- const hasLocalUrl = url.includes("localhost") || url.includes("127.0.0.1") || url.includes("0.0.0.0");
84
- const modelId = footerModel || "";
85
- if (modelId && (provider.models || []).some((m) => m.id === modelId)) {
86
- return hasLocalUrl;
87
- }
88
- }
89
- for (const [name, provider] of Object.entries(modelsJson.providers || {})) {
90
- const url = provider.baseUrl || "";
91
- if (url.includes("localhost") || url.includes("127.0.0.1") || url.includes("0.0.0.0") || name === "ollama") {
92
- return true;
82
+ const ctxUrl = currentCtx?.provider?.baseUrl || currentCtx?.provider?.url || "";
83
+ if (ctxUrl) return isLocalUrl(ctxUrl);
84
+ const modelId = footerModel || "";
85
+ if (modelsJson && modelId) {
86
+ for (const provider of Object.values(modelsJson.providers || {})) {
87
+ const url = provider.baseUrl || "";
88
+ if ((provider.models || []).some((m) => m.id === modelId)) {
89
+ return isLocalUrl(url);
90
+ }
93
91
  }
94
92
  }
95
93
  } catch {