@mgsoftwarebv/mg-dashboard-mcp 3.11.0 → 3.12.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/dist/index.js +15 -9
- package/dist/index.js.map +1 -1
- package/package.json +48 -48
package/dist/index.js
CHANGED
|
@@ -2879,7 +2879,8 @@ function parseDf(s) {
|
|
|
2879
2879
|
const lines = s.split("\n").filter(Boolean);
|
|
2880
2880
|
const header = lines[0];
|
|
2881
2881
|
if (!header || !/Filesystem/i.test(header)) return null;
|
|
2882
|
-
const
|
|
2882
|
+
const cleanHeader = header.replace(/Mounted on/i, "MountedOn");
|
|
2883
|
+
const cols = cleanHeader.trim().split(/\s+/);
|
|
2883
2884
|
const out = [];
|
|
2884
2885
|
for (const ln of lines.slice(1)) {
|
|
2885
2886
|
const parts = splitCols(ln, cols.length);
|
|
@@ -4524,18 +4525,23 @@ ${sample.join("\n")}${files.length > 5 ? `
|
|
|
4524
4525
|
if (targetIds.length === 1) {
|
|
4525
4526
|
const r = await probeOne(targetIds[0]);
|
|
4526
4527
|
const result = r.result;
|
|
4527
|
-
|
|
4528
|
+
const combined = `${result.stdout}
|
|
4529
|
+
${result.stderr}`;
|
|
4530
|
+
const noSuchMatch = /No such container:\s*(\S+)/i.exec(combined);
|
|
4531
|
+
const fuzzyHint = () => {
|
|
4532
|
+
if (!noSuchMatch) return "";
|
|
4528
4533
|
const known = getKnownContainers(targetIds[0]);
|
|
4529
|
-
if (known
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4534
|
+
if (!known?.length) return "";
|
|
4535
|
+
const hits = suggestSimilar(noSuchMatch[1], known);
|
|
4536
|
+
return hits.length ? `
|
|
4537
|
+
(hint) Did you mean: ${hits.join(", ")}?` : "";
|
|
4538
|
+
};
|
|
4539
|
+
if (!acceptableCode(result.exitCode) && !result.stdout) {
|
|
4540
|
+
return { content: [{ type: "text", text: `Error (exit ${result.exitCode}): ${result.stderr || "(no output)"}${fuzzyHint()}` }] };
|
|
4535
4541
|
}
|
|
4536
4542
|
const note = result.exitCode === 124 ? `
|
|
4537
4543
|
(note: command exceeded ${wallSeconds}s wall budget; partial output)` : "";
|
|
4538
|
-
return { content: [{ type: "text", text: (result.stdout || "(no log lines matched)") + note }] };
|
|
4544
|
+
return { content: [{ type: "text", text: (result.stdout || "(no log lines matched)") + note + fuzzyHint() }] };
|
|
4539
4545
|
}
|
|
4540
4546
|
const perServer = [];
|
|
4541
4547
|
for (let i = 0; i < targetIds.length; i += parallelism) {
|