@mcp-use/inspector 20.0.0-beta.1 → 20.0.0-beta.11
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-KJDI5ycl.js +6811 -0
- package/dist/cdn/{CheckboxIndicator-BF2cKfbA.js → CheckboxIndicator-BjF73mGX.js} +74 -73
- package/dist/cdn/ConnectionSettingsForm-CAvpobCm.js +929 -0
- package/dist/cdn/ConnectionSettingsTab-Nhdvdpk5.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-BIiauZ_A.js} +583 -620
- package/dist/cdn/{ManufactOAuthCallback-DEM8mhWD.js → ManufactOAuthCallback-ChbbjFIT.js} +3 -3
- package/dist/cdn/MarkdownRenderer-DZuWYsja.js +3610 -0
- package/dist/cdn/McpAppsViewPanel-BTOKcnV3.js +56 -0
- package/dist/cdn/{NotificationsTab-CWopTIzT.js → NotificationsTab-B7uebqMV.js} +13 -13
- package/dist/cdn/{OAuthCallback-k3oeLtIC.js → OAuthCallback-CBWWNg2N.js} +3 -3
- package/dist/cdn/PromptsTab-DuP66kUg.js +902 -0
- package/dist/cdn/{ResourcesTab-KfamsM6-.js → ResourcesTab-BJxaJgKU.js} +106 -124
- package/dist/cdn/{SamplingTab-vcufuK24.js → SamplingTab-Bfnd-TZ-.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-DGBRXBW-.js} +671 -693
- package/dist/cdn/{ViewPreview-B_onhcUB.js → ViewPreview-DPWKMeND.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-mRDqCgKU.js → dist-BgB6gR-d.js} +116 -114
- package/dist/cdn/{dist-DjXr_YO3.js → dist-CTJnCYmk.js} +1 -1
- 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-Ds41Irtb.js} +120 -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-BtzXvzGh.js} +855 -853
- 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-B6Xh2ktb.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-CLBnK-B4.js} +73 -46
- package/dist/cdn/{useSavedRequests-Ci2I919u.js → useSavedRequests-mSIsDd4c.js} +1 -1
- package/dist/cdn/{useViewHostProps-Dr6W2ooF.js → useViewHostProps-DRWpI0-w.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-Y2GBQOQW.js → chunk-7BTEIKSA.js} +2 -9
- package/dist/server/{chunk-VDUV6LR6.js → chunk-FJ7P3RIU.js} +75 -5
- package/dist/server/{chunk-KBVKS4J5.js → chunk-H6ZCIKBS.js} +10 -0
- package/dist/server/{chunk-K2V2SDQD.js → chunk-OWR2BIBW.js} +1 -1
- package/dist/server/{chunk-IXYK6ZOY.js → chunk-PY5HM5DW.js} +2 -2
- package/dist/server/{chunk-5B3SXGZP.js → chunk-UJLXHNQP.js} +1 -1
- package/dist/server/{chunk-6XWDZEFF.js → chunk-XCNS5CIW.js} +8 -3
- package/dist/server/cli.js +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-B_CvwC4L.js +18 -0
- package/dist/web/assets/ConnectionSettingsTab-OhY1ex8u.js +1 -0
- package/dist/web/assets/ElicitationTab-CwkUbGUo.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-SlpRw9KD.js +34 -0
- package/dist/web/assets/{ManufactOAuthCallback-DCLbW-mz.js → ManufactOAuthCallback-DgIxvi85.js} +1 -1
- package/dist/web/assets/MarkdownRenderer-B_n2JuA3.js +47 -0
- package/dist/web/assets/McpAppsViewPanel-CR8zhRi4.js +1 -0
- package/dist/web/assets/{NotificationsTab-JevzvJTg.js → NotificationsTab-DeGCkKLB.js} +1 -1
- package/dist/web/assets/{OAuthCallback-BjcRxLh5.js → OAuthCallback-DhFgvjS_.js} +1 -1
- package/dist/web/assets/PromptsTab-DZVkm_vn.js +15 -0
- package/dist/web/assets/ResourcesTab-5mZflymU.js +2 -0
- package/dist/web/assets/SamplingTab-TWoyNn8-.js +1 -0
- package/dist/web/assets/ServerMetadataTab-DZZpijCY.js +1 -0
- package/dist/web/assets/ToolsTab-DEZiEf9V.js +8 -0
- package/dist/web/assets/ViewPreview-ymDMBa0M.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-Wgm0SaKL.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-Bl7zPiY1.js +21 -0
- package/dist/web/assets/index-CpswgjB5.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-BtvKT_T4.js +1 -0
- package/dist/web/assets/{sparkles-2OAsc1aP.js → sparkles-BGYTDThM.js} +1 -1
- package/dist/web/assets/tabs-subtle-C5J9sUzi.js +1 -0
- package/dist/web/assets/textarea-CRTXuRmE.js +1 -0
- package/dist/web/assets/useConfig-CZkuy4Iy.js +1 -0
- package/dist/web/assets/useViewHostProps-nCaYmcbd.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
|
@@ -6,27 +6,25 @@ var l = /* @__PURE__ */ e({
|
|
|
6
6
|
BrowserOAuthClientProvider: () => B,
|
|
7
7
|
DialectJsonSchemaValidator: () => K,
|
|
8
8
|
HttpConnector: () => Y,
|
|
9
|
-
MCPClient: () =>
|
|
9
|
+
MCPClient: () => ke,
|
|
10
10
|
MCPConnection: () => $,
|
|
11
11
|
MCPSession: () => $,
|
|
12
|
-
POSTHOG_API_KEY: () =>
|
|
13
|
-
POSTHOG_HOST: () =>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Telemetry: () => I,
|
|
12
|
+
POSTHOG_API_KEY: () => oe,
|
|
13
|
+
POSTHOG_HOST: () => ae,
|
|
14
|
+
Tel: () => N,
|
|
15
|
+
Telemetry: () => M,
|
|
17
16
|
VERSION: () => x,
|
|
18
|
-
capturePostHog: () =>
|
|
19
|
-
|
|
20
|
-
completeOAuthFlow: () => W,
|
|
17
|
+
capturePostHog: () => E,
|
|
18
|
+
completeOAuthFlow: () => G,
|
|
21
19
|
createOAuthProvider: () => V,
|
|
22
20
|
getPackageVersion: () => S,
|
|
23
|
-
isUnauthorized: () =>
|
|
21
|
+
isUnauthorized: () => W,
|
|
24
22
|
logger: () => b,
|
|
25
23
|
normalizeClientInfo: () => Q,
|
|
26
24
|
resolveCallbacks: () => X,
|
|
27
|
-
setTelemetrySource: () =>
|
|
25
|
+
setTelemetrySource: () => P,
|
|
28
26
|
shouldAutoProvisionOAuth: () => Z,
|
|
29
|
-
telFetch: () =>
|
|
27
|
+
telFetch: () => T
|
|
30
28
|
}), u;
|
|
31
29
|
function d(e) {
|
|
32
30
|
u = e;
|
|
@@ -119,7 +117,7 @@ var ee = class {
|
|
|
119
117
|
static setFormat(e) {
|
|
120
118
|
this.configure({ format: e });
|
|
121
119
|
}
|
|
122
|
-
}.get(), x = "2.0.0-beta.
|
|
120
|
+
}.get(), x = "2.0.0-beta.6";
|
|
123
121
|
function S() {
|
|
124
122
|
return x;
|
|
125
123
|
}
|
|
@@ -192,7 +190,7 @@ var C = class {}, te = class extends C {
|
|
|
192
190
|
public_identifier: this.data.publicIdentifier ?? null
|
|
193
191
|
};
|
|
194
192
|
}
|
|
195
|
-
},
|
|
193
|
+
}, w = class extends C {
|
|
196
194
|
constructor(e) {
|
|
197
195
|
super(), this.data = e;
|
|
198
196
|
}
|
|
@@ -215,7 +213,7 @@ var C = class {}, te = class extends C {
|
|
|
215
213
|
return null;
|
|
216
214
|
}
|
|
217
215
|
}
|
|
218
|
-
},
|
|
216
|
+
}, ie = class extends C {
|
|
219
217
|
constructor(e) {
|
|
220
218
|
super(), this.data = e;
|
|
221
219
|
}
|
|
@@ -226,59 +224,15 @@ var C = class {}, te = class extends C {
|
|
|
226
224
|
return { server_name: this.data.serverName };
|
|
227
225
|
}
|
|
228
226
|
};
|
|
229
|
-
async function
|
|
227
|
+
async function T(e, t) {
|
|
230
228
|
try {
|
|
231
229
|
await fetch(e, t);
|
|
232
230
|
} catch {}
|
|
233
231
|
}
|
|
234
|
-
var
|
|
235
|
-
|
|
236
|
-
"response",
|
|
237
|
-
"messages"
|
|
238
|
-
]);
|
|
239
|
-
function le(e) {
|
|
240
|
-
if (e == null) return "";
|
|
241
|
-
if (typeof e == "string") return e;
|
|
242
|
-
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
243
|
-
try {
|
|
244
|
-
return JSON.stringify(e);
|
|
245
|
-
} catch {
|
|
246
|
-
return String(e);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
function ue(e, t = E) {
|
|
250
|
-
let n = new URLSearchParams();
|
|
251
|
-
for (let [t, r] of Object.entries(e)) {
|
|
252
|
-
let e = le(r);
|
|
253
|
-
ce.has(t) && e.length > 120 && (e = `${e.slice(0, 117)}...`), e !== "" && n.set(t, e);
|
|
254
|
-
}
|
|
255
|
-
let r = `${t}${t.includes("?") ? "&" : "?"}${n.toString()}`;
|
|
256
|
-
if (r.length <= D) return r;
|
|
257
|
-
let i = [...n.keys()].sort((e, t) => (n.get(t)?.length ?? 0) - (n.get(e)?.length ?? 0));
|
|
258
|
-
for (let e of i) {
|
|
259
|
-
if (r.length <= D) break;
|
|
260
|
-
e === "event" || e === "user_id" || (n.delete(e), r = `${t}${t.includes("?") ? "&" : "?"}${n.toString()}`);
|
|
261
|
-
}
|
|
262
|
-
return r.slice(0, D);
|
|
263
|
-
}
|
|
264
|
-
function de(e, t) {
|
|
265
|
-
return w(t, {
|
|
266
|
-
method: "POST",
|
|
267
|
-
headers: { "Content-Type": "application/json" },
|
|
268
|
-
keepalive: !0,
|
|
269
|
-
body: JSON.stringify(e)
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
function fe(e, t) {
|
|
273
|
-
try {
|
|
274
|
-
let n = ue(e, t), r = new Image();
|
|
275
|
-
r.referrerPolicy = "no-referrer-when-downgrade", r.src = n;
|
|
276
|
-
} catch {}
|
|
277
|
-
return Promise.resolve();
|
|
278
|
-
}
|
|
279
|
-
function O(e) {
|
|
232
|
+
var ae = "https://eu.i.posthog.com", oe = "phc_lyTtbYwvkdSbrcMQNPiKiiRWrrM1seyKIMjycSvItEI";
|
|
233
|
+
function E(e) {
|
|
280
234
|
let t = e.host ?? "https://eu.i.posthog.com", n = e.apiKey ?? "phc_lyTtbYwvkdSbrcMQNPiKiiRWrrM1seyKIMjycSvItEI";
|
|
281
|
-
return
|
|
235
|
+
return T(`${t}/i/v0/e/`, {
|
|
282
236
|
method: "POST",
|
|
283
237
|
headers: { "Content-Type": "application/json" },
|
|
284
238
|
keepalive: !0,
|
|
@@ -291,30 +245,19 @@ function O(e) {
|
|
|
291
245
|
})
|
|
292
246
|
});
|
|
293
247
|
}
|
|
294
|
-
function
|
|
295
|
-
return typeof window < "u" ? fe(e, t === "https://mcpuse.gateway.scarf.sh/events-ts" ? E : t) : de(e, t);
|
|
296
|
-
}
|
|
297
|
-
function A() {
|
|
248
|
+
function D() {
|
|
298
249
|
return globalThis.crypto.randomUUID();
|
|
299
250
|
}
|
|
300
|
-
function
|
|
251
|
+
function se() {
|
|
301
252
|
let e = new Uint8Array(8);
|
|
302
253
|
return globalThis.crypto.getRandomValues(e), Array.from(e, (e) => e.toString(16).padStart(2, "0")).join("");
|
|
303
254
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
for (let e = 0; e < a; e++) {
|
|
307
|
-
let t = r[e] ?? 0, n = i[e] ?? 0;
|
|
308
|
-
if (t !== n) return t > n;
|
|
309
|
-
}
|
|
310
|
-
return !1;
|
|
311
|
-
}
|
|
312
|
-
var j = "mcp_use_user_id", M = "phc_lyTtbYwvkdSbrcMQNPiKiiRWrrM1seyKIMjycSvItEI", N = "https://eu.i.posthog.com", P = null;
|
|
313
|
-
function F() {
|
|
255
|
+
var O = "mcp_use_user_id", k = "phc_lyTtbYwvkdSbrcMQNPiKiiRWrrM1seyKIMjycSvItEI", A = "https://eu.i.posthog.com", ce = null;
|
|
256
|
+
function j() {
|
|
314
257
|
return typeof localStorage < "u" && typeof localStorage.getItem == "function" && typeof localStorage.setItem == "function" && typeof localStorage.removeItem == "function";
|
|
315
258
|
}
|
|
316
|
-
function
|
|
317
|
-
if (!
|
|
259
|
+
function le() {
|
|
260
|
+
if (!j()) return null;
|
|
318
261
|
try {
|
|
319
262
|
localStorage.setItem("__mcp_use_test__", "1"), localStorage.removeItem("__mcp_use_test__");
|
|
320
263
|
} catch {
|
|
@@ -323,66 +266,60 @@ function he() {
|
|
|
323
266
|
return {
|
|
324
267
|
getUserId() {
|
|
325
268
|
try {
|
|
326
|
-
return localStorage.getItem(
|
|
269
|
+
return localStorage.getItem(O);
|
|
327
270
|
} catch {
|
|
328
271
|
return null;
|
|
329
272
|
}
|
|
330
273
|
},
|
|
331
274
|
setUserId(e) {
|
|
332
275
|
try {
|
|
333
|
-
localStorage.setItem(
|
|
276
|
+
localStorage.setItem(O, e);
|
|
334
277
|
} catch {}
|
|
335
|
-
}
|
|
336
|
-
getDownloadedVersion: () => null,
|
|
337
|
-
setDownloadedVersion: () => void 0
|
|
278
|
+
}
|
|
338
279
|
};
|
|
339
280
|
}
|
|
340
|
-
function
|
|
281
|
+
function ue() {
|
|
341
282
|
try {
|
|
342
283
|
return globalThis.Bun === void 0 ? globalThis.Deno === void 0 ? typeof navigator < "u" && navigator.userAgent?.includes("Cloudflare-Workers") ? "cloudflare-workers" : globalThis.EdgeRuntime === void 0 ? typeof window < "u" && typeof document < "u" ? "browser" : typeof process < "u" && process.versions?.node !== void 0 ? "node" : "unknown" : "edge" : "deno" : "bun";
|
|
343
284
|
} catch {
|
|
344
285
|
return "unknown";
|
|
345
286
|
}
|
|
346
287
|
}
|
|
347
|
-
function
|
|
288
|
+
function de() {
|
|
348
289
|
if (typeof process < "u" && {}.MCP_USE_TELEMETRY_SOURCE) return {}.MCP_USE_TELEMETRY_SOURCE;
|
|
349
290
|
try {
|
|
350
|
-
if (
|
|
291
|
+
if (j()) return localStorage.getItem("MCP_USE_TELEMETRY_SOURCE") ?? void 0;
|
|
351
292
|
} catch {}
|
|
352
293
|
}
|
|
353
|
-
function
|
|
294
|
+
function fe() {
|
|
354
295
|
if (typeof window < "u" && window.__MCP_USE_ANONYMIZED_TELEMETRY__ === !1 || typeof process < "u" && {}.MCP_USE_ANONYMIZED_TELEMETRY?.toLowerCase() === "false") return !0;
|
|
355
296
|
try {
|
|
356
|
-
if (
|
|
297
|
+
if (j() && localStorage.getItem("MCP_USE_ANONYMIZED_TELEMETRY") === "false") return !0;
|
|
357
298
|
} catch {}
|
|
358
299
|
return !1;
|
|
359
300
|
}
|
|
360
|
-
function
|
|
301
|
+
function pe() {
|
|
361
302
|
try {
|
|
362
|
-
return `session-${
|
|
303
|
+
return `session-${D()}`;
|
|
363
304
|
} catch {
|
|
364
|
-
return `session-${Date.now()}-${
|
|
305
|
+
return `session-${Date.now()}-${se()}`;
|
|
365
306
|
}
|
|
366
307
|
}
|
|
367
|
-
var
|
|
308
|
+
var M = class e {
|
|
368
309
|
static instance = null;
|
|
369
310
|
UNKNOWN_USER_ID = "UNKNOWN_USER_ID";
|
|
370
311
|
_currUserId = null;
|
|
371
312
|
_telemetryEnabled = !1;
|
|
372
313
|
_pending = /* @__PURE__ */ new Set();
|
|
373
|
-
_scarfEnabled = !1;
|
|
374
314
|
_runtimeEnvironment;
|
|
375
315
|
_storageCapability;
|
|
376
316
|
_storage;
|
|
377
|
-
_fsBacked;
|
|
378
317
|
_source;
|
|
379
318
|
_productVersion;
|
|
380
319
|
constructor() {
|
|
381
|
-
this._runtimeEnvironment =
|
|
382
|
-
let e =
|
|
383
|
-
e ? (this._telemetryEnabled = !1, b.debug("Telemetry disabled via opt-out")) : t ? (b.debug("Anonymized telemetry enabled. Set MCP_USE_ANONYMIZED_TELEMETRY=false to disable."), this._telemetryEnabled = !0
|
|
384
|
-
this.trackPackageDownload({ triggered_by: "initialization" }).catch((e) => b.debug(`Failed to track package download: ${e}`));
|
|
385
|
-
}, 0)) : (this._telemetryEnabled = !1, b.debug(`Telemetry disabled - unknown environment: ${this._runtimeEnvironment}`));
|
|
320
|
+
this._runtimeEnvironment = ue(), this._storage = ce ?? le() ?? null, this._storageCapability = this._storage ? "persistent" : "session-only", this._source = de() || this._runtimeEnvironment;
|
|
321
|
+
let e = fe(), t = this._runtimeEnvironment !== "unknown";
|
|
322
|
+
e ? (this._telemetryEnabled = !1, b.debug("Telemetry disabled via opt-out")) : t ? (b.debug("Anonymized telemetry enabled. Set MCP_USE_ANONYMIZED_TELEMETRY=false to disable."), this._telemetryEnabled = !0) : (this._telemetryEnabled = !1, b.debug(`Telemetry disabled - unknown environment: ${this._runtimeEnvironment}`));
|
|
386
323
|
}
|
|
387
324
|
get runtimeEnvironment() {
|
|
388
325
|
return this._runtimeEnvironment;
|
|
@@ -396,7 +333,7 @@ var I = class e {
|
|
|
396
333
|
setSource(e) {
|
|
397
334
|
this._source = e;
|
|
398
335
|
try {
|
|
399
|
-
|
|
336
|
+
j() && localStorage.setItem("MCP_USE_TELEMETRY_SOURCE", e);
|
|
400
337
|
} catch {}
|
|
401
338
|
b.debug(`Telemetry source set to: ${e}`);
|
|
402
339
|
}
|
|
@@ -407,7 +344,7 @@ var I = class e {
|
|
|
407
344
|
this._productVersion = e;
|
|
408
345
|
}
|
|
409
346
|
get isEnabled() {
|
|
410
|
-
return this._telemetryEnabled
|
|
347
|
+
return this._telemetryEnabled;
|
|
411
348
|
}
|
|
412
349
|
get userId() {
|
|
413
350
|
if (this._currUserId) return this._currUserId;
|
|
@@ -415,56 +352,31 @@ var I = class e {
|
|
|
415
352
|
if (this._storage) {
|
|
416
353
|
let e = this._storage.getUserId();
|
|
417
354
|
if (e) return this._currUserId = e, e;
|
|
418
|
-
let t =
|
|
355
|
+
let t = D();
|
|
419
356
|
return this._storage.setUserId(t), this._currUserId = t, t;
|
|
420
357
|
}
|
|
421
|
-
this._currUserId =
|
|
358
|
+
this._currUserId = pe();
|
|
422
359
|
} catch {
|
|
423
360
|
this._currUserId = this.UNKNOWN_USER_ID;
|
|
424
361
|
}
|
|
425
362
|
return this._currUserId;
|
|
426
363
|
}
|
|
427
364
|
async capture(e) {
|
|
428
|
-
if (!this._telemetryEnabled
|
|
365
|
+
if (!this._telemetryEnabled) return;
|
|
429
366
|
let t = this.userId, n = {
|
|
430
367
|
...e.properties,
|
|
431
368
|
mcp_use_version: this._productVersion ?? S(),
|
|
432
369
|
language: "typescript",
|
|
433
370
|
source: this._source,
|
|
434
371
|
runtime: this._runtimeEnvironment
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
distinctId: t,
|
|
442
|
-
properties: n
|
|
443
|
-
});
|
|
444
|
-
this._pending.add(r), r.finally(() => this._pending.delete(r));
|
|
445
|
-
}
|
|
446
|
-
if (this._scarfEnabled) {
|
|
447
|
-
let r = k({
|
|
448
|
-
...n,
|
|
449
|
-
user_id: t,
|
|
450
|
-
event: e.name
|
|
451
|
-
});
|
|
452
|
-
this._pending.add(r), r.finally(() => this._pending.delete(r));
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
async trackPackageDownload(e) {
|
|
456
|
-
if (!this._scarfEnabled || !this._fsBacked || !this._storage) return;
|
|
457
|
-
let t = S(), n = this._storage.getDownloadedVersion(), r = !1, i = !1;
|
|
458
|
-
n ? me(t, n) && (i = !0, this._storage.setDownloadedVersion(t)) : (i = !0, r = !0, this._storage.setDownloadedVersion(t)), i && await k({
|
|
459
|
-
...e || {},
|
|
460
|
-
mcp_use_version: t,
|
|
461
|
-
user_id: this.userId,
|
|
462
|
-
event: "package_download",
|
|
463
|
-
first_download: r,
|
|
464
|
-
language: "typescript",
|
|
465
|
-
source: this._source,
|
|
466
|
-
runtime: this._runtimeEnvironment
|
|
372
|
+
}, r = E({
|
|
373
|
+
host: A,
|
|
374
|
+
apiKey: k,
|
|
375
|
+
event: e.name,
|
|
376
|
+
distinctId: t,
|
|
377
|
+
properties: n
|
|
467
378
|
});
|
|
379
|
+
this._pending.add(r), r.finally(() => this._pending.delete(r));
|
|
468
380
|
}
|
|
469
381
|
async trackAgentExecution(e) {
|
|
470
382
|
this.isEnabled && await this.capture(new te(e));
|
|
@@ -476,13 +388,13 @@ var I = class e {
|
|
|
476
388
|
this.isEnabled && await this.capture(new re(e));
|
|
477
389
|
}
|
|
478
390
|
async trackClientAddServer(e, t) {
|
|
479
|
-
this.isEnabled && await this.capture(new
|
|
391
|
+
this.isEnabled && await this.capture(new w({
|
|
480
392
|
serverName: e,
|
|
481
393
|
serverConfig: t
|
|
482
394
|
}));
|
|
483
395
|
}
|
|
484
396
|
async trackClientRemoveServer(e) {
|
|
485
|
-
this.isEnabled && await this.capture(new
|
|
397
|
+
this.isEnabled && await this.capture(new ie({ serverName: e }));
|
|
486
398
|
}
|
|
487
399
|
async trackUseMcpConnection(e) {
|
|
488
400
|
this.isEnabled && await this.capture({
|
|
@@ -521,9 +433,9 @@ var I = class e {
|
|
|
521
433
|
});
|
|
522
434
|
}
|
|
523
435
|
identify(e, t) {
|
|
524
|
-
this._currUserId = e, this._storage?.setUserId(e), this._telemetryEnabled &&
|
|
525
|
-
host:
|
|
526
|
-
apiKey:
|
|
436
|
+
this._currUserId = e, this._storage?.setUserId(e), this._telemetryEnabled && E({
|
|
437
|
+
host: A,
|
|
438
|
+
apiKey: k,
|
|
527
439
|
event: "$identify",
|
|
528
440
|
distinctId: e,
|
|
529
441
|
properties: { $set: t ?? {} }
|
|
@@ -542,15 +454,15 @@ var I = class e {
|
|
|
542
454
|
b.debug(`Error flushing telemetry captures: ${e}`);
|
|
543
455
|
}
|
|
544
456
|
}
|
|
545
|
-
},
|
|
546
|
-
function
|
|
547
|
-
|
|
457
|
+
}, N = M;
|
|
458
|
+
function P(e) {
|
|
459
|
+
N.getInstance().setSource(e);
|
|
548
460
|
}
|
|
549
461
|
d({
|
|
550
|
-
addServer: (e, t) =>
|
|
551
|
-
removeServer: (e) =>
|
|
552
|
-
}), h((e) =>
|
|
553
|
-
function
|
|
462
|
+
addServer: (e, t) => M.getInstance().trackClientAddServer(e, t).catch(() => void 0),
|
|
463
|
+
removeServer: (e) => M.getInstance().trackClientRemoveServer(e).catch(() => void 0)
|
|
464
|
+
}), h((e) => M.getInstance().trackConnectorInit(e).catch(() => void 0));
|
|
465
|
+
function F(e) {
|
|
554
466
|
let t = () => {
|
|
555
467
|
throw Error(`Invalid url to pass to open(): ${e}`);
|
|
556
468
|
}, n;
|
|
@@ -559,12 +471,12 @@ function z(e) {
|
|
|
559
471
|
} catch {
|
|
560
472
|
t();
|
|
561
473
|
}
|
|
562
|
-
return n.protocol !== "https:" && n.protocol !== "http:" && t(), n.hostname !== encodeURIComponent(n.hostname) && t(), n.username &&= encodeURIComponent(n.username), n.password &&= encodeURIComponent(n.password), n.pathname = n.pathname.slice(0, 1) + encodeURIComponent(n.pathname.slice(1)).replace(/%2f/gi, "/"), n.search = n.search.slice(0, 1) + Array.from(n.searchParams.entries()).map(
|
|
474
|
+
return n.protocol !== "https:" && n.protocol !== "http:" && t(), n.hostname !== encodeURIComponent(n.hostname) && t(), n.username &&= encodeURIComponent(n.username), n.password &&= encodeURIComponent(n.password), n.pathname = n.pathname.slice(0, 1) + encodeURIComponent(n.pathname.slice(1)).replace(/%2f/gi, "/"), n.search = n.search.slice(0, 1) + Array.from(n.searchParams.entries()).map(I).join("&"), n.hash = n.hash.slice(0, 1) + encodeURIComponent(n.hash.slice(1)), n.href;
|
|
563
475
|
}
|
|
564
|
-
function
|
|
476
|
+
function I([e, t]) {
|
|
565
477
|
return `${encodeURIComponent(e)}${t.length > 0 ? `=${encodeURIComponent(t)}` : ""}`;
|
|
566
478
|
}
|
|
567
|
-
var
|
|
479
|
+
var L = class {
|
|
568
480
|
get(e) {
|
|
569
481
|
return localStorage.getItem(e);
|
|
570
482
|
}
|
|
@@ -582,7 +494,7 @@ var xe = class {
|
|
|
582
494
|
}
|
|
583
495
|
return e;
|
|
584
496
|
}
|
|
585
|
-
},
|
|
497
|
+
}, R = class e {
|
|
586
498
|
serverUrl;
|
|
587
499
|
storageKeyPrefix;
|
|
588
500
|
serverUrlHash;
|
|
@@ -595,7 +507,7 @@ var xe = class {
|
|
|
595
507
|
store;
|
|
596
508
|
allowClientSecret;
|
|
597
509
|
constructor(n, r, i) {
|
|
598
|
-
t(r.clientMetadataUrl), this.serverUrl = n, this.storageKeyPrefix = r.storageKeyPrefix || "mcp:auth", this.serverUrlHash = e.hashString(n), this.clientName = r.clientName || "mcp-use", this.clientUri = r.clientUri || (typeof window < "u" ? window.location.origin : "https://mcp-use.com"), this.logoUri = r.logoUri || "https://mcp-use.com/logo.png", this.callbackUrl =
|
|
510
|
+
t(r.clientMetadataUrl), this.serverUrl = n, this.storageKeyPrefix = r.storageKeyPrefix || "mcp:auth", this.serverUrlHash = e.hashString(n), this.clientName = r.clientName || "mcp-use", this.clientUri = r.clientUri || (typeof window < "u" ? window.location.origin : "https://mcp-use.com"), this.logoUri = r.logoUri || "https://mcp-use.com/logo.png", this.callbackUrl = F(r.callbackUrl || (typeof window < "u" ? new URL("/oauth/callback", window.location.origin).toString() : "/oauth/callback")), this.clientMetadataUrl = r.clientMetadataUrl, this.scope = r.scope, this.store = i, this.allowClientSecret = r.allowClientSecret ?? !0;
|
|
599
511
|
}
|
|
600
512
|
getKey(e) {
|
|
601
513
|
return `${this.storageKeyPrefix}_${this.serverUrlHash}_${e}`;
|
|
@@ -751,14 +663,18 @@ var xe = class {
|
|
|
751
663
|
returnUrl: t.returnUrl
|
|
752
664
|
};
|
|
753
665
|
e.searchParams.set("state", n);
|
|
754
|
-
let a =
|
|
666
|
+
let a = F(e.toString());
|
|
755
667
|
return await this.store.set(r, JSON.stringify(i)), await this.store.set(this.getKey("last_auth_url"), a), a;
|
|
756
668
|
}
|
|
757
669
|
async getTokenEndpoint() {
|
|
758
670
|
return (await this.discoveryState())?.authorizationServerMetadata?.token_endpoint ?? null;
|
|
759
671
|
}
|
|
672
|
+
async getResource() {
|
|
673
|
+
let e = (await this.discoveryState())?.resourceMetadata?.resource;
|
|
674
|
+
return typeof e == "string" ? e : null;
|
|
675
|
+
}
|
|
760
676
|
};
|
|
761
|
-
async function
|
|
677
|
+
async function z(e) {
|
|
762
678
|
return typeof e == "string" ? e : e instanceof URLSearchParams || e instanceof FormData ? Object.fromEntries(e.entries()) : e instanceof Blob ? await e.text() : e;
|
|
763
679
|
}
|
|
764
680
|
var B = class {
|
|
@@ -773,10 +689,10 @@ var B = class {
|
|
|
773
689
|
onPopupWindow;
|
|
774
690
|
constructor(e, t = {}) {
|
|
775
691
|
if (t.staticClientInfo?.client_secret) throw Error("Browser OAuth clients must be public clients; staticClientInfo.client_secret is not allowed.");
|
|
776
|
-
this.serverUrl = e, this.session = new
|
|
692
|
+
this.serverUrl = e, this.session = new R(e, {
|
|
777
693
|
...t,
|
|
778
694
|
allowClientSecret: !1
|
|
779
|
-
}, new
|
|
695
|
+
}, new L()), this.preventAutoAuth = t.preventAutoAuth, this.useRedirectFlow = t.useRedirectFlow, this.oauthProxyUrl = t.oauthProxyUrl, this.connectionUrl = t.connectionUrl, this.proxyOAuthRequests = t.proxyOAuthRequests ?? !0, this.staticClientInfo = t.staticClientInfo, this.onPopupWindow = t.onPopupWindow;
|
|
780
696
|
}
|
|
781
697
|
get storageKeyPrefix() {
|
|
782
698
|
return this.session.storageKeyPrefix;
|
|
@@ -862,7 +778,7 @@ var B = class {
|
|
|
862
778
|
} catch {}
|
|
863
779
|
return e;
|
|
864
780
|
}
|
|
865
|
-
let f = a?.body ? await
|
|
781
|
+
let f = a?.body ? await z(a.body) : void 0, p = await (await t(d, {
|
|
866
782
|
method: "POST",
|
|
867
783
|
headers: { "Content-Type": "application/json" },
|
|
868
784
|
body: JSON.stringify({
|
|
@@ -916,6 +832,9 @@ var B = class {
|
|
|
916
832
|
getTokenEndpoint() {
|
|
917
833
|
return this.session.getTokenEndpoint();
|
|
918
834
|
}
|
|
835
|
+
getResource() {
|
|
836
|
+
return this.session.getResource();
|
|
837
|
+
}
|
|
919
838
|
async getClientCredentials() {
|
|
920
839
|
let e = await this.clientInformation();
|
|
921
840
|
return e?.client_id ? { client_id: e.client_id } : null;
|
|
@@ -952,7 +871,7 @@ var B = class {
|
|
|
952
871
|
}
|
|
953
872
|
getLastAttemptedAuthUrl() {
|
|
954
873
|
let e = localStorage.getItem(this.getKey("last_auth_url"));
|
|
955
|
-
return e ?
|
|
874
|
+
return e ? F(e) : null;
|
|
956
875
|
}
|
|
957
876
|
clearStorage() {
|
|
958
877
|
let e = `${this.storageKeyPrefix}_${this.serverUrlHash}_`, t = `${this.storageKeyPrefix}:state_`, n = [], r = 0;
|
|
@@ -976,15 +895,15 @@ var B = class {
|
|
|
976
895
|
async function V(e, t = {}) {
|
|
977
896
|
return new B(e, t);
|
|
978
897
|
}
|
|
979
|
-
var
|
|
980
|
-
function
|
|
898
|
+
var H = "mcp_auth_callback", me = "mcp_auth_callback";
|
|
899
|
+
function U(e) {
|
|
981
900
|
try {
|
|
982
901
|
return typeof localStorage < "u" && !!localStorage.getItem(e);
|
|
983
902
|
} catch {
|
|
984
903
|
return !1;
|
|
985
904
|
}
|
|
986
905
|
}
|
|
987
|
-
function
|
|
906
|
+
function he({ popup: e, state: t, tokensKey: n, timeoutMs: r = 5 * 6e4, closePollMs: i = 1e3, closeGraceMs: a = 2e4, expectedOrigin: o = typeof window < "u" ? window.location.origin : "" }) {
|
|
988
907
|
return new Promise((s) => {
|
|
989
908
|
let c = !1, l = null, u = null, d = null, f = null, p = () => {
|
|
990
909
|
if (l &&= (clearInterval(l), null), u &&= (clearTimeout(u), null), d &&= (clearTimeout(d), null), typeof window < "u" && (window.removeEventListener("message", g), window.removeEventListener("storage", v)), f) {
|
|
@@ -996,7 +915,7 @@ function Ee({ popup: e, state: t, tokensKey: n, timeoutMs: r = 5 * 6e4, closePol
|
|
|
996
915
|
}, m = (e) => {
|
|
997
916
|
c || (c = !0, p(), s(e));
|
|
998
917
|
}, h = (e) => {
|
|
999
|
-
!e || e.type !==
|
|
918
|
+
!e || e.type !== me || e.state && t && e.state !== t || (e.success ? m({ kind: "success" }) : m({
|
|
1000
919
|
kind: "error",
|
|
1001
920
|
error: e.error ?? "Authentication failed in callback."
|
|
1002
921
|
}));
|
|
@@ -1008,7 +927,7 @@ function Ee({ popup: e, state: t, tokensKey: n, timeoutMs: r = 5 * 6e4, closePol
|
|
|
1008
927
|
e.key === n && e.newValue && m({ kind: "success" });
|
|
1009
928
|
};
|
|
1010
929
|
if (typeof window < "u" && (window.addEventListener("message", g), window.addEventListener("storage", v)), typeof BroadcastChannel < "u") try {
|
|
1011
|
-
f = new BroadcastChannel(
|
|
930
|
+
f = new BroadcastChannel(H), f.addEventListener("message", _);
|
|
1012
931
|
} catch {
|
|
1013
932
|
f = null;
|
|
1014
933
|
}
|
|
@@ -1021,34 +940,34 @@ function Ee({ popup: e, state: t, tokensKey: n, timeoutMs: r = 5 * 6e4, closePol
|
|
|
1021
940
|
t = !1;
|
|
1022
941
|
}
|
|
1023
942
|
if (t) {
|
|
1024
|
-
if (l &&= (clearInterval(l), null),
|
|
943
|
+
if (l &&= (clearInterval(l), null), U(n)) {
|
|
1025
944
|
m({ kind: "success" });
|
|
1026
945
|
return;
|
|
1027
946
|
}
|
|
1028
947
|
d = setTimeout(() => {
|
|
1029
|
-
m(
|
|
948
|
+
m(U(n) ? { kind: "success" } : { kind: "cancelled" });
|
|
1030
949
|
}, a);
|
|
1031
950
|
}
|
|
1032
951
|
}, i)), u = setTimeout(() => {
|
|
1033
|
-
m(
|
|
952
|
+
m(U(n) ? { kind: "success" } : { kind: "timeout" });
|
|
1034
953
|
}, r);
|
|
1035
954
|
});
|
|
1036
955
|
}
|
|
1037
|
-
var
|
|
1038
|
-
function
|
|
956
|
+
var ge = 5 * 6e4;
|
|
957
|
+
function W(e, t = 0) {
|
|
1039
958
|
if (!e || t > 5) return !1;
|
|
1040
959
|
if (e instanceof s) return !0;
|
|
1041
960
|
if (e instanceof Error) {
|
|
1042
961
|
if (e.code === 401 || e.name === "UnauthorizedError") return !0;
|
|
1043
962
|
let n = e.message ?? "";
|
|
1044
|
-
if (n.includes("401") || n.includes("Unauthorized") || e.cause &&
|
|
963
|
+
if (n.includes("401") || n.includes("Unauthorized") || e.cause && W(e.cause, t + 1)) return !0;
|
|
1045
964
|
let r = e.data;
|
|
1046
|
-
if (r?.cause &&
|
|
965
|
+
if (r?.cause && W(r.cause, t + 1)) return !0;
|
|
1047
966
|
}
|
|
1048
967
|
return !1;
|
|
1049
968
|
}
|
|
1050
|
-
async function
|
|
1051
|
-
let i = e, a = n.timeoutMs ??
|
|
969
|
+
async function G(e, t, n = {}) {
|
|
970
|
+
let i = e, a = n.timeoutMs ?? ge, o = n.fetchFn ?? i.getProxyFetch?.() ?? void 0;
|
|
1052
971
|
if (!i.hasPendingFlow) {
|
|
1053
972
|
let n = await r(e, {
|
|
1054
973
|
serverUrl: t,
|
|
@@ -1065,9 +984,9 @@ async function W(e, t, n = {}) {
|
|
|
1065
984
|
});
|
|
1066
985
|
return;
|
|
1067
986
|
}
|
|
1068
|
-
await
|
|
987
|
+
await _e(i, a);
|
|
1069
988
|
}
|
|
1070
|
-
async function
|
|
989
|
+
async function _e(e, t) {
|
|
1071
990
|
if (typeof window > "u") throw Error("OAuth redirect requires a browser environment or a provider with getAuthorizationCode()");
|
|
1072
991
|
if (e.useRedirectFlow) return;
|
|
1073
992
|
let n = e.getKey?.("tokens");
|
|
@@ -1076,7 +995,7 @@ async function G(e, t) {
|
|
|
1076
995
|
if (i) try {
|
|
1077
996
|
r = new URL(i).searchParams.get("state");
|
|
1078
997
|
} catch {}
|
|
1079
|
-
let a = await
|
|
998
|
+
let a = await he({
|
|
1080
999
|
popup: null,
|
|
1081
1000
|
state: r,
|
|
1082
1001
|
tokensKey: n,
|
|
@@ -1090,21 +1009,21 @@ async function G(e, t) {
|
|
|
1090
1009
|
default: throw Error("Unexpected OAuth popup result");
|
|
1091
1010
|
}
|
|
1092
1011
|
}
|
|
1093
|
-
var
|
|
1094
|
-
function
|
|
1012
|
+
var ve = "http://json-schema.org/draft-04/schema", ye = /* @__PURE__ */ new Set(["http://json-schema.org/draft-07/schema", "https://json-schema.org/draft-07/schema"]), be = /* @__PURE__ */ new Set(["https://json-schema.org/draft/2019-09/schema", "http://json-schema.org/draft/2019-09/schema"]), xe = /* @__PURE__ */ new Set(["https://json-schema.org/draft/2020-12/schema", "http://json-schema.org/draft/2020-12/schema"]);
|
|
1013
|
+
function Se(e) {
|
|
1095
1014
|
if (!("$schema" in e) || typeof e.$schema != "string") return "2020-12";
|
|
1096
1015
|
let t = e.$schema.replace(/#$/, "");
|
|
1097
|
-
if (t ===
|
|
1098
|
-
if (
|
|
1099
|
-
if (
|
|
1100
|
-
if (
|
|
1016
|
+
if (t === ve) return "4";
|
|
1017
|
+
if (ye.has(t)) return "7";
|
|
1018
|
+
if (be.has(t)) return "2019-09";
|
|
1019
|
+
if (xe.has(t)) return "2020-12";
|
|
1101
1020
|
}
|
|
1102
1021
|
var K = class {
|
|
1103
1022
|
getValidator(e) {
|
|
1104
|
-
let t =
|
|
1023
|
+
let t = Se(e);
|
|
1105
1024
|
return (t === void 0 ? new o() : new o({ draft: t })).getValidator(e);
|
|
1106
1025
|
}
|
|
1107
|
-
},
|
|
1026
|
+
}, Ce = { "~standard": {
|
|
1108
1027
|
version: 1,
|
|
1109
1028
|
vendor: "mcp-use",
|
|
1110
1029
|
validate: (e) => ({ value: e })
|
|
@@ -1370,7 +1289,7 @@ var K = class {
|
|
|
1370
1289
|
return b.debug(`Sending raw request '${e}' with params`, t), await this.client.request({
|
|
1371
1290
|
method: e,
|
|
1372
1291
|
params: t ?? {}
|
|
1373
|
-
},
|
|
1292
|
+
}, Ce, n);
|
|
1374
1293
|
}
|
|
1375
1294
|
async cleanupResources() {
|
|
1376
1295
|
let e = [];
|
|
@@ -1403,7 +1322,7 @@ function J(e, t = 0) {
|
|
|
1403
1322
|
}
|
|
1404
1323
|
return !1;
|
|
1405
1324
|
}
|
|
1406
|
-
function
|
|
1325
|
+
function we(e, t, n, r) {
|
|
1407
1326
|
let i = new URL(e), a = t.replace(/\/$/, "");
|
|
1408
1327
|
return async (e, t) => {
|
|
1409
1328
|
let o = new Request(e, t), s = new URL(o.url);
|
|
@@ -1437,7 +1356,7 @@ var Y = class extends q {
|
|
|
1437
1356
|
let n = e.replace(/\/$/, "");
|
|
1438
1357
|
this.baseUrl = n, this.headers = { ...t.headers ?? {} }, this.gatewayUrl = t.gatewayUrl, this.serverId = t.serverId, t.authToken && (this.headers.Authorization = `Bearer ${t.authToken}`), this.timeout = t.timeout ?? 1e4;
|
|
1439
1358
|
let r = t.fetch ?? globalThis.fetch.bind(globalThis);
|
|
1440
|
-
this.customFetch = this.gatewayUrl ?
|
|
1359
|
+
this.customFetch = this.gatewayUrl ? we(n, this.gatewayUrl, r, this.serverId) : t.fetch, this.clientInfo = t.clientInfo ?? {
|
|
1441
1360
|
name: "http-connector",
|
|
1442
1361
|
version: "1.0.0"
|
|
1443
1362
|
}, this.protocolNegotiation = t.protocolNegotiation ?? "auto", this.reconnectionOptions = t.reconnectionOptions;
|
|
@@ -1665,7 +1584,7 @@ function Z(e) {
|
|
|
1665
1584
|
}
|
|
1666
1585
|
return !0;
|
|
1667
1586
|
}
|
|
1668
|
-
function
|
|
1587
|
+
function Te() {
|
|
1669
1588
|
return {
|
|
1670
1589
|
name: "mcp-use",
|
|
1671
1590
|
title: "mcp-use",
|
|
@@ -1676,7 +1595,7 @@ function Fe() {
|
|
|
1676
1595
|
};
|
|
1677
1596
|
}
|
|
1678
1597
|
function Q(e) {
|
|
1679
|
-
let t =
|
|
1598
|
+
let t = Te();
|
|
1680
1599
|
if (!e || typeof e != "object") return t;
|
|
1681
1600
|
let n = e;
|
|
1682
1601
|
return !n.name || !n.version ? t : {
|
|
@@ -1779,10 +1698,10 @@ var $ = class {
|
|
|
1779
1698
|
return this.connector.request(e, t, n);
|
|
1780
1699
|
}
|
|
1781
1700
|
};
|
|
1782
|
-
function
|
|
1701
|
+
function Ee(e) {
|
|
1783
1702
|
return !!e && typeof e == "object" && "redirectUrl" in e && "clientMetadata" in e;
|
|
1784
1703
|
}
|
|
1785
|
-
var
|
|
1704
|
+
var De = class {
|
|
1786
1705
|
config = {};
|
|
1787
1706
|
sessions = {};
|
|
1788
1707
|
activeSessions = [];
|
|
@@ -1817,7 +1736,7 @@ var Le = class {
|
|
|
1817
1736
|
...r,
|
|
1818
1737
|
authProvider: i
|
|
1819
1738
|
};
|
|
1820
|
-
} else "authProvider" in r && r.authProvider &&
|
|
1739
|
+
} else "authProvider" in r && r.authProvider && Ee(r.authProvider) && (i = r.authProvider);
|
|
1821
1740
|
let a = async () => {
|
|
1822
1741
|
let e = new $(await Promise.resolve(this.createConnectorFromConfig(r)));
|
|
1823
1742
|
return t && await e.initialize(), e;
|
|
@@ -1826,8 +1745,8 @@ var Le = class {
|
|
|
1826
1745
|
o = await a();
|
|
1827
1746
|
} catch (n) {
|
|
1828
1747
|
let s = r;
|
|
1829
|
-
if (!t || !i || !("url" in s) || !
|
|
1830
|
-
b.info(`[MCPClient] Unauthorized connecting to '${e}'; completing OAuth\u2026`), await
|
|
1748
|
+
if (!t || !i || !("url" in s) || !W(n) || i.preventAutoAuth) throw n;
|
|
1749
|
+
b.info(`[MCPClient] Unauthorized connecting to '${e}'; completing OAuth\u2026`), await G(i, s.url), o = await a();
|
|
1831
1750
|
}
|
|
1832
1751
|
return this.sessions[e] = o, this.activeSessions.includes(e) || this.activeSessions.push(e), o;
|
|
1833
1752
|
}
|
|
@@ -1882,9 +1801,9 @@ var Le = class {
|
|
|
1882
1801
|
await this.closeAllSessions();
|
|
1883
1802
|
}
|
|
1884
1803
|
};
|
|
1885
|
-
function
|
|
1804
|
+
function Oe(e) {
|
|
1886
1805
|
let t = Object.keys(e.mcpServers ?? {});
|
|
1887
|
-
|
|
1806
|
+
N.getInstance().trackMCPClientInit({
|
|
1888
1807
|
codeMode: !1,
|
|
1889
1808
|
sandbox: !1,
|
|
1890
1809
|
allCallbacks: !1,
|
|
@@ -1894,12 +1813,12 @@ function Re(e) {
|
|
|
1894
1813
|
isBrowser: !0
|
|
1895
1814
|
}).catch((e) => b.debug(`Failed to track BrowserMCPClient init: ${e}`));
|
|
1896
1815
|
}
|
|
1897
|
-
var
|
|
1816
|
+
var ke = class e extends De {
|
|
1898
1817
|
static getPackageVersion() {
|
|
1899
1818
|
return S();
|
|
1900
1819
|
}
|
|
1901
1820
|
constructor(e) {
|
|
1902
|
-
super(e),
|
|
1821
|
+
super(e), Oe(this.config);
|
|
1903
1822
|
}
|
|
1904
1823
|
static fromDict(t) {
|
|
1905
1824
|
return new e(t);
|
|
@@ -1931,4 +1850,4 @@ var ze = class e extends Le {
|
|
|
1931
1850
|
}
|
|
1932
1851
|
};
|
|
1933
1852
|
//#endregion
|
|
1934
|
-
export {
|
|
1853
|
+
export { P as i, l as n, b as r, N as t };
|