decocms 2.176.0 → 2.176.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-PBJUtpjc.js → AlertCircle-BWr4XQe9.js} +1 -1
- package/dist/client/assets/{AlignLeft-CddYwC43.js → AlignLeft-BJyvDaBk.js} +1 -1
- package/dist/client/assets/{ArrowDown-LiBnMzQV.js → ArrowDown-BPMtK04S.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BHzi0YLf.js → ArrowLeft-GOjXvqCa.js} +1 -1
- package/dist/client/assets/{ArrowUp-WIHiBhdv.js → ArrowUp-DqOjcDuh.js} +1 -1
- package/dist/client/assets/{Building02-c7FCt8-6.js → Building02-D_v8ZXC2.js} +1 -1
- package/dist/client/assets/{Check-Bme4aNg5.js → Check-DAFdA2oM.js} +1 -1
- package/dist/client/assets/{CheckCircle-BSVa-h_Y.js → CheckCircle-BL2mIAJn.js} +1 -1
- package/dist/client/assets/{CheckVerified02-e9BOcL0K.js → CheckVerified02-YYsvmiw4.js} +1 -1
- package/dist/client/assets/{ChevronDown-jyPVRLzp.js → ChevronDown-C-3qjfHK.js} +1 -1
- package/dist/client/assets/{ChevronLeft-Bn35AKxx.js → ChevronLeft-Dugo1z8_.js} +1 -1
- package/dist/client/assets/{ChevronRight-Ct9VK1GH.js → ChevronRight-B3gSyJmK.js} +1 -1
- package/dist/client/assets/{ChevronUp-B5BOcmGB.js → ChevronUp-Rk5dLXNx.js} +1 -1
- package/dist/client/assets/{Clock-Bwl2wOhM.js → Clock-Ccv6eV04.js} +1 -1
- package/dist/client/assets/{Code01-DygQPwlG.js → Code01-CoEt5nyY.js} +1 -1
- package/dist/client/assets/{Container-BeAIfNvy.js → Container-CQmXt7Nc.js} +1 -1
- package/dist/client/assets/{Copy01-ekqsSfJN.js → Copy01-D7uh0hW0.js} +1 -1
- package/dist/client/assets/{Dataflow03-BGqN1hrV.js → Dataflow03-ccC0qbkR.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-BYFCLgks.js → DotsHorizontal-C3QGwRko.js} +1 -1
- package/dist/client/assets/{DotsVertical-Dn5mVo7u.js → DotsVertical-D5tMnzaQ.js} +1 -1
- package/dist/client/assets/{Download01-DQJbGhrI.js → Download01-BDm0aKH5.js} +1 -1
- package/dist/client/assets/{Edit01-BxDvpu_b.js → Edit01-DEd4k1xo.js} +1 -1
- package/dist/client/assets/{Edit05-Bta0rpFO.js → Edit05-RRC6ol7j.js} +1 -1
- package/dist/client/assets/{Eye-DN-kY_sb.js → Eye-MRRTHIte.js} +1 -1
- package/dist/client/assets/{EyeOff-E0TupCAH.js → EyeOff-CgRP1cSC.js} +1 -1
- package/dist/client/assets/{File02-Cyzf2kpD.js → File02-DdRvGWJN.js} +1 -1
- package/dist/client/assets/{File06-Ba0KxpWu.js → File06-DbRSeish.js} +1 -1
- package/dist/client/assets/{FilterLines-Ce9H-AFe.js → FilterLines-nV8jE7JI.js} +1 -1
- package/dist/client/assets/{Globe01-Cks65mCV.js → Globe01-Bb7jNfEM.js} +1 -1
- package/dist/client/assets/{Globe02-CB2InS06.js → Globe02-CDBspixd.js} +1 -1
- package/dist/client/assets/{Grid01-BvWQ72pJ.js → Grid01-COkHqk9k.js} +1 -1
- package/dist/client/assets/{Home02-C33y4DXe.js → Home02-Bjdq3zLu.js} +1 -1
- package/dist/client/assets/{Image01-B9BH_f0p.js → Image01-D4-tispo.js} +1 -1
- package/dist/client/assets/{Inbox01-ZPruuuHz.js → Inbox01-DiWhz3sk.js} +1 -1
- package/dist/client/assets/{InfoCircle-ETSHVG2F.js → InfoCircle-tftxVx0C.js} +1 -1
- package/dist/client/assets/{Key01-CdH7i8vY.js → Key01-Cv0XYLbb.js} +1 -1
- package/dist/client/assets/{LayersTwo01-8gQGsURS.js → LayersTwo01-DdRcHsrK.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Bn9kcy6T.js → LayoutLeft-BuqgN7z4.js} +1 -1
- package/dist/client/assets/{Link01-B4s1G5Jr.js → Link01-Bo114MSv.js} +1 -1
- package/dist/client/assets/{LinkExternal01-B5VTVW6k.js → LinkExternal01-Div7VvWd.js} +1 -1
- package/dist/client/assets/{List-BU70NJSh.js → List-_Z2X7aPf.js} +1 -1
- package/dist/client/assets/{Loading01-Dt16NixZ.js → Loading01-BYjTtpy0.js} +1 -1
- package/dist/client/assets/{Lock01-DZeZ3WxC.js → Lock01-j13GCiRT.js} +1 -1
- package/dist/client/assets/{Play-WAyK_VUq.js → Play-BOK5c4Hp.js} +1 -1
- package/dist/client/assets/{Plus-DN4FtVmx.js → Plus-1vH_gFoY.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-B88e0cNw.js → RefreshCcw01-ghOVEWuz.js} +1 -1
- package/dist/client/assets/{Save01-BCInJWrH.js → Save01-43mxrIvD.js} +1 -1
- package/dist/client/assets/{SearchMd-BQseJVRu.js → SearchMd-Dn4cWwEm.js} +1 -1
- package/dist/client/assets/{Settings01-CS4vVmx5.js → Settings01-B3FNPQBg.js} +1 -1
- package/dist/client/assets/{Shield01-BZpNsAZG.js → Shield01-0suO3hAe.js} +1 -1
- package/dist/client/assets/{Terminal-BDeJ6lHB.js → Terminal-CvfSVl9m.js} +1 -1
- package/dist/client/assets/{Tool01-xNX6v26H.js → Tool01-3i6uRXKJ.js} +1 -1
- package/dist/client/assets/{Trash01-PnuUudMl.js → Trash01-Dmi4vR7Q.js} +1 -1
- package/dist/client/assets/{Upload01-CSDtabhZ.js → Upload01-Cqh5tD2o.js} +1 -1
- package/dist/client/assets/{Users03-rAyzQyh3.js → Users03-CUiUl0DH.js} +1 -1
- package/dist/client/assets/{X-CxZVsh3L.js → X-Car5B1de.js} +1 -1
- package/dist/client/assets/{XClose-hdsxwv2G.js → XClose-D08ltwBw.js} +1 -1
- package/dist/client/assets/{Zap-azdz5wfI.js → Zap-CbjhdbUU.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-XZw5-X3u.js → agent-connections-preview-Dv4euUYL.js} +1 -1
- package/dist/client/assets/{agent-detail-BJSxCMs1.js → agent-detail-BignzT6b.js} +1 -1
- package/dist/client/assets/{agents-DQWRQl2B.js → agents-DRDlT25N.js} +1 -1
- package/dist/client/assets/{ai-providers-logos-DPOiBl7V.js → ai-providers-logos-4n_w8l7D.js} +1 -1
- package/dist/client/assets/{alert-dialog-DdwA_v8c.js → alert-dialog-BZtQAioB.js} +1 -1
- package/dist/client/assets/{auth-catchall-WCsr2pQN.js → auth-catchall-BorI3Y5Q.js} +1 -1
- package/dist/client/assets/{automation-detail-BZk6VK2r.js → automation-detail-MAP63xhb.js} +1 -1
- package/dist/client/assets/{automations-B0oZ4Oep.js → automations-CXEh0WQH.js} +1 -1
- package/dist/client/assets/{avatar-CXKBBJaI.js → avatar-DEdDAQ0j.js} +1 -1
- package/dist/client/assets/{badge-BfLRgdaW.js → badge-BTw8dF6C.js} +1 -1
- package/dist/client/assets/{binder-B5Q0NNkg.js → binder-B2xnCBeC.js} +1 -1
- package/dist/client/assets/{breadcrumb-BhQI8Xw3.js → breadcrumb-CcE89MsN.js} +1 -1
- package/dist/client/assets/{card-B8QXMrj8.js → card-B6XTMOTf.js} +1 -1
- package/dist/client/assets/{checkbox-C5Om9oxx.js → checkbox-BA_JFbx4.js} +1 -1
- package/dist/client/assets/{collapsible-MCSgly5t.js → collapsible-CW12HasT.js} +1 -1
- package/dist/client/assets/{collection-detail-CrytnlOI.js → collection-detail-DTZ81ye0.js} +1 -1
- package/dist/client/assets/{collection-display-button-D7NovPlc.js → collection-display-button-BJQ_VSFQ.js} +1 -1
- package/dist/client/assets/{collection-search-DDX1Zkg7.js → collection-search-D6ILFEtf.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-YGokzak8.js → collection-table-wrapper-D0JGm79B.js} +1 -1
- package/dist/client/assets/{collection-tabs-D8NPXaOU.js → collection-tabs-fsXO7rse.js} +1 -1
- package/dist/client/assets/{command-BVlE6-p8.js → command-DwfoahUI.js} +1 -1
- package/dist/client/assets/{connection-card-D0Hulz9h.js → connection-card-CoZ_ixiG.js} +1 -1
- package/dist/client/assets/{connection-detail-C-Ge5CVn.js → connection-detail-BPi4jlBF.js} +1 -1
- package/dist/client/assets/{connection-status-CxcA3Thg.js → connection-status-CulzjjXt.js} +1 -1
- package/dist/client/assets/{connections-DWyHpNQR.js → connections-2fSWPLii.js} +1 -1
- package/dist/client/assets/{constants-CKGlP4oN.js → constants-CLw0F8Mm.js} +1 -1
- package/dist/client/assets/constants-D3bMpbG0.js +1 -0
- package/dist/client/assets/{context-ow-zK3BP.js → context-ClUgEsLK.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CFn_U9MK.js → create-organization-dialog-CNZiViYc.js} +1 -1
- package/dist/client/assets/{create-project-dialog-Rt5_XeVq.js → create-project-dialog-QYAKiAC_.js} +1 -1
- package/dist/client/assets/{danger-CgzhgW7h.js → danger-1mM9iHWV.js} +1 -1
- package/dist/client/assets/{danger-zone-CvDs5VVH.js → danger-zone-DSO2EIjr.js} +1 -1
- package/dist/client/assets/{dependencies-BbmKfxYe.js → dependencies-DtSMIESZ.js} +1 -1
- package/dist/client/assets/{dialog-COv8XUO0.js → dialog-ZIc7OUaM.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Cr1iKfFo.js → dropdown-menu-EcTFyr4x.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-BIVc19gr.js → dynamic-plugin-layout-D40fWFup.js} +1 -1
- package/dist/client/assets/{editable-task-title-CrGgc8Hx.js → editable-task-title-CeJC7Fwa.js} +1 -1
- package/dist/client/assets/{empty-state-DsQ7yRoE.js → empty-state-gZUVmgL7.js} +1 -1
- package/dist/client/assets/{empty-state-CsEI90cv.js → empty-state-m7QcZ687.js} +1 -1
- package/dist/client/assets/{env-vars-editor-r00KzDtj.js → env-vars-editor-CIM7XauD.js} +1 -1
- package/dist/client/assets/{extract-connection-data-D46U8dB4.js → extract-connection-data-DEaEvOm7.js} +1 -1
- package/dist/client/assets/{file-browser-C8BCEBfL.js → file-browser-ChPNBU91.js} +2 -2
- package/dist/client/assets/{form-CZrleug2.js → form-Cd_AEgzv.js} +1 -1
- package/dist/client/assets/{general-39EgW9sq.js → general-mH6Dkpor.js} +1 -1
- package/dist/client/assets/{grid-view-CYvRmpTY.js → grid-view-C9tD8dqF.js} +1 -1
- package/dist/client/assets/{home-CwDvuqcO.js → home-icifeNIm.js} +1 -1
- package/dist/client/assets/{index-cEL2CgNm.js → index-BPs3Pxaa.js} +1 -1
- package/dist/client/assets/{index-Bc75bxbq.js → index-Bg2XE05Y.js} +1 -1
- package/dist/client/assets/{index-B23wyLB_.js → index-BrqeZa9X.js} +1 -1
- package/dist/client/assets/{index-DRLd-piX.js → index-CRi6734Z.js} +1 -1
- package/dist/client/assets/{index-CVyJGNS2.js → index-CfjT_Fv-.js} +1 -1
- package/dist/client/assets/{index-CT-515LV.js → index-Cg4edYBM.js} +1 -1
- package/dist/client/assets/{index-sEMWxAyS.js → index-Cz_J9f63.js} +1 -1
- package/dist/client/assets/{index-CsqngJxb.js → index-DKWOGpkx.js} +1 -1
- package/dist/client/assets/{index-BlBXXIdz.js → index-Dk4FCobs.js} +1 -1
- package/dist/client/assets/{index-iqPDmcBY.js → index-DxqOk4x4.js} +1 -1
- package/dist/client/assets/{index-B_DxRVw1.js → index-OyLnxARk.js} +3 -3
- package/dist/client/assets/{infiniteQueryObserver-DNhlrWmr.js → infiniteQueryObserver-BkZg7AVk.js} +1 -1
- package/dist/client/assets/{input-DqwWeNgs.js → input-B4YrZuiK.js} +1 -1
- package/dist/client/assets/{integration-icon-Dv0HduyT.js → integration-icon-B3aufi6R.js} +1 -1
- package/dist/client/assets/{label--AQoxbpU.js → label-BoRKSV_h.js} +1 -1
- package/dist/client/assets/{layout-Cji69-Fr.js → layout-C2-eT_B4.js} +1 -1
- package/dist/client/assets/{layout-CDyeWvbl.js → layout-DwPAPIK-.js} +1 -1
- package/dist/client/assets/{login-D1A8YvmQ.js → login-CYxKPB-k.js} +1 -1
- package/dist/client/assets/{logo-upload-BlIbeyor.js → logo-upload-DsXuRpYi.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-D7CJTHIn.js → mcp-app-renderer-KZyUYhBW.js} +1 -1
- package/dist/client/assets/{mcp-server-card-PhaJL10h.js → mcp-server-card-mO0UAT9W.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-BInJ9Okh.js → mcp-server-detail-CyByMkle.js} +2 -2
- package/dist/client/assets/{members-WK1ZXtTy.js → members-3oNbzlXC.js} +1 -1
- package/dist/client/assets/{monaco-editor-Dgc89AWr.js → monaco-editor-DDZgyrgO.js} +1 -1
- package/dist/client/assets/{monitoring-Co1Fc87j.js → monitoring-Xs5hJ6u_.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-edit-BllFPC-c.js → monitoring-dashboard-edit-C_1U7sTf.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-CztiwjLo.js → monitoring-dashboard-view-DcMyYV2C.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-C4WAOhN_.js → monitoring-stats-row-CIKRC_fM.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Bcscfh1C.js → oauth-callback-ai-provider-CX0oMmvR.js} +1 -1
- package/dist/client/assets/{oauth-callback-oApNt2lX.js → oauth-callback-kezpwk-4.js} +1 -1
- package/dist/client/assets/{org-ai-providers-BHi1kOOt.js → org-ai-providers-dfJpkNdu.js} +1 -1
- package/dist/client/assets/{page-Dpk4jTO5.js → page-Y307a-9q.js} +1 -1
- package/dist/client/assets/{page-BZV8vSMw.js → page-y0K-3s3k.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-BqFvCCv9.js → plugin-empty-state-BB0mg-1W.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-DGylhF1c.js → plugin-empty-state-DwyPPEO0.js} +1 -1
- package/dist/client/assets/{plugin-header-B9UGjso3.js → plugin-header-BMLNemwj.js} +1 -1
- package/dist/client/assets/{plugin-header-CMHji8Df.js → plugin-header-DNeIXlLi.js} +1 -1
- package/dist/client/assets/plugins-CVEdGukW.js +1 -0
- package/dist/client/assets/{popover-DOnHuwq3.js → popover-BKHsia9C.js} +1 -1
- package/dist/client/assets/{project-app-view-fPmiutKj.js → project-app-view-C7kPLPhi.js} +1 -1
- package/dist/client/assets/{project-layout-CDVw6pd9.js → project-layout-C_1_eCl-.js} +1 -1
- package/dist/client/assets/{project-plugins-DwwhiaLk.js → project-plugins-BgoKgZwd.js} +1 -1
- package/dist/client/assets/{projects-list-BY_yiyPl.js → projects-list-B3H-urrL.js} +1 -1
- package/dist/client/assets/{registry-layout-4qwa3Yrl.js → registry-layout-BHOAsCzG.js} +1 -1
- package/dist/client/assets/{registry-utils--TC_kKCq.js → registry-utils-D0qx2c0_.js} +1 -1
- package/dist/client/assets/{reset-password-ChK1U3PS.js → reset-password-o3nCvS90.js} +1 -1
- package/dist/client/assets/{resizable-DXBCOl3J.js → resizable-1OPd79St.js} +1 -1
- package/dist/client/assets/{save-actions-ChdDeTz6.js → save-actions-DQ0FV8E3.js} +1 -1
- package/dist/client/assets/{scroll-area-ACn8ZLYT.js → scroll-area-BSQHcCri.js} +1 -1
- package/dist/client/assets/{select-BM9jpLT2.js → select-Ctls6rHz.js} +1 -1
- package/dist/client/assets/{select-virtual-mcp-DzKjKtT5.js → select-virtual-mcp-CEX-N6yN.js} +1 -1
- package/dist/client/assets/{sheet-DCDIRpJJ.js → sheet-MAyp9_-H.js} +1 -1
- package/dist/client/assets/{shell-layout-BTXUcCYK.js → shell-layout-8MdYJa94.js} +2 -2
- package/dist/client/assets/{sidebar-settings-Dy0o9qBx.js → sidebar-settings-BtI4Obrm.js} +1 -1
- package/dist/client/assets/{skeleton-BkpiIfDB.js → skeleton-DAvz6Hk5.js} +1 -1
- package/dist/client/assets/{spinner-tJ67zxkj.js → spinner-CItj22uq.js} +1 -1
- package/dist/client/assets/{store-invite-CTVa-Zvm.js → store-invite-Dr9c1QQu.js} +1 -1
- package/dist/client/assets/{switch-BE6ziGyo.js → switch-BunRXVYQ.js} +1 -1
- package/dist/client/assets/{table-BOA7X4H8.js → table-DHN8Pbh9.js} +1 -1
- package/dist/client/assets/{tabs-BQ5doEBy.js → tabs-kzZLmFuM.js} +1 -1
- package/dist/client/assets/{task-status-B3QSknHK.js → task-status-D6cPLJpA.js} +1 -1
- package/dist/client/assets/tasks-CZAS_EEA.js +1 -0
- package/dist/client/assets/{tasks-panel-BXchRGWe.js → tasks-panel-6uv7gp5j.js} +1 -1
- package/dist/client/assets/{textarea-BDS2584p.js → textarea-CpLkXx5p.js} +1 -1
- package/dist/client/assets/{time-range-picker-CWEE6Pax.js → time-range-picker-CYn_bf9F.js} +1 -1
- package/dist/client/assets/{toggle-group-B9XVwguR.js → toggle-group-C-kSfPqI.js} +1 -1
- package/dist/client/assets/{tools-list-DO_G3ceo.js → tools-list-GuN2kaNF.js} +1 -1
- package/dist/client/assets/{tooltip-Bm11lCIm.js → tooltip--UA5heKX.js} +1 -1
- package/dist/client/assets/{topbar-portal-XGVG-nsS.js → topbar-portal-M3PPIThx.js} +1 -1
- package/dist/client/assets/{types-BnNswHwQ.js → types-DoomhLgW.js} +1 -1
- package/dist/client/assets/{use-automations-nu85KLSx.js → use-automations-D5ELbflL.js} +1 -1
- package/dist/client/assets/{use-collections-aokT1D_C.js → use-collections-DXLoMYCx.js} +1 -1
- package/dist/client/assets/{use-connection-DA77pjoV.js → use-connection-B7ll8uNa.js} +1 -1
- package/dist/client/assets/{use-copy-CPgIfOPM.js → use-copy-XD9UDj7l.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Dd303mOp.js → use-create-virtual-mcp-BvSTYw2n.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DXKnZJHX.js → use-infinite-scroll-CSG4wWka.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-C_csgcCs.js → use-install-from-registry-1KLotWZ_.js} +1 -1
- package/dist/client/assets/{use-list-state-CFQBiz4L.js → use-list-state-CVKHwo0P.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Dw4CvfV3.js → use-mcp-prompts-DyPVjaKa.js} +1 -1
- package/dist/client/assets/{use-mcp-resources-CFkkQw1d.js → use-mcp-resources-CFTlLllB.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-C3Vj1u8m.js → use-mcp-tools-S01H2JtZ.js} +1 -1
- package/dist/client/assets/{use-members-BbXqk449.js → use-members-BXkvGAIM.js} +1 -1
- package/dist/client/assets/{use-mobile-BarAf2zx.js → use-mobile-CgJAXGMs.js} +1 -1
- package/dist/client/assets/{use-project-CPyjDcpX.js → use-project-C2o9r0US.js} +1 -1
- package/dist/client/assets/{use-store-discovery-DupAMgFS.js → use-store-discovery-W6XcrfUT.js} +1 -1
- package/dist/client/assets/{use-view-mode-qVlfLymN.js → use-view-mode-CGzXYNrX.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-FAfRsySa.js → use-virtual-mcp-B8SbBr9v.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-C9KaycVy.js +1 -0
- package/dist/client/assets/{useMutation-d1AXy22c.js → useMutation-B_6d8oLI.js} +1 -1
- package/dist/client/assets/useQuery-Brtj4EoG.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DD7d1y3B.js +1 -0
- package/dist/client/assets/{user-z34A3977.js → user-BLAfg6Ev.js} +1 -1
- package/dist/client/assets/{workflow-D77B4RT7.js → workflow-DHe_PiQF.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +230 -230
- package/dist/server/node_modules/pg-int8/LICENSE +13 -0
- package/dist/server/node_modules/pg-int8/README.md +16 -0
- package/dist/server/node_modules/pg-int8/index.js +100 -0
- package/dist/server/node_modules/pg-int8/package.json +24 -0
- package/dist/server/node_modules/postgres-bytea/index.js +33 -0
- package/dist/server/node_modules/{xtend/LICENSE → postgres-bytea/license} +2 -1
- package/dist/server/node_modules/postgres-bytea/package.json +34 -0
- package/dist/server/node_modules/postgres-bytea/readme.md +34 -0
- package/dist/server/node_modules/postgres-date/index.js +116 -0
- package/dist/server/node_modules/{pg-connection-string/LICENSE → postgres-date/license} +5 -5
- package/dist/server/node_modules/postgres-date/package.json +33 -0
- package/dist/server/node_modules/postgres-date/readme.md +49 -0
- package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
- package/dist/server/node_modules/postgres-interval/index.js +125 -0
- package/dist/server/node_modules/{pg-cloudflare/LICENSE → postgres-interval/license} +6 -6
- package/dist/server/node_modules/postgres-interval/package.json +36 -0
- package/dist/server/node_modules/postgres-interval/readme.md +48 -0
- package/dist/server/node_modules/split2/LICENSE +13 -0
- package/dist/server/node_modules/split2/README.md +85 -0
- package/dist/server/node_modules/split2/bench.js +27 -0
- package/dist/server/node_modules/split2/index.js +141 -0
- package/dist/server/node_modules/split2/package.json +39 -0
- package/dist/server/node_modules/split2/test.js +409 -0
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/constants-DqZ0hFNm.js +0 -1
- package/dist/client/assets/plugins-DcIPR0Gj.js +0 -1
- package/dist/client/assets/tasks-BqsZZgtJ.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CCGqKrT7.js +0 -1
- package/dist/client/assets/useQuery-B8Io0Oda.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DsCmMd3U.js +0 -1
- package/dist/server/node_modules/pg-cloudflare/README.md +0 -112
- package/dist/server/node_modules/pg-cloudflare/dist/empty.d.ts +0 -2
- package/dist/server/node_modules/pg-cloudflare/dist/empty.js +0 -6
- package/dist/server/node_modules/pg-cloudflare/dist/empty.js.map +0 -1
- package/dist/server/node_modules/pg-cloudflare/dist/index.d.ts +0 -31
- package/dist/server/node_modules/pg-cloudflare/dist/index.js +0 -152
- package/dist/server/node_modules/pg-cloudflare/dist/index.js.map +0 -1
- package/dist/server/node_modules/pg-cloudflare/esm/index.mjs +0 -3
- package/dist/server/node_modules/pg-cloudflare/package.json +0 -39
- package/dist/server/node_modules/pg-cloudflare/src/empty.ts +0 -3
- package/dist/server/node_modules/pg-cloudflare/src/index.ts +0 -166
- package/dist/server/node_modules/pg-cloudflare/src/types.d.ts +0 -25
- package/dist/server/node_modules/pg-connection-string/README.md +0 -105
- package/dist/server/node_modules/pg-connection-string/esm/index.mjs +0 -8
- package/dist/server/node_modules/pg-connection-string/index.d.ts +0 -36
- package/dist/server/node_modules/pg-connection-string/index.js +0 -231
- package/dist/server/node_modules/pg-connection-string/package.json +0 -52
- package/dist/server/node_modules/pg-pool/LICENSE +0 -21
- package/dist/server/node_modules/pg-pool/README.md +0 -357
- package/dist/server/node_modules/pg-pool/esm/index.mjs +0 -5
- package/dist/server/node_modules/pg-pool/index.js +0 -517
- package/dist/server/node_modules/pg-pool/package.json +0 -51
- package/dist/server/node_modules/pg-protocol/LICENSE +0 -21
- package/dist/server/node_modules/pg-protocol/README.md +0 -3
- package/dist/server/node_modules/pg-protocol/dist/b.d.ts +0 -1
- package/dist/server/node_modules/pg-protocol/dist/b.js +0 -23
- package/dist/server/node_modules/pg-protocol/dist/b.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/buffer-reader.d.ts +0 -15
- package/dist/server/node_modules/pg-protocol/dist/buffer-reader.js +0 -55
- package/dist/server/node_modules/pg-protocol/dist/buffer-reader.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/buffer-writer.d.ts +0 -16
- package/dist/server/node_modules/pg-protocol/dist/buffer-writer.js +0 -81
- package/dist/server/node_modules/pg-protocol/dist/buffer-writer.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.d.ts +0 -1
- package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.js +0 -530
- package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/index.d.ts +0 -6
- package/dist/server/node_modules/pg-protocol/dist/index.js +0 -15
- package/dist/server/node_modules/pg-protocol/dist/index.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/messages.d.ts +0 -162
- package/dist/server/node_modules/pg-protocol/dist/messages.js +0 -160
- package/dist/server/node_modules/pg-protocol/dist/messages.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.d.ts +0 -1
- package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.js +0 -252
- package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/parser.d.ts +0 -24
- package/dist/server/node_modules/pg-protocol/dist/parser.js +0 -324
- package/dist/server/node_modules/pg-protocol/dist/parser.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/serializer.d.ts +0 -42
- package/dist/server/node_modules/pg-protocol/dist/serializer.js +0 -189
- package/dist/server/node_modules/pg-protocol/dist/serializer.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/esm/index.js +0 -11
- package/dist/server/node_modules/pg-protocol/package.json +0 -45
- package/dist/server/node_modules/pg-protocol/src/b.ts +0 -25
- package/dist/server/node_modules/pg-protocol/src/buffer-reader.ts +0 -58
- package/dist/server/node_modules/pg-protocol/src/buffer-writer.ts +0 -85
- package/dist/server/node_modules/pg-protocol/src/inbound-parser.test.ts +0 -575
- package/dist/server/node_modules/pg-protocol/src/index.ts +0 -11
- package/dist/server/node_modules/pg-protocol/src/messages.ts +0 -262
- package/dist/server/node_modules/pg-protocol/src/outbound-serializer.test.ts +0 -276
- package/dist/server/node_modules/pg-protocol/src/parser.ts +0 -413
- package/dist/server/node_modules/pg-protocol/src/serializer.ts +0 -274
- package/dist/server/node_modules/pg-protocol/src/testing/buffer-list.ts +0 -67
- package/dist/server/node_modules/pg-protocol/src/testing/test-buffers.ts +0 -166
- package/dist/server/node_modules/pg-protocol/src/types/chunky.d.ts +0 -1
- package/dist/server/node_modules/pg-types/.travis.yml +0 -7
- package/dist/server/node_modules/pg-types/Makefile +0 -14
- package/dist/server/node_modules/pg-types/README.md +0 -75
- package/dist/server/node_modules/pg-types/index.d.ts +0 -137
- package/dist/server/node_modules/pg-types/index.js +0 -47
- package/dist/server/node_modules/pg-types/index.test-d.ts +0 -21
- package/dist/server/node_modules/pg-types/lib/arrayParser.js +0 -11
- package/dist/server/node_modules/pg-types/lib/binaryParsers.js +0 -257
- package/dist/server/node_modules/pg-types/lib/builtins.js +0 -73
- package/dist/server/node_modules/pg-types/lib/textParsers.js +0 -215
- package/dist/server/node_modules/pg-types/package.json +0 -42
- package/dist/server/node_modules/pg-types/test/index.js +0 -24
- package/dist/server/node_modules/pg-types/test/types.js +0 -597
- package/dist/server/node_modules/pgpass/README.md +0 -74
- package/dist/server/node_modules/pgpass/lib/helper.js +0 -233
- package/dist/server/node_modules/pgpass/lib/index.js +0 -23
- package/dist/server/node_modules/pgpass/package.json +0 -41
- package/dist/server/node_modules/xtend/.jshintrc +0 -30
- package/dist/server/node_modules/xtend/README.md +0 -32
- package/dist/server/node_modules/xtend/immutable.js +0 -19
- package/dist/server/node_modules/xtend/mutable.js +0 -17
- package/dist/server/node_modules/xtend/package.json +0 -55
- package/dist/server/node_modules/xtend/test.js +0 -103
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,y as u,j as m}from"./index-
|
|
1
|
+
import{c as f,y as u,j as m}from"./index-OyLnxARk.js";import{B as g}from"./badge-BTw8dF6C.js";function h(x){const e=f.c(12),{tabs:l,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==l){let c;e[6]!==n||e[7]!==s?(c=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,y as m,j as n}from"./index-
|
|
1
|
+
import{c as r,y as m,j as n}from"./index-OyLnxARk.js";import{_ as d}from"./index-BrqeZa9X.js";import{i}from"./SearchMd-Dn4cWwEm.js";function x(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function g(l){const e=r.c(9);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(i,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let a;e[4]!==t?(a=m("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=a):a=e[5];let c;return e[6]!==s||e[7]!==a?(c=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(d.Input,{"data-slot":"command-input",className:a,...s})]}),e[6]=s,e[7]=a,e[8]=c):c=e[8],c}function h(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function N(l){const e=r.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(d.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function b(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function y(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}export{v as C,h as a,x as b,g as c,N as d,y as e,b as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as E,y as I,j as t}from"./index-
|
|
1
|
+
import{c as E,y as I,j as t}from"./index-OyLnxARk.js";import{C as P}from"./card-B6XTMOTf.js";import{I as R}from"./integration-icon-B3aufi6R.js";function B(h){const e=E.c(37),{connection:s,onClick:u,headerActions:j,headerActionsAlwaysVisible:A,body:v,footer:N,className:b,fallbackIcon:y}=h,C=A===void 0?!1:A,k=u&&"hover:bg-muted/50";let i;e[0]!==b||e[1]!==k?(i=I("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",k,b),e[0]=b,e[1]=k,e[2]=i):i=e[2];let l;e[3]!==s.icon||e[4]!==s.title||e[5]!==y?(l=t.jsx(R,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:y}),e[3]=s.icon,e[4]=s.title,e[5]=y,e[6]=l):l=e[6];let o;e[7]!==j||e[8]!==C?(o=j&&t.jsx("div",{className:I("transition-opacity",!C&&"opacity-0 group-hover:opacity-100"),onClick:_,children:j}),e[7]=j,e[8]=C,e[9]=o):o=e[9];let n;e[10]!==o?(n=t.jsx("div",{className:"relative",children:o}),e[10]=o,e[11]=n):n=e[11];let c;e[12]!==l||e[13]!==n?(c=t.jsxs("div",{className:"flex items-start justify-between",children:[l,n]}),e[12]=l,e[13]=n,e[14]=c):c=e[14];let r;e[15]!==s.title?(r=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:s.title}),e[15]=s.title,e[16]=r):r=e[16];const w=s.description||"No description";let a;e[17]!==w?(a=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:w}),e[17]=w,e[18]=a):a=e[18];let d;e[19]!==a||e[20]!==r?(d=t.jsxs("div",{className:"flex flex-col gap-1",children:[r,a]}),e[19]=a,e[20]=r,e[21]=d):d=e[21];let f;e[22]!==v?(f=v&&t.jsx("div",{children:v}),e[22]=v,e[23]=f):f=e[23];let m;e[24]!==d||e[25]!==f||e[26]!==c?(m=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[c,d,f]}),e[24]=d,e[25]=f,e[26]=c,e[27]=m):m=e[27];let x;e[28]!==N?(x=N&&t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:V,children:N})}),e[28]=N,e[29]=x):x=e[29];let p;e[30]!==m||e[31]!==x?(p=t.jsxs("div",{className:"flex flex-col flex-1",children:[m,x]}),e[30]=m,e[31]=x,e[32]=p):p=e[32];let g;return e[33]!==u||e[34]!==p||e[35]!==i?(g=t.jsx(P,{className:i,onClick:u,children:p}),e[33]=u,e[34]=p,e[35]=i,e[36]=g):g=e[36],g}function V(h){return h.stopPropagation()}function _(h){return h.stopPropagation()}export{B as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as B,c as A,u as Le,j as t,y as gt,x as jt,K as Qe,O as be,J as lt,e as Fe,B as ye,c4 as Ze,at as vt,p as bt,E as Nt,g as yt,w as _t,q as Ct,t as St,b as wt,a as kt,v as Ne}from"./index-B_DxRVw1.js";import{E as at}from"./empty-state-DsQ7yRoE.js";import{E as Tt,c as It,r as At,e as ct}from"./env-vars-editor-r00KzDtj.js";import{d as Dt}from"./registry-utils--TC_kKCq.js";import{n as $t,u as Pt,S as Ot}from"./index-cEL2CgNm.js";import{u as Mt,a as dt}from"./use-connection-DA77pjoV.js";import{u as qe,a as Vt}from"./constants-CKGlP4oN.js";import{d as Et}from"./use-mcp-tools-C3Vj1u8m.js";import{b as Ut}from"./use-mcp-resources-CFkkQw1d.js";import{a as Rt}from"./use-mcp-prompts-Dw4CvfV3.js";import{b as et,c as Lt,d as Ft,e as zt,B as Bt,a as Ht}from"./breadcrumb-BhQI8Xw3.js";import{b as Wt,d as Xt,c as Gt,A as Kt,e as Qt,h as qt,a as Jt,f as Yt}from"./alert-dialog-DdwA_v8c.js";import{S as Zt,a as es,b as ts,c as ss,d as ns}from"./sheet-DCDIRpJJ.js";import{F as U,b as R,c as L,d as M,f as F,e as os,a as rs}from"./form-CZrleug2.js";import{I as z}from"./input-DqwWeNgs.js";import{i as is}from"./Loading01-Dt16NixZ.js";import{a as ls}from"./layout-CDyeWvbl.js";import{c as as,C as cs,B as ds,a as ms,b as us,d as xs,e as ps}from"./monitoring-stats-row-C4WAOhN_.js";import{b as fs}from"./use-virtual-mcp-FAfRsySa.js";import{i as mt}from"./ChevronRight-Ct9VK1GH.js";import{t as ut}from"./Users03-rAyzQyh3.js";import{I as xt}from"./integration-icon-Dv0HduyT.js";import{T as Ee,a as hs,b as Ue,c as gs}from"./tabs-BQ5doEBy.js";import{a as js}from"./Tool01-xNX6v26H.js";import{g as Je}from"./types-BnNswHwQ.js";import{M as vs}from"./mcp-app-renderer-D7CJTHIn.js";import{C as bs}from"./collection-search-DDX1Zkg7.js";import{T as Ns}from"./tools-list-DO_G3ceo.js";import{C as ys}from"./card-B8QXMrj8.js";import{t as _s}from"./Settings01-CS4vVmx5.js";import{U as Cs}from"./user-z34A3977.js";import{f as Ss}from"./format-time-CMKyl-GC.js";import{B as ws}from"./badge-BfLRgdaW.js";import{D as ks,a as Ts,b as Is,c as tt}from"./dropdown-menu-Cr1iKfFo.js";import{S as st,a as nt,b as ot,c as rt,d as E}from"./select-BM9jpLT2.js";import{i as As}from"./CheckCircle-BSVa-h_Y.js";import{t as Ds}from"./ChevronDown-jyPVRLzp.js";import{n as $s}from"./Container-BeAIfNvy.js";import{s as Re}from"./Globe02-CB2InS06.js";import{s as Ps}from"./RefreshCcw01-B88e0cNw.js";import{i as Os}from"./Terminal-BDeJ6lHB.js";import{s as Ms}from"./Trash01-PnuUudMl.js";import{s as Vs}from"./XClose-hdsxwv2G.js";import"./Plus-DN4FtVmx.js";import"./binder-B5Q0NNkg.js";import"./File06-Ba0KxpWu.js";import"./Key01-CdH7i8vY.js";import"./constants-DqZ0hFNm.js";import"./extract-connection-data-D46U8dB4.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-C_csgcCs.js";import"./index-sEMWxAyS.js";import"./index-CT-515LV.js";import"./ChevronUp-B5BOcmGB.js";import"./index-B23wyLB_.js";import"./select-virtual-mcp-DzKjKtT5.js";import"./popover-DOnHuwq3.js";import"./tooltip-Bm11lCIm.js";import"./index-DRLd-piX.js";import"./Check-Bme4aNg5.js";import"./SearchMd-BQseJVRu.js";import"./use-create-virtual-mcp-Dd303mOp.js";import"./use-collections-aokT1D_C.js";import"./useMutation-d1AXy22c.js";import"./useQuery-B8Io0Oda.js";import"./X-CxZVsh3L.js";import"./label--AQoxbpU.js";import"./index-CsqngJxb.js";import"./collection-display-button-D7NovPlc.js";import"./ArrowDown-LiBnMzQV.js";import"./ArrowUp-WIHiBhdv.js";import"./Grid01-BvWQ72pJ.js";import"./List-BU70NJSh.js";import"./collection-table-wrapper-YGokzak8.js";import"./table-BOA7X4H8.js";import"./Eye-DN-kY_sb.js";import"./LayersTwo01-8gQGsURS.js";import"./avatar-CXKBBJaI.js";import"./differenceInSeconds-NQ4PDo0z.js";const pt=({size:s=24,color:e="currentColor",...n})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},B.createElement("path",{d:"m12 21-.1-.15c-.695-1.042-1.042-1.563-1.5-1.94a4 4 0 0 0-1.378-.737C8.453 18 7.827 18 6.575 18H5.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C2 16.48 2 15.92 2 14.8V6.2c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C3.52 3 4.08 3 5.2 3h.4c2.24 0 3.36 0 4.216.436a4 4 0 0 1 1.748 1.748C12 6.04 12 7.16 12 9.4M12 21V9.4M12 21l.1-.15c.695-1.042 1.042-1.563 1.5-1.94a3.999 3.999 0 0 1 1.378-.737C15.547 18 16.173 18 17.425 18H18.8c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 16.48 22 15.92 22 14.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 3 19.92 3 18.8 3h-.4c-2.24 0-3.36 0-4.216.436a4 4 0 0 0-1.748 1.748C12 6.04 12 7.16 12 9.4"}));pt.displayName="BookOpen01";const Es=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Us(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Rs={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Ls(s){const e=A.c(3),{connectionId:n,orgId:o,timeframe:r}=s;let i;e[0]!==o?(i={connectionId:Vt,orgId:o},e[0]=o,e[1]=i):i=e[1];const c=qe(i),a=Us(r),{data:m}=jt({queryKey:Qe.connectionActivity(n,r,o),queryFn:async()=>{const x=await c.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return x.structuredContent??x},staleTime:3e5}),d=as(m?.logs??[],a),u=d.data,p=d.totalCalls>0;let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[2]=l):l=e[2],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:d.totalCalls.toLocaleString()}),l]}),d.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:d.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),d.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(d.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),p?t.jsxs("div",{children:[t.jsx(cs,{config:Rs,className:"h-16 w-full",children:t.jsxs(ds,{data:u,barCategoryGap:"4%",children:[t.jsx(ms,{content:t.jsx(us,{labelFormatter:zs}),cursor:{fill:"var(--muted)"}}),t.jsx(xs,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(Fs)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Fs(s,e){return t.jsx(ps,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function zs(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function Bs(){const s=A.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function Hs(s){const e=A.c(13),{connectionId:n}=s,[o,r]=B.useState("14d"),{org:i}=Le();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=c):c=e[0];let a;e[1]!==o?(a=Es.map(l=>t.jsx("button",{type:"button",onClick:()=>r(l.value),className:gt("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",o===l.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:l.label},l.value)),e[1]=o,e[2]=a):a=e[2];let m;e[3]!==a?(m=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[c,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:a})]}),e[3]=a,e[4]=m):m=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Bs,{}),e[5]=d):d=e[5];let u;e[6]!==n||e[7]!==i.id||e[8]!==o?(u=t.jsx(B.Suspense,{fallback:d,children:t.jsx(Ls,{connectionId:n,orgId:i.id,timeframe:o})}),e[6]=n,e[7]=i.id,e[8]=o,e[9]=u):u=e[9];let p;return e[10]!==m||e[11]!==u?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,u]}),e[10]=m,e[11]=u,e[12]=p):p=e[12],p}function Ws(s){const e=A.c(14),{virtualMcp:n,org:o}=s;let r;e[0]!==o||e[1]!==n.id?(r={org:o,project:be,agentId:n.id},e[0]=o,e[1]=n.id,e[2]=r):r=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ut,{size:16}),e[3]=i):i=e[3];let c;e[4]!==n.icon||e[5]!==n.title?(c=t.jsx(xt,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:i}),e[4]=n.icon,e[5]=n.title,e[6]=c):c=e[6];let a;e[7]!==n.title?(a=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=a):a=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(mt,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=m):m=e[9];let d;return e[10]!==r||e[11]!==c||e[12]!==a?(d=t.jsxs(lt,{to:"/$org/$project/agents/$agentId/",params:r,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group",children:[c,a,m]}),e[10]=r,e[11]=c,e[12]=a,e[13]=d):d=e[13],d}function Xs(s){const e=A.c(7),{virtualMcps:n,org:o}=s;let r;if(e[0]!==o||e[1]!==n){let c;e[3]!==o?(c=a=>t.jsx(Ws,{virtualMcp:a,org:o},a.id),e[3]=o,e[4]=c):c=e[4],r=n.map(c),e[0]=o,e[1]=n,e[2]=r}else r=e[2];let i;return e[5]!==r?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=i):i=e[6],i}function Gs(s){const e=A.c(7),{connection:n}=s,{org:o}=Le();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const i=fs(r);if(!(i.length>0)){let d;return e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(t.Fragment,{}),e[2]=d):d=e[2],d}let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=a):a=e[3];let m;return e[4]!==o.slug||e[5]!==i?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[a,t.jsx("div",{className:"px-5 py-4",children:t.jsx(Xs,{virtualMcps:i,org:o.slug})})]}),e[4]=o.slug,e[5]=i,e[6]=m):m=e[6],m}function Ks(s){const e=A.c(27),{tools:n,connectionId:o,org:r}=s,i=Fe(),{org:c}=Le();let a;e[0]!==o||e[1]!==c.id?(a={connectionId:o,orgId:c.id},e[0]=o,e[1]=c.id,e[2]=a):a=e[2];const m=qe(a),[d,u]=B.useState("");let p,l,x,g;if(e[3]!==m||e[4]!==o||e[5]!==i||e[6]!==r||e[7]!==d||e[8]!==n){const S=(n??[]).filter(Qs),y=d.toLowerCase().trim(),v=y?S.filter(h=>h.name.toLowerCase().includes(y)||h.description&&h.description.toLowerCase().includes(y)):S;let T;e[13]!==o||e[14]!==i||e[15]!==r?(T=h=>{i({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:be,connectionId:o,collectionName:"tools",itemId:encodeURIComponent(h.name)}})},e[13]=o,e[14]=i,e[15]=r,e[16]=T):T=e[16];const w=T;x="flex flex-col h-full overflow-hidden";let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=h=>{h.key==="Escape"&&(u(""),h.target.blur())},e[17]=j):j=e[17],e[18]!==d?(g=t.jsx(bs,{value:d,onChange:u,placeholder:"Search apps...",onKeyDown:j}),e[18]=d,e[19]=g):g=e[19],p="flex-1 overflow-auto p-5",l=v.length===0?t.jsx(at,{image:null,title:d?"No apps found":"No apps available",description:d?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:v.map(h=>{const k=Je(h._meta);return t.jsxs(ys,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>w(h),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(vs,{resourceURI:k,toolInfo:{tool:h},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),t.jsx(Ns,{annotations:h.annotations,_meta:h._meta})]}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]})]},h.name)})}),e[3]=m,e[4]=o,e[5]=i,e[6]=r,e[7]=d,e[8]=n,e[9]=p,e[10]=l,e[11]=x,e[12]=g}else p=e[9],l=e[10],x=e[11],g=e[12];let b;e[20]!==p||e[21]!==l?(b=t.jsx("div",{className:p,children:l}),e[20]=p,e[21]=l,e[22]=b):b=e[22];let D;return e[23]!==x||e[24]!==g||e[25]!==b?(D=t.jsxs("div",{className:x,children:[g,b]}),e[23]=x,e[24]=g,e[25]=b,e[26]=D):D=e[26],D}function Qs(s){return!!Je(s._meta)}function ft(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=c=>c.charAt(0).toUpperCase()+c.slice(1),o=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),i=e[e.length-1];return r.length>=2&&i&&o.has(i)?[r.pop(),...r].join(" "):r.join(" ")}function Ke(s){const e=A.c(2),{label:n}=s;let o;return e[0]!==n?(o=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=o):o=e[1],o}function qs(s){const e=A.c(46),{tools:n,prompts:o,resources:r,connectionId:i,org:c}=s;let a;e[0]!==o?(a=o===void 0?[]:o,e[0]=o,e[1]=a):a=e[1];const m=a;let d;e[2]!==r?(d=r===void 0?[]:r,e[2]=r,e[3]=d):d=e[3];const u=d,p=Fe();let l;e[4]!==i||e[5]!==p||e[6]!==c?(l=function(O){!i||!c||p({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:c,project:be,connectionId:i,collectionName:"tools",itemId:encodeURIComponent(O)}})},e[4]=i,e[5]=p,e[6]=c,e[7]=l):l=e[7];const x=l;let g;e[8]!==i||e[9]!==c||e[10]!==n?(g=i&&c&&n.some(Zs),e[8]=i,e[9]=c,e[10]=n,e[11]=g):g=e[11];const b=g;if(n.length+m.length+u.length===0){let N;return e[12]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[12]=N):N=e[12],N}let S;e[13]!==n.length?(S=t.jsxs(Ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[13]=n.length,e[14]=S):S=e[14];let y;e[15]!==b?(y=b&&t.jsx(Ee,{value:"apps",variant:"underline",children:"UI"}),e[15]=b,e[16]=y):y=e[16];let v,T;e[17]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Ee,{value:"prompts",variant:"underline",children:"Prompts"}),v=t.jsx(Ee,{value:"resources",variant:"underline",children:"Resources"}),e[17]=v,e[18]=T):(v=e[17],T=e[18]);let w;e[19]!==S||e[20]!==y?(w=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(hs,{variant:"underline",className:"gap-1",children:[S,y,T,v]})}),e[19]=S,e[20]=y,e[21]=w):w=e[21];let j;e[22]!==x||e[23]!==n?(j=n.length>0?n.map(N=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>x(N.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(js,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:ft(N.name)}),N.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:N.description})]}),t.jsx(mt,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},N.name)):t.jsx(Ke,{label:"tools"}),e[22]=x,e[23]=n,e[24]=j):j=e[24];let h;e[25]!==j?(h=t.jsx(Ue,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:j})}),e[25]=j,e[26]=h):h=e[26];let k;e[27]!==i||e[28]!==b||e[29]!==c||e[30]!==n?(k=b&&t.jsx(Ue,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(Ks,{tools:n,connectionId:i,org:c})}),e[27]=i,e[28]=b,e[29]=c,e[30]=n,e[31]=k):k=e[31];let _;e[32]!==m?(_=m.length>0?m.map(Ys):t.jsx(Ke,{label:"prompts"}),e[32]=m,e[33]=_):_=e[33];let C;e[34]!==_?(C=t.jsx(Ue,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:_})}),e[34]=_,e[35]=C):C=e[35];let I;e[36]!==u?(I=u.length>0?u.map(Js):t.jsx(Ke,{label:"resources"}),e[36]=u,e[37]=I):I=e[37];let f;e[38]!==I?(f=t.jsx(Ue,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:I})}),e[38]=I,e[39]=f):f=e[39];let P;return e[40]!==w||e[41]!==h||e[42]!==k||e[43]!==C||e[44]!==f?(P=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(gs,{defaultValue:"tools",variant:"underline",children:[w,h,k,C,f]})}),e[40]=w,e[41]=h,e[42]=k,e[43]=C,e[44]=f,e[45]=P):P=e[45],P}function Js(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx($t,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function Ys(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(pt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:ft(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function Zs(s){return Je(s._meta)}function en(s){const e=A.c(22),{connection:n,onOpenSettings:o,onDisconnect:r}=s;let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(xt,{icon:n.icon,name:n.title,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let c;e[3]!==n.title?(c=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none",children:n.title})}),e[3]=n.title,e[4]=c):c=e[4];let a;e[5]!==n.description?(a=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:n.description}),e[5]=n.description,e[6]=a):a=e[6];let m;e[7]!==c||e[8]!==a?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,a]}),e[7]=c,e[8]=a,e[9]=m):m=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(_s,{size:15}),e[10]=d):d=e[10];let u;e[11]!==o?(u=t.jsx(ye,{variant:"ghost",size:"icon",onClick:o,title:"Configure connection",className:"h-8 w-8 text-muted-foreground hover:text-foreground",children:d}),e[11]=o,e[12]=u):u=e[12];let p;e[13]!==r?(p=t.jsx(ye,{variant:"outline",size:"sm",onClick:r,className:"text-destructive border-destructive/25 hover:bg-destructive/5 hover:text-destructive hover:border-destructive/40",children:"Disconnect"}),e[13]=r,e[14]=p):p=e[14];let l;e[15]!==u||e[16]!==p?(l=t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u,p]}),e[15]=u,e[16]=p,e[17]=l):l=e[17];let x;return e[18]!==i||e[19]!==m||e[20]!==l?(x=t.jsxs("div",{className:"flex items-center gap-6 py-7 px-8 bg-background border-b border-border shrink-0",children:[i,m,l]}),e[18]=i,e[19]=m,e[20]=l,e[21]=x):x=e[21],x}function tn(s){const e=A.c(21),{connection:n,onOpenSettings:o}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Connection"}),e[0]=r):r=e[0];let i;e[1]!==o?(i=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[r,t.jsx("button",{type:"button",onClick:o,className:"text-xs text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors cursor-pointer",children:"Configure"})]}),e[1]=o,e[2]=i):i=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("span",{className:"text-xs text-muted-foreground",children:"Added by"}),e[3]=c):c=e[3];let a;e[4]!==n.created_by?(a=t.jsxs("div",{className:"flex items-center justify-between",children:[c,t.jsx(Cs,{id:n.created_by,size:"2xs"})]}),e[4]=n.created_by,e[5]=a):a=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("span",{className:"text-xs text-muted-foreground",children:"Updated"}),e[6]=m):m=e[6];let d;e[7]!==n.updated_at?(d=n.updated_at?Ss(new Date(n.updated_at)):"—",e[7]=n.updated_at,e[8]=d):d=e[8];let u;e[9]!==d?(u=t.jsxs("div",{className:"flex items-center justify-between",children:[m,t.jsx("span",{className:"text-xs text-foreground",children:d})]}),e[9]=d,e[10]=u):u=e[10];let p;e[11]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("span",{className:"text-xs text-muted-foreground",children:"Protocol"}),e[11]=p):p=e[11];let l;e[12]!==n.connection_type?(l=t.jsxs("div",{className:"flex items-center justify-between",children:[p,t.jsx("span",{className:"text-xs font-mono text-foreground",children:n.connection_type})]}),e[12]=n.connection_type,e[13]=l):l=e[13];let x;e[14]!==a||e[15]!==u||e[16]!==l?(x=t.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[a,u,l]}),e[14]=a,e[15]=u,e[16]=l,e[17]=x):x=e[17];let g;return e[18]!==x||e[19]!==i?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[i,x]}),e[18]=x,e[19]=i,e[20]=g):g=e[20],g}function sn({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:r}){const i=Ze({control:s.control,name:"ui_type"}),c=Ze({control:s.control,name:"connection_url"}),{stdioEnabled:a}=vt(),m=(()=>{if(typeof c!="string"||!c)return!1;try{const l=new URL(c);return l.hostname==="api.githubcopilot.com"&&l.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),d=a||e.connection_type==="STDIO",u=e.connection_type==="VIRTUAL",p=u?bt(e.connection_url):null;return u?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(ut,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(U,{control:s.control,name:"ui_type",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(L,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),i!=="NPX"&&i!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(st,{value:l.value,onValueChange:l.onChange,children:[t.jsx(M,{children:t.jsxs(nt,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(Re,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(ot,{})]})}),t.jsxs(rt,{children:[t.jsx(E,{value:"HTTP",children:"HTTP"}),t.jsx(E,{value:"SSE",children:"SSE"}),t.jsx(E,{value:"Websocket",children:"Websocket"}),d&&t.jsxs(t.Fragment,{children:[t.jsx(E,{value:"NPX",children:"NPX Package"}),t.jsx(E,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(U,{control:s.control,name:"connection_url",render:({field:x})=>t.jsx(R,{className:"flex-1 min-w-0",children:t.jsx(M,{children:t.jsx(z,{placeholder:"https://example.com/mcp",...x,value:x.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(st,{value:l.value,onValueChange:l.onChange,children:[t.jsx(M,{children:t.jsx(nt,{className:"h-10",children:t.jsx(ot,{})})}),t.jsxs(rt,{children:[t.jsx(E,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Re,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(E,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Re,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(E,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Re,{className:"w-4 h-4"}),"Websocket"]})}),d&&t.jsxs(t.Fragment,{children:[t.jsx(E,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx($s,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(E,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Os,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(F,{})]})}),i==="NPX"&&t.jsx(U,{control:s.control,name:"npx_package",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(L,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(M,{children:t.jsx(z,{placeholder:"@perplexity-ai/mcp-server",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(F,{})]})}),i==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(U,{control:s.control,name:"stdio_command",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(L,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(M,{children:t.jsx(z,{placeholder:"node, bun, python...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(F,{})]})}),t.jsx(U,{control:s.control,name:"stdio_args",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(L,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(M,{children:t.jsx(z,{placeholder:"arg1 arg2 --flag value",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(F,{})]})})]}),t.jsx(U,{control:s.control,name:"stdio_cwd",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(L,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(M,{children:t.jsx(z,{placeholder:"/path/to/project (optional)",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(F,{})]})})]}),(i==="NPX"||i==="STDIO")&&t.jsx(U,{control:s.control,name:"env_vars",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(L,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(M,{children:t.jsx(Tt,{value:l.value??[],onChange:l.onChange})}),t.jsx(F,{})]})}),i!=="NPX"&&i!=="STDIO"&&t.jsx(U,{control:s.control,name:"connection_token",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(L,{className:"text-xs text-muted-foreground font-medium",children:m?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(ks,{children:[t.jsx(Ts,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(ws,{variant:"success",className:"gap-1.5",children:[t.jsx(As,{size:12}),"Authenticated via OAuth",t.jsx(Ds,{size:12})]})})}),t.jsxs(Is,{align:"start",children:[t.jsxs(tt,{onClick:o,children:[t.jsx(Ps,{size:16}),"Re-authenticate"]}),t.jsxs(tt,{variant:"destructive",onClick:r,children:[t.jsx(Ms,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&l.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>l.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Vs,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(M,{children:t.jsx(z,{type:"password",placeholder:m?"Paste your GitHub PAT":"Enter access token...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(os,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(F,{})]})})]})}function nn(s){return s.command==="npx"}function on(s){return s.args?.find(e=>!e.startsWith("-"))??""}function rn(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function ln(s,e){const n={command:"npx",args:["-y",s]},o=ct(e);return Object.keys(o).length>0&&(n.envVars=o),n}function an(s,e,n,o){const r={command:s};e.trim()&&(r.args=e.trim().split(/\s+/)),n?.trim()&&(r.cwd=n.trim());const i=ct(o);return Object.keys(i).length>0&&(r.envVars=i),r}function it(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&wt(s.connection_headers)){const o=s.connection_headers,r=At(o.envVars);if(nn(o)){const c=on(o);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const i=rn(o);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function cn(s){let e,n=null,o=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=ln(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=an(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",o=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...o&&{connection_token:o},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function dn(s){const e=A.c(129),{connection:n,connectionId:o,org:r,onUpdate:i,isUpdating:c,tools:a,prompts:m,resources:d}=s;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={from:"/$org/$project/mcps/$connectionId"},e[0]=u):u=e[0];const p=Fe(u),l=_t(),x=dt(),[g,b]=B.useState(!1),[D,S]=B.useState(!1);let y;e[1]!==o?(y={connectionId:o},e[1]=o,e[2]=y):y=e[2];const v=Pt(y),w=n?.connection_type==="VIRTUAL"||v.isAuthenticated;let j;e[3]!==n?(j={connections:[n],binding:"MCP"},e[3]=n,e[4]=j):j=e[4];const k=Dt(j).length>0;let _;e[5]===Symbol.for("react.memo_cache_sentinel")?(_=Ct(It),e[5]=_):_=e[5];let C;e[6]!==n?(C=it(n),e[6]=n,e[7]=C):C=e[7];let I;e[8]!==C?(I={resolver:_,values:C},e[8]=C,e[9]=I):I=e[9];const f=St(I),P=f.formState.isDirty;let N;e[10]!==f||e[11]!==i?(N=async()=>{if(!await f.trigger())return;const $=f.getValues(),ve=cn($);await i(ve),f.reset($)},e[10]=f,e[11]=i,e[12]=N):N=e[12];const O=N;let _e;e[13]!==n||e[14]!==f?(_e=()=>{f.reset(it(n))},e[13]=n,e[14]=f,e[15]=_e):_e=e[15];const ze=_e;let Ce;e[16]!==n.id||e[17]!==x.update||e[18]!==l?(Ce=async()=>{const{token:V,tokenInfo:$,error:ve}=await kt({connectionId:n.id});if(ve||!V){Ne.error(`Authentication failed: ${ve}`);return}if($)try{const Ve=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:$.accessToken,refreshToken:$.refreshToken,expiresIn:$.expiresIn,scope:$.scope,clientId:$.clientId,clientSecret:$.clientSecret,tokenEndpoint:$.tokenEndpoint})});if(!Ve.ok)console.error("Failed to save OAuth token:",await Ve.text()),await x.update.mutateAsync({id:n.id,data:{connection_token:V}});else try{await x.update.mutateAsync({id:n.id,data:{}})}catch(Ye){console.warn("Failed to refresh connection tools after OAuth:",Ye)}}catch(Ve){console.error("Error saving OAuth token:",Ve),await x.update.mutateAsync({id:n.id,data:{connection_token:V}})}else await x.update.mutateAsync({id:n.id,data:{connection_token:V}});const ht=new URL(`/mcp/${n.id}`,window.location.origin);await l.invalidateQueries({queryKey:Qe.isMCPAuthenticated(ht.href,null)}),Ne.success("Authentication successful")},e[16]=n.id,e[17]=x.update,e[18]=l,e[19]=Ce):Ce=e[19];const H=Ce;let Se;e[20]!==n.id||e[21]!==l?(Se=async()=>{try{const V=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!V.ok){const ve=await V.text();Ne.error(`Failed to remove OAuth: ${ve}`);return}const $=new URL(`/mcp/${n.id}`,window.location.origin);await l.invalidateQueries({queryKey:Qe.isMCPAuthenticated($.href,null)}),Ne.success("OAuth removed. You can now re-authenticate with a different account.")}catch(V){console.error("Error removing OAuth token:",V),Ne.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=l,e[22]=Se):Se=e[22];const Be=Se;let we;e[23]!==n.id||e[24]!==x.delete||e[25]!==p||e[26]!==r?(we=async()=>{await x.delete.mutateAsync(n.id),p({to:"/$org/$project/mcps",params:{org:r,project:be}})},e[23]=n.id,e[24]=x.delete,e[25]=p,e[26]=r,e[27]=we):we=e[27];const He=we;let W;e[28]!==r?(W=t.jsx(et,{children:t.jsx(Ft,{asChild:!0,children:t.jsx(lt,{to:"/$org/$project/mcps",params:{org:r,project:be},children:"Connections"})})}),e[28]=r,e[29]=W):W=e[29];let ke;e[30]===Symbol.for("react.memo_cache_sentinel")?(ke=t.jsx(zt,{}),e[30]=ke):ke=e[30];let X;e[31]!==n.title?(X=t.jsx(et,{children:t.jsx(Lt,{children:n.title})}),e[31]=n.title,e[32]=X):X=e[32];let Te;e[33]!==W||e[34]!==X?(Te=t.jsx(Bt,{children:t.jsxs(Ht,{children:[W,ke,X]})}),e[33]=W,e[34]=X,e[35]=Te):Te=e[35];const We=Te;let Ie;e[36]===Symbol.for("react.memo_cache_sentinel")?(Ie=t.jsx(Gt,{children:"Disconnect connection?"}),e[36]=Ie):Ie=e[36];let G;e[37]!==n.title?(G=t.jsxs(Wt,{children:[Ie,t.jsxs(Xt,{children:["This will permanently remove"," ",t.jsx("span",{className:"font-medium text-foreground",children:n.title}),". This action cannot be undone."]})]}),e[37]=n.title,e[38]=G):G=e[38];let Ae;e[39]===Symbol.for("react.memo_cache_sentinel")?(Ae=t.jsx(Kt,{children:"Cancel"}),e[39]=Ae):Ae=e[39];let K;e[40]!==He?(K=t.jsxs(Qt,{children:[Ae,t.jsx(qt,{onClick:He,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]}),e[40]=He,e[41]=K):K=e[41];let Q;e[42]!==G||e[43]!==K?(Q=t.jsxs(Jt,{children:[G,K]}),e[42]=G,e[43]=K,e[44]=Q):Q=e[44];let q;e[45]!==D||e[46]!==Q?(q=t.jsx(Yt,{open:D,onOpenChange:S,children:Q}),e[45]=D,e[46]=Q,e[47]=q):q=e[47];let J;e[48]!==n.title?(J=t.jsx(Zt,{className:"text-base",children:n.title}),e[48]=n.title,e[49]=J):J=e[49];let De;e[50]===Symbol.for("react.memo_cache_sentinel")?(De=t.jsx(es,{className:"text-xs",children:"Update URL, authentication, and other settings"}),e[50]=De):De=e[50];let Y;e[51]!==J?(Y=t.jsxs(ts,{className:"px-6 py-4 border-b border-border shrink-0",children:[J,De]}),e[51]=J,e[52]=Y):Y=e[52];let Z;e[53]!==f.control?(Z=t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(U,{control:f.control,name:"title",render:un}),t.jsx(U,{control:f.control,name:"description",render:mn})]}),e[53]=f.control,e[54]=Z):Z=e[54];let ee;e[55]!==v.hasOAuthToken||e[56]!==n||e[57]!==f||e[58]!==H||e[59]!==Be?(ee=t.jsx(sn,{form:f,connection:n,hasOAuthToken:v.hasOAuthToken,onReauthenticate:H,onRemoveOAuth:Be}),e[55]=v.hasOAuthToken,e[56]=n,e[57]=f,e[58]=H,e[59]=Be,e[60]=ee):ee=e[60];let te;e[61]!==v.isServerError||e[62]!==v.supportsOAuth||e[63]!==n||e[64]!==f||e[65]!==H||e[66]!==k||e[67]!==w?(te=t.jsx(Ot,{connection:n,form:f,hasMcpBinding:k,isMCPAuthenticated:w,supportsOAuth:v.supportsOAuth,isServerError:v.isServerError,onAuthenticate:H,onViewReadme:void 0}),e[61]=v.isServerError,e[62]=v.supportsOAuth,e[63]=n,e[64]=f,e[65]=H,e[66]=k,e[67]=w,e[68]=te):te=e[68];let se;e[69]!==Z||e[70]!==ee||e[71]!==te?(se=t.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-5 flex flex-col gap-6",children:[Z,ee,te]}),e[69]=Z,e[70]=ee,e[71]=te,e[72]=se):se=e[72];const Xe=!P||c,Ge=c?"Saving…":"Save changes";let ne;e[73]!==O||e[74]!==Xe||e[75]!==Ge?(ne=t.jsx(ye,{onClick:O,disabled:Xe,className:"flex-1",children:Ge}),e[73]=O,e[74]=Xe,e[75]=Ge,e[76]=ne):ne=e[76];let oe;e[77]!==ze||e[78]!==P?(oe=P&&t.jsx(ye,{variant:"outline",onClick:ze,children:"Undo"}),e[77]=ze,e[78]=P,e[79]=oe):oe=e[79];let re;e[80]!==ne||e[81]!==oe?(re=t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[ne,oe]}),e[80]=ne,e[81]=oe,e[82]=re):re=e[82];let ie;e[83]!==f||e[84]!==se||e[85]!==re?(ie=t.jsxs(rs,{...f,children:[se,re]}),e[83]=f,e[84]=se,e[85]=re,e[86]=ie):ie=e[86];let le;e[87]!==Y||e[88]!==ie?(le=t.jsxs(ss,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[Y,ie]}),e[87]=Y,e[88]=ie,e[89]=le):le=e[89];let ae;e[90]!==g||e[91]!==le?(ae=t.jsx(ns,{open:g,onOpenChange:b,children:le}),e[90]=g,e[91]=le,e[92]=ae):ae=e[92];let $e,Pe;e[93]===Symbol.for("react.memo_cache_sentinel")?($e=()=>b(!0),Pe=()=>S(!0),e[93]=$e,e[94]=Pe):($e=e[93],Pe=e[94]);let ce;e[95]!==n?(ce=t.jsx(en,{connection:n,onOpenSettings:$e,onDisconnect:Pe}),e[95]=n,e[96]=ce):ce=e[96];let de;e[97]!==o?(de=t.jsx(Hs,{connectionId:o}),e[97]=o,e[98]=de):de=e[98];let me;e[99]!==o||e[100]!==r||e[101]!==m||e[102]!==d||e[103]!==a?(me=t.jsx(qs,{tools:a,prompts:m,resources:d,connectionId:o,org:r}),e[99]=o,e[100]=r,e[101]=m,e[102]=d,e[103]=a,e[104]=me):me=e[104];let ue;e[105]!==de||e[106]!==me?(ue=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-5",children:[de,me]}),e[105]=de,e[106]=me,e[107]=ue):ue=e[107];let xe;e[108]!==n?(xe=t.jsx(Gs,{connection:n}),e[108]=n,e[109]=xe):xe=e[109];let Oe;e[110]===Symbol.for("react.memo_cache_sentinel")?(Oe=()=>b(!0),e[110]=Oe):Oe=e[110];let pe;e[111]!==n?(pe=t.jsx(tn,{connection:n,onOpenSettings:Oe}),e[111]=n,e[112]=pe):pe=e[112];let fe;e[113]!==xe||e[114]!==pe?(fe=t.jsxs("div",{className:"w-72 shrink-0 flex flex-col gap-5",children:[xe,pe]}),e[113]=xe,e[114]=pe,e[115]=fe):fe=e[115];let he;e[116]!==ue||e[117]!==fe?(he=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsxs("div",{className:"flex gap-6 p-6",children:[ue,fe]})}),e[116]=ue,e[117]=fe,e[118]=he):he=e[118];let ge;e[119]!==ce||e[120]!==he?(ge=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[ce,he]}),e[119]=ce,e[120]=he,e[121]=ge):ge=e[121];let je;e[122]!==We||e[123]!==ge?(je=t.jsx(ls,{breadcrumb:We,children:ge}),e[122]=We,e[123]=ge,e[124]=je):je=e[124];let Me;return e[125]!==q||e[126]!==ae||e[127]!==je?(Me=t.jsxs(t.Fragment,{children:[q,ae,je]}),e[125]=q,e[126]=ae,e[127]=je,e[128]=Me):Me=e[128],Me}function mn(s){const{field:e}=s;return t.jsxs(R,{children:[t.jsx(L,{children:"Description"}),t.jsx(M,{children:t.jsx(z,{...e,value:e.value||""})}),t.jsx(F,{})]})}function un(s){const{field:e}=s;return t.jsxs(R,{children:[t.jsx(L,{children:"Name"}),t.jsx(M,{children:t.jsx(z,{...e})}),t.jsx(F,{})]})}function xn(){const s=A.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$connectionId"},s[0]=e):e=s[0];const n=Fe(e);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/$project/mcps/$connectionId"},s[1]=o):o=s[1];const{connectionId:r,org:i}=yt(o),{org:c}=Le(),a=Mt(r),m=dt();let d;s[2]!==r||s[3]!==c.id?(d={connectionId:r,orgId:c.id},s[2]=r,s[3]=c.id,s[4]=d):d=s[4];const u=qe(d),l=!(a?.connection_type==="VIRTUAL")&&a?.tools&&a.tools.length>0,x=!l;let g;s[5]!==u||s[6]!==x?(g={client:u,enabled:x},s[5]=u,s[6]=x,s[7]=g):g=s[7];const{data:b}=Et(g);let D;s[8]!==a||s[9]!==l||s[10]!==b?.tools?(D=l?a.tools??[]:(b?.tools??[]).map(hn),s[8]=a,s[9]=l,s[10]=b?.tools,s[11]=D):D=s[11];const S=D;let y;s[12]!==u?(y={client:u},s[12]=u,s[13]=y):y=s[13];const{data:v}=Rt(y);let T;s[14]!==u?(T={client:u},s[14]=u,s[15]=T):T=s[15];const{data:w}=Ut(T);let j;s[16]!==v?.prompts?(j=v?.prompts??[],s[16]=v?.prompts,s[17]=j):j=s[17];let h;s[18]!==j?(h=j.map(fn),s[18]=j,s[19]=h):h=s[19];const k=h;let _;s[20]!==w?.resources?(_=w?.resources??[],s[20]=w?.resources,s[21]=_):_=s[21];let C;s[22]!==_?(C=_.map(pn),s[22]=_,s[23]=C):C=s[23];const I=C;let f;s[24]!==m.update||s[25]!==r?(f=async O=>{await m.update.mutateAsync({id:r,data:O})},s[24]=m.update,s[25]=r,s[26]=f):f=s[26];const P=f;if(!a){let O;return s[27]!==n||s[28]!==i?(O=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(at,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(ye,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:i,project:be}}),children:"Back to connections"})})}),s[27]=n,s[28]=i,s[29]=O):O=s[29],O}let N;return s[30]!==m.update.isPending||s[31]!==a||s[32]!==r||s[33]!==P||s[34]!==i||s[35]!==k||s[36]!==I||s[37]!==S?(N=t.jsx(dn,{org:i,connection:a,connectionId:r,onUpdate:P,isUpdating:m.update.isPending,tools:S,prompts:k,resources:I}),s[30]=m.update.isPending,s[31]=a,s[32]=r,s[33]=P,s[34]=i,s[35]=k,s[36]=I,s[37]=S,s[38]=N):N=s[38],N}function pn(s){return{name:s.name,description:s.description,uri:s.uri}}function fn(s){return{name:s.name,description:s.description}}function hn(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations,_meta:s._meta}}function gn(){const s=A.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Nt,{children:t.jsx(B.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(is,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(xn,{})})}),s[0]=e):e=s[0],e}function Wo(){const s=A.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(gn,{}),s[0]=e):e=s[0],e}export{Wo as default};
|
|
1
|
+
import{r as B,c as A,u as Le,j as t,y as gt,x as jt,K as Qe,O as be,J as lt,e as Fe,B as ye,c4 as Ze,at as vt,p as bt,E as Nt,g as yt,w as _t,q as Ct,t as St,b as wt,a as kt,v as Ne}from"./index-OyLnxARk.js";import{E as at}from"./empty-state-gZUVmgL7.js";import{E as Tt,c as It,r as At,e as ct}from"./env-vars-editor-CIM7XauD.js";import{d as Dt}from"./registry-utils-D0qx2c0_.js";import{n as $t,u as Pt,S as Ot}from"./index-BPs3Pxaa.js";import{u as Mt,a as dt}from"./use-connection-B7ll8uNa.js";import{u as qe,a as Vt}from"./constants-CLw0F8Mm.js";import{d as Et}from"./use-mcp-tools-S01H2JtZ.js";import{b as Ut}from"./use-mcp-resources-CFTlLllB.js";import{a as Rt}from"./use-mcp-prompts-DyPVjaKa.js";import{b as et,c as Lt,d as Ft,e as zt,B as Bt,a as Ht}from"./breadcrumb-CcE89MsN.js";import{b as Wt,d as Xt,c as Gt,A as Kt,e as Qt,h as qt,a as Jt,f as Yt}from"./alert-dialog-BZtQAioB.js";import{S as Zt,a as es,b as ts,c as ss,d as ns}from"./sheet-MAyp9_-H.js";import{F as U,b as R,c as L,d as M,f as F,e as os,a as rs}from"./form-Cd_AEgzv.js";import{I as z}from"./input-B4YrZuiK.js";import{i as is}from"./Loading01-BYjTtpy0.js";import{a as ls}from"./layout-DwPAPIK-.js";import{c as as,C as cs,B as ds,a as ms,b as us,d as xs,e as ps}from"./monitoring-stats-row-CIKRC_fM.js";import{b as fs}from"./use-virtual-mcp-B8SbBr9v.js";import{i as mt}from"./ChevronRight-B3gSyJmK.js";import{t as ut}from"./Users03-CUiUl0DH.js";import{I as xt}from"./integration-icon-B3aufi6R.js";import{T as Ee,a as hs,b as Ue,c as gs}from"./tabs-kzZLmFuM.js";import{a as js}from"./Tool01-3i6uRXKJ.js";import{g as Je}from"./types-DoomhLgW.js";import{M as vs}from"./mcp-app-renderer-KZyUYhBW.js";import{C as bs}from"./collection-search-D6ILFEtf.js";import{T as Ns}from"./tools-list-GuN2kaNF.js";import{C as ys}from"./card-B6XTMOTf.js";import{t as _s}from"./Settings01-B3FNPQBg.js";import{U as Cs}from"./user-BLAfg6Ev.js";import{f as Ss}from"./format-time-CMKyl-GC.js";import{B as ws}from"./badge-BTw8dF6C.js";import{D as ks,a as Ts,b as Is,c as tt}from"./dropdown-menu-EcTFyr4x.js";import{S as st,a as nt,b as ot,c as rt,d as E}from"./select-Ctls6rHz.js";import{i as As}from"./CheckCircle-BL2mIAJn.js";import{t as Ds}from"./ChevronDown-C-3qjfHK.js";import{n as $s}from"./Container-CQmXt7Nc.js";import{s as Re}from"./Globe02-CDBspixd.js";import{s as Ps}from"./RefreshCcw01-ghOVEWuz.js";import{i as Os}from"./Terminal-CvfSVl9m.js";import{s as Ms}from"./Trash01-Dmi4vR7Q.js";import{s as Vs}from"./XClose-D08ltwBw.js";import"./Plus-1vH_gFoY.js";import"./binder-B2xnCBeC.js";import"./File06-DbRSeish.js";import"./Key01-Cv0XYLbb.js";import"./constants-D3bMpbG0.js";import"./extract-connection-data-DEaEvOm7.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-1KLotWZ_.js";import"./index-Cz_J9f63.js";import"./index-Cg4edYBM.js";import"./ChevronUp-Rk5dLXNx.js";import"./index-BrqeZa9X.js";import"./select-virtual-mcp-CEX-N6yN.js";import"./popover-BKHsia9C.js";import"./tooltip--UA5heKX.js";import"./index-CRi6734Z.js";import"./Check-DAFdA2oM.js";import"./SearchMd-Dn4cWwEm.js";import"./use-create-virtual-mcp-BvSTYw2n.js";import"./use-collections-DXLoMYCx.js";import"./useMutation-B_6d8oLI.js";import"./useQuery-Brtj4EoG.js";import"./X-Car5B1de.js";import"./label-BoRKSV_h.js";import"./index-DKWOGpkx.js";import"./collection-display-button-BJQ_VSFQ.js";import"./ArrowDown-BPMtK04S.js";import"./ArrowUp-DqOjcDuh.js";import"./Grid01-COkHqk9k.js";import"./List-_Z2X7aPf.js";import"./collection-table-wrapper-D0JGm79B.js";import"./table-DHN8Pbh9.js";import"./Eye-MRRTHIte.js";import"./LayersTwo01-DdRcHsrK.js";import"./avatar-DEdDAQ0j.js";import"./differenceInSeconds-NQ4PDo0z.js";const pt=({size:s=24,color:e="currentColor",...n})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},B.createElement("path",{d:"m12 21-.1-.15c-.695-1.042-1.042-1.563-1.5-1.94a4 4 0 0 0-1.378-.737C8.453 18 7.827 18 6.575 18H5.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C2 16.48 2 15.92 2 14.8V6.2c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C3.52 3 4.08 3 5.2 3h.4c2.24 0 3.36 0 4.216.436a4 4 0 0 1 1.748 1.748C12 6.04 12 7.16 12 9.4M12 21V9.4M12 21l.1-.15c.695-1.042 1.042-1.563 1.5-1.94a3.999 3.999 0 0 1 1.378-.737C15.547 18 16.173 18 17.425 18H18.8c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 16.48 22 15.92 22 14.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 3 19.92 3 18.8 3h-.4c-2.24 0-3.36 0-4.216.436a4 4 0 0 0-1.748 1.748C12 6.04 12 7.16 12 9.4"}));pt.displayName="BookOpen01";const Es=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Us(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Rs={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Ls(s){const e=A.c(3),{connectionId:n,orgId:o,timeframe:r}=s;let i;e[0]!==o?(i={connectionId:Vt,orgId:o},e[0]=o,e[1]=i):i=e[1];const c=qe(i),a=Us(r),{data:m}=jt({queryKey:Qe.connectionActivity(n,r,o),queryFn:async()=>{const x=await c.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return x.structuredContent??x},staleTime:3e5}),d=as(m?.logs??[],a),u=d.data,p=d.totalCalls>0;let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[2]=l):l=e[2],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:d.totalCalls.toLocaleString()}),l]}),d.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:d.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),d.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(d.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),p?t.jsxs("div",{children:[t.jsx(cs,{config:Rs,className:"h-16 w-full",children:t.jsxs(ds,{data:u,barCategoryGap:"4%",children:[t.jsx(ms,{content:t.jsx(us,{labelFormatter:zs}),cursor:{fill:"var(--muted)"}}),t.jsx(xs,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(Fs)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Fs(s,e){return t.jsx(ps,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function zs(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function Bs(){const s=A.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function Hs(s){const e=A.c(13),{connectionId:n}=s,[o,r]=B.useState("14d"),{org:i}=Le();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=c):c=e[0];let a;e[1]!==o?(a=Es.map(l=>t.jsx("button",{type:"button",onClick:()=>r(l.value),className:gt("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",o===l.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:l.label},l.value)),e[1]=o,e[2]=a):a=e[2];let m;e[3]!==a?(m=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[c,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:a})]}),e[3]=a,e[4]=m):m=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Bs,{}),e[5]=d):d=e[5];let u;e[6]!==n||e[7]!==i.id||e[8]!==o?(u=t.jsx(B.Suspense,{fallback:d,children:t.jsx(Ls,{connectionId:n,orgId:i.id,timeframe:o})}),e[6]=n,e[7]=i.id,e[8]=o,e[9]=u):u=e[9];let p;return e[10]!==m||e[11]!==u?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,u]}),e[10]=m,e[11]=u,e[12]=p):p=e[12],p}function Ws(s){const e=A.c(14),{virtualMcp:n,org:o}=s;let r;e[0]!==o||e[1]!==n.id?(r={org:o,project:be,agentId:n.id},e[0]=o,e[1]=n.id,e[2]=r):r=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ut,{size:16}),e[3]=i):i=e[3];let c;e[4]!==n.icon||e[5]!==n.title?(c=t.jsx(xt,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:i}),e[4]=n.icon,e[5]=n.title,e[6]=c):c=e[6];let a;e[7]!==n.title?(a=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=a):a=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(mt,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=m):m=e[9];let d;return e[10]!==r||e[11]!==c||e[12]!==a?(d=t.jsxs(lt,{to:"/$org/$project/agents/$agentId/",params:r,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group",children:[c,a,m]}),e[10]=r,e[11]=c,e[12]=a,e[13]=d):d=e[13],d}function Xs(s){const e=A.c(7),{virtualMcps:n,org:o}=s;let r;if(e[0]!==o||e[1]!==n){let c;e[3]!==o?(c=a=>t.jsx(Ws,{virtualMcp:a,org:o},a.id),e[3]=o,e[4]=c):c=e[4],r=n.map(c),e[0]=o,e[1]=n,e[2]=r}else r=e[2];let i;return e[5]!==r?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=i):i=e[6],i}function Gs(s){const e=A.c(7),{connection:n}=s,{org:o}=Le();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const i=fs(r);if(!(i.length>0)){let d;return e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(t.Fragment,{}),e[2]=d):d=e[2],d}let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=a):a=e[3];let m;return e[4]!==o.slug||e[5]!==i?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[a,t.jsx("div",{className:"px-5 py-4",children:t.jsx(Xs,{virtualMcps:i,org:o.slug})})]}),e[4]=o.slug,e[5]=i,e[6]=m):m=e[6],m}function Ks(s){const e=A.c(27),{tools:n,connectionId:o,org:r}=s,i=Fe(),{org:c}=Le();let a;e[0]!==o||e[1]!==c.id?(a={connectionId:o,orgId:c.id},e[0]=o,e[1]=c.id,e[2]=a):a=e[2];const m=qe(a),[d,u]=B.useState("");let p,l,x,g;if(e[3]!==m||e[4]!==o||e[5]!==i||e[6]!==r||e[7]!==d||e[8]!==n){const S=(n??[]).filter(Qs),y=d.toLowerCase().trim(),v=y?S.filter(h=>h.name.toLowerCase().includes(y)||h.description&&h.description.toLowerCase().includes(y)):S;let T;e[13]!==o||e[14]!==i||e[15]!==r?(T=h=>{i({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:be,connectionId:o,collectionName:"tools",itemId:encodeURIComponent(h.name)}})},e[13]=o,e[14]=i,e[15]=r,e[16]=T):T=e[16];const w=T;x="flex flex-col h-full overflow-hidden";let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=h=>{h.key==="Escape"&&(u(""),h.target.blur())},e[17]=j):j=e[17],e[18]!==d?(g=t.jsx(bs,{value:d,onChange:u,placeholder:"Search apps...",onKeyDown:j}),e[18]=d,e[19]=g):g=e[19],p="flex-1 overflow-auto p-5",l=v.length===0?t.jsx(at,{image:null,title:d?"No apps found":"No apps available",description:d?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:v.map(h=>{const k=Je(h._meta);return t.jsxs(ys,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>w(h),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(vs,{resourceURI:k,toolInfo:{tool:h},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),t.jsx(Ns,{annotations:h.annotations,_meta:h._meta})]}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]})]},h.name)})}),e[3]=m,e[4]=o,e[5]=i,e[6]=r,e[7]=d,e[8]=n,e[9]=p,e[10]=l,e[11]=x,e[12]=g}else p=e[9],l=e[10],x=e[11],g=e[12];let b;e[20]!==p||e[21]!==l?(b=t.jsx("div",{className:p,children:l}),e[20]=p,e[21]=l,e[22]=b):b=e[22];let D;return e[23]!==x||e[24]!==g||e[25]!==b?(D=t.jsxs("div",{className:x,children:[g,b]}),e[23]=x,e[24]=g,e[25]=b,e[26]=D):D=e[26],D}function Qs(s){return!!Je(s._meta)}function ft(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=c=>c.charAt(0).toUpperCase()+c.slice(1),o=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),i=e[e.length-1];return r.length>=2&&i&&o.has(i)?[r.pop(),...r].join(" "):r.join(" ")}function Ke(s){const e=A.c(2),{label:n}=s;let o;return e[0]!==n?(o=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=o):o=e[1],o}function qs(s){const e=A.c(46),{tools:n,prompts:o,resources:r,connectionId:i,org:c}=s;let a;e[0]!==o?(a=o===void 0?[]:o,e[0]=o,e[1]=a):a=e[1];const m=a;let d;e[2]!==r?(d=r===void 0?[]:r,e[2]=r,e[3]=d):d=e[3];const u=d,p=Fe();let l;e[4]!==i||e[5]!==p||e[6]!==c?(l=function(O){!i||!c||p({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:c,project:be,connectionId:i,collectionName:"tools",itemId:encodeURIComponent(O)}})},e[4]=i,e[5]=p,e[6]=c,e[7]=l):l=e[7];const x=l;let g;e[8]!==i||e[9]!==c||e[10]!==n?(g=i&&c&&n.some(Zs),e[8]=i,e[9]=c,e[10]=n,e[11]=g):g=e[11];const b=g;if(n.length+m.length+u.length===0){let N;return e[12]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[12]=N):N=e[12],N}let S;e[13]!==n.length?(S=t.jsxs(Ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[13]=n.length,e[14]=S):S=e[14];let y;e[15]!==b?(y=b&&t.jsx(Ee,{value:"apps",variant:"underline",children:"UI"}),e[15]=b,e[16]=y):y=e[16];let v,T;e[17]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Ee,{value:"prompts",variant:"underline",children:"Prompts"}),v=t.jsx(Ee,{value:"resources",variant:"underline",children:"Resources"}),e[17]=v,e[18]=T):(v=e[17],T=e[18]);let w;e[19]!==S||e[20]!==y?(w=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(hs,{variant:"underline",className:"gap-1",children:[S,y,T,v]})}),e[19]=S,e[20]=y,e[21]=w):w=e[21];let j;e[22]!==x||e[23]!==n?(j=n.length>0?n.map(N=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>x(N.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(js,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:ft(N.name)}),N.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:N.description})]}),t.jsx(mt,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},N.name)):t.jsx(Ke,{label:"tools"}),e[22]=x,e[23]=n,e[24]=j):j=e[24];let h;e[25]!==j?(h=t.jsx(Ue,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:j})}),e[25]=j,e[26]=h):h=e[26];let k;e[27]!==i||e[28]!==b||e[29]!==c||e[30]!==n?(k=b&&t.jsx(Ue,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(Ks,{tools:n,connectionId:i,org:c})}),e[27]=i,e[28]=b,e[29]=c,e[30]=n,e[31]=k):k=e[31];let _;e[32]!==m?(_=m.length>0?m.map(Ys):t.jsx(Ke,{label:"prompts"}),e[32]=m,e[33]=_):_=e[33];let C;e[34]!==_?(C=t.jsx(Ue,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:_})}),e[34]=_,e[35]=C):C=e[35];let I;e[36]!==u?(I=u.length>0?u.map(Js):t.jsx(Ke,{label:"resources"}),e[36]=u,e[37]=I):I=e[37];let f;e[38]!==I?(f=t.jsx(Ue,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:I})}),e[38]=I,e[39]=f):f=e[39];let P;return e[40]!==w||e[41]!==h||e[42]!==k||e[43]!==C||e[44]!==f?(P=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(gs,{defaultValue:"tools",variant:"underline",children:[w,h,k,C,f]})}),e[40]=w,e[41]=h,e[42]=k,e[43]=C,e[44]=f,e[45]=P):P=e[45],P}function Js(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx($t,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function Ys(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(pt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:ft(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function Zs(s){return Je(s._meta)}function en(s){const e=A.c(22),{connection:n,onOpenSettings:o,onDisconnect:r}=s;let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(xt,{icon:n.icon,name:n.title,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let c;e[3]!==n.title?(c=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none",children:n.title})}),e[3]=n.title,e[4]=c):c=e[4];let a;e[5]!==n.description?(a=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:n.description}),e[5]=n.description,e[6]=a):a=e[6];let m;e[7]!==c||e[8]!==a?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,a]}),e[7]=c,e[8]=a,e[9]=m):m=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(_s,{size:15}),e[10]=d):d=e[10];let u;e[11]!==o?(u=t.jsx(ye,{variant:"ghost",size:"icon",onClick:o,title:"Configure connection",className:"h-8 w-8 text-muted-foreground hover:text-foreground",children:d}),e[11]=o,e[12]=u):u=e[12];let p;e[13]!==r?(p=t.jsx(ye,{variant:"outline",size:"sm",onClick:r,className:"text-destructive border-destructive/25 hover:bg-destructive/5 hover:text-destructive hover:border-destructive/40",children:"Disconnect"}),e[13]=r,e[14]=p):p=e[14];let l;e[15]!==u||e[16]!==p?(l=t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u,p]}),e[15]=u,e[16]=p,e[17]=l):l=e[17];let x;return e[18]!==i||e[19]!==m||e[20]!==l?(x=t.jsxs("div",{className:"flex items-center gap-6 py-7 px-8 bg-background border-b border-border shrink-0",children:[i,m,l]}),e[18]=i,e[19]=m,e[20]=l,e[21]=x):x=e[21],x}function tn(s){const e=A.c(21),{connection:n,onOpenSettings:o}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Connection"}),e[0]=r):r=e[0];let i;e[1]!==o?(i=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[r,t.jsx("button",{type:"button",onClick:o,className:"text-xs text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors cursor-pointer",children:"Configure"})]}),e[1]=o,e[2]=i):i=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("span",{className:"text-xs text-muted-foreground",children:"Added by"}),e[3]=c):c=e[3];let a;e[4]!==n.created_by?(a=t.jsxs("div",{className:"flex items-center justify-between",children:[c,t.jsx(Cs,{id:n.created_by,size:"2xs"})]}),e[4]=n.created_by,e[5]=a):a=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("span",{className:"text-xs text-muted-foreground",children:"Updated"}),e[6]=m):m=e[6];let d;e[7]!==n.updated_at?(d=n.updated_at?Ss(new Date(n.updated_at)):"—",e[7]=n.updated_at,e[8]=d):d=e[8];let u;e[9]!==d?(u=t.jsxs("div",{className:"flex items-center justify-between",children:[m,t.jsx("span",{className:"text-xs text-foreground",children:d})]}),e[9]=d,e[10]=u):u=e[10];let p;e[11]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("span",{className:"text-xs text-muted-foreground",children:"Protocol"}),e[11]=p):p=e[11];let l;e[12]!==n.connection_type?(l=t.jsxs("div",{className:"flex items-center justify-between",children:[p,t.jsx("span",{className:"text-xs font-mono text-foreground",children:n.connection_type})]}),e[12]=n.connection_type,e[13]=l):l=e[13];let x;e[14]!==a||e[15]!==u||e[16]!==l?(x=t.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[a,u,l]}),e[14]=a,e[15]=u,e[16]=l,e[17]=x):x=e[17];let g;return e[18]!==x||e[19]!==i?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[i,x]}),e[18]=x,e[19]=i,e[20]=g):g=e[20],g}function sn({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:r}){const i=Ze({control:s.control,name:"ui_type"}),c=Ze({control:s.control,name:"connection_url"}),{stdioEnabled:a}=vt(),m=(()=>{if(typeof c!="string"||!c)return!1;try{const l=new URL(c);return l.hostname==="api.githubcopilot.com"&&l.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),d=a||e.connection_type==="STDIO",u=e.connection_type==="VIRTUAL",p=u?bt(e.connection_url):null;return u?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(ut,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(U,{control:s.control,name:"ui_type",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(L,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),i!=="NPX"&&i!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(st,{value:l.value,onValueChange:l.onChange,children:[t.jsx(M,{children:t.jsxs(nt,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(Re,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(ot,{})]})}),t.jsxs(rt,{children:[t.jsx(E,{value:"HTTP",children:"HTTP"}),t.jsx(E,{value:"SSE",children:"SSE"}),t.jsx(E,{value:"Websocket",children:"Websocket"}),d&&t.jsxs(t.Fragment,{children:[t.jsx(E,{value:"NPX",children:"NPX Package"}),t.jsx(E,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(U,{control:s.control,name:"connection_url",render:({field:x})=>t.jsx(R,{className:"flex-1 min-w-0",children:t.jsx(M,{children:t.jsx(z,{placeholder:"https://example.com/mcp",...x,value:x.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(st,{value:l.value,onValueChange:l.onChange,children:[t.jsx(M,{children:t.jsx(nt,{className:"h-10",children:t.jsx(ot,{})})}),t.jsxs(rt,{children:[t.jsx(E,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Re,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(E,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Re,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(E,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Re,{className:"w-4 h-4"}),"Websocket"]})}),d&&t.jsxs(t.Fragment,{children:[t.jsx(E,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx($s,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(E,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Os,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(F,{})]})}),i==="NPX"&&t.jsx(U,{control:s.control,name:"npx_package",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(L,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(M,{children:t.jsx(z,{placeholder:"@perplexity-ai/mcp-server",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(F,{})]})}),i==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(U,{control:s.control,name:"stdio_command",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(L,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(M,{children:t.jsx(z,{placeholder:"node, bun, python...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(F,{})]})}),t.jsx(U,{control:s.control,name:"stdio_args",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(L,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(M,{children:t.jsx(z,{placeholder:"arg1 arg2 --flag value",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(F,{})]})})]}),t.jsx(U,{control:s.control,name:"stdio_cwd",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(L,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(M,{children:t.jsx(z,{placeholder:"/path/to/project (optional)",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(F,{})]})})]}),(i==="NPX"||i==="STDIO")&&t.jsx(U,{control:s.control,name:"env_vars",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(L,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(M,{children:t.jsx(Tt,{value:l.value??[],onChange:l.onChange})}),t.jsx(F,{})]})}),i!=="NPX"&&i!=="STDIO"&&t.jsx(U,{control:s.control,name:"connection_token",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(L,{className:"text-xs text-muted-foreground font-medium",children:m?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(ks,{children:[t.jsx(Ts,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(ws,{variant:"success",className:"gap-1.5",children:[t.jsx(As,{size:12}),"Authenticated via OAuth",t.jsx(Ds,{size:12})]})})}),t.jsxs(Is,{align:"start",children:[t.jsxs(tt,{onClick:o,children:[t.jsx(Ps,{size:16}),"Re-authenticate"]}),t.jsxs(tt,{variant:"destructive",onClick:r,children:[t.jsx(Ms,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&l.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>l.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Vs,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(M,{children:t.jsx(z,{type:"password",placeholder:m?"Paste your GitHub PAT":"Enter access token...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(os,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(F,{})]})})]})}function nn(s){return s.command==="npx"}function on(s){return s.args?.find(e=>!e.startsWith("-"))??""}function rn(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function ln(s,e){const n={command:"npx",args:["-y",s]},o=ct(e);return Object.keys(o).length>0&&(n.envVars=o),n}function an(s,e,n,o){const r={command:s};e.trim()&&(r.args=e.trim().split(/\s+/)),n?.trim()&&(r.cwd=n.trim());const i=ct(o);return Object.keys(i).length>0&&(r.envVars=i),r}function it(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&wt(s.connection_headers)){const o=s.connection_headers,r=At(o.envVars);if(nn(o)){const c=on(o);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const i=rn(o);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function cn(s){let e,n=null,o=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=ln(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=an(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",o=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...o&&{connection_token:o},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function dn(s){const e=A.c(129),{connection:n,connectionId:o,org:r,onUpdate:i,isUpdating:c,tools:a,prompts:m,resources:d}=s;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={from:"/$org/$project/mcps/$connectionId"},e[0]=u):u=e[0];const p=Fe(u),l=_t(),x=dt(),[g,b]=B.useState(!1),[D,S]=B.useState(!1);let y;e[1]!==o?(y={connectionId:o},e[1]=o,e[2]=y):y=e[2];const v=Pt(y),w=n?.connection_type==="VIRTUAL"||v.isAuthenticated;let j;e[3]!==n?(j={connections:[n],binding:"MCP"},e[3]=n,e[4]=j):j=e[4];const k=Dt(j).length>0;let _;e[5]===Symbol.for("react.memo_cache_sentinel")?(_=Ct(It),e[5]=_):_=e[5];let C;e[6]!==n?(C=it(n),e[6]=n,e[7]=C):C=e[7];let I;e[8]!==C?(I={resolver:_,values:C},e[8]=C,e[9]=I):I=e[9];const f=St(I),P=f.formState.isDirty;let N;e[10]!==f||e[11]!==i?(N=async()=>{if(!await f.trigger())return;const $=f.getValues(),ve=cn($);await i(ve),f.reset($)},e[10]=f,e[11]=i,e[12]=N):N=e[12];const O=N;let _e;e[13]!==n||e[14]!==f?(_e=()=>{f.reset(it(n))},e[13]=n,e[14]=f,e[15]=_e):_e=e[15];const ze=_e;let Ce;e[16]!==n.id||e[17]!==x.update||e[18]!==l?(Ce=async()=>{const{token:V,tokenInfo:$,error:ve}=await kt({connectionId:n.id});if(ve||!V){Ne.error(`Authentication failed: ${ve}`);return}if($)try{const Ve=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:$.accessToken,refreshToken:$.refreshToken,expiresIn:$.expiresIn,scope:$.scope,clientId:$.clientId,clientSecret:$.clientSecret,tokenEndpoint:$.tokenEndpoint})});if(!Ve.ok)console.error("Failed to save OAuth token:",await Ve.text()),await x.update.mutateAsync({id:n.id,data:{connection_token:V}});else try{await x.update.mutateAsync({id:n.id,data:{}})}catch(Ye){console.warn("Failed to refresh connection tools after OAuth:",Ye)}}catch(Ve){console.error("Error saving OAuth token:",Ve),await x.update.mutateAsync({id:n.id,data:{connection_token:V}})}else await x.update.mutateAsync({id:n.id,data:{connection_token:V}});const ht=new URL(`/mcp/${n.id}`,window.location.origin);await l.invalidateQueries({queryKey:Qe.isMCPAuthenticated(ht.href,null)}),Ne.success("Authentication successful")},e[16]=n.id,e[17]=x.update,e[18]=l,e[19]=Ce):Ce=e[19];const H=Ce;let Se;e[20]!==n.id||e[21]!==l?(Se=async()=>{try{const V=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!V.ok){const ve=await V.text();Ne.error(`Failed to remove OAuth: ${ve}`);return}const $=new URL(`/mcp/${n.id}`,window.location.origin);await l.invalidateQueries({queryKey:Qe.isMCPAuthenticated($.href,null)}),Ne.success("OAuth removed. You can now re-authenticate with a different account.")}catch(V){console.error("Error removing OAuth token:",V),Ne.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=l,e[22]=Se):Se=e[22];const Be=Se;let we;e[23]!==n.id||e[24]!==x.delete||e[25]!==p||e[26]!==r?(we=async()=>{await x.delete.mutateAsync(n.id),p({to:"/$org/$project/mcps",params:{org:r,project:be}})},e[23]=n.id,e[24]=x.delete,e[25]=p,e[26]=r,e[27]=we):we=e[27];const He=we;let W;e[28]!==r?(W=t.jsx(et,{children:t.jsx(Ft,{asChild:!0,children:t.jsx(lt,{to:"/$org/$project/mcps",params:{org:r,project:be},children:"Connections"})})}),e[28]=r,e[29]=W):W=e[29];let ke;e[30]===Symbol.for("react.memo_cache_sentinel")?(ke=t.jsx(zt,{}),e[30]=ke):ke=e[30];let X;e[31]!==n.title?(X=t.jsx(et,{children:t.jsx(Lt,{children:n.title})}),e[31]=n.title,e[32]=X):X=e[32];let Te;e[33]!==W||e[34]!==X?(Te=t.jsx(Bt,{children:t.jsxs(Ht,{children:[W,ke,X]})}),e[33]=W,e[34]=X,e[35]=Te):Te=e[35];const We=Te;let Ie;e[36]===Symbol.for("react.memo_cache_sentinel")?(Ie=t.jsx(Gt,{children:"Disconnect connection?"}),e[36]=Ie):Ie=e[36];let G;e[37]!==n.title?(G=t.jsxs(Wt,{children:[Ie,t.jsxs(Xt,{children:["This will permanently remove"," ",t.jsx("span",{className:"font-medium text-foreground",children:n.title}),". This action cannot be undone."]})]}),e[37]=n.title,e[38]=G):G=e[38];let Ae;e[39]===Symbol.for("react.memo_cache_sentinel")?(Ae=t.jsx(Kt,{children:"Cancel"}),e[39]=Ae):Ae=e[39];let K;e[40]!==He?(K=t.jsxs(Qt,{children:[Ae,t.jsx(qt,{onClick:He,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]}),e[40]=He,e[41]=K):K=e[41];let Q;e[42]!==G||e[43]!==K?(Q=t.jsxs(Jt,{children:[G,K]}),e[42]=G,e[43]=K,e[44]=Q):Q=e[44];let q;e[45]!==D||e[46]!==Q?(q=t.jsx(Yt,{open:D,onOpenChange:S,children:Q}),e[45]=D,e[46]=Q,e[47]=q):q=e[47];let J;e[48]!==n.title?(J=t.jsx(Zt,{className:"text-base",children:n.title}),e[48]=n.title,e[49]=J):J=e[49];let De;e[50]===Symbol.for("react.memo_cache_sentinel")?(De=t.jsx(es,{className:"text-xs",children:"Update URL, authentication, and other settings"}),e[50]=De):De=e[50];let Y;e[51]!==J?(Y=t.jsxs(ts,{className:"px-6 py-4 border-b border-border shrink-0",children:[J,De]}),e[51]=J,e[52]=Y):Y=e[52];let Z;e[53]!==f.control?(Z=t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(U,{control:f.control,name:"title",render:un}),t.jsx(U,{control:f.control,name:"description",render:mn})]}),e[53]=f.control,e[54]=Z):Z=e[54];let ee;e[55]!==v.hasOAuthToken||e[56]!==n||e[57]!==f||e[58]!==H||e[59]!==Be?(ee=t.jsx(sn,{form:f,connection:n,hasOAuthToken:v.hasOAuthToken,onReauthenticate:H,onRemoveOAuth:Be}),e[55]=v.hasOAuthToken,e[56]=n,e[57]=f,e[58]=H,e[59]=Be,e[60]=ee):ee=e[60];let te;e[61]!==v.isServerError||e[62]!==v.supportsOAuth||e[63]!==n||e[64]!==f||e[65]!==H||e[66]!==k||e[67]!==w?(te=t.jsx(Ot,{connection:n,form:f,hasMcpBinding:k,isMCPAuthenticated:w,supportsOAuth:v.supportsOAuth,isServerError:v.isServerError,onAuthenticate:H,onViewReadme:void 0}),e[61]=v.isServerError,e[62]=v.supportsOAuth,e[63]=n,e[64]=f,e[65]=H,e[66]=k,e[67]=w,e[68]=te):te=e[68];let se;e[69]!==Z||e[70]!==ee||e[71]!==te?(se=t.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-5 flex flex-col gap-6",children:[Z,ee,te]}),e[69]=Z,e[70]=ee,e[71]=te,e[72]=se):se=e[72];const Xe=!P||c,Ge=c?"Saving…":"Save changes";let ne;e[73]!==O||e[74]!==Xe||e[75]!==Ge?(ne=t.jsx(ye,{onClick:O,disabled:Xe,className:"flex-1",children:Ge}),e[73]=O,e[74]=Xe,e[75]=Ge,e[76]=ne):ne=e[76];let oe;e[77]!==ze||e[78]!==P?(oe=P&&t.jsx(ye,{variant:"outline",onClick:ze,children:"Undo"}),e[77]=ze,e[78]=P,e[79]=oe):oe=e[79];let re;e[80]!==ne||e[81]!==oe?(re=t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[ne,oe]}),e[80]=ne,e[81]=oe,e[82]=re):re=e[82];let ie;e[83]!==f||e[84]!==se||e[85]!==re?(ie=t.jsxs(rs,{...f,children:[se,re]}),e[83]=f,e[84]=se,e[85]=re,e[86]=ie):ie=e[86];let le;e[87]!==Y||e[88]!==ie?(le=t.jsxs(ss,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[Y,ie]}),e[87]=Y,e[88]=ie,e[89]=le):le=e[89];let ae;e[90]!==g||e[91]!==le?(ae=t.jsx(ns,{open:g,onOpenChange:b,children:le}),e[90]=g,e[91]=le,e[92]=ae):ae=e[92];let $e,Pe;e[93]===Symbol.for("react.memo_cache_sentinel")?($e=()=>b(!0),Pe=()=>S(!0),e[93]=$e,e[94]=Pe):($e=e[93],Pe=e[94]);let ce;e[95]!==n?(ce=t.jsx(en,{connection:n,onOpenSettings:$e,onDisconnect:Pe}),e[95]=n,e[96]=ce):ce=e[96];let de;e[97]!==o?(de=t.jsx(Hs,{connectionId:o}),e[97]=o,e[98]=de):de=e[98];let me;e[99]!==o||e[100]!==r||e[101]!==m||e[102]!==d||e[103]!==a?(me=t.jsx(qs,{tools:a,prompts:m,resources:d,connectionId:o,org:r}),e[99]=o,e[100]=r,e[101]=m,e[102]=d,e[103]=a,e[104]=me):me=e[104];let ue;e[105]!==de||e[106]!==me?(ue=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-5",children:[de,me]}),e[105]=de,e[106]=me,e[107]=ue):ue=e[107];let xe;e[108]!==n?(xe=t.jsx(Gs,{connection:n}),e[108]=n,e[109]=xe):xe=e[109];let Oe;e[110]===Symbol.for("react.memo_cache_sentinel")?(Oe=()=>b(!0),e[110]=Oe):Oe=e[110];let pe;e[111]!==n?(pe=t.jsx(tn,{connection:n,onOpenSettings:Oe}),e[111]=n,e[112]=pe):pe=e[112];let fe;e[113]!==xe||e[114]!==pe?(fe=t.jsxs("div",{className:"w-72 shrink-0 flex flex-col gap-5",children:[xe,pe]}),e[113]=xe,e[114]=pe,e[115]=fe):fe=e[115];let he;e[116]!==ue||e[117]!==fe?(he=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsxs("div",{className:"flex gap-6 p-6",children:[ue,fe]})}),e[116]=ue,e[117]=fe,e[118]=he):he=e[118];let ge;e[119]!==ce||e[120]!==he?(ge=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[ce,he]}),e[119]=ce,e[120]=he,e[121]=ge):ge=e[121];let je;e[122]!==We||e[123]!==ge?(je=t.jsx(ls,{breadcrumb:We,children:ge}),e[122]=We,e[123]=ge,e[124]=je):je=e[124];let Me;return e[125]!==q||e[126]!==ae||e[127]!==je?(Me=t.jsxs(t.Fragment,{children:[q,ae,je]}),e[125]=q,e[126]=ae,e[127]=je,e[128]=Me):Me=e[128],Me}function mn(s){const{field:e}=s;return t.jsxs(R,{children:[t.jsx(L,{children:"Description"}),t.jsx(M,{children:t.jsx(z,{...e,value:e.value||""})}),t.jsx(F,{})]})}function un(s){const{field:e}=s;return t.jsxs(R,{children:[t.jsx(L,{children:"Name"}),t.jsx(M,{children:t.jsx(z,{...e})}),t.jsx(F,{})]})}function xn(){const s=A.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$connectionId"},s[0]=e):e=s[0];const n=Fe(e);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/$project/mcps/$connectionId"},s[1]=o):o=s[1];const{connectionId:r,org:i}=yt(o),{org:c}=Le(),a=Mt(r),m=dt();let d;s[2]!==r||s[3]!==c.id?(d={connectionId:r,orgId:c.id},s[2]=r,s[3]=c.id,s[4]=d):d=s[4];const u=qe(d),l=!(a?.connection_type==="VIRTUAL")&&a?.tools&&a.tools.length>0,x=!l;let g;s[5]!==u||s[6]!==x?(g={client:u,enabled:x},s[5]=u,s[6]=x,s[7]=g):g=s[7];const{data:b}=Et(g);let D;s[8]!==a||s[9]!==l||s[10]!==b?.tools?(D=l?a.tools??[]:(b?.tools??[]).map(hn),s[8]=a,s[9]=l,s[10]=b?.tools,s[11]=D):D=s[11];const S=D;let y;s[12]!==u?(y={client:u},s[12]=u,s[13]=y):y=s[13];const{data:v}=Rt(y);let T;s[14]!==u?(T={client:u},s[14]=u,s[15]=T):T=s[15];const{data:w}=Ut(T);let j;s[16]!==v?.prompts?(j=v?.prompts??[],s[16]=v?.prompts,s[17]=j):j=s[17];let h;s[18]!==j?(h=j.map(fn),s[18]=j,s[19]=h):h=s[19];const k=h;let _;s[20]!==w?.resources?(_=w?.resources??[],s[20]=w?.resources,s[21]=_):_=s[21];let C;s[22]!==_?(C=_.map(pn),s[22]=_,s[23]=C):C=s[23];const I=C;let f;s[24]!==m.update||s[25]!==r?(f=async O=>{await m.update.mutateAsync({id:r,data:O})},s[24]=m.update,s[25]=r,s[26]=f):f=s[26];const P=f;if(!a){let O;return s[27]!==n||s[28]!==i?(O=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(at,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(ye,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:i,project:be}}),children:"Back to connections"})})}),s[27]=n,s[28]=i,s[29]=O):O=s[29],O}let N;return s[30]!==m.update.isPending||s[31]!==a||s[32]!==r||s[33]!==P||s[34]!==i||s[35]!==k||s[36]!==I||s[37]!==S?(N=t.jsx(dn,{org:i,connection:a,connectionId:r,onUpdate:P,isUpdating:m.update.isPending,tools:S,prompts:k,resources:I}),s[30]=m.update.isPending,s[31]=a,s[32]=r,s[33]=P,s[34]=i,s[35]=k,s[36]=I,s[37]=S,s[38]=N):N=s[38],N}function pn(s){return{name:s.name,description:s.description,uri:s.uri}}function fn(s){return{name:s.name,description:s.description}}function hn(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations,_meta:s._meta}}function gn(){const s=A.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Nt,{children:t.jsx(B.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(is,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(xn,{})})}),s[0]=e):e=s[0],e}function Wo(){const s=A.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(gn,{}),s[0]=e):e=s[0],e}export{Wo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,c as n,j as r}from"./index-
|
|
1
|
+
import{r as c,c as n,j as r}from"./index-OyLnxARk.js";import{B as a}from"./badge-BTw8dF6C.js";import{i as l}from"./AlertCircle-BWr4XQe9.js";import{i as m}from"./CheckCircle-BL2mIAJn.js";const u=({size:s=24,color:e="currentColor",...o})=>c.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},c.createElement("path",{d:"m7.5 12 3 3 6-6M7.8 21h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21Z"}));u.displayName="CheckSquare";function x(s){const e=n.c(3),{status:o}=s;if(o==="active"){let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=r.jsxs(a,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[r.jsx(m,{size:12}),"Active"]}),e[0]=t):t=e[0],t}if(o==="error"){let t;return e[1]===Symbol.for("react.memo_cache_sentinel")?(t=r.jsxs(a,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[r.jsx(l,{size:12}),"Error"]}),e[1]=t):t=e[1],t}let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(a,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),e[2]=i):i=e[2],i}export{x as C,u as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as de,u as rt,e as ct,j as t,O as re,B as z,E as wt,r as Y,w as Dt,d as It,f as At,at as Pt,aw as $t,t as Et,q as Lt,b as Ot,y as he,v as Q}from"./index-B_DxRVw1.js";import{g as zt}from"./generate-id-Dyweu44Y.js";import{C as Vt}from"./collection-display-button-D7NovPlc.js";import{C as Ft}from"./collection-search-DDX1Zkg7.js";import{C as Ut}from"./collection-tabs-D8NPXaOU.js";import{C as be}from"./connection-card-D0Hulz9h.js";import{I as ge}from"./integration-icon-Dv0HduyT.js";import{f as lt}from"./format-time-CMKyl-GC.js";import{D as Fe,b as Ue,c as Me,d as Be,a as at,e as dt}from"./dialog-COv8XUO0.js";import{i as Ye}from"./ChevronRight-Ct9VK1GH.js";import{n as ae}from"./Container-BeAIfNvy.js";import{s as mt}from"./Plus-DN4FtVmx.js";import{a as Je}from"./Tool01-xNX6v26H.js";import{i as Mt,C as Bt}from"./connection-status-CxcA3Thg.js";import{E as Rt}from"./empty-state-DsQ7yRoE.js";import{a as Ht,P as xe}from"./index-CsqngJxb.js";import{U as Xt}from"./user-z34A3977.js";import{u as Kt,f as Wt,g as Ze}from"./registry-utils--TC_kKCq.js";import{u as Gt}from"./use-infinite-scroll-DXKnZJHX.js";import{u as qt}from"./use-list-state-CFQBiz4L.js";import{u as Qt}from"./use-store-discovery-DupAMgFS.js";import{s as Yt}from"./slugify-CEUa2lfQ.js";import{f as Ie,a as Ae,b as Pe,c as $e,d as Ee,e as Le,A as Oe,h as ze}from"./alert-dialog-DdwA_v8c.js";import{B as Ve}from"./badge-BfLRgdaW.js";import{B as Jt,a as Zt,b as en,c as tn}from"./breadcrumb-BhQI8Xw3.js";import{C as pt}from"./checkbox-C5Om9oxx.js";import{D as et,a as tt,b as nt,c as Ce}from"./dropdown-menu-Cr1iKfFo.js";import{a as nn,F as Z,b as ee,c as te,d as ne,f as se}from"./form-CZrleug2.js";import{I as le}from"./input-DqwWeNgs.js";import{S as sn,a as on,b as rn,c as cn,d as fe}from"./select-BM9jpLT2.js";import{T as ln}from"./textarea-BDS2584p.js";import{a as an,b as st}from"./use-connection-DA77pjoV.js";import{u as dn,a as mn}from"./constants-CKGlP4oN.js";import{b as pn}from"./use-virtual-mcp-FAfRsySa.js";import{i as un}from"./CheckVerified02-e9BOcL0K.js";import{t as xn}from"./ChevronDown-jyPVRLzp.js";import{i as fn}from"./DotsVertical-Dn5mVo7u.js";import{s as hn}from"./Eye-DN-kY_sb.js";import{s as De}from"./Globe02-CB2InS06.js";import{i as ut}from"./Loading01-Dt16NixZ.js";import{i as gn}from"./Terminal-BDeJ6lHB.js";import{s as xt}from"./Trash01-PnuUudMl.js";import{s as jn}from"./XClose-hdsxwv2G.js";import{r as yn,E as vn,c as Cn,e as ft}from"./env-vars-editor-r00KzDtj.js";import"./ArrowDown-LiBnMzQV.js";import"./ArrowUp-WIHiBhdv.js";import"./Check-Bme4aNg5.js";import"./Grid01-BvWQ72pJ.js";import"./List-BU70NJSh.js";import"./tooltip-Bm11lCIm.js";import"./index-DRLd-piX.js";import"./SearchMd-BQseJVRu.js";import"./card-B8QXMrj8.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./X-CxZVsh3L.js";import"./AlertCircle-PBJUtpjc.js";import"./CheckCircle-BSVa-h_Y.js";import"./useQuery-B8Io0Oda.js";import"./useMutation-d1AXy22c.js";import"./avatar-CXKBBJaI.js";import"./binder-B5Q0NNkg.js";import"./use-view-mode-qVlfLymN.js";import"./use-mobile-BarAf2zx.js";import"./useInfiniteQuery-CCGqKrT7.js";import"./infiniteQueryObserver-DNhlrWmr.js";import"./label--AQoxbpU.js";import"./ChevronUp-B5BOcmGB.js";import"./use-collections-aokT1D_C.js";function Nn(i){const e=de.c(63),{open:s,onClose:r,appName:c,appIcon:l,appDescription:m,instances:g}=i,{org:N}=rt(),j=ct(),d=N.slug;let x;e[0]!==j||e[1]!==r||e[2]!==d?(x=function(V){j({to:"/$org/$project/mcps/$connectionId",params:{org:d,project:re,connectionId:V}}),r()},e[0]=j,e[1]=r,e[2]=d,e[3]=x):x=e[3];const v=x;let f;e[4]!==c||e[5]!==j||e[6]!==r||e[7]!==d?(f=function(){j({to:"/$org/$project/mcps",params:{org:d,project:re},search:{install:c}}),r()},e[4]=c,e[5]=j,e[6]=r,e[7]=d,e[8]=f):f=e[8];const h=f;let y;if(e[9]!==g){const w=new Set;y=[];for(const V of g)for(const W of V.tools??[])w.has(W.name)||(w.add(W.name),y.push({name:W.name,description:W.description,connectionId:V.id}));e[9]=g,e[10]=y}else y=e[10];let k;e[11]!==j||e[12]!==r||e[13]!==d?(k=function(V,W){j({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:d,project:re,connectionId:W,collectionName:"tools",itemId:encodeURIComponent(V)}}),r()},e[11]=j,e[12]=r,e[13]=d,e[14]=k):k=e[14];const T=k;let C;e[15]!==r?(C=w=>!w&&r(),e[15]=r,e[16]=C):C=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(ae,{}),e[17]=b):b=e[17];let D;e[18]!==l||e[19]!==c?(D=t.jsx(ge,{icon:l,name:c,size:"md",className:"shrink-0 shadow-sm mt-0.5",fallbackIcon:b}),e[18]=l,e[19]=c,e[20]=D):D=e[20];let I;e[21]!==c?(I=t.jsx(Fe,{className:"text-base font-semibold leading-snug",children:c}),e[21]=c,e[22]=I):I=e[22];let $;e[23]!==m?($=m&&t.jsx("p",{className:"text-sm text-muted-foreground mt-0.5 line-clamp-2",children:m}),e[23]=m,e[24]=$):$=e[24];let O;e[25]!==I||e[26]!==$?(O=t.jsxs("div",{className:"min-w-0",children:[I,$]}),e[25]=I,e[26]=$,e[27]=O):O=e[27];let R;e[28]!==D||e[29]!==O?(R=t.jsx(Ue,{className:"px-6 pt-6 pb-5 shrink-0",children:t.jsxs("div",{className:"flex items-start gap-4",children:[D,O]})}),e[28]=D,e[29]=O,e[30]=R):R=e[30];const P=g.length!==1?"s":"";let F;e[31]!==P?(F=t.jsxs("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:["Connection",P]}),e[31]=P,e[32]=F):F=e[32];let J;e[33]===Symbol.for("react.memo_cache_sentinel")?(J=t.jsx(mt,{size:14}),e[33]=J):J=e[33];let q;e[34]!==h?(q=t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:h,children:[J,"Add connection"]}),e[34]=h,e[35]=q):q=e[35];let U;e[36]!==F||e[37]!==q?(U=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3",children:[F,q]}),e[36]=F,e[37]=q,e[38]=U):U=e[38];let X;if(e[39]!==g||e[40]!==v){let w;e[42]!==v?(w=V=>t.jsxs("button",{type:"button",className:"w-full flex items-center gap-3 px-6 py-3 hover:bg-muted/40 transition-colors text-left cursor-pointer",onClick:()=>v(V.id),children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:V.title}),(V.updated_at||V.created_at)&&t.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Last updated"," ",lt(new Date(V.updated_at??V.created_at))]})]}),t.jsx(Ye,{size:16,className:"text-muted-foreground shrink-0"})]},V.id),e[42]=v,e[43]=w):w=e[43],X=g.map(w),e[39]=g,e[40]=v,e[41]=X}else X=e[41];let E;e[44]!==X?(E=t.jsx("div",{className:"pb-2",children:X}),e[44]=X,e[45]=E):E=e[45];let M;e[46]!==U||e[47]!==E?(M=t.jsxs("div",{children:[U,E]}),e[46]=U,e[47]=E,e[48]=M):M=e[48];let _;e[49]!==l||e[50]!==T||e[51]!==y?(_=y.length>0&&t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 px-6 py-3",children:[t.jsx(Je,{size:14,className:"text-muted-foreground"}),t.jsxs("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:["Tools (",y.length,")"]})]}),t.jsx("div",{className:"pb-2",children:y.map(w=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-6 py-2.5 hover:bg-muted/40 transition-colors text-left cursor-pointer",onClick:()=>T(w.name,w.connectionId),children:[t.jsx(ge,{icon:l,name:w.name,size:"xs",className:"shrink-0 mt-0.5",fallbackIcon:t.jsx(Je,{size:12})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:w.name}),w.description&&t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:w.description})]}),t.jsx(Ye,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},w.name))})]}),e[49]=l,e[50]=T,e[51]=y,e[52]=_):_=e[52];let K;e[53]!==M||e[54]!==_?(K=t.jsxs("div",{className:"flex-1 overflow-y-auto divide-y divide-border",children:[M,_]}),e[53]=M,e[54]=_,e[55]=K):K=e[55];let ie;e[56]!==R||e[57]!==K?(ie=t.jsxs(Me,{className:"sm:max-w-xl p-0 gap-0 overflow-hidden flex flex-col max-h-[80vh]",children:[R,K]}),e[56]=R,e[57]=K,e[58]=ie):ie=e[58];let ce;return e[59]!==s||e[60]!==ie||e[61]!==C?(ce=t.jsx(Be,{open:s,onOpenChange:C,children:ie}),e[59]=s,e[60]=ie,e[61]=C,e[62]=ce):ce=e[62],ce}function ot(i){return i.title.trim().replace(/\s+\(\d+\)$/,"")}function bn(i){const e=new Map;for(const c of i){if(c.connection_type==="VIRTUAL")continue;const l=ot(c),m=e.get(l);m?m.push(c):e.set(l,[c])}const s=[],r=new Set;for(const c of i){if(c.connection_type==="VIRTUAL")continue;const l=ot(c);if(r.has(l))continue;r.add(l);const m=e.get(l),g=m[0];m.length===1?s.push({type:"single",connection:g}):s.push({type:"group",key:l,icon:g.icon,title:g.app_name?g.title.replace(/\s*\(\d+\)\s*$/,""):g.title,connections:m})}return s}function Sn(i){const e=new Set,s=[];for(const r of i)r.created_by&&!e.has(r.created_by)&&(e.add(r.created_by),s.push(r.created_by));return s}function Se(i){const e=i.trim();if(!e)return"";try{const s=new URL(e),r=s.pathname.length>1?s.pathname.replace(/\/+$/,""):s.pathname;return`${s.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function _n(i){const e=i.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const s=e[0]?.toLowerCase();if(s!=="npx"&&s!=="bunx")return null;const c=e.slice(1).find(l=>!l.startsWith("-"));return c?{packageName:c}:null}function Ne(i){const{uiType:e}=i,s=Se(i.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&s===Se("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(i.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function it(i){if(i.registryItems.length===0||i.uiType!=="HTTP"&&i.uiType!=="SSE"&&i.uiType!=="Websocket")return null;const e=Se(i.connectionUrl??"");if(!e)return null;const s=i.registryItems.find(l=>(l.server?.remotes??[]).some(g=>Se(g.url??"")===e));if(!s)return null;const r=s.title||s.name||s.server?.title||s.server?.name||"",c=s.server?.description||s.description||s.summary||null;return r?{id:"registry",title:r,description:c}:null}function kn(i,e){const s={command:"npx",args:["-y",i]},r=ft(e);return Object.keys(r).length>0&&(s.envVars=r),s}function Tn(i,e,s,r){const c={command:i};e.trim()&&(c.args=e.trim().split(/\s+/)),s?.trim()&&(c.cwd=s.trim());const l=ft(r);return Object.keys(l).length>0&&(c.envVars=l),c}function wn(i){return i.command==="npx"}function Dn(i){return i.args?.find(e=>!e.startsWith("-"))??""}function In(i){return{command:i.command,args:i.args?.join(" ")??"",cwd:i.cwd??""}}function An(i,e){switch(e.type){case"edit":return{mode:"editing",connection:e.connection};case"delete":return{mode:"deleting",connection:e.connection};case"force-delete":return{mode:"force-deleting",connection:e.connection,agentNames:e.agentNames};case"close":return{mode:"idle"}}}function Pn(i){const e=de.c(74),{group:s,onOpen:r,selectionMode:c,selectedIds:l,onToggleSelect:m}=i;let g;if(e[0]!==s.connections||e[1]!==l){let P;e[3]!==l?(P=F=>l.has(F.id),e[3]=l,e[4]=P):P=e[4],g=s.connections.every(P),e[0]=s.connections,e[1]=l,e[2]=g}else g=e[2];const N=g;let j;if(e[5]!==s.connections||e[6]!==l){let P;e[8]!==l?(P=F=>l.has(F.id),e[8]=l,e[9]=P):P=e[9],j=s.connections.some(P),e[5]=s.connections,e[6]=l,e[7]=j}else j=e[7];const d=j;let x,v,f,h,y,k,T,C,b,D,I;if(e[10]!==N||e[11]!==s.connections||e[12]!==s.icon||e[13]!==s.title||e[14]!==r||e[15]!==m||e[16]!==l||e[17]!==c||e[18]!==d){const P=Sn(s.connections),F=s.connections.reduce(En,s.connections[0]),J=F.updated_at??F.created_at;x=be;const q=`${s.connections.length} instances`;e[30]!==s.icon||e[31]!==s.title||e[32]!==q?(b={title:s.title,icon:s.icon,description:q},e[30]=s.icon,e[31]=s.title,e[32]=q,e[33]=b):b=e[33],e[34]!==N||e[35]!==s.connections||e[36]!==r||e[37]!==m||e[38]!==l||e[39]!==c?(D=()=>c?(()=>{for(const _ of s.connections)N?l.has(_.id)&&m(_.id):l.has(_.id)||m(_.id)})():r(),e[34]=N,e[35]=s.connections,e[36]=r,e[37]=m,e[38]=l,e[39]=c,e[40]=D):D=e[40];const U=c&&N&&"ring-2 ring-primary",X=c&&d&&!N&&"ring-1 ring-primary/50";e[41]!==U||e[42]!==X?(I=he(U,X),e[41]=U,e[42]=X,e[43]=I):I=e[43],e[44]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(ae,{}),e[44]=v):v=e[44],e[45]!==N||e[46]!==s.connections||e[47]!==m||e[48]!==l||e[49]!==c||e[50]!==d?(f=c?t.jsx(pt,{checked:N?!0:d?"indeterminate":!1,onCheckedChange:()=>{for(const _ of s.connections)N?l.has(_.id)&&m(_.id):l.has(_.id)||m(_.id)}}):t.jsxs(Ve,{variant:"secondary",className:"text-xs tabular-nums",children:["x",s.connections.length]}),e[45]=N,e[46]=s.connections,e[47]=m,e[48]=l,e[49]=c,e[50]=d,e[51]=f):f=e[51];let E;e[52]!==s.connections?(E=s.connections.slice(0,6).map($n),e[52]=s.connections,e[53]=E):E=e[53],e[54]!==E?(h=t.jsx("div",{className:"flex items-center gap-1",children:E}),e[54]=E,e[55]=h):h=e[55],T="flex items-center justify-between text-xs text-muted-foreground w-full min-w-0";const M=P.map(_=>t.jsx(Xt,{id:_,size:"3xs",avatarOnly:P.length>1},_));e[56]!==M?(C=t.jsx("div",{className:"flex items-center -space-x-1.5",children:M}),e[56]=M,e[57]=C):C=e[57],y="shrink-0 ml-2",k=J?lt(new Date(J)):"—",e[10]=N,e[11]=s.connections,e[12]=s.icon,e[13]=s.title,e[14]=r,e[15]=m,e[16]=l,e[17]=c,e[18]=d,e[19]=x,e[20]=v,e[21]=f,e[22]=h,e[23]=y,e[24]=k,e[25]=T,e[26]=C,e[27]=b,e[28]=D,e[29]=I}else x=e[19],v=e[20],f=e[21],h=e[22],y=e[23],k=e[24],T=e[25],C=e[26],b=e[27],D=e[28],I=e[29];let $;e[58]!==y||e[59]!==k?($=t.jsx("span",{className:y,children:k}),e[58]=y,e[59]=k,e[60]=$):$=e[60];let O;e[61]!==$||e[62]!==T||e[63]!==C?(O=t.jsxs("div",{className:T,children:[C,$]}),e[61]=$,e[62]=T,e[63]=C,e[64]=O):O=e[64];let R;return e[65]!==x||e[66]!==v||e[67]!==f||e[68]!==h||e[69]!==O||e[70]!==b||e[71]!==D||e[72]!==I?(R=t.jsx(t.Fragment,{children:t.jsx(x,{connection:b,onClick:D,className:I,fallbackIcon:v,headerActions:f,body:h,footer:O})}),e[65]=x,e[66]=v,e[67]=f,e[68]=h,e[69]=O,e[70]=b,e[71]=D,e[72]=I,e[73]=R):R=e[73],R}function $n(i){return t.jsx(Bt,{status:i.status},i.id)}function En(i,e){const s=e.updated_at??e.created_at,r=i.updated_at??i.created_at;return s?r?new Date(s)>new Date(r)?e:i:e:i}function Ln(i){const e=de.c(28),{count:s,total:r,onSelectAll:c,onDeselectAll:l,onDelete:m,onAddToAgent:g,onToggleStatus:N,onCancel:j}=i;if(s===0)return null;let d;e[0]!==s?(d=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[s," selected"]}),e[0]=s,e[1]=d):d=e[1];let x;e[2]!==s||e[3]!==l||e[4]!==c||e[5]!==r?(x=s<r?t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:c,children:["Select all (",r,")"]}):t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:"Clear selection"}),e[2]=s,e[3]=l,e[4]=c,e[5]=r,e[6]=x):x=e[6];let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(mt,{size:13}),e[7]=v):v=e[7];let f;e[8]!==g?(f=t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:[v,"Add to Agent"]}),e[8]=g,e[9]=f):f=e[9];let h;e[10]!==N?(h=t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("active"),children:"Enable"}),e[10]=N,e[11]=h):h=e[11];let y;e[12]!==N?(y=t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("inactive"),children:"Disable"}),e[12]=N,e[13]=y):y=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(xt,{size:13}),e[14]=k):k=e[14];let T;e[15]!==m?(T=t.jsxs(z,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:[k,"Delete"]}),e[15]=m,e[16]=T):T=e[16];let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(jn,{size:13}),e[17]=C):C=e[17];let b;e[18]!==j?(b=t.jsx(z,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:j,children:C}),e[18]=j,e[19]=b):b=e[19];let D;return e[20]!==d||e[21]!==b||e[22]!==x||e[23]!==f||e[24]!==h||e[25]!==y||e[26]!==T?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[d,x,f,h,y,T,b]})}),e[20]=d,e[21]=b,e[22]=x,e[23]=f,e[24]=h,e[25]=y,e[26]=T,e[27]=D):D=e[27],D}function On(i){const e=de.c(25),{open:s,onOpenChange:r,agents:c,onConfirm:l}=i,[m,g]=Y.useState(null);let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsxs(Ue,{children:[t.jsx(Fe,{children:"Add to Agent"}),t.jsx(at,{children:"Select an agent to add the selected connections to."})]}),e[0]=N):N=e[0];let j;e[1]!==c||e[2]!==m?(j=c.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):c.map(C=>t.jsxs("button",{type:"button",onClick:()=>g(C.id),className:he("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",m===C.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(ge,{icon:C.icon,name:C.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:C.title}),C.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:C.description})]})]},C.id)),e[1]=c,e[2]=m,e[3]=j):j=e[3];let d;e[4]!==j?(d=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[4]=j,e[5]=d):d=e[5];let x;e[6]!==r?(x=t.jsx(z,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e[6]=r,e[7]=x):x=e[7];const v=!m;let f;e[8]!==l||e[9]!==r||e[10]!==m?(f=()=>{m&&(l(m),r(!1),g(null))},e[8]=l,e[9]=r,e[10]=m,e[11]=f):f=e[11];let h;e[12]!==v||e[13]!==f?(h=t.jsx(z,{disabled:v,onClick:f,children:"Add"}),e[12]=v,e[13]=f,e[14]=h):h=e[14];let y;e[15]!==x||e[16]!==h?(y=t.jsxs(dt,{children:[x,h]}),e[15]=x,e[16]=h,e[17]=y):y=e[17];let k;e[18]!==d||e[19]!==y?(k=t.jsxs(Me,{className:"sm:max-w-[400px]",children:[N,d,y]}),e[18]=d,e[19]=y,e[20]=k):k=e[20];let T;return e[21]!==r||e[22]!==s||e[23]!==k?(T=t.jsx(Be,{open:s,onOpenChange:r,children:k}),e[21]=r,e[22]=s,e[23]=k,e[24]=T):T=e[24],T}function zn(i){const e=de.c(20),{open:s,onOpenChange:r,count:c,onConfirm:l}=i,m=c!==1?"s":"";let g;e[0]!==c||e[1]!==m?(g=t.jsxs($e,{children:["Delete ",c," connection",m,"?"]}),e[0]=c,e[1]=m,e[2]=g):g=e[2];const N=c!==1?"s":"";let j;e[3]!==N?(j=t.jsxs(Ee,{children:["This will permanently delete the selected connection",N,". This action cannot be undone."]}),e[3]=N,e[4]=j):j=e[4];let d;e[5]!==g||e[6]!==j?(d=t.jsxs(Pe,{children:[g,j]}),e[5]=g,e[6]=j,e[7]=d):d=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Oe,{children:"Cancel"}),e[8]=x):x=e[8];const v=c!==1?"s":"";let f;e[9]!==c||e[10]!==l||e[11]!==v?(f=t.jsxs(Le,{children:[x,t.jsxs(ze,{onClick:l,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",c," connection",v]})]}),e[9]=c,e[10]=l,e[11]=v,e[12]=f):f=e[12];let h;e[13]!==d||e[14]!==f?(h=t.jsxs(Ae,{children:[d,f]}),e[13]=d,e[14]=f,e[15]=h):h=e[15];let y;return e[16]!==r||e[17]!==s||e[18]!==h?(y=t.jsx(Ie,{open:s,onOpenChange:r,children:h}),e[16]=r,e[17]=s,e[18]=h,e[19]=y):y=e[19],y}function Vn(){const{org:i}=rt(),e=Dt(),s=ct(),r=It({strict:!1}),{data:c}=At.useSession(),{stdioEnabled:l}=Pt(),m=qt({namespace:i.slug,resource:"connections"}),g=an(),N=st(m),j=st(),[d,x]=Y.useReducer(An,{mode:"idle"}),[v,f]=Y.useState(new Set),h=v.size>0,[y,k]=Y.useState(!1),[T,C]=Y.useState(!1),[b,D]=Y.useState("all"),[I,$]=Y.useState(null),[O,R]=Y.useState("ALL"),[P,F]=Y.useState("ALL"),J=pn(),U=N.filter(n=>!(n.connection_type==="VIRTUAL"||O!=="ALL"&&n.connection_type!==O||P!=="ALL"&&n.status!==P)),X=bn(U),E=n=>{f(o=>{const a=new Set(o);return a.has(n)?a.delete(n):a.add(n),a})},M=()=>{f(new Set)},_=Kt(j).sort((n,o)=>{const a=n.app_name==="@deco/management-mcp",u=o.app_name==="@deco/management-mcp";return a&&!u?1:!a&&u?-1:0}),[K,ie]=Ht($t.selectedRegistry(i.slug),n=>n??""),ce=(K?_.find(n=>n.id===K):void 0)??_[0],w=ce?.id??"",V=Wt(ce?.tools),W=Qt({registryId:w,listToolName:V}),_e=W.items,ht=Gt(W.loadMore,W.hasMore,W.isLoadingMore),Re=new Set(j.filter(n=>n.connection_type!=="VIRTUAL"&&n.app_name).map(n=>n.app_name)),ke=m.search.toLowerCase(),He=b==="all"?_e.filter(n=>{if(!ke)return!0;const o=n._meta?.["mcp.mesh"],a=[o?.friendly_name,n.server?.name,n.server?.title,n.name,n.title,n.id].filter(Boolean).join(" "),u=[o?.short_description,o?.mesh_description,n.server?.description,n.description].filter(Boolean).join(" ");return a.toLowerCase().includes(ke)||u.toLowerCase().includes(ke)}):[],Te=He.filter(n=>n.verified||n._meta?.["mcp.mesh"]?.verified||n.meta?.verified),we=He.filter(n=>!n.verified&&!n._meta?.["mcp.mesh"]?.verified&&!n.meta?.verified),gt=b==="all"?[]:X,je=n=>{const o=Yt(n.name||n.title||n.server?.title||""),a=typeof n.id=="string"&&n.id.includes("/"),u=typeof n.server?.name=="string"&&n.server.name.includes("/"),S=a&&!u?n.id:n.server?.name||n.id||"";s({to:"/$org/$project/store/$appName",params:{org:i.slug,project:re,appName:o},search:{registryId:w,serverName:S}})},Xe=r.action==="create",jt=()=>{s({to:"/$org/$project/mcps",params:{org:i.slug,project:re},search:{action:"create"}})},Ke=()=>{s({to:"/$org/$project/mcps",params:{org:i.slug,project:re},search:{}})},p=Et({resolver:Lt(Cn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),H=p.watch("ui_type"),We=p.watch("connection_url"),yt=p.watch("npx_package"),me=Ne({uiType:H,connectionUrl:We??"",npxPackage:yt??""})??it({uiType:H,connectionUrl:We??"",registryItems:_e}),A=d.mode==="editing"?d.connection:null;Y.useEffect(()=>{if(A){const n=Ot(A.connection_headers)?A.connection_headers:null;if(n&&A.connection_type==="STDIO"){const o=yn(n.envVars);if(wn(n)){const a=Dn(n);p.reset({title:A.title,description:A.description,icon:A.icon??null,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o})}else{const a=In(n);p.reset({title:A.title,description:A.description,icon:A.icon??null,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:o})}}else p.reset({title:A.title,description:A.description,icon:A.icon??null,ui_type:A.connection_type,connection_url:A.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else p.reset({title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[A,p]);const pe=dn({connectionId:mn,orgId:i.id}),ye=()=>{e.invalidateQueries({predicate:n=>{const o=n.queryKey;return o[1]===i.id&&o[3]==="collection"&&o[4]==="CONNECTIONS"}})},vt=async()=>{k(!1);const n=[...v];let o=0;for(const a of n)try{(await pe.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:a,force:!0}})).isError||o++}catch{}ye(),Q.success(`Deleted ${o} connection${o!==1?"s":""}`),M()},Ct=async n=>{const o=[...v];let a=0;for(const u of o)try{await g.update.mutateAsync({id:u,data:{status:n}}),a++}catch{}ye(),Q.success(`${n==="active"?"Enabled":"Disabled"} ${a} connection${a!==1?"s":""}`),M()},Nt=async n=>{const o=J.find(S=>S.id===n);if(!o||!pe)return;const a=new Set(o.connections.map(S=>S.connection_id)),u=[...v].filter(S=>!a.has(S)).map(S=>({connection_id:S,selected_tools:null,selected_resources:null,selected_prompts:null}));if(u.length===0){Q.info("All selected connections are already in that agent");return}try{await pe.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:n,data:{connections:[...o.connections,...u]}}}),e.invalidateQueries({predicate:S=>{const L=S.queryKey;return L[1]===i.id&&L[3]==="collection"&&L[4]==="VIRTUAL_MCP"}}),Q.success(`Added ${u.length} connection${u.length!==1?"s":""} to "${o.title}"`),M()}catch{Q.error("Failed to add connections to agent")}},Ge=n=>{const o=n.content;return Array.isArray(o)&&o[0]?.type==="text"&&typeof o[0].text=="string"?o[0].text:"Unknown error"},bt=async()=>{if(d.mode!=="deleting")return;const n=d.connection;x({type:"close"});try{const o=await pe.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:n.id}});if(o.isError){const a=Ge(o),u=a.replace(/^Error:\s*/,"");try{const S=JSON.parse(u);if(S.code==="CONNECTION_IN_USE"&&S.agentNames){x({type:"force-delete",connection:n,agentNames:S.agentNames.map(L=>`"${L}"`).join(", ")});return}}catch{}Q.error(`Failed to delete connection: ${a}`);return}ye(),Q.success("Connection deleted successfully")}catch(o){const a=o instanceof Error?o.message:String(o);Q.error(`Failed to delete connection: ${a}`)}},St=async()=>{if(d.mode!=="force-deleting")return;const n=d.connection.id;x({type:"close"});try{const o=await pe.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:n,force:!0}});if(o.isError){Q.error(`Failed to delete connection: ${Ge(o)}`);return}ye(),Q.success("Connection deleted successfully")}catch(o){const a=o instanceof Error?o.message:String(o);Q.error(`Failed to delete connection: ${a}`)}},_t=async n=>{let o,a=null,u=null,S=null;if(n.ui_type==="NPX"?(o="STDIO",a="",S=kn(n.npx_package||"",n.env_vars||[])):n.ui_type==="STDIO"?(o="STDIO",a="",S=Tn(n.stdio_command||"",n.stdio_args||"",n.stdio_cwd,n.env_vars||[])):(o=n.ui_type,a=n.connection_url||"",u=n.connection_token||null),A){await g.update.mutateAsync({id:A.id,data:{title:n.title,description:n.description||null,icon:n.icon??null,connection_type:o,connection_url:a,...u&&{connection_token:u},...S&&{connection_headers:S}}}),x({type:"close"}),p.reset();return}const L=zt("conn");await g.create.mutateAsync({id:L,title:n.title,description:n.description||null,connection_type:o,connection_url:a,connection_token:u,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:c?.user?.id||"system",organization_id:i.id,icon:n.icon??null,app_name:null,app_id:null,connection_headers:S,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),Ke(),p.reset(),s({to:"/$org/$project/mcps/$connectionId",params:{org:i.slug,project:re,connectionId:L}})},qe=n=>{n||(Xe?Ke():x({type:"close"}),p.reset())},ve=n=>{const o=n.trim();if(!o)return;const a=!!p.formState.dirtyFields.title,u=!!p.formState.dirtyFields.description,S=!!p.formState.dirtyFields.env_vars,L=B=>{if(B&&(!a&&!p.getValues("title").trim()&&B.title&&p.setValue("title",B.title,{shouldDirty:!1}),!u&&!(p.getValues("description")??"").trim()&&B.description&&p.setValue("description",B.description,{shouldDirty:!1}),!S&&B.envVarKeys?.length)){const G=p.getValues("env_vars")??[],Tt=new Set(G.map(ue=>ue.key)),Qe=B.envVarKeys.filter(ue=>!Tt.has(ue));Qe.length>0&&p.setValue("env_vars",[...G,...Qe.map(ue=>({key:ue,value:""}))],{shouldDirty:!0})}},oe=_n(o);if(oe&&l){p.setValue("ui_type","NPX",{shouldDirty:!0}),p.setValue("npx_package",oe.packageName,{shouldDirty:!0}),p.setValue("connection_url","",{shouldDirty:!0}),p.setValue("connection_token",null,{shouldDirty:!0}),L(Ne({uiType:"NPX",npxPackage:oe.packageName}));return}if(o.startsWith("http://")||o.startsWith("https://")){const B=H==="HTTP"||H==="SSE"||H==="Websocket"?H:"HTTP";p.setValue("ui_type",B,{shouldDirty:!0}),p.setValue("connection_url",o,{shouldDirty:!0}),L(Ne({uiType:B,connectionUrl:o})??it({uiType:B,connectionUrl:o,registryItems:_e}));return}H==="NPX"&&L(Ne({uiType:"NPX",npxPackage:o}))},kt=t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(z,{variant:"outline",onClick:jt,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})});return t.jsxs(t.Fragment,{children:[t.jsxs(xe,{children:[t.jsx(Be,{open:Xe||d.mode==="editing",onOpenChange:qe,children:t.jsxs(Me,{className:"sm:max-w-[525px]",children:[t.jsxs(Ue,{children:[t.jsx(Fe,{children:A?"Edit Connection":"Create Connection"}),t.jsx(at,{children:A?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),t.jsx(nn,{...p,children:t.jsxs("form",{onSubmit:p.handleSubmit(_t),children:[t.jsxs("div",{className:"grid gap-4 py-4",children:[t.jsx(Z,{control:p.control,name:"ui_type",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Type *"}),t.jsxs(sn,{value:n.value,onValueChange:n.onChange,children:[t.jsx(ne,{children:t.jsx(on,{children:t.jsx(rn,{})})}),t.jsxs(cn,{children:[t.jsx(fe,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(fe,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(fe,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(fe,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ae,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(fe,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(gn,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(se,{})]})}),H==="NPX"&&t.jsx(t.Fragment,{children:t.jsx(Z,{control:p.control,name:"npx_package",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"NPM Package *"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"@perplexity-ai/mcp-server",...n,value:n.value??"",onPaste:o=>{const a=o.clipboardData.getData("text");a&&(o.preventDefault(),p.setValue("npx_package",a.trim(),{shouldDirty:!0}),ve(a))},onBlur:o=>{ve(o.target.value),n.onBlur()}})}),t.jsx(se,{})]})})}),H==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Z,{control:p.control,name:"stdio_command",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Command *"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"node, bun, python...",...n,value:n.value??""})}),t.jsx(se,{})]})}),t.jsx(Z,{control:p.control,name:"stdio_args",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Arguments"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"arg1 arg2 --flag value",...n,value:n.value??""})}),t.jsx(se,{})]})})]}),t.jsx(Z,{control:p.control,name:"stdio_cwd",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Working Directory"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"/path/to/project (optional)",...n,value:n.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(se,{})]})})]}),(H==="NPX"||H==="STDIO")&&t.jsx(Z,{control:p.control,name:"env_vars",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Environment Variables"}),t.jsx(ne,{children:t.jsx(vn,{value:n.value??[],onChange:n.onChange})}),t.jsx(se,{})]})}),H!=="NPX"&&H!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Z,{control:p.control,name:"connection_url",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"URL *"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"https://example.com/mcp",...n,value:n.value??"",onPaste:o=>{const a=o.clipboardData.getData("text");a&&(o.preventDefault(),p.setValue("connection_url",a.trim(),{shouldDirty:!0}),ve(a))},onBlur:o=>{ve(o.target.value),n.onBlur()}})}),t.jsx(se,{})]})}),t.jsx(Z,{control:p.control,name:"connection_token",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:me?.token?.label??"Token (optional)"}),t.jsx(ne,{children:t.jsx(le,{type:"password",placeholder:me?.token?.placeholder??"Bearer token or API key",...n,value:n.value??""})}),me?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[me.token.helperText,me.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(se,{})]})})]}),t.jsx(Z,{control:p.control,name:"title",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Name *"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"My Connection",...n})}),t.jsx(se,{})]})}),t.jsx(Z,{control:p.control,name:"description",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Description"}),t.jsx(ne,{children:t.jsx(ln,{placeholder:"A brief description of this connection",rows:3,...n,value:n.value??""})}),t.jsx(se,{})]})})]}),t.jsxs(dt,{children:[t.jsx(z,{type:"button",variant:"outline",onClick:()=>qe(!1),children:"Cancel"}),t.jsx(z,{type:"submit",disabled:p.formState.isSubmitting,className:"min-w-40",children:p.formState.isSubmitting?"Saving...":A?"Update Connection":"Create Connection"})]})]})})]})}),t.jsx(Ie,{open:d.mode==="deleting",onOpenChange:n=>!n&&x({type:"close"}),children:t.jsxs(Ae,{children:[t.jsxs(Pe,{children:[t.jsx($e,{children:"Delete Connection?"}),t.jsxs(Ee,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:d.mode==="deleting"&&d.connection.title}),"."]})]}),t.jsxs(Le,{children:[t.jsx(Oe,{children:"Cancel"}),t.jsx(ze,{onClick:bt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),t.jsx(Ie,{open:d.mode==="force-deleting",onOpenChange:n=>!n&&x({type:"close"}),children:t.jsxs(Ae,{children:[t.jsxs(Pe,{children:[t.jsx($e,{children:"Connection Used by Agents"}),t.jsx(Ee,{asChild:!0,children:t.jsxs("div",{children:[t.jsxs("p",{children:["The connection"," ",t.jsx("span",{className:"font-medium text-foreground",children:d.mode==="force-deleting"&&d.connection.title})," ","is currently used by the following agent(s):"," ",t.jsx("span",{className:"font-medium text-foreground",children:d.mode==="force-deleting"&&d.agentNames}),"."]}),t.jsx("p",{className:"mt-2",children:"Deleting this connection will remove it from those agents, which may impact existing workflows that depend on them."})]})})]}),t.jsxs(Le,{children:[t.jsx(Oe,{children:"Cancel"}),t.jsx(ze,{onClick:St,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]})]})}),t.jsx(zn,{open:y,onOpenChange:k,count:v.size,onConfirm:vt}),t.jsx(On,{open:T,onOpenChange:C,agents:J,onConfirm:Nt}),t.jsxs(xe.Header,{children:[t.jsx(xe.Header.Left,{children:t.jsx(Jt,{children:t.jsx(Zt,{children:t.jsx(en,{children:t.jsx(tn,{children:"Connections"})})})})}),t.jsxs(xe.Header.Right,{children:[t.jsx(Vt,{sortKey:m.sortKey,sortDirection:m.sortDirection,onSort:m.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:O,onChange:n=>R(n||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:P,onChange:n=>F(n||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]}]}),kt]})]}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("div",{children:t.jsx(Ft,{value:m.search,onChange:m.setSearch,placeholder:"Search for a Connection...",onKeyDown:n=>{n.key==="Escape"&&(m.setSearch(""),n.target.blur())}})}),t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border",children:[t.jsx(Ut,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:b,onTabChange:n=>D(n)}),_.length>0&&t.jsx("div",{className:he(b!=="all"&&"invisible pointer-events-none"),children:t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 px-2 gap-1.5 text-sm font-normal",children:[(()=>{const n=_.find(o=>o.id===(K||_[0]?.id))??_[0];return t.jsxs(t.Fragment,{children:[t.jsx(ge,{icon:n?.icon,name:n?.title??"",size:"2xs",className:"shrink-0 rounded-sm"}),t.jsx("span",{children:n?.title})]})})(),t.jsx(xn,{size:14,className:"text-muted-foreground"})]})}),t.jsx(nt,{align:"end",children:_.map(n=>t.jsxs(Ce,{onClick:()=>ie(n.id),className:he(K===n.id||!K&&n.id===_[0]?.id?"bg-accent":""),children:[t.jsx(ge,{icon:n.icon,name:n.title,size:"2xs",className:"shrink-0 rounded-sm"}),n.title]},n.id))})]})})]})]}),t.jsx(xe.Content,{children:t.jsx("div",{className:"flex-1 overflow-auto p-5",children:(b==="all"?Te.length===0&&we.length===0:U.length===0)?t.jsx(Rt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:m.search?`No Connections match "${m.search}"`:"Create a connection to get started."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[gt.map(n=>{if(n.type==="group")return t.jsx(Pn,{group:n,onOpen:()=>$({appName:n.title,appIcon:n.icon,instances:n.connections}),selectionMode:h,selectedIds:v,onToggleSelect:E},n.key);const o=n.connection,a=v.has(o.id);return t.jsx(be,{connection:o,fallbackIcon:t.jsx(ae,{}),onClick:()=>h?E(o.id):$({appName:o.app_name||o.title,appIcon:o.icon,appDescription:o.description,instances:[o]}),className:he(a&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:h,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[h&&t.jsx(pt,{checked:a,onCheckedChange:()=>E(o.id),onClick:u=>u.stopPropagation()}),t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:u=>u.stopPropagation(),children:t.jsx(fn,{size:20})})}),t.jsxs(nt,{align:"end",onClick:u=>u.stopPropagation(),children:[t.jsxs(Ce,{onClick:u=>{u.stopPropagation(),s({to:"/$org/$project/mcps/$connectionId",params:{org:i.slug,project:re,connectionId:o.id}})},children:[t.jsx(hn,{size:16}),"Open"]}),t.jsxs(Ce,{onClick:u=>{u.stopPropagation(),E(o.id)},children:[t.jsx(Mt,{size:16}),"Select"]}),t.jsxs(Ce,{variant:"destructive",onClick:u=>{u.stopPropagation(),x({type:"delete",connection:o})},children:[t.jsx(xt,{size:16}),"Delete"]})]})]})]})},o.id)}),b==="all"&&Te.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(un,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"Verified"}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Te.map(n=>{const o=n.server?.name||n.name||n.id||"",a=Re.has(o),u=n._meta?.["mcp.mesh"],S=u?.friendlyName||u?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",L=n.server?.description||n.description||null,oe=n.server?.icons?.[0]?.src||Ze(n.server?.repository)||null,B=j.filter(G=>G.connection_type!=="VIRTUAL"&&G.app_name===o);return t.jsx(be,{connection:{title:S,description:L,icon:oe},fallbackIcon:t.jsx(ae,{}),onClick:()=>a?$({appName:S,appIcon:oe,appDescription:L,instances:B}):je(n),headerActionsAlwaysVisible:!0,headerActions:a?t.jsx(Ve,{variant:"secondary",className:"text-xs",children:"Connected"}):t.jsx(z,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:G=>{G.stopPropagation(),je(n)},children:"Connect"})},`catalog-${n.id}`)}),b==="all"&&we.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"All connections"}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),we.map(n=>{const o=n.server?.name||n.name||n.id||"",a=Re.has(o),u=n._meta?.["mcp.mesh"],S=u?.friendlyName||u?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",L=n.server?.description||n.description||null,oe=n.server?.icons?.[0]?.src||Ze(n.server?.repository)||null,B=j.filter(G=>G.connection_type!=="VIRTUAL"&&G.app_name===o);return t.jsx(be,{connection:{title:S,description:L,icon:oe},fallbackIcon:t.jsx(ae,{}),onClick:()=>a?$({appName:S,appIcon:oe,appDescription:L,instances:B}):je(n),headerActionsAlwaysVisible:!0,headerActions:a?t.jsx(Ve,{variant:"secondary",className:"text-xs",children:"Connected"}):t.jsx(z,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:G=>{G.stopPropagation(),je(n)},children:"Connect"})},`catalog-${n.id}`)}),b==="all"&&w&&t.jsx("div",{ref:ht,className:"col-span-full h-4"}),b==="all"&&W.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ut,{size:24,className:"animate-spin text-muted-foreground"})})]})})}),h&&t.jsx(Ln,{count:v.size,total:U.length,onSelectAll:()=>{f(new Set(U.map(n=>n.id)))},onDeselectAll:()=>f(new Set),onDelete:()=>k(!0),onAddToAgent:()=>C(!0),onToggleStatus:Ct,onCancel:M})]}),I&&t.jsx(Nn,{open:!0,onClose:()=>$(null),appName:I.appName,appIcon:I.appIcon,appDescription:I.appDescription,instances:I.instances})]})}function Zs(){const i=de.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(wt,{children:t.jsx(Y.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ut,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Vn,{})})}),i[0]=e):e=i[0],e}export{Zs as default};
|
|
1
|
+
import{c as de,u as rt,e as ct,j as t,O as re,B as z,E as wt,r as Y,w as Dt,d as It,f as At,at as Pt,aw as $t,t as Et,q as Lt,b as Ot,y as he,v as Q}from"./index-OyLnxARk.js";import{g as zt}from"./generate-id-Dyweu44Y.js";import{C as Vt}from"./collection-display-button-BJQ_VSFQ.js";import{C as Ft}from"./collection-search-D6ILFEtf.js";import{C as Ut}from"./collection-tabs-fsXO7rse.js";import{C as be}from"./connection-card-CoZ_ixiG.js";import{I as ge}from"./integration-icon-B3aufi6R.js";import{f as lt}from"./format-time-CMKyl-GC.js";import{D as Fe,b as Ue,c as Me,d as Be,a as at,e as dt}from"./dialog-ZIc7OUaM.js";import{i as Ye}from"./ChevronRight-B3gSyJmK.js";import{n as ae}from"./Container-CQmXt7Nc.js";import{s as mt}from"./Plus-1vH_gFoY.js";import{a as Je}from"./Tool01-3i6uRXKJ.js";import{i as Mt,C as Bt}from"./connection-status-CulzjjXt.js";import{E as Rt}from"./empty-state-gZUVmgL7.js";import{a as Ht,P as xe}from"./index-DKWOGpkx.js";import{U as Xt}from"./user-BLAfg6Ev.js";import{u as Kt,f as Wt,g as Ze}from"./registry-utils-D0qx2c0_.js";import{u as Gt}from"./use-infinite-scroll-CSG4wWka.js";import{u as qt}from"./use-list-state-CVKHwo0P.js";import{u as Qt}from"./use-store-discovery-W6XcrfUT.js";import{s as Yt}from"./slugify-CEUa2lfQ.js";import{f as Ie,a as Ae,b as Pe,c as $e,d as Ee,e as Le,A as Oe,h as ze}from"./alert-dialog-BZtQAioB.js";import{B as Ve}from"./badge-BTw8dF6C.js";import{B as Jt,a as Zt,b as en,c as tn}from"./breadcrumb-CcE89MsN.js";import{C as pt}from"./checkbox-BA_JFbx4.js";import{D as et,a as tt,b as nt,c as Ce}from"./dropdown-menu-EcTFyr4x.js";import{a as nn,F as Z,b as ee,c as te,d as ne,f as se}from"./form-Cd_AEgzv.js";import{I as le}from"./input-B4YrZuiK.js";import{S as sn,a as on,b as rn,c as cn,d as fe}from"./select-Ctls6rHz.js";import{T as ln}from"./textarea-CpLkXx5p.js";import{a as an,b as st}from"./use-connection-B7ll8uNa.js";import{u as dn,a as mn}from"./constants-CLw0F8Mm.js";import{b as pn}from"./use-virtual-mcp-B8SbBr9v.js";import{i as un}from"./CheckVerified02-YYsvmiw4.js";import{t as xn}from"./ChevronDown-C-3qjfHK.js";import{i as fn}from"./DotsVertical-D5tMnzaQ.js";import{s as hn}from"./Eye-MRRTHIte.js";import{s as De}from"./Globe02-CDBspixd.js";import{i as ut}from"./Loading01-BYjTtpy0.js";import{i as gn}from"./Terminal-CvfSVl9m.js";import{s as xt}from"./Trash01-Dmi4vR7Q.js";import{s as jn}from"./XClose-D08ltwBw.js";import{r as yn,E as vn,c as Cn,e as ft}from"./env-vars-editor-CIM7XauD.js";import"./ArrowDown-BPMtK04S.js";import"./ArrowUp-DqOjcDuh.js";import"./Check-DAFdA2oM.js";import"./Grid01-COkHqk9k.js";import"./List-_Z2X7aPf.js";import"./tooltip--UA5heKX.js";import"./index-CRi6734Z.js";import"./SearchMd-Dn4cWwEm.js";import"./card-B6XTMOTf.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./X-Car5B1de.js";import"./AlertCircle-BWr4XQe9.js";import"./CheckCircle-BL2mIAJn.js";import"./useQuery-Brtj4EoG.js";import"./useMutation-B_6d8oLI.js";import"./avatar-DEdDAQ0j.js";import"./binder-B2xnCBeC.js";import"./use-view-mode-CGzXYNrX.js";import"./use-mobile-CgJAXGMs.js";import"./useInfiniteQuery-C9KaycVy.js";import"./infiniteQueryObserver-BkZg7AVk.js";import"./label-BoRKSV_h.js";import"./ChevronUp-Rk5dLXNx.js";import"./use-collections-DXLoMYCx.js";function Nn(i){const e=de.c(63),{open:s,onClose:r,appName:c,appIcon:l,appDescription:m,instances:g}=i,{org:N}=rt(),j=ct(),d=N.slug;let x;e[0]!==j||e[1]!==r||e[2]!==d?(x=function(V){j({to:"/$org/$project/mcps/$connectionId",params:{org:d,project:re,connectionId:V}}),r()},e[0]=j,e[1]=r,e[2]=d,e[3]=x):x=e[3];const v=x;let f;e[4]!==c||e[5]!==j||e[6]!==r||e[7]!==d?(f=function(){j({to:"/$org/$project/mcps",params:{org:d,project:re},search:{install:c}}),r()},e[4]=c,e[5]=j,e[6]=r,e[7]=d,e[8]=f):f=e[8];const h=f;let y;if(e[9]!==g){const w=new Set;y=[];for(const V of g)for(const W of V.tools??[])w.has(W.name)||(w.add(W.name),y.push({name:W.name,description:W.description,connectionId:V.id}));e[9]=g,e[10]=y}else y=e[10];let k;e[11]!==j||e[12]!==r||e[13]!==d?(k=function(V,W){j({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:d,project:re,connectionId:W,collectionName:"tools",itemId:encodeURIComponent(V)}}),r()},e[11]=j,e[12]=r,e[13]=d,e[14]=k):k=e[14];const T=k;let C;e[15]!==r?(C=w=>!w&&r(),e[15]=r,e[16]=C):C=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(ae,{}),e[17]=b):b=e[17];let D;e[18]!==l||e[19]!==c?(D=t.jsx(ge,{icon:l,name:c,size:"md",className:"shrink-0 shadow-sm mt-0.5",fallbackIcon:b}),e[18]=l,e[19]=c,e[20]=D):D=e[20];let I;e[21]!==c?(I=t.jsx(Fe,{className:"text-base font-semibold leading-snug",children:c}),e[21]=c,e[22]=I):I=e[22];let $;e[23]!==m?($=m&&t.jsx("p",{className:"text-sm text-muted-foreground mt-0.5 line-clamp-2",children:m}),e[23]=m,e[24]=$):$=e[24];let O;e[25]!==I||e[26]!==$?(O=t.jsxs("div",{className:"min-w-0",children:[I,$]}),e[25]=I,e[26]=$,e[27]=O):O=e[27];let R;e[28]!==D||e[29]!==O?(R=t.jsx(Ue,{className:"px-6 pt-6 pb-5 shrink-0",children:t.jsxs("div",{className:"flex items-start gap-4",children:[D,O]})}),e[28]=D,e[29]=O,e[30]=R):R=e[30];const P=g.length!==1?"s":"";let F;e[31]!==P?(F=t.jsxs("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:["Connection",P]}),e[31]=P,e[32]=F):F=e[32];let J;e[33]===Symbol.for("react.memo_cache_sentinel")?(J=t.jsx(mt,{size:14}),e[33]=J):J=e[33];let q;e[34]!==h?(q=t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:h,children:[J,"Add connection"]}),e[34]=h,e[35]=q):q=e[35];let U;e[36]!==F||e[37]!==q?(U=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3",children:[F,q]}),e[36]=F,e[37]=q,e[38]=U):U=e[38];let X;if(e[39]!==g||e[40]!==v){let w;e[42]!==v?(w=V=>t.jsxs("button",{type:"button",className:"w-full flex items-center gap-3 px-6 py-3 hover:bg-muted/40 transition-colors text-left cursor-pointer",onClick:()=>v(V.id),children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:V.title}),(V.updated_at||V.created_at)&&t.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Last updated"," ",lt(new Date(V.updated_at??V.created_at))]})]}),t.jsx(Ye,{size:16,className:"text-muted-foreground shrink-0"})]},V.id),e[42]=v,e[43]=w):w=e[43],X=g.map(w),e[39]=g,e[40]=v,e[41]=X}else X=e[41];let E;e[44]!==X?(E=t.jsx("div",{className:"pb-2",children:X}),e[44]=X,e[45]=E):E=e[45];let M;e[46]!==U||e[47]!==E?(M=t.jsxs("div",{children:[U,E]}),e[46]=U,e[47]=E,e[48]=M):M=e[48];let _;e[49]!==l||e[50]!==T||e[51]!==y?(_=y.length>0&&t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 px-6 py-3",children:[t.jsx(Je,{size:14,className:"text-muted-foreground"}),t.jsxs("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:["Tools (",y.length,")"]})]}),t.jsx("div",{className:"pb-2",children:y.map(w=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-6 py-2.5 hover:bg-muted/40 transition-colors text-left cursor-pointer",onClick:()=>T(w.name,w.connectionId),children:[t.jsx(ge,{icon:l,name:w.name,size:"xs",className:"shrink-0 mt-0.5",fallbackIcon:t.jsx(Je,{size:12})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:w.name}),w.description&&t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:w.description})]}),t.jsx(Ye,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},w.name))})]}),e[49]=l,e[50]=T,e[51]=y,e[52]=_):_=e[52];let K;e[53]!==M||e[54]!==_?(K=t.jsxs("div",{className:"flex-1 overflow-y-auto divide-y divide-border",children:[M,_]}),e[53]=M,e[54]=_,e[55]=K):K=e[55];let ie;e[56]!==R||e[57]!==K?(ie=t.jsxs(Me,{className:"sm:max-w-xl p-0 gap-0 overflow-hidden flex flex-col max-h-[80vh]",children:[R,K]}),e[56]=R,e[57]=K,e[58]=ie):ie=e[58];let ce;return e[59]!==s||e[60]!==ie||e[61]!==C?(ce=t.jsx(Be,{open:s,onOpenChange:C,children:ie}),e[59]=s,e[60]=ie,e[61]=C,e[62]=ce):ce=e[62],ce}function ot(i){return i.title.trim().replace(/\s+\(\d+\)$/,"")}function bn(i){const e=new Map;for(const c of i){if(c.connection_type==="VIRTUAL")continue;const l=ot(c),m=e.get(l);m?m.push(c):e.set(l,[c])}const s=[],r=new Set;for(const c of i){if(c.connection_type==="VIRTUAL")continue;const l=ot(c);if(r.has(l))continue;r.add(l);const m=e.get(l),g=m[0];m.length===1?s.push({type:"single",connection:g}):s.push({type:"group",key:l,icon:g.icon,title:g.app_name?g.title.replace(/\s*\(\d+\)\s*$/,""):g.title,connections:m})}return s}function Sn(i){const e=new Set,s=[];for(const r of i)r.created_by&&!e.has(r.created_by)&&(e.add(r.created_by),s.push(r.created_by));return s}function Se(i){const e=i.trim();if(!e)return"";try{const s=new URL(e),r=s.pathname.length>1?s.pathname.replace(/\/+$/,""):s.pathname;return`${s.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function _n(i){const e=i.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const s=e[0]?.toLowerCase();if(s!=="npx"&&s!=="bunx")return null;const c=e.slice(1).find(l=>!l.startsWith("-"));return c?{packageName:c}:null}function Ne(i){const{uiType:e}=i,s=Se(i.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&s===Se("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(i.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function it(i){if(i.registryItems.length===0||i.uiType!=="HTTP"&&i.uiType!=="SSE"&&i.uiType!=="Websocket")return null;const e=Se(i.connectionUrl??"");if(!e)return null;const s=i.registryItems.find(l=>(l.server?.remotes??[]).some(g=>Se(g.url??"")===e));if(!s)return null;const r=s.title||s.name||s.server?.title||s.server?.name||"",c=s.server?.description||s.description||s.summary||null;return r?{id:"registry",title:r,description:c}:null}function kn(i,e){const s={command:"npx",args:["-y",i]},r=ft(e);return Object.keys(r).length>0&&(s.envVars=r),s}function Tn(i,e,s,r){const c={command:i};e.trim()&&(c.args=e.trim().split(/\s+/)),s?.trim()&&(c.cwd=s.trim());const l=ft(r);return Object.keys(l).length>0&&(c.envVars=l),c}function wn(i){return i.command==="npx"}function Dn(i){return i.args?.find(e=>!e.startsWith("-"))??""}function In(i){return{command:i.command,args:i.args?.join(" ")??"",cwd:i.cwd??""}}function An(i,e){switch(e.type){case"edit":return{mode:"editing",connection:e.connection};case"delete":return{mode:"deleting",connection:e.connection};case"force-delete":return{mode:"force-deleting",connection:e.connection,agentNames:e.agentNames};case"close":return{mode:"idle"}}}function Pn(i){const e=de.c(74),{group:s,onOpen:r,selectionMode:c,selectedIds:l,onToggleSelect:m}=i;let g;if(e[0]!==s.connections||e[1]!==l){let P;e[3]!==l?(P=F=>l.has(F.id),e[3]=l,e[4]=P):P=e[4],g=s.connections.every(P),e[0]=s.connections,e[1]=l,e[2]=g}else g=e[2];const N=g;let j;if(e[5]!==s.connections||e[6]!==l){let P;e[8]!==l?(P=F=>l.has(F.id),e[8]=l,e[9]=P):P=e[9],j=s.connections.some(P),e[5]=s.connections,e[6]=l,e[7]=j}else j=e[7];const d=j;let x,v,f,h,y,k,T,C,b,D,I;if(e[10]!==N||e[11]!==s.connections||e[12]!==s.icon||e[13]!==s.title||e[14]!==r||e[15]!==m||e[16]!==l||e[17]!==c||e[18]!==d){const P=Sn(s.connections),F=s.connections.reduce(En,s.connections[0]),J=F.updated_at??F.created_at;x=be;const q=`${s.connections.length} instances`;e[30]!==s.icon||e[31]!==s.title||e[32]!==q?(b={title:s.title,icon:s.icon,description:q},e[30]=s.icon,e[31]=s.title,e[32]=q,e[33]=b):b=e[33],e[34]!==N||e[35]!==s.connections||e[36]!==r||e[37]!==m||e[38]!==l||e[39]!==c?(D=()=>c?(()=>{for(const _ of s.connections)N?l.has(_.id)&&m(_.id):l.has(_.id)||m(_.id)})():r(),e[34]=N,e[35]=s.connections,e[36]=r,e[37]=m,e[38]=l,e[39]=c,e[40]=D):D=e[40];const U=c&&N&&"ring-2 ring-primary",X=c&&d&&!N&&"ring-1 ring-primary/50";e[41]!==U||e[42]!==X?(I=he(U,X),e[41]=U,e[42]=X,e[43]=I):I=e[43],e[44]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(ae,{}),e[44]=v):v=e[44],e[45]!==N||e[46]!==s.connections||e[47]!==m||e[48]!==l||e[49]!==c||e[50]!==d?(f=c?t.jsx(pt,{checked:N?!0:d?"indeterminate":!1,onCheckedChange:()=>{for(const _ of s.connections)N?l.has(_.id)&&m(_.id):l.has(_.id)||m(_.id)}}):t.jsxs(Ve,{variant:"secondary",className:"text-xs tabular-nums",children:["x",s.connections.length]}),e[45]=N,e[46]=s.connections,e[47]=m,e[48]=l,e[49]=c,e[50]=d,e[51]=f):f=e[51];let E;e[52]!==s.connections?(E=s.connections.slice(0,6).map($n),e[52]=s.connections,e[53]=E):E=e[53],e[54]!==E?(h=t.jsx("div",{className:"flex items-center gap-1",children:E}),e[54]=E,e[55]=h):h=e[55],T="flex items-center justify-between text-xs text-muted-foreground w-full min-w-0";const M=P.map(_=>t.jsx(Xt,{id:_,size:"3xs",avatarOnly:P.length>1},_));e[56]!==M?(C=t.jsx("div",{className:"flex items-center -space-x-1.5",children:M}),e[56]=M,e[57]=C):C=e[57],y="shrink-0 ml-2",k=J?lt(new Date(J)):"—",e[10]=N,e[11]=s.connections,e[12]=s.icon,e[13]=s.title,e[14]=r,e[15]=m,e[16]=l,e[17]=c,e[18]=d,e[19]=x,e[20]=v,e[21]=f,e[22]=h,e[23]=y,e[24]=k,e[25]=T,e[26]=C,e[27]=b,e[28]=D,e[29]=I}else x=e[19],v=e[20],f=e[21],h=e[22],y=e[23],k=e[24],T=e[25],C=e[26],b=e[27],D=e[28],I=e[29];let $;e[58]!==y||e[59]!==k?($=t.jsx("span",{className:y,children:k}),e[58]=y,e[59]=k,e[60]=$):$=e[60];let O;e[61]!==$||e[62]!==T||e[63]!==C?(O=t.jsxs("div",{className:T,children:[C,$]}),e[61]=$,e[62]=T,e[63]=C,e[64]=O):O=e[64];let R;return e[65]!==x||e[66]!==v||e[67]!==f||e[68]!==h||e[69]!==O||e[70]!==b||e[71]!==D||e[72]!==I?(R=t.jsx(t.Fragment,{children:t.jsx(x,{connection:b,onClick:D,className:I,fallbackIcon:v,headerActions:f,body:h,footer:O})}),e[65]=x,e[66]=v,e[67]=f,e[68]=h,e[69]=O,e[70]=b,e[71]=D,e[72]=I,e[73]=R):R=e[73],R}function $n(i){return t.jsx(Bt,{status:i.status},i.id)}function En(i,e){const s=e.updated_at??e.created_at,r=i.updated_at??i.created_at;return s?r?new Date(s)>new Date(r)?e:i:e:i}function Ln(i){const e=de.c(28),{count:s,total:r,onSelectAll:c,onDeselectAll:l,onDelete:m,onAddToAgent:g,onToggleStatus:N,onCancel:j}=i;if(s===0)return null;let d;e[0]!==s?(d=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[s," selected"]}),e[0]=s,e[1]=d):d=e[1];let x;e[2]!==s||e[3]!==l||e[4]!==c||e[5]!==r?(x=s<r?t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:c,children:["Select all (",r,")"]}):t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:"Clear selection"}),e[2]=s,e[3]=l,e[4]=c,e[5]=r,e[6]=x):x=e[6];let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(mt,{size:13}),e[7]=v):v=e[7];let f;e[8]!==g?(f=t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:[v,"Add to Agent"]}),e[8]=g,e[9]=f):f=e[9];let h;e[10]!==N?(h=t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("active"),children:"Enable"}),e[10]=N,e[11]=h):h=e[11];let y;e[12]!==N?(y=t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("inactive"),children:"Disable"}),e[12]=N,e[13]=y):y=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(xt,{size:13}),e[14]=k):k=e[14];let T;e[15]!==m?(T=t.jsxs(z,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:[k,"Delete"]}),e[15]=m,e[16]=T):T=e[16];let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(jn,{size:13}),e[17]=C):C=e[17];let b;e[18]!==j?(b=t.jsx(z,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:j,children:C}),e[18]=j,e[19]=b):b=e[19];let D;return e[20]!==d||e[21]!==b||e[22]!==x||e[23]!==f||e[24]!==h||e[25]!==y||e[26]!==T?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[d,x,f,h,y,T,b]})}),e[20]=d,e[21]=b,e[22]=x,e[23]=f,e[24]=h,e[25]=y,e[26]=T,e[27]=D):D=e[27],D}function On(i){const e=de.c(25),{open:s,onOpenChange:r,agents:c,onConfirm:l}=i,[m,g]=Y.useState(null);let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsxs(Ue,{children:[t.jsx(Fe,{children:"Add to Agent"}),t.jsx(at,{children:"Select an agent to add the selected connections to."})]}),e[0]=N):N=e[0];let j;e[1]!==c||e[2]!==m?(j=c.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):c.map(C=>t.jsxs("button",{type:"button",onClick:()=>g(C.id),className:he("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",m===C.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(ge,{icon:C.icon,name:C.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:C.title}),C.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:C.description})]})]},C.id)),e[1]=c,e[2]=m,e[3]=j):j=e[3];let d;e[4]!==j?(d=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[4]=j,e[5]=d):d=e[5];let x;e[6]!==r?(x=t.jsx(z,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e[6]=r,e[7]=x):x=e[7];const v=!m;let f;e[8]!==l||e[9]!==r||e[10]!==m?(f=()=>{m&&(l(m),r(!1),g(null))},e[8]=l,e[9]=r,e[10]=m,e[11]=f):f=e[11];let h;e[12]!==v||e[13]!==f?(h=t.jsx(z,{disabled:v,onClick:f,children:"Add"}),e[12]=v,e[13]=f,e[14]=h):h=e[14];let y;e[15]!==x||e[16]!==h?(y=t.jsxs(dt,{children:[x,h]}),e[15]=x,e[16]=h,e[17]=y):y=e[17];let k;e[18]!==d||e[19]!==y?(k=t.jsxs(Me,{className:"sm:max-w-[400px]",children:[N,d,y]}),e[18]=d,e[19]=y,e[20]=k):k=e[20];let T;return e[21]!==r||e[22]!==s||e[23]!==k?(T=t.jsx(Be,{open:s,onOpenChange:r,children:k}),e[21]=r,e[22]=s,e[23]=k,e[24]=T):T=e[24],T}function zn(i){const e=de.c(20),{open:s,onOpenChange:r,count:c,onConfirm:l}=i,m=c!==1?"s":"";let g;e[0]!==c||e[1]!==m?(g=t.jsxs($e,{children:["Delete ",c," connection",m,"?"]}),e[0]=c,e[1]=m,e[2]=g):g=e[2];const N=c!==1?"s":"";let j;e[3]!==N?(j=t.jsxs(Ee,{children:["This will permanently delete the selected connection",N,". This action cannot be undone."]}),e[3]=N,e[4]=j):j=e[4];let d;e[5]!==g||e[6]!==j?(d=t.jsxs(Pe,{children:[g,j]}),e[5]=g,e[6]=j,e[7]=d):d=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Oe,{children:"Cancel"}),e[8]=x):x=e[8];const v=c!==1?"s":"";let f;e[9]!==c||e[10]!==l||e[11]!==v?(f=t.jsxs(Le,{children:[x,t.jsxs(ze,{onClick:l,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",c," connection",v]})]}),e[9]=c,e[10]=l,e[11]=v,e[12]=f):f=e[12];let h;e[13]!==d||e[14]!==f?(h=t.jsxs(Ae,{children:[d,f]}),e[13]=d,e[14]=f,e[15]=h):h=e[15];let y;return e[16]!==r||e[17]!==s||e[18]!==h?(y=t.jsx(Ie,{open:s,onOpenChange:r,children:h}),e[16]=r,e[17]=s,e[18]=h,e[19]=y):y=e[19],y}function Vn(){const{org:i}=rt(),e=Dt(),s=ct(),r=It({strict:!1}),{data:c}=At.useSession(),{stdioEnabled:l}=Pt(),m=qt({namespace:i.slug,resource:"connections"}),g=an(),N=st(m),j=st(),[d,x]=Y.useReducer(An,{mode:"idle"}),[v,f]=Y.useState(new Set),h=v.size>0,[y,k]=Y.useState(!1),[T,C]=Y.useState(!1),[b,D]=Y.useState("all"),[I,$]=Y.useState(null),[O,R]=Y.useState("ALL"),[P,F]=Y.useState("ALL"),J=pn(),U=N.filter(n=>!(n.connection_type==="VIRTUAL"||O!=="ALL"&&n.connection_type!==O||P!=="ALL"&&n.status!==P)),X=bn(U),E=n=>{f(o=>{const a=new Set(o);return a.has(n)?a.delete(n):a.add(n),a})},M=()=>{f(new Set)},_=Kt(j).sort((n,o)=>{const a=n.app_name==="@deco/management-mcp",u=o.app_name==="@deco/management-mcp";return a&&!u?1:!a&&u?-1:0}),[K,ie]=Ht($t.selectedRegistry(i.slug),n=>n??""),ce=(K?_.find(n=>n.id===K):void 0)??_[0],w=ce?.id??"",V=Wt(ce?.tools),W=Qt({registryId:w,listToolName:V}),_e=W.items,ht=Gt(W.loadMore,W.hasMore,W.isLoadingMore),Re=new Set(j.filter(n=>n.connection_type!=="VIRTUAL"&&n.app_name).map(n=>n.app_name)),ke=m.search.toLowerCase(),He=b==="all"?_e.filter(n=>{if(!ke)return!0;const o=n._meta?.["mcp.mesh"],a=[o?.friendly_name,n.server?.name,n.server?.title,n.name,n.title,n.id].filter(Boolean).join(" "),u=[o?.short_description,o?.mesh_description,n.server?.description,n.description].filter(Boolean).join(" ");return a.toLowerCase().includes(ke)||u.toLowerCase().includes(ke)}):[],Te=He.filter(n=>n.verified||n._meta?.["mcp.mesh"]?.verified||n.meta?.verified),we=He.filter(n=>!n.verified&&!n._meta?.["mcp.mesh"]?.verified&&!n.meta?.verified),gt=b==="all"?[]:X,je=n=>{const o=Yt(n.name||n.title||n.server?.title||""),a=typeof n.id=="string"&&n.id.includes("/"),u=typeof n.server?.name=="string"&&n.server.name.includes("/"),S=a&&!u?n.id:n.server?.name||n.id||"";s({to:"/$org/$project/store/$appName",params:{org:i.slug,project:re,appName:o},search:{registryId:w,serverName:S}})},Xe=r.action==="create",jt=()=>{s({to:"/$org/$project/mcps",params:{org:i.slug,project:re},search:{action:"create"}})},Ke=()=>{s({to:"/$org/$project/mcps",params:{org:i.slug,project:re},search:{}})},p=Et({resolver:Lt(Cn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),H=p.watch("ui_type"),We=p.watch("connection_url"),yt=p.watch("npx_package"),me=Ne({uiType:H,connectionUrl:We??"",npxPackage:yt??""})??it({uiType:H,connectionUrl:We??"",registryItems:_e}),A=d.mode==="editing"?d.connection:null;Y.useEffect(()=>{if(A){const n=Ot(A.connection_headers)?A.connection_headers:null;if(n&&A.connection_type==="STDIO"){const o=yn(n.envVars);if(wn(n)){const a=Dn(n);p.reset({title:A.title,description:A.description,icon:A.icon??null,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o})}else{const a=In(n);p.reset({title:A.title,description:A.description,icon:A.icon??null,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:o})}}else p.reset({title:A.title,description:A.description,icon:A.icon??null,ui_type:A.connection_type,connection_url:A.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else p.reset({title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[A,p]);const pe=dn({connectionId:mn,orgId:i.id}),ye=()=>{e.invalidateQueries({predicate:n=>{const o=n.queryKey;return o[1]===i.id&&o[3]==="collection"&&o[4]==="CONNECTIONS"}})},vt=async()=>{k(!1);const n=[...v];let o=0;for(const a of n)try{(await pe.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:a,force:!0}})).isError||o++}catch{}ye(),Q.success(`Deleted ${o} connection${o!==1?"s":""}`),M()},Ct=async n=>{const o=[...v];let a=0;for(const u of o)try{await g.update.mutateAsync({id:u,data:{status:n}}),a++}catch{}ye(),Q.success(`${n==="active"?"Enabled":"Disabled"} ${a} connection${a!==1?"s":""}`),M()},Nt=async n=>{const o=J.find(S=>S.id===n);if(!o||!pe)return;const a=new Set(o.connections.map(S=>S.connection_id)),u=[...v].filter(S=>!a.has(S)).map(S=>({connection_id:S,selected_tools:null,selected_resources:null,selected_prompts:null}));if(u.length===0){Q.info("All selected connections are already in that agent");return}try{await pe.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:n,data:{connections:[...o.connections,...u]}}}),e.invalidateQueries({predicate:S=>{const L=S.queryKey;return L[1]===i.id&&L[3]==="collection"&&L[4]==="VIRTUAL_MCP"}}),Q.success(`Added ${u.length} connection${u.length!==1?"s":""} to "${o.title}"`),M()}catch{Q.error("Failed to add connections to agent")}},Ge=n=>{const o=n.content;return Array.isArray(o)&&o[0]?.type==="text"&&typeof o[0].text=="string"?o[0].text:"Unknown error"},bt=async()=>{if(d.mode!=="deleting")return;const n=d.connection;x({type:"close"});try{const o=await pe.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:n.id}});if(o.isError){const a=Ge(o),u=a.replace(/^Error:\s*/,"");try{const S=JSON.parse(u);if(S.code==="CONNECTION_IN_USE"&&S.agentNames){x({type:"force-delete",connection:n,agentNames:S.agentNames.map(L=>`"${L}"`).join(", ")});return}}catch{}Q.error(`Failed to delete connection: ${a}`);return}ye(),Q.success("Connection deleted successfully")}catch(o){const a=o instanceof Error?o.message:String(o);Q.error(`Failed to delete connection: ${a}`)}},St=async()=>{if(d.mode!=="force-deleting")return;const n=d.connection.id;x({type:"close"});try{const o=await pe.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:n,force:!0}});if(o.isError){Q.error(`Failed to delete connection: ${Ge(o)}`);return}ye(),Q.success("Connection deleted successfully")}catch(o){const a=o instanceof Error?o.message:String(o);Q.error(`Failed to delete connection: ${a}`)}},_t=async n=>{let o,a=null,u=null,S=null;if(n.ui_type==="NPX"?(o="STDIO",a="",S=kn(n.npx_package||"",n.env_vars||[])):n.ui_type==="STDIO"?(o="STDIO",a="",S=Tn(n.stdio_command||"",n.stdio_args||"",n.stdio_cwd,n.env_vars||[])):(o=n.ui_type,a=n.connection_url||"",u=n.connection_token||null),A){await g.update.mutateAsync({id:A.id,data:{title:n.title,description:n.description||null,icon:n.icon??null,connection_type:o,connection_url:a,...u&&{connection_token:u},...S&&{connection_headers:S}}}),x({type:"close"}),p.reset();return}const L=zt("conn");await g.create.mutateAsync({id:L,title:n.title,description:n.description||null,connection_type:o,connection_url:a,connection_token:u,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:c?.user?.id||"system",organization_id:i.id,icon:n.icon??null,app_name:null,app_id:null,connection_headers:S,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),Ke(),p.reset(),s({to:"/$org/$project/mcps/$connectionId",params:{org:i.slug,project:re,connectionId:L}})},qe=n=>{n||(Xe?Ke():x({type:"close"}),p.reset())},ve=n=>{const o=n.trim();if(!o)return;const a=!!p.formState.dirtyFields.title,u=!!p.formState.dirtyFields.description,S=!!p.formState.dirtyFields.env_vars,L=B=>{if(B&&(!a&&!p.getValues("title").trim()&&B.title&&p.setValue("title",B.title,{shouldDirty:!1}),!u&&!(p.getValues("description")??"").trim()&&B.description&&p.setValue("description",B.description,{shouldDirty:!1}),!S&&B.envVarKeys?.length)){const G=p.getValues("env_vars")??[],Tt=new Set(G.map(ue=>ue.key)),Qe=B.envVarKeys.filter(ue=>!Tt.has(ue));Qe.length>0&&p.setValue("env_vars",[...G,...Qe.map(ue=>({key:ue,value:""}))],{shouldDirty:!0})}},oe=_n(o);if(oe&&l){p.setValue("ui_type","NPX",{shouldDirty:!0}),p.setValue("npx_package",oe.packageName,{shouldDirty:!0}),p.setValue("connection_url","",{shouldDirty:!0}),p.setValue("connection_token",null,{shouldDirty:!0}),L(Ne({uiType:"NPX",npxPackage:oe.packageName}));return}if(o.startsWith("http://")||o.startsWith("https://")){const B=H==="HTTP"||H==="SSE"||H==="Websocket"?H:"HTTP";p.setValue("ui_type",B,{shouldDirty:!0}),p.setValue("connection_url",o,{shouldDirty:!0}),L(Ne({uiType:B,connectionUrl:o})??it({uiType:B,connectionUrl:o,registryItems:_e}));return}H==="NPX"&&L(Ne({uiType:"NPX",npxPackage:o}))},kt=t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(z,{variant:"outline",onClick:jt,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})});return t.jsxs(t.Fragment,{children:[t.jsxs(xe,{children:[t.jsx(Be,{open:Xe||d.mode==="editing",onOpenChange:qe,children:t.jsxs(Me,{className:"sm:max-w-[525px]",children:[t.jsxs(Ue,{children:[t.jsx(Fe,{children:A?"Edit Connection":"Create Connection"}),t.jsx(at,{children:A?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),t.jsx(nn,{...p,children:t.jsxs("form",{onSubmit:p.handleSubmit(_t),children:[t.jsxs("div",{className:"grid gap-4 py-4",children:[t.jsx(Z,{control:p.control,name:"ui_type",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Type *"}),t.jsxs(sn,{value:n.value,onValueChange:n.onChange,children:[t.jsx(ne,{children:t.jsx(on,{children:t.jsx(rn,{})})}),t.jsxs(cn,{children:[t.jsx(fe,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(fe,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(fe,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(fe,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ae,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(fe,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(gn,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(se,{})]})}),H==="NPX"&&t.jsx(t.Fragment,{children:t.jsx(Z,{control:p.control,name:"npx_package",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"NPM Package *"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"@perplexity-ai/mcp-server",...n,value:n.value??"",onPaste:o=>{const a=o.clipboardData.getData("text");a&&(o.preventDefault(),p.setValue("npx_package",a.trim(),{shouldDirty:!0}),ve(a))},onBlur:o=>{ve(o.target.value),n.onBlur()}})}),t.jsx(se,{})]})})}),H==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Z,{control:p.control,name:"stdio_command",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Command *"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"node, bun, python...",...n,value:n.value??""})}),t.jsx(se,{})]})}),t.jsx(Z,{control:p.control,name:"stdio_args",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Arguments"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"arg1 arg2 --flag value",...n,value:n.value??""})}),t.jsx(se,{})]})})]}),t.jsx(Z,{control:p.control,name:"stdio_cwd",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Working Directory"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"/path/to/project (optional)",...n,value:n.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(se,{})]})})]}),(H==="NPX"||H==="STDIO")&&t.jsx(Z,{control:p.control,name:"env_vars",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Environment Variables"}),t.jsx(ne,{children:t.jsx(vn,{value:n.value??[],onChange:n.onChange})}),t.jsx(se,{})]})}),H!=="NPX"&&H!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Z,{control:p.control,name:"connection_url",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"URL *"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"https://example.com/mcp",...n,value:n.value??"",onPaste:o=>{const a=o.clipboardData.getData("text");a&&(o.preventDefault(),p.setValue("connection_url",a.trim(),{shouldDirty:!0}),ve(a))},onBlur:o=>{ve(o.target.value),n.onBlur()}})}),t.jsx(se,{})]})}),t.jsx(Z,{control:p.control,name:"connection_token",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:me?.token?.label??"Token (optional)"}),t.jsx(ne,{children:t.jsx(le,{type:"password",placeholder:me?.token?.placeholder??"Bearer token or API key",...n,value:n.value??""})}),me?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[me.token.helperText,me.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(se,{})]})})]}),t.jsx(Z,{control:p.control,name:"title",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Name *"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"My Connection",...n})}),t.jsx(se,{})]})}),t.jsx(Z,{control:p.control,name:"description",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Description"}),t.jsx(ne,{children:t.jsx(ln,{placeholder:"A brief description of this connection",rows:3,...n,value:n.value??""})}),t.jsx(se,{})]})})]}),t.jsxs(dt,{children:[t.jsx(z,{type:"button",variant:"outline",onClick:()=>qe(!1),children:"Cancel"}),t.jsx(z,{type:"submit",disabled:p.formState.isSubmitting,className:"min-w-40",children:p.formState.isSubmitting?"Saving...":A?"Update Connection":"Create Connection"})]})]})})]})}),t.jsx(Ie,{open:d.mode==="deleting",onOpenChange:n=>!n&&x({type:"close"}),children:t.jsxs(Ae,{children:[t.jsxs(Pe,{children:[t.jsx($e,{children:"Delete Connection?"}),t.jsxs(Ee,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:d.mode==="deleting"&&d.connection.title}),"."]})]}),t.jsxs(Le,{children:[t.jsx(Oe,{children:"Cancel"}),t.jsx(ze,{onClick:bt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),t.jsx(Ie,{open:d.mode==="force-deleting",onOpenChange:n=>!n&&x({type:"close"}),children:t.jsxs(Ae,{children:[t.jsxs(Pe,{children:[t.jsx($e,{children:"Connection Used by Agents"}),t.jsx(Ee,{asChild:!0,children:t.jsxs("div",{children:[t.jsxs("p",{children:["The connection"," ",t.jsx("span",{className:"font-medium text-foreground",children:d.mode==="force-deleting"&&d.connection.title})," ","is currently used by the following agent(s):"," ",t.jsx("span",{className:"font-medium text-foreground",children:d.mode==="force-deleting"&&d.agentNames}),"."]}),t.jsx("p",{className:"mt-2",children:"Deleting this connection will remove it from those agents, which may impact existing workflows that depend on them."})]})})]}),t.jsxs(Le,{children:[t.jsx(Oe,{children:"Cancel"}),t.jsx(ze,{onClick:St,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]})]})}),t.jsx(zn,{open:y,onOpenChange:k,count:v.size,onConfirm:vt}),t.jsx(On,{open:T,onOpenChange:C,agents:J,onConfirm:Nt}),t.jsxs(xe.Header,{children:[t.jsx(xe.Header.Left,{children:t.jsx(Jt,{children:t.jsx(Zt,{children:t.jsx(en,{children:t.jsx(tn,{children:"Connections"})})})})}),t.jsxs(xe.Header.Right,{children:[t.jsx(Vt,{sortKey:m.sortKey,sortDirection:m.sortDirection,onSort:m.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:O,onChange:n=>R(n||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:P,onChange:n=>F(n||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]}]}),kt]})]}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("div",{children:t.jsx(Ft,{value:m.search,onChange:m.setSearch,placeholder:"Search for a Connection...",onKeyDown:n=>{n.key==="Escape"&&(m.setSearch(""),n.target.blur())}})}),t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border",children:[t.jsx(Ut,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:b,onTabChange:n=>D(n)}),_.length>0&&t.jsx("div",{className:he(b!=="all"&&"invisible pointer-events-none"),children:t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 px-2 gap-1.5 text-sm font-normal",children:[(()=>{const n=_.find(o=>o.id===(K||_[0]?.id))??_[0];return t.jsxs(t.Fragment,{children:[t.jsx(ge,{icon:n?.icon,name:n?.title??"",size:"2xs",className:"shrink-0 rounded-sm"}),t.jsx("span",{children:n?.title})]})})(),t.jsx(xn,{size:14,className:"text-muted-foreground"})]})}),t.jsx(nt,{align:"end",children:_.map(n=>t.jsxs(Ce,{onClick:()=>ie(n.id),className:he(K===n.id||!K&&n.id===_[0]?.id?"bg-accent":""),children:[t.jsx(ge,{icon:n.icon,name:n.title,size:"2xs",className:"shrink-0 rounded-sm"}),n.title]},n.id))})]})})]})]}),t.jsx(xe.Content,{children:t.jsx("div",{className:"flex-1 overflow-auto p-5",children:(b==="all"?Te.length===0&&we.length===0:U.length===0)?t.jsx(Rt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:m.search?`No Connections match "${m.search}"`:"Create a connection to get started."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[gt.map(n=>{if(n.type==="group")return t.jsx(Pn,{group:n,onOpen:()=>$({appName:n.title,appIcon:n.icon,instances:n.connections}),selectionMode:h,selectedIds:v,onToggleSelect:E},n.key);const o=n.connection,a=v.has(o.id);return t.jsx(be,{connection:o,fallbackIcon:t.jsx(ae,{}),onClick:()=>h?E(o.id):$({appName:o.app_name||o.title,appIcon:o.icon,appDescription:o.description,instances:[o]}),className:he(a&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:h,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[h&&t.jsx(pt,{checked:a,onCheckedChange:()=>E(o.id),onClick:u=>u.stopPropagation()}),t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:u=>u.stopPropagation(),children:t.jsx(fn,{size:20})})}),t.jsxs(nt,{align:"end",onClick:u=>u.stopPropagation(),children:[t.jsxs(Ce,{onClick:u=>{u.stopPropagation(),s({to:"/$org/$project/mcps/$connectionId",params:{org:i.slug,project:re,connectionId:o.id}})},children:[t.jsx(hn,{size:16}),"Open"]}),t.jsxs(Ce,{onClick:u=>{u.stopPropagation(),E(o.id)},children:[t.jsx(Mt,{size:16}),"Select"]}),t.jsxs(Ce,{variant:"destructive",onClick:u=>{u.stopPropagation(),x({type:"delete",connection:o})},children:[t.jsx(xt,{size:16}),"Delete"]})]})]})]})},o.id)}),b==="all"&&Te.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(un,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"Verified"}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Te.map(n=>{const o=n.server?.name||n.name||n.id||"",a=Re.has(o),u=n._meta?.["mcp.mesh"],S=u?.friendlyName||u?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",L=n.server?.description||n.description||null,oe=n.server?.icons?.[0]?.src||Ze(n.server?.repository)||null,B=j.filter(G=>G.connection_type!=="VIRTUAL"&&G.app_name===o);return t.jsx(be,{connection:{title:S,description:L,icon:oe},fallbackIcon:t.jsx(ae,{}),onClick:()=>a?$({appName:S,appIcon:oe,appDescription:L,instances:B}):je(n),headerActionsAlwaysVisible:!0,headerActions:a?t.jsx(Ve,{variant:"secondary",className:"text-xs",children:"Connected"}):t.jsx(z,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:G=>{G.stopPropagation(),je(n)},children:"Connect"})},`catalog-${n.id}`)}),b==="all"&&we.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"All connections"}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),we.map(n=>{const o=n.server?.name||n.name||n.id||"",a=Re.has(o),u=n._meta?.["mcp.mesh"],S=u?.friendlyName||u?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",L=n.server?.description||n.description||null,oe=n.server?.icons?.[0]?.src||Ze(n.server?.repository)||null,B=j.filter(G=>G.connection_type!=="VIRTUAL"&&G.app_name===o);return t.jsx(be,{connection:{title:S,description:L,icon:oe},fallbackIcon:t.jsx(ae,{}),onClick:()=>a?$({appName:S,appIcon:oe,appDescription:L,instances:B}):je(n),headerActionsAlwaysVisible:!0,headerActions:a?t.jsx(Ve,{variant:"secondary",className:"text-xs",children:"Connected"}):t.jsx(z,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:G=>{G.stopPropagation(),je(n)},children:"Connect"})},`catalog-${n.id}`)}),b==="all"&&w&&t.jsx("div",{ref:ht,className:"col-span-full h-4"}),b==="all"&&W.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ut,{size:24,className:"animate-spin text-muted-foreground"})})]})})}),h&&t.jsx(Ln,{count:v.size,total:U.length,onSelectAll:()=>{f(new Set(U.map(n=>n.id)))},onDeselectAll:()=>f(new Set),onDelete:()=>k(!0),onAddToAgent:()=>C(!0),onToggleStatus:Ct,onCancel:M})]}),I&&t.jsx(Nn,{open:!0,onClose:()=>$(null),appName:I.appName,appIcon:I.appIcon,appDescription:I.appDescription,instances:I.instances})]})}function Zs(){const i=de.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(wt,{children:t.jsx(Y.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ut,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Vn,{})})}),i[0]=e):e=i[0],e}export{Zs as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bO as h,c as d,x as g,bP as y}from"./index-
|
|
1
|
+
import{bO as h,c as d,x as g,bP as y}from"./index-OyLnxARk.js";const m={authConfig:()=>["authConfig"],threads:e=>["threads",e],virtualMcpThreads:(e,t)=>["threads",e,"virtual-mcp",t],thread:(e,t)=>["thread",e,t],threadMessages:(e,t)=>["thread-messages",e,t],messages:e=>["messages",e],organizations:()=>["organizations"],members:e=>[e,"members"],invitations:e=>[e,"invitations"],organizationRoles:e=>[e,"organization-roles"],connections:e=>[e,"connections"],connectionsByBinding:(e,t)=>[e,"connections",`binding:${t}`],connection:(e,t)=>[e,"connection",t],isMCPAuthenticated:(e,t)=>["is-mcp-authenticated",e,t],mcpTools:(e,t)=>["mcp","tools",e,t],mcpClient:(e,t,n,o)=>["mcp","client",e,t,n,o],mcpToolsList:e=>["mcp","client",e,"tools"],mcpResourcesList:e=>["mcp","client",e,"resources"],mcpPromptsList:e=>["mcp","client",e,"prompts"],mcpReadResource:(e,t)=>["mcp","client",e,"resource",t],mcpGetPrompt:(e,t,n)=>["mcp","client",e,"prompt",t,n],mcpToolCall:(e,t,n)=>["mcp","client",e,"tool-call",t,n],organizationSettings:e=>["organization-settings",e],activeOrganization:e=>["activeOrganization",e],modelsList:e=>["models-list",e],connectionCollections:e=>[e,"collections","discovery"],toolCall:(e,t,n)=>["tool-call",e,t,n],collectionItems:(e,t)=>["collection",e,t],collection:(e,t,n)=>[e,t,"collection",n],collectionItem:(e,t,n,o,i)=>[e,t,n,"collection",o,i],collectionList:(e,t,n,o,i)=>[e,t,n,"collection",o,"list",i],collectionListInfinite:(e,t,n,o,i)=>[e,t,n,"collection",o,"list-infinite",i],githubReadme:(e,t)=>["github-readme",e,t],monitoringStats:()=>["monitoring","stats"],monitoringLogs:e=>["monitoring","logs",e],monitoringLogsInfinite:(e,t)=>["monitoring","logs-infinite",e,t],virtualMcpPrompts:e=>["virtual-mcp",e,"prompts"],connectionPrompts:e=>["connection",e,"prompts"],connectionResources:e=>["connection",e,"resources"],user:e=>["user",e]};class _ extends h{constructor(t,n){super(t,n)}send(t,n){const o=C(t);return o?.type==="emit"?(this.onmessage?.(o.message),Promise.resolve()):o?.type==="suppress"?Promise.resolve():super.send(t,n)}}function C(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"mesh-virtual-mcp",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const b={name:"mesh-sdk",version:"1.0.0"};function T(e,t){const n=t??(typeof window<"u"?window.location.origin:void 0);if(!n)throw new Error("MCP client requires either meshUrl option or a browser environment.");const o=e?`/mcp/${e}`:"/mcp";return new URL(o,n).href}async function f({connectionId:e,orgId:t,token:n,meshUrl:o}){const i=T(e,o),s=new y(b,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),r=new _(new URL(i),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream","x-org-id":t,...n?{Authorization:`Bearer ${n}`}:{}}}});await s.connect(r);const l=m.mcpClient(t,e??"self",n??"",o??"");return s.toJSON=()=>`mcp-client:${l.join(":")}`,s}function S(e){const t=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:s}=e;let r;t[0]!==n||t[1]!==s||t[2]!==o||t[3]!==i?(r=m.mcpClient(o,n??"self",i??"",s??""),t[0]=n,t[1]=s,t[2]=o,t[3]=i,t[4]=r):r=t[4];const l=r;let c;t[5]!==n||t[6]!==s||t[7]!==o||t[8]!==i?(c=()=>f({connectionId:n,orgId:o,token:i,meshUrl:s}),t[5]=n,t[6]=s,t[7]=o,t[8]=i,t[9]=c):c=t[9];let a;t[10]!==l||t[11]!==c?(a={queryKey:l,queryFn:c,staleTime:1/0,gcTime:0},t[10]=l,t[11]=c,t[12]=a):a=t[12];const{data:u}=g(a);return u}function w(e){const t=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:s}=e;let r;t[0]!==n||t[1]!==s||t[2]!==o||t[3]!==i?(r=n!==void 0?m.mcpClient(o,n??"self",i??"",s??""):["mcp","client","skip",o],t[0]=n,t[1]=s,t[2]=o,t[3]=i,t[4]=r):r=t[4];const l=r;let c;t[5]!==n||t[6]!==s||t[7]!==o||t[8]!==i?(c=async()=>n===void 0?null:f({connectionId:n,orgId:o,token:i,meshUrl:s}),t[5]=n,t[6]=s,t[7]=o,t[8]=i,t[9]=c):c=t[9];let a;t[10]!==l||t[11]!==c?(a={queryKey:l,queryFn:c,staleTime:1/0,gcTime:0},t[10]=l,t[11]=c,t[12]=a):a=t[12];const{data:u}=g(a);return u??null}const P={SELF:e=>`${e}_self`,REGISTRY:e=>`${e}_registry`,COMMUNITY_REGISTRY:e=>`${e}_community-registry`,DEV_ASSETS:e=>`${e}_dev-assets`},M="self";function R(e){return{id:P.REGISTRY(e),title:"Deco Store",description:"Official deco MCP registry with curated integrations",connection_type:"HTTP",connection_url:"https://studio.decocms.com/org/deco/registry/mcp",icon:"https://assets.decocache.com/decocms/00ccf6c3-9e13-4517-83b0-75ab84554bb9/596364c63320075ca58483660156b6d9de9b526e.png",app_name:"deco-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function L(){return{id:"community-registry",title:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",connection_type:"HTTP",connection_url:"https://sites-registry.decocache.com/mcp",icon:"https://assets.decocache.com/decocms/cd7ca472-0f72-463a-b0de-6e44bdd0f9b4/mcp.png",app_name:"mcp-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function D(e){return{id:v(e),organization_id:e,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:null},connections:[]}}const p="decopilot_";function E(e){return!e||!e.startsWith(p)?null:e.slice(p.length)||null}function v(e){return`${p}${e}`}export{m as K,_ as S,P as W,M as a,L as b,f as c,D as d,R as e,w as f,v as g,E as i,S as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ap as a,aq as t}from"./index-OyLnxARk.js";const e=a(t,{target:"draft-7"});export{e as B};
|