@decocms/mesh 2.136.1 → 2.137.0
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-CXJCnY_R.js → AlertCircle-Bz0Gu2J2.js} +1 -1
- package/dist/client/assets/{AlignLeft-Ckpqqq7X.js → AlignLeft-cTDyunvB.js} +1 -1
- package/dist/client/assets/{ArrowDown-BXCgJapO.js → ArrowDown-DA10fwsF.js} +1 -1
- package/dist/client/assets/{ArrowLeft-ihbjidrQ.js → ArrowLeft-bHzBiXiT.js} +1 -1
- package/dist/client/assets/{ArrowUp-B3tPpNuu.js → ArrowUp-DNV5Voek.js} +1 -1
- package/dist/client/assets/{Check-G22LpKFd.js → Check-e1LxjlnS.js} +1 -1
- package/dist/client/assets/{CheckCircle-Dl3Eh5mw.js → CheckCircle-aG4ywA2O.js} +1 -1
- package/dist/client/assets/{CheckDone01-DQOA8kaK.js → CheckDone01-BbDxR0le.js} +1 -1
- package/dist/client/assets/{CheckVerified02-C58oaMz8.js → CheckVerified02-BSRvrUwy.js} +1 -1
- package/dist/client/assets/{ChevronDown-DAk1F2Sn.js → ChevronDown-BjWhsewG.js} +1 -1
- package/dist/client/assets/{ChevronLeft-CGPjZdmg.js → ChevronLeft-bfDO3afT.js} +1 -1
- package/dist/client/assets/{ChevronRight-BT7U8Kip.js → ChevronRight-DZwFOSrA.js} +1 -1
- package/dist/client/assets/{Clock-CPO-Cqx6.js → Clock-BDkBqrq2.js} +1 -1
- package/dist/client/assets/{Code01-UXkm6aqY.js → Code01-Den27Mse.js} +1 -1
- package/dist/client/assets/{Container-CyEPuAYL.js → Container-w8ZJjmnR.js} +1 -1
- package/dist/client/assets/{Copy01-tzx60ICS.js → Copy01-BCJxa3pS.js} +1 -1
- package/dist/client/assets/{Dataflow03-mD5gBD1P.js → Dataflow03-C3PCJs5S.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-9qiIYu_T.js → DotsHorizontal-DdpEu4kv.js} +1 -1
- package/dist/client/assets/{DotsVertical-DHxrk-2J.js → DotsVertical-D65a3izp.js} +1 -1
- package/dist/client/assets/{Download01-DM18IWVp.js → Download01-AELYrpVY.js} +1 -1
- package/dist/client/assets/{Edit01-D3PaS600.js → Edit01-CPphoQZI.js} +1 -1
- package/dist/client/assets/{Edit05-B64h7zay.js → Edit05-Bxh4QPsk.js} +1 -1
- package/dist/client/assets/{Eye-C_LYW9jG.js → Eye-B65VnOsY.js} +1 -1
- package/dist/client/assets/{File02-CY9LI3Y-.js → File02-DbPhqcQA.js} +1 -1
- package/dist/client/assets/{File06-Dy7xo8XS.js → File06-DI2DTxDK.js} +1 -1
- package/dist/client/assets/{FilterLines-BvkJQ7ij.js → FilterLines-BWEMXQRq.js} +1 -1
- package/dist/client/assets/{Globe01-39jWI59e.js → Globe01-0k9H0lE8.js} +1 -1
- package/dist/client/assets/{Globe02-X-Xm1ngz.js → Globe02-C7u-Ldxq.js} +1 -1
- package/dist/client/assets/{Grid01-DTf5JuyC.js → Grid01-CMrNK-TY.js} +1 -1
- package/dist/client/assets/{Hash02-AH6eTaow.js → Hash02-DhotVIqT.js} +1 -1
- package/dist/client/assets/{Home02-DzIcdgJH.js → Home02-CSmINeMq.js} +1 -1
- package/dist/client/assets/{Image01-Dvb2vnmH.js → Image01-HHGXqEyS.js} +1 -1
- package/dist/client/assets/{Inbox01-CsvPcK33.js → Inbox01-BVd6Ufjh.js} +1 -1
- package/dist/client/assets/{InfoCircle-D2mDfen0.js → InfoCircle-CBee5-NO.js} +1 -1
- package/dist/client/assets/{Key01-C3Fh3hes.js → Key01-DY7k7KSd.js} +1 -1
- package/dist/client/assets/{LayersTwo01-CRgWs3EX.js → LayersTwo01-CuCFLmbR.js} +1 -1
- package/dist/client/assets/{LayoutLeft-C-0_xlw0.js → LayoutLeft-D-Sd6nh5.js} +1 -1
- package/dist/client/assets/{Link01-C74Jreax.js → Link01-C0RF1TkY.js} +1 -1
- package/dist/client/assets/{LinkExternal01-D6xwQf32.js → LinkExternal01-DUHpfLmD.js} +1 -1
- package/dist/client/assets/{List-DJEz6yKj.js → List-DFmwlXqV.js} +1 -1
- package/dist/client/assets/{Loading01-B3gOoSbd.js → Loading01-By16fsIj.js} +1 -1
- package/dist/client/assets/{Lock01-CodP_ius.js → Lock01-CJOMXMAI.js} +1 -1
- package/dist/client/assets/{Play-CxAaQi_l.js → Play-DYSuo3bc.js} +1 -1
- package/dist/client/assets/{Plus-Bo0L9uYY.js → Plus-jLReB_Bt.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-v6pXwg6P.js → RefreshCcw01-CJTVrN2f.js} +1 -1
- package/dist/client/assets/{Save01-CU3VjXKO.js → Save01-B5XsnIBD.js} +1 -1
- package/dist/client/assets/{SearchMd-Cpf31N-H.js → SearchMd-DF5i6zVs.js} +1 -1
- package/dist/client/assets/{Settings01-BmEB9pVn.js → Settings01-B3dw12xC.js} +1 -1
- package/dist/client/assets/{Shield01-CqrrEAw-.js → Shield01-B801SPcx.js} +1 -1
- package/dist/client/assets/{Terminal-BS-6VR5p.js → Terminal-DvZ2cYHA.js} +1 -1
- package/dist/client/assets/{Trash01-HuK-pEft.js → Trash01-BZm-kVJv.js} +1 -1
- package/dist/client/assets/{Upload01-DcyyJb_e.js → Upload01-B_Zc3fui.js} +1 -1
- package/dist/client/assets/{Users03-CPWgVi4r.js → Users03-CUtoEpN2.js} +1 -1
- package/dist/client/assets/{X-uHaUni9w.js → X-DZCW78jV.js} +1 -1
- package/dist/client/assets/{XCircle-C4iqiznn.js → XCircle-BRYqxNwU.js} +1 -1
- package/dist/client/assets/{XClose-DGYV-4S5.js → XClose-CuKHHhHx.js} +1 -1
- package/dist/client/assets/{Zap-5c_DBEtK.js → Zap-D7ItB-QC.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-BsjSZYGn.js → agent-connections-preview-NrV6TyCn.js} +1 -1
- package/dist/client/assets/agent-detail-CTx9BMRL.js +2 -0
- package/dist/client/assets/agents-DtA7iPv8.js +1 -0
- package/dist/client/assets/{alert-dialog-D3oCqQtu.js → alert-dialog-BY3oMun9.js} +2 -2
- package/dist/client/assets/{auth-catchall-bz6gJ41s.js → auth-catchall-DM7vkLcv.js} +1 -1
- package/dist/client/assets/{avatar-rYlL0ZoJ.js → avatar-Bp7Qjpgt.js} +1 -1
- package/dist/client/assets/{badge-CxJArm69.js → badge-CU_zbIXX.js} +1 -1
- package/dist/client/assets/{binder-BXDCztlr.js → binder-D8RBAvqy.js} +1 -1
- package/dist/client/assets/{breadcrumb-CGrLS5HH.js → breadcrumb-J-4TPKpB.js} +1 -1
- package/dist/client/assets/{card-CAORA3L1.js → card-ekU23Imm.js} +1 -1
- package/dist/client/assets/{chart-DX1_yJHY.js → chart-B5BozNmG.js} +1 -1
- package/dist/client/assets/{checkbox-BCSzUsPR.js → checkbox-Dkby6oH1.js} +1 -1
- package/dist/client/assets/{circle-alert-B4C3d1aQ.js → circle-alert-Dmir_dX9.js} +1 -1
- package/dist/client/assets/{collapsible-sQONDG4w.js → collapsible-C32NLu9h.js} +1 -1
- package/dist/client/assets/{collection-detail-B42SRwNb.js → collection-detail-CVcRRgDT.js} +1 -1
- package/dist/client/assets/{collection-display-button-M7dfC2Rf.js → collection-display-button-Cep9T1dy.js} +1 -1
- package/dist/client/assets/{collection-search-q4T1hb73.js → collection-search-D8Kd7sE4.js} +1 -1
- package/dist/client/assets/{collection-tab-e-VwhAzh.js → collection-tab-BkZUIpwh.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DXH0yXJC.js → collection-table-wrapper-j8x7CZEu.js} +1 -1
- package/dist/client/assets/{collection-tabs-BbVq4J-5.js → collection-tabs-_pBQ3xqw.js} +1 -1
- package/dist/client/assets/{command-CPQN970u.js → command-dR8rnu75.js} +1 -1
- package/dist/client/assets/{connect-BGH3KdkD.js → connect-DIFUIUeS.js} +1 -1
- package/dist/client/assets/{connection-card-DTiOZbAC.js → connection-card-Da4urKr2.js} +1 -1
- package/dist/client/assets/connection-detail-_mYJNdTe.js +1 -0
- package/dist/client/assets/connection-status-D-gHs_bI.js +1 -0
- package/dist/client/assets/connections-z3dfk98Y.js +1 -0
- package/dist/client/assets/{constants-D9bRXDQp.js → constants-B_iiTUip.js} +1 -1
- package/dist/client/assets/constants-DWucmYRT.js +1 -0
- package/dist/client/assets/{create-organization-dialog-Bs4zbKG7.js → create-organization-dialog-Dp3eW5BV.js} +1 -1
- package/dist/client/assets/{create-project-dialog-BkL7vqeo.js → create-project-dialog-wLCAgffa.js} +1 -1
- package/dist/client/assets/{danger-C_vn0auF.js → danger-DN20H7Jv.js} +1 -1
- package/dist/client/assets/{danger-zone-CdUOoCFt.js → danger-zone-BlpO_iQ-.js} +1 -1
- package/dist/client/assets/{decopilot-events-DHSwekTa.js → decopilot-events-Dczeyumg.js} +1 -1
- package/dist/client/assets/{dependencies-DTmw6OGT.js → dependencies-Uah1lriA.js} +1 -1
- package/dist/client/assets/{dialog-Baq_fjtR.js → dialog-BuY4tTjY.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CSqO4Mxn.js → dropdown-menu-CF9W86LV.js} +1 -1
- package/dist/client/assets/dynamic-plugin-layout-DbZjG_ew.js +1 -0
- package/dist/client/assets/{editable-task-title-HUenZvZX.js → editable-task-title-Po1P2Wd0.js} +1 -1
- package/dist/client/assets/{empty-state-BPClkF2j.js → empty-state-COL4jrg3.js} +1 -1
- package/dist/client/assets/{env-vars-editor-DDp7f4JN.js → env-vars-editor-KGRYrftY.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BkJeK0tX.js → extract-connection-data-BbBDZhaA.js} +1 -1
- package/dist/client/assets/{file-browser-DVzV35Ko.js → file-browser-B2axtg2i.js} +2 -2
- package/dist/client/assets/{form-C5R0_qWR.js → form-Ci0uQFmj.js} +1 -1
- package/dist/client/assets/{general-mBNwCpsS.js → general-DaCshnBc.js} +1 -1
- package/dist/client/assets/{grid-view-7eQhfO8f.js → grid-view-Cs9Fsjar.js} +1 -1
- package/dist/client/assets/{home-okrTp5Gh.js → home-CiAMHjmh.js} +1 -1
- package/dist/client/assets/{icon-picker-DevrZ9IQ.js → icon-picker-5o9r59w2.js} +1 -1
- package/dist/client/assets/{index-CvEIDmnk.js → index-B5u30SQw.js} +1 -1
- package/dist/client/assets/{index-DYY56DJY.js → index-CBuDQZ5c.js} +1 -1
- package/dist/client/assets/{index-BWSvBz7o.js → index-CNLrMiMB.js} +1 -1
- package/dist/client/assets/{index-B_0vsVr1.js → index-Cb17fVaO.js} +3 -3
- package/dist/client/assets/{index-BK6i23a9.js → index-Ch67qqnf.js} +1 -1
- package/dist/client/assets/index-ClZvg-b8.js +1 -0
- package/dist/client/assets/{index-UbeVlDrq.js → index-CvxrBAxY.js} +1 -1
- package/dist/client/assets/{index-QCmdl8uj.js → index-DLDRkAi_.js} +1 -1
- package/dist/client/assets/{index-ByA6j7_H.js → index-DlboOjMX.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DKiK82rX.js → infiniteQueryObserver-CiekiSCa.js} +1 -1
- package/dist/client/assets/{input-CW7SVowR.js → input-Cch0IC2D.js} +1 -1
- package/dist/client/assets/{integration-icon-DAFtApWT.js → integration-icon-BtE6qqXO.js} +1 -1
- package/dist/client/assets/{label-DWU1nKSS.js → label-BLzrK_Rs.js} +1 -1
- package/dist/client/assets/layout-BDCv6fVK.js +1 -0
- package/dist/client/assets/{layout-CzVwolFw.js → layout-JuxaRCBK.js} +1 -1
- package/dist/client/assets/{localstorage-keys-BAzeyS9J.js → localstorage-keys-CxWEzkpK.js} +1 -1
- package/dist/client/assets/login-4Ej4TxT2.js +1 -0
- package/dist/client/assets/{markdown-DCSB9ejV.js → markdown-B9U6C-Vk.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BtuEhdWL.js → mcp-app-renderer-vWTHzC-y.js} +1 -1
- package/dist/client/assets/{mcp-oauth-D8pA0WRM.js → mcp-oauth-D_4U_dE3.js} +1 -1
- package/dist/client/assets/{mcp-server-card-D7xlSyX7.js → mcp-server-card-xdUT5WQB.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-DdKXdUu2.js → mcp-server-detail-CZ73zkO0.js} +2 -2
- package/dist/client/assets/members-CNen9UaM.js +3 -0
- package/dist/client/assets/{monaco-editor-zyWgiZEt.js → monaco-editor-CYwLLnlJ.js} +1 -1
- package/dist/client/assets/{monitoring-SM_c8qxT.js → monitoring-BoQ3xY78.js} +1 -1
- package/dist/client/assets/monitoring-dashboard-edit-BdndwDLO.js +1 -0
- package/dist/client/assets/{monitoring-dashboard-view-C3qQNwfm.js → monitoring-dashboard-view-C4LyubYv.js} +2 -2
- package/dist/client/assets/{oauth-callback-1SC3hH5y.js → oauth-callback-B6grmhGw.js} +1 -1
- package/dist/client/assets/page-BEtq2_NI.js +1 -0
- package/dist/client/assets/{page-hoODnFtN.js → page-BnZfgb1H.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-Cl_h_OgT.js → plugin-empty-state-CJi_lWXP.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-Doboc7Tq.js → plugin-empty-state-DyUfvnh_.js} +1 -1
- package/dist/client/assets/{plugin-header-DNeaPoeS.js → plugin-header-B7DjR-EV.js} +1 -1
- package/dist/client/assets/{plugin-header-C4Dfehzm.js → plugin-header-UTo9wubo.js} +1 -1
- package/dist/client/assets/plugins-HjXVX3kj.js +1 -0
- package/dist/client/assets/{popover-BNZ96bFv.js → popover-CH5Uw6Js.js} +1 -1
- package/dist/client/assets/{project-app-view-Bsbq4Qf_.js → project-app-view-DdBfbyq8.js} +1 -1
- package/dist/client/assets/{project-layout-B4cnkESa.js → project-layout-hj30-COK.js} +1 -1
- package/dist/client/assets/{project-plugins-CqDaIw1P.js → project-plugins-DiXNjiNd.js} +1 -1
- package/dist/client/assets/{projects-list-CgsVuZof.js → projects-list-BhN8iQTZ.js} +1 -1
- package/dist/client/assets/{readme-viewer-CKidIXa3.js → readme-viewer-D1bVaWvP.js} +1 -1
- package/dist/client/assets/{registry-layout-oUh5Zl7W.js → registry-layout-vtzlbvnH.js} +1 -1
- package/dist/client/assets/{registry-utils-DXJps8H7.js → registry-utils-M1yY8DgS.js} +1 -1
- package/dist/client/assets/{reports-layout-CFJRqv-Q.js → reports-layout-BiNtHVIg.js} +1 -1
- package/dist/client/assets/{reset-password-ZQI9gTW6.js → reset-password-CVwZZFPi.js} +1 -1
- package/dist/client/assets/{resizable-CWRglWOX.js → resizable-taukBI4-.js} +1 -1
- package/dist/client/assets/{save-actions-eGQZXGI3.js → save-actions-DkD1FHqW.js} +1 -1
- package/dist/client/assets/{scroll-area-By1z4ZyY.js → scroll-area-nyuwfJ38.js} +1 -1
- package/dist/client/assets/{select-CYY4CENz.js → select-iAQ1JGAr.js} +1 -1
- package/dist/client/assets/{shell-layout-DMKfJTmj.js → shell-layout-hy8oqx1b.js} +2 -2
- package/dist/client/assets/{sidebar-settings-ILgspCqY.js → sidebar-settings-DQE_2wSn.js} +1 -1
- package/dist/client/assets/{skeleton-C4ZMp7sl.js → skeleton-BavbnGik.js} +1 -1
- package/dist/client/assets/{spinner-oA3jiJW_.js → spinner-BsdcXRt-.js} +1 -1
- package/dist/client/assets/{store-invite-Bfy0Alsf.js → store-invite-BlSnhDpm.js} +1 -1
- package/dist/client/assets/switch-BYETmQBd.js +1 -0
- package/dist/client/assets/{table-RFgqEt_E.js → table-5KSUgwco.js} +1 -1
- package/dist/client/assets/tabs-BCXNMT0l.js +1 -0
- package/dist/client/assets/tasks-BEHJWLwK.js +1 -0
- package/dist/client/assets/{tasks-panel-C7RwVTDD.js → tasks-panel-DXBfZcDd.js} +1 -1
- package/dist/client/assets/{textarea-4HpXofT0.js → textarea-D4QsZZY2.js} +1 -1
- package/dist/client/assets/{time-range-picker-Cx2A-Fs_.js → time-range-picker-LYFa1sSz.js} +1 -1
- package/dist/client/assets/{toggle-group-CVFHcp8K.js → toggle-group-CnLXoLRJ.js} +1 -1
- package/dist/client/assets/tools-list-CWpIc2sG.js +1 -0
- package/dist/client/assets/tooltip-Bb66VFhj.js +1 -0
- package/dist/client/assets/{topbar-portal-DOwsTUY4.js → topbar-portal-DBCM_jc6.js} +1 -1
- package/dist/client/assets/{types-B46wd5bS.js → types-CGMnrrVy.js} +1 -1
- package/dist/client/assets/use-binding-Bi9qdfAY.js +1 -0
- package/dist/client/assets/{use-collections-vccihohV.js → use-collections-BF-71bZg.js} +1 -1
- package/dist/client/assets/{use-connection-DeEn4qfI.js → use-connection-Bv6BgTqI.js} +1 -1
- package/dist/client/assets/{use-copy-CykDvxn6.js → use-copy-QwK_lQBK.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DB14T-Ft.js → use-create-virtual-mcp-wYKTF_rl.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-BeHRHLDl.js → use-install-from-registry-CM7KAiir.js} +1 -1
- package/dist/client/assets/{use-list-state-ykkfYLR3.js → use-list-state-CB-KMJqf.js} +1 -1
- package/dist/client/assets/{use-llm-B_iPCa-K.js → use-llm-lZx_FT_g.js} +1 -1
- package/dist/client/assets/{use-mcp-resources-Rqzq7A0J.js → use-mcp-resources-MU6kxIry.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BXihKxpu.js → use-mcp-tools-q5O9mXfB.js} +1 -1
- package/dist/client/assets/{use-members-DAcqcxDX.js → use-members-xNw9MWgV.js} +1 -1
- package/dist/client/assets/{use-mobile-B2VAoWT2.js → use-mobile-By224gq0.js} +1 -1
- package/dist/client/assets/{use-project-D96OXk4y.js → use-project-Dr0Nftxm.js} +1 -1
- package/dist/client/assets/{use-settings-modal-CouKpdi3.js → use-settings-modal-5estZr-G.js} +1 -1
- package/dist/client/assets/{use-view-mode-DyK0fMBe.js → use-view-mode-Dd5y7aaP.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-OwU65kyR.js → use-virtual-mcp-T76ZkZ-8.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DGesCtT2.js +1 -0
- package/dist/client/assets/{useMutation-lBFQDcxE.js → useMutation-DRjp2Nl5.js} +1 -1
- package/dist/client/assets/useQuery-BcAK4m0m.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-B9EajsfN.js +1 -0
- package/dist/client/assets/{user-C73vNaiS.js → user-CkBLhwlg.js} +1 -1
- package/dist/client/assets/{workflow-S9BhswBs.js → workflow-C8yX97ao.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-detail-BxRuQLTH.js +0 -2
- package/dist/client/assets/agents-KBFzt520.js +0 -1
- package/dist/client/assets/connection-detail-DznxU3SC.js +0 -1
- package/dist/client/assets/connections-AQfSUAp3.js +0 -1
- package/dist/client/assets/constants-DvJZMaim.js +0 -1
- package/dist/client/assets/dynamic-plugin-layout-d0KDA7MF.js +0 -1
- package/dist/client/assets/index-B-STjJpH.js +0 -1
- package/dist/client/assets/layout-DEcRD72T.js +0 -1
- package/dist/client/assets/login-OPfY3bsF.js +0 -1
- package/dist/client/assets/members-YKyOsCaT.js +0 -3
- package/dist/client/assets/monitoring-dashboard-edit-cexdjvMw.js +0 -1
- package/dist/client/assets/page-DfTTOYQt.js +0 -1
- package/dist/client/assets/plugins-H9eiCXso.js +0 -1
- package/dist/client/assets/switch-BSc4dVNg.js +0 -1
- package/dist/client/assets/tabs-BZ-xfLNG.js +0 -1
- package/dist/client/assets/tasks-Cy-gkHRX.js +0 -1
- package/dist/client/assets/tools-list-BYphEqhu.js +0 -1
- package/dist/client/assets/tooltip-Cz-bAWiO.js +0 -1
- package/dist/client/assets/use-binding-Dz1SRdBY.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Cl9EtkM0.js +0 -1
- package/dist/client/assets/useQuery-DcRkCB2j.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DdSDu-rZ.js +0 -1
package/dist/client/index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<title>MCP Mesh</title>
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
6
|
-
<script type="module" crossorigin src="/assets/index-
|
|
6
|
+
<script type="module" crossorigin src="/assets/index-Cb17fVaO.js"></script>
|
|
7
7
|
<link rel="stylesheet" crossorigin href="/assets/index-D6E08wfB.css">
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as _,c as k,j as t,E as fe,B as J,v as ae,_ as Ze,u as de,V as Qe,s as Xe,t as ce,b as et,e as tt,O as Ge,l as st,k as lt,aD as ot,q as Me}from"./index-B_0vsVr1.js";import{b as Ae,i as nt,c as it,u as rt,C as at,d as ct}from"./collapsible-sQONDG4w.js";import{C as dt,E as mt}from"./collection-search-q4T1hb73.js";import{I as ut}from"./icon-picker-DevrZ9IQ.js";import{I as Oe}from"./integration-icon-DAFtApWT.js";import{u as ft}from"./index-QCmdl8uj.js";import{B as $e}from"./badge-CxJArm69.js";import{I as Ve}from"./input-CW7SVowR.js";import{S as pt}from"./switch-BSc4dVNg.js";import{T as xt}from"./textarea-4HpXofT0.js";import{a as pe,c as ve,T as xe,b as he}from"./tooltip-Cz-bAWiO.js";import{b as ht,u as gt}from"./use-connection-DeEn4qfI.js";import{u as jt,a as bt}from"./use-virtual-mcp-OwU65kyR.js";import{i as He}from"./ChevronRight-BT7U8Kip.js";import{n as Nt}from"./select-CYY4CENz.js";import{i as De}from"./File02-CY9LI3Y-.js";import{i as Le}from"./Loading01-B3gOoSbd.js";import{i as vt}from"./Play-CxAaQi_l.js";import{s as Be}from"./Plus-Bo0L9uYY.js";import{t as yt}from"./Users03-CPWgVi4r.js";import{B as Ct,a as _t,b as Fe,d as St,e as Tt,c as kt}from"./breadcrumb-CGrLS5HH.js";import{a as wt,V as Et}from"./layout-CzVwolFw.js";import{S as It}from"./save-actions-eGQZXGI3.js";import{a as At}from"./tools-list-BYphEqhu.js";import{C as ze}from"./checkbox-BCSzUsPR.js";import{e as Ot,a as Ue,D as Ke,b as $t,c as Dt}from"./dialog-Baq_fjtR.js";import{T as ye,a as Lt,b as Ce,c as zt}from"./tabs-BZ-xfLNG.js";import{u as ge,a as Rt}from"./constants-D9bRXDQp.js";import{c as Pt}from"./use-mcp-tools-BXihKxpu.js";import{a as Mt}from"./use-mcp-resources-Rqzq7A0J.js";import{u as Vt}from"./decopilot-events-DHSwekTa.js";import{s as We}from"./slugify-CEUa2lfQ.js";import{I as Bt,R as Ft,a as Gt}from"./index-B-STjJpH.js";import{i as je}from"./Check-G22LpKFd.js";import{i as Ht}from"./Code01-UXkm6aqY.js";import{a as Re}from"./Copy01-tzx60ICS.js";import{i as _e}from"./InfoCircle-D2mDfen0.js";import{i as Ut}from"./Key01-C3Fh3hes.js";import{A as Kt}from"./agent-connections-preview-BsjSZYGn.js";import"./use-llm-B_iPCa-K.js";import"./use-collections-vccihohV.js";import"./useMutation-lBFQDcxE.js";import"./use-binding-Dz1SRdBY.js";import"./binder-BXDCztlr.js";import"./useQuery-DcRkCB2j.js";import"./localstorage-keys-BAzeyS9J.js";import"./skeleton-C4ZMp7sl.js";import"./AlignLeft-Ckpqqq7X.js";import"./ArrowLeft-ihbjidrQ.js";import"./ChevronDown-DAk1F2Sn.js";import"./Image01-Dvb2vnmH.js";import"./RefreshCcw01-v6pXwg6P.js";import"./SearchMd-Cpf31N-H.js";import"./Settings01-BmEB9pVn.js";import"./useSuspenseInfiniteQuery-DdSDu-rZ.js";import"./infiniteQueryObserver-DKiK82rX.js";import"./popover-BNZ96bFv.js";import"./scroll-area-By1z4ZyY.js";import"./Container-CyEPuAYL.js";import"./Edit05-B64h7zay.js";import"./Link01-C74Jreax.js";import"./XClose-DGYV-4S5.js";import"./index-CvEIDmnk.js";import"./Save01-CU3VjXKO.js";import"./collection-display-button-M7dfC2Rf.js";import"./dropdown-menu-CSqO4Mxn.js";import"./ArrowDown-BXCgJapO.js";import"./ArrowUp-B3tPpNuu.js";import"./Grid01-DTf5JuyC.js";import"./List-DJEz6yKj.js";import"./collection-table-wrapper-DXH0yXJC.js";import"./table-RFgqEt_E.js";import"./card-CAORA3L1.js";import"./types-B46wd5bS.js";import"./Eye-C_LYW9jG.js";import"./Globe02-X-Xm1ngz.js";import"./LayersTwo01-CRgWs3EX.js";import"./X-uHaUni9w.js";const Ye=({size:o=24,color:e="currentColor",...s})=>_.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},_.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}));Ye.displayName="Circle";const be=({size:o=24,color:e="currentColor",...s})=>_.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},_.createElement("path",{d:"m9.75 20.75 1.473.818c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l1.473-.818m-9-2.5-1.427-.793c-.3-.166-.45-.25-.558-.368a1 1 0 0 1-.215-.364C3 16.573 3 16.401 3 16.06V14.5m0-5V7.942c0-.343 0-.514.05-.667a1 1 0 0 1 .215-.364c.109-.119.258-.202.558-.368L5.25 5.75m4.5-2.5 1.473-.818c.284-.158.425-.237.576-.267a1 1 0 0 1 .402 0c.15.03.292.11.576.267l1.473.818m4.5 2.5 1.427.793c.3.166.45.25.558.368a1 1 0 0 1 .215.364c.05.153.05.324.05.667V9.5m0 5v1.559c0 .342 0 .514-.05.666a.999.999 0 0 1-.215.364c-.109.119-.258.202-.558.368l-1.427.793m-9-7.5L12 12m0 0 2.25-1.25M12 12v2.5M3 7l2.25 1.25m13.5 0L21 7m-9 12.5V22"}));be.displayName="CubeOutline";const qe=({size:o=24,color:e="currentColor",...s})=>_.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},_.createElement("path",{d:"m12 5.5-4.638 6.747c-.28.406-.42.609-.41.778a.5.5 0 0 0 .195.373c.135.102.38.102.874.102H12v5l4.638-6.747c.28-.406.42-.609.41-.778a.5.5 0 0 0-.195-.373c-.135-.102-.38-.102-.874-.102H12v-5Z"}),_.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}));qe.displayName="ZapCircle";function Se(o){return o===null?"all":o?.length??0}function Wt(o,e){const s=o[e];if(!s)return"";const n=[];return s.tools===null?n.push("all tools"):s.tools&&s.tools.length>0&&n.push(`${s.tools.length} tools`),s.resources===null?n.push("all resources"):s.resources&&s.resources.length>0&&n.push(`${s.resources.length} resources`),s.prompts===null?n.push("all prompts"):s.prompts&&s.prompts.length>0&&n.push(`${s.prompts.length} prompts`),n.join(", ")}function Yt(o,e){const s=o[e];return s?!((s.tools===void 0||s.tools!==null&&s.tools.length===0)&&(s.resources===void 0||s.resources!==null&&s.resources.length===0)&&(s.prompts===void 0||s.prompts!==null&&s.prompts.length===0)):!1}const qt={tools:null,resources:null,prompts:null};function Te(){const o=k.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(Le,{className:"animate-spin text-muted-foreground",size:24})}),o[0]=e):e=o[0],e}function ke(o){return({error:e})=>e?.message?.includes("Method not found")||e?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:o})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(Ze,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:e?.message?e.message.length>200?`${e.message.slice(0,200)}...`:e.message:"An unexpected error occurred"})]})]})}function Jt(o){const e=k.c(23),{item:s,isSelected:n,onToggle:l,disabled:i}=o,d=i?"cursor-not-allowed opacity-50":"cursor-pointer",a=n?"bg-accent/25":"hover:bg-muted/50";let r;e[0]!==d||e[1]!==a?(r=ae("flex items-start gap-3 p-4 rounded-lg transition-colors",d,a),e[0]=d,e[1]=a,e[2]=r):r=e[2];let c;e[3]!==s.name?(c=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:s.name}),e[3]=s.name,e[4]=c):c=e[4];let x;e[5]!==s.tags?(x=s.tags&&t.jsx("span",{className:"shrink-0",children:s.tags}),e[5]=s.tags,e[6]=x):x=e[6];let g;e[7]!==c||e[8]!==x?(g=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c,x]}),e[7]=c,e[8]=x,e[9]=g):g=e[9];let p;e[10]!==s.description?(p=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[10]=s.description,e[11]=p):p=e[11];let h;e[12]!==g||e[13]!==p?(h=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[g,p]}),e[12]=g,e[13]=p,e[14]=h):h=e[14];let u;e[15]!==i||e[16]!==n||e[17]!==l?(u=t.jsx(ze,{checked:n,onCheckedChange:l,disabled:i,className:"mt-0.5"}),e[15]=i,e[16]=n,e[17]=l,e[18]=u):u=e[18];let f;return e[19]!==r||e[20]!==h||e[21]!==u?(f=t.jsxs("label",{className:r,children:[h,u]}),e[19]=r,e[20]=h,e[21]=u,e[22]=f):f=e[22],f}function Pe(o){const e=k.c(32),{items:s,selections:n,onToggle:l,onToggleAll:i,emptyMessage:d,disabled:a}=o;let r,c,x,g,p;if(e[0]!==a||e[1]!==d||e[2]!==s||e[3]!==l||e[4]!==i||e[5]!==n){p=Symbol.for("react.early_return_sentinel");e:{const f=s.map(Zt);if(s.length===0){let y;e[11]!==d?(y=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:d})}),e[11]=d,e[12]=y):y=e[12],p=y;break e}x="flex flex-col h-full";const b=a?"cursor-not-allowed opacity-50":"cursor-pointer";let m;e[13]!==b?(m=ae("flex items-start gap-3 p-4",b),e[13]=b,e[14]=m):m=e[14];let j;e[15]!==s.length?(j=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsxs("span",{className:"text-sm font-medium",children:["Select All (",s.length,")"]})}),e[15]=s.length,e[16]=j):j=e[16];const v=n===null;let C;e[17]!==a||e[18]!==i||e[19]!==v?(C=t.jsx(ze,{checked:v,onCheckedChange:i,disabled:a,className:"mt-0.5"}),e[17]=a,e[18]=i,e[19]=v,e[20]=C):C=e[20],e[21]!==C||e[22]!==m||e[23]!==j?(g=t.jsx("div",{className:"px-4 border-b border-border shrink-0",children:t.jsxs("label",{className:m,children:[j,C]})}),e[21]=C,e[22]=m,e[23]=j,e[24]=g):g=e[24],r="flex-1 overflow-auto px-4 py-3 space-y-1",c=s.map(y=>t.jsx(Jt,{item:y,isSelected:n===null||n?.includes(y.id),onToggle:()=>l(y.id,f),disabled:a},y.id))}e[0]=a,e[1]=d,e[2]=s,e[3]=l,e[4]=i,e[5]=n,e[6]=r,e[7]=c,e[8]=x,e[9]=g,e[10]=p}else r=e[6],c=e[7],x=e[8],g=e[9],p=e[10];if(p!==Symbol.for("react.early_return_sentinel"))return p;let h;e[25]!==r||e[26]!==c?(h=t.jsx("div",{className:r,children:c}),e[25]=r,e[26]=c,e[27]=h):h=e[27];let u;return e[28]!==x||e[29]!==g||e[30]!==h?(u=t.jsxs("div",{className:x,children:[g,h]}),e[28]=x,e[29]=g,e[30]=h,e[31]=u):u=e[31],u}function Zt(o){return o.id}function Qt(o){const e=k.c(13),{connectionId:s,selections:n,onToggle:l,onToggleAll:i,disabled:d}=o,{org:a}=de();let r;e[0]!==s||e[1]!==a.id?(r={connectionId:s,orgId:a.id},e[0]=s,e[1]=a.id,e[2]=r):r=e[2];const c=ge(r);let x;e[3]!==c?(x={client:c},e[3]=c,e[4]=x):x=e[4];const{data:g}=Pt(x);let p;e[5]!==g.tools?(p=g.tools.map(Xt),e[5]=g.tools,e[6]=p):p=e[6];const h=p;let u;return e[7]!==d||e[8]!==h||e[9]!==l||e[10]!==i||e[11]!==n?(u=t.jsx(Pe,{items:h,selections:n,onToggle:l,onToggleAll:i,emptyMessage:"No tools available",disabled:d}),e[7]=d,e[8]=h,e[9]=l,e[10]=i,e[11]=n,e[12]=u):u=e[12],u}function Xt(o){return{id:o.name,name:o.name,description:o.description,tags:t.jsx(At,{annotations:o.annotations,_meta:o._meta})}}function es(o){const e=k.c(13),{connectionId:s,selections:n,onToggle:l,onToggleAll:i,disabled:d}=o,{org:a}=de();let r;e[0]!==s||e[1]!==a.id?(r={connectionId:s,orgId:a.id},e[0]=s,e[1]=a.id,e[2]=r):r=e[2];const c=ge(r);let x;e[3]!==c?(x={client:c},e[3]=c,e[4]=x):x=e[4];const{data:g}=Mt(x);let p;e[5]!==g.resources?(p=g.resources.map(ts),e[5]=g.resources,e[6]=p):p=e[6];const h=p;let u;return e[7]!==d||e[8]!==h||e[9]!==l||e[10]!==i||e[11]!==n?(u=t.jsx(Pe,{items:h,selections:n,onToggle:l,onToggleAll:i,emptyMessage:"No resources available",disabled:d}),e[7]=d,e[8]=h,e[9]=l,e[10]=i,e[11]=n,e[12]=u):u=e[12],u}function ts(o){return{id:o.name||o.uri,name:o.name||o.uri,description:o.description}}function ss(o){const e=k.c(13),{connectionId:s,selections:n,onToggle:l,onToggleAll:i,disabled:d}=o,{org:a}=de();let r;e[0]!==s||e[1]!==a.id?(r={connectionId:s,orgId:a.id},e[0]=s,e[1]=a.id,e[2]=r):r=e[2];const c=ge(r);let x;e[3]!==c?(x={client:c},e[3]=c,e[4]=x):x=e[4];const{data:g}=Vt(x);let p;e[5]!==g.prompts?(p=g.prompts.map(ls),e[5]=g.prompts,e[6]=p):p=e[6];const h=p;let u;return e[7]!==d||e[8]!==h||e[9]!==l||e[10]!==i||e[11]!==n?(u=t.jsx(Pe,{items:h,selections:n,onToggle:l,onToggleAll:i,emptyMessage:"No prompts available",disabled:d}),e[7]=d,e[8]=h,e[9]=l,e[10]=i,e[11]=n,e[12]=u):u=e[12],u}function ls(o){return{id:o.name,name:o.name,description:o.description}}function os(o){const e=k.c(24),{connection:s,isSelected:n,hasSelections:l,summary:i,onClick:d,onToggleAll:a,disabled:r}=o,c=r?"cursor-not-allowed opacity-50":"cursor-pointer",x=n?"bg-accent":"hover:bg-muted/50";let g;e[0]!==c||e[1]!==x?(g=ae("flex items-center gap-2 p-2 h-12 rounded-lg transition-colors",c,x),e[0]=c,e[1]=x,e[2]=g):g=e[2];const p=r?void 0:d;let h;e[3]!==s.icon||e[4]!==s.title?(h=t.jsx(Oe,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[3]=s.icon,e[4]=s.title,e[5]=h):h=e[5];let u;e[6]!==s.title?(u=t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.title}),e[6]=s.title,e[7]=u):u=e[7];let f;e[8]!==l||e[9]!==i?(f=l&&i&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i}),e[8]=l,e[9]=i,e[10]=f):f=e[10];let b;e[11]!==u||e[12]!==f?(b=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[u,f]}),e[11]=u,e[12]=f,e[13]=b):b=e[13];let m;e[14]!==r||e[15]!==l||e[16]!==a?(m=t.jsx(ze,{checked:l,onCheckedChange:a,onClick:ns,disabled:r,className:"shrink-0"}),e[14]=r,e[15]=l,e[16]=a,e[17]=m):m=e[17];let j;return e[18]!==g||e[19]!==p||e[20]!==h||e[21]!==b||e[22]!==m?(j=t.jsxs("div",{className:g,onClick:p,children:[h,b,m]}),e[18]=g,e[19]=p,e[20]=h,e[21]=b,e[22]=m,e[23]=j):j=e[23],j}function ns(o){return o.stopPropagation()}function is(o){const e=k.c(22),{allConnections:s,searchTerm:n,selectedId:l,hasSelections:i,getSelectionSummary:d,onConnectionClick:a,onToggleAll:r,disabled:c}=o;let x;e[0]!==s||e[1]!==n?(x=n?s.filter(u=>u.title.toLowerCase().includes(n.toLowerCase())||u.description?.toLowerCase().includes(n.toLowerCase())):s,e[0]=s,e[1]=n,e[2]=x):x=e[2];const g=x;if(g.length===0){const u=n?"No connections found":"No connections available";let f;return e[3]!==u?(f=t.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground p-4",children:u}),e[3]=u,e[4]=f):f=e[4],f}let p;if(e[5]!==c||e[6]!==g||e[7]!==d||e[8]!==i||e[9]!==a||e[10]!==r||e[11]!==l){let u;e[13]!==c||e[14]!==d||e[15]!==i||e[16]!==a||e[17]!==r||e[18]!==l?(u=f=>t.jsx(os,{connection:f,isSelected:l===f.id,hasSelections:i(f.id),summary:d(f.id),onClick:()=>a(f.id),onToggleAll:()=>r(f.id),disabled:c},f.id),e[13]=c,e[14]=d,e[15]=i,e[16]=a,e[17]=r,e[18]=l,e[19]=u):u=e[19],p=g.map(u),e[5]=c,e[6]=g,e[7]=d,e[8]=i,e[9]=a,e[10]=r,e[11]=l,e[12]=p}else p=e[12];let h;return e[20]!==p?(h=t.jsx("div",{className:"flex flex-col gap-0.5",children:p}),e[20]=p,e[21]=h):h=e[21],h}function rs(o){const e=k.c(75),{currentConnection:s,activeTab:n,selectedId:l,formData:i,toggleTool:d,toggleResource:a,togglePrompt:r,toggleAllTools:c,toggleAllResources:x,toggleAllPrompts:g,onTabChange:p}=o;let h;e[0]!==s.icon||e[1]!==s.title?(h=t.jsx(Oe,{icon:s.icon,name:s.title,size:"md",className:"shrink-0"}),e[0]=s.icon,e[1]=s.title,e[2]=h):h=e[2];let u;e[3]!==s.title?(u=t.jsx("h2",{className:"text-lg font-semibold truncate",children:s.title}),e[3]=s.title,e[4]=u):u=e[4];let f;e[5]!==s.description?(f=s.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:s.description}),e[5]=s.description,e[6]=f):f=e[6];let b;e[7]!==u||e[8]!==f?(b=t.jsxs("div",{className:"flex-1 min-w-0",children:[u,f]}),e[7]=u,e[8]=f,e[9]=b):b=e[9];let m;e[10]!==h||e[11]!==b?(m=t.jsx("div",{className:"p-6 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[h,b]})}),e[10]=h,e[11]=b,e[12]=m):m=e[12];let j;e[13]!==p?(j=M=>p(M),e[13]=p,e[14]=j):j=e[14];let v;e[15]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsxs(ye,{value:"tools",variant:"underline",className:"gap-2",children:[t.jsx(Ae,{size:16}),"Tools"]}),e[15]=v):v=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs(ye,{value:"resources",variant:"underline",className:"gap-2",children:[t.jsx(be,{size:16}),"Resources"]}),e[16]=C):C=e[16];let y;e[17]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsxs(Lt,{variant:"underline",className:"shrink-0 px-6",children:[v,C,t.jsxs(ye,{value:"prompts",variant:"underline",className:"gap-2",children:[t.jsx(De,{size:16}),"Prompts"]})]}),e[17]=y):y=e[17];let V;e[18]===Symbol.for("react.memo_cache_sentinel")?(V=ke("Tools not supported by this server"),e[18]=V):V=e[18];let R;e[19]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(Te,{}),e[19]=R):R=e[19];let T;e[20]!==i||e[21]!==l?(T=i[l]?i[l].tools:[],e[20]=i,e[21]=l,e[22]=T):T=e[22];let O;e[23]!==l||e[24]!==d?(O=(M,q)=>d(l,M,q),e[23]=l,e[24]=d,e[25]=O):O=e[25];let S;e[26]!==l||e[27]!==c?(S=()=>c(l),e[26]=l,e[27]=c,e[28]=S):S=e[28];let w;e[29]!==l||e[30]!==T||e[31]!==O||e[32]!==S?(w=t.jsx(Ce,{value:"tools",className:"flex-1 overflow-hidden mt-0",children:t.jsx(fe,{fallback:V,children:t.jsx(_.Suspense,{fallback:R,children:t.jsx(Qt,{connectionId:l,selections:T,onToggle:O,onToggleAll:S})})})}),e[29]=l,e[30]=T,e[31]=O,e[32]=S,e[33]=w):w=e[33];let z;e[34]===Symbol.for("react.memo_cache_sentinel")?(z=ke("Resources not supported by this server"),e[34]=z):z=e[34];let $;e[35]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Te,{}),e[35]=$):$=e[35];let I;e[36]!==i||e[37]!==l?(I=i[l]?i[l].resources:[],e[36]=i,e[37]=l,e[38]=I):I=e[38];let D;e[39]!==l||e[40]!==a?(D=(M,q)=>a(l,M,q),e[39]=l,e[40]=a,e[41]=D):D=e[41];let A;e[42]!==l||e[43]!==x?(A=()=>x(l),e[42]=l,e[43]=x,e[44]=A):A=e[44];let E;e[45]!==l||e[46]!==I||e[47]!==D||e[48]!==A?(E=t.jsx(Ce,{value:"resources",className:"flex-1 overflow-hidden mt-0",children:t.jsx(fe,{fallback:z,children:t.jsx(_.Suspense,{fallback:$,children:t.jsx(es,{connectionId:l,selections:I,onToggle:D,onToggleAll:A})})})}),e[45]=l,e[46]=I,e[47]=D,e[48]=A,e[49]=E):E=e[49];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=ke("Prompts not supported by this server"),e[50]=B):B=e[50];let P;e[51]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Te,{}),e[51]=P):P=e[51];let K;e[52]!==i||e[53]!==l?(K=i[l]?i[l].prompts:[],e[52]=i,e[53]=l,e[54]=K):K=e[54];let H;e[55]!==l||e[56]!==r?(H=(M,q)=>r(l,M,q),e[55]=l,e[56]=r,e[57]=H):H=e[57];let W;e[58]!==l||e[59]!==g?(W=()=>g(l),e[58]=l,e[59]=g,e[60]=W):W=e[60];let U;e[61]!==l||e[62]!==K||e[63]!==H||e[64]!==W?(U=t.jsx(Ce,{value:"prompts",className:"flex-1 overflow-hidden mt-0",children:t.jsx(fe,{fallback:B,children:t.jsx(_.Suspense,{fallback:P,children:t.jsx(ss,{connectionId:l,selections:K,onToggle:H,onToggleAll:W})})})}),e[61]=l,e[62]=K,e[63]=H,e[64]=W,e[65]=U):U=e[65];let Y;e[66]!==n||e[67]!==w||e[68]!==E||e[69]!==U||e[70]!==j?(Y=t.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:t.jsxs(zt,{value:n,onValueChange:j,variant:"underline",className:"flex-1 flex flex-col overflow-hidden",children:[y,w,E,U]})}),e[66]=n,e[67]=w,e[68]=E,e[69]=U,e[70]=j,e[71]=Y):Y=e[71];let Z;return e[72]!==Y||e[73]!==m?(Z=t.jsxs(t.Fragment,{children:[m,Y]}),e[72]=Y,e[73]=m,e[74]=Z):Z=e[74],Z}function as(o){const e={};for(const s of o)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function we(o){return Object.entries(o).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function cs(o,e){switch(e.type){case"SET_SEARCH_TERM":return{...o,searchTerm:e.payload};case"SET_SELECTED":return{...o,selectedId:e.payload};case"SET_ACTIVE_TAB":return{...o,activeTab:e.payload};case"RESET":return{searchTerm:"",selectedId:e.payload.selectedId??e.payload.firstConnectionId??null,activeTab:"tools"};case"SELECT_CONNECTION":return{...o,selectedId:e.payload,activeTab:"tools"};default:return o}}const ds=(o,e)=>o.find(s=>s.id===e)??o[0];function ms(o){const e=k.c(77),{open:s,onOpenChange:n,selectedId:l,form:i,connections:d}=o;let a;e[0]!==l?(a={activeTab:"tools",searchTerm:"",selectedId:l},e[0]=l,e[1]=a):a=e[1];const[r,c]=_.useReducer(cs,a),x=_.useDeferredValue(r.searchTerm);let g;e[2]!==x?(g={searchTerm:x},e[2]=x,e[3]=g):g=e[3];const p=ht(g);let h;e[4]!==d?(h=d??[],e[4]=d,e[5]=h):h=e[5];let u;e[6]!==h?(u=as(h),e[6]=h,e[7]=u):u=e[7];const f=u;let b;e[8]!==p||e[9]!==r.selectedId?(b=ds(p,r.selectedId),e[8]=p,e[9]=r.selectedId,e[10]=b):b=e[10];const m=b,j=m?.id??null;let v;e[11]!==f?(v=N=>Yt(f,N),e[11]=f,e[12]=v):v=e[12];const C=v;let y;e[13]!==f?(y=N=>Wt(f,N),e[13]=f,e[14]=y):y=e[14];const V=y;let R;e[15]!==i||e[16]!==f?(R=(N,L,F,Q)=>{const ie=f[N]?.[L];let G;ie===null?G=Q.filter(Ne=>Ne!==F):ie?.includes(F)?G=ie.filter(Ne=>Ne!==F):(G=[...ie??[],F],G.length===Q.length&&(G=null));const re={...f};re[N]?re[N]={...re[N]}:re[N]={tools:null,resources:null,prompts:null},re[N][L]=G,i.setValue("connections",we(re),{shouldDirty:!0,shouldTouch:!0})},e[15]=i,e[16]=f,e[17]=R):R=e[17];const T=R;let O;e[18]!==i||e[19]!==f?(O=(N,L)=>{const ie=f[N]?.[L]===null?[]:null,G={...f};G[N]?G[N]={...G[N]}:G[N]={tools:null,resources:null,prompts:null},G[N][L]=ie,i.setValue("connections",we(G),{shouldDirty:!0,shouldTouch:!0})},e[18]=i,e[19]=f,e[20]=O):O=e[20];const S=O;let w;e[21]!==T?(w=(N,L,F)=>T(N,"tools",L,F),e[21]=T,e[22]=w):w=e[22];const z=w;let $;e[23]!==T?($=(N,L,F)=>T(N,"resources",L,F),e[23]=T,e[24]=$):$=e[24];const I=$;let D;e[25]!==T?(D=(N,L,F)=>T(N,"prompts",L,F),e[25]=T,e[26]=D):D=e[26];const A=D;let E;e[27]!==S?(E=N=>S(N,"tools"),e[27]=S,e[28]=E):E=e[28];const B=E;let P;e[29]!==S?(P=N=>S(N,"resources"),e[29]=S,e[30]=P):P=e[30];const K=P;let H;e[31]!==S?(H=N=>S(N,"prompts"),e[31]=S,e[32]=H):H=e[32];const W=H;let U;e[33]!==i||e[34]!==f?(U=N=>{const L=f[N],F=L&&L.tools===null&&L.resources===null&&L.prompts===null,Q={...f};F?delete Q[N]:Q[N]=qt,i.setValue("connections",we(Q),{shouldDirty:!0,shouldTouch:!0})},e[33]=i,e[34]=f,e[35]=U):U=e[35];const Y=U;let Z;e[36]!==p||e[37]!==n||e[38]!==l?(Z=N=>{N&&c({type:"RESET",payload:{selectedId:l,firstConnectionId:p[0]?.id??null}}),n(N)},e[36]=p,e[37]=n,e[38]=l,e[39]=Z):Z=e[39];const M=Z;let q;e[40]===Symbol.for("react.memo_cache_sentinel")?(q=N=>{c({type:"SELECT_CONNECTION",payload:N})},e[40]=q):q=e[40];const Je=q;let me;e[41]===Symbol.for("react.memo_cache_sentinel")?(me=N=>c({type:"SET_SEARCH_TERM",payload:N}),e[41]=me):me=e[41];let X;e[42]!==r.searchTerm?(X=t.jsx(dt,{value:r.searchTerm,onChange:me,placeholder:"Search connections..."}),e[42]=r.searchTerm,e[43]=X):X=e[43];let ee;e[44]!==p||e[45]!==r.searchTerm||e[46]!==j||e[47]!==V||e[48]!==C||e[49]!==Y?(ee=t.jsx("div",{className:"flex-1 overflow-auto p-2",children:t.jsx(is,{allConnections:p,searchTerm:r.searchTerm,selectedId:j,hasSelections:C,getSelectionSummary:V,onConnectionClick:Je,onToggleAll:Y})}),e[44]=p,e[45]=r.searchTerm,e[46]=j,e[47]=V,e[48]=C,e[49]=Y,e[50]=ee):ee=e[50];let te;e[51]!==X||e[52]!==ee?(te=t.jsxs("div",{className:"w-full sm:w-72 sm:border-r border-b sm:border-b-0 border-border flex flex-col bg-background sm:h-full max-h-[40vh] sm:max-h-full",children:[X,ee]}),e[51]=X,e[52]=ee,e[53]=te):te=e[53];let se;e[54]!==m||e[55]!==r.activeTab||e[56]!==j||e[57]!==f||e[58]!==W||e[59]!==K||e[60]!==B||e[61]!==A||e[62]!==I||e[63]!==z?(se=t.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:m&&j?t.jsx(rs,{currentConnection:m,activeTab:r.activeTab,selectedId:j,formData:f,toggleTool:z,toggleResource:I,togglePrompt:A,toggleAllTools:B,toggleAllResources:K,toggleAllPrompts:W,onTabChange:N=>c({type:"SET_ACTIVE_TAB",payload:N})},j):t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Select a connection to view its tools, resources, and prompts"})}),e[54]=m,e[55]=r.activeTab,e[56]=j,e[57]=f,e[58]=W,e[59]=K,e[60]=B,e[61]=A,e[62]=I,e[63]=z,e[64]=se):se=e[64];let le;e[65]!==te||e[66]!==se?(le=t.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0 flex-col sm:flex-row",children:[te,se]}),e[65]=te,e[66]=se,e[67]=le):le=e[67];let oe;e[68]!==M?(oe=t.jsx(Ot,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(J,{variant:"outline",onClick:()=>M(!1),children:"Done"})}),e[68]=M,e[69]=oe):oe=e[69];let ne;e[70]!==le||e[71]!==oe?(ne=t.jsxs(Ue,{className:"sm:max-w-5xl h-[80vh] max-h-[80vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[le,oe]}),e[70]=le,e[71]=oe,e[72]=ne):ne=e[72];let ue;return e[73]!==M||e[74]!==s||e[75]!==ne?(ue=t.jsx(Ke,{open:s,onOpenChange:M,children:ne}),e[73]=M,e[74]=s,e[75]=ne,e[76]=ue):ue=e[76],ue}const us=Qe.pick({title:!0,description:!0,icon:!0,status:!0,metadata:!0,connections:!0}).extend({title:Xe().min(1,"Name is required").max(255)});function fs(o){const e=k.c(8);let s,n;e[0]!==o?({className:s,...n}=o,e[0]=o,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let l;e[3]!==s?(l=ae("grid gap-3",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==n||e[6]!==l?(i=t.jsx(Ft,{"data-slot":"radio-group",className:l,...n}),e[5]=n,e[6]=l,e[7]=i):i=e[7],i}function Ee(o){const e=k.c(9);let s,n;e[0]!==o?({className:s,...n}=o,e[0]=o,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let l;e[3]!==s?(l=ae("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Gt,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(Ye,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=i):i=e[5];let d;return e[6]!==n||e[7]!==l?(d=t.jsx(Bt,{"data-slot":"radio-group-item",className:l,...n,children:i}),e[6]=n,e[7]=l,e[8]=d):d=e[8],d}function ps(o){const s=new TextEncoder().encode(o),n=Array.from(s,l=>String.fromCharCode(l)).join("");return btoa(n)}function xs(o){const e=k.c(10),{url:s}=o,[n,l]=_.useState(!1);let i;e[0]!==s?(i=async()=>{await navigator.clipboard.writeText(s),l(!0),ce.success("Agent URL copied to clipboard"),setTimeout(()=>l(!1),2e3)},e[0]=s,e[1]=i):i=e[1];const d=i;let a;e[2]!==n?(a=n?t.jsx(je,{size:20,className:"text-green-600"}):t.jsx(Re,{size:20}),e[2]=n,e[3]=a):a=e[3];const r=n?"Copied!":"Copy URL";let c;e[4]!==r?(c=t.jsx("span",{className:"text-xs font-medium",children:r}),e[4]=r,e[5]=c):c=e[5];let x;return e[6]!==d||e[7]!==a||e[8]!==c?(x=t.jsxs(J,{type:"button",variant:"outline",onClick:d,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[a,c]}),e[6]=d,e[7]=a,e[8]=c,e[9]=x):x=e[9],x}function hs(o){const e=k.c(7),{url:s,serverName:n}=o;let l;e[0]!==n||e[1]!==s?(l=()=>{const c=We(n),g=ps(JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Cursor"}},null,2)),p=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(c)}&config=${encodeURIComponent(g)}`;window.open(p,"_blank"),ce.success("Opening Cursor...")},e[0]=n,e[1]=s,e[2]=l):l=e[2];const i=l;let d,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),a=t.jsx("span",{className:"text-xs font-medium",children:"Install on Cursor"}),e[3]=d,e[4]=a):(d=e[3],a=e[4]);let r;return e[5]!==i?(r=t.jsxs(J,{type:"button",variant:"outline",onClick:i,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[d,a]}),e[5]=i,e[6]=r):r=e[6],r}function gs(o){const e=k.c(11),{url:s,serverName:n}=o,[l,i]=_.useState(!1);let d;e[0]!==n||e[1]!==s?(d=async()=>{const p=We(n),u=JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Claude Code"}},null,2),f=`claude mcp add-json "${p}" '${u.replace(/'/g,"'\\''")}'`;await navigator.clipboard.writeText(f),i(!0),ce.success("Claude Code command copied to clipboard"),setTimeout(()=>i(!1),2e3)},e[0]=n,e[1]=s,e[2]=d):d=e[2];const a=d;let r;e[3]!==l?(r=l?t.jsx(je,{size:20,className:"text-green-600"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[3]=l,e[4]=r):r=e[4];const c=l?"Copied!":"Install on Claude";let x;e[5]!==c?(x=t.jsx("span",{className:"text-xs font-medium",children:c}),e[5]=c,e[6]=x):x=e[6];let g;return e[7]!==a||e[8]!==r||e[9]!==x?(g=t.jsxs(J,{type:"button",variant:"outline",onClick:a,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[r,x]}),e[7]=a,e[8]=r,e[9]=x,e[10]=g):g=e[10],g}function js({virtualMcp:o}){const{org:e}=de(),s=ge({connectionId:Rt,orgId:e.id}),[n,l]=_.useState(null),[i,d]=_.useState(!1),[a,r]=_.useState(!1),c=o.id,x=o.title||`agent-${c.slice(0,8)}`,g=n?`bunx @decocms/typegen@latest --mcp ${c} --key ${n} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${c} --key <api-key> --output client.ts`,p=async()=>{d(!0);try{const f=(await s.callTool({name:"API_KEY_CREATE",arguments:{name:`typegen-${x}`,permissions:{[c]:["*"]}}})).structuredContent?.key;if(!f)throw new Error("No key in response");l(f)}catch{ce.error("Failed to generate API key")}finally{d(!1)}},h=async()=>{await navigator.clipboard.writeText(g),r(!0),ce.success("Command copied to clipboard"),setTimeout(()=>r(!1),2e3)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:"Generate typed client"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Introspects this agent and writes a typed"," ",t.jsx("code",{className:"font-mono",children:"client.ts"})," you can import directly."]})]}),!n&&t.jsxs(J,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:p,disabled:i,children:[i?t.jsx(Le,{size:14,className:"animate-spin"}):t.jsx(Ut,{size:14}),t.jsx("span",{children:i?"Generating…":"Generate API key"})]})]}),n&&t.jsx("p",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-700",children:"Store this key securely — it won't be shown again."}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Generate client"}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:g}),t.jsx(J,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:h,children:a?t.jsx(je,{size:12,className:"text-green-600"}):t.jsx(Re,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Runtime variables"}),t.jsx(bs,{apiKey:n})]})}function bs(o){const e=k.c(19),{apiKey:s}=o,[n,l]=_.useState(!1),i=window.location.origin,d=s?`MESH_API_KEY=${s}`:"MESH_API_KEY=<api-key>",a=`MESH_BASE_URL=${i}`,r=`${d}
|
|
2
|
-
${a}`;let c;e[0]!==r?(c=async()=>{await navigator.clipboard.writeText(r),l(!0),setTimeout(()=>l(!1),2e3)},e[0]=r,e[1]=c):c=e[1];const x=c,g=!s;let p;e[2]!==g?(p=ae({"opacity-50":g}),e[2]=g,e[3]=p):p=e[3];let h;e[4]!==d||e[5]!==p?(h=t.jsx("span",{className:p,children:d}),e[4]=d,e[5]=p,e[6]=h):h=e[6];let u,f;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("br",{}),f=t.jsx("span",{children:a}),e[7]=u,e[8]=f):(u=e[7],f=e[8]);let b;e[9]!==h?(b=t.jsxs("code",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:[h,u,f]}),e[9]=h,e[10]=b):b=e[10];let m;e[11]!==n?(m=n?t.jsx(je,{size:12,className:"text-green-600"}):t.jsx(Re,{size:12}),e[11]=n,e[12]=m):m=e[12];let j;e[13]!==x||e[14]!==m?(j=t.jsx(J,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:x,children:m}),e[13]=x,e[14]=m,e[15]=j):j=e[15];let v;return e[16]!==b||e[17]!==j?(v=t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[b,j]})}),e[16]=b,e[17]=j,e[18]=v):v=e[18],v}function Ns(o){const e=k.c(3),{virtualMcp:s}=o;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=n):n=e[0];let l;return e[1]!==s?(l=t.jsx(_.Suspense,{fallback:n,children:t.jsx(js,{virtualMcp:s})}),e[1]=s,e[2]=l):l=e[2],l}function vs(o){const e=k.c(44),{open:s,onOpenChange:n,virtualMcp:l}=o,[i,d]=_.useState("code_execution");let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=P=>{(P==="passthrough"||P==="smart_tool_selection"||P==="code_execution")&&d(P)},e[0]=a):a=e[0];const r=a;let c;e[1]!==i||e[2]!==l.id?(c=new URL(`/mcp/virtual-mcp/${l.id}`,window.location.origin),c.searchParams.set("mode",i),e[1]=i,e[2]=l.id,e[3]=c):c=e[3];let x;e[4]!==l.id||e[5]!==l.title?(x=l.title||`agent-${l.id?.slice(0,8)??"default"}`,e[4]=l.id,e[5]=l.title,e[6]=x):x=e[6];const g=x;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx($t,{children:t.jsx(Dt,{children:"Connect"})}),e[7]=p):p=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mt-1",children:"How should this agent work?"})}),e[8]=h):h=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(nt,{className:"size-5 text-muted-foreground"})}),e[9]=u):u=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Direct access"}),e[10]=f):f=e[10];let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(pe,{asChild:!0,children:t.jsx(_e,{className:"size-3.5 text-muted-foreground"})}),e[11]=b):b=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("label",{htmlFor:"mode-passthrough",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[u,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[f,t.jsx(ve,{children:t.jsxs(xe,{children:[b,t.jsx(he,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"All tools are exposed directly via tools/list. Best for small tool surfaces with deterministic behavior."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Best for small teams or when you need predictable behavior"})]}),t.jsx(Ee,{id:"mode-passthrough",value:"passthrough"})]}),e[12]=m):m=e[12];let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(it,{className:"size-5 text-muted-foreground"})}),e[13]=j):j=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart discovery"}),e[14]=v):v=e[14];let C;e[15]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(pe,{asChild:!0,children:t.jsx(_e,{className:"size-3.5 text-muted-foreground"})}),e[15]=C):C=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsxs("label",{htmlFor:"mode-smart",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[j,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[v,t.jsx(ve,{children:t.jsxs(xe,{children:[C,t.jsx(he,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Uses meta-tools (GATEWAY_SEARCH_TOOLS, GATEWAY_DESCRIBE_TOOLS, GATEWAY_CALL_TOOL) to keep the tool list small and request details on demand."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Ideal for large teams with many tools - AI finds what it needs"})]}),t.jsx(Ee,{id:"mode-smart",value:"smart_tool_selection"})]}),e[16]=y):y=e[16];let V;e[17]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Ht,{className:"size-5 text-muted-foreground"})}),e[17]=V):V=e[17];let R;e[18]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart execution"}),e[18]=R):R=e[18];let T;e[19]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(pe,{asChild:!0,children:t.jsx(_e,{className:"size-3.5 text-muted-foreground"})}),e[19]=T):T=e[19];let O;e[20]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs("label",{htmlFor:"mode-code",className:"relative flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[V,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[R,t.jsx(ve,{children:t.jsxs(xe,{children:[T,t.jsx(he,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Exposes meta-tools for discovery + sandboxed execution (GATEWAY_RUN_CODE). Reduces overhead on large surfaces by shifting work into a controlled runtime."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Maximum flexibility - AI can write code to orchestrate tools"})]}),t.jsx(Ee,{id:"mode-code",value:"code_execution"}),t.jsx($e,{variant:"outline",className:"absolute -top-2.5 left-1/2 -translate-x-1/2 bg-background z-10",children:"Recommended"})]}),e[20]=O):O=e[20];let S;e[21]!==i?(S=t.jsxs("div",{className:"flex flex-col gap-3",children:[h,t.jsxs(fs,{value:i,onValueChange:r,className:"flex flex-col gap-4.5",children:[m,y,O]})]}),e[21]=i,e[22]=S):S=e[22];let w;e[23]!==c.href?(w=t.jsx(xs,{url:c.href}),e[23]=c.href,e[24]=w):w=e[24];let z,$;e[25]!==g||e[26]!==c.href?(z=t.jsx(hs,{url:c.href,serverName:g}),$=t.jsx(gs,{url:c.href,serverName:g}),e[25]=g,e[26]=c.href,e[27]=z,e[28]=$):(z=e[27],$=e[28]);let I;e[29]!==w||e[30]!==z||e[31]!==$?(I=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[w,z,$]})}),e[29]=w,e[30]=z,e[31]=$,e[32]=I):I=e[32];let D;e[33]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx("div",{className:"border-t border-border"}),e[33]=D):D=e[33];let A;e[34]!==l?(A=t.jsx(Ns,{virtualMcp:l}),e[34]=l,e[35]=A):A=e[35];let E;e[36]!==S||e[37]!==I||e[38]!==A?(E=t.jsxs(Ue,{className:"max-h-[80vh] overflow-y-auto sm:max-w-2xl",children:[p,t.jsxs("div",{className:"flex flex-col gap-6",children:[S,I,D,A]})]}),e[36]=S,e[37]=I,e[38]=A,e[39]=E):E=e[39];let B;return e[40]!==n||e[41]!==s||e[42]!==E?(B=t.jsx(Ke,{open:s,onOpenChange:n,children:E}),e[40]=n,e[41]=s,e[42]=E,e[43]=B):B=e[43],B}function ys(o,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...o,shareDialogOpen:e.payload};case"SET_CONNECTION_DIALOG_OPEN":return{...o,connectionDialogOpen:e.payload};case"SET_EDITING_CONNECTION_ID":return{...o,editingConnectionId:e.payload};case"SET_SKILLS_OPEN":return{...o,skillsOpen:e.payload};default:return o}}function Ie(o){const e=k.c(27),{connection_id:s,selected_tools:n,selected_resources:l,selected_prompts:i,onClick:d}=o,a=gt(s);if(!a)return null;let r;e[0]!==n?(r=Se(n),e[0]=n,e[1]=r):r=e[1];const c=r;let x;e[2]!==l?(x=Se(l),e[2]=l,e[3]=x):x=e[3];const g=x;let p;e[4]!==i?(p=Se(i),e[4]=i,e[5]=p):p=e[5];const h=p;let u;e[6]!==a.icon||e[7]!==a.title?(u=t.jsx(Oe,{icon:a.icon,name:a.title,size:"xs"}),e[6]=a.icon,e[7]=a.title,e[8]=u):u=e[8];let f;e[9]!==a.title?(f=t.jsx("p",{className:"flex-1 text-sm font-normal text-foreground truncate",children:a.title}),e[9]=a.title,e[10]=f):f=e[10];let b;e[11]!==c?(b=c!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:c==="all"?"all":c}),t.jsx(Ae,{size:12})]}),e[11]=c,e[12]=b):b=e[12];let m;e[13]!==g?(m=g!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:g==="all"?"all":g}),t.jsx(be,{size:12})]}),e[13]=g,e[14]=m):m=e[14];let j;e[15]!==h?(j=h!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:h==="all"?"all":h}),t.jsx(De,{size:12})]}),e[15]=h,e[16]=j):j=e[16];let v;e[17]!==b||e[18]!==m||e[19]!==j?(v=t.jsxs($e,{variant:"secondary",className:"bg-muted h-5 gap-2 px-1.5 py-1 flex items-center",children:[b,m,j]}),e[17]=b,e[18]=m,e[19]=j,e[20]=v):v=e[20];let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(He,{size:16,className:"text-muted-foreground shrink-0"}),e[21]=C):C=e[21];let y;return e[22]!==d||e[23]!==u||e[24]!==f||e[25]!==v?(y=t.jsxs("div",{onClick:d,className:"w-full h-12 flex items-center gap-2 px-3 rounded-lg border border-border hover:bg-accent/50 transition-colors cursor-pointer",children:[u,f,v,C]}),e[22]=d,e[23]=u,e[24]=f,e[25]=v,e[26]=y):y=e[26],y}Ie.Fallback=function(){return t.jsxs("div",{className:"w-full h-12 flex items-center gap-2 px-3 rounded-lg border border-border",children:[t.jsx("div",{className:"size-5 rounded bg-muted animate-pulse shrink-0"}),t.jsx("div",{className:"flex-1 h-4 rounded bg-muted animate-pulse"}),t.jsxs($e,{variant:"secondary",className:"bg-muted h-5 gap-2 px-1.5 py-1 flex items-center",children:[t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(Ae,{size:12})]}),t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(be,{size:12})]}),t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(De,{size:12})]})]}),t.jsx(He,{size:16,className:"text-muted-foreground shrink-0"})]})};function Cs({virtualMcp:o}){const{org:e}=de(),s=bt(),n=st({resolver:lt(us),defaultValues:o}),l=n.watch("connections"),[i,d]=_.useReducer(ys,{shareDialogOpen:!1,connectionDialogOpen:!1,editingConnectionId:null,skillsOpen:!1}),[,a]=ft(),{setVirtualMcpId:r}=rt();_.useEffect(()=>{a(!0),r(o.id)},[o.id]);const c=()=>{r(o.id),a(!0)},x=n.formState.isDirty,g=async()=>{const m=n.getValues(),j=await s.update.mutateAsync({id:o.id,data:m});n.reset(j)},p=()=>{n.reset(o)},h=()=>{d({type:"SET_EDITING_CONNECTION_ID",payload:null}),d({type:"SET_CONNECTION_DIALOG_OPEN",payload:!0})},u=m=>{d({type:"SET_EDITING_CONNECTION_ID",payload:m}),d({type:"SET_CONNECTION_DIALOG_OPEN",payload:!0})},f=s.update.isPending,b=t.jsx(Ct,{children:t.jsxs(_t,{children:[t.jsx(Fe,{children:t.jsx(St,{asChild:!0,children:t.jsx(ot,{to:"/$org/$project/agents",params:{org:e.slug,project:Ge},children:"Agents"})})}),t.jsx(Tt,{}),t.jsx(Fe,{children:t.jsx(kt,{children:o.title})})]})});return t.jsxs(wt,{breadcrumb:b,children:[t.jsxs(Et,{children:[t.jsx(It,{onSave:g,onUndo:p,isDirty:x,isSaving:f}),t.jsxs(xe,{delayDuration:0,children:[t.jsx(pe,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsxs(J,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 border border-input",onClick:c,"aria-label":"Test Agent",children:[t.jsx(vt,{size:14}),"Test Agent"]})})}),t.jsx(he,{side:"bottom",children:"Test this agent in chat"})]}),t.jsxs(J,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 border border-input",onClick:()=>d({type:"SET_SHARE_DIALOG_OPEN",payload:!0}),children:[t.jsx(qe,{size:14}),"Connect"]})]}),t.jsx("div",{className:"flex h-full w-full bg-background overflow-auto",children:t.jsxs("div",{className:"flex flex-col w-full",children:[t.jsxs("div",{className:"flex items-start justify-between gap-4 p-6 shrink-0",children:[t.jsxs("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[t.jsx(Me,{control:n.control,name:"icon",render:({field:m})=>t.jsx(ut,{value:m.value,onChange:m.onChange,name:n.watch("title")||"Agent",size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(yt,{})})}),t.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[t.jsx(Ve,{...n.register("title"),className:"h-auto py-0.5 text-lg! font-medium leading-7 px-1 -mx-1 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Agent Name"}),t.jsx(Ve,{...n.register("description"),className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-1 -mx-1 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})]})]}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(pt,{checked:n.watch("status")==="active",onCheckedChange:m=>n.setValue("status",m?"active":"inactive",{shouldDirty:!0})})})]}),t.jsxs(at,{open:i.skillsOpen,onOpenChange:m=>d({type:"SET_SKILLS_OPEN",payload:m}),className:"border-t border-border shrink-0 max-h-[400px] overflow-hidden flex flex-col",children:[l.length===0?t.jsxs("button",{type:"button",onClick:h,className:"w-full flex items-center justify-between px-6 py-4 hover:bg-muted/50 transition-colors cursor-pointer",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Skills"}),t.jsxs("div",{className:"h-7 px-2 inline-flex items-center justify-center gap-1 rounded-md text-sm text-muted-foreground",children:[t.jsx(Be,{size:14}),"Add"]})]}):t.jsx(ct,{asChild:!0,children:t.jsxs("button",{type:"button",className:"w-full flex items-center justify-between px-6 py-4 hover:bg-muted/50 transition-colors cursor-pointer",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Skills"}),t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"ease-(--ease-out-expo)",style:{width:i.skillsOpen?0:"auto",marginRight:i.skillsOpen?0:4,opacity:i.skillsOpen?0:1,pointerEvents:i.skillsOpen?"none":"auto",transitionProperty:"all",transitionDuration:i.skillsOpen?"0ms":"200ms"},children:t.jsx(Kt,{connectionIds:l.map(m=>m.connection_id),maxVisibleIcons:2})}),t.jsxs("div",{role:"button",tabIndex:0,className:"h-7 inline-flex items-center justify-center rounded-md text-sm text-muted-foreground overflow-hidden transition-all duration-200 ease-(--ease-out-expo) hover:bg-accent hover:text-accent-foreground",style:{width:i.skillsOpen?"auto":28,paddingLeft:i.skillsOpen?8:0,paddingRight:i.skillsOpen?8:0,gap:i.skillsOpen?4:0},onPointerDown:m=>{m.stopPropagation()},onClick:m=>{m.stopPropagation(),m.preventDefault(),h()},onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.stopPropagation(),m.preventDefault(),h())},children:[t.jsx(Be,{size:14,className:"shrink-0"}),t.jsx("span",{className:"overflow-hidden whitespace-nowrap transition-all duration-200 ease-(--ease-out-expo)",style:{width:i.skillsOpen?"auto":0,opacity:i.skillsOpen?1:0},children:"Add"})]}),t.jsx("div",{className:"h-7 inline-flex items-center justify-center overflow-hidden transition-all duration-200 ease-(--ease-out-expo)",style:{width:i.skillsOpen?28:0,opacity:i.skillsOpen?1:0},children:t.jsx(Nt,{size:16,className:"shrink-0"})})]})]})}),t.jsx("div",{className:"grid overflow-hidden transition-[grid-template-rows] duration-200 ease-(--ease-out-expo)",style:{gridTemplateRows:i.skillsOpen?"1fr":"0fr"},children:t.jsx("div",{className:"min-h-0 overflow-hidden",children:t.jsx("div",{className:"overflow-y-auto max-h-[300px] mask-[linear-gradient(to_bottom,black_calc(100%-40px),transparent_100%)]",children:t.jsx("div",{className:"flex flex-col gap-2 px-6 pb-4 pt-2",children:l.map(m=>t.jsx(_.Suspense,{fallback:t.jsx(Ie.Fallback,{}),children:t.jsx(Ie,{connection_id:m.connection_id,selected_tools:m.selected_tools,selected_resources:m.selected_resources,selected_prompts:m.selected_prompts,onClick:()=>u(m.connection_id)})},m.connection_id))})})})})]}),t.jsxs("div",{className:"flex flex-col flex-1 p-6 border-t border-border overflow-auto",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Instructions"}),t.jsx(Me,{name:"metadata.instructions",control:n.control,render:({field:m})=>t.jsx(xt,{...m,value:m.value??"",placeholder:"Write instructions here...",className:"min-h-[200px] resize-none text-sm placeholder:text-muted-foreground/50 leading-relaxed border-0 rounded-none shadow-none px-0 focus-visible:ring-0 focus-visible:ring-offset-0 focus:border-0 bg-transparent"})})]})]})}),t.jsx(ms,{open:i.connectionDialogOpen,onOpenChange:m=>d({type:"SET_CONNECTION_DIALOG_OPEN",payload:m}),selectedId:i.editingConnectionId,form:n,connections:l}),t.jsx(vs,{open:i.shareDialogOpen,onOpenChange:m=>d({type:"SET_SHARE_DIALOG_OPEN",payload:m}),virtualMcp:o})]})}function _s(){const o=k.c(6),e=et();let s;o[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/$project/agents/$agentId"},o[0]=s):s=o[0];const n=tt(s),{org:l,agentId:i}=n,d=jt(i);if(!d){let r;return o[1]!==e||o[2]!==l?(r=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(mt,{title:"Agent not found",description:"This Agent may have been deleted or you may not have access.",actions:t.jsx(J,{variant:"outline",onClick:()=>e({to:"/$org/$project/agents",params:{org:l,project:Ge}}),children:"Back to agents"})})}),o[1]=e,o[2]=l,o[3]=r):r=o[3],r}let a;return o[4]!==d?(a=t.jsx(Cs,{virtualMcp:d}),o[4]=d,o[5]=a):a=o[5],a}function ql(){const o=k.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(fe,{children:t.jsx(_.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(_s,{})})}),o[0]=e):e=o[0],e}export{ql as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ie,j as t,E as ne,r as X,u as ae,b as le,B as q,O as V}from"./index-B_0vsVr1.js";import{C as ce}from"./collection-display-button-M7dfC2Rf.js";import{C as de,E as Q}from"./collection-search-q4T1hb73.js";import{P as j}from"./index-QCmdl8uj.js";import{B as me,a as pe,b as ue,c as ge}from"./breadcrumb-CGrLS5HH.js";import{C as he}from"./collection-table-wrapper-DXH0yXJC.js";import{C as fe}from"./connection-card-DTiOZbAC.js";import{I as xe}from"./integration-icon-DAFtApWT.js";import{u as je}from"./use-list-state-ykkfYLR3.js";import{u as Ce}from"./use-create-virtual-mcp-DB14T-Ft.js";import{i as be}from"./constants-D9bRXDQp.js";import{b as ye,a as we}from"./use-virtual-mcp-OwU65kyR.js";import{c as Ne,b as De,d as Se,A as _e,e as ke,h as ve,a as Ae,f as Ie}from"./alert-dialog-D3oCqQtu.js";import{D as Y,a as Z,b as ee,c as R}from"./dropdown-menu-CSqO4Mxn.js";import{i as te}from"./DotsVertical-DHxrk-2J.js";import{s as se}from"./Eye-C_LYW9jG.js";import{i as Pe}from"./Loading01-B3gOoSbd.js";import{s as oe}from"./Trash01-HuK-pEft.js";import{t as C}from"./Users03-CPWgVi4r.js";import{U as $e}from"./user-C73vNaiS.js";import{A as re}from"./agent-connections-preview-BsjSZYGn.js";import{f as ze}from"./format-time-CMKyl-GC.js";import"./ArrowDown-BXCgJapO.js";import"./ArrowUp-B3tPpNuu.js";import"./Check-G22LpKFd.js";import"./Grid01-DTf5JuyC.js";import"./List-DJEz6yKj.js";import"./tooltip-Cz-bAWiO.js";import"./index-CvEIDmnk.js";import"./badge-CxJArm69.js";import"./SearchMd-Cpf31N-H.js";import"./input-CW7SVowR.js";import"./localstorage-keys-BAzeyS9J.js";import"./useQuery-DcRkCB2j.js";import"./useMutation-lBFQDcxE.js";import"./ChevronRight-BT7U8Kip.js";import"./table-RFgqEt_E.js";import"./card-CAORA3L1.js";import"./Container-CyEPuAYL.js";import"./use-view-mode-DyK0fMBe.js";import"./use-mobile-B2VAoWT2.js";import"./use-collections-vccihohV.js";import"./avatar-rYlL0ZoJ.js";import"./use-connection-DeEn4qfI.js";import"./differenceInSeconds-NQ4PDo0z.js";function Me(e,r){switch(r.type){case"delete":return{mode:"deleting",virtualMcp:r.virtualMcp};case"close":return{mode:"idle"}}}function Be(){const e=ie.c(65),{org:r}=ae(),n=le();let b;e[0]!==r.slug?(b={namespace:r.slug,resource:"agents"},e[0]=r.slug,e[1]=b):b=e[1];const s=je(b),x=ye(s);let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y={navigateOnCreate:!0},e[2]=y):y=e[2];const{createVirtualMCP:T,isCreating:w}=Ce(y),U=we();let N;e[3]===Symbol.for("react.memo_cache_sentinel")?(N={mode:"idle"},e[3]=N):N=e[3];const[i,D]=X.useReducer(Me,N);let S;e[4]!==U||e[5]!==i.mode||e[6]!==i.virtualMcp?(S=async()=>{if(i.mode!=="deleting")return;const o=i.virtualMcp.id;if(D({type:"close"}),!(!o||be(o)))try{await U.delete.mutateAsync(o)}catch{}},e[4]=U,e[5]=i.mode,e[6]=i.virtualMcp,e[7]=S):S=e[7];const L=S;let _,k,v,A,I;e[8]===Symbol.for("react.memo_cache_sentinel")?(_={id:"title",header:"Name",render:Fe,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},k={id:"description",header:"Description",render:He,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},v={id:"connections",header:"Connections",render:Ue,cellClassName:"w-28 shrink-0"},A={id:"updated_by",header:"Updated by",render:Te,cellClassName:"w-32 shrink-0",sortable:!0},I={id:"updated_at",header:"Updated",render:Re,cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},e[8]=_,e[9]=k,e[10]=v,e[11]=A,e[12]=I):(_=e[8],k=e[9],v=e[10],A=e[11],I=e[12]);let P;e[13]!==n||e[14]!==r.slug?(P=[_,k,v,A,I,{id:"actions",header:"",render:o=>t.jsxs(Y,{children:[t.jsx(Z,{asChild:!0,children:t.jsx(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ve,children:t.jsx(te,{size:20})})}),t.jsxs(ee,{align:"end",onClick:Ke,children:[t.jsxs(R,{onClick:a=>{a.stopPropagation(),n({to:"/$org/$project/agents/$agentId",params:{org:r.slug,project:V,agentId:o.id}})},children:[t.jsx(se,{size:16}),"Open"]}),t.jsxs(R,{variant:"destructive",onClick:a=>{a.stopPropagation(),D({type:"delete",virtualMcp:o})},children:[t.jsx(oe,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[13]=n,e[14]=r.slug,e[15]=P):P=e[15];const H=P,F=w?"Creating...":"Create Agent";let $;e[16]!==T||e[17]!==w||e[18]!==F?($=t.jsx(q,{onClick:T,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:w,children:F}),e[16]=T,e[17]=w,e[18]=F,e[19]=$):$=e[19];const G=$,J=i.mode==="deleting";let z;e[20]===Symbol.for("react.memo_cache_sentinel")?(z=o=>!o&&D({type:"close"}),e[20]=z):z=e[20];let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Ne,{children:"Delete Agent?"}),e[21]=M):M=e[21];const W=i.mode==="deleting"&&i.virtualMcp.title;let l;e[22]!==W?(l=t.jsxs(De,{children:[M,t.jsxs(Se,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),e[22]=W,e[23]=l):l=e[23];let B;e[24]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(_e,{children:"Cancel"}),e[24]=B):B=e[24];let c;e[25]!==L?(c=t.jsxs(ke,{children:[B,t.jsx(ve,{onClick:L,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[25]=L,e[26]=c):c=e[26];let d;e[27]!==l||e[28]!==c?(d=t.jsxs(Ae,{children:[l,c]}),e[27]=l,e[28]=c,e[29]=d):d=e[29];let m;e[30]!==J||e[31]!==d?(m=t.jsx(Ie,{open:J,onOpenChange:z,children:d}),e[30]=J,e[31]=d,e[32]=m):m=e[32];let O;e[33]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(j.Header.Left,{children:t.jsx(me,{children:t.jsx(pe,{children:t.jsx(ue,{children:t.jsx(ge,{children:"Agents"})})})})}),e[33]=O):O=e[33];let E;e[34]===Symbol.for("react.memo_cache_sentinel")?(E=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],e[34]=E):E=e[34];let p;e[35]!==s.handleSort||e[36]!==s.setViewMode||e[37]!==s.sortDirection||e[38]!==s.sortKey||e[39]!==s.viewMode?(p=t.jsx(ce,{viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:E}),e[35]=s.handleSort,e[36]=s.setViewMode,e[37]=s.sortDirection,e[38]=s.sortKey,e[39]=s.viewMode,e[40]=p):p=e[40];let u;e[41]!==G||e[42]!==p?(u=t.jsxs(j.Header,{children:[O,t.jsxs(j.Header.Right,{children:[p,G]})]}),e[41]=G,e[42]=p,e[43]=u):u=e[43];let g;e[44]!==s?(g=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[44]=s,e[45]=g):g=e[45];let h;e[46]!==s.search||e[47]!==s.setSearch||e[48]!==g?(h=t.jsx(de,{value:s.search,onChange:s.setSearch,placeholder:"Search for an agent...",onKeyDown:g}),e[46]=s.search,e[47]=s.setSearch,e[48]=g,e[49]=h):h=e[49];let f;e[50]!==H||e[51]!==s.handleSort||e[52]!==s.search||e[53]!==s.sortDirection||e[54]!==s.sortKey||e[55]!==s.viewMode||e[56]!==n||e[57]!==r.slug||e[58]!==x?(f=t.jsx(j.Content,{children:s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:x.length===0?t.jsx(Q,{image:t.jsx(C,{size:36,className:"text-muted-foreground"}),title:s.search?"No agents found":"No agents yet",description:s.search?`No agents match "${s.search}"`:"Create an agent to aggregate tools from multiple Connections."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:x.map(o=>t.jsx(fe,{connection:{id:o.id??"",title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(C,{}),onClick:()=>n({to:"/$org/$project/agents/$agentId",params:{org:r.slug,project:V,agentId:o.id}}),footer:t.jsx("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:t.jsxs("span",{children:[o.connections.length," connection",o.connections.length!==1?"s":""]})}),headerActions:t.jsxs(Y,{children:[t.jsx(Z,{asChild:!0,children:t.jsx(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ee,children:t.jsx(te,{size:20})})}),t.jsxs(ee,{align:"end",onClick:Oe,children:[t.jsxs(R,{onClick:a=>{a.stopPropagation(),n({to:"/$org/$project/agents/$agentId",params:{org:r.slug,project:V,agentId:o.id}})},children:[t.jsx(se,{size:16}),"Open"]}),t.jsxs(R,{variant:"destructive",onClick:a=>{a.stopPropagation(),D({type:"delete",virtualMcp:o})},children:[t.jsx(oe,{size:16}),"Delete"]})]})]})},o.id??"default"))})}):t.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:t.jsx(he,{columns:H,data:x,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>n({to:"/$org/$project/agents/$agentId",params:{org:r.slug,project:V,agentId:o.id}}),emptyState:s.search?t.jsx(Q,{image:t.jsx(C,{size:36,className:"text-muted-foreground"}),title:"No agents found",description:`No agents match "${s.search}"`}):t.jsx(Q,{image:t.jsx(C,{size:36,className:"text-muted-foreground"}),title:"No agents yet",description:"Create an agent to aggregate tools from multiple Connections."})})})}),e[50]=H,e[51]=s.handleSort,e[52]=s.search,e[53]=s.sortDirection,e[54]=s.sortKey,e[55]=s.viewMode,e[56]=n,e[57]=r.slug,e[58]=x,e[59]=f):f=e[59];let K;return e[60]!==m||e[61]!==u||e[62]!==h||e[63]!==f?(K=t.jsxs(j,{children:[m,u,h,f]}),e[60]=m,e[61]=u,e[62]=h,e[63]=f,e[64]=K):K=e[64],K}function Oe(e){return e.stopPropagation()}function Ee(e){return e.stopPropagation()}function Ke(e){return e.stopPropagation()}function Ve(e){return e.stopPropagation()}function Re(e){return t.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:e.updated_at?ze(new Date(e.updated_at)):"—"})}function Te(e){return t.jsx($e,{id:e.updated_by??e.created_by,size:"3xs"})}function Ue(e){return t.jsx(X.Suspense,{fallback:t.jsx(re.Fallback,{}),children:t.jsx(re,{connectionIds:e.connections.map(Le),maxVisibleIcons:2})})}function Le(e){return e.connection_id}function He(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Fe(e){return t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(xe,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(C,{size:16})}),t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})]})}function Et(){const e=ie.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ne,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Pe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Be,{})})}),e[0]=r):r=e[0],r}export{Et as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as U,j as t,b as Ne,B as Ue,O as ge,aD as it,u as Be,q as gt,c0 as Qe,aB as jt,p as bt,r as X,o as at,bI as vt,bQ as Nt,s as z,bb as Ge,bc as yt,E as ct,e as _t,a as Ct,n as St,k as wt,l as Tt,i as kt,t as ve,K as Je}from"./index-B_0vsVr1.js";import{E as Z,C as ze}from"./collection-search-q4T1hb73.js";import{E as Pt,r as It,e as lt}from"./env-vars-editor-DDp7f4JN.js";import{g as Ke}from"./types-B46wd5bS.js";import{S as $t}from"./save-actions-eGQZXGI3.js";import{b as At,a as Vt}from"./use-binding-Dz1SRdBY.js";import{u as Mt,S as Dt}from"./index-BK6i23a9.js";import{u as Ot,a as dt}from"./use-connection-DeEn4qfI.js";import{u as mt}from"./constants-D9bRXDQp.js";import{d as Rt}from"./use-mcp-tools-BXihKxpu.js";import{b as Et}from"./use-mcp-resources-Rqzq7A0J.js";import{a as Lt}from"./decopilot-events-DHSwekTa.js";import{a as Ut}from"./mcp-oauth-D8pA0WRM.js";import{b as Ye,c as Ft,d as Bt,e as zt,B as Kt,a as Xt}from"./breadcrumb-CGrLS5HH.js";import{C as qt}from"./collection-tabs-BbVq4J-5.js";import{i as Oe}from"./Loading01-B3gOoSbd.js";import{V as Xe,a as Ht}from"./layout-CzVwolFw.js";import{C as Wt}from"./collection-tab-e-VwhAzh.js";import{I as Qt}from"./icon-picker-DevrZ9IQ.js";import{I as Re}from"./integration-icon-DAFtApWT.js";import{B as Fe}from"./badge-CxJArm69.js";import{D as Gt,a as Jt,b as Yt,c as Ze}from"./dropdown-menu-CSqO4Mxn.js";import{F as H,a as Zt,b as W,d as K,f as Q,c as Y,e as es}from"./form-C5R0_qWR.js";import{I as G}from"./input-CW7SVowR.js";import{S as et,a as tt,b as st,c as nt,d as q}from"./select-CYY4CENz.js";import{i as ut}from"./CheckCircle-Dl3Eh5mw.js";import{t as ts}from"./ChevronDown-DAk1F2Sn.js";import{n as ss}from"./Container-CyEPuAYL.js";import{s as De}from"./Globe02-X-Xm1ngz.js";import{s as ns}from"./RefreshCcw01-v6pXwg6P.js";import{i as os}from"./Terminal-BS-6VR5p.js";import{s as rs}from"./Trash01-HuK-pEft.js";import{t as qe}from"./Users03-CPWgVi4r.js";import{s as is}from"./XClose-DGYV-4S5.js";import{U as as}from"./user-C73vNaiS.js";import{b as cs,a as ls}from"./use-virtual-mcp-OwU65kyR.js";import{i as ds}from"./ChevronRight-BT7U8Kip.js";import{s as ms}from"./Plus-Bo0L9uYY.js";import{f as us}from"./formatDistanceToNow-Cb2QZZJn.js";import{C as pt}from"./collection-display-button-M7dfC2Rf.js";import{C as ft}from"./collection-table-wrapper-DXH0yXJC.js";import{C as He}from"./card-CAORA3L1.js";import{R as ps}from"./readme-viewer-CKidIXa3.js";import{T as fs,a as xs}from"./tools-list-BYphEqhu.js";import{M as hs}from"./mcp-app-renderer-BtuEhdWL.js";import"./SearchMd-Cpf31N-H.js";import"./Save01-CU3VjXKO.js";import"./binder-BXDCztlr.js";import"./File06-Dy7xo8XS.js";import"./Key01-C3Fh3hes.js";import"./constants-DvJZMaim.js";import"./registry-utils-DXJps8H7.js";import"./extract-connection-data-BkJeK0tX.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-BeHRHLDl.js";import"./index-BWSvBz7o.js";import"./circle-alert-B4C3d1aQ.js";import"./index-B-STjJpH.js";import"./index-ByA6j7_H.js";import"./index-UbeVlDrq.js";import"./collapsible-sQONDG4w.js";import"./use-llm-B_iPCa-K.js";import"./use-collections-vccihohV.js";import"./useMutation-lBFQDcxE.js";import"./useQuery-DcRkCB2j.js";import"./localstorage-keys-BAzeyS9J.js";import"./tabs-BZ-xfLNG.js";import"./checkbox-BCSzUsPR.js";import"./Check-G22LpKFd.js";import"./dialog-Baq_fjtR.js";import"./X-uHaUni9w.js";import"./skeleton-C4ZMp7sl.js";import"./AlignLeft-Ckpqqq7X.js";import"./ArrowLeft-ihbjidrQ.js";import"./Image01-Dvb2vnmH.js";import"./Settings01-BmEB9pVn.js";import"./useSuspenseInfiniteQuery-DdSDu-rZ.js";import"./infiniteQueryObserver-DKiK82rX.js";import"./popover-BNZ96bFv.js";import"./spinner-oA3jiJW_.js";import"./tooltip-Cz-bAWiO.js";import"./index-CvEIDmnk.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-B3tPpNuu.js";import"./Edit01-D3PaS600.js";import"./XCircle-C4iqiznn.js";import"./AlertCircle-CXJCnY_R.js";import"./use-copy-CykDvxn6.js";import"./Code01-UXkm6aqY.js";import"./use-create-virtual-mcp-DB14T-Ft.js";import"./Copy01-tzx60ICS.js";import"./marked.esm-BaswSlok.js";import"./markdown-DCSB9ejV.js";import"./Eye-C_LYW9jG.js";import"./LayersTwo01-CRgWs3EX.js";import"./index-QCmdl8uj.js";import"./Clock-CPO-Cqx6.js";import"./DotsVertical-DHxrk-2J.js";import"./empty-state-BPClkF2j.js";import"./Inbox01-CsvPcK33.js";import"./use-list-state-ykkfYLR3.js";import"./use-view-mode-DyK0fMBe.js";import"./use-mobile-B2VAoWT2.js";import"./alert-dialog-D3oCqQtu.js";import"./scroll-area-By1z4ZyY.js";import"./Edit05-B64h7zay.js";import"./Link01-C74Jreax.js";import"./label-DWU1nKSS.js";import"./avatar-rYlL0ZoJ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowDown-BXCgJapO.js";import"./Grid01-DTf5JuyC.js";import"./List-DJEz6yKj.js";import"./table-RFgqEt_E.js";function gs(s){const e=U.c(14),{virtualMcp:n,org:o}=s;let i;e[0]!==o||e[1]!==n.id?(i={org:o,project:ge,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(qe,{size:16}),e[3]=a):a=e[3];let l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(Re,{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(ds,{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(it,{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 ot(s){const e=U.c(20),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:j}=s,f=Ne(),m=ls();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:ge,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(Oe,{size:16,className:"animate-spin"}):t.jsx(ms,{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(Ue,{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(Oe,{className:"animate-spin text-muted-foreground"}):t.jsx(qe,{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(Ue,{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 js(s){const e=U.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=cs(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 b;return e[3]!==i||e[4]!==a||e[5]!==n||e[6]!==o||e[7]!==l?(b=t.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[u,t.jsx(ot,{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]=b):b=e[8],b}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(ot,{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=b=>t.jsx(gs,{virtualMcp:b,org:l},b.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 bs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:i}){const a=Qe({control:s.control,name:"ui_type"}),l=Qe({control:s.control,name:"connection_url"}),{stdioEnabled:j}=jt(),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?bt(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(qe,{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(H,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{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(et,{value:r.value,onValueChange:r.onChange,children:[t.jsx(K,{children:t.jsxs(tt,{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(De,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(st,{})]})}),t.jsxs(nt,{children:[t.jsx(q,{value:"HTTP",children:"HTTP"}),t.jsx(q,{value:"SSE",children:"SSE"}),t.jsx(q,{value:"Websocket",children:"Websocket"}),m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:"NPX Package"}),t.jsx(q,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(H,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(W,{className:"flex-1 min-w-0",children:t.jsx(K,{children:t.jsx(G,{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(et,{value:r.value,onValueChange:r.onChange,children:[t.jsx(K,{children:t.jsx(tt,{className:"h-10",children:t.jsx(st,{})})}),t.jsxs(nt,{children:[t.jsx(q,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(q,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(q,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"Websocket"]})}),m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ss,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(os,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(Q,{})]})}),a==="NPX"&&t.jsx(H,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(K,{children:t.jsx(G,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),a==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(H,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(K,{children:t.jsx(G,{placeholder:"node, bun, python...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),t.jsx(H,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(K,{children:t.jsx(G,{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(Q,{})]})})]}),t.jsx(H,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(K,{children:t.jsx(G,{placeholder:"/path/to/project (optional)",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})})]}),(a==="NPX"||a==="STDIO")&&t.jsx(H,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(K,{children:t.jsx(Pt,{value:r.value??[],onChange:r.onChange})}),t.jsx(Q,{})]})}),a!=="NPX"&&a!=="STDIO"&&t.jsx(H,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{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(Gt,{children:[t.jsx(Jt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Fe,{variant:"success",className:"gap-1.5",children:[t.jsx(ut,{size:12}),"Authenticated via OAuth",t.jsx(ts,{size:12})]})})}),t.jsxs(Yt,{align:"start",children:[t.jsxs(Ze,{onClick:o,children:[t.jsx(ns,{size:16}),"Re-authenticate"]}),t.jsxs(Ze,{variant:"destructive",onClick:i,children:[t.jsx(rs,{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(is,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(K,{children:t.jsx(G,{type:"password",placeholder:f?"Paste your GitHub PAT":"Enter access token...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),f&&t.jsxs(es,{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(Q,{})]})})]})}function vs(s){const e=U.c(45),{form:n,connection:o,isMCPAuthenticated:i,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:j}=s,{org:f}=Be();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(Re,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}):t.jsx(gt,{control:n.control,name:"icon",render:k=>{const{field:I}=k;return t.jsx(Qt,{value:I.value,onChange:I.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(H,{control:n.control,name:"title",render:ys}),t.jsx(H,{control:n.control,name:"description",render:Ns})]}),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(bs,{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(Fe,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[t.jsx(ut,{size:12}),"Connected"]}):t.jsx(Fe,{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 b;e[20]!==o.created_by?(b=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[u,t.jsx(as,{id:o.created_by,size:"2xs"})]}),e[20]=o.created_by,e[21]=b):b=e[21];let v;e[22]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[22]=v):v=e[22];let _;e[23]!==o.updated_at?(_=o.updated_at?us(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:[v,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]!==b?(p=t.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[d,b,S]}),e[27]=S,e[28]=d,e[29]=b,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(js,{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(Zt,{...n,children:w}),e[42]=n,e[43]=w,e[44]=g):g=e[44],g}function Ns(s){const{field:e}=s;return t.jsxs(W,{className:"w-full space-y-0",children:[t.jsx(K,{children:t.jsx(G,{...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(Q,{})]})}function ys(s){const{field:e}=s;return t.jsxs(W,{className:"flex-1 space-y-0",children:[t.jsx(K,{children:t.jsx(G,{...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(Q,{})]})}function _s(s){const e=U.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=Ne(),[c,r]=X.useState(""),[h,d]=X.useState("table"),[u,b]=X.useState("name"),[v,_]=X.useState("asc");let S;e[0]!==v||e[1]!==u?(S=T=>{u===T?(_(ks),v==="desc"&&b(void 0)):(b(T),_("asc"))},e[0]=v,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:ge,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]!==v||e[11]!==u){const T=!n||n.length===0?[]:c.trim()?(()=>{const F=c.toLowerCase();return n.filter(B=>B.name.toLowerCase().includes(F)||B.description&&B.description.toLowerCase().includes(F))})():n;g=!u||!v?T:[...T].sort((F,B)=>{const je=F[u]||"",ee=B[u]||"",J=String(je).localeCompare(String(ee));return v==="asc"?J:-J}),e[8]=n,e[9]=c,e[10]=v,e[11]=u,e[12]=g}else g=e[12];const k=g;let I;e[13]===Symbol.for("react.memo_cache_sentinel")?(I=[{id:"name",header:"Name",render:Ts,sortable:!0},{id:"description",header:"Description",render:ws,cellClassName:"flex-1",sortable:!0}],e[13]=I):I=e[13];const V=I;let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=V.filter(Ss).map(Cs),e[14]=M):M=e[14];const L=M;let y;e[15]!==p||e[16]!==f||e[17]!==v||e[18]!==u||e[19]!==h?(y=f&&t.jsx(Xe,{children:t.jsx(pt,{viewMode:h,onViewModeChange:d,sortKey:u,sortDirection:v,onSort:p,sortOptions:L})}),e[15]=p,e[16]=f,e[17]=v,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 D;e[22]!==c?(D=t.jsx(ze,{value:c,onChange:r,placeholder:"Search prompts...",onKeyDown:R}),e[22]=c,e[23]=D):D=e[23];let N;e[24]!==m||e[25]!==w||e[26]!==p||e[27]!==c||e[28]!==v||e[29]!==u||e[30]!==k||e[31]!==h?(N=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(He,{className:"cursor-pointer transition-colors",onClick:()=>w(T),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Re,{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(ft,{columns:V,data:k,isLoading:!1,sortKey:u,sortDirection:v,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]=v,e[29]=u,e[30]=k,e[31]=h,e[32]=N):N=e[32];let A;e[33]!==D||e[34]!==N?(A=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[D,N]}),e[33]=D,e[34]=N,e[35]=A):A=e[35];let $;return e[36]!==A||e[37]!==y?($=t.jsxs(t.Fragment,{children:[y,A]}),e[36]=A,e[37]=y,e[38]=$):$=e[38],$}function Cs(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Ss(s){return s.sortable}function ws(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ts(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function ks(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Ps(s){const e=U.c(4),{prompts:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx(_s,{prompts:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}function Is(s){const e=U.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(ps,{repository:n})}),e[0]=n,e[1]=o):o=e[1],o}function $s(s){const e=U.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 b;e[0]!==d||e[1]!==r?(b=N=>{r===N?(u(Es),d==="desc"&&h(void 0)):(h(N),u("asc"))},e[0]=d,e[1]=r,e[2]=b):b=e[2];const v=b;let _;e[3]!==o?(_=N=>{o&&o(N)},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 N=!n||n.length===0?[]:f.trim()?(()=>{const A=f.toLowerCase();return n.filter($=>$.uri.toLowerCase().includes(A)||$.name&&$.name.toLowerCase().includes(A)||$.description&&$.description.toLowerCase().includes(A))})():n;p=!r||!d?N:[...N].sort((A,$)=>{const T=A[r]||"",F=$[r]||"",B=String(T).localeCompare(String(F));return d==="asc"?B:-B}),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:Rs,sortable:!0},{id:"uri",header:"URI",render:Os,sortable:!0},{id:"description",header:"Description",render:Ds,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Ms,sortable:!0}],e[10]=w):w=e[10];const g=w;let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=g.filter(Vs).map(As),e[11]=k):k=e[11];const I=k;let V;e[12]!==v||e[13]!==l||e[14]!==d||e[15]!==r||e[16]!==x?(V=l&&t.jsx(Xe,{children:t.jsx(pt,{viewMode:x,onViewModeChange:c,sortKey:r,sortDirection:d,onSort:v,sortOptions:I})}),e[12]=v,e[13]=l,e[14]=d,e[15]=r,e[16]=x,e[17]=V):V=e[17];let M;e[18]===Symbol.for("react.memo_cache_sentinel")?(M=N=>{N.key==="Escape"&&(m(""),N.target.blur())},e[18]=M):M=e[18];let L;e[19]!==f?(L=t.jsx(ze,{value:f,onChange:m,placeholder:"Search resources...",onKeyDown:M}),e[19]=f,e[20]=L):L=e[20];let y;e[21]!==j||e[22]!==S||e[23]!==v||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(N=>t.jsx(He,{className:"cursor-pointer transition-colors",onClick:()=>S(N),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Re,{icon:null,name:N.name||N.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:N.name||N.uri}),t.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:N.uri}),N.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:N.description})]})]})},N.uri))})}):t.jsx(ft,{columns:g,data:C,isLoading:!1,sortKey:r,sortDirection:d,onSort:v,onRowClick:N=>S(N),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]=v,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 D;return e[33]!==R||e[34]!==V?(D=t.jsxs(t.Fragment,{children:[V,R]}),e[33]=R,e[34]=V,e[35]=D):D=e[35],D}function As(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Vs(s){return s.sortable}function Ms(s){return t.jsx("span",{className:"text-sm text-muted-foreground",children:s.mimeType||"—"})}function Ds(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Os(s){return t.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:s.uri})}function Rs(s){return t.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name||s.uri})}function Es(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Ls(s){const e=U.c(4),{resources:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx($s,{resources:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}const Us=at({key:z().min(1,"Key is required"),value:z()}),Fs=at({title:z().min(1,"Name is required"),description:z().nullable().optional(),icon:z().nullable().optional(),ui_type:yt(["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:Ge(Us).optional(),configuration_scopes:Ge(z()).nullable().optional(),configuration_state:vt(z(),Nt()).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 Bs(s){const e=U.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(fs,{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 zs(s){const e=U.c(27),{tools:n,connectionId:o,org:i}=s,a=Ne(),{org:l}=Be();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=mt(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 v=(n??[]).filter(Ks),_=m.toLowerCase().trim(),S=_?v.filter(g=>g.name.toLowerCase().includes(_)||g.description&&g.description.toLowerCase().includes(_)):v;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:ge,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=Ke(g._meta);return t.jsxs(He,{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(hs,{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(xs,{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 b;return e[23]!==h||e[24]!==d||e[25]!==u?(b=t.jsxs("div",{className:h,children:[d,u]}),e[23]=h,e[24]=d,e[25]=u,e[26]=b):b=e[26],b}function Ks(s){return!!Ke(s._meta)}function Xs(s){return s.command==="npx"}function qs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Hs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Ws(s,e){const n={command:"npx",args:["-y",s]},o=lt(e);return Object.keys(o).length>0&&(n.envVars=o),n}function Qs(s,e,n,o){const i={command:s};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const a=lt(o);return Object.keys(a).length>0&&(i.envVars=a),i}function rt(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"&&kt(s.connection_headers)){const o=s.connection_headers,i=It(o.envVars);if(Xs(o)){const l=qs(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=Hs(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 Gs(s){let e,n=null,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=Ws(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=Qs(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 Js(s){const e=U.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=Ne(h),u=St(),b=dt();let v;e[1]!==o?(v={connectionId:o},e[1]=o,e[2]=v):v=e[2];const _=Mt(v),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=Vt(C).length>0,k=n?.metadata?.repository,I=!!k?.url;let V;e[5]===Symbol.for("react.memo_cache_sentinel")?(V=wt(Fs),e[5]=V):V=e[5];let M;e[6]!==n?(M=rt(n),e[6]=n,e[7]=M):M=e[7];let L;e[8]!==M?(L={resolver:V,values:M},e[8]=M,e[9]=L):L=e[9];const y=Tt(L),R=y.formState.isDirty;let D;e[10]!==y||e[11]!==j?(D=async()=>{if(!await y.trigger())return;const E=y.getValues(),he=Gs(E);await j(he),y.reset(E)},e[10]=y,e[11]=j,e[12]=D):D=e[12];const N=D;let A;e[13]!==n||e[14]!==y?(A=()=>{y.reset(rt(n))},e[13]=n,e[14]=y,e[15]=A):A=e[15];const $=A;let T;e[16]!==n.id||e[17]!==b||e[18]!==u?(T=async()=>{const{token:P,tokenInfo:E,error:he}=await Ut({connectionId:n.id});if(he||!P){ve.error(`Authentication failed: ${he}`);return}if(E)try{const Me=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:E.accessToken,refreshToken:E.refreshToken,expiresIn:E.expiresIn,scope:E.scope,clientId:E.clientId,clientSecret:E.clientSecret,tokenEndpoint:E.tokenEndpoint})});if(!Me.ok)console.error("Failed to save OAuth token:",await Me.text()),await b.update.mutateAsync({id:n.id,data:{connection_token:P}});else try{await b.update.mutateAsync({id:n.id,data:{}})}catch(We){console.warn("Failed to refresh connection tools after OAuth:",We)}}catch(Me){console.error("Error saving OAuth token:",Me),await b.update.mutateAsync({id:n.id,data:{connection_token:P}})}else await b.update.mutateAsync({id:n.id,data:{connection_token:P}});const ht=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:Je.isMCPAuthenticated(ht.href,null)}),ve.success("Authentication successful")},e[16]=n.id,e[17]=b,e[18]=u,e[19]=T):T=e[19];const F=T;let B;e[20]!==n.id||e[21]!==u?(B=async()=>{try{const P=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!P.ok){const he=await P.text();ve.error(`Failed to remove OAuth: ${he}`);return}const E=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:Je.isMCPAuthenticated(E.href,null)}),ve.success("OAuth removed. You can now re-authenticate with a different account.")}catch(P){console.error("Error removing OAuth token:",P),ve.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=u,e[22]=B):B=e[22];const je=B,ee=c.length,J=m.length,ye=x.length;let _e;e[23]!==c?(_e=c.filter(en),e[23]=c,e[24]=_e):_e=e[24];const Ce=_e.length,Ee=ee>0||r;let Se;e[25]===Symbol.for("react.memo_cache_sentinel")?(Se={id:"settings",label:"Settings"},e[25]=Se):Se=e[25];let te;e[26]!==r||e[27]!==p||e[28]!==Ee||e[29]!==ee?(te=p&&Ee?[{id:"tools",label:"Tools",count:r?void 0:ee}]:[],e[26]=r,e[27]=p,e[28]=Ee,e[29]=ee,e[30]=te):te=e[30];let se;e[31]!==p||e[32]!==J?(se=p&&J>0?[{id:"prompts",label:"Prompts",count:J}]:[],e[31]=p,e[32]=J,e[33]=se):se=e[33];let ne;e[34]!==p||e[35]!==ye?(ne=p&&ye>0?[{id:"resources",label:"Resources",count:ye}]:[],e[34]=p,e[35]=ye,e[36]=ne):ne=e[36];let oe;e[37]!==p||e[38]!==Ce?(oe=p&&Ce>0?[{id:"ui",label:"UI",count:Ce}]:[],e[37]=p,e[38]=Ce,e[39]=oe):oe=e[39];let we;if(e[40]!==l||e[41]!==I||e[42]!==p||e[43]!==te||e[44]!==se||e[45]!==ne||e[46]!==oe){let P;e[48]!==I?(P=I?[{id:"readme",label:"README"}]:[],e[48]=I,e[49]=P):P=e[49],we=[Se,...te,...se,...ne,...oe,...p?(l||[]).map(Zs):[],...P],e[40]=l,e[41]=I,e[42]=p,e[43]=te,e[44]=se,e[45]=ne,e[46]=oe,e[47]=we}else we=e[47];const be=we,xt=p&&be.some(Ys)?"tools":"settings",O=be.some(P=>P.id===a)?a:xt;let Te;e[50]!==d?(Te=P=>{d({search:E=>({...E,tab:P}),replace:!0})},e[50]=d,e[51]=Te):Te=e[51];const re=Te;let ie;e[52]!==l?(ie=l||[],e[52]=l,e[53]=ie):ie=e[53];let ke;if(e[54]!==O||e[55]!==ie){let P;e[57]!==O?(P=E=>E.name===O,e[57]=O,e[58]=P):P=e[58],ke=ie.find(P),e[54]=O,e[55]=ie,e[56]=ke}else ke=e[56];const Pe=ke;let ae;e[59]!==i?(ae=t.jsx(Ye,{children:t.jsx(Bt,{asChild:!0,children:t.jsx(it,{to:"/$org/$project/mcps",params:{org:i,project:ge},children:"Connections"})})}),e[59]=i,e[60]=ae):ae=e[60];let Ie;e[61]===Symbol.for("react.memo_cache_sentinel")?(Ie=t.jsx(zt,{}),e[61]=Ie):Ie=e[61];let ce;e[62]!==n.title?(ce=t.jsx(Ye,{children:t.jsx(Ft,{children:n.title})}),e[62]=n.title,e[63]=ce):ce=e[63];let $e;e[64]!==ae||e[65]!==ce?($e=t.jsx(Kt,{children:t.jsxs(Xt,{children:[ae,Ie,ce]})}),e[64]=ae,e[65]=ce,e[66]=$e):$e=e[66];const Le=$e;let le;e[67]!==N||e[68]!==$||e[69]!==R||e[70]!==f?(le=t.jsx(Xe,{children:t.jsx($t,{onSave:N,onUndo:$,isDirty:R,isSaving:f})}),e[67]=N,e[68]=$,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]!==F||e[76]!==je||e[77]!==p?(de=t.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:t.jsx(vs,{form:y,connection:n,isMCPAuthenticated:p,hasOAuthToken:_.hasOAuthToken,onReauthenticate:F,onRemoveOAuth:je})}),e[72]=_.hasOAuthToken,e[73]=n,e[74]=y,e[75]=F,e[76]=je,e[77]=p,e[78]=de):de=e[78];let me;e[79]!==O||e[80]!==re||e[81]!==be?(me=t.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:t.jsx(qt,{tabs:be,activeTab:O,onTabChange:re,className:"flex-1"})}),e[79]=O,e[80]=re,e[81]=be,e[82]=me):me=e[82];let Ae;e[83]===Symbol.for("react.memo_cache_sentinel")?(Ae=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),e[83]=Ae):Ae=e[83];let ue;e[84]!==Pe||e[85]!==O||e[86]!==_.isServerError||e[87]!==_.supportsOAuth||e[88]!==n||e[89]!==o||e[90]!==y||e[91]!==F||e[92]!==re||e[93]!==g||e[94]!==I||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:Ae,children:O==="tools"?t.jsx(Bs,{tools:c,connectionId:o,org:i,isLoading:r}):O==="ui"?t.jsx(zs,{tools:c,connectionId:o,org:i}):O==="prompts"?t.jsx(Ps,{prompts:m,connectionId:o,org:i}):O==="resources"?t.jsx(Ls,{resources:x,connectionId:o,org:i}):O==="settings"?t.jsx(Dt,{connection:n,form:y,hasMcpBinding:g,isMCPAuthenticated:p,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:F,onViewReadme:I?()=>re("readme"):void 0}):O==="readme"&&I?t.jsx(Is,{repository:k}):Pe&&p?t.jsx(Wt,{connectionId:o,org:i,activeCollection:Pe},O):t.jsx(Z,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[84]=Pe,e[85]=O,e[86]=_.isServerError,e[87]=_.supportsOAuth,e[88]=n,e[89]=o,e[90]=y,e[91]=F,e[92]=re,e[93]=g,e[94]=I,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]!==O||e[104]!==ue?(pe=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(ct,{children:ue},O)}),e[103]=O,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 Ve;return e[112]!==Le||e[113]!==le||e[114]!==xe?(Ve=t.jsxs(Ht,{breadcrumb:Le,children:[le,xe]}),e[112]=Le,e[113]=le,e[114]=xe,e[115]=Ve):Ve=e[115],Ve}function Ys(s){return s.id==="tools"}function Zs(s){return{id:s.name,label:s.displayName}}function en(s){return!!Ke(s._meta)}function tn(){const s=U.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=Ne(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}=_t(o),{org:l}=Be();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=Ct(j).tab??"",x=Ot(i),c=dt(),r=At(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=mt(h);let u;s[6]!==d?(u={client:d},s[6]=d,s[7]=u):u=s[7];const{data:b}=Lt(u);let v;s[8]!==d?(v={client:d},s[8]=d,s[9]=v):v=s[9];const{data:_}=Et(v),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}=Rt(p);let g;s[13]!==b?.prompts?(g=b?.prompts??[],s[13]=b?.prompts,s[14]=g):g=s[14];let k;s[15]!==g?(k=g.map(on),s[15]=g,s[16]=k):k=s[16];const I=k;let V;s[17]!==_?.resources?(V=_?.resources??[],s[17]=_?.resources,s[18]=V):V=s[18];let M;s[19]!==V?(M=V.map(nn),s[19]=V,s[20]=M):M=s[20];const L=M;let y;s[21]!==x?.tools||s[22]!==S||s[23]!==C?.tools?(y=S?(C?.tools??[]).map(sn):x?.tools??[],s[21]=x?.tools,s[22]=S,s[23]=C?.tools,s[24]=y):y=s[24];const R=y;let D;s[25]!==c.update||s[26]!==i?(D=async $=>{await c.update.mutateAsync({id:i,data:$})},s[25]=c.update,s[26]=i,s[27]=D):D=s[27];const N=D;if(!x){let $;return s[28]!==n||s[29]!==a?($=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(Ue,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:a,project:ge}}),children:"Back to connections"})})}),s[28]=n,s[29]=a,s[30]=$):$=s[30],$}let A;return s[31]!==c.update.isPending||s[32]!==r||s[33]!==x||s[34]!==i||s[35]!==N||s[36]!==w||s[37]!==a||s[38]!==I||s[39]!==m||s[40]!==L||s[41]!==R?(A=t.jsx(Js,{org:a,connection:x,connectionId:i,requestedTabId:m,collections:r,onUpdate:N,isUpdating:c.update.isPending,prompts:I,resources:L,tools:R,isLoadingTools:w}),s[31]=c.update.isPending,s[32]=r,s[33]=x,s[34]=i,s[35]=N,s[36]=w,s[37]=a,s[38]=I,s[39]=m,s[40]=L,s[41]=R,s[42]=A):A=s[42],A}function sn(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations,_meta:s._meta}}function nn(s){return{uri:s.uri,name:s.name,description:s.description}}function on(s){return{name:s.name,description:s.description}}function rn(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ct,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(tn,{})})}),s[0]=e):e=s[0],e}function hr(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(rn,{}),s[0]=e):e=s[0],e}export{hr as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as U,c as fe,j as t,E as vt,u as bt,n as Ct,b as Nt,a as _t,d as kt,aB as wt,l as St,k as Tt,i as Dt,B as O,O as Q,v as oe,t as J,o as ct,bb as It,s as Y,bc as Pt}from"./index-B_0vsVr1.js";import{g as At}from"./generate-id-Dyweu44Y.js";import{C as $t}from"./collection-display-button-M7dfC2Rf.js";import{C as Et,E as Ee}from"./collection-search-q4T1hb73.js";import{T as Ot,a as zt,b as Se,c as pe,d as Lt,e as Vt}from"./table-RFgqEt_E.js";import{C as lt}from"./connection-card-DTiOZbAC.js";import{B as je}from"./badge-CxJArm69.js";import{i as Ft}from"./AlertCircle-CXJCnY_R.js";import{i as Bt}from"./CheckCircle-Dl3Eh5mw.js";import{I as Ne}from"./integration-icon-DAFtApWT.js";import{P as be}from"./index-QCmdl8uj.js";import{U as _e}from"./user-C73vNaiS.js";import{u as Mt}from"./use-binding-Dz1SRdBY.js";import{u as Ut}from"./use-list-state-ykkfYLR3.js";import{f as Ht,e as Rt}from"./registry-utils-DXJps8H7.js";import{f as ze,a as Le,b as Ve,c as Fe,d as Be,e as Me,A as Ue,h as He}from"./alert-dialog-D3oCqQtu.js";import{B as Wt,a as Xt,b as Kt,c as Gt}from"./breadcrumb-CGrLS5HH.js";import{C as De}from"./checkbox-BCSzUsPR.js";import{D as qe,a as Qe,b as Je,c as Ye,d as Ze,e as at}from"./dialog-Baq_fjtR.js";import{D as Re,a as We,b as Xe,c as ge}from"./dropdown-menu-CSqO4Mxn.js";import{a as qt,F as Z,b as ee,c as te,d as ne,f as se}from"./form-C5R0_qWR.js";import{I as xe}from"./input-CW7SVowR.js";import{S as Qt,a as Jt,b as Yt,c as Zt,d as Ce}from"./select-CYY4CENz.js";import{T as en}from"./textarea-4HpXofT0.js";import{a as tn,b as nn}from"./use-connection-DeEn4qfI.js";import{u as ot,a as sn}from"./constants-D9bRXDQp.js";import{b as on}from"./use-mcp-tools-BXihKxpu.js";import{b as rn}from"./use-virtual-mcp-OwU65kyR.js";import{n as cn}from"./ArrowDown-BXCgJapO.js";import{i as ln}from"./ArrowUp-B3tPpNuu.js";import{t as an}from"./ChevronDown-DAk1F2Sn.js";import{n as he}from"./Container-CyEPuAYL.js";import{i as Ke}from"./DotsVertical-DHxrk-2J.js";import{s as Ge}from"./Eye-C_LYW9jG.js";import{s as Oe}from"./Globe02-X-Xm1ngz.js";import{i as dn}from"./Loading01-B3gOoSbd.js";import{s as mn}from"./Plus-Bo0L9uYY.js";import{i as un}from"./Terminal-BS-6VR5p.js";import{s as Ie}from"./Trash01-HuK-pEft.js";import{s as dt}from"./XClose-DGYV-4S5.js";import{f as ke}from"./format-time-CMKyl-GC.js";import{r as pn,E as xn,e as mt}from"./env-vars-editor-DDp7f4JN.js";import"./Check-G22LpKFd.js";import"./Grid01-DTf5JuyC.js";import"./List-DJEz6yKj.js";import"./tooltip-Cz-bAWiO.js";import"./index-CvEIDmnk.js";import"./SearchMd-Cpf31N-H.js";import"./card-CAORA3L1.js";import"./localstorage-keys-BAzeyS9J.js";import"./useQuery-DcRkCB2j.js";import"./useMutation-lBFQDcxE.js";import"./avatar-rYlL0ZoJ.js";import"./binder-BXDCztlr.js";import"./use-view-mode-DyK0fMBe.js";import"./use-mobile-B2VAoWT2.js";import"./ChevronRight-BT7U8Kip.js";import"./X-uHaUni9w.js";import"./label-DWU1nKSS.js";import"./use-collections-vccihohV.js";import"./differenceInSeconds-NQ4PDo0z.js";const ut=({size:o=24,color:e="currentColor",...n})=>U.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},U.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"}));ut.displayName="CheckSquare";function Pe(o){const e=fe.c(3),{status:n}=o;if(n==="active"){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs(je,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[t.jsx(Bt,{size:12}),"Active"]}),e[0]=l):l=e[0],l}if(n==="error"){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs(je,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[t.jsx(Ft,{size:12}),"Error"]}),e[1]=l):l=e[1],l}let c;return e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(je,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),e[2]=c):c=e[2],c}function it(o){return o.title.trim().replace(/\s+\(\d+\)$/,"")}function hn(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 pt(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 fn(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 gn=ct({key:Y(),value:Y()}),jn=ct({title:Y().min(1,"Name is required"),description:Y().nullable().optional(),icon:Y().nullable().optional(),ui_type:Pt(["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:It(gn).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 Ae(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 yn(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 Te(o){const{uiType:e}=o,n=Ae(o.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&n===Ae("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=Ae(o.connectionUrl??"");if(!e)return null;const n=o.registryItems.find(u=>(u.server?.remotes??[]).some(h=>Ae(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 vn(o,e){const n={command:"npx",args:["-y",o]},c=mt(e);return Object.keys(c).length>0&&(n.envVars=c),n}function bn(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 Cn(o){return o.command==="npx"}function Nn(o){return o.args?.find(e=>!e.startsWith("-"))??""}function _n(o){return{command:o.command,args:o.args?.join(" ")??"",cwd:o.cwd??""}}function kn(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 wn(o){const e=fe.c(107),{group:n,onNavigate:c,onDelete:l,selectionMode:u,selectedIds:r,onToggleSelect:h}=o,[b,d]=U.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,_,C,I,A,z,M,N,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 $=pt(n.connections),E=n.connections.reduce(In,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?(M={title:n.title,icon:n.icon,description:D},e[29]=n.icon,e[30]=n.title,e[31]=D,e[32]=M):M=e[32],e[33]!==p||e[34]!==n.connections||e[35]!==h||e[36]!==r||e[37]!==u?(N=()=>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]=N):N=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(je,{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(Dn),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 ye=$.map(R=>t.jsx(_e,{id:R,size:"3xs",avatarOnly:$.length>1},R));e[54]!==ye?(z=t.jsx("div",{className:"flex items-center -space-x-1.5",children:ye}),e[54]=ye,e[55]=z):z=e[55],C="shrink-0 ml-2",I=de?ke(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]=C,e[23]=I,e[24]=A,e[25]=z,e[26]=M,e[27]=N,e[28]=k}else j=e[18],y=e[19],w=e[20],_=e[21],C=e[22],I=e[23],A=e[24],z=e[25],M=e[26],N=e[27],k=e[28];let v;e[56]!==C||e[57]!==I?(v=t.jsx("span",{className:C,children:I}),e[56]=C,e[57]=I,e[58]=v):v=e[58];let H;e[59]!==v||e[60]!==A||e[61]!==z?(H=t.jsxs("div",{className:A,children:[z,v]}),e[59]=v,e[60]=A,e[61]=z,e[62]=H):H=e[62];let V;e[63]!==j||e[64]!==y||e[65]!==w||e[66]!==_||e[67]!==H||e[68]!==M||e[69]!==N||e[70]!==k?(V=t.jsx(j,{connection:M,onClick:N,className:k,fallbackIcon:y,headerActions:w,body:_,footer:H}),e[63]=j,e[64]=y,e[65]=w,e[66]=_,e[67]=H,e[68]=M,e[69]=N,e[70]=k,e[71]=V):V=e[71];let W;e[72]===Symbol.for("react.memo_cache_sentinel")?(W=t.jsx(he,{}),e[72]=W):W=e[72];let X;e[73]!==n.icon||e[74]!==n.title?(X=t.jsx(Ne,{icon:n.icon,name:n.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:W}),e[73]=n.icon,e[74]=n.title,e[75]=X):X=e[75];let K;e[76]!==n.connections.length?(K=t.jsxs(je,{variant:"secondary",className:"ml-2 text-xs tabular-nums",children:["x",n.connections.length]}),e[76]=n.connections.length,e[77]=K):K=e[77];let g;e[78]!==n.title||e[79]!==K?(g=t.jsxs(Ye,{children:[n.title,K]}),e[78]=n.title,e[79]=K,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]!==X||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:[X,L]})}),e[86]=X,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(Pe,{status:E.status})]}),t.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground shrink-0",children:[t.jsx(_e,{id:E.created_by,size:"3xs"}),t.jsx("span",{children:E.created_at?ke(new Date(E.created_at)):"—"})]}),t.jsxs(Re,{children:[t.jsx(We,{asChild:!0,children:t.jsx(O,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:Tn,children:t.jsx(Ke,{size:16})})}),t.jsxs(Xe,{align:"end",onClick:Sn,children:[t.jsxs(ge,{onClick:()=>{d(!1),c(E.id)},children:[t.jsx(Ge,{size:16}),"Open"]}),t.jsxs(ge,{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]!==b||e[102]!==ce?(m=t.jsx(qe,{open:b,onOpenChange:d,children:ce}),e[101]=b,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 Sn(o){return o.stopPropagation()}function Tn(o){return o.stopPropagation()}function Dn(o){return t.jsx(Pe,{status:o.status},o.id)}function In(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 Pn(o){const e=fe.c(28),{count:n,total:c,onSelectAll:l,onDeselectAll:u,onDelete:r,onAddToAgent:h,onToggleStatus:b,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(mn,{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]!==b?(j=t.jsx(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>b("active"),children:"Enable"}),e[10]=b,e[11]=j):j=e[11];let y;e[12]!==b?(y=t.jsx(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>b("inactive"),children:"Disable"}),e[12]=b,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 C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(dt,{size:13}),e[17]=C):C=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:C}),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 An(o){const e=fe.c(25),{open:n,onOpenChange:c,agents:l,onConfirm:u}=o,[r,h]=U.useState(null);let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=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]=b):b=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(C=>t.jsxs("button",{type:"button",onClick:()=>h(C.id),className:oe("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",r===C.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Ne,{icon:C.icon,name:C.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:C.title}),C.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:C.description})]})]},C.id)),e[1]=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:[b,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 $n(o){const e=fe.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(Fe,{children:["Delete ",l," connection",r,"?"]}),e[0]=l,e[1]=r,e[2]=h):h=e[2];const b=l!==1?"s":"";let d;e[3]!==b?(d=t.jsxs(Be,{children:["This will permanently delete the selected connection",b,". This action cannot be undone."]}),e[3]=b,e[4]=d):d=e[4];let f;e[5]!==h||e[6]!==d?(f=t.jsxs(Ve,{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(Me,{children:[p,t.jsxs(He,{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(Le,{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(ze,{open:n,onOpenChange:c,children:j}),e[16]=c,e[17]=n,e[18]=j,e[19]=y):y=e[19],y}function En(o){const e=fe.c(37),{columns:n,grouped:c,sortKey:l,sortDirection:u,onSort:r,onRowClick:h,selectionMode:b,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]=U.useState(T);let y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y=N=>{j(k=>{const v=new Set(k);return v.has(N)?v.delete(N):v.add(N),v})},e[1]=y):y=e[1];const w=y;if(c.length===0&&p){let N;return e[2]!==p?(N=t.jsx("div",{className:"flex items-center justify-center h-full",children:p}),e[2]=p,e[3]=N):N=e[3],N}const _=n.length;let C;if(e[4]!==_||e[5]!==n||e[6]!==r||e[7]!==u||e[8]!==l){let N;e[10]!==_||e[11]!==r||e[12]!==u||e[13]!==l?(N=(k,v)=>{const H=l===k.id,V=v===_-1;return t.jsx(Ot,{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:H&&u&&(u==="asc"?t.jsx(ln,{size:16,className:"text-muted-foreground"}):t.jsx(cn,{size:16,className:"text-muted-foreground"}))})]})},k.id)},e[10]=_,e[11]=r,e[12]=u,e[13]=l,e[14]=N):N=e[14],C=n.map(N),e[4]=_,e[5]=n,e[6]=r,e[7]=u,e[8]=l,e[9]=C}else C=e[9];let I;e[15]!==C?(I=t.jsx(zt,{className:"border-b-0",children:t.jsx(Se,{className:"h-9 hover:bg-transparent border-b border-border",children:C})}),e[15]=C,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]!==b){let N;e[25]!==n||e[26]!==x||e[27]!==h||e[28]!==f||e[29]!==d||e[30]!==b?(N=k=>{if(k.type==="single"){const g=k.connection;return t.jsx(Se,{className:oe("group/data-row transition-colors border-b-0 hover:bg-accent/50 cursor-pointer",b&&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,H=x.has(v.key),V=v.connections.every(g=>d.has(g.id)),W=v.connections.some(g=>d.has(g.id)),X=pt(v.connections),K=v.connections.reduce(zn,v.connections[0]);return t.jsxs(U.Fragment,{children:[t.jsx(Se,{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:W?"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:On})},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(je,{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:X.map(L=>t.jsx(_e,{id:L,size:"3xs",avatarOnly:X.length>1},L))})},g.id);if(g.id==="updated_at"){const L=K.updated_at??K.created_at;return t.jsx(pe,{className:S,children:t.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:L?ke(new Date(L)):"—"})},g.id)}return g.id==="actions"?t.jsx(pe,{className:S,children:t.jsx(an,{size:16,className:oe("text-muted-foreground transition-transform",H&&"rotate-180")})},g.id):t.jsx(pe,{className:S},g.id)})}),H&&v.connections.map(g=>t.jsx(Se,{className:oe("group/data-row transition-colors border-b-0 hover:bg-accent/50 cursor-pointer bg-muted/20",b&&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]=b,e[31]=N):N=e[31],A=c.map(N),e[17]=n,e[18]=x,e[19]=c,e[20]=h,e[21]=f,e[22]=d,e[23]=b,e[24]=A}else A=e[24];let z;e[32]!==A?(z=t.jsx(Lt,{children:A}),e[32]=A,e[33]=z):z=e[33];let M;return e[34]!==I||e[35]!==z?(M=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsxs(Vt,{className:"w-full border-collapse",children:[I,z]})}),e[34]=I,e[35]=z,e[36]=M):M=e[36],M}function On(o){return o.stopPropagation()}function zn(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 Ln(){const{org:o}=bt(),e=Ct(),n=Nt(),c=_t({strict:!1}),{data:l}=kt.useSession(),{stdioEnabled:u}=wt(),r=Ut({namespace:o.slug,resource:"connections"}),h=tn(),b=nn(r),[d,f]=U.useReducer(kn,{mode:"idle"}),[p,T]=U.useState(!1),[x,j]=U.useState(new Set),[y,w]=U.useState(!1),[_,C]=U.useState(!1),[I,A]=U.useState("ALL"),[z,M]=U.useState("ALL"),N=rn(),k=b.filter(s=>!(s.connection_type==="VIRTUAL"||I!=="ALL"&&s.connection_type!==I||z!=="ALL"&&s.status!==z)),v=fn(b),H=hn(k),V=s=>{j(i=>{const a=new Set(i);return a.has(s)?a.delete(s):a.add(s),a})},W=()=>{T(!1),j(new Set)},X=Mt(b)[0],K=X?.id??"",g=Ht(X?.tools),S=ot({connectionId:K||null,orgId:o.id}),{data:L}=on({client:S,toolName:g,toolArguments:{limit:200},enabled:!!(K&&g),staleTime:3600*1e3,select:s=>s.structuredContent??s}),ie=Rt(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=St({resolver:Tt(jn),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=Te({uiType:F,connectionUrl:$??"",npxPackage:E??""})??rt({uiType:F,connectionUrl:$??"",registryItems:ie}),D=d.mode==="editing"?d.connection:null;U.useEffect(()=>{if(D){const s=Dt(D.connection_headers)?D.connection_headers:null;if(s&&D.connection_type==="STDIO"){const i=pn(s.envVars);if(Cn(s)){const a=Nn(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=_n(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:sn,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":""}`),W()},ye=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":""}`),W()},R=async s=>{const i=N.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}"`),W()}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"},xt=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}`)}},ht=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}`)}},ft=async s=>{let i,a=null,B=null,P=null;if(s.ui_type==="NPX"?(i="STDIO",a="",P=vn(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(i="STDIO",a="",P=bn(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=At("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())},we=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")??[],yt=new Set(nt.map(ve=>ve.key)),st=q.envVarKeys.filter(ve=>!yt.has(ve));st.length>0&&m.setValue("env_vars",[...nt,...st.map(ve=>({key:ve,value:""}))],{shouldDirty:!0})}},$e=yn(i);if($e&&u){m.setValue("ui_type","NPX",{shouldDirty:!0}),m.setValue("npx_package",$e.packageName,{shouldDirty:!0}),m.setValue("connection_url","",{shouldDirty:!0}),m.setValue("connection_token",null,{shouldDirty:!0}),G(Te({uiType:"NPX",npxPackage:$e.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(Te({uiType:q,connectionUrl:i})??rt({uiType:q,connectionUrl:i,registryItems:ie}));return}F==="NPX"&&G(Te({uiType:"NPX",npxPackage:i}))},gt=[...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(Pe,{status:s.status}),cellClassName:"w-28 shrink-0",sortable:!1},{id:"updated_by",header:"Updated by",render:s=>t.jsx(_e,{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?ke(new Date(s.updated_at)):"—"}),cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:s=>t.jsxs(Re,{children:[t.jsx(We,{asChild:!0,children:t.jsx(O,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:i=>i.stopPropagation(),children:t.jsx(Ke,{size:20})})}),t.jsxs(Xe,{align:"end",onClick:i=>i.stopPropagation(),children:[t.jsxs(ge,{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(ge,{variant:"destructive",onClick:i=>{i.stopPropagation(),f({type:"delete",connection:s})},children:[t.jsx(Ie,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],jt=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:W,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(ut,{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(be,{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(qt,{...m,children:t.jsxs("form",{onSubmit:m.handleSubmit(ft),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(Qt,{value:s.value,onValueChange:s.onChange,children:[t.jsx(ne,{children:t.jsx(Jt,{children:t.jsx(Yt,{})})}),t.jsxs(Zt,{children:[t.jsx(Ce,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(Ce,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(Ce,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{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(un,{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}),we(a))},onBlur:i=>{we(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(xn,{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}),we(a))},onBlur:i=>{we(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(en,{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(ze,{open:d.mode==="deleting",onOpenChange:s=>!s&&f({type:"close"}),children:t.jsxs(Le,{children:[t.jsxs(Ve,{children:[t.jsx(Fe,{children:"Delete Connection?"}),t.jsxs(Be,{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(Me,{children:[t.jsx(Ue,{children:"Cancel"}),t.jsx(He,{onClick:xt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),t.jsx(ze,{open:d.mode==="force-deleting",onOpenChange:s=>!s&&f({type:"close"}),children:t.jsxs(Le,{children:[t.jsxs(Ve,{children:[t.jsx(Fe,{children:"Connection Used by Agents"}),t.jsx(Be,{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(Me,{children:[t.jsx(Ue,{children:"Cancel"}),t.jsx(He,{onClick:ht,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]})]})}),t.jsx($n,{open:y,onOpenChange:w,count:x.size,onConfirm:ue}),t.jsx(An,{open:_,onOpenChange:C,agents:N,onConfirm:R}),t.jsxs(be.Header,{children:[t.jsx(be.Header.Left,{children:t.jsx(Wt,{children:t.jsx(Xt,{children:t.jsx(Kt,{children:t.jsxs(Gt,{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(be.Header.Right,{children:[t.jsx($t,{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=>M(s||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]}]}),jt]})]}),t.jsx("div",{className:"flex items-center gap-3 px-5 pb-0",children:t.jsx("div",{className:"flex-1",children:t.jsx(Et,{value:r.search,onChange:r.setSearch,placeholder:"Search for a Connection...",onKeyDown:s=>{s.key==="Escape"&&(r.setSearch(""),s.target.blur())}})})}),t.jsx(be.Content,{children:r.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:k.length===0?t.jsx(Ee,{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:H.map(s=>{if(s.type==="group")return t.jsx(wn,{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(Re,{children:[t.jsx(We,{asChild:!0,children:t.jsx(O,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:a=>a.stopPropagation(),children:t.jsx(Ke,{size:20})})}),t.jsxs(Xe,{align:"end",onClick:a=>a.stopPropagation(),children:[t.jsxs(ge,{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(ge,{variant:"destructive",onClick:a=>{a.stopPropagation(),f({type:"delete",connection:i})},children:[t.jsx(Ie,{size:16}),"Delete"]})]})]}),body:t.jsx(Pe,{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(_e,{id:i.updated_by??i.created_by,size:"3xs"})}),t.jsx("span",{className:"shrink-0 ml-2",children:i.updated_at?ke(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(En,{columns:gt,grouped:H,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(Ee,{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(Ee,{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(Pn,{count:x.size,total:k.length,onSelectAll:()=>{j(new Set(k.map(s=>s.id)))},onDeselectAll:()=>j(new Set),onDelete:()=>w(!0),onAddToAgent:()=>C(!0),onToggleStatus:ye,onCancel:W})]})}function Ws(){const o=fe.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(vt,{children:t.jsx(U.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(dn,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ln,{})})}),o[0]=e):e=o[0],e}export{Ws as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a0 as a,a1 as t}from"./index-B_0vsVr1.js";const e=a(t,{target:"draft-7"});export{e as B};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as R,u as W,e as A,d as X,K as Z,j as n,r as q,aE as J,B as ee,aD as te,b8 as ne}from"./index-B_0vsVr1.js";import{i as v}from"./Loading01-B3gOoSbd.js";import{c as ie}from"./binder-BXDCztlr.js";import{P as $}from"./topbar-portal-DOwsTUY4.js";import{u as se}from"./useQuery-DcRkCB2j.js";import{b as oe}from"./use-connection-DeEn4qfI.js";import{a as le,u as re,h as ce}from"./constants-D9bRXDQp.js";import{t as ae}from"./Settings01-BmEB9pVn.js";import{P as E}from"./index-QCmdl8uj.js";import"./use-collections-vccihohV.js";import"./useMutation-lBFQDcxE.js";import"./localstorage-keys-BAzeyS9J.js";import"./tooltip-Cz-bAWiO.js";import"./index-CvEIDmnk.js";function de(t,e){return t?t.filter(m=>ie(m,e)):[]}function K(t){return{id:t.id,title:t.title,icon:t.icon,description:t.description,app_name:t.app_name,app_id:t.app_id,tools:t.tools,metadata:t.metadata}}function me(t){const e=R.c(35),{binding:m,renderHeader:f,renderEmptyState:i}=t,{org:o,project:l}=W();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const{org:r,project:g,pluginId:u}=A(a),Q=oe(),{data:y}=X.useSession();let b;e[1]!==o.id?(b={connectionId:le,orgId:o.id},e[1]=o.id,e[2]=b):b=e[2];const H=re(b);let x;e[3]!==u||e[4]!==l.id?(x=Z.projectPluginConfig(l.id??"",u),e[3]=u,e[4]=l.id,e[5]=x):x=e[5];let p;e[6]!==u||e[7]!==l.id||e[8]!==H?(p=async()=>{const s=await H.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:l.id,pluginId:u}});return s.structuredContent??s},e[6]=u,e[7]=l.id,e[8]=H,e[9]=p):p=e[9];const T=!!l.id&&!!u;let _;e[10]!==x||e[11]!==p||e[12]!==T?(_={queryKey:x,queryFn:p,enabled:T},e[10]=x,e[11]=p,e[12]=T,e[13]=_):_=e[13];const{data:U,isLoading:Y}=se(_),D=de(Q,m),F=U?.config?.connectionId,j=F?D.find(s=>s.id===F):null,P=ce({connectionId:j?.id,orgId:o.id}),w=y?.user?{user:{id:y.user.id,name:y.user.name,email:y.user.email,image:y.user.image}}:null,z={id:o.id,slug:o.slug,name:o.name};if(Y){let s;return e[14]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),e[14]=s):s=e[14],s}if(D.length===0){const s={connectionId:null,connection:null,toolCaller:null,org:z,session:w};let c;e[15]!==i?(c=i(),e[15]=i,e[16]=c):c=e[16];let d;return e[17]!==c?(d=n.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:c}),e[17]=c,e[18]=d):d=e[18],n.jsx($,{value:s,children:d})}if(!j){const s={connectionId:null,connection:null,toolCaller:null,org:z,session:w};let c;e[19]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[n.jsx(ae,{size:48,className:"text-muted-foreground mb-2"}),n.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a connection to be configured. Go to project settings to select which integration to use."})]}),e[19]=c):c=e[19];const d=r??o.slug,O=g??l.slug??"";let L;return e[20]!==d||e[21]!==O?(L=n.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:[c,n.jsx(ee,{asChild:!0,children:n.jsx(te,{to:"/$org/$project/settings",params:{org:d,project:O},children:"Go to Project Settings"})})]}),e[20]=d,e[21]=O,e[22]=L):L=e[22],n.jsx($,{value:s,children:L})}let S;e[23]!==P?(S=(s,c)=>P?P.callTool({name:s,arguments:c}).then(fe):Promise.reject(new Error("MCP client is not available")),e[23]=P,e[24]=S):S=e[24];const V={connectionId:j.id,connection:K(j),toolCaller:S,org:z,session:w},B=E,G=E,k=E,M=f({connections:[K(j)],selectedConnectionId:j.id,onConnectionChange:ue});let h;e[25]!==M||e[26]!==k.Header.Left?(h=n.jsx(k.Header.Left,{children:M}),e[25]=M,e[26]=k.Header.Left,e[27]=h):h=e[27];let C;e[28]!==h||e[29]!==G.Header?(C=n.jsx(G.Header,{children:h}),e[28]=h,e[29]=G.Header,e[30]=C):C=e[30];let N;e[31]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(E.Content,{children:n.jsx(q.Suspense,{fallback:n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),children:n.jsx(J,{})})}),e[31]=N):N=e[31];let I;return e[32]!==B||e[33]!==C?(I=n.jsxs(B,{children:[C,N]}),e[32]=B,e[33]=C,e[34]=I):I=e[34],n.jsx($,{value:V,children:I})}function ue(){}function fe(t){return t.structuredContent??t}function Ee(){const t=R.c(12);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{pluginId:m}=A(e);let f;t[1]!==m?(f=ne.find(r=>r.id===m),t[1]=m,t[2]=f):f=t[2];const i=f;if(i?.renderHeader&&i?.renderEmptyState&&i?.binding){let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),t[3]=r):r=t[3];let g;return t[4]!==i.binding||t[5]!==i.renderEmptyState||t[6]!==i.renderHeader?(g=n.jsx(q.Suspense,{fallback:r,children:n.jsx(me,{binding:i.binding,renderHeader:i.renderHeader,renderEmptyState:i.renderEmptyState})}),t[4]=i.binding,t[5]=i.renderEmptyState,t[6]=i.renderHeader,t[7]=g):g=t[7],g}const o=i?.LayoutComponent;if(!o){let r;return t[8]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(J,{}),t[8]=r):r=t[8],r}let l;t[9]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),t[9]=l):l=t[9];let a;return t[10]!==o?(a=n.jsx(q.Suspense,{fallback:l,children:n.jsx(o,{})}),t[10]=o,t[11]=a):a=t[11],a}export{Ee as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,D as L,G as B,j as d,R as T,H as y,I,J as U,M as E,Q as _,T as q,U as w,W as K,X as V}from"./index-B_0vsVr1.js";var b="Radio",[H,P]=w(b),[z,W]=H(b),k=s.forwardRef((t,c)=>{const{__scopeRadio:o,name:n,checked:e=!1,required:r,disabled:a,value:l="on",onCheck:f,form:R,...v}=t,[p,m]=s.useState(null),i=I(c,x=>m(x)),u=s.useRef(!1),h=p?R||!!p.closest("form"):!0;return d.jsxs(z,{scope:o,checked:e,disabled:a,children:[d.jsx(y.button,{type:"button",role:"radio","aria-checked":e,"data-state":A(e),"data-disabled":a?"":void 0,disabled:a,value:l,...v,ref:i,onClick:E(t.onClick,x=>{e||f?.(),h&&(u.current=x.isPropagationStopped(),u.current||x.stopPropagation())})}),h&&d.jsx(S,{control:p,bubbles:!u.current,name:n,value:l,checked:e,required:r,disabled:a,form:R,style:{transform:"translateX(-100%)"}})]})});k.displayName=b;var G="RadioIndicator",g=s.forwardRef((t,c)=>{const{__scopeRadio:o,forceMount:n,...e}=t,r=W(G,o);return d.jsx(q,{present:n||r.checked,children:d.jsx(y.span,{"data-state":A(r.checked),"data-disabled":r.disabled?"":void 0,...e,ref:c})})});g.displayName=G;var X="RadioBubbleInput",S=s.forwardRef(({__scopeRadio:t,control:c,checked:o,bubbles:n=!0,...e},r)=>{const a=s.useRef(null),l=I(a,r),f=K(o),R=V(c);return s.useEffect(()=>{const v=a.current;if(!v)return;const p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==o&&i){const u=new Event("click",{bubbles:n});i.call(v,o),v.dispatchEvent(u)}},[f,o,n]),d.jsx(y.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...e,tabIndex:-1,ref:l,style:{...e.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});S.displayName=X;function A(t){return t?"checked":"unchecked"}var J=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],C="RadioGroup",[Q]=w(C,[_,P]),j=_(),N=P(),[Y,Z]=Q(C),D=s.forwardRef((t,c)=>{const{__scopeRadioGroup:o,name:n,defaultValue:e,value:r,required:a=!1,disabled:l=!1,orientation:f,dir:R,loop:v=!0,onValueChange:p,...m}=t,i=j(o),u=L(R),[h,x]=B({prop:r,defaultProp:e??null,onChange:p,caller:C});return d.jsx(Y,{scope:o,name:n,required:a,disabled:l,value:h,onValueChange:x,children:d.jsx(T,{asChild:!0,...i,orientation:f,dir:u,loop:v,children:d.jsx(y.div,{role:"radiogroup","aria-required":a,"aria-orientation":f,"data-disabled":l?"":void 0,dir:u,...m,ref:c})})})});D.displayName=C;var M="RadioGroupItem",O=s.forwardRef((t,c)=>{const{__scopeRadioGroup:o,disabled:n,...e}=t,r=Z(M,o),a=r.disabled||n,l=j(o),f=N(o),R=s.useRef(null),v=I(c,R),p=r.value===e.value,m=s.useRef(!1);return s.useEffect(()=>{const i=h=>{J.includes(h.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",u)}},[]),d.jsx(U,{asChild:!0,...l,focusable:!a,active:p,children:d.jsx(k,{disabled:a,required:r.required,checked:p,...f,...e,name:r.name,ref:v,onCheck:()=>r.onValueChange(e.value),onKeyDown:E(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:E(e.onFocus,()=>{m.current&&R.current?.click()})})})});O.displayName=M;var $="RadioGroupIndicator",F=s.forwardRef((t,c)=>{const{__scopeRadioGroup:o,...n}=t,e=N(o);return d.jsx(g,{...e,...n,ref:c})});F.displayName=$;var oe=D,re=O,te=F;export{re as I,oe as R,te as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as z,aC as D,j as s,aD as C,v as M,_ as F,r as T,e as J,u as U,O as L,aE as W,P as Z}from"./index-B_0vsVr1.js";import{S as v}from"./skeleton-C4ZMp7sl.js";import{u as q}from"./use-project-D96OXk4y.js";import{P as n}from"./index-QCmdl8uj.js";import{b as u,d as B,B as O,a as R,e as E,c as G}from"./breadcrumb-CGrLS5HH.js";import{n as K}from"./Container-CyEPuAYL.js";import{i as Q}from"./LayoutLeft-C-0_xlw0.js";import{t as V}from"./Settings01-BmEB9pVn.js";import{i as X}from"./Zap-5c_DBEtK.js";import"./useQuery-DcRkCB2j.js";import"./constants-D9bRXDQp.js";import"./localstorage-keys-BAzeyS9J.js";import"./useMutation-lBFQDcxE.js";import"./tooltip-Cz-bAWiO.js";import"./index-CvEIDmnk.js";import"./ChevronRight-BT7U8Kip.js";const Y=[{key:"general",label:"General",icon:s.jsx(V,{size:14})},{key:"dependencies",label:"Connections",icon:s.jsx(K,{size:14})},{key:"sidebar",label:"Sidebar",icon:s.jsx(Q,{size:14})},{key:"plugins",label:"Features",icon:s.jsx(X,{size:14})},{key:"danger",label:"Danger Zone",icon:s.jsx(F,{size:14})}];function ee(){const e=z.c(4),{location:l}=D();let r;e[0]!==l?(r=Y.map(i=>{const t=l.pathname.endsWith(`/settings/${i.key}`);return s.jsxs(C,{to:`/$org/$project/projects/$slug/settings/${i.key}`,className:M("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",t?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:i.icon}),s.jsx("span",{className:"truncate",children:i.label})]},i.key)}),e[0]=l,e[1]=r):r=e[1];let o;return e[2]!==r?(o=s.jsx("div",{className:"w-52 shrink-0 border-r border-border bg-sidebar/50 overflow-y-auto py-3 flex flex-col gap-0.5 px-2",children:r}),e[2]=r,e[3]=o):o=e[3],o}function H(){const e=z.c(3);let l,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(v,{className:"h-6 w-48"}),r=s.jsx(v,{className:"h-4 w-80"}),e[0]=l,e[1]=r):(l=e[0],r=e[1]);let o;return e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[l,r,s.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[s.jsx(v,{className:"h-12 w-full"}),s.jsx(v,{className:"h-12 w-full"})]})]}),e[2]=o):o=e[2],o}function se(){const e=z.c(41);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},e[0]=l):l=e[0];const r=J(l),{org:o}=U(),i=r.slug,{data:t,isLoading:A}=q(o.id,i);if(A||!t){let x;e[1]!==r.org?(x=s.jsx(u,{children:s.jsx(B,{asChild:!0,children:s.jsx(C,{to:"/$org/$project/projects",params:{org:r.org,project:L},children:"Projects"})})}),e[1]=r.org,e[2]=x):x=e[2];let P;e[3]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(E,{}),e[3]=P):P=e[3];let $;e[4]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(u,{children:s.jsx(G,{children:"Settings"})}),e[4]=$):$=e[4];let f;e[5]!==x?(f=s.jsx(n.Header,{children:s.jsx(n.Header.Left,{children:s.jsx(O,{children:s.jsxs(R,{children:[x,P,$]})})})}),e[5]=x,e[6]=f):f=e[6];let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(n.Content,{children:s.jsx("div",{className:"p-8",children:s.jsx(H,{})})}),e[7]=k):k=e[7];let N;return e[8]!==f?(N=s.jsxs(n,{children:[f,k]}),e[8]=f,e[9]=N):N=e[9],N}const w=t.slug===L;let h;e[10]!==t.description||e[11]!==t.enabledPlugins||e[12]!==t.id||e[13]!==t.name||e[14]!==t.organizationId||e[15]!==t.slug||e[16]!==t.ui||e[17]!==w?(h={id:t.id,organizationId:t.organizationId,slug:t.slug,name:t.name,description:t.description,enabledPlugins:t.enabledPlugins,ui:t.ui,isOrgAdmin:w},e[10]=t.description,e[11]=t.enabledPlugins,e[12]=t.id,e[13]=t.name,e[14]=t.organizationId,e[15]=t.slug,e[16]=t.ui,e[17]=w,e[18]=h):h=e[18];const I=h;let a;e[19]!==r.org?(a=s.jsx(u,{children:s.jsx(B,{asChild:!0,children:s.jsx(C,{to:"/$org/$project/projects",params:{org:r.org,project:L},children:"Projects"})})}),e[19]=r.org,e[20]=a):a=e[20];let g;e[21]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(E,{}),e[21]=g):g=e[21];let c;e[22]!==r.org||e[23]!==t.slug?(c={org:r.org,project:t.slug},e[22]=r.org,e[23]=t.slug,e[24]=c):c=e[24];let m;e[25]!==t.name||e[26]!==c?(m=s.jsx(u,{children:s.jsx(B,{asChild:!0,children:s.jsx(C,{to:"/$org/$project",params:c,children:t.name})})}),e[25]=t.name,e[26]=c,e[27]=m):m=e[27];let p;e[28]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(E,{}),e[28]=p):p=e[28];let b;e[29]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(u,{children:s.jsx(G,{children:"Settings"})}),e[29]=b):b=e[29];let d;e[30]!==a||e[31]!==m?(d=s.jsx(n.Header,{children:s.jsx(n.Header.Left,{children:s.jsx(O,{children:s.jsxs(R,{children:[a,g,m,p,b]})})})}),e[30]=a,e[31]=m,e[32]=d):d=e[32];let S;e[33]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(ee,{}),e[33]=S):S=e[33];let _;e[34]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(n.Content,{className:"flex",children:[S,s.jsx("div",{className:"flex-1 overflow-y-auto p-8",children:s.jsx(T.Suspense,{fallback:s.jsx(H,{}),children:s.jsx(W,{})})})]}),e[34]=_):_=e[34];let j;e[35]!==d?(j=s.jsxs(n,{children:[d,_]}),e[35]=d,e[36]=j):j=e[36];let y;return e[37]!==I||e[38]!==o||e[39]!==j?(y=s.jsx(Z,{org:o,project:I,children:j}),e[37]=I,e[38]=o,e[39]=j,e[40]=y):y=e[40],y}function pe(){const e=z.c(1);let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(T.Suspense,{fallback:null,children:s.jsx(se,{})}),e[0]=l):l=e[0],l}export{pe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aB as T,r as f,d as N,j as e,B as I,v as j,a as Y,S as q,N as G,c as H}from"./index-B_0vsVr1.js";import{u as F}from"./useMutation-lBFQDcxE.js";import{I as C}from"./input-CW7SVowR.js";function J({redirectUrl:s}){const{emailAndPassword:t,resetPassword:u}=T(),[a,l]=f.useState(""),[o,g]=f.useState(""),[p,S]=f.useState(""),[_,P]=f.useState(()=>globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[m,x]=f.useState(""),[k,h]=f.useState(!1),i=_==="signUp",b=_==="forgotPassword",w=F({mutationFn:async({email:r,password:n,name:V})=>{try{if(i){const c=await N.signUp.email({email:r,password:n,name:V||""});if(c.error)throw new Error(c.error.message||"Sign up failed");return c}else{const c=await N.signIn.email({email:r,password:n});if(c.error)throw new Error(c.error.message||"Sign in failed");return c}}catch(c){throw c instanceof Error?c:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),s&&(window.location.href=s)}}),v=F({mutationFn:async({email:r})=>{const n=await N.requestPasswordReset({email:r,redirectTo:"/reset-password"});if(n.error)throw new Error(n.error.message||"Failed to send reset email");return n},onSuccess:()=>{h(!0)}}),L=r=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r),R=()=>{a.trim()&&!L(a)&&x("Invalid email address")},M=r=>{if(r.preventDefault(),!L(a)){x("Invalid email address");return}w.mutate({email:a,password:o,name:p})},D=r=>{if(r.preventDefault(),!L(a)){x("Invalid email address");return}v.mutate({email:a})},E=r=>n=>{r(n.target.value),U&&w.reset(),z&&v.reset(),r===l&&m&&x("")},A=r=>{P(r),S(""),x(""),h(!1),w.reset(),v.reset()},d=w.isPending||v.isPending,U=w.error,z=v.error,y=i?a.trim()&&o.trim()&&p.trim():b?a.trim():a.trim()&&o.trim(),$=r=>{if(!r)return null;const n=r.message.toLowerCase();return n.includes("unauthorized")||n.includes("401")?"Invalid email or password. Please try again.":n.includes("already exists")||n.includes("409")?"An account with this email already exists. Try signing in instead.":n.includes("network")||n.includes("fetch")?"Network error. Please check your connection and try again.":n.includes("rate limit")||n.includes("429")?"Too many attempts. Please wait a moment and try again.":r.message||"An error occurred. Please try again."},B=U||z,O=b?"Reset your password":i?"Create your account":"Login or signup below";return e.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e.jsx("div",{className:"text-center space-y-1",children:e.jsx("p",{className:"text-sm text-foreground/70",children:O})}),B&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:$(B)}),k&&e.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Check your email for a password reset link."}),b&&t.enabled&&!k&&e.jsxs("form",{onSubmit:D,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(C,{type:"email",placeholder:"you@example.com",value:a,onChange:E(l),onBlur:R,required:!0,disabled:d,"aria-invalid":!!m}),m&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:m})]}),e.jsx(I,{type:"submit",disabled:d||!y,className:"w-full font-semibold",size:"lg",children:d?"Sending...":"Send reset link"})]}),!b&&t.enabled&&e.jsxs("form",{onSubmit:M,className:"grid gap-4",children:[e.jsx("div",{className:j("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",i?"max-h-[200px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsxs("div",{className:j("p-1",!i&&"pointer-events-none"),children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(C,{type:"text",placeholder:"Your name",value:p,onChange:E(S),required:!0,disabled:d||!i,"aria-hidden":!i})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(C,{type:"email",placeholder:"you@example.com",value:a,onChange:E(l),onBlur:R,required:!0,disabled:d,"aria-invalid":!!m}),m&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:m})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Password"}),!i&&u.enabled&&e.jsx("button",{type:"button",onClick:()=>A("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Forgot password?"})]}),e.jsx(C,{type:"password",placeholder:"••••••••",value:o,onChange:E(g),required:!0,disabled:d})]}),e.jsx("div",{className:j("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",y?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:j("p-1",!y&&"pointer-events-none"),children:e.jsx(I,{type:"submit",disabled:d||!y,className:j("w-full font-semibold"),size:"lg","aria-hidden":!y,children:d?i?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-center",children:b?e.jsx(I,{type:"button",variant:"link",onClick:()=>A("signIn"),disabled:d,className:"text-sm text-muted-foreground hover:text-foreground",children:"Back to sign in"}):e.jsx(I,{type:"button",variant:"link",onClick:()=>A(i?"signIn":"signUp"),disabled:d,className:"text-sm text-muted-foreground hover:text-foreground",children:i?"Already have an account? Sign in":"Don't have an account? Sign up"})}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground pt-4",children:[e.jsx("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Terms of Service"}),e.jsx("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Privacy Policy"})]})]})}function K(s){if(!s.client_id||s.response_type!=="code")return null;const t=new URLSearchParams;return s.client_id&&t.set("client_id",s.client_id),s.redirect_uri&&t.set("redirect_uri",s.redirect_uri),s.response_type&&t.set("response_type",s.response_type),s.state&&t.set("state",s.state),s.scope&&t.set("scope",s.scope),s.code_challenge&&t.set("code_challenge",s.code_challenge),s.code_challenge_method&&t.set("code_challenge_method",s.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function Q(s){const t=H.c(5),{callbackURL:u,providerId:a}=s;let l,o;t[0]!==u||t[1]!==a?(l=()=>{(async()=>await N.signIn.sso({providerId:a,callbackURL:u}))()},o=[a,u],t[0]=u,t[1]=a,t[2]=l,t[3]=o):(l=t[2],o=t[3]),f.useEffect(l,o);let g;return t[4]===Symbol.for("react.memo_cache_sentinel")?(g=e.jsx(q,{}),t[4]=g):g=t[4],g}function ee(){const s=N.useSession(),t=Y({from:"/login"}),{next:u="/",client_id:a,redirect_uri:l,response_type:o,state:g,scope:p,code_challenge:S,code_challenge_method:_}=t,{sso:P,emailAndPassword:m,magicLink:x,socialProviders:k}=T(),h=K({client_id:a,redirect_uri:l,response_type:o,state:g,scope:p,code_challenge:S,code_challenge_method:_}),i=h||u;return s.data?h?(window.location.href=h,e.jsx(q,{})):e.jsx(G,{to:u}):P.enabled?e.jsx(Q,{callbackURL:i,providerId:P.providerId}):m.enabled||x.enabled||k.enabled?e.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-brand to-brand/75 p-4",children:[e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--brand-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-brand-foreground/15"}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-brand-foreground/15"}),e.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-brand-foreground/15"}),e.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-brand-foreground/15"}),e.jsx(J,{redirectUrl:h})]})]}):e.jsx("div",{children:"No login options available"})}export{ee as default};
|