@decocms/mesh 2.138.2 → 2.138.3
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-COCPzruB.js → AlertCircle-D8UIpq37.js} +1 -1
- package/dist/client/assets/{AlignLeft-BXEQaqkm.js → AlignLeft-BtXg7P0e.js} +1 -1
- package/dist/client/assets/{ArrowDown-CWZOxMGB.js → ArrowDown-D7A05Pqz.js} +1 -1
- package/dist/client/assets/{ArrowLeft-D9yt1ohq.js → ArrowLeft-CFfxbhXN.js} +1 -1
- package/dist/client/assets/{ArrowUp-CxJFPww9.js → ArrowUp-BHnUcKjj.js} +1 -1
- package/dist/client/assets/{Check-BxmpGgJO.js → Check-DnflcDgh.js} +1 -1
- package/dist/client/assets/{CheckCircle-CTJxivs_.js → CheckCircle-BfTaFQXT.js} +1 -1
- package/dist/client/assets/{CheckDone01-Dcp2FYQ-.js → CheckDone01-B8Vo5lqI.js} +1 -1
- package/dist/client/assets/{CheckVerified02-D11ceW2n.js → CheckVerified02-CWpuqjel.js} +1 -1
- package/dist/client/assets/{ChevronDown-DMBKkJDw.js → ChevronDown-BdRzf7AV.js} +1 -1
- package/dist/client/assets/{ChevronLeft-CSMOvegR.js → ChevronLeft-BENcbD0N.js} +1 -1
- package/dist/client/assets/{ChevronRight-H9Yc9f7O.js → ChevronRight-B6krViGL.js} +1 -1
- package/dist/client/assets/{Clock-CKhQI6RG.js → Clock-BahX3Ppr.js} +1 -1
- package/dist/client/assets/{Code01-YTmJoKH0.js → Code01-DAiaTcLi.js} +1 -1
- package/dist/client/assets/{Container-yYsRLnMs.js → Container-Bhk6-bJW.js} +1 -1
- package/dist/client/assets/{Copy01-CBbaVNcV.js → Copy01-IhjKnzZh.js} +1 -1
- package/dist/client/assets/{Dataflow03-D7alrCgq.js → Dataflow03-CplqbZiq.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-Bs1LoWL0.js → DotsHorizontal-ol0p2nBi.js} +1 -1
- package/dist/client/assets/{DotsVertical-JTzIXbI1.js → DotsVertical-DaFbwRBO.js} +1 -1
- package/dist/client/assets/{Download01-BfbmibGe.js → Download01-CpdZoaWE.js} +1 -1
- package/dist/client/assets/{Edit01-86XeEa-K.js → Edit01-B2tEsq4Y.js} +1 -1
- package/dist/client/assets/{Edit05-D2Mr1uN2.js → Edit05-D1q7xT-x.js} +1 -1
- package/dist/client/assets/{Eye-CH7m62Q9.js → Eye-D7y1c_jY.js} +1 -1
- package/dist/client/assets/{File02-D5MLfFax.js → File02-BBBrx8D7.js} +1 -1
- package/dist/client/assets/{File06-BsPa6yJC.js → File06-BXEc3PLa.js} +1 -1
- package/dist/client/assets/{FilterLines-CCRMwRH-.js → FilterLines-DQzwn6mr.js} +1 -1
- package/dist/client/assets/{Globe01-DkkMg0kW.js → Globe01-DxOhGk1c.js} +1 -1
- package/dist/client/assets/{Globe02-C9h9OvDn.js → Globe02-CK23mV4o.js} +1 -1
- package/dist/client/assets/{Grid01-BJl2SMz4.js → Grid01--89xjjlS.js} +1 -1
- package/dist/client/assets/{Hash02-fUOm6jU-.js → Hash02-GHgct6qe.js} +1 -1
- package/dist/client/assets/{Home02-Css4Iepc.js → Home02-CtaUTS4r.js} +1 -1
- package/dist/client/assets/{Image01-DcPksOlo.js → Image01-DV4WJck5.js} +1 -1
- package/dist/client/assets/{Inbox01-B-u4MXdb.js → Inbox01-DJZPgIPT.js} +1 -1
- package/dist/client/assets/{InfoCircle-Ix7ZTvJi.js → InfoCircle-D5uH0MNf.js} +1 -1
- package/dist/client/assets/{Key01-Df3Idqiz.js → Key01-caSA-Yw4.js} +1 -1
- package/dist/client/assets/{LayersTwo01-B5E2fqo_.js → LayersTwo01-PpQdLoEG.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Bc53fB6X.js → LayoutLeft-Cf-N8SYH.js} +1 -1
- package/dist/client/assets/{Link01-DL7ePw82.js → Link01-DMneZx2j.js} +1 -1
- package/dist/client/assets/{LinkExternal01-b8VjDApC.js → LinkExternal01-BrnXDZEp.js} +1 -1
- package/dist/client/assets/{List-DurPU5xB.js → List-C5_6cfio.js} +1 -1
- package/dist/client/assets/{Loading01-BSgt365L.js → Loading01-BCzCCK_W.js} +1 -1
- package/dist/client/assets/{Lock01-Kbe8uq9Q.js → Lock01-jPvo4nA0.js} +1 -1
- package/dist/client/assets/{Play-C_XCWv-e.js → Play-CkKt4QCZ.js} +1 -1
- package/dist/client/assets/{Plus-DyccoR76.js → Plus--co7BTa1.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-C5LHek4w.js → RefreshCcw01-CbOhHOko.js} +1 -1
- package/dist/client/assets/{Save01-DB_m4T10.js → Save01-BTh64p14.js} +1 -1
- package/dist/client/assets/{SearchMd-C9PpmA7c.js → SearchMd-m173J65G.js} +1 -1
- package/dist/client/assets/{Settings01-C8nyLh4e.js → Settings01-CZOfcAS6.js} +1 -1
- package/dist/client/assets/{Shield01-D3qnwTrp.js → Shield01-BI5amJl0.js} +1 -1
- package/dist/client/assets/{Terminal-BQ8QYOY1.js → Terminal-CtGvt6je.js} +1 -1
- package/dist/client/assets/{Trash01-CJ60cufT.js → Trash01-HuotuXJH.js} +1 -1
- package/dist/client/assets/{Upload01-CPuUtuFU.js → Upload01-C7rpQkkP.js} +1 -1
- package/dist/client/assets/{Users03-TzAql3be.js → Users03-DlGbW_jR.js} +1 -1
- package/dist/client/assets/{X-CpYNC6lo.js → X-TCHNS2KI.js} +1 -1
- package/dist/client/assets/{XCircle-BjAJVHDF.js → XCircle-B9lbeJth.js} +1 -1
- package/dist/client/assets/{XClose-Rpsc-3OA.js → XClose-zAWwTjC9.js} +1 -1
- package/dist/client/assets/{Zap-BZ3UCYjM.js → Zap-CgMlO3IL.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-DIiP1L_8.js → agent-connections-preview-CBD487Ew.js} +1 -1
- package/dist/client/assets/{agent-detail-J2F2tRbj.js → agent-detail-BILNtrP7.js} +1 -1
- package/dist/client/assets/{agents-Cd6HGWat.js → agents-8Xh54Wv-.js} +1 -1
- package/dist/client/assets/{alert-dialog-CjulzWr7.js → alert-dialog-BifPyCni.js} +1 -1
- package/dist/client/assets/{auth-catchall-BnImxdbW.js → auth-catchall-CBObZF31.js} +1 -1
- package/dist/client/assets/{avatar-COttSggk.js → avatar-B3kSzLTz.js} +1 -1
- package/dist/client/assets/{badge-DeKjEqoU.js → badge-ndLAVsnC.js} +1 -1
- package/dist/client/assets/{binder-JBklfnkZ.js → binder-GTmFyrCu.js} +1 -1
- package/dist/client/assets/{breadcrumb-DZ4K3wPr.js → breadcrumb-iZbBQmAw.js} +1 -1
- package/dist/client/assets/{card-DkMC4yhp.js → card-CyJvSJWb.js} +1 -1
- package/dist/client/assets/{chart-oCbiVl3J.js → chart-BAb0wVHC.js} +1 -1
- package/dist/client/assets/{checkbox-DOpKFROJ.js → checkbox-D9hw1y4e.js} +1 -1
- package/dist/client/assets/{circle-alert-vyafkPY9.js → circle-alert-MDHm-xpi.js} +1 -1
- package/dist/client/assets/{collapsible-BqhrFzzR.js → collapsible-JmR8gcL1.js} +1 -1
- package/dist/client/assets/{collection-detail-CnE9tdFz.js → collection-detail-DPhTZmU2.js} +1 -1
- package/dist/client/assets/{collection-display-button-B5-Qbe51.js → collection-display-button-DKSbWUip.js} +1 -1
- package/dist/client/assets/{collection-search-BqJoX17Q.js → collection-search-CoyqU1D4.js} +1 -1
- package/dist/client/assets/{collection-tab-CalpHH6o.js → collection-tab-BhUGnesV.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BTjazYQf.js → collection-table-wrapper-DB-0Sbir.js} +1 -1
- package/dist/client/assets/{collection-tabs-EEOW6GRL.js → collection-tabs-CMDCQky7.js} +1 -1
- package/dist/client/assets/{command-BEFS8ANg.js → command-B1E9omIC.js} +1 -1
- package/dist/client/assets/{connect-DfPT2YCY.js → connect-VZjoVrkN.js} +1 -1
- package/dist/client/assets/{connection-card-BdnPGsex.js → connection-card-D1wFGPSt.js} +1 -1
- package/dist/client/assets/{connection-detail-CLUQ4ftB.js → connection-detail-BKyATRjq.js} +1 -1
- package/dist/client/assets/{connection-status-C-QmdjUW.js → connection-status-Djf9yQEZ.js} +1 -1
- package/dist/client/assets/{connections-kkqT0K5k.js → connections-B2qIhAsK.js} +1 -1
- package/dist/client/assets/constants-CJIMg126.js +1 -0
- package/dist/client/assets/{constants-BDiSPTuo.js → constants-CQia8SG0.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-jAyzYeAn.js → create-organization-dialog-BeY9othQ.js} +1 -1
- package/dist/client/assets/{create-project-dialog-D33xriWJ.js → create-project-dialog-BEdRfc9R.js} +1 -1
- package/dist/client/assets/{danger-Cha4pSGh.js → danger-B_y0n4gO.js} +1 -1
- package/dist/client/assets/{danger-zone-DADmz_4H.js → danger-zone-BgWu6tp3.js} +1 -1
- package/dist/client/assets/{decopilot-events-D0o8qF4i.js → decopilot-events-Cxyg_szC.js} +1 -1
- package/dist/client/assets/{dependencies-WKnlxG4W.js → dependencies-DHfx0ASL.js} +1 -1
- package/dist/client/assets/{dialog-DZh8Ph30.js → dialog-CRMnu4D5.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Z-xkakKz.js → dropdown-menu-C89udqdU.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-1VL-Nq0v.js → dynamic-plugin-layout-CJepJHId.js} +1 -1
- package/dist/client/assets/{editable-task-title-BtM8Y_i0.js → editable-task-title-Dftwn0Jq.js} +1 -1
- package/dist/client/assets/{empty-state-Bs6ZvT13.js → empty-state-SPMY63O9.js} +1 -1
- package/dist/client/assets/{env-vars-editor-C_fpQu3r.js → env-vars-editor-B-wGdKWy.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BvxOwwOc.js → extract-connection-data-B9XYD2id.js} +1 -1
- package/dist/client/assets/{file-browser-COkzPlsr.js → file-browser-WuEQLf3l.js} +2 -2
- package/dist/client/assets/{form-u0JM0zFo.js → form-D5fEmRYW.js} +1 -1
- package/dist/client/assets/{general-fg_RS0yr.js → general-CTvWH7rg.js} +1 -1
- package/dist/client/assets/{grid-view-D9Ic3afI.js → grid-view-BnX1z_Ch.js} +1 -1
- package/dist/client/assets/{home-C0wm8Ra0.js → home-C7YK5fqh.js} +1 -1
- package/dist/client/assets/{icon-picker-BYggeY9I.js → icon-picker-z3hf23Xc.js} +1 -1
- package/dist/client/assets/{index-BjjNfFZO.js → index-BdSTuQz3.js} +1 -1
- package/dist/client/assets/{index-DtzYx0E6.js → index-BtrcIP0U.js} +1 -1
- package/dist/client/assets/{index-D_0ZYhFs.js → index-BvccbczP.js} +1 -1
- package/dist/client/assets/{index-B6H1H8GZ.js → index-CFro8UN2.js} +3 -3
- package/dist/client/assets/{index-D-QI-if6.js → index-Dcd2vOoh.js} +1 -1
- package/dist/client/assets/{index-C-FConRx.js → index-TAv8a7S6.js} +1 -1
- package/dist/client/assets/{index-DGzQM1h1.js → index-UT-OKuyW.js} +1 -1
- package/dist/client/assets/{index-BTGfXm3p.js → index-v8sm2sIL.js} +1 -1
- package/dist/client/assets/{index-C21sEs5P.js → index-yK-spAaO.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-B4_Pq1jp.js → infiniteQueryObserver-DRNwzQ2J.js} +1 -1
- package/dist/client/assets/{input-DL82FsGU.js → input-DHT-dQ79.js} +1 -1
- package/dist/client/assets/{integration-icon-lbcrIfEl.js → integration-icon-BIEcJDPc.js} +1 -1
- package/dist/client/assets/{label-CiV91E3T.js → label-DTRd2hOl.js} +1 -1
- package/dist/client/assets/{layout-DyQEA0SZ.js → layout-CoyjPych.js} +1 -1
- package/dist/client/assets/{layout-Be7WHnRk.js → layout-DSQJF_Qw.js} +1 -1
- package/dist/client/assets/{localstorage-keys-B-P4Lkkc.js → localstorage-keys-C6UNhMX3.js} +1 -1
- package/dist/client/assets/{login-B3dPe2uq.js → login-DRo1nfCX.js} +1 -1
- package/dist/client/assets/{markdown-Bf8aDiE3.js → markdown-C_NNKbxL.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BnVKlKcJ.js → mcp-app-renderer-Npg6Irre.js} +1 -1
- package/dist/client/assets/{mcp-server-card-DZcgEuH9.js → mcp-server-card-_9Ad8GQZ.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-Bt5RaPnX.js → mcp-server-detail-DiUTX-4T.js} +2 -2
- package/dist/client/assets/{members-BJawTGLR.js → members-CTLVZ_UU.js} +1 -1
- package/dist/client/assets/{monaco-editor-BQM0x1VO.js → monaco-editor-kBsXk8Uv.js} +1 -1
- package/dist/client/assets/{monitoring-blJKyDvA.js → monitoring-BxvRioe2.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-edit-BDHHepNV.js → monitoring-dashboard-edit-BavhlQSN.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-ipSeoz8O.js → monitoring-dashboard-view-cCvR45k2.js} +1 -1
- package/dist/client/assets/{oauth-callback-BrSHCBQX.js → oauth-callback-Ut8wMr5A.js} +1 -1
- package/dist/client/assets/{page-CA_pelN-.js → page-ByhxsSXs.js} +1 -1
- package/dist/client/assets/{page-Kq0I6KKP.js → page-Can2Mcvy.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-RaKROIGH.js → plugin-empty-state-Bfx2fgKl.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-C4w1L8kt.js → plugin-empty-state-Cosz1pwR.js} +1 -1
- package/dist/client/assets/{plugin-header-BhtUXHbX.js → plugin-header-D7qmYXR-.js} +1 -1
- package/dist/client/assets/{plugin-header-sixzd3Ma.js → plugin-header-DhF4rvJU.js} +1 -1
- package/dist/client/assets/plugins-CExOue8T.js +1 -0
- package/dist/client/assets/{popover-BsBq580h.js → popover-CcXiFLG0.js} +1 -1
- package/dist/client/assets/{project-app-view-BJtfzuHN.js → project-app-view-C8owlFW4.js} +1 -1
- package/dist/client/assets/{project-layout-RD2qGV-x.js → project-layout-BILGWikD.js} +1 -1
- package/dist/client/assets/{project-plugins-COU6htGE.js → project-plugins-DUyruksA.js} +1 -1
- package/dist/client/assets/{projects-list-D9xGyghY.js → projects-list-BB9cD3_q.js} +1 -1
- package/dist/client/assets/{readme-viewer-BbXjdtG9.js → readme-viewer-D7DlvuHz.js} +1 -1
- package/dist/client/assets/{registry-layout-DeFY3kKT.js → registry-layout-CzqzSWVI.js} +1 -1
- package/dist/client/assets/{registry-utils-Bl8qAIIE.js → registry-utils-BM82D6MS.js} +1 -1
- package/dist/client/assets/{reports-layout-DEPJi7t7.js → reports-layout-DgIgiik2.js} +1 -1
- package/dist/client/assets/{reset-password-CCjN8Der.js → reset-password-C4PRxfSd.js} +1 -1
- package/dist/client/assets/{resizable-Dyz8Ueqx.js → resizable-BASq3Pgk.js} +1 -1
- package/dist/client/assets/{save-actions-BY0Prlb4.js → save-actions-wlTs7EAc.js} +1 -1
- package/dist/client/assets/{scroll-area-7QhPLRXH.js → scroll-area-C6nUo9wy.js} +1 -1
- package/dist/client/assets/{select-BNpARAGJ.js → select-aCEgiwRG.js} +1 -1
- package/dist/client/assets/{shell-layout-7XeOm_ax.js → shell-layout-BkdF_E4v.js} +2 -2
- package/dist/client/assets/{sidebar-settings-B9cT50kt.js → sidebar-settings-JiGQZ3fp.js} +1 -1
- package/dist/client/assets/{skeleton-BS-CeywH.js → skeleton-C5VDRx_S.js} +1 -1
- package/dist/client/assets/{spinner-DBhlROgw.js → spinner-D5-FOXs-.js} +1 -1
- package/dist/client/assets/{store-invite-e1T7z82O.js → store-invite-h96iSwsC.js} +1 -1
- package/dist/client/assets/{switch-wuXa1Kvf.js → switch-CzRdWsOb.js} +1 -1
- package/dist/client/assets/{table-ls4zjAkQ.js → table-DbeCzOFv.js} +1 -1
- package/dist/client/assets/{tabs-BpharFFf.js → tabs-Ml-lETIv.js} +1 -1
- package/dist/client/assets/tasks-CmzV6y78.js +1 -0
- package/dist/client/assets/{tasks-panel-Ct2D_gmM.js → tasks-panel-U539gk-l.js} +1 -1
- package/dist/client/assets/{textarea-DM9DH5x9.js → textarea-B8s-zfsk.js} +1 -1
- package/dist/client/assets/{time-range-picker-CdtxSNYv.js → time-range-picker-BS12ZDuS.js} +1 -1
- package/dist/client/assets/{toggle-group-BRFTG6MH.js → toggle-group-xYK4IM-u.js} +1 -1
- package/dist/client/assets/{tools-list-UPWCb7T0.js → tools-list-DUTGV-gT.js} +1 -1
- package/dist/client/assets/{tooltip-j8kTHx55.js → tooltip-oZyiLpuc.js} +1 -1
- package/dist/client/assets/{topbar-portal-BUJnfe9A.js → topbar-portal-Dioc5LFm.js} +1 -1
- package/dist/client/assets/{types-jFDozJe3.js → types-BwtK0SDt.js} +1 -1
- package/dist/client/assets/{use-binding-BfnusZ1F.js → use-binding-BSR1JqIQ.js} +1 -1
- package/dist/client/assets/{use-collections-D-dYas4g.js → use-collections-BPrRt-ii.js} +1 -1
- package/dist/client/assets/{use-connection-C6mRcJDK.js → use-connection-DG_OWqAP.js} +1 -1
- package/dist/client/assets/{use-copy-CVnO_3mM.js → use-copy-CXa-kk7H.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Dn5aJHho.js → use-create-virtual-mcp-Jzi9Oo3B.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-Ci2mnCpP.js → use-install-from-registry-D7-6zhi-.js} +1 -1
- package/dist/client/assets/{use-list-state-Cs0Vw1fn.js → use-list-state-CmyPcBg7.js} +1 -1
- package/dist/client/assets/{use-llm-C2ec2VVQ.js → use-llm-CCXNkRzc.js} +1 -1
- package/dist/client/assets/{use-mcp-resources-C0pasPvz.js → use-mcp-resources-DE_pqa4e.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CMrxqGk3.js → use-mcp-tools-CZWduBUe.js} +1 -1
- package/dist/client/assets/{use-members-DyNTppwq.js → use-members-D0qifzUt.js} +1 -1
- package/dist/client/assets/{use-mobile-TplPgiBS.js → use-mobile-iIf5uj_e.js} +1 -1
- package/dist/client/assets/{use-project-BJg-zw4z.js → use-project-BZNqM_qN.js} +1 -1
- package/dist/client/assets/{use-settings-modal-nlOCOvru.js → use-settings-modal-DKqeXV5B.js} +1 -1
- package/dist/client/assets/{use-view-mode-Csk7hnWi.js → use-view-mode-F92r7fn5.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Dbh6kzyX.js → use-virtual-mcp-Duh8bmbW.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CirhN3j-.js +1 -0
- package/dist/client/assets/{useMutation-CJ6jjC2l.js → useMutation-DjbNdewa.js} +1 -1
- package/dist/client/assets/useQuery-DXBnvbwb.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BOauSLbt.js +1 -0
- package/dist/client/assets/{user-DoJm1uYf.js → user-B9NsMy7x.js} +1 -1
- package/dist/client/assets/{workflow-BypiKv8P.js → workflow-C-92M3XD.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +3 -3
- package/dist/server/migrate.js +1 -1
- package/dist/server/node_modules/@esbuild/linux-x64/README.md +3 -0
- package/dist/server/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
- package/dist/server/node_modules/@esbuild/linux-x64/package.json +20 -0
- package/dist/server/node_modules/electron-to-chromium/LICENSE +5 -0
- package/dist/server/node_modules/electron-to-chromium/README.md +186 -0
- package/dist/server/node_modules/electron-to-chromium/chromium-versions.js +85 -0
- package/dist/server/node_modules/electron-to-chromium/chromium-versions.json +1 -0
- package/dist/server/node_modules/electron-to-chromium/full-chromium-versions.js +2706 -0
- package/dist/server/node_modules/electron-to-chromium/full-chromium-versions.json +1 -0
- package/dist/server/node_modules/electron-to-chromium/full-versions.js +1726 -0
- package/dist/server/node_modules/electron-to-chromium/full-versions.json +1 -0
- package/dist/server/node_modules/electron-to-chromium/index.js +36 -0
- package/dist/server/node_modules/electron-to-chromium/package.json +44 -0
- package/dist/server/node_modules/electron-to-chromium/versions.js +237 -0
- package/dist/server/node_modules/electron-to-chromium/versions.json +1 -0
- package/dist/server/node_modules/node-releases/LICENSE +21 -0
- package/dist/server/node_modules/node-releases/README.md +12 -0
- package/dist/server/node_modules/node-releases/data/processed/envs.json +1 -0
- package/dist/server/node_modules/node-releases/data/release-schedule/release-schedule.json +1 -0
- package/dist/server/node_modules/node-releases/package.json +22 -0
- package/dist/server/node_modules/picocolors/LICENSE +15 -0
- package/dist/server/node_modules/picocolors/README.md +21 -0
- package/dist/server/node_modules/picocolors/package.json +25 -0
- package/dist/server/node_modules/picocolors/picocolors.browser.js +4 -0
- package/dist/server/node_modules/picocolors/picocolors.d.ts +5 -0
- package/dist/server/node_modules/picocolors/picocolors.js +75 -0
- package/dist/server/node_modules/picocolors/types.d.ts +51 -0
- package/dist/server/server.js +3 -3
- package/package.json +1 -1
- package/dist/client/assets/constants-Dvvbc3ac.js +0 -1
- package/dist/client/assets/plugins-CD_83bbp.js +0 -1
- package/dist/client/assets/tasks-CJXh_ge0.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CQVTTHIu.js +0 -1
- package/dist/client/assets/useQuery-BQ0SjuWE.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BSv4Z18C.js +0 -1
- package/dist/server/node_modules/supports-color/browser.js +0 -24
- package/dist/server/node_modules/supports-color/index.js +0 -152
- package/dist/server/node_modules/supports-color/license +0 -9
- package/dist/server/node_modules/supports-color/package.json +0 -58
- package/dist/server/node_modules/supports-color/readme.md +0 -77
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as $,z as N,j as t}from"./index-
|
|
1
|
+
import{c as $,z as N,j as t}from"./index-CFro8UN2.js";import{C as q}from"./card-CyJvSJWb.js";import{I as B}from"./integration-icon-BIEcJDPc.js";function K(g){const e=$.c(46),{connection:s,onClick:C,headerActions:b,body:z,footer:k,className:I,size:A,fallbackIcon:w}=g,E=A===void 0?"md":A,i=E==="sm"?"p-4":"p-6",P=E==="sm"?"text-sm":"text-base",R=E==="sm"?"text-xs":"text-sm",S=C&&"hover:bg-muted/50";let l;e[0]!==I||e[1]!==S?(l=N("cursor-pointer transition-colors group overflow-hidden flex flex-col",S,I),e[0]=I,e[1]=S,e[2]=l):l=e[2];let o;e[3]!==i?(o=N("flex flex-col gap-4",i),e[3]=i,e[4]=o):o=e[4];let n;e[5]!==s.icon||e[6]!==s.title||e[7]!==w?(n=t.jsx(B,{icon:s.icon,name:s.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:w}),e[5]=s.icon,e[6]=s.title,e[7]=w,e[8]=n):n=e[8];let c;e[9]!==b?(c=b&&t.jsx("div",{className:N("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:F,children:b}),e[9]=b,e[10]=c):c=e[10];let r;e[11]!==c?(r=t.jsx("div",{className:"relative",children:c}),e[11]=c,e[12]=r):r=e[12];let a;e[13]!==n||e[14]!==r?(a=t.jsxs("div",{className:"flex items-start justify-between",children:[n,r]}),e[13]=n,e[14]=r,e[15]=a):a=e[15];let d;e[16]!==P?(d=N("font-medium text-foreground truncate",P),e[16]=P,e[17]=d):d=e[17];let m;e[18]!==s.title||e[19]!==d?(m=t.jsx("h3",{className:d,children:s.title}),e[18]=s.title,e[19]=d,e[20]=m):m=e[20];let f;e[21]!==R?(f=N("text-muted-foreground line-clamp-2",R),e[21]=R,e[22]=f):f=e[22];const _=s.description||"No description";let x;e[23]!==f||e[24]!==_?(x=t.jsx("p",{className:f,children:_}),e[23]=f,e[24]=_,e[25]=x):x=e[25];let p;e[26]!==m||e[27]!==x?(p=t.jsxs("div",{className:"flex flex-col gap-0",children:[m,x]}),e[26]=m,e[27]=x,e[28]=p):p=e[28];let h;e[29]!==z?(h=z&&t.jsx("div",{children:z}),e[29]=z,e[30]=h):h=e[30];let u;e[31]!==p||e[32]!==h||e[33]!==o||e[34]!==a?(u=t.jsxs("div",{className:o,children:[a,p,h]}),e[31]=p,e[32]=h,e[33]=o,e[34]=a,e[35]=u):u=e[35];let j;e[36]!==k||e[37]!==i?(j=k&&t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:N("h-14 flex items-center",i),onClick:D,children:k})}),e[36]=k,e[37]=i,e[38]=j):j=e[38];let v;e[39]!==u||e[40]!==j?(v=t.jsxs("div",{className:"flex flex-col flex-1",children:[u,j]}),e[39]=u,e[40]=j,e[41]=v):v=e[41];let y;return e[42]!==C||e[43]!==v||e[44]!==l?(y=t.jsx(q,{className:l,onClick:C,children:v}),e[42]=C,e[43]=v,e[44]=l,e[45]=y):y=e[45],y}function D(g){return g.stopPropagation()}function F(g){return g.stopPropagation()}export{K as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as E,j as t,e as be,B as Ee,O as he,aF as nt,u as Fe,G as pt,c0 as We,y as ft,p as xt,r as X,o as ot,bI as ht,bQ as gt,n as z,D as qe,_ as jt,E as rt,g as bt,d as vt,w as Nt,q as yt,t as _t,b as Ct,x as Ve,K as St}from"./index-B6H1H8GZ.js";import{E as Z,C as ze}from"./collection-search-BqJoX17Q.js";import{E as wt,r as Tt,e as it}from"./env-vars-editor-C_fpQu3r.js";import{g as Be}from"./types-jFDozJe3.js";import{S as kt}from"./save-actions-BY0Prlb4.js";import{b as Pt,a as It}from"./use-binding-BfnusZ1F.js";import{u as $t,S as Vt}from"./index-C21sEs5P.js";import{a as At}from"./index-BTGfXm3p.js";import{b as Ge,c as Mt,d as Dt,e as Ot,B as Rt,a as Lt}from"./breadcrumb-DZ4K3wPr.js";import{C as Et}from"./collection-tabs-EEOW6GRL.js";import{u as Ut,a as at}from"./use-connection-C6mRcJDK.js";import{u as ct}from"./constants-BDiSPTuo.js";import{d as Ft}from"./use-mcp-tools-CMrxqGk3.js";import{b as zt}from"./use-mcp-resources-C0pasPvz.js";import{a as Bt}from"./decopilot-events-D0o8qF4i.js";import{i as Me}from"./Loading01-BSgt365L.js";import{V as Xe,a as Xt}from"./layout-DyQEA0SZ.js";import{C as Ht}from"./collection-tab-CalpHH6o.js";import{I as Kt}from"./icon-picker-BYggeY9I.js";import{I as De}from"./integration-icon-lbcrIfEl.js";import{B as Ue}from"./badge-DeKjEqoU.js";import{D as Wt,a as qt,b as Gt,c as Qe}from"./dropdown-menu-Z-xkakKz.js";import{F as K,a as Qt,b as W,d as B,f as G,c as J,e as Yt}from"./form-u0JM0zFo.js";import{I as Q}from"./input-DL82FsGU.js";import{S as Ye,a as Je,b as Ze,c as et,d as H}from"./select-BNpARAGJ.js";import{i as lt}from"./CheckCircle-CTJxivs_.js";import{t as Jt}from"./ChevronDown-DMBKkJDw.js";import{n as Zt}from"./Container-yYsRLnMs.js";import{s as Ae}from"./Globe02-C9h9OvDn.js";import{s as es}from"./RefreshCcw01-C5LHek4w.js";import{i as ts}from"./Terminal-BQ8QYOY1.js";import{s as ss}from"./Trash01-CJ60cufT.js";import{t as He}from"./Users03-TzAql3be.js";import{s as ns}from"./XClose-Rpsc-3OA.js";import{U as os}from"./user-DoJm1uYf.js";import{b as rs,a as is}from"./use-virtual-mcp-Dbh6kzyX.js";import{i as as}from"./ChevronRight-H9Yc9f7O.js";import{s as cs}from"./Plus-DyccoR76.js";import{f as ls}from"./formatDistanceToNow-Cb2QZZJn.js";import{C as dt}from"./collection-display-button-B5-Qbe51.js";import{C as mt}from"./collection-table-wrapper-BTjazYQf.js";import{C as Ke}from"./card-DkMC4yhp.js";import{R as ds}from"./readme-viewer-BbXjdtG9.js";import{T as ms,a as us}from"./tools-list-UPWCb7T0.js";import{M as ps}from"./mcp-app-renderer-BnVKlKcJ.js";import"./SearchMd-C9PpmA7c.js";import"./Save01-DB_m4T10.js";import"./binder-JBklfnkZ.js";import"./File06-BsPa6yJC.js";import"./Key01-Df3Idqiz.js";import"./constants-Dvvbc3ac.js";import"./registry-utils-Bl8qAIIE.js";import"./extract-connection-data-BvxOwwOc.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-Ci2mnCpP.js";import"./index-C-FConRx.js";import"./circle-alert-vyafkPY9.js";import"./index-BjjNfFZO.js";import"./index-DtzYx0E6.js";import"./collapsible-BqhrFzzR.js";import"./use-llm-C2ec2VVQ.js";import"./use-collections-D-dYas4g.js";import"./useMutation-CJ6jjC2l.js";import"./useQuery-BQ0SjuWE.js";import"./localstorage-keys-B-P4Lkkc.js";import"./tabs-BpharFFf.js";import"./checkbox-DOpKFROJ.js";import"./Check-BxmpGgJO.js";import"./dialog-DZh8Ph30.js";import"./X-CpYNC6lo.js";import"./skeleton-BS-CeywH.js";import"./AlignLeft-BXEQaqkm.js";import"./ArrowLeft-D9yt1ohq.js";import"./Image01-DcPksOlo.js";import"./Settings01-C8nyLh4e.js";import"./useSuspenseInfiniteQuery-BSv4Z18C.js";import"./infiniteQueryObserver-B4_Pq1jp.js";import"./popover-BsBq580h.js";import"./spinner-DBhlROgw.js";import"./tooltip-j8kTHx55.js";import"./index-D_0ZYhFs.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-CxJFPww9.js";import"./Edit01-86XeEa-K.js";import"./XCircle-BjAJVHDF.js";import"./AlertCircle-COCPzruB.js";import"./use-copy-CVnO_3mM.js";import"./Code01-YTmJoKH0.js";import"./use-create-virtual-mcp-Dn5aJHho.js";import"./Copy01-CBbaVNcV.js";import"./marked.esm-BaswSlok.js";import"./markdown-Bf8aDiE3.js";import"./Eye-CH7m62Q9.js";import"./LayersTwo01-B5E2fqo_.js";import"./Clock-CKhQI6RG.js";import"./index-D-QI-if6.js";import"./DotsVertical-JTzIXbI1.js";import"./empty-state-Bs6ZvT13.js";import"./Inbox01-B-u4MXdb.js";import"./use-list-state-Cs0Vw1fn.js";import"./use-view-mode-Csk7hnWi.js";import"./use-mobile-TplPgiBS.js";import"./alert-dialog-CjulzWr7.js";import"./scroll-area-7QhPLRXH.js";import"./Edit05-D2Mr1uN2.js";import"./Link01-DL7ePw82.js";import"./label-CiV91E3T.js";import"./avatar-COttSggk.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowDown-CWZOxMGB.js";import"./Grid01-BJl2SMz4.js";import"./List-DurPU5xB.js";import"./table-ls4zjAkQ.js";function fs(s){const e=E.c(14),{virtualMcp:n,org:o}=s;let i;e[0]!==o||e[1]!==n.id?(i={org:o,project:he,agentId:n.id},e[0]=o,e[1]=n.id,e[2]=i):i=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(He,{size:16}),e[3]=a):a=e[3];let l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(De,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[4]=n.icon,e[5]=n.title,e[6]=l):l=e[6];let j;e[7]!==n.title?(j=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(as,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=f):f=e[9];let m;return e[10]!==i||e[11]!==l||e[12]!==j?(m=t.jsxs(nt,{to:"/$org/$project/agents/$agentId",params:i,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[l,j,f]}),e[10]=i,e[11]=l,e[12]=j,e[13]=m):m=e[13],m}function tt(s){const e=E.c(20),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:j}=s,f=be(),m=is();let x;e[0]!==m.create||e[1]!==i||e[2]!==a||e[3]!==n||e[4]!==o||e[5]!==f||e[6]!==l?(x=async()=>{const d=await m.create.mutateAsync({title:`${o} Agent`,description:i??null,icon:a??null,status:"active",connections:[{connection_id:n,selected_tools:null,selected_resources:null,selected_prompts:null}]});f({to:"/$org/$project/agents/$agentId",params:{org:l,project:he,agentId:d.id}})},e[0]=m.create,e[1]=i,e[2]=a,e[3]=n,e[4]=o,e[5]=f,e[6]=l,e[7]=x):x=e[7];const c=x;if(j){let d;e[8]!==m.create.isPending?(d=m.create.isPending?t.jsx(Me,{size:16,className:"animate-spin"}):t.jsx(cs,{size:16}),e[8]=m.create.isPending,e[9]=d):d=e[9];let u;return e[10]!==m.create.isPending||e[11]!==c||e[12]!==d?(u=t.jsx(Ee,{variant:"ghost",className:"size-6 p-0",onClick:c,disabled:m.create.isPending,children:d}),e[10]=m.create.isPending,e[11]=c,e[12]=d,e[13]=u):u=e[13],u}let r;e[14]!==m.create.isPending?(r=m.create.isPending?t.jsx(Me,{className:"animate-spin text-muted-foreground"}):t.jsx(He,{className:"size-3 text-muted-foreground"}),e[14]=m.create.isPending,e[15]=r):r=e[15];let h;return e[16]!==m.create.isPending||e[17]!==c||e[18]!==r?(h=t.jsxs(Ee,{variant:"outline",size:"sm",onClick:c,disabled:m.create.isPending,children:[r,"Create an agent"]}),e[16]=m.create.isPending,e[17]=c,e[18]=r,e[19]=h):h=e[19],h}function xs(s){const e=E.c(26),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l}=s;let j;e[0]!==n?(j={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=j):j=e[1];const f=rs(j);if(!(f.length>0)){let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=u):u=e[2];let N;return e[3]!==i||e[4]!==a||e[5]!==n||e[6]!==o||e[7]!==l?(N=t.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[u,t.jsx(tt,{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:!1})]}),e[3]=i,e[4]=a,e[5]=n,e[6]=o,e[7]=l,e[8]=N):N=e[8],N}let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Agents"}),e[9]=x):x=e[9];let c;e[10]!==i||e[11]!==a||e[12]!==n||e[13]!==o||e[14]!==l?(c=t.jsx("div",{className:"flex flex-col gap-1",children:t.jsxs("div",{className:"flex items-center justify-between",children:[x,t.jsx(tt,{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:!0})]})}),e[10]=i,e[11]=a,e[12]=n,e[13]=o,e[14]=l,e[15]=c):c=e[15];let r;if(e[16]!==l||e[17]!==f){let u;e[19]!==l?(u=N=>t.jsx(fs,{virtualMcp:N,org:l},N.id),e[19]=l,e[20]=u):u=e[20],r=f.map(u),e[16]=l,e[17]=f,e[18]=r}else r=e[18];let h;e[21]!==r?(h=t.jsx("div",{className:"flex flex-col gap-2",children:r}),e[21]=r,e[22]=h):h=e[22];let d;return e[23]!==c||e[24]!==h?(d=t.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[c,h]}),e[23]=c,e[24]=h,e[25]=d):d=e[25],d}function hs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:i}){const a=We({control:s.control,name:"ui_type"}),l=We({control:s.control,name:"connection_url"}),{stdioEnabled:j}=ft(),f=(()=>{if(typeof l!="string"||!l)return!1;try{const r=new URL(l);return r.hostname==="api.githubcopilot.com"&&r.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),m=j||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",c=x?xt(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",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(He,{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."})]}),c&&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:c})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(K,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(J,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),a!=="NPX"&&a!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(Ye,{value:r.value,onValueChange:r.onChange,children:[t.jsx(B,{children:t.jsxs(Je,{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(Ae,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(Ze,{})]})}),t.jsxs(et,{children:[t.jsx(H,{value:"HTTP",children:"HTTP"}),t.jsx(H,{value:"SSE",children:"SSE"}),t.jsx(H,{value:"Websocket",children:"Websocket"}),m&&t.jsxs(t.Fragment,{children:[t.jsx(H,{value:"NPX",children:"NPX Package"}),t.jsx(H,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(K,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(W,{className:"flex-1 min-w-0",children:t.jsx(B,{children:t.jsx(Q,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(Ye,{value:r.value,onValueChange:r.onChange,children:[t.jsx(B,{children:t.jsx(Je,{className:"h-10",children:t.jsx(Ze,{})})}),t.jsxs(et,{children:[t.jsx(H,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ae,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(H,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ae,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(H,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ae,{className:"w-4 h-4"}),"Websocket"]})}),m&&t.jsxs(t.Fragment,{children:[t.jsx(H,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Zt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(H,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ts,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(G,{})]})}),a==="NPX"&&t.jsx(K,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(J,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(B,{children:t.jsx(Q,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})}),a==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(K,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(J,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(B,{children:t.jsx(Q,{placeholder:"node, bun, python...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})}),t.jsx(K,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(J,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(B,{children:t.jsx(Q,{placeholder:"arg1 arg2 --flag value",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(G,{})]})})]}),t.jsx(K,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(J,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(B,{children:t.jsx(Q,{placeholder:"/path/to/project (optional)",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})})]}),(a==="NPX"||a==="STDIO")&&t.jsx(K,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(J,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(B,{children:t.jsx(wt,{value:r.value??[],onChange:r.onChange})}),t.jsx(G,{})]})}),a!=="NPX"&&a!=="STDIO"&&t.jsx(K,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(J,{className:"text-xs text-muted-foreground font-medium",children:f?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Wt,{children:[t.jsx(qt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Ue,{variant:"success",className:"gap-1.5",children:[t.jsx(lt,{size:12}),"Authenticated via OAuth",t.jsx(Jt,{size:12})]})})}),t.jsxs(Gt,{align:"start",children:[t.jsxs(Qe,{onClick:o,children:[t.jsx(es,{size:16}),"Re-authenticate"]}),t.jsxs(Qe,{variant:"destructive",onClick:i,children:[t.jsx(ss,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&r.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:()=>r.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(ns,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(B,{children:t.jsx(Q,{type:"password",placeholder:f?"Paste your GitHub PAT":"Enter access token...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),f&&t.jsxs(Yt,{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(G,{})]})})]})}function gs(s){const e=E.c(45),{form:n,connection:o,isMCPAuthenticated:i,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:j}=s,{org:f}=Fe();let m;e[0]!==o.app_name||e[1]!==o.icon||e[2]!==o.title||e[3]!==n.control?(m=o.app_name&&o.icon?t.jsx(De,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}):t.jsx(pt,{control:n.control,name:"icon",render:k=>{const{field:P}=k;return t.jsx(Kt,{value:P.value,onChange:P.onChange,name:o.title,size:"lg",className:"shadow-sm"})}}),e[0]=o.app_name,e[1]=o.icon,e[2]=o.title,e[3]=n.control,e[4]=m):m=e[4];let x;e[5]!==n.control?(x=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(K,{control:n.control,name:"title",render:bs}),t.jsx(K,{control:n.control,name:"description",render:js})]}),e[5]=n.control,e[6]=x):x=e[6];let c;e[7]!==m||e[8]!==x?(c=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[m,x]}),e[7]=m,e[8]=x,e[9]=c):c=e[9];let r;e[10]!==o||e[11]!==n||e[12]!==a||e[13]!==l||e[14]!==j?(r=t.jsx(hs,{form:n,connection:o,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:j}),e[10]=o,e[11]=n,e[12]=a,e[13]=l,e[14]=j,e[15]=r):r=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[16]=h):h=e[16];let d;e[17]!==i?(d=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[h,i?t.jsxs(Ue,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[t.jsx(lt,{size:12}),"Connected"]}):t.jsx(Ue,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[17]=i,e[18]=d):d=e[18];let u;e[19]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[19]=u):u=e[19];let N;e[20]!==o.created_by?(N=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[u,t.jsx(os,{id:o.created_by,size:"2xs"})]}),e[20]=o.created_by,e[21]=N):N=e[21];let b;e[22]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[22]=b):b=e[22];let _;e[23]!==o.updated_at?(_=o.updated_at?ls(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[23]=o.updated_at,e[24]=_):_=e[24];let S;e[25]!==_?(S=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[b,t.jsx("span",{className:"text-sm text-foreground",children:_})]}),e[25]=_,e[26]=S):S=e[26];let p;e[27]!==S||e[28]!==d||e[29]!==N?(p=t.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[d,N,S]}),e[27]=S,e[28]=d,e[29]=N,e[30]=p):p=e[30];let C;e[31]!==o.description||e[32]!==o.icon||e[33]!==o.id||e[34]!==o.title||e[35]!==f.slug?(C=t.jsx(xs,{connectionId:o.id,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,org:f.slug}),e[31]=o.description,e[32]=o.icon,e[33]=o.id,e[34]=o.title,e[35]=f.slug,e[36]=C):C=e[36];let w;e[37]!==p||e[38]!==C||e[39]!==c||e[40]!==r?(w=t.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[c,r,p,C]}),e[37]=p,e[38]=C,e[39]=c,e[40]=r,e[41]=w):w=e[41];let g;return e[42]!==n||e[43]!==w?(g=t.jsx(Qt,{...n,children:w}),e[42]=n,e[43]=w,e[44]=g):g=e[44],g}function js(s){const{field:e}=s;return t.jsxs(W,{className:"w-full space-y-0",children:[t.jsx(B,{children:t.jsx(Q,{...e,value:e.value||"",className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(G,{})]})}function bs(s){const{field:e}=s;return t.jsxs(W,{className:"flex-1 space-y-0",children:[t.jsx(B,{children:t.jsx(Q,{...e,className:"h-auto py-0.5 text-lg! font-medium leading-7 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})}),t.jsx(G,{})]})}function vs(s){const e=E.c(39),{prompts:n,connectionId:o,org:i,onPromptClick:a,showToolbar:l,emptyMessage:j}=s,f=l===void 0?!0:l,m=j===void 0?"This connection doesn't have any prompts yet.":j,x=be(),[c,r]=X.useState(""),[h,d]=X.useState("table"),[u,N]=X.useState("name"),[b,_]=X.useState("asc");let S;e[0]!==b||e[1]!==u?(S=T=>{u===T?(_(Ss),b==="desc"&&N(void 0)):(N(T),_("asc"))},e[0]=b,e[1]=u,e[2]=S):S=e[2];const p=S;let C;e[3]!==o||e[4]!==x||e[5]!==a||e[6]!==i?(C=T=>{a?a(T):o&&i&&x({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:he,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(T.name)}})},e[3]=o,e[4]=x,e[5]=a,e[6]=i,e[7]=C):C=e[7];const w=C;let g;if(e[8]!==n||e[9]!==c||e[10]!==b||e[11]!==u){const T=!n||n.length===0?[]:c.trim()?(()=>{const U=c.toLowerCase();return n.filter(F=>F.name.toLowerCase().includes(U)||F.description&&F.description.toLowerCase().includes(U))})():n;g=!u||!b?T:[...T].sort((U,F)=>{const ge=U[u]||"",ee=F[u]||"",Y=String(ge).localeCompare(String(ee));return b==="asc"?Y:-Y}),e[8]=n,e[9]=c,e[10]=b,e[11]=u,e[12]=g}else g=e[12];const k=g;let P;e[13]===Symbol.for("react.memo_cache_sentinel")?(P=[{id:"name",header:"Name",render:Cs,sortable:!0},{id:"description",header:"Description",render:_s,cellClassName:"flex-1",sortable:!0}],e[13]=P):P=e[13];const V=P;let A;e[14]===Symbol.for("react.memo_cache_sentinel")?(A=V.filter(ys).map(Ns),e[14]=A):A=e[14];const L=A;let y;e[15]!==p||e[16]!==f||e[17]!==b||e[18]!==u||e[19]!==h?(y=f&&t.jsx(Xe,{children:t.jsx(dt,{viewMode:h,onViewModeChange:d,sortKey:u,sortDirection:b,onSort:p,sortOptions:L})}),e[15]=p,e[16]=f,e[17]=b,e[18]=u,e[19]=h,e[20]=y):y=e[20];let R;e[21]===Symbol.for("react.memo_cache_sentinel")?(R=T=>{T.key==="Escape"&&(r(""),T.target.blur())},e[21]=R):R=e[21];let M;e[22]!==c?(M=t.jsx(ze,{value:c,onChange:r,placeholder:"Search prompts...",onKeyDown:R}),e[22]=c,e[23]=M):M=e[23];let v;e[24]!==m||e[25]!==w||e[26]!==p||e[27]!==c||e[28]!==b||e[29]!==u||e[30]!==k||e[31]!==h?(v=h==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:k.length===0?t.jsx(Z,{image:null,title:c?"No prompts found":"No prompts available",description:c?"Try adjusting your search terms":m}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:k.map(T=>t.jsx(Ke,{className:"cursor-pointer transition-colors",onClick:()=>w(T),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(De,{icon:null,name:T.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:T.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:T.description||"No description"})]})]})},T.name))})}):t.jsx(mt,{columns:V,data:k,isLoading:!1,sortKey:u,sortDirection:b,onSort:p,onRowClick:T=>w(T),emptyState:t.jsx(Z,{image:null,title:c?"No prompts found":"No prompts available",description:c?"Try adjusting your search terms":m})}),e[24]=m,e[25]=w,e[26]=p,e[27]=c,e[28]=b,e[29]=u,e[30]=k,e[31]=h,e[32]=v):v=e[32];let $;e[33]!==M||e[34]!==v?($=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[M,v]}),e[33]=M,e[34]=v,e[35]=$):$=e[35];let I;return e[36]!==$||e[37]!==y?(I=t.jsxs(t.Fragment,{children:[y,$]}),e[36]=$,e[37]=y,e[38]=I):I=e[38],I}function Ns(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function ys(s){return s.sortable}function _s(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Cs(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function Ss(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function ws(s){const e=E.c(4),{prompts:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx(vs,{prompts:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}function Ts(s){const e=E.c(2),{repository:n}=s;let o;return e[0]!==n?(o=t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(ds,{repository:n})}),e[0]=n,e[1]=o):o=e[1],o}function ks(s){const e=E.c(36),{resources:n,onResourceClick:o,showToolbar:i,emptyMessage:a}=s,l=i===void 0?!0:i,j=a===void 0?"This connection doesn't have any resources yet.":a,[f,m]=X.useState(""),[x,c]=X.useState("table"),[r,h]=X.useState("name"),[d,u]=X.useState("asc");let N;e[0]!==d||e[1]!==r?(N=v=>{r===v?(u(Ds),d==="desc"&&h(void 0)):(h(v),u("asc"))},e[0]=d,e[1]=r,e[2]=N):N=e[2];const b=N;let _;e[3]!==o?(_=v=>{o&&o(v)},e[3]=o,e[4]=_):_=e[4];const S=_;let p;if(e[5]!==n||e[6]!==f||e[7]!==d||e[8]!==r){const v=!n||n.length===0?[]:f.trim()?(()=>{const $=f.toLowerCase();return n.filter(I=>I.uri.toLowerCase().includes($)||I.name&&I.name.toLowerCase().includes($)||I.description&&I.description.toLowerCase().includes($))})():n;p=!r||!d?v:[...v].sort(($,I)=>{const T=$[r]||"",U=I[r]||"",F=String(T).localeCompare(String(U));return d==="asc"?F:-F}),e[5]=n,e[6]=f,e[7]=d,e[8]=r,e[9]=p}else p=e[9];const C=p;let w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=[{id:"name",header:"Name",render:Ms,sortable:!0},{id:"uri",header:"URI",render:As,sortable:!0},{id:"description",header:"Description",render:Vs,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:$s,sortable:!0}],e[10]=w):w=e[10];const g=w;let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=g.filter(Is).map(Ps),e[11]=k):k=e[11];const P=k;let V;e[12]!==b||e[13]!==l||e[14]!==d||e[15]!==r||e[16]!==x?(V=l&&t.jsx(Xe,{children:t.jsx(dt,{viewMode:x,onViewModeChange:c,sortKey:r,sortDirection:d,onSort:b,sortOptions:P})}),e[12]=b,e[13]=l,e[14]=d,e[15]=r,e[16]=x,e[17]=V):V=e[17];let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=v=>{v.key==="Escape"&&(m(""),v.target.blur())},e[18]=A):A=e[18];let L;e[19]!==f?(L=t.jsx(ze,{value:f,onChange:m,placeholder:"Search resources...",onKeyDown:A}),e[19]=f,e[20]=L):L=e[20];let y;e[21]!==j||e[22]!==S||e[23]!==b||e[24]!==f||e[25]!==d||e[26]!==r||e[27]!==C||e[28]!==x?(y=x==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:C.length===0?t.jsx(Z,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":j}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:C.map(v=>t.jsx(Ke,{className:"cursor-pointer transition-colors",onClick:()=>S(v),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(De,{icon:null,name:v.name||v.uri,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:v.name||v.uri}),t.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:v.uri}),v.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:v.description})]})]})},v.uri))})}):t.jsx(mt,{columns:g,data:C,isLoading:!1,sortKey:r,sortDirection:d,onSort:b,onRowClick:v=>S(v),emptyState:t.jsx(Z,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":j})}),e[21]=j,e[22]=S,e[23]=b,e[24]=f,e[25]=d,e[26]=r,e[27]=C,e[28]=x,e[29]=y):y=e[29];let R;e[30]!==L||e[31]!==y?(R=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[L,y]}),e[30]=L,e[31]=y,e[32]=R):R=e[32];let M;return e[33]!==R||e[34]!==V?(M=t.jsxs(t.Fragment,{children:[V,R]}),e[33]=R,e[34]=V,e[35]=M):M=e[35],M}function Ps(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Is(s){return s.sortable}function $s(s){return t.jsx("span",{className:"text-sm text-muted-foreground",children:s.mimeType||"—"})}function Vs(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function As(s){return t.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:s.uri})}function Ms(s){return t.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name||s.uri})}function Ds(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Os(s){const e=E.c(4),{resources:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx(ks,{resources:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}const Rs=ot({key:z().min(1,"Key is required"),value:z()}),Ls=ot({title:z().min(1,"Name is required"),description:z().nullable().optional(),icon:z().nullable().optional(),ui_type:jt(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:z().optional(),connection_token:z().nullable().optional(),npx_package:z().optional(),stdio_command:z().optional(),stdio_args:z().optional(),stdio_cwd:z().optional(),env_vars:qe(Rs).optional(),configuration_scopes:qe(z()).nullable().optional(),configuration_state:ht(z(),gt()).nullable().optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Es(s){const e=E.c(5),{tools:n,connectionId:o,org:i,isLoading:a}=s;let l;return e[0]!==o||e[1]!==a||e[2]!==i||e[3]!==n?(l=t.jsx(ms,{tools:n,connectionId:o,org:i,isLoading:a}),e[0]=o,e[1]=a,e[2]=i,e[3]=n,e[4]=l):l=e[4],l}function Us(s){const e=E.c(27),{tools:n,connectionId:o,org:i}=s,a=be(),{org:l}=Fe();let j;e[0]!==o||e[1]!==l.id?(j={connectionId:o,orgId:l.id},e[0]=o,e[1]=l.id,e[2]=j):j=e[2];const f=ct(j),[m,x]=X.useState("");let c,r,h,d;if(e[3]!==f||e[4]!==o||e[5]!==a||e[6]!==i||e[7]!==m||e[8]!==n){const b=(n??[]).filter(Fs),_=m.toLowerCase().trim(),S=_?b.filter(g=>g.name.toLowerCase().includes(_)||g.description&&g.description.toLowerCase().includes(_)):b;let p;e[13]!==o||e[14]!==a||e[15]!==i?(p=g=>{a({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:he,connectionId:o,collectionName:"tools",itemId:encodeURIComponent(g.name)}})},e[13]=o,e[14]=a,e[15]=i,e[16]=p):p=e[16];const C=p;h="flex flex-col h-full overflow-hidden";let w;e[17]===Symbol.for("react.memo_cache_sentinel")?(w=g=>{g.key==="Escape"&&(x(""),g.target.blur())},e[17]=w):w=e[17],e[18]!==m?(d=t.jsx(ze,{value:m,onChange:x,placeholder:"Search apps...",onKeyDown:w}),e[18]=m,e[19]=d):d=e[19],c="flex-1 overflow-auto p-5",r=S.length===0?t.jsx(Z,{image:null,title:m?"No apps found":"No apps available",description:m?"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:S.map(g=>{const k=Be(g._meta);return t.jsxs(Ke,{className:"cursor-pointer transition-colors overflow-hidden",onClick:()=>C(g),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(ps,{resourceURI:k,toolInfo:{tool:g},displayMode:"inline",minHeight:200,maxHeight:200,client:f})}),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:g.name}),t.jsx(us,{annotations:g.annotations,_meta:g._meta})]}),g.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:g.description})]})]},g.name)})}),e[3]=f,e[4]=o,e[5]=a,e[6]=i,e[7]=m,e[8]=n,e[9]=c,e[10]=r,e[11]=h,e[12]=d}else c=e[9],r=e[10],h=e[11],d=e[12];let u;e[20]!==c||e[21]!==r?(u=t.jsx("div",{className:c,children:r}),e[20]=c,e[21]=r,e[22]=u):u=e[22];let N;return e[23]!==h||e[24]!==d||e[25]!==u?(N=t.jsxs("div",{className:h,children:[d,u]}),e[23]=h,e[24]=d,e[25]=u,e[26]=N):N=e[26],N}function Fs(s){return!!Be(s._meta)}function zs(s){return s.command==="npx"}function Bs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Xs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Hs(s,e){const n={command:"npx",args:["-y",s]},o=it(e);return Object.keys(o).length>0&&(n.envVars=o),n}function Ks(s,e,n,o){const i={command:s};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const a=it(o);return Object.keys(a).length>0&&(i.envVars=a),i}function st(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"&&Ct(s.connection_headers)){const o=s.connection_headers,i=Tt(o.envVars);if(zs(o)){const l=Bs(o);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i}}const a=Xs(o);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:i}}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 Ws(s){let e,n=null,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=Hs(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=Ks(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},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function qs(s){const e=E.c(116),{connection:n,connectionId:o,org:i,requestedTabId:a,collections:l,onUpdate:j,isUpdating:f,prompts:m,resources:x,tools:c,isLoadingTools:r}=s;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={from:"/$org/$project/mcps/$connectionId"},e[0]=h):h=e[0];const d=be(h),u=Nt(),N=at();let b;e[1]!==o?(b={connectionId:o},e[1]=o,e[2]=b):b=e[2];const _=$t(b),p=n?.connection_type==="VIRTUAL"||_.isAuthenticated;let C;e[3]!==n?(C={connections:[n],binding:"MCP"},e[3]=n,e[4]=C):C=e[4];const g=It(C).length>0,k=n?.metadata?.repository,P=!!k?.url;let V;e[5]===Symbol.for("react.memo_cache_sentinel")?(V=yt(Ls),e[5]=V):V=e[5];let A;e[6]!==n?(A=st(n),e[6]=n,e[7]=A):A=e[7];let L;e[8]!==A?(L={resolver:V,values:A},e[8]=A,e[9]=L):L=e[9];const y=_t(L),R=y.formState.isDirty;let M;e[10]!==y||e[11]!==j?(M=async()=>{if(!await y.trigger())return;const q=y.getValues(),Le=Ws(q);await j(Le),y.reset(q)},e[10]=y,e[11]=j,e[12]=M):M=e[12];const v=M;let $;e[13]!==n||e[14]!==y?($=()=>{y.reset(st(n))},e[13]=n,e[14]=y,e[15]=$):$=e[15];const I=$;let T;e[16]!==n.id||e[17]!==N||e[18]!==u?(T=async()=>{await At(n.id,N,u)&&Ve.success("Authentication successful")},e[16]=n.id,e[17]=N,e[18]=u,e[19]=T):T=e[19];const U=T;let F;e[20]!==n.id||e[21]!==u?(F=async()=>{try{const O=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!O.ok){const Le=await O.text();Ve.error(`Failed to remove OAuth: ${Le}`);return}const q=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:St.isMCPAuthenticated(q.href,null)}),Ve.success("OAuth removed. You can now re-authenticate with a different account.")}catch(O){console.error("Error removing OAuth token:",O),Ve.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=u,e[22]=F):F=e[22];const ge=F,ee=c.length,Y=m.length,ve=x.length;let Ne;e[23]!==c?(Ne=c.filter(Ys),e[23]=c,e[24]=Ne):Ne=e[24];const ye=Ne.length,Oe=ee>0||r;let _e;e[25]===Symbol.for("react.memo_cache_sentinel")?(_e={id:"settings",label:"Settings"},e[25]=_e):_e=e[25];let te;e[26]!==r||e[27]!==p||e[28]!==Oe||e[29]!==ee?(te=p&&Oe?[{id:"tools",label:"Tools",count:r?void 0:ee}]:[],e[26]=r,e[27]=p,e[28]=Oe,e[29]=ee,e[30]=te):te=e[30];let se;e[31]!==p||e[32]!==Y?(se=p&&Y>0?[{id:"prompts",label:"Prompts",count:Y}]:[],e[31]=p,e[32]=Y,e[33]=se):se=e[33];let ne;e[34]!==p||e[35]!==ve?(ne=p&&ve>0?[{id:"resources",label:"Resources",count:ve}]:[],e[34]=p,e[35]=ve,e[36]=ne):ne=e[36];let oe;e[37]!==p||e[38]!==ye?(oe=p&&ye>0?[{id:"ui",label:"UI",count:ye}]:[],e[37]=p,e[38]=ye,e[39]=oe):oe=e[39];let Ce;if(e[40]!==l||e[41]!==P||e[42]!==p||e[43]!==te||e[44]!==se||e[45]!==ne||e[46]!==oe){let O;e[48]!==P?(O=P?[{id:"readme",label:"README"}]:[],e[48]=P,e[49]=O):O=e[49],Ce=[_e,...te,...se,...ne,...oe,...p?(l||[]).map(Qs):[],...O],e[40]=l,e[41]=P,e[42]=p,e[43]=te,e[44]=se,e[45]=ne,e[46]=oe,e[47]=Ce}else Ce=e[47];const je=Ce,ut=p&&je.some(Gs)?"tools":"settings",D=je.some(O=>O.id===a)?a:ut;let Se;e[50]!==d?(Se=O=>{d({search:q=>({...q,tab:O}),replace:!0})},e[50]=d,e[51]=Se):Se=e[51];const re=Se;let ie;e[52]!==l?(ie=l||[],e[52]=l,e[53]=ie):ie=e[53];let we;if(e[54]!==D||e[55]!==ie){let O;e[57]!==D?(O=q=>q.name===D,e[57]=D,e[58]=O):O=e[58],we=ie.find(O),e[54]=D,e[55]=ie,e[56]=we}else we=e[56];const Te=we;let ae;e[59]!==i?(ae=t.jsx(Ge,{children:t.jsx(Dt,{asChild:!0,children:t.jsx(nt,{to:"/$org/$project/mcps",params:{org:i,project:he},children:"Connections"})})}),e[59]=i,e[60]=ae):ae=e[60];let ke;e[61]===Symbol.for("react.memo_cache_sentinel")?(ke=t.jsx(Ot,{}),e[61]=ke):ke=e[61];let ce;e[62]!==n.title?(ce=t.jsx(Ge,{children:t.jsx(Mt,{children:n.title})}),e[62]=n.title,e[63]=ce):ce=e[63];let Pe;e[64]!==ae||e[65]!==ce?(Pe=t.jsx(Rt,{children:t.jsxs(Lt,{children:[ae,ke,ce]})}),e[64]=ae,e[65]=ce,e[66]=Pe):Pe=e[66];const Re=Pe;let le;e[67]!==v||e[68]!==I||e[69]!==R||e[70]!==f?(le=t.jsx(Xe,{children:t.jsx(kt,{onSave:v,onUndo:I,isDirty:R,isSaving:f})}),e[67]=v,e[68]=I,e[69]=R,e[70]=f,e[71]=le):le=e[71];let de;e[72]!==_.hasOAuthToken||e[73]!==n||e[74]!==y||e[75]!==U||e[76]!==ge||e[77]!==p?(de=t.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:t.jsx(gs,{form:y,connection:n,isMCPAuthenticated:p,hasOAuthToken:_.hasOAuthToken,onReauthenticate:U,onRemoveOAuth:ge})}),e[72]=_.hasOAuthToken,e[73]=n,e[74]=y,e[75]=U,e[76]=ge,e[77]=p,e[78]=de):de=e[78];let me;e[79]!==D||e[80]!==re||e[81]!==je?(me=t.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:t.jsx(Et,{tabs:je,activeTab:D,onTabChange:re,className:"flex-1"})}),e[79]=D,e[80]=re,e[81]=je,e[82]=me):me=e[82];let Ie;e[83]===Symbol.for("react.memo_cache_sentinel")?(Ie=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Me,{size:32,className:"animate-spin text-muted-foreground"})}),e[83]=Ie):Ie=e[83];let ue;e[84]!==Te||e[85]!==D||e[86]!==_.isServerError||e[87]!==_.supportsOAuth||e[88]!==n||e[89]!==o||e[90]!==y||e[91]!==U||e[92]!==re||e[93]!==g||e[94]!==P||e[95]!==r||e[96]!==p||e[97]!==i||e[98]!==m||e[99]!==k||e[100]!==x||e[101]!==c?(ue=t.jsx(X.Suspense,{fallback:Ie,children:D==="tools"?t.jsx(Es,{tools:c,connectionId:o,org:i,isLoading:r}):D==="ui"?t.jsx(Us,{tools:c,connectionId:o,org:i}):D==="prompts"?t.jsx(ws,{prompts:m,connectionId:o,org:i}):D==="resources"?t.jsx(Os,{resources:x,connectionId:o,org:i}):D==="settings"?t.jsx(Vt,{connection:n,form:y,hasMcpBinding:g,isMCPAuthenticated:p,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:U,onViewReadme:P?()=>re("readme"):void 0}):D==="readme"&&P?t.jsx(Ts,{repository:k}):Te&&p?t.jsx(Ht,{connectionId:o,org:i,activeCollection:Te},D):t.jsx(Z,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[84]=Te,e[85]=D,e[86]=_.isServerError,e[87]=_.supportsOAuth,e[88]=n,e[89]=o,e[90]=y,e[91]=U,e[92]=re,e[93]=g,e[94]=P,e[95]=r,e[96]=p,e[97]=i,e[98]=m,e[99]=k,e[100]=x,e[101]=c,e[102]=ue):ue=e[102];let pe;e[103]!==D||e[104]!==ue?(pe=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(rt,{children:ue},D)}),e[103]=D,e[104]=ue,e[105]=pe):pe=e[105];let fe;e[106]!==me||e[107]!==pe?(fe=t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[me,pe]}),e[106]=me,e[107]=pe,e[108]=fe):fe=e[108];let xe;e[109]!==de||e[110]!==fe?(xe=t.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[de,fe]}),e[109]=de,e[110]=fe,e[111]=xe):xe=e[111];let $e;return e[112]!==Re||e[113]!==le||e[114]!==xe?($e=t.jsxs(Xt,{breadcrumb:Re,children:[le,xe]}),e[112]=Re,e[113]=le,e[114]=xe,e[115]=$e):$e=e[115],$e}function Gs(s){return s.id==="tools"}function Qs(s){return{id:s.name,label:s.displayName}}function Ys(s){return!!Be(s._meta)}function Js(){const s=E.c(43);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$connectionId"},s[0]=e):e=s[0];const n=be(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:i,org:a}=bt(o),{org:l}=Fe();let j;s[2]===Symbol.for("react.memo_cache_sentinel")?(j={from:"/shell/$org/$project/mcps/$connectionId"},s[2]=j):j=s[2];const m=vt(j).tab??"",x=Ut(i),c=at(),r=Pt(x??void 0);let h;s[3]!==i||s[4]!==l.id?(h={connectionId:i,orgId:l.id},s[3]=i,s[4]=l.id,s[5]=h):h=s[5];const d=ct(h);let u;s[6]!==d?(u={client:d},s[6]=d,s[7]=u):u=s[7];const{data:N}=Bt(u);let b;s[8]!==d?(b={client:d},s[8]=d,s[9]=b):b=s[9];const{data:_}=zt(b),S=x?.connection_type==="VIRTUAL";let p;s[10]!==d||s[11]!==S?(p={client:d,enabled:S},s[10]=d,s[11]=S,s[12]=p):p=s[12];const{data:C,isLoading:w}=Ft(p);let g;s[13]!==N?.prompts?(g=N?.prompts??[],s[13]=N?.prompts,s[14]=g):g=s[14];let k;s[15]!==g?(k=g.map(tn),s[15]=g,s[16]=k):k=s[16];const P=k;let V;s[17]!==_?.resources?(V=_?.resources??[],s[17]=_?.resources,s[18]=V):V=s[18];let A;s[19]!==V?(A=V.map(en),s[19]=V,s[20]=A):A=s[20];const L=A;let y;s[21]!==x?.tools||s[22]!==S||s[23]!==C?.tools?(y=S?(C?.tools??[]).map(Zs):x?.tools??[],s[21]=x?.tools,s[22]=S,s[23]=C?.tools,s[24]=y):y=s[24];const R=y;let M;s[25]!==c.update||s[26]!==i?(M=async I=>{await c.update.mutateAsync({id:i,data:I})},s[25]=c.update,s[26]=i,s[27]=M):M=s[27];const v=M;if(!x){let I;return s[28]!==n||s[29]!==a?(I=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Z,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(Ee,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:a,project:he}}),children:"Back to connections"})})}),s[28]=n,s[29]=a,s[30]=I):I=s[30],I}let $;return s[31]!==c.update.isPending||s[32]!==r||s[33]!==x||s[34]!==i||s[35]!==v||s[36]!==w||s[37]!==a||s[38]!==P||s[39]!==m||s[40]!==L||s[41]!==R?($=t.jsx(qs,{org:a,connection:x,connectionId:i,requestedTabId:m,collections:r,onUpdate:v,isUpdating:c.update.isPending,prompts:P,resources:L,tools:R,isLoadingTools:w}),s[31]=c.update.isPending,s[32]=r,s[33]=x,s[34]=i,s[35]=v,s[36]=w,s[37]=a,s[38]=P,s[39]=m,s[40]=L,s[41]=R,s[42]=$):$=s[42],$}function Zs(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations,_meta:s._meta}}function en(s){return{uri:s.uri,name:s.name,description:s.description}}function tn(s){return{name:s.name,description:s.description}}function sn(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(rt,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Me,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Js,{})})}),s[0]=e):e=s[0],e}function mr(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(sn,{}),s[0]=e):e=s[0],e}export{mr as default};
|
|
1
|
+
import{c as E,j as t,e as be,B as Ee,O as he,aF as nt,u as Fe,G as pt,c0 as We,y as ft,p as xt,r as X,o as ot,bI as ht,bQ as gt,n as z,D as qe,_ as jt,E as rt,g as bt,d as vt,w as Nt,q as yt,t as _t,b as Ct,x as Ve,K as St}from"./index-CFro8UN2.js";import{E as Z,C as ze}from"./collection-search-CoyqU1D4.js";import{E as wt,r as Tt,e as it}from"./env-vars-editor-B-wGdKWy.js";import{g as Be}from"./types-BwtK0SDt.js";import{S as kt}from"./save-actions-wlTs7EAc.js";import{b as Pt,a as It}from"./use-binding-BSR1JqIQ.js";import{u as $t,S as Vt}from"./index-yK-spAaO.js";import{a as At}from"./index-v8sm2sIL.js";import{b as Ge,c as Mt,d as Dt,e as Ot,B as Rt,a as Lt}from"./breadcrumb-iZbBQmAw.js";import{C as Et}from"./collection-tabs-CMDCQky7.js";import{u as Ut,a as at}from"./use-connection-DG_OWqAP.js";import{u as ct}from"./constants-CQia8SG0.js";import{d as Ft}from"./use-mcp-tools-CZWduBUe.js";import{b as zt}from"./use-mcp-resources-DE_pqa4e.js";import{a as Bt}from"./decopilot-events-Cxyg_szC.js";import{i as Me}from"./Loading01-BCzCCK_W.js";import{V as Xe,a as Xt}from"./layout-CoyjPych.js";import{C as Ht}from"./collection-tab-BhUGnesV.js";import{I as Kt}from"./icon-picker-z3hf23Xc.js";import{I as De}from"./integration-icon-BIEcJDPc.js";import{B as Ue}from"./badge-ndLAVsnC.js";import{D as Wt,a as qt,b as Gt,c as Qe}from"./dropdown-menu-C89udqdU.js";import{F as K,a as Qt,b as W,d as B,f as G,c as J,e as Yt}from"./form-D5fEmRYW.js";import{I as Q}from"./input-DHT-dQ79.js";import{S as Ye,a as Je,b as Ze,c as et,d as H}from"./select-aCEgiwRG.js";import{i as lt}from"./CheckCircle-BfTaFQXT.js";import{t as Jt}from"./ChevronDown-BdRzf7AV.js";import{n as Zt}from"./Container-Bhk6-bJW.js";import{s as Ae}from"./Globe02-CK23mV4o.js";import{s as es}from"./RefreshCcw01-CbOhHOko.js";import{i as ts}from"./Terminal-CtGvt6je.js";import{s as ss}from"./Trash01-HuotuXJH.js";import{t as He}from"./Users03-DlGbW_jR.js";import{s as ns}from"./XClose-zAWwTjC9.js";import{U as os}from"./user-B9NsMy7x.js";import{b as rs,a as is}from"./use-virtual-mcp-Duh8bmbW.js";import{i as as}from"./ChevronRight-B6krViGL.js";import{s as cs}from"./Plus--co7BTa1.js";import{f as ls}from"./formatDistanceToNow-Cb2QZZJn.js";import{C as dt}from"./collection-display-button-DKSbWUip.js";import{C as mt}from"./collection-table-wrapper-DB-0Sbir.js";import{C as Ke}from"./card-CyJvSJWb.js";import{R as ds}from"./readme-viewer-D7DlvuHz.js";import{T as ms,a as us}from"./tools-list-DUTGV-gT.js";import{M as ps}from"./mcp-app-renderer-Npg6Irre.js";import"./SearchMd-m173J65G.js";import"./Save01-BTh64p14.js";import"./binder-GTmFyrCu.js";import"./File06-BXEc3PLa.js";import"./Key01-caSA-Yw4.js";import"./constants-CJIMg126.js";import"./registry-utils-BM82D6MS.js";import"./extract-connection-data-B9XYD2id.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-D7-6zhi-.js";import"./index-TAv8a7S6.js";import"./circle-alert-MDHm-xpi.js";import"./index-BdSTuQz3.js";import"./index-BtrcIP0U.js";import"./collapsible-JmR8gcL1.js";import"./use-llm-CCXNkRzc.js";import"./use-collections-BPrRt-ii.js";import"./useMutation-DjbNdewa.js";import"./useQuery-DXBnvbwb.js";import"./localstorage-keys-C6UNhMX3.js";import"./tabs-Ml-lETIv.js";import"./checkbox-D9hw1y4e.js";import"./Check-DnflcDgh.js";import"./dialog-CRMnu4D5.js";import"./X-TCHNS2KI.js";import"./skeleton-C5VDRx_S.js";import"./AlignLeft-BtXg7P0e.js";import"./ArrowLeft-CFfxbhXN.js";import"./Image01-DV4WJck5.js";import"./Settings01-CZOfcAS6.js";import"./useSuspenseInfiniteQuery-BOauSLbt.js";import"./infiniteQueryObserver-DRNwzQ2J.js";import"./popover-CcXiFLG0.js";import"./spinner-D5-FOXs-.js";import"./tooltip-oZyiLpuc.js";import"./index-BvccbczP.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-BHnUcKjj.js";import"./Edit01-B2tEsq4Y.js";import"./XCircle-B9lbeJth.js";import"./AlertCircle-D8UIpq37.js";import"./use-copy-CXa-kk7H.js";import"./Code01-DAiaTcLi.js";import"./use-create-virtual-mcp-Jzi9Oo3B.js";import"./Copy01-IhjKnzZh.js";import"./marked.esm-BaswSlok.js";import"./markdown-C_NNKbxL.js";import"./Eye-D7y1c_jY.js";import"./LayersTwo01-PpQdLoEG.js";import"./Clock-BahX3Ppr.js";import"./index-Dcd2vOoh.js";import"./DotsVertical-DaFbwRBO.js";import"./empty-state-SPMY63O9.js";import"./Inbox01-DJZPgIPT.js";import"./use-list-state-CmyPcBg7.js";import"./use-view-mode-F92r7fn5.js";import"./use-mobile-iIf5uj_e.js";import"./alert-dialog-BifPyCni.js";import"./scroll-area-C6nUo9wy.js";import"./Edit05-D1q7xT-x.js";import"./Link01-DMneZx2j.js";import"./label-DTRd2hOl.js";import"./avatar-B3kSzLTz.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowDown-D7A05Pqz.js";import"./Grid01--89xjjlS.js";import"./List-C5_6cfio.js";import"./table-DbeCzOFv.js";function fs(s){const e=E.c(14),{virtualMcp:n,org:o}=s;let i;e[0]!==o||e[1]!==n.id?(i={org:o,project:he,agentId:n.id},e[0]=o,e[1]=n.id,e[2]=i):i=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(He,{size:16}),e[3]=a):a=e[3];let l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(De,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[4]=n.icon,e[5]=n.title,e[6]=l):l=e[6];let j;e[7]!==n.title?(j=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(as,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=f):f=e[9];let m;return e[10]!==i||e[11]!==l||e[12]!==j?(m=t.jsxs(nt,{to:"/$org/$project/agents/$agentId",params:i,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[l,j,f]}),e[10]=i,e[11]=l,e[12]=j,e[13]=m):m=e[13],m}function tt(s){const e=E.c(20),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:j}=s,f=be(),m=is();let x;e[0]!==m.create||e[1]!==i||e[2]!==a||e[3]!==n||e[4]!==o||e[5]!==f||e[6]!==l?(x=async()=>{const d=await m.create.mutateAsync({title:`${o} Agent`,description:i??null,icon:a??null,status:"active",connections:[{connection_id:n,selected_tools:null,selected_resources:null,selected_prompts:null}]});f({to:"/$org/$project/agents/$agentId",params:{org:l,project:he,agentId:d.id}})},e[0]=m.create,e[1]=i,e[2]=a,e[3]=n,e[4]=o,e[5]=f,e[6]=l,e[7]=x):x=e[7];const c=x;if(j){let d;e[8]!==m.create.isPending?(d=m.create.isPending?t.jsx(Me,{size:16,className:"animate-spin"}):t.jsx(cs,{size:16}),e[8]=m.create.isPending,e[9]=d):d=e[9];let u;return e[10]!==m.create.isPending||e[11]!==c||e[12]!==d?(u=t.jsx(Ee,{variant:"ghost",className:"size-6 p-0",onClick:c,disabled:m.create.isPending,children:d}),e[10]=m.create.isPending,e[11]=c,e[12]=d,e[13]=u):u=e[13],u}let r;e[14]!==m.create.isPending?(r=m.create.isPending?t.jsx(Me,{className:"animate-spin text-muted-foreground"}):t.jsx(He,{className:"size-3 text-muted-foreground"}),e[14]=m.create.isPending,e[15]=r):r=e[15];let h;return e[16]!==m.create.isPending||e[17]!==c||e[18]!==r?(h=t.jsxs(Ee,{variant:"outline",size:"sm",onClick:c,disabled:m.create.isPending,children:[r,"Create an agent"]}),e[16]=m.create.isPending,e[17]=c,e[18]=r,e[19]=h):h=e[19],h}function xs(s){const e=E.c(26),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l}=s;let j;e[0]!==n?(j={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=j):j=e[1];const f=rs(j);if(!(f.length>0)){let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=u):u=e[2];let N;return e[3]!==i||e[4]!==a||e[5]!==n||e[6]!==o||e[7]!==l?(N=t.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[u,t.jsx(tt,{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:!1})]}),e[3]=i,e[4]=a,e[5]=n,e[6]=o,e[7]=l,e[8]=N):N=e[8],N}let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Agents"}),e[9]=x):x=e[9];let c;e[10]!==i||e[11]!==a||e[12]!==n||e[13]!==o||e[14]!==l?(c=t.jsx("div",{className:"flex flex-col gap-1",children:t.jsxs("div",{className:"flex items-center justify-between",children:[x,t.jsx(tt,{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:!0})]})}),e[10]=i,e[11]=a,e[12]=n,e[13]=o,e[14]=l,e[15]=c):c=e[15];let r;if(e[16]!==l||e[17]!==f){let u;e[19]!==l?(u=N=>t.jsx(fs,{virtualMcp:N,org:l},N.id),e[19]=l,e[20]=u):u=e[20],r=f.map(u),e[16]=l,e[17]=f,e[18]=r}else r=e[18];let h;e[21]!==r?(h=t.jsx("div",{className:"flex flex-col gap-2",children:r}),e[21]=r,e[22]=h):h=e[22];let d;return e[23]!==c||e[24]!==h?(d=t.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[c,h]}),e[23]=c,e[24]=h,e[25]=d):d=e[25],d}function hs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:i}){const a=We({control:s.control,name:"ui_type"}),l=We({control:s.control,name:"connection_url"}),{stdioEnabled:j}=ft(),f=(()=>{if(typeof l!="string"||!l)return!1;try{const r=new URL(l);return r.hostname==="api.githubcopilot.com"&&r.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),m=j||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",c=x?xt(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",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(He,{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."})]}),c&&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:c})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(K,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(J,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),a!=="NPX"&&a!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(Ye,{value:r.value,onValueChange:r.onChange,children:[t.jsx(B,{children:t.jsxs(Je,{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(Ae,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(Ze,{})]})}),t.jsxs(et,{children:[t.jsx(H,{value:"HTTP",children:"HTTP"}),t.jsx(H,{value:"SSE",children:"SSE"}),t.jsx(H,{value:"Websocket",children:"Websocket"}),m&&t.jsxs(t.Fragment,{children:[t.jsx(H,{value:"NPX",children:"NPX Package"}),t.jsx(H,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(K,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(W,{className:"flex-1 min-w-0",children:t.jsx(B,{children:t.jsx(Q,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(Ye,{value:r.value,onValueChange:r.onChange,children:[t.jsx(B,{children:t.jsx(Je,{className:"h-10",children:t.jsx(Ze,{})})}),t.jsxs(et,{children:[t.jsx(H,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ae,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(H,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ae,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(H,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ae,{className:"w-4 h-4"}),"Websocket"]})}),m&&t.jsxs(t.Fragment,{children:[t.jsx(H,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Zt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(H,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ts,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(G,{})]})}),a==="NPX"&&t.jsx(K,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(J,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(B,{children:t.jsx(Q,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})}),a==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(K,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(J,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(B,{children:t.jsx(Q,{placeholder:"node, bun, python...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})}),t.jsx(K,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(J,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(B,{children:t.jsx(Q,{placeholder:"arg1 arg2 --flag value",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(G,{})]})})]}),t.jsx(K,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(J,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(B,{children:t.jsx(Q,{placeholder:"/path/to/project (optional)",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})})]}),(a==="NPX"||a==="STDIO")&&t.jsx(K,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(J,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(B,{children:t.jsx(wt,{value:r.value??[],onChange:r.onChange})}),t.jsx(G,{})]})}),a!=="NPX"&&a!=="STDIO"&&t.jsx(K,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(J,{className:"text-xs text-muted-foreground font-medium",children:f?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Wt,{children:[t.jsx(qt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Ue,{variant:"success",className:"gap-1.5",children:[t.jsx(lt,{size:12}),"Authenticated via OAuth",t.jsx(Jt,{size:12})]})})}),t.jsxs(Gt,{align:"start",children:[t.jsxs(Qe,{onClick:o,children:[t.jsx(es,{size:16}),"Re-authenticate"]}),t.jsxs(Qe,{variant:"destructive",onClick:i,children:[t.jsx(ss,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&r.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:()=>r.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(ns,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(B,{children:t.jsx(Q,{type:"password",placeholder:f?"Paste your GitHub PAT":"Enter access token...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),f&&t.jsxs(Yt,{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(G,{})]})})]})}function gs(s){const e=E.c(45),{form:n,connection:o,isMCPAuthenticated:i,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:j}=s,{org:f}=Fe();let m;e[0]!==o.app_name||e[1]!==o.icon||e[2]!==o.title||e[3]!==n.control?(m=o.app_name&&o.icon?t.jsx(De,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}):t.jsx(pt,{control:n.control,name:"icon",render:k=>{const{field:P}=k;return t.jsx(Kt,{value:P.value,onChange:P.onChange,name:o.title,size:"lg",className:"shadow-sm"})}}),e[0]=o.app_name,e[1]=o.icon,e[2]=o.title,e[3]=n.control,e[4]=m):m=e[4];let x;e[5]!==n.control?(x=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(K,{control:n.control,name:"title",render:bs}),t.jsx(K,{control:n.control,name:"description",render:js})]}),e[5]=n.control,e[6]=x):x=e[6];let c;e[7]!==m||e[8]!==x?(c=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[m,x]}),e[7]=m,e[8]=x,e[9]=c):c=e[9];let r;e[10]!==o||e[11]!==n||e[12]!==a||e[13]!==l||e[14]!==j?(r=t.jsx(hs,{form:n,connection:o,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:j}),e[10]=o,e[11]=n,e[12]=a,e[13]=l,e[14]=j,e[15]=r):r=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[16]=h):h=e[16];let d;e[17]!==i?(d=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[h,i?t.jsxs(Ue,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[t.jsx(lt,{size:12}),"Connected"]}):t.jsx(Ue,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[17]=i,e[18]=d):d=e[18];let u;e[19]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[19]=u):u=e[19];let N;e[20]!==o.created_by?(N=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[u,t.jsx(os,{id:o.created_by,size:"2xs"})]}),e[20]=o.created_by,e[21]=N):N=e[21];let b;e[22]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[22]=b):b=e[22];let _;e[23]!==o.updated_at?(_=o.updated_at?ls(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[23]=o.updated_at,e[24]=_):_=e[24];let S;e[25]!==_?(S=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[b,t.jsx("span",{className:"text-sm text-foreground",children:_})]}),e[25]=_,e[26]=S):S=e[26];let p;e[27]!==S||e[28]!==d||e[29]!==N?(p=t.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[d,N,S]}),e[27]=S,e[28]=d,e[29]=N,e[30]=p):p=e[30];let C;e[31]!==o.description||e[32]!==o.icon||e[33]!==o.id||e[34]!==o.title||e[35]!==f.slug?(C=t.jsx(xs,{connectionId:o.id,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,org:f.slug}),e[31]=o.description,e[32]=o.icon,e[33]=o.id,e[34]=o.title,e[35]=f.slug,e[36]=C):C=e[36];let w;e[37]!==p||e[38]!==C||e[39]!==c||e[40]!==r?(w=t.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[c,r,p,C]}),e[37]=p,e[38]=C,e[39]=c,e[40]=r,e[41]=w):w=e[41];let g;return e[42]!==n||e[43]!==w?(g=t.jsx(Qt,{...n,children:w}),e[42]=n,e[43]=w,e[44]=g):g=e[44],g}function js(s){const{field:e}=s;return t.jsxs(W,{className:"w-full space-y-0",children:[t.jsx(B,{children:t.jsx(Q,{...e,value:e.value||"",className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(G,{})]})}function bs(s){const{field:e}=s;return t.jsxs(W,{className:"flex-1 space-y-0",children:[t.jsx(B,{children:t.jsx(Q,{...e,className:"h-auto py-0.5 text-lg! font-medium leading-7 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})}),t.jsx(G,{})]})}function vs(s){const e=E.c(39),{prompts:n,connectionId:o,org:i,onPromptClick:a,showToolbar:l,emptyMessage:j}=s,f=l===void 0?!0:l,m=j===void 0?"This connection doesn't have any prompts yet.":j,x=be(),[c,r]=X.useState(""),[h,d]=X.useState("table"),[u,N]=X.useState("name"),[b,_]=X.useState("asc");let S;e[0]!==b||e[1]!==u?(S=T=>{u===T?(_(Ss),b==="desc"&&N(void 0)):(N(T),_("asc"))},e[0]=b,e[1]=u,e[2]=S):S=e[2];const p=S;let C;e[3]!==o||e[4]!==x||e[5]!==a||e[6]!==i?(C=T=>{a?a(T):o&&i&&x({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:he,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(T.name)}})},e[3]=o,e[4]=x,e[5]=a,e[6]=i,e[7]=C):C=e[7];const w=C;let g;if(e[8]!==n||e[9]!==c||e[10]!==b||e[11]!==u){const T=!n||n.length===0?[]:c.trim()?(()=>{const U=c.toLowerCase();return n.filter(F=>F.name.toLowerCase().includes(U)||F.description&&F.description.toLowerCase().includes(U))})():n;g=!u||!b?T:[...T].sort((U,F)=>{const ge=U[u]||"",ee=F[u]||"",Y=String(ge).localeCompare(String(ee));return b==="asc"?Y:-Y}),e[8]=n,e[9]=c,e[10]=b,e[11]=u,e[12]=g}else g=e[12];const k=g;let P;e[13]===Symbol.for("react.memo_cache_sentinel")?(P=[{id:"name",header:"Name",render:Cs,sortable:!0},{id:"description",header:"Description",render:_s,cellClassName:"flex-1",sortable:!0}],e[13]=P):P=e[13];const V=P;let A;e[14]===Symbol.for("react.memo_cache_sentinel")?(A=V.filter(ys).map(Ns),e[14]=A):A=e[14];const L=A;let y;e[15]!==p||e[16]!==f||e[17]!==b||e[18]!==u||e[19]!==h?(y=f&&t.jsx(Xe,{children:t.jsx(dt,{viewMode:h,onViewModeChange:d,sortKey:u,sortDirection:b,onSort:p,sortOptions:L})}),e[15]=p,e[16]=f,e[17]=b,e[18]=u,e[19]=h,e[20]=y):y=e[20];let R;e[21]===Symbol.for("react.memo_cache_sentinel")?(R=T=>{T.key==="Escape"&&(r(""),T.target.blur())},e[21]=R):R=e[21];let M;e[22]!==c?(M=t.jsx(ze,{value:c,onChange:r,placeholder:"Search prompts...",onKeyDown:R}),e[22]=c,e[23]=M):M=e[23];let v;e[24]!==m||e[25]!==w||e[26]!==p||e[27]!==c||e[28]!==b||e[29]!==u||e[30]!==k||e[31]!==h?(v=h==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:k.length===0?t.jsx(Z,{image:null,title:c?"No prompts found":"No prompts available",description:c?"Try adjusting your search terms":m}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:k.map(T=>t.jsx(Ke,{className:"cursor-pointer transition-colors",onClick:()=>w(T),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(De,{icon:null,name:T.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:T.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:T.description||"No description"})]})]})},T.name))})}):t.jsx(mt,{columns:V,data:k,isLoading:!1,sortKey:u,sortDirection:b,onSort:p,onRowClick:T=>w(T),emptyState:t.jsx(Z,{image:null,title:c?"No prompts found":"No prompts available",description:c?"Try adjusting your search terms":m})}),e[24]=m,e[25]=w,e[26]=p,e[27]=c,e[28]=b,e[29]=u,e[30]=k,e[31]=h,e[32]=v):v=e[32];let $;e[33]!==M||e[34]!==v?($=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[M,v]}),e[33]=M,e[34]=v,e[35]=$):$=e[35];let I;return e[36]!==$||e[37]!==y?(I=t.jsxs(t.Fragment,{children:[y,$]}),e[36]=$,e[37]=y,e[38]=I):I=e[38],I}function Ns(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function ys(s){return s.sortable}function _s(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Cs(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function Ss(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function ws(s){const e=E.c(4),{prompts:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx(vs,{prompts:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}function Ts(s){const e=E.c(2),{repository:n}=s;let o;return e[0]!==n?(o=t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(ds,{repository:n})}),e[0]=n,e[1]=o):o=e[1],o}function ks(s){const e=E.c(36),{resources:n,onResourceClick:o,showToolbar:i,emptyMessage:a}=s,l=i===void 0?!0:i,j=a===void 0?"This connection doesn't have any resources yet.":a,[f,m]=X.useState(""),[x,c]=X.useState("table"),[r,h]=X.useState("name"),[d,u]=X.useState("asc");let N;e[0]!==d||e[1]!==r?(N=v=>{r===v?(u(Ds),d==="desc"&&h(void 0)):(h(v),u("asc"))},e[0]=d,e[1]=r,e[2]=N):N=e[2];const b=N;let _;e[3]!==o?(_=v=>{o&&o(v)},e[3]=o,e[4]=_):_=e[4];const S=_;let p;if(e[5]!==n||e[6]!==f||e[7]!==d||e[8]!==r){const v=!n||n.length===0?[]:f.trim()?(()=>{const $=f.toLowerCase();return n.filter(I=>I.uri.toLowerCase().includes($)||I.name&&I.name.toLowerCase().includes($)||I.description&&I.description.toLowerCase().includes($))})():n;p=!r||!d?v:[...v].sort(($,I)=>{const T=$[r]||"",U=I[r]||"",F=String(T).localeCompare(String(U));return d==="asc"?F:-F}),e[5]=n,e[6]=f,e[7]=d,e[8]=r,e[9]=p}else p=e[9];const C=p;let w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=[{id:"name",header:"Name",render:Ms,sortable:!0},{id:"uri",header:"URI",render:As,sortable:!0},{id:"description",header:"Description",render:Vs,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:$s,sortable:!0}],e[10]=w):w=e[10];const g=w;let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=g.filter(Is).map(Ps),e[11]=k):k=e[11];const P=k;let V;e[12]!==b||e[13]!==l||e[14]!==d||e[15]!==r||e[16]!==x?(V=l&&t.jsx(Xe,{children:t.jsx(dt,{viewMode:x,onViewModeChange:c,sortKey:r,sortDirection:d,onSort:b,sortOptions:P})}),e[12]=b,e[13]=l,e[14]=d,e[15]=r,e[16]=x,e[17]=V):V=e[17];let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=v=>{v.key==="Escape"&&(m(""),v.target.blur())},e[18]=A):A=e[18];let L;e[19]!==f?(L=t.jsx(ze,{value:f,onChange:m,placeholder:"Search resources...",onKeyDown:A}),e[19]=f,e[20]=L):L=e[20];let y;e[21]!==j||e[22]!==S||e[23]!==b||e[24]!==f||e[25]!==d||e[26]!==r||e[27]!==C||e[28]!==x?(y=x==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:C.length===0?t.jsx(Z,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":j}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:C.map(v=>t.jsx(Ke,{className:"cursor-pointer transition-colors",onClick:()=>S(v),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(De,{icon:null,name:v.name||v.uri,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:v.name||v.uri}),t.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:v.uri}),v.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:v.description})]})]})},v.uri))})}):t.jsx(mt,{columns:g,data:C,isLoading:!1,sortKey:r,sortDirection:d,onSort:b,onRowClick:v=>S(v),emptyState:t.jsx(Z,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":j})}),e[21]=j,e[22]=S,e[23]=b,e[24]=f,e[25]=d,e[26]=r,e[27]=C,e[28]=x,e[29]=y):y=e[29];let R;e[30]!==L||e[31]!==y?(R=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[L,y]}),e[30]=L,e[31]=y,e[32]=R):R=e[32];let M;return e[33]!==R||e[34]!==V?(M=t.jsxs(t.Fragment,{children:[V,R]}),e[33]=R,e[34]=V,e[35]=M):M=e[35],M}function Ps(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Is(s){return s.sortable}function $s(s){return t.jsx("span",{className:"text-sm text-muted-foreground",children:s.mimeType||"—"})}function Vs(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function As(s){return t.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:s.uri})}function Ms(s){return t.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name||s.uri})}function Ds(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Os(s){const e=E.c(4),{resources:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx(ks,{resources:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}const Rs=ot({key:z().min(1,"Key is required"),value:z()}),Ls=ot({title:z().min(1,"Name is required"),description:z().nullable().optional(),icon:z().nullable().optional(),ui_type:jt(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:z().optional(),connection_token:z().nullable().optional(),npx_package:z().optional(),stdio_command:z().optional(),stdio_args:z().optional(),stdio_cwd:z().optional(),env_vars:qe(Rs).optional(),configuration_scopes:qe(z()).nullable().optional(),configuration_state:ht(z(),gt()).nullable().optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Es(s){const e=E.c(5),{tools:n,connectionId:o,org:i,isLoading:a}=s;let l;return e[0]!==o||e[1]!==a||e[2]!==i||e[3]!==n?(l=t.jsx(ms,{tools:n,connectionId:o,org:i,isLoading:a}),e[0]=o,e[1]=a,e[2]=i,e[3]=n,e[4]=l):l=e[4],l}function Us(s){const e=E.c(27),{tools:n,connectionId:o,org:i}=s,a=be(),{org:l}=Fe();let j;e[0]!==o||e[1]!==l.id?(j={connectionId:o,orgId:l.id},e[0]=o,e[1]=l.id,e[2]=j):j=e[2];const f=ct(j),[m,x]=X.useState("");let c,r,h,d;if(e[3]!==f||e[4]!==o||e[5]!==a||e[6]!==i||e[7]!==m||e[8]!==n){const b=(n??[]).filter(Fs),_=m.toLowerCase().trim(),S=_?b.filter(g=>g.name.toLowerCase().includes(_)||g.description&&g.description.toLowerCase().includes(_)):b;let p;e[13]!==o||e[14]!==a||e[15]!==i?(p=g=>{a({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:he,connectionId:o,collectionName:"tools",itemId:encodeURIComponent(g.name)}})},e[13]=o,e[14]=a,e[15]=i,e[16]=p):p=e[16];const C=p;h="flex flex-col h-full overflow-hidden";let w;e[17]===Symbol.for("react.memo_cache_sentinel")?(w=g=>{g.key==="Escape"&&(x(""),g.target.blur())},e[17]=w):w=e[17],e[18]!==m?(d=t.jsx(ze,{value:m,onChange:x,placeholder:"Search apps...",onKeyDown:w}),e[18]=m,e[19]=d):d=e[19],c="flex-1 overflow-auto p-5",r=S.length===0?t.jsx(Z,{image:null,title:m?"No apps found":"No apps available",description:m?"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:S.map(g=>{const k=Be(g._meta);return t.jsxs(Ke,{className:"cursor-pointer transition-colors overflow-hidden",onClick:()=>C(g),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(ps,{resourceURI:k,toolInfo:{tool:g},displayMode:"inline",minHeight:200,maxHeight:200,client:f})}),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:g.name}),t.jsx(us,{annotations:g.annotations,_meta:g._meta})]}),g.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:g.description})]})]},g.name)})}),e[3]=f,e[4]=o,e[5]=a,e[6]=i,e[7]=m,e[8]=n,e[9]=c,e[10]=r,e[11]=h,e[12]=d}else c=e[9],r=e[10],h=e[11],d=e[12];let u;e[20]!==c||e[21]!==r?(u=t.jsx("div",{className:c,children:r}),e[20]=c,e[21]=r,e[22]=u):u=e[22];let N;return e[23]!==h||e[24]!==d||e[25]!==u?(N=t.jsxs("div",{className:h,children:[d,u]}),e[23]=h,e[24]=d,e[25]=u,e[26]=N):N=e[26],N}function Fs(s){return!!Be(s._meta)}function zs(s){return s.command==="npx"}function Bs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Xs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Hs(s,e){const n={command:"npx",args:["-y",s]},o=it(e);return Object.keys(o).length>0&&(n.envVars=o),n}function Ks(s,e,n,o){const i={command:s};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const a=it(o);return Object.keys(a).length>0&&(i.envVars=a),i}function st(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"&&Ct(s.connection_headers)){const o=s.connection_headers,i=Tt(o.envVars);if(zs(o)){const l=Bs(o);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i}}const a=Xs(o);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:i}}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 Ws(s){let e,n=null,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=Hs(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=Ks(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},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function qs(s){const e=E.c(116),{connection:n,connectionId:o,org:i,requestedTabId:a,collections:l,onUpdate:j,isUpdating:f,prompts:m,resources:x,tools:c,isLoadingTools:r}=s;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={from:"/$org/$project/mcps/$connectionId"},e[0]=h):h=e[0];const d=be(h),u=Nt(),N=at();let b;e[1]!==o?(b={connectionId:o},e[1]=o,e[2]=b):b=e[2];const _=$t(b),p=n?.connection_type==="VIRTUAL"||_.isAuthenticated;let C;e[3]!==n?(C={connections:[n],binding:"MCP"},e[3]=n,e[4]=C):C=e[4];const g=It(C).length>0,k=n?.metadata?.repository,P=!!k?.url;let V;e[5]===Symbol.for("react.memo_cache_sentinel")?(V=yt(Ls),e[5]=V):V=e[5];let A;e[6]!==n?(A=st(n),e[6]=n,e[7]=A):A=e[7];let L;e[8]!==A?(L={resolver:V,values:A},e[8]=A,e[9]=L):L=e[9];const y=_t(L),R=y.formState.isDirty;let M;e[10]!==y||e[11]!==j?(M=async()=>{if(!await y.trigger())return;const q=y.getValues(),Le=Ws(q);await j(Le),y.reset(q)},e[10]=y,e[11]=j,e[12]=M):M=e[12];const v=M;let $;e[13]!==n||e[14]!==y?($=()=>{y.reset(st(n))},e[13]=n,e[14]=y,e[15]=$):$=e[15];const I=$;let T;e[16]!==n.id||e[17]!==N||e[18]!==u?(T=async()=>{await At(n.id,N,u)&&Ve.success("Authentication successful")},e[16]=n.id,e[17]=N,e[18]=u,e[19]=T):T=e[19];const U=T;let F;e[20]!==n.id||e[21]!==u?(F=async()=>{try{const O=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!O.ok){const Le=await O.text();Ve.error(`Failed to remove OAuth: ${Le}`);return}const q=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:St.isMCPAuthenticated(q.href,null)}),Ve.success("OAuth removed. You can now re-authenticate with a different account.")}catch(O){console.error("Error removing OAuth token:",O),Ve.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=u,e[22]=F):F=e[22];const ge=F,ee=c.length,Y=m.length,ve=x.length;let Ne;e[23]!==c?(Ne=c.filter(Ys),e[23]=c,e[24]=Ne):Ne=e[24];const ye=Ne.length,Oe=ee>0||r;let _e;e[25]===Symbol.for("react.memo_cache_sentinel")?(_e={id:"settings",label:"Settings"},e[25]=_e):_e=e[25];let te;e[26]!==r||e[27]!==p||e[28]!==Oe||e[29]!==ee?(te=p&&Oe?[{id:"tools",label:"Tools",count:r?void 0:ee}]:[],e[26]=r,e[27]=p,e[28]=Oe,e[29]=ee,e[30]=te):te=e[30];let se;e[31]!==p||e[32]!==Y?(se=p&&Y>0?[{id:"prompts",label:"Prompts",count:Y}]:[],e[31]=p,e[32]=Y,e[33]=se):se=e[33];let ne;e[34]!==p||e[35]!==ve?(ne=p&&ve>0?[{id:"resources",label:"Resources",count:ve}]:[],e[34]=p,e[35]=ve,e[36]=ne):ne=e[36];let oe;e[37]!==p||e[38]!==ye?(oe=p&&ye>0?[{id:"ui",label:"UI",count:ye}]:[],e[37]=p,e[38]=ye,e[39]=oe):oe=e[39];let Ce;if(e[40]!==l||e[41]!==P||e[42]!==p||e[43]!==te||e[44]!==se||e[45]!==ne||e[46]!==oe){let O;e[48]!==P?(O=P?[{id:"readme",label:"README"}]:[],e[48]=P,e[49]=O):O=e[49],Ce=[_e,...te,...se,...ne,...oe,...p?(l||[]).map(Qs):[],...O],e[40]=l,e[41]=P,e[42]=p,e[43]=te,e[44]=se,e[45]=ne,e[46]=oe,e[47]=Ce}else Ce=e[47];const je=Ce,ut=p&&je.some(Gs)?"tools":"settings",D=je.some(O=>O.id===a)?a:ut;let Se;e[50]!==d?(Se=O=>{d({search:q=>({...q,tab:O}),replace:!0})},e[50]=d,e[51]=Se):Se=e[51];const re=Se;let ie;e[52]!==l?(ie=l||[],e[52]=l,e[53]=ie):ie=e[53];let we;if(e[54]!==D||e[55]!==ie){let O;e[57]!==D?(O=q=>q.name===D,e[57]=D,e[58]=O):O=e[58],we=ie.find(O),e[54]=D,e[55]=ie,e[56]=we}else we=e[56];const Te=we;let ae;e[59]!==i?(ae=t.jsx(Ge,{children:t.jsx(Dt,{asChild:!0,children:t.jsx(nt,{to:"/$org/$project/mcps",params:{org:i,project:he},children:"Connections"})})}),e[59]=i,e[60]=ae):ae=e[60];let ke;e[61]===Symbol.for("react.memo_cache_sentinel")?(ke=t.jsx(Ot,{}),e[61]=ke):ke=e[61];let ce;e[62]!==n.title?(ce=t.jsx(Ge,{children:t.jsx(Mt,{children:n.title})}),e[62]=n.title,e[63]=ce):ce=e[63];let Pe;e[64]!==ae||e[65]!==ce?(Pe=t.jsx(Rt,{children:t.jsxs(Lt,{children:[ae,ke,ce]})}),e[64]=ae,e[65]=ce,e[66]=Pe):Pe=e[66];const Re=Pe;let le;e[67]!==v||e[68]!==I||e[69]!==R||e[70]!==f?(le=t.jsx(Xe,{children:t.jsx(kt,{onSave:v,onUndo:I,isDirty:R,isSaving:f})}),e[67]=v,e[68]=I,e[69]=R,e[70]=f,e[71]=le):le=e[71];let de;e[72]!==_.hasOAuthToken||e[73]!==n||e[74]!==y||e[75]!==U||e[76]!==ge||e[77]!==p?(de=t.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:t.jsx(gs,{form:y,connection:n,isMCPAuthenticated:p,hasOAuthToken:_.hasOAuthToken,onReauthenticate:U,onRemoveOAuth:ge})}),e[72]=_.hasOAuthToken,e[73]=n,e[74]=y,e[75]=U,e[76]=ge,e[77]=p,e[78]=de):de=e[78];let me;e[79]!==D||e[80]!==re||e[81]!==je?(me=t.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:t.jsx(Et,{tabs:je,activeTab:D,onTabChange:re,className:"flex-1"})}),e[79]=D,e[80]=re,e[81]=je,e[82]=me):me=e[82];let Ie;e[83]===Symbol.for("react.memo_cache_sentinel")?(Ie=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Me,{size:32,className:"animate-spin text-muted-foreground"})}),e[83]=Ie):Ie=e[83];let ue;e[84]!==Te||e[85]!==D||e[86]!==_.isServerError||e[87]!==_.supportsOAuth||e[88]!==n||e[89]!==o||e[90]!==y||e[91]!==U||e[92]!==re||e[93]!==g||e[94]!==P||e[95]!==r||e[96]!==p||e[97]!==i||e[98]!==m||e[99]!==k||e[100]!==x||e[101]!==c?(ue=t.jsx(X.Suspense,{fallback:Ie,children:D==="tools"?t.jsx(Es,{tools:c,connectionId:o,org:i,isLoading:r}):D==="ui"?t.jsx(Us,{tools:c,connectionId:o,org:i}):D==="prompts"?t.jsx(ws,{prompts:m,connectionId:o,org:i}):D==="resources"?t.jsx(Os,{resources:x,connectionId:o,org:i}):D==="settings"?t.jsx(Vt,{connection:n,form:y,hasMcpBinding:g,isMCPAuthenticated:p,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:U,onViewReadme:P?()=>re("readme"):void 0}):D==="readme"&&P?t.jsx(Ts,{repository:k}):Te&&p?t.jsx(Ht,{connectionId:o,org:i,activeCollection:Te},D):t.jsx(Z,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[84]=Te,e[85]=D,e[86]=_.isServerError,e[87]=_.supportsOAuth,e[88]=n,e[89]=o,e[90]=y,e[91]=U,e[92]=re,e[93]=g,e[94]=P,e[95]=r,e[96]=p,e[97]=i,e[98]=m,e[99]=k,e[100]=x,e[101]=c,e[102]=ue):ue=e[102];let pe;e[103]!==D||e[104]!==ue?(pe=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(rt,{children:ue},D)}),e[103]=D,e[104]=ue,e[105]=pe):pe=e[105];let fe;e[106]!==me||e[107]!==pe?(fe=t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[me,pe]}),e[106]=me,e[107]=pe,e[108]=fe):fe=e[108];let xe;e[109]!==de||e[110]!==fe?(xe=t.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[de,fe]}),e[109]=de,e[110]=fe,e[111]=xe):xe=e[111];let $e;return e[112]!==Re||e[113]!==le||e[114]!==xe?($e=t.jsxs(Xt,{breadcrumb:Re,children:[le,xe]}),e[112]=Re,e[113]=le,e[114]=xe,e[115]=$e):$e=e[115],$e}function Gs(s){return s.id==="tools"}function Qs(s){return{id:s.name,label:s.displayName}}function Ys(s){return!!Be(s._meta)}function Js(){const s=E.c(43);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$connectionId"},s[0]=e):e=s[0];const n=be(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:i,org:a}=bt(o),{org:l}=Fe();let j;s[2]===Symbol.for("react.memo_cache_sentinel")?(j={from:"/shell/$org/$project/mcps/$connectionId"},s[2]=j):j=s[2];const m=vt(j).tab??"",x=Ut(i),c=at(),r=Pt(x??void 0);let h;s[3]!==i||s[4]!==l.id?(h={connectionId:i,orgId:l.id},s[3]=i,s[4]=l.id,s[5]=h):h=s[5];const d=ct(h);let u;s[6]!==d?(u={client:d},s[6]=d,s[7]=u):u=s[7];const{data:N}=Bt(u);let b;s[8]!==d?(b={client:d},s[8]=d,s[9]=b):b=s[9];const{data:_}=zt(b),S=x?.connection_type==="VIRTUAL";let p;s[10]!==d||s[11]!==S?(p={client:d,enabled:S},s[10]=d,s[11]=S,s[12]=p):p=s[12];const{data:C,isLoading:w}=Ft(p);let g;s[13]!==N?.prompts?(g=N?.prompts??[],s[13]=N?.prompts,s[14]=g):g=s[14];let k;s[15]!==g?(k=g.map(tn),s[15]=g,s[16]=k):k=s[16];const P=k;let V;s[17]!==_?.resources?(V=_?.resources??[],s[17]=_?.resources,s[18]=V):V=s[18];let A;s[19]!==V?(A=V.map(en),s[19]=V,s[20]=A):A=s[20];const L=A;let y;s[21]!==x?.tools||s[22]!==S||s[23]!==C?.tools?(y=S?(C?.tools??[]).map(Zs):x?.tools??[],s[21]=x?.tools,s[22]=S,s[23]=C?.tools,s[24]=y):y=s[24];const R=y;let M;s[25]!==c.update||s[26]!==i?(M=async I=>{await c.update.mutateAsync({id:i,data:I})},s[25]=c.update,s[26]=i,s[27]=M):M=s[27];const v=M;if(!x){let I;return s[28]!==n||s[29]!==a?(I=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Z,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(Ee,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:a,project:he}}),children:"Back to connections"})})}),s[28]=n,s[29]=a,s[30]=I):I=s[30],I}let $;return s[31]!==c.update.isPending||s[32]!==r||s[33]!==x||s[34]!==i||s[35]!==v||s[36]!==w||s[37]!==a||s[38]!==P||s[39]!==m||s[40]!==L||s[41]!==R?($=t.jsx(qs,{org:a,connection:x,connectionId:i,requestedTabId:m,collections:r,onUpdate:v,isUpdating:c.update.isPending,prompts:P,resources:L,tools:R,isLoadingTools:w}),s[31]=c.update.isPending,s[32]=r,s[33]=x,s[34]=i,s[35]=v,s[36]=w,s[37]=a,s[38]=P,s[39]=m,s[40]=L,s[41]=R,s[42]=$):$=s[42],$}function Zs(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations,_meta:s._meta}}function en(s){return{uri:s.uri,name:s.name,description:s.description}}function tn(s){return{name:s.name,description:s.description}}function sn(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(rt,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Me,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Js,{})})}),s[0]=e):e=s[0],e}function mr(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(sn,{}),s[0]=e):e=s[0],e}export{mr 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-CFro8UN2.js";import{B as a}from"./badge-ndLAVsnC.js";import{i as l}from"./AlertCircle-D8UIpq37.js";import{i as m}from"./CheckCircle-BfTaFQXT.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 ge,j as t,E as yt,r as H,u as vt,w as Ct,e as Nt,d as bt,f as _t,y as kt,t as wt,q as St,b as Tt,B as O,O as Q,z as oe,x as J,o as ct,D as Dt,n as Y,_ as It}from"./index-B6H1H8GZ.js";import{g as Pt}from"./generate-id-Dyweu44Y.js";import{C as At}from"./collection-display-button-B5-Qbe51.js";import{C as $t,E as $e}from"./collection-search-BqJoX17Q.js";import{T as Et,a as Ot,b as we,c as pe,d as zt,e as Lt}from"./table-ls4zjAkQ.js";import{C as lt}from"./connection-card-BdnPGsex.js";import{C as Te,i as Vt}from"./connection-status-C-QmdjUW.js";import{I as Ne}from"./integration-icon-lbcrIfEl.js";import{P as ve}from"./index-D-QI-if6.js";import{U as be}from"./user-DoJm1uYf.js";import{u as Ft}from"./use-binding-BfnusZ1F.js";import{u as Bt}from"./use-list-state-Cs0Vw1fn.js";import{f as Ut,e as Mt}from"./registry-utils-Bl8qAIIE.js";import{f as Oe,a as ze,b as Le,c as Ve,d as Fe,e as Be,A as Ue,h as Me}from"./alert-dialog-CjulzWr7.js";import{B as Re}from"./badge-DeKjEqoU.js";import{B as Rt,a as Ht,b as Xt,c as Kt}from"./breadcrumb-DZ4K3wPr.js";import{C as De}from"./checkbox-DOpKFROJ.js";import{D as qe,a as Qe,b as Je,c as Ye,d as Ze,e as at}from"./dialog-DZh8Ph30.js";import{D as He,a as Xe,b as Ke,c as fe}from"./dropdown-menu-Z-xkakKz.js";import{a as Wt,F as Z,b as ee,c as te,d as ne,f as se}from"./form-u0JM0zFo.js";import{I as xe}from"./input-DL82FsGU.js";import{S as Gt,a as qt,b as Qt,c as Jt,d as Ce}from"./select-BNpARAGJ.js";import{T as Yt}from"./textarea-DM9DH5x9.js";import{a as Zt,b as en}from"./use-connection-C6mRcJDK.js";import{u as ot,a as tn}from"./constants-BDiSPTuo.js";import{b as nn}from"./use-mcp-tools-CMrxqGk3.js";import{b as sn}from"./use-virtual-mcp-Dbh6kzyX.js";import{n as on}from"./ArrowDown-CWZOxMGB.js";import{i as rn}from"./ArrowUp-CxJFPww9.js";import{t as cn}from"./ChevronDown-DMBKkJDw.js";import{n as he}from"./Container-yYsRLnMs.js";import{i as We}from"./DotsVertical-JTzIXbI1.js";import{s as Ge}from"./Eye-CH7m62Q9.js";import{s as Ee}from"./Globe02-C9h9OvDn.js";import{i as ln}from"./Loading01-BSgt365L.js";import{s as an}from"./Plus-DyccoR76.js";import{i as dn}from"./Terminal-BQ8QYOY1.js";import{s as Ie}from"./Trash01-CJ60cufT.js";import{s as dt}from"./XClose-Rpsc-3OA.js";import{f as _e}from"./format-time-CMKyl-GC.js";import{r as mn,E as un,e as mt}from"./env-vars-editor-C_fpQu3r.js";import"./Check-BxmpGgJO.js";import"./Grid01-BJl2SMz4.js";import"./List-DurPU5xB.js";import"./tooltip-j8kTHx55.js";import"./index-D_0ZYhFs.js";import"./SearchMd-C9PpmA7c.js";import"./card-DkMC4yhp.js";import"./AlertCircle-COCPzruB.js";import"./CheckCircle-CTJxivs_.js";import"./localstorage-keys-B-P4Lkkc.js";import"./useQuery-BQ0SjuWE.js";import"./useMutation-CJ6jjC2l.js";import"./avatar-COttSggk.js";import"./binder-JBklfnkZ.js";import"./use-view-mode-Csk7hnWi.js";import"./use-mobile-TplPgiBS.js";import"./ChevronRight-H9Yc9f7O.js";import"./X-CpYNC6lo.js";import"./label-CiV91E3T.js";import"./use-collections-D-dYas4g.js";import"./differenceInSeconds-NQ4PDo0z.js";function it(o){return o.title.trim().replace(/\s+\(\d+\)$/,"")}function pn(o){const e=new Map;for(const l of o){if(l.connection_type==="VIRTUAL")continue;const u=it(l),r=e.get(u);r?r.push(l):e.set(u,[l])}const n=[],c=new Set;for(const l of o){if(l.connection_type==="VIRTUAL")continue;const u=it(l);if(c.has(u))continue;c.add(u);const r=e.get(u),h=r[0];r.length===1?n.push({type:"single",connection:h}):n.push({type:"group",key:u,icon:h.icon,title:h.app_name?h.title.replace(/\s*\(\d+\)\s*$/,""):h.title,connections:r})}return n}function ut(o){const e=new Set,n=[];for(const c of o)c.created_by&&!e.has(c.created_by)&&(e.add(c.created_by),n.push(c.created_by));return n}function xn(o){let e=0,n=0,c=0;for(const l of o)l.connection_type!=="VIRTUAL"&&(l.status==="active"?e++:l.status==="error"?c++:n++);return{active:e,inactive:n,error:c,total:e+n+c}}const hn=ct({key:Y(),value:Y()}),fn=ct({title:Y().min(1,"Name is required"),description:Y().nullable().optional(),icon:Y().nullable().optional(),ui_type:It(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:Y().optional(),connection_token:Y().nullable().optional(),npx_package:Y().optional(),stdio_command:Y().optional(),stdio_args:Y().optional(),stdio_cwd:Y().optional(),env_vars:Dt(hn).optional()}).refine(o=>o.ui_type==="NPX"?!!o.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(o=>o.ui_type==="STDIO"?!!o.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(o=>o.ui_type==="HTTP"||o.ui_type==="SSE"||o.ui_type==="Websocket"?!!o.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Pe(o){const e=o.trim();if(!e)return"";try{const n=new URL(e),c=n.pathname.length>1?n.pathname.replace(/\/+$/,""):n.pathname;return`${n.origin}${c}`}catch{return e.replace(/\/+$/,"")}}function gn(o){const e=o.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const n=e[0]?.toLowerCase();if(n!=="npx"&&n!=="bunx")return null;const l=e.slice(1).find(u=>!u.startsWith("-"));return l?{packageName:l}:null}function Se(o){const{uiType:e}=o,n=Pe(o.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&n===Pe("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 c=(o.npxPackage??"").trim();return e==="NPX"&&c==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function rt(o){if(o.registryItems.length===0||o.uiType!=="HTTP"&&o.uiType!=="SSE"&&o.uiType!=="Websocket")return null;const e=Pe(o.connectionUrl??"");if(!e)return null;const n=o.registryItems.find(u=>(u.server?.remotes??[]).some(h=>Pe(h.url??"")===e));if(!n)return null;const c=n.title||n.name||n.server?.title||n.server?.name||"",l=n.server?.description||n.description||n.summary||null;return c?{id:"registry",title:c,description:l}:null}function jn(o,e){const n={command:"npx",args:["-y",o]},c=mt(e);return Object.keys(c).length>0&&(n.envVars=c),n}function yn(o,e,n,c){const l={command:o};e.trim()&&(l.args=e.trim().split(/\s+/)),n?.trim()&&(l.cwd=n.trim());const u=mt(c);return Object.keys(u).length>0&&(l.envVars=u),l}function vn(o){return o.command==="npx"}function Cn(o){return o.args?.find(e=>!e.startsWith("-"))??""}function Nn(o){return{command:o.command,args:o.args?.join(" ")??"",cwd:o.cwd??""}}function bn(o,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 _n(o){const e=ge.c(107),{group:n,onNavigate:c,onDelete:l,selectionMode:u,selectedIds:r,onToggleSelect:h}=o,[C,d]=H.useState(!1);let f;if(e[0]!==n.connections||e[1]!==r){let $;e[3]!==r?($=E=>r.has(E.id),e[3]=r,e[4]=$):$=e[4],f=n.connections.every($),e[0]=n.connections,e[1]=r,e[2]=f}else f=e[2];const p=f;let T;if(e[5]!==n.connections||e[6]!==r){let $;e[8]!==r?($=E=>r.has(E.id),e[8]=r,e[9]=$):$=e[9],T=n.connections.some($),e[5]=n.connections,e[6]=r,e[7]=T}else T=e[7];const x=T;let j,y,w,_,N,I,A,z,U,b,k;if(e[10]!==p||e[11]!==n.connections||e[12]!==n.icon||e[13]!==n.title||e[14]!==h||e[15]!==r||e[16]!==u||e[17]!==x){const $=ut(n.connections),E=n.connections.reduce(Tn,n.connections[0]),de=E.updated_at??E.created_at;j=lt;const D=`${n.connections.length} instances`;e[29]!==n.icon||e[30]!==n.title||e[31]!==D?(U={title:n.title,icon:n.icon,description:D},e[29]=n.icon,e[30]=n.title,e[31]=D,e[32]=U):U=e[32],e[33]!==p||e[34]!==n.connections||e[35]!==h||e[36]!==r||e[37]!==u?(b=()=>u?(()=>{for(const R of n.connections)p?r.has(R.id)&&h(R.id):r.has(R.id)||h(R.id)})():d(!0),e[33]=p,e[34]=n.connections,e[35]=h,e[36]=r,e[37]=u,e[38]=b):b=e[38];const le=u&&p&&"ring-2 ring-primary",me=u&&x&&!p&&"ring-1 ring-primary/50";e[39]!==le||e[40]!==me?(k=oe(le,me),e[39]=le,e[40]=me,e[41]=k):k=e[41],e[42]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(he,{}),e[42]=y):y=e[42],e[43]!==p||e[44]!==n.connections||e[45]!==h||e[46]!==r||e[47]!==u||e[48]!==x?(w=u?t.jsx(De,{checked:p?!0:x?"indeterminate":!1,onCheckedChange:()=>{for(const R of n.connections)p?r.has(R.id)&&h(R.id):r.has(R.id)||h(R.id)}}):t.jsxs(Re,{variant:"secondary",className:"text-xs tabular-nums",children:["x",n.connections.length]}),e[43]=p,e[44]=n.connections,e[45]=h,e[46]=r,e[47]=u,e[48]=x,e[49]=w):w=e[49];let ue;e[50]!==n.connections?(ue=n.connections.slice(0,6).map(Sn),e[50]=n.connections,e[51]=ue):ue=e[51],e[52]!==ue?(_=t.jsx("div",{className:"flex items-center gap-1",children:ue}),e[52]=ue,e[53]=_):_=e[53],A="flex items-center justify-between text-xs text-muted-foreground w-full min-w-0";const je=$.map(R=>t.jsx(be,{id:R,size:"3xs",avatarOnly:$.length>1},R));e[54]!==je?(z=t.jsx("div",{className:"flex items-center -space-x-1.5",children:je}),e[54]=je,e[55]=z):z=e[55],N="shrink-0 ml-2",I=de?_e(new Date(de)):"—",e[10]=p,e[11]=n.connections,e[12]=n.icon,e[13]=n.title,e[14]=h,e[15]=r,e[16]=u,e[17]=x,e[18]=j,e[19]=y,e[20]=w,e[21]=_,e[22]=N,e[23]=I,e[24]=A,e[25]=z,e[26]=U,e[27]=b,e[28]=k}else j=e[18],y=e[19],w=e[20],_=e[21],N=e[22],I=e[23],A=e[24],z=e[25],U=e[26],b=e[27],k=e[28];let v;e[56]!==N||e[57]!==I?(v=t.jsx("span",{className:N,children:I}),e[56]=N,e[57]=I,e[58]=v):v=e[58];let M;e[59]!==v||e[60]!==A||e[61]!==z?(M=t.jsxs("div",{className:A,children:[z,v]}),e[59]=v,e[60]=A,e[61]=z,e[62]=M):M=e[62];let V;e[63]!==j||e[64]!==y||e[65]!==w||e[66]!==_||e[67]!==M||e[68]!==U||e[69]!==b||e[70]!==k?(V=t.jsx(j,{connection:U,onClick:b,className:k,fallbackIcon:y,headerActions:w,body:_,footer:M}),e[63]=j,e[64]=y,e[65]=w,e[66]=_,e[67]=M,e[68]=U,e[69]=b,e[70]=k,e[71]=V):V=e[71];let X;e[72]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(he,{}),e[72]=X):X=e[72];let K;e[73]!==n.icon||e[74]!==n.title?(K=t.jsx(Ne,{icon:n.icon,name:n.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:X}),e[73]=n.icon,e[74]=n.title,e[75]=K):K=e[75];let W;e[76]!==n.connections.length?(W=t.jsxs(Re,{variant:"secondary",className:"ml-2 text-xs tabular-nums",children:["x",n.connections.length]}),e[76]=n.connections.length,e[77]=W):W=e[77];let g;e[78]!==n.title||e[79]!==W?(g=t.jsxs(Ye,{children:[n.title,W]}),e[78]=n.title,e[79]=W,e[80]=g):g=e[80];let S;e[81]!==n.connections.length?(S=t.jsxs(Ze,{children:[n.connections.length," installed instances"]}),e[81]=n.connections.length,e[82]=S):S=e[82];let L;e[83]!==g||e[84]!==S?(L=t.jsxs("div",{children:[g,S]}),e[83]=g,e[84]=S,e[85]=L):L=e[85];let ie;e[86]!==K||e[87]!==L?(ie=t.jsx(Je,{className:"px-6 pt-6 pb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[K,L]})}),e[86]=K,e[87]=L,e[88]=ie):ie=e[88];let re;if(e[89]!==n.connections||e[90]!==l||e[91]!==c){let $;e[93]!==l||e[94]!==c?($=E=>t.jsxs("div",{className:"flex items-center gap-3 px-6 py-3 hover:bg-muted/30 cursor-pointer transition-colors",onClick:()=>{d(!1),c(E.id)},children:[t.jsx(Ne,{icon:E.icon,name:E.title,size:"sm",className:"shrink-0",fallbackIcon:t.jsx(he,{})}),t.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:E.title}),t.jsx(Te,{status:E.status})]}),t.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground shrink-0",children:[t.jsx(be,{id:E.created_by,size:"3xs"}),t.jsx("span",{children:E.created_at?_e(new Date(E.created_at)):"—"})]}),t.jsxs(He,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(O,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:wn,children:t.jsx(We,{size:16})})}),t.jsxs(Ke,{align:"end",onClick:kn,children:[t.jsxs(fe,{onClick:()=>{d(!1),c(E.id)},children:[t.jsx(Ge,{size:16}),"Open"]}),t.jsxs(fe,{variant:"destructive",onClick:()=>l(E),children:[t.jsx(Ie,{size:16}),"Delete"]})]})]})]},E.id),e[93]=l,e[94]=c,e[95]=$):$=e[95],re=n.connections.map($),e[89]=n.connections,e[90]=l,e[91]=c,e[92]=re}else re=e[92];let ae;e[96]!==re?(ae=t.jsx("div",{className:"divide-y max-h-80 overflow-auto",children:re}),e[96]=re,e[97]=ae):ae=e[97];let ce;e[98]!==ie||e[99]!==ae?(ce=t.jsxs(Qe,{className:"sm:max-w-lg p-0 gap-0",children:[ie,ae]}),e[98]=ie,e[99]=ae,e[100]=ce):ce=e[100];let m;e[101]!==C||e[102]!==ce?(m=t.jsx(qe,{open:C,onOpenChange:d,children:ce}),e[101]=C,e[102]=ce,e[103]=m):m=e[103];let F;return e[104]!==V||e[105]!==m?(F=t.jsxs(t.Fragment,{children:[V,m]}),e[104]=V,e[105]=m,e[106]=F):F=e[106],F}function kn(o){return o.stopPropagation()}function wn(o){return o.stopPropagation()}function Sn(o){return t.jsx(Te,{status:o.status},o.id)}function Tn(o,e){const n=e.updated_at??e.created_at,c=o.updated_at??o.created_at;return n?c?new Date(n)>new Date(c)?e:o:e:o}function Dn(o){const e=ge.c(28),{count:n,total:c,onSelectAll:l,onDeselectAll:u,onDelete:r,onAddToAgent:h,onToggleStatus:C,onCancel:d}=o;if(n===0)return null;let f;e[0]!==n?(f=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=f):f=e[1];let p;e[2]!==n||e[3]!==u||e[4]!==l||e[5]!==c?(p=n<c?t.jsxs(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:["Select all (",c,")"]}):t.jsx(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:"Clear selection"}),e[2]=n,e[3]=u,e[4]=l,e[5]=c,e[6]=p):p=e[6];let T;e[7]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(an,{size:13}),e[7]=T):T=e[7];let x;e[8]!==h?(x=t.jsxs(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:[T,"Add to Agent"]}),e[8]=h,e[9]=x):x=e[9];let j;e[10]!==C?(j=t.jsx(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>C("active"),children:"Enable"}),e[10]=C,e[11]=j):j=e[11];let y;e[12]!==C?(y=t.jsx(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>C("inactive"),children:"Disable"}),e[12]=C,e[13]=y):y=e[13];let w;e[14]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(Ie,{size:13}),e[14]=w):w=e[14];let _;e[15]!==r?(_=t.jsxs(O,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:[w,"Delete"]}),e[15]=r,e[16]=_):_=e[16];let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(dt,{size:13}),e[17]=N):N=e[17];let I;e[18]!==d?(I=t.jsx(O,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:N}),e[18]=d,e[19]=I):I=e[19];let A;return e[20]!==f||e[21]!==I||e[22]!==p||e[23]!==x||e[24]!==j||e[25]!==y||e[26]!==_?(A=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:[f,p,x,j,y,_,I]})}),e[20]=f,e[21]=I,e[22]=p,e[23]=x,e[24]=j,e[25]=y,e[26]=_,e[27]=A):A=e[27],A}function In(o){const e=ge.c(25),{open:n,onOpenChange:c,agents:l,onConfirm:u}=o,[r,h]=H.useState(null);let C;e[0]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs(Je,{children:[t.jsx(Ye,{children:"Add to Agent"}),t.jsx(Ze,{children:"Select an agent to add the selected connections to."})]}),e[0]=C):C=e[0];let d;e[1]!==l||e[2]!==r?(d=l.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):l.map(N=>t.jsxs("button",{type:"button",onClick:()=>h(N.id),className:oe("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",r===N.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Ne,{icon:N.icon,name:N.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:N.title}),N.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:N.description})]})]},N.id)),e[1]=l,e[2]=r,e[3]=d):d=e[3];let f;e[4]!==d?(f=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:d}),e[4]=d,e[5]=f):f=e[5];let p;e[6]!==c?(p=t.jsx(O,{variant:"outline",onClick:()=>c(!1),children:"Cancel"}),e[6]=c,e[7]=p):p=e[7];const T=!r;let x;e[8]!==u||e[9]!==c||e[10]!==r?(x=()=>{r&&(u(r),c(!1),h(null))},e[8]=u,e[9]=c,e[10]=r,e[11]=x):x=e[11];let j;e[12]!==T||e[13]!==x?(j=t.jsx(O,{disabled:T,onClick:x,children:"Add"}),e[12]=T,e[13]=x,e[14]=j):j=e[14];let y;e[15]!==p||e[16]!==j?(y=t.jsxs(at,{children:[p,j]}),e[15]=p,e[16]=j,e[17]=y):y=e[17];let w;e[18]!==f||e[19]!==y?(w=t.jsxs(Qe,{className:"sm:max-w-[400px]",children:[C,f,y]}),e[18]=f,e[19]=y,e[20]=w):w=e[20];let _;return e[21]!==c||e[22]!==n||e[23]!==w?(_=t.jsx(qe,{open:n,onOpenChange:c,children:w}),e[21]=c,e[22]=n,e[23]=w,e[24]=_):_=e[24],_}function Pn(o){const e=ge.c(20),{open:n,onOpenChange:c,count:l,onConfirm:u}=o,r=l!==1?"s":"";let h;e[0]!==l||e[1]!==r?(h=t.jsxs(Ve,{children:["Delete ",l," connection",r,"?"]}),e[0]=l,e[1]=r,e[2]=h):h=e[2];const C=l!==1?"s":"";let d;e[3]!==C?(d=t.jsxs(Fe,{children:["This will permanently delete the selected connection",C,". This action cannot be undone."]}),e[3]=C,e[4]=d):d=e[4];let f;e[5]!==h||e[6]!==d?(f=t.jsxs(Le,{children:[h,d]}),e[5]=h,e[6]=d,e[7]=f):f=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Ue,{children:"Cancel"}),e[8]=p):p=e[8];const T=l!==1?"s":"";let x;e[9]!==l||e[10]!==u||e[11]!==T?(x=t.jsxs(Be,{children:[p,t.jsxs(Me,{onClick:u,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",l," connection",T]})]}),e[9]=l,e[10]=u,e[11]=T,e[12]=x):x=e[12];let j;e[13]!==f||e[14]!==x?(j=t.jsxs(ze,{children:[f,x]}),e[13]=f,e[14]=x,e[15]=j):j=e[15];let y;return e[16]!==c||e[17]!==n||e[18]!==j?(y=t.jsx(Oe,{open:n,onOpenChange:c,children:j}),e[16]=c,e[17]=n,e[18]=j,e[19]=y):y=e[19],y}function An(o){const e=ge.c(37),{columns:n,grouped:c,sortKey:l,sortDirection:u,onSort:r,onRowClick:h,selectionMode:C,selectedIds:d,onToggleSelect:f,emptyState:p}=o;let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=new Set,e[0]=T):T=e[0];const[x,j]=H.useState(T);let y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y=b=>{j(k=>{const v=new Set(k);return v.has(b)?v.delete(b):v.add(b),v})},e[1]=y):y=e[1];const w=y;if(c.length===0&&p){let b;return e[2]!==p?(b=t.jsx("div",{className:"flex items-center justify-center h-full",children:p}),e[2]=p,e[3]=b):b=e[3],b}const _=n.length;let N;if(e[4]!==_||e[5]!==n||e[6]!==r||e[7]!==u||e[8]!==l){let b;e[10]!==_||e[11]!==r||e[12]!==u||e[13]!==l?(b=(k,v)=>{const M=l===k.id,V=v===_-1;return t.jsx(Et,{className:oe("px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider",V&&"w-8","group transition-colors select-none",k.sortable&&"hover:bg-accent cursor-pointer",k.cellClassName),onClick:k.sortable&&r?()=>r(k.id):void 0,children:t.jsxs("span",{className:"flex items-center gap-1",children:[k.header,k.sortable&&t.jsx("span",{className:"w-4 flex items-center justify-center",children:M&&u&&(u==="asc"?t.jsx(rn,{size:16,className:"text-muted-foreground"}):t.jsx(on,{size:16,className:"text-muted-foreground"}))})]})},k.id)},e[10]=_,e[11]=r,e[12]=u,e[13]=l,e[14]=b):b=e[14],N=n.map(b),e[4]=_,e[5]=n,e[6]=r,e[7]=u,e[8]=l,e[9]=N}else N=e[9];let I;e[15]!==N?(I=t.jsx(Ot,{className:"border-b-0",children:t.jsx(we,{className:"h-9 hover:bg-transparent border-b border-border",children:N})}),e[15]=N,e[16]=I):I=e[16];let A;if(e[17]!==n||e[18]!==x||e[19]!==c||e[20]!==h||e[21]!==f||e[22]!==d||e[23]!==C){let b;e[25]!==n||e[26]!==x||e[27]!==h||e[28]!==f||e[29]!==d||e[30]!==C?(b=k=>{if(k.type==="single"){const g=k.connection;return t.jsx(we,{className:oe("group/data-row transition-colors border-b-0 hover:bg-accent/50 cursor-pointer",C&&d.has(g.id)&&"bg-primary/5"),onClick:()=>h(g),children:n.map(S=>t.jsx(pe,{className:oe("px-5 py-4 h-16 align-middle text-sm text-foreground",S.cellClassName),children:t.jsx("div",{className:"min-w-0 w-full truncate overflow-hidden whitespace-nowrap",children:S.render?S.render(g):null})},S.id))},g.id)}const v=k,M=x.has(v.key),V=v.connections.every(g=>d.has(g.id)),X=v.connections.some(g=>d.has(g.id)),K=ut(v.connections),W=v.connections.reduce(En,v.connections[0]);return t.jsxs(H.Fragment,{children:[t.jsx(we,{className:"border-b-0 hover:bg-accent/50 cursor-pointer transition-colors",onClick:()=>w(v.key),children:n.map(g=>{const S=oe("px-5 py-3 h-14 align-middle text-sm",g.cellClassName);if(g.id==="select")return t.jsx(pe,{className:S,children:t.jsx(De,{checked:V?!0:X?"indeterminate":!1,onCheckedChange:()=>{for(const L of v.connections)V?d.has(L.id)&&f(L.id):d.has(L.id)||f(L.id)},onClick:$n})},g.id);if(g.id==="title")return t.jsx(pe,{className:S,children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(Ne,{icon:v.icon,name:v.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(he,{})}),t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:v.title}),t.jsxs(Re,{variant:"secondary",className:"text-xs tabular-nums",children:["x",v.connections.length]})]})},g.id);if(g.id==="updated_by")return t.jsx(pe,{className:S,children:t.jsx("div",{className:"flex items-center -space-x-1.5",children:K.map(L=>t.jsx(be,{id:L,size:"3xs",avatarOnly:K.length>1},L))})},g.id);if(g.id==="updated_at"){const L=W.updated_at??W.created_at;return t.jsx(pe,{className:S,children:t.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:L?_e(new Date(L)):"—"})},g.id)}return g.id==="actions"?t.jsx(pe,{className:S,children:t.jsx(cn,{size:16,className:oe("text-muted-foreground transition-transform",M&&"rotate-180")})},g.id):t.jsx(pe,{className:S},g.id)})}),M&&v.connections.map(g=>t.jsx(we,{className:oe("group/data-row transition-colors border-b-0 hover:bg-accent/50 cursor-pointer bg-muted/20",C&&d.has(g.id)&&"bg-primary/5"),onClick:()=>h(g),children:n.map(S=>t.jsx(pe,{className:oe("px-5 py-3 h-14 align-middle text-sm text-foreground",S.cellClassName,S.id==="title"&&"pl-12"),children:t.jsx("div",{className:"min-w-0 w-full truncate overflow-hidden whitespace-nowrap",children:S.render?S.render(g):null})},S.id))},g.id))]},v.key)},e[25]=n,e[26]=x,e[27]=h,e[28]=f,e[29]=d,e[30]=C,e[31]=b):b=e[31],A=c.map(b),e[17]=n,e[18]=x,e[19]=c,e[20]=h,e[21]=f,e[22]=d,e[23]=C,e[24]=A}else A=e[24];let z;e[32]!==A?(z=t.jsx(zt,{children:A}),e[32]=A,e[33]=z):z=e[33];let U;return e[34]!==I||e[35]!==z?(U=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsxs(Lt,{className:"w-full border-collapse",children:[I,z]})}),e[34]=I,e[35]=z,e[36]=U):U=e[36],U}function $n(o){return o.stopPropagation()}function En(o,e){const n=e.updated_at??e.created_at,c=o.updated_at??o.created_at;return n?c?new Date(n)>new Date(c)?e:o:e:o}function On(){const{org:o}=vt(),e=Ct(),n=Nt(),c=bt({strict:!1}),{data:l}=_t.useSession(),{stdioEnabled:u}=kt(),r=Bt({namespace:o.slug,resource:"connections"}),h=Zt(),C=en(r),[d,f]=H.useReducer(bn,{mode:"idle"}),[p,T]=H.useState(!1),[x,j]=H.useState(new Set),[y,w]=H.useState(!1),[_,N]=H.useState(!1),[I,A]=H.useState("ALL"),[z,U]=H.useState("ALL"),b=sn(),k=C.filter(s=>!(s.connection_type==="VIRTUAL"||I!=="ALL"&&s.connection_type!==I||z!=="ALL"&&s.status!==z)),v=xn(C),M=pn(k),V=s=>{j(i=>{const a=new Set(i);return a.has(s)?a.delete(s):a.add(s),a})},X=()=>{T(!1),j(new Set)},K=Ft(C)[0],W=K?.id??"",g=Ut(K?.tools),S=ot({connectionId:W||null,orgId:o.id}),{data:L}=nn({client:S,toolName:g,toolArguments:{limit:200},enabled:!!(W&&g),staleTime:3600*1e3,select:s=>s.structuredContent??s}),ie=Mt(L??[]),re=c.action==="create",ae=()=>{n({to:"/$org/$project/mcps",params:{org:o.slug,project:Q},search:{action:"create"}})},ce=()=>{n({to:"/$org/$project/mcps",params:{org:o.slug,project:Q},search:{}})},m=wt({resolver:St(fn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),F=m.watch("ui_type"),$=m.watch("connection_url"),E=m.watch("npx_package"),de=Se({uiType:F,connectionUrl:$??"",npxPackage:E??""})??rt({uiType:F,connectionUrl:$??"",registryItems:ie}),D=d.mode==="editing"?d.connection:null;H.useEffect(()=>{if(D){const s=Tt(D.connection_headers)?D.connection_headers:null;if(s&&D.connection_type==="STDIO"){const i=mn(s.envVars);if(vn(s)){const a=Cn(s);m.reset({title:D.title,description:D.description,icon:D.icon??null,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i})}else{const a=Nn(s);m.reset({title:D.title,description:D.description,icon:D.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:i})}}else m.reset({title:D.title,description:D.description,icon:D.icon??null,ui_type:D.connection_type,connection_url:D.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else m.reset({title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[D,m]);const le=ot({connectionId:tn,orgId:o.id}),me=()=>{e.invalidateQueries({predicate:s=>{const i=s.queryKey;return i[1]===o.id&&i[3]==="collection"&&i[4]==="CONNECTIONS"}})},ue=async()=>{w(!1);const s=[...x];let i=0;for(const a of s)try{(await le.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:a,force:!0}})).isError||i++}catch{}me(),J.success(`Deleted ${i} connection${i!==1?"s":""}`),X()},je=async s=>{const i=[...x];let a=0;for(const B of i)try{await h.update.mutateAsync({id:B,data:{status:s}}),a++}catch{}me(),J.success(`${s==="active"?"Enabled":"Disabled"} ${a} connection${a!==1?"s":""}`),X()},R=async s=>{const i=b.find(P=>P.id===s);if(!i||!le)return;const a=new Set(i.connections.map(P=>P.connection_id)),B=[...x].filter(P=>!a.has(P)).map(P=>({connection_id:P,selected_tools:null,selected_resources:null,selected_prompts:null}));if(B.length===0){J.info("All selected connections are already in that agent");return}try{await le.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:s,data:{connections:[...i.connections,...B]}}}),e.invalidateQueries({predicate:P=>{const G=P.queryKey;return G[1]===o.id&&G[3]==="collection"&&G[4]==="VIRTUAL_MCP"}}),J.success(`Added ${B.length} connection${B.length!==1?"s":""} to "${i.title}"`),X()}catch{J.error("Failed to add connections to agent")}},et=s=>{const i=s.content;return Array.isArray(i)&&i[0]?.type==="text"&&typeof i[0].text=="string"?i[0].text:"Unknown error"},pt=async()=>{if(d.mode!=="deleting")return;const s=d.connection;f({type:"close"});try{const i=await le.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:s.id}});if(i.isError){const a=et(i),B=a.replace(/^Error:\s*/,"");try{const P=JSON.parse(B);if(P.code==="CONNECTION_IN_USE"&&P.agentNames){f({type:"force-delete",connection:s,agentNames:P.agentNames.map(G=>`"${G}"`).join(", ")});return}}catch{}J.error(`Failed to delete connection: ${a}`);return}me(),J.success("Connection deleted successfully")}catch(i){const a=i instanceof Error?i.message:String(i);J.error(`Failed to delete connection: ${a}`)}},xt=async()=>{if(d.mode!=="force-deleting")return;const s=d.connection.id;f({type:"close"});try{const i=await le.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:s,force:!0}});if(i.isError){J.error(`Failed to delete connection: ${et(i)}`);return}me(),J.success("Connection deleted successfully")}catch(i){const a=i instanceof Error?i.message:String(i);J.error(`Failed to delete connection: ${a}`)}},ht=async s=>{let i,a=null,B=null,P=null;if(s.ui_type==="NPX"?(i="STDIO",a="",P=jn(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(i="STDIO",a="",P=yn(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(i=s.ui_type,a=s.connection_url||"",B=s.connection_token||null),D){await h.update.mutateAsync({id:D.id,data:{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:i,connection_url:a,...B&&{connection_token:B},...P&&{connection_headers:P}}}),f({type:"close"}),m.reset();return}const G=Pt("conn");await h.create.mutateAsync({id:G,title:s.title,description:s.description||null,connection_type:i,connection_url:a,connection_token:B,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:l?.user?.id||"system",organization_id:o.id,icon:s.icon??null,app_name:null,app_id:null,connection_headers:P,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),ce(),m.reset(),n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:G}})},tt=s=>{s||(re?ce():f({type:"close"}),m.reset())},ke=s=>{const i=s.trim();if(!i)return;const a=!!m.formState.dirtyFields.title,B=!!m.formState.dirtyFields.description,P=!!m.formState.dirtyFields.env_vars,G=q=>{if(q&&(!a&&!m.getValues("title").trim()&&q.title&&m.setValue("title",q.title,{shouldDirty:!1}),!B&&!(m.getValues("description")??"").trim()&&q.description&&m.setValue("description",q.description,{shouldDirty:!1}),!P&&q.envVarKeys?.length)){const nt=m.getValues("env_vars")??[],jt=new Set(nt.map(ye=>ye.key)),st=q.envVarKeys.filter(ye=>!jt.has(ye));st.length>0&&m.setValue("env_vars",[...nt,...st.map(ye=>({key:ye,value:""}))],{shouldDirty:!0})}},Ae=gn(i);if(Ae&&u){m.setValue("ui_type","NPX",{shouldDirty:!0}),m.setValue("npx_package",Ae.packageName,{shouldDirty:!0}),m.setValue("connection_url","",{shouldDirty:!0}),m.setValue("connection_token",null,{shouldDirty:!0}),G(Se({uiType:"NPX",npxPackage:Ae.packageName}));return}if(i.startsWith("http://")||i.startsWith("https://")){const q=F==="HTTP"||F==="SSE"||F==="Websocket"?F:"HTTP";m.setValue("ui_type",q,{shouldDirty:!0}),m.setValue("connection_url",i,{shouldDirty:!0}),G(Se({uiType:q,connectionUrl:i})??rt({uiType:q,connectionUrl:i,registryItems:ie}));return}F==="NPX"&&G(Se({uiType:"NPX",npxPackage:i}))},ft=[...p?[{id:"select",header:"",render:s=>t.jsx(De,{checked:x.has(s.id),onCheckedChange:()=>V(s.id),onClick:i=>i.stopPropagation()}),cellClassName:"w-10 shrink-0"}]:[],{id:"title",header:"Name",render:s=>t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(Ne,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(he,{})}),t.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:s.title,children:s.title})]}),cellClassName:"w-32 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:s=>t.jsx("span",{className:"text-sm text-muted-foreground truncate block",title:s.description||"",children:s.description||"—"}),cellClassName:"flex-1 min-w-0 max-w-0",wrap:!1,sortable:!0},{id:"connection_type",header:"Type",accessor:s=>t.jsx("span",{className:"text-xs font-medium",children:s.connection_type}),cellClassName:"w-16 shrink-0",sortable:!0},{id:"status",header:"Status",render:s=>t.jsx(Te,{status:s.status}),cellClassName:"w-28 shrink-0",sortable:!1},{id:"updated_by",header:"Updated by",render:s=>t.jsx(be,{id:s.updated_by??s.created_by,size:"3xs"}),cellClassName:"w-32 shrink-0",sortable:!0},{id:"updated_at",header:"Updated",render:s=>t.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:s.updated_at?_e(new Date(s.updated_at)):"—"}),cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:s=>t.jsxs(He,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(O,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:i=>i.stopPropagation(),children:t.jsx(We,{size:20})})}),t.jsxs(Ke,{align:"end",onClick:i=>i.stopPropagation(),children:[t.jsxs(fe,{onClick:i=>{i.stopPropagation(),n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:s.id}})},children:[t.jsx(Ge,{size:16}),"Open"]}),t.jsxs(fe,{variant:"destructive",onClick:i=>{i.stopPropagation(),f({type:"delete",connection:s})},children:[t.jsx(Ie,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],gt=t.jsx("div",{className:"flex items-center gap-2",children:p?t.jsxs(O,{variant:"ghost",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:X,children:[t.jsx(dt,{size:14}),"Cancel"]}):t.jsxs(t.Fragment,{children:[t.jsxs(O,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:()=>T(!0),children:[t.jsx(Vt,{size:14}),"Select"]}),t.jsx(O,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:o.slug,project:Q}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),t.jsx(O,{onClick:ae,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]})});return t.jsxs(ve,{children:[t.jsx(qe,{open:re||d.mode==="editing",onOpenChange:tt,children:t.jsxs(Qe,{className:"sm:max-w-[525px]",children:[t.jsxs(Je,{children:[t.jsx(Ye,{children:D?"Edit Connection":"Create Connection"}),t.jsx(Ze,{children:D?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),t.jsx(Wt,{...m,children:t.jsxs("form",{onSubmit:m.handleSubmit(ht),children:[t.jsxs("div",{className:"grid gap-4 py-4",children:[t.jsx(Z,{control:m.control,name:"ui_type",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Type *"}),t.jsxs(Gt,{value:s.value,onValueChange:s.onChange,children:[t.jsx(ne,{children:t.jsx(qt,{children:t.jsx(Qt,{})})}),t.jsxs(Jt,{children:[t.jsx(Ce,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ee,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(Ce,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ee,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(Ce,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ee,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(Ce,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(he,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(Ce,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(dn,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(se,{})]})}),F==="NPX"&&t.jsx(t.Fragment,{children:t.jsx(Z,{control:m.control,name:"npx_package",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"NPM Package *"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"@perplexity-ai/mcp-server",...s,value:s.value??"",onPaste:i=>{const a=i.clipboardData.getData("text");a&&(i.preventDefault(),m.setValue("npx_package",a.trim(),{shouldDirty:!0}),ke(a))},onBlur:i=>{ke(i.target.value),s.onBlur()}})}),t.jsx(se,{})]})})}),F==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Z,{control:m.control,name:"stdio_command",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Command *"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"node, bun, python...",...s,value:s.value??""})}),t.jsx(se,{})]})}),t.jsx(Z,{control:m.control,name:"stdio_args",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Arguments"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"arg1 arg2 --flag value",...s,value:s.value??""})}),t.jsx(se,{})]})})]}),t.jsx(Z,{control:m.control,name:"stdio_cwd",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Working Directory"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"/path/to/project (optional)",...s,value:s.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(se,{})]})})]}),(F==="NPX"||F==="STDIO")&&t.jsx(Z,{control:m.control,name:"env_vars",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Environment Variables"}),t.jsx(ne,{children:t.jsx(un,{value:s.value??[],onChange:s.onChange})}),t.jsx(se,{})]})}),F!=="NPX"&&F!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Z,{control:m.control,name:"connection_url",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"URL *"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"https://example.com/mcp",...s,value:s.value??"",onPaste:i=>{const a=i.clipboardData.getData("text");a&&(i.preventDefault(),m.setValue("connection_url",a.trim(),{shouldDirty:!0}),ke(a))},onBlur:i=>{ke(i.target.value),s.onBlur()}})}),t.jsx(se,{})]})}),t.jsx(Z,{control:m.control,name:"connection_token",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:de?.token?.label??"Token (optional)"}),t.jsx(ne,{children:t.jsx(xe,{type:"password",placeholder:de?.token?.placeholder??"Bearer token or API key",...s,value:s.value??""})}),de?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[de.token.helperText,de.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:m.control,name:"title",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Name *"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"My Connection",...s})}),t.jsx(se,{})]})}),t.jsx(Z,{control:m.control,name:"description",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Description"}),t.jsx(ne,{children:t.jsx(Yt,{placeholder:"A brief description of this connection",rows:3,...s,value:s.value??""})}),t.jsx(se,{})]})})]}),t.jsxs(at,{children:[t.jsx(O,{type:"button",variant:"outline",onClick:()=>tt(!1),children:"Cancel"}),t.jsx(O,{type:"submit",disabled:m.formState.isSubmitting,className:"min-w-40",children:m.formState.isSubmitting?"Saving...":D?"Update Connection":"Create Connection"})]})]})})]})}),t.jsx(Oe,{open:d.mode==="deleting",onOpenChange:s=>!s&&f({type:"close"}),children:t.jsxs(ze,{children:[t.jsxs(Le,{children:[t.jsx(Ve,{children:"Delete Connection?"}),t.jsxs(Fe,{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(Be,{children:[t.jsx(Ue,{children:"Cancel"}),t.jsx(Me,{onClick:pt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),t.jsx(Oe,{open:d.mode==="force-deleting",onOpenChange:s=>!s&&f({type:"close"}),children:t.jsxs(ze,{children:[t.jsxs(Le,{children:[t.jsx(Ve,{children:"Connection Used by Agents"}),t.jsx(Fe,{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(Be,{children:[t.jsx(Ue,{children:"Cancel"}),t.jsx(Me,{onClick:xt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]})]})}),t.jsx(Pn,{open:y,onOpenChange:w,count:x.size,onConfirm:ue}),t.jsx(In,{open:_,onOpenChange:N,agents:b,onConfirm:R}),t.jsxs(ve.Header,{children:[t.jsx(ve.Header.Left,{children:t.jsx(Rt,{children:t.jsx(Ht,{children:t.jsx(Xt,{children:t.jsxs(Kt,{className:"flex items-center gap-2",children:["Connections",t.jsxs("span",{className:"text-xs font-normal text-muted-foreground tabular-nums",children:[v.total," total",v.active>0&&` · ${v.active} active`,v.error>0&&` · ${v.error} errors`]})]})})})})}),t.jsxs(ve.Header.Right,{children:[t.jsx(At,{viewMode:r.viewMode,onViewModeChange:r.setViewMode,sortKey:r.sortKey,sortDirection:r.sortDirection,onSort:r.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:I,onChange:s=>A(s||"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:z,onChange:s=>U(s||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]}]}),gt]})]}),t.jsx("div",{className:"flex items-center gap-3 px-5 pb-0",children:t.jsx("div",{className:"flex-1",children:t.jsx($t,{value:r.search,onChange:r.setSearch,placeholder:"Search for a Connection...",onKeyDown:s=>{s.key==="Escape"&&(r.setSearch(""),s.target.blur())}})})}),t.jsx(ve.Content,{children:r.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:k.length===0?t.jsx($e,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:r.search?`No Connections match "${r.search}"`:"Create a connection to get started.",actions:!r.search&&t.jsx(O,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:o.slug,project:Q}}),children:"Browse Store"})}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:M.map(s=>{if(s.type==="group")return t.jsx(_n,{group:s,onNavigate:a=>n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:a}}),onDelete:a=>f({type:"delete",connection:a}),selectionMode:p,selectedIds:x,onToggleSelect:V},s.key);const i=s.connection;return t.jsxs("div",{className:"relative",children:[p&&t.jsx("div",{className:"absolute top-3 left-3 z-10",children:t.jsx(De,{checked:x.has(i.id),onCheckedChange:()=>V(i.id)})}),t.jsx(lt,{connection:i,fallbackIcon:t.jsx(he,{}),onClick:()=>p?V(i.id):n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:i.id}}),className:oe(p&&x.has(i.id)&&"ring-2 ring-primary"),headerActions:p?void 0:t.jsxs(He,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(O,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:a=>a.stopPropagation(),children:t.jsx(We,{size:20})})}),t.jsxs(Ke,{align:"end",onClick:a=>a.stopPropagation(),children:[t.jsxs(fe,{onClick:a=>{a.stopPropagation(),n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:i.id}})},children:[t.jsx(Ge,{size:16}),"Open"]}),t.jsxs(fe,{variant:"destructive",onClick:a=>{a.stopPropagation(),f({type:"delete",connection:i})},children:[t.jsx(Ie,{size:16}),"Delete"]})]})]}),body:t.jsx(Te,{status:i.status}),footer:t.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(be,{id:i.updated_by??i.created_by,size:"3xs"})}),t.jsx("span",{className:"shrink-0 ml-2",children:i.updated_at?_e(new Date(i.updated_at)):"—"})]})})]},i.id)})})}):t.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:t.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:t.jsx("div",{className:"min-w-[1000px]",children:t.jsx(An,{columns:ft,grouped:M,sortKey:r.sortKey,sortDirection:r.sortDirection,onSort:r.handleSort,onRowClick:s=>p?V(s.id):n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:s.id}}),selectionMode:p,selectedIds:x,onToggleSelect:V,emptyState:r.search?t.jsx($e,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${r.search}"`}):t.jsx($e,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:t.jsx(O,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:o.slug,project:Q}}),children:"Browse Store"})})})})})})}),p&&t.jsx(Dn,{count:x.size,total:k.length,onSelectAll:()=>{j(new Set(k.map(s=>s.id)))},onDeselectAll:()=>j(new Set),onDelete:()=>w(!0),onAddToAgent:()=>N(!0),onToggleStatus:je,onCancel:X})]})}function Hs(){const o=ge.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(yt,{children:t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ln,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(On,{})})}),o[0]=e):e=o[0],e}export{Hs as default};
|
|
1
|
+
import{c as ge,j as t,E as yt,r as H,u as vt,w as Ct,e as Nt,d as bt,f as _t,y as kt,t as wt,q as St,b as Tt,B as O,O as Q,z as oe,x as J,o as ct,D as Dt,n as Y,_ as It}from"./index-CFro8UN2.js";import{g as Pt}from"./generate-id-Dyweu44Y.js";import{C as At}from"./collection-display-button-DKSbWUip.js";import{C as $t,E as $e}from"./collection-search-CoyqU1D4.js";import{T as Et,a as Ot,b as we,c as pe,d as zt,e as Lt}from"./table-DbeCzOFv.js";import{C as lt}from"./connection-card-D1wFGPSt.js";import{C as Te,i as Vt}from"./connection-status-Djf9yQEZ.js";import{I as Ne}from"./integration-icon-BIEcJDPc.js";import{P as ve}from"./index-Dcd2vOoh.js";import{U as be}from"./user-B9NsMy7x.js";import{u as Ft}from"./use-binding-BSR1JqIQ.js";import{u as Bt}from"./use-list-state-CmyPcBg7.js";import{f as Ut,e as Mt}from"./registry-utils-BM82D6MS.js";import{f as Oe,a as ze,b as Le,c as Ve,d as Fe,e as Be,A as Ue,h as Me}from"./alert-dialog-BifPyCni.js";import{B as Re}from"./badge-ndLAVsnC.js";import{B as Rt,a as Ht,b as Xt,c as Kt}from"./breadcrumb-iZbBQmAw.js";import{C as De}from"./checkbox-D9hw1y4e.js";import{D as qe,a as Qe,b as Je,c as Ye,d as Ze,e as at}from"./dialog-CRMnu4D5.js";import{D as He,a as Xe,b as Ke,c as fe}from"./dropdown-menu-C89udqdU.js";import{a as Wt,F as Z,b as ee,c as te,d as ne,f as se}from"./form-D5fEmRYW.js";import{I as xe}from"./input-DHT-dQ79.js";import{S as Gt,a as qt,b as Qt,c as Jt,d as Ce}from"./select-aCEgiwRG.js";import{T as Yt}from"./textarea-B8s-zfsk.js";import{a as Zt,b as en}from"./use-connection-DG_OWqAP.js";import{u as ot,a as tn}from"./constants-CQia8SG0.js";import{b as nn}from"./use-mcp-tools-CZWduBUe.js";import{b as sn}from"./use-virtual-mcp-Duh8bmbW.js";import{n as on}from"./ArrowDown-D7A05Pqz.js";import{i as rn}from"./ArrowUp-BHnUcKjj.js";import{t as cn}from"./ChevronDown-BdRzf7AV.js";import{n as he}from"./Container-Bhk6-bJW.js";import{i as We}from"./DotsVertical-DaFbwRBO.js";import{s as Ge}from"./Eye-D7y1c_jY.js";import{s as Ee}from"./Globe02-CK23mV4o.js";import{i as ln}from"./Loading01-BCzCCK_W.js";import{s as an}from"./Plus--co7BTa1.js";import{i as dn}from"./Terminal-CtGvt6je.js";import{s as Ie}from"./Trash01-HuotuXJH.js";import{s as dt}from"./XClose-zAWwTjC9.js";import{f as _e}from"./format-time-CMKyl-GC.js";import{r as mn,E as un,e as mt}from"./env-vars-editor-B-wGdKWy.js";import"./Check-DnflcDgh.js";import"./Grid01--89xjjlS.js";import"./List-C5_6cfio.js";import"./tooltip-oZyiLpuc.js";import"./index-BvccbczP.js";import"./SearchMd-m173J65G.js";import"./card-CyJvSJWb.js";import"./AlertCircle-D8UIpq37.js";import"./CheckCircle-BfTaFQXT.js";import"./localstorage-keys-C6UNhMX3.js";import"./useQuery-DXBnvbwb.js";import"./useMutation-DjbNdewa.js";import"./avatar-B3kSzLTz.js";import"./binder-GTmFyrCu.js";import"./use-view-mode-F92r7fn5.js";import"./use-mobile-iIf5uj_e.js";import"./ChevronRight-B6krViGL.js";import"./X-TCHNS2KI.js";import"./label-DTRd2hOl.js";import"./use-collections-BPrRt-ii.js";import"./differenceInSeconds-NQ4PDo0z.js";function it(o){return o.title.trim().replace(/\s+\(\d+\)$/,"")}function pn(o){const e=new Map;for(const l of o){if(l.connection_type==="VIRTUAL")continue;const u=it(l),r=e.get(u);r?r.push(l):e.set(u,[l])}const n=[],c=new Set;for(const l of o){if(l.connection_type==="VIRTUAL")continue;const u=it(l);if(c.has(u))continue;c.add(u);const r=e.get(u),h=r[0];r.length===1?n.push({type:"single",connection:h}):n.push({type:"group",key:u,icon:h.icon,title:h.app_name?h.title.replace(/\s*\(\d+\)\s*$/,""):h.title,connections:r})}return n}function ut(o){const e=new Set,n=[];for(const c of o)c.created_by&&!e.has(c.created_by)&&(e.add(c.created_by),n.push(c.created_by));return n}function xn(o){let e=0,n=0,c=0;for(const l of o)l.connection_type!=="VIRTUAL"&&(l.status==="active"?e++:l.status==="error"?c++:n++);return{active:e,inactive:n,error:c,total:e+n+c}}const hn=ct({key:Y(),value:Y()}),fn=ct({title:Y().min(1,"Name is required"),description:Y().nullable().optional(),icon:Y().nullable().optional(),ui_type:It(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:Y().optional(),connection_token:Y().nullable().optional(),npx_package:Y().optional(),stdio_command:Y().optional(),stdio_args:Y().optional(),stdio_cwd:Y().optional(),env_vars:Dt(hn).optional()}).refine(o=>o.ui_type==="NPX"?!!o.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(o=>o.ui_type==="STDIO"?!!o.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(o=>o.ui_type==="HTTP"||o.ui_type==="SSE"||o.ui_type==="Websocket"?!!o.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Pe(o){const e=o.trim();if(!e)return"";try{const n=new URL(e),c=n.pathname.length>1?n.pathname.replace(/\/+$/,""):n.pathname;return`${n.origin}${c}`}catch{return e.replace(/\/+$/,"")}}function gn(o){const e=o.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const n=e[0]?.toLowerCase();if(n!=="npx"&&n!=="bunx")return null;const l=e.slice(1).find(u=>!u.startsWith("-"));return l?{packageName:l}:null}function Se(o){const{uiType:e}=o,n=Pe(o.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&n===Pe("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 c=(o.npxPackage??"").trim();return e==="NPX"&&c==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function rt(o){if(o.registryItems.length===0||o.uiType!=="HTTP"&&o.uiType!=="SSE"&&o.uiType!=="Websocket")return null;const e=Pe(o.connectionUrl??"");if(!e)return null;const n=o.registryItems.find(u=>(u.server?.remotes??[]).some(h=>Pe(h.url??"")===e));if(!n)return null;const c=n.title||n.name||n.server?.title||n.server?.name||"",l=n.server?.description||n.description||n.summary||null;return c?{id:"registry",title:c,description:l}:null}function jn(o,e){const n={command:"npx",args:["-y",o]},c=mt(e);return Object.keys(c).length>0&&(n.envVars=c),n}function yn(o,e,n,c){const l={command:o};e.trim()&&(l.args=e.trim().split(/\s+/)),n?.trim()&&(l.cwd=n.trim());const u=mt(c);return Object.keys(u).length>0&&(l.envVars=u),l}function vn(o){return o.command==="npx"}function Cn(o){return o.args?.find(e=>!e.startsWith("-"))??""}function Nn(o){return{command:o.command,args:o.args?.join(" ")??"",cwd:o.cwd??""}}function bn(o,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 _n(o){const e=ge.c(107),{group:n,onNavigate:c,onDelete:l,selectionMode:u,selectedIds:r,onToggleSelect:h}=o,[C,d]=H.useState(!1);let f;if(e[0]!==n.connections||e[1]!==r){let $;e[3]!==r?($=E=>r.has(E.id),e[3]=r,e[4]=$):$=e[4],f=n.connections.every($),e[0]=n.connections,e[1]=r,e[2]=f}else f=e[2];const p=f;let T;if(e[5]!==n.connections||e[6]!==r){let $;e[8]!==r?($=E=>r.has(E.id),e[8]=r,e[9]=$):$=e[9],T=n.connections.some($),e[5]=n.connections,e[6]=r,e[7]=T}else T=e[7];const x=T;let j,y,w,_,N,I,A,z,U,b,k;if(e[10]!==p||e[11]!==n.connections||e[12]!==n.icon||e[13]!==n.title||e[14]!==h||e[15]!==r||e[16]!==u||e[17]!==x){const $=ut(n.connections),E=n.connections.reduce(Tn,n.connections[0]),de=E.updated_at??E.created_at;j=lt;const D=`${n.connections.length} instances`;e[29]!==n.icon||e[30]!==n.title||e[31]!==D?(U={title:n.title,icon:n.icon,description:D},e[29]=n.icon,e[30]=n.title,e[31]=D,e[32]=U):U=e[32],e[33]!==p||e[34]!==n.connections||e[35]!==h||e[36]!==r||e[37]!==u?(b=()=>u?(()=>{for(const R of n.connections)p?r.has(R.id)&&h(R.id):r.has(R.id)||h(R.id)})():d(!0),e[33]=p,e[34]=n.connections,e[35]=h,e[36]=r,e[37]=u,e[38]=b):b=e[38];const le=u&&p&&"ring-2 ring-primary",me=u&&x&&!p&&"ring-1 ring-primary/50";e[39]!==le||e[40]!==me?(k=oe(le,me),e[39]=le,e[40]=me,e[41]=k):k=e[41],e[42]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(he,{}),e[42]=y):y=e[42],e[43]!==p||e[44]!==n.connections||e[45]!==h||e[46]!==r||e[47]!==u||e[48]!==x?(w=u?t.jsx(De,{checked:p?!0:x?"indeterminate":!1,onCheckedChange:()=>{for(const R of n.connections)p?r.has(R.id)&&h(R.id):r.has(R.id)||h(R.id)}}):t.jsxs(Re,{variant:"secondary",className:"text-xs tabular-nums",children:["x",n.connections.length]}),e[43]=p,e[44]=n.connections,e[45]=h,e[46]=r,e[47]=u,e[48]=x,e[49]=w):w=e[49];let ue;e[50]!==n.connections?(ue=n.connections.slice(0,6).map(Sn),e[50]=n.connections,e[51]=ue):ue=e[51],e[52]!==ue?(_=t.jsx("div",{className:"flex items-center gap-1",children:ue}),e[52]=ue,e[53]=_):_=e[53],A="flex items-center justify-between text-xs text-muted-foreground w-full min-w-0";const je=$.map(R=>t.jsx(be,{id:R,size:"3xs",avatarOnly:$.length>1},R));e[54]!==je?(z=t.jsx("div",{className:"flex items-center -space-x-1.5",children:je}),e[54]=je,e[55]=z):z=e[55],N="shrink-0 ml-2",I=de?_e(new Date(de)):"—",e[10]=p,e[11]=n.connections,e[12]=n.icon,e[13]=n.title,e[14]=h,e[15]=r,e[16]=u,e[17]=x,e[18]=j,e[19]=y,e[20]=w,e[21]=_,e[22]=N,e[23]=I,e[24]=A,e[25]=z,e[26]=U,e[27]=b,e[28]=k}else j=e[18],y=e[19],w=e[20],_=e[21],N=e[22],I=e[23],A=e[24],z=e[25],U=e[26],b=e[27],k=e[28];let v;e[56]!==N||e[57]!==I?(v=t.jsx("span",{className:N,children:I}),e[56]=N,e[57]=I,e[58]=v):v=e[58];let M;e[59]!==v||e[60]!==A||e[61]!==z?(M=t.jsxs("div",{className:A,children:[z,v]}),e[59]=v,e[60]=A,e[61]=z,e[62]=M):M=e[62];let V;e[63]!==j||e[64]!==y||e[65]!==w||e[66]!==_||e[67]!==M||e[68]!==U||e[69]!==b||e[70]!==k?(V=t.jsx(j,{connection:U,onClick:b,className:k,fallbackIcon:y,headerActions:w,body:_,footer:M}),e[63]=j,e[64]=y,e[65]=w,e[66]=_,e[67]=M,e[68]=U,e[69]=b,e[70]=k,e[71]=V):V=e[71];let X;e[72]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(he,{}),e[72]=X):X=e[72];let K;e[73]!==n.icon||e[74]!==n.title?(K=t.jsx(Ne,{icon:n.icon,name:n.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:X}),e[73]=n.icon,e[74]=n.title,e[75]=K):K=e[75];let W;e[76]!==n.connections.length?(W=t.jsxs(Re,{variant:"secondary",className:"ml-2 text-xs tabular-nums",children:["x",n.connections.length]}),e[76]=n.connections.length,e[77]=W):W=e[77];let g;e[78]!==n.title||e[79]!==W?(g=t.jsxs(Ye,{children:[n.title,W]}),e[78]=n.title,e[79]=W,e[80]=g):g=e[80];let S;e[81]!==n.connections.length?(S=t.jsxs(Ze,{children:[n.connections.length," installed instances"]}),e[81]=n.connections.length,e[82]=S):S=e[82];let L;e[83]!==g||e[84]!==S?(L=t.jsxs("div",{children:[g,S]}),e[83]=g,e[84]=S,e[85]=L):L=e[85];let ie;e[86]!==K||e[87]!==L?(ie=t.jsx(Je,{className:"px-6 pt-6 pb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[K,L]})}),e[86]=K,e[87]=L,e[88]=ie):ie=e[88];let re;if(e[89]!==n.connections||e[90]!==l||e[91]!==c){let $;e[93]!==l||e[94]!==c?($=E=>t.jsxs("div",{className:"flex items-center gap-3 px-6 py-3 hover:bg-muted/30 cursor-pointer transition-colors",onClick:()=>{d(!1),c(E.id)},children:[t.jsx(Ne,{icon:E.icon,name:E.title,size:"sm",className:"shrink-0",fallbackIcon:t.jsx(he,{})}),t.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:E.title}),t.jsx(Te,{status:E.status})]}),t.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground shrink-0",children:[t.jsx(be,{id:E.created_by,size:"3xs"}),t.jsx("span",{children:E.created_at?_e(new Date(E.created_at)):"—"})]}),t.jsxs(He,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(O,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:wn,children:t.jsx(We,{size:16})})}),t.jsxs(Ke,{align:"end",onClick:kn,children:[t.jsxs(fe,{onClick:()=>{d(!1),c(E.id)},children:[t.jsx(Ge,{size:16}),"Open"]}),t.jsxs(fe,{variant:"destructive",onClick:()=>l(E),children:[t.jsx(Ie,{size:16}),"Delete"]})]})]})]},E.id),e[93]=l,e[94]=c,e[95]=$):$=e[95],re=n.connections.map($),e[89]=n.connections,e[90]=l,e[91]=c,e[92]=re}else re=e[92];let ae;e[96]!==re?(ae=t.jsx("div",{className:"divide-y max-h-80 overflow-auto",children:re}),e[96]=re,e[97]=ae):ae=e[97];let ce;e[98]!==ie||e[99]!==ae?(ce=t.jsxs(Qe,{className:"sm:max-w-lg p-0 gap-0",children:[ie,ae]}),e[98]=ie,e[99]=ae,e[100]=ce):ce=e[100];let m;e[101]!==C||e[102]!==ce?(m=t.jsx(qe,{open:C,onOpenChange:d,children:ce}),e[101]=C,e[102]=ce,e[103]=m):m=e[103];let F;return e[104]!==V||e[105]!==m?(F=t.jsxs(t.Fragment,{children:[V,m]}),e[104]=V,e[105]=m,e[106]=F):F=e[106],F}function kn(o){return o.stopPropagation()}function wn(o){return o.stopPropagation()}function Sn(o){return t.jsx(Te,{status:o.status},o.id)}function Tn(o,e){const n=e.updated_at??e.created_at,c=o.updated_at??o.created_at;return n?c?new Date(n)>new Date(c)?e:o:e:o}function Dn(o){const e=ge.c(28),{count:n,total:c,onSelectAll:l,onDeselectAll:u,onDelete:r,onAddToAgent:h,onToggleStatus:C,onCancel:d}=o;if(n===0)return null;let f;e[0]!==n?(f=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=f):f=e[1];let p;e[2]!==n||e[3]!==u||e[4]!==l||e[5]!==c?(p=n<c?t.jsxs(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:["Select all (",c,")"]}):t.jsx(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:"Clear selection"}),e[2]=n,e[3]=u,e[4]=l,e[5]=c,e[6]=p):p=e[6];let T;e[7]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(an,{size:13}),e[7]=T):T=e[7];let x;e[8]!==h?(x=t.jsxs(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:[T,"Add to Agent"]}),e[8]=h,e[9]=x):x=e[9];let j;e[10]!==C?(j=t.jsx(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>C("active"),children:"Enable"}),e[10]=C,e[11]=j):j=e[11];let y;e[12]!==C?(y=t.jsx(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>C("inactive"),children:"Disable"}),e[12]=C,e[13]=y):y=e[13];let w;e[14]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(Ie,{size:13}),e[14]=w):w=e[14];let _;e[15]!==r?(_=t.jsxs(O,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:[w,"Delete"]}),e[15]=r,e[16]=_):_=e[16];let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(dt,{size:13}),e[17]=N):N=e[17];let I;e[18]!==d?(I=t.jsx(O,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:N}),e[18]=d,e[19]=I):I=e[19];let A;return e[20]!==f||e[21]!==I||e[22]!==p||e[23]!==x||e[24]!==j||e[25]!==y||e[26]!==_?(A=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:[f,p,x,j,y,_,I]})}),e[20]=f,e[21]=I,e[22]=p,e[23]=x,e[24]=j,e[25]=y,e[26]=_,e[27]=A):A=e[27],A}function In(o){const e=ge.c(25),{open:n,onOpenChange:c,agents:l,onConfirm:u}=o,[r,h]=H.useState(null);let C;e[0]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs(Je,{children:[t.jsx(Ye,{children:"Add to Agent"}),t.jsx(Ze,{children:"Select an agent to add the selected connections to."})]}),e[0]=C):C=e[0];let d;e[1]!==l||e[2]!==r?(d=l.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):l.map(N=>t.jsxs("button",{type:"button",onClick:()=>h(N.id),className:oe("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",r===N.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Ne,{icon:N.icon,name:N.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:N.title}),N.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:N.description})]})]},N.id)),e[1]=l,e[2]=r,e[3]=d):d=e[3];let f;e[4]!==d?(f=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:d}),e[4]=d,e[5]=f):f=e[5];let p;e[6]!==c?(p=t.jsx(O,{variant:"outline",onClick:()=>c(!1),children:"Cancel"}),e[6]=c,e[7]=p):p=e[7];const T=!r;let x;e[8]!==u||e[9]!==c||e[10]!==r?(x=()=>{r&&(u(r),c(!1),h(null))},e[8]=u,e[9]=c,e[10]=r,e[11]=x):x=e[11];let j;e[12]!==T||e[13]!==x?(j=t.jsx(O,{disabled:T,onClick:x,children:"Add"}),e[12]=T,e[13]=x,e[14]=j):j=e[14];let y;e[15]!==p||e[16]!==j?(y=t.jsxs(at,{children:[p,j]}),e[15]=p,e[16]=j,e[17]=y):y=e[17];let w;e[18]!==f||e[19]!==y?(w=t.jsxs(Qe,{className:"sm:max-w-[400px]",children:[C,f,y]}),e[18]=f,e[19]=y,e[20]=w):w=e[20];let _;return e[21]!==c||e[22]!==n||e[23]!==w?(_=t.jsx(qe,{open:n,onOpenChange:c,children:w}),e[21]=c,e[22]=n,e[23]=w,e[24]=_):_=e[24],_}function Pn(o){const e=ge.c(20),{open:n,onOpenChange:c,count:l,onConfirm:u}=o,r=l!==1?"s":"";let h;e[0]!==l||e[1]!==r?(h=t.jsxs(Ve,{children:["Delete ",l," connection",r,"?"]}),e[0]=l,e[1]=r,e[2]=h):h=e[2];const C=l!==1?"s":"";let d;e[3]!==C?(d=t.jsxs(Fe,{children:["This will permanently delete the selected connection",C,". This action cannot be undone."]}),e[3]=C,e[4]=d):d=e[4];let f;e[5]!==h||e[6]!==d?(f=t.jsxs(Le,{children:[h,d]}),e[5]=h,e[6]=d,e[7]=f):f=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Ue,{children:"Cancel"}),e[8]=p):p=e[8];const T=l!==1?"s":"";let x;e[9]!==l||e[10]!==u||e[11]!==T?(x=t.jsxs(Be,{children:[p,t.jsxs(Me,{onClick:u,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",l," connection",T]})]}),e[9]=l,e[10]=u,e[11]=T,e[12]=x):x=e[12];let j;e[13]!==f||e[14]!==x?(j=t.jsxs(ze,{children:[f,x]}),e[13]=f,e[14]=x,e[15]=j):j=e[15];let y;return e[16]!==c||e[17]!==n||e[18]!==j?(y=t.jsx(Oe,{open:n,onOpenChange:c,children:j}),e[16]=c,e[17]=n,e[18]=j,e[19]=y):y=e[19],y}function An(o){const e=ge.c(37),{columns:n,grouped:c,sortKey:l,sortDirection:u,onSort:r,onRowClick:h,selectionMode:C,selectedIds:d,onToggleSelect:f,emptyState:p}=o;let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=new Set,e[0]=T):T=e[0];const[x,j]=H.useState(T);let y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y=b=>{j(k=>{const v=new Set(k);return v.has(b)?v.delete(b):v.add(b),v})},e[1]=y):y=e[1];const w=y;if(c.length===0&&p){let b;return e[2]!==p?(b=t.jsx("div",{className:"flex items-center justify-center h-full",children:p}),e[2]=p,e[3]=b):b=e[3],b}const _=n.length;let N;if(e[4]!==_||e[5]!==n||e[6]!==r||e[7]!==u||e[8]!==l){let b;e[10]!==_||e[11]!==r||e[12]!==u||e[13]!==l?(b=(k,v)=>{const M=l===k.id,V=v===_-1;return t.jsx(Et,{className:oe("px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider",V&&"w-8","group transition-colors select-none",k.sortable&&"hover:bg-accent cursor-pointer",k.cellClassName),onClick:k.sortable&&r?()=>r(k.id):void 0,children:t.jsxs("span",{className:"flex items-center gap-1",children:[k.header,k.sortable&&t.jsx("span",{className:"w-4 flex items-center justify-center",children:M&&u&&(u==="asc"?t.jsx(rn,{size:16,className:"text-muted-foreground"}):t.jsx(on,{size:16,className:"text-muted-foreground"}))})]})},k.id)},e[10]=_,e[11]=r,e[12]=u,e[13]=l,e[14]=b):b=e[14],N=n.map(b),e[4]=_,e[5]=n,e[6]=r,e[7]=u,e[8]=l,e[9]=N}else N=e[9];let I;e[15]!==N?(I=t.jsx(Ot,{className:"border-b-0",children:t.jsx(we,{className:"h-9 hover:bg-transparent border-b border-border",children:N})}),e[15]=N,e[16]=I):I=e[16];let A;if(e[17]!==n||e[18]!==x||e[19]!==c||e[20]!==h||e[21]!==f||e[22]!==d||e[23]!==C){let b;e[25]!==n||e[26]!==x||e[27]!==h||e[28]!==f||e[29]!==d||e[30]!==C?(b=k=>{if(k.type==="single"){const g=k.connection;return t.jsx(we,{className:oe("group/data-row transition-colors border-b-0 hover:bg-accent/50 cursor-pointer",C&&d.has(g.id)&&"bg-primary/5"),onClick:()=>h(g),children:n.map(S=>t.jsx(pe,{className:oe("px-5 py-4 h-16 align-middle text-sm text-foreground",S.cellClassName),children:t.jsx("div",{className:"min-w-0 w-full truncate overflow-hidden whitespace-nowrap",children:S.render?S.render(g):null})},S.id))},g.id)}const v=k,M=x.has(v.key),V=v.connections.every(g=>d.has(g.id)),X=v.connections.some(g=>d.has(g.id)),K=ut(v.connections),W=v.connections.reduce(En,v.connections[0]);return t.jsxs(H.Fragment,{children:[t.jsx(we,{className:"border-b-0 hover:bg-accent/50 cursor-pointer transition-colors",onClick:()=>w(v.key),children:n.map(g=>{const S=oe("px-5 py-3 h-14 align-middle text-sm",g.cellClassName);if(g.id==="select")return t.jsx(pe,{className:S,children:t.jsx(De,{checked:V?!0:X?"indeterminate":!1,onCheckedChange:()=>{for(const L of v.connections)V?d.has(L.id)&&f(L.id):d.has(L.id)||f(L.id)},onClick:$n})},g.id);if(g.id==="title")return t.jsx(pe,{className:S,children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(Ne,{icon:v.icon,name:v.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(he,{})}),t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:v.title}),t.jsxs(Re,{variant:"secondary",className:"text-xs tabular-nums",children:["x",v.connections.length]})]})},g.id);if(g.id==="updated_by")return t.jsx(pe,{className:S,children:t.jsx("div",{className:"flex items-center -space-x-1.5",children:K.map(L=>t.jsx(be,{id:L,size:"3xs",avatarOnly:K.length>1},L))})},g.id);if(g.id==="updated_at"){const L=W.updated_at??W.created_at;return t.jsx(pe,{className:S,children:t.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:L?_e(new Date(L)):"—"})},g.id)}return g.id==="actions"?t.jsx(pe,{className:S,children:t.jsx(cn,{size:16,className:oe("text-muted-foreground transition-transform",M&&"rotate-180")})},g.id):t.jsx(pe,{className:S},g.id)})}),M&&v.connections.map(g=>t.jsx(we,{className:oe("group/data-row transition-colors border-b-0 hover:bg-accent/50 cursor-pointer bg-muted/20",C&&d.has(g.id)&&"bg-primary/5"),onClick:()=>h(g),children:n.map(S=>t.jsx(pe,{className:oe("px-5 py-3 h-14 align-middle text-sm text-foreground",S.cellClassName,S.id==="title"&&"pl-12"),children:t.jsx("div",{className:"min-w-0 w-full truncate overflow-hidden whitespace-nowrap",children:S.render?S.render(g):null})},S.id))},g.id))]},v.key)},e[25]=n,e[26]=x,e[27]=h,e[28]=f,e[29]=d,e[30]=C,e[31]=b):b=e[31],A=c.map(b),e[17]=n,e[18]=x,e[19]=c,e[20]=h,e[21]=f,e[22]=d,e[23]=C,e[24]=A}else A=e[24];let z;e[32]!==A?(z=t.jsx(zt,{children:A}),e[32]=A,e[33]=z):z=e[33];let U;return e[34]!==I||e[35]!==z?(U=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsxs(Lt,{className:"w-full border-collapse",children:[I,z]})}),e[34]=I,e[35]=z,e[36]=U):U=e[36],U}function $n(o){return o.stopPropagation()}function En(o,e){const n=e.updated_at??e.created_at,c=o.updated_at??o.created_at;return n?c?new Date(n)>new Date(c)?e:o:e:o}function On(){const{org:o}=vt(),e=Ct(),n=Nt(),c=bt({strict:!1}),{data:l}=_t.useSession(),{stdioEnabled:u}=kt(),r=Bt({namespace:o.slug,resource:"connections"}),h=Zt(),C=en(r),[d,f]=H.useReducer(bn,{mode:"idle"}),[p,T]=H.useState(!1),[x,j]=H.useState(new Set),[y,w]=H.useState(!1),[_,N]=H.useState(!1),[I,A]=H.useState("ALL"),[z,U]=H.useState("ALL"),b=sn(),k=C.filter(s=>!(s.connection_type==="VIRTUAL"||I!=="ALL"&&s.connection_type!==I||z!=="ALL"&&s.status!==z)),v=xn(C),M=pn(k),V=s=>{j(i=>{const a=new Set(i);return a.has(s)?a.delete(s):a.add(s),a})},X=()=>{T(!1),j(new Set)},K=Ft(C)[0],W=K?.id??"",g=Ut(K?.tools),S=ot({connectionId:W||null,orgId:o.id}),{data:L}=nn({client:S,toolName:g,toolArguments:{limit:200},enabled:!!(W&&g),staleTime:3600*1e3,select:s=>s.structuredContent??s}),ie=Mt(L??[]),re=c.action==="create",ae=()=>{n({to:"/$org/$project/mcps",params:{org:o.slug,project:Q},search:{action:"create"}})},ce=()=>{n({to:"/$org/$project/mcps",params:{org:o.slug,project:Q},search:{}})},m=wt({resolver:St(fn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),F=m.watch("ui_type"),$=m.watch("connection_url"),E=m.watch("npx_package"),de=Se({uiType:F,connectionUrl:$??"",npxPackage:E??""})??rt({uiType:F,connectionUrl:$??"",registryItems:ie}),D=d.mode==="editing"?d.connection:null;H.useEffect(()=>{if(D){const s=Tt(D.connection_headers)?D.connection_headers:null;if(s&&D.connection_type==="STDIO"){const i=mn(s.envVars);if(vn(s)){const a=Cn(s);m.reset({title:D.title,description:D.description,icon:D.icon??null,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i})}else{const a=Nn(s);m.reset({title:D.title,description:D.description,icon:D.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:i})}}else m.reset({title:D.title,description:D.description,icon:D.icon??null,ui_type:D.connection_type,connection_url:D.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else m.reset({title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[D,m]);const le=ot({connectionId:tn,orgId:o.id}),me=()=>{e.invalidateQueries({predicate:s=>{const i=s.queryKey;return i[1]===o.id&&i[3]==="collection"&&i[4]==="CONNECTIONS"}})},ue=async()=>{w(!1);const s=[...x];let i=0;for(const a of s)try{(await le.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:a,force:!0}})).isError||i++}catch{}me(),J.success(`Deleted ${i} connection${i!==1?"s":""}`),X()},je=async s=>{const i=[...x];let a=0;for(const B of i)try{await h.update.mutateAsync({id:B,data:{status:s}}),a++}catch{}me(),J.success(`${s==="active"?"Enabled":"Disabled"} ${a} connection${a!==1?"s":""}`),X()},R=async s=>{const i=b.find(P=>P.id===s);if(!i||!le)return;const a=new Set(i.connections.map(P=>P.connection_id)),B=[...x].filter(P=>!a.has(P)).map(P=>({connection_id:P,selected_tools:null,selected_resources:null,selected_prompts:null}));if(B.length===0){J.info("All selected connections are already in that agent");return}try{await le.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:s,data:{connections:[...i.connections,...B]}}}),e.invalidateQueries({predicate:P=>{const G=P.queryKey;return G[1]===o.id&&G[3]==="collection"&&G[4]==="VIRTUAL_MCP"}}),J.success(`Added ${B.length} connection${B.length!==1?"s":""} to "${i.title}"`),X()}catch{J.error("Failed to add connections to agent")}},et=s=>{const i=s.content;return Array.isArray(i)&&i[0]?.type==="text"&&typeof i[0].text=="string"?i[0].text:"Unknown error"},pt=async()=>{if(d.mode!=="deleting")return;const s=d.connection;f({type:"close"});try{const i=await le.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:s.id}});if(i.isError){const a=et(i),B=a.replace(/^Error:\s*/,"");try{const P=JSON.parse(B);if(P.code==="CONNECTION_IN_USE"&&P.agentNames){f({type:"force-delete",connection:s,agentNames:P.agentNames.map(G=>`"${G}"`).join(", ")});return}}catch{}J.error(`Failed to delete connection: ${a}`);return}me(),J.success("Connection deleted successfully")}catch(i){const a=i instanceof Error?i.message:String(i);J.error(`Failed to delete connection: ${a}`)}},xt=async()=>{if(d.mode!=="force-deleting")return;const s=d.connection.id;f({type:"close"});try{const i=await le.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:s,force:!0}});if(i.isError){J.error(`Failed to delete connection: ${et(i)}`);return}me(),J.success("Connection deleted successfully")}catch(i){const a=i instanceof Error?i.message:String(i);J.error(`Failed to delete connection: ${a}`)}},ht=async s=>{let i,a=null,B=null,P=null;if(s.ui_type==="NPX"?(i="STDIO",a="",P=jn(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(i="STDIO",a="",P=yn(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(i=s.ui_type,a=s.connection_url||"",B=s.connection_token||null),D){await h.update.mutateAsync({id:D.id,data:{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:i,connection_url:a,...B&&{connection_token:B},...P&&{connection_headers:P}}}),f({type:"close"}),m.reset();return}const G=Pt("conn");await h.create.mutateAsync({id:G,title:s.title,description:s.description||null,connection_type:i,connection_url:a,connection_token:B,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:l?.user?.id||"system",organization_id:o.id,icon:s.icon??null,app_name:null,app_id:null,connection_headers:P,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),ce(),m.reset(),n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:G}})},tt=s=>{s||(re?ce():f({type:"close"}),m.reset())},ke=s=>{const i=s.trim();if(!i)return;const a=!!m.formState.dirtyFields.title,B=!!m.formState.dirtyFields.description,P=!!m.formState.dirtyFields.env_vars,G=q=>{if(q&&(!a&&!m.getValues("title").trim()&&q.title&&m.setValue("title",q.title,{shouldDirty:!1}),!B&&!(m.getValues("description")??"").trim()&&q.description&&m.setValue("description",q.description,{shouldDirty:!1}),!P&&q.envVarKeys?.length)){const nt=m.getValues("env_vars")??[],jt=new Set(nt.map(ye=>ye.key)),st=q.envVarKeys.filter(ye=>!jt.has(ye));st.length>0&&m.setValue("env_vars",[...nt,...st.map(ye=>({key:ye,value:""}))],{shouldDirty:!0})}},Ae=gn(i);if(Ae&&u){m.setValue("ui_type","NPX",{shouldDirty:!0}),m.setValue("npx_package",Ae.packageName,{shouldDirty:!0}),m.setValue("connection_url","",{shouldDirty:!0}),m.setValue("connection_token",null,{shouldDirty:!0}),G(Se({uiType:"NPX",npxPackage:Ae.packageName}));return}if(i.startsWith("http://")||i.startsWith("https://")){const q=F==="HTTP"||F==="SSE"||F==="Websocket"?F:"HTTP";m.setValue("ui_type",q,{shouldDirty:!0}),m.setValue("connection_url",i,{shouldDirty:!0}),G(Se({uiType:q,connectionUrl:i})??rt({uiType:q,connectionUrl:i,registryItems:ie}));return}F==="NPX"&&G(Se({uiType:"NPX",npxPackage:i}))},ft=[...p?[{id:"select",header:"",render:s=>t.jsx(De,{checked:x.has(s.id),onCheckedChange:()=>V(s.id),onClick:i=>i.stopPropagation()}),cellClassName:"w-10 shrink-0"}]:[],{id:"title",header:"Name",render:s=>t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(Ne,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(he,{})}),t.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:s.title,children:s.title})]}),cellClassName:"w-32 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:s=>t.jsx("span",{className:"text-sm text-muted-foreground truncate block",title:s.description||"",children:s.description||"—"}),cellClassName:"flex-1 min-w-0 max-w-0",wrap:!1,sortable:!0},{id:"connection_type",header:"Type",accessor:s=>t.jsx("span",{className:"text-xs font-medium",children:s.connection_type}),cellClassName:"w-16 shrink-0",sortable:!0},{id:"status",header:"Status",render:s=>t.jsx(Te,{status:s.status}),cellClassName:"w-28 shrink-0",sortable:!1},{id:"updated_by",header:"Updated by",render:s=>t.jsx(be,{id:s.updated_by??s.created_by,size:"3xs"}),cellClassName:"w-32 shrink-0",sortable:!0},{id:"updated_at",header:"Updated",render:s=>t.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:s.updated_at?_e(new Date(s.updated_at)):"—"}),cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:s=>t.jsxs(He,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(O,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:i=>i.stopPropagation(),children:t.jsx(We,{size:20})})}),t.jsxs(Ke,{align:"end",onClick:i=>i.stopPropagation(),children:[t.jsxs(fe,{onClick:i=>{i.stopPropagation(),n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:s.id}})},children:[t.jsx(Ge,{size:16}),"Open"]}),t.jsxs(fe,{variant:"destructive",onClick:i=>{i.stopPropagation(),f({type:"delete",connection:s})},children:[t.jsx(Ie,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],gt=t.jsx("div",{className:"flex items-center gap-2",children:p?t.jsxs(O,{variant:"ghost",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:X,children:[t.jsx(dt,{size:14}),"Cancel"]}):t.jsxs(t.Fragment,{children:[t.jsxs(O,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:()=>T(!0),children:[t.jsx(Vt,{size:14}),"Select"]}),t.jsx(O,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:o.slug,project:Q}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),t.jsx(O,{onClick:ae,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]})});return t.jsxs(ve,{children:[t.jsx(qe,{open:re||d.mode==="editing",onOpenChange:tt,children:t.jsxs(Qe,{className:"sm:max-w-[525px]",children:[t.jsxs(Je,{children:[t.jsx(Ye,{children:D?"Edit Connection":"Create Connection"}),t.jsx(Ze,{children:D?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),t.jsx(Wt,{...m,children:t.jsxs("form",{onSubmit:m.handleSubmit(ht),children:[t.jsxs("div",{className:"grid gap-4 py-4",children:[t.jsx(Z,{control:m.control,name:"ui_type",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Type *"}),t.jsxs(Gt,{value:s.value,onValueChange:s.onChange,children:[t.jsx(ne,{children:t.jsx(qt,{children:t.jsx(Qt,{})})}),t.jsxs(Jt,{children:[t.jsx(Ce,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ee,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(Ce,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ee,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(Ce,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ee,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(Ce,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(he,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(Ce,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(dn,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(se,{})]})}),F==="NPX"&&t.jsx(t.Fragment,{children:t.jsx(Z,{control:m.control,name:"npx_package",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"NPM Package *"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"@perplexity-ai/mcp-server",...s,value:s.value??"",onPaste:i=>{const a=i.clipboardData.getData("text");a&&(i.preventDefault(),m.setValue("npx_package",a.trim(),{shouldDirty:!0}),ke(a))},onBlur:i=>{ke(i.target.value),s.onBlur()}})}),t.jsx(se,{})]})})}),F==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Z,{control:m.control,name:"stdio_command",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Command *"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"node, bun, python...",...s,value:s.value??""})}),t.jsx(se,{})]})}),t.jsx(Z,{control:m.control,name:"stdio_args",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Arguments"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"arg1 arg2 --flag value",...s,value:s.value??""})}),t.jsx(se,{})]})})]}),t.jsx(Z,{control:m.control,name:"stdio_cwd",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Working Directory"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"/path/to/project (optional)",...s,value:s.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(se,{})]})})]}),(F==="NPX"||F==="STDIO")&&t.jsx(Z,{control:m.control,name:"env_vars",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Environment Variables"}),t.jsx(ne,{children:t.jsx(un,{value:s.value??[],onChange:s.onChange})}),t.jsx(se,{})]})}),F!=="NPX"&&F!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Z,{control:m.control,name:"connection_url",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"URL *"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"https://example.com/mcp",...s,value:s.value??"",onPaste:i=>{const a=i.clipboardData.getData("text");a&&(i.preventDefault(),m.setValue("connection_url",a.trim(),{shouldDirty:!0}),ke(a))},onBlur:i=>{ke(i.target.value),s.onBlur()}})}),t.jsx(se,{})]})}),t.jsx(Z,{control:m.control,name:"connection_token",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:de?.token?.label??"Token (optional)"}),t.jsx(ne,{children:t.jsx(xe,{type:"password",placeholder:de?.token?.placeholder??"Bearer token or API key",...s,value:s.value??""})}),de?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[de.token.helperText,de.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:m.control,name:"title",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Name *"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"My Connection",...s})}),t.jsx(se,{})]})}),t.jsx(Z,{control:m.control,name:"description",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Description"}),t.jsx(ne,{children:t.jsx(Yt,{placeholder:"A brief description of this connection",rows:3,...s,value:s.value??""})}),t.jsx(se,{})]})})]}),t.jsxs(at,{children:[t.jsx(O,{type:"button",variant:"outline",onClick:()=>tt(!1),children:"Cancel"}),t.jsx(O,{type:"submit",disabled:m.formState.isSubmitting,className:"min-w-40",children:m.formState.isSubmitting?"Saving...":D?"Update Connection":"Create Connection"})]})]})})]})}),t.jsx(Oe,{open:d.mode==="deleting",onOpenChange:s=>!s&&f({type:"close"}),children:t.jsxs(ze,{children:[t.jsxs(Le,{children:[t.jsx(Ve,{children:"Delete Connection?"}),t.jsxs(Fe,{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(Be,{children:[t.jsx(Ue,{children:"Cancel"}),t.jsx(Me,{onClick:pt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),t.jsx(Oe,{open:d.mode==="force-deleting",onOpenChange:s=>!s&&f({type:"close"}),children:t.jsxs(ze,{children:[t.jsxs(Le,{children:[t.jsx(Ve,{children:"Connection Used by Agents"}),t.jsx(Fe,{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(Be,{children:[t.jsx(Ue,{children:"Cancel"}),t.jsx(Me,{onClick:xt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]})]})}),t.jsx(Pn,{open:y,onOpenChange:w,count:x.size,onConfirm:ue}),t.jsx(In,{open:_,onOpenChange:N,agents:b,onConfirm:R}),t.jsxs(ve.Header,{children:[t.jsx(ve.Header.Left,{children:t.jsx(Rt,{children:t.jsx(Ht,{children:t.jsx(Xt,{children:t.jsxs(Kt,{className:"flex items-center gap-2",children:["Connections",t.jsxs("span",{className:"text-xs font-normal text-muted-foreground tabular-nums",children:[v.total," total",v.active>0&&` · ${v.active} active`,v.error>0&&` · ${v.error} errors`]})]})})})})}),t.jsxs(ve.Header.Right,{children:[t.jsx(At,{viewMode:r.viewMode,onViewModeChange:r.setViewMode,sortKey:r.sortKey,sortDirection:r.sortDirection,onSort:r.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:I,onChange:s=>A(s||"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:z,onChange:s=>U(s||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]}]}),gt]})]}),t.jsx("div",{className:"flex items-center gap-3 px-5 pb-0",children:t.jsx("div",{className:"flex-1",children:t.jsx($t,{value:r.search,onChange:r.setSearch,placeholder:"Search for a Connection...",onKeyDown:s=>{s.key==="Escape"&&(r.setSearch(""),s.target.blur())}})})}),t.jsx(ve.Content,{children:r.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:k.length===0?t.jsx($e,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:r.search?`No Connections match "${r.search}"`:"Create a connection to get started.",actions:!r.search&&t.jsx(O,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:o.slug,project:Q}}),children:"Browse Store"})}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:M.map(s=>{if(s.type==="group")return t.jsx(_n,{group:s,onNavigate:a=>n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:a}}),onDelete:a=>f({type:"delete",connection:a}),selectionMode:p,selectedIds:x,onToggleSelect:V},s.key);const i=s.connection;return t.jsxs("div",{className:"relative",children:[p&&t.jsx("div",{className:"absolute top-3 left-3 z-10",children:t.jsx(De,{checked:x.has(i.id),onCheckedChange:()=>V(i.id)})}),t.jsx(lt,{connection:i,fallbackIcon:t.jsx(he,{}),onClick:()=>p?V(i.id):n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:i.id}}),className:oe(p&&x.has(i.id)&&"ring-2 ring-primary"),headerActions:p?void 0:t.jsxs(He,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(O,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:a=>a.stopPropagation(),children:t.jsx(We,{size:20})})}),t.jsxs(Ke,{align:"end",onClick:a=>a.stopPropagation(),children:[t.jsxs(fe,{onClick:a=>{a.stopPropagation(),n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:i.id}})},children:[t.jsx(Ge,{size:16}),"Open"]}),t.jsxs(fe,{variant:"destructive",onClick:a=>{a.stopPropagation(),f({type:"delete",connection:i})},children:[t.jsx(Ie,{size:16}),"Delete"]})]})]}),body:t.jsx(Te,{status:i.status}),footer:t.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(be,{id:i.updated_by??i.created_by,size:"3xs"})}),t.jsx("span",{className:"shrink-0 ml-2",children:i.updated_at?_e(new Date(i.updated_at)):"—"})]})})]},i.id)})})}):t.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:t.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:t.jsx("div",{className:"min-w-[1000px]",children:t.jsx(An,{columns:ft,grouped:M,sortKey:r.sortKey,sortDirection:r.sortDirection,onSort:r.handleSort,onRowClick:s=>p?V(s.id):n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:s.id}}),selectionMode:p,selectedIds:x,onToggleSelect:V,emptyState:r.search?t.jsx($e,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${r.search}"`}):t.jsx($e,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:t.jsx(O,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:o.slug,project:Q}}),children:"Browse Store"})})})})})})}),p&&t.jsx(Dn,{count:x.size,total:k.length,onSelectAll:()=>{j(new Set(k.map(s=>s.id)))},onDeselectAll:()=>j(new Set),onDelete:()=>w(!0),onAddToAgent:()=>N(!0),onToggleStatus:je,onCancel:X})]})}function Hs(){const o=ge.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(yt,{children:t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ln,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(On,{})})}),o[0]=e):e=o[0],e}export{Hs as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a7 as a,a8 as t}from"./index-CFro8UN2.js";const e=a(t,{target:"draft-7"});export{e as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bC as h,c as d,v as g,bD as y}from"./index-
|
|
1
|
+
import{bC as h,c as d,v as g,bD as y}from"./index-CFro8UN2.js";const m={authConfig:()=>["authConfig"],threads:t=>["threads",t],virtualMcpThreads:(t,e)=>["threads",t,"virtual-mcp",e],thread:(t,e)=>["thread",t,e],threadMessages:(t,e)=>["thread-messages",t,e],messages:t=>["messages",t],organizations:()=>["organizations"],members:t=>[t,"members"],invitations:t=>[t,"invitations"],organizationRoles:t=>[t,"organization-roles"],connections:t=>[t,"connections"],connectionsByBinding:(t,e)=>[t,"connections",`binding:${e}`],connection:(t,e)=>[t,"connection",e],isMCPAuthenticated:(t,e)=>["is-mcp-authenticated",t,e],mcpTools:(t,e)=>["mcp","tools",t,e],mcpClient:(t,e,n,o)=>["mcp","client",t,e,n,o],mcpToolsList:t=>["mcp","client",t,"tools"],mcpResourcesList:t=>["mcp","client",t,"resources"],mcpPromptsList:t=>["mcp","client",t,"prompts"],mcpReadResource:(t,e)=>["mcp","client",t,"resource",e],mcpGetPrompt:(t,e,n)=>["mcp","client",t,"prompt",e,n],mcpToolCall:(t,e,n)=>["mcp","client",t,"tool-call",e,n],organizationSettings:t=>["organization-settings",t],activeOrganization:t=>["activeOrganization",t],modelsList:t=>["models-list",t],connectionCollections:t=>[t,"collections","discovery"],toolCall:(t,e,n)=>["tool-call",t,e,n],collectionItems:(t,e)=>["collection",t,e],collection:(t,e,n)=>[t,e,"collection",n],collectionItem:(t,e,n,o,i)=>[t,e,n,"collection",o,i],collectionList:(t,e,n,o,i)=>[t,e,n,"collection",o,"list",i],collectionListInfinite:(t,e,n,o,i)=>[t,e,n,"collection",o,"list-infinite",i],githubReadme:(t,e)=>["github-readme",t,e],monitoringStats:()=>["monitoring","stats"],monitoringLogs:t=>["monitoring","logs",t],monitoringLogsInfinite:(t,e)=>["monitoring","logs-infinite",t,e],virtualMcpPrompts:t=>["virtual-mcp",t,"prompts"],connectionPrompts:t=>["connection",t,"prompts"],connectionResources:t=>["connection",t,"resources"],user:t=>["user",t]};class _ extends h{constructor(e,n){super(e,n)}send(e,n){const o=C(e);return o?.type==="emit"?(this.onmessage?.(o.message),Promise.resolve()):o?.type==="suppress"?Promise.resolve():super.send(e,n)}}function C(t){const e=t;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const n=e?.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:e.jsonrpc??"2.0",id:e.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(t,e){const n=e??(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=t?`/mcp/${t}`:"/mcp";return new URL(o,n).href}async function f({connectionId:t,orgId:e,token:n,meshUrl:o}){const i=T(t,o),c=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":e,...n?{Authorization:`Bearer ${n}`}:{}}}});await c.connect(r);const l=m.mcpClient(e,t??"self",n??"",o??"");return c.toJSON=()=>`mcp-client:${l.join(":")}`,c}function w(t){const e=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:c}=t;let r;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==i?(r=m.mcpClient(o,n??"self",i??"",c??""),e[0]=n,e[1]=c,e[2]=o,e[3]=i,e[4]=r):r=e[4];const l=r;let s;e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==i?(s=()=>f({connectionId:n,orgId:o,token:i,meshUrl:c}),e[5]=n,e[6]=c,e[7]=o,e[8]=i,e[9]=s):s=e[9];let a;e[10]!==l||e[11]!==s?(a={queryKey:l,queryFn:s,staleTime:1/0,gcTime:0},e[10]=l,e[11]=s,e[12]=a):a=e[12];const{data:u}=g(a);return u}function S(t){const e=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:c}=t;let r;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==i?(r=n!==void 0?m.mcpClient(o,n??"self",i??"",c??""):["mcp","client","skip",o],e[0]=n,e[1]=c,e[2]=o,e[3]=i,e[4]=r):r=e[4];const l=r;let s;e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==i?(s=async()=>n===void 0?null:f({connectionId:n,orgId:o,token:i,meshUrl:c}),e[5]=n,e[6]=c,e[7]=o,e[8]=i,e[9]=s):s=e[9];let a;e[10]!==l||e[11]!==s?(a={queryKey:l,queryFn:s,staleTime:1/0,gcTime:0},e[10]=l,e[11]=s,e[12]=a):a=e[12];const{data:u}=g(a);return u??null}const P={SELF:t=>`${t}_self`,REGISTRY:t=>`${t}_registry`,COMMUNITY_REGISTRY:t=>`${t}_community-registry`,DEV_ASSETS:t=>`${t}_dev-assets`},R="self";function M(t){return{id:P.REGISTRY(t),title:"Deco Store",description:"Official deco MCP registry with curated integrations",connection_type:"HTTP",connection_url:"https://api.decocms.com/mcp/registry",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(t={}){return{id:t.id,title:"OpenRouter",description:"Access hundreds of LLM models from a single API",icon:"https://assets.decocache.com/decocms/b2e2f64f-6025-45f7-9e8c-3b3ebdd073d8/openrouter_logojpg.jpg",app_name:"openrouter",app_id:"openrouter",connection_type:"HTTP",connection_url:"https://sites-openrouter.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{source:"chat",verified:!1,scopeName:"deco",toolsCount:0,publishedAt:null,repository:null}}}function E(t){return{id:v(t),organization_id:t,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 O(t){return!t||!t.startsWith(p)?null:t.slice(p.length)||null}function v(t){return`${p}${t}`}export{m as K,_ as S,P as W,R as a,L as b,f as c,E as d,D as e,M as f,v as g,S as h,O as i,w as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as A,n as D,c as O,q as v,t as E,j as r,B as N,f as I}from"./index-
|
|
1
|
+
import{o as A,n as D,c as O,q as v,t as E,j as r,B as N,f as I}from"./index-CFro8UN2.js";import{A as M,a as L,b as R,c as T,d as $,e as q,f as B}from"./alert-dialog-BifPyCni.js";import{F as V,a as k,b as H,c as U,d as G,e as J,f as K}from"./form-D5fEmRYW.js";import{I as P}from"./input-DHT-dQ79.js";import{S as Q}from"./spinner-D5-FOXs-.js";import{u as W}from"./useMutation-DjbNdewa.js";function _(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function se(o){const e=O.c(41),{open:a,onOpenChange:s}=o;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:v(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=W(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(R,{children:[r.jsx(T,{children:"Create a new organization"}),r.jsx($,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let p;e[6]!==i?(p=b=>i.mutateAsync(b),e[6]=i,e[7]=p):p=e[7],n=t.handleSubmit(p),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=p=>{const{field:b}=p;return r.jsxs(H,{children:[r.jsx(U,{children:"Organization Name"}),r.jsx(G,{children:r.jsx(P,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(J,{children:"The name of your company or organization"}),b.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",_(b.value)]})]}),r.jsx(K,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(V,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(M,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Q,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(N,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let S;e[26]!==d||e[27]!==g?(S=r.jsxs(q,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=S):S=e[28];let h;e[29]!==S||e[30]!==n||e[31]!==m||e[32]!==c?(h=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,S]}),e[29]=S,e[30]=n,e[31]=m,e[32]=c,e[33]=h):h=e[33];let x;e[34]!==t||e[35]!==h?(x=r.jsxs(L,{children:[F,r.jsx(k,{...t,children:h})]}),e[34]=t,e[35]=h,e[36]=x):x=e[36];let C;return e[37]!==s||e[38]!==a||e[39]!==x?(C=r.jsx(B,{open:a,onOpenChange:s,children:x}),e[37]=s,e[38]=a,e[39]=x,e[40]=C):C=e[40],C}function Y(o){const{orgSlug:e}=o;window.location.href=`/${e}`}async function Z(o){const e=_(o.name);if(!e)throw new Error("Organization slug is invalid");const a=await I.organization.create({name:o.name,slug:e});if(a?.error)throw new Error(a.error.message||"Failed to create organization");const s=a?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{se as C};
|