@mcp-use/inspector 20.0.0-beta.1 → 20.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -18
- package/dist/cdn/{AnimatePresence-B4HhIdgq.js → AnimatePresence-D1bZ5_-l.js} +80 -79
- package/dist/cdn/ChatTab-DRn-AnBV.js +6811 -0
- package/dist/cdn/{CheckboxIndicator-BF2cKfbA.js → CheckboxIndicator-BjF73mGX.js} +74 -73
- package/dist/cdn/ConnectionSettingsForm-CsG61Iyd.js +929 -0
- package/dist/cdn/ConnectionSettingsTab-CTJJK4hj.js +151 -0
- package/dist/cdn/{ElicitationTab-upPXq2q7.js → ElicitationTab-PEmEDvC5.js} +48 -47
- package/dist/cdn/{FormContext-Cl51-7O7.js → FormContext-NtUiZclE.js} +26 -26
- package/dist/cdn/{InspectorContext-DzXtgyTx.js → InspectorContext-BBKCdfmK.js} +2 -22
- package/dist/cdn/{JSONDisplay-D3RcyO9z.js → JSONDisplay-BJqMz7Ny.js} +23 -23
- package/dist/cdn/{ListTabHeader-8lULn-90.js → ListTabHeader-DzmTtN1e.js} +21 -20
- package/dist/cdn/{WidgetWrapper-D29YDxIu.js → MCPAppsDebugControls-C5-knSKL.js} +583 -620
- package/dist/cdn/{ManufactOAuthCallback-DEM8mhWD.js → ManufactOAuthCallback-ChbbjFIT.js} +3 -3
- package/dist/cdn/MarkdownRenderer-uUvyteZT.js +3610 -0
- package/dist/cdn/McpAppsViewPanel-Bj-1E9_v.js +56 -0
- package/dist/cdn/{NotificationsTab-CWopTIzT.js → NotificationsTab-B7uebqMV.js} +13 -13
- package/dist/cdn/{OAuthCallback-k3oeLtIC.js → OAuthCallback-Hdtybeu0.js} +3 -3
- package/dist/cdn/PromptsTab-b4UpzPPY.js +902 -0
- package/dist/cdn/{ResourcesTab-KfamsM6-.js → ResourcesTab-BCA0_b8c.js} +106 -124
- package/dist/cdn/{SamplingTab-vcufuK24.js → SamplingTab-CuPYqFyA.js} +43 -42
- package/dist/cdn/{ServerMetadataTab-DS0eiyyD.js → ServerMetadataTab-BM3VhSLf.js} +14 -14
- package/dist/cdn/{StatusIcon-BGXOEU2u.js → StatusIcon-Q3n3YRtE.js} +8 -9
- package/dist/cdn/{ToolsTab-DRjcZnpu.js → ToolsTab-4lvUZRQq.js} +671 -693
- package/dist/cdn/{ViewPreview-B_onhcUB.js → ViewPreview-BGClMNvo.js} +5 -4
- 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-DqjqAq0o.js → card-BA-DQk-G.js} +2 -2
- package/dist/cdn/{checkbox-B4oUG6Rr.js → checkbox-kwVa4gRX.js} +4 -4
- 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-Dnl-pZsY.js → dialog-CJGnC5Ag.js} +165 -165
- package/dist/cdn/{dist-DjXr_YO3.js → dist-CTJnCYmk.js} +1 -1
- package/dist/cdn/{dist-mRDqCgKU.js → dist-dw0FdK5Y.js} +116 -114
- 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-CVUwR-Bu.js → index-browser-B1xWyLr0.js} +113 -201
- package/dist/cdn/{info-CNiOwqkf.js → info-BMkB68mB.js} +1 -1
- package/dist/cdn/{input-BLxOA7V-.js → input-BCpgLXU1.js} +3039 -3600
- package/dist/cdn/inspector.css +1 -1
- package/dist/cdn/inspector.js +7797 -7857
- package/dist/cdn/{label-CBvG613A.js → label-A0UGV8FE.js} +8 -8
- package/dist/cdn/{loader-circle-BLy9A_pp.js → loader-circle-BKRHJEB7.js} +1 -1
- package/dist/cdn/{manufact-auth-0TVxpeTA.js → manufact-auth-BQMHhbLV.js} +142 -106
- 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-BcNNsTjS.js → not-found-BajFyZpp.js} +4 -6
- package/dist/cdn/{play-vuZ5PLnI.js → play-B1leulYf.js} +1 -1
- package/dist/cdn/providerMeta-CjGU4rID.js +436 -0
- package/dist/cdn/{react-BxO-uEDZ.js → react-BoOQpLwo.js} +838 -849
- 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-BZ_IoKxg.js → select-CCFHjOGk.js} +843 -842
- package/dist/cdn/{servers-Dm72iTpY.js → servers-Dd0Vcp81.js} +5 -1
- package/dist/cdn/{shared-uMiV6Fx1.js → shared-CJVHJhag.js} +35 -35
- package/dist/cdn/sheet-oyq1mIyg.js +2078 -0
- package/dist/cdn/{sparkles-BntO2rDR.js → sparkles-CxeZpVtX.js} +1 -1
- package/dist/cdn/{spinner-CWcJhIY_.js → spinner-Be1GlSGX.js} +3 -3
- package/dist/cdn/{square-check-big-BvwQ17Bl.js → square-check-big-C_4wbfwF.js} +1 -1
- package/dist/cdn/{switch-DtQOLb9R.js → switch-DHXEA_N5.js} +211 -210
- package/dist/cdn/{tabs-subtle-C5cy35sY.js → tabs-subtle-Dubd6Kj8.js} +259 -258
- package/dist/cdn/{telemetry-Ct6pVkM1.js → telemetry-C7bt_ifQ.js} +38 -70
- package/dist/cdn/{textarea-Bj-CT7hC.js → textarea-CwmI8_uI.js} +2 -2
- package/dist/cdn/{trash-2-RwpJY5SL.js → trash-2-BhumJAFE.js} +1 -1
- package/dist/cdn/{useAriaLabelledBy-Bm9qHGK6.js → useAriaLabelledBy-Cra6w3YY.js} +2 -1
- package/dist/cdn/{useCompositeItem-CNJ6MXdi.js → useCompositeItem-Dhnm-7el.js} +3 -3
- package/dist/cdn/{useConfig-CwxZ6Quj.js → useConfig-DiOY6evp.js} +73 -46
- package/dist/cdn/{useSavedRequests-Ci2I919u.js → useSavedRequests-mSIsDd4c.js} +1 -1
- package/dist/cdn/{useViewHostProps-Dr6W2ooF.js → useViewHostProps-D1emxC9m.js} +124 -108
- 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 +87 -14
- package/dist/client/auth/manufact-auth.d.ts +3 -1
- package/dist/client/auth/manufact-auth.d.ts.map +1 -1
- package/dist/client/components/ChatTab.d.ts +1 -8
- package/dist/client/components/ChatTab.d.ts.map +1 -1
- package/dist/client/components/MCPAppsDebugControls.d.ts.map +1 -1
- package/dist/client/components/ResourcesTab.d.ts.map +1 -1
- package/dist/client/components/ToolsTab.d.ts.map +1 -1
- package/dist/client/components/chat/ChatHeader.d.ts +7 -2
- package/dist/client/components/chat/ChatHeader.d.ts.map +1 -1
- package/dist/client/components/chat/ChatLandingForm.d.ts +4 -2
- package/dist/client/components/chat/ChatLandingForm.d.ts.map +1 -1
- package/dist/client/components/chat/ChatManagedNotice.d.ts +10 -0
- package/dist/client/components/chat/ChatManagedNotice.d.ts.map +1 -0
- package/dist/client/components/chat/ChatScrollTopFade.d.ts +7 -0
- package/dist/client/components/chat/ChatScrollTopFade.d.ts.map +1 -0
- package/dist/client/components/chat/ConfigurationDialog.d.ts +11 -9
- package/dist/client/components/chat/ConfigurationDialog.d.ts.map +1 -1
- package/dist/client/components/chat/ConfigureEmptyState.d.ts +1 -6
- package/dist/client/components/chat/ConfigureEmptyState.d.ts.map +1 -1
- package/dist/client/components/chat/MessageList.d.ts +1 -0
- package/dist/client/components/chat/MessageList.d.ts.map +1 -1
- package/dist/client/components/chat/StreamingAssistantContent.d.ts.map +1 -1
- package/dist/client/components/chat/ToolResultRenderer.d.ts.map +1 -1
- package/dist/client/components/chat/chatModeStorage.d.ts +11 -0
- package/dist/client/components/chat/chatModeStorage.d.ts.map +1 -0
- package/dist/client/components/chat/managedChatNotice.d.ts +16 -0
- package/dist/client/components/chat/managedChatNotice.d.ts.map +1 -0
- package/dist/client/components/chat/partialToolArgs.d.ts +10 -0
- package/dist/client/components/chat/partialToolArgs.d.ts.map +1 -0
- package/dist/client/components/chat/providerMeta.d.ts +11 -0
- package/dist/client/components/chat/providerMeta.d.ts.map +1 -1
- package/dist/client/components/chat/types.d.ts +1 -0
- package/dist/client/components/chat/types.d.ts.map +1 -1
- package/dist/client/components/chat/useChatMessages.d.ts +7 -5
- package/dist/client/components/chat/useChatMessages.d.ts.map +1 -1
- package/dist/client/components/chat/useChatMessagesClientSide.d.ts +4 -6
- package/dist/client/components/chat/useChatMessagesClientSide.d.ts.map +1 -1
- package/dist/client/components/chat/useChatScrollToBottom.d.ts +1 -0
- package/dist/client/components/chat/useChatScrollToBottom.d.ts.map +1 -1
- package/dist/client/components/chat/useConfig.d.ts +1 -1
- package/dist/client/components/chat/useConfig.d.ts.map +1 -1
- package/dist/client/components/chat/useHostedChatMode.d.ts +1 -1
- package/dist/client/components/chat/useHostedChatMode.d.ts.map +1 -1
- package/dist/client/components/mcp-apps/McpAppsViewPanel.d.ts +29 -0
- package/dist/client/components/mcp-apps/McpAppsViewPanel.d.ts.map +1 -0
- package/dist/client/components/shared/MarkdownRenderer.d.ts +2 -1
- package/dist/client/components/shared/MarkdownRenderer.d.ts.map +1 -1
- package/dist/client/components/tools/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 +13 -0
- package/dist/client/components/ui/MeshGradientCanvas.d.ts.map +1 -0
- package/dist/client/components/ui/chat-message.d.ts +1 -1
- package/dist/client/components/ui/chat-message.d.ts.map +1 -1
- package/dist/client/components/ui/file-thumbnail.d.ts.map +1 -1
- package/dist/client/components/ui/mesh-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 +3 -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/InspectorContext.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 +4202 -3491
- package/dist/client/telemetry/init.d.ts.map +1 -1
- package/dist/client/telemetry/utils.d.ts.map +1 -1
- package/dist/client/utils/servers.d.ts +5 -0
- package/dist/client/utils/servers.d.ts.map +1 -1
- package/dist/server/asset-urls.d.ts +4 -0
- package/dist/server/asset-urls.d.ts.map +1 -1
- package/dist/server/asset-urls.js +7 -3
- package/dist/server/cdn-shell.d.ts.map +1 -1
- package/dist/server/cdn-shell.js +3 -3
- package/dist/server/{chunk-IXYK6ZOY.js → chunk-5XMQ5UJR.js} +2 -2
- package/dist/server/{chunk-KBVKS4J5.js → chunk-H6ZCIKBS.js} +10 -0
- package/dist/server/{chunk-VDUV6LR6.js → chunk-KTPQKADO.js} +75 -5
- package/dist/server/{chunk-Y2GBQOQW.js → chunk-LMLZJR2K.js} +2 -9
- package/dist/server/{chunk-K2V2SDQD.js → chunk-OWR2BIBW.js} +1 -1
- package/dist/server/{chunk-5B3SXGZP.js → chunk-UJLXHNQP.js} +1 -1
- package/dist/server/{chunk-6XWDZEFF.js → chunk-XCNS5CIW.js} +8 -3
- package/dist/server/cli.js +5 -5
- package/dist/server/create-dev-api-app.js +3 -3
- package/dist/server/dev-callback-redirect.d.ts +3 -0
- package/dist/server/dev-callback-redirect.d.ts.map +1 -0
- package/dist/server/dev-callback-redirect.js +18 -0
- package/dist/server/index.js +6 -6
- package/dist/server/middleware.js +6 -6
- package/dist/server/proxy/index.js +1 -1
- package/dist/server/proxy/mcp-proxy.d.ts +2 -0
- package/dist/server/proxy/mcp-proxy.d.ts.map +1 -1
- package/dist/server/proxy/mcp-proxy.js +3 -1
- package/dist/server/proxy-routes.js +2 -2
- package/dist/server/server.js +3 -3
- package/dist/server/version.js +1 -1
- package/dist/server/vite-dev-api-plugin.js +3 -3
- package/dist/web/assets/AnimatePresence-FfDQQNFJ.js +9 -0
- package/dist/web/assets/ChatTab-x6dg7xyx.js +18 -0
- package/dist/web/assets/ConnectionSettingsTab-DUwCNYXJ.js +1 -0
- package/dist/web/assets/ElicitationTab-Dk04sjRw.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-Kh10bYHm.js +34 -0
- package/dist/web/assets/{ManufactOAuthCallback-DCLbW-mz.js → ManufactOAuthCallback-Bq00h5wq.js} +1 -1
- package/dist/web/assets/MarkdownRenderer--ZbJc80m.js +47 -0
- package/dist/web/assets/McpAppsViewPanel-BM7S0O6E.js +1 -0
- package/dist/web/assets/{NotificationsTab-JevzvJTg.js → NotificationsTab-DTcas5xQ.js} +1 -1
- package/dist/web/assets/{OAuthCallback-BjcRxLh5.js → OAuthCallback-CZ5PbMLP.js} +1 -1
- package/dist/web/assets/PromptsTab-Ce9hFDPL.js +15 -0
- package/dist/web/assets/ResourcesTab-CfV_CTOT.js +2 -0
- package/dist/web/assets/SamplingTab-7FoVfzSl.js +1 -0
- package/dist/web/assets/ServerMetadataTab-DfOYnm2P.js +1 -0
- package/dist/web/assets/ToolsTab-CeDM6lbc.js +8 -0
- package/dist/web/assets/ViewPreview-DMpWAByN.js +1 -0
- 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-ocTkuPLe.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-D6mojCV5.js +21 -0
- package/dist/web/assets/index-BfmL5fRO.js +499 -0
- package/dist/web/assets/index-bCIH1Sdx.css +1 -0
- package/dist/web/assets/input-C0OQCUZy.js +1 -0
- package/dist/web/assets/{label-B5Q_Zr8M.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-BaJnSpaR.js +1 -0
- package/dist/web/assets/{sparkles-2OAsc1aP.js → sparkles-BGYTDThM.js} +1 -1
- package/dist/web/assets/tabs-subtle-C3U3Xswq.js +1 -0
- package/dist/web/assets/textarea-CRTXuRmE.js +1 -0
- package/dist/web/assets/useConfig-tIq2w5rV.js +1 -0
- package/dist/web/assets/useViewHostProps--1CXsG5i.js +1 -0
- package/dist/web/assets/{zap-Du2Uc5pa.js → zap-BDWHCVHU.js} +1 -1
- package/dist/web/index.html +10 -11
- package/package.json +5 -12
- package/dist/cdn/ChatTab-D8uwCHAf.js +0 -13218
- package/dist/cdn/ConnectionSettingsForm-BNS6bOMD.js +0 -873
- package/dist/cdn/ConnectionSettingsTab-B97gPPJW.js +0 -145
- package/dist/cdn/PromptsTab-Cspfnl6n.js +0 -4400
- package/dist/cdn/bundle-mjs-B0nmHDtp.js +0 -1953
- package/dist/cdn/chunk-BO2N2NFS-Cy167e0X.js +0 -17500
- package/dist/cdn/createLucideIcon-C5fZZ6oB.js +0 -38
- package/dist/cdn/highlighted-body-OFNGDK62-CoReNbTX.js +0 -36
- package/dist/cdn/mermaid-GHXKKRXX-DgVIbk-D.js +0 -2
- package/dist/cdn/pdf-CxFT9FER.js +0 -16291
- package/dist/cdn/popover-C_SSrXT0.js +0 -2005
- package/dist/cdn/sheet-CerCdhxz.js +0 -78
- package/dist/cdn/useHostedSession-BA39Aegc.js +0 -153
- package/dist/cdn/useMCPPrompts-D3_Hla_z.js +0 -104
- package/dist/client/components/chat/streamdown-code-slim.d.ts +0 -4
- package/dist/client/components/chat/streamdown-code-slim.d.ts.map +0 -1
- package/dist/web/assets/AnimatePresence-CthXziG2.js +0 -9
- package/dist/web/assets/ChatTab-Cy8eyFYI.js +0 -460
- package/dist/web/assets/ConnectionSettingsTab-sDZGaUJn.js +0 -1
- package/dist/web/assets/ElicitationTab-wDKgU1qL.js +0 -1
- package/dist/web/assets/FormContext-Cqc_A12u.js +0 -1
- package/dist/web/assets/ListTabHeader-G-nQX18m.js +0 -1
- package/dist/web/assets/PromptsTab-DsQVOjKH.js +0 -61
- package/dist/web/assets/ResourcesTab-Bw8_p6M1.js +0 -2
- package/dist/web/assets/SamplingTab-BrcF1zJF.js +0 -1
- package/dist/web/assets/ServerMetadataTab-Bydeh1Po.js +0 -1
- package/dist/web/assets/ToolsTab-DJWF7Q_x.js +0 -8
- package/dist/web/assets/ViewPreview-jgeU7bY9.js +0 -1
- package/dist/web/assets/WidgetWrapper-B_vJU9uF.js +0 -34
- package/dist/web/assets/bundle-mjs-8puS6ou7.js +0 -1
- package/dist/web/assets/checkbox-BA-XURSj.js +0 -1
- package/dist/web/assets/chunk-BO2N2NFS-CGbd3eLY.js +0 -131
- package/dist/web/assets/code-tME-5H6D.js +0 -1
- package/dist/web/assets/createLucideIcon-B3b8EU0b.js +0 -1
- package/dist/web/assets/dist-BcAQZluc.js +0 -21
- package/dist/web/assets/highlighted-body-OFNGDK62-BBJFbIMp.js +0 -1
- package/dist/web/assets/index-BjH-Qp85.css +0 -1
- package/dist/web/assets/index-D2UxaT9v.js +0 -475
- package/dist/web/assets/input-CjmxOFr6.js +0 -1
- package/dist/web/assets/jsx-runtime-Cjj9sGSy.js +0 -1
- package/dist/web/assets/mermaid-GHXKKRXX-B4MKVODA.js +0 -1
- package/dist/web/assets/pdf-CuwKm9zO.js +0 -54
- package/dist/web/assets/select-C0xlfLAa.js +0 -1
- package/dist/web/assets/shared-DQE60Op-.js +0 -1
- package/dist/web/assets/sheet-7TIkLdpr.js +0 -1
- package/dist/web/assets/tabs-subtle-AkJZvdxS.js +0 -1
- package/dist/web/assets/textarea-Ci09-en6.js +0 -1
- package/dist/web/assets/useConfig-Qglo4xs1.js +0 -1
- package/dist/web/assets/useMCPPrompts-USLYc1I4.js +0 -1
- package/dist/web/assets/useViewHostProps-DXAD1g7g.js +0 -1
|
@@ -1,106 +1,107 @@
|
|
|
1
1
|
import { s as e, t } from "./react-BIs9pQ3H.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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-C5-knSKL.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-C7bt_ifQ.js";
|
|
26
|
+
import { c as Y, o as ge } from "./react-BoOQpLwo.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-Bj-1E9_v.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
|
|
258
|
+
return d ? /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
258
259
|
className: "space-y-4",
|
|
259
|
-
children: Object.entries(
|
|
260
|
-
let
|
|
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 && !
|
|
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
|
s,
|
|
391
|
-
|
|
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
|
-
disabled:
|
|
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
|
-
disabled:
|
|
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
|
-
disabled:
|
|
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
|
-
|
|
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:
|
|
493
|
+
onClick: l,
|
|
494
|
+
disabled: o || !s,
|
|
494
495
|
size: "sm",
|
|
495
|
-
className:
|
|
496
|
-
children:
|
|
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: r, 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: r, 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: r, 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: r, 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, l] = (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 && l(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:
|
|
1010
|
-
onValueChange: (e) =>
|
|
1011
|
-
children: [/* @__PURE__ */ (0,
|
|
983
|
+
E.length > 1 && /* @__PURE__ */ (0, Q.jsxs)(b, {
|
|
984
|
+
value: l.toString(),
|
|
985
|
+
onValueChange: (e) => u(parseInt(e)),
|
|
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,
|
|
1049
|
-
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,
|
|
1022
|
+
let e = D.error || Be(D.result);
|
|
1023
|
+
return e ? /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
1024
|
+
className: "bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded p-3 mx-4 mt-4",
|
|
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,127 +1119,127 @@ 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,
|
|
1185
|
-
onClick: () =>
|
|
1165
|
+
onClick: () => r(e)
|
|
1186
1166
|
}, e.name);
|
|
1187
1167
|
}) });
|
|
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
|
}),
|
|
@@ -1268,8 +1248,8 @@ function nt({ className: e, variant: t = "outline", size: n = "default", ...r })
|
|
|
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,45 +1435,11 @@ function it({ ref: e, activeTab: t, filteredTools: n, savedRequests: r, searchQu
|
|
|
1453
1435
|
n,
|
|
1454
1436
|
r,
|
|
1455
1437
|
t
|
|
1456
|
-
]), (0,
|
|
1457
|
-
if (
|
|
1458
|
-
method: "POST",
|
|
1459
|
-
headers: {
|
|
1460
|
-
"Content-Type": "application/json",
|
|
1461
|
-
"X-Debug-Session-Id": "831b88"
|
|
1462
|
-
},
|
|
1463
|
-
body: JSON.stringify({
|
|
1464
|
-
sessionId: "831b88",
|
|
1465
|
-
location: "useToolsTabNavigation.ts:auto-select",
|
|
1466
|
-
message: "tools auto-select effect",
|
|
1467
|
-
data: {
|
|
1468
|
-
selectedToolName: f,
|
|
1469
|
-
toolsCount: p.length,
|
|
1470
|
-
toolNames: p.slice(0, 5).map((e) => e.name),
|
|
1471
|
-
toolFound: f ? !!p.find((e) => e.name === f) : !1,
|
|
1472
|
-
currentSelected: o?.name ?? null
|
|
1473
|
-
},
|
|
1474
|
-
timestamp: Date.now(),
|
|
1475
|
-
hypothesisId: "H2"
|
|
1476
|
-
})
|
|
1477
|
-
}).catch(() => {}), !f || p.length === 0) return;
|
|
1438
|
+
]), (0, Z.useEffect)(() => {
|
|
1439
|
+
if (!f || p.length === 0) return;
|
|
1478
1440
|
let e = p.find((e) => e.name === f);
|
|
1479
1441
|
if (e) {
|
|
1480
|
-
|
|
1481
|
-
method: "POST",
|
|
1482
|
-
headers: {
|
|
1483
|
-
"Content-Type": "application/json",
|
|
1484
|
-
"X-Debug-Session-Id": "831b88"
|
|
1485
|
-
},
|
|
1486
|
-
body: JSON.stringify({
|
|
1487
|
-
sessionId: "831b88",
|
|
1488
|
-
location: "useToolsTabNavigation.ts:auto-select-apply",
|
|
1489
|
-
message: "scheduling handleToolSelect",
|
|
1490
|
-
data: { toolName: e.name },
|
|
1491
|
-
timestamp: Date.now(),
|
|
1492
|
-
hypothesisId: "H4"
|
|
1493
|
-
})
|
|
1494
|
-
}).catch(() => {}), m(null);
|
|
1442
|
+
m(null);
|
|
1495
1443
|
let t = setTimeout(() => {
|
|
1496
1444
|
l(e), document.getElementById(`tool-${e.name}`)?.scrollIntoView({
|
|
1497
1445
|
behavior: "smooth",
|
|
@@ -1520,45 +1468,46 @@ function it({ ref: e, activeTab: t, filteredTools: n, savedRequests: r, searchQu
|
|
|
1520
1468
|
}
|
|
1521
1469
|
//#endregion
|
|
1522
1470
|
//#region src/client/components/ToolsTab.tsx
|
|
1523
|
-
|
|
1524
|
-
|
|
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)({
|
|
1525
1474
|
open: !1,
|
|
1526
1475
|
parsedObject: {},
|
|
1527
1476
|
fieldsToUpdate: [],
|
|
1528
1477
|
newFields: [],
|
|
1529
1478
|
resolve: null
|
|
1530
|
-
}), [
|
|
1531
|
-
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));
|
|
1532
1481
|
}, [
|
|
1533
1482
|
M,
|
|
1534
|
-
|
|
1483
|
+
L,
|
|
1535
1484
|
z
|
|
1536
|
-
]),
|
|
1485
|
+
]), K = (0, Z.useMemo)(() => {
|
|
1537
1486
|
if (!S.trim()) return t;
|
|
1538
1487
|
let e = S.toLowerCase();
|
|
1539
1488
|
return t.filter((t) => t.name.toLowerCase().includes(e) || t.description?.toLowerCase().includes(e));
|
|
1540
|
-
}, [t, S]),
|
|
1489
|
+
}, [t, S]), se = (0, Z.useCallback)((e) => {
|
|
1541
1490
|
l(e);
|
|
1542
1491
|
let t = {}, n = /* @__PURE__ */ new Set();
|
|
1543
1492
|
e.inputSchema?.properties && Object.entries(e.inputSchema.properties).forEach(([e, r]) => {
|
|
1544
1493
|
let i = r;
|
|
1545
1494
|
i.default !== void 0 && (t[e] = i.default, n.add(e));
|
|
1546
1495
|
}), _(t), y(n), x(/* @__PURE__ */ new Set());
|
|
1547
|
-
}, []),
|
|
1496
|
+
}, []), le = (0, Z.useCallback)((e) => {
|
|
1548
1497
|
let n = t.find((t) => t.name === e.toolName);
|
|
1549
|
-
n && (l(n), _(e.args), y(new Set(Object.keys(e.args))), x(/* @__PURE__ */ new Set()),
|
|
1498
|
+
n && (l(n), _(e.args), y(new Set(Object.keys(e.args))), x(/* @__PURE__ */ new Set()), d(e));
|
|
1550
1499
|
}, [t]);
|
|
1551
|
-
(0,
|
|
1500
|
+
(0, Z.useEffect)(() => {
|
|
1552
1501
|
if (c) {
|
|
1553
1502
|
let e = t.find((e) => e.name === c.name);
|
|
1554
|
-
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),
|
|
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));
|
|
1555
1504
|
}
|
|
1556
1505
|
}, [
|
|
1557
1506
|
t,
|
|
1558
1507
|
c,
|
|
1559
|
-
|
|
1508
|
+
m
|
|
1560
1509
|
]);
|
|
1561
|
-
let
|
|
1510
|
+
let q = (0, Z.useCallback)((e, t) => {
|
|
1562
1511
|
let n = c?.inputSchema || {}, r = c?.inputSchema?.properties?.[e], i = r ? ke(r, n) : "string", a;
|
|
1563
1512
|
a = i === "object" || i === "array" || i === "string" ? t : Me(t, i), _((t) => ({
|
|
1564
1513
|
...t,
|
|
@@ -1572,7 +1521,7 @@ function at({ ref: e, tools: t, callTool: n, readResource: r, serverId: i, isCon
|
|
|
1572
1521
|
let n = new Set(t);
|
|
1573
1522
|
return n.delete(e), n;
|
|
1574
1523
|
});
|
|
1575
|
-
}, [c]),
|
|
1524
|
+
}, [c]), de = (0, Z.useCallback)((e, t, n) => {
|
|
1576
1525
|
if (n) {
|
|
1577
1526
|
let n = t === "array" ? "[]" : t === "object" ? "{}" : "";
|
|
1578
1527
|
_((t) => ({
|
|
@@ -1586,7 +1535,7 @@ function at({ ref: e, tools: t, callTool: n, readResource: r, serverId: i, isCon
|
|
|
1586
1535
|
let n = new Set(t);
|
|
1587
1536
|
return n.delete(e), n;
|
|
1588
1537
|
});
|
|
1589
|
-
}, []),
|
|
1538
|
+
}, []), fe = (0, Z.useCallback)(async (e, t) => {
|
|
1590
1539
|
if (!c) return !1;
|
|
1591
1540
|
let n = Fe(e);
|
|
1592
1541
|
if (!n) return !1;
|
|
@@ -1600,10 +1549,10 @@ function at({ ref: e, tools: t, callTool: n, readResource: r, serverId: i, isCon
|
|
|
1600
1549
|
key: e,
|
|
1601
1550
|
oldValue: l,
|
|
1602
1551
|
newValue: c
|
|
1603
|
-
}) : (s.push(e),
|
|
1552
|
+
}) : (s.push(e), q(e, String(c)));
|
|
1604
1553
|
}
|
|
1605
|
-
}), o.length === 0 && s.length === 0 ? !1 : o.length === 0 ? (
|
|
1606
|
-
|
|
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({
|
|
1607
1556
|
open: !0,
|
|
1608
1557
|
parsedObject: n,
|
|
1609
1558
|
fieldsToUpdate: o,
|
|
@@ -1614,29 +1563,29 @@ function at({ ref: e, tools: t, callTool: n, readResource: r, serverId: i, isCon
|
|
|
1614
1563
|
}, [
|
|
1615
1564
|
c,
|
|
1616
1565
|
g,
|
|
1617
|
-
|
|
1618
|
-
]),
|
|
1566
|
+
q
|
|
1567
|
+
]), pe = (0, Z.useCallback)(() => {
|
|
1619
1568
|
if (!N.resolve) return;
|
|
1620
1569
|
N.fieldsToUpdate.forEach(({ key: e, newValue: t }) => {
|
|
1621
|
-
|
|
1570
|
+
q(e, String(t));
|
|
1622
1571
|
});
|
|
1623
1572
|
let e = [...N.fieldsToUpdate.map((e) => e.key), ...N.newFields];
|
|
1624
|
-
|
|
1573
|
+
I(new Set(e)), setTimeout(() => I(/* @__PURE__ */ new Set()), 2e3), N.resolve(!0), F({
|
|
1625
1574
|
open: !1,
|
|
1626
1575
|
parsedObject: {},
|
|
1627
1576
|
fieldsToUpdate: [],
|
|
1628
1577
|
newFields: [],
|
|
1629
1578
|
resolve: null
|
|
1630
1579
|
});
|
|
1631
|
-
}, [N,
|
|
1632
|
-
N.resolve && (N.resolve(!1),
|
|
1580
|
+
}, [N, q]), J = (0, Z.useCallback)(() => {
|
|
1581
|
+
N.resolve && (N.resolve(!1), F({
|
|
1633
1582
|
open: !1,
|
|
1634
1583
|
parsedObject: {},
|
|
1635
1584
|
fieldsToUpdate: [],
|
|
1636
1585
|
newFields: [],
|
|
1637
1586
|
resolve: null
|
|
1638
1587
|
}));
|
|
1639
|
-
}, [N]),
|
|
1588
|
+
}, [N]), Y = (0, Z.useMemo)(() => {
|
|
1640
1589
|
if (!c?.inputSchema?.properties) return {};
|
|
1641
1590
|
let e = c.inputSchema || {}, t = {};
|
|
1642
1591
|
for (let n of v) {
|
|
@@ -1651,110 +1600,132 @@ function at({ ref: e, tools: t, callTool: n, readResource: r, serverId: i, isCon
|
|
|
1651
1600
|
g,
|
|
1652
1601
|
v,
|
|
1653
1602
|
b
|
|
1654
|
-
]), { isExecuting:
|
|
1603
|
+
]), { isExecuting: ge, copiedResult: _e, executeTool: X, handleCopyResult: ye, handleDeleteResult: be, handleFullscreen: xe, filteredResults: Ce, cancelExecution: Ee, results: De } = tt({
|
|
1655
1604
|
selectedTool: c,
|
|
1656
|
-
payloadToSend:
|
|
1605
|
+
payloadToSend: Y,
|
|
1657
1606
|
toolArgs: g,
|
|
1658
1607
|
callTool: n,
|
|
1659
|
-
readResource:
|
|
1660
|
-
serverId:
|
|
1661
|
-
}),
|
|
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({
|
|
1662
1633
|
ref: e,
|
|
1663
1634
|
activeTab: w,
|
|
1664
|
-
filteredTools:
|
|
1635
|
+
filteredTools: K,
|
|
1665
1636
|
savedRequests: E,
|
|
1666
1637
|
searchQuery: S,
|
|
1667
1638
|
setSearchQuery: C,
|
|
1668
1639
|
selectedTool: c,
|
|
1669
|
-
results:
|
|
1670
|
-
isExecuting:
|
|
1671
|
-
handleToolSelect:
|
|
1672
|
-
loadSavedRequest:
|
|
1673
|
-
refreshTools:
|
|
1674
|
-
selectedToolName:
|
|
1640
|
+
results: De,
|
|
1641
|
+
isExecuting: ge,
|
|
1642
|
+
handleToolSelect: se,
|
|
1643
|
+
loadSavedRequest: le,
|
|
1644
|
+
refreshTools: s,
|
|
1645
|
+
selectedToolName: f,
|
|
1675
1646
|
tools: t,
|
|
1676
|
-
setSelectedToolName:
|
|
1677
|
-
}),
|
|
1647
|
+
setSelectedToolName: m
|
|
1648
|
+
}), at = (0, Z.useCallback)(() => {
|
|
1678
1649
|
c && (j(""), k(!0));
|
|
1679
|
-
}, [c]),
|
|
1650
|
+
}, [c]), ot = (0, Z.useCallback)(() => {
|
|
1680
1651
|
if (!c) return;
|
|
1681
1652
|
let e = {
|
|
1682
1653
|
id: `${Date.now()}-${Math.random()}`,
|
|
1683
1654
|
name: A.trim() || `${c.name} - ${(/* @__PURE__ */ new Date()).toLocaleString()}`,
|
|
1684
1655
|
toolName: c.name,
|
|
1685
|
-
args:
|
|
1656
|
+
args: Y,
|
|
1686
1657
|
savedAt: Date.now(),
|
|
1687
1658
|
serverId: c._serverId,
|
|
1688
1659
|
serverName: c._serverName
|
|
1689
1660
|
};
|
|
1690
|
-
D([...E, e]),
|
|
1661
|
+
D([...E, e]), me(new he({
|
|
1691
1662
|
toolName: c.name,
|
|
1692
|
-
serverId:
|
|
1663
|
+
serverId: a
|
|
1693
1664
|
})).catch(() => {}), k(!1), j("");
|
|
1694
1665
|
}, [
|
|
1695
1666
|
c,
|
|
1696
1667
|
A,
|
|
1697
|
-
|
|
1668
|
+
Y,
|
|
1698
1669
|
E,
|
|
1699
1670
|
D,
|
|
1700
|
-
|
|
1701
|
-
]),
|
|
1702
|
-
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);
|
|
1703
1674
|
}, [
|
|
1704
1675
|
E,
|
|
1705
1676
|
D,
|
|
1706
|
-
|
|
1677
|
+
u
|
|
1707
1678
|
]);
|
|
1708
|
-
return
|
|
1679
|
+
return Be ? /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
1709
1680
|
className: "h-full flex flex-col overflow-hidden relative bg-background",
|
|
1710
1681
|
children: [
|
|
1711
|
-
|
|
1682
|
+
$ !== "list" && /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
1712
1683
|
className: "flex items-center gap-2 p-2 border-b shrink-0 bg-background z-10",
|
|
1713
|
-
children: [/* @__PURE__ */ (0,
|
|
1684
|
+
children: [/* @__PURE__ */ (0, Q.jsx)(p, {
|
|
1714
1685
|
variant: "ghost",
|
|
1715
1686
|
size: "sm",
|
|
1716
1687
|
onClick: () => {
|
|
1717
|
-
|
|
1688
|
+
$ === "response" ? Ve("detail") : (l(null), Ve("list"));
|
|
1718
1689
|
},
|
|
1719
1690
|
className: "p-0 h-8 w-8",
|
|
1720
|
-
children: /* @__PURE__ */ (0,
|
|
1721
|
-
}), /* @__PURE__ */ (0,
|
|
1691
|
+
children: /* @__PURE__ */ (0, Q.jsx)(R, { className: "h-4 w-4" })
|
|
1692
|
+
}), /* @__PURE__ */ (0, Q.jsxs)("div", {
|
|
1722
1693
|
className: "flex items-center text-sm font-medium",
|
|
1723
1694
|
children: [
|
|
1724
|
-
/* @__PURE__ */ (0,
|
|
1695
|
+
/* @__PURE__ */ (0, Q.jsx)("button", {
|
|
1725
1696
|
onClick: () => {
|
|
1726
|
-
l(null),
|
|
1697
|
+
l(null), Ve("list");
|
|
1727
1698
|
},
|
|
1728
1699
|
className: "text-muted-foreground hover:text-foreground hover:underline cursor-pointer",
|
|
1729
1700
|
children: "Tools"
|
|
1730
1701
|
}),
|
|
1731
|
-
|
|
1702
|
+
$ === "detail" && /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
1732
1703
|
className: "mx-2 text-muted-foreground",
|
|
1733
1704
|
children: "/"
|
|
1734
|
-
}), /* @__PURE__ */ (0,
|
|
1705
|
+
}), /* @__PURE__ */ (0, Q.jsx)("button", {
|
|
1735
1706
|
onClick: () => {
|
|
1736
|
-
|
|
1707
|
+
Ve("response");
|
|
1737
1708
|
},
|
|
1738
|
-
className:
|
|
1709
|
+
className: $ === "detail" ? "text-foreground hover:underline" : $ === "response" ? "text-muted-foreground hover:text-foreground hover:underline cursor-pointer" : "text-muted-foreground",
|
|
1739
1710
|
children: "Execute"
|
|
1740
1711
|
})] }),
|
|
1741
|
-
|
|
1712
|
+
$ === "response" && /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
1742
1713
|
className: "mx-2 text-muted-foreground",
|
|
1743
1714
|
children: "/"
|
|
1744
|
-
}), /* @__PURE__ */ (0,
|
|
1715
|
+
}), /* @__PURE__ */ (0, Q.jsx)("span", {
|
|
1745
1716
|
className: "text-foreground",
|
|
1746
1717
|
children: "Response"
|
|
1747
1718
|
})] })
|
|
1748
1719
|
]
|
|
1749
1720
|
})]
|
|
1750
1721
|
}),
|
|
1751
|
-
/* @__PURE__ */ (0,
|
|
1722
|
+
/* @__PURE__ */ (0, Q.jsx)("div", {
|
|
1752
1723
|
className: "flex-1 relative overflow-hidden",
|
|
1753
|
-
children: /* @__PURE__ */ (0,
|
|
1724
|
+
children: /* @__PURE__ */ (0, Q.jsxs)(h, {
|
|
1754
1725
|
initial: !1,
|
|
1755
1726
|
mode: "popLayout",
|
|
1756
1727
|
children: [
|
|
1757
|
-
|
|
1728
|
+
$ === "list" && /* @__PURE__ */ (0, Q.jsx)(r.div, {
|
|
1758
1729
|
initial: { x: "-100%" },
|
|
1759
1730
|
animate: { x: 0 },
|
|
1760
1731
|
exit: { x: "-100%" },
|
|
@@ -1764,41 +1735,41 @@ function at({ ref: e, tools: t, callTool: n, readResource: r, serverId: i, isCon
|
|
|
1764
1735
|
damping: 30
|
|
1765
1736
|
},
|
|
1766
1737
|
className: "absolute inset-0 flex flex-col bg-background z-0",
|
|
1767
|
-
children: /* @__PURE__ */ (0,
|
|
1738
|
+
children: /* @__PURE__ */ (0, Q.jsx)(W, { children: (e) => /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(Se, {
|
|
1768
1739
|
isScrolled: e,
|
|
1769
1740
|
activeTab: w,
|
|
1770
|
-
isSearchExpanded:
|
|
1741
|
+
isSearchExpanded: Pe,
|
|
1771
1742
|
searchQuery: S,
|
|
1772
1743
|
primaryTabName: "tools",
|
|
1773
1744
|
secondaryTabName: "saved",
|
|
1774
1745
|
primaryTabTitle: "Tools",
|
|
1775
1746
|
secondaryTabTitle: "Saved",
|
|
1776
|
-
primaryCount:
|
|
1747
|
+
primaryCount: K.length,
|
|
1777
1748
|
secondaryCount: E.length,
|
|
1778
|
-
primaryIcon:
|
|
1779
|
-
secondaryIcon:
|
|
1749
|
+
primaryIcon: ue,
|
|
1750
|
+
secondaryIcon: P,
|
|
1780
1751
|
searchPlaceholder: "Search tools...",
|
|
1781
|
-
onSearchExpand: () =>
|
|
1752
|
+
onSearchExpand: () => Ie(!0),
|
|
1782
1753
|
onSearchChange: C,
|
|
1783
|
-
onSearchBlur:
|
|
1754
|
+
onSearchBlur: Ke,
|
|
1784
1755
|
onTabSwitch: () => T(w === "tools" ? "saved" : "tools"),
|
|
1785
|
-
searchInputRef:
|
|
1786
|
-
onRefresh:
|
|
1787
|
-
isRefreshing:
|
|
1788
|
-
}), w === "tools" ? /* @__PURE__ */ (0,
|
|
1789
|
-
tools:
|
|
1756
|
+
searchInputRef: ze,
|
|
1757
|
+
onRefresh: s ? qe : void 0,
|
|
1758
|
+
isRefreshing: We
|
|
1759
|
+
}), w === "tools" ? /* @__PURE__ */ (0, Q.jsx)(Ue, {
|
|
1760
|
+
tools: K,
|
|
1790
1761
|
selectedTool: c,
|
|
1791
|
-
onToolSelect:
|
|
1792
|
-
focusedIndex:
|
|
1793
|
-
}) : /* @__PURE__ */ (0,
|
|
1762
|
+
onToolSelect: se,
|
|
1763
|
+
focusedIndex: Re
|
|
1764
|
+
}) : /* @__PURE__ */ (0, Q.jsx)(we, {
|
|
1794
1765
|
savedRequests: E,
|
|
1795
|
-
selectedRequest:
|
|
1796
|
-
onLoadRequest:
|
|
1797
|
-
onDeleteRequest:
|
|
1798
|
-
focusedIndex:
|
|
1766
|
+
selectedRequest: u,
|
|
1767
|
+
onLoadRequest: le,
|
|
1768
|
+
onDeleteRequest: st,
|
|
1769
|
+
focusedIndex: Re
|
|
1799
1770
|
})] }) })
|
|
1800
1771
|
}, "list"),
|
|
1801
|
-
|
|
1772
|
+
$ === "detail" && /* @__PURE__ */ (0, Q.jsx)(r.div, {
|
|
1802
1773
|
initial: { x: "100%" },
|
|
1803
1774
|
animate: { x: 0 },
|
|
1804
1775
|
exit: { x: "-100%" },
|
|
@@ -1808,23 +1779,23 @@ function at({ ref: e, tools: t, callTool: n, readResource: r, serverId: i, isCon
|
|
|
1808
1779
|
damping: 30
|
|
1809
1780
|
},
|
|
1810
1781
|
className: "absolute inset-0 bg-background z-10",
|
|
1811
|
-
children: /* @__PURE__ */ (0,
|
|
1782
|
+
children: /* @__PURE__ */ (0, Q.jsx)(Le, {
|
|
1812
1783
|
selectedTool: c,
|
|
1813
1784
|
toolArgs: g,
|
|
1814
|
-
payloadToSend:
|
|
1815
|
-
isExecuting:
|
|
1816
|
-
isConnected:
|
|
1817
|
-
onArgChange:
|
|
1818
|
-
onExecute:
|
|
1819
|
-
onSave:
|
|
1820
|
-
onBulkPaste:
|
|
1821
|
-
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,
|
|
1822
1793
|
setFields: v,
|
|
1823
1794
|
sendEmptyFields: b,
|
|
1824
|
-
onToggleEmpty:
|
|
1795
|
+
onToggleEmpty: de
|
|
1825
1796
|
})
|
|
1826
1797
|
}, "detail"),
|
|
1827
|
-
|
|
1798
|
+
$ === "response" && /* @__PURE__ */ (0, Q.jsx)(r.div, {
|
|
1828
1799
|
initial: { x: "100%" },
|
|
1829
1800
|
animate: { x: 0 },
|
|
1830
1801
|
exit: { x: "100%" },
|
|
@@ -1834,228 +1805,235 @@ function at({ ref: e, tools: t, callTool: n, readResource: r, serverId: i, isCon
|
|
|
1834
1805
|
damping: 30
|
|
1835
1806
|
},
|
|
1836
1807
|
className: "absolute inset-0 bg-background z-20",
|
|
1837
|
-
children: /* @__PURE__ */ (0,
|
|
1838
|
-
results:
|
|
1839
|
-
copiedResult:
|
|
1840
|
-
serverId:
|
|
1841
|
-
readResource:
|
|
1842
|
-
onCopy:
|
|
1843
|
-
onDelete:
|
|
1844
|
-
onFullscreen:
|
|
1845
|
-
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
|
|
1846
1817
|
})
|
|
1847
1818
|
}, "response")
|
|
1848
1819
|
]
|
|
1849
1820
|
})
|
|
1850
1821
|
}),
|
|
1851
|
-
/* @__PURE__ */ (0,
|
|
1822
|
+
/* @__PURE__ */ (0, Q.jsx)(Te, {
|
|
1852
1823
|
isOpen: O,
|
|
1853
1824
|
requestName: A,
|
|
1854
1825
|
defaultPlaceholder: `${c?.name} - ${(/* @__PURE__ */ new Date()).toLocaleString()}`,
|
|
1855
1826
|
onRequestNameChange: j,
|
|
1856
|
-
onSave:
|
|
1827
|
+
onSave: ot,
|
|
1857
1828
|
onCancel: () => k(!1)
|
|
1858
1829
|
}),
|
|
1859
|
-
/* @__PURE__ */ (0,
|
|
1830
|
+
/* @__PURE__ */ (0, Q.jsx)(Ge, {
|
|
1860
1831
|
open: N.open,
|
|
1861
1832
|
onOpenChange: (e) => {
|
|
1862
|
-
e ||
|
|
1833
|
+
e || J();
|
|
1863
1834
|
},
|
|
1864
|
-
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", {
|
|
1865
1836
|
className: "mb-3",
|
|
1866
|
-
children: [/* @__PURE__ */ (0,
|
|
1837
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("p", {
|
|
1867
1838
|
className: "font-medium mb-2",
|
|
1868
1839
|
children: "The following fields will be updated:"
|
|
1869
|
-
}), /* @__PURE__ */ (0,
|
|
1840
|
+
}), /* @__PURE__ */ (0, Q.jsx)("ul", {
|
|
1870
1841
|
className: "text-sm space-y-1 max-h-[200px] overflow-y-auto",
|
|
1871
|
-
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", {
|
|
1872
1843
|
className: "font-mono",
|
|
1873
1844
|
children: [
|
|
1874
|
-
/* @__PURE__ */ (0,
|
|
1845
|
+
/* @__PURE__ */ (0, Q.jsxs)("span", {
|
|
1875
1846
|
className: "font-semibold",
|
|
1876
1847
|
children: [e, ":"]
|
|
1877
1848
|
}),
|
|
1878
1849
|
" ",
|
|
1879
|
-
/* @__PURE__ */ (0,
|
|
1850
|
+
/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
1880
1851
|
className: "text-red-600 dark:text-red-400 line-through",
|
|
1881
1852
|
children: typeof t == "object" ? JSON.stringify(t).substring(0, 30) + "..." : String(t).substring(0, 30)
|
|
1882
1853
|
}),
|
|
1883
1854
|
" ",
|
|
1884
1855
|
"→",
|
|
1885
1856
|
" ",
|
|
1886
|
-
/* @__PURE__ */ (0,
|
|
1857
|
+
/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
1887
1858
|
className: "text-green-600 dark:text-green-400",
|
|
1888
1859
|
children: typeof n == "string" && n.length > 30 ? n.substring(0, 30) + "..." : String(n).substring(0, 30)
|
|
1889
1860
|
})
|
|
1890
1861
|
]
|
|
1891
1862
|
}, e))
|
|
1892
1863
|
})]
|
|
1893
|
-
}), N.newFields.length > 0 && /* @__PURE__ */ (0,
|
|
1864
|
+
}), N.newFields.length > 0 && /* @__PURE__ */ (0, Q.jsxs)("div", { children: [/* @__PURE__ */ (0, Q.jsx)("p", {
|
|
1894
1865
|
className: "font-medium mb-1",
|
|
1895
1866
|
children: "New fields to be filled:"
|
|
1896
|
-
}), /* @__PURE__ */ (0,
|
|
1867
|
+
}), /* @__PURE__ */ (0, Q.jsx)("p", {
|
|
1897
1868
|
className: "text-sm font-mono",
|
|
1898
1869
|
children: N.newFields.join(", ")
|
|
1899
|
-
})] })] })] }), /* @__PURE__ */ (0,
|
|
1900
|
-
onClick:
|
|
1870
|
+
})] })] })] }), /* @__PURE__ */ (0, Q.jsxs)(Xe, { children: [/* @__PURE__ */ (0, Q.jsx)(et, {
|
|
1871
|
+
onClick: J,
|
|
1901
1872
|
children: "Cancel"
|
|
1902
|
-
}), /* @__PURE__ */ (0,
|
|
1903
|
-
onClick:
|
|
1873
|
+
}), /* @__PURE__ */ (0, Q.jsx)($e, {
|
|
1874
|
+
onClick: pe,
|
|
1904
1875
|
children: "Auto-fill"
|
|
1905
1876
|
})] })] })
|
|
1906
1877
|
})
|
|
1907
1878
|
]
|
|
1908
|
-
}) : /* @__PURE__ */ (0,
|
|
1879
|
+
}) : /* @__PURE__ */ (0, Q.jsxs)(G, {
|
|
1909
1880
|
orientation: "horizontal",
|
|
1910
1881
|
className: "h-full",
|
|
1911
1882
|
children: [
|
|
1912
|
-
/* @__PURE__ */ (0,
|
|
1883
|
+
/* @__PURE__ */ (0, Q.jsx)(H, {
|
|
1913
1884
|
id: "left-panel",
|
|
1914
1885
|
defaultSize: "33%",
|
|
1915
1886
|
minSize: 250,
|
|
1916
1887
|
collapsedSize: 0,
|
|
1917
1888
|
collapsible: !0,
|
|
1918
1889
|
className: "flex flex-col h-full relative",
|
|
1919
|
-
panelRef:
|
|
1920
|
-
children: /* @__PURE__ */ (0,
|
|
1921
|
-
className: "flex h-full flex-col overflow-hidden
|
|
1922
|
-
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, {
|
|
1923
1894
|
isScrolled: e,
|
|
1924
1895
|
activeTab: w,
|
|
1925
|
-
isSearchExpanded:
|
|
1896
|
+
isSearchExpanded: Pe,
|
|
1926
1897
|
searchQuery: S,
|
|
1927
1898
|
primaryTabName: "tools",
|
|
1928
1899
|
secondaryTabName: "saved",
|
|
1929
1900
|
primaryTabTitle: "Tools",
|
|
1930
1901
|
secondaryTabTitle: "Saved",
|
|
1931
|
-
primaryCount:
|
|
1902
|
+
primaryCount: K.length,
|
|
1932
1903
|
secondaryCount: E.length,
|
|
1933
|
-
primaryIcon:
|
|
1934
|
-
secondaryIcon:
|
|
1904
|
+
primaryIcon: ue,
|
|
1905
|
+
secondaryIcon: P,
|
|
1935
1906
|
searchPlaceholder: "Search tools...",
|
|
1936
|
-
onSearchExpand: () =>
|
|
1907
|
+
onSearchExpand: () => Ie(!0),
|
|
1937
1908
|
onSearchChange: C,
|
|
1938
|
-
onSearchBlur:
|
|
1909
|
+
onSearchBlur: Ke,
|
|
1939
1910
|
onTabSwitch: () => T(w === "tools" ? "saved" : "tools"),
|
|
1940
|
-
searchInputRef:
|
|
1941
|
-
onRefresh:
|
|
1942
|
-
isRefreshing:
|
|
1943
|
-
}), w === "tools" ? /* @__PURE__ */ (0,
|
|
1944
|
-
tools:
|
|
1911
|
+
searchInputRef: ze,
|
|
1912
|
+
onRefresh: s ? qe : void 0,
|
|
1913
|
+
isRefreshing: We
|
|
1914
|
+
}), w === "tools" ? /* @__PURE__ */ (0, Q.jsx)(Ue, {
|
|
1915
|
+
tools: K,
|
|
1945
1916
|
selectedTool: c,
|
|
1946
|
-
onToolSelect:
|
|
1947
|
-
focusedIndex:
|
|
1948
|
-
}) : /* @__PURE__ */ (0,
|
|
1917
|
+
onToolSelect: se,
|
|
1918
|
+
focusedIndex: Re
|
|
1919
|
+
}) : /* @__PURE__ */ (0, Q.jsx)(we, {
|
|
1949
1920
|
savedRequests: E,
|
|
1950
|
-
selectedRequest:
|
|
1951
|
-
onLoadRequest:
|
|
1952
|
-
onDeleteRequest:
|
|
1953
|
-
focusedIndex:
|
|
1921
|
+
selectedRequest: u,
|
|
1922
|
+
onLoadRequest: le,
|
|
1923
|
+
onDeleteRequest: st,
|
|
1924
|
+
focusedIndex: Re
|
|
1954
1925
|
})] }) })
|
|
1955
1926
|
})
|
|
1956
1927
|
}),
|
|
1957
|
-
/* @__PURE__ */ (0,
|
|
1958
|
-
/* @__PURE__ */ (0,
|
|
1928
|
+
/* @__PURE__ */ (0, Q.jsx)(U, { withHandle: !0 }),
|
|
1929
|
+
/* @__PURE__ */ (0, Q.jsx)(H, {
|
|
1959
1930
|
defaultSize: "67%",
|
|
1960
|
-
children: /* @__PURE__ */ (0,
|
|
1931
|
+
children: /* @__PURE__ */ (0, Q.jsxs)(G, {
|
|
1961
1932
|
orientation: "vertical",
|
|
1933
|
+
elementRef: V,
|
|
1934
|
+
onLayoutChanged: Ae,
|
|
1962
1935
|
children: [
|
|
1963
|
-
/* @__PURE__ */ (0,
|
|
1936
|
+
/* @__PURE__ */ (0, Q.jsx)(H, {
|
|
1937
|
+
id: "tool-params",
|
|
1964
1938
|
defaultSize: "40%",
|
|
1939
|
+
minSize: `${rt}px`,
|
|
1965
1940
|
collapsible: !0,
|
|
1966
1941
|
panelRef: z,
|
|
1967
|
-
children: /* @__PURE__ */ (0,
|
|
1942
|
+
children: /* @__PURE__ */ (0, Q.jsx)(Le, {
|
|
1968
1943
|
selectedTool: c,
|
|
1969
1944
|
toolArgs: g,
|
|
1970
|
-
payloadToSend:
|
|
1971
|
-
isExecuting:
|
|
1972
|
-
isConnected:
|
|
1973
|
-
onArgChange:
|
|
1974
|
-
onExecute:
|
|
1975
|
-
onSave:
|
|
1976
|
-
onCancel:
|
|
1977
|
-
onBulkPaste:
|
|
1978
|
-
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,
|
|
1979
1954
|
setFields: v,
|
|
1980
1955
|
sendEmptyFields: b,
|
|
1981
|
-
onToggleEmpty:
|
|
1956
|
+
onToggleEmpty: de
|
|
1982
1957
|
})
|
|
1983
1958
|
}),
|
|
1984
|
-
/* @__PURE__ */ (0,
|
|
1985
|
-
/* @__PURE__ */ (0,
|
|
1959
|
+
/* @__PURE__ */ (0, Q.jsx)(U, { withHandle: !0 }),
|
|
1960
|
+
/* @__PURE__ */ (0, Q.jsx)(H, {
|
|
1961
|
+
id: "tool-result",
|
|
1986
1962
|
defaultSize: "60%",
|
|
1987
|
-
|
|
1963
|
+
panelRef: B,
|
|
1964
|
+
children: /* @__PURE__ */ (0, Q.jsx)("div", {
|
|
1988
1965
|
className: "flex flex-col h-full",
|
|
1989
|
-
children: /* @__PURE__ */ (0,
|
|
1990
|
-
results:
|
|
1991
|
-
copiedResult:
|
|
1992
|
-
serverId:
|
|
1993
|
-
readResource:
|
|
1994
|
-
onCopy:
|
|
1995
|
-
onDelete:
|
|
1996
|
-
onFullscreen:
|
|
1997
|
-
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,
|
|
1998
1975
|
isMaximized: M,
|
|
1999
|
-
onRerunTool:
|
|
1976
|
+
onRerunTool: X,
|
|
1977
|
+
onWidgetHeightChange: je
|
|
2000
1978
|
})
|
|
2001
1979
|
})
|
|
2002
1980
|
})
|
|
2003
1981
|
]
|
|
2004
1982
|
})
|
|
2005
1983
|
}),
|
|
2006
|
-
/* @__PURE__ */ (0,
|
|
1984
|
+
/* @__PURE__ */ (0, Q.jsx)(Te, {
|
|
2007
1985
|
isOpen: O,
|
|
2008
1986
|
requestName: A,
|
|
2009
1987
|
defaultPlaceholder: `${c?.name} - ${(/* @__PURE__ */ new Date()).toLocaleString()}`,
|
|
2010
1988
|
onRequestNameChange: j,
|
|
2011
|
-
onSave:
|
|
1989
|
+
onSave: ot,
|
|
2012
1990
|
onCancel: () => k(!1)
|
|
2013
1991
|
}),
|
|
2014
|
-
/* @__PURE__ */ (0,
|
|
1992
|
+
/* @__PURE__ */ (0, Q.jsx)(Ge, {
|
|
2015
1993
|
open: N.open,
|
|
2016
1994
|
onOpenChange: (e) => {
|
|
2017
|
-
e ||
|
|
1995
|
+
e || J();
|
|
2018
1996
|
},
|
|
2019
|
-
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", {
|
|
2020
1998
|
className: "mb-3",
|
|
2021
|
-
children: [/* @__PURE__ */ (0,
|
|
1999
|
+
children: [/* @__PURE__ */ (0, Q.jsx)("p", {
|
|
2022
2000
|
className: "font-medium mb-2",
|
|
2023
2001
|
children: "The following fields will be updated:"
|
|
2024
|
-
}), /* @__PURE__ */ (0,
|
|
2002
|
+
}), /* @__PURE__ */ (0, Q.jsx)("ul", {
|
|
2025
2003
|
className: "text-sm space-y-1 max-h-[200px] overflow-y-auto",
|
|
2026
|
-
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", {
|
|
2027
2005
|
className: "font-mono",
|
|
2028
2006
|
children: [
|
|
2029
|
-
/* @__PURE__ */ (0,
|
|
2007
|
+
/* @__PURE__ */ (0, Q.jsxs)("span", {
|
|
2030
2008
|
className: "font-semibold",
|
|
2031
2009
|
children: [e, ":"]
|
|
2032
2010
|
}),
|
|
2033
2011
|
" ",
|
|
2034
|
-
/* @__PURE__ */ (0,
|
|
2012
|
+
/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
2035
2013
|
className: "text-red-600 dark:text-red-400 line-through",
|
|
2036
2014
|
children: typeof t == "object" ? JSON.stringify(t).substring(0, 30) + "..." : String(t).substring(0, 30)
|
|
2037
2015
|
}),
|
|
2038
2016
|
" ",
|
|
2039
2017
|
"→",
|
|
2040
2018
|
" ",
|
|
2041
|
-
/* @__PURE__ */ (0,
|
|
2019
|
+
/* @__PURE__ */ (0, Q.jsx)("span", {
|
|
2042
2020
|
className: "text-green-600 dark:text-green-400",
|
|
2043
2021
|
children: typeof n == "string" && n.length > 30 ? n.substring(0, 30) + "..." : String(n).substring(0, 30)
|
|
2044
2022
|
})
|
|
2045
2023
|
]
|
|
2046
2024
|
}, e))
|
|
2047
2025
|
})]
|
|
2048
|
-
}), N.newFields.length > 0 && /* @__PURE__ */ (0,
|
|
2026
|
+
}), N.newFields.length > 0 && /* @__PURE__ */ (0, Q.jsxs)("div", { children: [/* @__PURE__ */ (0, Q.jsx)("p", {
|
|
2049
2027
|
className: "font-medium mb-1",
|
|
2050
2028
|
children: "New fields to be filled:"
|
|
2051
|
-
}), /* @__PURE__ */ (0,
|
|
2029
|
+
}), /* @__PURE__ */ (0, Q.jsx)("p", {
|
|
2052
2030
|
className: "text-sm font-mono",
|
|
2053
2031
|
children: N.newFields.join(", ")
|
|
2054
|
-
})] })] })] }), /* @__PURE__ */ (0,
|
|
2055
|
-
onClick:
|
|
2032
|
+
})] })] })] }), /* @__PURE__ */ (0, Q.jsxs)(Xe, { children: [/* @__PURE__ */ (0, Q.jsx)(et, {
|
|
2033
|
+
onClick: J,
|
|
2056
2034
|
children: "Cancel"
|
|
2057
|
-
}), /* @__PURE__ */ (0,
|
|
2058
|
-
onClick:
|
|
2035
|
+
}), /* @__PURE__ */ (0, Q.jsx)($e, {
|
|
2036
|
+
onClick: pe,
|
|
2059
2037
|
children: "Auto-fill"
|
|
2060
2038
|
})] })] })
|
|
2061
2039
|
})
|