@mcp-use/inspector 20.0.0-beta.6 → 20.0.0-beta.7
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/cdn/{AnimatePresence-Dcw-FOy8.js → AnimatePresence-D1bZ5_-l.js} +79 -78
- package/dist/cdn/{ChatTab-D6J3Gyp7.js → ChatTab-DtUGK07C.js} +1951 -1932
- package/dist/cdn/CheckboxIndicator-BjF73mGX.js +252 -0
- package/dist/cdn/{ConnectionSettingsForm-CWQueI8J.js → ConnectionSettingsForm-CNuMa6jp.js} +202 -202
- package/dist/cdn/{ConnectionSettingsTab-FGyt3QaI.js → ConnectionSettingsTab-qSVQ1aIF.js} +36 -35
- package/dist/cdn/{ElicitationTab-CL1KJ0bz.js → ElicitationTab-PEmEDvC5.js} +47 -46
- package/dist/cdn/{FormContext-tmgN_Vdr.js → FormContext-NtUiZclE.js} +26 -26
- package/dist/cdn/{InspectorContext-UjtEbNod.js → InspectorContext-BBKCdfmK.js} +1 -1
- package/dist/cdn/{JSONDisplay-BFxf5oEu.js → JSONDisplay-BJqMz7Ny.js} +22 -22
- package/dist/cdn/{ListTabHeader-Cv-GmtGF.js → ListTabHeader-DzmTtN1e.js} +20 -19
- package/dist/cdn/{WidgetWrapper-CruwjBOd.js → MCPAppsDebugControls-BpP-Ifap.js} +514 -550
- package/dist/cdn/{ManufactOAuthCallback-B98kSYCj.js → ManufactOAuthCallback-ChbbjFIT.js} +2 -2
- package/dist/cdn/{MarkdownRenderer-gLqUICEd.js → MarkdownRenderer-bX1BrKgI.js} +23 -23
- package/dist/cdn/McpAppsViewPanel-jlsYQ7uS.js +56 -0
- package/dist/cdn/{NotificationsTab-CeImSrhx.js → NotificationsTab-B7uebqMV.js} +21 -21
- package/dist/cdn/{OAuthCallback-Bg2bP-o9.js → OAuthCallback--NZdLoWx.js} +3 -3
- package/dist/cdn/PromptsTab-BlXDcau3.js +902 -0
- package/dist/cdn/{ResourcesTab-CQkKni-P.js → ResourcesTab-D45_JojP.js} +116 -114
- package/dist/cdn/{SamplingTab-D8q-iCMc.js → SamplingTab-r7tImM6L.js} +34 -33
- package/dist/cdn/{ServerMetadataTab-CvrKX8fz.js → ServerMetadataTab-BM3VhSLf.js} +9 -9
- package/dist/cdn/{StatusIcon-D0-ARyOh.js → StatusIcon-Q3n3YRtE.js} +10 -11
- package/dist/cdn/{ToolsTab-6xaVH43x.js → ToolsTab-DOAO8HnS.js} +664 -652
- package/dist/cdn/{ViewPreview-Ohh6JwOn.js → ViewPreview-CBhrVdwx.js} +3 -3
- package/dist/cdn/{WidgetDebugContext-D4usL_MA.js → WidgetDebugContext-B6yoOVVV.js} +1 -11
- package/dist/cdn/WidgetWrapper-BlbQAh_X.js +12 -0
- package/dist/cdn/{bell-CGjAO_0s.js → bell-GrTZcnD2.js} +1 -1
- package/dist/cdn/{browser-CbQIH4w2.js → browser-DG2Z8392.js} +1 -1
- package/dist/cdn/{brush-B_mKhyxG.js → brush-CelVvMGp.js} +1 -1
- package/dist/cdn/button-CB4uOoUV.js +2509 -0
- package/dist/cdn/card-BA-DQk-G.js +41 -0
- package/dist/cdn/{checkbox-By0FklhG.js → checkbox-kwVa4gRX.js} +7 -7
- package/dist/cdn/{clock-CmUbSx_B.js → clock-YMF8Gtw5.js} +1 -1
- package/dist/cdn/{code-V_0nf5rg.js → code-C8sN2OGR.js} +1 -1
- package/dist/cdn/{jsx-runtime-CIxvMpEo.js → createLucideIcon-BONxC1L5.js} +57 -24
- package/dist/cdn/{dialog-BsDpuJd3.js → dialog-CJGnC5Ag.js} +171 -171
- package/dist/cdn/{dist-DaMB0Su9.js → dist-CTJnCYmk.js} +1 -1
- package/dist/cdn/{dist-CXHFvGre.js → dist-SxRsB1iS.js} +3 -3
- package/dist/cdn/{external-link-CjmfT6rW.js → external-link-Bo4lQxr1.js} +1 -1
- package/dist/cdn/{eye-B7H96av8.js → eye-pSGG7nvf.js} +1 -1
- package/dist/cdn/{folder-open-B3lu2rG_.js → folder-open-aM8CPtBO.js} +1 -1
- package/dist/cdn/{hash-BVQnWi7q.js → hash-DDs2vE1k.js} +1 -1
- package/dist/cdn/{history-Csw4rb44.js → history-BfUFpL1d.js} +1 -1
- package/dist/cdn/{index-browser-DkQOzkvX.js → index-browser-Dm3R1Mfe.js} +1 -1
- package/dist/cdn/{info-CNiOwqkf.js → info-BMkB68mB.js} +1 -1
- package/dist/cdn/{input-C2OBd4PJ.js → input-BCpgLXU1.js} +2993 -5499
- package/dist/cdn/inspector.css +1 -1
- package/dist/cdn/inspector.js +7106 -7140
- package/dist/cdn/{label-B9Jmm9be.js → label-A0UGV8FE.js} +9 -9
- package/dist/cdn/{loader-circle-BLy9A_pp.js → loader-circle-BKRHJEB7.js} +1 -1
- package/dist/cdn/{maximize-2-CH5Lq90B.js → maximize-2-DdrB_spi.js} +1 -1
- package/dist/cdn/{maximize-BALCV_ep.js → maximize-hSOCz133.js} +1 -1
- package/dist/cdn/{message-square-BnxdpJxZ.js → message-square-D3tKB3uJ.js} +1 -1
- package/dist/cdn/{not-found-DEtSM_Wd.js → not-found-BajFyZpp.js} +9 -11
- package/dist/cdn/{play-vuZ5PLnI.js → play-B1leulYf.js} +1 -1
- package/dist/cdn/providerMeta-CjGU4rID.js +436 -0
- package/dist/cdn/{react-BLtCruam.js → react-Bl-hSkvn.js} +562 -512
- package/dist/cdn/{refresh-cw-BXY-Pa0U.js → refresh-cw-CyvXrS91.js} +1 -1
- package/dist/cdn/{save-Tgil_AJZ.js → save-CmdEPUAm.js} +1 -1
- package/dist/cdn/{select-DDdiIPR2.js → select-CCFHjOGk.js} +808 -807
- package/dist/cdn/{servers-Dm72iTpY.js → servers-Dd0Vcp81.js} +5 -1
- package/dist/cdn/{shared-DaILIQPP.js → shared-CJVHJhag.js} +36 -36
- package/dist/cdn/{sheet-Br_l2kry.js → sheet-oyq1mIyg.js} +620 -619
- package/dist/cdn/{sparkles-BntO2rDR.js → sparkles-CxeZpVtX.js} +1 -1
- package/dist/cdn/spinner-Be1GlSGX.js +15 -0
- package/dist/cdn/{square-check-big-BvwQ17Bl.js → square-check-big-C_4wbfwF.js} +1 -1
- package/dist/cdn/{switch-C3IyQuid.js → switch-DHXEA_N5.js} +190 -189
- package/dist/cdn/{tabs-subtle-CkdI6Mac.js → tabs-subtle-Dubd6Kj8.js} +269 -268
- package/dist/cdn/{telemetry-C7Ytz2BG.js → telemetry-TwPKZlFf.js} +2 -2
- package/dist/cdn/{textarea-DSbwcFVt.js → textarea-CwmI8_uI.js} +6 -6
- package/dist/cdn/{trash-2-RwpJY5SL.js → trash-2-BhumJAFE.js} +1 -1
- package/dist/cdn/{useAriaLabelledBy-DqAdnppm.js → useAriaLabelledBy-Cra6w3YY.js} +2 -1
- package/dist/cdn/{useCompositeItem-BRqEzYh-.js → useCompositeItem-Dhnm-7el.js} +3 -3
- package/dist/cdn/{useConfig-BW6uQf2m.js → useConfig-leHVjdjl.js} +2 -2
- package/dist/cdn/{useSavedRequests-Ci2I919u.js → useSavedRequests-mSIsDd4c.js} +1 -1
- package/dist/cdn/{useViewHostProps-CINeSkth.js → useViewHostProps-CDOm2w6u.js} +124 -109
- package/dist/cdn/{wrench-DzGmCfnb.js → wrench-DvK20LUT.js} +1 -1
- package/dist/cdn/{x-C3vRQIYu.js → x-EilKPiCX.js} +1 -1
- package/dist/cdn/{zap-Mb-pbw2X.js → zap-0Wr9QO7N.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/components/ChatTab.d.ts.map +1 -1
- package/dist/client/components/MCPAppsDebugControls.d.ts.map +1 -1
- package/dist/client/components/ToolsTab.d.ts.map +1 -1
- package/dist/client/components/chat/ConfigurationDialog.d.ts.map +1 -1
- package/dist/client/components/chat/ToolResultRenderer.d.ts.map +1 -1
- package/dist/client/components/mcp-apps/McpAppsViewPanel.d.ts +29 -0
- package/dist/client/components/mcp-apps/McpAppsViewPanel.d.ts.map +1 -0
- package/dist/client/components/tools/ToolExecutionPanel.d.ts.map +1 -1
- package/dist/client/components/tools/ToolResultDisplay.d.ts +2 -1
- package/dist/client/components/tools/ToolResultDisplay.d.ts.map +1 -1
- package/dist/client/components/tools/useToolsTabNavigation.d.ts.map +1 -1
- package/dist/client/components/ui/MeshGradientCanvas.d.ts.map +1 -1
- package/dist/client/components/ui/mesh-animation-pause.d.ts +14 -0
- package/dist/client/components/ui/mesh-animation-pause.d.ts.map +1 -0
- package/dist/client/components/ui/mesh-gradient-colors.d.ts +6 -0
- package/dist/client/components/ui/mesh-gradient-colors.d.ts.map +1 -0
- package/dist/client/components/ui/mesh-tab-background.d.ts +1 -1
- package/dist/client/components/ui/mesh-tab-background.d.ts.map +1 -1
- package/dist/client/components/ui/not-found.d.ts.map +1 -1
- package/dist/client/context/WidgetDebugContext.d.ts +1 -11
- package/dist/client/context/WidgetDebugContext.d.ts.map +1 -1
- package/dist/client/hooks/useDeviceViewport.d.ts +1 -5
- package/dist/client/hooks/useDeviceViewport.d.ts.map +1 -1
- package/dist/client/hooks/useViewHostProps.d.ts +1 -1
- package/dist/client/hooks/useViewHostProps.d.ts.map +1 -1
- package/dist/client/index.js +2086 -1860
- package/dist/client/utils/servers.d.ts +5 -0
- package/dist/client/utils/servers.d.ts.map +1 -1
- package/dist/server/cdn-shell.js +2 -2
- package/dist/server/{chunk-GBY4WAVP.js → chunk-5GVQGIAX.js} +1 -1
- package/dist/server/{chunk-IFF5T5J4.js → chunk-UZZDBVKF.js} +1 -1
- package/dist/server/{chunk-NUHI6MJ6.js → chunk-VFVFLXKP.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/AnimatePresence-FfDQQNFJ.js +9 -0
- package/dist/web/assets/ChatTab-B6ubLbeA.js +18 -0
- package/dist/web/assets/ConnectionSettingsTab-Cb2eDgEu.js +1 -0
- package/dist/web/assets/ElicitationTab-CbnCrmu9.js +1 -0
- package/dist/web/assets/FormContext-sV-yByKz.js +1 -0
- package/dist/web/assets/ListTabHeader-CrGae306.js +1 -0
- package/dist/web/assets/MCPAppsDebugControls-sRglMhat.js +34 -0
- package/dist/web/assets/{ManufactOAuthCallback-BRO6TPkZ.js → ManufactOAuthCallback-D4uYGigW.js} +1 -1
- package/dist/web/assets/{MarkdownRenderer-gaJFjbtr.js → MarkdownRenderer-Cwxp9fLj.js} +2 -2
- package/dist/web/assets/McpAppsViewPanel-jQYFoZNX.js +1 -0
- package/dist/web/assets/{NotificationsTab-LYcfRjyd.js → NotificationsTab-DuSm762_.js} +1 -1
- package/dist/web/assets/{OAuthCallback-D8UItgTB.js → OAuthCallback-VLHlUe2c.js} +1 -1
- package/dist/web/assets/PromptsTab-DK6XZxR8.js +15 -0
- package/dist/web/assets/ResourcesTab-CUE4MAtJ.js +2 -0
- package/dist/web/assets/SamplingTab-BYNkVCTu.js +1 -0
- package/dist/web/assets/ServerMetadataTab-DWjNFMbq.js +1 -0
- package/dist/web/assets/ToolsTab-BisWWY2p.js +8 -0
- package/dist/web/assets/{ViewPreview--z6jL0Zg.js → ViewPreview-COrmPpRr.js} +1 -1
- package/dist/web/assets/WidgetWrapper-cv_BM1bY.js +1 -0
- package/dist/web/assets/{brush--0LobUi4.js → brush-DX0UZ_pI.js} +1 -1
- package/dist/web/assets/button-C8Xa2k4x.js +1 -0
- package/dist/web/assets/checkbox-B6dtF73d.js +1 -0
- package/dist/web/assets/code-B14rVdNt.js +1 -0
- package/dist/web/assets/createLucideIcon-BEHeJH0M.js +1 -0
- package/dist/web/assets/{dist-B8sA8Zml.js → dist-9Oy7e0v8.js} +4 -4
- package/dist/web/assets/index-BMaSsizY.js +499 -0
- package/dist/web/assets/index-D7TVTIt9.css +1 -0
- package/dist/web/assets/input-C0OQCUZy.js +1 -0
- package/dist/web/assets/{label-Cdim77Jw.js → label-CI7JWQOo.js} +1 -1
- package/dist/web/assets/{maximize-2-BTT9QQU9.js → maximize-2-Br1WQzT2.js} +1 -1
- package/dist/web/assets/{maximize-_O55kFcr.js → maximize-CJNgRe6S.js} +1 -1
- package/dist/web/assets/{refresh-cw-C9wQl8_d.js → refresh-cw-B5iaAZKn.js} +1 -1
- package/dist/web/assets/{save-B-MsgxX9.js → save-TM6fvNrt.js} +1 -1
- package/dist/web/assets/select-D6jzbLJn.js +1 -0
- package/dist/web/assets/shared-CFs9CZfB.js +1 -0
- package/dist/web/assets/{sparkles-2OAsc1aP.js → sparkles-BGYTDThM.js} +1 -1
- package/dist/web/assets/tabs-subtle-D2XkWhLL.js +1 -0
- package/dist/web/assets/textarea-CRTXuRmE.js +1 -0
- package/dist/web/assets/{useConfig-BAsKhUxf.js → useConfig-B6tXvJOb.js} +1 -1
- package/dist/web/assets/useViewHostProps-DZqOwiAm.js +1 -0
- package/dist/web/assets/{zap-Du2Uc5pa.js → zap-BDWHCVHU.js} +1 -1
- package/dist/web/index.html +10 -10
- package/package.json +4 -4
- package/dist/cdn/CheckboxIndicator-Bt4IICtv.js +0 -251
- package/dist/cdn/PromptsTab-C4LuwyWN.js +0 -901
- package/dist/cdn/card-DgiYnSg-.js +0 -41
- package/dist/cdn/createLucideIcon-C5fZZ6oB.js +0 -38
- package/dist/cdn/providerMeta-BQIfHuNL.js +0 -379
- package/dist/cdn/spinner-jQtC7EBj.js +0 -15
- package/dist/web/assets/AnimatePresence-C5p0yiY1.js +0 -9
- package/dist/web/assets/ChatTab-CsBPVCSc.js +0 -18
- package/dist/web/assets/ConnectionSettingsTab-DQTXfnl1.js +0 -1
- package/dist/web/assets/ElicitationTab-_FKB7nNG.js +0 -1
- package/dist/web/assets/FormContext-DH2caWKO.js +0 -1
- package/dist/web/assets/ListTabHeader-R17w_JsB.js +0 -1
- package/dist/web/assets/PromptsTab-B2uVMRR2.js +0 -15
- package/dist/web/assets/ResourcesTab-DhOZYPjE.js +0 -2
- package/dist/web/assets/SamplingTab-C-oY2hoi.js +0 -1
- package/dist/web/assets/ServerMetadataTab-BkTxO5KS.js +0 -1
- package/dist/web/assets/ToolsTab-DupHgo7A.js +0 -8
- package/dist/web/assets/WidgetWrapper-CZaEVEw4.js +0 -34
- package/dist/web/assets/checkbox-BQ9mI_6k.js +0 -1
- package/dist/web/assets/code-tME-5H6D.js +0 -1
- package/dist/web/assets/createLucideIcon-B3b8EU0b.js +0 -1
- package/dist/web/assets/index-C_fCIJ4C.js +0 -492
- package/dist/web/assets/index-fBX3akc8.css +0 -1
- package/dist/web/assets/input-CLYhA7PK.js +0 -1
- package/dist/web/assets/jsx-runtime-Cjj9sGSy.js +0 -1
- package/dist/web/assets/select-CJ57-Bor.js +0 -1
- package/dist/web/assets/shared-CCC9rTz4.js +0 -1
- package/dist/web/assets/tabs-subtle-246ABJqx.js +0 -1
- package/dist/web/assets/textarea-DLAmNVf_.js +0 -1
- package/dist/web/assets/useViewHostProps-CV5zBxUb.js +0 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { s as e, t } from "./react-BIs9pQ3H.js";
|
|
2
|
-
import { G as n, K as r,
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import { t as C } from "./
|
|
6
|
-
import {
|
|
7
|
-
import { t as k } from "./
|
|
8
|
-
import { A, E as j, S as
|
|
9
|
-
import { i as
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as
|
|
15
|
-
import { t as
|
|
16
|
-
import { t as
|
|
17
|
-
import { t as
|
|
18
|
-
import { n as
|
|
19
|
-
import { r as
|
|
20
|
-
import { a as
|
|
21
|
-
import { t as
|
|
22
|
-
import { a as
|
|
23
|
-
var
|
|
2
|
+
import { G as n, K as r, a as i, n as a, r as o, t as s } from "./input-BCpgLXU1.js";
|
|
3
|
+
import { n as c, t as l } from "./createLucideIcon-BONxC1L5.js";
|
|
4
|
+
import { U as u, t as d } from "./button-CB4uOoUV.js";
|
|
5
|
+
import { _ as f, a as p, c as m, d as h, i as g, l as _, n as v, o as y, s as b, t as x, u as S, v as C } from "./sheet-oyq1mIyg.js";
|
|
6
|
+
import { t as w } from "./label-A0UGV8FE.js";
|
|
7
|
+
import { a as T, i as E, n as D, r as O, t as k } from "./select-CCFHjOGk.js";
|
|
8
|
+
import { A, E as j, S as ee, T as M, a as N, b as P, c as te, i as F, l as ne, n as re, o as ie, r as ae, s as oe, t as se, w as I } from "./dialog-CJGnC5Ag.js";
|
|
9
|
+
import { i as L, t as R } from "./browser-DG2Z8392.js";
|
|
10
|
+
import { t as ce } from "./clock-YMF8Gtw5.js";
|
|
11
|
+
import { t as le } from "./JSONDisplay-BJqMz7Ny.js";
|
|
12
|
+
import { t as ue } from "./loader-circle-BKRHJEB7.js";
|
|
13
|
+
import { t as de } from "./maximize-2-DdrB_spi.js";
|
|
14
|
+
import { t as fe } from "./sparkles-CxeZpVtX.js";
|
|
15
|
+
import { t as pe } from "./trash-2-BhumJAFE.js";
|
|
16
|
+
import { t as me } from "./x-EilKPiCX.js";
|
|
17
|
+
import { t as he } from "./switch-DHXEA_N5.js";
|
|
18
|
+
import { n as z } from "./dist-CTJnCYmk.js";
|
|
19
|
+
import { r as ge, s as _e } from "./WidgetDebugContext-B6yoOVVV.js";
|
|
20
|
+
import { a as B } from "./dist-SxRsB1iS.js";
|
|
21
|
+
import { t as V } from "./textarea-CwmI8_uI.js";
|
|
22
|
+
import { a as ve, i as ye, n as be, o as xe, r as Se } from "./useViewHostProps-CDOm2w6u.js";
|
|
23
|
+
var Ce = l("braces", [["path", {
|
|
24
24
|
d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",
|
|
25
25
|
key: "ezmyqa"
|
|
26
26
|
}], ["path", {
|
|
27
27
|
d: "M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",
|
|
28
28
|
key: "e1hn23"
|
|
29
|
-
}]]),
|
|
29
|
+
}]]), we = l("database", [
|
|
30
30
|
["ellipse", {
|
|
31
31
|
cx: "12",
|
|
32
32
|
cy: "5",
|
|
@@ -42,10 +42,10 @@ var we = k("braces", [["path", {
|
|
|
42
42
|
d: "M3 12A9 3 0 0 0 21 12",
|
|
43
43
|
key: "mv7ke4"
|
|
44
44
|
}]
|
|
45
|
-
]),
|
|
45
|
+
]), Te = l("mouse-pointer-2", [["path", {
|
|
46
46
|
d: "M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",
|
|
47
47
|
key: "edeuup"
|
|
48
|
-
}]]),
|
|
48
|
+
}]]), Ee = l("picture-in-picture", [
|
|
49
49
|
["path", {
|
|
50
50
|
d: "M2 10h6V4",
|
|
51
51
|
key: "zwrco"
|
|
@@ -70,7 +70,7 @@ var we = k("braces", [["path", {
|
|
|
70
70
|
rx: "1",
|
|
71
71
|
key: "1wjs3o"
|
|
72
72
|
}]
|
|
73
|
-
]),
|
|
73
|
+
]), De = l("pointer", [
|
|
74
74
|
["path", {
|
|
75
75
|
d: "M22 14a8 8 0 0 1-8 8",
|
|
76
76
|
key: "56vcr3"
|
|
@@ -91,13 +91,13 @@ var we = k("braces", [["path", {
|
|
|
91
91
|
d: "M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",
|
|
92
92
|
key: "g6ys72"
|
|
93
93
|
}]
|
|
94
|
-
]),
|
|
94
|
+
]), Oe = l("shield-check", [["path", {
|
|
95
95
|
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
|
|
96
96
|
key: "oel41y"
|
|
97
97
|
}], ["path", {
|
|
98
98
|
d: "m9 12 2 2 4-4",
|
|
99
99
|
key: "dzmm74"
|
|
100
|
-
}]]),
|
|
100
|
+
}]]), ke = l("shield-off", [
|
|
101
101
|
["path", {
|
|
102
102
|
d: "m2 2 20 20",
|
|
103
103
|
key: "1ooewy"
|
|
@@ -110,7 +110,7 @@ var we = k("braces", [["path", {
|
|
|
110
110
|
d: "M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",
|
|
111
111
|
key: "18rp1v"
|
|
112
112
|
}]
|
|
113
|
-
]),
|
|
113
|
+
]), Ae = l("smartphone", [["rect", {
|
|
114
114
|
width: "14",
|
|
115
115
|
height: "20",
|
|
116
116
|
x: "5",
|
|
@@ -121,7 +121,7 @@ var we = k("braces", [["path", {
|
|
|
121
121
|
}], ["path", {
|
|
122
122
|
d: "M12 18h.01",
|
|
123
123
|
key: "mhygvu"
|
|
124
|
-
}]]),
|
|
124
|
+
}]]), je = l("square-dashed-mouse-pointer", [
|
|
125
125
|
["path", {
|
|
126
126
|
d: "M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z",
|
|
127
127
|
key: "xwnzip"
|
|
@@ -162,27 +162,13 @@ var we = k("braces", [["path", {
|
|
|
162
162
|
d: "M3 14v1",
|
|
163
163
|
key: "vnatye"
|
|
164
164
|
}]
|
|
165
|
-
]),
|
|
166
|
-
width: "16",
|
|
167
|
-
height: "20",
|
|
168
|
-
x: "4",
|
|
169
|
-
y: "2",
|
|
170
|
-
rx: "2",
|
|
171
|
-
ry: "2",
|
|
172
|
-
key: "76otgf"
|
|
173
|
-
}], ["line", {
|
|
174
|
-
x1: "12",
|
|
175
|
-
x2: "12.01",
|
|
176
|
-
y1: "18",
|
|
177
|
-
y2: "18",
|
|
178
|
-
key: "1dp563"
|
|
179
|
-
}]]), V = k("terminal", [["path", {
|
|
165
|
+
]), H = l("terminal", [["path", {
|
|
180
166
|
d: "M12 19h8",
|
|
181
167
|
key: "baeox8"
|
|
182
168
|
}], ["path", {
|
|
183
169
|
d: "m4 17 6-6-6-6",
|
|
184
170
|
key: "1yngyt"
|
|
185
|
-
}]]),
|
|
171
|
+
}]]), Me = l("trash", [
|
|
186
172
|
["path", {
|
|
187
173
|
d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",
|
|
188
174
|
key: "miytrc"
|
|
@@ -195,7 +181,7 @@ var we = k("braces", [["path", {
|
|
|
195
181
|
d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",
|
|
196
182
|
key: "e791ji"
|
|
197
183
|
}]
|
|
198
|
-
]),
|
|
184
|
+
]), U = /* @__PURE__ */ e(t(), 1), Ne = [
|
|
199
185
|
{
|
|
200
186
|
value: "en-US",
|
|
201
187
|
label: "English (US)"
|
|
@@ -433,19 +419,19 @@ var we = k("braces", [["path", {
|
|
|
433
419
|
label: "Swahili (Kenya)"
|
|
434
420
|
}
|
|
435
421
|
];
|
|
436
|
-
function
|
|
422
|
+
function Pe() {
|
|
437
423
|
return Intl.supportedValuesOf("timeZone").map((e) => ({
|
|
438
424
|
value: e,
|
|
439
425
|
label: e.replace(/_/g, " ")
|
|
440
426
|
}));
|
|
441
427
|
}
|
|
442
|
-
var
|
|
443
|
-
function
|
|
444
|
-
let [t, n] = (0,
|
|
445
|
-
return (0,
|
|
428
|
+
var Fe = Pe(), W = (e) => `mcp-inspector-resource-props-${e}`;
|
|
429
|
+
function Ie(e) {
|
|
430
|
+
let [t, n] = (0, U.useState)([]), [r, i] = (0, U.useState)(null);
|
|
431
|
+
return (0, U.useEffect)(() => {
|
|
446
432
|
(() => {
|
|
447
433
|
try {
|
|
448
|
-
let t =
|
|
434
|
+
let t = W(e), r = localStorage.getItem(t);
|
|
449
435
|
if (r) {
|
|
450
436
|
let e = JSON.parse(r);
|
|
451
437
|
n(e.presets || []), i(e.activePresetId || null);
|
|
@@ -454,8 +440,8 @@ function Re(e) {
|
|
|
454
440
|
console.error("[useResourceProps] Failed to load presets:", e), n([]), i(null);
|
|
455
441
|
}
|
|
456
442
|
})();
|
|
457
|
-
}, [e]), (0,
|
|
458
|
-
let n =
|
|
443
|
+
}, [e]), (0, U.useEffect)(() => {
|
|
444
|
+
let n = W(e), i = {
|
|
459
445
|
presets: t,
|
|
460
446
|
activePresetId: r
|
|
461
447
|
};
|
|
@@ -467,25 +453,25 @@ function Re(e) {
|
|
|
467
453
|
]), {
|
|
468
454
|
presets: t,
|
|
469
455
|
activePresetId: r,
|
|
470
|
-
savePreset: (0,
|
|
456
|
+
savePreset: (0, U.useCallback)((e) => {
|
|
471
457
|
n((t) => {
|
|
472
458
|
let n = t.findIndex((t) => t.id === e.id), r;
|
|
473
459
|
return n >= 0 ? (r = [...t], r[n] = e) : r = [...t, e], r;
|
|
474
460
|
});
|
|
475
461
|
}, []),
|
|
476
|
-
deletePreset: (0,
|
|
462
|
+
deletePreset: (0, U.useCallback)((e) => {
|
|
477
463
|
n((t) => t.filter((t) => t.id !== e)), i((t) => t === e ? null : t);
|
|
478
464
|
}, []),
|
|
479
|
-
setActivePreset: (0,
|
|
465
|
+
setActivePreset: (0, U.useCallback)((e) => {
|
|
480
466
|
i(e);
|
|
481
467
|
}, []),
|
|
482
|
-
getActiveProps: (0,
|
|
468
|
+
getActiveProps: (0, U.useCallback)(() => r && t.find((e) => e.id === r)?.props || null, [r, t])
|
|
483
469
|
};
|
|
484
470
|
}
|
|
485
471
|
//#endregion
|
|
486
472
|
//#region src/client/hooks/useIframeConsole.ts
|
|
487
|
-
function
|
|
488
|
-
let { enabled: t = !0, maxLogs: n = 1e3, proxyToPageConsole: r = !1 } = e, [i, a] = (0,
|
|
473
|
+
function G(e = {}) {
|
|
474
|
+
let { enabled: t = !0, maxLogs: n = 1e3, proxyToPageConsole: r = !1 } = e, [i, a] = (0, U.useState)([]), [o, s] = (0, U.useState)(!1), c = (0, U.useRef)(0), l = (0, U.useCallback)((e) => {
|
|
489
475
|
if (!t) return;
|
|
490
476
|
let i = {
|
|
491
477
|
...e,
|
|
@@ -523,10 +509,10 @@ function W(e = {}) {
|
|
|
523
509
|
t,
|
|
524
510
|
n,
|
|
525
511
|
r
|
|
526
|
-
]), u = (0,
|
|
512
|
+
]), u = (0, U.useCallback)(() => {
|
|
527
513
|
a([]), c.current = 0;
|
|
528
514
|
}, []);
|
|
529
|
-
return (0,
|
|
515
|
+
return (0, U.useEffect)(() => {
|
|
530
516
|
if (!t) return;
|
|
531
517
|
let e = (e) => {
|
|
532
518
|
e.data && e.data.type === "iframe-console-log" && e.data.level && Array.isArray(e.data.args) && l({
|
|
@@ -539,8 +525,8 @@ function W(e = {}) {
|
|
|
539
525
|
return window.addEventListener("message", e), () => {
|
|
540
526
|
window.removeEventListener("message", e);
|
|
541
527
|
};
|
|
542
|
-
}, [t, l]), (0,
|
|
543
|
-
if (t) return
|
|
528
|
+
}, [t, l]), (0, U.useEffect)(() => {
|
|
529
|
+
if (t) return xe.subscribe(l);
|
|
544
530
|
}, [t, l]), {
|
|
545
531
|
logs: i,
|
|
546
532
|
addLog: l,
|
|
@@ -551,8 +537,8 @@ function W(e = {}) {
|
|
|
551
537
|
}
|
|
552
538
|
//#endregion
|
|
553
539
|
//#region src/client/components/IframeConsole.tsx
|
|
554
|
-
var
|
|
555
|
-
function
|
|
540
|
+
var K = c(), Le = 200, Re = .9;
|
|
541
|
+
function q(e) {
|
|
556
542
|
if (e === null) return "null";
|
|
557
543
|
if (e === void 0) return "undefined";
|
|
558
544
|
if (typeof e == "string") return e;
|
|
@@ -563,10 +549,10 @@ function K(e) {
|
|
|
563
549
|
}
|
|
564
550
|
return String(e);
|
|
565
551
|
}
|
|
566
|
-
function
|
|
552
|
+
function J(e) {
|
|
567
553
|
if (e.length === 0) return [];
|
|
568
554
|
let t = e[0];
|
|
569
|
-
if (typeof t != "string" || !/%[oOdisfc]/.test(t)) return e.map(
|
|
555
|
+
if (typeof t != "string" || !/%[oOdisfc]/.test(t)) return e.map(q);
|
|
570
556
|
let n = e.slice(1), r = 0, i = "";
|
|
571
557
|
for (let e = 0; e < t.length; e++) {
|
|
572
558
|
let a = t[e];
|
|
@@ -575,7 +561,7 @@ function q(e) {
|
|
|
575
561
|
switch (o) {
|
|
576
562
|
case "o":
|
|
577
563
|
case "O":
|
|
578
|
-
i +=
|
|
564
|
+
i += q(s), e++;
|
|
579
565
|
break;
|
|
580
566
|
case "s":
|
|
581
567
|
i += s === void 0 ? "undefined" : String(s), e++;
|
|
@@ -597,12 +583,12 @@ function q(e) {
|
|
|
597
583
|
i += a;
|
|
598
584
|
}
|
|
599
585
|
let a = [i.trim()];
|
|
600
|
-
for (; r < n.length;) a.push(
|
|
586
|
+
for (; r < n.length;) a.push(q(n[r++]));
|
|
601
587
|
return a.filter((e) => e.length > 0);
|
|
602
588
|
}
|
|
603
|
-
function
|
|
604
|
-
return /* @__PURE__ */ (0,
|
|
605
|
-
className:
|
|
589
|
+
function ze({ level: e }) {
|
|
590
|
+
return /* @__PURE__ */ (0, K.jsx)("span", {
|
|
591
|
+
className: u("px-1.5 py-0.5 text-[11px] font-mono font-semibold rounded-full text-white shrink-0", {
|
|
606
592
|
log: "bg-zinc-500",
|
|
607
593
|
info: "bg-blue-500",
|
|
608
594
|
warn: "bg-yellow-500",
|
|
@@ -613,45 +599,45 @@ function Ve({ level: e }) {
|
|
|
613
599
|
children: e.toUpperCase()
|
|
614
600
|
});
|
|
615
601
|
}
|
|
616
|
-
function
|
|
617
|
-
let [t, n] = (0,
|
|
602
|
+
function Be({ log: e }) {
|
|
603
|
+
let [t, n] = (0, U.useState)(!1), i = (0, U.useMemo)(() => {
|
|
618
604
|
try {
|
|
619
605
|
return new Date(e.timestamp).toLocaleTimeString();
|
|
620
606
|
} catch {
|
|
621
607
|
return "";
|
|
622
608
|
}
|
|
623
|
-
}, [e.timestamp]),
|
|
624
|
-
if (
|
|
625
|
-
let e =
|
|
626
|
-
return (e.length > 120 ? e.slice(0, 120) + "…" : e) + (
|
|
627
|
-
}, [
|
|
609
|
+
}, [e.timestamp]), a = (0, U.useMemo)(() => J(e.args), [e.args]), o = (0, U.useMemo)(() => {
|
|
610
|
+
if (a.length === 0) return "";
|
|
611
|
+
let e = a[0].replace(/\s*\n\s*/g, " ").trim();
|
|
612
|
+
return (e.length > 120 ? e.slice(0, 120) + "…" : e) + (a.length > 1 ? ` +${a.length - 1}` : "");
|
|
613
|
+
}, [a]), s = async (e) => {
|
|
628
614
|
e.stopPropagation();
|
|
629
615
|
try {
|
|
630
|
-
await
|
|
616
|
+
await R(a.join("\n")), z.success("Copied to clipboard");
|
|
631
617
|
} catch {
|
|
632
|
-
|
|
618
|
+
z.error("Failed to copy");
|
|
633
619
|
}
|
|
634
|
-
},
|
|
635
|
-
return /* @__PURE__ */ (0,
|
|
636
|
-
className:
|
|
637
|
-
children: [/* @__PURE__ */ (0,
|
|
638
|
-
className:
|
|
620
|
+
}, c = u("font-mono text-xs border-b border-zinc-200 dark:border-zinc-800", e.level === "error" && "bg-red-50/30 dark:bg-red-950/10", e.level === "warn" && "bg-yellow-50/30 dark:bg-yellow-950/10"), l = u("cursor-pointer select-none", e.level === "error" && "hover:bg-red-50/50 dark:hover:bg-red-950/20", e.level === "warn" && "hover:bg-yellow-50/50 dark:hover:bg-yellow-950/20", e.level !== "error" && e.level !== "warn" && "hover:bg-zinc-100/70 dark:hover:bg-zinc-800/40");
|
|
621
|
+
return /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
622
|
+
className: u(c, "group"),
|
|
623
|
+
children: [/* @__PURE__ */ (0, K.jsxs)("div", {
|
|
624
|
+
className: u("flex items-center gap-2 px-2 py-1.5", l),
|
|
639
625
|
onClick: () => n((e) => !e),
|
|
640
626
|
children: [
|
|
641
|
-
/* @__PURE__ */ (0,
|
|
627
|
+
/* @__PURE__ */ (0, K.jsx)("span", {
|
|
642
628
|
className: "text-zinc-400 dark:text-zinc-500 shrink-0",
|
|
643
|
-
children: t ? /* @__PURE__ */ (0,
|
|
629
|
+
children: t ? /* @__PURE__ */ (0, K.jsx)(A, { className: "size-3" }) : /* @__PURE__ */ (0, K.jsx)(r, { className: "size-3" })
|
|
644
630
|
}),
|
|
645
|
-
/* @__PURE__ */ (0,
|
|
646
|
-
/* @__PURE__ */ (0,
|
|
631
|
+
/* @__PURE__ */ (0, K.jsx)(ze, { level: e.level }),
|
|
632
|
+
/* @__PURE__ */ (0, K.jsx)("span", {
|
|
647
633
|
className: "text-zinc-500 dark:text-zinc-400 text-[10px] shrink-0",
|
|
648
|
-
children:
|
|
634
|
+
children: i
|
|
649
635
|
}),
|
|
650
|
-
!t && /* @__PURE__ */ (0,
|
|
651
|
-
className:
|
|
652
|
-
children:
|
|
636
|
+
!t && /* @__PURE__ */ (0, K.jsx)("span", {
|
|
637
|
+
className: u("truncate text-[11px]", e.level === "error" && "text-red-700 dark:text-red-400", e.level === "warn" && "text-yellow-700 dark:text-yellow-400", e.level !== "error" && e.level !== "warn" && "text-zinc-700 dark:text-zinc-300"),
|
|
638
|
+
children: o
|
|
653
639
|
}),
|
|
654
|
-
t && e.url && /* @__PURE__ */ (0,
|
|
640
|
+
t && e.url && /* @__PURE__ */ (0, K.jsx)("span", {
|
|
655
641
|
className: "text-zinc-400 dark:text-zinc-500 text-[10px] truncate flex-1",
|
|
656
642
|
children: (() => {
|
|
657
643
|
try {
|
|
@@ -661,30 +647,30 @@ function He({ log: e }) {
|
|
|
661
647
|
}
|
|
662
648
|
})()
|
|
663
649
|
}),
|
|
664
|
-
t && /* @__PURE__ */ (0,
|
|
665
|
-
onClick:
|
|
650
|
+
t && /* @__PURE__ */ (0, K.jsx)("button", {
|
|
651
|
+
onClick: s,
|
|
666
652
|
"aria-label": "Copy log",
|
|
667
653
|
className: "ml-auto shrink-0 opacity-0 group-hover:opacity-100 transition-opacity p-0.5 rounded text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200",
|
|
668
|
-
children: /* @__PURE__ */ (0,
|
|
654
|
+
children: /* @__PURE__ */ (0, K.jsx)(L, { className: "size-3" })
|
|
669
655
|
})
|
|
670
656
|
]
|
|
671
|
-
}), t && /* @__PURE__ */ (0,
|
|
657
|
+
}), t && /* @__PURE__ */ (0, K.jsx)("div", {
|
|
672
658
|
className: "pl-8 pr-2 pb-2 select-text",
|
|
673
|
-
children:
|
|
674
|
-
className:
|
|
659
|
+
children: a.map((t, n) => /* @__PURE__ */ (0, K.jsx)("pre", {
|
|
660
|
+
className: u("whitespace-pre-wrap wrap-break-word text-[11px]", e.level === "error" && "text-red-700 dark:text-red-400", e.level === "warn" && "text-yellow-700 dark:text-yellow-400", e.level !== "error" && e.level !== "warn" && "text-zinc-700 dark:text-zinc-300"),
|
|
675
661
|
children: t
|
|
676
662
|
}, n))
|
|
677
663
|
})]
|
|
678
664
|
});
|
|
679
665
|
}
|
|
680
|
-
var
|
|
666
|
+
var Y = "mcp-inspector-console-proxy-enabled", Ve = "mcp-inspector-console-height", He = [
|
|
681
667
|
"log",
|
|
682
668
|
"info",
|
|
683
669
|
"warn",
|
|
684
670
|
"error",
|
|
685
671
|
"debug",
|
|
686
672
|
"trace"
|
|
687
|
-
],
|
|
673
|
+
], Ue = {
|
|
688
674
|
log: "text-zinc-500",
|
|
689
675
|
info: "text-blue-500",
|
|
690
676
|
warn: "text-yellow-500",
|
|
@@ -692,48 +678,48 @@ var J = "mcp-inspector-console-proxy-enabled", Ue = "mcp-inspector-console-heigh
|
|
|
692
678
|
debug: "text-purple-500",
|
|
693
679
|
trace: "text-gray-500"
|
|
694
680
|
};
|
|
695
|
-
function
|
|
696
|
-
let [r,
|
|
681
|
+
function We({ iframeId: e, enabled: t = !0 }) {
|
|
682
|
+
let [r, s] = (0, U.useState)(() => {
|
|
697
683
|
if (typeof window > "u") return !0;
|
|
698
684
|
try {
|
|
699
|
-
return localStorage.getItem(
|
|
685
|
+
return localStorage.getItem(Y) === "true";
|
|
700
686
|
} catch {
|
|
701
687
|
return !0;
|
|
702
688
|
}
|
|
703
|
-
}), [
|
|
689
|
+
}), [c, l] = (0, U.useState)(() => {
|
|
704
690
|
if (typeof window > "u") return 400;
|
|
705
691
|
try {
|
|
706
|
-
let e = localStorage.getItem(
|
|
707
|
-
return e ? Math.max(
|
|
692
|
+
let e = localStorage.getItem(Ve);
|
|
693
|
+
return e ? Math.max(Le, parseInt(e, 10)) : 400;
|
|
708
694
|
} catch {
|
|
709
695
|
return 400;
|
|
710
696
|
}
|
|
711
|
-
}),
|
|
712
|
-
e.preventDefault(),
|
|
697
|
+
}), f = (0, U.useRef)(!1), m = (0, U.useCallback)((e) => {
|
|
698
|
+
e.preventDefault(), f.current = !0;
|
|
713
699
|
let t = (e) => {
|
|
714
|
-
if (!
|
|
715
|
-
let t = Math.floor(window.innerHeight *
|
|
716
|
-
|
|
700
|
+
if (!f.current) return;
|
|
701
|
+
let t = Math.floor(window.innerHeight * Re);
|
|
702
|
+
l(Math.min(t, Math.max(Le, window.innerHeight - e.clientY)));
|
|
717
703
|
}, n = () => {
|
|
718
|
-
|
|
704
|
+
f.current = !1, window.removeEventListener("mousemove", t), window.removeEventListener("mouseup", n);
|
|
719
705
|
};
|
|
720
706
|
window.addEventListener("mousemove", t), window.addEventListener("mouseup", n);
|
|
721
707
|
}, []);
|
|
722
|
-
(0,
|
|
708
|
+
(0, U.useEffect)(() => {
|
|
723
709
|
try {
|
|
724
|
-
localStorage.setItem(
|
|
710
|
+
localStorage.setItem(Ve, String(c));
|
|
725
711
|
} catch {}
|
|
726
|
-
}, [
|
|
727
|
-
let [
|
|
712
|
+
}, [c]);
|
|
713
|
+
let [h, _] = (0, U.useState)("all"), [b, S] = (0, U.useState)(""), { logs: C, clearLogs: T, isOpen: E, setIsOpen: D } = G({
|
|
728
714
|
enabled: t,
|
|
729
715
|
proxyToPageConsole: r
|
|
730
|
-
}), O = (0,
|
|
731
|
-
(0,
|
|
716
|
+
}), O = (0, U.useRef)(null);
|
|
717
|
+
(0, U.useEffect)(() => {
|
|
732
718
|
try {
|
|
733
|
-
localStorage.setItem(
|
|
719
|
+
localStorage.setItem(Y, String(r));
|
|
734
720
|
} catch {}
|
|
735
721
|
}, [r]);
|
|
736
|
-
let k = (0,
|
|
722
|
+
let k = (0, U.useMemo)(() => {
|
|
737
723
|
let e = {
|
|
738
724
|
log: 0,
|
|
739
725
|
info: 0,
|
|
@@ -742,57 +728,57 @@ function Ke({ iframeId: e, enabled: t = !0 }) {
|
|
|
742
728
|
debug: 0,
|
|
743
729
|
trace: 0
|
|
744
730
|
};
|
|
745
|
-
for (let t of
|
|
731
|
+
for (let t of C) e[t.level]++;
|
|
746
732
|
return e;
|
|
747
|
-
}, [
|
|
733
|
+
}, [C]), A = k.error, j = k.warn, ee = k.log + k.info + k.debug + k.trace, M = C.length, N = (0, U.useMemo)(() => A > 0 ? "bg-red-500" : j > 0 ? "bg-yellow-500" : "bg-zinc-500", [
|
|
748
734
|
A,
|
|
749
735
|
j,
|
|
750
|
-
|
|
751
|
-
]),
|
|
752
|
-
let e =
|
|
736
|
+
ee
|
|
737
|
+
]), P = (0, U.useMemo)(() => {
|
|
738
|
+
let e = h === "all" ? C : C.filter((e) => e.level === h), t = b.trim().toLowerCase();
|
|
753
739
|
return t && (e = e.filter((e) => {
|
|
754
|
-
let n =
|
|
740
|
+
let n = J(e.args).join(" ").toLowerCase(), r = (e.url ?? "").toLowerCase();
|
|
755
741
|
return n.includes(t) || r.includes(t);
|
|
756
742
|
})), e;
|
|
757
743
|
}, [
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
744
|
+
C,
|
|
745
|
+
h,
|
|
746
|
+
b
|
|
761
747
|
]);
|
|
762
|
-
return (0,
|
|
763
|
-
E && !
|
|
748
|
+
return (0, U.useEffect)(() => {
|
|
749
|
+
E && !b && O.current && (O.current.scrollTop = O.current.scrollHeight);
|
|
764
750
|
}, [
|
|
765
|
-
|
|
751
|
+
P,
|
|
766
752
|
E,
|
|
767
|
-
|
|
768
|
-
]), /* @__PURE__ */ (0,
|
|
753
|
+
b
|
|
754
|
+
]), /* @__PURE__ */ (0, K.jsxs)(x, {
|
|
769
755
|
open: E,
|
|
770
756
|
onOpenChange: D,
|
|
771
|
-
children: [/* @__PURE__ */ (0,
|
|
772
|
-
render: /* @__PURE__ */ (0,
|
|
773
|
-
render: /* @__PURE__ */ (0,
|
|
757
|
+
children: [/* @__PURE__ */ (0, K.jsx)(y, {
|
|
758
|
+
render: /* @__PURE__ */ (0, K.jsxs)(a, { children: [/* @__PURE__ */ (0, K.jsx)(i, {
|
|
759
|
+
render: /* @__PURE__ */ (0, K.jsxs)(d, {
|
|
774
760
|
variant: "outline",
|
|
775
761
|
size: "sm",
|
|
776
762
|
className: "relative bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
777
763
|
onClick: () => D(!0),
|
|
778
|
-
children: [/* @__PURE__ */ (0,
|
|
779
|
-
className:
|
|
780
|
-
children:
|
|
764
|
+
children: [/* @__PURE__ */ (0, K.jsx)(H, { className: "size-4" }), M > 0 && /* @__PURE__ */ (0, K.jsx)("span", {
|
|
765
|
+
className: u("ml-2 px-1.5 py-0.5 text-xs rounded-full text-white font-semibold", N),
|
|
766
|
+
children: M
|
|
781
767
|
})]
|
|
782
768
|
}),
|
|
783
769
|
nativeButton: !0
|
|
784
|
-
}), /* @__PURE__ */ (0,
|
|
770
|
+
}), /* @__PURE__ */ (0, K.jsx)(o, { children: /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
785
771
|
className: "text-xs space-y-1",
|
|
786
772
|
children: [
|
|
787
|
-
/* @__PURE__ */ (0,
|
|
773
|
+
/* @__PURE__ */ (0, K.jsxs)("p", {
|
|
788
774
|
className: "font-semibold",
|
|
789
775
|
children: [
|
|
790
|
-
|
|
776
|
+
M,
|
|
791
777
|
" console ",
|
|
792
|
-
|
|
778
|
+
M === 1 ? "log" : "logs"
|
|
793
779
|
]
|
|
794
780
|
}),
|
|
795
|
-
A > 0 && /* @__PURE__ */ (0,
|
|
781
|
+
A > 0 && /* @__PURE__ */ (0, K.jsxs)("p", {
|
|
796
782
|
className: "text-red-400",
|
|
797
783
|
children: [
|
|
798
784
|
A,
|
|
@@ -800,7 +786,7 @@ function Ke({ iframeId: e, enabled: t = !0 }) {
|
|
|
800
786
|
A === 1 ? "" : "s"
|
|
801
787
|
]
|
|
802
788
|
}),
|
|
803
|
-
j > 0 && /* @__PURE__ */ (0,
|
|
789
|
+
j > 0 && /* @__PURE__ */ (0, K.jsxs)("p", {
|
|
804
790
|
className: "text-yellow-400",
|
|
805
791
|
children: [
|
|
806
792
|
j,
|
|
@@ -808,145 +794,145 @@ function Ke({ iframeId: e, enabled: t = !0 }) {
|
|
|
808
794
|
j === 1 ? "" : "s"
|
|
809
795
|
]
|
|
810
796
|
}),
|
|
811
|
-
|
|
797
|
+
ee > 0 && /* @__PURE__ */ (0, K.jsxs)("p", {
|
|
812
798
|
className: "text-zinc-400",
|
|
813
|
-
children: [
|
|
799
|
+
children: [ee, " info"]
|
|
814
800
|
})
|
|
815
801
|
]
|
|
816
802
|
}) })] }),
|
|
817
803
|
nativeButton: !1
|
|
818
|
-
}), /* @__PURE__ */ (0,
|
|
804
|
+
}), /* @__PURE__ */ (0, K.jsxs)(v, {
|
|
819
805
|
side: "bottom",
|
|
820
806
|
className: "flex flex-col p-0 transition-none m-0 gap-0",
|
|
821
|
-
style: { height:
|
|
807
|
+
style: { height: c },
|
|
822
808
|
children: [
|
|
823
|
-
/* @__PURE__ */ (0,
|
|
809
|
+
/* @__PURE__ */ (0, K.jsx)("div", {
|
|
824
810
|
className: "h-1.5 w-full shrink-0 cursor-ns-resize bg-zinc-200 dark:bg-zinc-700 hover:bg-zinc-300 dark:hover:bg-zinc-600 transition-colors",
|
|
825
811
|
onMouseDown: m
|
|
826
812
|
}),
|
|
827
|
-
/* @__PURE__ */ (0,
|
|
813
|
+
/* @__PURE__ */ (0, K.jsxs)(g, {
|
|
828
814
|
className: "px-4 py-4 m-0 border-b border-zinc-200 dark:border-zinc-800 shrink-0",
|
|
829
|
-
children: [/* @__PURE__ */ (0,
|
|
815
|
+
children: [/* @__PURE__ */ (0, K.jsxs)("div", {
|
|
830
816
|
className: "flex items-center justify-between",
|
|
831
|
-
children: [/* @__PURE__ */ (0,
|
|
817
|
+
children: [/* @__PURE__ */ (0, K.jsxs)(p, {
|
|
832
818
|
className: "flex items-center gap-2",
|
|
833
819
|
children: [
|
|
834
|
-
/* @__PURE__ */ (0,
|
|
820
|
+
/* @__PURE__ */ (0, K.jsx)(H, { className: "size-4" }),
|
|
835
821
|
"Widget Console Logs",
|
|
836
|
-
|
|
822
|
+
C.length > 0 && /* @__PURE__ */ (0, K.jsxs)("span", {
|
|
837
823
|
className: "text-sm font-normal text-zinc-500 dark:text-zinc-400",
|
|
838
824
|
children: [
|
|
839
825
|
"(",
|
|
840
|
-
|
|
826
|
+
C.length,
|
|
841
827
|
" ",
|
|
842
|
-
|
|
828
|
+
C.length === 1 ? "log" : "logs",
|
|
843
829
|
")"
|
|
844
830
|
]
|
|
845
831
|
})
|
|
846
832
|
]
|
|
847
|
-
}), /* @__PURE__ */ (0,
|
|
833
|
+
}), /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
848
834
|
className: "flex items-center gap-4 pr-4",
|
|
849
|
-
children: [/* @__PURE__ */ (0,
|
|
835
|
+
children: [/* @__PURE__ */ (0, K.jsxs)("div", {
|
|
850
836
|
className: "flex items-center gap-2",
|
|
851
|
-
children: [/* @__PURE__ */ (0,
|
|
837
|
+
children: [/* @__PURE__ */ (0, K.jsx)(he, {
|
|
852
838
|
id: "proxy-console-toggle",
|
|
853
839
|
checked: r,
|
|
854
|
-
onCheckedChange:
|
|
855
|
-
}), /* @__PURE__ */ (0,
|
|
840
|
+
onCheckedChange: s
|
|
841
|
+
}), /* @__PURE__ */ (0, K.jsx)(w, {
|
|
856
842
|
htmlFor: "proxy-console-toggle",
|
|
857
843
|
className: "text-sm font-normal cursor-pointer",
|
|
858
844
|
children: "Proxy logs to page console"
|
|
859
845
|
})]
|
|
860
|
-
}),
|
|
846
|
+
}), C.length > 0 && /* @__PURE__ */ (0, K.jsxs)(K.Fragment, { children: [/* @__PURE__ */ (0, K.jsxs)(d, {
|
|
861
847
|
variant: "ghost",
|
|
862
848
|
size: "sm",
|
|
863
849
|
onClick: async () => {
|
|
864
850
|
try {
|
|
865
|
-
await
|
|
851
|
+
await R(P.map((e) => {
|
|
866
852
|
let t = new Date(e.timestamp).toLocaleTimeString();
|
|
867
|
-
return `[${e.level.toUpperCase()}] ${t}${e.url ? ` ${e.url}` : ""}\n${
|
|
868
|
-
}).join("\n\n")),
|
|
853
|
+
return `[${e.level.toUpperCase()}] ${t}${e.url ? ` ${e.url}` : ""}\n${J(e.args).join("\n")}`;
|
|
854
|
+
}).join("\n\n")), z.success(`Copied ${P.length} logs to clipboard`);
|
|
869
855
|
} catch {
|
|
870
|
-
|
|
856
|
+
z.error("Failed to copy logs to clipboard");
|
|
871
857
|
}
|
|
872
858
|
},
|
|
873
859
|
className: "-my-2",
|
|
874
|
-
children: [/* @__PURE__ */ (0,
|
|
875
|
-
}), /* @__PURE__ */ (0,
|
|
860
|
+
children: [/* @__PURE__ */ (0, K.jsx)(L, { className: "size-4 mr-1" }), "Copy All"]
|
|
861
|
+
}), /* @__PURE__ */ (0, K.jsxs)(d, {
|
|
876
862
|
variant: "ghost",
|
|
877
863
|
size: "sm",
|
|
878
864
|
onClick: T,
|
|
879
865
|
className: "-my-2",
|
|
880
|
-
children: [/* @__PURE__ */ (0,
|
|
866
|
+
children: [/* @__PURE__ */ (0, K.jsx)(Me, { className: "size-4 mr-1" }), "Clear"]
|
|
881
867
|
})] })]
|
|
882
868
|
})]
|
|
883
|
-
}), /* @__PURE__ */ (0,
|
|
869
|
+
}), /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
884
870
|
className: "flex items-center gap-1 pt-1",
|
|
885
871
|
children: [
|
|
886
|
-
/* @__PURE__ */ (0,
|
|
887
|
-
onClick: () =>
|
|
888
|
-
className:
|
|
889
|
-
children: ["All",
|
|
872
|
+
/* @__PURE__ */ (0, K.jsxs)("button", {
|
|
873
|
+
onClick: () => _("all"),
|
|
874
|
+
className: u("px-2 py-0.5 text-xs rounded font-medium transition-colors", h === "all" ? "bg-zinc-200 dark:bg-zinc-700 text-zinc-900 dark:text-zinc-100" : "text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800"),
|
|
875
|
+
children: ["All", M > 0 && /* @__PURE__ */ (0, K.jsx)("span", {
|
|
890
876
|
className: "ml-1 text-[10px] opacity-70",
|
|
891
|
-
children:
|
|
877
|
+
children: M
|
|
892
878
|
})]
|
|
893
879
|
}),
|
|
894
|
-
|
|
880
|
+
He.map((e) => {
|
|
895
881
|
let t = k[e];
|
|
896
|
-
return /* @__PURE__ */ (0,
|
|
897
|
-
onClick: () =>
|
|
898
|
-
className:
|
|
899
|
-
children: [/* @__PURE__ */ (0,
|
|
900
|
-
className:
|
|
882
|
+
return /* @__PURE__ */ (0, K.jsxs)("button", {
|
|
883
|
+
onClick: () => _(h === e ? "all" : e),
|
|
884
|
+
className: u("px-2 py-0.5 text-xs rounded font-medium transition-colors", h === e ? "bg-zinc-200 dark:bg-zinc-700 text-zinc-900 dark:text-zinc-100" : "text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800"),
|
|
885
|
+
children: [/* @__PURE__ */ (0, K.jsx)("span", {
|
|
886
|
+
className: u(t > 0 && Ue[e]),
|
|
901
887
|
children: e.charAt(0).toUpperCase() + e.slice(1)
|
|
902
|
-
}), t > 0 && /* @__PURE__ */ (0,
|
|
903
|
-
className:
|
|
888
|
+
}), t > 0 && /* @__PURE__ */ (0, K.jsx)("span", {
|
|
889
|
+
className: u("ml-1 text-[10px]", Ue[e]),
|
|
904
890
|
children: t
|
|
905
891
|
})]
|
|
906
892
|
}, e);
|
|
907
893
|
}),
|
|
908
|
-
/* @__PURE__ */ (0,
|
|
894
|
+
/* @__PURE__ */ (0, K.jsxs)("div", {
|
|
909
895
|
className: "ml-auto flex items-center gap-1 relative",
|
|
910
896
|
children: [
|
|
911
|
-
/* @__PURE__ */ (0,
|
|
912
|
-
/* @__PURE__ */ (0,
|
|
897
|
+
/* @__PURE__ */ (0, K.jsx)(n, { className: "absolute left-2 size-3 text-zinc-400 dark:text-zinc-500 pointer-events-none" }),
|
|
898
|
+
/* @__PURE__ */ (0, K.jsx)("input", {
|
|
913
899
|
type: "text",
|
|
914
900
|
placeholder: "Filter logs…",
|
|
915
|
-
value:
|
|
901
|
+
value: b,
|
|
916
902
|
onChange: (e) => S(e.target.value),
|
|
917
903
|
className: "pl-6 pr-6 py-0.5 text-xs rounded border border-zinc-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400 dark:placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-400 dark:focus:ring-zinc-500 w-44"
|
|
918
904
|
}),
|
|
919
|
-
|
|
905
|
+
b && /* @__PURE__ */ (0, K.jsx)("button", {
|
|
920
906
|
onClick: () => S(""),
|
|
921
907
|
"aria-label": "Clear search",
|
|
922
908
|
className: "absolute right-1.5 text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300",
|
|
923
|
-
children: /* @__PURE__ */ (0,
|
|
909
|
+
children: /* @__PURE__ */ (0, K.jsx)(me, { className: "size-3" })
|
|
924
910
|
})
|
|
925
911
|
]
|
|
926
912
|
})
|
|
927
913
|
]
|
|
928
914
|
})]
|
|
929
915
|
}),
|
|
930
|
-
/* @__PURE__ */ (0,
|
|
916
|
+
/* @__PURE__ */ (0, K.jsx)("div", {
|
|
931
917
|
ref: O,
|
|
932
918
|
className: "flex-1 overflow-auto bg-zinc-50 dark:bg-zinc-950",
|
|
933
|
-
children:
|
|
919
|
+
children: P.length === 0 ? /* @__PURE__ */ (0, K.jsx)("div", {
|
|
934
920
|
className: "flex items-center justify-center h-full text-zinc-500 dark:text-zinc-400",
|
|
935
|
-
children: /* @__PURE__ */ (0,
|
|
921
|
+
children: /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
936
922
|
className: "text-center",
|
|
937
923
|
children: [
|
|
938
|
-
/* @__PURE__ */ (0,
|
|
939
|
-
/* @__PURE__ */ (0,
|
|
924
|
+
/* @__PURE__ */ (0, K.jsx)(H, { className: "size-8 mx-auto mb-2 opacity-50" }),
|
|
925
|
+
/* @__PURE__ */ (0, K.jsx)("p", {
|
|
940
926
|
className: "text-sm",
|
|
941
|
-
children:
|
|
927
|
+
children: C.length === 0 ? "No console logs yet" : b ? `No logs match "${b}"` : "No logs match the current filter"
|
|
942
928
|
}),
|
|
943
|
-
/* @__PURE__ */ (0,
|
|
929
|
+
/* @__PURE__ */ (0, K.jsx)("p", {
|
|
944
930
|
className: "text-xs mt-1",
|
|
945
|
-
children:
|
|
931
|
+
children: C.length === 0 ? "Logs from iframes will appear here" : `${C.length} log${C.length === 1 ? "" : "s"} hidden by filter`
|
|
946
932
|
})
|
|
947
933
|
]
|
|
948
934
|
})
|
|
949
|
-
}) : /* @__PURE__ */ (0,
|
|
935
|
+
}) : /* @__PURE__ */ (0, K.jsx)("div", { children: P.map((e) => /* @__PURE__ */ (0, K.jsx)(Be, { log: e }, e.id)) })
|
|
950
936
|
})
|
|
951
937
|
]
|
|
952
938
|
})]
|
|
@@ -954,7 +940,7 @@ function Ke({ iframeId: e, enabled: t = !0 }) {
|
|
|
954
940
|
}
|
|
955
941
|
//#endregion
|
|
956
942
|
//#region src/client/hooks/usePropsLLM.ts
|
|
957
|
-
function
|
|
943
|
+
function Ge(e) {
|
|
958
944
|
let t = e.trim(), n = t.match(/```(?:json)?\s*([\s\S]*?)```/);
|
|
959
945
|
n && (t = n[1].trim());
|
|
960
946
|
let r = t.indexOf("{");
|
|
@@ -968,9 +954,9 @@ function qe(e) {
|
|
|
968
954
|
}
|
|
969
955
|
return null;
|
|
970
956
|
}
|
|
971
|
-
function
|
|
957
|
+
function Ke({ llmConfig: e }) {
|
|
972
958
|
return {
|
|
973
|
-
generateProps: (0,
|
|
959
|
+
generateProps: (0, U.useCallback)(async ({ resource: t, resourceAnnotations: n, propsSchema: r }) => {
|
|
974
960
|
if (!e) throw Error("LLM config is not available");
|
|
975
961
|
let i = t.mimeType || n?.mimeType || "unknown", a = t.description || n?.description || "N/A";
|
|
976
962
|
if (r?.properties) {
|
|
@@ -990,7 +976,7 @@ ${n}
|
|
|
990
976
|
|
|
991
977
|
Generate appropriate default/example values for these props. Return ONLY a JSON object with the exact prop names as keys.
|
|
992
978
|
Example: {"query": "example search term", "results": [{"fruit": "Apple", "color": "red"}]}`
|
|
993
|
-
}], o =
|
|
979
|
+
}], o = Ge(await B({
|
|
994
980
|
config: {
|
|
995
981
|
provider: e.provider,
|
|
996
982
|
model: e.model,
|
|
@@ -1024,7 +1010,7 @@ Based on this information, suggest 3-5 common customizable properties like theme
|
|
|
1024
1010
|
}, {
|
|
1025
1011
|
role: "user",
|
|
1026
1012
|
content: c
|
|
1027
|
-
}], u = await
|
|
1013
|
+
}], u = await B({
|
|
1028
1014
|
config: {
|
|
1029
1015
|
provider: e.provider,
|
|
1030
1016
|
model: e.model,
|
|
@@ -1035,7 +1021,7 @@ Based on this information, suggest 3-5 common customizable properties like theme
|
|
|
1035
1021
|
messages: l
|
|
1036
1022
|
});
|
|
1037
1023
|
try {
|
|
1038
|
-
let e =
|
|
1024
|
+
let e = Ge(u);
|
|
1039
1025
|
if (e) return Object.entries(e).map(([e, t]) => ({
|
|
1040
1026
|
key: e,
|
|
1041
1027
|
value: typeof t == "object" && t ? JSON.stringify(t) : String(t)
|
|
@@ -1059,7 +1045,7 @@ Based on this information, suggest 3-5 common customizable properties like theme
|
|
|
1059
1045
|
}
|
|
1060
1046
|
//#endregion
|
|
1061
1047
|
//#region src/client/components/shared/SchemaFormField.tsx
|
|
1062
|
-
function
|
|
1048
|
+
function qe(e, t) {
|
|
1063
1049
|
if (!e?.$ref) return e;
|
|
1064
1050
|
let n = e.$ref;
|
|
1065
1051
|
if (n.startsWith("#/")) {
|
|
@@ -1070,35 +1056,35 @@ function Y(e, t) {
|
|
|
1070
1056
|
}
|
|
1071
1057
|
return e;
|
|
1072
1058
|
}
|
|
1073
|
-
function
|
|
1059
|
+
function Je(e, t) {
|
|
1074
1060
|
if (e.anyOf && Array.isArray(e.anyOf)) {
|
|
1075
1061
|
let n = e.anyOf.find((e) => e.type !== "null");
|
|
1076
1062
|
if (n) return {
|
|
1077
|
-
...
|
|
1063
|
+
...qe(n, t),
|
|
1078
1064
|
nullable: !0
|
|
1079
1065
|
};
|
|
1080
1066
|
}
|
|
1081
1067
|
return e;
|
|
1082
1068
|
}
|
|
1083
|
-
function
|
|
1069
|
+
function Ye(e) {
|
|
1084
1070
|
return Array.isArray(e.enum) ? e.enum : null;
|
|
1085
1071
|
}
|
|
1086
1072
|
function X({ name: e, schema: t, value: n, onChange: r, required: i = !1, disabled: a = !1, rootSchema: o }) {
|
|
1087
|
-
let
|
|
1088
|
-
|
|
1089
|
-
let u =
|
|
1090
|
-
return f.type === "object" || f.type === "array" ? /* @__PURE__ */ (0,
|
|
1073
|
+
let c = o || t, l = Je(t, c);
|
|
1074
|
+
l = qe(l, c);
|
|
1075
|
+
let u = Ye(l), d = l.type === "string" && u !== null, f = l;
|
|
1076
|
+
return f.type === "object" || f.type === "array" ? /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1091
1077
|
className: "space-y-2",
|
|
1092
1078
|
children: [
|
|
1093
|
-
/* @__PURE__ */ (0,
|
|
1079
|
+
/* @__PURE__ */ (0, K.jsxs)(w, {
|
|
1094
1080
|
htmlFor: e,
|
|
1095
1081
|
className: "text-sm font-medium",
|
|
1096
|
-
children: [e, i && /* @__PURE__ */ (0,
|
|
1082
|
+
children: [e, i && /* @__PURE__ */ (0, K.jsx)("span", {
|
|
1097
1083
|
className: "text-red-500 ml-1",
|
|
1098
1084
|
children: "*"
|
|
1099
1085
|
})]
|
|
1100
1086
|
}),
|
|
1101
|
-
/* @__PURE__ */ (0,
|
|
1087
|
+
/* @__PURE__ */ (0, K.jsx)(V, {
|
|
1102
1088
|
id: e,
|
|
1103
1089
|
value: n,
|
|
1104
1090
|
onChange: (e) => r(e.target.value),
|
|
@@ -1106,52 +1092,52 @@ function X({ name: e, schema: t, value: n, onChange: r, required: i = !1, disabl
|
|
|
1106
1092
|
className: "min-h-[100px]",
|
|
1107
1093
|
disabled: a
|
|
1108
1094
|
}),
|
|
1109
|
-
f?.description && /* @__PURE__ */ (0,
|
|
1095
|
+
f?.description && /* @__PURE__ */ (0, K.jsx)("p", {
|
|
1110
1096
|
className: "text-xs text-gray-500 dark:text-gray-400",
|
|
1111
1097
|
children: f.description
|
|
1112
1098
|
})
|
|
1113
1099
|
]
|
|
1114
|
-
}) : d && u ? /* @__PURE__ */ (0,
|
|
1100
|
+
}) : d && u ? /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1115
1101
|
className: "space-y-2",
|
|
1116
1102
|
children: [
|
|
1117
|
-
/* @__PURE__ */ (0,
|
|
1103
|
+
/* @__PURE__ */ (0, K.jsxs)(w, {
|
|
1118
1104
|
htmlFor: e,
|
|
1119
1105
|
className: "text-sm font-medium",
|
|
1120
|
-
children: [e, i && /* @__PURE__ */ (0,
|
|
1106
|
+
children: [e, i && /* @__PURE__ */ (0, K.jsx)("span", {
|
|
1121
1107
|
className: "text-red-500 ml-1",
|
|
1122
1108
|
children: "*"
|
|
1123
1109
|
})]
|
|
1124
1110
|
}),
|
|
1125
|
-
/* @__PURE__ */ (0,
|
|
1111
|
+
/* @__PURE__ */ (0, K.jsxs)(k, {
|
|
1126
1112
|
value: n || "",
|
|
1127
1113
|
onValueChange: r,
|
|
1128
1114
|
disabled: a,
|
|
1129
|
-
children: [/* @__PURE__ */ (0,
|
|
1115
|
+
children: [/* @__PURE__ */ (0, K.jsx)(E, {
|
|
1130
1116
|
id: e,
|
|
1131
1117
|
className: "w-full",
|
|
1132
|
-
children: /* @__PURE__ */ (0,
|
|
1133
|
-
}), /* @__PURE__ */ (0,
|
|
1118
|
+
children: /* @__PURE__ */ (0, K.jsx)(T, { placeholder: f.description || "Select an option" })
|
|
1119
|
+
}), /* @__PURE__ */ (0, K.jsx)(D, { children: u.map((e, t) => /* @__PURE__ */ (0, K.jsx)(O, {
|
|
1134
1120
|
value: e,
|
|
1135
1121
|
children: f.enumNames?.[t] || e
|
|
1136
1122
|
}, e)) })]
|
|
1137
1123
|
}),
|
|
1138
|
-
f.description && /* @__PURE__ */ (0,
|
|
1124
|
+
f.description && /* @__PURE__ */ (0, K.jsx)("p", {
|
|
1139
1125
|
className: "text-xs text-gray-500 dark:text-gray-400",
|
|
1140
1126
|
children: f.description
|
|
1141
1127
|
})
|
|
1142
1128
|
]
|
|
1143
|
-
}) : /* @__PURE__ */ (0,
|
|
1129
|
+
}) : /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1144
1130
|
className: "space-y-2",
|
|
1145
1131
|
children: [
|
|
1146
|
-
/* @__PURE__ */ (0,
|
|
1132
|
+
/* @__PURE__ */ (0, K.jsxs)(w, {
|
|
1147
1133
|
htmlFor: e,
|
|
1148
1134
|
className: "text-sm font-medium",
|
|
1149
|
-
children: [e, i && /* @__PURE__ */ (0,
|
|
1135
|
+
children: [e, i && /* @__PURE__ */ (0, K.jsx)("span", {
|
|
1150
1136
|
className: "text-red-500 ml-1",
|
|
1151
1137
|
children: "*"
|
|
1152
1138
|
})]
|
|
1153
1139
|
}),
|
|
1154
|
-
/* @__PURE__ */ (0,
|
|
1140
|
+
/* @__PURE__ */ (0, K.jsx)(s, {
|
|
1155
1141
|
id: e,
|
|
1156
1142
|
value: n,
|
|
1157
1143
|
onChange: (e) => r(e.target.value),
|
|
@@ -1159,7 +1145,7 @@ function X({ name: e, schema: t, value: n, onChange: r, required: i = !1, disabl
|
|
|
1159
1145
|
type: f.type === "number" ? "number" : "text",
|
|
1160
1146
|
disabled: a
|
|
1161
1147
|
}),
|
|
1162
|
-
f?.description && /* @__PURE__ */ (0,
|
|
1148
|
+
f?.description && /* @__PURE__ */ (0, K.jsx)("p", {
|
|
1163
1149
|
className: "text-xs text-gray-500 dark:text-gray-400",
|
|
1164
1150
|
children: f.description
|
|
1165
1151
|
})
|
|
@@ -1168,8 +1154,8 @@ function X({ name: e, schema: t, value: n, onChange: r, required: i = !1, disabl
|
|
|
1168
1154
|
}
|
|
1169
1155
|
//#endregion
|
|
1170
1156
|
//#region src/client/components/resources/PropsConfigDialog.tsx
|
|
1171
|
-
function
|
|
1172
|
-
let
|
|
1157
|
+
function Xe({ open: e, onOpenChange: t, onSave: n, existingPresets: r, resource: i, resourceAnnotations: a, llmConfig: o, editingPreset: c }) {
|
|
1158
|
+
let l = (0, U.useMemo)(() => {
|
|
1173
1159
|
let e = (e) => {
|
|
1174
1160
|
if (!e) return null;
|
|
1175
1161
|
if (e.type === "object" && e.properties) return e;
|
|
@@ -1233,16 +1219,16 @@ function Ze({ open: e, onOpenChange: t, onSave: n, existingPresets: r, resource:
|
|
|
1233
1219
|
i.annotations,
|
|
1234
1220
|
i.uri,
|
|
1235
1221
|
i.name
|
|
1236
|
-
]),
|
|
1222
|
+
]), u = !!l, [f, p] = (0, U.useState)(""), [m, h] = (0, U.useState)({}), [g, _] = (0, U.useState)([{
|
|
1237
1223
|
id: crypto.randomUUID(),
|
|
1238
1224
|
key: "",
|
|
1239
1225
|
value: ""
|
|
1240
|
-
}]), [v, y] = (0,
|
|
1241
|
-
(0,
|
|
1226
|
+
}]), [v, y] = (0, U.useState)(!1), [b, x] = (0, U.useState)(null), { generateProps: S, isAvailable: C } = Ke({ llmConfig: o });
|
|
1227
|
+
(0, U.useEffect)(() => {
|
|
1242
1228
|
if (e) {
|
|
1243
|
-
if (
|
|
1229
|
+
if (c) if (p(c.name), u) h(c.props);
|
|
1244
1230
|
else {
|
|
1245
|
-
let e = Object.entries(
|
|
1231
|
+
let e = Object.entries(c.props).map(([e, t]) => ({
|
|
1246
1232
|
id: crypto.randomUUID(),
|
|
1247
1233
|
key: e,
|
|
1248
1234
|
value: t
|
|
@@ -1253,7 +1239,7 @@ function Ze({ open: e, onOpenChange: t, onSave: n, existingPresets: r, resource:
|
|
|
1253
1239
|
value: ""
|
|
1254
1240
|
}]);
|
|
1255
1241
|
}
|
|
1256
|
-
else p(""),
|
|
1242
|
+
else p(""), u ? h({}) : _([{
|
|
1257
1243
|
id: crypto.randomUUID(),
|
|
1258
1244
|
key: "",
|
|
1259
1245
|
value: ""
|
|
@@ -1262,8 +1248,8 @@ function Ze({ open: e, onOpenChange: t, onSave: n, existingPresets: r, resource:
|
|
|
1262
1248
|
}
|
|
1263
1249
|
}, [
|
|
1264
1250
|
e,
|
|
1265
|
-
|
|
1266
|
-
|
|
1251
|
+
c,
|
|
1252
|
+
u
|
|
1267
1253
|
]);
|
|
1268
1254
|
let T = () => {
|
|
1269
1255
|
_([...g, {
|
|
@@ -1279,28 +1265,28 @@ function Ze({ open: e, onOpenChange: t, onSave: n, existingPresets: r, resource:
|
|
|
1279
1265
|
[t]: n
|
|
1280
1266
|
} : r));
|
|
1281
1267
|
};
|
|
1282
|
-
return /* @__PURE__ */ (0,
|
|
1268
|
+
return /* @__PURE__ */ (0, K.jsx)(se, {
|
|
1283
1269
|
open: e,
|
|
1284
1270
|
onOpenChange: t,
|
|
1285
|
-
children: /* @__PURE__ */ (0,
|
|
1271
|
+
children: /* @__PURE__ */ (0, K.jsxs)(ae, {
|
|
1286
1272
|
scrollable: !0,
|
|
1287
1273
|
className: "sm:max-w-[600px] max-h-[80vh]",
|
|
1288
1274
|
"data-testid": "props-config-dialog",
|
|
1289
1275
|
children: [
|
|
1290
|
-
/* @__PURE__ */ (0,
|
|
1276
|
+
/* @__PURE__ */ (0, K.jsxs)(ie, { children: [/* @__PURE__ */ (0, K.jsx)(te, { children: c ? "Edit Preset" : "Create Props Preset" }), /* @__PURE__ */ (0, K.jsxs)(F, { children: [
|
|
1291
1277
|
"Configure props for ",
|
|
1292
1278
|
i.name || i.uri,
|
|
1293
1279
|
". You can manually add key-value pairs or generate them with AI."
|
|
1294
1280
|
] })] }),
|
|
1295
|
-
/* @__PURE__ */ (0,
|
|
1281
|
+
/* @__PURE__ */ (0, K.jsxs)(re, {
|
|
1296
1282
|
className: "space-y-4 py-4",
|
|
1297
1283
|
children: [
|
|
1298
|
-
/* @__PURE__ */ (0,
|
|
1284
|
+
/* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1299
1285
|
className: "space-y-2",
|
|
1300
|
-
children: [/* @__PURE__ */ (0,
|
|
1286
|
+
children: [/* @__PURE__ */ (0, K.jsx)(w, {
|
|
1301
1287
|
htmlFor: "preset-name",
|
|
1302
1288
|
children: "Preset Name"
|
|
1303
|
-
}), /* @__PURE__ */ (0,
|
|
1289
|
+
}), /* @__PURE__ */ (0, K.jsx)(s, {
|
|
1304
1290
|
id: "preset-name",
|
|
1305
1291
|
"data-testid": "props-config-preset-name",
|
|
1306
1292
|
value: f,
|
|
@@ -1309,15 +1295,15 @@ function Ze({ open: e, onOpenChange: t, onSave: n, existingPresets: r, resource:
|
|
|
1309
1295
|
disabled: v
|
|
1310
1296
|
})]
|
|
1311
1297
|
}),
|
|
1312
|
-
/* @__PURE__ */ (0,
|
|
1298
|
+
/* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1313
1299
|
className: "space-y-2 p-3 bg-muted rounded-lg",
|
|
1314
1300
|
children: [
|
|
1315
|
-
/* @__PURE__ */ (0,
|
|
1301
|
+
/* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1316
1302
|
className: "flex items-center justify-between",
|
|
1317
|
-
children: [/* @__PURE__ */ (0,
|
|
1303
|
+
children: [/* @__PURE__ */ (0, K.jsx)(w, {
|
|
1318
1304
|
className: "text-sm font-medium",
|
|
1319
1305
|
children: "Generate with AI"
|
|
1320
|
-
}),
|
|
1306
|
+
}), C && /* @__PURE__ */ (0, K.jsxs)("span", {
|
|
1321
1307
|
className: "text-xs text-muted-foreground",
|
|
1322
1308
|
children: [
|
|
1323
1309
|
"Using ",
|
|
@@ -1328,10 +1314,10 @@ function Ze({ open: e, onOpenChange: t, onSave: n, existingPresets: r, resource:
|
|
|
1328
1314
|
]
|
|
1329
1315
|
})]
|
|
1330
1316
|
}),
|
|
1331
|
-
|
|
1317
|
+
C ? /* @__PURE__ */ (0, K.jsx)(d, {
|
|
1332
1318
|
onClick: async () => {
|
|
1333
|
-
if (!
|
|
1334
|
-
|
|
1319
|
+
if (!C) {
|
|
1320
|
+
z.error("LLM not configured", { description: "Please configure LLM in the Chat tab first." });
|
|
1335
1321
|
return;
|
|
1336
1322
|
}
|
|
1337
1323
|
y(!0), x(null);
|
|
@@ -1339,21 +1325,21 @@ function Ze({ open: e, onOpenChange: t, onSave: n, existingPresets: r, resource:
|
|
|
1339
1325
|
let e = await S({
|
|
1340
1326
|
resource: i,
|
|
1341
1327
|
resourceAnnotations: a,
|
|
1342
|
-
propsSchema:
|
|
1328
|
+
propsSchema: u ? l : void 0
|
|
1343
1329
|
});
|
|
1344
|
-
if (
|
|
1330
|
+
if (u) {
|
|
1345
1331
|
let t = {};
|
|
1346
|
-
for (let n of e)
|
|
1332
|
+
for (let n of e) l.properties?.[n.key] && (t[n.key] = n.value);
|
|
1347
1333
|
h(t);
|
|
1348
1334
|
} else _(e.map((e) => ({
|
|
1349
1335
|
id: crypto.randomUUID(),
|
|
1350
1336
|
key: e.key,
|
|
1351
1337
|
value: e.value
|
|
1352
1338
|
})));
|
|
1353
|
-
|
|
1339
|
+
z.success("Props generated successfully", { description: `Generated ${e.length} prop(s) using ${o?.provider}` });
|
|
1354
1340
|
} catch (e) {
|
|
1355
1341
|
let t = e instanceof Error ? e.message : "Failed to generate props";
|
|
1356
|
-
x(t),
|
|
1342
|
+
x(t), z.error("LLM Generation Failed", { description: t });
|
|
1357
1343
|
} finally {
|
|
1358
1344
|
y(!1);
|
|
1359
1345
|
}
|
|
@@ -1363,30 +1349,30 @@ function Ze({ open: e, onOpenChange: t, onSave: n, existingPresets: r, resource:
|
|
|
1363
1349
|
variant: "outline",
|
|
1364
1350
|
className: "w-full",
|
|
1365
1351
|
"data-testid": "props-config-generate-llm-button",
|
|
1366
|
-
children: v ? /* @__PURE__ */ (0,
|
|
1352
|
+
children: v ? /* @__PURE__ */ (0, K.jsxs)("span", {
|
|
1367
1353
|
"data-testid": "props-config-generating",
|
|
1368
1354
|
className: "flex items-center gap-2",
|
|
1369
|
-
children: [/* @__PURE__ */ (0,
|
|
1370
|
-
}) : /* @__PURE__ */ (0,
|
|
1371
|
-
}) : /* @__PURE__ */ (0,
|
|
1355
|
+
children: [/* @__PURE__ */ (0, K.jsx)(ue, { className: "h-4 w-4 mr-2 animate-spin" }), "Generating..."]
|
|
1356
|
+
}) : /* @__PURE__ */ (0, K.jsxs)(K.Fragment, { children: [/* @__PURE__ */ (0, K.jsx)(fe, { className: "h-4 w-4 mr-2" }), "Generate Props with LLM"] })
|
|
1357
|
+
}) : /* @__PURE__ */ (0, K.jsx)("p", {
|
|
1372
1358
|
className: "text-xs text-muted-foreground",
|
|
1373
1359
|
children: "LLM not configured. Please configure LLM in the Chat tab to use this feature."
|
|
1374
1360
|
}),
|
|
1375
|
-
b && /* @__PURE__ */ (0,
|
|
1361
|
+
b && /* @__PURE__ */ (0, K.jsx)("p", {
|
|
1376
1362
|
className: "text-xs text-destructive",
|
|
1377
1363
|
"data-testid": "props-config-error",
|
|
1378
1364
|
children: b
|
|
1379
1365
|
})
|
|
1380
1366
|
]
|
|
1381
1367
|
}),
|
|
1382
|
-
/* @__PURE__ */ (0,
|
|
1368
|
+
/* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1383
1369
|
className: "space-y-3",
|
|
1384
|
-
children: [/* @__PURE__ */ (0,
|
|
1370
|
+
children: [/* @__PURE__ */ (0, K.jsx)(w, {
|
|
1385
1371
|
className: "text-sm font-medium",
|
|
1386
1372
|
children: "Props"
|
|
1387
|
-
}),
|
|
1373
|
+
}), u ? /* @__PURE__ */ (0, K.jsx)("div", {
|
|
1388
1374
|
className: "space-y-4",
|
|
1389
|
-
children: Object.entries(
|
|
1375
|
+
children: Object.entries(l.properties || {}).map(([e, t]) => /* @__PURE__ */ (0, K.jsx)(X, {
|
|
1390
1376
|
name: e,
|
|
1391
1377
|
schema: t,
|
|
1392
1378
|
value: m[e] || "",
|
|
@@ -1394,86 +1380,86 @@ function Ze({ open: e, onOpenChange: t, onSave: n, existingPresets: r, resource:
|
|
|
1394
1380
|
...n,
|
|
1395
1381
|
[e]: t
|
|
1396
1382
|
})),
|
|
1397
|
-
required:
|
|
1383
|
+
required: l.required?.includes(e),
|
|
1398
1384
|
disabled: v,
|
|
1399
|
-
rootSchema:
|
|
1385
|
+
rootSchema: l
|
|
1400
1386
|
}, e))
|
|
1401
|
-
}) : /* @__PURE__ */ (0,
|
|
1387
|
+
}) : /* @__PURE__ */ (0, K.jsxs)(K.Fragment, { children: [/* @__PURE__ */ (0, K.jsx)("div", {
|
|
1402
1388
|
className: "flex items-center justify-between",
|
|
1403
|
-
children: /* @__PURE__ */ (0,
|
|
1389
|
+
children: /* @__PURE__ */ (0, K.jsxs)(d, {
|
|
1404
1390
|
onClick: T,
|
|
1405
1391
|
size: "sm",
|
|
1406
1392
|
variant: "ghost",
|
|
1407
1393
|
disabled: v,
|
|
1408
1394
|
"data-testid": "props-config-add-prop",
|
|
1409
|
-
children: [/* @__PURE__ */ (0,
|
|
1395
|
+
children: [/* @__PURE__ */ (0, K.jsx)(I, { className: "h-4 w-4 mr-1" }), "Add Prop"]
|
|
1410
1396
|
})
|
|
1411
|
-
}), g.map((e, t) => /* @__PURE__ */ (0,
|
|
1397
|
+
}), g.map((e, t) => /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1412
1398
|
className: "flex items-center gap-2",
|
|
1413
|
-
children: [/* @__PURE__ */ (0,
|
|
1399
|
+
children: [/* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1414
1400
|
className: "flex-1 grid grid-cols-2 gap-2",
|
|
1415
|
-
children: [/* @__PURE__ */ (0,
|
|
1401
|
+
children: [/* @__PURE__ */ (0, K.jsx)(s, {
|
|
1416
1402
|
placeholder: "Key",
|
|
1417
1403
|
value: e.key,
|
|
1418
1404
|
onChange: (t) => D(e.id, "key", t.target.value),
|
|
1419
1405
|
disabled: v,
|
|
1420
1406
|
"data-testid": `props-config-key-${t}`
|
|
1421
|
-
}), /* @__PURE__ */ (0,
|
|
1407
|
+
}), /* @__PURE__ */ (0, K.jsx)(s, {
|
|
1422
1408
|
placeholder: "Value",
|
|
1423
1409
|
value: e.value,
|
|
1424
1410
|
onChange: (t) => D(e.id, "value", t.target.value),
|
|
1425
1411
|
disabled: v,
|
|
1426
1412
|
"data-testid": `props-config-value-${t}`
|
|
1427
1413
|
})]
|
|
1428
|
-
}), /* @__PURE__ */ (0,
|
|
1414
|
+
}), /* @__PURE__ */ (0, K.jsx)(d, {
|
|
1429
1415
|
variant: "ghost",
|
|
1430
1416
|
size: "sm",
|
|
1431
1417
|
onClick: () => E(e.id),
|
|
1432
1418
|
disabled: g.length === 1 || v,
|
|
1433
1419
|
className: "h-9 w-9 p-0",
|
|
1434
1420
|
"data-testid": `props-config-remove-${t}`,
|
|
1435
|
-
children: /* @__PURE__ */ (0,
|
|
1421
|
+
children: /* @__PURE__ */ (0, K.jsx)(pe, { className: "h-4 w-4 text-muted-foreground" })
|
|
1436
1422
|
})]
|
|
1437
1423
|
}, e.id))] })]
|
|
1438
1424
|
})
|
|
1439
1425
|
]
|
|
1440
1426
|
}),
|
|
1441
|
-
/* @__PURE__ */ (0,
|
|
1427
|
+
/* @__PURE__ */ (0, K.jsxs)(N, { children: [/* @__PURE__ */ (0, K.jsx)(d, {
|
|
1442
1428
|
variant: "outline",
|
|
1443
1429
|
onClick: () => t(!1),
|
|
1444
1430
|
disabled: v,
|
|
1445
1431
|
"data-testid": "props-config-cancel-button",
|
|
1446
1432
|
children: "Cancel"
|
|
1447
|
-
}), /* @__PURE__ */ (0,
|
|
1433
|
+
}), /* @__PURE__ */ (0, K.jsxs)(d, {
|
|
1448
1434
|
onClick: () => {
|
|
1449
1435
|
if (!f.trim()) {
|
|
1450
|
-
|
|
1436
|
+
z.error("Preset name required", { description: "Please enter a name for this preset." });
|
|
1451
1437
|
return;
|
|
1452
1438
|
}
|
|
1453
|
-
if (r.find((e) => e.name.toLowerCase() === f.toLowerCase() && e.id !==
|
|
1454
|
-
|
|
1439
|
+
if (r.find((e) => e.name.toLowerCase() === f.toLowerCase() && e.id !== c?.id)) {
|
|
1440
|
+
z.error("Duplicate preset name", { description: "A preset with this name already exists." });
|
|
1455
1441
|
return;
|
|
1456
1442
|
}
|
|
1457
1443
|
let e;
|
|
1458
|
-
if (
|
|
1444
|
+
if (u) e = { ...m };
|
|
1459
1445
|
else {
|
|
1460
1446
|
e = {};
|
|
1461
1447
|
for (let t of g) t.key.trim() && (e[t.key.trim()] = t.value);
|
|
1462
1448
|
}
|
|
1463
1449
|
if (Object.keys(e).length === 0) {
|
|
1464
|
-
|
|
1450
|
+
z.error("No props defined", { description: "Please add at least one prop with a key." });
|
|
1465
1451
|
return;
|
|
1466
1452
|
}
|
|
1467
1453
|
let i = {
|
|
1468
|
-
id:
|
|
1454
|
+
id: c?.id || crypto.randomUUID(),
|
|
1469
1455
|
name: f.trim(),
|
|
1470
1456
|
props: e
|
|
1471
1457
|
};
|
|
1472
|
-
n(i), t(!1),
|
|
1458
|
+
n(i), t(!1), z.success(c ? "Preset updated" : "Preset created", { description: `Preset "${i.name}" saved successfully.` });
|
|
1473
1459
|
},
|
|
1474
1460
|
disabled: v,
|
|
1475
1461
|
"data-testid": "props-config-save-button",
|
|
1476
|
-
children: [
|
|
1462
|
+
children: [c ? "Update" : "Create", " Preset"]
|
|
1477
1463
|
})] })
|
|
1478
1464
|
]
|
|
1479
1465
|
})
|
|
@@ -1481,7 +1467,7 @@ function Ze({ open: e, onOpenChange: t, onSave: n, existingPresets: r, resource:
|
|
|
1481
1467
|
}
|
|
1482
1468
|
//#endregion
|
|
1483
1469
|
//#region src/client/components/ui-playground/shared/SafeAreaInsetsEditor.tsx
|
|
1484
|
-
function
|
|
1470
|
+
function Ze({ value: e, onChange: t }) {
|
|
1485
1471
|
let n = (n, r) => {
|
|
1486
1472
|
let i = parseInt(r, 10);
|
|
1487
1473
|
isNaN(i) || t({
|
|
@@ -1489,15 +1475,15 @@ function Qe({ value: e, onChange: t }) {
|
|
|
1489
1475
|
[n]: i
|
|
1490
1476
|
});
|
|
1491
1477
|
};
|
|
1492
|
-
return /* @__PURE__ */ (0,
|
|
1478
|
+
return /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1493
1479
|
className: "grid grid-cols-2 gap-2",
|
|
1494
1480
|
children: [
|
|
1495
|
-
/* @__PURE__ */ (0,
|
|
1481
|
+
/* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1496
1482
|
className: "space-y-1",
|
|
1497
|
-
children: [/* @__PURE__ */ (0,
|
|
1483
|
+
children: [/* @__PURE__ */ (0, K.jsx)("label", {
|
|
1498
1484
|
className: "text-xs text-muted-foreground",
|
|
1499
1485
|
children: "Top"
|
|
1500
|
-
}), /* @__PURE__ */ (0,
|
|
1486
|
+
}), /* @__PURE__ */ (0, K.jsx)(s, {
|
|
1501
1487
|
type: "number",
|
|
1502
1488
|
min: "0",
|
|
1503
1489
|
value: e.top,
|
|
@@ -1506,12 +1492,12 @@ function Qe({ value: e, onChange: t }) {
|
|
|
1506
1492
|
"data-testid": "debugger-safe-area-top"
|
|
1507
1493
|
})]
|
|
1508
1494
|
}),
|
|
1509
|
-
/* @__PURE__ */ (0,
|
|
1495
|
+
/* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1510
1496
|
className: "space-y-1",
|
|
1511
|
-
children: [/* @__PURE__ */ (0,
|
|
1497
|
+
children: [/* @__PURE__ */ (0, K.jsx)("label", {
|
|
1512
1498
|
className: "text-xs text-muted-foreground",
|
|
1513
1499
|
children: "Right"
|
|
1514
|
-
}), /* @__PURE__ */ (0,
|
|
1500
|
+
}), /* @__PURE__ */ (0, K.jsx)(s, {
|
|
1515
1501
|
type: "number",
|
|
1516
1502
|
min: "0",
|
|
1517
1503
|
value: e.right,
|
|
@@ -1520,12 +1506,12 @@ function Qe({ value: e, onChange: t }) {
|
|
|
1520
1506
|
"data-testid": "debugger-safe-area-right"
|
|
1521
1507
|
})]
|
|
1522
1508
|
}),
|
|
1523
|
-
/* @__PURE__ */ (0,
|
|
1509
|
+
/* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1524
1510
|
className: "space-y-1",
|
|
1525
|
-
children: [/* @__PURE__ */ (0,
|
|
1511
|
+
children: [/* @__PURE__ */ (0, K.jsx)("label", {
|
|
1526
1512
|
className: "text-xs text-muted-foreground",
|
|
1527
1513
|
children: "Bottom"
|
|
1528
|
-
}), /* @__PURE__ */ (0,
|
|
1514
|
+
}), /* @__PURE__ */ (0, K.jsx)(s, {
|
|
1529
1515
|
type: "number",
|
|
1530
1516
|
min: "0",
|
|
1531
1517
|
value: e.bottom,
|
|
@@ -1534,12 +1520,12 @@ function Qe({ value: e, onChange: t }) {
|
|
|
1534
1520
|
"data-testid": "debugger-safe-area-bottom"
|
|
1535
1521
|
})]
|
|
1536
1522
|
}),
|
|
1537
|
-
/* @__PURE__ */ (0,
|
|
1523
|
+
/* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1538
1524
|
className: "space-y-1",
|
|
1539
|
-
children: [/* @__PURE__ */ (0,
|
|
1525
|
+
children: [/* @__PURE__ */ (0, K.jsx)("label", {
|
|
1540
1526
|
className: "text-xs text-muted-foreground",
|
|
1541
1527
|
children: "Left"
|
|
1542
|
-
}), /* @__PURE__ */ (0,
|
|
1528
|
+
}), /* @__PURE__ */ (0, K.jsx)(s, {
|
|
1543
1529
|
type: "number",
|
|
1544
1530
|
min: "0",
|
|
1545
1531
|
value: e.left,
|
|
@@ -1553,7 +1539,7 @@ function Qe({ value: e, onChange: t }) {
|
|
|
1553
1539
|
}
|
|
1554
1540
|
//#endregion
|
|
1555
1541
|
//#region src/client/mcp-apps/debug/csp-suggestions.ts
|
|
1556
|
-
function
|
|
1542
|
+
function Qe(e, t) {
|
|
1557
1543
|
let n = new Set(t?.connectDomains ?? []), r = new Set(t?.resourceDomains ?? []), i = new Set(t?.frameDomains ?? []), a = new Set([
|
|
1558
1544
|
"script-src",
|
|
1559
1545
|
"style-src",
|
|
@@ -1580,14 +1566,14 @@ function $e(e, t) {
|
|
|
1580
1566
|
};
|
|
1581
1567
|
return i.size > 0 && (o.frameDomains = Array.from(i).sort()), o;
|
|
1582
1568
|
}
|
|
1583
|
-
var Z = "https://raw.githubusercontent.com/modelcontextprotocol/ext-apps/bcfffb6585ea4fb1e3a9da39fb8911b83399fa71/specification/2026-01-26/apps.mdx",
|
|
1584
|
-
function
|
|
1569
|
+
var Z = "https://raw.githubusercontent.com/modelcontextprotocol/ext-apps/bcfffb6585ea4fb1e3a9da39fb8911b83399fa71/specification/2026-01-26/apps.mdx", $e = "https://mcp-use.com/docs/typescript/server/csp";
|
|
1570
|
+
function et(e, t, n, r) {
|
|
1585
1571
|
let i = [
|
|
1586
1572
|
"Fix the Content Security Policy (CSP) for this MCP Apps widget. The widget has CSP violations that block network requests and resources.",
|
|
1587
1573
|
"",
|
|
1588
1574
|
"**References:**",
|
|
1589
1575
|
`- MCP Apps CSP spec: ${Z}`,
|
|
1590
|
-
`- mcp-use CSP docs: ${
|
|
1576
|
+
`- mcp-use CSP docs: ${$e}`,
|
|
1591
1577
|
""
|
|
1592
1578
|
];
|
|
1593
1579
|
if (i.push("**Current declared CSP:**"), e ? (i.push(`connectDomains: ${JSON.stringify(e.connectDomains ?? [])}`), i.push(`resourceDomains: ${JSON.stringify(e.resourceDomains ?? [])}`), i.push(`frameDomains: ${JSON.stringify(e.frameDomains ?? [])}`), i.push(`baseUriDomains: ${JSON.stringify(e.baseUriDomains ?? [])}`)) : i.push("No CSP declared."), i.push(""), t && (i.push("**Effective policy (originalPolicy):**"), i.push("```"), i.push(t), i.push("```"), i.push("")), n.length > 0) {
|
|
@@ -1606,48 +1592,40 @@ function tt(e, t, n, r) {
|
|
|
1606
1592
|
}
|
|
1607
1593
|
//#endregion
|
|
1608
1594
|
//#region src/client/components/MCPAppsDebugControls.tsx
|
|
1609
|
-
var Q = "__no_props__", $ = "__tool_props__",
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
{
|
|
1621
|
-
|
|
1622
|
-
label: "Tablet",
|
|
1623
|
-
icon: Ne
|
|
1624
|
-
}
|
|
1625
|
-
];
|
|
1626
|
-
function it({ options: e, value: t, onValueChange: n, placeholder: r, contentTestId: i, searchTestId: a, optionTestId: o, trigger: s }) {
|
|
1627
|
-
let [c, u] = (0, H.useState)(!1), [d, f] = (0, H.useState)(""), p = (0, H.useRef)(null);
|
|
1628
|
-
(0, H.useEffect)(() => {
|
|
1629
|
-
if (!c) {
|
|
1595
|
+
var Q = "__no_props__", $ = "__tool_props__", tt = "__create_preset__", nt = [{
|
|
1596
|
+
value: "desktop",
|
|
1597
|
+
label: "Desktop",
|
|
1598
|
+
icon: j
|
|
1599
|
+
}, {
|
|
1600
|
+
value: "mobile",
|
|
1601
|
+
label: "Mobile",
|
|
1602
|
+
icon: Ae
|
|
1603
|
+
}];
|
|
1604
|
+
function rt({ options: e, value: t, onValueChange: n, placeholder: r, contentTestId: i, searchTestId: a, optionTestId: o, trigger: c }) {
|
|
1605
|
+
let [l, u] = (0, U.useState)(!1), [d, f] = (0, U.useState)(""), p = (0, U.useRef)(null);
|
|
1606
|
+
(0, U.useEffect)(() => {
|
|
1607
|
+
if (!l) {
|
|
1630
1608
|
f("");
|
|
1631
1609
|
return;
|
|
1632
1610
|
}
|
|
1633
1611
|
let e = requestAnimationFrame(() => p.current?.focus());
|
|
1634
1612
|
return () => cancelAnimationFrame(e);
|
|
1635
|
-
}, [
|
|
1636
|
-
let
|
|
1613
|
+
}, [l]);
|
|
1614
|
+
let m = (0, U.useMemo)(() => {
|
|
1637
1615
|
let t = d.trim().toLowerCase();
|
|
1638
1616
|
return t ? e.filter((e) => e.label.toLowerCase().includes(t) || e.value.toLowerCase().includes(t)) : [...e];
|
|
1639
|
-
}, [e, d]), g =
|
|
1640
|
-
return /* @__PURE__ */ (0,
|
|
1641
|
-
open:
|
|
1617
|
+
}, [e, d]), g = m.findIndex((e) => e.value === t);
|
|
1618
|
+
return /* @__PURE__ */ (0, K.jsxs)(S, {
|
|
1619
|
+
open: l,
|
|
1642
1620
|
onOpenChange: u,
|
|
1643
|
-
children: [
|
|
1621
|
+
children: [c, /* @__PURE__ */ (0, K.jsxs)(h, {
|
|
1644
1622
|
"data-testid": i,
|
|
1645
1623
|
checkedIndex: g >= 0 ? g : void 0,
|
|
1646
1624
|
className: "w-80 overflow-hidden",
|
|
1647
|
-
children: [/* @__PURE__ */ (0,
|
|
1625
|
+
children: [/* @__PURE__ */ (0, K.jsx)("div", {
|
|
1648
1626
|
className: "border-b border-border p-2",
|
|
1649
1627
|
onKeyDown: (e) => e.stopPropagation(),
|
|
1650
|
-
children: /* @__PURE__ */ (0,
|
|
1628
|
+
children: /* @__PURE__ */ (0, K.jsx)(s, {
|
|
1651
1629
|
ref: p,
|
|
1652
1630
|
value: d,
|
|
1653
1631
|
onChange: (e) => f(e.target.value),
|
|
@@ -1655,12 +1633,12 @@ function it({ options: e, value: t, onValueChange: n, placeholder: r, contentTes
|
|
|
1655
1633
|
"data-testid": a,
|
|
1656
1634
|
className: "h-8"
|
|
1657
1635
|
})
|
|
1658
|
-
}), /* @__PURE__ */ (0,
|
|
1636
|
+
}), /* @__PURE__ */ (0, K.jsx)("div", {
|
|
1659
1637
|
className: "max-h-64 overflow-y-auto",
|
|
1660
|
-
children:
|
|
1638
|
+
children: m.length === 0 ? /* @__PURE__ */ (0, K.jsx)("p", {
|
|
1661
1639
|
className: "px-3 py-4 text-xs text-muted-foreground",
|
|
1662
1640
|
children: "No results found."
|
|
1663
|
-
}) :
|
|
1641
|
+
}) : m.map((e, r) => /* @__PURE__ */ (0, K.jsx)(C, {
|
|
1664
1642
|
index: r,
|
|
1665
1643
|
label: e.label,
|
|
1666
1644
|
checked: t === e.value,
|
|
@@ -1673,112 +1651,106 @@ function it({ options: e, value: t, onValueChange: n, placeholder: r, contentTes
|
|
|
1673
1651
|
})]
|
|
1674
1652
|
});
|
|
1675
1653
|
}
|
|
1676
|
-
function
|
|
1677
|
-
let { resolvedTheme:
|
|
1678
|
-
(0,
|
|
1679
|
-
|
|
1680
|
-
}, [
|
|
1681
|
-
let [
|
|
1654
|
+
function it({ displayMode: e, onDisplayModeChange: t, toolCallId: n, propsContext: s, resourceUri: c, toolInput: l, resourceAnnotations: u, llmConfig: p, resource: g, onPropsChange: v, requiredProps: y }) {
|
|
1655
|
+
let { resolvedTheme: x, setTheme: w } = _e(), { playground: T, updatePlaygroundSettings: E, widgets: D, clearCspViolations: O } = ge(), k = D.get(n), N = k?.cspViolations ?? [], F = k?.declaredCsp, I = k?.effectivePolicy, ue = N.length > 0 ? Qe(N, F) : null, fe = N.length > 0 ? et(F, I, N, ue) : "", me = e === "fullscreen", he = e === "pip", { presets: B, activePresetId: V, savePreset: xe, deletePreset: we, setActivePreset: H, getActiveProps: Me } = Ie(c), [Pe, W] = (0, U.useState)(!1), G = !!y?.length && !V, [Le, Re] = (0, U.useState)(() => G);
|
|
1656
|
+
(0, U.useEffect)(() => {
|
|
1657
|
+
G && Re(!0);
|
|
1658
|
+
}, [G]);
|
|
1659
|
+
let [q, J] = (0, U.useState)(null), [ze, Be] = (0, U.useState)(!1), [Y, Ve] = (0, U.useState)("mode"), [He, Ue] = (0, U.useState)(!0), Ge = (0, U.useMemo)(() => ve(F), [F]), Ke = (0, U.useMemo)(() => ye(I), [I]), qe = (0, U.useMemo)(() => Se(Ge, Ke), [Ge, Ke]), Je = (0, U.useMemo)(() => be({
|
|
1682
1660
|
mode: T.cspMode,
|
|
1683
|
-
declared:
|
|
1684
|
-
effectivePolicy:
|
|
1685
|
-
violations:
|
|
1661
|
+
declared: F,
|
|
1662
|
+
effectivePolicy: I,
|
|
1663
|
+
violations: N
|
|
1686
1664
|
}), [
|
|
1687
1665
|
T.cspMode,
|
|
1666
|
+
F,
|
|
1688
1667
|
I,
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
B && i !== "tool" ? Z(B) : X !== Q && X !== $ && Z(Xe());
|
|
1668
|
+
N
|
|
1669
|
+
]), Ye = (0, U.useCallback)(() => s === "tool" && l ? $ : Q, [s, l]), [X, Z] = (0, U.useState)(Ye());
|
|
1670
|
+
(0, U.useEffect)(() => {
|
|
1671
|
+
V && s !== "tool" ? Z(V) : X !== Q && X !== $ && Z(Ye());
|
|
1694
1672
|
}, [
|
|
1695
|
-
|
|
1673
|
+
V,
|
|
1696
1674
|
X,
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
]), (0,
|
|
1675
|
+
Ye,
|
|
1676
|
+
s
|
|
1677
|
+
]), (0, U.useEffect)(() => {
|
|
1700
1678
|
if (v) {
|
|
1701
1679
|
if (X === Q || X === $) v(null);
|
|
1702
|
-
else if (
|
|
1703
|
-
let e =
|
|
1680
|
+
else if (V && X === V) {
|
|
1681
|
+
let e = Me();
|
|
1704
1682
|
e && v(e);
|
|
1705
1683
|
}
|
|
1706
1684
|
}
|
|
1707
1685
|
}, [
|
|
1708
1686
|
X,
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1687
|
+
V,
|
|
1688
|
+
l,
|
|
1689
|
+
Me,
|
|
1712
1690
|
v,
|
|
1713
|
-
|
|
1691
|
+
B
|
|
1714
1692
|
]);
|
|
1715
|
-
let
|
|
1716
|
-
if (e ===
|
|
1717
|
-
|
|
1693
|
+
let $e = (e) => {
|
|
1694
|
+
if (e === tt) {
|
|
1695
|
+
J(null), W(!0);
|
|
1718
1696
|
return;
|
|
1719
1697
|
}
|
|
1720
|
-
if (e === Q || e === $)
|
|
1698
|
+
if (e === Q || e === $) H(null), Z(e), v?.(null);
|
|
1721
1699
|
else {
|
|
1722
|
-
|
|
1723
|
-
let t =
|
|
1700
|
+
H(e), Z(e);
|
|
1701
|
+
let t = B.find((t) => t.id === e);
|
|
1724
1702
|
v?.(t?.props ?? null);
|
|
1725
1703
|
}
|
|
1726
|
-
},
|
|
1727
|
-
|
|
1728
|
-
},
|
|
1704
|
+
}, it = (e) => {
|
|
1705
|
+
xe(e), H(e.id), Z(e.id), v?.(e.props);
|
|
1706
|
+
}, at = (e, t) => {
|
|
1729
1707
|
t.stopPropagation();
|
|
1730
|
-
let n =
|
|
1731
|
-
n && (
|
|
1732
|
-
},
|
|
1733
|
-
t.stopPropagation(),
|
|
1734
|
-
}, ct = () =>
|
|
1735
|
-
|
|
1736
|
-
case "mobile": return /* @__PURE__ */ (0, G.jsx)(je, { className: "size-3" });
|
|
1737
|
-
case "tablet": return /* @__PURE__ */ (0, G.jsx)(Ne, { className: "size-3" });
|
|
1738
|
-
default: return /* @__PURE__ */ (0, G.jsx)(j, { className: "size-3" });
|
|
1739
|
-
}
|
|
1740
|
-
}, lt = rt.findIndex((e) => e.value === T.deviceType);
|
|
1741
|
-
return /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1708
|
+
let n = B.find((t) => t.id === e);
|
|
1709
|
+
n && (we(e), z.success("Preset deleted", { description: `Preset "${n.name}" has been deleted.` }));
|
|
1710
|
+
}, ot = (e, t) => {
|
|
1711
|
+
t.stopPropagation(), J(e), W(!0);
|
|
1712
|
+
}, st = () => T.deviceType === "mobile" ? /* @__PURE__ */ (0, K.jsx)(Ae, { className: "size-3" }) : /* @__PURE__ */ (0, K.jsx)(j, { className: "size-3" }), ct = nt.findIndex((e) => e.value === T.deviceType);
|
|
1713
|
+
return /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1742
1714
|
className: "flex items-center gap-2",
|
|
1743
1715
|
children: [
|
|
1744
|
-
!
|
|
1745
|
-
render: /* @__PURE__ */ (0,
|
|
1716
|
+
!me && !he && /* @__PURE__ */ (0, K.jsxs)(K.Fragment, { children: [/* @__PURE__ */ (0, K.jsxs)(a, { children: [/* @__PURE__ */ (0, K.jsx)(i, {
|
|
1717
|
+
render: /* @__PURE__ */ (0, K.jsx)(d, {
|
|
1746
1718
|
"data-testid": "debugger-fullscreen-button",
|
|
1747
1719
|
variant: "outline",
|
|
1748
1720
|
size: "sm",
|
|
1749
1721
|
className: "bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
1750
1722
|
onClick: () => t("fullscreen"),
|
|
1751
|
-
children: /* @__PURE__ */ (0,
|
|
1723
|
+
children: /* @__PURE__ */ (0, K.jsx)(de, { className: "size-4" })
|
|
1752
1724
|
}),
|
|
1753
1725
|
nativeButton: !0
|
|
1754
|
-
}), /* @__PURE__ */ (0,
|
|
1755
|
-
render: /* @__PURE__ */ (0,
|
|
1726
|
+
}), /* @__PURE__ */ (0, K.jsx)(o, { children: "Enter fullscreen mode" })] }), /* @__PURE__ */ (0, K.jsxs)(a, { children: [/* @__PURE__ */ (0, K.jsx)(i, {
|
|
1727
|
+
render: /* @__PURE__ */ (0, K.jsx)(d, {
|
|
1756
1728
|
"data-testid": "debugger-pip-button",
|
|
1757
1729
|
variant: "outline",
|
|
1758
1730
|
size: "sm",
|
|
1759
1731
|
className: "bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
1760
1732
|
onClick: () => t("pip"),
|
|
1761
|
-
children: /* @__PURE__ */ (0,
|
|
1733
|
+
children: /* @__PURE__ */ (0, K.jsx)(Ee, { className: "size-4" })
|
|
1762
1734
|
}),
|
|
1763
1735
|
nativeButton: !0
|
|
1764
|
-
}), /* @__PURE__ */ (0,
|
|
1765
|
-
/* @__PURE__ */ (0,
|
|
1766
|
-
render: /* @__PURE__ */ (0,
|
|
1767
|
-
render: /* @__PURE__ */ (0,
|
|
1736
|
+
}), /* @__PURE__ */ (0, K.jsx)(o, { children: "Picture-in-picture" })] })] }),
|
|
1737
|
+
/* @__PURE__ */ (0, K.jsxs)(S, { children: [/* @__PURE__ */ (0, K.jsxs)(a, { children: [/* @__PURE__ */ (0, K.jsx)(i, {
|
|
1738
|
+
render: /* @__PURE__ */ (0, K.jsx)(f, {
|
|
1739
|
+
render: /* @__PURE__ */ (0, K.jsx)(d, {
|
|
1768
1740
|
"data-testid": "debugger-device-button",
|
|
1769
1741
|
variant: "outline",
|
|
1770
1742
|
size: "sm",
|
|
1771
1743
|
className: "h-8 w-8 p-0 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
1772
|
-
children:
|
|
1744
|
+
children: st()
|
|
1773
1745
|
}),
|
|
1774
1746
|
nativeButton: !0
|
|
1775
1747
|
}),
|
|
1776
1748
|
nativeButton: !0
|
|
1777
|
-
}), /* @__PURE__ */ (0,
|
|
1749
|
+
}), /* @__PURE__ */ (0, K.jsxs)(o, { children: ["Device: ", T.deviceType] })] }), /* @__PURE__ */ (0, K.jsx)(h, {
|
|
1778
1750
|
"data-testid": "debugger-device-dialog",
|
|
1779
|
-
checkedIndex:
|
|
1751
|
+
checkedIndex: ct >= 0 ? ct : void 0,
|
|
1780
1752
|
className: "w-56",
|
|
1781
|
-
children:
|
|
1753
|
+
children: nt.map((e, t) => /* @__PURE__ */ (0, K.jsx)(C, {
|
|
1782
1754
|
index: t,
|
|
1783
1755
|
icon: e.icon,
|
|
1784
1756
|
label: e.label,
|
|
@@ -1787,35 +1759,35 @@ function at({ displayMode: e, onDisplayModeChange: t, toolCallId: n, propsContex
|
|
|
1787
1759
|
onSelect: () => E({ deviceType: e.value })
|
|
1788
1760
|
}, e.value))
|
|
1789
1761
|
})] }),
|
|
1790
|
-
/* @__PURE__ */ (0,
|
|
1791
|
-
render: /* @__PURE__ */ (0,
|
|
1762
|
+
/* @__PURE__ */ (0, K.jsxs)(a, { children: [/* @__PURE__ */ (0, K.jsx)(i, {
|
|
1763
|
+
render: /* @__PURE__ */ (0, K.jsx)(d, {
|
|
1792
1764
|
"data-testid": "debugger-theme-button",
|
|
1793
1765
|
variant: "outline",
|
|
1794
1766
|
size: "sm",
|
|
1795
1767
|
className: "h-8 w-8 p-0 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
1796
1768
|
onClick: () => {
|
|
1797
|
-
w(
|
|
1769
|
+
w(x === "dark" ? "light" : "dark");
|
|
1798
1770
|
},
|
|
1799
|
-
children:
|
|
1771
|
+
children: x === "dark" ? /* @__PURE__ */ (0, K.jsx)(M, { className: "size-3.5" }) : /* @__PURE__ */ (0, K.jsx)(P, { className: "size-3.5" })
|
|
1800
1772
|
}),
|
|
1801
1773
|
nativeButton: !0
|
|
1802
|
-
}), /* @__PURE__ */ (0,
|
|
1803
|
-
/* @__PURE__ */ (0,
|
|
1804
|
-
options:
|
|
1774
|
+
}), /* @__PURE__ */ (0, K.jsxs)(o, { children: ["Theme: ", x === "dark" ? "Dark" : "Light"] })] }),
|
|
1775
|
+
/* @__PURE__ */ (0, K.jsx)(rt, {
|
|
1776
|
+
options: Ne,
|
|
1805
1777
|
value: T.locale,
|
|
1806
1778
|
onValueChange: (e) => E({ locale: e }),
|
|
1807
1779
|
placeholder: "Search locales...",
|
|
1808
1780
|
contentTestId: "debugger-locale-dialog",
|
|
1809
1781
|
searchTestId: "debugger-locale-search",
|
|
1810
1782
|
optionTestId: (e) => `debugger-locale-option-${e}`,
|
|
1811
|
-
trigger: /* @__PURE__ */ (0,
|
|
1812
|
-
render: /* @__PURE__ */ (0,
|
|
1813
|
-
render: /* @__PURE__ */ (0,
|
|
1783
|
+
trigger: /* @__PURE__ */ (0, K.jsxs)(a, { children: [/* @__PURE__ */ (0, K.jsx)(i, {
|
|
1784
|
+
render: /* @__PURE__ */ (0, K.jsx)(f, {
|
|
1785
|
+
render: /* @__PURE__ */ (0, K.jsx)(d, {
|
|
1814
1786
|
"data-testid": "debugger-locale-button",
|
|
1815
1787
|
variant: "outline",
|
|
1816
1788
|
size: "sm",
|
|
1817
1789
|
className: "h-8 min-w-[50px] px-2 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
1818
|
-
children: /* @__PURE__ */ (0,
|
|
1790
|
+
children: /* @__PURE__ */ (0, K.jsx)("span", {
|
|
1819
1791
|
className: "text-xs font-mono",
|
|
1820
1792
|
children: T.locale
|
|
1821
1793
|
})
|
|
@@ -1823,61 +1795,61 @@ function at({ displayMode: e, onDisplayModeChange: t, toolCallId: n, propsContex
|
|
|
1823
1795
|
nativeButton: !0
|
|
1824
1796
|
}),
|
|
1825
1797
|
nativeButton: !0
|
|
1826
|
-
}), /* @__PURE__ */ (0,
|
|
1798
|
+
}), /* @__PURE__ */ (0, K.jsx)(o, { children: "Locale" })] })
|
|
1827
1799
|
}),
|
|
1828
|
-
/* @__PURE__ */ (0,
|
|
1829
|
-
options:
|
|
1800
|
+
/* @__PURE__ */ (0, K.jsx)(rt, {
|
|
1801
|
+
options: Fe,
|
|
1830
1802
|
value: T.timeZone,
|
|
1831
1803
|
onValueChange: (e) => E({ timeZone: e }),
|
|
1832
1804
|
placeholder: "Search timezones...",
|
|
1833
1805
|
contentTestId: "debugger-timezone-dialog",
|
|
1834
1806
|
searchTestId: "debugger-timezone-search",
|
|
1835
1807
|
optionTestId: (e) => `debugger-timezone-option-${e.replace(/\//g, "-")}`,
|
|
1836
|
-
trigger: /* @__PURE__ */ (0,
|
|
1837
|
-
render: /* @__PURE__ */ (0,
|
|
1838
|
-
render: /* @__PURE__ */ (0,
|
|
1808
|
+
trigger: /* @__PURE__ */ (0, K.jsxs)(a, { children: [/* @__PURE__ */ (0, K.jsx)(i, {
|
|
1809
|
+
render: /* @__PURE__ */ (0, K.jsx)(f, {
|
|
1810
|
+
render: /* @__PURE__ */ (0, K.jsx)(d, {
|
|
1839
1811
|
"data-testid": "debugger-timezone-button",
|
|
1840
1812
|
variant: "outline",
|
|
1841
1813
|
size: "sm",
|
|
1842
1814
|
className: "h-8 w-8 p-0 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
1843
|
-
children: /* @__PURE__ */ (0,
|
|
1815
|
+
children: /* @__PURE__ */ (0, K.jsx)(ce, { className: "size-3.5" })
|
|
1844
1816
|
}),
|
|
1845
1817
|
nativeButton: !0
|
|
1846
1818
|
}),
|
|
1847
1819
|
nativeButton: !0
|
|
1848
|
-
}), /* @__PURE__ */ (0,
|
|
1820
|
+
}), /* @__PURE__ */ (0, K.jsxs)(o, { children: ["Timezone: ", T.timeZone] })] })
|
|
1849
1821
|
}),
|
|
1850
|
-
/* @__PURE__ */ (0,
|
|
1851
|
-
open:
|
|
1852
|
-
onOpenChange:
|
|
1853
|
-
children: [/* @__PURE__ */ (0,
|
|
1854
|
-
render: /* @__PURE__ */ (0,
|
|
1855
|
-
render: /* @__PURE__ */ (0,
|
|
1822
|
+
/* @__PURE__ */ (0, K.jsxs)(se, {
|
|
1823
|
+
open: ze,
|
|
1824
|
+
onOpenChange: Be,
|
|
1825
|
+
children: [/* @__PURE__ */ (0, K.jsxs)(a, { children: [/* @__PURE__ */ (0, K.jsx)(i, {
|
|
1826
|
+
render: /* @__PURE__ */ (0, K.jsx)(ne, {
|
|
1827
|
+
render: /* @__PURE__ */ (0, K.jsxs)(d, {
|
|
1856
1828
|
"data-testid": "debugger-csp-button",
|
|
1857
1829
|
variant: "outline",
|
|
1858
1830
|
size: "sm",
|
|
1859
1831
|
className: "relative h-8 w-8 p-0 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
1860
|
-
children: [T.cspMode === "permissive" ? /* @__PURE__ */ (0,
|
|
1832
|
+
children: [T.cspMode === "permissive" ? /* @__PURE__ */ (0, K.jsx)(ke, { className: "size-3.5" }) : /* @__PURE__ */ (0, K.jsx)(Oe, { className: "size-3.5" }), N.length > 0 && /* @__PURE__ */ (0, K.jsx)("span", {
|
|
1861
1833
|
className: `absolute -top-1.5 -right-1.5 flex h-4 min-w-4 items-center justify-center rounded-full px-0.5 text-[9px] font-bold text-white leading-none ${T.cspMode === "permissive" ? "bg-yellow-500" : "bg-red-500"}`,
|
|
1862
|
-
children:
|
|
1834
|
+
children: N.length > 99 ? "99+" : N.length
|
|
1863
1835
|
})]
|
|
1864
1836
|
}),
|
|
1865
1837
|
nativeButton: !0
|
|
1866
1838
|
}),
|
|
1867
1839
|
nativeButton: !0
|
|
1868
|
-
}), /* @__PURE__ */ (0,
|
|
1840
|
+
}), /* @__PURE__ */ (0, K.jsxs)(o, { children: [
|
|
1869
1841
|
"CSP:",
|
|
1870
1842
|
" ",
|
|
1871
1843
|
T.cspMode === "permissive" ? "Permissive" : "Declared",
|
|
1872
|
-
|
|
1873
|
-
] })] }), /* @__PURE__ */ (0,
|
|
1844
|
+
N.length > 0 && ` · ${N.length} ${T.cspMode === "permissive" ? "would be blocked" : "blocked"}`
|
|
1845
|
+
] })] }), /* @__PURE__ */ (0, K.jsxs)(ae, {
|
|
1874
1846
|
scrollable: !0,
|
|
1875
1847
|
className: "sm:max-w-[520px] max-h-[85vh]",
|
|
1876
1848
|
"data-testid": "debugger-csp-dialog",
|
|
1877
|
-
children: [/* @__PURE__ */ (0,
|
|
1849
|
+
children: [/* @__PURE__ */ (0, K.jsx)(ie, { children: /* @__PURE__ */ (0, K.jsx)(te, { children: "CSP Mode" }) }), /* @__PURE__ */ (0, K.jsxs)(re, {
|
|
1878
1850
|
className: "space-y-3",
|
|
1879
1851
|
children: [
|
|
1880
|
-
/* @__PURE__ */ (0,
|
|
1852
|
+
/* @__PURE__ */ (0, K.jsx)("div", {
|
|
1881
1853
|
role: "tablist",
|
|
1882
1854
|
"aria-label": "CSP diagnostics",
|
|
1883
1855
|
className: "grid grid-cols-3 rounded-md border border-zinc-200 dark:border-zinc-700 p-1",
|
|
@@ -1885,129 +1857,129 @@ function at({ displayMode: e, onDisplayModeChange: t, toolCallId: n, propsContex
|
|
|
1885
1857
|
["mode", "Mode"],
|
|
1886
1858
|
["diff", "Policy Diff"],
|
|
1887
1859
|
["findings", "Findings"]
|
|
1888
|
-
].map(([e, t]) => /* @__PURE__ */ (0,
|
|
1860
|
+
].map(([e, t]) => /* @__PURE__ */ (0, K.jsx)("button", {
|
|
1889
1861
|
type: "button",
|
|
1890
1862
|
role: "tab",
|
|
1891
|
-
"aria-selected":
|
|
1892
|
-
onClick: () =>
|
|
1893
|
-
className: `rounded px-2 py-1.5 text-xs font-medium ${
|
|
1863
|
+
"aria-selected": Y === e,
|
|
1864
|
+
onClick: () => Ve(e),
|
|
1865
|
+
className: `rounded px-2 py-1.5 text-xs font-medium ${Y === e ? "bg-zinc-100 dark:bg-zinc-800" : "text-muted-foreground"}`,
|
|
1894
1866
|
children: t
|
|
1895
1867
|
}, e))
|
|
1896
1868
|
}),
|
|
1897
|
-
|
|
1869
|
+
Y === "mode" && /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1898
1870
|
role: "tabpanel",
|
|
1899
1871
|
className: "space-y-2",
|
|
1900
1872
|
children: [
|
|
1901
|
-
/* @__PURE__ */ (0,
|
|
1873
|
+
/* @__PURE__ */ (0, K.jsxs)(d, {
|
|
1902
1874
|
"data-testid": "debugger-csp-option-permissive",
|
|
1903
1875
|
variant: T.cspMode === "permissive" ? "default" : "outline",
|
|
1904
1876
|
className: "w-full justify-start",
|
|
1905
1877
|
onClick: () => E({ cspMode: "permissive" }),
|
|
1906
|
-
children: [/* @__PURE__ */ (0,
|
|
1878
|
+
children: [/* @__PURE__ */ (0, K.jsx)(ke, { className: "size-4 mr-2" }), "Permissive"]
|
|
1907
1879
|
}),
|
|
1908
|
-
/* @__PURE__ */ (0,
|
|
1880
|
+
/* @__PURE__ */ (0, K.jsxs)(d, {
|
|
1909
1881
|
"data-testid": "debugger-csp-option-widget-declared",
|
|
1910
1882
|
variant: T.cspMode === "widget-declared" ? "default" : "outline",
|
|
1911
1883
|
className: "w-full justify-start",
|
|
1912
1884
|
onClick: () => E({ cspMode: "widget-declared" }),
|
|
1913
|
-
children: [/* @__PURE__ */ (0,
|
|
1885
|
+
children: [/* @__PURE__ */ (0, K.jsx)(Oe, { className: "size-4 mr-2" }), "Widget-Declared"]
|
|
1914
1886
|
}),
|
|
1915
|
-
/* @__PURE__ */ (0,
|
|
1887
|
+
/* @__PURE__ */ (0, K.jsx)("p", {
|
|
1916
1888
|
className: "text-xs text-muted-foreground",
|
|
1917
1889
|
children: "Permissive records would-be blocks; Widget-Declared enforces the resource metadata policy."
|
|
1918
1890
|
})
|
|
1919
1891
|
]
|
|
1920
1892
|
}),
|
|
1921
|
-
|
|
1893
|
+
Y === "diff" && /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1922
1894
|
role: "tabpanel",
|
|
1923
1895
|
className: "space-y-2",
|
|
1924
|
-
children: [
|
|
1896
|
+
children: [qe.length ? /* @__PURE__ */ (0, K.jsx)("div", {
|
|
1925
1897
|
className: "max-h-64 overflow-y-auto rounded border border-zinc-200 dark:border-zinc-700",
|
|
1926
|
-
children:
|
|
1898
|
+
children: qe.map((e) => /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1927
1899
|
className: "border-b border-zinc-100 dark:border-zinc-800 p-2 text-xs last:border-0",
|
|
1928
|
-
children: [/* @__PURE__ */ (0,
|
|
1900
|
+
children: [/* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1929
1901
|
className: "flex items-center justify-between",
|
|
1930
|
-
children: [/* @__PURE__ */ (0,
|
|
1902
|
+
children: [/* @__PURE__ */ (0, K.jsx)("code", { children: e.directive }), /* @__PURE__ */ (0, K.jsx)("span", {
|
|
1931
1903
|
className: "text-[10px] uppercase text-muted-foreground",
|
|
1932
1904
|
children: e.status
|
|
1933
1905
|
})]
|
|
1934
|
-
}), /* @__PURE__ */ (0,
|
|
1906
|
+
}), /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1935
1907
|
className: "mt-1 font-mono text-[10px] text-muted-foreground break-all",
|
|
1936
1908
|
children: [
|
|
1937
1909
|
"requested: ",
|
|
1938
1910
|
e.requested.join(" ") || "—",
|
|
1939
|
-
/* @__PURE__ */ (0,
|
|
1911
|
+
/* @__PURE__ */ (0, K.jsx)("br", {}),
|
|
1940
1912
|
"effective: ",
|
|
1941
1913
|
e.effective.join(" ") || "—"
|
|
1942
1914
|
]
|
|
1943
1915
|
})]
|
|
1944
1916
|
}, e.directive))
|
|
1945
|
-
}) : /* @__PURE__ */ (0,
|
|
1917
|
+
}) : /* @__PURE__ */ (0, K.jsx)("p", {
|
|
1946
1918
|
className: "text-xs text-muted-foreground",
|
|
1947
1919
|
children: "No requested or effective policy data yet."
|
|
1948
|
-
}),
|
|
1920
|
+
}), I && /* @__PURE__ */ (0, K.jsxs)(d, {
|
|
1949
1921
|
variant: "outline",
|
|
1950
1922
|
size: "sm",
|
|
1951
1923
|
onClick: async () => {
|
|
1952
1924
|
try {
|
|
1953
|
-
await
|
|
1925
|
+
await R(I), z.success("Policy copied to clipboard");
|
|
1954
1926
|
} catch {
|
|
1955
|
-
|
|
1927
|
+
z.error("Failed to copy");
|
|
1956
1928
|
}
|
|
1957
1929
|
},
|
|
1958
|
-
children: [/* @__PURE__ */ (0,
|
|
1930
|
+
children: [/* @__PURE__ */ (0, K.jsx)(L, { className: "size-3.5 mr-2" }), "Copy effective policy"]
|
|
1959
1931
|
})]
|
|
1960
1932
|
}),
|
|
1961
|
-
|
|
1933
|
+
Y === "findings" && /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1962
1934
|
role: "tabpanel",
|
|
1963
1935
|
className: "space-y-2",
|
|
1964
|
-
children: [/* @__PURE__ */ (0,
|
|
1936
|
+
children: [/* @__PURE__ */ (0, K.jsx)("div", {
|
|
1965
1937
|
className: "space-y-1.5",
|
|
1966
|
-
children:
|
|
1938
|
+
children: Je.map((e, t) => /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1967
1939
|
className: "rounded border border-zinc-200 dark:border-zinc-700 p-2",
|
|
1968
|
-
children: [/* @__PURE__ */ (0,
|
|
1940
|
+
children: [/* @__PURE__ */ (0, K.jsx)("div", {
|
|
1969
1941
|
className: "text-xs font-medium",
|
|
1970
1942
|
children: e.title
|
|
1971
|
-
}), /* @__PURE__ */ (0,
|
|
1943
|
+
}), /* @__PURE__ */ (0, K.jsx)("div", {
|
|
1972
1944
|
className: "text-[11px] text-muted-foreground break-all",
|
|
1973
1945
|
children: e.detail
|
|
1974
1946
|
})]
|
|
1975
1947
|
}, `${e.title}-${t}`))
|
|
1976
|
-
}),
|
|
1948
|
+
}), N.length > 0 && /* @__PURE__ */ (0, K.jsxs)(K.Fragment, { children: [/* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1977
1949
|
className: "flex items-center justify-between",
|
|
1978
|
-
children: [/* @__PURE__ */ (0,
|
|
1950
|
+
children: [/* @__PURE__ */ (0, K.jsxs)("span", {
|
|
1979
1951
|
className: "text-xs font-medium",
|
|
1980
1952
|
children: [
|
|
1981
|
-
|
|
1953
|
+
N.length,
|
|
1982
1954
|
" observed request",
|
|
1983
|
-
|
|
1955
|
+
N.length === 1 ? "" : "s"
|
|
1984
1956
|
]
|
|
1985
|
-
}), /* @__PURE__ */ (0,
|
|
1957
|
+
}), /* @__PURE__ */ (0, K.jsx)("button", {
|
|
1986
1958
|
className: "text-xs text-muted-foreground underline",
|
|
1987
1959
|
onClick: () => O(n),
|
|
1988
1960
|
children: "Clear"
|
|
1989
1961
|
})]
|
|
1990
|
-
}), /* @__PURE__ */ (0,
|
|
1962
|
+
}), /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1991
1963
|
className: "border border-amber-200 dark:border-amber-800 rounded-md overflow-hidden",
|
|
1992
|
-
children: [/* @__PURE__ */ (0,
|
|
1964
|
+
children: [/* @__PURE__ */ (0, K.jsxs)("div", {
|
|
1993
1965
|
className: "flex items-center justify-between bg-amber-50 dark:bg-amber-950/30 px-3 py-2",
|
|
1994
|
-
children: [/* @__PURE__ */ (0,
|
|
1966
|
+
children: [/* @__PURE__ */ (0, K.jsxs)("button", {
|
|
1995
1967
|
type: "button",
|
|
1996
1968
|
className: "flex items-center gap-2 text-xs font-medium text-amber-800 dark:text-amber-200",
|
|
1997
|
-
onClick: () =>
|
|
1998
|
-
children: [
|
|
1999
|
-
}), /* @__PURE__ */ (0,
|
|
1969
|
+
onClick: () => Ue((e) => !e),
|
|
1970
|
+
children: [He ? /* @__PURE__ */ (0, K.jsx)(A, { className: "size-3.5" }) : /* @__PURE__ */ (0, K.jsx)(r, { className: "size-3.5" }), "Prompt for Agents"]
|
|
1971
|
+
}), /* @__PURE__ */ (0, K.jsx)(d, {
|
|
2000
1972
|
variant: "ghost",
|
|
2001
1973
|
size: "sm",
|
|
2002
1974
|
className: "h-7 w-7 p-0",
|
|
2003
|
-
onClick: () => void
|
|
1975
|
+
onClick: () => void R(fe),
|
|
2004
1976
|
"aria-label": "Copy prompt for agents",
|
|
2005
|
-
children: /* @__PURE__ */ (0,
|
|
1977
|
+
children: /* @__PURE__ */ (0, K.jsx)(L, { className: "size-3.5" })
|
|
2006
1978
|
})]
|
|
2007
|
-
}),
|
|
1979
|
+
}), He && /* @__PURE__ */ (0, K.jsx)("pre", {
|
|
2008
1980
|
className: "max-h-48 overflow-auto whitespace-pre-wrap p-2 text-[11px]",
|
|
2009
1981
|
"data-testid": "debugger-csp-prompt-for-agents",
|
|
2010
|
-
children:
|
|
1982
|
+
children: fe
|
|
2011
1983
|
})]
|
|
2012
1984
|
})] })]
|
|
2013
1985
|
})
|
|
@@ -2015,8 +1987,8 @@ function at({ displayMode: e, onDisplayModeChange: t, toolCallId: n, propsContex
|
|
|
2015
1987
|
})]
|
|
2016
1988
|
})]
|
|
2017
1989
|
}),
|
|
2018
|
-
/* @__PURE__ */ (0,
|
|
2019
|
-
render: /* @__PURE__ */ (0,
|
|
1990
|
+
/* @__PURE__ */ (0, K.jsxs)(a, { children: [/* @__PURE__ */ (0, K.jsx)(i, {
|
|
1991
|
+
render: /* @__PURE__ */ (0, K.jsx)(d, {
|
|
2020
1992
|
"data-testid": "debugger-touch-button",
|
|
2021
1993
|
variant: "outline",
|
|
2022
1994
|
size: "sm",
|
|
@@ -2027,12 +1999,12 @@ function at({ displayMode: e, onDisplayModeChange: t, toolCallId: n, propsContex
|
|
|
2027
1999
|
touch: !T.capabilities.touch
|
|
2028
2000
|
} });
|
|
2029
2001
|
},
|
|
2030
|
-
children: /* @__PURE__ */ (0,
|
|
2002
|
+
children: /* @__PURE__ */ (0, K.jsx)(De, { className: `size-3.5 ${T.capabilities.touch ? "text-blue-600 dark:text-blue-400" : ""}` })
|
|
2031
2003
|
}),
|
|
2032
2004
|
nativeButton: !0
|
|
2033
|
-
}), /* @__PURE__ */ (0,
|
|
2034
|
-
/* @__PURE__ */ (0,
|
|
2035
|
-
render: /* @__PURE__ */ (0,
|
|
2005
|
+
}), /* @__PURE__ */ (0, K.jsxs)(o, { children: ["Touch: ", T.capabilities.touch ? "Enabled" : "Disabled"] })] }),
|
|
2006
|
+
/* @__PURE__ */ (0, K.jsxs)(a, { children: [/* @__PURE__ */ (0, K.jsx)(i, {
|
|
2007
|
+
render: /* @__PURE__ */ (0, K.jsx)(d, {
|
|
2036
2008
|
"data-testid": "debugger-hover-button",
|
|
2037
2009
|
variant: "outline",
|
|
2038
2010
|
size: "sm",
|
|
@@ -2043,28 +2015,28 @@ function at({ displayMode: e, onDisplayModeChange: t, toolCallId: n, propsContex
|
|
|
2043
2015
|
hover: !T.capabilities.hover
|
|
2044
2016
|
} });
|
|
2045
2017
|
},
|
|
2046
|
-
children: /* @__PURE__ */ (0,
|
|
2018
|
+
children: /* @__PURE__ */ (0, K.jsx)(Te, { className: `size-3.5 ${T.capabilities.hover ? "text-blue-600 dark:text-blue-400" : ""}` })
|
|
2047
2019
|
}),
|
|
2048
2020
|
nativeButton: !0
|
|
2049
|
-
}), /* @__PURE__ */ (0,
|
|
2050
|
-
/* @__PURE__ */ (0,
|
|
2051
|
-
render: /* @__PURE__ */ (0,
|
|
2021
|
+
}), /* @__PURE__ */ (0, K.jsxs)(o, { children: ["Hover: ", T.capabilities.hover ? "Enabled" : "Disabled"] })] }),
|
|
2022
|
+
/* @__PURE__ */ (0, K.jsxs)(b, { children: [/* @__PURE__ */ (0, K.jsx)(_, {
|
|
2023
|
+
render: /* @__PURE__ */ (0, K.jsx)(d, {
|
|
2052
2024
|
"data-testid": "debugger-safe-area-button",
|
|
2053
2025
|
variant: "outline",
|
|
2054
2026
|
size: "sm",
|
|
2055
2027
|
className: "h-8 w-8 p-0 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
2056
|
-
children: /* @__PURE__ */ (0,
|
|
2028
|
+
children: /* @__PURE__ */ (0, K.jsx)(je, { className: "size-3.5" })
|
|
2057
2029
|
}),
|
|
2058
2030
|
nativeButton: !0
|
|
2059
|
-
}), /* @__PURE__ */ (0,
|
|
2031
|
+
}), /* @__PURE__ */ (0, K.jsx)(m, {
|
|
2060
2032
|
className: "w-64 p-3",
|
|
2061
2033
|
"data-testid": "debugger-safe-area-dialog",
|
|
2062
|
-
children: /* @__PURE__ */ (0,
|
|
2034
|
+
children: /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
2063
2035
|
className: "space-y-2",
|
|
2064
|
-
children: [/* @__PURE__ */ (0,
|
|
2036
|
+
children: [/* @__PURE__ */ (0, K.jsx)("label", {
|
|
2065
2037
|
className: "text-xs font-medium",
|
|
2066
2038
|
children: "Safe Area Insets"
|
|
2067
|
-
}), /* @__PURE__ */ (0,
|
|
2039
|
+
}), /* @__PURE__ */ (0, K.jsx)(Ze, {
|
|
2068
2040
|
value: T.safeAreaInsets,
|
|
2069
2041
|
onChange: (e) => {
|
|
2070
2042
|
E({ safeAreaInsets: e });
|
|
@@ -2072,108 +2044,108 @@ function at({ displayMode: e, onDisplayModeChange: t, toolCallId: n, propsContex
|
|
|
2072
2044
|
})]
|
|
2073
2045
|
})
|
|
2074
2046
|
})] }),
|
|
2075
|
-
|
|
2076
|
-
render: /* @__PURE__ */ (0,
|
|
2077
|
-
render: /* @__PURE__ */ (0,
|
|
2047
|
+
s === "tool" ? /* @__PURE__ */ (0, K.jsxs)(se, { children: [/* @__PURE__ */ (0, K.jsxs)(a, { children: [/* @__PURE__ */ (0, K.jsx)(i, {
|
|
2048
|
+
render: /* @__PURE__ */ (0, K.jsx)(ne, {
|
|
2049
|
+
render: /* @__PURE__ */ (0, K.jsx)(d, {
|
|
2078
2050
|
variant: "outline",
|
|
2079
2051
|
size: "sm",
|
|
2080
2052
|
className: "h-8 w-8 p-0 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
2081
2053
|
"data-testid": "debugger-props-button",
|
|
2082
|
-
children: /* @__PURE__ */ (0,
|
|
2054
|
+
children: /* @__PURE__ */ (0, K.jsx)(Ce, { className: "size-3.5" })
|
|
2083
2055
|
}),
|
|
2084
2056
|
nativeButton: !0
|
|
2085
2057
|
}),
|
|
2086
2058
|
nativeButton: !0
|
|
2087
|
-
}), /* @__PURE__ */ (0,
|
|
2059
|
+
}), /* @__PURE__ */ (0, K.jsx)(o, { children: "View Tool Props" })] }), /* @__PURE__ */ (0, K.jsxs)(ae, {
|
|
2088
2060
|
scrollable: !0,
|
|
2089
2061
|
className: "sm:max-w-[600px] max-h-[85vh]",
|
|
2090
2062
|
"data-testid": "debugger-props-dialog",
|
|
2091
|
-
children: [/* @__PURE__ */ (0,
|
|
2092
|
-
data:
|
|
2063
|
+
children: [/* @__PURE__ */ (0, K.jsx)(ie, { children: /* @__PURE__ */ (0, K.jsx)(te, { children: "Tool Props" }) }), /* @__PURE__ */ (0, K.jsx)(re, { children: /* @__PURE__ */ (0, K.jsx)(oe, { children: /* @__PURE__ */ (0, K.jsx)(le, {
|
|
2064
|
+
data: l ?? {},
|
|
2093
2065
|
filename: "tool-props.json"
|
|
2094
2066
|
}) }) })]
|
|
2095
|
-
})] }) : /* @__PURE__ */ (0,
|
|
2096
|
-
open:
|
|
2097
|
-
onOpenChange:
|
|
2098
|
-
children: [/* @__PURE__ */ (0,
|
|
2099
|
-
render: /* @__PURE__ */ (0,
|
|
2100
|
-
render: /* @__PURE__ */ (0,
|
|
2067
|
+
})] }) : /* @__PURE__ */ (0, K.jsxs)(b, {
|
|
2068
|
+
open: Le,
|
|
2069
|
+
onOpenChange: Re,
|
|
2070
|
+
children: [/* @__PURE__ */ (0, K.jsxs)(a, { children: [/* @__PURE__ */ (0, K.jsx)(i, {
|
|
2071
|
+
render: /* @__PURE__ */ (0, K.jsx)(_, {
|
|
2072
|
+
render: /* @__PURE__ */ (0, K.jsx)(d, {
|
|
2101
2073
|
variant: "outline",
|
|
2102
2074
|
size: "sm",
|
|
2103
|
-
className: `h-8 w-8 p-0 backdrop-blur-sm shadow-sm ${
|
|
2075
|
+
className: `h-8 w-8 p-0 backdrop-blur-sm shadow-sm ${G ? "bg-amber-50 dark:bg-amber-950/40 border-amber-300 dark:border-amber-700 hover:bg-amber-100 dark:hover:bg-amber-900/50 animate-pulse" : "bg-white/90 dark:bg-zinc-900/90 hover:bg-white dark:hover:bg-zinc-900"}`,
|
|
2104
2076
|
"data-testid": "debugger-props-button",
|
|
2105
|
-
children: /* @__PURE__ */ (0,
|
|
2077
|
+
children: /* @__PURE__ */ (0, K.jsx)(Ce, { className: `size-3.5 ${G ? "text-amber-500" : ""}` })
|
|
2106
2078
|
}),
|
|
2107
2079
|
nativeButton: !0
|
|
2108
2080
|
}),
|
|
2109
2081
|
nativeButton: !0
|
|
2110
|
-
}), /* @__PURE__ */ (0,
|
|
2082
|
+
}), /* @__PURE__ */ (0, K.jsxs)(o, { children: [
|
|
2111
2083
|
"Props:",
|
|
2112
2084
|
" ",
|
|
2113
|
-
X === Q ? "No Props" : X === $ ? "Tool Props" :
|
|
2114
|
-
] })] }), /* @__PURE__ */ (0,
|
|
2085
|
+
X === Q ? "No Props" : X === $ ? "Tool Props" : B.find((e) => e.id === X)?.name || "Custom"
|
|
2086
|
+
] })] }), /* @__PURE__ */ (0, K.jsxs)(m, {
|
|
2115
2087
|
className: "w-64 p-2",
|
|
2116
2088
|
"data-testid": "debugger-props-popover",
|
|
2117
|
-
children: [
|
|
2089
|
+
children: [G && /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
2118
2090
|
className: "mb-2 rounded-md border border-amber-200 dark:border-amber-800/50 bg-amber-50 dark:bg-amber-950/30 px-3 py-2",
|
|
2119
2091
|
children: [
|
|
2120
|
-
/* @__PURE__ */ (0,
|
|
2092
|
+
/* @__PURE__ */ (0, K.jsx)("p", {
|
|
2121
2093
|
className: "text-xs font-medium text-amber-700 dark:text-amber-300 mb-0.5",
|
|
2122
2094
|
children: "Props required to render this widget:"
|
|
2123
2095
|
}),
|
|
2124
|
-
/* @__PURE__ */ (0,
|
|
2096
|
+
/* @__PURE__ */ (0, K.jsx)("p", {
|
|
2125
2097
|
className: "text-xs font-mono text-amber-600 dark:text-amber-400",
|
|
2126
|
-
children:
|
|
2098
|
+
children: y.join(", ")
|
|
2127
2099
|
}),
|
|
2128
|
-
/* @__PURE__ */ (0,
|
|
2100
|
+
/* @__PURE__ */ (0, K.jsx)("p", {
|
|
2129
2101
|
className: "text-xs text-amber-500 dark:text-amber-400 mt-1",
|
|
2130
2102
|
children: "Create a preset below to set them."
|
|
2131
2103
|
})
|
|
2132
2104
|
]
|
|
2133
|
-
}), /* @__PURE__ */ (0,
|
|
2105
|
+
}), /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
2134
2106
|
className: "space-y-1",
|
|
2135
2107
|
children: [
|
|
2136
|
-
/* @__PURE__ */ (0,
|
|
2108
|
+
/* @__PURE__ */ (0, K.jsx)(d, {
|
|
2137
2109
|
variant: X === Q ? "secondary" : "ghost",
|
|
2138
2110
|
size: "sm",
|
|
2139
2111
|
className: "w-full justify-start",
|
|
2140
|
-
onClick: () =>
|
|
2112
|
+
onClick: () => $e(Q),
|
|
2141
2113
|
"data-testid": "debugger-props-no-props",
|
|
2142
2114
|
children: "No Props"
|
|
2143
2115
|
}),
|
|
2144
|
-
|
|
2116
|
+
B.map((e) => /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
2145
2117
|
className: "relative group flex items-center",
|
|
2146
|
-
children: [/* @__PURE__ */ (0,
|
|
2118
|
+
children: [/* @__PURE__ */ (0, K.jsx)(d, {
|
|
2147
2119
|
variant: X === e.id ? "secondary" : "ghost",
|
|
2148
2120
|
size: "sm",
|
|
2149
2121
|
className: "w-full justify-start pr-14",
|
|
2150
|
-
onClick: () =>
|
|
2122
|
+
onClick: () => $e(e.id),
|
|
2151
2123
|
"data-testid": `debugger-props-preset-${e.id}`,
|
|
2152
2124
|
children: e.name
|
|
2153
|
-
}), /* @__PURE__ */ (0,
|
|
2125
|
+
}), /* @__PURE__ */ (0, K.jsxs)("div", {
|
|
2154
2126
|
className: "absolute right-2 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
2155
|
-
children: [/* @__PURE__ */ (0,
|
|
2127
|
+
children: [/* @__PURE__ */ (0, K.jsx)(d, {
|
|
2156
2128
|
variant: "ghost",
|
|
2157
2129
|
size: "sm",
|
|
2158
2130
|
className: "h-6 w-6 p-0",
|
|
2159
|
-
onClick: (t) =>
|
|
2131
|
+
onClick: (t) => ot(e, t),
|
|
2160
2132
|
"data-testid": `debugger-props-edit-${e.id}`,
|
|
2161
|
-
children: /* @__PURE__ */ (0,
|
|
2162
|
-
}), /* @__PURE__ */ (0,
|
|
2133
|
+
children: /* @__PURE__ */ (0, K.jsx)(ee, { className: "h-3 w-3" })
|
|
2134
|
+
}), /* @__PURE__ */ (0, K.jsx)(d, {
|
|
2163
2135
|
variant: "ghost",
|
|
2164
2136
|
size: "sm",
|
|
2165
2137
|
className: "h-6 w-6 p-0",
|
|
2166
|
-
onClick: (t) =>
|
|
2138
|
+
onClick: (t) => at(e.id, t),
|
|
2167
2139
|
"data-testid": `debugger-props-delete-${e.id}`,
|
|
2168
|
-
children: /* @__PURE__ */ (0,
|
|
2140
|
+
children: /* @__PURE__ */ (0, K.jsx)(pe, { className: "h-3 w-3 text-destructive" })
|
|
2169
2141
|
})]
|
|
2170
2142
|
})]
|
|
2171
2143
|
}, e.id)),
|
|
2172
|
-
/* @__PURE__ */ (0,
|
|
2144
|
+
/* @__PURE__ */ (0, K.jsx)(d, {
|
|
2173
2145
|
variant: "ghost",
|
|
2174
2146
|
size: "sm",
|
|
2175
2147
|
className: "w-full justify-start text-primary",
|
|
2176
|
-
onClick: () =>
|
|
2148
|
+
onClick: () => $e(tt),
|
|
2177
2149
|
"data-testid": "debugger-props-create-preset",
|
|
2178
2150
|
children: "+ Create Preset..."
|
|
2179
2151
|
})
|
|
@@ -2181,30 +2153,22 @@ function at({ displayMode: e, onDisplayModeChange: t, toolCallId: n, propsContex
|
|
|
2181
2153
|
})]
|
|
2182
2154
|
})]
|
|
2183
2155
|
}),
|
|
2184
|
-
/* @__PURE__ */ (0,
|
|
2156
|
+
/* @__PURE__ */ (0, K.jsx)(We, {
|
|
2185
2157
|
iframeId: n,
|
|
2186
2158
|
enabled: !0
|
|
2187
2159
|
}),
|
|
2188
|
-
|
|
2189
|
-
open:
|
|
2190
|
-
onOpenChange:
|
|
2191
|
-
onSave:
|
|
2192
|
-
existingPresets:
|
|
2193
|
-
resource:
|
|
2194
|
-
resourceAnnotations:
|
|
2195
|
-
llmConfig:
|
|
2196
|
-
editingPreset:
|
|
2160
|
+
g && /* @__PURE__ */ (0, K.jsx)(Xe, {
|
|
2161
|
+
open: Pe,
|
|
2162
|
+
onOpenChange: W,
|
|
2163
|
+
onSave: it,
|
|
2164
|
+
existingPresets: B,
|
|
2165
|
+
resource: g,
|
|
2166
|
+
resourceAnnotations: u,
|
|
2167
|
+
llmConfig: p || null,
|
|
2168
|
+
editingPreset: q
|
|
2197
2169
|
})
|
|
2198
2170
|
]
|
|
2199
2171
|
});
|
|
2200
2172
|
}
|
|
2201
2173
|
//#endregion
|
|
2202
|
-
|
|
2203
|
-
function ot({ children: e, className: t, noWrapper: n }) {
|
|
2204
|
-
return n ? e : /* @__PURE__ */ (0, G.jsx)("div", {
|
|
2205
|
-
className: i("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]", t),
|
|
2206
|
-
children: e
|
|
2207
|
-
});
|
|
2208
|
-
}
|
|
2209
|
-
//#endregion
|
|
2210
|
-
export { at as n, Te as r, ot as t };
|
|
2174
|
+
export { we as n, it as t };
|