@mcp-use/inspector 20.0.0-beta.14 → 20.0.0-beta.16
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/README.md +2 -2
- package/dist/cdn/inspector.js +76909 -9272
- package/dist/cli.js +1 -1
- package/dist/server/cdn-shell.js +2 -2
- package/dist/server/{chunk-3XD7J5NX.js → chunk-FHC5ZGMM.js} +1 -1
- package/dist/server/{chunk-N3VXWLT6.js → chunk-QXOCY5ZE.js} +1 -1
- package/dist/server/{chunk-DLHO3Q42.js → chunk-R5ZEVRE5.js} +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/index.js +3 -3
- package/dist/server/middleware.js +3 -3
- package/dist/server/version.js +1 -1
- package/dist/web/assets/index-BgHcVJO3.js +643 -0
- package/dist/web/index.html +2 -10
- package/package.json +4 -4
- package/dist/cdn/AnimatePresence-D1bZ5_-l.js +0 -394
- package/dist/cdn/ChatTab-D_2TXR3X.js +0 -6811
- package/dist/cdn/CheckboxIndicator-BjF73mGX.js +0 -252
- package/dist/cdn/ConnectionSettingsForm-BqH0PcZF.js +0 -929
- package/dist/cdn/ConnectionSettingsTab-Duhb1uQP.js +0 -151
- package/dist/cdn/ElicitationTab-PEmEDvC5.js +0 -655
- package/dist/cdn/FormContext-NtUiZclE.js +0 -135
- package/dist/cdn/InspectorContext-BBKCdfmK.js +0 -123
- package/dist/cdn/JSONDisplay-BJqMz7Ny.js +0 -324
- package/dist/cdn/ListTabHeader-DzmTtN1e.js +0 -89
- package/dist/cdn/MCPAppsDebugControls-w5NRWhlZ.js +0 -2174
- package/dist/cdn/ManufactOAuthCallback-ChbbjFIT.js +0 -31
- package/dist/cdn/MarkdownRenderer-BIsUE0bf.js +0 -3610
- package/dist/cdn/McpAppsViewPanel-B3_76u7O.js +0 -56
- package/dist/cdn/NotificationsTab-B7uebqMV.js +0 -290
- package/dist/cdn/OAuthCallback-CtLoXa3h.js +0 -58
- package/dist/cdn/PromptsTab-DpE0XLzk.js +0 -902
- package/dist/cdn/ResourcesTab-DQS24z5p.js +0 -566
- package/dist/cdn/SamplingTab-ZDeu0CjJ.js +0 -659
- package/dist/cdn/ServerMetadataTab-BM3VhSLf.js +0 -244
- package/dist/cdn/StatusIcon-Q3n3YRtE.js +0 -65
- package/dist/cdn/ToolsTab-LtviZSWA.js +0 -2045
- package/dist/cdn/ViewPreview-BwC_tbF_.js +0 -238
- package/dist/cdn/WidgetDebugContext-B6yoOVVV.js +0 -314
- package/dist/cdn/WidgetWrapper-BlbQAh_X.js +0 -12
- package/dist/cdn/basePath-B8HuhIMu.js +0 -25
- package/dist/cdn/bell-GrTZcnD2.js +0 -10
- package/dist/cdn/browser-DG2Z8392.js +0 -42
- package/dist/cdn/brush-CelVvMGp.js +0 -17
- package/dist/cdn/button-CB4uOoUV.js +0 -2509
- package/dist/cdn/card-BA-DQk-G.js +0 -41
- package/dist/cdn/cfWorker-Bxcs9rNe.js +0 -10799
- package/dist/cdn/checkbox-kwVa4gRX.js +0 -20
- package/dist/cdn/chunk-QUQL4437-XnDcYQEx.js +0 -1508
- package/dist/cdn/clock-YMF8Gtw5.js +0 -12
- package/dist/cdn/code-C8sN2OGR.js +0 -10
- package/dist/cdn/createLucideIcon-BONxC1L5.js +0 -213
- package/dist/cdn/dialog-CJGnC5Ag.js +0 -1028
- package/dist/cdn/dist-CHKts0NS.js +0 -2307
- package/dist/cdn/dist-CTJnCYmk.js +0 -616
- package/dist/cdn/external-link-Bo4lQxr1.js +0 -17
- package/dist/cdn/eye-pSGG7nvf.js +0 -29
- package/dist/cdn/folder-open-aM8CPtBO.js +0 -7
- package/dist/cdn/hash-DDs2vE1k.js +0 -33
- package/dist/cdn/history-BfUFpL1d.js +0 -17
- package/dist/cdn/index-browser-DO-sd0TA.js +0 -1853
- package/dist/cdn/info-BMkB68mB.js +0 -19
- package/dist/cdn/input-BCpgLXU1.js +0 -9654
- package/dist/cdn/inspector-settings-layout-0VDsjeqb.js +0 -4
- package/dist/cdn/label-A0UGV8FE.js +0 -60
- package/dist/cdn/loader-circle-BKRHJEB7.js +0 -7
- package/dist/cdn/manufact-auth-BQMHhbLV.js +0 -423
- package/dist/cdn/maximize-2-DdrB_spi.js +0 -21
- package/dist/cdn/maximize-hSOCz133.js +0 -21
- package/dist/cdn/message-square-D3tKB3uJ.js +0 -7
- package/dist/cdn/not-found-BajFyZpp.js +0 -32
- package/dist/cdn/play-B1leulYf.js +0 -7
- package/dist/cdn/providerMeta-CjGU4rID.js +0 -436
- package/dist/cdn/react-BDA-xrgK.js +0 -5421
- package/dist/cdn/react-BIs9pQ3H.js +0 -926
- package/dist/cdn/refresh-cw-CyvXrS91.js +0 -21
- package/dist/cdn/save-CmdEPUAm.js +0 -34
- package/dist/cdn/schemaHelpers-DTV38jGq.js +0 -16
- package/dist/cdn/select-CCFHjOGk.js +0 -2595
- package/dist/cdn/servers-Dd0Vcp81.js +0 -30
- package/dist/cdn/shared-CJVHJhag.js +0 -1700
- package/dist/cdn/sheet-oyq1mIyg.js +0 -2078
- package/dist/cdn/sparkles-CxeZpVtX.js +0 -23
- package/dist/cdn/spinner-Be1GlSGX.js +0 -15
- package/dist/cdn/square-check-big-C_4wbfwF.js +0 -10
- package/dist/cdn/switch-DHXEA_N5.js +0 -665
- package/dist/cdn/tabs-subtle-Dubd6Kj8.js +0 -788
- package/dist/cdn/telemetry-e4uEESP7.js +0 -208
- package/dist/cdn/textarea-CwmI8_uI.js +0 -14
- package/dist/cdn/trash-2-BhumJAFE.js +0 -25
- package/dist/cdn/useAriaLabelledBy-Cra6w3YY.js +0 -30
- package/dist/cdn/useCompositeItem-Dhnm-7el.js +0 -26
- package/dist/cdn/useConfig-Dw_6Ztzr.js +0 -235
- package/dist/cdn/useSavedRequests-mSIsDd4c.js +0 -51
- package/dist/cdn/useViewHostProps-BPApUBaM.js +0 -364
- package/dist/cdn/wrench-DvK20LUT.js +0 -7
- package/dist/cdn/x-EilKPiCX.js +0 -10
- package/dist/cdn/zap-0Wr9QO7N.js +0 -10
- package/dist/web/assets/AnimatePresence-FfDQQNFJ.js +0 -9
- package/dist/web/assets/ChatTab-BhoU_ges.js +0 -18
- package/dist/web/assets/ConnectionSettingsTab-vJcr7uI3.js +0 -1
- package/dist/web/assets/ElicitationTab-4my-wtXf.js +0 -1
- package/dist/web/assets/FormContext-sV-yByKz.js +0 -1
- package/dist/web/assets/ListTabHeader-CrGae306.js +0 -1
- package/dist/web/assets/MCPAppsDebugControls-Cd4s9mr1.js +0 -34
- package/dist/web/assets/ManufactOAuthCallback-CCRWJhuT.js +0 -1
- package/dist/web/assets/MarkdownRenderer-BUDZYHqm.js +0 -47
- package/dist/web/assets/McpAppsViewPanel-Cil7Fdy4.js +0 -1
- package/dist/web/assets/NotificationsTab-Bl3O5PRb.js +0 -1
- package/dist/web/assets/OAuthCallback-CceVgo-9.js +0 -1
- package/dist/web/assets/PromptsTab-8lSxb8x-.js +0 -15
- package/dist/web/assets/ResourcesTab-DtGfgsPv.js +0 -2
- package/dist/web/assets/SamplingTab-XC-DTfOo.js +0 -1
- package/dist/web/assets/ServerMetadataTab-C5d_dI3_.js +0 -1
- package/dist/web/assets/ToolsTab-DuHPXItY.js +0 -8
- package/dist/web/assets/ViewPreview-DXswO9q8.js +0 -1
- package/dist/web/assets/WidgetWrapper-cv_BM1bY.js +0 -1
- package/dist/web/assets/brush-DX0UZ_pI.js +0 -1
- package/dist/web/assets/button-C8Xa2k4x.js +0 -1
- package/dist/web/assets/checkbox-DAfdiGl1.js +0 -1
- package/dist/web/assets/code-B14rVdNt.js +0 -1
- package/dist/web/assets/createLucideIcon-BEHeJH0M.js +0 -1
- package/dist/web/assets/dist-C2Y1wkk6.js +0 -21
- package/dist/web/assets/index-tu5-QdSJ.js +0 -499
- package/dist/web/assets/input-C0OQCUZy.js +0 -1
- package/dist/web/assets/inspector-settings-layout-yjKRJDai.js +0 -1
- package/dist/web/assets/label-CI7JWQOo.js +0 -1
- package/dist/web/assets/maximize-2-Br1WQzT2.js +0 -1
- package/dist/web/assets/maximize-CJNgRe6S.js +0 -1
- package/dist/web/assets/react-CU_d2d5K.js +0 -1
- package/dist/web/assets/refresh-cw-B5iaAZKn.js +0 -1
- package/dist/web/assets/save-TM6fvNrt.js +0 -1
- package/dist/web/assets/schemaHelpers-DLNTQr_6.js +0 -1
- package/dist/web/assets/select-D6jzbLJn.js +0 -1
- package/dist/web/assets/shared-c1Yr-wvV.js +0 -1
- package/dist/web/assets/sparkles-BGYTDThM.js +0 -1
- package/dist/web/assets/tabs-subtle-CHvFXVIA.js +0 -1
- package/dist/web/assets/textarea-CRTXuRmE.js +0 -1
- package/dist/web/assets/useConfig-9UVqLmR_.js +0 -1
- package/dist/web/assets/useViewHostProps-BBoPQYEl.js +0 -1
- package/dist/web/assets/zap-BDWHCVHU.js +0 -1
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
import { s as e, t } from "./react-BIs9pQ3H.js";
|
|
2
|
-
import { n } from "./createLucideIcon-BONxC1L5.js";
|
|
3
|
-
import { d as r, r as i } from "./react-BDA-xrgK.js";
|
|
4
|
-
import { t as a } from "./basePath-B8HuhIMu.js";
|
|
5
|
-
import { c as o, s } from "./chunk-QUQL4437-XnDcYQEx.js";
|
|
6
|
-
import { t as c } from "./useViewHostProps-BPApUBaM.js";
|
|
7
|
-
//#region src/client/components/ViewPreview.tsx
|
|
8
|
-
var l = /* @__PURE__ */ e(t(), 1), u = n(), d = "preview-default";
|
|
9
|
-
function f(e) {
|
|
10
|
-
if (!e) return {};
|
|
11
|
-
try {
|
|
12
|
-
let t = atob(e), n = JSON.parse(t);
|
|
13
|
-
if (n && typeof n == "object") return n;
|
|
14
|
-
} catch {}
|
|
15
|
-
return {};
|
|
16
|
-
}
|
|
17
|
-
function p(e, t) {
|
|
18
|
-
let n = `ui://widget/${t}`, r = e.find((e) => e.uri.startsWith(`${n}.`) && e.uri.endsWith(".html"));
|
|
19
|
-
return r ? r.uri : e.find((e) => e.name === t)?.uri;
|
|
20
|
-
}
|
|
21
|
-
function m() {
|
|
22
|
-
let e = globalThis.__mcpUsePreviewBundle;
|
|
23
|
-
if (!e || typeof e != "object") return;
|
|
24
|
-
let t = e;
|
|
25
|
-
if (typeof t.resourceUri == "string") return t;
|
|
26
|
-
}
|
|
27
|
-
function h() {
|
|
28
|
-
(0, l.useEffect)(() => {
|
|
29
|
-
let e = document.documentElement, t = document.body, n = e.style.margin, r = t.style.margin, i = t.style.overflow;
|
|
30
|
-
return e.style.margin = "0", t.style.margin = "0", t.style.overflow = "hidden", () => {
|
|
31
|
-
e.style.margin = n, t.style.margin = r, t.style.overflow = i;
|
|
32
|
-
};
|
|
33
|
-
}, []);
|
|
34
|
-
}
|
|
35
|
-
function g(e, t) {
|
|
36
|
-
(0, l.useEffect)(() => {
|
|
37
|
-
let n = () => {
|
|
38
|
-
document.body.dataset.viewError = "runtime_error";
|
|
39
|
-
};
|
|
40
|
-
return e && !t && (document.body.dataset.viewError = "invalid_payload"), window.addEventListener("error", n), window.addEventListener("unhandledrejection", n), () => {
|
|
41
|
-
window.removeEventListener("error", n), window.removeEventListener("unhandledrejection", n), delete document.body.dataset.viewError;
|
|
42
|
-
};
|
|
43
|
-
}, [e, t]);
|
|
44
|
-
}
|
|
45
|
-
function _(e) {
|
|
46
|
-
(0, l.useEffect)(() => {
|
|
47
|
-
if (!e) return;
|
|
48
|
-
let t = !1;
|
|
49
|
-
return (async () => {
|
|
50
|
-
try {
|
|
51
|
-
await document.fonts.ready;
|
|
52
|
-
} catch {}
|
|
53
|
-
t || (await new Promise((e) => requestAnimationFrame(() => e(void 0))), await new Promise((e) => requestAnimationFrame(() => e(void 0))), !t && document.body.setAttribute("data-view-ready", "true"));
|
|
54
|
-
})(), () => {
|
|
55
|
-
t = !0, document.body.removeAttribute("data-view-ready");
|
|
56
|
-
};
|
|
57
|
-
}, [e]);
|
|
58
|
-
}
|
|
59
|
-
function v(e, t) {
|
|
60
|
-
(0, l.useEffect)(() => {
|
|
61
|
-
if (!e) return;
|
|
62
|
-
let n = !1, r, i, a = (e) => {
|
|
63
|
-
n || (e && (document.body.dataset.viewX = String(Math.round(e.left)), document.body.dataset.viewY = String(Math.round(e.top)), document.body.dataset.viewWidth = String(Math.round(e.width)), document.body.dataset.viewHeight = String(Math.round(e.height))), document.body.setAttribute("data-view-ready", "true"));
|
|
64
|
-
};
|
|
65
|
-
return (async () => {
|
|
66
|
-
try {
|
|
67
|
-
await document.fonts.ready;
|
|
68
|
-
} catch {}
|
|
69
|
-
if (n || (await new Promise((e) => requestAnimationFrame(() => e(void 0))), await new Promise((e) => requestAnimationFrame(() => e(void 0))), n)) return;
|
|
70
|
-
let e = t.current?.querySelector("iframe");
|
|
71
|
-
if (!e) {
|
|
72
|
-
a(null);
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
let o = () => {
|
|
76
|
-
r && clearTimeout(r), r = setTimeout(() => {
|
|
77
|
-
n || (i?.disconnect(), a(e.getBoundingClientRect()));
|
|
78
|
-
}, 250);
|
|
79
|
-
};
|
|
80
|
-
i = new ResizeObserver(o), i.observe(e), o();
|
|
81
|
-
})(), () => {
|
|
82
|
-
n = !0, r && clearTimeout(r), i?.disconnect(), document.body.removeAttribute("data-view-ready"), delete document.body.dataset.viewX, delete document.body.dataset.viewY, delete document.body.dataset.viewWidth, delete document.body.dataset.viewHeight;
|
|
83
|
-
};
|
|
84
|
-
}, [e, t]);
|
|
85
|
-
}
|
|
86
|
-
function y({ view: e, bundle: t, widthOverride: n }) {
|
|
87
|
-
let [r, a] = (0, l.useState)(!1), o = (0, l.useRef)(null);
|
|
88
|
-
h(), v(r, o);
|
|
89
|
-
let s = (0, l.useMemo)(() => async (e) => {
|
|
90
|
-
if (e === t.resourceUri) return t.resourceContents;
|
|
91
|
-
throw Error(`Resource ${e} not in screenshot bundle`);
|
|
92
|
-
}, [t]);
|
|
93
|
-
return /* @__PURE__ */ (0, u.jsx)("div", {
|
|
94
|
-
ref: o,
|
|
95
|
-
style: {
|
|
96
|
-
width: "100vw",
|
|
97
|
-
height: "100vh"
|
|
98
|
-
},
|
|
99
|
-
children: /* @__PURE__ */ (0, u.jsx)(i, {
|
|
100
|
-
viewId: (0, l.useMemo)(() => `preview-bundle-${e}-${Date.now().toString(36)}`, [e]),
|
|
101
|
-
toolName: e,
|
|
102
|
-
toolInput: t.toolInput,
|
|
103
|
-
toolOutput: t.toolOutput,
|
|
104
|
-
displayMode: "inline",
|
|
105
|
-
inlineMaxWidth: n,
|
|
106
|
-
chromeless: !0,
|
|
107
|
-
onReady: () => a(!0),
|
|
108
|
-
source: {
|
|
109
|
-
kind: "live",
|
|
110
|
-
connection: {
|
|
111
|
-
callTool: async () => {
|
|
112
|
-
throw Error("Preview bundle mode has no server connection");
|
|
113
|
-
},
|
|
114
|
-
readResource: s
|
|
115
|
-
},
|
|
116
|
-
resourceUri: t.resourceUri
|
|
117
|
-
},
|
|
118
|
-
cspMode: "permissive",
|
|
119
|
-
hostInfo: {
|
|
120
|
-
name: "mcp-use-inspector",
|
|
121
|
-
version: "11.0.0"
|
|
122
|
-
},
|
|
123
|
-
mockOpenAiFileApis: !0
|
|
124
|
-
})
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
function b({ view: e }) {
|
|
128
|
-
let [t] = o(), n = (0, l.useMemo)(() => f(t.get("props")), [t]), s = (0, l.useMemo)(() => t.get("server") || `${window.location.origin}${a() || "/"}`, [t]), m = (0, l.useMemo)(() => {
|
|
129
|
-
let e = t.get("headers");
|
|
130
|
-
if (e) try {
|
|
131
|
-
let t = JSON.parse(atob(e));
|
|
132
|
-
if (t && typeof t == "object") return t;
|
|
133
|
-
} catch {}
|
|
134
|
-
}, [t]), { servers: g, addServer: v, storageLoaded: y } = r(), b = g.find((e) => e.id === d);
|
|
135
|
-
(0, l.useEffect)(() => {
|
|
136
|
-
y && v(d, {
|
|
137
|
-
url: s,
|
|
138
|
-
displayName: "Preview",
|
|
139
|
-
protocolNegotiation: "auto",
|
|
140
|
-
...m ? { headers: m } : {}
|
|
141
|
-
});
|
|
142
|
-
}, [
|
|
143
|
-
y,
|
|
144
|
-
s,
|
|
145
|
-
m,
|
|
146
|
-
v
|
|
147
|
-
]);
|
|
148
|
-
let x = b?.state === "ready", S = b?.state === "failed", C = (0, l.useMemo)(() => {
|
|
149
|
-
if (x) return p(b.resources, e);
|
|
150
|
-
}, [
|
|
151
|
-
x,
|
|
152
|
-
b?.resources,
|
|
153
|
-
e
|
|
154
|
-
]), w = (0, l.useMemo)(() => `preview-${e}-${Date.now().toString(36)}`, [e]), T = (0, l.useMemo)(() => async (e) => {
|
|
155
|
-
if (!b?.readResource) throw Error("Server not ready");
|
|
156
|
-
return b.readResource(e);
|
|
157
|
-
}, [b]), [E, D] = (0, l.useState)(!1);
|
|
158
|
-
_(E), h();
|
|
159
|
-
let O = c({
|
|
160
|
-
serverId: d,
|
|
161
|
-
viewId: w,
|
|
162
|
-
resourceUri: C ?? "",
|
|
163
|
-
toolName: e,
|
|
164
|
-
toolInput: n.toolInput,
|
|
165
|
-
toolOutput: n.toolOutput,
|
|
166
|
-
readResource: T,
|
|
167
|
-
displayMode: "fullscreen",
|
|
168
|
-
chromeless: !0,
|
|
169
|
-
onReady: () => D(!0)
|
|
170
|
-
});
|
|
171
|
-
return S ? /* @__PURE__ */ (0, u.jsxs)("div", {
|
|
172
|
-
style: {
|
|
173
|
-
padding: 16,
|
|
174
|
-
fontFamily: "monospace",
|
|
175
|
-
color: "#b00"
|
|
176
|
-
},
|
|
177
|
-
children: [
|
|
178
|
-
"Failed to connect to MCP server at ",
|
|
179
|
-
s,
|
|
180
|
-
"."
|
|
181
|
-
]
|
|
182
|
-
}) : !x || !C ? x && !C ? /* @__PURE__ */ (0, u.jsxs)("div", {
|
|
183
|
-
style: {
|
|
184
|
-
padding: 16,
|
|
185
|
-
fontFamily: "monospace",
|
|
186
|
-
color: "#b00"
|
|
187
|
-
},
|
|
188
|
-
children: [
|
|
189
|
-
"View \"",
|
|
190
|
-
e,
|
|
191
|
-
"\" not found on ",
|
|
192
|
-
s,
|
|
193
|
-
"."
|
|
194
|
-
]
|
|
195
|
-
}) : /* @__PURE__ */ (0, u.jsx)("div", {
|
|
196
|
-
style: {
|
|
197
|
-
width: "100vw",
|
|
198
|
-
height: "100vh",
|
|
199
|
-
display: "flex",
|
|
200
|
-
alignItems: "center",
|
|
201
|
-
justifyContent: "center",
|
|
202
|
-
fontFamily: "monospace",
|
|
203
|
-
color: "var(--muted-foreground, #888)"
|
|
204
|
-
},
|
|
205
|
-
children: "Loading…"
|
|
206
|
-
}) : /* @__PURE__ */ (0, u.jsx)("div", {
|
|
207
|
-
style: {
|
|
208
|
-
width: "100vw",
|
|
209
|
-
height: "100vh"
|
|
210
|
-
},
|
|
211
|
-
children: O && C ? /* @__PURE__ */ (0, u.jsx)(i, {
|
|
212
|
-
viewId: w,
|
|
213
|
-
toolName: e,
|
|
214
|
-
toolInput: n.toolInput,
|
|
215
|
-
toolOutput: n.toolOutput,
|
|
216
|
-
displayMode: "fullscreen",
|
|
217
|
-
chromeless: !0,
|
|
218
|
-
...O
|
|
219
|
-
}) : null
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
function x() {
|
|
223
|
-
let e = s(), [t] = o(), n = e.view ?? "", r = (0, l.useMemo)(() => m(), []), i = t.get("protocol") === "1";
|
|
224
|
-
g(i, r !== void 0);
|
|
225
|
-
let a = (0, l.useMemo)(() => {
|
|
226
|
-
let e = t.get("width");
|
|
227
|
-
if (!e) return;
|
|
228
|
-
let n = parseInt(e, 10);
|
|
229
|
-
return Number.isFinite(n) && n > 0 ? n : void 0;
|
|
230
|
-
}, [t]);
|
|
231
|
-
return r ? /* @__PURE__ */ (0, u.jsx)(y, {
|
|
232
|
-
view: n,
|
|
233
|
-
bundle: r,
|
|
234
|
-
widthOverride: a
|
|
235
|
-
}) : i ? null : /* @__PURE__ */ (0, u.jsx)(b, { view: n });
|
|
236
|
-
}
|
|
237
|
-
//#endregion
|
|
238
|
-
export { x as ViewPreview };
|
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
import { s as e, t } from "./react-BIs9pQ3H.js";
|
|
2
|
-
import { n } from "./createLucideIcon-BONxC1L5.js";
|
|
3
|
-
//#region src/client/context/ThemeContext.tsx
|
|
4
|
-
var r = /* @__PURE__ */ e(t(), 1), i = n(), a = (0, r.createContext)(void 0);
|
|
5
|
-
function o() {
|
|
6
|
-
let e = (0, r.use)(a);
|
|
7
|
-
if (e === void 0) throw Error("useTheme must be used within a ThemeProvider");
|
|
8
|
-
return e;
|
|
9
|
-
}
|
|
10
|
-
function s({ children: e, defaultTheme: t = "system", storageKey: n = "theme", forcedTheme: o }) {
|
|
11
|
-
let [s, c] = (0, r.useState)(o || t), [l, u] = (0, r.useState)(!1), d = () => typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", f = s === "system" ? d() : s, p = (e) => {
|
|
12
|
-
let t = document.documentElement, r = e === "system" ? d() : e;
|
|
13
|
-
t.classList.remove("light", "dark"), t.classList.add(r), o || localStorage.setItem(n, e);
|
|
14
|
-
};
|
|
15
|
-
return (0, r.useEffect)(() => {
|
|
16
|
-
u(!0);
|
|
17
|
-
let e = localStorage.getItem(n), r = o || e || t;
|
|
18
|
-
c(r), p(r);
|
|
19
|
-
}, [
|
|
20
|
-
t,
|
|
21
|
-
n,
|
|
22
|
-
o
|
|
23
|
-
]), (0, r.useEffect)(() => {
|
|
24
|
-
if (s !== "system") return;
|
|
25
|
-
let e = window.matchMedia("(prefers-color-scheme: dark)"), t = () => {
|
|
26
|
-
p("system");
|
|
27
|
-
};
|
|
28
|
-
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
29
|
-
}, [s]), (0, r.useEffect)(() => {
|
|
30
|
-
l && p(s);
|
|
31
|
-
}, [s, l]), /* @__PURE__ */ (0, i.jsx)(a, {
|
|
32
|
-
value: {
|
|
33
|
-
theme: s,
|
|
34
|
-
setTheme: (e) => {
|
|
35
|
-
if (o) {
|
|
36
|
-
console.warn("[ThemeProvider] Theme is forced via URL parameter, ignoring setTheme call");
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
c(e);
|
|
40
|
-
},
|
|
41
|
-
resolvedTheme: f
|
|
42
|
-
},
|
|
43
|
-
children: e
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
//#endregion
|
|
47
|
-
//#region src/client/rpc-traffic-coalesce.ts
|
|
48
|
-
var c = 300, l = /(?:^|\/)notifications\//;
|
|
49
|
-
function u(e) {
|
|
50
|
-
let t = e;
|
|
51
|
-
return typeof t?.method == "string" ? t.method : null;
|
|
52
|
-
}
|
|
53
|
-
function d(e) {
|
|
54
|
-
let t = e.message;
|
|
55
|
-
if (t?.id !== void 0 && t.id !== null || t?.result !== void 0 || t?.error !== void 0) return null;
|
|
56
|
-
let n = u(e.message);
|
|
57
|
-
return !n || !l.test(n) ? null : [
|
|
58
|
-
e.source,
|
|
59
|
-
e.serverId,
|
|
60
|
-
e.widgetId ?? "",
|
|
61
|
-
e.direction,
|
|
62
|
-
n
|
|
63
|
-
].join("|");
|
|
64
|
-
}
|
|
65
|
-
function f(e, t, n = Date.now()) {
|
|
66
|
-
let r = d(e), i = d(t);
|
|
67
|
-
if (!r || r !== i) return !1;
|
|
68
|
-
let a = Date.parse(e.timestamp);
|
|
69
|
-
return Number.isNaN(a) ? !1 : n - a <= c;
|
|
70
|
-
}
|
|
71
|
-
function p(e, t) {
|
|
72
|
-
return {
|
|
73
|
-
...e,
|
|
74
|
-
timestamp: t.timestamp,
|
|
75
|
-
message: t.message,
|
|
76
|
-
repeatCount: (e.repeatCount ?? 1) + 1
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
var m = new class {
|
|
80
|
-
maxEntries;
|
|
81
|
-
entries = [];
|
|
82
|
-
listeners = /* @__PURE__ */ new Set();
|
|
83
|
-
nextId = 0;
|
|
84
|
-
emitFrame = null;
|
|
85
|
-
constructor(e = 1e3) {
|
|
86
|
-
this.maxEntries = e;
|
|
87
|
-
}
|
|
88
|
-
publish(e) {
|
|
89
|
-
let t = this.entries[this.entries.length - 1];
|
|
90
|
-
if (t && f(t, e, Date.parse(e.timestamp))) {
|
|
91
|
-
this.entries[this.entries.length - 1] = p(t, e), this.scheduleEmit();
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
this.entries.push({
|
|
95
|
-
...e,
|
|
96
|
-
id: `rpc-${++this.nextId}`
|
|
97
|
-
}), this.entries.length > this.maxEntries && this.entries.splice(0, this.entries.length - this.maxEntries), this.scheduleEmit();
|
|
98
|
-
}
|
|
99
|
-
getSnapshot = () => this.entries;
|
|
100
|
-
subscribe = (e) => (this.listeners.add(e), () => this.listeners.delete(e));
|
|
101
|
-
clear(e = {}) {
|
|
102
|
-
let t = new Set(e.serverIds ?? []), n = new Set(e.sources ?? []);
|
|
103
|
-
t.size === 0 && n.size === 0 ? this.entries = [] : this.entries = this.entries.filter((e) => !((t.size === 0 || t.has(e.serverId)) && (n.size === 0 || n.has(e.source)))), this.scheduleEmit();
|
|
104
|
-
}
|
|
105
|
-
peekCoalesceKey(e) {
|
|
106
|
-
return d(e);
|
|
107
|
-
}
|
|
108
|
-
scheduleEmit() {
|
|
109
|
-
if (this.emitFrame === null) {
|
|
110
|
-
if (typeof requestAnimationFrame > "u") {
|
|
111
|
-
this.emit();
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
this.emitFrame = requestAnimationFrame(() => {
|
|
115
|
-
this.emitFrame = null, this.emit();
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
emit() {
|
|
120
|
-
this.listeners.forEach((e) => e());
|
|
121
|
-
}
|
|
122
|
-
}(), h = (0, r.createContext)(void 0), g = {
|
|
123
|
-
deviceType: "desktop",
|
|
124
|
-
customViewport: {
|
|
125
|
-
width: 768,
|
|
126
|
-
height: 1024
|
|
127
|
-
},
|
|
128
|
-
cspMode: "permissive",
|
|
129
|
-
displayModeOverride: null,
|
|
130
|
-
capabilities: {
|
|
131
|
-
hover: !0,
|
|
132
|
-
touch: !1
|
|
133
|
-
},
|
|
134
|
-
safeAreaInsets: {
|
|
135
|
-
top: 0,
|
|
136
|
-
right: 0,
|
|
137
|
-
bottom: 0,
|
|
138
|
-
left: 0
|
|
139
|
-
},
|
|
140
|
-
locale: "en-US",
|
|
141
|
-
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC"
|
|
142
|
-
};
|
|
143
|
-
function _({ children: e }) {
|
|
144
|
-
let [t, n] = (0, r.useState)({
|
|
145
|
-
activeWidgetId: null,
|
|
146
|
-
widgets: /* @__PURE__ */ new Map(),
|
|
147
|
-
playground: g
|
|
148
|
-
}), a = (0, r.useCallback)((e) => {
|
|
149
|
-
n((t) => ({
|
|
150
|
-
...t,
|
|
151
|
-
activeWidgetId: e
|
|
152
|
-
}));
|
|
153
|
-
}, []), o = (0, r.useCallback)((e, t) => {
|
|
154
|
-
n((n) => {
|
|
155
|
-
if (n.widgets.has(e)) return n;
|
|
156
|
-
let r = new Map(n.widgets);
|
|
157
|
-
return r.set(e, {
|
|
158
|
-
...t,
|
|
159
|
-
cspViolations: []
|
|
160
|
-
}), {
|
|
161
|
-
...n,
|
|
162
|
-
widgets: r
|
|
163
|
-
};
|
|
164
|
-
});
|
|
165
|
-
}, []), s = (0, r.useCallback)((e) => {
|
|
166
|
-
n((t) => {
|
|
167
|
-
let n = new Map(t.widgets);
|
|
168
|
-
return n.delete(e), {
|
|
169
|
-
...t,
|
|
170
|
-
widgets: n,
|
|
171
|
-
activeWidgetId: t.activeWidgetId === e ? null : t.activeWidgetId
|
|
172
|
-
};
|
|
173
|
-
});
|
|
174
|
-
}, []), c = (0, r.useRef)(t);
|
|
175
|
-
c.current = t;
|
|
176
|
-
let l = (0, r.useCallback)((e) => c.current.widgets.get(e), []), u = (0, r.useCallback)((e, t) => {
|
|
177
|
-
n((n) => {
|
|
178
|
-
let r = n.widgets.get(e);
|
|
179
|
-
if (!r) return n;
|
|
180
|
-
let i = { cspViolations: [...r.cspViolations, t] };
|
|
181
|
-
t.originalPolicy && r.effectivePolicy === void 0 && (i.effectivePolicy = t.originalPolicy);
|
|
182
|
-
let a = new Map(n.widgets);
|
|
183
|
-
return a.set(e, {
|
|
184
|
-
...r,
|
|
185
|
-
...i
|
|
186
|
-
}), {
|
|
187
|
-
...n,
|
|
188
|
-
widgets: a
|
|
189
|
-
};
|
|
190
|
-
});
|
|
191
|
-
}, []), d = (0, r.useCallback)((e) => {
|
|
192
|
-
n((t) => {
|
|
193
|
-
let n = t.widgets.get(e);
|
|
194
|
-
if (!n) return t;
|
|
195
|
-
let r = new Map(t.widgets);
|
|
196
|
-
return r.set(e, {
|
|
197
|
-
...n,
|
|
198
|
-
cspViolations: []
|
|
199
|
-
}), {
|
|
200
|
-
...t,
|
|
201
|
-
widgets: r
|
|
202
|
-
};
|
|
203
|
-
});
|
|
204
|
-
}, []), f = (0, r.useCallback)((e, t) => {
|
|
205
|
-
n((n) => {
|
|
206
|
-
let r = n.widgets.get(e);
|
|
207
|
-
if (!r) return n;
|
|
208
|
-
let i = new Map(n.widgets);
|
|
209
|
-
return i.set(e, {
|
|
210
|
-
...r,
|
|
211
|
-
modelContext: t
|
|
212
|
-
}), {
|
|
213
|
-
...n,
|
|
214
|
-
widgets: i
|
|
215
|
-
};
|
|
216
|
-
});
|
|
217
|
-
}, []), p = (0, r.useCallback)((e, t) => {
|
|
218
|
-
n((n) => {
|
|
219
|
-
let r = n.widgets.get(e);
|
|
220
|
-
if (!r) return n;
|
|
221
|
-
let i = new Map(n.widgets);
|
|
222
|
-
return i.set(e, {
|
|
223
|
-
...r,
|
|
224
|
-
widgetState: t
|
|
225
|
-
}), {
|
|
226
|
-
...n,
|
|
227
|
-
widgets: i
|
|
228
|
-
};
|
|
229
|
-
});
|
|
230
|
-
}, []), m = (0, r.useCallback)((e, t, r) => {
|
|
231
|
-
n((n) => {
|
|
232
|
-
let i = n.widgets.get(e);
|
|
233
|
-
if (!i) return n;
|
|
234
|
-
let a = new Map(n.widgets);
|
|
235
|
-
return a.set(e, {
|
|
236
|
-
...i,
|
|
237
|
-
declaredCsp: t,
|
|
238
|
-
...r !== void 0 && { effectivePolicy: r }
|
|
239
|
-
}), {
|
|
240
|
-
...n,
|
|
241
|
-
widgets: a
|
|
242
|
-
};
|
|
243
|
-
});
|
|
244
|
-
}, []), _ = (0, r.useCallback)((e) => {
|
|
245
|
-
n((t) => ({
|
|
246
|
-
...t,
|
|
247
|
-
playground: {
|
|
248
|
-
...t.playground,
|
|
249
|
-
...e
|
|
250
|
-
}
|
|
251
|
-
}));
|
|
252
|
-
}, []), v = (0, r.useCallback)(() => {
|
|
253
|
-
n((e) => ({
|
|
254
|
-
...e,
|
|
255
|
-
widgets: /* @__PURE__ */ new Map(),
|
|
256
|
-
activeWidgetId: null
|
|
257
|
-
}));
|
|
258
|
-
}, []), y = (0, r.useCallback)(() => {
|
|
259
|
-
let e = /* @__PURE__ */ new Map();
|
|
260
|
-
for (let [n, r] of t.widgets) r.modelContext && e.set(n, r.modelContext);
|
|
261
|
-
return e;
|
|
262
|
-
}, [t.widgets]);
|
|
263
|
-
return /* @__PURE__ */ (0, i.jsx)(h, {
|
|
264
|
-
value: (0, r.useMemo)(() => ({
|
|
265
|
-
...t,
|
|
266
|
-
setActiveWidget: a,
|
|
267
|
-
addWidget: o,
|
|
268
|
-
removeWidget: s,
|
|
269
|
-
getWidget: l,
|
|
270
|
-
addCspViolation: u,
|
|
271
|
-
clearCspViolations: d,
|
|
272
|
-
setWidgetModelContext: f,
|
|
273
|
-
setWidgetState: p,
|
|
274
|
-
setWidgetDeclaredCsp: m,
|
|
275
|
-
updatePlaygroundSettings: _,
|
|
276
|
-
clearAllWidgets: v,
|
|
277
|
-
getAllModelContexts: y
|
|
278
|
-
}), [
|
|
279
|
-
t,
|
|
280
|
-
a,
|
|
281
|
-
o,
|
|
282
|
-
s,
|
|
283
|
-
l,
|
|
284
|
-
u,
|
|
285
|
-
d,
|
|
286
|
-
f,
|
|
287
|
-
p,
|
|
288
|
-
m,
|
|
289
|
-
_,
|
|
290
|
-
v,
|
|
291
|
-
y
|
|
292
|
-
]),
|
|
293
|
-
children: e
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
function v() {
|
|
297
|
-
let e = (0, r.use)(h);
|
|
298
|
-
if (!e) throw Error("useWidgetDebug must be used within WidgetDebugProvider");
|
|
299
|
-
return e;
|
|
300
|
-
}
|
|
301
|
-
var y = {
|
|
302
|
-
mobile: {
|
|
303
|
-
width: 390,
|
|
304
|
-
height: 844,
|
|
305
|
-
name: "iPhone 14"
|
|
306
|
-
},
|
|
307
|
-
desktop: {
|
|
308
|
-
width: 1440,
|
|
309
|
-
height: 900,
|
|
310
|
-
name: "Desktop"
|
|
311
|
-
}
|
|
312
|
-
};
|
|
313
|
-
//#endregion
|
|
314
|
-
export { u as a, m as i, _ as n, s as o, v as r, o as s, y as t };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./createLucideIcon-BONxC1L5.js";
|
|
2
|
-
import { U as t } from "./button-CB4uOoUV.js";
|
|
3
|
-
//#region src/client/components/ui/WidgetWrapper.tsx
|
|
4
|
-
var n = e();
|
|
5
|
-
function r({ children: e, className: r, noWrapper: i }) {
|
|
6
|
-
return i ? e : /* @__PURE__ */ (0, n.jsx)("div", {
|
|
7
|
-
className: t("flex flex-1 items-center justify-center bg-zinc-50 dark:bg-zinc-800", "[background-image:radial-gradient(circle,rgba(0,0,0,0.12)_1px,transparent_1px)]", "dark:[background-image:radial-gradient(circle,rgba(255,255,255,0.1)_1px,transparent_1px)]", "bg-[length:32px_32px]", r),
|
|
8
|
-
children: e
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
//#endregion
|
|
12
|
-
export { r as t };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//#region src/client/utils/basePath.ts
|
|
2
|
-
function e(e) {
|
|
3
|
-
if (e == null) return "/mcp";
|
|
4
|
-
let t = e.trim().replace(/\/{2,}/g, "/").replace(/\/+$/, "");
|
|
5
|
-
return t === "" || t === "/" ? "" : (t.startsWith("/") || (t = `/${t}`), t);
|
|
6
|
-
}
|
|
7
|
-
function t() {
|
|
8
|
-
if (typeof window > "u") return "";
|
|
9
|
-
let t = window.location.pathname || "", n = t.indexOf("/inspector");
|
|
10
|
-
return n <= 0 ? "" : e(t.slice(0, n));
|
|
11
|
-
}
|
|
12
|
-
function n() {
|
|
13
|
-
if (typeof window > "u") return "";
|
|
14
|
-
let n = window.__MCP_BASE_PATH__;
|
|
15
|
-
return n == null ? t() : e(n);
|
|
16
|
-
}
|
|
17
|
-
function r() {
|
|
18
|
-
return `${n()}/inspector`;
|
|
19
|
-
}
|
|
20
|
-
function i(e) {
|
|
21
|
-
let t = e.replace(/^\/+/, "");
|
|
22
|
-
return `${r()}/api/${t}`;
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
|
-
export { r as n, i as r, n as t };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./createLucideIcon-BONxC1L5.js";
|
|
2
|
-
var t = e("bell", [["path", {
|
|
3
|
-
d: "M10.268 21a2 2 0 0 0 3.464 0",
|
|
4
|
-
key: "vwvbt9"
|
|
5
|
-
}], ["path", {
|
|
6
|
-
d: "M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",
|
|
7
|
-
key: "11g9vi"
|
|
8
|
-
}]]);
|
|
9
|
-
//#endregion
|
|
10
|
-
export { t };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./createLucideIcon-BONxC1L5.js";
|
|
2
|
-
var t = e("check", [["path", {
|
|
3
|
-
d: "M20 6 9 17l-5-5",
|
|
4
|
-
key: "1gmf2c"
|
|
5
|
-
}]]), n = e("copy", [["rect", {
|
|
6
|
-
width: "14",
|
|
7
|
-
height: "14",
|
|
8
|
-
x: "8",
|
|
9
|
-
y: "8",
|
|
10
|
-
rx: "2",
|
|
11
|
-
ry: "2",
|
|
12
|
-
key: "17jyea"
|
|
13
|
-
}], ["path", {
|
|
14
|
-
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
|
|
15
|
-
key: "zix9uf"
|
|
16
|
-
}]]);
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region src/client/utils/browser.ts
|
|
19
|
-
function r(e) {
|
|
20
|
-
let t = document.createElement("textarea");
|
|
21
|
-
t.value = e, t.style.cssText = "position:fixed;top:-9999px;left:-9999px;opacity:0", document.body.appendChild(t), t.focus(), t.select();
|
|
22
|
-
try {
|
|
23
|
-
return document.execCommand("copy");
|
|
24
|
-
} finally {
|
|
25
|
-
document.body.removeChild(t);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function i(e) {
|
|
29
|
-
return r(e);
|
|
30
|
-
}
|
|
31
|
-
async function a(e) {
|
|
32
|
-
if (!r(e)) {
|
|
33
|
-
if (navigator.clipboard?.writeText) return navigator.clipboard.writeText(e);
|
|
34
|
-
throw Error("copy failed");
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
function o(e) {
|
|
38
|
-
let t = Date.now() - e, n = Math.floor(t / 1e3), r = Math.floor(n / 60), i = Math.floor(r / 60), a = Math.floor(i / 24);
|
|
39
|
-
return n < 60 ? "just now" : r < 60 ? `${r}m ago` : i < 24 ? `${i}h ago` : a < 7 ? `${a}d ago` : new Date(e).toLocaleDateString();
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
42
|
-
export { t as a, n as i, i as n, o as r, a as t };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./createLucideIcon-BONxC1L5.js";
|
|
2
|
-
var t = e("brush", [
|
|
3
|
-
["path", {
|
|
4
|
-
d: "m11 10 3 3",
|
|
5
|
-
key: "fzmg1i"
|
|
6
|
-
}],
|
|
7
|
-
["path", {
|
|
8
|
-
d: "M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z",
|
|
9
|
-
key: "p4q2r7"
|
|
10
|
-
}],
|
|
11
|
-
["path", {
|
|
12
|
-
d: "M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031",
|
|
13
|
-
key: "wy6l02"
|
|
14
|
-
}]
|
|
15
|
-
]);
|
|
16
|
-
//#endregion
|
|
17
|
-
export { t };
|