@vtstech/pi-diag 1.1.7 → 1.1.8

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 +22 -3
  2. package/package.json +2 -2
package/diag.js CHANGED
@@ -27,6 +27,23 @@ import {
27
27
  readRecentAuditEntries,
28
28
  AUDIT_LOG_PATH
29
29
  } from "@vtstech/pi-shared/security";
30
+ import { debugLog } from "@vtstech/pi-shared/debug";
31
+ var SECRET_KEY_PATTERNS = [
32
+ /key/i,
33
+ /token/i,
34
+ /secret/i,
35
+ /password/i,
36
+ /credential/i,
37
+ /auth/i,
38
+ /apikey/i,
39
+ /api_key/i
40
+ ];
41
+ function redactValue(key, value) {
42
+ if (typeof value !== "string") return JSON.stringify(value);
43
+ if (SECRET_KEY_PATTERNS.some((p) => p.test(key))) return "[REDACTED]";
44
+ if (value.length > 20 && !value.includes(" ") && /^[A-Za-z0-9_\-+/=]+$/.test(value)) return value.slice(0, 8) + "...";
45
+ return value;
46
+ }
30
47
  function diag_temp_default(pi) {
31
48
  const branding = [
32
49
  ` \u26A1 Pi Diagnostics v${EXTENSION_VERSION}`,
@@ -140,7 +157,8 @@ function diag_temp_default(pi) {
140
157
  lines.push(info("No model currently loaded in Ollama"));
141
158
  }
142
159
  }
143
- } catch {
160
+ } catch (err) {
161
+ debugLog("diag", "failed to check remote Ollama loaded models", err);
144
162
  }
145
163
  }
146
164
  } else {
@@ -182,7 +200,8 @@ function diag_temp_default(pi) {
182
200
  lines.push(warn("No model currently loaded in Ollama"));
183
201
  }
184
202
  }
185
- } catch {
203
+ } catch (err) {
204
+ debugLog("diag", "failed to check local Ollama loaded models", err);
186
205
  }
187
206
  }
188
207
  }
@@ -239,7 +258,7 @@ function diag_temp_default(pi) {
239
258
  const settings = JSON.parse(fs.readFileSync(settingsPath, "utf-8"));
240
259
  lines.push(info("Global settings found:"));
241
260
  for (const [key, val] of Object.entries(settings)) {
242
- lines.push(info(` ${key}: ${JSON.stringify(val)}`));
261
+ lines.push(info(` ${key}: ${redactValue(key, val)}`));
243
262
  }
244
263
  check(true, "settings.json valid JSON", "");
245
264
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtstech/pi-diag",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
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.7"
17
+ "@vtstech/pi-shared": "1.1.8"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@mariozechner/pi-coding-agent": ">=0.66"