pi-mcp-client 0.3.1 → 0.3.3
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 +14 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3499,7 +3499,7 @@ function renderResult(result, options, theme, isError) {
|
|
|
3499
3499
|
if (width <= 0) return [];
|
|
3500
3500
|
const lines = rows.flatMap((row) => {
|
|
3501
3501
|
const status = states[row.state] ?? states.failed;
|
|
3502
|
-
const value = theme.fg(status.color, status.glyph) + " " + theme.fg("accent", line(row.label)) + (row.inlineDescription ? theme.fg("dim", ` ${line(row.inlineDescription)}`) : "");
|
|
3502
|
+
const value = theme.fg(status.color, status.glyph) + " " + theme.fg(status === states.failed ? "error" : "accent", line(row.label)) + (row.inlineDescription ? theme.fg("dim", ` ${line(row.inlineDescription)}`) : "") + (row.inlineAction ? theme.bold(theme.fg("dim", ` ${line(row.inlineAction)}`)) : "");
|
|
3503
3503
|
const rendered = options.expanded && (!details?.searchNotes || row.state === "failed") ? new Text(value, 0, 0).render(width).map((x) => truncateToWidth2(x, width)) : [truncateToWidth2(value, width)];
|
|
3504
3504
|
if (options.expanded && row.description)
|
|
3505
3505
|
rendered.push(truncateToWidth2(
|
|
@@ -3513,7 +3513,10 @@ function renderResult(result, options, theme, isError) {
|
|
|
3513
3513
|
if (options.expanded && !options.isPartial && text && !details?.searchNotes && !bodyInRow)
|
|
3514
3514
|
lines.push(
|
|
3515
3515
|
...new Text(
|
|
3516
|
-
formattedOutput ??=
|
|
3516
|
+
formattedOutput ??= (() => {
|
|
3517
|
+
const output = validation ? formatValidation(body, theme) : formatOutput(body, details?.displayBlocks, theme);
|
|
3518
|
+
return isError || details?.failed ? theme.fg("error", output) : output;
|
|
3519
|
+
})(),
|
|
3517
3520
|
0,
|
|
3518
3521
|
0
|
|
3519
3522
|
).render(width).map((x) => truncateToWidth2(x, width))
|
|
@@ -3781,7 +3784,15 @@ Discover candidates with mcp_tools({query: "capability", server: "name"}); disco
|
|
|
3781
3784
|
});
|
|
3782
3785
|
}
|
|
3783
3786
|
if (!candidates.length) messages2.push("No matching tools. Try a more specific capability, server, or exact tool name.");
|
|
3784
|
-
details.rows.push(...discovery.
|
|
3787
|
+
details.rows.push(...discovery.diagnostics.map((value) => {
|
|
3788
|
+
const action = value.hint.startsWith("Run ") ? value.hint : void 0;
|
|
3789
|
+
return {
|
|
3790
|
+
label: value.server ?? "MCP",
|
|
3791
|
+
inlineDescription: `${value.message}${action ? "" : ` ${value.hint}`}`,
|
|
3792
|
+
...action ? { inlineAction: action } : {},
|
|
3793
|
+
state: "failed"
|
|
3794
|
+
};
|
|
3795
|
+
}));
|
|
3785
3796
|
messages2.push(...discovery.unavailable.map((message) => `Not searched: ${message}`), ...discovery.warnings);
|
|
3786
3797
|
messages2.push("No tools activated. Call mcp_tools({activate: [...]}) with the identifiers you need.");
|
|
3787
3798
|
} else {
|