@mcp-use/inspector 20.0.0-beta.5 → 20.0.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{AnimatePresence-Dcw-FOy8.js → AnimatePresence-D1bZ5_-l.js} +79 -78
- package/dist/cdn/{ChatTab-B255lH5i.js → ChatTab-DtUGK07C.js} +1628 -1561
- package/dist/cdn/CheckboxIndicator-BjF73mGX.js +252 -0
- package/dist/cdn/{ConnectionSettingsForm-DF-NS58d.js → ConnectionSettingsForm-CNuMa6jp.js} +202 -202
- package/dist/cdn/{ConnectionSettingsTab-dI-Cqe79.js → ConnectionSettingsTab-qSVQ1aIF.js} +36 -35
- package/dist/cdn/{ElicitationTab-CL1KJ0bz.js → ElicitationTab-PEmEDvC5.js} +47 -46
- package/dist/cdn/{FormContext-tmgN_Vdr.js → FormContext-NtUiZclE.js} +26 -26
- package/dist/cdn/{InspectorContext-UjtEbNod.js → InspectorContext-BBKCdfmK.js} +1 -1
- package/dist/cdn/{JSONDisplay-BFxf5oEu.js → JSONDisplay-BJqMz7Ny.js} +22 -22
- package/dist/cdn/{ListTabHeader-Cv-GmtGF.js → ListTabHeader-DzmTtN1e.js} +20 -19
- package/dist/cdn/{WidgetWrapper-B4H3Fek7.js → MCPAppsDebugControls-BpP-Ifap.js} +514 -550
- package/dist/cdn/{ManufactOAuthCallback-B98kSYCj.js → ManufactOAuthCallback-ChbbjFIT.js} +2 -2
- package/dist/cdn/{MarkdownRenderer-Ba7nA4Ie.js → MarkdownRenderer-bX1BrKgI.js} +23 -23
- package/dist/cdn/McpAppsViewPanel-jlsYQ7uS.js +56 -0
- package/dist/cdn/{NotificationsTab-CeImSrhx.js → NotificationsTab-B7uebqMV.js} +21 -21
- package/dist/cdn/{OAuthCallback-Blc2Asxc.js → OAuthCallback--NZdLoWx.js} +3 -3
- package/dist/cdn/PromptsTab-BlXDcau3.js +902 -0
- package/dist/cdn/{ResourcesTab-BGualKW-.js → ResourcesTab-D45_JojP.js} +116 -114
- package/dist/cdn/{SamplingTab-BeZBUeni.js → SamplingTab-r7tImM6L.js} +34 -33
- package/dist/cdn/{ServerMetadataTab-CvrKX8fz.js → ServerMetadataTab-BM3VhSLf.js} +9 -9
- package/dist/cdn/{StatusIcon-D0-ARyOh.js → StatusIcon-Q3n3YRtE.js} +10 -11
- package/dist/cdn/{ToolsTab-j6n4O_3s.js → ToolsTab-DOAO8HnS.js} +664 -652
- package/dist/cdn/{ViewPreview-DihyG6Qd.js → ViewPreview-CBhrVdwx.js} +3 -3
- package/dist/cdn/{WidgetDebugContext-D4usL_MA.js → WidgetDebugContext-B6yoOVVV.js} +1 -11
- package/dist/cdn/WidgetWrapper-BlbQAh_X.js +12 -0
- package/dist/cdn/{bell-CGjAO_0s.js → bell-GrTZcnD2.js} +1 -1
- package/dist/cdn/{browser-CbQIH4w2.js → browser-DG2Z8392.js} +1 -1
- package/dist/cdn/{brush-B_mKhyxG.js → brush-CelVvMGp.js} +1 -1
- package/dist/cdn/button-CB4uOoUV.js +2509 -0
- package/dist/cdn/card-BA-DQk-G.js +41 -0
- package/dist/cdn/{checkbox-By0FklhG.js → checkbox-kwVa4gRX.js} +7 -7
- package/dist/cdn/{clock-CmUbSx_B.js → clock-YMF8Gtw5.js} +1 -1
- package/dist/cdn/{code-V_0nf5rg.js → code-C8sN2OGR.js} +1 -1
- package/dist/cdn/{jsx-runtime-CIxvMpEo.js → createLucideIcon-BONxC1L5.js} +57 -24
- package/dist/cdn/{dialog-BsDpuJd3.js → dialog-CJGnC5Ag.js} +171 -171
- package/dist/cdn/{dist-DaMB0Su9.js → dist-CTJnCYmk.js} +1 -1
- package/dist/cdn/{dist-DbX5yidW.js → dist-SxRsB1iS.js} +5 -4
- package/dist/cdn/{external-link-CjmfT6rW.js → external-link-Bo4lQxr1.js} +1 -1
- package/dist/cdn/{eye-B7H96av8.js → eye-pSGG7nvf.js} +1 -1
- package/dist/cdn/{folder-open-B3lu2rG_.js → folder-open-aM8CPtBO.js} +1 -1
- package/dist/cdn/{hash-BVQnWi7q.js → hash-DDs2vE1k.js} +1 -1
- package/dist/cdn/{history-Csw4rb44.js → history-BfUFpL1d.js} +1 -1
- package/dist/cdn/{index-browser-DkQOzkvX.js → index-browser-Dm3R1Mfe.js} +1 -1
- package/dist/cdn/{info-CNiOwqkf.js → info-BMkB68mB.js} +1 -1
- package/dist/cdn/{input-C2OBd4PJ.js → input-BCpgLXU1.js} +2993 -5499
- package/dist/cdn/inspector.css +1 -1
- package/dist/cdn/inspector.js +7106 -7140
- package/dist/cdn/{label-B9Jmm9be.js → label-A0UGV8FE.js} +9 -9
- package/dist/cdn/{loader-circle-BLy9A_pp.js → loader-circle-BKRHJEB7.js} +1 -1
- package/dist/cdn/{maximize-2-CH5Lq90B.js → maximize-2-DdrB_spi.js} +1 -1
- package/dist/cdn/{maximize-BALCV_ep.js → maximize-hSOCz133.js} +1 -1
- package/dist/cdn/{message-square-BnxdpJxZ.js → message-square-D3tKB3uJ.js} +1 -1
- package/dist/cdn/{not-found-DEtSM_Wd.js → not-found-BajFyZpp.js} +9 -11
- package/dist/cdn/{play-vuZ5PLnI.js → play-B1leulYf.js} +1 -1
- package/dist/cdn/providerMeta-CjGU4rID.js +436 -0
- package/dist/cdn/{react-BajV-X4P.js → react-Bl-hSkvn.js} +628 -571
- package/dist/cdn/{refresh-cw-BXY-Pa0U.js → refresh-cw-CyvXrS91.js} +1 -1
- package/dist/cdn/{save-Tgil_AJZ.js → save-CmdEPUAm.js} +1 -1
- package/dist/cdn/{select-DDdiIPR2.js → select-CCFHjOGk.js} +808 -807
- package/dist/cdn/{servers-Dm72iTpY.js → servers-Dd0Vcp81.js} +5 -1
- package/dist/cdn/{shared-DaILIQPP.js → shared-CJVHJhag.js} +36 -36
- package/dist/cdn/{sheet-Br_l2kry.js → sheet-oyq1mIyg.js} +620 -619
- package/dist/cdn/{sparkles-BntO2rDR.js → sparkles-CxeZpVtX.js} +1 -1
- package/dist/cdn/spinner-Be1GlSGX.js +15 -0
- package/dist/cdn/{square-check-big-BvwQ17Bl.js → square-check-big-C_4wbfwF.js} +1 -1
- package/dist/cdn/{switch-C3IyQuid.js → switch-DHXEA_N5.js} +190 -189
- package/dist/cdn/{tabs-subtle-CkdI6Mac.js → tabs-subtle-Dubd6Kj8.js} +269 -268
- package/dist/cdn/{telemetry-DabTAQ8x.js → telemetry-TwPKZlFf.js} +2 -2
- package/dist/cdn/{textarea-DSbwcFVt.js → textarea-CwmI8_uI.js} +6 -6
- package/dist/cdn/{trash-2-RwpJY5SL.js → trash-2-BhumJAFE.js} +1 -1
- package/dist/cdn/{useAriaLabelledBy-DqAdnppm.js → useAriaLabelledBy-Cra6w3YY.js} +2 -1
- package/dist/cdn/{useCompositeItem-BRqEzYh-.js → useCompositeItem-Dhnm-7el.js} +3 -3
- package/dist/cdn/{useConfig-Btmh8wjJ.js → useConfig-leHVjdjl.js} +2 -2
- package/dist/cdn/{useSavedRequests-Ci2I919u.js → useSavedRequests-mSIsDd4c.js} +1 -1
- package/dist/cdn/{useViewHostProps-B6SKeeH9.js → useViewHostProps-CDOm2w6u.js} +124 -109
- package/dist/cdn/{wrench-DzGmCfnb.js → wrench-DvK20LUT.js} +1 -1
- package/dist/cdn/{x-C3vRQIYu.js → x-EilKPiCX.js} +1 -1
- package/dist/cdn/{zap-Mb-pbw2X.js → zap-0Wr9QO7N.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/components/ChatTab.d.ts.map +1 -1
- package/dist/client/components/MCPAppsDebugControls.d.ts.map +1 -1
- package/dist/client/components/ToolsTab.d.ts.map +1 -1
- package/dist/client/components/chat/ConfigurationDialog.d.ts.map +1 -1
- package/dist/client/components/chat/MessageList.d.ts +1 -0
- package/dist/client/components/chat/MessageList.d.ts.map +1 -1
- package/dist/client/components/chat/ToolResultRenderer.d.ts.map +1 -1
- package/dist/client/components/chat/partialToolArgs.d.ts +10 -0
- package/dist/client/components/chat/partialToolArgs.d.ts.map +1 -0
- package/dist/client/components/chat/types.d.ts +1 -0
- package/dist/client/components/chat/types.d.ts.map +1 -1
- package/dist/client/components/chat/useChatMessages.d.ts.map +1 -1
- package/dist/client/components/chat/useChatMessagesClientSide.d.ts.map +1 -1
- package/dist/client/components/mcp-apps/McpAppsViewPanel.d.ts +29 -0
- package/dist/client/components/mcp-apps/McpAppsViewPanel.d.ts.map +1 -0
- package/dist/client/components/tools/ToolExecutionPanel.d.ts.map +1 -1
- package/dist/client/components/tools/ToolResultDisplay.d.ts +2 -1
- package/dist/client/components/tools/ToolResultDisplay.d.ts.map +1 -1
- package/dist/client/components/tools/useToolsTabNavigation.d.ts.map +1 -1
- package/dist/client/components/ui/MeshGradientCanvas.d.ts.map +1 -1
- package/dist/client/components/ui/mesh-animation-pause.d.ts +14 -0
- package/dist/client/components/ui/mesh-animation-pause.d.ts.map +1 -0
- package/dist/client/components/ui/mesh-gradient-colors.d.ts +6 -0
- package/dist/client/components/ui/mesh-gradient-colors.d.ts.map +1 -0
- package/dist/client/components/ui/mesh-tab-background.d.ts +1 -1
- package/dist/client/components/ui/mesh-tab-background.d.ts.map +1 -1
- package/dist/client/components/ui/not-found.d.ts.map +1 -1
- package/dist/client/context/WidgetDebugContext.d.ts +1 -11
- package/dist/client/context/WidgetDebugContext.d.ts.map +1 -1
- package/dist/client/hooks/useDeviceViewport.d.ts +1 -5
- package/dist/client/hooks/useDeviceViewport.d.ts.map +1 -1
- package/dist/client/hooks/useViewHostProps.d.ts +1 -1
- package/dist/client/hooks/useViewHostProps.d.ts.map +1 -1
- package/dist/client/index.js +2238 -1935
- package/dist/client/utils/servers.d.ts +5 -0
- package/dist/client/utils/servers.d.ts.map +1 -1
- package/dist/server/cdn-shell.js +2 -2
- package/dist/server/{chunk-ZCGLU5T7.js → chunk-5GVQGIAX.js} +1 -1
- package/dist/server/{chunk-DSTNUYWX.js → chunk-UZZDBVKF.js} +1 -1
- package/dist/server/{chunk-SQ4XNMLT.js → chunk-VFVFLXKP.js} +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/index.js +3 -3
- package/dist/server/middleware.js +3 -3
- package/dist/server/version.js +1 -1
- package/dist/web/assets/AnimatePresence-FfDQQNFJ.js +9 -0
- package/dist/web/assets/ChatTab-B6ubLbeA.js +18 -0
- package/dist/web/assets/ConnectionSettingsTab-Cb2eDgEu.js +1 -0
- package/dist/web/assets/ElicitationTab-CbnCrmu9.js +1 -0
- package/dist/web/assets/FormContext-sV-yByKz.js +1 -0
- package/dist/web/assets/ListTabHeader-CrGae306.js +1 -0
- package/dist/web/assets/MCPAppsDebugControls-sRglMhat.js +34 -0
- package/dist/web/assets/{ManufactOAuthCallback-CS3ydSZg.js → ManufactOAuthCallback-D4uYGigW.js} +1 -1
- package/dist/web/assets/{MarkdownRenderer-BeeBfQhv.js → MarkdownRenderer-Cwxp9fLj.js} +2 -2
- package/dist/web/assets/McpAppsViewPanel-jQYFoZNX.js +1 -0
- package/dist/web/assets/{NotificationsTab-Uj0_DrmK.js → NotificationsTab-DuSm762_.js} +1 -1
- package/dist/web/assets/{OAuthCallback-C0ljgCiw.js → OAuthCallback-VLHlUe2c.js} +1 -1
- package/dist/web/assets/PromptsTab-DK6XZxR8.js +15 -0
- package/dist/web/assets/ResourcesTab-CUE4MAtJ.js +2 -0
- package/dist/web/assets/SamplingTab-BYNkVCTu.js +1 -0
- package/dist/web/assets/ServerMetadataTab-DWjNFMbq.js +1 -0
- package/dist/web/assets/ToolsTab-BisWWY2p.js +8 -0
- package/dist/web/assets/{ViewPreview-Ba1Ec5uA.js → ViewPreview-COrmPpRr.js} +1 -1
- package/dist/web/assets/WidgetWrapper-cv_BM1bY.js +1 -0
- package/dist/web/assets/{brush--0LobUi4.js → brush-DX0UZ_pI.js} +1 -1
- package/dist/web/assets/button-C8Xa2k4x.js +1 -0
- package/dist/web/assets/checkbox-B6dtF73d.js +1 -0
- package/dist/web/assets/code-B14rVdNt.js +1 -0
- package/dist/web/assets/createLucideIcon-BEHeJH0M.js +1 -0
- package/dist/web/assets/{dist-C5JjLJN9.js → dist-9Oy7e0v8.js} +5 -5
- package/dist/web/assets/index-BMaSsizY.js +499 -0
- package/dist/web/assets/index-D7TVTIt9.css +1 -0
- package/dist/web/assets/input-C0OQCUZy.js +1 -0
- package/dist/web/assets/{label-Cdim77Jw.js → label-CI7JWQOo.js} +1 -1
- package/dist/web/assets/{maximize-2-BTT9QQU9.js → maximize-2-Br1WQzT2.js} +1 -1
- package/dist/web/assets/{maximize-_O55kFcr.js → maximize-CJNgRe6S.js} +1 -1
- package/dist/web/assets/{refresh-cw-C9wQl8_d.js → refresh-cw-B5iaAZKn.js} +1 -1
- package/dist/web/assets/{save-B-MsgxX9.js → save-TM6fvNrt.js} +1 -1
- package/dist/web/assets/select-D6jzbLJn.js +1 -0
- package/dist/web/assets/shared-CFs9CZfB.js +1 -0
- package/dist/web/assets/{sparkles-2OAsc1aP.js → sparkles-BGYTDThM.js} +1 -1
- package/dist/web/assets/tabs-subtle-D2XkWhLL.js +1 -0
- package/dist/web/assets/textarea-CRTXuRmE.js +1 -0
- package/dist/web/assets/{useConfig-BAgALiZg.js → useConfig-B6tXvJOb.js} +1 -1
- package/dist/web/assets/useViewHostProps-DZqOwiAm.js +1 -0
- package/dist/web/assets/{zap-Du2Uc5pa.js → zap-BDWHCVHU.js} +1 -1
- package/dist/web/index.html +10 -10
- package/package.json +4 -4
- package/dist/cdn/CheckboxIndicator-Bt4IICtv.js +0 -251
- package/dist/cdn/PromptsTab-BYKnY7Rp.js +0 -901
- package/dist/cdn/card-DgiYnSg-.js +0 -41
- package/dist/cdn/createLucideIcon-C5fZZ6oB.js +0 -38
- package/dist/cdn/providerMeta-BQIfHuNL.js +0 -379
- package/dist/cdn/spinner-jQtC7EBj.js +0 -15
- package/dist/web/assets/AnimatePresence-C5p0yiY1.js +0 -9
- package/dist/web/assets/ChatTab-BCobuZDc.js +0 -18
- package/dist/web/assets/ConnectionSettingsTab-BjGkLwVu.js +0 -1
- package/dist/web/assets/ElicitationTab-D3ZUKHND.js +0 -1
- package/dist/web/assets/FormContext-DH2caWKO.js +0 -1
- package/dist/web/assets/ListTabHeader-R17w_JsB.js +0 -1
- package/dist/web/assets/PromptsTab-Bns2u0G-.js +0 -15
- package/dist/web/assets/ResourcesTab-CO24312V.js +0 -2
- package/dist/web/assets/SamplingTab-7gtN7FwU.js +0 -1
- package/dist/web/assets/ServerMetadataTab-CQwqYSjL.js +0 -1
- package/dist/web/assets/ToolsTab-bDdRxI1b.js +0 -8
- package/dist/web/assets/WidgetWrapper-CYHfzrtb.js +0 -34
- package/dist/web/assets/checkbox-CzBkaNKa.js +0 -1
- package/dist/web/assets/code-tME-5H6D.js +0 -1
- package/dist/web/assets/createLucideIcon-B3b8EU0b.js +0 -1
- package/dist/web/assets/index-TQ5V7cM9.js +0 -492
- package/dist/web/assets/index-fBX3akc8.css +0 -1
- package/dist/web/assets/input-CLYhA7PK.js +0 -1
- package/dist/web/assets/jsx-runtime-Cjj9sGSy.js +0 -1
- package/dist/web/assets/select-CJ57-Bor.js +0 -1
- package/dist/web/assets/shared-BF0rJNdE.js +0 -1
- package/dist/web/assets/tabs-subtle-6D79T1xd.js +0 -1
- package/dist/web/assets/textarea-DLAmNVf_.js +0 -1
- package/dist/web/assets/useViewHostProps-BYitt_6K.js +0 -1
|
@@ -1,106 +1,107 @@
|
|
|
1
1
|
import { s as e, t } from "./react-BIs9pQ3H.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as p } from "./
|
|
5
|
-
import { t as m } from "./
|
|
6
|
-
import {
|
|
7
|
-
import { t as b } from "./
|
|
8
|
-
import { A as x, _ as S, c as C, d as w, g as T, h as E, m as D, n as O, o as k, p as A, r as j, s as M, t as ee, v as N } from "./dialog-
|
|
9
|
-
import { n as P,
|
|
10
|
-
import { a as
|
|
11
|
-
import { n as
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as
|
|
14
|
-
import { a as
|
|
15
|
-
import { t as
|
|
16
|
-
import { t as ae } from "./maximize-
|
|
17
|
-
import { n as oe, t as
|
|
18
|
-
import { n as
|
|
19
|
-
import { t as
|
|
20
|
-
import { t as
|
|
21
|
-
import { t as
|
|
22
|
-
import { t as
|
|
23
|
-
import { t as
|
|
24
|
-
import { t as pe } from "./not-found-
|
|
25
|
-
import { _ as
|
|
26
|
-
import { c as
|
|
27
|
-
import { n as
|
|
28
|
-
import { t as
|
|
29
|
-
import { n as
|
|
30
|
-
import { t as
|
|
31
|
-
import { t as
|
|
32
|
-
import { t as
|
|
33
|
-
|
|
2
|
+
import { a as n, f as r, n as i, r as a, sr as o, t as s } from "./input-BCpgLXU1.js";
|
|
3
|
+
import { n as c, t as l } from "./createLucideIcon-BONxC1L5.js";
|
|
4
|
+
import { U as u, i as d, n as f, t as p } from "./button-CB4uOoUV.js";
|
|
5
|
+
import { t as m } from "./label-A0UGV8FE.js";
|
|
6
|
+
import { t as h } from "./AnimatePresence-D1bZ5_-l.js";
|
|
7
|
+
import { a as g, i as _, n as v, r as y, t as b } from "./select-CCFHjOGk.js";
|
|
8
|
+
import { A as x, _ as S, c as C, d as w, g as T, h as E, m as D, n as O, o as k, p as A, r as j, s as M, t as ee, v as N } from "./dialog-CJGnC5Ag.js";
|
|
9
|
+
import { n as P, t as F } from "./MCPAppsDebugControls-BpP-Ifap.js";
|
|
10
|
+
import { a as te, i as I, t as L } from "./browser-DG2Z8392.js";
|
|
11
|
+
import { n as R, t as z } from "./zap-0Wr9QO7N.js";
|
|
12
|
+
import { t as B } from "./code-C8sN2OGR.js";
|
|
13
|
+
import { t as V } from "./JSONDisplay-BJqMz7Ny.js";
|
|
14
|
+
import { a as H, i as U, n as W, o as G, r as ne, s as re } from "./shared-CJVHJhag.js";
|
|
15
|
+
import { t as ie } from "./history-BfUFpL1d.js";
|
|
16
|
+
import { t as ae } from "./maximize-hSOCz133.js";
|
|
17
|
+
import { n as oe, t as K } from "./save-CmdEPUAm.js";
|
|
18
|
+
import { n as se, t as ce } from "./useSavedRequests-mSIsDd4c.js";
|
|
19
|
+
import { t as le } from "./play-B1leulYf.js";
|
|
20
|
+
import { t as q } from "./trash-2-BhumJAFE.js";
|
|
21
|
+
import { t as ue } from "./wrench-DvK20LUT.js";
|
|
22
|
+
import { t as de } from "./x-EilKPiCX.js";
|
|
23
|
+
import { t as fe } from "./switch-DHXEA_N5.js";
|
|
24
|
+
import { t as pe } from "./not-found-BajFyZpp.js";
|
|
25
|
+
import { _ as J, t as me, v as he } from "./telemetry-TwPKZlFf.js";
|
|
26
|
+
import { c as Y, o as ge } from "./react-Bl-hSkvn.js";
|
|
27
|
+
import { n as _e } from "./dist-CTJnCYmk.js";
|
|
28
|
+
import { t as X } from "./spinner-Be1GlSGX.js";
|
|
29
|
+
import { n as ve } from "./InspectorContext-BBKCdfmK.js";
|
|
30
|
+
import { t as ye } from "./textarea-CwmI8_uI.js";
|
|
31
|
+
import { t as be } from "./WidgetWrapper-BlbQAh_X.js";
|
|
32
|
+
import { t as xe } from "./McpAppsViewPanel-jlsYQ7uS.js";
|
|
33
|
+
import { t as Se } from "./ListTabHeader-DzmTtN1e.js";
|
|
34
|
+
var Ce = l("chevron-up", [["path", {
|
|
34
35
|
d: "m18 15-6-6-6 6",
|
|
35
36
|
key: "153udz"
|
|
36
|
-
}]]),
|
|
37
|
-
function
|
|
38
|
-
if (e.length === 0) return /* @__PURE__ */ (0,
|
|
37
|
+
}]]), Z = /* @__PURE__ */ e(t(), 1), Q = c();
|
|
38
|
+
function we({ savedRequests: e, selectedRequest: t, onLoadRequest: r, onDeleteRequest: o, focusedIndex: s }) {
|
|
39
|
+
if (e.length === 0) return /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
39
40
|
className: "flex flex-1 flex-col items-center justify-center p-4 text-center",
|
|
40
41
|
children: [
|
|
41
|
-
/* @__PURE__ */ (0,
|
|
42
|
-
/* @__PURE__ */ (0,
|
|
42
|
+
/* @__PURE__ */ (0, Q.jsx)(P, { className: "h-12 w-12 text-gray-400 dark:text-gray-600 mb-3" }),
|
|
43
|
+
/* @__PURE__ */ (0, Q.jsx)("p", {
|
|
43
44
|
className: "text-gray-500 dark:text-gray-400 mb-2",
|
|
44
45
|
children: "No saved requests yet"
|
|
45
46
|
}),
|
|
46
|
-
/* @__PURE__ */ (0,
|
|
47
|
+
/* @__PURE__ */ (0, Q.jsx)("p", {
|
|
47
48
|
className: "text-xs text-gray-400 dark:text-gray-500",
|
|
48
49
|
children: "Execute a tool and click Save to store requests"
|
|
49
50
|
})
|
|
50
51
|
]
|
|
51
52
|
});
|
|
52
|
-
let
|
|
53
|
+
let c = (e, t) => {
|
|
53
54
|
e.stopPropagation(), t();
|
|
54
55
|
};
|
|
55
|
-
return /* @__PURE__ */ (0,
|
|
56
|
+
return /* @__PURE__ */ (0, Q.jsx)("div", { children: e.map((e, l) => /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
56
57
|
className: "relative group",
|
|
57
|
-
children: [/* @__PURE__ */ (0,
|
|
58
|
+
children: [/* @__PURE__ */ (0, Q.jsx)(ne, {
|
|
58
59
|
id: `saved-${e.id}`,
|
|
59
60
|
isSelected: t?.id === e.id,
|
|
60
|
-
isFocused:
|
|
61
|
+
isFocused: s === l,
|
|
61
62
|
title: e.name,
|
|
62
63
|
description: e.toolName,
|
|
63
|
-
metadata: /* @__PURE__ */ (0,
|
|
64
|
+
metadata: /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
64
65
|
className: "flex flex-col gap-1",
|
|
65
|
-
children: /* @__PURE__ */ (0,
|
|
66
|
+
children: /* @__PURE__ */ (0, Q.jsx)("span", {
|
|
66
67
|
className: "text-xs text-gray-400 dark:text-gray-500",
|
|
67
68
|
children: new Date(e.savedAt).toLocaleString()
|
|
68
69
|
})
|
|
69
70
|
}),
|
|
70
|
-
onClick: () =>
|
|
71
|
-
}), /* @__PURE__ */ (0,
|
|
71
|
+
onClick: () => r(e)
|
|
72
|
+
}), /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
72
73
|
className: "absolute top-1/2 right-2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity z-10",
|
|
73
|
-
children: /* @__PURE__ */ (0,
|
|
74
|
-
render: /* @__PURE__ */ (0,
|
|
74
|
+
children: /* @__PURE__ */ (0, Q.jsxs)(i, { children: [/* @__PURE__ */ (0, Q.jsx)(n, {
|
|
75
|
+
render: /* @__PURE__ */ (0, Q.jsx)(p, {
|
|
75
76
|
variant: "secondary",
|
|
76
77
|
size: "sm",
|
|
77
|
-
onClick: (t) =>
|
|
78
|
+
onClick: (t) => c(t, () => o(e.id)),
|
|
78
79
|
className: "h-8 w-8 p-0",
|
|
79
|
-
children: /* @__PURE__ */ (0,
|
|
80
|
+
children: /* @__PURE__ */ (0, Q.jsx)(q, { className: "h-4 w-4" })
|
|
80
81
|
}),
|
|
81
82
|
nativeButton: !0
|
|
82
|
-
}), /* @__PURE__ */ (0,
|
|
83
|
+
}), /* @__PURE__ */ (0, Q.jsx)(a, { children: /* @__PURE__ */ (0, Q.jsx)("p", { children: "Delete saved request" }) })] })
|
|
83
84
|
})]
|
|
84
85
|
}, e.id)) });
|
|
85
86
|
}
|
|
86
87
|
//#endregion
|
|
87
88
|
//#region src/client/components/tools/SaveRequestDialog.tsx
|
|
88
|
-
function
|
|
89
|
-
return e ? /* @__PURE__ */ (0,
|
|
89
|
+
function Te({ isOpen: e, requestName: t, defaultPlaceholder: n, onRequestNameChange: r, onSave: i, onCancel: a }) {
|
|
90
|
+
return e ? /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
90
91
|
className: "fixed inset-0 bg-black/50 flex items-center justify-center z-50",
|
|
91
92
|
onClick: a,
|
|
92
|
-
children: /* @__PURE__ */ (0,
|
|
93
|
+
children: /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
93
94
|
className: "bg-white dark:bg-zinc-800 rounded-lg p-6 w-[400px] shadow-xl border border-gray-200 dark:border-zinc-700",
|
|
94
95
|
onClick: (e) => e.stopPropagation(),
|
|
95
|
-
children: [/* @__PURE__ */ (0,
|
|
96
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("h3", {
|
|
96
97
|
className: "text-lg font-semibold mb-4 text-gray-900 dark:text-gray-100",
|
|
97
98
|
children: "Save Request"
|
|
98
|
-
}), /* @__PURE__ */ (0,
|
|
99
|
+
}), /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
99
100
|
className: "space-y-4",
|
|
100
|
-
children: [/* @__PURE__ */ (0,
|
|
101
|
+
children: [/* @__PURE__ */ (0, Q.jsxs)("div", { children: [/* @__PURE__ */ (0, Q.jsx)(m, {
|
|
101
102
|
htmlFor: "request-name",
|
|
102
103
|
children: "Request Name (optional)"
|
|
103
|
-
}), /* @__PURE__ */ (0,
|
|
104
|
+
}), /* @__PURE__ */ (0, Q.jsx)(s, {
|
|
104
105
|
id: "request-name",
|
|
105
106
|
value: t,
|
|
106
107
|
onChange: (e) => r(e.target.value),
|
|
@@ -110,15 +111,15 @@ function De({ isOpen: e, requestName: t, defaultPlaceholder: n, onRequestNameCha
|
|
|
110
111
|
e.key === "Enter" && i();
|
|
111
112
|
},
|
|
112
113
|
autoFocus: !0
|
|
113
|
-
})] }), /* @__PURE__ */ (0,
|
|
114
|
+
})] }), /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
114
115
|
className: "flex justify-end gap-2",
|
|
115
|
-
children: [/* @__PURE__ */ (0,
|
|
116
|
+
children: [/* @__PURE__ */ (0, Q.jsx)(p, {
|
|
116
117
|
variant: "outline",
|
|
117
118
|
onClick: a,
|
|
118
119
|
children: "Cancel"
|
|
119
|
-
}), /* @__PURE__ */ (0,
|
|
120
|
+
}), /* @__PURE__ */ (0, Q.jsxs)(p, {
|
|
120
121
|
onClick: i,
|
|
121
|
-
children: [/* @__PURE__ */ (0,
|
|
122
|
+
children: [/* @__PURE__ */ (0, Q.jsx)(K, { className: "h-4 w-4 mr-2" }), "Save"]
|
|
122
123
|
})]
|
|
123
124
|
})]
|
|
124
125
|
})]
|
|
@@ -127,7 +128,7 @@ function De({ isOpen: e, requestName: t, defaultPlaceholder: n, onRequestNameCha
|
|
|
127
128
|
}
|
|
128
129
|
//#endregion
|
|
129
130
|
//#region src/client/components/tools/schema-utils.ts
|
|
130
|
-
function
|
|
131
|
+
function Ee(e, t) {
|
|
131
132
|
if (!e?.$ref) return e;
|
|
132
133
|
let n = e.$ref;
|
|
133
134
|
if (!n.startsWith("#/")) return e;
|
|
@@ -136,22 +137,22 @@ function Oe(e, t) {
|
|
|
136
137
|
else return e;
|
|
137
138
|
return i;
|
|
138
139
|
}
|
|
139
|
-
function
|
|
140
|
+
function De(e, t) {
|
|
140
141
|
if (e?.anyOf && Array.isArray(e.anyOf)) {
|
|
141
|
-
let n = e.anyOf.find((e) =>
|
|
142
|
+
let n = e.anyOf.find((e) => Ee(e, t)?.type !== "null");
|
|
142
143
|
if (n) return {
|
|
143
|
-
...
|
|
144
|
+
...Ee(n, t),
|
|
144
145
|
nullable: !0
|
|
145
146
|
};
|
|
146
147
|
}
|
|
147
148
|
return e;
|
|
148
149
|
}
|
|
149
|
-
function
|
|
150
|
-
let n =
|
|
151
|
-
return n =
|
|
150
|
+
function Oe(e, t) {
|
|
151
|
+
let n = De(e || {}, t);
|
|
152
|
+
return n = Ee(n, t), n;
|
|
152
153
|
}
|
|
153
154
|
function ke(e, t) {
|
|
154
|
-
let n =
|
|
155
|
+
let n = Oe(e, t);
|
|
155
156
|
if (typeof n.type == "string") return n.type;
|
|
156
157
|
if (Array.isArray(n.type)) {
|
|
157
158
|
let e = n.type.find((e) => e !== "null");
|
|
@@ -250,46 +251,46 @@ function Fe(e) {
|
|
|
250
251
|
}
|
|
251
252
|
//#endregion
|
|
252
253
|
//#region src/client/components/tools/ToolInputForm.tsx
|
|
253
|
-
function Ie({ selectedTool: e, toolArgs: t, onArgChange: n, onBulkPaste: r, autoFilledFields: i, setFields: a, sendEmptyFields: o, onToggleEmpty:
|
|
254
|
-
let
|
|
254
|
+
function Ie({ selectedTool: e, toolArgs: t, onArgChange: n, onBulkPaste: r, autoFilledFields: i, setFields: a, sendEmptyFields: o, onToggleEmpty: c }) {
|
|
255
|
+
let l = e?.inputSchema?.properties || {}, u = e?.inputSchema?.required || [], d = Object.keys(l).length > 0, f = async (e, t) => {
|
|
255
256
|
r && await r(e.clipboardData.getData("text"), t) && e.preventDefault();
|
|
256
257
|
};
|
|
257
|
-
return d ? /* @__PURE__ */ (0,
|
|
258
|
+
return d ? /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
258
259
|
className: "space-y-4",
|
|
259
|
-
children: Object.entries(
|
|
260
|
-
let d =
|
|
260
|
+
children: Object.entries(l).map(([r, l]) => {
|
|
261
|
+
let d = Oe(l, e?.inputSchema || {}), p = Ae(d), h = d.type === "string" && p !== null, x = d, S = u.includes(r), C = t[r], w = "";
|
|
261
262
|
C != null && (w = typeof C == "string" ? C : typeof C == "object" && C ? JSON.stringify(C, null, 2) : String(C));
|
|
262
|
-
let T = x.type === "object" || x.type === "array", E = T ? x.type === "array" ? "array" : "object" : "string", D = a?.has(r) ?? !0, O =
|
|
263
|
-
return T ? /* @__PURE__ */ (0,
|
|
263
|
+
let T = x.type === "object" || x.type === "array", E = T ? x.type === "array" ? "array" : "object" : "string", D = a?.has(r) ?? !0, O = c && (x.type === "string" || T);
|
|
264
|
+
return T ? /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
264
265
|
className: "space-y-2",
|
|
265
|
-
children: [/* @__PURE__ */ (0,
|
|
266
|
+
children: [/* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
266
267
|
className: "flex items-start justify-between gap-2",
|
|
267
|
-
children: [/* @__PURE__ */ (0,
|
|
268
|
+
children: [/* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
268
269
|
className: "min-w-0 flex-1",
|
|
269
|
-
children: [/* @__PURE__ */ (0,
|
|
270
|
+
children: [/* @__PURE__ */ (0, Q.jsxs)(m, {
|
|
270
271
|
htmlFor: r,
|
|
271
272
|
className: "text-sm font-medium",
|
|
272
|
-
children: [r, S && /* @__PURE__ */ (0,
|
|
273
|
+
children: [r, S && /* @__PURE__ */ (0, Q.jsx)("span", {
|
|
273
274
|
className: "text-red-500 ml-1",
|
|
274
275
|
children: "*"
|
|
275
276
|
})]
|
|
276
|
-
}), x?.description && /* @__PURE__ */ (0,
|
|
277
|
+
}), x?.description && /* @__PURE__ */ (0, Q.jsx)("p", {
|
|
277
278
|
className: "mt-0.5 text-xs text-gray-500 dark:text-gray-400",
|
|
278
279
|
children: x.description
|
|
279
280
|
})]
|
|
280
|
-
}), O &&
|
|
281
|
+
}), O && c && /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
281
282
|
className: "flex items-center gap-2 shrink-0",
|
|
282
|
-
children: [/* @__PURE__ */ (0,
|
|
283
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
283
284
|
className: "text-xs text-muted-foreground whitespace-nowrap",
|
|
284
285
|
children: E === "array" ? "Send empty array explicitly" : "Send empty object explicitly"
|
|
285
|
-
}), /* @__PURE__ */ (0,
|
|
286
|
+
}), /* @__PURE__ */ (0, Q.jsx)(fe, {
|
|
286
287
|
checked: o?.has(r) ?? !1,
|
|
287
|
-
onCheckedChange: (e) =>
|
|
288
|
+
onCheckedChange: (e) => c(r, E, e),
|
|
288
289
|
"aria-label": E === "array" ? "Send empty array" : "Send empty object",
|
|
289
290
|
title: E === "array" ? "Send empty array []" : "Send empty object {}"
|
|
290
291
|
})]
|
|
291
292
|
})]
|
|
292
|
-
}), /* @__PURE__ */ (0,
|
|
293
|
+
}), /* @__PURE__ */ (0, Q.jsx)(ye, {
|
|
293
294
|
id: r,
|
|
294
295
|
"data-testid": `tool-param-${r}`,
|
|
295
296
|
value: w,
|
|
@@ -299,61 +300,61 @@ function Ie({ selectedTool: e, toolArgs: t, onArgChange: n, onBulkPaste: r, auto
|
|
|
299
300
|
disabled: o?.has(r) ?? !1,
|
|
300
301
|
className: `min-h-[100px] ${D ? "" : "opacity-70"} ${i?.has(r) ? "animate-pulse ring-2 ring-green-500 dark:ring-green-400" : ""}`
|
|
301
302
|
})]
|
|
302
|
-
}, r) :
|
|
303
|
+
}, r) : h && p ? /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
303
304
|
className: "space-y-2",
|
|
304
|
-
children: [/* @__PURE__ */ (0,
|
|
305
|
+
children: [/* @__PURE__ */ (0, Q.jsxs)("div", { children: [/* @__PURE__ */ (0, Q.jsxs)(m, {
|
|
305
306
|
htmlFor: r,
|
|
306
307
|
className: "text-sm font-medium",
|
|
307
|
-
children: [r, S && /* @__PURE__ */ (0,
|
|
308
|
+
children: [r, S && /* @__PURE__ */ (0, Q.jsx)("span", {
|
|
308
309
|
className: "text-red-500 ml-1",
|
|
309
310
|
children: "*"
|
|
310
311
|
})]
|
|
311
|
-
}), x.description && /* @__PURE__ */ (0,
|
|
312
|
+
}), x.description && /* @__PURE__ */ (0, Q.jsx)("p", {
|
|
312
313
|
className: "mt-0.5 text-xs text-gray-500 dark:text-gray-400",
|
|
313
314
|
children: x.description
|
|
314
|
-
})] }), /* @__PURE__ */ (0,
|
|
315
|
+
})] }), /* @__PURE__ */ (0, Q.jsxs)(b, {
|
|
315
316
|
value: String(t[r] || ""),
|
|
316
317
|
onValueChange: (e) => n(r, e),
|
|
317
|
-
children: [/* @__PURE__ */ (0,
|
|
318
|
+
children: [/* @__PURE__ */ (0, Q.jsx)(_, {
|
|
318
319
|
id: r,
|
|
319
320
|
className: `w-full ${D ? "" : "opacity-70"}`,
|
|
320
321
|
"data-testid": `tool-param-${r}`,
|
|
321
|
-
children: /* @__PURE__ */ (0,
|
|
322
|
-
}), /* @__PURE__ */ (0,
|
|
322
|
+
children: /* @__PURE__ */ (0, Q.jsx)(g, { placeholder: "Select an option" })
|
|
323
|
+
}), /* @__PURE__ */ (0, Q.jsx)(v, { children: p.map((e, t) => /* @__PURE__ */ (0, Q.jsx)(y, {
|
|
323
324
|
value: e,
|
|
324
325
|
children: x.enumNames?.[t] || e
|
|
325
326
|
}, e)) })]
|
|
326
327
|
})]
|
|
327
|
-
}, r) : /* @__PURE__ */ (0,
|
|
328
|
+
}, r) : /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
328
329
|
className: "space-y-2",
|
|
329
|
-
children: [/* @__PURE__ */ (0,
|
|
330
|
+
children: [/* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
330
331
|
className: "flex items-start justify-between gap-2",
|
|
331
|
-
children: [/* @__PURE__ */ (0,
|
|
332
|
+
children: [/* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
332
333
|
className: "min-w-0 flex-1",
|
|
333
|
-
children: [/* @__PURE__ */ (0,
|
|
334
|
+
children: [/* @__PURE__ */ (0, Q.jsxs)(m, {
|
|
334
335
|
htmlFor: r,
|
|
335
336
|
className: "text-sm font-medium",
|
|
336
|
-
children: [r, S && /* @__PURE__ */ (0,
|
|
337
|
+
children: [r, S && /* @__PURE__ */ (0, Q.jsx)("span", {
|
|
337
338
|
className: "text-red-500 ml-1",
|
|
338
339
|
children: "*"
|
|
339
340
|
})]
|
|
340
|
-
}), x?.description && /* @__PURE__ */ (0,
|
|
341
|
+
}), x?.description && /* @__PURE__ */ (0, Q.jsx)("p", {
|
|
341
342
|
className: "mt-0.5 text-xs text-gray-500 dark:text-gray-400",
|
|
342
343
|
children: x.description
|
|
343
344
|
})]
|
|
344
|
-
}), O &&
|
|
345
|
+
}), O && c && /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
345
346
|
className: "flex items-center gap-2 shrink-0",
|
|
346
|
-
children: [/* @__PURE__ */ (0,
|
|
347
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
347
348
|
className: "text-xs text-muted-foreground whitespace-nowrap",
|
|
348
349
|
children: "Send empty string"
|
|
349
|
-
}), /* @__PURE__ */ (0,
|
|
350
|
+
}), /* @__PURE__ */ (0, Q.jsx)(fe, {
|
|
350
351
|
checked: o?.has(r) ?? !1,
|
|
351
|
-
onCheckedChange: (e) =>
|
|
352
|
+
onCheckedChange: (e) => c(r, "string", e),
|
|
352
353
|
"aria-label": "Send empty string",
|
|
353
354
|
title: "Send empty string"
|
|
354
355
|
})]
|
|
355
356
|
})]
|
|
356
|
-
}), /* @__PURE__ */ (0,
|
|
357
|
+
}), /* @__PURE__ */ (0, Q.jsx)(s, {
|
|
357
358
|
id: r,
|
|
358
359
|
"data-testid": `tool-param-${r}`,
|
|
359
360
|
value: w,
|
|
@@ -365,144 +366,144 @@ function Ie({ selectedTool: e, toolArgs: t, onArgChange: n, onBulkPaste: r, auto
|
|
|
365
366
|
})]
|
|
366
367
|
}, r);
|
|
367
368
|
})
|
|
368
|
-
}) : /* @__PURE__ */ (0,
|
|
369
|
+
}) : /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
369
370
|
className: "flex items-center justify-center h-32 text-gray-500 dark:text-gray-400 text-sm",
|
|
370
371
|
children: "No parameters required"
|
|
371
372
|
});
|
|
372
373
|
}
|
|
373
374
|
//#endregion
|
|
374
375
|
//#region src/client/components/tools/ToolExecutionPanel.tsx
|
|
375
|
-
function Le({ selectedTool: e, toolArgs: t, payloadToSend:
|
|
376
|
-
let S = "hidden @[700px]/tool-exec:inline", w = "hidden @[700px]/tool-exec:inline shrink-0 text-[10px] leading-none border border-current/30 p-1 rounded-full", T = "max-[699px]/tool-exec:size-8 max-[699px]/tool-exec:min-w-8 max-[699px]/tool-exec:shrink-0 max-[699px]/tool-exec:gap-0 max-[699px]/tool-exec:rounded-full max-[699px]/tool-exec
|
|
377
|
-
return (0,
|
|
378
|
-
if (
|
|
379
|
-
let e =
|
|
380
|
-
|
|
376
|
+
function Le({ selectedTool: e, toolArgs: t, payloadToSend: r, isExecuting: o, isConnected: s, onArgChange: c, onExecute: l, onSave: m, onCancel: h, onBulkPaste: g, autoFilledFields: _, setFields: v, sendEmptyFields: y, onToggleEmpty: b }) {
|
|
377
|
+
let S = "hidden @[700px]/tool-exec:inline", w = "hidden @[700px]/tool-exec:inline shrink-0 text-[10px] leading-none border border-current/30 p-1 rounded-full", T = "@max-[699px]/tool-exec:size-8 @max-[699px]/tool-exec:min-w-8 @max-[699px]/tool-exec:shrink-0 @max-[699px]/tool-exec:gap-0 @max-[699px]/tool-exec:rounded-full @max-[699px]/tool-exec:!px-0 @max-[699px]/tool-exec:!py-0", E = "@max-[699px]/tool-exec:!pr-0", [D, A] = (0, Z.useState)(!1), [N, P] = (0, Z.useState)(!1), [F, R] = (0, Z.useState)(!1), [z, H] = (0, Z.useState)(!1), [U, W] = (0, Z.useState)(!1), G = (0, Z.useRef)(null);
|
|
378
|
+
return (0, Z.useEffect)(() => {
|
|
379
|
+
if (G.current && e?.description) {
|
|
380
|
+
let e = G.current, t = parseFloat(getComputedStyle(e).lineHeight), n = e.scrollHeight;
|
|
381
|
+
W(Math.round(n / t) > 3), H(!1);
|
|
381
382
|
}
|
|
382
|
-
}, [e?.description]), (0,
|
|
383
|
+
}, [e?.description]), (0, Z.useEffect)(() => {
|
|
383
384
|
let t = (t) => {
|
|
384
|
-
(t.metaKey || t.ctrlKey) && t.key === "Enter" && e && !o &&
|
|
385
|
+
(t.metaKey || t.ctrlKey) && t.key === "Enter" && e && !o && s && (t.preventDefault(), l()), t.key === "Escape" && o && h && (t.preventDefault(), h());
|
|
385
386
|
};
|
|
386
387
|
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
387
388
|
}, [
|
|
388
389
|
e,
|
|
389
390
|
o,
|
|
390
|
-
|
|
391
|
-
|
|
391
|
+
s,
|
|
392
|
+
l,
|
|
392
393
|
h
|
|
393
|
-
]), e ? /* @__PURE__ */ (0,
|
|
394
|
+
]), e ? /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
394
395
|
className: "flex flex-col h-full @container/tool-exec",
|
|
395
396
|
children: [
|
|
396
|
-
/* @__PURE__ */ (0,
|
|
397
|
+
/* @__PURE__ */ (0, Q.jsx)("div", {
|
|
397
398
|
className: "shrink-0 p-3 sm:p-5 pt-3 sm:pt-4 pb-2 sm:pb-2 sm:pr-4",
|
|
398
|
-
children: /* @__PURE__ */ (0,
|
|
399
|
+
children: /* @__PURE__ */ (0, Q.jsx)("div", { children: /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
399
400
|
className: "flex flex-row items-center justify-between mb-0 gap-2",
|
|
400
|
-
children: [/* @__PURE__ */ (0,
|
|
401
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("h3", {
|
|
401
402
|
className: "text-base sm:text-lg font-semibold",
|
|
402
403
|
"data-testid": "tool-execution-title",
|
|
403
404
|
children: e.name
|
|
404
|
-
}), /* @__PURE__ */ (0,
|
|
405
|
+
}), /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
405
406
|
className: "flex gap-2 shrink-0",
|
|
406
407
|
children: [
|
|
407
|
-
/* @__PURE__ */ (0,
|
|
408
|
-
render: /* @__PURE__ */ (0,
|
|
408
|
+
/* @__PURE__ */ (0, Q.jsxs)(i, { children: [/* @__PURE__ */ (0, Q.jsx)(n, {
|
|
409
|
+
render: /* @__PURE__ */ (0, Q.jsxs)(p, {
|
|
409
410
|
"data-testid": "tool-execution-metadata-button",
|
|
410
411
|
variant: N ? "default" : "outline",
|
|
411
412
|
onClick: () => P(!N),
|
|
412
413
|
disabled: o,
|
|
413
414
|
size: "sm",
|
|
414
|
-
className:
|
|
415
|
+
className: u(d, T),
|
|
415
416
|
title: "View tool metadata",
|
|
416
|
-
children: [/* @__PURE__ */ (0,
|
|
417
|
+
children: [/* @__PURE__ */ (0, Q.jsx)(B, {}), /* @__PURE__ */ (0, Q.jsx)("span", {
|
|
417
418
|
className: S,
|
|
418
419
|
children: "Metadata"
|
|
419
420
|
})]
|
|
420
421
|
}),
|
|
421
422
|
nativeButton: !0
|
|
422
|
-
}), /* @__PURE__ */ (0,
|
|
423
|
-
/* @__PURE__ */ (0,
|
|
424
|
-
render: /* @__PURE__ */ (0,
|
|
423
|
+
}), /* @__PURE__ */ (0, Q.jsx)(a, { children: /* @__PURE__ */ (0, Q.jsx)("p", { children: "View tool definition metadata" }) })] }),
|
|
424
|
+
/* @__PURE__ */ (0, Q.jsxs)(i, { children: [/* @__PURE__ */ (0, Q.jsx)(n, {
|
|
425
|
+
render: /* @__PURE__ */ (0, Q.jsxs)(p, {
|
|
425
426
|
"data-testid": "tool-execution-copy-payload-button",
|
|
426
427
|
variant: "outline",
|
|
427
428
|
onClick: async () => {
|
|
428
429
|
if (e) try {
|
|
429
|
-
await
|
|
430
|
+
await L(JSON.stringify(r ?? t, null, 2)), R(!0), setTimeout(() => R(!1), 2e3);
|
|
430
431
|
} catch {}
|
|
431
432
|
},
|
|
432
433
|
disabled: o,
|
|
433
434
|
size: "sm",
|
|
434
|
-
className:
|
|
435
|
+
className: u(d, T),
|
|
435
436
|
title: "Copy payload as JSON",
|
|
436
|
-
children: [F ? /* @__PURE__ */ (0,
|
|
437
|
+
children: [F ? /* @__PURE__ */ (0, Q.jsx)(te, { className: "text-green-600" }) : /* @__PURE__ */ (0, Q.jsx)(I, {}), /* @__PURE__ */ (0, Q.jsx)("span", {
|
|
437
438
|
className: S,
|
|
438
439
|
children: F ? "Copied!" : "Payload"
|
|
439
440
|
})]
|
|
440
441
|
}),
|
|
441
442
|
nativeButton: !0
|
|
442
|
-
}), /* @__PURE__ */ (0,
|
|
443
|
-
/* @__PURE__ */ (0,
|
|
444
|
-
render: /* @__PURE__ */ (0,
|
|
443
|
+
}), /* @__PURE__ */ (0, Q.jsx)(a, { children: /* @__PURE__ */ (0, Q.jsx)("p", { children: "Copy payload as JSON" }) })] }),
|
|
444
|
+
/* @__PURE__ */ (0, Q.jsxs)(i, { children: [/* @__PURE__ */ (0, Q.jsx)(n, {
|
|
445
|
+
render: /* @__PURE__ */ (0, Q.jsxs)(p, {
|
|
445
446
|
"data-testid": "tool-execution-save-button",
|
|
446
447
|
variant: "outline",
|
|
447
448
|
onClick: m,
|
|
448
449
|
disabled: o,
|
|
449
450
|
size: "sm",
|
|
450
|
-
className:
|
|
451
|
+
className: u(d, T),
|
|
451
452
|
title: "Save request",
|
|
452
|
-
children: [/* @__PURE__ */ (0,
|
|
453
|
+
children: [/* @__PURE__ */ (0, Q.jsx)(K, {}), /* @__PURE__ */ (0, Q.jsx)("span", {
|
|
453
454
|
className: S,
|
|
454
455
|
children: "Save"
|
|
455
456
|
})]
|
|
456
457
|
}),
|
|
457
458
|
nativeButton: !0
|
|
458
|
-
}), /* @__PURE__ */ (0,
|
|
459
|
-
o && h ? /* @__PURE__ */ (0,
|
|
459
|
+
}), /* @__PURE__ */ (0, Q.jsx)(a, { children: /* @__PURE__ */ (0, Q.jsx)("p", { children: "Save request" }) })] }),
|
|
460
|
+
o && h ? /* @__PURE__ */ (0, Q.jsxs)(i, {
|
|
460
461
|
open: D ? void 0 : !1,
|
|
461
|
-
children: [/* @__PURE__ */ (0,
|
|
462
|
-
render: /* @__PURE__ */ (0,
|
|
462
|
+
children: [/* @__PURE__ */ (0, Q.jsx)(n, {
|
|
463
|
+
render: /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
463
464
|
onMouseEnter: () => A(!0),
|
|
464
465
|
onMouseLeave: () => A(!1),
|
|
465
466
|
className: "relative",
|
|
466
|
-
children: /* @__PURE__ */ (0,
|
|
467
|
+
children: /* @__PURE__ */ (0, Q.jsx)(p, {
|
|
467
468
|
"data-testid": "tool-execution-cancel-button",
|
|
468
469
|
onClick: h,
|
|
469
470
|
variant: D ? "destructive" : "default",
|
|
470
471
|
size: "sm",
|
|
471
|
-
className:
|
|
472
|
-
children: D ? /* @__PURE__ */ (0,
|
|
473
|
-
/* @__PURE__ */ (0,
|
|
474
|
-
/* @__PURE__ */ (0,
|
|
472
|
+
className: u(f, T, E, "transition-all"),
|
|
473
|
+
children: D ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [
|
|
474
|
+
/* @__PURE__ */ (0, Q.jsx)(de, {}),
|
|
475
|
+
/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
475
476
|
className: S,
|
|
476
477
|
children: "Cancel"
|
|
477
478
|
}),
|
|
478
|
-
/* @__PURE__ */ (0,
|
|
479
|
+
/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
479
480
|
className: w,
|
|
480
481
|
children: "Esc"
|
|
481
482
|
})
|
|
482
|
-
] }) : /* @__PURE__ */ (0,
|
|
483
|
+
] }) : /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(X, {}), /* @__PURE__ */ (0, Q.jsx)("span", {
|
|
483
484
|
className: S,
|
|
484
485
|
children: "Executing..."
|
|
485
486
|
})] })
|
|
486
487
|
})
|
|
487
488
|
}),
|
|
488
489
|
nativeButton: !1
|
|
489
|
-
}), /* @__PURE__ */ (0,
|
|
490
|
-
}) : /* @__PURE__ */ (0,
|
|
490
|
+
}), /* @__PURE__ */ (0, Q.jsx)(a, { children: /* @__PURE__ */ (0, Q.jsx)("p", { children: "Hover to cancel (or press Esc)" }) })]
|
|
491
|
+
}) : /* @__PURE__ */ (0, Q.jsx)(p, {
|
|
491
492
|
"data-testid": "tool-execution-execute-button",
|
|
492
|
-
onClick:
|
|
493
|
-
disabled: o || !
|
|
493
|
+
onClick: l,
|
|
494
|
+
disabled: o || !s,
|
|
494
495
|
size: "sm",
|
|
495
|
-
className:
|
|
496
|
-
children: o ? /* @__PURE__ */ (0,
|
|
496
|
+
className: u(f, T, E),
|
|
497
|
+
children: o ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(X, {}), /* @__PURE__ */ (0, Q.jsx)("span", {
|
|
497
498
|
className: S,
|
|
498
499
|
children: "Executing..."
|
|
499
|
-
})] }) : /* @__PURE__ */ (0,
|
|
500
|
-
/* @__PURE__ */ (0,
|
|
501
|
-
/* @__PURE__ */ (0,
|
|
500
|
+
})] }) : /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [
|
|
501
|
+
/* @__PURE__ */ (0, Q.jsx)(le, {}),
|
|
502
|
+
/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
502
503
|
className: S,
|
|
503
504
|
children: "Execute"
|
|
504
505
|
}),
|
|
505
|
-
/* @__PURE__ */ (0,
|
|
506
|
+
/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
506
507
|
className: w,
|
|
507
508
|
children: "⌘↵"
|
|
508
509
|
})
|
|
@@ -512,30 +513,30 @@ function Le({ selectedTool: e, toolArgs: t, payloadToSend: n, isExecuting: o, is
|
|
|
512
513
|
})]
|
|
513
514
|
}) })
|
|
514
515
|
}),
|
|
515
|
-
/* @__PURE__ */ (0,
|
|
516
|
+
/* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
516
517
|
className: "flex-1 overflow-y-auto px-3 sm:px-5 pb-4 pr-3",
|
|
517
|
-
children: [e.description && /* @__PURE__ */ (0,
|
|
518
|
+
children: [e.description && /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
518
519
|
className: "relative mb-6",
|
|
519
|
-
children: [/* @__PURE__ */ (0,
|
|
520
|
+
children: [/* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
520
521
|
className: "relative",
|
|
521
|
-
children: [/* @__PURE__ */ (0,
|
|
522
|
-
ref:
|
|
522
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("p", {
|
|
523
|
+
ref: G,
|
|
523
524
|
"data-testid": "tool-execution-description",
|
|
524
|
-
className: `text-sm text-gray-600 dark:text-gray-400 leading-relaxed transition-all duration-300 ${!
|
|
525
|
+
className: `text-sm text-gray-600 dark:text-gray-400 leading-relaxed transition-all duration-300 ${!z && U ? "line-clamp-3" : ""}`,
|
|
525
526
|
children: e.description
|
|
526
|
-
}), U && !
|
|
527
|
-
}), U && /* @__PURE__ */ (0,
|
|
527
|
+
}), U && !z && /* @__PURE__ */ (0, Q.jsx)("div", { className: "absolute bottom-0 left-0 right-0 h-[1.4em] bg-linear-to-t from-white/95 dark:from-black/95 via-white/55 dark:via-black/55 to-transparent pointer-events-none" })]
|
|
528
|
+
}), U && /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
528
529
|
className: "flex justify-end",
|
|
529
|
-
children: /* @__PURE__ */ (0,
|
|
530
|
-
onClick: () =>
|
|
530
|
+
children: /* @__PURE__ */ (0, Q.jsx)("button", {
|
|
531
|
+
onClick: () => H(!z),
|
|
531
532
|
className: "relative z-10 inline-flex items-center gap-1 text-xs text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 mt-1 transition-colors",
|
|
532
|
-
children:
|
|
533
|
+
children: z ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: ["Show less", /* @__PURE__ */ (0, Q.jsx)(Ce, { className: "h-3 w-3" })] }) : /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: ["Show more", /* @__PURE__ */ (0, Q.jsx)(x, { className: "h-3 w-3" })] })
|
|
533
534
|
})
|
|
534
535
|
})]
|
|
535
|
-
}), /* @__PURE__ */ (0,
|
|
536
|
+
}), /* @__PURE__ */ (0, Q.jsx)(Ie, {
|
|
536
537
|
selectedTool: e,
|
|
537
538
|
toolArgs: t,
|
|
538
|
-
onArgChange:
|
|
539
|
+
onArgChange: c,
|
|
539
540
|
onBulkPaste: g,
|
|
540
541
|
autoFilledFields: _,
|
|
541
542
|
setFields: v,
|
|
@@ -543,20 +544,20 @@ function Le({ selectedTool: e, toolArgs: t, payloadToSend: n, isExecuting: o, is
|
|
|
543
544
|
onToggleEmpty: b
|
|
544
545
|
})]
|
|
545
546
|
}),
|
|
546
|
-
/* @__PURE__ */ (0,
|
|
547
|
+
/* @__PURE__ */ (0, Q.jsx)(ee, {
|
|
547
548
|
open: N,
|
|
548
549
|
onOpenChange: P,
|
|
549
|
-
children: /* @__PURE__ */ (0,
|
|
550
|
+
children: /* @__PURE__ */ (0, Q.jsxs)(j, {
|
|
550
551
|
scrollable: !0,
|
|
551
552
|
className: "max-w-3xl max-h-[80vh]",
|
|
552
|
-
children: [/* @__PURE__ */ (0,
|
|
553
|
+
children: [/* @__PURE__ */ (0, Q.jsx)(k, {
|
|
553
554
|
sticky: !0,
|
|
554
|
-
children: /* @__PURE__ */ (0,
|
|
555
|
-
}), /* @__PURE__ */ (0,
|
|
555
|
+
children: /* @__PURE__ */ (0, Q.jsx)(C, { children: "Tool Definition" })
|
|
556
|
+
}), /* @__PURE__ */ (0, Q.jsx)(O, { children: /* @__PURE__ */ (0, Q.jsx)(M, {
|
|
556
557
|
onCopy: async () => {
|
|
557
|
-
e && await
|
|
558
|
+
e && await L(JSON.stringify(e, null, 2));
|
|
558
559
|
},
|
|
559
|
-
children: /* @__PURE__ */ (0,
|
|
560
|
+
children: /* @__PURE__ */ (0, Q.jsx)(V, {
|
|
560
561
|
data: e,
|
|
561
562
|
filename: `tool-definition-${e.name}-${Date.now()}.json`
|
|
562
563
|
})
|
|
@@ -564,12 +565,12 @@ function Le({ selectedTool: e, toolArgs: t, payloadToSend: n, isExecuting: o, is
|
|
|
564
565
|
})
|
|
565
566
|
})
|
|
566
567
|
]
|
|
567
|
-
}) : /* @__PURE__ */ (0,
|
|
568
|
+
}) : /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
568
569
|
className: "flex flex-col items-center justify-center h-full p-4 text-center",
|
|
569
|
-
children: [/* @__PURE__ */ (0,
|
|
570
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("p", {
|
|
570
571
|
className: "text-gray-500 dark:text-gray-400 mb-2",
|
|
571
572
|
children: "Select a tool to get started"
|
|
572
|
-
}), /* @__PURE__ */ (0,
|
|
573
|
+
}), /* @__PURE__ */ (0, Q.jsx)("p", {
|
|
573
574
|
className: "text-xs text-gray-400 dark:text-gray-500",
|
|
574
575
|
children: "Choose a tool from the list to view its details and execute it"
|
|
575
576
|
})]
|
|
@@ -578,13 +579,13 @@ function Le({ selectedTool: e, toolArgs: t, payloadToSend: n, isExecuting: o, is
|
|
|
578
579
|
//#endregion
|
|
579
580
|
//#region src/client/components/tools/ToolResultDisplay.tsx
|
|
580
581
|
function Re({ timestamp: e }) {
|
|
581
|
-
let [t, n] = (0,
|
|
582
|
-
return (0,
|
|
582
|
+
let [t, n] = (0, Z.useState)(() => ze(e));
|
|
583
|
+
return (0, Z.useEffect)(() => {
|
|
583
584
|
let t = () => n(ze(e));
|
|
584
585
|
t();
|
|
585
586
|
let r = setInterval(t, 1e3);
|
|
586
587
|
return () => clearInterval(r);
|
|
587
|
-
}, [e]), /* @__PURE__ */ (0,
|
|
588
|
+
}, [e]), /* @__PURE__ */ (0, Q.jsx)("span", { children: t });
|
|
588
589
|
}
|
|
589
590
|
function ze(e) {
|
|
590
591
|
let t = Date.now() - e, n = Math.floor(t / 1e3), r = Math.floor(n / 60), i = Math.floor(r / 60), a = Math.floor(i / 24);
|
|
@@ -599,73 +600,73 @@ function Be(e) {
|
|
|
599
600
|
}
|
|
600
601
|
return "An error occurred";
|
|
601
602
|
}
|
|
602
|
-
function
|
|
603
|
+
function $(e) {
|
|
603
604
|
try {
|
|
604
605
|
return JSON.parse(e), !0;
|
|
605
606
|
} catch {
|
|
606
607
|
return !1;
|
|
607
608
|
}
|
|
608
609
|
}
|
|
609
|
-
function
|
|
610
|
-
let [t, n] = (0,
|
|
610
|
+
function Ve({ content: e }) {
|
|
611
|
+
let [t, n] = (0, Z.useState)(/* @__PURE__ */ new Set()), r = (0, Z.useCallback)((e) => {
|
|
611
612
|
n((t) => {
|
|
612
613
|
let n = new Set(t);
|
|
613
614
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
614
615
|
});
|
|
615
616
|
}, []);
|
|
616
|
-
return !Array.isArray(e) || e.length === 0 ? /* @__PURE__ */ (0,
|
|
617
|
+
return !Array.isArray(e) || e.length === 0 ? /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
617
618
|
className: "text-sm text-gray-500 dark:text-gray-400",
|
|
618
619
|
children: "No content"
|
|
619
|
-
}) : /* @__PURE__ */ (0,
|
|
620
|
+
}) : /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
620
621
|
className: "space-y-4",
|
|
621
622
|
children: e.map((e, n) => {
|
|
622
623
|
if (e.type === "text") {
|
|
623
|
-
let i = e.text || "", a = t.has(n), o =
|
|
624
|
+
let i = e.text || "", a = t.has(n), o = $(i), s = o ? (() => {
|
|
624
625
|
try {
|
|
625
626
|
return JSON.parse(i);
|
|
626
627
|
} catch {
|
|
627
628
|
return null;
|
|
628
629
|
}
|
|
629
630
|
})() : null;
|
|
630
|
-
return /* @__PURE__ */ (0,
|
|
631
|
+
return /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
631
632
|
className: "space-y-2",
|
|
632
|
-
children: [/* @__PURE__ */ (0,
|
|
633
|
+
children: [/* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
633
634
|
className: "flex items-center justify-between gap-2",
|
|
634
|
-
children: [/* @__PURE__ */ (0,
|
|
635
|
+
children: [/* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
635
636
|
className: "text-xs font-medium text-gray-500 dark:text-gray-400",
|
|
636
637
|
children: ["Text Content", a ? " (formatted)" : ""]
|
|
637
|
-
}), o && /* @__PURE__ */ (0,
|
|
638
|
+
}), o && /* @__PURE__ */ (0, Q.jsx)("button", {
|
|
638
639
|
type: "button",
|
|
639
640
|
onClick: () => r(n),
|
|
640
641
|
className: "text-xs text-blue-600 dark:text-blue-400 hover:underline",
|
|
641
642
|
"data-testid": `tool-result-format-toggle-${n}`,
|
|
642
643
|
children: a ? "Show as text" : "Try to format"
|
|
643
644
|
})]
|
|
644
|
-
}), a && s !== null ? /* @__PURE__ */ (0,
|
|
645
|
+
}), a && s !== null ? /* @__PURE__ */ (0, Q.jsx)(V, {
|
|
645
646
|
data: s,
|
|
646
647
|
filename: `content-${n}.json`
|
|
647
|
-
}) : /* @__PURE__ */ (0,
|
|
648
|
+
}) : /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
648
649
|
className: "bg-gray-50 dark:bg-zinc-900 rounded-lg p-3 font-mono text-sm whitespace-pre-wrap break-words",
|
|
649
650
|
"data-testid": "tool-execution-results-text-content",
|
|
650
651
|
children: i
|
|
651
652
|
})]
|
|
652
653
|
}, n);
|
|
653
654
|
}
|
|
654
|
-
if (e.type === "image") return /* @__PURE__ */ (0,
|
|
655
|
+
if (e.type === "image") return /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
655
656
|
className: "space-y-2",
|
|
656
|
-
children: [/* @__PURE__ */ (0,
|
|
657
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("div", {
|
|
657
658
|
className: "text-xs font-medium text-gray-500 dark:text-gray-400",
|
|
658
659
|
children: "Image Content"
|
|
659
|
-
}), /* @__PURE__ */ (0,
|
|
660
|
+
}), /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
660
661
|
className: "bg-gray-50 dark:bg-zinc-900 rounded-lg p-3",
|
|
661
|
-
children: [/* @__PURE__ */ (0,
|
|
662
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("img", {
|
|
662
663
|
src: `data:${e.mimeType || "image/png"};base64,${e.data}`,
|
|
663
664
|
alt: "Result",
|
|
664
665
|
className: "max-w-full rounded",
|
|
665
666
|
"data-testid": "tool-execution-results-image-content"
|
|
666
|
-
}), e.annotations && /* @__PURE__ */ (0,
|
|
667
|
+
}), e.annotations && /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
667
668
|
className: "mt-2 text-xs text-gray-500 dark:text-gray-400",
|
|
668
|
-
children: /* @__PURE__ */ (0,
|
|
669
|
+
children: /* @__PURE__ */ (0, Q.jsx)(V, {
|
|
669
670
|
data: e.annotations,
|
|
670
671
|
filename: `image-annotations-${n}.json`,
|
|
671
672
|
"data-testid": "tool-execution-results-image-annotations"
|
|
@@ -673,21 +674,21 @@ function He({ content: e }) {
|
|
|
673
674
|
})]
|
|
674
675
|
})]
|
|
675
676
|
}, n);
|
|
676
|
-
if (e.type === "audio") return /* @__PURE__ */ (0,
|
|
677
|
+
if (e.type === "audio") return /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
677
678
|
className: "space-y-2",
|
|
678
|
-
children: [/* @__PURE__ */ (0,
|
|
679
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("div", {
|
|
679
680
|
className: "text-xs font-medium text-gray-500 dark:text-gray-400",
|
|
680
681
|
children: "Audio Content"
|
|
681
|
-
}), /* @__PURE__ */ (0,
|
|
682
|
+
}), /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
682
683
|
className: "bg-gray-50 dark:bg-zinc-900 rounded-lg p-3",
|
|
683
|
-
children: [/* @__PURE__ */ (0,
|
|
684
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("audio", {
|
|
684
685
|
controls: !0,
|
|
685
686
|
src: `data:${e.mimeType || "audio/wav"};base64,${e.data}`,
|
|
686
687
|
className: "w-full",
|
|
687
688
|
"data-testid": "tool-execution-results-audio-content"
|
|
688
|
-
}), e.annotations && /* @__PURE__ */ (0,
|
|
689
|
+
}), e.annotations && /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
689
690
|
className: "mt-2 text-xs text-gray-500 dark:text-gray-400",
|
|
690
|
-
children: /* @__PURE__ */ (0,
|
|
691
|
+
children: /* @__PURE__ */ (0, Q.jsx)(V, {
|
|
691
692
|
data: e.annotations,
|
|
692
693
|
filename: `audio-annotations-${n}.json`,
|
|
693
694
|
"data-testid": "tool-execution-results-audio-annotations"
|
|
@@ -695,18 +696,18 @@ function He({ content: e }) {
|
|
|
695
696
|
})]
|
|
696
697
|
})]
|
|
697
698
|
}, n);
|
|
698
|
-
if (e.type === "resource_link") return /* @__PURE__ */ (0,
|
|
699
|
+
if (e.type === "resource_link") return /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
699
700
|
className: "space-y-2",
|
|
700
|
-
children: [/* @__PURE__ */ (0,
|
|
701
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("div", {
|
|
701
702
|
className: "text-xs font-medium text-gray-500 dark:text-gray-400",
|
|
702
703
|
children: "Resource Link"
|
|
703
|
-
}), /* @__PURE__ */ (0,
|
|
704
|
+
}), /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
704
705
|
className: "bg-gray-50 dark:bg-zinc-900 rounded-lg p-3 space-y-2",
|
|
705
706
|
children: [
|
|
706
|
-
/* @__PURE__ */ (0,
|
|
707
|
+
/* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
707
708
|
className: "font-mono text-sm break-all",
|
|
708
709
|
children: [
|
|
709
|
-
/* @__PURE__ */ (0,
|
|
710
|
+
/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
710
711
|
className: "text-gray-600 dark:text-gray-400",
|
|
711
712
|
children: "URI:"
|
|
712
713
|
}),
|
|
@@ -714,10 +715,10 @@ function He({ content: e }) {
|
|
|
714
715
|
e.uri
|
|
715
716
|
]
|
|
716
717
|
}),
|
|
717
|
-
e.name && /* @__PURE__ */ (0,
|
|
718
|
+
e.name && /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
718
719
|
className: "text-sm",
|
|
719
720
|
children: [
|
|
720
|
-
/* @__PURE__ */ (0,
|
|
721
|
+
/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
721
722
|
className: "text-gray-600 dark:text-gray-400",
|
|
722
723
|
children: "Name:"
|
|
723
724
|
}),
|
|
@@ -725,10 +726,10 @@ function He({ content: e }) {
|
|
|
725
726
|
e.name
|
|
726
727
|
]
|
|
727
728
|
}),
|
|
728
|
-
e.description && /* @__PURE__ */ (0,
|
|
729
|
+
e.description && /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
729
730
|
className: "text-sm",
|
|
730
731
|
children: [
|
|
731
|
-
/* @__PURE__ */ (0,
|
|
732
|
+
/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
732
733
|
className: "text-gray-600 dark:text-gray-400",
|
|
733
734
|
children: "Description:"
|
|
734
735
|
}),
|
|
@@ -736,10 +737,10 @@ function He({ content: e }) {
|
|
|
736
737
|
e.description
|
|
737
738
|
]
|
|
738
739
|
}),
|
|
739
|
-
e.mimeType && /* @__PURE__ */ (0,
|
|
740
|
+
e.mimeType && /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
740
741
|
className: "text-sm",
|
|
741
742
|
children: [
|
|
742
|
-
/* @__PURE__ */ (0,
|
|
743
|
+
/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
743
744
|
className: "text-gray-600 dark:text-gray-400",
|
|
744
745
|
children: "MIME Type:"
|
|
745
746
|
}),
|
|
@@ -747,12 +748,12 @@ function He({ content: e }) {
|
|
|
747
748
|
e.mimeType
|
|
748
749
|
]
|
|
749
750
|
}),
|
|
750
|
-
e.annotations && /* @__PURE__ */ (0,
|
|
751
|
+
e.annotations && /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
751
752
|
className: "mt-2",
|
|
752
|
-
children: [/* @__PURE__ */ (0,
|
|
753
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("div", {
|
|
753
754
|
className: "text-xs text-gray-500 dark:text-gray-400 mb-1",
|
|
754
755
|
children: "Annotations:"
|
|
755
|
-
}), /* @__PURE__ */ (0,
|
|
756
|
+
}), /* @__PURE__ */ (0, Q.jsx)(V, {
|
|
756
757
|
data: e.annotations,
|
|
757
758
|
filename: `resource-link-annotations-${n}.json`,
|
|
758
759
|
"data-testid": "tool-execution-results-resource-link-annotations"
|
|
@@ -763,19 +764,19 @@ function He({ content: e }) {
|
|
|
763
764
|
}, n);
|
|
764
765
|
if (e.type === "resource") {
|
|
765
766
|
let t = e.resource || {};
|
|
766
|
-
return /* @__PURE__ */ (0,
|
|
767
|
+
return /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
767
768
|
className: "space-y-2",
|
|
768
|
-
children: [/* @__PURE__ */ (0,
|
|
769
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("div", {
|
|
769
770
|
className: "text-xs font-medium text-gray-500 dark:text-gray-400",
|
|
770
771
|
children: "Embedded Resource"
|
|
771
|
-
}), /* @__PURE__ */ (0,
|
|
772
|
+
}), /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
772
773
|
className: "bg-gray-50 dark:bg-zinc-900 rounded-lg p-3 space-y-2",
|
|
773
774
|
children: [
|
|
774
|
-
/* @__PURE__ */ (0,
|
|
775
|
+
/* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
775
776
|
className: "font-mono text-sm break-all",
|
|
776
777
|
"data-testid": "tool-execution-results-resource-uri",
|
|
777
778
|
children: [
|
|
778
|
-
/* @__PURE__ */ (0,
|
|
779
|
+
/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
779
780
|
className: "text-gray-600 dark:text-gray-400",
|
|
780
781
|
children: "URI:"
|
|
781
782
|
}),
|
|
@@ -783,10 +784,10 @@ function He({ content: e }) {
|
|
|
783
784
|
t.uri
|
|
784
785
|
]
|
|
785
786
|
}),
|
|
786
|
-
t.mimeType && /* @__PURE__ */ (0,
|
|
787
|
+
t.mimeType && /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
787
788
|
className: "text-sm",
|
|
788
789
|
children: [
|
|
789
|
-
/* @__PURE__ */ (0,
|
|
790
|
+
/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
790
791
|
className: "text-gray-600 dark:text-gray-400",
|
|
791
792
|
"data-testid": "tool-execution-results-mime-type",
|
|
792
793
|
children: "MIME Type:"
|
|
@@ -795,17 +796,17 @@ function He({ content: e }) {
|
|
|
795
796
|
t.mimeType
|
|
796
797
|
]
|
|
797
798
|
}),
|
|
798
|
-
t.text && /* @__PURE__ */ (0,
|
|
799
|
+
t.text && /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
799
800
|
"data-testid": "tool-execution-results-resource-text-content",
|
|
800
|
-
children: [/* @__PURE__ */ (0,
|
|
801
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("div", {
|
|
801
802
|
className: "text-xs text-gray-500 dark:text-gray-400 mb-1",
|
|
802
803
|
children: "Content:"
|
|
803
|
-
}), /* @__PURE__ */ (0,
|
|
804
|
+
}), /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
804
805
|
className: "bg-white dark:bg-black rounded p-2 font-mono text-sm whitespace-pre-wrap break-words max-h-60 overflow-y-auto",
|
|
805
806
|
children: t.text
|
|
806
807
|
})]
|
|
807
808
|
}),
|
|
808
|
-
t.blob && /* @__PURE__ */ (0,
|
|
809
|
+
t.blob && /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
809
810
|
className: "text-sm text-gray-600 dark:text-gray-400",
|
|
810
811
|
children: [
|
|
811
812
|
"[Binary content: ",
|
|
@@ -813,12 +814,12 @@ function He({ content: e }) {
|
|
|
813
814
|
" bytes]"
|
|
814
815
|
]
|
|
815
816
|
}),
|
|
816
|
-
t.annotations && /* @__PURE__ */ (0,
|
|
817
|
+
t.annotations && /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
817
818
|
className: "mt-2",
|
|
818
|
-
children: [/* @__PURE__ */ (0,
|
|
819
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("div", {
|
|
819
820
|
className: "text-xs text-gray-500 dark:text-gray-400 mb-1",
|
|
820
821
|
children: "Annotations:"
|
|
821
|
-
}), /* @__PURE__ */ (0,
|
|
822
|
+
}), /* @__PURE__ */ (0, Q.jsx)(V, {
|
|
822
823
|
data: t.annotations,
|
|
823
824
|
filename: `resource-annotations-${n}.json`,
|
|
824
825
|
"data-testid": "tool-execution-results-resource-annotations"
|
|
@@ -828,12 +829,12 @@ function He({ content: e }) {
|
|
|
828
829
|
})]
|
|
829
830
|
}, n);
|
|
830
831
|
}
|
|
831
|
-
return /* @__PURE__ */ (0,
|
|
832
|
+
return /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
832
833
|
className: "space-y-2",
|
|
833
|
-
children: [/* @__PURE__ */ (0,
|
|
834
|
+
children: [/* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
834
835
|
className: "text-xs font-medium text-gray-500 dark:text-gray-400",
|
|
835
836
|
children: ["Unknown Content Type: ", e.type || "N/A"]
|
|
836
|
-
}), /* @__PURE__ */ (0,
|
|
837
|
+
}), /* @__PURE__ */ (0, Q.jsx)(V, {
|
|
837
838
|
data: e,
|
|
838
839
|
filename: `content-${n}.json`,
|
|
839
840
|
"data-testid": "tool-execution-results-unknown-content"
|
|
@@ -842,86 +843,60 @@ function He({ content: e }) {
|
|
|
842
843
|
})
|
|
843
844
|
});
|
|
844
845
|
}
|
|
845
|
-
function
|
|
846
|
-
let f =
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
});
|
|
858
|
-
if (!f) return /* @__PURE__ */ (0, Z.jsx)(I, {
|
|
859
|
-
className: "w-full h-full min-h-[240px]",
|
|
860
|
-
children: /* @__PURE__ */ (0, Z.jsx)(Y, { className: "size-5" })
|
|
861
|
-
});
|
|
862
|
-
let p = l === "inline" ? "w-full h-full flex items-center justify-center relative p-4 min-h-0" : "w-full h-full relative p-4", m = c ? JSON.stringify(c) : "no-custom-props";
|
|
863
|
-
return /* @__PURE__ */ (0, Z.jsx)(I, {
|
|
864
|
-
className: "w-full h-full min-h-[240px]",
|
|
865
|
-
children: /* @__PURE__ */ (0, Z.jsx)(ye, {
|
|
866
|
-
viewId: t,
|
|
867
|
-
toolName: n,
|
|
868
|
-
toolInput: i,
|
|
869
|
-
toolOutput: a,
|
|
870
|
-
customProps: c,
|
|
871
|
-
className: p,
|
|
872
|
-
onMessage: (e) => {
|
|
873
|
-
e.length > 0 && d && d(e);
|
|
874
|
-
},
|
|
875
|
-
...f
|
|
876
|
-
}, m)
|
|
877
|
-
});
|
|
878
|
-
}
|
|
879
|
-
function We({ results: e, copiedResult: t, serverId: n, readResource: r, onCopy: i, onMaximize: a, isMaximized: o = !1, onRerunTool: s }) {
|
|
880
|
-
let [c, u] = (0, X.useState)(0), [d, f] = (0, X.useState)(!0), [p, m] = (0, X.useState)(null), [h, b] = (0, X.useState)("inline"), [x, S] = (0, X.useState)(null), C = (0, X.useRef)(!1), w = e[0], T = w ? e.filter((e) => e.toolName === w.toolName) : [], E = T[c] || T[0], D = e.findIndex((e) => e === E), O = (E ? E.error || Be(E.result) : null) ?? (E == null ? "" : JSON.stringify(E.result, null, 2));
|
|
881
|
-
(0, X.useEffect)(() => {
|
|
882
|
-
T.length > 0 && c >= T.length && u(0);
|
|
883
|
-
}, [T.length, c]), (0, X.useEffect)(() => {
|
|
884
|
-
C.current = !1, m(null);
|
|
885
|
-
}, [w?.toolName]);
|
|
886
|
-
let k = (0, X.useMemo)(() => E?.args, [E?.timestamp, c]), A = (0, X.useMemo)(() => E?.result, [
|
|
887
|
-
E?.timestamp,
|
|
888
|
-
E?.duration,
|
|
889
|
-
c
|
|
890
|
-
]), j = (0, X.useCallback)((e) => r(e), [r]), M = (0, X.useCallback)((e) => {
|
|
846
|
+
function He({ results: e, copiedResult: t, serverId: n, readResource: r, onCopy: i, onMaximize: a, isMaximized: o = !1, onRerunTool: s, onWidgetHeightChange: c }) {
|
|
847
|
+
let [l, u] = (0, Z.useState)(0), [d, f] = (0, Z.useState)(!0), [m, h] = (0, Z.useState)(null), [g, x] = (0, Z.useState)("inline"), [S, C] = (0, Z.useState)(null), w = (0, Z.useRef)(!1), T = e[0], E = T ? e.filter((e) => e.toolName === T.toolName) : [], D = E[l] || E[0], O = e.findIndex((e) => e === D), k = (D ? D.error || Be(D.result) : null) ?? (D == null ? "" : JSON.stringify(D.result, null, 2));
|
|
848
|
+
(0, Z.useEffect)(() => {
|
|
849
|
+
E.length > 0 && l >= E.length && u(0);
|
|
850
|
+
}, [E.length, l]), (0, Z.useEffect)(() => {
|
|
851
|
+
w.current = !1, h(null);
|
|
852
|
+
}, [T?.toolName]);
|
|
853
|
+
let A = (0, Z.useMemo)(() => D?.args, [D?.timestamp, l]), j = (0, Z.useMemo)(() => D?.result, [
|
|
854
|
+
D?.timestamp,
|
|
855
|
+
D?.duration,
|
|
856
|
+
l
|
|
857
|
+
]), M = (0, Z.useCallback)((e) => r(e), [r]), ee = (0, Z.useCallback)((e) => {
|
|
891
858
|
let t = e.filter((e) => e.type === "text" && "text" in e).map((e) => e.text).join("\n"), n = e.filter((e) => e.type === "image").length, r = e.filter((e) => e.type === "resource").length, i = [n > 0 && `${n} image${n > 1 ? "s" : ""}`, r > 0 && `${r} resource${r > 1 ? "s" : ""}`].filter(Boolean).join(", ");
|
|
892
|
-
|
|
859
|
+
_e.info("Widget follow-up", {
|
|
893
860
|
description: [t, i].filter(Boolean).join(" — "),
|
|
894
861
|
duration: 5e3
|
|
895
862
|
});
|
|
896
|
-
}, []),
|
|
863
|
+
}, []), N = (0, Z.useMemo)(() => D && Y(D.toolMeta) ? "mcp-apps" : null, [D]), P = (0, Z.useMemo)(() => D?.toolMeta ? ge(D.toolMeta) : null, [D?.toolMeta]), L = (0, Z.useMemo)(() => N === "mcp-apps" && !!P, [N, P]), R = (0, Z.useMemo)(() => D?.result?.content || [], [D]), B = (0, Z.useMemo)(() => P || null, [P]), H = (0, Z.useMemo)(() => !!(R && R.length > 0 || D?.result?.structuredContent), [R, D]), U = (0, Z.useMemo)(() => !L && H, [L, H]), W = (0, Z.useMemo)(() => {
|
|
897
864
|
let e = [];
|
|
898
|
-
return
|
|
865
|
+
return L && P && e.push({
|
|
899
866
|
mode: "mcp-apps",
|
|
900
867
|
label: "Component (MCP Apps)"
|
|
901
868
|
}), e.push({
|
|
902
869
|
mode: "json",
|
|
903
870
|
label: "Raw JSON"
|
|
904
871
|
}), e;
|
|
905
|
-
}, [
|
|
906
|
-
return (0,
|
|
907
|
-
if (
|
|
908
|
-
let e =
|
|
872
|
+
}, [L, P]);
|
|
873
|
+
return (0, Z.useEffect)(() => {
|
|
874
|
+
if (W.length === 0) return;
|
|
875
|
+
let e = m && W.some((e) => e.mode === m), t = W.find((e) => e.mode !== "json");
|
|
909
876
|
if (t) {
|
|
910
|
-
let n =
|
|
911
|
-
if (
|
|
912
|
-
|
|
877
|
+
let n = w.current;
|
|
878
|
+
if (w.current = !0, !m || !e || m === "json" && !n) {
|
|
879
|
+
h(t.mode);
|
|
913
880
|
return;
|
|
914
881
|
}
|
|
915
|
-
} else (!
|
|
916
|
-
}, [
|
|
917
|
-
|
|
918
|
-
|
|
882
|
+
} else (!m || !e) && h("json");
|
|
883
|
+
}, [W, m]), (0, Z.useEffect)(() => {
|
|
884
|
+
c && (e.length === 0 || m !== "mcp-apps" || g !== "inline" || !L) && c(null);
|
|
885
|
+
}, [
|
|
886
|
+
c,
|
|
887
|
+
e.length,
|
|
888
|
+
m,
|
|
889
|
+
g,
|
|
890
|
+
L
|
|
891
|
+
]), e.length === 0 ? /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
892
|
+
className: "flex flex-col h-full bg-white dark:bg-black",
|
|
893
|
+
children: /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
919
894
|
className: "flex-1 overflow-y-auto h-full",
|
|
920
|
-
children: /* @__PURE__ */ (0,
|
|
895
|
+
children: /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
921
896
|
className: "flex items-center justify-center h-full",
|
|
922
|
-
children: /* @__PURE__ */ (0,
|
|
897
|
+
children: /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
923
898
|
className: "text-center",
|
|
924
|
-
children: /* @__PURE__ */ (0,
|
|
899
|
+
children: /* @__PURE__ */ (0, Q.jsx)(pe, {
|
|
925
900
|
vertical: !0,
|
|
926
901
|
noBorder: !0,
|
|
927
902
|
message: "No Results yet"
|
|
@@ -929,99 +904,99 @@ function We({ results: e, copiedResult: t, serverId: n, readResource: r, onCopy:
|
|
|
929
904
|
})
|
|
930
905
|
})
|
|
931
906
|
})
|
|
932
|
-
}) : /* @__PURE__ */ (0,
|
|
933
|
-
className: "relative flex flex-col h-full bg-white dark:bg-black
|
|
934
|
-
children: [/* @__PURE__ */ (0,
|
|
907
|
+
}) : /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
908
|
+
className: "relative flex flex-col h-full bg-white dark:bg-black",
|
|
909
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("div", {
|
|
935
910
|
className: "flex-1 overflow-y-auto h-full",
|
|
936
|
-
children: /* @__PURE__ */ (0,
|
|
911
|
+
children: /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
937
912
|
className: "space-y-0 flex flex-col flex-1 h-full",
|
|
938
|
-
children: [/* @__PURE__ */ (0,
|
|
939
|
-
className: `sticky top-0 z-40 flex items-center gap-2 px-4 pt-2 backdrop-blur-xs bg-white/50 dark:bg-black/50 ${
|
|
913
|
+
children: [/* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
914
|
+
className: `sticky top-0 z-40 flex items-center gap-2 px-4 pt-2 backdrop-blur-xs bg-white/50 dark:bg-black/50 ${L || U ? "border-b border-gray-200 dark:border-zinc-600 pb-2" : ""}`,
|
|
940
915
|
children: [
|
|
941
|
-
/* @__PURE__ */ (0,
|
|
916
|
+
/* @__PURE__ */ (0, Q.jsx)("h3", {
|
|
942
917
|
className: "text-sm font-medium hidden sm:block",
|
|
943
918
|
children: "Response"
|
|
944
919
|
}),
|
|
945
|
-
|
|
920
|
+
D.duration !== void 0 && /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
946
921
|
className: "hidden sm:flex items-center gap-1",
|
|
947
|
-
children: [/* @__PURE__ */ (0,
|
|
922
|
+
children: [/* @__PURE__ */ (0, Q.jsx)(z, { className: "h-3 w-3 text-gray-400" }), /* @__PURE__ */ (0, Q.jsxs)("span", {
|
|
948
923
|
className: "text-xs text-gray-500 dark:text-gray-400",
|
|
949
|
-
children: [
|
|
924
|
+
children: [D.duration, "ms"]
|
|
950
925
|
})]
|
|
951
926
|
}),
|
|
952
|
-
|
|
927
|
+
L && /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
953
928
|
className: "flex items-center gap-4 sm:ml-4",
|
|
954
|
-
children: /* @__PURE__ */ (0,
|
|
929
|
+
children: /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
955
930
|
className: "flex items-center gap-2",
|
|
956
|
-
children:
|
|
931
|
+
children: W.map((e, t) => /* @__PURE__ */ (0, Q.jsxs)(Z.Fragment, { children: [t > 0 && /* @__PURE__ */ (0, Q.jsx)("span", {
|
|
957
932
|
className: "text-xs text-zinc-400",
|
|
958
933
|
children: "|"
|
|
959
|
-
}), /* @__PURE__ */ (0,
|
|
934
|
+
}), /* @__PURE__ */ (0, Q.jsx)("button", {
|
|
960
935
|
"data-testid": `tool-result-view-${e.mode}`,
|
|
961
|
-
onClick: () =>
|
|
962
|
-
className: `text-xs font-medium ${
|
|
936
|
+
onClick: () => h(e.mode),
|
|
937
|
+
className: `text-xs font-medium ${m === e.mode ? "text-black dark:text-white" : "text-zinc-500 dark:text-zinc-400"}`,
|
|
963
938
|
children: e.label
|
|
964
939
|
})] }, e.mode))
|
|
965
940
|
})
|
|
966
941
|
}),
|
|
967
|
-
|
|
942
|
+
U && /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
968
943
|
className: "flex items-center gap-2 sm:ml-4",
|
|
969
944
|
children: [
|
|
970
|
-
/* @__PURE__ */ (0,
|
|
945
|
+
/* @__PURE__ */ (0, Q.jsx)("button", {
|
|
971
946
|
onClick: () => f(!0),
|
|
972
947
|
className: `text-xs font-medium ${d ? "text-black dark:text-white" : "text-zinc-500 dark:text-zinc-400"}`,
|
|
973
948
|
children: "Formatted"
|
|
974
949
|
}),
|
|
975
|
-
/* @__PURE__ */ (0,
|
|
950
|
+
/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
976
951
|
className: "text-xs text-zinc-400",
|
|
977
952
|
children: "|"
|
|
978
953
|
}),
|
|
979
|
-
/* @__PURE__ */ (0,
|
|
954
|
+
/* @__PURE__ */ (0, Q.jsx)("button", {
|
|
980
955
|
onClick: () => f(!1),
|
|
981
956
|
className: `text-xs font-medium ${d ? "text-zinc-500 dark:text-zinc-400" : "text-black dark:text-white"}`,
|
|
982
957
|
children: "Raw"
|
|
983
958
|
})
|
|
984
959
|
]
|
|
985
960
|
}),
|
|
986
|
-
/* @__PURE__ */ (0,
|
|
961
|
+
/* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
987
962
|
className: "ml-auto flex items-center gap-1",
|
|
988
963
|
children: [
|
|
989
|
-
o && s && /* @__PURE__ */ (0,
|
|
964
|
+
o && s && /* @__PURE__ */ (0, Q.jsxs)(p, {
|
|
990
965
|
"data-testid": "tool-result-rerun",
|
|
991
966
|
variant: "ghost",
|
|
992
967
|
size: "sm",
|
|
993
968
|
onClick: s,
|
|
994
969
|
title: "Re-run with same arguments",
|
|
995
|
-
children: [/* @__PURE__ */ (0,
|
|
970
|
+
children: [/* @__PURE__ */ (0, Q.jsx)(le, { className: "h-4 w-4" }), /* @__PURE__ */ (0, Q.jsx)("span", {
|
|
996
971
|
className: "hidden sm:inline ml-1",
|
|
997
972
|
children: "Re-run"
|
|
998
973
|
})]
|
|
999
974
|
}),
|
|
1000
|
-
|
|
975
|
+
L && a && /* @__PURE__ */ (0, Q.jsx)(p, {
|
|
1001
976
|
"data-testid": "tool-result-maximize",
|
|
1002
977
|
variant: "ghost",
|
|
1003
978
|
size: "sm",
|
|
1004
979
|
onClick: a,
|
|
1005
980
|
title: o ? "Restore" : "Maximize",
|
|
1006
|
-
children: o ? /* @__PURE__ */ (0,
|
|
981
|
+
children: o ? /* @__PURE__ */ (0, Q.jsx)(oe, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, Q.jsx)(ae, { className: "h-4 w-4" })
|
|
1007
982
|
}),
|
|
1008
|
-
|
|
1009
|
-
value:
|
|
983
|
+
E.length > 1 && /* @__PURE__ */ (0, Q.jsxs)(b, {
|
|
984
|
+
value: l.toString(),
|
|
1010
985
|
onValueChange: (e) => u(parseInt(e)),
|
|
1011
|
-
children: [/* @__PURE__ */ (0,
|
|
986
|
+
children: [/* @__PURE__ */ (0, Q.jsx)(_, {
|
|
1012
987
|
className: "w-[140px] h-8 text-xs",
|
|
1013
|
-
leading: /* @__PURE__ */ (0,
|
|
988
|
+
leading: /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
1014
989
|
className: "flex items-center gap-1",
|
|
1015
|
-
children: [/* @__PURE__ */ (0,
|
|
990
|
+
children: [/* @__PURE__ */ (0, Q.jsx)(ie, { className: "h-3 w-3" }), /* @__PURE__ */ (0, Q.jsx)(Re, { timestamp: D.timestamp })]
|
|
1016
991
|
})
|
|
1017
|
-
}), /* @__PURE__ */ (0,
|
|
992
|
+
}), /* @__PURE__ */ (0, Q.jsx)(v, { children: E.map((e, t) => /* @__PURE__ */ (0, Q.jsx)(y, {
|
|
1018
993
|
value: t.toString(),
|
|
1019
|
-
children: /* @__PURE__ */ (0,
|
|
994
|
+
children: /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
1020
995
|
className: "flex items-center gap-2",
|
|
1021
996
|
children: [
|
|
1022
|
-
/* @__PURE__ */ (0,
|
|
1023
|
-
/* @__PURE__ */ (0,
|
|
1024
|
-
/* @__PURE__ */ (0,
|
|
997
|
+
/* @__PURE__ */ (0, Q.jsx)(ie, { className: "h-3 w-3" }),
|
|
998
|
+
/* @__PURE__ */ (0, Q.jsx)("span", { children: ze(e.timestamp) }),
|
|
999
|
+
/* @__PURE__ */ (0, Q.jsxs)("span", {
|
|
1025
1000
|
className: "text-xs text-muted-foreground",
|
|
1026
1001
|
children: [
|
|
1027
1002
|
"(",
|
|
@@ -1033,93 +1008,98 @@ function We({ results: e, copiedResult: t, serverId: n, readResource: r, onCopy:
|
|
|
1033
1008
|
})
|
|
1034
1009
|
}, t)) })]
|
|
1035
1010
|
}),
|
|
1036
|
-
/* @__PURE__ */ (0,
|
|
1037
|
-
"data-testid": `tool-result-copy-${
|
|
1011
|
+
/* @__PURE__ */ (0, Q.jsx)(p, {
|
|
1012
|
+
"data-testid": `tool-result-copy-${O}`,
|
|
1038
1013
|
variant: "ghost",
|
|
1039
1014
|
size: "sm",
|
|
1040
|
-
onClick: () => i(
|
|
1041
|
-
children: t ===
|
|
1015
|
+
onClick: () => i(O, k),
|
|
1016
|
+
children: t === O ? /* @__PURE__ */ (0, Q.jsx)(te, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, Q.jsx)(I, { className: "h-4 w-4" })
|
|
1042
1017
|
})
|
|
1043
1018
|
]
|
|
1044
1019
|
})
|
|
1045
1020
|
]
|
|
1046
1021
|
}), (() => {
|
|
1047
|
-
let e =
|
|
1048
|
-
return e ? /* @__PURE__ */ (0,
|
|
1022
|
+
let e = D.error || Be(D.result);
|
|
1023
|
+
return e ? /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
1049
1024
|
className: "bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded p-3 mx-4",
|
|
1050
|
-
children: [/* @__PURE__ */ (0,
|
|
1025
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("p", {
|
|
1051
1026
|
className: "text-red-800 dark:text-red-300 font-medium",
|
|
1052
1027
|
children: "Error:"
|
|
1053
|
-
}), /* @__PURE__ */ (0,
|
|
1028
|
+
}), /* @__PURE__ */ (0, Q.jsx)("p", {
|
|
1054
1029
|
className: "text-red-700 dark:text-red-400 text-sm",
|
|
1055
1030
|
children: e
|
|
1056
1031
|
})]
|
|
1057
1032
|
}) : (() => {
|
|
1058
|
-
if (!
|
|
1033
|
+
if (!m) return /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
1059
1034
|
className: "flex items-center justify-center w-full h-[200px]",
|
|
1060
|
-
children: /* @__PURE__ */ (0,
|
|
1035
|
+
children: /* @__PURE__ */ (0, Q.jsx)(X, { className: "size-5" })
|
|
1061
1036
|
});
|
|
1062
|
-
switch (
|
|
1063
|
-
case "mcp-apps": return !
|
|
1037
|
+
switch (m) {
|
|
1038
|
+
case "mcp-apps": return !L || !P ? /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
1064
1039
|
className: "px-4 pt-4",
|
|
1065
|
-
children: /* @__PURE__ */ (0,
|
|
1040
|
+
children: /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
1066
1041
|
className: "bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded p-3",
|
|
1067
|
-
children: /* @__PURE__ */ (0,
|
|
1042
|
+
children: /* @__PURE__ */ (0, Q.jsx)("p", {
|
|
1068
1043
|
className: "text-sm text-red-600 dark:text-red-400",
|
|
1069
1044
|
children: "MCP Apps resource not available"
|
|
1070
1045
|
})
|
|
1071
1046
|
})
|
|
1072
|
-
}) : /* @__PURE__ */ (0,
|
|
1073
|
-
className: "flex flex-1
|
|
1074
|
-
children: [/* @__PURE__ */ (0,
|
|
1047
|
+
}) : /* @__PURE__ */ (0, Q.jsxs)(be, {
|
|
1048
|
+
className: "relative flex flex-1 w-full min-h-[240px] items-stretch",
|
|
1049
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("div", {
|
|
1075
1050
|
className: "absolute top-2 right-2 z-30 flex items-center gap-2",
|
|
1076
|
-
children: /* @__PURE__ */ (0,
|
|
1077
|
-
toolCallId: `tool-${
|
|
1078
|
-
displayMode:
|
|
1079
|
-
onDisplayModeChange:
|
|
1051
|
+
children: /* @__PURE__ */ (0, Q.jsx)(F, {
|
|
1052
|
+
toolCallId: `tool-${D.timestamp}`,
|
|
1053
|
+
displayMode: g,
|
|
1054
|
+
onDisplayModeChange: x,
|
|
1080
1055
|
propsContext: "tool",
|
|
1081
|
-
resourceUri:
|
|
1082
|
-
toolInput:
|
|
1083
|
-
resourceAnnotations:
|
|
1056
|
+
resourceUri: P,
|
|
1057
|
+
toolInput: D.args,
|
|
1058
|
+
resourceAnnotations: D.toolMeta,
|
|
1084
1059
|
llmConfig: null,
|
|
1085
1060
|
resource: null,
|
|
1086
|
-
onPropsChange:
|
|
1061
|
+
onPropsChange: C
|
|
1087
1062
|
})
|
|
1088
|
-
}), /* @__PURE__ */ (0,
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1063
|
+
}), /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
1064
|
+
className: "flex min-h-0 flex-1 flex-col pt-11",
|
|
1065
|
+
children: /* @__PURE__ */ (0, Q.jsx)(xe, {
|
|
1066
|
+
serverId: n,
|
|
1067
|
+
viewId: `tool-${D.timestamp}`,
|
|
1068
|
+
toolName: D.toolName,
|
|
1069
|
+
toolInput: A,
|
|
1070
|
+
toolOutput: j,
|
|
1071
|
+
toolMetadata: D.toolMeta,
|
|
1072
|
+
resourceUri: P,
|
|
1073
|
+
readResource: M,
|
|
1074
|
+
customProps: S || void 0,
|
|
1075
|
+
displayMode: g,
|
|
1076
|
+
onDisplayModeChange: x,
|
|
1077
|
+
onSendFollowUp: ee,
|
|
1078
|
+
onWidgetHeightChange: c ? (e) => c(e) : void 0,
|
|
1079
|
+
noWrapper: !0
|
|
1080
|
+
}, `mcp-apps-${D.timestamp}`)
|
|
1081
|
+
})]
|
|
1102
1082
|
});
|
|
1103
1083
|
case "json":
|
|
1104
|
-
if (
|
|
1105
|
-
let e =
|
|
1106
|
-
return /* @__PURE__ */ (0,
|
|
1084
|
+
if (U && d) {
|
|
1085
|
+
let e = D.result?.structuredContent;
|
|
1086
|
+
return /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
1107
1087
|
className: "px-4 pt-4 space-y-4",
|
|
1108
1088
|
"data-testid": "tool-execution-results-content",
|
|
1109
1089
|
children: [
|
|
1110
|
-
e && /* @__PURE__ */ (0,
|
|
1090
|
+
e && /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
1111
1091
|
className: "space-y-2",
|
|
1112
1092
|
"data-testid": "tool-execution-results-structured-content",
|
|
1113
|
-
children: [/* @__PURE__ */ (0,
|
|
1093
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("div", {
|
|
1114
1094
|
className: "text-xs font-medium text-gray-500 dark:text-gray-400",
|
|
1115
1095
|
children: "Structured Content"
|
|
1116
|
-
}), /* @__PURE__ */ (0,
|
|
1096
|
+
}), /* @__PURE__ */ (0, Q.jsx)(V, {
|
|
1117
1097
|
data: e,
|
|
1118
|
-
filename: `structured-content-${
|
|
1098
|
+
filename: `structured-content-${D.toolName}-${Date.now()}.json`
|
|
1119
1099
|
})]
|
|
1120
1100
|
}),
|
|
1121
|
-
|
|
1122
|
-
!e && (!
|
|
1101
|
+
R && R.length > 0 && /* @__PURE__ */ (0, Q.jsx)(Ve, { content: R }),
|
|
1102
|
+
!e && (!R || R.length === 0) && /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
1123
1103
|
className: "text-sm text-gray-500 dark:text-gray-400",
|
|
1124
1104
|
"data-testid": "tool-execution-results-no-content",
|
|
1125
1105
|
children: "No content to display"
|
|
@@ -1127,11 +1107,11 @@ function We({ results: e, copiedResult: t, serverId: n, readResource: r, onCopy:
|
|
|
1127
1107
|
]
|
|
1128
1108
|
});
|
|
1129
1109
|
}
|
|
1130
|
-
return /* @__PURE__ */ (0,
|
|
1110
|
+
return /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
1131
1111
|
className: "px-4 pt-4",
|
|
1132
|
-
children: /* @__PURE__ */ (0,
|
|
1133
|
-
data:
|
|
1134
|
-
filename: `tool-result-${
|
|
1112
|
+
children: /* @__PURE__ */ (0, Q.jsx)(V, {
|
|
1113
|
+
data: D.result,
|
|
1114
|
+
filename: `tool-result-${D.toolName}-${Date.now()}.json`
|
|
1135
1115
|
})
|
|
1136
1116
|
});
|
|
1137
1117
|
default: return null;
|
|
@@ -1139,46 +1119,46 @@ function We({ results: e, copiedResult: t, serverId: n, readResource: r, onCopy:
|
|
|
1139
1119
|
})();
|
|
1140
1120
|
})()]
|
|
1141
1121
|
})
|
|
1142
|
-
}),
|
|
1122
|
+
}), B && m === "mcp-apps" && /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
1143
1123
|
className: "absolute bottom-0 left-1/2 -translate-x-1/2 z-40 pointer-events-none",
|
|
1144
|
-
children: /* @__PURE__ */ (0,
|
|
1124
|
+
children: /* @__PURE__ */ (0, Q.jsx)("span", {
|
|
1145
1125
|
className: "text-[11px] bg-gray-200 dark:bg-zinc-800 text-gray-500 dark:text-gray-400 px-3 py-0.5 rounded-t-xl font-mono max-w-[320px] truncate block",
|
|
1146
|
-
children:
|
|
1126
|
+
children: B
|
|
1147
1127
|
})
|
|
1148
1128
|
})]
|
|
1149
1129
|
});
|
|
1150
1130
|
}
|
|
1151
1131
|
//#endregion
|
|
1152
1132
|
//#region src/client/components/tools/ToolsList.tsx
|
|
1153
|
-
function
|
|
1154
|
-
if (e.length === 0) return /* @__PURE__ */ (0,
|
|
1133
|
+
function Ue({ tools: e, selectedTool: t, onToolSelect: r, focusedIndex: s }) {
|
|
1134
|
+
if (e.length === 0) return /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
1155
1135
|
className: "flex flex-1 flex-col items-center justify-center p-4 text-center",
|
|
1156
|
-
children: [/* @__PURE__ */ (0,
|
|
1136
|
+
children: [/* @__PURE__ */ (0, Q.jsx)(ue, { className: "h-12 w-12 text-gray-400 dark:text-gray-600 mb-3" }), /* @__PURE__ */ (0, Q.jsx)("p", {
|
|
1157
1137
|
className: "text-gray-500 dark:text-gray-400",
|
|
1158
1138
|
children: "No tools available"
|
|
1159
1139
|
})]
|
|
1160
1140
|
});
|
|
1161
|
-
let
|
|
1162
|
-
return /* @__PURE__ */ (0,
|
|
1163
|
-
let u = e._meta, d =
|
|
1141
|
+
let c = e.some((e) => e.inputSchema?.properties && Object.keys(e.inputSchema.properties).length > 0);
|
|
1142
|
+
return /* @__PURE__ */ (0, Q.jsx)("div", { children: e.map((e, l) => {
|
|
1143
|
+
let u = e._meta, d = Y(u) ? "mcp-apps" : null, f = e.inputSchema?.properties, p = f ? Object.keys(f).length : 0, m = c && p > 0 && /* @__PURE__ */ (0, Q.jsxs)(o, {
|
|
1164
1144
|
variant: "outline",
|
|
1165
1145
|
className: "text-xs border-gray-300 dark:border-zinc-600 text-gray-600 dark:text-gray-400",
|
|
1166
1146
|
children: [p, " params"]
|
|
1167
|
-
}), h = d === "mcp-apps" || m ? /* @__PURE__ */ (0,
|
|
1147
|
+
}), h = d === "mcp-apps" || m ? /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
1168
1148
|
className: "flex items-center gap-1.5",
|
|
1169
|
-
children: [d === "mcp-apps" && /* @__PURE__ */ (0,
|
|
1170
|
-
render: /* @__PURE__ */ (0,
|
|
1149
|
+
children: [d === "mcp-apps" && /* @__PURE__ */ (0, Q.jsxs)(i, { children: [/* @__PURE__ */ (0, Q.jsx)(n, {
|
|
1150
|
+
render: /* @__PURE__ */ (0, Q.jsx)("span", {
|
|
1171
1151
|
className: "inline-flex",
|
|
1172
|
-
children: /* @__PURE__ */ (0,
|
|
1152
|
+
children: /* @__PURE__ */ (0, Q.jsx)(se, { className: "h-3.5 w-3.5" })
|
|
1173
1153
|
}),
|
|
1174
1154
|
nativeButton: !1
|
|
1175
|
-
}), /* @__PURE__ */ (0,
|
|
1155
|
+
}), /* @__PURE__ */ (0, Q.jsx)(a, { children: /* @__PURE__ */ (0, Q.jsx)("p", { children: "UI widget" }) })] }), m]
|
|
1176
1156
|
}) : void 0;
|
|
1177
|
-
return /* @__PURE__ */ (0,
|
|
1157
|
+
return /* @__PURE__ */ (0, Q.jsx)(ne, {
|
|
1178
1158
|
id: `tool-${e.name}`,
|
|
1179
1159
|
"data-testid": `tool-item-${e.name}`,
|
|
1180
1160
|
isSelected: t?.name === e.name,
|
|
1181
|
-
isFocused:
|
|
1161
|
+
isFocused: s === l,
|
|
1182
1162
|
title: e.name,
|
|
1183
1163
|
description: e.description,
|
|
1184
1164
|
metadata: h,
|
|
@@ -1188,88 +1168,88 @@ function Ge({ tools: e, selectedTool: t, onToolSelect: r, focusedIndex: a }) {
|
|
|
1188
1168
|
}
|
|
1189
1169
|
//#endregion
|
|
1190
1170
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/alert-dialog/root/AlertDialogRoot.mjs
|
|
1191
|
-
function
|
|
1171
|
+
function We(e) {
|
|
1192
1172
|
return A(e, "alert-dialog");
|
|
1193
1173
|
}
|
|
1194
1174
|
//#endregion
|
|
1195
1175
|
//#region src/client/components/ui/alert-dialog.tsx
|
|
1196
|
-
function
|
|
1197
|
-
return /* @__PURE__ */ (0,
|
|
1176
|
+
function Ge({ ...e }) {
|
|
1177
|
+
return /* @__PURE__ */ (0, Q.jsx)(We, {
|
|
1198
1178
|
"data-slot": "alert-dialog",
|
|
1199
1179
|
...e
|
|
1200
1180
|
});
|
|
1201
1181
|
}
|
|
1202
|
-
function
|
|
1203
|
-
return /* @__PURE__ */ (0,
|
|
1182
|
+
function Ke({ ...e }) {
|
|
1183
|
+
return /* @__PURE__ */ (0, Q.jsx)(D, {
|
|
1204
1184
|
"data-slot": "alert-dialog-portal",
|
|
1205
1185
|
...e
|
|
1206
1186
|
});
|
|
1207
1187
|
}
|
|
1208
|
-
function
|
|
1209
|
-
return /* @__PURE__ */ (0,
|
|
1188
|
+
function qe({ className: e, ...t }) {
|
|
1189
|
+
return /* @__PURE__ */ (0, Q.jsx)(N, {
|
|
1210
1190
|
"data-slot": "alert-dialog-overlay",
|
|
1211
|
-
className:
|
|
1191
|
+
className: u("fixed inset-0 isolate z-50 bg-black/50 duration-100 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", e),
|
|
1212
1192
|
...t
|
|
1213
1193
|
});
|
|
1214
1194
|
}
|
|
1215
|
-
function
|
|
1216
|
-
return /* @__PURE__ */ (0,
|
|
1195
|
+
function Je({ className: e, size: t = "default", ...n }) {
|
|
1196
|
+
return /* @__PURE__ */ (0, Q.jsxs)(Ke, { children: [/* @__PURE__ */ (0, Q.jsx)(qe, {}), /* @__PURE__ */ (0, Q.jsx)(E, {
|
|
1217
1197
|
"data-slot": "alert-dialog-content",
|
|
1218
1198
|
"data-size": t,
|
|
1219
|
-
className:
|
|
1199
|
+
className: u("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", e),
|
|
1220
1200
|
...n
|
|
1221
1201
|
})] });
|
|
1222
1202
|
}
|
|
1223
|
-
function
|
|
1224
|
-
return /* @__PURE__ */ (0,
|
|
1203
|
+
function Ye({ className: e, ...t }) {
|
|
1204
|
+
return /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
1225
1205
|
"data-slot": "alert-dialog-header",
|
|
1226
|
-
className:
|
|
1206
|
+
className: u("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", e),
|
|
1227
1207
|
...t
|
|
1228
1208
|
});
|
|
1229
1209
|
}
|
|
1230
|
-
function
|
|
1231
|
-
return /* @__PURE__ */ (0,
|
|
1210
|
+
function Xe({ className: e, ...t }) {
|
|
1211
|
+
return /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
1232
1212
|
"data-slot": "alert-dialog-footer",
|
|
1233
|
-
className:
|
|
1213
|
+
className: u("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end", e),
|
|
1234
1214
|
...t
|
|
1235
1215
|
});
|
|
1236
1216
|
}
|
|
1237
|
-
function
|
|
1238
|
-
return /* @__PURE__ */ (0,
|
|
1217
|
+
function Ze({ className: e, ...t }) {
|
|
1218
|
+
return /* @__PURE__ */ (0, Q.jsx)(w, {
|
|
1239
1219
|
"data-slot": "alert-dialog-title",
|
|
1240
|
-
className:
|
|
1220
|
+
className: u("text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", e),
|
|
1241
1221
|
...t
|
|
1242
1222
|
});
|
|
1243
1223
|
}
|
|
1244
|
-
function
|
|
1245
|
-
return /* @__PURE__ */ (0,
|
|
1224
|
+
function Qe({ className: e, ...t }) {
|
|
1225
|
+
return /* @__PURE__ */ (0, Q.jsx)(T, {
|
|
1246
1226
|
"data-slot": "alert-dialog-description",
|
|
1247
|
-
className:
|
|
1227
|
+
className: u("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", e),
|
|
1248
1228
|
...t
|
|
1249
1229
|
});
|
|
1250
1230
|
}
|
|
1251
|
-
function
|
|
1252
|
-
return /* @__PURE__ */ (0,
|
|
1231
|
+
function $e({ className: e, ...t }) {
|
|
1232
|
+
return /* @__PURE__ */ (0, Q.jsx)(p, {
|
|
1253
1233
|
"data-slot": "alert-dialog-action",
|
|
1254
|
-
className:
|
|
1234
|
+
className: u(e),
|
|
1255
1235
|
...t
|
|
1256
1236
|
});
|
|
1257
1237
|
}
|
|
1258
|
-
function
|
|
1259
|
-
return /* @__PURE__ */ (0,
|
|
1238
|
+
function et({ className: e, variant: t = "outline", size: n = "default", ...r }) {
|
|
1239
|
+
return /* @__PURE__ */ (0, Q.jsx)(S, {
|
|
1260
1240
|
"data-slot": "alert-dialog-cancel",
|
|
1261
|
-
className:
|
|
1262
|
-
render: /* @__PURE__ */ (0,
|
|
1241
|
+
className: u(e),
|
|
1242
|
+
render: /* @__PURE__ */ (0, Q.jsx)(p, {
|
|
1263
1243
|
variant: t,
|
|
1264
1244
|
size: n
|
|
1265
1245
|
}),
|
|
1266
|
-
...
|
|
1246
|
+
...r
|
|
1267
1247
|
});
|
|
1268
1248
|
}
|
|
1269
1249
|
//#endregion
|
|
1270
1250
|
//#region src/client/components/tools/useToolExecution.ts
|
|
1271
|
-
function
|
|
1272
|
-
let [o, s] = (0,
|
|
1251
|
+
function tt({ selectedTool: e, payloadToSend: t, toolArgs: n, callTool: r, readResource: i, serverId: a }) {
|
|
1252
|
+
let [o, s] = (0, Z.useState)([]), [c, l] = (0, Z.useState)(!1), [u, d] = (0, Z.useState)(null), [f, p] = (0, Z.useState)(null), m = (0, Z.useCallback)(async () => {
|
|
1273
1253
|
if (!e || c) return;
|
|
1274
1254
|
let o = new AbortController();
|
|
1275
1255
|
p(o), l(!0);
|
|
@@ -1294,7 +1274,7 @@ function rt({ selectedTool: e, payloadToSend: t, toolArgs: n, callTool: r, readR
|
|
|
1294
1274
|
resetTimeoutOnProgress: !0,
|
|
1295
1275
|
signal: o.signal
|
|
1296
1276
|
}), p = Date.now() - u, m = f?._meta ?? l;
|
|
1297
|
-
|
|
1277
|
+
me(new J({
|
|
1298
1278
|
toolName: e.name,
|
|
1299
1279
|
serverId: a,
|
|
1300
1280
|
success: !0,
|
|
@@ -1314,7 +1294,7 @@ function rt({ selectedTool: e, payloadToSend: t, toolArgs: n, callTool: r, readR
|
|
|
1314
1294
|
}, ...t]);
|
|
1315
1295
|
} catch (t) {
|
|
1316
1296
|
let r = Date.now() - u;
|
|
1317
|
-
|
|
1297
|
+
me(new J({
|
|
1318
1298
|
toolName: e.name,
|
|
1319
1299
|
serverId: a,
|
|
1320
1300
|
success: !1,
|
|
@@ -1342,15 +1322,15 @@ function rt({ selectedTool: e, payloadToSend: t, toolArgs: n, callTool: r, readR
|
|
|
1342
1322
|
r,
|
|
1343
1323
|
i,
|
|
1344
1324
|
a
|
|
1345
|
-
]), h = (0,
|
|
1325
|
+
]), h = (0, Z.useCallback)(async (e, t) => {
|
|
1346
1326
|
try {
|
|
1347
|
-
await
|
|
1327
|
+
await L(t), d(e), setTimeout(() => d(null), 2e3);
|
|
1348
1328
|
} catch (e) {
|
|
1349
1329
|
console.error("[ToolsTab] Failed to copy result:", e);
|
|
1350
1330
|
}
|
|
1351
|
-
}, []), g = (0,
|
|
1331
|
+
}, []), g = (0, Z.useCallback)((e) => {
|
|
1352
1332
|
s((t) => t.filter((t, n) => n !== e));
|
|
1353
|
-
}, []), _ = (0,
|
|
1333
|
+
}, []), _ = (0, Z.useMemo)(() => e ? o.filter((t) => t.toolName === e.name) : [], [o, e]);
|
|
1354
1334
|
return {
|
|
1355
1335
|
results: o,
|
|
1356
1336
|
setResults: s,
|
|
@@ -1359,7 +1339,7 @@ function rt({ selectedTool: e, payloadToSend: t, toolArgs: n, callTool: r, readR
|
|
|
1359
1339
|
executeTool: m,
|
|
1360
1340
|
handleCopyResult: h,
|
|
1361
1341
|
handleDeleteResult: g,
|
|
1362
|
-
handleFullscreen: (0,
|
|
1342
|
+
handleFullscreen: (0, Z.useCallback)((e) => {
|
|
1363
1343
|
let t = _[e];
|
|
1364
1344
|
if (!t) return;
|
|
1365
1345
|
let n = window.open("", "_blank", "width=800,height=600");
|
|
@@ -1371,39 +1351,41 @@ function rt({ selectedTool: e, payloadToSend: t, toolArgs: n, callTool: r, readR
|
|
|
1371
1351
|
`), n.document.close());
|
|
1372
1352
|
}, [_]),
|
|
1373
1353
|
filteredResults: _,
|
|
1374
|
-
cancelExecution: (0,
|
|
1354
|
+
cancelExecution: (0, Z.useCallback)(() => {
|
|
1375
1355
|
f?.abort(), p(null), l(!1);
|
|
1376
1356
|
}, [f])
|
|
1377
1357
|
};
|
|
1378
1358
|
}
|
|
1379
1359
|
//#endregion
|
|
1380
1360
|
//#region src/client/components/tools/useToolsTabNavigation.ts
|
|
1381
|
-
function
|
|
1382
|
-
let [h, g] = (0,
|
|
1383
|
-
(0,
|
|
1361
|
+
function nt({ ref: e, activeTab: t, filteredTools: n, savedRequests: r, searchQuery: i, setSearchQuery: a, selectedTool: o, results: s, isExecuting: c, handleToolSelect: l, loadSavedRequest: u, refreshTools: d, selectedToolName: f, tools: p, setSelectedToolName: m }) {
|
|
1362
|
+
let [h, g] = (0, Z.useState)(!1), [_, v] = (0, Z.useState)(-1), y = (0, Z.useRef)(null), [b, x] = (0, Z.useState)(!1), [S, C] = (0, Z.useState)("list"), [w, T] = (0, Z.useState)(!1);
|
|
1363
|
+
(0, Z.useEffect)(() => {
|
|
1384
1364
|
let e = () => x(window.innerWidth < 1024);
|
|
1385
1365
|
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
1386
|
-
}, []), (0,
|
|
1366
|
+
}, []), (0, Z.useEffect)(() => {
|
|
1387
1367
|
C(o ? "detail" : "list");
|
|
1388
|
-
}, [o]), (0,
|
|
1389
|
-
b
|
|
1368
|
+
}, [o]), (0, Z.useEffect)(() => {
|
|
1369
|
+
if (!b || s.length === 0) return;
|
|
1370
|
+
let e = s[0];
|
|
1371
|
+
(!c || e?.result === null) && C("response");
|
|
1390
1372
|
}, [
|
|
1391
1373
|
s,
|
|
1392
1374
|
c,
|
|
1393
1375
|
b
|
|
1394
|
-
]), (0,
|
|
1376
|
+
]), (0, Z.useImperativeHandle)(e, () => ({
|
|
1395
1377
|
focusSearch: () => {
|
|
1396
1378
|
g(!0), setTimeout(() => y.current?.focus(), 0);
|
|
1397
1379
|
},
|
|
1398
1380
|
blurSearch: () => {
|
|
1399
1381
|
a(""), g(!1), y.current?.blur();
|
|
1400
1382
|
}
|
|
1401
|
-
})), (0,
|
|
1383
|
+
})), (0, Z.useEffect)(() => {
|
|
1402
1384
|
h && y.current?.focus();
|
|
1403
1385
|
}, [h]);
|
|
1404
|
-
let E = (0,
|
|
1386
|
+
let E = (0, Z.useCallback)(() => {
|
|
1405
1387
|
i.trim() || g(!1);
|
|
1406
|
-
}, [i]), D = (0,
|
|
1388
|
+
}, [i]), D = (0, Z.useCallback)(async () => {
|
|
1407
1389
|
if (d) {
|
|
1408
1390
|
T(!0);
|
|
1409
1391
|
try {
|
|
@@ -1413,11 +1395,11 @@ function it({ ref: e, activeTab: t, filteredTools: n, savedRequests: r, searchQu
|
|
|
1413
1395
|
}
|
|
1414
1396
|
}
|
|
1415
1397
|
}, [d]);
|
|
1416
|
-
return (0,
|
|
1398
|
+
return (0, Z.useEffect)(() => {
|
|
1417
1399
|
t !== "tools" && g(!1);
|
|
1418
|
-
}, [t]), (0,
|
|
1400
|
+
}, [t]), (0, Z.useEffect)(() => {
|
|
1419
1401
|
v(-1);
|
|
1420
|
-
}, [i, t]), (0,
|
|
1402
|
+
}, [i, t]), (0, Z.useEffect)(() => {
|
|
1421
1403
|
let e = (e) => {
|
|
1422
1404
|
let i = e.target;
|
|
1423
1405
|
if (i.tagName === "INPUT" || i.tagName === "TEXTAREA" || i.contentEditable === "true" || e.metaKey || e.ctrlKey || e.altKey) return;
|
|
@@ -1440,7 +1422,7 @@ function it({ ref: e, activeTab: t, filteredTools: n, savedRequests: r, searchQu
|
|
|
1440
1422
|
t,
|
|
1441
1423
|
l,
|
|
1442
1424
|
u
|
|
1443
|
-
]), (0,
|
|
1425
|
+
]), (0, Z.useEffect)(() => {
|
|
1444
1426
|
if (_ >= 0) {
|
|
1445
1427
|
let e = t === "tools" ? `tool-${n[_]?.name}` : `saved-${r[_]?.id}`;
|
|
1446
1428
|
document.getElementById(e)?.scrollIntoView({
|
|
@@ -1453,7 +1435,7 @@ function it({ ref: e, activeTab: t, filteredTools: n, savedRequests: r, searchQu
|
|
|
1453
1435
|
n,
|
|
1454
1436
|
r,
|
|
1455
1437
|
t
|
|
1456
|
-
]), (0,
|
|
1438
|
+
]), (0, Z.useEffect)(() => {
|
|
1457
1439
|
if (!f || p.length === 0) return;
|
|
1458
1440
|
let e = p.find((e) => e.name === f);
|
|
1459
1441
|
if (e) {
|
|
@@ -1486,45 +1468,46 @@ function it({ ref: e, activeTab: t, filteredTools: n, savedRequests: r, searchQu
|
|
|
1486
1468
|
}
|
|
1487
1469
|
//#endregion
|
|
1488
1470
|
//#region src/client/components/ToolsTab.tsx
|
|
1489
|
-
|
|
1490
|
-
|
|
1471
|
+
var rt = 200, it = 140;
|
|
1472
|
+
function at({ ref: e, tools: t, callTool: n, readResource: i, serverId: a, isConnected: o, refreshTools: s }) {
|
|
1473
|
+
let [c, l] = (0, Z.useState)(null), [u, d] = (0, Z.useState)(null), { selectedToolName: f, setSelectedToolName: m } = ve(), [g, _] = (0, Z.useState)({}), [v, y] = (0, Z.useState)(/* @__PURE__ */ new Set()), [b, x] = (0, Z.useState)(/* @__PURE__ */ new Set()), [S, C] = (0, Z.useState)(""), [w, T] = (0, Z.useState)("tools"), { savedRequests: E, saveSavedRequests: D } = ce(), [O, k] = (0, Z.useState)(!1), [A, j] = (0, Z.useState)(""), [M, ee] = (0, Z.useState)(!1), [N, F] = (0, Z.useState)({
|
|
1491
1474
|
open: !1,
|
|
1492
1475
|
parsedObject: {},
|
|
1493
1476
|
fieldsToUpdate: [],
|
|
1494
1477
|
newFields: [],
|
|
1495
1478
|
resolve: null
|
|
1496
|
-
}), [
|
|
1497
|
-
M ? (
|
|
1479
|
+
}), [te, I] = (0, Z.useState)(/* @__PURE__ */ new Set()), L = re(), z = re(), B = re(), V = (0, Z.useRef)(null), ne = (0, Z.useRef)(!1), ie = (0, Z.useRef)(!1), ae = (0, Z.useRef)(!0), oe = (0, Z.useCallback)(() => {
|
|
1480
|
+
M ? (L.current && L.current.expand(), z.current && z.current.expand(), ee(!1)) : (L.current && L.current.collapse(), z.current && z.current.collapse(), ee(!0));
|
|
1498
1481
|
}, [
|
|
1499
1482
|
M,
|
|
1500
|
-
|
|
1483
|
+
L,
|
|
1501
1484
|
z
|
|
1502
|
-
]),
|
|
1485
|
+
]), K = (0, Z.useMemo)(() => {
|
|
1503
1486
|
if (!S.trim()) return t;
|
|
1504
1487
|
let e = S.toLowerCase();
|
|
1505
1488
|
return t.filter((t) => t.name.toLowerCase().includes(e) || t.description?.toLowerCase().includes(e));
|
|
1506
|
-
}, [t, S]),
|
|
1507
|
-
|
|
1489
|
+
}, [t, S]), se = (0, Z.useCallback)((e) => {
|
|
1490
|
+
l(e);
|
|
1508
1491
|
let t = {}, n = /* @__PURE__ */ new Set();
|
|
1509
1492
|
e.inputSchema?.properties && Object.entries(e.inputSchema.properties).forEach(([e, r]) => {
|
|
1510
1493
|
let i = r;
|
|
1511
1494
|
i.default !== void 0 && (t[e] = i.default, n.add(e));
|
|
1512
1495
|
}), _(t), y(n), x(/* @__PURE__ */ new Set());
|
|
1513
|
-
}, []),
|
|
1496
|
+
}, []), le = (0, Z.useCallback)((e) => {
|
|
1514
1497
|
let n = t.find((t) => t.name === e.toolName);
|
|
1515
|
-
n && (
|
|
1498
|
+
n && (l(n), _(e.args), y(new Set(Object.keys(e.args))), x(/* @__PURE__ */ new Set()), d(e));
|
|
1516
1499
|
}, [t]);
|
|
1517
|
-
(0,
|
|
1500
|
+
(0, Z.useEffect)(() => {
|
|
1518
1501
|
if (c) {
|
|
1519
1502
|
let e = t.find((e) => e.name === c.name);
|
|
1520
|
-
e ? e !== c && (JSON.stringify(e.inputSchema) !== JSON.stringify(c.inputSchema) || e.description !== c.description || JSON.stringify(e?._meta) !== JSON.stringify(c?._meta)) &&
|
|
1503
|
+
e ? e !== c && (JSON.stringify(e.inputSchema) !== JSON.stringify(c.inputSchema) || e.description !== c.description || JSON.stringify(e?._meta) !== JSON.stringify(c?._meta)) && l(e) : (l(null), m(null));
|
|
1521
1504
|
}
|
|
1522
1505
|
}, [
|
|
1523
1506
|
t,
|
|
1524
1507
|
c,
|
|
1525
|
-
|
|
1508
|
+
m
|
|
1526
1509
|
]);
|
|
1527
|
-
let
|
|
1510
|
+
let q = (0, Z.useCallback)((e, t) => {
|
|
1528
1511
|
let n = c?.inputSchema || {}, r = c?.inputSchema?.properties?.[e], i = r ? ke(r, n) : "string", a;
|
|
1529
1512
|
a = i === "object" || i === "array" || i === "string" ? t : Me(t, i), _((t) => ({
|
|
1530
1513
|
...t,
|
|
@@ -1538,7 +1521,7 @@ function at({ ref: e, tools: t, callTool: n, readResource: r, serverId: i, isCon
|
|
|
1538
1521
|
let n = new Set(t);
|
|
1539
1522
|
return n.delete(e), n;
|
|
1540
1523
|
});
|
|
1541
|
-
}, [c]),
|
|
1524
|
+
}, [c]), de = (0, Z.useCallback)((e, t, n) => {
|
|
1542
1525
|
if (n) {
|
|
1543
1526
|
let n = t === "array" ? "[]" : t === "object" ? "{}" : "";
|
|
1544
1527
|
_((t) => ({
|
|
@@ -1552,7 +1535,7 @@ function at({ ref: e, tools: t, callTool: n, readResource: r, serverId: i, isCon
|
|
|
1552
1535
|
let n = new Set(t);
|
|
1553
1536
|
return n.delete(e), n;
|
|
1554
1537
|
});
|
|
1555
|
-
}, []),
|
|
1538
|
+
}, []), fe = (0, Z.useCallback)(async (e, t) => {
|
|
1556
1539
|
if (!c) return !1;
|
|
1557
1540
|
let n = Fe(e);
|
|
1558
1541
|
if (!n) return !1;
|
|
@@ -1566,10 +1549,10 @@ function at({ ref: e, tools: t, callTool: n, readResource: r, serverId: i, isCon
|
|
|
1566
1549
|
key: e,
|
|
1567
1550
|
oldValue: l,
|
|
1568
1551
|
newValue: c
|
|
1569
|
-
}) : (s.push(e),
|
|
1552
|
+
}) : (s.push(e), q(e, String(c)));
|
|
1570
1553
|
}
|
|
1571
|
-
}), o.length === 0 && s.length === 0 ? !1 : o.length === 0 ? (
|
|
1572
|
-
|
|
1554
|
+
}), o.length === 0 && s.length === 0 ? !1 : o.length === 0 ? (I(new Set(s)), setTimeout(() => I(/* @__PURE__ */ new Set()), 2e3), !0) : new Promise((e) => {
|
|
1555
|
+
F({
|
|
1573
1556
|
open: !0,
|
|
1574
1557
|
parsedObject: n,
|
|
1575
1558
|
fieldsToUpdate: o,
|
|
@@ -1580,29 +1563,29 @@ function at({ ref: e, tools: t, callTool: n, readResource: r, serverId: i, isCon
|
|
|
1580
1563
|
}, [
|
|
1581
1564
|
c,
|
|
1582
1565
|
g,
|
|
1583
|
-
|
|
1584
|
-
]),
|
|
1566
|
+
q
|
|
1567
|
+
]), pe = (0, Z.useCallback)(() => {
|
|
1585
1568
|
if (!N.resolve) return;
|
|
1586
1569
|
N.fieldsToUpdate.forEach(({ key: e, newValue: t }) => {
|
|
1587
|
-
|
|
1570
|
+
q(e, String(t));
|
|
1588
1571
|
});
|
|
1589
1572
|
let e = [...N.fieldsToUpdate.map((e) => e.key), ...N.newFields];
|
|
1590
|
-
|
|
1573
|
+
I(new Set(e)), setTimeout(() => I(/* @__PURE__ */ new Set()), 2e3), N.resolve(!0), F({
|
|
1591
1574
|
open: !1,
|
|
1592
1575
|
parsedObject: {},
|
|
1593
1576
|
fieldsToUpdate: [],
|
|
1594
1577
|
newFields: [],
|
|
1595
1578
|
resolve: null
|
|
1596
1579
|
});
|
|
1597
|
-
}, [N,
|
|
1598
|
-
N.resolve && (N.resolve(!1),
|
|
1580
|
+
}, [N, q]), J = (0, Z.useCallback)(() => {
|
|
1581
|
+
N.resolve && (N.resolve(!1), F({
|
|
1599
1582
|
open: !1,
|
|
1600
1583
|
parsedObject: {},
|
|
1601
1584
|
fieldsToUpdate: [],
|
|
1602
1585
|
newFields: [],
|
|
1603
1586
|
resolve: null
|
|
1604
1587
|
}));
|
|
1605
|
-
}, [N]),
|
|
1588
|
+
}, [N]), Y = (0, Z.useMemo)(() => {
|
|
1606
1589
|
if (!c?.inputSchema?.properties) return {};
|
|
1607
1590
|
let e = c.inputSchema || {}, t = {};
|
|
1608
1591
|
for (let n of v) {
|
|
@@ -1617,110 +1600,132 @@ function at({ ref: e, tools: t, callTool: n, readResource: r, serverId: i, isCon
|
|
|
1617
1600
|
g,
|
|
1618
1601
|
v,
|
|
1619
1602
|
b
|
|
1620
|
-
]), { isExecuting:
|
|
1603
|
+
]), { isExecuting: ge, copiedResult: _e, executeTool: X, handleCopyResult: ye, handleDeleteResult: be, handleFullscreen: xe, filteredResults: Ce, cancelExecution: Ee, results: De } = tt({
|
|
1621
1604
|
selectedTool: c,
|
|
1622
|
-
payloadToSend:
|
|
1605
|
+
payloadToSend: Y,
|
|
1623
1606
|
toolArgs: g,
|
|
1624
1607
|
callTool: n,
|
|
1625
|
-
readResource:
|
|
1626
|
-
serverId:
|
|
1627
|
-
}),
|
|
1608
|
+
readResource: i,
|
|
1609
|
+
serverId: a
|
|
1610
|
+
}), Oe = Ce[0]?.timestamp;
|
|
1611
|
+
(0, Z.useEffect)(() => {
|
|
1612
|
+
ne.current = !1, ae.current = !0;
|
|
1613
|
+
let e = requestAnimationFrame(() => {
|
|
1614
|
+
ae.current = !1;
|
|
1615
|
+
});
|
|
1616
|
+
return () => cancelAnimationFrame(e);
|
|
1617
|
+
}, [Oe]);
|
|
1618
|
+
let Ae = (0, Z.useCallback)(() => {
|
|
1619
|
+
ie.current || ae.current || (ne.current = !0);
|
|
1620
|
+
}, []), je = (0, Z.useCallback)((e) => {
|
|
1621
|
+
if (e === null || M || ne.current) return;
|
|
1622
|
+
let t = B.current, n = V.current;
|
|
1623
|
+
if (!t || !n) return;
|
|
1624
|
+
let r = n.offsetHeight;
|
|
1625
|
+
if (r <= 0) return;
|
|
1626
|
+
let i = t.getSize().inPixels, a = e + it, o = r - rt;
|
|
1627
|
+
if (a <= i || o <= i) return;
|
|
1628
|
+
let s = Math.min(a, o);
|
|
1629
|
+
s <= i || (ie.current = !0, t.resize(s), requestAnimationFrame(() => {
|
|
1630
|
+
ie.current = !1;
|
|
1631
|
+
}));
|
|
1632
|
+
}, [M, B]), { isSearchExpanded: Pe, setIsSearchExpanded: Ie, focusedIndex: Re, searchInputRef: ze, isMobile: Be, mobileView: $, setMobileView: Ve, isRefreshing: We, handleSearchBlur: Ke, handleRefresh: qe } = nt({
|
|
1628
1633
|
ref: e,
|
|
1629
1634
|
activeTab: w,
|
|
1630
|
-
filteredTools:
|
|
1635
|
+
filteredTools: K,
|
|
1631
1636
|
savedRequests: E,
|
|
1632
1637
|
searchQuery: S,
|
|
1633
1638
|
setSearchQuery: C,
|
|
1634
1639
|
selectedTool: c,
|
|
1635
|
-
results:
|
|
1636
|
-
isExecuting:
|
|
1637
|
-
handleToolSelect:
|
|
1638
|
-
loadSavedRequest:
|
|
1640
|
+
results: De,
|
|
1641
|
+
isExecuting: ge,
|
|
1642
|
+
handleToolSelect: se,
|
|
1643
|
+
loadSavedRequest: le,
|
|
1639
1644
|
refreshTools: s,
|
|
1640
|
-
selectedToolName:
|
|
1645
|
+
selectedToolName: f,
|
|
1641
1646
|
tools: t,
|
|
1642
|
-
setSelectedToolName:
|
|
1643
|
-
}),
|
|
1647
|
+
setSelectedToolName: m
|
|
1648
|
+
}), at = (0, Z.useCallback)(() => {
|
|
1644
1649
|
c && (j(""), k(!0));
|
|
1645
|
-
}, [c]),
|
|
1650
|
+
}, [c]), ot = (0, Z.useCallback)(() => {
|
|
1646
1651
|
if (!c) return;
|
|
1647
1652
|
let e = {
|
|
1648
1653
|
id: `${Date.now()}-${Math.random()}`,
|
|
1649
1654
|
name: A.trim() || `${c.name} - ${(/* @__PURE__ */ new Date()).toLocaleString()}`,
|
|
1650
1655
|
toolName: c.name,
|
|
1651
|
-
args:
|
|
1656
|
+
args: Y,
|
|
1652
1657
|
savedAt: Date.now(),
|
|
1653
1658
|
serverId: c._serverId,
|
|
1654
1659
|
serverName: c._serverName
|
|
1655
1660
|
};
|
|
1656
|
-
D([...E, e]),
|
|
1661
|
+
D([...E, e]), me(new he({
|
|
1657
1662
|
toolName: c.name,
|
|
1658
|
-
serverId:
|
|
1663
|
+
serverId: a
|
|
1659
1664
|
})).catch(() => {}), k(!1), j("");
|
|
1660
1665
|
}, [
|
|
1661
1666
|
c,
|
|
1662
1667
|
A,
|
|
1663
|
-
|
|
1668
|
+
Y,
|
|
1664
1669
|
E,
|
|
1665
1670
|
D,
|
|
1666
|
-
|
|
1667
|
-
]),
|
|
1668
|
-
D(E.filter((t) => t.id !== e)),
|
|
1671
|
+
a
|
|
1672
|
+
]), st = (0, Z.useCallback)((e) => {
|
|
1673
|
+
D(E.filter((t) => t.id !== e)), u?.id === e && d(null);
|
|
1669
1674
|
}, [
|
|
1670
1675
|
E,
|
|
1671
1676
|
D,
|
|
1672
|
-
|
|
1677
|
+
u
|
|
1673
1678
|
]);
|
|
1674
|
-
return
|
|
1679
|
+
return Be ? /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
1675
1680
|
className: "h-full flex flex-col overflow-hidden relative bg-background",
|
|
1676
1681
|
children: [
|
|
1677
|
-
|
|
1682
|
+
$ !== "list" && /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
1678
1683
|
className: "flex items-center gap-2 p-2 border-b shrink-0 bg-background z-10",
|
|
1679
|
-
children: [/* @__PURE__ */ (0,
|
|
1684
|
+
children: [/* @__PURE__ */ (0, Q.jsx)(p, {
|
|
1680
1685
|
variant: "ghost",
|
|
1681
1686
|
size: "sm",
|
|
1682
1687
|
onClick: () => {
|
|
1683
|
-
|
|
1688
|
+
$ === "response" ? Ve("detail") : (l(null), Ve("list"));
|
|
1684
1689
|
},
|
|
1685
1690
|
className: "p-0 h-8 w-8",
|
|
1686
|
-
children: /* @__PURE__ */ (0,
|
|
1687
|
-
}), /* @__PURE__ */ (0,
|
|
1691
|
+
children: /* @__PURE__ */ (0, Q.jsx)(R, { className: "h-4 w-4" })
|
|
1692
|
+
}), /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
1688
1693
|
className: "flex items-center text-sm font-medium",
|
|
1689
1694
|
children: [
|
|
1690
|
-
/* @__PURE__ */ (0,
|
|
1695
|
+
/* @__PURE__ */ (0, Q.jsx)("button", {
|
|
1691
1696
|
onClick: () => {
|
|
1692
|
-
|
|
1697
|
+
l(null), Ve("list");
|
|
1693
1698
|
},
|
|
1694
1699
|
className: "text-muted-foreground hover:text-foreground hover:underline cursor-pointer",
|
|
1695
1700
|
children: "Tools"
|
|
1696
1701
|
}),
|
|
1697
|
-
|
|
1702
|
+
$ === "detail" && /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
1698
1703
|
className: "mx-2 text-muted-foreground",
|
|
1699
1704
|
children: "/"
|
|
1700
|
-
}), /* @__PURE__ */ (0,
|
|
1705
|
+
}), /* @__PURE__ */ (0, Q.jsx)("button", {
|
|
1701
1706
|
onClick: () => {
|
|
1702
|
-
|
|
1707
|
+
Ve("response");
|
|
1703
1708
|
},
|
|
1704
|
-
className:
|
|
1709
|
+
className: $ === "detail" ? "text-foreground hover:underline" : $ === "response" ? "text-muted-foreground hover:text-foreground hover:underline cursor-pointer" : "text-muted-foreground",
|
|
1705
1710
|
children: "Execute"
|
|
1706
1711
|
})] }),
|
|
1707
|
-
|
|
1712
|
+
$ === "response" && /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
1708
1713
|
className: "mx-2 text-muted-foreground",
|
|
1709
1714
|
children: "/"
|
|
1710
|
-
}), /* @__PURE__ */ (0,
|
|
1715
|
+
}), /* @__PURE__ */ (0, Q.jsx)("span", {
|
|
1711
1716
|
className: "text-foreground",
|
|
1712
1717
|
children: "Response"
|
|
1713
1718
|
})] })
|
|
1714
1719
|
]
|
|
1715
1720
|
})]
|
|
1716
1721
|
}),
|
|
1717
|
-
/* @__PURE__ */ (0,
|
|
1722
|
+
/* @__PURE__ */ (0, Q.jsx)("div", {
|
|
1718
1723
|
className: "flex-1 relative overflow-hidden",
|
|
1719
|
-
children: /* @__PURE__ */ (0,
|
|
1724
|
+
children: /* @__PURE__ */ (0, Q.jsxs)(h, {
|
|
1720
1725
|
initial: !1,
|
|
1721
1726
|
mode: "popLayout",
|
|
1722
1727
|
children: [
|
|
1723
|
-
|
|
1728
|
+
$ === "list" && /* @__PURE__ */ (0, Q.jsx)(r.div, {
|
|
1724
1729
|
initial: { x: "-100%" },
|
|
1725
1730
|
animate: { x: 0 },
|
|
1726
1731
|
exit: { x: "-100%" },
|
|
@@ -1730,41 +1735,41 @@ function at({ ref: e, tools: t, callTool: n, readResource: r, serverId: i, isCon
|
|
|
1730
1735
|
damping: 30
|
|
1731
1736
|
},
|
|
1732
1737
|
className: "absolute inset-0 flex flex-col bg-background z-0",
|
|
1733
|
-
children: /* @__PURE__ */ (0,
|
|
1738
|
+
children: /* @__PURE__ */ (0, Q.jsx)(W, { children: (e) => /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(Se, {
|
|
1734
1739
|
isScrolled: e,
|
|
1735
1740
|
activeTab: w,
|
|
1736
|
-
isSearchExpanded:
|
|
1741
|
+
isSearchExpanded: Pe,
|
|
1737
1742
|
searchQuery: S,
|
|
1738
1743
|
primaryTabName: "tools",
|
|
1739
1744
|
secondaryTabName: "saved",
|
|
1740
1745
|
primaryTabTitle: "Tools",
|
|
1741
1746
|
secondaryTabTitle: "Saved",
|
|
1742
|
-
primaryCount:
|
|
1747
|
+
primaryCount: K.length,
|
|
1743
1748
|
secondaryCount: E.length,
|
|
1744
|
-
primaryIcon:
|
|
1745
|
-
secondaryIcon:
|
|
1749
|
+
primaryIcon: ue,
|
|
1750
|
+
secondaryIcon: P,
|
|
1746
1751
|
searchPlaceholder: "Search tools...",
|
|
1747
|
-
onSearchExpand: () =>
|
|
1752
|
+
onSearchExpand: () => Ie(!0),
|
|
1748
1753
|
onSearchChange: C,
|
|
1749
|
-
onSearchBlur:
|
|
1754
|
+
onSearchBlur: Ke,
|
|
1750
1755
|
onTabSwitch: () => T(w === "tools" ? "saved" : "tools"),
|
|
1751
|
-
searchInputRef:
|
|
1752
|
-
onRefresh: s ?
|
|
1753
|
-
isRefreshing:
|
|
1754
|
-
}), w === "tools" ? /* @__PURE__ */ (0,
|
|
1755
|
-
tools:
|
|
1756
|
+
searchInputRef: ze,
|
|
1757
|
+
onRefresh: s ? qe : void 0,
|
|
1758
|
+
isRefreshing: We
|
|
1759
|
+
}), w === "tools" ? /* @__PURE__ */ (0, Q.jsx)(Ue, {
|
|
1760
|
+
tools: K,
|
|
1756
1761
|
selectedTool: c,
|
|
1757
|
-
onToolSelect:
|
|
1758
|
-
focusedIndex:
|
|
1759
|
-
}) : /* @__PURE__ */ (0,
|
|
1762
|
+
onToolSelect: se,
|
|
1763
|
+
focusedIndex: Re
|
|
1764
|
+
}) : /* @__PURE__ */ (0, Q.jsx)(we, {
|
|
1760
1765
|
savedRequests: E,
|
|
1761
|
-
selectedRequest:
|
|
1762
|
-
onLoadRequest:
|
|
1763
|
-
onDeleteRequest:
|
|
1764
|
-
focusedIndex:
|
|
1766
|
+
selectedRequest: u,
|
|
1767
|
+
onLoadRequest: le,
|
|
1768
|
+
onDeleteRequest: st,
|
|
1769
|
+
focusedIndex: Re
|
|
1765
1770
|
})] }) })
|
|
1766
1771
|
}, "list"),
|
|
1767
|
-
|
|
1772
|
+
$ === "detail" && /* @__PURE__ */ (0, Q.jsx)(r.div, {
|
|
1768
1773
|
initial: { x: "100%" },
|
|
1769
1774
|
animate: { x: 0 },
|
|
1770
1775
|
exit: { x: "-100%" },
|
|
@@ -1774,23 +1779,23 @@ function at({ ref: e, tools: t, callTool: n, readResource: r, serverId: i, isCon
|
|
|
1774
1779
|
damping: 30
|
|
1775
1780
|
},
|
|
1776
1781
|
className: "absolute inset-0 bg-background z-10",
|
|
1777
|
-
children: /* @__PURE__ */ (0,
|
|
1782
|
+
children: /* @__PURE__ */ (0, Q.jsx)(Le, {
|
|
1778
1783
|
selectedTool: c,
|
|
1779
1784
|
toolArgs: g,
|
|
1780
|
-
payloadToSend:
|
|
1781
|
-
isExecuting:
|
|
1782
|
-
isConnected:
|
|
1783
|
-
onArgChange:
|
|
1784
|
-
onExecute:
|
|
1785
|
-
onSave:
|
|
1786
|
-
onBulkPaste:
|
|
1787
|
-
autoFilledFields:
|
|
1785
|
+
payloadToSend: Y,
|
|
1786
|
+
isExecuting: ge,
|
|
1787
|
+
isConnected: o,
|
|
1788
|
+
onArgChange: q,
|
|
1789
|
+
onExecute: X,
|
|
1790
|
+
onSave: at,
|
|
1791
|
+
onBulkPaste: fe,
|
|
1792
|
+
autoFilledFields: te,
|
|
1788
1793
|
setFields: v,
|
|
1789
1794
|
sendEmptyFields: b,
|
|
1790
|
-
onToggleEmpty:
|
|
1795
|
+
onToggleEmpty: de
|
|
1791
1796
|
})
|
|
1792
1797
|
}, "detail"),
|
|
1793
|
-
|
|
1798
|
+
$ === "response" && /* @__PURE__ */ (0, Q.jsx)(r.div, {
|
|
1794
1799
|
initial: { x: "100%" },
|
|
1795
1800
|
animate: { x: 0 },
|
|
1796
1801
|
exit: { x: "100%" },
|
|
@@ -1800,228 +1805,235 @@ function at({ ref: e, tools: t, callTool: n, readResource: r, serverId: i, isCon
|
|
|
1800
1805
|
damping: 30
|
|
1801
1806
|
},
|
|
1802
1807
|
className: "absolute inset-0 bg-background z-20",
|
|
1803
|
-
children: /* @__PURE__ */ (0,
|
|
1804
|
-
results:
|
|
1805
|
-
copiedResult:
|
|
1806
|
-
serverId:
|
|
1807
|
-
readResource:
|
|
1808
|
-
onCopy:
|
|
1809
|
-
onDelete:
|
|
1810
|
-
onFullscreen:
|
|
1811
|
-
onRerunTool:
|
|
1808
|
+
children: /* @__PURE__ */ (0, Q.jsx)(He, {
|
|
1809
|
+
results: Ce,
|
|
1810
|
+
copiedResult: _e,
|
|
1811
|
+
serverId: a,
|
|
1812
|
+
readResource: i,
|
|
1813
|
+
onCopy: ye,
|
|
1814
|
+
onDelete: be,
|
|
1815
|
+
onFullscreen: xe,
|
|
1816
|
+
onRerunTool: X
|
|
1812
1817
|
})
|
|
1813
1818
|
}, "response")
|
|
1814
1819
|
]
|
|
1815
1820
|
})
|
|
1816
1821
|
}),
|
|
1817
|
-
/* @__PURE__ */ (0,
|
|
1822
|
+
/* @__PURE__ */ (0, Q.jsx)(Te, {
|
|
1818
1823
|
isOpen: O,
|
|
1819
1824
|
requestName: A,
|
|
1820
1825
|
defaultPlaceholder: `${c?.name} - ${(/* @__PURE__ */ new Date()).toLocaleString()}`,
|
|
1821
1826
|
onRequestNameChange: j,
|
|
1822
|
-
onSave:
|
|
1827
|
+
onSave: ot,
|
|
1823
1828
|
onCancel: () => k(!1)
|
|
1824
1829
|
}),
|
|
1825
|
-
/* @__PURE__ */ (0,
|
|
1830
|
+
/* @__PURE__ */ (0, Q.jsx)(Ge, {
|
|
1826
1831
|
open: N.open,
|
|
1827
1832
|
onOpenChange: (e) => {
|
|
1828
|
-
e ||
|
|
1833
|
+
e || J();
|
|
1829
1834
|
},
|
|
1830
|
-
children: /* @__PURE__ */ (0,
|
|
1835
|
+
children: /* @__PURE__ */ (0, Q.jsxs)(Je, { children: [/* @__PURE__ */ (0, Q.jsxs)(Ye, { children: [/* @__PURE__ */ (0, Q.jsx)(Ze, { children: "Auto-fill fields from pasted object?" }), /* @__PURE__ */ (0, Q.jsxs)(Qe, { children: [N.fieldsToUpdate.length > 0 && /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
1831
1836
|
className: "mb-3",
|
|
1832
|
-
children: [/* @__PURE__ */ (0,
|
|
1837
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("p", {
|
|
1833
1838
|
className: "font-medium mb-2",
|
|
1834
1839
|
children: "The following fields will be updated:"
|
|
1835
|
-
}), /* @__PURE__ */ (0,
|
|
1840
|
+
}), /* @__PURE__ */ (0, Q.jsx)("ul", {
|
|
1836
1841
|
className: "text-sm space-y-1 max-h-[200px] overflow-y-auto",
|
|
1837
|
-
children: N.fieldsToUpdate.map(({ key: e, oldValue: t, newValue: n }) => /* @__PURE__ */ (0,
|
|
1842
|
+
children: N.fieldsToUpdate.map(({ key: e, oldValue: t, newValue: n }) => /* @__PURE__ */ (0, Q.jsxs)("li", {
|
|
1838
1843
|
className: "font-mono",
|
|
1839
1844
|
children: [
|
|
1840
|
-
/* @__PURE__ */ (0,
|
|
1845
|
+
/* @__PURE__ */ (0, Q.jsxs)("span", {
|
|
1841
1846
|
className: "font-semibold",
|
|
1842
1847
|
children: [e, ":"]
|
|
1843
1848
|
}),
|
|
1844
1849
|
" ",
|
|
1845
|
-
/* @__PURE__ */ (0,
|
|
1850
|
+
/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
1846
1851
|
className: "text-red-600 dark:text-red-400 line-through",
|
|
1847
1852
|
children: typeof t == "object" ? JSON.stringify(t).substring(0, 30) + "..." : String(t).substring(0, 30)
|
|
1848
1853
|
}),
|
|
1849
1854
|
" ",
|
|
1850
1855
|
"→",
|
|
1851
1856
|
" ",
|
|
1852
|
-
/* @__PURE__ */ (0,
|
|
1857
|
+
/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
1853
1858
|
className: "text-green-600 dark:text-green-400",
|
|
1854
1859
|
children: typeof n == "string" && n.length > 30 ? n.substring(0, 30) + "..." : String(n).substring(0, 30)
|
|
1855
1860
|
})
|
|
1856
1861
|
]
|
|
1857
1862
|
}, e))
|
|
1858
1863
|
})]
|
|
1859
|
-
}), N.newFields.length > 0 && /* @__PURE__ */ (0,
|
|
1864
|
+
}), N.newFields.length > 0 && /* @__PURE__ */ (0, Q.jsxs)("div", { children: [/* @__PURE__ */ (0, Q.jsx)("p", {
|
|
1860
1865
|
className: "font-medium mb-1",
|
|
1861
1866
|
children: "New fields to be filled:"
|
|
1862
|
-
}), /* @__PURE__ */ (0,
|
|
1867
|
+
}), /* @__PURE__ */ (0, Q.jsx)("p", {
|
|
1863
1868
|
className: "text-sm font-mono",
|
|
1864
1869
|
children: N.newFields.join(", ")
|
|
1865
|
-
})] })] })] }), /* @__PURE__ */ (0,
|
|
1866
|
-
onClick:
|
|
1870
|
+
})] })] })] }), /* @__PURE__ */ (0, Q.jsxs)(Xe, { children: [/* @__PURE__ */ (0, Q.jsx)(et, {
|
|
1871
|
+
onClick: J,
|
|
1867
1872
|
children: "Cancel"
|
|
1868
|
-
}), /* @__PURE__ */ (0,
|
|
1869
|
-
onClick:
|
|
1873
|
+
}), /* @__PURE__ */ (0, Q.jsx)($e, {
|
|
1874
|
+
onClick: pe,
|
|
1870
1875
|
children: "Auto-fill"
|
|
1871
1876
|
})] })] })
|
|
1872
1877
|
})
|
|
1873
1878
|
]
|
|
1874
|
-
}) : /* @__PURE__ */ (0,
|
|
1879
|
+
}) : /* @__PURE__ */ (0, Q.jsxs)(G, {
|
|
1875
1880
|
orientation: "horizontal",
|
|
1876
1881
|
className: "h-full",
|
|
1877
1882
|
children: [
|
|
1878
|
-
/* @__PURE__ */ (0,
|
|
1883
|
+
/* @__PURE__ */ (0, Q.jsx)(H, {
|
|
1879
1884
|
id: "left-panel",
|
|
1880
1885
|
defaultSize: "33%",
|
|
1881
1886
|
minSize: 250,
|
|
1882
1887
|
collapsedSize: 0,
|
|
1883
1888
|
collapsible: !0,
|
|
1884
1889
|
className: "flex flex-col h-full relative",
|
|
1885
|
-
panelRef:
|
|
1886
|
-
children: /* @__PURE__ */ (0,
|
|
1887
|
-
className: "flex h-full flex-col overflow-hidden
|
|
1888
|
-
children: /* @__PURE__ */ (0,
|
|
1890
|
+
panelRef: L,
|
|
1891
|
+
children: /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
1892
|
+
className: "flex h-full flex-col overflow-hidden",
|
|
1893
|
+
children: /* @__PURE__ */ (0, Q.jsx)(W, { children: (e) => /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(Se, {
|
|
1889
1894
|
isScrolled: e,
|
|
1890
1895
|
activeTab: w,
|
|
1891
|
-
isSearchExpanded:
|
|
1896
|
+
isSearchExpanded: Pe,
|
|
1892
1897
|
searchQuery: S,
|
|
1893
1898
|
primaryTabName: "tools",
|
|
1894
1899
|
secondaryTabName: "saved",
|
|
1895
1900
|
primaryTabTitle: "Tools",
|
|
1896
1901
|
secondaryTabTitle: "Saved",
|
|
1897
|
-
primaryCount:
|
|
1902
|
+
primaryCount: K.length,
|
|
1898
1903
|
secondaryCount: E.length,
|
|
1899
|
-
primaryIcon:
|
|
1900
|
-
secondaryIcon:
|
|
1904
|
+
primaryIcon: ue,
|
|
1905
|
+
secondaryIcon: P,
|
|
1901
1906
|
searchPlaceholder: "Search tools...",
|
|
1902
|
-
onSearchExpand: () =>
|
|
1907
|
+
onSearchExpand: () => Ie(!0),
|
|
1903
1908
|
onSearchChange: C,
|
|
1904
|
-
onSearchBlur:
|
|
1909
|
+
onSearchBlur: Ke,
|
|
1905
1910
|
onTabSwitch: () => T(w === "tools" ? "saved" : "tools"),
|
|
1906
|
-
searchInputRef:
|
|
1907
|
-
onRefresh: s ?
|
|
1908
|
-
isRefreshing:
|
|
1909
|
-
}), w === "tools" ? /* @__PURE__ */ (0,
|
|
1910
|
-
tools:
|
|
1911
|
+
searchInputRef: ze,
|
|
1912
|
+
onRefresh: s ? qe : void 0,
|
|
1913
|
+
isRefreshing: We
|
|
1914
|
+
}), w === "tools" ? /* @__PURE__ */ (0, Q.jsx)(Ue, {
|
|
1915
|
+
tools: K,
|
|
1911
1916
|
selectedTool: c,
|
|
1912
|
-
onToolSelect:
|
|
1913
|
-
focusedIndex:
|
|
1914
|
-
}) : /* @__PURE__ */ (0,
|
|
1917
|
+
onToolSelect: se,
|
|
1918
|
+
focusedIndex: Re
|
|
1919
|
+
}) : /* @__PURE__ */ (0, Q.jsx)(we, {
|
|
1915
1920
|
savedRequests: E,
|
|
1916
|
-
selectedRequest:
|
|
1917
|
-
onLoadRequest:
|
|
1918
|
-
onDeleteRequest:
|
|
1919
|
-
focusedIndex:
|
|
1921
|
+
selectedRequest: u,
|
|
1922
|
+
onLoadRequest: le,
|
|
1923
|
+
onDeleteRequest: st,
|
|
1924
|
+
focusedIndex: Re
|
|
1920
1925
|
})] }) })
|
|
1921
1926
|
})
|
|
1922
1927
|
}),
|
|
1923
|
-
/* @__PURE__ */ (0,
|
|
1924
|
-
/* @__PURE__ */ (0,
|
|
1928
|
+
/* @__PURE__ */ (0, Q.jsx)(U, { withHandle: !0 }),
|
|
1929
|
+
/* @__PURE__ */ (0, Q.jsx)(H, {
|
|
1925
1930
|
defaultSize: "67%",
|
|
1926
|
-
children: /* @__PURE__ */ (0,
|
|
1931
|
+
children: /* @__PURE__ */ (0, Q.jsxs)(G, {
|
|
1927
1932
|
orientation: "vertical",
|
|
1933
|
+
elementRef: V,
|
|
1934
|
+
onLayoutChanged: Ae,
|
|
1928
1935
|
children: [
|
|
1929
|
-
/* @__PURE__ */ (0,
|
|
1936
|
+
/* @__PURE__ */ (0, Q.jsx)(H, {
|
|
1937
|
+
id: "tool-params",
|
|
1930
1938
|
defaultSize: "40%",
|
|
1939
|
+
minSize: `${rt}px`,
|
|
1931
1940
|
collapsible: !0,
|
|
1932
1941
|
panelRef: z,
|
|
1933
|
-
children: /* @__PURE__ */ (0,
|
|
1942
|
+
children: /* @__PURE__ */ (0, Q.jsx)(Le, {
|
|
1934
1943
|
selectedTool: c,
|
|
1935
1944
|
toolArgs: g,
|
|
1936
|
-
payloadToSend:
|
|
1937
|
-
isExecuting:
|
|
1938
|
-
isConnected:
|
|
1939
|
-
onArgChange:
|
|
1940
|
-
onExecute:
|
|
1941
|
-
onSave:
|
|
1942
|
-
onCancel:
|
|
1943
|
-
onBulkPaste:
|
|
1944
|
-
autoFilledFields:
|
|
1945
|
+
payloadToSend: Y,
|
|
1946
|
+
isExecuting: ge,
|
|
1947
|
+
isConnected: o,
|
|
1948
|
+
onArgChange: q,
|
|
1949
|
+
onExecute: X,
|
|
1950
|
+
onSave: at,
|
|
1951
|
+
onCancel: Ee,
|
|
1952
|
+
onBulkPaste: fe,
|
|
1953
|
+
autoFilledFields: te,
|
|
1945
1954
|
setFields: v,
|
|
1946
1955
|
sendEmptyFields: b,
|
|
1947
|
-
onToggleEmpty:
|
|
1956
|
+
onToggleEmpty: de
|
|
1948
1957
|
})
|
|
1949
1958
|
}),
|
|
1950
|
-
/* @__PURE__ */ (0,
|
|
1951
|
-
/* @__PURE__ */ (0,
|
|
1959
|
+
/* @__PURE__ */ (0, Q.jsx)(U, { withHandle: !0 }),
|
|
1960
|
+
/* @__PURE__ */ (0, Q.jsx)(H, {
|
|
1961
|
+
id: "tool-result",
|
|
1952
1962
|
defaultSize: "60%",
|
|
1953
|
-
|
|
1963
|
+
panelRef: B,
|
|
1964
|
+
children: /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
1954
1965
|
className: "flex flex-col h-full",
|
|
1955
|
-
children: /* @__PURE__ */ (0,
|
|
1956
|
-
results:
|
|
1957
|
-
copiedResult:
|
|
1958
|
-
serverId:
|
|
1959
|
-
readResource:
|
|
1960
|
-
onCopy:
|
|
1961
|
-
onDelete:
|
|
1962
|
-
onFullscreen:
|
|
1963
|
-
onMaximize:
|
|
1966
|
+
children: /* @__PURE__ */ (0, Q.jsx)(He, {
|
|
1967
|
+
results: Ce,
|
|
1968
|
+
copiedResult: _e,
|
|
1969
|
+
serverId: a,
|
|
1970
|
+
readResource: i,
|
|
1971
|
+
onCopy: ye,
|
|
1972
|
+
onDelete: be,
|
|
1973
|
+
onFullscreen: xe,
|
|
1974
|
+
onMaximize: oe,
|
|
1964
1975
|
isMaximized: M,
|
|
1965
|
-
onRerunTool:
|
|
1976
|
+
onRerunTool: X,
|
|
1977
|
+
onWidgetHeightChange: je
|
|
1966
1978
|
})
|
|
1967
1979
|
})
|
|
1968
1980
|
})
|
|
1969
1981
|
]
|
|
1970
1982
|
})
|
|
1971
1983
|
}),
|
|
1972
|
-
/* @__PURE__ */ (0,
|
|
1984
|
+
/* @__PURE__ */ (0, Q.jsx)(Te, {
|
|
1973
1985
|
isOpen: O,
|
|
1974
1986
|
requestName: A,
|
|
1975
1987
|
defaultPlaceholder: `${c?.name} - ${(/* @__PURE__ */ new Date()).toLocaleString()}`,
|
|
1976
1988
|
onRequestNameChange: j,
|
|
1977
|
-
onSave:
|
|
1989
|
+
onSave: ot,
|
|
1978
1990
|
onCancel: () => k(!1)
|
|
1979
1991
|
}),
|
|
1980
|
-
/* @__PURE__ */ (0,
|
|
1992
|
+
/* @__PURE__ */ (0, Q.jsx)(Ge, {
|
|
1981
1993
|
open: N.open,
|
|
1982
1994
|
onOpenChange: (e) => {
|
|
1983
|
-
e ||
|
|
1995
|
+
e || J();
|
|
1984
1996
|
},
|
|
1985
|
-
children: /* @__PURE__ */ (0,
|
|
1997
|
+
children: /* @__PURE__ */ (0, Q.jsxs)(Je, { children: [/* @__PURE__ */ (0, Q.jsxs)(Ye, { children: [/* @__PURE__ */ (0, Q.jsx)(Ze, { children: "Auto-fill fields from pasted object?" }), /* @__PURE__ */ (0, Q.jsxs)(Qe, { children: [N.fieldsToUpdate.length > 0 && /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
1986
1998
|
className: "mb-3",
|
|
1987
|
-
children: [/* @__PURE__ */ (0,
|
|
1999
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("p", {
|
|
1988
2000
|
className: "font-medium mb-2",
|
|
1989
2001
|
children: "The following fields will be updated:"
|
|
1990
|
-
}), /* @__PURE__ */ (0,
|
|
2002
|
+
}), /* @__PURE__ */ (0, Q.jsx)("ul", {
|
|
1991
2003
|
className: "text-sm space-y-1 max-h-[200px] overflow-y-auto",
|
|
1992
|
-
children: N.fieldsToUpdate.map(({ key: e, oldValue: t, newValue: n }) => /* @__PURE__ */ (0,
|
|
2004
|
+
children: N.fieldsToUpdate.map(({ key: e, oldValue: t, newValue: n }) => /* @__PURE__ */ (0, Q.jsxs)("li", {
|
|
1993
2005
|
className: "font-mono",
|
|
1994
2006
|
children: [
|
|
1995
|
-
/* @__PURE__ */ (0,
|
|
2007
|
+
/* @__PURE__ */ (0, Q.jsxs)("span", {
|
|
1996
2008
|
className: "font-semibold",
|
|
1997
2009
|
children: [e, ":"]
|
|
1998
2010
|
}),
|
|
1999
2011
|
" ",
|
|
2000
|
-
/* @__PURE__ */ (0,
|
|
2012
|
+
/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
2001
2013
|
className: "text-red-600 dark:text-red-400 line-through",
|
|
2002
2014
|
children: typeof t == "object" ? JSON.stringify(t).substring(0, 30) + "..." : String(t).substring(0, 30)
|
|
2003
2015
|
}),
|
|
2004
2016
|
" ",
|
|
2005
2017
|
"→",
|
|
2006
2018
|
" ",
|
|
2007
|
-
/* @__PURE__ */ (0,
|
|
2019
|
+
/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
2008
2020
|
className: "text-green-600 dark:text-green-400",
|
|
2009
2021
|
children: typeof n == "string" && n.length > 30 ? n.substring(0, 30) + "..." : String(n).substring(0, 30)
|
|
2010
2022
|
})
|
|
2011
2023
|
]
|
|
2012
2024
|
}, e))
|
|
2013
2025
|
})]
|
|
2014
|
-
}), N.newFields.length > 0 && /* @__PURE__ */ (0,
|
|
2026
|
+
}), N.newFields.length > 0 && /* @__PURE__ */ (0, Q.jsxs)("div", { children: [/* @__PURE__ */ (0, Q.jsx)("p", {
|
|
2015
2027
|
className: "font-medium mb-1",
|
|
2016
2028
|
children: "New fields to be filled:"
|
|
2017
|
-
}), /* @__PURE__ */ (0,
|
|
2029
|
+
}), /* @__PURE__ */ (0, Q.jsx)("p", {
|
|
2018
2030
|
className: "text-sm font-mono",
|
|
2019
2031
|
children: N.newFields.join(", ")
|
|
2020
|
-
})] })] })] }), /* @__PURE__ */ (0,
|
|
2021
|
-
onClick:
|
|
2032
|
+
})] })] })] }), /* @__PURE__ */ (0, Q.jsxs)(Xe, { children: [/* @__PURE__ */ (0, Q.jsx)(et, {
|
|
2033
|
+
onClick: J,
|
|
2022
2034
|
children: "Cancel"
|
|
2023
|
-
}), /* @__PURE__ */ (0,
|
|
2024
|
-
onClick:
|
|
2035
|
+
}), /* @__PURE__ */ (0, Q.jsx)($e, {
|
|
2036
|
+
onClick: pe,
|
|
2025
2037
|
children: "Auto-fill"
|
|
2026
2038
|
})] })] })
|
|
2027
2039
|
})
|