@mcp-use/inspector 20.0.0-beta.0 → 20.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/cdn/{AnimatePresence-B4HhIdgq.js → AnimatePresence-Dcw-FOy8.js} +50 -50
- package/dist/cdn/ChatTab-DBl6dHVH.js +6744 -0
- package/dist/cdn/{CheckboxIndicator-BF2cKfbA.js → CheckboxIndicator-Bt4IICtv.js} +77 -77
- package/dist/cdn/{ConnectionSettingsForm-iwNW86ZU.js → ConnectionSettingsForm-BFsZpwK4.js} +348 -292
- package/dist/cdn/ConnectionSettingsTab-DDk06dhT.js +150 -0
- package/dist/cdn/{ElicitationTab-upPXq2q7.js → ElicitationTab-CL1KJ0bz.js} +39 -39
- package/dist/cdn/{FormContext-Cl51-7O7.js → FormContext-tmgN_Vdr.js} +1 -1
- package/dist/cdn/{InspectorContext-DzXtgyTx.js → InspectorContext-UjtEbNod.js} +1 -21
- package/dist/cdn/{JSONDisplay-D3RcyO9z.js → JSONDisplay-BFxf5oEu.js} +18 -18
- package/dist/cdn/{ListTabHeader-8lULn-90.js → ListTabHeader-Cv-GmtGF.js} +19 -19
- package/dist/cdn/{ManufactOAuthCallback-DEM8mhWD.js → ManufactOAuthCallback-B98kSYCj.js} +1 -1
- package/dist/cdn/MarkdownRenderer-DQflNTGo.js +3610 -0
- package/dist/cdn/{NotificationsTab-CWopTIzT.js → NotificationsTab-CeImSrhx.js} +13 -13
- package/dist/cdn/{OAuthCallback-BxuOVgdb.js → OAuthCallback-C4n2hqKU.js} +1 -1
- package/dist/cdn/PromptsTab-C84YLTSM.js +901 -0
- package/dist/cdn/{ResourcesTab-BczUMFil.js → ResourcesTab-CCa5bIHE.js} +35 -55
- package/dist/cdn/{SamplingTab-6u5s845G.js → SamplingTab-Bt9z8yQ2.js} +35 -35
- package/dist/cdn/{ServerMetadataTab-DS0eiyyD.js → ServerMetadataTab-CvrKX8fz.js} +12 -12
- package/dist/cdn/{StatusIcon-BGXOEU2u.js → StatusIcon-D0-ARyOh.js} +6 -6
- package/dist/cdn/{ToolsTab-CUhwP4rZ.js → ToolsTab-v9zgWmM6.js} +103 -137
- package/dist/cdn/{ViewPreview-CxJc1Kht.js → ViewPreview-DsPwZAwO.js} +2 -2
- package/dist/cdn/{WidgetWrapper-BJJtLqMb.js → WidgetWrapper-CwlpDv17.js} +529 -530
- package/dist/cdn/card-DgiYnSg-.js +41 -0
- package/dist/cdn/{checkbox-B4oUG6Rr.js → checkbox-By0FklhG.js} +6 -6
- package/dist/cdn/{dialog-Dnl-pZsY.js → dialog-BsDpuJd3.js} +151 -151
- package/dist/cdn/{dist-mRDqCgKU.js → dist-B0eL32Gb.js} +114 -113
- package/dist/cdn/{dist-DjXr_YO3.js → dist-DaMB0Su9.js} +1 -1
- package/dist/cdn/{index-browser-CVUwR-Bu.js → index-browser-QDjRGsPo.js} +1 -1
- package/dist/cdn/{input-BLxOA7V-.js → input-C2OBd4PJ.js} +4787 -2842
- package/dist/cdn/inspector.css +1 -1
- package/dist/cdn/inspector.js +7424 -7443
- package/dist/cdn/{label-CBvG613A.js → label-B9Jmm9be.js} +10 -10
- package/dist/cdn/{manufact-auth-0TVxpeTA.js → manufact-auth-BQMHhbLV.js} +142 -106
- package/dist/cdn/{not-found-BcNNsTjS.js → not-found-DEtSM_Wd.js} +7 -7
- package/dist/cdn/providerMeta-BQIfHuNL.js +379 -0
- package/dist/cdn/{react-yUi9mVK4.js → react-Dn8PWXwP.js} +33 -27
- package/dist/cdn/{select-BZ_IoKxg.js → select-DDdiIPR2.js} +726 -726
- package/dist/cdn/{shared-uMiV6Fx1.js → shared-DaILIQPP.js} +29 -29
- package/dist/cdn/{popover-C_SSrXT0.js → sheet-Br_l2kry.js} +694 -622
- package/dist/cdn/{spinner-CWcJhIY_.js → spinner-jQtC7EBj.js} +5 -5
- package/dist/cdn/{switch-DtQOLb9R.js → switch-C3IyQuid.js} +104 -104
- package/dist/cdn/{tabs-subtle-C5cy35sY.js → tabs-subtle-CkdI6Mac.js} +147 -147
- package/dist/cdn/{telemetry-Ct6pVkM1.js → telemetry-DGoIGfIS.js} +3 -3
- package/dist/cdn/{textarea-Bj-CT7hC.js → textarea-DSbwcFVt.js} +6 -6
- package/dist/cdn/{useAriaLabelledBy-Bm9qHGK6.js → useAriaLabelledBy-DqAdnppm.js} +1 -1
- package/dist/cdn/{useCompositeItem-CNJ6MXdi.js → useCompositeItem-BRqEzYh-.js} +2 -2
- package/dist/cdn/{useConfig-CwxZ6Quj.js → useConfig-CTb6GZbt.js} +73 -46
- package/dist/cdn/{useViewHostProps-C7vjco2m.js → useViewHostProps-DIIlz3tJ.js} +1 -1
- package/dist/cli.js +141 -25
- package/dist/client/auth/manufact-auth.d.ts +3 -1
- package/dist/client/auth/manufact-auth.d.ts.map +1 -1
- package/dist/client/components/ChatTab.d.ts +1 -8
- package/dist/client/components/ChatTab.d.ts.map +1 -1
- package/dist/client/components/ResourcesTab.d.ts.map +1 -1
- package/dist/client/components/chat/ChatHeader.d.ts +7 -2
- package/dist/client/components/chat/ChatHeader.d.ts.map +1 -1
- package/dist/client/components/chat/ChatLandingForm.d.ts +4 -2
- package/dist/client/components/chat/ChatLandingForm.d.ts.map +1 -1
- package/dist/client/components/chat/ChatManagedNotice.d.ts +10 -0
- package/dist/client/components/chat/ChatManagedNotice.d.ts.map +1 -0
- package/dist/client/components/chat/ChatScrollTopFade.d.ts +7 -0
- package/dist/client/components/chat/ChatScrollTopFade.d.ts.map +1 -0
- package/dist/client/components/chat/ConfigurationDialog.d.ts +11 -9
- package/dist/client/components/chat/ConfigurationDialog.d.ts.map +1 -1
- package/dist/client/components/chat/ConfigureEmptyState.d.ts +1 -6
- package/dist/client/components/chat/ConfigureEmptyState.d.ts.map +1 -1
- package/dist/client/components/chat/StreamingAssistantContent.d.ts.map +1 -1
- package/dist/client/components/chat/chatModeStorage.d.ts +11 -0
- package/dist/client/components/chat/chatModeStorage.d.ts.map +1 -0
- package/dist/client/components/chat/managedChatNotice.d.ts +16 -0
- package/dist/client/components/chat/managedChatNotice.d.ts.map +1 -0
- package/dist/client/components/chat/providerMeta.d.ts +11 -0
- package/dist/client/components/chat/providerMeta.d.ts.map +1 -1
- package/dist/client/components/chat/useChatMessages.d.ts +7 -5
- package/dist/client/components/chat/useChatMessages.d.ts.map +1 -1
- package/dist/client/components/chat/useChatMessagesClientSide.d.ts +4 -6
- package/dist/client/components/chat/useChatMessagesClientSide.d.ts.map +1 -1
- package/dist/client/components/chat/useChatScrollToBottom.d.ts +1 -0
- package/dist/client/components/chat/useChatScrollToBottom.d.ts.map +1 -1
- package/dist/client/components/chat/useConfig.d.ts +1 -1
- package/dist/client/components/chat/useConfig.d.ts.map +1 -1
- package/dist/client/components/chat/useHostedChatMode.d.ts +1 -1
- package/dist/client/components/chat/useHostedChatMode.d.ts.map +1 -1
- package/dist/client/components/shared/MarkdownRenderer.d.ts +2 -1
- package/dist/client/components/shared/MarkdownRenderer.d.ts.map +1 -1
- package/dist/client/components/tools/useToolsTabNavigation.d.ts.map +1 -1
- package/dist/client/components/ui/MeshGradientCanvas.d.ts +13 -0
- package/dist/client/components/ui/MeshGradientCanvas.d.ts.map +1 -0
- package/dist/client/components/ui/chat-message.d.ts +1 -1
- package/dist/client/components/ui/chat-message.d.ts.map +1 -1
- package/dist/client/components/ui/file-thumbnail.d.ts.map +1 -1
- package/dist/client/components/ui/mesh-tab-background.d.ts +3 -1
- package/dist/client/components/ui/mesh-tab-background.d.ts.map +1 -1
- package/dist/client/context/InspectorContext.d.ts.map +1 -1
- package/dist/client/index.js +2577 -2165
- package/dist/client/telemetry/utils.d.ts.map +1 -1
- package/dist/server/asset-urls.d.ts +18 -0
- package/dist/server/asset-urls.d.ts.map +1 -0
- package/dist/server/asset-urls.js +17 -0
- package/dist/server/cdn-shell.d.ts +3 -3
- package/dist/server/cdn-shell.d.ts.map +1 -1
- package/dist/server/cdn-shell.js +5 -3
- package/dist/server/chunk-H6ZCIKBS.js +63 -0
- package/dist/server/{chunk-ESODOPDD.js → chunk-J4FNYLBF.js} +4 -0
- package/dist/server/{chunk-TPHRVELX.js → chunk-K2DPKTIS.js} +27 -9
- package/dist/server/{chunk-THQ67TSE.js → chunk-LIM6NAUS.js} +2 -9
- package/dist/server/chunk-M5TZA42I.js +54 -0
- package/dist/server/{chunk-K2V2SDQD.js → chunk-OWR2BIBW.js} +1 -1
- package/dist/server/{chunk-J67FVPHF.js → chunk-R6RQMIXL.js} +2 -2
- package/dist/server/{chunk-5B3SXGZP.js → chunk-UJLXHNQP.js} +1 -1
- package/dist/server/{chunk-6XWDZEFF.js → chunk-XCNS5CIW.js} +8 -3
- package/dist/server/cli.js +8 -6
- package/dist/server/create-dev-api-app.js +3 -3
- package/dist/server/dev-callback-redirect.d.ts +3 -0
- package/dist/server/dev-callback-redirect.d.ts.map +1 -0
- package/dist/server/dev-callback-redirect.js +18 -0
- package/dist/server/favicon-static.d.ts.map +1 -1
- package/dist/server/favicon-static.js +1 -1
- package/dist/server/index.js +9 -7
- package/dist/server/middleware.js +9 -7
- package/dist/server/proxy/index.js +1 -1
- package/dist/server/proxy/mcp-proxy.d.ts +2 -0
- package/dist/server/proxy/mcp-proxy.d.ts.map +1 -1
- package/dist/server/proxy/mcp-proxy.js +3 -1
- package/dist/server/proxy-routes.js +2 -2
- package/dist/server/server.js +3 -3
- package/dist/server/static-assets.d.ts +5 -0
- package/dist/server/static-assets.d.ts.map +1 -0
- package/dist/server/static-assets.js +9 -0
- package/dist/server/version.js +1 -1
- package/dist/server/vite-dev-api-plugin.js +3 -3
- package/dist/web/assets/{AnimatePresence-CthXziG2.js → AnimatePresence-C5p0yiY1.js} +2 -2
- package/dist/web/assets/ChatTab-C2FtENBM.js +18 -0
- package/dist/web/assets/ConnectionSettingsTab-B2sUjytG.js +1 -0
- package/dist/web/assets/ElicitationTab-DwH08kDC.js +1 -0
- package/dist/web/assets/{FormContext-Cqc_A12u.js → FormContext-DH2caWKO.js} +1 -1
- package/dist/web/assets/ListTabHeader-R17w_JsB.js +1 -0
- package/dist/web/assets/{ManufactOAuthCallback-B-tdkUA2.js → ManufactOAuthCallback-Btu4B6u6.js} +1 -1
- package/dist/web/assets/MarkdownRenderer-DpIEt9wb.js +47 -0
- package/dist/web/assets/{NotificationsTab-BgLjxuos.js → NotificationsTab-CHB8mtSz.js} +1 -1
- package/dist/web/assets/{OAuthCallback-Bp-jLoQs.js → OAuthCallback-DV4MgX4Z.js} +1 -1
- package/dist/web/assets/PromptsTab-0GIapoSs.js +15 -0
- package/dist/web/assets/ResourcesTab-N9xjsI_b.js +2 -0
- package/dist/web/assets/SamplingTab-Dw0vpi4t.js +1 -0
- package/dist/web/assets/ServerMetadataTab-D-eQpLBF.js +1 -0
- package/dist/web/assets/ToolsTab-BMrMJ5JV.js +8 -0
- package/dist/web/assets/ViewPreview-N_cpEO0W.js +1 -0
- package/dist/web/assets/WidgetWrapper-pDgNVq9y.js +34 -0
- package/dist/web/assets/checkbox-CrnXSMh2.js +1 -0
- package/dist/web/assets/dist-CeWSydFI.js +21 -0
- package/dist/web/assets/index-Cfuv_gb3.js +475 -0
- package/dist/web/assets/index-fBX3akc8.css +1 -0
- package/dist/web/assets/input-CLYhA7PK.js +1 -0
- package/dist/web/assets/{label-B5Q_Zr8M.js → label-Cdim77Jw.js} +1 -1
- package/dist/web/assets/select-CJ57-Bor.js +1 -0
- package/dist/web/assets/shared-B1GD9FMm.js +1 -0
- package/dist/web/assets/{tabs-subtle-Dxgism9f.js → tabs-subtle-CG5cjC_N.js} +1 -1
- package/dist/web/assets/textarea-DLAmNVf_.js +1 -0
- package/dist/web/assets/useConfig-BTp15Lle.js +1 -0
- package/dist/web/assets/{useViewHostProps-BgsQ2yYl.js → useViewHostProps-BQlaFC2Q.js} +1 -1
- package/dist/web/index.html +8 -9
- package/package.json +5 -12
- package/dist/cdn/ChatTab-5ya_YTFV.js +0 -13218
- package/dist/cdn/ConnectionSettingsTab-CeK83dxn.js +0 -145
- package/dist/cdn/PromptsTab-Cspfnl6n.js +0 -4400
- package/dist/cdn/bundle-mjs-B0nmHDtp.js +0 -1953
- package/dist/cdn/card-DqjqAq0o.js +0 -41
- package/dist/cdn/chunk-BO2N2NFS-Cy167e0X.js +0 -17500
- package/dist/cdn/highlighted-body-OFNGDK62-CoReNbTX.js +0 -36
- package/dist/cdn/mermaid-GHXKKRXX-DgVIbk-D.js +0 -2
- package/dist/cdn/pdf-CxFT9FER.js +0 -16291
- package/dist/cdn/sheet-CerCdhxz.js +0 -78
- package/dist/cdn/useHostedSession-BA39Aegc.js +0 -153
- package/dist/cdn/useMCPPrompts-D3_Hla_z.js +0 -104
- package/dist/client/components/chat/streamdown-code-slim.d.ts +0 -4
- package/dist/client/components/chat/streamdown-code-slim.d.ts.map +0 -1
- package/dist/web/assets/ChatTab-CiAqtqhj.js +0 -460
- package/dist/web/assets/ConnectionSettingsTab-CTh6MFKE.js +0 -1
- package/dist/web/assets/ElicitationTab-B3Eg0_Jm.js +0 -1
- package/dist/web/assets/ListTabHeader-G-nQX18m.js +0 -1
- package/dist/web/assets/PromptsTab-CA-SZs43.js +0 -61
- package/dist/web/assets/ResourcesTab-DdMIW_af.js +0 -2
- package/dist/web/assets/SamplingTab-DjyDG01W.js +0 -1
- package/dist/web/assets/ServerMetadataTab-Q4PlqP_B.js +0 -1
- package/dist/web/assets/ToolsTab-BHk8GCmd.js +0 -8
- package/dist/web/assets/ViewPreview-DWtmwzCb.js +0 -1
- package/dist/web/assets/WidgetWrapper-B43lqbld.js +0 -34
- package/dist/web/assets/bundle-mjs-8puS6ou7.js +0 -1
- package/dist/web/assets/checkbox-_GzEPQic.js +0 -1
- package/dist/web/assets/chunk-BO2N2NFS-BdIeB5Lr.js +0 -131
- package/dist/web/assets/dist-DQjEDTKs.js +0 -21
- package/dist/web/assets/highlighted-body-OFNGDK62-Dp3e1QHL.js +0 -1
- package/dist/web/assets/index-Bbn-6QR2.js +0 -475
- package/dist/web/assets/index-BjH-Qp85.css +0 -1
- package/dist/web/assets/input-CjmxOFr6.js +0 -1
- package/dist/web/assets/mermaid-GHXKKRXX-yq1lkD3x.js +0 -1
- package/dist/web/assets/pdf-C3cfS_Ha.js +0 -54
- package/dist/web/assets/select-C0xlfLAa.js +0 -1
- package/dist/web/assets/shared-Dfwy7nyg.js +0 -1
- package/dist/web/assets/sheet-CRPrEqAa.js +0 -1
- package/dist/web/assets/textarea-Ci09-en6.js +0 -1
- package/dist/web/assets/useConfig-b1f_iVFH.js +0 -1
- package/dist/web/assets/useMCPPrompts-CPskz9af.js +0 -1
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
import { s as e, t } from "./react-BIs9pQ3H.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import { a as
|
|
7
|
-
import { t as
|
|
8
|
-
import { A 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 {
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
var Te = w("braces", [["path", {
|
|
2
|
+
import { G as n, K as r, Rr as i, a, n as o, r as s, sr as c, t as l } from "./input-C2OBd4PJ.js";
|
|
3
|
+
import { t as u } from "./jsx-runtime-CIxvMpEo.js";
|
|
4
|
+
import { _ as d, a as f, c as p, d as m, i as h, l as g, n as _, o as v, s as y, t as b, u as x, v as S } from "./sheet-Br_l2kry.js";
|
|
5
|
+
import { t as C } from "./label-B9Jmm9be.js";
|
|
6
|
+
import { a as w, i as T, n as E, r as D, t as O } from "./select-DDdiIPR2.js";
|
|
7
|
+
import { t as k } from "./createLucideIcon-C5fZZ6oB.js";
|
|
8
|
+
import { A, E as j, S as M, T as N, a as P, b as F, c as ee, i as I, l as te, n as ne, o as re, r as ie, s as ae, t as oe, w as L } from "./dialog-BsDpuJd3.js";
|
|
9
|
+
import { i as se, t as ce } from "./browser-CbQIH4w2.js";
|
|
10
|
+
import { t as le } from "./clock-CmUbSx_B.js";
|
|
11
|
+
import { t as ue } from "./JSONDisplay-BFxf5oEu.js";
|
|
12
|
+
import { t as de } from "./loader-circle-BLy9A_pp.js";
|
|
13
|
+
import { t as fe } from "./maximize-2-CH5Lq90B.js";
|
|
14
|
+
import { t as pe } from "./sparkles-BntO2rDR.js";
|
|
15
|
+
import { t as me } from "./trash-2-RwpJY5SL.js";
|
|
16
|
+
import { t as he } from "./x-C3vRQIYu.js";
|
|
17
|
+
import { t as ge } from "./switch-C3IyQuid.js";
|
|
18
|
+
import { n as R } from "./dist-DaMB0Su9.js";
|
|
19
|
+
import { r as _e, s as ve } from "./WidgetDebugContext-D4usL_MA.js";
|
|
20
|
+
import { a as z } from "./dist-B0eL32Gb.js";
|
|
21
|
+
import { t as B } from "./textarea-DSbwcFVt.js";
|
|
22
|
+
import { a as ye, i as be, n as xe, o as Se, r as Ce } from "./useViewHostProps-DIIlz3tJ.js";
|
|
23
|
+
var we = k("braces", [["path", {
|
|
25
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",
|
|
26
25
|
key: "ezmyqa"
|
|
27
26
|
}], ["path", {
|
|
28
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",
|
|
29
28
|
key: "e1hn23"
|
|
30
|
-
}]]),
|
|
29
|
+
}]]), Te = k("database", [
|
|
31
30
|
["ellipse", {
|
|
32
31
|
cx: "12",
|
|
33
32
|
cy: "5",
|
|
@@ -43,10 +42,10 @@ var Te = w("braces", [["path", {
|
|
|
43
42
|
d: "M3 12A9 3 0 0 0 21 12",
|
|
44
43
|
key: "mv7ke4"
|
|
45
44
|
}]
|
|
46
|
-
]),
|
|
45
|
+
]), Ee = k("mouse-pointer-2", [["path", {
|
|
47
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",
|
|
48
47
|
key: "edeuup"
|
|
49
|
-
}]]),
|
|
48
|
+
}]]), De = k("picture-in-picture", [
|
|
50
49
|
["path", {
|
|
51
50
|
d: "M2 10h6V4",
|
|
52
51
|
key: "zwrco"
|
|
@@ -71,7 +70,7 @@ var Te = w("braces", [["path", {
|
|
|
71
70
|
rx: "1",
|
|
72
71
|
key: "1wjs3o"
|
|
73
72
|
}]
|
|
74
|
-
]),
|
|
73
|
+
]), Oe = k("pointer", [
|
|
75
74
|
["path", {
|
|
76
75
|
d: "M22 14a8 8 0 0 1-8 8",
|
|
77
76
|
key: "56vcr3"
|
|
@@ -92,13 +91,13 @@ var Te = w("braces", [["path", {
|
|
|
92
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",
|
|
93
92
|
key: "g6ys72"
|
|
94
93
|
}]
|
|
95
|
-
]),
|
|
94
|
+
]), ke = k("shield-check", [["path", {
|
|
96
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",
|
|
97
96
|
key: "oel41y"
|
|
98
97
|
}], ["path", {
|
|
99
98
|
d: "m9 12 2 2 4-4",
|
|
100
99
|
key: "dzmm74"
|
|
101
|
-
}]]),
|
|
100
|
+
}]]), Ae = k("shield-off", [
|
|
102
101
|
["path", {
|
|
103
102
|
d: "m2 2 20 20",
|
|
104
103
|
key: "1ooewy"
|
|
@@ -111,7 +110,7 @@ var Te = w("braces", [["path", {
|
|
|
111
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",
|
|
112
111
|
key: "18rp1v"
|
|
113
112
|
}]
|
|
114
|
-
]),
|
|
113
|
+
]), je = k("smartphone", [["rect", {
|
|
115
114
|
width: "14",
|
|
116
115
|
height: "20",
|
|
117
116
|
x: "5",
|
|
@@ -122,7 +121,7 @@ var Te = w("braces", [["path", {
|
|
|
122
121
|
}], ["path", {
|
|
123
122
|
d: "M12 18h.01",
|
|
124
123
|
key: "mhygvu"
|
|
125
|
-
}]]),
|
|
124
|
+
}]]), Me = k("square-dashed-mouse-pointer", [
|
|
126
125
|
["path", {
|
|
127
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",
|
|
128
127
|
key: "xwnzip"
|
|
@@ -163,7 +162,7 @@ var Te = w("braces", [["path", {
|
|
|
163
162
|
d: "M3 14v1",
|
|
164
163
|
key: "vnatye"
|
|
165
164
|
}]
|
|
166
|
-
]),
|
|
165
|
+
]), Ne = k("tablet", [["rect", {
|
|
167
166
|
width: "16",
|
|
168
167
|
height: "20",
|
|
169
168
|
x: "4",
|
|
@@ -177,13 +176,13 @@ var Te = w("braces", [["path", {
|
|
|
177
176
|
y1: "18",
|
|
178
177
|
y2: "18",
|
|
179
178
|
key: "1dp563"
|
|
180
|
-
}]]),
|
|
179
|
+
}]]), V = k("terminal", [["path", {
|
|
181
180
|
d: "M12 19h8",
|
|
182
181
|
key: "baeox8"
|
|
183
182
|
}], ["path", {
|
|
184
183
|
d: "m4 17 6-6-6-6",
|
|
185
184
|
key: "1yngyt"
|
|
186
|
-
}]]),
|
|
185
|
+
}]]), Pe = k("trash", [
|
|
187
186
|
["path", {
|
|
188
187
|
d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",
|
|
189
188
|
key: "miytrc"
|
|
@@ -196,7 +195,7 @@ var Te = w("braces", [["path", {
|
|
|
196
195
|
d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",
|
|
197
196
|
key: "e791ji"
|
|
198
197
|
}]
|
|
199
|
-
]),
|
|
198
|
+
]), H = /* @__PURE__ */ e(t(), 1), Fe = [
|
|
200
199
|
{
|
|
201
200
|
value: "en-US",
|
|
202
201
|
label: "English (US)"
|
|
@@ -434,19 +433,19 @@ var Te = w("braces", [["path", {
|
|
|
434
433
|
label: "Swahili (Kenya)"
|
|
435
434
|
}
|
|
436
435
|
];
|
|
437
|
-
function
|
|
436
|
+
function Ie() {
|
|
438
437
|
return Intl.supportedValuesOf("timeZone").map((e) => ({
|
|
439
438
|
value: e,
|
|
440
439
|
label: e.replace(/_/g, " ")
|
|
441
440
|
}));
|
|
442
441
|
}
|
|
443
|
-
var
|
|
444
|
-
function
|
|
445
|
-
let [t, n] = (0,
|
|
446
|
-
return (0,
|
|
442
|
+
var Le = Ie(), U = (e) => `mcp-inspector-resource-props-${e}`;
|
|
443
|
+
function Re(e) {
|
|
444
|
+
let [t, n] = (0, H.useState)([]), [r, i] = (0, H.useState)(null);
|
|
445
|
+
return (0, H.useEffect)(() => {
|
|
447
446
|
(() => {
|
|
448
447
|
try {
|
|
449
|
-
let t =
|
|
448
|
+
let t = U(e), r = localStorage.getItem(t);
|
|
450
449
|
if (r) {
|
|
451
450
|
let e = JSON.parse(r);
|
|
452
451
|
n(e.presets || []), i(e.activePresetId || null);
|
|
@@ -455,8 +454,8 @@ function ze(e) {
|
|
|
455
454
|
console.error("[useResourceProps] Failed to load presets:", e), n([]), i(null);
|
|
456
455
|
}
|
|
457
456
|
})();
|
|
458
|
-
}, [e]), (0,
|
|
459
|
-
let n =
|
|
457
|
+
}, [e]), (0, H.useEffect)(() => {
|
|
458
|
+
let n = U(e), i = {
|
|
460
459
|
presets: t,
|
|
461
460
|
activePresetId: r
|
|
462
461
|
};
|
|
@@ -468,25 +467,25 @@ function ze(e) {
|
|
|
468
467
|
]), {
|
|
469
468
|
presets: t,
|
|
470
469
|
activePresetId: r,
|
|
471
|
-
savePreset: (0,
|
|
470
|
+
savePreset: (0, H.useCallback)((e) => {
|
|
472
471
|
n((t) => {
|
|
473
472
|
let n = t.findIndex((t) => t.id === e.id), r;
|
|
474
473
|
return n >= 0 ? (r = [...t], r[n] = e) : r = [...t, e], r;
|
|
475
474
|
});
|
|
476
475
|
}, []),
|
|
477
|
-
deletePreset: (0,
|
|
476
|
+
deletePreset: (0, H.useCallback)((e) => {
|
|
478
477
|
n((t) => t.filter((t) => t.id !== e)), i((t) => t === e ? null : t);
|
|
479
478
|
}, []),
|
|
480
|
-
setActivePreset: (0,
|
|
479
|
+
setActivePreset: (0, H.useCallback)((e) => {
|
|
481
480
|
i(e);
|
|
482
481
|
}, []),
|
|
483
|
-
getActiveProps: (0,
|
|
482
|
+
getActiveProps: (0, H.useCallback)(() => r && t.find((e) => e.id === r)?.props || null, [r, t])
|
|
484
483
|
};
|
|
485
484
|
}
|
|
486
485
|
//#endregion
|
|
487
486
|
//#region src/client/hooks/useIframeConsole.ts
|
|
488
|
-
function
|
|
489
|
-
let { enabled: t = !0, maxLogs: n = 1e3, proxyToPageConsole: r = !1 } = e, [i, a] = (0,
|
|
487
|
+
function W(e = {}) {
|
|
488
|
+
let { enabled: t = !0, maxLogs: n = 1e3, proxyToPageConsole: r = !1 } = e, [i, a] = (0, H.useState)([]), [o, s] = (0, H.useState)(!1), c = (0, H.useRef)(0), l = (0, H.useCallback)((e) => {
|
|
490
489
|
if (!t) return;
|
|
491
490
|
let i = {
|
|
492
491
|
...e,
|
|
@@ -524,10 +523,10 @@ function U(e = {}) {
|
|
|
524
523
|
t,
|
|
525
524
|
n,
|
|
526
525
|
r
|
|
527
|
-
]), u = (0,
|
|
526
|
+
]), u = (0, H.useCallback)(() => {
|
|
528
527
|
a([]), c.current = 0;
|
|
529
528
|
}, []);
|
|
530
|
-
return (0,
|
|
529
|
+
return (0, H.useEffect)(() => {
|
|
531
530
|
if (!t) return;
|
|
532
531
|
let e = (e) => {
|
|
533
532
|
e.data && e.data.type === "iframe-console-log" && e.data.level && Array.isArray(e.data.args) && l({
|
|
@@ -540,8 +539,8 @@ function U(e = {}) {
|
|
|
540
539
|
return window.addEventListener("message", e), () => {
|
|
541
540
|
window.removeEventListener("message", e);
|
|
542
541
|
};
|
|
543
|
-
}, [t, l]), (0,
|
|
544
|
-
if (t) return
|
|
542
|
+
}, [t, l]), (0, H.useEffect)(() => {
|
|
543
|
+
if (t) return Se.subscribe(l);
|
|
545
544
|
}, [t, l]), {
|
|
546
545
|
logs: i,
|
|
547
546
|
addLog: l,
|
|
@@ -552,8 +551,8 @@ function U(e = {}) {
|
|
|
552
551
|
}
|
|
553
552
|
//#endregion
|
|
554
553
|
//#region src/client/components/IframeConsole.tsx
|
|
555
|
-
var
|
|
556
|
-
function
|
|
554
|
+
var G = u(), ze = 200, Be = .9;
|
|
555
|
+
function K(e) {
|
|
557
556
|
if (e === null) return "null";
|
|
558
557
|
if (e === void 0) return "undefined";
|
|
559
558
|
if (typeof e == "string") return e;
|
|
@@ -564,10 +563,10 @@ function G(e) {
|
|
|
564
563
|
}
|
|
565
564
|
return String(e);
|
|
566
565
|
}
|
|
567
|
-
function
|
|
566
|
+
function q(e) {
|
|
568
567
|
if (e.length === 0) return [];
|
|
569
568
|
let t = e[0];
|
|
570
|
-
if (typeof t != "string" || !/%[oOdisfc]/.test(t)) return e.map(
|
|
569
|
+
if (typeof t != "string" || !/%[oOdisfc]/.test(t)) return e.map(K);
|
|
571
570
|
let n = e.slice(1), r = 0, i = "";
|
|
572
571
|
for (let e = 0; e < t.length; e++) {
|
|
573
572
|
let a = t[e];
|
|
@@ -576,7 +575,7 @@ function K(e) {
|
|
|
576
575
|
switch (o) {
|
|
577
576
|
case "o":
|
|
578
577
|
case "O":
|
|
579
|
-
i +=
|
|
578
|
+
i += K(s), e++;
|
|
580
579
|
break;
|
|
581
580
|
case "s":
|
|
582
581
|
i += s === void 0 ? "undefined" : String(s), e++;
|
|
@@ -598,12 +597,12 @@ function K(e) {
|
|
|
598
597
|
i += a;
|
|
599
598
|
}
|
|
600
599
|
let a = [i.trim()];
|
|
601
|
-
for (; r < n.length;) a.push(
|
|
600
|
+
for (; r < n.length;) a.push(K(n[r++]));
|
|
602
601
|
return a.filter((e) => e.length > 0);
|
|
603
602
|
}
|
|
604
|
-
function
|
|
605
|
-
return /* @__PURE__ */ (0,
|
|
606
|
-
className:
|
|
603
|
+
function Ve({ level: e }) {
|
|
604
|
+
return /* @__PURE__ */ (0, G.jsx)("span", {
|
|
605
|
+
className: i("px-1.5 py-0.5 text-[11px] font-mono font-semibold rounded-full text-white shrink-0", {
|
|
607
606
|
log: "bg-zinc-500",
|
|
608
607
|
info: "bg-blue-500",
|
|
609
608
|
warn: "bg-yellow-500",
|
|
@@ -614,45 +613,45 @@ function He({ level: e }) {
|
|
|
614
613
|
children: e.toUpperCase()
|
|
615
614
|
});
|
|
616
615
|
}
|
|
617
|
-
function
|
|
618
|
-
let [t, n] = (0,
|
|
616
|
+
function He({ log: e }) {
|
|
617
|
+
let [t, n] = (0, H.useState)(!1), a = (0, H.useMemo)(() => {
|
|
619
618
|
try {
|
|
620
619
|
return new Date(e.timestamp).toLocaleTimeString();
|
|
621
620
|
} catch {
|
|
622
621
|
return "";
|
|
623
622
|
}
|
|
624
|
-
}, [e.timestamp]), o = (0,
|
|
623
|
+
}, [e.timestamp]), o = (0, H.useMemo)(() => q(e.args), [e.args]), s = (0, H.useMemo)(() => {
|
|
625
624
|
if (o.length === 0) return "";
|
|
626
625
|
let e = o[0].replace(/\s*\n\s*/g, " ").trim();
|
|
627
626
|
return (e.length > 120 ? e.slice(0, 120) + "…" : e) + (o.length > 1 ? ` +${o.length - 1}` : "");
|
|
628
627
|
}, [o]), c = async (e) => {
|
|
629
628
|
e.stopPropagation();
|
|
630
629
|
try {
|
|
631
|
-
await
|
|
630
|
+
await ce(o.join("\n")), R.success("Copied to clipboard");
|
|
632
631
|
} catch {
|
|
633
|
-
|
|
632
|
+
R.error("Failed to copy");
|
|
634
633
|
}
|
|
635
|
-
}, l =
|
|
636
|
-
return /* @__PURE__ */ (0,
|
|
637
|
-
className:
|
|
638
|
-
children: [/* @__PURE__ */ (0,
|
|
639
|
-
className:
|
|
634
|
+
}, l = i("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"), u = i("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");
|
|
635
|
+
return /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
636
|
+
className: i(l, "group"),
|
|
637
|
+
children: [/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
638
|
+
className: i("flex items-center gap-2 px-2 py-1.5", u),
|
|
640
639
|
onClick: () => n((e) => !e),
|
|
641
640
|
children: [
|
|
642
|
-
/* @__PURE__ */ (0,
|
|
641
|
+
/* @__PURE__ */ (0, G.jsx)("span", {
|
|
643
642
|
className: "text-zinc-400 dark:text-zinc-500 shrink-0",
|
|
644
|
-
children: t ? /* @__PURE__ */ (0,
|
|
643
|
+
children: t ? /* @__PURE__ */ (0, G.jsx)(A, { className: "size-3" }) : /* @__PURE__ */ (0, G.jsx)(r, { className: "size-3" })
|
|
645
644
|
}),
|
|
646
|
-
/* @__PURE__ */ (0,
|
|
647
|
-
/* @__PURE__ */ (0,
|
|
645
|
+
/* @__PURE__ */ (0, G.jsx)(Ve, { level: e.level }),
|
|
646
|
+
/* @__PURE__ */ (0, G.jsx)("span", {
|
|
648
647
|
className: "text-zinc-500 dark:text-zinc-400 text-[10px] shrink-0",
|
|
649
|
-
children:
|
|
648
|
+
children: a
|
|
650
649
|
}),
|
|
651
|
-
!t && /* @__PURE__ */ (0,
|
|
652
|
-
className:
|
|
650
|
+
!t && /* @__PURE__ */ (0, G.jsx)("span", {
|
|
651
|
+
className: i("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"),
|
|
653
652
|
children: s
|
|
654
653
|
}),
|
|
655
|
-
t && e.url && /* @__PURE__ */ (0,
|
|
654
|
+
t && e.url && /* @__PURE__ */ (0, G.jsx)("span", {
|
|
656
655
|
className: "text-zinc-400 dark:text-zinc-500 text-[10px] truncate flex-1",
|
|
657
656
|
children: (() => {
|
|
658
657
|
try {
|
|
@@ -662,30 +661,30 @@ function Ue({ log: e }) {
|
|
|
662
661
|
}
|
|
663
662
|
})()
|
|
664
663
|
}),
|
|
665
|
-
t && /* @__PURE__ */ (0,
|
|
664
|
+
t && /* @__PURE__ */ (0, G.jsx)("button", {
|
|
666
665
|
onClick: c,
|
|
667
666
|
"aria-label": "Copy log",
|
|
668
667
|
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",
|
|
669
|
-
children: /* @__PURE__ */ (0,
|
|
668
|
+
children: /* @__PURE__ */ (0, G.jsx)(se, { className: "size-3" })
|
|
670
669
|
})
|
|
671
670
|
]
|
|
672
|
-
}), t && /* @__PURE__ */ (0,
|
|
671
|
+
}), t && /* @__PURE__ */ (0, G.jsx)("div", {
|
|
673
672
|
className: "pl-8 pr-2 pb-2 select-text",
|
|
674
|
-
children: o.map((t, n) => /* @__PURE__ */ (0,
|
|
675
|
-
className:
|
|
673
|
+
children: o.map((t, n) => /* @__PURE__ */ (0, G.jsx)("pre", {
|
|
674
|
+
className: i("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"),
|
|
676
675
|
children: t
|
|
677
676
|
}, n))
|
|
678
677
|
})]
|
|
679
678
|
});
|
|
680
679
|
}
|
|
681
|
-
var
|
|
680
|
+
var J = "mcp-inspector-console-proxy-enabled", Ue = "mcp-inspector-console-height", We = [
|
|
682
681
|
"log",
|
|
683
682
|
"info",
|
|
684
683
|
"warn",
|
|
685
684
|
"error",
|
|
686
685
|
"debug",
|
|
687
686
|
"trace"
|
|
688
|
-
],
|
|
687
|
+
], Ge = {
|
|
689
688
|
log: "text-zinc-500",
|
|
690
689
|
info: "text-blue-500",
|
|
691
690
|
warn: "text-yellow-500",
|
|
@@ -693,48 +692,48 @@ var q = "mcp-inspector-console-proxy-enabled", We = "mcp-inspector-console-heigh
|
|
|
693
692
|
debug: "text-purple-500",
|
|
694
693
|
trace: "text-gray-500"
|
|
695
694
|
};
|
|
696
|
-
function
|
|
697
|
-
let [
|
|
695
|
+
function Ke({ iframeId: e, enabled: t = !0 }) {
|
|
696
|
+
let [r, l] = (0, H.useState)(() => {
|
|
698
697
|
if (typeof window > "u") return !0;
|
|
699
698
|
try {
|
|
700
|
-
return localStorage.getItem(
|
|
699
|
+
return localStorage.getItem(J) === "true";
|
|
701
700
|
} catch {
|
|
702
701
|
return !0;
|
|
703
702
|
}
|
|
704
|
-
}), [u, d] = (0,
|
|
703
|
+
}), [u, d] = (0, H.useState)(() => {
|
|
705
704
|
if (typeof window > "u") return 400;
|
|
706
705
|
try {
|
|
707
|
-
let e = localStorage.getItem(
|
|
708
|
-
return e ? Math.max(
|
|
706
|
+
let e = localStorage.getItem(Ue);
|
|
707
|
+
return e ? Math.max(ze, parseInt(e, 10)) : 400;
|
|
709
708
|
} catch {
|
|
710
709
|
return 400;
|
|
711
710
|
}
|
|
712
|
-
}),
|
|
713
|
-
e.preventDefault(),
|
|
711
|
+
}), p = (0, H.useRef)(!1), m = (0, H.useCallback)((e) => {
|
|
712
|
+
e.preventDefault(), p.current = !0;
|
|
714
713
|
let t = (e) => {
|
|
715
|
-
if (!
|
|
716
|
-
let t = Math.floor(window.innerHeight *
|
|
717
|
-
d(Math.min(t, Math.max(
|
|
714
|
+
if (!p.current) return;
|
|
715
|
+
let t = Math.floor(window.innerHeight * Be);
|
|
716
|
+
d(Math.min(t, Math.max(ze, window.innerHeight - e.clientY)));
|
|
718
717
|
}, n = () => {
|
|
719
|
-
|
|
718
|
+
p.current = !1, window.removeEventListener("mousemove", t), window.removeEventListener("mouseup", n);
|
|
720
719
|
};
|
|
721
720
|
window.addEventListener("mousemove", t), window.addEventListener("mouseup", n);
|
|
722
721
|
}, []);
|
|
723
|
-
(0,
|
|
722
|
+
(0, H.useEffect)(() => {
|
|
724
723
|
try {
|
|
725
|
-
localStorage.setItem(
|
|
724
|
+
localStorage.setItem(Ue, String(u));
|
|
726
725
|
} catch {}
|
|
727
726
|
}, [u]);
|
|
728
|
-
let [
|
|
727
|
+
let [g, y] = (0, H.useState)("all"), [x, S] = (0, H.useState)(""), { logs: w, clearLogs: T, isOpen: E, setIsOpen: D } = W({
|
|
729
728
|
enabled: t,
|
|
730
|
-
proxyToPageConsole:
|
|
731
|
-
}),
|
|
732
|
-
(0,
|
|
729
|
+
proxyToPageConsole: r
|
|
730
|
+
}), O = (0, H.useRef)(null);
|
|
731
|
+
(0, H.useEffect)(() => {
|
|
733
732
|
try {
|
|
734
|
-
localStorage.setItem(
|
|
733
|
+
localStorage.setItem(J, String(r));
|
|
735
734
|
} catch {}
|
|
736
|
-
}, [
|
|
737
|
-
let
|
|
735
|
+
}, [r]);
|
|
736
|
+
let k = (0, H.useMemo)(() => {
|
|
738
737
|
let e = {
|
|
739
738
|
log: 0,
|
|
740
739
|
info: 0,
|
|
@@ -743,211 +742,211 @@ function qe({ iframeId: e, enabled: t = !0 }) {
|
|
|
743
742
|
debug: 0,
|
|
744
743
|
trace: 0
|
|
745
744
|
};
|
|
746
|
-
for (let t of
|
|
745
|
+
for (let t of w) e[t.level]++;
|
|
747
746
|
return e;
|
|
748
|
-
}, [
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
]),
|
|
753
|
-
let e =
|
|
747
|
+
}, [w]), A = k.error, j = k.warn, M = k.log + k.info + k.debug + k.trace, N = w.length, P = (0, H.useMemo)(() => A > 0 ? "bg-red-500" : j > 0 ? "bg-yellow-500" : "bg-zinc-500", [
|
|
748
|
+
A,
|
|
749
|
+
j,
|
|
750
|
+
M
|
|
751
|
+
]), F = (0, H.useMemo)(() => {
|
|
752
|
+
let e = g === "all" ? w : w.filter((e) => e.level === g), t = x.trim().toLowerCase();
|
|
754
753
|
return t && (e = e.filter((e) => {
|
|
755
|
-
let n =
|
|
754
|
+
let n = q(e.args).join(" ").toLowerCase(), r = (e.url ?? "").toLowerCase();
|
|
756
755
|
return n.includes(t) || r.includes(t);
|
|
757
756
|
})), e;
|
|
758
757
|
}, [
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
758
|
+
w,
|
|
759
|
+
g,
|
|
760
|
+
x
|
|
762
761
|
]);
|
|
763
|
-
return (0,
|
|
764
|
-
|
|
762
|
+
return (0, H.useEffect)(() => {
|
|
763
|
+
E && !x && O.current && (O.current.scrollTop = O.current.scrollHeight);
|
|
765
764
|
}, [
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
]), /* @__PURE__ */ (0,
|
|
770
|
-
open:
|
|
771
|
-
onOpenChange:
|
|
772
|
-
children: [/* @__PURE__ */ (0,
|
|
773
|
-
render: /* @__PURE__ */ (0,
|
|
774
|
-
render: /* @__PURE__ */ (0,
|
|
765
|
+
F,
|
|
766
|
+
E,
|
|
767
|
+
x
|
|
768
|
+
]), /* @__PURE__ */ (0, G.jsxs)(b, {
|
|
769
|
+
open: E,
|
|
770
|
+
onOpenChange: D,
|
|
771
|
+
children: [/* @__PURE__ */ (0, G.jsx)(v, {
|
|
772
|
+
render: /* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
773
|
+
render: /* @__PURE__ */ (0, G.jsxs)(c, {
|
|
775
774
|
variant: "outline",
|
|
776
775
|
size: "sm",
|
|
777
776
|
className: "relative bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
778
|
-
onClick: () =>
|
|
779
|
-
children: [/* @__PURE__ */ (0,
|
|
780
|
-
className:
|
|
781
|
-
children:
|
|
777
|
+
onClick: () => D(!0),
|
|
778
|
+
children: [/* @__PURE__ */ (0, G.jsx)(V, { className: "size-4" }), N > 0 && /* @__PURE__ */ (0, G.jsx)("span", {
|
|
779
|
+
className: i("ml-2 px-1.5 py-0.5 text-xs rounded-full text-white font-semibold", P),
|
|
780
|
+
children: N
|
|
782
781
|
})]
|
|
783
782
|
}),
|
|
784
783
|
nativeButton: !0
|
|
785
|
-
}), /* @__PURE__ */ (0,
|
|
784
|
+
}), /* @__PURE__ */ (0, G.jsx)(s, { children: /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
786
785
|
className: "text-xs space-y-1",
|
|
787
786
|
children: [
|
|
788
|
-
/* @__PURE__ */ (0,
|
|
787
|
+
/* @__PURE__ */ (0, G.jsxs)("p", {
|
|
789
788
|
className: "font-semibold",
|
|
790
789
|
children: [
|
|
791
|
-
|
|
790
|
+
N,
|
|
792
791
|
" console ",
|
|
793
|
-
|
|
792
|
+
N === 1 ? "log" : "logs"
|
|
794
793
|
]
|
|
795
794
|
}),
|
|
796
|
-
|
|
795
|
+
A > 0 && /* @__PURE__ */ (0, G.jsxs)("p", {
|
|
797
796
|
className: "text-red-400",
|
|
798
797
|
children: [
|
|
799
|
-
|
|
798
|
+
A,
|
|
800
799
|
" error",
|
|
801
|
-
|
|
800
|
+
A === 1 ? "" : "s"
|
|
802
801
|
]
|
|
803
802
|
}),
|
|
804
|
-
|
|
803
|
+
j > 0 && /* @__PURE__ */ (0, G.jsxs)("p", {
|
|
805
804
|
className: "text-yellow-400",
|
|
806
805
|
children: [
|
|
807
|
-
|
|
806
|
+
j,
|
|
808
807
|
" warning",
|
|
809
|
-
|
|
808
|
+
j === 1 ? "" : "s"
|
|
810
809
|
]
|
|
811
810
|
}),
|
|
812
|
-
|
|
811
|
+
M > 0 && /* @__PURE__ */ (0, G.jsxs)("p", {
|
|
813
812
|
className: "text-zinc-400",
|
|
814
|
-
children: [
|
|
813
|
+
children: [M, " info"]
|
|
815
814
|
})
|
|
816
815
|
]
|
|
817
816
|
}) })] }),
|
|
818
817
|
nativeButton: !1
|
|
819
|
-
}), /* @__PURE__ */ (0,
|
|
818
|
+
}), /* @__PURE__ */ (0, G.jsxs)(_, {
|
|
820
819
|
side: "bottom",
|
|
821
820
|
className: "flex flex-col p-0 transition-none m-0 gap-0",
|
|
822
821
|
style: { height: u },
|
|
823
822
|
children: [
|
|
824
|
-
/* @__PURE__ */ (0,
|
|
823
|
+
/* @__PURE__ */ (0, G.jsx)("div", {
|
|
825
824
|
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",
|
|
826
|
-
onMouseDown:
|
|
825
|
+
onMouseDown: m
|
|
827
826
|
}),
|
|
828
|
-
/* @__PURE__ */ (0,
|
|
827
|
+
/* @__PURE__ */ (0, G.jsxs)(h, {
|
|
829
828
|
className: "px-4 py-4 m-0 border-b border-zinc-200 dark:border-zinc-800 shrink-0",
|
|
830
|
-
children: [/* @__PURE__ */ (0,
|
|
829
|
+
children: [/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
831
830
|
className: "flex items-center justify-between",
|
|
832
|
-
children: [/* @__PURE__ */ (0,
|
|
831
|
+
children: [/* @__PURE__ */ (0, G.jsxs)(f, {
|
|
833
832
|
className: "flex items-center gap-2",
|
|
834
833
|
children: [
|
|
835
|
-
/* @__PURE__ */ (0,
|
|
834
|
+
/* @__PURE__ */ (0, G.jsx)(V, { className: "size-4" }),
|
|
836
835
|
"Widget Console Logs",
|
|
837
|
-
|
|
836
|
+
w.length > 0 && /* @__PURE__ */ (0, G.jsxs)("span", {
|
|
838
837
|
className: "text-sm font-normal text-zinc-500 dark:text-zinc-400",
|
|
839
838
|
children: [
|
|
840
839
|
"(",
|
|
841
|
-
|
|
840
|
+
w.length,
|
|
842
841
|
" ",
|
|
843
|
-
|
|
842
|
+
w.length === 1 ? "log" : "logs",
|
|
844
843
|
")"
|
|
845
844
|
]
|
|
846
845
|
})
|
|
847
846
|
]
|
|
848
|
-
}), /* @__PURE__ */ (0,
|
|
847
|
+
}), /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
849
848
|
className: "flex items-center gap-4 pr-4",
|
|
850
|
-
children: [/* @__PURE__ */ (0,
|
|
849
|
+
children: [/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
851
850
|
className: "flex items-center gap-2",
|
|
852
|
-
children: [/* @__PURE__ */ (0,
|
|
851
|
+
children: [/* @__PURE__ */ (0, G.jsx)(ge, {
|
|
853
852
|
id: "proxy-console-toggle",
|
|
854
|
-
checked:
|
|
855
|
-
onCheckedChange:
|
|
856
|
-
}), /* @__PURE__ */ (0,
|
|
853
|
+
checked: r,
|
|
854
|
+
onCheckedChange: l
|
|
855
|
+
}), /* @__PURE__ */ (0, G.jsx)(C, {
|
|
857
856
|
htmlFor: "proxy-console-toggle",
|
|
858
857
|
className: "text-sm font-normal cursor-pointer",
|
|
859
858
|
children: "Proxy logs to page console"
|
|
860
859
|
})]
|
|
861
|
-
}),
|
|
860
|
+
}), w.length > 0 && /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [/* @__PURE__ */ (0, G.jsxs)(c, {
|
|
862
861
|
variant: "ghost",
|
|
863
862
|
size: "sm",
|
|
864
863
|
onClick: async () => {
|
|
865
864
|
try {
|
|
866
|
-
await
|
|
865
|
+
await ce(F.map((e) => {
|
|
867
866
|
let t = new Date(e.timestamp).toLocaleTimeString();
|
|
868
|
-
return `[${e.level.toUpperCase()}] ${t}${e.url ? ` ${e.url}` : ""}\n${
|
|
869
|
-
}).join("\n\n")),
|
|
867
|
+
return `[${e.level.toUpperCase()}] ${t}${e.url ? ` ${e.url}` : ""}\n${q(e.args).join("\n")}`;
|
|
868
|
+
}).join("\n\n")), R.success(`Copied ${F.length} logs to clipboard`);
|
|
870
869
|
} catch {
|
|
871
|
-
|
|
870
|
+
R.error("Failed to copy logs to clipboard");
|
|
872
871
|
}
|
|
873
872
|
},
|
|
874
873
|
className: "-my-2",
|
|
875
|
-
children: [/* @__PURE__ */ (0,
|
|
876
|
-
}), /* @__PURE__ */ (0,
|
|
874
|
+
children: [/* @__PURE__ */ (0, G.jsx)(se, { className: "size-4 mr-1" }), "Copy All"]
|
|
875
|
+
}), /* @__PURE__ */ (0, G.jsxs)(c, {
|
|
877
876
|
variant: "ghost",
|
|
878
877
|
size: "sm",
|
|
879
|
-
onClick:
|
|
878
|
+
onClick: T,
|
|
880
879
|
className: "-my-2",
|
|
881
|
-
children: [/* @__PURE__ */ (0,
|
|
880
|
+
children: [/* @__PURE__ */ (0, G.jsx)(Pe, { className: "size-4 mr-1" }), "Clear"]
|
|
882
881
|
})] })]
|
|
883
882
|
})]
|
|
884
|
-
}), /* @__PURE__ */ (0,
|
|
883
|
+
}), /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
885
884
|
className: "flex items-center gap-1 pt-1",
|
|
886
885
|
children: [
|
|
887
|
-
/* @__PURE__ */ (0,
|
|
888
|
-
onClick: () =>
|
|
889
|
-
className:
|
|
890
|
-
children: ["All",
|
|
886
|
+
/* @__PURE__ */ (0, G.jsxs)("button", {
|
|
887
|
+
onClick: () => y("all"),
|
|
888
|
+
className: i("px-2 py-0.5 text-xs rounded font-medium transition-colors", g === "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"),
|
|
889
|
+
children: ["All", N > 0 && /* @__PURE__ */ (0, G.jsx)("span", {
|
|
891
890
|
className: "ml-1 text-[10px] opacity-70",
|
|
892
|
-
children:
|
|
891
|
+
children: N
|
|
893
892
|
})]
|
|
894
893
|
}),
|
|
895
|
-
|
|
896
|
-
let t =
|
|
897
|
-
return /* @__PURE__ */ (0,
|
|
898
|
-
onClick: () =>
|
|
899
|
-
className:
|
|
900
|
-
children: [/* @__PURE__ */ (0,
|
|
901
|
-
className:
|
|
894
|
+
We.map((e) => {
|
|
895
|
+
let t = k[e];
|
|
896
|
+
return /* @__PURE__ */ (0, G.jsxs)("button", {
|
|
897
|
+
onClick: () => y(g === e ? "all" : e),
|
|
898
|
+
className: i("px-2 py-0.5 text-xs rounded font-medium transition-colors", g === 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"),
|
|
899
|
+
children: [/* @__PURE__ */ (0, G.jsx)("span", {
|
|
900
|
+
className: i(t > 0 && Ge[e]),
|
|
902
901
|
children: e.charAt(0).toUpperCase() + e.slice(1)
|
|
903
|
-
}), t > 0 && /* @__PURE__ */ (0,
|
|
904
|
-
className:
|
|
902
|
+
}), t > 0 && /* @__PURE__ */ (0, G.jsx)("span", {
|
|
903
|
+
className: i("ml-1 text-[10px]", Ge[e]),
|
|
905
904
|
children: t
|
|
906
905
|
})]
|
|
907
906
|
}, e);
|
|
908
907
|
}),
|
|
909
|
-
/* @__PURE__ */ (0,
|
|
908
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
910
909
|
className: "ml-auto flex items-center gap-1 relative",
|
|
911
910
|
children: [
|
|
912
|
-
/* @__PURE__ */ (0,
|
|
913
|
-
/* @__PURE__ */ (0,
|
|
911
|
+
/* @__PURE__ */ (0, G.jsx)(n, { className: "absolute left-2 size-3 text-zinc-400 dark:text-zinc-500 pointer-events-none" }),
|
|
912
|
+
/* @__PURE__ */ (0, G.jsx)("input", {
|
|
914
913
|
type: "text",
|
|
915
914
|
placeholder: "Filter logs…",
|
|
916
|
-
value:
|
|
917
|
-
onChange: (e) =>
|
|
915
|
+
value: x,
|
|
916
|
+
onChange: (e) => S(e.target.value),
|
|
918
917
|
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"
|
|
919
918
|
}),
|
|
920
|
-
|
|
921
|
-
onClick: () =>
|
|
919
|
+
x && /* @__PURE__ */ (0, G.jsx)("button", {
|
|
920
|
+
onClick: () => S(""),
|
|
922
921
|
"aria-label": "Clear search",
|
|
923
922
|
className: "absolute right-1.5 text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300",
|
|
924
|
-
children: /* @__PURE__ */ (0,
|
|
923
|
+
children: /* @__PURE__ */ (0, G.jsx)(he, { className: "size-3" })
|
|
925
924
|
})
|
|
926
925
|
]
|
|
927
926
|
})
|
|
928
927
|
]
|
|
929
928
|
})]
|
|
930
929
|
}),
|
|
931
|
-
/* @__PURE__ */ (0,
|
|
932
|
-
ref:
|
|
930
|
+
/* @__PURE__ */ (0, G.jsx)("div", {
|
|
931
|
+
ref: O,
|
|
933
932
|
className: "flex-1 overflow-auto bg-zinc-50 dark:bg-zinc-950",
|
|
934
|
-
children:
|
|
933
|
+
children: F.length === 0 ? /* @__PURE__ */ (0, G.jsx)("div", {
|
|
935
934
|
className: "flex items-center justify-center h-full text-zinc-500 dark:text-zinc-400",
|
|
936
|
-
children: /* @__PURE__ */ (0,
|
|
935
|
+
children: /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
937
936
|
className: "text-center",
|
|
938
937
|
children: [
|
|
939
|
-
/* @__PURE__ */ (0,
|
|
940
|
-
/* @__PURE__ */ (0,
|
|
938
|
+
/* @__PURE__ */ (0, G.jsx)(V, { className: "size-8 mx-auto mb-2 opacity-50" }),
|
|
939
|
+
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
941
940
|
className: "text-sm",
|
|
942
|
-
children:
|
|
941
|
+
children: w.length === 0 ? "No console logs yet" : x ? `No logs match "${x}"` : "No logs match the current filter"
|
|
943
942
|
}),
|
|
944
|
-
/* @__PURE__ */ (0,
|
|
943
|
+
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
945
944
|
className: "text-xs mt-1",
|
|
946
|
-
children:
|
|
945
|
+
children: w.length === 0 ? "Logs from iframes will appear here" : `${w.length} log${w.length === 1 ? "" : "s"} hidden by filter`
|
|
947
946
|
})
|
|
948
947
|
]
|
|
949
948
|
})
|
|
950
|
-
}) : /* @__PURE__ */ (0,
|
|
949
|
+
}) : /* @__PURE__ */ (0, G.jsx)("div", { children: F.map((e) => /* @__PURE__ */ (0, G.jsx)(He, { log: e }, e.id)) })
|
|
951
950
|
})
|
|
952
951
|
]
|
|
953
952
|
})]
|
|
@@ -955,7 +954,7 @@ function qe({ iframeId: e, enabled: t = !0 }) {
|
|
|
955
954
|
}
|
|
956
955
|
//#endregion
|
|
957
956
|
//#region src/client/hooks/usePropsLLM.ts
|
|
958
|
-
function
|
|
957
|
+
function qe(e) {
|
|
959
958
|
let t = e.trim(), n = t.match(/```(?:json)?\s*([\s\S]*?)```/);
|
|
960
959
|
n && (t = n[1].trim());
|
|
961
960
|
let r = t.indexOf("{");
|
|
@@ -971,7 +970,7 @@ function J(e) {
|
|
|
971
970
|
}
|
|
972
971
|
function Je({ llmConfig: e }) {
|
|
973
972
|
return {
|
|
974
|
-
generateProps: (0,
|
|
973
|
+
generateProps: (0, H.useCallback)(async ({ resource: t, resourceAnnotations: n, propsSchema: r }) => {
|
|
975
974
|
if (!e) throw Error("LLM config is not available");
|
|
976
975
|
let i = t.mimeType || n?.mimeType || "unknown", a = t.description || n?.description || "N/A";
|
|
977
976
|
if (r?.properties) {
|
|
@@ -991,7 +990,7 @@ ${n}
|
|
|
991
990
|
|
|
992
991
|
Generate appropriate default/example values for these props. Return ONLY a JSON object with the exact prop names as keys.
|
|
993
992
|
Example: {"query": "example search term", "results": [{"fruit": "Apple", "color": "red"}]}`
|
|
994
|
-
}], o =
|
|
993
|
+
}], o = qe(await z({
|
|
995
994
|
config: {
|
|
996
995
|
provider: e.provider,
|
|
997
996
|
model: e.model,
|
|
@@ -1025,7 +1024,7 @@ Based on this information, suggest 3-5 common customizable properties like theme
|
|
|
1025
1024
|
}, {
|
|
1026
1025
|
role: "user",
|
|
1027
1026
|
content: c
|
|
1028
|
-
}], u = await
|
|
1027
|
+
}], u = await z({
|
|
1029
1028
|
config: {
|
|
1030
1029
|
provider: e.provider,
|
|
1031
1030
|
model: e.model,
|
|
@@ -1036,7 +1035,7 @@ Based on this information, suggest 3-5 common customizable properties like theme
|
|
|
1036
1035
|
messages: l
|
|
1037
1036
|
});
|
|
1038
1037
|
try {
|
|
1039
|
-
let e =
|
|
1038
|
+
let e = qe(u);
|
|
1040
1039
|
if (e) return Object.entries(e).map(([e, t]) => ({
|
|
1041
1040
|
key: e,
|
|
1042
1041
|
value: typeof t == "object" && t ? JSON.stringify(t) : String(t)
|
|
@@ -1087,19 +1086,19 @@ function Xe(e) {
|
|
|
1087
1086
|
function X({ name: e, schema: t, value: n, onChange: r, required: i = !1, disabled: a = !1, rootSchema: o }) {
|
|
1088
1087
|
let s = o || t, c = Ye(t, s);
|
|
1089
1088
|
c = Y(c, s);
|
|
1090
|
-
let
|
|
1091
|
-
return f.type === "object" || f.type === "array" ? /* @__PURE__ */ (0,
|
|
1089
|
+
let u = Xe(c), d = c.type === "string" && u !== null, f = c;
|
|
1090
|
+
return f.type === "object" || f.type === "array" ? /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1092
1091
|
className: "space-y-2",
|
|
1093
1092
|
children: [
|
|
1094
|
-
/* @__PURE__ */ (0,
|
|
1093
|
+
/* @__PURE__ */ (0, G.jsxs)(C, {
|
|
1095
1094
|
htmlFor: e,
|
|
1096
1095
|
className: "text-sm font-medium",
|
|
1097
|
-
children: [e, i && /* @__PURE__ */ (0,
|
|
1096
|
+
children: [e, i && /* @__PURE__ */ (0, G.jsx)("span", {
|
|
1098
1097
|
className: "text-red-500 ml-1",
|
|
1099
1098
|
children: "*"
|
|
1100
1099
|
})]
|
|
1101
1100
|
}),
|
|
1102
|
-
/* @__PURE__ */ (0,
|
|
1101
|
+
/* @__PURE__ */ (0, G.jsx)(B, {
|
|
1103
1102
|
id: e,
|
|
1104
1103
|
value: n,
|
|
1105
1104
|
onChange: (e) => r(e.target.value),
|
|
@@ -1107,52 +1106,52 @@ function X({ name: e, schema: t, value: n, onChange: r, required: i = !1, disabl
|
|
|
1107
1106
|
className: "min-h-[100px]",
|
|
1108
1107
|
disabled: a
|
|
1109
1108
|
}),
|
|
1110
|
-
f?.description && /* @__PURE__ */ (0,
|
|
1109
|
+
f?.description && /* @__PURE__ */ (0, G.jsx)("p", {
|
|
1111
1110
|
className: "text-xs text-gray-500 dark:text-gray-400",
|
|
1112
1111
|
children: f.description
|
|
1113
1112
|
})
|
|
1114
1113
|
]
|
|
1115
|
-
}) : d &&
|
|
1114
|
+
}) : d && u ? /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1116
1115
|
className: "space-y-2",
|
|
1117
1116
|
children: [
|
|
1118
|
-
/* @__PURE__ */ (0,
|
|
1117
|
+
/* @__PURE__ */ (0, G.jsxs)(C, {
|
|
1119
1118
|
htmlFor: e,
|
|
1120
1119
|
className: "text-sm font-medium",
|
|
1121
|
-
children: [e, i && /* @__PURE__ */ (0,
|
|
1120
|
+
children: [e, i && /* @__PURE__ */ (0, G.jsx)("span", {
|
|
1122
1121
|
className: "text-red-500 ml-1",
|
|
1123
1122
|
children: "*"
|
|
1124
1123
|
})]
|
|
1125
1124
|
}),
|
|
1126
|
-
/* @__PURE__ */ (0,
|
|
1125
|
+
/* @__PURE__ */ (0, G.jsxs)(O, {
|
|
1127
1126
|
value: n || "",
|
|
1128
1127
|
onValueChange: r,
|
|
1129
1128
|
disabled: a,
|
|
1130
|
-
children: [/* @__PURE__ */ (0,
|
|
1129
|
+
children: [/* @__PURE__ */ (0, G.jsx)(T, {
|
|
1131
1130
|
id: e,
|
|
1132
1131
|
className: "w-full",
|
|
1133
|
-
children: /* @__PURE__ */ (0,
|
|
1134
|
-
}), /* @__PURE__ */ (0,
|
|
1132
|
+
children: /* @__PURE__ */ (0, G.jsx)(w, { placeholder: f.description || "Select an option" })
|
|
1133
|
+
}), /* @__PURE__ */ (0, G.jsx)(E, { children: u.map((e, t) => /* @__PURE__ */ (0, G.jsx)(D, {
|
|
1135
1134
|
value: e,
|
|
1136
1135
|
children: f.enumNames?.[t] || e
|
|
1137
1136
|
}, e)) })]
|
|
1138
1137
|
}),
|
|
1139
|
-
f.description && /* @__PURE__ */ (0,
|
|
1138
|
+
f.description && /* @__PURE__ */ (0, G.jsx)("p", {
|
|
1140
1139
|
className: "text-xs text-gray-500 dark:text-gray-400",
|
|
1141
1140
|
children: f.description
|
|
1142
1141
|
})
|
|
1143
1142
|
]
|
|
1144
|
-
}) : /* @__PURE__ */ (0,
|
|
1143
|
+
}) : /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1145
1144
|
className: "space-y-2",
|
|
1146
1145
|
children: [
|
|
1147
|
-
/* @__PURE__ */ (0,
|
|
1146
|
+
/* @__PURE__ */ (0, G.jsxs)(C, {
|
|
1148
1147
|
htmlFor: e,
|
|
1149
1148
|
className: "text-sm font-medium",
|
|
1150
|
-
children: [e, i && /* @__PURE__ */ (0,
|
|
1149
|
+
children: [e, i && /* @__PURE__ */ (0, G.jsx)("span", {
|
|
1151
1150
|
className: "text-red-500 ml-1",
|
|
1152
1151
|
children: "*"
|
|
1153
1152
|
})]
|
|
1154
1153
|
}),
|
|
1155
|
-
/* @__PURE__ */ (0,
|
|
1154
|
+
/* @__PURE__ */ (0, G.jsx)(l, {
|
|
1156
1155
|
id: e,
|
|
1157
1156
|
value: n,
|
|
1158
1157
|
onChange: (e) => r(e.target.value),
|
|
@@ -1160,7 +1159,7 @@ function X({ name: e, schema: t, value: n, onChange: r, required: i = !1, disabl
|
|
|
1160
1159
|
type: f.type === "number" ? "number" : "text",
|
|
1161
1160
|
disabled: a
|
|
1162
1161
|
}),
|
|
1163
|
-
f?.description && /* @__PURE__ */ (0,
|
|
1162
|
+
f?.description && /* @__PURE__ */ (0, G.jsx)("p", {
|
|
1164
1163
|
className: "text-xs text-gray-500 dark:text-gray-400",
|
|
1165
1164
|
children: f.description
|
|
1166
1165
|
})
|
|
@@ -1170,7 +1169,7 @@ function X({ name: e, schema: t, value: n, onChange: r, required: i = !1, disabl
|
|
|
1170
1169
|
//#endregion
|
|
1171
1170
|
//#region src/client/components/resources/PropsConfigDialog.tsx
|
|
1172
1171
|
function Ze({ open: e, onOpenChange: t, onSave: n, existingPresets: r, resource: i, resourceAnnotations: a, llmConfig: o, editingPreset: s }) {
|
|
1173
|
-
let
|
|
1172
|
+
let u = (0, H.useMemo)(() => {
|
|
1174
1173
|
let e = (e) => {
|
|
1175
1174
|
if (!e) return null;
|
|
1176
1175
|
if (e.type === "object" && e.properties) return e;
|
|
@@ -1234,12 +1233,12 @@ function Ze({ open: e, onOpenChange: t, onSave: n, existingPresets: r, resource:
|
|
|
1234
1233
|
i.annotations,
|
|
1235
1234
|
i.uri,
|
|
1236
1235
|
i.name
|
|
1237
|
-
]), d = !!
|
|
1236
|
+
]), d = !!u, [f, p] = (0, H.useState)(""), [m, h] = (0, H.useState)({}), [g, _] = (0, H.useState)([{
|
|
1238
1237
|
id: crypto.randomUUID(),
|
|
1239
1238
|
key: "",
|
|
1240
1239
|
value: ""
|
|
1241
|
-
}]), [
|
|
1242
|
-
(0,
|
|
1240
|
+
}]), [v, y] = (0, H.useState)(!1), [b, x] = (0, H.useState)(null), { generateProps: S, isAvailable: w } = Je({ llmConfig: o });
|
|
1241
|
+
(0, H.useEffect)(() => {
|
|
1243
1242
|
if (e) {
|
|
1244
1243
|
if (s) if (p(s.name), d) h(s.props);
|
|
1245
1244
|
else {
|
|
@@ -1259,7 +1258,7 @@ function Ze({ open: e, onOpenChange: t, onSave: n, existingPresets: r, resource:
|
|
|
1259
1258
|
key: "",
|
|
1260
1259
|
value: ""
|
|
1261
1260
|
}]);
|
|
1262
|
-
|
|
1261
|
+
x(null);
|
|
1263
1262
|
}
|
|
1264
1263
|
}, [
|
|
1265
1264
|
e,
|
|
@@ -1280,45 +1279,45 @@ function Ze({ open: e, onOpenChange: t, onSave: n, existingPresets: r, resource:
|
|
|
1280
1279
|
[t]: n
|
|
1281
1280
|
} : r));
|
|
1282
1281
|
};
|
|
1283
|
-
return /* @__PURE__ */ (0,
|
|
1282
|
+
return /* @__PURE__ */ (0, G.jsx)(oe, {
|
|
1284
1283
|
open: e,
|
|
1285
1284
|
onOpenChange: t,
|
|
1286
|
-
children: /* @__PURE__ */ (0,
|
|
1285
|
+
children: /* @__PURE__ */ (0, G.jsxs)(ie, {
|
|
1287
1286
|
scrollable: !0,
|
|
1288
1287
|
className: "sm:max-w-[600px] max-h-[80vh]",
|
|
1289
1288
|
"data-testid": "props-config-dialog",
|
|
1290
1289
|
children: [
|
|
1291
|
-
/* @__PURE__ */ (0,
|
|
1290
|
+
/* @__PURE__ */ (0, G.jsxs)(re, { children: [/* @__PURE__ */ (0, G.jsx)(ee, { children: s ? "Edit Preset" : "Create Props Preset" }), /* @__PURE__ */ (0, G.jsxs)(I, { children: [
|
|
1292
1291
|
"Configure props for ",
|
|
1293
1292
|
i.name || i.uri,
|
|
1294
1293
|
". You can manually add key-value pairs or generate them with AI."
|
|
1295
1294
|
] })] }),
|
|
1296
|
-
/* @__PURE__ */ (0,
|
|
1295
|
+
/* @__PURE__ */ (0, G.jsxs)(ne, {
|
|
1297
1296
|
className: "space-y-4 py-4",
|
|
1298
1297
|
children: [
|
|
1299
|
-
/* @__PURE__ */ (0,
|
|
1298
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1300
1299
|
className: "space-y-2",
|
|
1301
|
-
children: [/* @__PURE__ */ (0,
|
|
1300
|
+
children: [/* @__PURE__ */ (0, G.jsx)(C, {
|
|
1302
1301
|
htmlFor: "preset-name",
|
|
1303
1302
|
children: "Preset Name"
|
|
1304
|
-
}), /* @__PURE__ */ (0,
|
|
1303
|
+
}), /* @__PURE__ */ (0, G.jsx)(l, {
|
|
1305
1304
|
id: "preset-name",
|
|
1306
1305
|
"data-testid": "props-config-preset-name",
|
|
1307
1306
|
value: f,
|
|
1308
1307
|
onChange: (e) => p(e.target.value),
|
|
1309
1308
|
placeholder: "e.g., Dark Theme, Production Config",
|
|
1310
|
-
disabled:
|
|
1309
|
+
disabled: v
|
|
1311
1310
|
})]
|
|
1312
1311
|
}),
|
|
1313
|
-
/* @__PURE__ */ (0,
|
|
1312
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1314
1313
|
className: "space-y-2 p-3 bg-muted rounded-lg",
|
|
1315
1314
|
children: [
|
|
1316
|
-
/* @__PURE__ */ (0,
|
|
1315
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1317
1316
|
className: "flex items-center justify-between",
|
|
1318
|
-
children: [/* @__PURE__ */ (0,
|
|
1317
|
+
children: [/* @__PURE__ */ (0, G.jsx)(C, {
|
|
1319
1318
|
className: "text-sm font-medium",
|
|
1320
1319
|
children: "Generate with AI"
|
|
1321
|
-
}), w && /* @__PURE__ */ (0,
|
|
1320
|
+
}), w && /* @__PURE__ */ (0, G.jsxs)("span", {
|
|
1322
1321
|
className: "text-xs text-muted-foreground",
|
|
1323
1322
|
children: [
|
|
1324
1323
|
"Using ",
|
|
@@ -1329,65 +1328,65 @@ function Ze({ open: e, onOpenChange: t, onSave: n, existingPresets: r, resource:
|
|
|
1329
1328
|
]
|
|
1330
1329
|
})]
|
|
1331
1330
|
}),
|
|
1332
|
-
w ? /* @__PURE__ */ (0,
|
|
1331
|
+
w ? /* @__PURE__ */ (0, G.jsx)(c, {
|
|
1333
1332
|
onClick: async () => {
|
|
1334
1333
|
if (!w) {
|
|
1335
|
-
|
|
1334
|
+
R.error("LLM not configured", { description: "Please configure LLM in the Chat tab first." });
|
|
1336
1335
|
return;
|
|
1337
1336
|
}
|
|
1338
|
-
|
|
1337
|
+
y(!0), x(null);
|
|
1339
1338
|
try {
|
|
1340
|
-
let e = await
|
|
1339
|
+
let e = await S({
|
|
1341
1340
|
resource: i,
|
|
1342
1341
|
resourceAnnotations: a,
|
|
1343
|
-
propsSchema: d ?
|
|
1342
|
+
propsSchema: d ? u : void 0
|
|
1344
1343
|
});
|
|
1345
1344
|
if (d) {
|
|
1346
1345
|
let t = {};
|
|
1347
|
-
for (let n of e)
|
|
1346
|
+
for (let n of e) u.properties?.[n.key] && (t[n.key] = n.value);
|
|
1348
1347
|
h(t);
|
|
1349
1348
|
} else _(e.map((e) => ({
|
|
1350
1349
|
id: crypto.randomUUID(),
|
|
1351
1350
|
key: e.key,
|
|
1352
1351
|
value: e.value
|
|
1353
1352
|
})));
|
|
1354
|
-
|
|
1353
|
+
R.success("Props generated successfully", { description: `Generated ${e.length} prop(s) using ${o?.provider}` });
|
|
1355
1354
|
} catch (e) {
|
|
1356
1355
|
let t = e instanceof Error ? e.message : "Failed to generate props";
|
|
1357
|
-
|
|
1356
|
+
x(t), R.error("LLM Generation Failed", { description: t });
|
|
1358
1357
|
} finally {
|
|
1359
|
-
|
|
1358
|
+
y(!1);
|
|
1360
1359
|
}
|
|
1361
1360
|
},
|
|
1362
|
-
disabled:
|
|
1361
|
+
disabled: v,
|
|
1363
1362
|
size: "sm",
|
|
1364
1363
|
variant: "outline",
|
|
1365
1364
|
className: "w-full",
|
|
1366
1365
|
"data-testid": "props-config-generate-llm-button",
|
|
1367
|
-
children:
|
|
1366
|
+
children: v ? /* @__PURE__ */ (0, G.jsxs)("span", {
|
|
1368
1367
|
"data-testid": "props-config-generating",
|
|
1369
1368
|
className: "flex items-center gap-2",
|
|
1370
|
-
children: [/* @__PURE__ */ (0,
|
|
1371
|
-
}) : /* @__PURE__ */ (0,
|
|
1372
|
-
}) : /* @__PURE__ */ (0,
|
|
1369
|
+
children: [/* @__PURE__ */ (0, G.jsx)(de, { className: "h-4 w-4 mr-2 animate-spin" }), "Generating..."]
|
|
1370
|
+
}) : /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [/* @__PURE__ */ (0, G.jsx)(pe, { className: "h-4 w-4 mr-2" }), "Generate Props with LLM"] })
|
|
1371
|
+
}) : /* @__PURE__ */ (0, G.jsx)("p", {
|
|
1373
1372
|
className: "text-xs text-muted-foreground",
|
|
1374
1373
|
children: "LLM not configured. Please configure LLM in the Chat tab to use this feature."
|
|
1375
1374
|
}),
|
|
1376
|
-
|
|
1375
|
+
b && /* @__PURE__ */ (0, G.jsx)("p", {
|
|
1377
1376
|
className: "text-xs text-destructive",
|
|
1378
1377
|
"data-testid": "props-config-error",
|
|
1379
|
-
children:
|
|
1378
|
+
children: b
|
|
1380
1379
|
})
|
|
1381
1380
|
]
|
|
1382
1381
|
}),
|
|
1383
|
-
/* @__PURE__ */ (0,
|
|
1382
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1384
1383
|
className: "space-y-3",
|
|
1385
|
-
children: [/* @__PURE__ */ (0,
|
|
1384
|
+
children: [/* @__PURE__ */ (0, G.jsx)(C, {
|
|
1386
1385
|
className: "text-sm font-medium",
|
|
1387
1386
|
children: "Props"
|
|
1388
|
-
}), d ? /* @__PURE__ */ (0,
|
|
1387
|
+
}), d ? /* @__PURE__ */ (0, G.jsx)("div", {
|
|
1389
1388
|
className: "space-y-4",
|
|
1390
|
-
children: Object.entries(
|
|
1389
|
+
children: Object.entries(u.properties || {}).map(([e, t]) => /* @__PURE__ */ (0, G.jsx)(X, {
|
|
1391
1390
|
name: e,
|
|
1392
1391
|
schema: t,
|
|
1393
1392
|
value: m[e] || "",
|
|
@@ -1395,64 +1394,64 @@ function Ze({ open: e, onOpenChange: t, onSave: n, existingPresets: r, resource:
|
|
|
1395
1394
|
...n,
|
|
1396
1395
|
[e]: t
|
|
1397
1396
|
})),
|
|
1398
|
-
required:
|
|
1399
|
-
disabled:
|
|
1400
|
-
rootSchema:
|
|
1397
|
+
required: u.required?.includes(e),
|
|
1398
|
+
disabled: v,
|
|
1399
|
+
rootSchema: u
|
|
1401
1400
|
}, e))
|
|
1402
|
-
}) : /* @__PURE__ */ (0,
|
|
1401
|
+
}) : /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [/* @__PURE__ */ (0, G.jsx)("div", {
|
|
1403
1402
|
className: "flex items-center justify-between",
|
|
1404
|
-
children: /* @__PURE__ */ (0,
|
|
1403
|
+
children: /* @__PURE__ */ (0, G.jsxs)(c, {
|
|
1405
1404
|
onClick: T,
|
|
1406
1405
|
size: "sm",
|
|
1407
1406
|
variant: "ghost",
|
|
1408
|
-
disabled:
|
|
1407
|
+
disabled: v,
|
|
1409
1408
|
"data-testid": "props-config-add-prop",
|
|
1410
|
-
children: [/* @__PURE__ */ (0,
|
|
1409
|
+
children: [/* @__PURE__ */ (0, G.jsx)(L, { className: "h-4 w-4 mr-1" }), "Add Prop"]
|
|
1411
1410
|
})
|
|
1412
|
-
}), g.map((e, t) => /* @__PURE__ */ (0,
|
|
1411
|
+
}), g.map((e, t) => /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1413
1412
|
className: "flex items-center gap-2",
|
|
1414
|
-
children: [/* @__PURE__ */ (0,
|
|
1413
|
+
children: [/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1415
1414
|
className: "flex-1 grid grid-cols-2 gap-2",
|
|
1416
|
-
children: [/* @__PURE__ */ (0,
|
|
1415
|
+
children: [/* @__PURE__ */ (0, G.jsx)(l, {
|
|
1417
1416
|
placeholder: "Key",
|
|
1418
1417
|
value: e.key,
|
|
1419
1418
|
onChange: (t) => D(e.id, "key", t.target.value),
|
|
1420
|
-
disabled:
|
|
1419
|
+
disabled: v,
|
|
1421
1420
|
"data-testid": `props-config-key-${t}`
|
|
1422
|
-
}), /* @__PURE__ */ (0,
|
|
1421
|
+
}), /* @__PURE__ */ (0, G.jsx)(l, {
|
|
1423
1422
|
placeholder: "Value",
|
|
1424
1423
|
value: e.value,
|
|
1425
1424
|
onChange: (t) => D(e.id, "value", t.target.value),
|
|
1426
|
-
disabled:
|
|
1425
|
+
disabled: v,
|
|
1427
1426
|
"data-testid": `props-config-value-${t}`
|
|
1428
1427
|
})]
|
|
1429
|
-
}), /* @__PURE__ */ (0,
|
|
1428
|
+
}), /* @__PURE__ */ (0, G.jsx)(c, {
|
|
1430
1429
|
variant: "ghost",
|
|
1431
1430
|
size: "sm",
|
|
1432
1431
|
onClick: () => E(e.id),
|
|
1433
|
-
disabled: g.length === 1 ||
|
|
1432
|
+
disabled: g.length === 1 || v,
|
|
1434
1433
|
className: "h-9 w-9 p-0",
|
|
1435
1434
|
"data-testid": `props-config-remove-${t}`,
|
|
1436
|
-
children: /* @__PURE__ */ (0,
|
|
1435
|
+
children: /* @__PURE__ */ (0, G.jsx)(me, { className: "h-4 w-4 text-muted-foreground" })
|
|
1437
1436
|
})]
|
|
1438
1437
|
}, e.id))] })]
|
|
1439
1438
|
})
|
|
1440
1439
|
]
|
|
1441
1440
|
}),
|
|
1442
|
-
/* @__PURE__ */ (0,
|
|
1441
|
+
/* @__PURE__ */ (0, G.jsxs)(P, { children: [/* @__PURE__ */ (0, G.jsx)(c, {
|
|
1443
1442
|
variant: "outline",
|
|
1444
1443
|
onClick: () => t(!1),
|
|
1445
|
-
disabled:
|
|
1444
|
+
disabled: v,
|
|
1446
1445
|
"data-testid": "props-config-cancel-button",
|
|
1447
1446
|
children: "Cancel"
|
|
1448
|
-
}), /* @__PURE__ */ (0,
|
|
1447
|
+
}), /* @__PURE__ */ (0, G.jsxs)(c, {
|
|
1449
1448
|
onClick: () => {
|
|
1450
1449
|
if (!f.trim()) {
|
|
1451
|
-
|
|
1450
|
+
R.error("Preset name required", { description: "Please enter a name for this preset." });
|
|
1452
1451
|
return;
|
|
1453
1452
|
}
|
|
1454
1453
|
if (r.find((e) => e.name.toLowerCase() === f.toLowerCase() && e.id !== s?.id)) {
|
|
1455
|
-
|
|
1454
|
+
R.error("Duplicate preset name", { description: "A preset with this name already exists." });
|
|
1456
1455
|
return;
|
|
1457
1456
|
}
|
|
1458
1457
|
let e;
|
|
@@ -1462,7 +1461,7 @@ function Ze({ open: e, onOpenChange: t, onSave: n, existingPresets: r, resource:
|
|
|
1462
1461
|
for (let t of g) t.key.trim() && (e[t.key.trim()] = t.value);
|
|
1463
1462
|
}
|
|
1464
1463
|
if (Object.keys(e).length === 0) {
|
|
1465
|
-
|
|
1464
|
+
R.error("No props defined", { description: "Please add at least one prop with a key." });
|
|
1466
1465
|
return;
|
|
1467
1466
|
}
|
|
1468
1467
|
let i = {
|
|
@@ -1470,9 +1469,9 @@ function Ze({ open: e, onOpenChange: t, onSave: n, existingPresets: r, resource:
|
|
|
1470
1469
|
name: f.trim(),
|
|
1471
1470
|
props: e
|
|
1472
1471
|
};
|
|
1473
|
-
n(i), t(!1),
|
|
1472
|
+
n(i), t(!1), R.success(s ? "Preset updated" : "Preset created", { description: `Preset "${i.name}" saved successfully.` });
|
|
1474
1473
|
},
|
|
1475
|
-
disabled:
|
|
1474
|
+
disabled: v,
|
|
1476
1475
|
"data-testid": "props-config-save-button",
|
|
1477
1476
|
children: [s ? "Update" : "Create", " Preset"]
|
|
1478
1477
|
})] })
|
|
@@ -1490,15 +1489,15 @@ function Qe({ value: e, onChange: t }) {
|
|
|
1490
1489
|
[n]: i
|
|
1491
1490
|
});
|
|
1492
1491
|
};
|
|
1493
|
-
return /* @__PURE__ */ (0,
|
|
1492
|
+
return /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1494
1493
|
className: "grid grid-cols-2 gap-2",
|
|
1495
1494
|
children: [
|
|
1496
|
-
/* @__PURE__ */ (0,
|
|
1495
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1497
1496
|
className: "space-y-1",
|
|
1498
|
-
children: [/* @__PURE__ */ (0,
|
|
1497
|
+
children: [/* @__PURE__ */ (0, G.jsx)("label", {
|
|
1499
1498
|
className: "text-xs text-muted-foreground",
|
|
1500
1499
|
children: "Top"
|
|
1501
|
-
}), /* @__PURE__ */ (0,
|
|
1500
|
+
}), /* @__PURE__ */ (0, G.jsx)(l, {
|
|
1502
1501
|
type: "number",
|
|
1503
1502
|
min: "0",
|
|
1504
1503
|
value: e.top,
|
|
@@ -1507,12 +1506,12 @@ function Qe({ value: e, onChange: t }) {
|
|
|
1507
1506
|
"data-testid": "debugger-safe-area-top"
|
|
1508
1507
|
})]
|
|
1509
1508
|
}),
|
|
1510
|
-
/* @__PURE__ */ (0,
|
|
1509
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1511
1510
|
className: "space-y-1",
|
|
1512
|
-
children: [/* @__PURE__ */ (0,
|
|
1511
|
+
children: [/* @__PURE__ */ (0, G.jsx)("label", {
|
|
1513
1512
|
className: "text-xs text-muted-foreground",
|
|
1514
1513
|
children: "Right"
|
|
1515
|
-
}), /* @__PURE__ */ (0,
|
|
1514
|
+
}), /* @__PURE__ */ (0, G.jsx)(l, {
|
|
1516
1515
|
type: "number",
|
|
1517
1516
|
min: "0",
|
|
1518
1517
|
value: e.right,
|
|
@@ -1521,12 +1520,12 @@ function Qe({ value: e, onChange: t }) {
|
|
|
1521
1520
|
"data-testid": "debugger-safe-area-right"
|
|
1522
1521
|
})]
|
|
1523
1522
|
}),
|
|
1524
|
-
/* @__PURE__ */ (0,
|
|
1523
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1525
1524
|
className: "space-y-1",
|
|
1526
|
-
children: [/* @__PURE__ */ (0,
|
|
1525
|
+
children: [/* @__PURE__ */ (0, G.jsx)("label", {
|
|
1527
1526
|
className: "text-xs text-muted-foreground",
|
|
1528
1527
|
children: "Bottom"
|
|
1529
|
-
}), /* @__PURE__ */ (0,
|
|
1528
|
+
}), /* @__PURE__ */ (0, G.jsx)(l, {
|
|
1530
1529
|
type: "number",
|
|
1531
1530
|
min: "0",
|
|
1532
1531
|
value: e.bottom,
|
|
@@ -1535,12 +1534,12 @@ function Qe({ value: e, onChange: t }) {
|
|
|
1535
1534
|
"data-testid": "debugger-safe-area-bottom"
|
|
1536
1535
|
})]
|
|
1537
1536
|
}),
|
|
1538
|
-
/* @__PURE__ */ (0,
|
|
1537
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1539
1538
|
className: "space-y-1",
|
|
1540
|
-
children: [/* @__PURE__ */ (0,
|
|
1539
|
+
children: [/* @__PURE__ */ (0, G.jsx)("label", {
|
|
1541
1540
|
className: "text-xs text-muted-foreground",
|
|
1542
1541
|
children: "Left"
|
|
1543
|
-
}), /* @__PURE__ */ (0,
|
|
1542
|
+
}), /* @__PURE__ */ (0, G.jsx)(l, {
|
|
1544
1543
|
type: "number",
|
|
1545
1544
|
min: "0",
|
|
1546
1545
|
value: e.left,
|
|
@@ -1611,161 +1610,161 @@ var Q = "__no_props__", $ = "__tool_props__", nt = "__create_preset__", rt = [
|
|
|
1611
1610
|
{
|
|
1612
1611
|
value: "desktop",
|
|
1613
1612
|
label: "Desktop",
|
|
1614
|
-
icon:
|
|
1613
|
+
icon: j
|
|
1615
1614
|
},
|
|
1616
1615
|
{
|
|
1617
1616
|
value: "mobile",
|
|
1618
1617
|
label: "Mobile",
|
|
1619
|
-
icon:
|
|
1618
|
+
icon: je
|
|
1620
1619
|
},
|
|
1621
1620
|
{
|
|
1622
1621
|
value: "tablet",
|
|
1623
1622
|
label: "Tablet",
|
|
1624
|
-
icon:
|
|
1623
|
+
icon: Ne
|
|
1625
1624
|
}
|
|
1626
1625
|
];
|
|
1627
1626
|
function it({ options: e, value: t, onValueChange: n, placeholder: r, contentTestId: i, searchTestId: a, optionTestId: o, trigger: s }) {
|
|
1628
|
-
let [c,
|
|
1629
|
-
(0,
|
|
1627
|
+
let [c, u] = (0, H.useState)(!1), [d, f] = (0, H.useState)(""), p = (0, H.useRef)(null);
|
|
1628
|
+
(0, H.useEffect)(() => {
|
|
1630
1629
|
if (!c) {
|
|
1631
|
-
|
|
1630
|
+
f("");
|
|
1632
1631
|
return;
|
|
1633
1632
|
}
|
|
1634
|
-
let e = requestAnimationFrame(() =>
|
|
1633
|
+
let e = requestAnimationFrame(() => p.current?.focus());
|
|
1635
1634
|
return () => cancelAnimationFrame(e);
|
|
1636
1635
|
}, [c]);
|
|
1637
|
-
let
|
|
1638
|
-
let t =
|
|
1636
|
+
let h = (0, H.useMemo)(() => {
|
|
1637
|
+
let t = d.trim().toLowerCase();
|
|
1639
1638
|
return t ? e.filter((e) => e.label.toLowerCase().includes(t) || e.value.toLowerCase().includes(t)) : [...e];
|
|
1640
|
-
}, [e,
|
|
1641
|
-
return /* @__PURE__ */ (0,
|
|
1639
|
+
}, [e, d]), g = h.findIndex((e) => e.value === t);
|
|
1640
|
+
return /* @__PURE__ */ (0, G.jsxs)(x, {
|
|
1642
1641
|
open: c,
|
|
1643
|
-
onOpenChange:
|
|
1644
|
-
children: [s, /* @__PURE__ */ (0,
|
|
1642
|
+
onOpenChange: u,
|
|
1643
|
+
children: [s, /* @__PURE__ */ (0, G.jsxs)(m, {
|
|
1645
1644
|
"data-testid": i,
|
|
1646
|
-
checkedIndex:
|
|
1645
|
+
checkedIndex: g >= 0 ? g : void 0,
|
|
1647
1646
|
className: "w-80 overflow-hidden",
|
|
1648
|
-
children: [/* @__PURE__ */ (0,
|
|
1647
|
+
children: [/* @__PURE__ */ (0, G.jsx)("div", {
|
|
1649
1648
|
className: "border-b border-border p-2",
|
|
1650
1649
|
onKeyDown: (e) => e.stopPropagation(),
|
|
1651
|
-
children: /* @__PURE__ */ (0,
|
|
1652
|
-
ref:
|
|
1653
|
-
value:
|
|
1654
|
-
onChange: (e) =>
|
|
1650
|
+
children: /* @__PURE__ */ (0, G.jsx)(l, {
|
|
1651
|
+
ref: p,
|
|
1652
|
+
value: d,
|
|
1653
|
+
onChange: (e) => f(e.target.value),
|
|
1655
1654
|
placeholder: r,
|
|
1656
1655
|
"data-testid": a,
|
|
1657
1656
|
className: "h-8"
|
|
1658
1657
|
})
|
|
1659
|
-
}), /* @__PURE__ */ (0,
|
|
1658
|
+
}), /* @__PURE__ */ (0, G.jsx)("div", {
|
|
1660
1659
|
className: "max-h-64 overflow-y-auto",
|
|
1661
|
-
children:
|
|
1660
|
+
children: h.length === 0 ? /* @__PURE__ */ (0, G.jsx)("p", {
|
|
1662
1661
|
className: "px-3 py-4 text-xs text-muted-foreground",
|
|
1663
1662
|
children: "No results found."
|
|
1664
|
-
}) :
|
|
1663
|
+
}) : h.map((e, r) => /* @__PURE__ */ (0, G.jsx)(S, {
|
|
1665
1664
|
index: r,
|
|
1666
1665
|
label: e.label,
|
|
1667
1666
|
checked: t === e.value,
|
|
1668
1667
|
"data-testid": o(e.value),
|
|
1669
1668
|
onSelect: () => {
|
|
1670
|
-
n(e.value),
|
|
1669
|
+
n(e.value), u(!1);
|
|
1671
1670
|
}
|
|
1672
1671
|
}, e.value))
|
|
1673
1672
|
})]
|
|
1674
1673
|
})]
|
|
1675
1674
|
});
|
|
1676
1675
|
}
|
|
1677
|
-
function at({ displayMode: e, onDisplayModeChange: t, toolCallId: n, propsContext:
|
|
1678
|
-
let { resolvedTheme: C, setTheme: w } =
|
|
1679
|
-
(0,
|
|
1680
|
-
|
|
1681
|
-
}, [
|
|
1682
|
-
let [
|
|
1683
|
-
mode:
|
|
1684
|
-
declared:
|
|
1676
|
+
function at({ displayMode: e, onDisplayModeChange: t, toolCallId: n, propsContext: i, resourceUri: l, toolInput: u, resourceAnnotations: f, llmConfig: h, resource: _, onPropsChange: v, requiredProps: b }) {
|
|
1677
|
+
let { resolvedTheme: C, setTheme: w } = ve(), { playground: T, updatePlaygroundSettings: E, widgets: D, clearCspViolations: O } = _e(), k = D.get(n), P = k?.cspViolations ?? [], I = k?.declaredCsp, L = k?.effectivePolicy, de = P.length > 0 ? $e(P, I) : null, pe = P.length > 0 ? tt(I, L, P, de) : "", he = e === "fullscreen", ge = e === "pip", { presets: z, activePresetId: B, savePreset: Se, deletePreset: Te, setActivePreset: V, getActiveProps: Pe } = Re(l), [Ie, U] = (0, H.useState)(!1), W = !!b?.length && !B, [ze, Be] = (0, H.useState)(() => W);
|
|
1678
|
+
(0, H.useEffect)(() => {
|
|
1679
|
+
W && Be(!0);
|
|
1680
|
+
}, [W]);
|
|
1681
|
+
let [K, q] = (0, H.useState)(null), [Ve, He] = (0, H.useState)(!1), [J, Ue] = (0, H.useState)("mode"), [We, Ge] = (0, H.useState)(!0), qe = (0, H.useMemo)(() => ye(I), [I]), Je = (0, H.useMemo)(() => be(L), [L]), Y = (0, H.useMemo)(() => Ce(qe, Je), [qe, Je]), Ye = (0, H.useMemo)(() => xe({
|
|
1682
|
+
mode: T.cspMode,
|
|
1683
|
+
declared: I,
|
|
1685
1684
|
effectivePolicy: L,
|
|
1686
1685
|
violations: P
|
|
1687
1686
|
}), [
|
|
1688
|
-
|
|
1689
|
-
|
|
1687
|
+
T.cspMode,
|
|
1688
|
+
I,
|
|
1690
1689
|
L,
|
|
1691
1690
|
P
|
|
1692
|
-
]), Xe = (0,
|
|
1693
|
-
(0,
|
|
1694
|
-
|
|
1691
|
+
]), Xe = (0, H.useCallback)(() => i === "tool" && u ? $ : Q, [i, u]), [X, Z] = (0, H.useState)(Xe());
|
|
1692
|
+
(0, H.useEffect)(() => {
|
|
1693
|
+
B && i !== "tool" ? Z(B) : X !== Q && X !== $ && Z(Xe());
|
|
1695
1694
|
}, [
|
|
1696
|
-
|
|
1695
|
+
B,
|
|
1697
1696
|
X,
|
|
1698
1697
|
Xe,
|
|
1699
|
-
|
|
1700
|
-
]), (0,
|
|
1701
|
-
if (
|
|
1702
|
-
if (X === Q || X === $)
|
|
1703
|
-
else if (
|
|
1704
|
-
let e =
|
|
1705
|
-
e &&
|
|
1698
|
+
i
|
|
1699
|
+
]), (0, H.useEffect)(() => {
|
|
1700
|
+
if (v) {
|
|
1701
|
+
if (X === Q || X === $) v(null);
|
|
1702
|
+
else if (B && X === B) {
|
|
1703
|
+
let e = Pe();
|
|
1704
|
+
e && v(e);
|
|
1706
1705
|
}
|
|
1707
1706
|
}
|
|
1708
1707
|
}, [
|
|
1709
1708
|
X,
|
|
1710
|
-
|
|
1709
|
+
B,
|
|
1711
1710
|
u,
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1711
|
+
Pe,
|
|
1712
|
+
v,
|
|
1713
|
+
z
|
|
1715
1714
|
]);
|
|
1716
1715
|
let et = (e) => {
|
|
1717
1716
|
if (e === nt) {
|
|
1718
|
-
|
|
1717
|
+
q(null), U(!0);
|
|
1719
1718
|
return;
|
|
1720
1719
|
}
|
|
1721
|
-
if (e === Q || e === $)
|
|
1720
|
+
if (e === Q || e === $) V(null), Z(e), v?.(null);
|
|
1722
1721
|
else {
|
|
1723
|
-
|
|
1724
|
-
let t =
|
|
1725
|
-
|
|
1722
|
+
V(e), Z(e);
|
|
1723
|
+
let t = z.find((t) => t.id === e);
|
|
1724
|
+
v?.(t?.props ?? null);
|
|
1726
1725
|
}
|
|
1727
1726
|
}, at = (e) => {
|
|
1728
|
-
|
|
1727
|
+
Se(e), V(e.id), Z(e.id), v?.(e.props);
|
|
1729
1728
|
}, ot = (e, t) => {
|
|
1730
1729
|
t.stopPropagation();
|
|
1731
|
-
let n =
|
|
1732
|
-
n && (
|
|
1730
|
+
let n = z.find((t) => t.id === e);
|
|
1731
|
+
n && (Te(e), R.success("Preset deleted", { description: `Preset "${n.name}" has been deleted.` }));
|
|
1733
1732
|
}, st = (e, t) => {
|
|
1734
|
-
t.stopPropagation(),
|
|
1733
|
+
t.stopPropagation(), q(e), U(!0);
|
|
1735
1734
|
}, ct = () => {
|
|
1736
|
-
switch (
|
|
1737
|
-
case "mobile": return /* @__PURE__ */ (0,
|
|
1738
|
-
case "tablet": return /* @__PURE__ */ (0,
|
|
1739
|
-
default: return /* @__PURE__ */ (0,
|
|
1735
|
+
switch (T.deviceType) {
|
|
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" });
|
|
1740
1739
|
}
|
|
1741
|
-
}, lt = rt.findIndex((e) => e.value ===
|
|
1742
|
-
return /* @__PURE__ */ (0,
|
|
1740
|
+
}, lt = rt.findIndex((e) => e.value === T.deviceType);
|
|
1741
|
+
return /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1743
1742
|
className: "flex items-center gap-2",
|
|
1744
1743
|
children: [
|
|
1745
|
-
!
|
|
1746
|
-
render: /* @__PURE__ */ (0,
|
|
1744
|
+
!he && !ge && /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [/* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
1745
|
+
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
1747
1746
|
"data-testid": "debugger-fullscreen-button",
|
|
1748
1747
|
variant: "outline",
|
|
1749
1748
|
size: "sm",
|
|
1750
1749
|
className: "bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
1751
1750
|
onClick: () => t("fullscreen"),
|
|
1752
|
-
children: /* @__PURE__ */ (0,
|
|
1751
|
+
children: /* @__PURE__ */ (0, G.jsx)(fe, { className: "size-4" })
|
|
1753
1752
|
}),
|
|
1754
1753
|
nativeButton: !0
|
|
1755
|
-
}), /* @__PURE__ */ (0,
|
|
1756
|
-
render: /* @__PURE__ */ (0,
|
|
1754
|
+
}), /* @__PURE__ */ (0, G.jsx)(s, { children: "Enter fullscreen mode" })] }), /* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
1755
|
+
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
1757
1756
|
"data-testid": "debugger-pip-button",
|
|
1758
1757
|
variant: "outline",
|
|
1759
1758
|
size: "sm",
|
|
1760
1759
|
className: "bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
1761
1760
|
onClick: () => t("pip"),
|
|
1762
|
-
children: /* @__PURE__ */ (0,
|
|
1761
|
+
children: /* @__PURE__ */ (0, G.jsx)(De, { className: "size-4" })
|
|
1763
1762
|
}),
|
|
1764
1763
|
nativeButton: !0
|
|
1765
|
-
}), /* @__PURE__ */ (0,
|
|
1766
|
-
/* @__PURE__ */ (0,
|
|
1767
|
-
render: /* @__PURE__ */ (0,
|
|
1768
|
-
render: /* @__PURE__ */ (0,
|
|
1764
|
+
}), /* @__PURE__ */ (0, G.jsx)(s, { children: "Picture-in-picture" })] })] }),
|
|
1765
|
+
/* @__PURE__ */ (0, G.jsxs)(x, { children: [/* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
1766
|
+
render: /* @__PURE__ */ (0, G.jsx)(d, {
|
|
1767
|
+
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
1769
1768
|
"data-testid": "debugger-device-button",
|
|
1770
1769
|
variant: "outline",
|
|
1771
1770
|
size: "sm",
|
|
@@ -1775,21 +1774,21 @@ function at({ displayMode: e, onDisplayModeChange: t, toolCallId: n, propsContex
|
|
|
1775
1774
|
nativeButton: !0
|
|
1776
1775
|
}),
|
|
1777
1776
|
nativeButton: !0
|
|
1778
|
-
}), /* @__PURE__ */ (0,
|
|
1777
|
+
}), /* @__PURE__ */ (0, G.jsxs)(s, { children: ["Device: ", T.deviceType] })] }), /* @__PURE__ */ (0, G.jsx)(m, {
|
|
1779
1778
|
"data-testid": "debugger-device-dialog",
|
|
1780
1779
|
checkedIndex: lt >= 0 ? lt : void 0,
|
|
1781
1780
|
className: "w-56",
|
|
1782
|
-
children: rt.map((e, t) => /* @__PURE__ */ (0,
|
|
1781
|
+
children: rt.map((e, t) => /* @__PURE__ */ (0, G.jsx)(S, {
|
|
1783
1782
|
index: t,
|
|
1784
1783
|
icon: e.icon,
|
|
1785
1784
|
label: e.label,
|
|
1786
|
-
checked:
|
|
1785
|
+
checked: T.deviceType === e.value,
|
|
1787
1786
|
"data-testid": `debugger-device-option-${e.value}`,
|
|
1788
|
-
onSelect: () =>
|
|
1787
|
+
onSelect: () => E({ deviceType: e.value })
|
|
1789
1788
|
}, e.value))
|
|
1790
1789
|
})] }),
|
|
1791
|
-
/* @__PURE__ */ (0,
|
|
1792
|
-
render: /* @__PURE__ */ (0,
|
|
1790
|
+
/* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
1791
|
+
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
1793
1792
|
"data-testid": "debugger-theme-button",
|
|
1794
1793
|
variant: "outline",
|
|
1795
1794
|
size: "sm",
|
|
@@ -1797,88 +1796,88 @@ function at({ displayMode: e, onDisplayModeChange: t, toolCallId: n, propsContex
|
|
|
1797
1796
|
onClick: () => {
|
|
1798
1797
|
w(C === "dark" ? "light" : "dark");
|
|
1799
1798
|
},
|
|
1800
|
-
children: C === "dark" ? /* @__PURE__ */ (0,
|
|
1799
|
+
children: C === "dark" ? /* @__PURE__ */ (0, G.jsx)(N, { className: "size-3.5" }) : /* @__PURE__ */ (0, G.jsx)(F, { className: "size-3.5" })
|
|
1801
1800
|
}),
|
|
1802
1801
|
nativeButton: !0
|
|
1803
|
-
}), /* @__PURE__ */ (0,
|
|
1804
|
-
/* @__PURE__ */ (0,
|
|
1805
|
-
options:
|
|
1806
|
-
value:
|
|
1807
|
-
onValueChange: (e) =>
|
|
1802
|
+
}), /* @__PURE__ */ (0, G.jsxs)(s, { children: ["Theme: ", C === "dark" ? "Dark" : "Light"] })] }),
|
|
1803
|
+
/* @__PURE__ */ (0, G.jsx)(it, {
|
|
1804
|
+
options: Fe,
|
|
1805
|
+
value: T.locale,
|
|
1806
|
+
onValueChange: (e) => E({ locale: e }),
|
|
1808
1807
|
placeholder: "Search locales...",
|
|
1809
1808
|
contentTestId: "debugger-locale-dialog",
|
|
1810
1809
|
searchTestId: "debugger-locale-search",
|
|
1811
1810
|
optionTestId: (e) => `debugger-locale-option-${e}`,
|
|
1812
|
-
trigger: /* @__PURE__ */ (0,
|
|
1813
|
-
render: /* @__PURE__ */ (0,
|
|
1814
|
-
render: /* @__PURE__ */ (0,
|
|
1811
|
+
trigger: /* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
1812
|
+
render: /* @__PURE__ */ (0, G.jsx)(d, {
|
|
1813
|
+
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
1815
1814
|
"data-testid": "debugger-locale-button",
|
|
1816
1815
|
variant: "outline",
|
|
1817
1816
|
size: "sm",
|
|
1818
1817
|
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",
|
|
1819
|
-
children: /* @__PURE__ */ (0,
|
|
1818
|
+
children: /* @__PURE__ */ (0, G.jsx)("span", {
|
|
1820
1819
|
className: "text-xs font-mono",
|
|
1821
|
-
children:
|
|
1820
|
+
children: T.locale
|
|
1822
1821
|
})
|
|
1823
1822
|
}),
|
|
1824
1823
|
nativeButton: !0
|
|
1825
1824
|
}),
|
|
1826
1825
|
nativeButton: !0
|
|
1827
|
-
}), /* @__PURE__ */ (0,
|
|
1826
|
+
}), /* @__PURE__ */ (0, G.jsx)(s, { children: "Locale" })] })
|
|
1828
1827
|
}),
|
|
1829
|
-
/* @__PURE__ */ (0,
|
|
1830
|
-
options:
|
|
1831
|
-
value:
|
|
1832
|
-
onValueChange: (e) =>
|
|
1828
|
+
/* @__PURE__ */ (0, G.jsx)(it, {
|
|
1829
|
+
options: Le,
|
|
1830
|
+
value: T.timeZone,
|
|
1831
|
+
onValueChange: (e) => E({ timeZone: e }),
|
|
1833
1832
|
placeholder: "Search timezones...",
|
|
1834
1833
|
contentTestId: "debugger-timezone-dialog",
|
|
1835
1834
|
searchTestId: "debugger-timezone-search",
|
|
1836
1835
|
optionTestId: (e) => `debugger-timezone-option-${e.replace(/\//g, "-")}`,
|
|
1837
|
-
trigger: /* @__PURE__ */ (0,
|
|
1838
|
-
render: /* @__PURE__ */ (0,
|
|
1839
|
-
render: /* @__PURE__ */ (0,
|
|
1836
|
+
trigger: /* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
1837
|
+
render: /* @__PURE__ */ (0, G.jsx)(d, {
|
|
1838
|
+
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
1840
1839
|
"data-testid": "debugger-timezone-button",
|
|
1841
1840
|
variant: "outline",
|
|
1842
1841
|
size: "sm",
|
|
1843
1842
|
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",
|
|
1844
|
-
children: /* @__PURE__ */ (0,
|
|
1843
|
+
children: /* @__PURE__ */ (0, G.jsx)(le, { className: "size-3.5" })
|
|
1845
1844
|
}),
|
|
1846
1845
|
nativeButton: !0
|
|
1847
1846
|
}),
|
|
1848
1847
|
nativeButton: !0
|
|
1849
|
-
}), /* @__PURE__ */ (0,
|
|
1848
|
+
}), /* @__PURE__ */ (0, G.jsxs)(s, { children: ["Timezone: ", T.timeZone] })] })
|
|
1850
1849
|
}),
|
|
1851
|
-
/* @__PURE__ */ (0,
|
|
1852
|
-
open:
|
|
1853
|
-
onOpenChange:
|
|
1854
|
-
children: [/* @__PURE__ */ (0,
|
|
1855
|
-
render: /* @__PURE__ */ (0,
|
|
1856
|
-
render: /* @__PURE__ */ (0,
|
|
1850
|
+
/* @__PURE__ */ (0, G.jsxs)(oe, {
|
|
1851
|
+
open: Ve,
|
|
1852
|
+
onOpenChange: He,
|
|
1853
|
+
children: [/* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
1854
|
+
render: /* @__PURE__ */ (0, G.jsx)(te, {
|
|
1855
|
+
render: /* @__PURE__ */ (0, G.jsxs)(c, {
|
|
1857
1856
|
"data-testid": "debugger-csp-button",
|
|
1858
1857
|
variant: "outline",
|
|
1859
1858
|
size: "sm",
|
|
1860
1859
|
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",
|
|
1861
|
-
children: [
|
|
1862
|
-
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 ${
|
|
1860
|
+
children: [T.cspMode === "permissive" ? /* @__PURE__ */ (0, G.jsx)(Ae, { className: "size-3.5" }) : /* @__PURE__ */ (0, G.jsx)(ke, { className: "size-3.5" }), P.length > 0 && /* @__PURE__ */ (0, G.jsx)("span", {
|
|
1861
|
+
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"}`,
|
|
1863
1862
|
children: P.length > 99 ? "99+" : P.length
|
|
1864
1863
|
})]
|
|
1865
1864
|
}),
|
|
1866
1865
|
nativeButton: !0
|
|
1867
1866
|
}),
|
|
1868
1867
|
nativeButton: !0
|
|
1869
|
-
}), /* @__PURE__ */ (0,
|
|
1868
|
+
}), /* @__PURE__ */ (0, G.jsxs)(s, { children: [
|
|
1870
1869
|
"CSP:",
|
|
1871
1870
|
" ",
|
|
1872
|
-
|
|
1873
|
-
P.length > 0 && ` · ${P.length} ${
|
|
1874
|
-
] })] }), /* @__PURE__ */ (0,
|
|
1871
|
+
T.cspMode === "permissive" ? "Permissive" : "Declared",
|
|
1872
|
+
P.length > 0 && ` · ${P.length} ${T.cspMode === "permissive" ? "would be blocked" : "blocked"}`
|
|
1873
|
+
] })] }), /* @__PURE__ */ (0, G.jsxs)(ie, {
|
|
1875
1874
|
scrollable: !0,
|
|
1876
1875
|
className: "sm:max-w-[520px] max-h-[85vh]",
|
|
1877
1876
|
"data-testid": "debugger-csp-dialog",
|
|
1878
|
-
children: [/* @__PURE__ */ (0,
|
|
1877
|
+
children: [/* @__PURE__ */ (0, G.jsx)(re, { children: /* @__PURE__ */ (0, G.jsx)(ee, { children: "CSP Mode" }) }), /* @__PURE__ */ (0, G.jsxs)(ne, {
|
|
1879
1878
|
className: "space-y-3",
|
|
1880
1879
|
children: [
|
|
1881
|
-
/* @__PURE__ */ (0,
|
|
1880
|
+
/* @__PURE__ */ (0, G.jsx)("div", {
|
|
1882
1881
|
role: "tablist",
|
|
1883
1882
|
"aria-label": "CSP diagnostics",
|
|
1884
1883
|
className: "grid grid-cols-3 rounded-md border border-zinc-200 dark:border-zinc-700 p-1",
|
|
@@ -1886,129 +1885,129 @@ function at({ displayMode: e, onDisplayModeChange: t, toolCallId: n, propsContex
|
|
|
1886
1885
|
["mode", "Mode"],
|
|
1887
1886
|
["diff", "Policy Diff"],
|
|
1888
1887
|
["findings", "Findings"]
|
|
1889
|
-
].map(([e, t]) => /* @__PURE__ */ (0,
|
|
1888
|
+
].map(([e, t]) => /* @__PURE__ */ (0, G.jsx)("button", {
|
|
1890
1889
|
type: "button",
|
|
1891
1890
|
role: "tab",
|
|
1892
|
-
"aria-selected":
|
|
1893
|
-
onClick: () =>
|
|
1894
|
-
className: `rounded px-2 py-1.5 text-xs font-medium ${
|
|
1891
|
+
"aria-selected": J === e,
|
|
1892
|
+
onClick: () => Ue(e),
|
|
1893
|
+
className: `rounded px-2 py-1.5 text-xs font-medium ${J === e ? "bg-zinc-100 dark:bg-zinc-800" : "text-muted-foreground"}`,
|
|
1895
1894
|
children: t
|
|
1896
1895
|
}, e))
|
|
1897
1896
|
}),
|
|
1898
|
-
|
|
1897
|
+
J === "mode" && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1899
1898
|
role: "tabpanel",
|
|
1900
1899
|
className: "space-y-2",
|
|
1901
1900
|
children: [
|
|
1902
|
-
/* @__PURE__ */ (0,
|
|
1901
|
+
/* @__PURE__ */ (0, G.jsxs)(c, {
|
|
1903
1902
|
"data-testid": "debugger-csp-option-permissive",
|
|
1904
|
-
variant:
|
|
1903
|
+
variant: T.cspMode === "permissive" ? "default" : "outline",
|
|
1905
1904
|
className: "w-full justify-start",
|
|
1906
|
-
onClick: () =>
|
|
1907
|
-
children: [/* @__PURE__ */ (0,
|
|
1905
|
+
onClick: () => E({ cspMode: "permissive" }),
|
|
1906
|
+
children: [/* @__PURE__ */ (0, G.jsx)(Ae, { className: "size-4 mr-2" }), "Permissive"]
|
|
1908
1907
|
}),
|
|
1909
|
-
/* @__PURE__ */ (0,
|
|
1908
|
+
/* @__PURE__ */ (0, G.jsxs)(c, {
|
|
1910
1909
|
"data-testid": "debugger-csp-option-widget-declared",
|
|
1911
|
-
variant:
|
|
1910
|
+
variant: T.cspMode === "widget-declared" ? "default" : "outline",
|
|
1912
1911
|
className: "w-full justify-start",
|
|
1913
|
-
onClick: () =>
|
|
1914
|
-
children: [/* @__PURE__ */ (0,
|
|
1912
|
+
onClick: () => E({ cspMode: "widget-declared" }),
|
|
1913
|
+
children: [/* @__PURE__ */ (0, G.jsx)(ke, { className: "size-4 mr-2" }), "Widget-Declared"]
|
|
1915
1914
|
}),
|
|
1916
|
-
/* @__PURE__ */ (0,
|
|
1915
|
+
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
1917
1916
|
className: "text-xs text-muted-foreground",
|
|
1918
1917
|
children: "Permissive records would-be blocks; Widget-Declared enforces the resource metadata policy."
|
|
1919
1918
|
})
|
|
1920
1919
|
]
|
|
1921
1920
|
}),
|
|
1922
|
-
|
|
1921
|
+
J === "diff" && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1923
1922
|
role: "tabpanel",
|
|
1924
1923
|
className: "space-y-2",
|
|
1925
|
-
children: [Y.length ? /* @__PURE__ */ (0,
|
|
1924
|
+
children: [Y.length ? /* @__PURE__ */ (0, G.jsx)("div", {
|
|
1926
1925
|
className: "max-h-64 overflow-y-auto rounded border border-zinc-200 dark:border-zinc-700",
|
|
1927
|
-
children: Y.map((e) => /* @__PURE__ */ (0,
|
|
1926
|
+
children: Y.map((e) => /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1928
1927
|
className: "border-b border-zinc-100 dark:border-zinc-800 p-2 text-xs last:border-0",
|
|
1929
|
-
children: [/* @__PURE__ */ (0,
|
|
1928
|
+
children: [/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1930
1929
|
className: "flex items-center justify-between",
|
|
1931
|
-
children: [/* @__PURE__ */ (0,
|
|
1930
|
+
children: [/* @__PURE__ */ (0, G.jsx)("code", { children: e.directive }), /* @__PURE__ */ (0, G.jsx)("span", {
|
|
1932
1931
|
className: "text-[10px] uppercase text-muted-foreground",
|
|
1933
1932
|
children: e.status
|
|
1934
1933
|
})]
|
|
1935
|
-
}), /* @__PURE__ */ (0,
|
|
1934
|
+
}), /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1936
1935
|
className: "mt-1 font-mono text-[10px] text-muted-foreground break-all",
|
|
1937
1936
|
children: [
|
|
1938
1937
|
"requested: ",
|
|
1939
1938
|
e.requested.join(" ") || "—",
|
|
1940
|
-
/* @__PURE__ */ (0,
|
|
1939
|
+
/* @__PURE__ */ (0, G.jsx)("br", {}),
|
|
1941
1940
|
"effective: ",
|
|
1942
1941
|
e.effective.join(" ") || "—"
|
|
1943
1942
|
]
|
|
1944
1943
|
})]
|
|
1945
1944
|
}, e.directive))
|
|
1946
|
-
}) : /* @__PURE__ */ (0,
|
|
1945
|
+
}) : /* @__PURE__ */ (0, G.jsx)("p", {
|
|
1947
1946
|
className: "text-xs text-muted-foreground",
|
|
1948
1947
|
children: "No requested or effective policy data yet."
|
|
1949
|
-
}), L && /* @__PURE__ */ (0,
|
|
1948
|
+
}), L && /* @__PURE__ */ (0, G.jsxs)(c, {
|
|
1950
1949
|
variant: "outline",
|
|
1951
1950
|
size: "sm",
|
|
1952
1951
|
onClick: async () => {
|
|
1953
1952
|
try {
|
|
1954
|
-
await
|
|
1953
|
+
await ce(L), R.success("Policy copied to clipboard");
|
|
1955
1954
|
} catch {
|
|
1956
|
-
|
|
1955
|
+
R.error("Failed to copy");
|
|
1957
1956
|
}
|
|
1958
1957
|
},
|
|
1959
|
-
children: [/* @__PURE__ */ (0,
|
|
1958
|
+
children: [/* @__PURE__ */ (0, G.jsx)(se, { className: "size-3.5 mr-2" }), "Copy effective policy"]
|
|
1960
1959
|
})]
|
|
1961
1960
|
}),
|
|
1962
|
-
|
|
1961
|
+
J === "findings" && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1963
1962
|
role: "tabpanel",
|
|
1964
1963
|
className: "space-y-2",
|
|
1965
|
-
children: [/* @__PURE__ */ (0,
|
|
1964
|
+
children: [/* @__PURE__ */ (0, G.jsx)("div", {
|
|
1966
1965
|
className: "space-y-1.5",
|
|
1967
|
-
children: Ye.map((e, t) => /* @__PURE__ */ (0,
|
|
1966
|
+
children: Ye.map((e, t) => /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1968
1967
|
className: "rounded border border-zinc-200 dark:border-zinc-700 p-2",
|
|
1969
|
-
children: [/* @__PURE__ */ (0,
|
|
1968
|
+
children: [/* @__PURE__ */ (0, G.jsx)("div", {
|
|
1970
1969
|
className: "text-xs font-medium",
|
|
1971
1970
|
children: e.title
|
|
1972
|
-
}), /* @__PURE__ */ (0,
|
|
1971
|
+
}), /* @__PURE__ */ (0, G.jsx)("div", {
|
|
1973
1972
|
className: "text-[11px] text-muted-foreground break-all",
|
|
1974
1973
|
children: e.detail
|
|
1975
1974
|
})]
|
|
1976
1975
|
}, `${e.title}-${t}`))
|
|
1977
|
-
}), P.length > 0 && /* @__PURE__ */ (0,
|
|
1976
|
+
}), P.length > 0 && /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1978
1977
|
className: "flex items-center justify-between",
|
|
1979
|
-
children: [/* @__PURE__ */ (0,
|
|
1978
|
+
children: [/* @__PURE__ */ (0, G.jsxs)("span", {
|
|
1980
1979
|
className: "text-xs font-medium",
|
|
1981
1980
|
children: [
|
|
1982
1981
|
P.length,
|
|
1983
1982
|
" observed request",
|
|
1984
1983
|
P.length === 1 ? "" : "s"
|
|
1985
1984
|
]
|
|
1986
|
-
}), /* @__PURE__ */ (0,
|
|
1985
|
+
}), /* @__PURE__ */ (0, G.jsx)("button", {
|
|
1987
1986
|
className: "text-xs text-muted-foreground underline",
|
|
1988
|
-
onClick: () =>
|
|
1987
|
+
onClick: () => O(n),
|
|
1989
1988
|
children: "Clear"
|
|
1990
1989
|
})]
|
|
1991
|
-
}), /* @__PURE__ */ (0,
|
|
1990
|
+
}), /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1992
1991
|
className: "border border-amber-200 dark:border-amber-800 rounded-md overflow-hidden",
|
|
1993
|
-
children: [/* @__PURE__ */ (0,
|
|
1992
|
+
children: [/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1994
1993
|
className: "flex items-center justify-between bg-amber-50 dark:bg-amber-950/30 px-3 py-2",
|
|
1995
|
-
children: [/* @__PURE__ */ (0,
|
|
1994
|
+
children: [/* @__PURE__ */ (0, G.jsxs)("button", {
|
|
1996
1995
|
type: "button",
|
|
1997
1996
|
className: "flex items-center gap-2 text-xs font-medium text-amber-800 dark:text-amber-200",
|
|
1998
|
-
onClick: () =>
|
|
1999
|
-
children: [
|
|
2000
|
-
}), /* @__PURE__ */ (0,
|
|
1997
|
+
onClick: () => Ge((e) => !e),
|
|
1998
|
+
children: [We ? /* @__PURE__ */ (0, G.jsx)(A, { className: "size-3.5" }) : /* @__PURE__ */ (0, G.jsx)(r, { className: "size-3.5" }), "Prompt for Agents"]
|
|
1999
|
+
}), /* @__PURE__ */ (0, G.jsx)(c, {
|
|
2001
2000
|
variant: "ghost",
|
|
2002
2001
|
size: "sm",
|
|
2003
2002
|
className: "h-7 w-7 p-0",
|
|
2004
|
-
onClick: () => void
|
|
2003
|
+
onClick: () => void ce(pe),
|
|
2005
2004
|
"aria-label": "Copy prompt for agents",
|
|
2006
|
-
children: /* @__PURE__ */ (0,
|
|
2005
|
+
children: /* @__PURE__ */ (0, G.jsx)(se, { className: "size-3.5" })
|
|
2007
2006
|
})]
|
|
2008
|
-
}),
|
|
2007
|
+
}), We && /* @__PURE__ */ (0, G.jsx)("pre", {
|
|
2009
2008
|
className: "max-h-48 overflow-auto whitespace-pre-wrap p-2 text-[11px]",
|
|
2010
2009
|
"data-testid": "debugger-csp-prompt-for-agents",
|
|
2011
|
-
children:
|
|
2010
|
+
children: pe
|
|
2012
2011
|
})]
|
|
2013
2012
|
})] })]
|
|
2014
2013
|
})
|
|
@@ -2016,125 +2015,125 @@ function at({ displayMode: e, onDisplayModeChange: t, toolCallId: n, propsContex
|
|
|
2016
2015
|
})]
|
|
2017
2016
|
})]
|
|
2018
2017
|
}),
|
|
2019
|
-
/* @__PURE__ */ (0,
|
|
2020
|
-
render: /* @__PURE__ */ (0,
|
|
2018
|
+
/* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
2019
|
+
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
2021
2020
|
"data-testid": "debugger-touch-button",
|
|
2022
2021
|
variant: "outline",
|
|
2023
2022
|
size: "sm",
|
|
2024
|
-
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 ${
|
|
2023
|
+
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 ${T.capabilities.touch ? "border-blue-500 dark:border-blue-400" : ""}`,
|
|
2025
2024
|
onClick: () => {
|
|
2026
|
-
|
|
2027
|
-
...
|
|
2028
|
-
touch: !
|
|
2025
|
+
E({ capabilities: {
|
|
2026
|
+
...T.capabilities,
|
|
2027
|
+
touch: !T.capabilities.touch
|
|
2029
2028
|
} });
|
|
2030
2029
|
},
|
|
2031
|
-
children: /* @__PURE__ */ (0,
|
|
2030
|
+
children: /* @__PURE__ */ (0, G.jsx)(Oe, { className: `size-3.5 ${T.capabilities.touch ? "text-blue-600 dark:text-blue-400" : ""}` })
|
|
2032
2031
|
}),
|
|
2033
2032
|
nativeButton: !0
|
|
2034
|
-
}), /* @__PURE__ */ (0,
|
|
2035
|
-
/* @__PURE__ */ (0,
|
|
2036
|
-
render: /* @__PURE__ */ (0,
|
|
2033
|
+
}), /* @__PURE__ */ (0, G.jsxs)(s, { children: ["Touch: ", T.capabilities.touch ? "Enabled" : "Disabled"] })] }),
|
|
2034
|
+
/* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
2035
|
+
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
2037
2036
|
"data-testid": "debugger-hover-button",
|
|
2038
2037
|
variant: "outline",
|
|
2039
2038
|
size: "sm",
|
|
2040
|
-
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 ${
|
|
2039
|
+
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 ${T.capabilities.hover ? "border-blue-500 dark:border-blue-400" : ""}`,
|
|
2041
2040
|
onClick: () => {
|
|
2042
|
-
|
|
2043
|
-
...
|
|
2044
|
-
hover: !
|
|
2041
|
+
E({ capabilities: {
|
|
2042
|
+
...T.capabilities,
|
|
2043
|
+
hover: !T.capabilities.hover
|
|
2045
2044
|
} });
|
|
2046
2045
|
},
|
|
2047
|
-
children: /* @__PURE__ */ (0,
|
|
2046
|
+
children: /* @__PURE__ */ (0, G.jsx)(Ee, { className: `size-3.5 ${T.capabilities.hover ? "text-blue-600 dark:text-blue-400" : ""}` })
|
|
2048
2047
|
}),
|
|
2049
2048
|
nativeButton: !0
|
|
2050
|
-
}), /* @__PURE__ */ (0,
|
|
2051
|
-
/* @__PURE__ */ (0,
|
|
2052
|
-
render: /* @__PURE__ */ (0,
|
|
2049
|
+
}), /* @__PURE__ */ (0, G.jsxs)(s, { children: ["Hover: ", T.capabilities.hover ? "Enabled" : "Disabled"] })] }),
|
|
2050
|
+
/* @__PURE__ */ (0, G.jsxs)(y, { children: [/* @__PURE__ */ (0, G.jsx)(g, {
|
|
2051
|
+
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
2053
2052
|
"data-testid": "debugger-safe-area-button",
|
|
2054
2053
|
variant: "outline",
|
|
2055
2054
|
size: "sm",
|
|
2056
2055
|
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",
|
|
2057
|
-
children: /* @__PURE__ */ (0,
|
|
2056
|
+
children: /* @__PURE__ */ (0, G.jsx)(Me, { className: "size-3.5" })
|
|
2058
2057
|
}),
|
|
2059
2058
|
nativeButton: !0
|
|
2060
|
-
}), /* @__PURE__ */ (0,
|
|
2059
|
+
}), /* @__PURE__ */ (0, G.jsx)(p, {
|
|
2061
2060
|
className: "w-64 p-3",
|
|
2062
2061
|
"data-testid": "debugger-safe-area-dialog",
|
|
2063
|
-
children: /* @__PURE__ */ (0,
|
|
2062
|
+
children: /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
2064
2063
|
className: "space-y-2",
|
|
2065
|
-
children: [/* @__PURE__ */ (0,
|
|
2064
|
+
children: [/* @__PURE__ */ (0, G.jsx)("label", {
|
|
2066
2065
|
className: "text-xs font-medium",
|
|
2067
2066
|
children: "Safe Area Insets"
|
|
2068
|
-
}), /* @__PURE__ */ (0,
|
|
2069
|
-
value:
|
|
2067
|
+
}), /* @__PURE__ */ (0, G.jsx)(Qe, {
|
|
2068
|
+
value: T.safeAreaInsets,
|
|
2070
2069
|
onChange: (e) => {
|
|
2071
|
-
|
|
2070
|
+
E({ safeAreaInsets: e });
|
|
2072
2071
|
}
|
|
2073
2072
|
})]
|
|
2074
2073
|
})
|
|
2075
2074
|
})] }),
|
|
2076
|
-
|
|
2077
|
-
render: /* @__PURE__ */ (0,
|
|
2078
|
-
render: /* @__PURE__ */ (0,
|
|
2075
|
+
i === "tool" ? /* @__PURE__ */ (0, G.jsxs)(oe, { children: [/* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
2076
|
+
render: /* @__PURE__ */ (0, G.jsx)(te, {
|
|
2077
|
+
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
2079
2078
|
variant: "outline",
|
|
2080
2079
|
size: "sm",
|
|
2081
2080
|
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",
|
|
2082
2081
|
"data-testid": "debugger-props-button",
|
|
2083
|
-
children: /* @__PURE__ */ (0,
|
|
2082
|
+
children: /* @__PURE__ */ (0, G.jsx)(we, { className: "size-3.5" })
|
|
2084
2083
|
}),
|
|
2085
2084
|
nativeButton: !0
|
|
2086
2085
|
}),
|
|
2087
2086
|
nativeButton: !0
|
|
2088
|
-
}), /* @__PURE__ */ (0,
|
|
2087
|
+
}), /* @__PURE__ */ (0, G.jsx)(s, { children: "View Tool Props" })] }), /* @__PURE__ */ (0, G.jsxs)(ie, {
|
|
2089
2088
|
scrollable: !0,
|
|
2090
2089
|
className: "sm:max-w-[600px] max-h-[85vh]",
|
|
2091
2090
|
"data-testid": "debugger-props-dialog",
|
|
2092
|
-
children: [/* @__PURE__ */ (0,
|
|
2091
|
+
children: [/* @__PURE__ */ (0, G.jsx)(re, { children: /* @__PURE__ */ (0, G.jsx)(ee, { children: "Tool Props" }) }), /* @__PURE__ */ (0, G.jsx)(ne, { children: /* @__PURE__ */ (0, G.jsx)(ae, { children: /* @__PURE__ */ (0, G.jsx)(ue, {
|
|
2093
2092
|
data: u ?? {},
|
|
2094
2093
|
filename: "tool-props.json"
|
|
2095
2094
|
}) }) })]
|
|
2096
|
-
})] }) : /* @__PURE__ */ (0,
|
|
2097
|
-
open:
|
|
2098
|
-
onOpenChange:
|
|
2099
|
-
children: [/* @__PURE__ */ (0,
|
|
2100
|
-
render: /* @__PURE__ */ (0,
|
|
2101
|
-
render: /* @__PURE__ */ (0,
|
|
2095
|
+
})] }) : /* @__PURE__ */ (0, G.jsxs)(y, {
|
|
2096
|
+
open: ze,
|
|
2097
|
+
onOpenChange: Be,
|
|
2098
|
+
children: [/* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
2099
|
+
render: /* @__PURE__ */ (0, G.jsx)(g, {
|
|
2100
|
+
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
2102
2101
|
variant: "outline",
|
|
2103
2102
|
size: "sm",
|
|
2104
|
-
className: `h-8 w-8 p-0 backdrop-blur-sm shadow-sm ${
|
|
2103
|
+
className: `h-8 w-8 p-0 backdrop-blur-sm shadow-sm ${W ? "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"}`,
|
|
2105
2104
|
"data-testid": "debugger-props-button",
|
|
2106
|
-
children: /* @__PURE__ */ (0,
|
|
2105
|
+
children: /* @__PURE__ */ (0, G.jsx)(we, { className: `size-3.5 ${W ? "text-amber-500" : ""}` })
|
|
2107
2106
|
}),
|
|
2108
2107
|
nativeButton: !0
|
|
2109
2108
|
}),
|
|
2110
2109
|
nativeButton: !0
|
|
2111
|
-
}), /* @__PURE__ */ (0,
|
|
2110
|
+
}), /* @__PURE__ */ (0, G.jsxs)(s, { children: [
|
|
2112
2111
|
"Props:",
|
|
2113
2112
|
" ",
|
|
2114
|
-
X === Q ? "No Props" : X === $ ? "Tool Props" :
|
|
2115
|
-
] })] }), /* @__PURE__ */ (0,
|
|
2113
|
+
X === Q ? "No Props" : X === $ ? "Tool Props" : z.find((e) => e.id === X)?.name || "Custom"
|
|
2114
|
+
] })] }), /* @__PURE__ */ (0, G.jsxs)(p, {
|
|
2116
2115
|
className: "w-64 p-2",
|
|
2117
2116
|
"data-testid": "debugger-props-popover",
|
|
2118
|
-
children: [
|
|
2117
|
+
children: [W && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
2119
2118
|
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",
|
|
2120
2119
|
children: [
|
|
2121
|
-
/* @__PURE__ */ (0,
|
|
2120
|
+
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
2122
2121
|
className: "text-xs font-medium text-amber-700 dark:text-amber-300 mb-0.5",
|
|
2123
2122
|
children: "Props required to render this widget:"
|
|
2124
2123
|
}),
|
|
2125
|
-
/* @__PURE__ */ (0,
|
|
2124
|
+
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
2126
2125
|
className: "text-xs font-mono text-amber-600 dark:text-amber-400",
|
|
2127
|
-
children:
|
|
2126
|
+
children: b.join(", ")
|
|
2128
2127
|
}),
|
|
2129
|
-
/* @__PURE__ */ (0,
|
|
2128
|
+
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
2130
2129
|
className: "text-xs text-amber-500 dark:text-amber-400 mt-1",
|
|
2131
2130
|
children: "Create a preset below to set them."
|
|
2132
2131
|
})
|
|
2133
2132
|
]
|
|
2134
|
-
}), /* @__PURE__ */ (0,
|
|
2133
|
+
}), /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
2135
2134
|
className: "space-y-1",
|
|
2136
2135
|
children: [
|
|
2137
|
-
/* @__PURE__ */ (0,
|
|
2136
|
+
/* @__PURE__ */ (0, G.jsx)(c, {
|
|
2138
2137
|
variant: X === Q ? "secondary" : "ghost",
|
|
2139
2138
|
size: "sm",
|
|
2140
2139
|
className: "w-full justify-start",
|
|
@@ -2142,35 +2141,35 @@ function at({ displayMode: e, onDisplayModeChange: t, toolCallId: n, propsContex
|
|
|
2142
2141
|
"data-testid": "debugger-props-no-props",
|
|
2143
2142
|
children: "No Props"
|
|
2144
2143
|
}),
|
|
2145
|
-
|
|
2144
|
+
z.map((e) => /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
2146
2145
|
className: "relative group flex items-center",
|
|
2147
|
-
children: [/* @__PURE__ */ (0,
|
|
2146
|
+
children: [/* @__PURE__ */ (0, G.jsx)(c, {
|
|
2148
2147
|
variant: X === e.id ? "secondary" : "ghost",
|
|
2149
2148
|
size: "sm",
|
|
2150
2149
|
className: "w-full justify-start pr-14",
|
|
2151
2150
|
onClick: () => et(e.id),
|
|
2152
2151
|
"data-testid": `debugger-props-preset-${e.id}`,
|
|
2153
2152
|
children: e.name
|
|
2154
|
-
}), /* @__PURE__ */ (0,
|
|
2153
|
+
}), /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
2155
2154
|
className: "absolute right-2 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
2156
|
-
children: [/* @__PURE__ */ (0,
|
|
2155
|
+
children: [/* @__PURE__ */ (0, G.jsx)(c, {
|
|
2157
2156
|
variant: "ghost",
|
|
2158
2157
|
size: "sm",
|
|
2159
2158
|
className: "h-6 w-6 p-0",
|
|
2160
2159
|
onClick: (t) => st(e, t),
|
|
2161
2160
|
"data-testid": `debugger-props-edit-${e.id}`,
|
|
2162
|
-
children: /* @__PURE__ */ (0,
|
|
2163
|
-
}), /* @__PURE__ */ (0,
|
|
2161
|
+
children: /* @__PURE__ */ (0, G.jsx)(M, { className: "h-3 w-3" })
|
|
2162
|
+
}), /* @__PURE__ */ (0, G.jsx)(c, {
|
|
2164
2163
|
variant: "ghost",
|
|
2165
2164
|
size: "sm",
|
|
2166
2165
|
className: "h-6 w-6 p-0",
|
|
2167
2166
|
onClick: (t) => ot(e.id, t),
|
|
2168
2167
|
"data-testid": `debugger-props-delete-${e.id}`,
|
|
2169
|
-
children: /* @__PURE__ */ (0,
|
|
2168
|
+
children: /* @__PURE__ */ (0, G.jsx)(me, { className: "h-3 w-3 text-destructive" })
|
|
2170
2169
|
})]
|
|
2171
2170
|
})]
|
|
2172
2171
|
}, e.id)),
|
|
2173
|
-
/* @__PURE__ */ (0,
|
|
2172
|
+
/* @__PURE__ */ (0, G.jsx)(c, {
|
|
2174
2173
|
variant: "ghost",
|
|
2175
2174
|
size: "sm",
|
|
2176
2175
|
className: "w-full justify-start text-primary",
|
|
@@ -2182,19 +2181,19 @@ function at({ displayMode: e, onDisplayModeChange: t, toolCallId: n, propsContex
|
|
|
2182
2181
|
})]
|
|
2183
2182
|
})]
|
|
2184
2183
|
}),
|
|
2185
|
-
/* @__PURE__ */ (0,
|
|
2184
|
+
/* @__PURE__ */ (0, G.jsx)(Ke, {
|
|
2186
2185
|
iframeId: n,
|
|
2187
2186
|
enabled: !0
|
|
2188
2187
|
}),
|
|
2189
|
-
|
|
2190
|
-
open:
|
|
2191
|
-
onOpenChange:
|
|
2188
|
+
_ && /* @__PURE__ */ (0, G.jsx)(Ze, {
|
|
2189
|
+
open: Ie,
|
|
2190
|
+
onOpenChange: U,
|
|
2192
2191
|
onSave: at,
|
|
2193
|
-
existingPresets:
|
|
2194
|
-
resource:
|
|
2195
|
-
resourceAnnotations:
|
|
2196
|
-
llmConfig:
|
|
2197
|
-
editingPreset:
|
|
2192
|
+
existingPresets: z,
|
|
2193
|
+
resource: _,
|
|
2194
|
+
resourceAnnotations: f,
|
|
2195
|
+
llmConfig: h || null,
|
|
2196
|
+
editingPreset: K
|
|
2198
2197
|
})
|
|
2199
2198
|
]
|
|
2200
2199
|
});
|
|
@@ -2202,10 +2201,10 @@ function at({ displayMode: e, onDisplayModeChange: t, toolCallId: n, propsContex
|
|
|
2202
2201
|
//#endregion
|
|
2203
2202
|
//#region src/client/components/ui/WidgetWrapper.tsx
|
|
2204
2203
|
function ot({ children: e, className: t, noWrapper: n }) {
|
|
2205
|
-
return n ? e : /* @__PURE__ */ (0,
|
|
2206
|
-
className:
|
|
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),
|
|
2207
2206
|
children: e
|
|
2208
2207
|
});
|
|
2209
2208
|
}
|
|
2210
2209
|
//#endregion
|
|
2211
|
-
export { at as n,
|
|
2210
|
+
export { at as n, Te as r, ot as t };
|