@vtstech/pi-diag 1.0.4 → 1.0.6

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 (3) hide show
  1. package/README.md +40 -0
  2. package/diag.js +4 -16
  3. package/package.json +3 -3
package/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # @vtstech/pi-diag
2
+
3
+ Diagnostics extension for the [Pi Coding Agent](https://github.com/badlogic/pi-mono).
4
+
5
+ Run a full system diagnostic of your Pi environment — system info, Ollama status, models.json validation, extension listing, security posture, and more.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pi install "npm:@vtstech/pi-diag"
11
+ ```
12
+
13
+ ## Commands
14
+
15
+ ```
16
+ /diag Run full system diagnostic
17
+ ```
18
+
19
+ ## Checks
20
+
21
+ - **System** — OS, CPU, RAM usage, uptime, Node.js version
22
+ - **Disk** — Disk usage via `df -h`
23
+ - **Ollama** — Running? Version? Response latency? Models pulled? Currently loaded in VRAM?
24
+ - **models.json** — Valid JSON? Provider config? Models listed? Cross-references with Ollama
25
+ - **Settings** — settings.json exists? Valid?
26
+ - **Extensions** — Extension files found? Active tools?
27
+ - **Themes** — Theme files? Valid JSON?
28
+ - **Session** — Active model? API mode? Provider? Base URL? Context window? Context usage? Thinking level?
29
+ - **Security** — Audit log status, blocked command count
30
+
31
+ Also registers a `self_diagnostic` tool so the AI agent can run diagnostics on command.
32
+
33
+ ## Links
34
+
35
+ - [Full Documentation](https://github.com/VTSTech/pi-coding-agent#diagnostics-diagts)
36
+ - [Changelog](https://github.com/VTSTech/pi-coding-agent/blob/main/CHANGELOG.md)
37
+
38
+ ## License
39
+
40
+ MIT — [VTSTech](https://www.vts-tech.org)
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 } from "@vtstech/pi-shared/ollama";
15
+ import { MODELS_JSON_PATH, getOllamaBaseUrl, BUILTIN_PROVIDERS } from "@vtstech/pi-shared/ollama";
16
16
  import {
17
17
  BLOCKED_COMMANDS,
18
18
  BLOCKED_URL_PATTERNS,
@@ -23,7 +23,7 @@ import {
23
23
  } from "@vtstech/pi-shared/security";
24
24
  function diag_temp_default(pi) {
25
25
  const branding = [
26
- ` \u26A1 Pi Diagnostics v1.0.3`,
26
+ ` \u26A1 Pi Diagnostics v1.0.6`,
27
27
  ` Written by VTSTech`,
28
28
  ` GitHub: https://github.com/VTSTech`,
29
29
  ` Website: www.vts-tech.org`
@@ -197,7 +197,8 @@ function diag_temp_default(pi) {
197
197
  for (const m of models) {
198
198
  configuredModels.push(m.id);
199
199
  const reasoning = m.reasoning ? " [reasoning]" : "";
200
- lines.push(info(` \u2022 ${m.id}${reasoning}`));
200
+ const ctx2 = m.contextLength ? ` ctx:${(m.contextLength / 1e3).toFixed(0)}k` : "";
201
+ lines.push(info(` \u2022 ${m.id}${reasoning}${ctx2}`));
201
202
  }
202
203
  }
203
204
  check(
@@ -392,19 +393,6 @@ function diag_temp_default(pi) {
392
393
  if (model) {
393
394
  lines.push(info(`Model: ${model.id || "unknown"}`));
394
395
  lines.push(info(`Provider: ${model.provider || "unknown"}`));
395
- const BUILTIN_PROVIDERS = {
396
- openrouter: { api: "openai-completions", baseUrl: "https://openrouter.ai/api/v1" },
397
- anthropic: { api: "anthropic-messages", baseUrl: "https://api.anthropic.com" },
398
- google: { api: "gemini", baseUrl: "https://generativelanguage.googleapis.com" },
399
- openai: { api: "openai-completions", baseUrl: "https://api.openai.com" },
400
- groq: { api: "openai-completions", baseUrl: "https://api.groq.com" },
401
- deepseek: { api: "openai-completions", baseUrl: "https://api.deepseek.com" },
402
- mistral: { api: "openai-completions", baseUrl: "https://api.mistral.ai" },
403
- xai: { api: "openai-completions", baseUrl: "https://api.x.ai" },
404
- together: { api: "openai-completions", baseUrl: "https://api.together.xyz" },
405
- fireworks: { api: "openai-completions", baseUrl: "https://api.fireworks.ai" },
406
- cohere: { api: "cohere-chat", baseUrl: "https://api.cohere.com" }
407
- };
408
396
  const providerName = model.provider || "";
409
397
  const userProviderCfg = modelsJson ? (modelsJson.providers || {})[providerName] : null;
410
398
  if (userProviderCfg) {
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@vtstech/pi-diag",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Diagnostics extension for Pi Coding Agent",
5
5
  "main": "diag.js",
6
- "keywords": ["pi-package", "pi-extensions"],
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.4"
17
+ "@vtstech/pi-shared": "1.0.6"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@mariozechner/pi-coding-agent": ">=0.66"