@leanmcp/ui 0.2.0 → 0.2.1

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 CHANGED
@@ -491,7 +491,14 @@ function extractResultData(result) {
491
491
  const textContent = result.content.filter((c) => c.type === "text").map((c) => c.text).join("");
492
492
  if (textContent) {
493
493
  try {
494
- return JSON.parse(textContent);
494
+ const parsed = JSON.parse(textContent);
495
+ if (parsed && typeof parsed === "object" && "content" in parsed && Array.isArray(parsed.content)) {
496
+ const nested = extractResultData(parsed);
497
+ if (nested !== null) {
498
+ return nested;
499
+ }
500
+ }
501
+ return parsed;
495
502
  } catch {
496
503
  return textContent;
497
504
  }
@@ -1872,6 +1879,9 @@ function ToolDataGrid({ dataTool, columns, transformData, rowActions = [], pagin
1872
1879
  50,
1873
1880
  100
1874
1881
  ], defaultPageSize = 10, defaultSort, refreshInterval, showRefresh = true, onDataLoaded, onError, onRowClick, getRowKey, emptyContent, loadingContent, className }) {
1882
+ if (!dataTool) {
1883
+ throw new Error("ToolDataGrid: dataTool prop is required");
1884
+ }
1875
1885
  const toolConfig = typeof dataTool === "string" ? {
1876
1886
  name: dataTool
1877
1887
  } : dataTool;
@@ -2101,6 +2111,9 @@ function ToolDataGrid({ dataTool, columns, transformData, rowActions = [], pagin
2101
2111
  }
2102
2112
  chunk3PV26V5F_js.__name(ToolDataGrid, "ToolDataGrid");
2103
2113
  function RowActionButton({ action, row, onRefresh }) {
2114
+ if (!action.tool) {
2115
+ throw new Error("ToolDataGrid: rowAction.tool is required");
2116
+ }
2104
2117
  const toolConfig = typeof action.tool === "string" ? {
2105
2118
  name: action.tool
2106
2119
  } : action.tool;