@mcp-use/inspector 20.0.0-beta.14 → 20.0.0-beta.15

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 (139) hide show
  1. package/dist/cdn/inspector.js +76858 -9272
  2. package/dist/cli.js +1 -1
  3. package/dist/server/cdn-shell.js +2 -2
  4. package/dist/server/{chunk-3XD7J5NX.js → chunk-WNQGHIZ3.js} +1 -1
  5. package/dist/server/{chunk-DLHO3Q42.js → chunk-XKCUJ6ZJ.js} +1 -1
  6. package/dist/server/{chunk-N3VXWLT6.js → chunk-ZPGABKXL.js} +1 -1
  7. package/dist/server/cli.js +2 -2
  8. package/dist/server/index.js +3 -3
  9. package/dist/server/middleware.js +3 -3
  10. package/dist/server/version.js +1 -1
  11. package/dist/web/assets/index-Bqfsh_Rp.js +643 -0
  12. package/dist/web/index.html +2 -10
  13. package/package.json +1 -1
  14. package/dist/cdn/AnimatePresence-D1bZ5_-l.js +0 -394
  15. package/dist/cdn/ChatTab-D_2TXR3X.js +0 -6811
  16. package/dist/cdn/CheckboxIndicator-BjF73mGX.js +0 -252
  17. package/dist/cdn/ConnectionSettingsForm-BqH0PcZF.js +0 -929
  18. package/dist/cdn/ConnectionSettingsTab-Duhb1uQP.js +0 -151
  19. package/dist/cdn/ElicitationTab-PEmEDvC5.js +0 -655
  20. package/dist/cdn/FormContext-NtUiZclE.js +0 -135
  21. package/dist/cdn/InspectorContext-BBKCdfmK.js +0 -123
  22. package/dist/cdn/JSONDisplay-BJqMz7Ny.js +0 -324
  23. package/dist/cdn/ListTabHeader-DzmTtN1e.js +0 -89
  24. package/dist/cdn/MCPAppsDebugControls-w5NRWhlZ.js +0 -2174
  25. package/dist/cdn/ManufactOAuthCallback-ChbbjFIT.js +0 -31
  26. package/dist/cdn/MarkdownRenderer-BIsUE0bf.js +0 -3610
  27. package/dist/cdn/McpAppsViewPanel-B3_76u7O.js +0 -56
  28. package/dist/cdn/NotificationsTab-B7uebqMV.js +0 -290
  29. package/dist/cdn/OAuthCallback-CtLoXa3h.js +0 -58
  30. package/dist/cdn/PromptsTab-DpE0XLzk.js +0 -902
  31. package/dist/cdn/ResourcesTab-DQS24z5p.js +0 -566
  32. package/dist/cdn/SamplingTab-ZDeu0CjJ.js +0 -659
  33. package/dist/cdn/ServerMetadataTab-BM3VhSLf.js +0 -244
  34. package/dist/cdn/StatusIcon-Q3n3YRtE.js +0 -65
  35. package/dist/cdn/ToolsTab-LtviZSWA.js +0 -2045
  36. package/dist/cdn/ViewPreview-BwC_tbF_.js +0 -238
  37. package/dist/cdn/WidgetDebugContext-B6yoOVVV.js +0 -314
  38. package/dist/cdn/WidgetWrapper-BlbQAh_X.js +0 -12
  39. package/dist/cdn/basePath-B8HuhIMu.js +0 -25
  40. package/dist/cdn/bell-GrTZcnD2.js +0 -10
  41. package/dist/cdn/browser-DG2Z8392.js +0 -42
  42. package/dist/cdn/brush-CelVvMGp.js +0 -17
  43. package/dist/cdn/button-CB4uOoUV.js +0 -2509
  44. package/dist/cdn/card-BA-DQk-G.js +0 -41
  45. package/dist/cdn/cfWorker-Bxcs9rNe.js +0 -10799
  46. package/dist/cdn/checkbox-kwVa4gRX.js +0 -20
  47. package/dist/cdn/chunk-QUQL4437-XnDcYQEx.js +0 -1508
  48. package/dist/cdn/clock-YMF8Gtw5.js +0 -12
  49. package/dist/cdn/code-C8sN2OGR.js +0 -10
  50. package/dist/cdn/createLucideIcon-BONxC1L5.js +0 -213
  51. package/dist/cdn/dialog-CJGnC5Ag.js +0 -1028
  52. package/dist/cdn/dist-CHKts0NS.js +0 -2307
  53. package/dist/cdn/dist-CTJnCYmk.js +0 -616
  54. package/dist/cdn/external-link-Bo4lQxr1.js +0 -17
  55. package/dist/cdn/eye-pSGG7nvf.js +0 -29
  56. package/dist/cdn/folder-open-aM8CPtBO.js +0 -7
  57. package/dist/cdn/hash-DDs2vE1k.js +0 -33
  58. package/dist/cdn/history-BfUFpL1d.js +0 -17
  59. package/dist/cdn/index-browser-DO-sd0TA.js +0 -1853
  60. package/dist/cdn/info-BMkB68mB.js +0 -19
  61. package/dist/cdn/input-BCpgLXU1.js +0 -9654
  62. package/dist/cdn/inspector-settings-layout-0VDsjeqb.js +0 -4
  63. package/dist/cdn/label-A0UGV8FE.js +0 -60
  64. package/dist/cdn/loader-circle-BKRHJEB7.js +0 -7
  65. package/dist/cdn/manufact-auth-BQMHhbLV.js +0 -423
  66. package/dist/cdn/maximize-2-DdrB_spi.js +0 -21
  67. package/dist/cdn/maximize-hSOCz133.js +0 -21
  68. package/dist/cdn/message-square-D3tKB3uJ.js +0 -7
  69. package/dist/cdn/not-found-BajFyZpp.js +0 -32
  70. package/dist/cdn/play-B1leulYf.js +0 -7
  71. package/dist/cdn/providerMeta-CjGU4rID.js +0 -436
  72. package/dist/cdn/react-BDA-xrgK.js +0 -5421
  73. package/dist/cdn/react-BIs9pQ3H.js +0 -926
  74. package/dist/cdn/refresh-cw-CyvXrS91.js +0 -21
  75. package/dist/cdn/save-CmdEPUAm.js +0 -34
  76. package/dist/cdn/schemaHelpers-DTV38jGq.js +0 -16
  77. package/dist/cdn/select-CCFHjOGk.js +0 -2595
  78. package/dist/cdn/servers-Dd0Vcp81.js +0 -30
  79. package/dist/cdn/shared-CJVHJhag.js +0 -1700
  80. package/dist/cdn/sheet-oyq1mIyg.js +0 -2078
  81. package/dist/cdn/sparkles-CxeZpVtX.js +0 -23
  82. package/dist/cdn/spinner-Be1GlSGX.js +0 -15
  83. package/dist/cdn/square-check-big-C_4wbfwF.js +0 -10
  84. package/dist/cdn/switch-DHXEA_N5.js +0 -665
  85. package/dist/cdn/tabs-subtle-Dubd6Kj8.js +0 -788
  86. package/dist/cdn/telemetry-e4uEESP7.js +0 -208
  87. package/dist/cdn/textarea-CwmI8_uI.js +0 -14
  88. package/dist/cdn/trash-2-BhumJAFE.js +0 -25
  89. package/dist/cdn/useAriaLabelledBy-Cra6w3YY.js +0 -30
  90. package/dist/cdn/useCompositeItem-Dhnm-7el.js +0 -26
  91. package/dist/cdn/useConfig-Dw_6Ztzr.js +0 -235
  92. package/dist/cdn/useSavedRequests-mSIsDd4c.js +0 -51
  93. package/dist/cdn/useViewHostProps-BPApUBaM.js +0 -364
  94. package/dist/cdn/wrench-DvK20LUT.js +0 -7
  95. package/dist/cdn/x-EilKPiCX.js +0 -10
  96. package/dist/cdn/zap-0Wr9QO7N.js +0 -10
  97. package/dist/web/assets/AnimatePresence-FfDQQNFJ.js +0 -9
  98. package/dist/web/assets/ChatTab-BhoU_ges.js +0 -18
  99. package/dist/web/assets/ConnectionSettingsTab-vJcr7uI3.js +0 -1
  100. package/dist/web/assets/ElicitationTab-4my-wtXf.js +0 -1
  101. package/dist/web/assets/FormContext-sV-yByKz.js +0 -1
  102. package/dist/web/assets/ListTabHeader-CrGae306.js +0 -1
  103. package/dist/web/assets/MCPAppsDebugControls-Cd4s9mr1.js +0 -34
  104. package/dist/web/assets/ManufactOAuthCallback-CCRWJhuT.js +0 -1
  105. package/dist/web/assets/MarkdownRenderer-BUDZYHqm.js +0 -47
  106. package/dist/web/assets/McpAppsViewPanel-Cil7Fdy4.js +0 -1
  107. package/dist/web/assets/NotificationsTab-Bl3O5PRb.js +0 -1
  108. package/dist/web/assets/OAuthCallback-CceVgo-9.js +0 -1
  109. package/dist/web/assets/PromptsTab-8lSxb8x-.js +0 -15
  110. package/dist/web/assets/ResourcesTab-DtGfgsPv.js +0 -2
  111. package/dist/web/assets/SamplingTab-XC-DTfOo.js +0 -1
  112. package/dist/web/assets/ServerMetadataTab-C5d_dI3_.js +0 -1
  113. package/dist/web/assets/ToolsTab-DuHPXItY.js +0 -8
  114. package/dist/web/assets/ViewPreview-DXswO9q8.js +0 -1
  115. package/dist/web/assets/WidgetWrapper-cv_BM1bY.js +0 -1
  116. package/dist/web/assets/brush-DX0UZ_pI.js +0 -1
  117. package/dist/web/assets/button-C8Xa2k4x.js +0 -1
  118. package/dist/web/assets/checkbox-DAfdiGl1.js +0 -1
  119. package/dist/web/assets/code-B14rVdNt.js +0 -1
  120. package/dist/web/assets/createLucideIcon-BEHeJH0M.js +0 -1
  121. package/dist/web/assets/dist-C2Y1wkk6.js +0 -21
  122. package/dist/web/assets/index-tu5-QdSJ.js +0 -499
  123. package/dist/web/assets/input-C0OQCUZy.js +0 -1
  124. package/dist/web/assets/inspector-settings-layout-yjKRJDai.js +0 -1
  125. package/dist/web/assets/label-CI7JWQOo.js +0 -1
  126. package/dist/web/assets/maximize-2-Br1WQzT2.js +0 -1
  127. package/dist/web/assets/maximize-CJNgRe6S.js +0 -1
  128. package/dist/web/assets/react-CU_d2d5K.js +0 -1
  129. package/dist/web/assets/refresh-cw-B5iaAZKn.js +0 -1
  130. package/dist/web/assets/save-TM6fvNrt.js +0 -1
  131. package/dist/web/assets/schemaHelpers-DLNTQr_6.js +0 -1
  132. package/dist/web/assets/select-D6jzbLJn.js +0 -1
  133. package/dist/web/assets/shared-c1Yr-wvV.js +0 -1
  134. package/dist/web/assets/sparkles-BGYTDThM.js +0 -1
  135. package/dist/web/assets/tabs-subtle-CHvFXVIA.js +0 -1
  136. package/dist/web/assets/textarea-CRTXuRmE.js +0 -1
  137. package/dist/web/assets/useConfig-9UVqLmR_.js +0 -1
  138. package/dist/web/assets/useViewHostProps-BBoPQYEl.js +0 -1
  139. package/dist/web/assets/zap-BDWHCVHU.js +0 -1
@@ -1,364 +0,0 @@
1
- import { s as e, t } from "./react-BIs9pQ3H.js";
2
- import { n } from "./createLucideIcon-BONxC1L5.js";
3
- import { t as r } from "./button-CB4uOoUV.js";
4
- import { t as i } from "./x-EilKPiCX.js";
5
- import { d as a } from "./react-BDA-xrgK.js";
6
- import { n as o, r as s } from "./servers-Dd0Vcp81.js";
7
- import { i as c, r as l, s as u, t as d } from "./WidgetDebugContext-B6yoOVVV.js";
8
- //#region src/client/console-log-bus.ts
9
- var f = /* @__PURE__ */ e(t(), 1), p = new class {
10
- listeners = /* @__PURE__ */ new Set();
11
- publish(e) {
12
- this.listeners.forEach((t) => {
13
- try {
14
- t(e);
15
- } catch (e) {
16
- console.error("[ConsoleLogBus] Error in listener:", e);
17
- }
18
- });
19
- }
20
- subscribe(e) {
21
- return this.listeners.add(e), () => this.listeners.delete(e);
22
- }
23
- }();
24
- //#endregion
25
- //#region src/client/mcp-apps/csp.ts
26
- function m(e) {
27
- let t = (e) => e.replace(/['"<>;]/g, "").trim(), n = (e.connectDomains || []).map(t).filter(Boolean), r = (e.resourceDomains || []).map(t).filter(Boolean), i = (e.frameDomains || []).map(t).filter(Boolean), a = (e.baseUriDomains || []).map(t).filter(Boolean), o = n.length > 0 ? n.join(" ") : "'none'", s = r.length > 0 ? [
28
- "data:",
29
- "blob:",
30
- ...r
31
- ].join(" ") : "data: blob:", c = i.length > 0 ? i.join(" ") : "'none'", l = a.length > 0 ? a.join(" ") : "'none'";
32
- return [
33
- "default-src 'none'",
34
- `script-src 'unsafe-inline' ${s}`,
35
- `style-src 'unsafe-inline' ${s}`,
36
- `img-src ${s}`,
37
- `font-src ${s}`,
38
- `media-src ${s}`,
39
- `connect-src ${o}`,
40
- `frame-src ${c}`,
41
- "object-src 'none'",
42
- `base-uri ${l}`
43
- ].join("; ");
44
- }
45
- function h(e) {
46
- if (!e) return {};
47
- let t = {};
48
- for (let n of e.split(";")) {
49
- let [e, ...r] = n.trim().split(/\s+/);
50
- e && (t[e.toLowerCase()] = r);
51
- }
52
- return t;
53
- }
54
- function g(e) {
55
- return e ? h(m(e)) : {};
56
- }
57
- function _(e) {
58
- return h(e);
59
- }
60
- function v(e) {
61
- let t = {};
62
- for (let n of e) {
63
- let e = (n.effectiveDirective || n.directive || "unknown").toLowerCase(), r = n.blockedUri || "(inline)";
64
- t[e] = Array.from(new Set([...t[e] ?? [], r])).sort();
65
- }
66
- return t;
67
- }
68
- function y(e, t) {
69
- return Array.from(new Set([...Object.keys(e), ...Object.keys(t)])).sort().map((n) => {
70
- let r = e[n] ?? [], i = t[n] ?? [], a = Array.from(new Set(r)).sort(), o = Array.from(new Set(i)).sort();
71
- return {
72
- directive: n,
73
- requested: r,
74
- effective: i,
75
- status: a.length === o.length && a.every((e, t) => e === o[t]) ? "same" : r.length === 0 ? "added" : i.length === 0 ? "missing" : "changed"
76
- };
77
- });
78
- }
79
- function b(e) {
80
- let t = [];
81
- e.declared || t.push({
82
- severity: "warning",
83
- title: "No widget CSP declared",
84
- detail: "Widget-declared mode blocks external connections and resources."
85
- }), e.mode === "permissive" && t.push({
86
- severity: "info",
87
- title: "Permissive mode",
88
- detail: "Observed violations are requests a declared policy would block."
89
- });
90
- let n = v(e.violations);
91
- for (let [r, i] of Object.entries(n)) t.push({
92
- severity: e.mode === "permissive" ? "warning" : "error",
93
- title: `${i.length} blocked by ${r}`,
94
- detail: i.join(", ")
95
- });
96
- return t.length === 0 && t.push({
97
- severity: "info",
98
- title: "No CSP issues observed",
99
- detail: e.effectivePolicy ? "The effective policy has not produced violations." : "Load the widget to observe its effective policy."
100
- }), t;
101
- }
102
- //#endregion
103
- //#region src/client/mcp-apps/logging-transport.ts
104
- function x(e, t, n) {
105
- let r = {
106
- get sessionId() {
107
- return e.sessionId;
108
- },
109
- set sessionId(t) {
110
- e.sessionId = t;
111
- },
112
- setProtocolVersion: e.setProtocolVersion ? (t) => e.setProtocolVersion?.(t) : void 0,
113
- async start() {
114
- return e.start();
115
- },
116
- async send(r, i) {
117
- return c.publish({
118
- source: "widget",
119
- serverId: t,
120
- widgetId: n,
121
- direction: "send",
122
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
123
- message: r
124
- }), e.send(r, i);
125
- },
126
- async close() {
127
- return e.close();
128
- },
129
- onclose: void 0,
130
- onerror: void 0,
131
- onmessage: void 0
132
- };
133
- return Object.defineProperty(r, "onmessage", {
134
- configurable: !0,
135
- enumerable: !0,
136
- get() {
137
- return e.onmessage;
138
- },
139
- set(r) {
140
- if (!r) {
141
- e.onmessage = void 0;
142
- return;
143
- }
144
- e.onmessage = (e, i) => {
145
- c.publish({
146
- source: "widget",
147
- serverId: t,
148
- widgetId: n,
149
- direction: "receive",
150
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
151
- message: e
152
- }), r(e, i);
153
- };
154
- }
155
- }), Object.defineProperty(r, "onclose", {
156
- configurable: !0,
157
- enumerable: !0,
158
- get() {
159
- return e.onclose;
160
- },
161
- set(t) {
162
- e.onclose = t;
163
- }
164
- }), Object.defineProperty(r, "onerror", {
165
- configurable: !0,
166
- enumerable: !0,
167
- get() {
168
- return e.onerror;
169
- },
170
- set(t) {
171
- e.onerror = t;
172
- }
173
- }), r;
174
- }
175
- //#endregion
176
- //#region src/client/hooks/useDeviceViewport.ts
177
- function S(e) {
178
- return (0, f.useMemo)(() => ({
179
- maxWidth: d[e].width,
180
- maxHeight: d[e].height
181
- }), [e]);
182
- }
183
- //#endregion
184
- //#region src/client/hooks/useMcpAppsHostContext.ts
185
- function C(e, t) {
186
- return e.getPropertyValue(t).trim();
187
- }
188
- function w() {
189
- if (typeof window > "u") return {};
190
- let e = getComputedStyle(document.documentElement), t = {}, n = (e, n) => {
191
- n && (t[e] = n);
192
- }, r = C(e, "--background"), i = C(e, "--foreground"), a = C(e, "--card"), o = C(e, "--muted"), s = C(e, "--muted-foreground"), c = C(e, "--primary"), l = C(e, "--primary-foreground"), u = C(e, "--secondary"), d = C(e, "--accent"), f = C(e, "--accent-foreground"), p = C(e, "--destructive"), m = C(e, "--border"), h = C(e, "--ring"), g = C(e, "--radius");
193
- return n("--color-background-primary", r), n("--color-background-secondary", a || u), n("--color-background-tertiary", o || d), n("--color-background-inverse", c), n("--color-background-ghost", d || o), n("--color-background-danger", p), n("--color-text-primary", i), n("--color-text-secondary", s), n("--color-text-tertiary", s), n("--color-text-inverse", l), n("--color-text-ghost", f || s), n("--color-text-danger", p), n("--color-border-primary", m), n("--color-border-secondary", m), n("--color-border-tertiary", m), n("--color-ring-primary", h || m), n("--border-radius-sm", g), n("--border-radius-md", g), n("--border-radius-lg", g), n("--font-sans", "system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif"), t;
194
- }
195
- function T({ theme: e, displayMode: t, maxWidth: n, maxHeight: r, playground: i, deviceType: a, toolCallId: o, toolName: s, toolInput: c, toolOutput: l, toolMetadata: u, tool: d }) {
196
- return (0, f.useMemo)(() => ({
197
- theme: e,
198
- displayMode: t,
199
- availableDisplayModes: [
200
- "inline",
201
- "pip",
202
- "fullscreen"
203
- ],
204
- containerDimensions: {
205
- maxHeight: r,
206
- maxWidth: n
207
- },
208
- locale: i.locale,
209
- timeZone: i.timeZone,
210
- platform: a === "mobile" ? "mobile" : "web",
211
- userAgent: "mcp-use-inspector/0.16.2",
212
- deviceCapabilities: i.capabilities,
213
- safeAreaInsets: i.safeAreaInsets,
214
- styles: { variables: w() },
215
- toolInfo: d ? {
216
- id: o,
217
- tool: d
218
- } : void 0
219
- }), [
220
- e,
221
- t,
222
- r,
223
- n,
224
- i.locale,
225
- i.timeZone,
226
- i.capabilities,
227
- i.safeAreaInsets,
228
- a,
229
- o,
230
- s,
231
- c,
232
- l,
233
- u,
234
- d
235
- ]);
236
- }
237
- //#endregion
238
- //#region src/client/hooks/useViewHostProps.tsx
239
- var E = n(), D = {
240
- name: "mcp-use-inspector",
241
- version: "11.0.0"
242
- };
243
- function O(e, t) {
244
- let n = (0, f.useRef)(e);
245
- n.current = e;
246
- let r = (0, f.useRef)(t);
247
- return r.current = t, (0, f.useMemo)(() => e ? {
248
- callTool: (e, t, r) => n.current.callTool(e, t ?? {}, r),
249
- readResource: (e) => r.current(e),
250
- get resources() {
251
- return n.current?.resources;
252
- }
253
- } : null, [e?.id]);
254
- }
255
- function k(e) {
256
- let { serverId: t, viewId: n, resourceUri: c, toolName: d, toolInput: h, toolOutput: g, toolMetadata: _, tool: v, readResource: y, displayMode: b, onDisplayModeChange: C, inlineMaxWidth: w, chromeless: k, onReady: A } = e, { resolvedTheme: j } = u(), { servers: M } = a(), N = M.find((e) => e.id === t), { playground: P, addWidget: F, removeWidget: I, addCspViolation: L, setWidgetModelContext: R, setWidgetDeclaredCsp: z } = l(), B = P.cspMode === "permissive" ? "permissive" : "widget-declared", { maxWidth: V, maxHeight: H } = S(P.deviceType), U = T({
257
- theme: j,
258
- displayMode: b ?? "inline",
259
- maxWidth: V,
260
- maxHeight: H,
261
- playground: P,
262
- deviceType: P.deviceType,
263
- toolCallId: n,
264
- toolName: d,
265
- toolInput: h,
266
- toolOutput: g,
267
- toolMetadata: _,
268
- tool: v
269
- }), W = (0, f.useRef)(U);
270
- W.current = U;
271
- let G = O(N, y), K = (0, f.useMemo)(() => G ? {
272
- kind: "live",
273
- connection: G,
274
- resourceUri: c
275
- } : null, [G, c]), q = (0, f.useCallback)((e) => x(e, t, n), [t, n]), J = (0, f.useCallback)((e) => {
276
- F(n, {
277
- toolName: d,
278
- protocol: "mcp-apps",
279
- hostContext: W.current
280
- });
281
- let t = e.declaredCsp, r;
282
- B === "permissive" ? r = [
283
- "default-src * 'unsafe-inline' 'unsafe-eval' data: blob: filesystem: about:",
284
- "script-src * 'unsafe-inline' 'unsafe-eval' data: blob:",
285
- "style-src * 'unsafe-inline' data: blob:",
286
- "img-src * data: blob: https: http:",
287
- "media-src * data: blob: https: http:",
288
- "font-src * data: blob: https: http:",
289
- "connect-src * data: blob: https: http: ws: wss: about:",
290
- "frame-src * data: blob: https: http: about:",
291
- "object-src * data: blob:",
292
- "base-uri *",
293
- "form-action *"
294
- ].join("; ") : t && (r = m(t)), z(n, t, r);
295
- }, [
296
- F,
297
- n,
298
- d,
299
- B,
300
- z
301
- ]);
302
- (0, f.useEffect)(() => () => I(n), [n, I]);
303
- let Y = (0, f.useCallback)((e) => {
304
- L(n, {
305
- directive: e.directive,
306
- effectiveDirective: e.effectiveDirective ?? e.directive,
307
- blockedUri: e.blockedUri,
308
- sourceFile: e.sourceFile ?? void 0,
309
- lineNumber: e.lineNumber ?? void 0,
310
- columnNumber: e.columnNumber ?? void 0,
311
- originalPolicy: e.originalPolicy,
312
- timestamp: e.timestamp
313
- });
314
- }, [L, n]), X = (0, f.useCallback)(({ content: e, structuredContent: t }) => {
315
- R(n, {
316
- content: e,
317
- structuredContent: t
318
- });
319
- try {
320
- localStorage.setItem(`mcp-use:widget-state:${n}`, JSON.stringify(t));
321
- } catch {}
322
- }, [R, n]), Z = (0, f.useCallback)(({ level: e, data: t }) => {
323
- let n = e === "warning" ? "warn" : e === "error" ? "error" : "log";
324
- p.publish({
325
- level: n,
326
- args: Array.isArray(t) ? t : [t],
327
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
328
- url: c
329
- });
330
- }, [c]), Q = (0, f.useMemo)(() => ({
331
- title: N ? o(N) : "MCP Server",
332
- iconUrl: N ? s(N) : null
333
- }), [N]), $ = (0, f.useCallback)(({ onClick: e, "data-testid": t, "aria-label": n }) => /* @__PURE__ */ (0, E.jsx)(r, {
334
- type: "button",
335
- variant: "tertiary",
336
- size: "icon-sm",
337
- className: "rounded-full shadow-sm",
338
- "data-testid": t,
339
- "aria-label": n,
340
- onClick: e,
341
- children: /* @__PURE__ */ (0, E.jsx)(i, {})
342
- }), []);
343
- return K ? {
344
- source: K,
345
- hostInfo: D,
346
- hostContext: U,
347
- cspMode: B,
348
- wrapTransport: q,
349
- onCspViolation: Y,
350
- onModelContextUpdate: X,
351
- onLog: Z,
352
- onResourceResolved: J,
353
- displayMode: b,
354
- onDisplayModeChange: C,
355
- inlineMaxWidth: w ?? (P.deviceType === "mobile" ? V : void 0),
356
- chromeless: k,
357
- onReady: A,
358
- mockOpenAiFileApis: !0,
359
- fullscreenHeader: Q,
360
- renderFullscreenClose: $
361
- } : null;
362
- }
363
- //#endregion
364
- export { g as a, _ as i, b as n, p as o, y as r, k as t };
@@ -1,7 +0,0 @@
1
- import { t as e } from "./createLucideIcon-BONxC1L5.js";
2
- var t = e("wrench", [["path", {
3
- d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",
4
- key: "1ngwbx"
5
- }]]);
6
- //#endregion
7
- export { t };
@@ -1,10 +0,0 @@
1
- import { t as e } from "./createLucideIcon-BONxC1L5.js";
2
- var t = e("x", [["path", {
3
- d: "M18 6 6 18",
4
- key: "1bl5f8"
5
- }], ["path", {
6
- d: "m6 6 12 12",
7
- key: "d8bk6v"
8
- }]]);
9
- //#endregion
10
- export { t };
@@ -1,10 +0,0 @@
1
- import { t as e } from "./createLucideIcon-BONxC1L5.js";
2
- var t = e("chevron-left", [["path", {
3
- d: "m15 18-6-6 6-6",
4
- key: "1wnfg3"
5
- }]]), n = e("zap", [["path", {
6
- d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",
7
- key: "1xq2db"
8
- }]]);
9
- //#endregion
10
- export { t as n, n as t };
@@ -1,9 +0,0 @@
1
- import{s as e,t}from"./react-CU_d2d5K.js";import{C as n,H as r,U as i,V as a,W as o,m as s,p as c}from"./input-C0OQCUZy.js";import{n as l}from"./createLucideIcon-BEHeJH0M.js";import{_ as u,g as d,j as f,v as p}from"./button-C8Xa2k4x.js";var m=e(t(),1),h=m.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function g(){return m.useContext(h)}var _=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function v(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:f}=g(),p=m.useRef(-1),[h,v]=m.useState(a??(i===_.GuessFromOrder?()=>{if(p.current===-1){let e=f.current;f.current+=1,p.current=e}return p.current}:-1)),y=m.useRef(null),b=m.useCallback(e=>{if(y.current=e,h!==-1&&e!==null&&(l.current[h]=e,u)){let n=t!==void 0;u.current[h]=n?t:r?.current?.textContent??e.textContent}},[h,l,u,t,r]);return d(()=>{if(a!=null)return;let e=y.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),d(()=>{if(a==null)return c(e=>{let t=y.current?e.get(y.current)?.index:null;t!=null&&v(t)})},[a,c,v]),{ref:b,index:h}}var y=`ArrowUp`,b=`ArrowDown`,x=`ArrowLeft`,S=`ArrowRight`,C=`Home`,w=new Set([x,S]),T=new Set([x,S,C,`End`]),E=new Set([y,b]),D=new Set([y,b,C,`End`]),O=new Set([...w,...E]),k=new Set([...O,C,`End`]),A=`Shift`,j=new Set([A,`Control`,`Alt`,`Meta`]);function M(e){return f(e)&&e.tagName===`INPUT`}function N(e){return!!(M(e)&&e.selectionStart!=null||f(e)&&e.tagName===`TEXTAREA`)}function P(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=F(e,t,`left`),a=I(e),o=I(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginRight<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=F(e,t,`top`),r=I(e),i=I(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function F(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function I(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var L=l();function R(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=u(i),o=m.useRef(0),s=p(B).current,c=p(z).current,[l,f]=m.useState(0),g=m.useRef(l),_=u((e,t)=>{c.set(e,t??null),g.current+=1,f(g.current)}),v=u(e=>{c.delete(e),g.current+=1,f(g.current)}),y=m.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(V).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);d(()=>{if(typeof MutationObserver!=`function`||y.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(g.current+=1,f(g.current))});return y.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[y]),d(()=>{g.current===l&&(n.current.length!==y.size&&(n.current.length=y.size),r&&r.current.length!==y.size&&(r.current.length=y.size),o.current=y.size),a(y)},[a,y,n,r,l]),d(()=>()=>{n.current=[]},[n]),d(()=>()=>{r&&(r.current=[])},[r]);let b=u(e=>(s.add(e),()=>{s.delete(e)}));d(()=>{s.forEach(e=>e(y))},[s,y]);let x=m.useMemo(()=>({register:_,unregister:v,subscribeMapChange:b,elementsRef:n,labelsRef:r,nextIndexRef:o}),[_,v,b,n,r,o]);return(0,L.jsx)(h.Provider,{value:x,children:t})}function z(){return new Map}function B(){return new Set}function V(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function H(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function U(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function W(...e){return t=>{let n=!1,r=e.map(e=>{let r=U(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():U(e[t],null)}}}}function G(...e){return m.useCallback(W(...e),e)}var K=class extends m.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(n(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,r=n(e)&&e.offsetWidth||0,i=n(e)&&e.offsetHeight||0,a=getComputedStyle(t),o=this.props.sizeRef.current;o.height=parseFloat(a.height),o.width=parseFloat(a.width),o.top=t.offsetTop,o.left=t.offsetLeft,o.right=r-o.width-o.left,o.bottom=i-o.height-o.top,o.direction=a.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function q({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,m.useId)(),c=(0,m.useRef)(null),l=(0,m.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:u}=(0,m.useContext)(s),d=G(c,e.props?.ref??e?.ref);return(0,m.useInsertionEffect)(()=>{let{width:e,height:s,top:d,left:f,right:p,bottom:m,direction:h}=l.current;if(t||a===!1||!c.current||!e||!s)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`;c.current.dataset.motionPopId=o;let y=document.createElement(`style`);u&&(y.nonce=u);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
2
- [data-motion-pop-id="${o}"] {
3
- position: absolute !important;
4
- width: ${e}px !important;
5
- height: ${s}px !important;
6
- ${_}px !important;
7
- ${v}px !important;
8
- }
9
- `),()=>{c.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,L.jsx)(K,{isPresent:t,childRef:c,sizeRef:l,pop:a,children:a===!1?e:m.cloneElement(e,{ref:d})})}var J=({children:e,initial:t,isPresent:n,onExitComplete:o,custom:s,presenceAffectsLayout:c,mode:l,anchorX:u,anchorY:d,root:f})=>{let p=i(Y),h=(0,m.useId)(),g=(0,m.useRef)(n),_=(0,m.useRef)(o);r(()=>{g.current=n,_.current=o});let v=!0,y=(0,m.useMemo)(()=>(v=!1,{id:h,initial:t,isPresent:n,custom:s,onExitComplete:e=>{p.set(e,!0);for(let e of p.values())if(!e)return;o&&o()},register:e=>(p.set(e,!1),()=>{p.delete(e),!g.current&&!p.size&&_.current?.()})}),[n,p,o]);return c&&v&&(y={...y}),(0,m.useMemo)(()=>{p.forEach((e,t)=>p.set(t,!1))},[n]),m.useEffect(()=>{!n&&!p.size&&o&&o()},[n]),e=(0,L.jsx)(q,{pop:l===`popLayout`,isPresent:n,anchorX:u,anchorY:d,root:f,children:e}),(0,L.jsx)(a.Provider,{value:y,children:e})};function Y(){return new Map}var X=e=>e.key||``;function Z(e){let t=[];return m.Children.forEach(e,e=>{(0,m.isValidElement)(e)&&t.push(e)}),t}var Q=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:s=!0,mode:l=`sync`,propagate:u=!1,anchorX:d=`left`,anchorY:f=`top`,root:p})=>{let[h,g]=c(u),_=(0,m.useMemo)(()=>Z(e),[e]),v=u&&!h?[]:_.map(X),y=(0,m.useRef)(!0),b=(0,m.useRef)(_),x=i(()=>new Map),S=(0,m.useRef)(new Set),[C,w]=(0,m.useState)(_),[T,E]=(0,m.useState)(_);r(()=>{y.current=!1,b.current=_;for(let e=0;e<T.length;e++){let t=X(T[e]);v.includes(t)?(x.delete(t),S.current.delete(t)):x.get(t)!==!0&&x.set(t,!1)}},[T,v.length,v.join(`-`)]);let D=[];if(_!==C){let e=[..._];for(let t=0;t<T.length;t++){let n=T[t],r=X(n);v.includes(r)||(e.splice(t,0,n),D.push(n))}return l===`wait`&&D.length&&(e=D),E(Z(e)),w(_),null}let{forceRender:O}=(0,m.useContext)(o);return(0,L.jsx)(L.Fragment,{children:T.map(e=>{let r=X(e),i=u&&!h?!1:_===T||v.includes(r);return(0,L.jsx)(J,{isPresent:i,initial:!y.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:l,root:p,onExitComplete:i?void 0:()=>{if(S.current.has(r))return;if(x.has(r))S.current.add(r),x.set(r,!0);else return;let e=!0;x.forEach(t=>{t||(e=!1)}),e&&(O?.(),E(b.current),u&&g?.(),a&&a())},anchorX:d,anchorY:f,children:e},r)})})};export{N as _,O as a,v as b,y as c,w as d,T as f,D as g,E as h,b as i,k as l,A as m,H as n,x as o,j as p,R as r,S as s,Q as t,C as u,P as v,_ as y};