pi-mcp-client 0.3.2 → 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.
Files changed (2) hide show
  1. package/dist/index.js +11 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3499,11 +3499,11 @@ 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(status === states.failed ? "error" : "accent", line(row.label)) + (row.inlineDescription ? theme.fg(status === states.failed ? "error" : "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(
3506
- theme.fg(status === states.failed ? "error" : "dim", ` ${line(row.description)}`),
3506
+ theme.fg("dim", ` ${line(row.description)}`),
3507
3507
  width
3508
3508
  ));
3509
3509
  return rendered;
@@ -3784,7 +3784,15 @@ Discover candidates with mcp_tools({query: "capability", server: "name"}); disco
3784
3784
  });
3785
3785
  }
3786
3786
  if (!candidates.length) messages2.push("No matching tools. Try a more specific capability, server, or exact tool name.");
3787
- details.rows.push(...discovery.unavailable.map((label) => ({ label, state: "failed" })));
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
+ }));
3788
3796
  messages2.push(...discovery.unavailable.map((message) => `Not searched: ${message}`), ...discovery.warnings);
3789
3797
  messages2.push("No tools activated. Call mcp_tools({activate: [...]}) with the identifiers you need.");
3790
3798
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-mcp-client",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "MCP tools for Pi, discovered on demand and called natively through the official SDK.",
5
5
  "type": "module",
6
6
  "license": "MIT",