@vtstech/pi-diag 1.0.9 → 1.1.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.
- package/diag.js +12 -9
- package/package.json +2 -2
package/diag.js
CHANGED
|
@@ -12,18 +12,19 @@ import {
|
|
|
12
12
|
msHuman,
|
|
13
13
|
pct
|
|
14
14
|
} from "@vtstech/pi-shared/format";
|
|
15
|
-
import { getOllamaBaseUrl, BUILTIN_PROVIDERS, readModelsJson } from "@vtstech/pi-shared/ollama";
|
|
15
|
+
import { MODELS_JSON_PATH, getOllamaBaseUrl, BUILTIN_PROVIDERS, readModelsJson, EXTENSION_VERSION } from "@vtstech/pi-shared/ollama";
|
|
16
16
|
import {
|
|
17
17
|
BLOCKED_COMMANDS,
|
|
18
18
|
BLOCKED_URL_PATTERNS,
|
|
19
19
|
validatePath,
|
|
20
20
|
isSafeUrl,
|
|
21
21
|
sanitizeCommand,
|
|
22
|
-
readRecentAuditEntries
|
|
22
|
+
readRecentAuditEntries,
|
|
23
|
+
AUDIT_LOG_PATH
|
|
23
24
|
} from "@vtstech/pi-shared/security";
|
|
24
25
|
function diag_temp_default(pi) {
|
|
25
26
|
const branding = [
|
|
26
|
-
` \u26A1 Pi Diagnostics
|
|
27
|
+
` \u26A1 Pi Diagnostics v${EXTENSION_VERSION}`,
|
|
27
28
|
` Written by VTSTech`,
|
|
28
29
|
` GitHub: https://github.com/VTSTech`,
|
|
29
30
|
` Website: www.vts-tech.org`
|
|
@@ -223,7 +224,7 @@ function diag_temp_default(pi) {
|
|
|
223
224
|
lines.push(fail(`models.json parse error: ${e.message}`));
|
|
224
225
|
}
|
|
225
226
|
} else {
|
|
226
|
-
lines.push(fail(`models.json not found at ${
|
|
227
|
+
lines.push(fail(`models.json not found at ${MODELS_JSON_PATH}`));
|
|
227
228
|
lines.push(info(" \u2192 Run /ollama-sync to create it"));
|
|
228
229
|
}
|
|
229
230
|
lines.push(section("SETTINGS"));
|
|
@@ -368,9 +369,8 @@ function diag_temp_default(pi) {
|
|
|
368
369
|
}
|
|
369
370
|
lines.push(info("Audit log status:"));
|
|
370
371
|
const auditEntries = readRecentAuditEntries(50);
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
lines.push(ok(`Audit log exists: ${auditLogPath}`));
|
|
372
|
+
if (fs.existsSync(AUDIT_LOG_PATH)) {
|
|
373
|
+
lines.push(ok(`Audit log exists: ${AUDIT_LOG_PATH}`));
|
|
374
374
|
if (auditEntries.length > 0) {
|
|
375
375
|
lines.push(info(` Recent entries: ${auditEntries.length} (last 50)`));
|
|
376
376
|
const recentSample = auditEntries.slice(-3);
|
|
@@ -383,7 +383,7 @@ function diag_temp_default(pi) {
|
|
|
383
383
|
lines.push(info(" No audit entries found (log is empty or unparseable)"));
|
|
384
384
|
}
|
|
385
385
|
} else {
|
|
386
|
-
lines.push(warn(`Audit log not found at ${
|
|
386
|
+
lines.push(warn(`Audit log not found at ${AUDIT_LOG_PATH}`));
|
|
387
387
|
lines.push(info(" \u2192 Audit logging will begin when security events occur"));
|
|
388
388
|
}
|
|
389
389
|
lines.push(section("CURRENT SESSION"));
|
|
@@ -462,7 +462,10 @@ function diag_temp_default(pi) {
|
|
|
462
462
|
promptGuidelines: [
|
|
463
463
|
"When the user asks for a diagnostic, health check, or system test, call self_diagnostic."
|
|
464
464
|
],
|
|
465
|
-
parameters: {
|
|
465
|
+
parameters: {
|
|
466
|
+
type: "object",
|
|
467
|
+
properties: {}
|
|
468
|
+
},
|
|
466
469
|
execute: async (_toolCallId, _params, _signal, _onUpdate, ctx) => {
|
|
467
470
|
try {
|
|
468
471
|
const report = await runDiagnostics(ctx);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtstech/pi-diag",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.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.0
|
|
17
|
+
"@vtstech/pi-shared": "1.1.0"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"@mariozechner/pi-coding-agent": ">=0.66"
|