@invergent/agent-chat-react 1.7.8 → 1.7.9

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.cjs CHANGED
@@ -2287,6 +2287,29 @@ function WebToolBlock({ tc }) {
2287
2287
  displayText && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/70 truncate text-xs", children: displayText })
2288
2288
  ] });
2289
2289
  }
2290
+ function MCPToolBlock({ tc }) {
2291
+ const segments = tc.toolName.replace(/^mcp__/, "").split("__");
2292
+ const toolName = segments[segments.length - 1] ?? tc.toolName;
2293
+ const label = toolName.split("_").map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join(" ");
2294
+ let summary = "";
2295
+ try {
2296
+ const args = JSON.parse(tc.args);
2297
+ if (args && typeof args === "object") {
2298
+ const entries = Object.entries(args).filter(([, v]) => v !== void 0 && v !== null && v !== "");
2299
+ if (entries.length > 0) {
2300
+ summary = entries.map(([k, v]) => {
2301
+ const val = typeof v === "string" ? v : JSON.stringify(v);
2302
+ return `${k}=${val}`;
2303
+ }).join(", ");
2304
+ }
2305
+ }
2306
+ } catch {
2307
+ }
2308
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-sm py-0.5", children: [
2309
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: label }),
2310
+ summary && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/60 truncate text-xs", children: summary })
2311
+ ] });
2312
+ }
2290
2313
  function VisionAnalyzeBlock({ tc }) {
2291
2314
  let image = "";
2292
2315
  try {
@@ -4337,6 +4360,9 @@ function ToolCallBlock({
4337
4360
  resolvedArtifactName,
4338
4361
  onFileSelect
4339
4362
  }) {
4363
+ if (tc.toolName.startsWith("mcp__")) {
4364
+ return /* @__PURE__ */ jsxRuntime.jsx(MCPToolBlock, { tc });
4365
+ }
4340
4366
  switch (tc.toolName) {
4341
4367
  case "terminal":
4342
4368
  return /* @__PURE__ */ jsxRuntime.jsx(TerminalToolBlock, { tc });