@vtstech/pi-diag 1.1.8 → 1.2.0

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/diag.js +10 -10
  2. package/package.json +2 -2
package/diag.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  msHuman,
13
13
  pct
14
14
  } from "@vtstech/pi-shared/format";
15
- import { MODELS_JSON_PATH, getOllamaBaseUrl, BUILTIN_PROVIDERS, readModelsJson, EXTENSION_VERSION } from "@vtstech/pi-shared/ollama";
15
+ import { MODELS_JSON_PATH, getOllamaBaseUrl, BUILTIN_PROVIDERS, readModelsJson, EXTENSION_VERSION, isLocalProvider } from "@vtstech/pi-shared/ollama";
16
16
  import {
17
17
  BLOCKED_COMMANDS,
18
18
  BLOCKED_URL_PATTERNS,
@@ -27,6 +27,7 @@ import {
27
27
  readRecentAuditEntries,
28
28
  AUDIT_LOG_PATH
29
29
  } from "@vtstech/pi-shared/security";
30
+ import { readSettings } from "@vtstech/pi-shared/config-io";
30
31
  import { debugLog } from "@vtstech/pi-shared/debug";
31
32
  var SECRET_KEY_PATTERNS = [
32
33
  /key/i,
@@ -114,7 +115,7 @@ function diag_temp_default(pi) {
114
115
  let ollamaModels = [];
115
116
  let ollamaVersion = "unknown";
116
117
  const ollamaBaseUrl = getOllamaBaseUrl();
117
- const isRemoteOllama = !ollamaBaseUrl.includes("localhost") && !ollamaBaseUrl.includes("127.0.0.1");
118
+ const isRemoteOllama = !isLocalProvider(ollamaBaseUrl);
118
119
  if (isRemoteOllama) {
119
120
  const ollamaRoot = ollamaBaseUrl.replace(/\/v1\/?$/, "");
120
121
  lines.push(info(`Remote Ollama detected: ${ollamaBaseUrl}`));
@@ -252,20 +253,19 @@ function diag_temp_default(pi) {
252
253
  lines.push(info(" \u2192 Run /ollama-sync to create it"));
253
254
  }
254
255
  lines.push(section("SETTINGS"));
255
- const settingsPath = path.join(agentDir, "settings.json");
256
- if (fs.existsSync(settingsPath)) {
257
- try {
258
- const settings = JSON.parse(fs.readFileSync(settingsPath, "utf-8"));
256
+ try {
257
+ const settings = readSettings();
258
+ if (Object.keys(settings).length > 0) {
259
259
  lines.push(info("Global settings found:"));
260
260
  for (const [key, val] of Object.entries(settings)) {
261
261
  lines.push(info(` ${key}: ${redactValue(key, val)}`));
262
262
  }
263
263
  check(true, "settings.json valid JSON", "");
264
- } catch (e) {
265
- lines.push(fail(`settings.json parse error: ${e.message}`));
264
+ } else {
265
+ lines.push(warn("No global settings.json found (using defaults)"));
266
266
  }
267
- } else {
268
- lines.push(warn("No global settings.json found (using defaults)"));
267
+ } catch (e) {
268
+ lines.push(fail(`settings.json read error: ${e.message}`));
269
269
  }
270
270
  lines.push(section("EXTENSIONS"));
271
271
  const extensionsDir = path.join(agentDir, "extensions");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtstech/pi-diag",
3
- "version": "1.1.8",
3
+ "version": "1.2.0",
4
4
  "description": "Diagnostics extension for Pi Coding Agent",
5
5
  "main": "diag.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.1.8"
17
+ "@vtstech/pi-shared": "1.2.0"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@mariozechner/pi-coding-agent": ">=0.66"