@epam/ai-dial-mcp-apps 1.2.0-dev.61 → 1.2.0-dev.72

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.
@@ -21,6 +21,15 @@ export interface McpAppInlinePreviewProps {
21
21
  actionsGroupAriaLabel?: string;
22
22
  /** Message shown when the resource fails to load or the app fails to initialize. */
23
23
  loadErrorLabel: string;
24
+ /**
25
+ * Whether this message's MCP App is currently open in the full-width
26
+ * canvas. When `true`, the header stays (so the tool/app identity is still
27
+ * visible) but the body shows `openedInCanvasLabel` centered instead of
28
+ * mounting the app — only one live app instance exists at a time.
29
+ */
30
+ isOpenedInCanvas?: boolean;
31
+ /** Message shown centered in the body when `isOpenedInCanvas` is `true`. */
32
+ openedInCanvasLabel: string;
24
33
  /** Color overrides applied as CSS custom properties on the preview's root. */
25
34
  colors?: McpAppInlinePreviewColors;
26
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"McpAppInlinePreview.d.ts","sourceRoot":"","sources":["../../../src/components/McpAppInlinePreview/McpAppInlinePreview.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EACnB,MAAM,uBAAuB,CAAC;AAG/B,qDAAqD;AACrD,MAAM,WAAW,wBAAwB;IACvC,uCAAuC;IACvC,KAAK,EAAE,aAAa,CAAC;IACrB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,uIAAuI;IACvI,KAAK,EAAE,mBAAmB,CAAC;IAC3B,gEAAgE;IAChE,QAAQ,EAAE,MAAM,CAAC;IACjB,6GAA6G;IAC7G,WAAW,EAAE,iBAAiB,CAAC;IAC/B,kEAAkE;IAClE,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,wDAAwD;IACxD,eAAe,EAAE,MAAM,CAAC;IACxB,8CAA8C;IAC9C,eAAe,EAAE,MAAM,CAAC;IACxB,uFAAuF;IACvF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,oFAAoF;IACpF,cAAc,EAAE,MAAM,CAAC;IACvB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,yBAAyB,CAAC;CACpC;AA6ID,iHAAiH;AACjH,eAAO,MAAM,mBAAmB,gEAAgC,CAAC"}
1
+ {"version":3,"file":"McpAppInlinePreview.d.ts","sourceRoot":"","sources":["../../../src/components/McpAppInlinePreview/McpAppInlinePreview.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EACnB,MAAM,uBAAuB,CAAC;AAG/B,qDAAqD;AACrD,MAAM,WAAW,wBAAwB;IACvC,uCAAuC;IACvC,KAAK,EAAE,aAAa,CAAC;IACrB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,uIAAuI;IACvI,KAAK,EAAE,mBAAmB,CAAC;IAC3B,gEAAgE;IAChE,QAAQ,EAAE,MAAM,CAAC;IACjB,6GAA6G;IAC7G,WAAW,EAAE,iBAAiB,CAAC;IAC/B,kEAAkE;IAClE,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,wDAAwD;IACxD,eAAe,EAAE,MAAM,CAAC;IACxB,8CAA8C;IAC9C,eAAe,EAAE,MAAM,CAAC;IACxB,uFAAuF;IACvF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,oFAAoF;IACpF,cAAc,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,4EAA4E;IAC5E,mBAAmB,EAAE,MAAM,CAAC;IAC5B,8EAA8E;IAC9E,MAAM,CAAC,EAAE,yBAAyB,CAAC;CACpC;AAqLD,iHAAiH;AACjH,eAAO,MAAM,mBAAmB,gEAAgC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useMcpAppInlinePreview.d.ts","sourceRoot":"","sources":["../../../src/hooks/useMcpAppInlinePreview/useMcpAppInlinePreview.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACvB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EACL,yBAAyB,EACzB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EACnB,MAAM,uBAAuB,CAAC;AAM/B,kDAAkD;AAClD,MAAM,WAAW,wBAAwB;IACvC,iDAAiD;IACjD,MAAM,EAAE,yBAAyB,CAAC;IAClC,6CAA6C;IAC7C,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,+FAA+F;IAC/F,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,sBAAsB,GACjC,OAAO,aAAa,GAAG,SAAS,EAChC,UAAU,kBAAkB,GAAG,SAAS,EACxC,OAAO,mBAAmB,EAC1B,UAAU,MAAM,EAChB,aAAa,iBAAiB,EAC9B,uBAAuB,CAAC,IAAI,EAAE,iBAAiB,KAAK,iBAAiB,GAAG,IAAI,KAC3E,wBAgGF,CAAC"}
1
+ {"version":3,"file":"useMcpAppInlinePreview.d.ts","sourceRoot":"","sources":["../../../src/hooks/useMcpAppInlinePreview/useMcpAppInlinePreview.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACvB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EACL,yBAAyB,EACzB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EACnB,MAAM,uBAAuB,CAAC;AAM/B,kDAAkD;AAClD,MAAM,WAAW,wBAAwB;IACvC,iDAAiD;IACjD,MAAM,EAAE,yBAAyB,CAAC;IAClC,6CAA6C;IAC7C,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,+FAA+F;IAC/F,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,sBAAsB,GACjC,OAAO,aAAa,GAAG,SAAS,EAChC,UAAU,kBAAkB,GAAG,SAAS,EACxC,OAAO,mBAAmB,EAC1B,UAAU,MAAM,EAChB,aAAa,iBAAiB,EAC9B,uBAAuB,CAAC,IAAI,EAAE,iBAAiB,KAAK,iBAAiB,GAAG,IAAI,KAC3E,wBAkGF,CAAC"}
package/index.css CHANGED
@@ -1,2 +1,2 @@
1
1
  ._preview_19as4_11{background:var(--mcpapp-preview-bg,var(--bg-layer-raised,#fcfcfc));border-color:var(--mcpapp-preview-border,var(--stroke-tertiary,#e0e6f0))}._previewHeader_19as4_23{border-bottom-color:var(--mcpapp-preview-header-border,var(--stroke-tertiary,#e0e6f0))}
2
- /*$vite$:1*/.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.block{display:block}.inline{display:inline}.flex{display:flex}.min-h-10{min-height:2.5rem}.min-h-\[200px\]{min-height:200px}.w-full{width:100%}.min-w-0{min-width:0}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.p-4{padding:1rem}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.text-center{text-align:center}.text-error{color:var(--text-error,#ae2f2f)}.text-primary{color:var(--text-primary,#161b2d)}
2
+ /*$vite$:1*/.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-1\.5{margin-left:.375rem;margin-right:.375rem}.ms-2{margin-inline-start:.5rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.h-3{height:.75rem}.min-h-10{min-height:2.5rem}.min-h-\[200px\]{min-height:200px}.w-0{width:0}.w-full{width:100%}.min-w-0{min-width:0}.shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-s{border-inline-start-width:1px}.p-4{padding:1rem}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.text-center{text-align:center}.align-middle{vertical-align:middle}.text-error{color:var(--text-error,#ae2f2f)}.text-primary{color:var(--text-primary,#161b2d)}.text-secondary{color:var(--text-secondary,#57647a)}
package/index.js CHANGED
@@ -1,23 +1,23 @@
1
1
  import { AttachmentContentType as e, McpAppCanvasRenderer as t } from "@epam/ai-dial-attachment-canvas";
2
2
  import { MessageRole as n, buildCssVars as r } from "@epam/ai-dial-chat-shared";
3
- import { DIAL_ICON_SIZE as i, DIAL_KIT_ICON_STROKE as a, ElementSize as o, GhostIconButton as s, Spinner as c, mergeClasses as l } from "@epam/ai-dial-ui-kit";
4
- import { IconAlertTriangle as u, IconArrowsMaximize as d, IconRefresh as f } from "@tabler/icons-react";
5
- import { memo as p, useCallback as m, useEffect as h, useMemo as g, useRef as _, useState as v } from "react";
6
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
3
+ import { DIAL_ICON_SIZE as i, DIAL_KIT_ICON_STROKE as a, ElementSize as o, EllipsisTooltip as s, GhostIconButton as c, Spinner as l, mergeClasses as u } from "@epam/ai-dial-ui-kit";
4
+ import { IconAlertTriangle as d, IconArrowsMaximize as f, IconRefresh as p } from "@tabler/icons-react";
5
+ import { memo as m, useCallback as h, useEffect as g, useMemo as _, useRef as v, useState as y } from "react";
6
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
7
7
  //#region src/constants/public-class-names.ts
8
- var x = {
8
+ var C = {
9
9
  preview: "dial-mcp-apps-preview",
10
10
  previewHeader: "dial-mcp-apps-preview-header"
11
- }, S = /* @__PURE__ */ function(e) {
11
+ }, w = /* @__PURE__ */ function(e) {
12
12
  return e.Loading = "loading", e.Ready = "ready", e.Error = "error", e.Unavailable = "unavailable", e;
13
- }({}), C = (e) => {
13
+ }({}), T = (e) => {
14
14
  try {
15
15
  let t = JSON.parse(e);
16
16
  return typeof t == "object" && t ? t : {};
17
17
  } catch {
18
18
  return {};
19
19
  }
20
- }, w = (e) => {
20
+ }, E = (e) => {
21
21
  let t = /* @__PURE__ */ new Map();
22
22
  for (let n of e?.tool_messages ?? []) {
23
23
  for (let e of n.tool_calls ?? []) t.set(e.id, {
@@ -32,7 +32,7 @@ var x = {
32
32
  for (let n of e?.tool_execution_history ?? []) {
33
33
  for (let e of n.tool_calls ?? []) t.set(e.id, {
34
34
  name: e.function.name,
35
- args: C(e.function.arguments)
35
+ args: T(e.function.arguments)
36
36
  });
37
37
  if (n.role === "tool" && n.tool_call_id) {
38
38
  let e = t.get(n.tool_call_id);
@@ -40,18 +40,18 @@ var x = {
40
40
  }
41
41
  }
42
42
  return t;
43
- }, T = (e) => {
43
+ }, D = (e) => {
44
44
  let t = /* @__PURE__ */ new Set();
45
- for (let n of e) for (let e of w(n.custom_content?.state).values()) t.add(e.name);
45
+ for (let n of e) for (let e of E(n.custom_content?.state).values()) t.add(e.name);
46
46
  return t;
47
- }, E = (e, t, r) => {
47
+ }, O = (e, t, r) => {
48
48
  if (t.length === 0 || e.role !== n.Assistant) return;
49
- let i = new Set([...w(e.custom_content?.state).values()].map((e) => e.name));
49
+ let i = new Set([...E(e.custom_content?.state).values()].map((e) => e.name));
50
50
  return t.find((e) => i.has(e.toolName)) || t.find((e) => e.discovery === "direct") || (r ? t[0] : void 0);
51
- }, D = (e) => `${e}:mcp-app`, O = (e) => e == null ? void 0 : JSON.stringify(e.toolInput ?? null), k = (e, t) => {
51
+ }, k = (e) => `${e}:mcp-app`, A = (e) => e == null ? void 0 : JSON.stringify(e.toolInput ?? null), j = (e, t) => {
52
52
  let n = e.custom_content?.state;
53
53
  if (!n) return;
54
- let r = [...w(n).values()].reverse().find((e) => e.name === t);
54
+ let r = [...E(n).values()].reverse().find((e) => e.name === t);
55
55
  if (r) return {
56
56
  toolInput: r.args,
57
57
  toolResult: r.result == null ? void 0 : { content: [{
@@ -59,152 +59,189 @@ var x = {
59
59
  text: r.result
60
60
  }] }
61
61
  };
62
- }, A = async (e, t, n) => {
62
+ }, M = async (e, t, n) => {
63
63
  if (!(e.discovery === "direct" || t?.toolInput != null)) return t?.toolResult;
64
64
  try {
65
65
  return await n(e.toolsetId, e.mcpToolName, t?.toolInput ?? {}, e.kind);
66
66
  } catch {
67
67
  return t?.toolResult;
68
68
  }
69
- }, j = (t, n, r, i, a, o) => {
70
- let { hostContext: s, sandboxUrl: c, fetchResourceHtml: l, callTool: u } = a, [d, f] = v(), [p, g] = v(), [_, y] = v(() => t == null || c == null ? S.Unavailable : S.Loading), [b, x] = v(0), C = m(() => {
71
- r.invalidate(i), x((e) => e + 1);
72
- }, [r, i]), w = m(async (e) => {
73
- if (!(t == null || c == null)) try {
74
- let a = O(n), { html: o, toolResult: s } = await r.getOrFetch(i, a, async () => {
75
- let [e, r] = await Promise.all([l(t.toolsetId, t.resourceUri), A(t, n, u)]);
69
+ }, N = (t, n, r, i, a, o) => {
70
+ let { hostContext: s, hostInfo: c, sandboxUrl: l, fetchResourceHtml: u, callTool: d } = a, [f, p] = y(), [m, _] = y(), [v, b] = y(() => t == null || l == null ? w.Unavailable : w.Loading), [x, S] = y(0), C = h(() => {
71
+ r.invalidate(i), S((e) => e + 1);
72
+ }, [r, i]), T = h(async (e) => {
73
+ if (!(t == null || l == null)) try {
74
+ let a = A(n), { html: o, toolResult: s } = await r.getOrFetch(i, a, async () => {
75
+ let [e, r] = await Promise.all([u(t.toolsetId, t.resourceUri), M(t, n, d)]);
76
76
  return {
77
77
  html: e,
78
78
  toolResult: r
79
79
  };
80
80
  });
81
81
  if (e()) return;
82
- f(o), g(s), y(S.Ready);
82
+ p(o), _(s), b(w.Ready);
83
83
  } catch {
84
- e() || y(S.Error);
84
+ e() || b(w.Error);
85
85
  }
86
86
  }, [
87
87
  t,
88
88
  n,
89
- c,
89
+ l,
90
90
  r,
91
91
  i,
92
- l,
93
- u
92
+ u,
93
+ d
94
94
  ]);
95
- h(() => {
96
- if (t == null || c == null) {
97
- y(S.Unavailable);
95
+ g(() => {
96
+ if (t == null || l == null) {
97
+ b(w.Unavailable);
98
98
  return;
99
99
  }
100
100
  let e = !1;
101
- return y(S.Loading), w(() => e), () => {
101
+ return b(w.Loading), T(() => e), () => {
102
102
  e = !0;
103
103
  };
104
104
  }, [
105
105
  t,
106
- c,
107
- w,
108
- b
106
+ l,
107
+ T,
108
+ x
109
109
  ]);
110
- let T = m(async (e, n) => {
110
+ let E = h(async (e, n) => {
111
111
  if (t == null) throw Error(`Tool call "${e}" failed: no matching MCP App`);
112
- return u(t.toolsetId, e, n, t.kind);
113
- }, [t, u]);
114
- return _ !== S.Ready || t == null || c == null || d == null ? {
115
- status: _,
112
+ return d(t.toolsetId, e, n, t.kind);
113
+ }, [t, d]);
114
+ return v !== w.Ready || t == null || l == null || f == null ? {
115
+ status: v,
116
116
  reload: C
117
117
  } : {
118
- status: _,
118
+ status: v,
119
119
  reload: C,
120
120
  content: {
121
121
  type: e.McpApp,
122
- html: d,
123
- sandboxUrl: c,
122
+ html: f,
123
+ sandboxUrl: l,
124
124
  toolInput: n?.toolInput,
125
- toolResult: p,
125
+ toolResult: m,
126
126
  hostContext: s,
127
- onToolCall: T,
127
+ hostInfo: c,
128
+ onToolCall: E,
128
129
  onRequestDisplayMode: o
129
130
  }
130
131
  };
131
- }, M = {
132
+ }, P = {
132
133
  preview: "_preview_19as4_11",
133
134
  previewHeader: "_previewHeader_19as4_23"
134
- }, N = p(({ match: e, toolCall: n, cache: p, cacheKey: h, hostAdapter: g, onExpand: _, expandAriaLabel: v, reloadAriaLabel: C, actionsGroupAriaLabel: w = "MCP app actions", loadErrorLabel: T, colors: E }) => {
135
- let D = m((e) => e === "fullscreen" ? (_(), "fullscreen") : "inline", [_]), O = r({
136
- "--mcpapp-preview-bg": E?.previewBackground,
137
- "--mcpapp-preview-border": E?.previewBorder,
138
- "--mcpapp-preview-header-border": E?.previewHeaderBorder
139
- }), { status: k, content: A, reload: N } = j(e, n, p, h, g, D);
140
- return k === S.Unavailable ? null : /* @__PURE__ */ b("div", {
141
- style: O,
142
- className: l(M.preview, "flex w-full min-w-0 flex-col overflow-hidden rounded-xl border", x.preview),
143
- children: [/* @__PURE__ */ y("div", {
144
- className: l(M.previewHeader, "flex min-h-10 items-center justify-end border-b px-4 py-2", x.previewHeader),
145
- children: /* @__PURE__ */ b("div", {
135
+ }, F = m(({ match: e, toolCall: n, cache: m, cacheKey: _, hostAdapter: v, onExpand: T, expandAriaLabel: E, reloadAriaLabel: D, actionsGroupAriaLabel: O = "MCP app actions", loadErrorLabel: k, isOpenedInCanvas: A = !1, openedInCanvasLabel: j, colors: M }) => {
136
+ let [F, I] = y(void 0);
137
+ g(() => {
138
+ I(void 0);
139
+ }, [_]);
140
+ let L = h((e) => e === "fullscreen" ? (T(), "fullscreen") : "inline", [T]), R = r({
141
+ "--mcpapp-preview-bg": M?.previewBackground,
142
+ "--mcpapp-preview-border": M?.previewBorder,
143
+ "--mcpapp-preview-header-border": M?.previewHeaderBorder
144
+ }), { status: z, content: B, reload: V } = N(e, n, m, _, v, L);
145
+ return z === w.Unavailable ? null : /* @__PURE__ */ S("div", {
146
+ style: R,
147
+ className: u(P.preview, "flex w-full min-w-0 flex-col overflow-hidden rounded-xl border", C.preview),
148
+ children: [/* @__PURE__ */ S("div", {
149
+ className: u(P.previewHeader, "flex min-h-10 items-center justify-between gap-2 border-b px-4 py-2", C.previewHeader),
150
+ children: [/* @__PURE__ */ x(s, {
151
+ text: F == null ? /* @__PURE__ */ x("span", {
152
+ className: "dial-tiny-lead-semi-text",
153
+ children: e.mcpToolName
154
+ }) : /* @__PURE__ */ S(b, { children: [
155
+ /* @__PURE__ */ x("span", {
156
+ className: "dial-tiny-lead-semi-text",
157
+ children: e.mcpToolName
158
+ }),
159
+ /* @__PURE__ */ x("span", {
160
+ "aria-hidden": !0,
161
+ className: "border-current mx-1.5 inline-block h-3 w-0 border-s align-middle"
162
+ }),
163
+ /* @__PURE__ */ x("span", {
164
+ className: "dial-tiny-lead-semi-text",
165
+ children: F.name
166
+ }),
167
+ F.version && /* @__PURE__ */ x("span", {
168
+ className: "dial-caption-text ms-2",
169
+ children: F.version
170
+ })
171
+ ] }),
172
+ className: "text-secondary"
173
+ }), /* @__PURE__ */ S("div", {
146
174
  role: "toolbar",
147
- "aria-label": w,
148
- className: "flex items-center gap-1",
149
- children: [/* @__PURE__ */ y(s, {
150
- icon: /* @__PURE__ */ y(f, {
175
+ "aria-label": O,
176
+ className: "flex shrink-0 items-center gap-1",
177
+ children: [/* @__PURE__ */ x(c, {
178
+ icon: /* @__PURE__ */ x(p, {
151
179
  size: i.SM,
152
180
  stroke: a,
153
181
  "aria-hidden": !0
154
182
  }),
155
- "aria-label": C,
183
+ "aria-label": D,
156
184
  size: o.Small,
157
- onClick: N
158
- }), /* @__PURE__ */ y(s, {
159
- icon: /* @__PURE__ */ y(d, {
185
+ onClick: V
186
+ }), /* @__PURE__ */ x(c, {
187
+ icon: /* @__PURE__ */ x(f, {
160
188
  size: i.SM,
161
189
  stroke: a,
162
190
  "aria-hidden": !0
163
191
  }),
164
- "aria-label": v,
192
+ "aria-label": E,
165
193
  size: o.Small,
166
- onClick: _
194
+ onClick: T
167
195
  })]
168
- })
169
- }), /* @__PURE__ */ b("div", {
196
+ })]
197
+ }), /* @__PURE__ */ x("div", {
170
198
  className: "relative min-h-[200px] w-full",
171
- children: [
172
- k === S.Loading && /* @__PURE__ */ y("div", {
199
+ children: A ? /* @__PURE__ */ x("div", {
200
+ role: "status",
201
+ "aria-live": "polite",
202
+ className: "absolute inset-0 flex items-center justify-center p-4",
203
+ children: /* @__PURE__ */ x("span", {
204
+ className: "dial-body-text text-center text-secondary",
205
+ children: j
206
+ })
207
+ }) : /* @__PURE__ */ S(b, { children: [
208
+ z === w.Loading && /* @__PURE__ */ x("div", {
173
209
  className: "absolute inset-0 flex items-center justify-center",
174
- children: /* @__PURE__ */ y(c, {})
210
+ children: /* @__PURE__ */ x(l, {})
175
211
  }),
176
- k === S.Error && /* @__PURE__ */ b("div", {
212
+ z === w.Error && /* @__PURE__ */ S("div", {
177
213
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2 p-4",
178
- children: [/* @__PURE__ */ y(u, {
214
+ children: [/* @__PURE__ */ x(d, {
179
215
  size: 40,
180
216
  stroke: a,
181
217
  "aria-hidden": !0,
182
218
  className: "text-error"
183
- }), /* @__PURE__ */ y("p", {
219
+ }), /* @__PURE__ */ x("p", {
184
220
  role: "alert",
185
221
  className: "dial-body-text text-center text-primary",
186
- children: T
222
+ children: k
187
223
  })]
188
224
  }),
189
- k === S.Ready && A && /* @__PURE__ */ y(t, {
190
- content: A,
191
- errorLabel: T
225
+ z === w.Ready && B && /* @__PURE__ */ x(t, {
226
+ content: B,
227
+ errorLabel: k,
228
+ onAppInfo: I
192
229
  })
193
- ]
230
+ ] })
194
231
  })]
195
232
  });
196
- }), P = 900 * 1e3, F = (e) => {
197
- let t = _(/* @__PURE__ */ new Map()), n = _(/* @__PURE__ */ new Map());
198
- return g(() => {
233
+ }), I = 900 * 1e3, L = (e) => {
234
+ let t = v(/* @__PURE__ */ new Map()), n = v(/* @__PURE__ */ new Map());
235
+ return _(() => {
199
236
  let r = (t) => `${e}:${t}`, i = (e, t) => `${r(e)}::${t ?? ""}`, a = (e, n) => {
200
237
  let i = t.current.get(r(e));
201
- if (i != null && i.seedKey === n && !(Date.now() - i.cachedAt > P)) return {
238
+ if (i != null && i.seedKey === n && !(Date.now() - i.cachedAt > I)) return {
202
239
  html: i.html,
203
240
  toolResult: i.toolResult
204
241
  };
205
242
  }, o = (e, n, i) => {
206
243
  let a = Date.now();
207
- for (let [e, n] of t.current) a - n.cachedAt > P && t.current.delete(e);
244
+ for (let [e, n] of t.current) a - n.cachedAt > I && t.current.delete(e);
208
245
  t.current.set(r(e), {
209
246
  ...n,
210
247
  seedKey: i,
@@ -231,4 +268,4 @@ var x = {
231
268
  }, [e]);
232
269
  };
233
270
  //#endregion
234
- export { x as MCP_APPS_CLASS, N as McpAppInlinePreview, S as McpAppInlinePreviewStatus, T as collectToolCallNames, O as computeMcpAppSeedKey, E as findMcpAppForMessage, D as mcpAppCanvasKey, k as resolveMcpAppToolCallSeed, A as resolveMcpAppToolResult, j as useMcpAppInlinePreview, F as useMcpAppResponseCache };
271
+ export { C as MCP_APPS_CLASS, F as McpAppInlinePreview, w as McpAppInlinePreviewStatus, D as collectToolCallNames, A as computeMcpAppSeedKey, O as findMcpAppForMessage, k as mcpAppCanvasKey, j as resolveMcpAppToolCallSeed, M as resolveMcpAppToolResult, N as useMcpAppInlinePreview, L as useMcpAppResponseCache };
@@ -1,5 +1,5 @@
1
1
  import { McpUiHostContext } from '@mcp-ui/client';
2
- import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
2
+ import { CallToolResult, Implementation } from '@modelcontextprotocol/sdk/types.js';
3
3
  /** Which of the host's two MCP proxy routes a deployment id resolves through — a plain toolset, or an application that is itself an MCP server. */
4
4
  export type McpDeploymentKind = 'toolset' | 'application';
5
5
  /**
@@ -92,6 +92,8 @@ export declare enum McpAppInlinePreviewStatus {
92
92
  export interface McpAppHostAdapter {
93
93
  /** `McpUiHostContext` to deliver to the mounted app's `ui/initialize` handshake. */
94
94
  hostContext: McpUiHostContext;
95
+ /** Host identity (`name`/`version`) to deliver to the mounted app's `ui/initialize` handshake. */
96
+ hostInfo: Implementation;
95
97
  /** Operator-configured MCP Apps sandbox-proxy URL, or `null` when unconfigured. */
96
98
  sandboxUrl: string | null;
97
99
  /** Fetches the matched tool's MCP Apps `ui://` resource. */
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-apps.d.ts","sourceRoot":"","sources":["../../src/models/mcp-apps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,mJAAmJ;AACnJ,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,aAAa,CAAC;AAE1D;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAExD,yFAAyF;AACzF,MAAM,WAAW,aAAa;IAC5B,iEAAiE;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,oIAAoI;IACpI,QAAQ,EAAE,MAAM,CAAC;IACjB,mIAAmI;IACnI,WAAW,EAAE,MAAM,CAAC;IACpB,mGAAmG;IACnG,IAAI,EAAE,iBAAiB,CAAC;IACxB,gEAAgE;IAChE,SAAS,EAAE,mBAAmB,CAAC;CAChC;AAED,sJAAsJ;AACtJ,MAAM,WAAW,kBAAkB;IACjC,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,gDAAgD;IAChD,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B;AAED,+GAA+G;AAC/G,MAAM,MAAM,uBAAuB,GAAG,CACpC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,KAChB,OAAO,CAAC,MAAM,CAAC,CAAC;AAErB,8FAA8F;AAC9F,MAAM,MAAM,cAAc,GAAG,CAC3B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,iBAAiB,KACpB,OAAO,CAAC,cAAc,C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E;IACrE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B"}
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.2.0-dev.61",
4
+ "version": "1.2.0-dev.72",
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.2.0-dev.61"
23
+ "@epam/ai-dial-attachment-canvas": "1.2.0-dev.72"
24
24
  },
25
25
  "peerDependencies": {
26
- "@epam/ai-dial-chat-shared": "1.2.0-dev.61",
26
+ "@epam/ai-dial-chat-shared": "1.2.0-dev.72",
27
27
  "@epam/ai-dial-ui-kit": "^0.15.0-dev.9",
28
28
  "react": "^19.2.8"
29
29
  },