@epam/ai-dial-mcp-apps 1.1.16 → 1.1.18

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/index.js +4 -5
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -4,7 +4,7 @@ import { IconAlertTriangle as s, IconArrowsMaximize as c, IconRefresh as l } fro
4
4
  import { memo as u, useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
5
5
  import { MessageRole as g } from "@epam/ai-dial-chat-shared";
6
6
  import { jsx as _, jsxs as v } from "react/jsx-runtime";
7
- //#region src/models/mcp-apps.ts
7
+ // src/models/mcp-apps.ts
8
8
  var y = /* @__PURE__ */ function(e) {
9
9
  return e.Loading = "loading", e.Ready = "ready", e.Error = "error", e.Unavailable = "unavailable", e;
10
10
  }({}), b = (e) => {
@@ -57,7 +57,7 @@ var y = /* @__PURE__ */ function(e) {
57
57
  }] }
58
58
  };
59
59
  }, D = async (e, t, n) => {
60
- if (!(e.discovery === "direct" || t?.toolInput != null)) return t?.toolResult;
60
+ if (e.discovery !== "direct" && t?.toolInput == null) return t?.toolResult;
61
61
  try {
62
62
  return await n(e.toolsetId, e.mcpToolName, t?.toolInput ?? {}, e.kind);
63
63
  } catch {
@@ -67,7 +67,7 @@ var y = /* @__PURE__ */ function(e) {
67
67
  let { hostContext: s, sandboxUrl: c, fetchResourceHtml: l, callTool: u } = a, [p, m] = h(), [g, _] = h(), [v, b] = h(() => t == null || c == null ? y.Unavailable : y.Loading), [x, S] = h(0), C = d(() => {
68
68
  r.invalidate(i), S((e) => e + 1);
69
69
  }, [r, i]), w = d(async (e) => {
70
- if (!(t == null || c == null)) try {
70
+ if (t != null && c != null) try {
71
71
  let a = T(n), { html: o, toolResult: s } = await r.getOrFetch(i, a, async () => {
72
72
  let [e, r] = await Promise.all([l(t.toolsetId, t.resourceUri), D(t, n, u)]);
73
73
  return {
@@ -182,7 +182,7 @@ var y = /* @__PURE__ */ function(e) {
182
182
  ]
183
183
  })]
184
184
  });
185
- }), A = 900 * 1e3, j = (e) => {
185
+ }), A = 9e5, j = (e) => {
186
186
  let t = m(/* @__PURE__ */ new Map()), n = m(/* @__PURE__ */ new Map());
187
187
  return p(() => {
188
188
  let r = (t) => `${e}:${t}`, i = (e, t) => `${r(e)}::${t ?? ""}`, a = (e, n) => {
@@ -219,5 +219,4 @@ var y = /* @__PURE__ */ function(e) {
219
219
  };
220
220
  }, [e]);
221
221
  };
222
- //#endregion
223
222
  export { k as McpAppInlinePreview, y as McpAppInlinePreviewStatus, S as collectToolCallNames, T as computeMcpAppSeedKey, C as findMcpAppForMessage, w as mcpAppCanvasKey, E as resolveMcpAppToolCallSeed, D as resolveMcpAppToolResult, O as useMcpAppInlinePreview, j as useMcpAppResponseCache };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-mcp-apps",
3
3
  "description": "Host-agnostic MCP Apps building blocks — tool-call/message matching, the response cache, and the inline preview hook/component shared by the full-width canvas and inline surfaces",
4
- "version": "1.1.16",
4
+ "version": "1.1.18",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -20,10 +20,10 @@
20
20
  "@tabler/icons-react": "^3.44.0",
21
21
  "@mcp-ui/client": "^7.1.1",
22
22
  "@modelcontextprotocol/sdk": "^1.29.0",
23
- "@epam/ai-dial-attachment-canvas": "1.1.16"
23
+ "@epam/ai-dial-attachment-canvas": "1.1.18"
24
24
  },
25
25
  "peerDependencies": {
26
- "@epam/ai-dial-chat-shared": "1.1.16",
26
+ "@epam/ai-dial-chat-shared": "1.1.18",
27
27
  "@epam/ai-dial-ui-kit": "^0.14.2",
28
28
  "react": "^19.2.8"
29
29
  },