@decocms/mesh 2.125.0 → 2.125.1
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-BzYW4X7z.js → AlertCircle-DxaosN_f.js} +1 -1
- package/dist/client/assets/{AlertOctagon-CUysWl_m.js → AlertOctagon-cUZLNABf.js} +1 -1
- package/dist/client/assets/{AlertTriangle-DniGvpwb.js → AlertTriangle-4A_giHV7.js} +1 -1
- package/dist/client/assets/{ArrowDown-B35oswmj.js → ArrowDown-BCC90_2r.js} +1 -1
- package/dist/client/assets/{ArrowLeft-dS1h2Fqu.js → ArrowLeft-CPy9b3-I.js} +1 -1
- package/dist/client/assets/{ArrowUp-G8RCE5_O.js → ArrowUp-095f00XC.js} +1 -1
- package/dist/client/assets/{Check-Bv0pZ3gl.js → Check-DX81M4UN.js} +1 -1
- package/dist/client/assets/{CheckCircle-lzDHXhkH.js → CheckCircle-CIh-eFaM.js} +1 -1
- package/dist/client/assets/{CheckDone01-BrxNvWbF.js → CheckDone01-B4S514Pm.js} +1 -1
- package/dist/client/assets/{CheckVerified02-6wwLRSRQ.js → CheckVerified02-BZWM283O.js} +1 -1
- package/dist/client/assets/{ChevronDown-CggIFEVQ.js → ChevronDown-C_pFRqX8.js} +1 -1
- package/dist/client/assets/{ChevronRight-DgAfR8pA.js → ChevronRight-DY1xiCUb.js} +1 -1
- package/dist/client/assets/{Clock-IA7N95Qq.js → Clock-vSHk4lRO.js} +1 -1
- package/dist/client/assets/{Code01-DP2jwP0n.js → Code01-D3JhXTPK.js} +1 -1
- package/dist/client/assets/{Container-jfv9L6Hc.js → Container-adXBBWtI.js} +1 -1
- package/dist/client/assets/{Copy01-Dq7Edhtu.js → Copy01-y1kUbB69.js} +1 -1
- package/dist/client/assets/{Dataflow03-C6KAN8vb.js → Dataflow03-CGMAE4CD.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-CQ-MbYsC.js → DotsHorizontal-B48pfMoL.js} +1 -1
- package/dist/client/assets/{DotsVertical-PhooMqUv.js → DotsVertical-fI7whvq1.js} +1 -1
- package/dist/client/assets/{Download01-CA9RmYjX.js → Download01-CQdpB9dg.js} +1 -1
- package/dist/client/assets/{Edit01-DRruZKzG.js → Edit01-DV7i6b_1.js} +1 -1
- package/dist/client/assets/{Eye-B9ZDOUkE.js → Eye-0EEXzuIs.js} +1 -1
- package/dist/client/assets/{File02-B2t2I1sM.js → File02-DDGoV-pJ.js} +1 -1
- package/dist/client/assets/{File06-2US99J_V.js → File06-vlWs29hO.js} +1 -1
- package/dist/client/assets/{FilterLines-BFeSNY4D.js → FilterLines-C6hE4dxD.js} +1 -1
- package/dist/client/assets/{Globe01-Dxe6Kj1c.js → Globe01-YUJRKhi7.js} +1 -1
- package/dist/client/assets/{Globe02-BPmEw10H.js → Globe02-McmndEy1.js} +1 -1
- package/dist/client/assets/{Grid01-CJW4ZLO5.js → Grid01-D-UJvJ4U.js} +1 -1
- package/dist/client/assets/{Hash02-CIZbsu7P.js → Hash02-BsuEn6Tr.js} +1 -1
- package/dist/client/assets/{Home02-Doo3wLuN.js → Home02-BzWLDni0.js} +1 -1
- package/dist/client/assets/{Image01-C9h8llDV.js → Image01-D37M36hG.js} +1 -1
- package/dist/client/assets/{Inbox01-BweXezQd.js → Inbox01-A36zOoLA.js} +1 -1
- package/dist/client/assets/{InfoCircle-DBbArWGV.js → InfoCircle-BptNWRbo.js} +1 -1
- package/dist/client/assets/{Key01-CfL5jY3W.js → Key01-DTOaoO9L.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DAvzaXYE.js → LinkExternal01-s5AS-l6s.js} +1 -1
- package/dist/client/assets/{List-sG42OZ_v.js → List-ChBrkSt3.js} +1 -1
- package/dist/client/assets/{Loading01-BHMOj-H5.js → Loading01-C_dZ70Y_.js} +1 -1
- package/dist/client/assets/{Lock01-CQ3bhGvR.js → Lock01-BgYAZD0M.js} +1 -1
- package/dist/client/assets/{Pin01-8MTlfWD2.js → Pin01-m8Usx-G2.js} +1 -1
- package/dist/client/assets/{Play-APj1Lxit.js → Play-Dj27C0Pj.js} +1 -1
- package/dist/client/assets/{Plus-DNqvDLOK.js → Plus-Cqqd1qB7.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-4dzpBOob.js → RefreshCcw01-aEpj51K0.js} +1 -1
- package/dist/client/assets/{RefreshCw01-DHXbMDcX.js → RefreshCw01-CND9qgYc.js} +1 -1
- package/dist/client/assets/{Rows03-Cdgrgsit.js → Rows03-YSN8NfTb.js} +1 -1
- package/dist/client/assets/{Save01-D-T2SbCx.js → Save01-Cvritm34.js} +1 -1
- package/dist/client/assets/{SearchMd-BLcaRHQs.js → SearchMd-C2TJxhWh.js} +1 -1
- package/dist/client/assets/{Settings01-DKXbh8uh.js → Settings01-CUb7_xIo.js} +1 -1
- package/dist/client/assets/{Shield01-B89AcbSX.js → Shield01-BmOROuXR.js} +1 -1
- package/dist/client/assets/{Terminal-BblMM2fp.js → Terminal-Z3ZvfZjV.js} +1 -1
- package/dist/client/assets/{Trash01-CkTOgej8.js → Trash01-DGNEPK6E.js} +1 -1
- package/dist/client/assets/{Upload01-gcuuVZ2S.js → Upload01-Bu2dTgTN.js} +1 -1
- package/dist/client/assets/{Users03-C1B58zTV.js → Users03-21KXT9Tr.js} +1 -1
- package/dist/client/assets/{XCircle-DneNZUk0.js → XCircle-DtxTTf3G.js} +1 -1
- package/dist/client/assets/{XClose-Dgr_gyyv.js → XClose-aBNfOQCP.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-Dq0jl9Fh.js → agent-connections-preview-CUZdrftq.js} +1 -1
- package/dist/client/assets/{agent-detail-BNn3Uyo0.js → agent-detail-CQ93FkhV.js} +1 -1
- package/dist/client/assets/{agents-BAZxaM_m.js → agents-DH13svFw.js} +1 -1
- package/dist/client/assets/{alert-dialog-BvNipqK_.js → alert-dialog-CqcaYkiJ.js} +1 -1
- package/dist/client/assets/{auth-catchall-BoSUXTLZ.js → auth-catchall-D1O9ygtz.js} +1 -1
- package/dist/client/assets/{avatar-BNKSN34R.js → avatar-CLwmO-iu.js} +1 -1
- package/dist/client/assets/{badge-Do8iK9u9.js → badge-COxDM0wU.js} +1 -1
- package/dist/client/assets/{binder-BBB8LQyx.js → binder-BnqkDZhr.js} +1 -1
- package/dist/client/assets/{breadcrumb-DeYbtjMk.js → breadcrumb-DNLwlIVn.js} +1 -1
- package/dist/client/assets/{button-D6YZfFzy.js → button-Bh5FwGIY.js} +1 -1
- package/dist/client/assets/{card-BNyCnFpQ.js → card-CQpD36Cd.js} +1 -1
- package/dist/client/assets/{chart--8-symKO.js → chart-CJ0LfYbL.js} +1 -1
- package/dist/client/assets/{checkbox-BZwARXIv.js → checkbox-2aSR3jmV.js} +1 -1
- package/dist/client/assets/{circle-alert-YjViK8VE.js → circle-alert-CkvRYvnb.js} +1 -1
- package/dist/client/assets/{collection-detail-LkGK1rw-.js → collection-detail-egzLIo3p.js} +1 -1
- package/dist/client/assets/{collection-search-CBYSITVU.js → collection-search-By6ZMwtA.js} +1 -1
- package/dist/client/assets/{collection-tab-BrrYAQmN.js → collection-tab-DFeE5Fu9.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-fNhnYl-G.js → collection-table-wrapper-BRK1q11U.js} +1 -1
- package/dist/client/assets/{collection-tabs-D0bfkNrY.js → collection-tabs-BtVgWqaS.js} +1 -1
- package/dist/client/assets/{command-Dt3t7o57.js → command-BaS-0Wfh.js} +1 -1
- package/dist/client/assets/{connect-DPEGql6L.js → connect-3VJmRE1h.js} +1 -1
- package/dist/client/assets/{connection-card-Cwh5xUmA.js → connection-card-B91SZISg.js} +1 -1
- package/dist/client/assets/{connection-detail-DgHwxZSJ.js → connection-detail-mo3MA2Xi.js} +1 -1
- package/dist/client/assets/{connections-D2AuzZXu.js → connections-CE3xmstM.js} +1 -1
- package/dist/client/assets/constants-Bg8UqzBy.js +1 -0
- package/dist/client/assets/{constants-8URKDp4Y.js → constants-DnuxEo5s.js} +1 -1
- package/dist/client/assets/{context-DHicyHl4.js → context-DKu_mHFC.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-Cb3EQpzl.js → create-organization-dialog-De0OX1Zl.js} +1 -1
- package/dist/client/assets/{create-project-dialog-BjqZAjhY.js → create-project-dialog-lv0TRMx_.js} +1 -1
- package/dist/client/assets/{deco-constants-CyaJG-D1.js → deco-constants-CTtPnJzR.js} +1 -1
- package/dist/client/assets/{dialog-DSPMVHyJ.js → dialog-BYwNnwwA.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CRT7qGQ9.js → dropdown-menu-usbHDlIZ.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-Dj3hkiA6.js → dynamic-plugin-layout-d2sr4Zos.js} +1 -1
- package/dist/client/assets/{empty-state-BA6UkF4p.js → empty-state-BmmycNCG.js} +1 -1
- package/dist/client/assets/{empty-state-sMx3NP6e.js → empty-state-D0ORcC9s.js} +1 -1
- package/dist/client/assets/{env-vars-editor-DuW-Il-b.js → env-vars-editor-CEsz7coi.js} +1 -1
- package/dist/client/assets/{error-boundary-lFjWy2-n.js → error-boundary-BLEw7xWo.js} +1 -1
- package/dist/client/assets/{extract-connection-data-B39uuFqG.js → extract-connection-data-BReoF993.js} +1 -1
- package/dist/client/assets/{file-browser-BIF8ssgw.js → file-browser-BwHr0_f-.js} +2 -2
- package/dist/client/assets/{form-BMtUcs2k.js → form-Cci_0GHL.js} +1 -1
- package/dist/client/assets/{grid-view-e1dnT7b5.js → grid-view-DxVImF1W.js} +1 -1
- package/dist/client/assets/{home-1A3rDo1n.js → home-EcK31mDl.js} +1 -1
- package/dist/client/assets/{index-CjGa0AXv.js → index-B9KDyGv1.js} +1 -1
- package/dist/client/assets/{index-QQ-XmLlG.js → index-CJPy6tkz.js} +1 -1
- package/dist/client/assets/{index-DnrfuViL.js → index-Cqq1nFO_.js} +1 -1
- package/dist/client/assets/{index-DmoBx0VC.js → index-CzbRSFGS.js} +1 -1
- package/dist/client/assets/{index-DwBgLSti.js → index-D52JGBSW.js} +24 -24
- package/dist/client/assets/{index-B_nMIrSY.js → index-DH9RHGRj.js} +1 -1
- package/dist/client/assets/{index-DJ_LDW-E.js → index-DMSLkGyV.js} +1 -1
- package/dist/client/assets/{index-CCjxSJ1y.js → index-TP7Ym6Gi.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-Yvt0ZTml.js → infiniteQueryObserver-DXqCWbrQ.js} +1 -1
- package/dist/client/assets/{input-B7id4I1j.js → input--zCus1rn.js} +1 -1
- package/dist/client/assets/{integration-icon-qV_BsBQR.js → integration-icon-B4lXAd2V.js} +1 -1
- package/dist/client/assets/{label-29qY4FPs.js → label-Dt9hwfoA.js} +1 -1
- package/dist/client/assets/{layout-Ck3H2-cu.js → layout-Desge4fu.js} +1 -1
- package/dist/client/assets/{localstorage-keys-Ct4C992S.js → localstorage-keys-DFOUclc3.js} +1 -1
- package/dist/client/assets/{login-DO8QasPa.js → login-ZxDL_xXY.js} +1 -1
- package/dist/client/assets/{markdown-jp5pFlBz.js → markdown-B_rkr1OY.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Bb9gvF4o.js → mcp-oauth-g19aHl5R.js} +1 -1
- package/dist/client/assets/{mcp-server-card-D_Epc4aH.js → mcp-server-card-PYGzaKTV.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-Dut9IDFd.js → mcp-server-detail-sq3Zve-q.js} +2 -2
- package/dist/client/assets/{members-4s3A4PQH.js → members-Dko3OMBs.js} +1 -1
- package/dist/client/assets/{monitoring-gEkChCwS.js → monitoring-25vjnX5K.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-edit-DyFCcJjq.js → monitoring-dashboard-edit-APi27Lyy.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-Bc4tCiDF.js → monitoring-dashboard-view-BTgDG7Qr.js} +1 -1
- package/dist/client/assets/{oauth-callback-tz7MTdrq.js → oauth-callback-C2TJ9rrs.js} +1 -1
- package/dist/client/assets/{page-YrzfNFn-.js → page-BuCrRSmo.js} +1 -1
- package/dist/client/assets/{page-pkTyp5rB.js → page-C2P203ja.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-dEbxXjO6.js → plugin-empty-state-BiS9FDyZ.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-YsTdKC2B.js → plugin-empty-state-CJIaoSBt.js} +1 -1
- package/dist/client/assets/{plugin-header-Di-tZc0h.js → plugin-header-BMhkjONo.js} +1 -1
- package/dist/client/assets/{plugin-header-Djvd0-eL.js → plugin-header-Be_rW9BG.js} +1 -1
- package/dist/client/assets/{popover-pjzQQlLd.js → popover-C4pJDbzd.js} +1 -1
- package/dist/client/assets/project-layout-a9ZljoS8.js +1 -0
- package/dist/client/assets/{projects-list-DcozT0tR.js → projects-list-bxq1MrSm.js} +1 -1
- package/dist/client/assets/{ranking-layout-D3PvNfv7.js → ranking-layout-DEmm60_H.js} +1 -1
- package/dist/client/assets/{readme-viewer-BmO5RwRH.js → readme-viewer-5tvDeQHi.js} +1 -1
- package/dist/client/assets/{registry-layout-DEN2jHtD.js → registry-layout-CJhj9rcX.js} +1 -1
- package/dist/client/assets/{registry-utils-DMdc5PTp.js → registry-utils-DEhTjpqF.js} +1 -1
- package/dist/client/assets/{reports-layout-DziFQRp_.js → reports-layout-fQTBEwe0.js} +1 -1
- package/dist/client/assets/{reset-password-CrHLBBwi.js → reset-password-ez0ppaGq.js} +1 -1
- package/dist/client/assets/{resizable-jXkpfiVS.js → resizable-C26aI2AS.js} +1 -1
- package/dist/client/assets/{save-actions-BPg_8VMI.js → save-actions-Dv1nRyHY.js} +1 -1
- package/dist/client/assets/{scroll-area-CcejXaMp.js → scroll-area-DcJFHDMz.js} +1 -1
- package/dist/client/assets/{select-CkeKfTEx.js → select-DEG2HUsU.js} +1 -1
- package/dist/client/assets/shell-layout-BXZeCKqs.js +3 -0
- package/dist/client/assets/{skeleton-DNLZ4Kho.js → skeleton-_QoQu65Z.js} +1 -1
- package/dist/client/assets/{spinner-DZtD-MX0.js → spinner-CpcUYhT9.js} +1 -1
- package/dist/client/assets/{store-invite-B_jz8YSY.js → store-invite-BI-C3Ger.js} +1 -1
- package/dist/client/assets/{switch-DFKxfcc5.js → switch-Yifr4LYd.js} +1 -1
- package/dist/client/assets/{table-Csfk_VXo.js → table-BE49uKeW.js} +1 -1
- package/dist/client/assets/{tasks-Dv2Dq-cV.js → tasks-_TSvuWWo.js} +1 -1
- package/dist/client/assets/{textarea-GWXLFYfv.js → textarea-DGrDCMYg.js} +1 -1
- package/dist/client/assets/{time-range-picker-DnUGZRLa.js → time-range-picker-D-bxceyA.js} +1 -1
- package/dist/client/assets/{toggle-group-CojJ3wZ4.js → toggle-group-BDPgnYqc.js} +1 -1
- package/dist/client/assets/{tools-list-BPGP3JUO.js → tools-list-DmG41xlg.js} +1 -1
- package/dist/client/assets/{tooltip-D71dCz4E.js → tooltip-DJR7bz1l.js} +1 -1
- package/dist/client/assets/{topbar-portal-BKT0Es8i.js → topbar-portal-CoIDsv0w.js} +1 -1
- package/dist/client/assets/{typewriter-title-DqLjhGgL.js → typewriter-title-EJB9gire.js} +1 -1
- package/dist/client/assets/{use-binding-DbH4Xe03.js → use-binding-Cs2Y-PcQ.js} +1 -1
- package/dist/client/assets/{use-connection-BEGrPCmR.js → use-connection-Dj9QSNVL.js} +1 -1
- package/dist/client/assets/{use-copy-DsHlaDHD.js → use-copy-D7PzOc0z.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BzTARjrD.js → use-create-virtual-mcp-B-HizY93.js} +1 -1
- package/dist/client/assets/{use-deco-chat-open-CxG3qwlT.js → use-deco-chat-open-C86CtM_I.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-CSDJ0ZgD.js → use-install-from-registry-C8e-6Etm.js} +1 -1
- package/dist/client/assets/{use-list-state-DvpdPuz-.js → use-list-state-CmfVe0Sz.js} +1 -1
- package/dist/client/assets/{use-llm-BbYG_RIr.js → use-llm-C_wGfF_N.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-qD8uHlkj.js → use-mcp-prompts-CFUruqMt.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BAsmCzEJ.js → use-mcp-tools-CjZtbvY1.js} +1 -1
- package/dist/client/assets/{use-mobile-Bs0AkxK7.js → use-mobile-DBGLvQCZ.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BJ9tNAL9.js → use-organization-settings-DFBQM6OB.js} +1 -1
- package/dist/client/assets/{use-project-CXHCn5kp.js → use-project-cfHYfzp_.js} +1 -1
- package/dist/client/assets/{use-settings-modal-Dx8IF1Gs.js → use-settings-modal-D3XdLMRO.js} +1 -1
- package/dist/client/assets/{use-view-mode-DMPiUC22.js → use-view-mode-DyCv_xrc.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DBzFAk7J.js → use-virtual-mcp-ctHrpgTx.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BSv9hDZn.js +1 -0
- package/dist/client/assets/{useMutation-DgG1LVg-.js → useMutation-B8qgpkUA.js} +1 -1
- package/dist/client/assets/useQuery--0jbogka.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DU-5JWKq.js +1 -0
- package/dist/client/assets/{view-mode-toggle-2-qyK3LU.js → view-mode-toggle-DnPBouL3.js} +1 -1
- package/dist/client/assets/{workflow-YppA7Sxi.js → workflow-Dfnb1_XD.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/constants-oXq_cTdm.js +0 -1
- package/dist/client/assets/project-layout-Bp5s1iI1.js +0 -1
- package/dist/client/assets/shell-layout-C4PQ301W.js +0 -3
- package/dist/client/assets/useInfiniteQuery-DXQ7BtjQ.js +0 -1
- package/dist/client/assets/useQuery-CPsXfVfR.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CuH1Eku2.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as X,j as t,b as Re,O as Se,aE as at,u as ct,bA as Ge,ai as vt,p as yt,by as Xe,r as Y,o as lt,b8 as Nt,bg as _t,s as W,aj as Je,ak as Ct,e as St,a as Tt,m as wt,k as kt,l as Pt,i as It,t as Ce,K as Ye}from"./index-DwBgLSti.js";import{E as Ne}from"./empty-state-sMx3NP6e.js";import{E as dt}from"./error-boundary-lFjWy2-n.js";import{E as $t,r as At,e as mt}from"./env-vars-editor-DuW-Il-b.js";import{P as Ke}from"./index-DnrfuViL.js";import{S as Vt}from"./save-actions-BPg_8VMI.js";import{b as Mt,a as Dt}from"./use-binding-DbH4Xe03.js";import{u as Ot,S as Et}from"./index-CCjxSJ1y.js";import{f as We,g as ut}from"./use-connection-BEGrPCmR.js";import{u as Rt}from"./constants-8URKDp4Y.js";import{d as Lt}from"./use-mcp-tools-BAsmCzEJ.js";import{b as Ut,d as Ft}from"./use-mcp-prompts-qD8uHlkj.js";import{a as Bt}from"./mcp-oauth-Bb9gvF4o.js";import{b as Ze,c as zt,d as Xt,e as Kt,B as Wt,a as qt}from"./breadcrumb-DeYbtjMk.js";import{B as Be}from"./button-D6YZfFzy.js";import{C as Ht}from"./collection-tabs-D0bfkNrY.js";import{i as Ee}from"./Loading01-BHMOj-H5.js";import{V as qe,a as Qt}from"./layout-Ck3H2-cu.js";import{C as Gt}from"./collection-tab-BrrYAQmN.js";import{I as Le}from"./integration-icon-qV_BsBQR.js";import{B as ze}from"./badge-Do8iK9u9.js";import{D as Jt,a as Yt,b as Zt,c as et}from"./dropdown-menu-CRT7qGQ9.js";import{F as G,a as es,b as J,d as q,f as Z,c as te,e as ts}from"./form-BMtUcs2k.js";import{I as ee}from"./input-B7id4I1j.js";import{S as tt,a as st,b as nt,c as ot,d as Q}from"./select-CkeKfTEx.js";import{i as pt}from"./CheckCircle-lzDHXhkH.js";import{t as ss}from"./ChevronDown-CggIFEVQ.js";import{n as ns}from"./Container-jfv9L6Hc.js";import{s as Oe}from"./Globe02-BPmEw10H.js";import{s as os}from"./RefreshCcw01-4dzpBOob.js";import{i as rs}from"./Terminal-BblMM2fp.js";import{s as is}from"./Trash01-CkTOgej8.js";import{t as He}from"./Users03-C1B58zTV.js";import{s as as}from"./XClose-Dgr_gyyv.js";import{U as cs}from"./use-list-state-DvpdPuz-.js";import{b as ls,a as ds}from"./use-virtual-mcp-DBzFAk7J.js";import{i as ms}from"./ChevronRight-DgAfR8pA.js";import{s as us}from"./Plus-DNqvDLOK.js";import{f as ps}from"./formatDistanceToNow-Cb2QZZJn.js";import{a as ft,C as xt}from"./collection-table-wrapper-fNhnYl-G.js";import{C as ht}from"./collection-search-CBYSITVU.js";import{C as gt}from"./card-BNyCnFpQ.js";import{R as fs}from"./readme-viewer-BmO5RwRH.js";import{T as xs}from"./tools-list-BPGP3JUO.js";import"./AlertTriangle-DniGvpwb.js";import"./tooltip-D71dCz4E.js";import"./Pin01-8MTlfWD2.js";import"./use-organization-settings-BJ9tNAL9.js";import"./useMutation-DgG1LVg-.js";import"./Save01-D-T2SbCx.js";import"./binder-BBB8LQyx.js";import"./File06-2US99J_V.js";import"./Key01-CfL5jY3W.js";import"./constants-oXq_cTdm.js";import"./registry-utils-DMdc5PTp.js";import"./extract-connection-data-B39uuFqG.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-CSDJ0ZgD.js";import"./index-DJ_LDW-E.js";import"./circle-alert-YjViK8VE.js";import"./index-DmoBx0VC.js";import"./index-QQ-XmLlG.js";import"./context-DHicyHl4.js";import"./decopilot-events-Brt4gAR6.js";import"./use-llm-BbYG_RIr.js";import"./useQuery-CPsXfVfR.js";import"./localstorage-keys-Ct4C992S.js";import"./skeleton-DNLZ4Kho.js";import"./popover-pjzQQlLd.js";import"./Grid01-CJW4ZLO5.js";import"./Image01-C9h8llDV.js";import"./SearchMd-BLcaRHQs.js";import"./Settings01-DKXbh8uh.js";import"./useSuspenseInfiniteQuery-CuH1Eku2.js";import"./infiniteQueryObserver-Yvt0ZTml.js";import"./spinner-DZtD-MX0.js";import"./dialog-DSPMVHyJ.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-G8RCE5_O.js";import"./Edit01-DRruZKzG.js";import"./XCircle-DneNZUk0.js";import"./AlertCircle-BzYW4X7z.js";import"./use-deco-chat-open-CxG3qwlT.js";import"./ArrowLeft-dS1h2Fqu.js";import"./use-copy-DsHlaDHD.js";import"./Check-Bv0pZ3gl.js";import"./Code01-DP2jwP0n.js";import"./use-create-virtual-mcp-BzTARjrD.js";import"./deco-constants-CyaJG-D1.js";import"./Copy01-Dq7Edhtu.js";import"./marked.esm-BaswSlok.js";import"./markdown-jp5pFlBz.js";import"./Eye-B9ZDOUkE.js";import"./Clock-IA7N95Qq.js";import"./index-B_nMIrSY.js";import"./use-mobile-Bs0AkxK7.js";import"./DotsVertical-PhooMqUv.js";import"./empty-state-BA6UkF4p.js";import"./Inbox01-BweXezQd.js";import"./alert-dialog-BvNipqK_.js";import"./label-29qY4FPs.js";import"./avatar-BNKSN34R.js";import"./use-view-mode-DMPiUC22.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowDown-B35oswmj.js";import"./List-sG42OZ_v.js";import"./view-mode-toggle-2-qyK3LU.js";import"./table-Csfk_VXo.js";import"./RefreshCw01-DHXbMDcX.js";function hs(s){const e=X.c(14),{virtualMcp:n,org:o}=s;let r;e[0]!==o||e[1]!==n.id?(r={org:o,project:Se,agentId:n.id},e[0]=o,e[1]=n.id,e[2]=r):r=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(He,{size:16}),e[3]=a):a=e[3];let c;e[4]!==n.icon||e[5]!==n.title?(c=t.jsx(Le,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[4]=n.icon,e[5]=n.title,e[6]=c):c=e[6];let u;e[7]!==n.title?(u=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ms,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=f):f=e[9];let l;return e[10]!==r||e[11]!==c||e[12]!==u?(l=t.jsxs(at,{to:"/$org/$project/agents/$agentId",params:r,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[c,u,f]}),e[10]=r,e[11]=c,e[12]=u,e[13]=l):l=e[13],l}function rt(s){const e=X.c(20),{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:a,org:c,hasExistingVirtualMcps:u}=s,f=Re(),l=ds();let x;e[0]!==l.create||e[1]!==r||e[2]!==a||e[3]!==n||e[4]!==o||e[5]!==f||e[6]!==c?(x=async()=>{const m=await l.create.mutateAsync({title:`${o} Agent`,description:r??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:c,project:Se,agentId:m.id}})},e[0]=l.create,e[1]=r,e[2]=a,e[3]=n,e[4]=o,e[5]=f,e[6]=c,e[7]=x):x=e[7];const p=x;if(u){let m;e[8]!==l.create.isPending?(m=l.create.isPending?t.jsx(Ee,{size:16,className:"animate-spin"}):t.jsx(us,{size:16}),e[8]=l.create.isPending,e[9]=m):m=e[9];let d;return e[10]!==l.create.isPending||e[11]!==p||e[12]!==m?(d=t.jsx(Be,{variant:"ghost",className:"size-6 p-0",onClick:p,disabled:l.create.isPending,children:m}),e[10]=l.create.isPending,e[11]=p,e[12]=m,e[13]=d):d=e[13],d}let i;e[14]!==l.create.isPending?(i=l.create.isPending?t.jsx(Ee,{className:"animate-spin text-muted-foreground"}):t.jsx(He,{className:"size-3 text-muted-foreground"}),e[14]=l.create.isPending,e[15]=i):i=e[15];let b;return e[16]!==l.create.isPending||e[17]!==p||e[18]!==i?(b=t.jsxs(Be,{variant:"outline",size:"sm",onClick:p,disabled:l.create.isPending,children:[i,"Create an agent"]}),e[16]=l.create.isPending,e[17]=p,e[18]=i,e[19]=b):b=e[19],b}function gs(s){const e=X.c(26),{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:a,org:c}=s;let u;e[0]!==n?(u={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=u):u=e[1];const f=ls(u);if(!(f.length>0)){let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=d):d=e[2];let j;return e[3]!==r||e[4]!==a||e[5]!==n||e[6]!==o||e[7]!==c?(j=t.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[d,t.jsx(rt,{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:a,org:c,hasExistingVirtualMcps:!1})]}),e[3]=r,e[4]=a,e[5]=n,e[6]=o,e[7]=c,e[8]=j):j=e[8],j}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 p;e[10]!==r||e[11]!==a||e[12]!==n||e[13]!==o||e[14]!==c?(p=t.jsx("div",{className:"flex flex-col gap-1",children:t.jsxs("div",{className:"flex items-center justify-between",children:[x,t.jsx(rt,{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:a,org:c,hasExistingVirtualMcps:!0})]})}),e[10]=r,e[11]=a,e[12]=n,e[13]=o,e[14]=c,e[15]=p):p=e[15];let i;if(e[16]!==c||e[17]!==f){let d;e[19]!==c?(d=j=>t.jsx(hs,{virtualMcp:j,org:c},j.id),e[19]=c,e[20]=d):d=e[20],i=f.map(d),e[16]=c,e[17]=f,e[18]=i}else i=e[18];let b;e[21]!==i?(b=t.jsx("div",{className:"flex flex-col gap-2",children:i}),e[21]=i,e[22]=b):b=e[22];let m;return e[23]!==p||e[24]!==b?(m=t.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[p,b]}),e[23]=p,e[24]=b,e[25]=m):m=e[25],m}function js({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:r}){const a=Ge({control:s.control,name:"ui_type"}),c=Ge({control:s.control,name:"connection_url"}),{stdioEnabled:u}=vt(),f=(()=>{if(typeof c!="string"||!c)return!1;try{const i=new URL(c);return i.hostname==="api.githubcopilot.com"&&i.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),l=u||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?yt(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(He,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{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(tt,{value:i.value,onValueChange:i.onChange,children:[t.jsx(q,{children:t.jsxs(st,{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(Oe,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(nt,{})]})}),t.jsxs(ot,{children:[t.jsx(Q,{value:"HTTP",children:"HTTP"}),t.jsx(Q,{value:"SSE",children:"SSE"}),t.jsx(Q,{value:"Websocket",children:"Websocket"}),l&&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(G,{control:s.control,name:"connection_url",render:({field:b})=>t.jsx(J,{className:"flex-1 min-w-0",children:t.jsx(q,{children:t.jsx(ee,{placeholder:"https://example.com/mcp",...b,value:b.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(tt,{value:i.value,onValueChange:i.onChange,children:[t.jsx(q,{children:t.jsx(st,{className:"h-10",children:t.jsx(nt,{})})}),t.jsxs(ot,{children:[t.jsx(Q,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(Q,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(Q,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ns,{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(rs,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(Z,{})]})}),a==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"@perplexity-ai/mcp-server",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})}),a==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"node, bun, python...",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"arg1 arg2 --flag value",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(Z,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"/path/to/project (optional)",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})})]}),(a==="NPX"||a==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(q,{children:t.jsx($t,{value:i.value??[],onChange:i.onChange})}),t.jsx(Z,{})]})}),a!=="NPX"&&a!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{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(Jt,{children:[t.jsx(Yt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(ze,{variant:"success",className:"gap-1.5",children:[t.jsx(pt,{size:12}),"Authenticated via OAuth",t.jsx(ss,{size:12})]})})}),t.jsxs(Zt,{align:"start",children:[t.jsxs(et,{onClick:o,children:[t.jsx(os,{size:16}),"Re-authenticate"]}),t.jsxs(et,{variant:"destructive",onClick:r,children:[t.jsx(is,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&i.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:()=>i.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(as,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(ee,{type:"password",placeholder:f?"Paste your GitHub PAT":"Enter access token...",...i,value:i.value||"",className:"h-10 rounded-lg"})}),f&&t.jsxs(ts,{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(Z,{})]})})]})}function bs(s){const e=X.c(43),{form:n,connection:o,isMCPAuthenticated:r,hasOAuthToken:a,onReauthenticate:c,onRemoveOAuth:u}=s,{org:f}=ct();let l;e[0]!==o.icon||e[1]!==o.title?(l=t.jsx(Le,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}),e[0]=o.icon,e[1]=o.title,e[2]=l):l=e[2];let x;e[3]!==n.control?(x=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(G,{control:n.control,name:"title",render:ys}),t.jsx(G,{control:n.control,name:"description",render:vs})]}),e[3]=n.control,e[4]=x):x=e[4];let p;e[5]!==l||e[6]!==x?(p=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[l,x]}),e[5]=l,e[6]=x,e[7]=p):p=e[7];let i;e[8]!==o||e[9]!==n||e[10]!==a||e[11]!==c||e[12]!==u?(i=t.jsx(js,{form:n,connection:o,hasOAuthToken:a,onReauthenticate:c,onRemoveOAuth:u}),e[8]=o,e[9]=n,e[10]=a,e[11]=c,e[12]=u,e[13]=i):i=e[13];let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[14]=b):b=e[14];let m;e[15]!==r?(m=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[b,r?t.jsxs(ze,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[t.jsx(pt,{size:12}),"Connected"]}):t.jsx(ze,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[15]=r,e[16]=m):m=e[16];let d;e[17]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[17]=d):d=e[17];let j;e[18]!==o.created_by?(j=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[d,t.jsx(cs,{id:o.created_by,size:"2xs"})]}),e[18]=o.created_by,e[19]=j):j=e[19];let w;e[20]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[20]=w):w=e[20];let v;e[21]!==o.updated_at?(v=o.updated_at?ps(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[21]=o.updated_at,e[22]=v):v=e[22];let N;e[23]!==v?(N=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[w,t.jsx("span",{className:"text-sm text-foreground",children:v})]}),e[23]=v,e[24]=N):N=e[24];let _;e[25]!==N||e[26]!==m||e[27]!==j?(_=t.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[m,j,N]}),e[25]=N,e[26]=m,e[27]=j,e[28]=_):_=e[28];let y;e[29]!==o.description||e[30]!==o.icon||e[31]!==o.id||e[32]!==o.title||e[33]!==f.slug?(y=t.jsx(gs,{connectionId:o.id,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,org:f.slug}),e[29]=o.description,e[30]=o.icon,e[31]=o.id,e[32]=o.title,e[33]=f.slug,e[34]=y):y=e[34];let h;e[35]!==_||e[36]!==y||e[37]!==p||e[38]!==i?(h=t.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[p,i,_,y]}),e[35]=_,e[36]=y,e[37]=p,e[38]=i,e[39]=h):h=e[39];let k;return e[40]!==n||e[41]!==h?(k=t.jsx(es,{...n,children:h}),e[40]=n,e[41]=h,e[42]=k):k=e[42],k}function vs(s){const{field:e}=s;return t.jsxs(J,{className:"w-full space-y-0",children:[t.jsx(q,{children:t.jsx(ee,{...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(Z,{})]})}function ys(s){const{field:e}=s;return t.jsxs(J,{className:"flex-1 space-y-0",children:[t.jsx(q,{children:t.jsx(ee,{...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(Z,{})]})}function Ns(s){const e=X.c(42),{prompts:n,connectionId:o,org:r,connectionTitle:a,connectionIcon:c,onPromptClick:u,showToolbar:f,emptyMessage:l}=s,x=f===void 0?!0:f,p=l===void 0?"This connection doesn't have any prompts yet.":l,i=Re(),m=Xe().location.href,[d,j]=Y.useState(""),[w,v]=Y.useState("table"),[N,_]=Y.useState("name"),[y,h]=Y.useState("asc");let k;e[0]!==y||e[1]!==N?(k=S=>{N===S?(h(ws),y==="desc"&&_(void 0)):(_(S),h("asc"))},e[0]=y,e[1]=N,e[2]=k):k=e[2];const B=k;let $;e[3]!==o||e[4]!==i||e[5]!==u||e[6]!==r?($=S=>{u?u(S):o&&r&&i({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:Se,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(S.name)}})},e[3]=o,e[4]=i,e[5]=u,e[6]=r,e[7]=$):$=e[7];const M=$;let A;if(e[8]!==n||e[9]!==d||e[10]!==y||e[11]!==N){const S=!n||n.length===0?[]:d.trim()?(()=>{const H=d.toLowerCase();return n.filter(K=>K.name.toLowerCase().includes(H)||K.description&&K.description.toLowerCase().includes(H))})():n;A=!N||!y?S:[...S].sort((H,K)=>{const se=H[N]||"",ne=K[N]||"",oe=String(se).localeCompare(String(ne));return y==="asc"?oe:-oe}),e[8]=n,e[9]=d,e[10]=y,e[11]=N,e[12]=A}else A=e[12];const I=A;let R;e[13]===Symbol.for("react.memo_cache_sentinel")?(R=[{id:"name",header:"Name",render:Ts,sortable:!0},{id:"description",header:"Description",render:Ss,cellClassName:"flex-1",sortable:!0}],e[13]=R):R=e[13];const L=R;let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=L.filter(Cs).map(_s),e[14]=C):C=e[14];const z=C;let P;e[15]!==c||e[16]!==a||e[17]!==B||e[18]!==x||e[19]!==y||e[20]!==N||e[21]!==m||e[22]!==w?(P=x&&t.jsxs(qe,{children:[t.jsx(xt,{viewMode:w,onViewModeChange:v,sortKey:N,sortDirection:y,onSort:B,sortOptions:z}),t.jsx(Ke,{title:a?`${a}: Prompts`:"Prompts",url:m,icon:c??"description"})]}),e[15]=c,e[16]=a,e[17]=B,e[18]=x,e[19]=y,e[20]=N,e[21]=m,e[22]=w,e[23]=P):P=e[23];let D;e[24]===Symbol.for("react.memo_cache_sentinel")?(D=S=>{S.key==="Escape"&&(j(""),S.target.blur())},e[24]=D):D=e[24];let V;e[25]!==d?(V=t.jsx(ht,{value:d,onChange:j,placeholder:"Search prompts...",onKeyDown:D}),e[25]=d,e[26]=V):V=e[26];let g;e[27]!==p||e[28]!==M||e[29]!==B||e[30]!==d||e[31]!==y||e[32]!==N||e[33]!==I||e[34]!==w?(g=w==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:I.length===0?t.jsx(Ne,{image:null,title:d?"No prompts found":"No prompts available",description:d?"Try adjusting your search terms":p}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:I.map(S=>t.jsx(gt,{className:"cursor-pointer transition-colors",onClick:()=>M(S),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Le,{icon:null,name:S.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:S.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:S.description||"No description"})]})]})},S.name))})}):t.jsx(ft,{columns:L,data:I,isLoading:!1,sortKey:N,sortDirection:y,onSort:B,onRowClick:S=>M(S),emptyState:t.jsx(Ne,{image:null,title:d?"No prompts found":"No prompts available",description:d?"Try adjusting your search terms":p})}),e[27]=p,e[28]=M,e[29]=B,e[30]=d,e[31]=y,e[32]=N,e[33]=I,e[34]=w,e[35]=g):g=e[35];let F;e[36]!==V||e[37]!==g?(F=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[V,g]}),e[36]=V,e[37]=g,e[38]=F):F=e[38];let O;return e[39]!==F||e[40]!==P?(O=t.jsxs(t.Fragment,{children:[P,F]}),e[39]=F,e[40]=P,e[41]=O):O=e[41],O}function _s(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Cs(s){return s.sortable}function Ss(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 ws(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function ks(s){const e=X.c(6),{prompts:n,connectionId:o,org:r}=s,a=We(o),c=a?.title,u=a?.icon;let f;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==c||e[4]!==u?(f=t.jsx(Ns,{prompts:n,connectionId:o,org:r,connectionTitle:c,connectionIcon:u}),e[0]=o,e[1]=r,e[2]=n,e[3]=c,e[4]=u,e[5]=f):f=e[5],f}function Ps(s){const e=X.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(fs,{repository:n})}),e[0]=n,e[1]=o):o=e[1],o}function Is(s){const e=X.c(39),{resources:n,connectionTitle:o,connectionIcon:r,onResourceClick:a,showToolbar:c,emptyMessage:u}=s,f=c===void 0?!0:c,l=u===void 0?"This connection doesn't have any resources yet.":u,p=Xe().location.href,[i,b]=Y.useState(""),[m,d]=Y.useState("table"),[j,w]=Y.useState("name"),[v,N]=Y.useState("asc");let _;e[0]!==v||e[1]!==j?(_=g=>{j===g?(N(Es),v==="desc"&&w(void 0)):(w(g),N("asc"))},e[0]=v,e[1]=j,e[2]=_):_=e[2];const y=_;let h;e[3]!==a?(h=g=>{a&&a(g)},e[3]=a,e[4]=h):h=e[4];const k=h;let B;if(e[5]!==n||e[6]!==i||e[7]!==v||e[8]!==j){const g=!n||n.length===0?[]:i.trim()?(()=>{const F=i.toLowerCase();return n.filter(O=>O.uri.toLowerCase().includes(F)||O.name&&O.name.toLowerCase().includes(F)||O.description&&O.description.toLowerCase().includes(F))})():n;B=!j||!v?g:[...g].sort((F,O)=>{const S=F[j]||"",H=O[j]||"",K=String(S).localeCompare(String(H));return v==="asc"?K:-K}),e[5]=n,e[6]=i,e[7]=v,e[8]=j,e[9]=B}else B=e[9];const $=B;let M;e[10]===Symbol.for("react.memo_cache_sentinel")?(M=[{id:"name",header:"Name",render:Os,sortable:!0},{id:"uri",header:"URI",render:Ds,sortable:!0},{id:"description",header:"Description",render:Ms,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Vs,sortable:!0}],e[10]=M):M=e[10];const A=M;let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=A.filter(As).map($s),e[11]=I):I=e[11];const R=I;let L;e[12]!==r||e[13]!==o||e[14]!==y||e[15]!==f||e[16]!==v||e[17]!==j||e[18]!==p||e[19]!==m?(L=f&&t.jsxs(qe,{children:[t.jsx(xt,{viewMode:m,onViewModeChange:d,sortKey:j,sortDirection:v,onSort:y,sortOptions:R}),t.jsx(Ke,{title:o?`${o}: Resources`:"Resources",url:p,icon:r??"folder"})]}),e[12]=r,e[13]=o,e[14]=y,e[15]=f,e[16]=v,e[17]=j,e[18]=p,e[19]=m,e[20]=L):L=e[20];let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=g=>{g.key==="Escape"&&(b(""),g.target.blur())},e[21]=C):C=e[21];let z;e[22]!==i?(z=t.jsx(ht,{value:i,onChange:b,placeholder:"Search resources...",onKeyDown:C}),e[22]=i,e[23]=z):z=e[23];let P;e[24]!==l||e[25]!==k||e[26]!==y||e[27]!==i||e[28]!==v||e[29]!==j||e[30]!==$||e[31]!==m?(P=m==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:$.length===0?t.jsx(Ne,{image:null,title:i?"No resources found":"No resources available",description:i?"Try adjusting your search terms":l}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:$.map(g=>t.jsx(gt,{className:"cursor-pointer transition-colors",onClick:()=>k(g),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Le,{icon:null,name:g.name||g.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:g.name||g.uri}),t.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:g.uri}),g.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:g.description})]})]})},g.uri))})}):t.jsx(ft,{columns:A,data:$,isLoading:!1,sortKey:j,sortDirection:v,onSort:y,onRowClick:g=>k(g),emptyState:t.jsx(Ne,{image:null,title:i?"No resources found":"No resources available",description:i?"Try adjusting your search terms":l})}),e[24]=l,e[25]=k,e[26]=y,e[27]=i,e[28]=v,e[29]=j,e[30]=$,e[31]=m,e[32]=P):P=e[32];let D;e[33]!==z||e[34]!==P?(D=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[z,P]}),e[33]=z,e[34]=P,e[35]=D):D=e[35];let V;return e[36]!==D||e[37]!==L?(V=t.jsxs(t.Fragment,{children:[L,D]}),e[36]=D,e[37]=L,e[38]=V):V=e[38],V}function $s(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function As(s){return s.sortable}function Vs(s){return t.jsx("span",{className:"text-sm text-muted-foreground",children:s.mimeType||"—"})}function Ms(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ds(s){return t.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:s.uri})}function Os(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 Rs(s){const e=X.c(6),{resources:n,connectionId:o,org:r}=s,a=We(o),c=a?.title,u=a?.icon;let f;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==c||e[4]!==u?(f=t.jsx(Is,{resources:n,connectionId:o,org:r,connectionTitle:c,connectionIcon:u}),e[0]=o,e[1]=r,e[2]=n,e[3]=c,e[4]=u,e[5]=f):f=e[5],f}const Ls=lt({key:W().min(1,"Key is required"),value:W()}),Us=lt({title:W().min(1,"Name is required"),description:W().nullable().optional(),ui_type:Ct(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:W().optional(),connection_token:W().nullable().optional(),npx_package:W().optional(),stdio_command:W().optional(),stdio_args:W().optional(),stdio_cwd:W().optional(),env_vars:Je(Ls).optional(),configuration_scopes:Je(W()).nullable().optional(),configuration_state:Nt(W(),_t()).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 Fs(s){const e=X.c(5),{tools:n,connectionId:o,org:r,isLoading:a}=s;let c;return e[0]!==o||e[1]!==a||e[2]!==r||e[3]!==n?(c=t.jsx(xs,{tools:n,connectionId:o,org:r,isLoading:a}),e[0]=o,e[1]=a,e[2]=r,e[3]=n,e[4]=c):c=e[4],c}function Bs(s){return s.command==="npx"}function zs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Xs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Ks(s,e){const n={command:"npx",args:["-y",s]},o=mt(e);return Object.keys(o).length>0&&(n.envVars=o),n}function Ws(s,e,n,o){const r={command:s};e.trim()&&(r.args=e.trim().split(/\s+/)),n?.trim()&&(r.cwd=n.trim());const a=mt(o);return Object.keys(a).length>0&&(r.envVars=a),r}function it(s,e){const n={title:s.title,description:s.description??"",configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&It(s.connection_headers)){const o=s.connection_headers,r=At(o.envVars);if(Bs(o)){const c=zs(o);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const a=Xs(o);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function qs(s){let e,n=null,o=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Ks(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Ws(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,connection_type:e,connection_url:n,...o&&{connection_token:o},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function Hs(s){const e=X.c(117),{connection:n,connectionId:o,org:r,requestedTabId:a,collections:c,onUpdate:u,isUpdating:f,prompts:l,resources:x,tools:p,isLoadingTools:i}=s;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={from:"/$org/$project/mcps/$connectionId"},e[0]=b):b=e[0];const m=Re(b),d=wt(),w=Xe().location.href,v=ut();let N;e[1]!==o?(N={connectionId:o},e[1]=o,e[2]=N):N=e[2];const _=Ot(N),h=n?.connection_type==="VIRTUAL"||_.isAuthenticated;let k;e[3]!==n?(k={connections:[n],binding:"MCP"},e[3]=n,e[4]=k):k=e[4];const $=Dt(k).length>0,M=n?.metadata?.repository,A=!!M?.url;let I;e[5]===Symbol.for("react.memo_cache_sentinel")?(I=kt(Us),e[5]=I):I=e[5];let R;e[6]!==n?(R=it(n),e[6]=n,e[7]=R):R=e[7];let L;e[8]!==R?(L={resolver:I,values:R},e[8]=R,e[9]=L):L=e[9];const C=Pt(L),z=C.formState.isDirty;let P;e[10]!==C||e[11]!==u?(P=async()=>{if(!await C.trigger())return;const U=C.getValues(),ye=qs(U);await u(ye),C.reset(U)},e[10]=C,e[11]=u,e[12]=P):P=e[12];const D=P;let V;e[13]!==n||e[14]!==C?(V=()=>{C.reset(it(n))},e[13]=n,e[14]=C,e[15]=V):V=e[15];const g=V;let F;e[16]!==n.id||e[17]!==v||e[18]!==d?(F=async()=>{const{token:T,tokenInfo:U,error:ye}=await Bt({connectionId:n.id});if(ye||!T){Ce.error(`Authentication failed: ${ye}`);return}if(U)try{const De=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:U.accessToken,refreshToken:U.refreshToken,expiresIn:U.expiresIn,scope:U.scope,clientId:U.clientId,clientSecret:U.clientSecret,tokenEndpoint:U.tokenEndpoint})});if(!De.ok)console.error("Failed to save OAuth token:",await De.text()),await v.update.mutateAsync({id:n.id,data:{connection_token:T}});else try{await v.update.mutateAsync({id:n.id,data:{}})}catch(Qe){console.warn("Failed to refresh connection tools after OAuth:",Qe)}}catch(De){console.error("Error saving OAuth token:",De),await v.update.mutateAsync({id:n.id,data:{connection_token:T}})}else await v.update.mutateAsync({id:n.id,data:{connection_token:T}});const bt=new URL(`/mcp/${n.id}`,window.location.origin);await d.invalidateQueries({queryKey:Ye.isMCPAuthenticated(bt.href,null)}),Ce.success("Authentication successful")},e[16]=n.id,e[17]=v,e[18]=d,e[19]=F):F=e[19];const O=F;let S;e[20]!==n.id||e[21]!==d?(S=async()=>{try{const T=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!T.ok){const ye=await T.text();Ce.error(`Failed to remove OAuth: ${ye}`);return}const U=new URL(`/mcp/${n.id}`,window.location.origin);await d.invalidateQueries({queryKey:Ye.isMCPAuthenticated(U.href,null)}),Ce.success("OAuth removed. You can now re-authenticate with a different account.")}catch(T){console.error("Error removing OAuth token:",T),Ce.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=d,e[22]=S):S=e[22];const H=S,K=p.length,se=l.length,ne=x.length,oe=K>0||i;let Te;e[23]===Symbol.for("react.memo_cache_sentinel")?(Te={id:"settings",label:"Settings"},e[23]=Te):Te=e[23];let re;e[24]!==i||e[25]!==h||e[26]!==oe||e[27]!==K?(re=h&&oe?[{id:"tools",label:"Tools",count:i?void 0:K}]:[],e[24]=i,e[25]=h,e[26]=oe,e[27]=K,e[28]=re):re=e[28];let ie;e[29]!==h||e[30]!==se?(ie=h&&se>0?[{id:"prompts",label:"Prompts",count:se}]:[],e[29]=h,e[30]=se,e[31]=ie):ie=e[31];let ae;e[32]!==h||e[33]!==ne?(ae=h&&ne>0?[{id:"resources",label:"Resources",count:ne}]:[],e[32]=h,e[33]=ne,e[34]=ae):ae=e[34];let we;if(e[35]!==c||e[36]!==A||e[37]!==h||e[38]!==re||e[39]!==ie||e[40]!==ae){let T;e[42]!==A?(T=A?[{id:"readme",label:"README"}]:[],e[42]=A,e[43]=T):T=e[43],we=[Te,...re,...ie,...ae,...h?(c||[]).map(Gs):[],...T],e[35]=c,e[36]=A,e[37]=h,e[38]=re,e[39]=ie,e[40]=ae,e[41]=we}else we=e[41];const _e=we,jt=h&&_e.some(Qs)?"tools":"settings",E=_e.some(T=>T.id===a)?a:jt;let ke;e[44]!==m?(ke=T=>{m({search:U=>({...U,tab:T}),replace:!0})},e[44]=m,e[45]=ke):ke=e[45];const ce=ke;let le;e[46]!==c?(le=c||[],e[46]=c,e[47]=le):le=e[47];let Pe;if(e[48]!==E||e[49]!==le){let T;e[51]!==E?(T=U=>U.name===E,e[51]=E,e[52]=T):T=e[52],Pe=le.find(T),e[48]=E,e[49]=le,e[50]=Pe}else Pe=e[50];const Ie=Pe;let de;e[53]!==r?(de=t.jsx(Ze,{children:t.jsx(Xt,{asChild:!0,children:t.jsx(at,{to:"/$org/$project/mcps",params:{org:r,project:Se},children:"Connections"})})}),e[53]=r,e[54]=de):de=e[54];let $e;e[55]===Symbol.for("react.memo_cache_sentinel")?($e=t.jsx(Kt,{}),e[55]=$e):$e=e[55];let me;e[56]!==n.title?(me=t.jsx(Ze,{children:t.jsx(zt,{children:n.title})}),e[56]=n.title,e[57]=me):me=e[57];let Ae;e[58]!==de||e[59]!==me?(Ae=t.jsx(Wt,{children:t.jsxs(qt,{children:[de,$e,me]})}),e[58]=de,e[59]=me,e[60]=Ae):Ae=e[60];const Ue=Ae;let ue;e[61]!==D||e[62]!==g||e[63]!==z||e[64]!==f?(ue=t.jsx(Vt,{onSave:D,onUndo:g,isDirty:z,isSaving:f}),e[61]=D,e[62]=g,e[63]=z,e[64]=f,e[65]=ue):ue=e[65];const Fe=n.icon??"settings";let pe;e[66]!==n.title||e[67]!==Fe||e[68]!==w?(pe=t.jsx(Ke,{title:n.title,url:w,icon:Fe}),e[66]=n.title,e[67]=Fe,e[68]=w,e[69]=pe):pe=e[69];let fe;e[70]!==ue||e[71]!==pe?(fe=t.jsxs(qe,{children:[ue,pe]}),e[70]=ue,e[71]=pe,e[72]=fe):fe=e[72];let xe;e[73]!==_.hasOAuthToken||e[74]!==n||e[75]!==C||e[76]!==O||e[77]!==H||e[78]!==h?(xe=t.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:t.jsx(bs,{form:C,connection:n,isMCPAuthenticated:h,hasOAuthToken:_.hasOAuthToken,onReauthenticate:O,onRemoveOAuth:H})}),e[73]=_.hasOAuthToken,e[74]=n,e[75]=C,e[76]=O,e[77]=H,e[78]=h,e[79]=xe):xe=e[79];let he;e[80]!==E||e[81]!==ce||e[82]!==_e?(he=t.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:t.jsx(Ht,{tabs:_e,activeTab:E,onTabChange:ce,className:"flex-1"})}),e[80]=E,e[81]=ce,e[82]=_e,e[83]=he):he=e[83];let Ve;e[84]===Symbol.for("react.memo_cache_sentinel")?(Ve=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Ee,{size:32,className:"animate-spin text-muted-foreground"})}),e[84]=Ve):Ve=e[84];let ge;e[85]!==Ie||e[86]!==E||e[87]!==_.isServerError||e[88]!==_.supportsOAuth||e[89]!==n||e[90]!==o||e[91]!==C||e[92]!==O||e[93]!==ce||e[94]!==$||e[95]!==A||e[96]!==i||e[97]!==h||e[98]!==r||e[99]!==l||e[100]!==M||e[101]!==x||e[102]!==p?(ge=t.jsx(Y.Suspense,{fallback:Ve,children:E==="tools"?t.jsx(Fs,{tools:p,connectionId:o,org:r,isLoading:i}):E==="prompts"?t.jsx(ks,{prompts:l,connectionId:o,org:r}):E==="resources"?t.jsx(Rs,{resources:x,connectionId:o,org:r}):E==="settings"?t.jsx(Et,{connection:n,form:C,hasMcpBinding:$,isMCPAuthenticated:h,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:O,onViewReadme:A?()=>ce("readme"):void 0}):E==="readme"&&A?t.jsx(Ps,{repository:M}):Ie&&h?t.jsx(Gt,{connectionId:o,org:r,activeCollection:Ie},E):t.jsx(Ne,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[85]=Ie,e[86]=E,e[87]=_.isServerError,e[88]=_.supportsOAuth,e[89]=n,e[90]=o,e[91]=C,e[92]=O,e[93]=ce,e[94]=$,e[95]=A,e[96]=i,e[97]=h,e[98]=r,e[99]=l,e[100]=M,e[101]=x,e[102]=p,e[103]=ge):ge=e[103];let je;e[104]!==E||e[105]!==ge?(je=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(dt,{children:ge},E)}),e[104]=E,e[105]=ge,e[106]=je):je=e[106];let be;e[107]!==he||e[108]!==je?(be=t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[he,je]}),e[107]=he,e[108]=je,e[109]=be):be=e[109];let ve;e[110]!==xe||e[111]!==be?(ve=t.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[xe,be]}),e[110]=xe,e[111]=be,e[112]=ve):ve=e[112];let Me;return e[113]!==Ue||e[114]!==fe||e[115]!==ve?(Me=t.jsxs(Qt,{breadcrumb:Ue,children:[fe,ve]}),e[113]=Ue,e[114]=fe,e[115]=ve,e[116]=Me):Me=e[116],Me}function Qs(s){return s.id==="tools"}function Gs(s){return{id:s.name,label:s.displayName}}function Js(){const s=X.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=Re(e);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/$project/mcps/$connectionId"},s[1]=o):o=s[1];const{connectionId:r,org:a}=St(o),{org:c}=ct();let u;s[2]===Symbol.for("react.memo_cache_sentinel")?(u={from:"/shell/$org/$project/mcps/$connectionId"},s[2]=u):u=s[2];const l=Tt(u).tab??"",x=We(r),p=ut(),i=Mt(x??void 0);let b;s[3]!==r||s[4]!==c.id?(b={connectionId:r,orgId:c.id},s[3]=r,s[4]=c.id,s[5]=b):b=s[5];const m=Rt(b);let d;s[6]!==m?(d={client:m},s[6]=m,s[7]=d):d=s[7];const{data:j}=Ut(d);let w;s[8]!==m?(w={client:m},s[8]=m,s[9]=w):w=s[9];const{data:v}=Ft(w),_=!(x?.connection_type==="VIRTUAL")&&x?.tools&&x.tools.length>0,y=!_;let h;s[10]!==m||s[11]!==y?(h={client:m,enabled:y},s[10]=m,s[11]=y,s[12]=h):h=s[12];const{data:k,isLoading:B}=Lt(h);let $;s[13]!==j?.prompts?($=j?.prompts??[],s[13]=j?.prompts,s[14]=$):$=s[14];let M;s[15]!==$?(M=$.map(en),s[15]=$,s[16]=M):M=s[16];const A=M;let I;s[17]!==v?.resources?(I=v?.resources??[],s[17]=v?.resources,s[18]=I):I=s[18];let R;s[19]!==I?(R=I.map(Zs),s[19]=I,s[20]=R):R=s[20];const L=R;let C;s[21]!==x||s[22]!==_||s[23]!==k?.tools?(C=_?x.tools??[]:(k?.tools??[]).map(Ys),s[21]=x,s[22]=_,s[23]=k?.tools,s[24]=C):C=s[24];const z=C;let P;s[25]!==p.update||s[26]!==r?(P=async g=>{await p.update.mutateAsync({id:r,data:g})},s[25]=p.update,s[26]=r,s[27]=P):P=s[27];const D=P;if(!x){let g;return s[28]!==n||s[29]!==a?(g=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ne,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(Be,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:a,project:Se}}),children:"Back to connections"})})}),s[28]=n,s[29]=a,s[30]=g):g=s[30],g}let V;return s[31]!==p.update.isPending||s[32]!==i||s[33]!==x||s[34]!==r||s[35]!==D||s[36]!==B||s[37]!==a||s[38]!==A||s[39]!==l||s[40]!==L||s[41]!==z?(V=t.jsx(Hs,{org:a,connection:x,connectionId:r,requestedTabId:l,collections:i,onUpdate:D,isUpdating:p.update.isPending,prompts:A,resources:L,tools:z,isLoadingTools:B}),s[31]=p.update.isPending,s[32]=i,s[33]=x,s[34]=r,s[35]=D,s[36]=B,s[37]=a,s[38]=A,s[39]=l,s[40]=L,s[41]=z,s[42]=V):V=s[42],V}function Ys(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations}}function Zs(s){return{uri:s.uri,name:s.name,description:s.description}}function en(s){return{name:s.name,description:s.description}}function tn(){const s=X.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(dt,{children:t.jsx(Y.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ee,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Js,{})})}),s[0]=e):e=s[0],e}function ar(){const s=X.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tn,{}),s[0]=e):e=s[0],e}export{ar as default};
|
|
1
|
+
import{c as X,j as t,b as Re,O as Se,aE as at,u as ct,bA as Ge,ai as vt,p as yt,by as Xe,r as Y,o as lt,b8 as Nt,bg as _t,s as W,aj as Je,ak as Ct,e as St,a as Tt,m as wt,k as kt,l as Pt,i as It,t as Ce,K as Ye}from"./index-D52JGBSW.js";import{E as Ne}from"./empty-state-D0ORcC9s.js";import{E as dt}from"./error-boundary-BLEw7xWo.js";import{E as $t,r as At,e as mt}from"./env-vars-editor-CEsz7coi.js";import{P as Ke}from"./index-Cqq1nFO_.js";import{S as Vt}from"./save-actions-Dv1nRyHY.js";import{b as Mt,a as Dt}from"./use-binding-Cs2Y-PcQ.js";import{u as Ot,S as Et}from"./index-TP7Ym6Gi.js";import{f as We,g as ut}from"./use-connection-Dj9QSNVL.js";import{u as Rt}from"./constants-DnuxEo5s.js";import{d as Lt}from"./use-mcp-tools-CjZtbvY1.js";import{b as Ut,d as Ft}from"./use-mcp-prompts-CFUruqMt.js";import{a as Bt}from"./mcp-oauth-g19aHl5R.js";import{b as Ze,c as zt,d as Xt,e as Kt,B as Wt,a as qt}from"./breadcrumb-DNLwlIVn.js";import{B as Be}from"./button-Bh5FwGIY.js";import{C as Ht}from"./collection-tabs-BtVgWqaS.js";import{i as Ee}from"./Loading01-C_dZ70Y_.js";import{V as qe,a as Qt}from"./layout-Desge4fu.js";import{C as Gt}from"./collection-tab-DFeE5Fu9.js";import{I as Le}from"./integration-icon-B4lXAd2V.js";import{B as ze}from"./badge-COxDM0wU.js";import{D as Jt,a as Yt,b as Zt,c as et}from"./dropdown-menu-usbHDlIZ.js";import{F as G,a as es,b as J,d as q,f as Z,c as te,e as ts}from"./form-Cci_0GHL.js";import{I as ee}from"./input--zCus1rn.js";import{S as tt,a as st,b as nt,c as ot,d as Q}from"./select-DEG2HUsU.js";import{i as pt}from"./CheckCircle-CIh-eFaM.js";import{t as ss}from"./ChevronDown-C_pFRqX8.js";import{n as ns}from"./Container-adXBBWtI.js";import{s as Oe}from"./Globe02-McmndEy1.js";import{s as os}from"./RefreshCcw01-aEpj51K0.js";import{i as rs}from"./Terminal-Z3ZvfZjV.js";import{s as is}from"./Trash01-DGNEPK6E.js";import{t as He}from"./Users03-21KXT9Tr.js";import{s as as}from"./XClose-aBNfOQCP.js";import{U as cs}from"./use-list-state-CmfVe0Sz.js";import{b as ls,a as ds}from"./use-virtual-mcp-ctHrpgTx.js";import{i as ms}from"./ChevronRight-DY1xiCUb.js";import{s as us}from"./Plus-Cqqd1qB7.js";import{f as ps}from"./formatDistanceToNow-Cb2QZZJn.js";import{a as ft,C as xt}from"./collection-table-wrapper-BRK1q11U.js";import{C as ht}from"./collection-search-By6ZMwtA.js";import{C as gt}from"./card-CQpD36Cd.js";import{R as fs}from"./readme-viewer-5tvDeQHi.js";import{T as xs}from"./tools-list-DmG41xlg.js";import"./AlertTriangle-4A_giHV7.js";import"./tooltip-DJR7bz1l.js";import"./Pin01-m8Usx-G2.js";import"./use-organization-settings-DFBQM6OB.js";import"./useMutation-B8qgpkUA.js";import"./Save01-Cvritm34.js";import"./binder-BnqkDZhr.js";import"./File06-vlWs29hO.js";import"./Key01-DTOaoO9L.js";import"./constants-Bg8UqzBy.js";import"./registry-utils-DEhTjpqF.js";import"./extract-connection-data-BReoF993.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-C8e-6Etm.js";import"./index-DMSLkGyV.js";import"./circle-alert-CkvRYvnb.js";import"./index-CzbRSFGS.js";import"./index-CJPy6tkz.js";import"./context-DKu_mHFC.js";import"./decopilot-events-Brt4gAR6.js";import"./use-llm-C_wGfF_N.js";import"./useQuery--0jbogka.js";import"./localstorage-keys-DFOUclc3.js";import"./skeleton-_QoQu65Z.js";import"./popover-C4pJDbzd.js";import"./Grid01-D-UJvJ4U.js";import"./Image01-D37M36hG.js";import"./SearchMd-C2TJxhWh.js";import"./Settings01-CUb7_xIo.js";import"./useSuspenseInfiniteQuery-DU-5JWKq.js";import"./infiniteQueryObserver-DXqCWbrQ.js";import"./spinner-CpcUYhT9.js";import"./dialog-BYwNnwwA.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-095f00XC.js";import"./Edit01-DV7i6b_1.js";import"./XCircle-DtxTTf3G.js";import"./AlertCircle-DxaosN_f.js";import"./use-deco-chat-open-C86CtM_I.js";import"./ArrowLeft-CPy9b3-I.js";import"./use-copy-D7PzOc0z.js";import"./Check-DX81M4UN.js";import"./Code01-D3JhXTPK.js";import"./use-create-virtual-mcp-B-HizY93.js";import"./deco-constants-CTtPnJzR.js";import"./Copy01-y1kUbB69.js";import"./marked.esm-BaswSlok.js";import"./markdown-B_rkr1OY.js";import"./Eye-0EEXzuIs.js";import"./Clock-vSHk4lRO.js";import"./index-DH9RHGRj.js";import"./use-mobile-DBGLvQCZ.js";import"./DotsVertical-fI7whvq1.js";import"./empty-state-BmmycNCG.js";import"./Inbox01-A36zOoLA.js";import"./alert-dialog-CqcaYkiJ.js";import"./label-Dt9hwfoA.js";import"./avatar-CLwmO-iu.js";import"./use-view-mode-DyCv_xrc.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowDown-BCC90_2r.js";import"./List-ChBrkSt3.js";import"./view-mode-toggle-DnPBouL3.js";import"./table-BE49uKeW.js";import"./RefreshCw01-CND9qgYc.js";function hs(s){const e=X.c(14),{virtualMcp:n,org:o}=s;let r;e[0]!==o||e[1]!==n.id?(r={org:o,project:Se,agentId:n.id},e[0]=o,e[1]=n.id,e[2]=r):r=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(He,{size:16}),e[3]=a):a=e[3];let c;e[4]!==n.icon||e[5]!==n.title?(c=t.jsx(Le,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[4]=n.icon,e[5]=n.title,e[6]=c):c=e[6];let u;e[7]!==n.title?(u=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ms,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=f):f=e[9];let l;return e[10]!==r||e[11]!==c||e[12]!==u?(l=t.jsxs(at,{to:"/$org/$project/agents/$agentId",params:r,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[c,u,f]}),e[10]=r,e[11]=c,e[12]=u,e[13]=l):l=e[13],l}function rt(s){const e=X.c(20),{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:a,org:c,hasExistingVirtualMcps:u}=s,f=Re(),l=ds();let x;e[0]!==l.create||e[1]!==r||e[2]!==a||e[3]!==n||e[4]!==o||e[5]!==f||e[6]!==c?(x=async()=>{const m=await l.create.mutateAsync({title:`${o} Agent`,description:r??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:c,project:Se,agentId:m.id}})},e[0]=l.create,e[1]=r,e[2]=a,e[3]=n,e[4]=o,e[5]=f,e[6]=c,e[7]=x):x=e[7];const p=x;if(u){let m;e[8]!==l.create.isPending?(m=l.create.isPending?t.jsx(Ee,{size:16,className:"animate-spin"}):t.jsx(us,{size:16}),e[8]=l.create.isPending,e[9]=m):m=e[9];let d;return e[10]!==l.create.isPending||e[11]!==p||e[12]!==m?(d=t.jsx(Be,{variant:"ghost",className:"size-6 p-0",onClick:p,disabled:l.create.isPending,children:m}),e[10]=l.create.isPending,e[11]=p,e[12]=m,e[13]=d):d=e[13],d}let i;e[14]!==l.create.isPending?(i=l.create.isPending?t.jsx(Ee,{className:"animate-spin text-muted-foreground"}):t.jsx(He,{className:"size-3 text-muted-foreground"}),e[14]=l.create.isPending,e[15]=i):i=e[15];let b;return e[16]!==l.create.isPending||e[17]!==p||e[18]!==i?(b=t.jsxs(Be,{variant:"outline",size:"sm",onClick:p,disabled:l.create.isPending,children:[i,"Create an agent"]}),e[16]=l.create.isPending,e[17]=p,e[18]=i,e[19]=b):b=e[19],b}function gs(s){const e=X.c(26),{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:a,org:c}=s;let u;e[0]!==n?(u={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=u):u=e[1];const f=ls(u);if(!(f.length>0)){let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=d):d=e[2];let j;return e[3]!==r||e[4]!==a||e[5]!==n||e[6]!==o||e[7]!==c?(j=t.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[d,t.jsx(rt,{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:a,org:c,hasExistingVirtualMcps:!1})]}),e[3]=r,e[4]=a,e[5]=n,e[6]=o,e[7]=c,e[8]=j):j=e[8],j}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 p;e[10]!==r||e[11]!==a||e[12]!==n||e[13]!==o||e[14]!==c?(p=t.jsx("div",{className:"flex flex-col gap-1",children:t.jsxs("div",{className:"flex items-center justify-between",children:[x,t.jsx(rt,{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:a,org:c,hasExistingVirtualMcps:!0})]})}),e[10]=r,e[11]=a,e[12]=n,e[13]=o,e[14]=c,e[15]=p):p=e[15];let i;if(e[16]!==c||e[17]!==f){let d;e[19]!==c?(d=j=>t.jsx(hs,{virtualMcp:j,org:c},j.id),e[19]=c,e[20]=d):d=e[20],i=f.map(d),e[16]=c,e[17]=f,e[18]=i}else i=e[18];let b;e[21]!==i?(b=t.jsx("div",{className:"flex flex-col gap-2",children:i}),e[21]=i,e[22]=b):b=e[22];let m;return e[23]!==p||e[24]!==b?(m=t.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[p,b]}),e[23]=p,e[24]=b,e[25]=m):m=e[25],m}function js({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:r}){const a=Ge({control:s.control,name:"ui_type"}),c=Ge({control:s.control,name:"connection_url"}),{stdioEnabled:u}=vt(),f=(()=>{if(typeof c!="string"||!c)return!1;try{const i=new URL(c);return i.hostname==="api.githubcopilot.com"&&i.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),l=u||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?yt(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(He,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{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(tt,{value:i.value,onValueChange:i.onChange,children:[t.jsx(q,{children:t.jsxs(st,{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(Oe,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(nt,{})]})}),t.jsxs(ot,{children:[t.jsx(Q,{value:"HTTP",children:"HTTP"}),t.jsx(Q,{value:"SSE",children:"SSE"}),t.jsx(Q,{value:"Websocket",children:"Websocket"}),l&&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(G,{control:s.control,name:"connection_url",render:({field:b})=>t.jsx(J,{className:"flex-1 min-w-0",children:t.jsx(q,{children:t.jsx(ee,{placeholder:"https://example.com/mcp",...b,value:b.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(tt,{value:i.value,onValueChange:i.onChange,children:[t.jsx(q,{children:t.jsx(st,{className:"h-10",children:t.jsx(nt,{})})}),t.jsxs(ot,{children:[t.jsx(Q,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(Q,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(Q,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ns,{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(rs,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(Z,{})]})}),a==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"@perplexity-ai/mcp-server",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})}),a==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"node, bun, python...",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"arg1 arg2 --flag value",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(Z,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"/path/to/project (optional)",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})})]}),(a==="NPX"||a==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(q,{children:t.jsx($t,{value:i.value??[],onChange:i.onChange})}),t.jsx(Z,{})]})}),a!=="NPX"&&a!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{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(Jt,{children:[t.jsx(Yt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(ze,{variant:"success",className:"gap-1.5",children:[t.jsx(pt,{size:12}),"Authenticated via OAuth",t.jsx(ss,{size:12})]})})}),t.jsxs(Zt,{align:"start",children:[t.jsxs(et,{onClick:o,children:[t.jsx(os,{size:16}),"Re-authenticate"]}),t.jsxs(et,{variant:"destructive",onClick:r,children:[t.jsx(is,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&i.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:()=>i.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(as,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(ee,{type:"password",placeholder:f?"Paste your GitHub PAT":"Enter access token...",...i,value:i.value||"",className:"h-10 rounded-lg"})}),f&&t.jsxs(ts,{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(Z,{})]})})]})}function bs(s){const e=X.c(43),{form:n,connection:o,isMCPAuthenticated:r,hasOAuthToken:a,onReauthenticate:c,onRemoveOAuth:u}=s,{org:f}=ct();let l;e[0]!==o.icon||e[1]!==o.title?(l=t.jsx(Le,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}),e[0]=o.icon,e[1]=o.title,e[2]=l):l=e[2];let x;e[3]!==n.control?(x=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(G,{control:n.control,name:"title",render:ys}),t.jsx(G,{control:n.control,name:"description",render:vs})]}),e[3]=n.control,e[4]=x):x=e[4];let p;e[5]!==l||e[6]!==x?(p=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[l,x]}),e[5]=l,e[6]=x,e[7]=p):p=e[7];let i;e[8]!==o||e[9]!==n||e[10]!==a||e[11]!==c||e[12]!==u?(i=t.jsx(js,{form:n,connection:o,hasOAuthToken:a,onReauthenticate:c,onRemoveOAuth:u}),e[8]=o,e[9]=n,e[10]=a,e[11]=c,e[12]=u,e[13]=i):i=e[13];let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[14]=b):b=e[14];let m;e[15]!==r?(m=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[b,r?t.jsxs(ze,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[t.jsx(pt,{size:12}),"Connected"]}):t.jsx(ze,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[15]=r,e[16]=m):m=e[16];let d;e[17]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[17]=d):d=e[17];let j;e[18]!==o.created_by?(j=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[d,t.jsx(cs,{id:o.created_by,size:"2xs"})]}),e[18]=o.created_by,e[19]=j):j=e[19];let w;e[20]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[20]=w):w=e[20];let v;e[21]!==o.updated_at?(v=o.updated_at?ps(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[21]=o.updated_at,e[22]=v):v=e[22];let N;e[23]!==v?(N=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[w,t.jsx("span",{className:"text-sm text-foreground",children:v})]}),e[23]=v,e[24]=N):N=e[24];let _;e[25]!==N||e[26]!==m||e[27]!==j?(_=t.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[m,j,N]}),e[25]=N,e[26]=m,e[27]=j,e[28]=_):_=e[28];let y;e[29]!==o.description||e[30]!==o.icon||e[31]!==o.id||e[32]!==o.title||e[33]!==f.slug?(y=t.jsx(gs,{connectionId:o.id,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,org:f.slug}),e[29]=o.description,e[30]=o.icon,e[31]=o.id,e[32]=o.title,e[33]=f.slug,e[34]=y):y=e[34];let h;e[35]!==_||e[36]!==y||e[37]!==p||e[38]!==i?(h=t.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[p,i,_,y]}),e[35]=_,e[36]=y,e[37]=p,e[38]=i,e[39]=h):h=e[39];let k;return e[40]!==n||e[41]!==h?(k=t.jsx(es,{...n,children:h}),e[40]=n,e[41]=h,e[42]=k):k=e[42],k}function vs(s){const{field:e}=s;return t.jsxs(J,{className:"w-full space-y-0",children:[t.jsx(q,{children:t.jsx(ee,{...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(Z,{})]})}function ys(s){const{field:e}=s;return t.jsxs(J,{className:"flex-1 space-y-0",children:[t.jsx(q,{children:t.jsx(ee,{...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(Z,{})]})}function Ns(s){const e=X.c(42),{prompts:n,connectionId:o,org:r,connectionTitle:a,connectionIcon:c,onPromptClick:u,showToolbar:f,emptyMessage:l}=s,x=f===void 0?!0:f,p=l===void 0?"This connection doesn't have any prompts yet.":l,i=Re(),m=Xe().location.href,[d,j]=Y.useState(""),[w,v]=Y.useState("table"),[N,_]=Y.useState("name"),[y,h]=Y.useState("asc");let k;e[0]!==y||e[1]!==N?(k=S=>{N===S?(h(ws),y==="desc"&&_(void 0)):(_(S),h("asc"))},e[0]=y,e[1]=N,e[2]=k):k=e[2];const B=k;let $;e[3]!==o||e[4]!==i||e[5]!==u||e[6]!==r?($=S=>{u?u(S):o&&r&&i({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:Se,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(S.name)}})},e[3]=o,e[4]=i,e[5]=u,e[6]=r,e[7]=$):$=e[7];const M=$;let A;if(e[8]!==n||e[9]!==d||e[10]!==y||e[11]!==N){const S=!n||n.length===0?[]:d.trim()?(()=>{const H=d.toLowerCase();return n.filter(K=>K.name.toLowerCase().includes(H)||K.description&&K.description.toLowerCase().includes(H))})():n;A=!N||!y?S:[...S].sort((H,K)=>{const se=H[N]||"",ne=K[N]||"",oe=String(se).localeCompare(String(ne));return y==="asc"?oe:-oe}),e[8]=n,e[9]=d,e[10]=y,e[11]=N,e[12]=A}else A=e[12];const I=A;let R;e[13]===Symbol.for("react.memo_cache_sentinel")?(R=[{id:"name",header:"Name",render:Ts,sortable:!0},{id:"description",header:"Description",render:Ss,cellClassName:"flex-1",sortable:!0}],e[13]=R):R=e[13];const L=R;let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=L.filter(Cs).map(_s),e[14]=C):C=e[14];const z=C;let P;e[15]!==c||e[16]!==a||e[17]!==B||e[18]!==x||e[19]!==y||e[20]!==N||e[21]!==m||e[22]!==w?(P=x&&t.jsxs(qe,{children:[t.jsx(xt,{viewMode:w,onViewModeChange:v,sortKey:N,sortDirection:y,onSort:B,sortOptions:z}),t.jsx(Ke,{title:a?`${a}: Prompts`:"Prompts",url:m,icon:c??"description"})]}),e[15]=c,e[16]=a,e[17]=B,e[18]=x,e[19]=y,e[20]=N,e[21]=m,e[22]=w,e[23]=P):P=e[23];let D;e[24]===Symbol.for("react.memo_cache_sentinel")?(D=S=>{S.key==="Escape"&&(j(""),S.target.blur())},e[24]=D):D=e[24];let V;e[25]!==d?(V=t.jsx(ht,{value:d,onChange:j,placeholder:"Search prompts...",onKeyDown:D}),e[25]=d,e[26]=V):V=e[26];let g;e[27]!==p||e[28]!==M||e[29]!==B||e[30]!==d||e[31]!==y||e[32]!==N||e[33]!==I||e[34]!==w?(g=w==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:I.length===0?t.jsx(Ne,{image:null,title:d?"No prompts found":"No prompts available",description:d?"Try adjusting your search terms":p}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:I.map(S=>t.jsx(gt,{className:"cursor-pointer transition-colors",onClick:()=>M(S),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Le,{icon:null,name:S.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:S.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:S.description||"No description"})]})]})},S.name))})}):t.jsx(ft,{columns:L,data:I,isLoading:!1,sortKey:N,sortDirection:y,onSort:B,onRowClick:S=>M(S),emptyState:t.jsx(Ne,{image:null,title:d?"No prompts found":"No prompts available",description:d?"Try adjusting your search terms":p})}),e[27]=p,e[28]=M,e[29]=B,e[30]=d,e[31]=y,e[32]=N,e[33]=I,e[34]=w,e[35]=g):g=e[35];let F;e[36]!==V||e[37]!==g?(F=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[V,g]}),e[36]=V,e[37]=g,e[38]=F):F=e[38];let O;return e[39]!==F||e[40]!==P?(O=t.jsxs(t.Fragment,{children:[P,F]}),e[39]=F,e[40]=P,e[41]=O):O=e[41],O}function _s(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Cs(s){return s.sortable}function Ss(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 ws(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function ks(s){const e=X.c(6),{prompts:n,connectionId:o,org:r}=s,a=We(o),c=a?.title,u=a?.icon;let f;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==c||e[4]!==u?(f=t.jsx(Ns,{prompts:n,connectionId:o,org:r,connectionTitle:c,connectionIcon:u}),e[0]=o,e[1]=r,e[2]=n,e[3]=c,e[4]=u,e[5]=f):f=e[5],f}function Ps(s){const e=X.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(fs,{repository:n})}),e[0]=n,e[1]=o):o=e[1],o}function Is(s){const e=X.c(39),{resources:n,connectionTitle:o,connectionIcon:r,onResourceClick:a,showToolbar:c,emptyMessage:u}=s,f=c===void 0?!0:c,l=u===void 0?"This connection doesn't have any resources yet.":u,p=Xe().location.href,[i,b]=Y.useState(""),[m,d]=Y.useState("table"),[j,w]=Y.useState("name"),[v,N]=Y.useState("asc");let _;e[0]!==v||e[1]!==j?(_=g=>{j===g?(N(Es),v==="desc"&&w(void 0)):(w(g),N("asc"))},e[0]=v,e[1]=j,e[2]=_):_=e[2];const y=_;let h;e[3]!==a?(h=g=>{a&&a(g)},e[3]=a,e[4]=h):h=e[4];const k=h;let B;if(e[5]!==n||e[6]!==i||e[7]!==v||e[8]!==j){const g=!n||n.length===0?[]:i.trim()?(()=>{const F=i.toLowerCase();return n.filter(O=>O.uri.toLowerCase().includes(F)||O.name&&O.name.toLowerCase().includes(F)||O.description&&O.description.toLowerCase().includes(F))})():n;B=!j||!v?g:[...g].sort((F,O)=>{const S=F[j]||"",H=O[j]||"",K=String(S).localeCompare(String(H));return v==="asc"?K:-K}),e[5]=n,e[6]=i,e[7]=v,e[8]=j,e[9]=B}else B=e[9];const $=B;let M;e[10]===Symbol.for("react.memo_cache_sentinel")?(M=[{id:"name",header:"Name",render:Os,sortable:!0},{id:"uri",header:"URI",render:Ds,sortable:!0},{id:"description",header:"Description",render:Ms,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Vs,sortable:!0}],e[10]=M):M=e[10];const A=M;let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=A.filter(As).map($s),e[11]=I):I=e[11];const R=I;let L;e[12]!==r||e[13]!==o||e[14]!==y||e[15]!==f||e[16]!==v||e[17]!==j||e[18]!==p||e[19]!==m?(L=f&&t.jsxs(qe,{children:[t.jsx(xt,{viewMode:m,onViewModeChange:d,sortKey:j,sortDirection:v,onSort:y,sortOptions:R}),t.jsx(Ke,{title:o?`${o}: Resources`:"Resources",url:p,icon:r??"folder"})]}),e[12]=r,e[13]=o,e[14]=y,e[15]=f,e[16]=v,e[17]=j,e[18]=p,e[19]=m,e[20]=L):L=e[20];let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=g=>{g.key==="Escape"&&(b(""),g.target.blur())},e[21]=C):C=e[21];let z;e[22]!==i?(z=t.jsx(ht,{value:i,onChange:b,placeholder:"Search resources...",onKeyDown:C}),e[22]=i,e[23]=z):z=e[23];let P;e[24]!==l||e[25]!==k||e[26]!==y||e[27]!==i||e[28]!==v||e[29]!==j||e[30]!==$||e[31]!==m?(P=m==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:$.length===0?t.jsx(Ne,{image:null,title:i?"No resources found":"No resources available",description:i?"Try adjusting your search terms":l}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:$.map(g=>t.jsx(gt,{className:"cursor-pointer transition-colors",onClick:()=>k(g),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Le,{icon:null,name:g.name||g.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:g.name||g.uri}),t.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:g.uri}),g.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:g.description})]})]})},g.uri))})}):t.jsx(ft,{columns:A,data:$,isLoading:!1,sortKey:j,sortDirection:v,onSort:y,onRowClick:g=>k(g),emptyState:t.jsx(Ne,{image:null,title:i?"No resources found":"No resources available",description:i?"Try adjusting your search terms":l})}),e[24]=l,e[25]=k,e[26]=y,e[27]=i,e[28]=v,e[29]=j,e[30]=$,e[31]=m,e[32]=P):P=e[32];let D;e[33]!==z||e[34]!==P?(D=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[z,P]}),e[33]=z,e[34]=P,e[35]=D):D=e[35];let V;return e[36]!==D||e[37]!==L?(V=t.jsxs(t.Fragment,{children:[L,D]}),e[36]=D,e[37]=L,e[38]=V):V=e[38],V}function $s(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function As(s){return s.sortable}function Vs(s){return t.jsx("span",{className:"text-sm text-muted-foreground",children:s.mimeType||"—"})}function Ms(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ds(s){return t.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:s.uri})}function Os(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 Rs(s){const e=X.c(6),{resources:n,connectionId:o,org:r}=s,a=We(o),c=a?.title,u=a?.icon;let f;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==c||e[4]!==u?(f=t.jsx(Is,{resources:n,connectionId:o,org:r,connectionTitle:c,connectionIcon:u}),e[0]=o,e[1]=r,e[2]=n,e[3]=c,e[4]=u,e[5]=f):f=e[5],f}const Ls=lt({key:W().min(1,"Key is required"),value:W()}),Us=lt({title:W().min(1,"Name is required"),description:W().nullable().optional(),ui_type:Ct(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:W().optional(),connection_token:W().nullable().optional(),npx_package:W().optional(),stdio_command:W().optional(),stdio_args:W().optional(),stdio_cwd:W().optional(),env_vars:Je(Ls).optional(),configuration_scopes:Je(W()).nullable().optional(),configuration_state:Nt(W(),_t()).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 Fs(s){const e=X.c(5),{tools:n,connectionId:o,org:r,isLoading:a}=s;let c;return e[0]!==o||e[1]!==a||e[2]!==r||e[3]!==n?(c=t.jsx(xs,{tools:n,connectionId:o,org:r,isLoading:a}),e[0]=o,e[1]=a,e[2]=r,e[3]=n,e[4]=c):c=e[4],c}function Bs(s){return s.command==="npx"}function zs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Xs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Ks(s,e){const n={command:"npx",args:["-y",s]},o=mt(e);return Object.keys(o).length>0&&(n.envVars=o),n}function Ws(s,e,n,o){const r={command:s};e.trim()&&(r.args=e.trim().split(/\s+/)),n?.trim()&&(r.cwd=n.trim());const a=mt(o);return Object.keys(a).length>0&&(r.envVars=a),r}function it(s,e){const n={title:s.title,description:s.description??"",configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&It(s.connection_headers)){const o=s.connection_headers,r=At(o.envVars);if(Bs(o)){const c=zs(o);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const a=Xs(o);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function qs(s){let e,n=null,o=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Ks(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Ws(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,connection_type:e,connection_url:n,...o&&{connection_token:o},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function Hs(s){const e=X.c(117),{connection:n,connectionId:o,org:r,requestedTabId:a,collections:c,onUpdate:u,isUpdating:f,prompts:l,resources:x,tools:p,isLoadingTools:i}=s;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={from:"/$org/$project/mcps/$connectionId"},e[0]=b):b=e[0];const m=Re(b),d=wt(),w=Xe().location.href,v=ut();let N;e[1]!==o?(N={connectionId:o},e[1]=o,e[2]=N):N=e[2];const _=Ot(N),h=n?.connection_type==="VIRTUAL"||_.isAuthenticated;let k;e[3]!==n?(k={connections:[n],binding:"MCP"},e[3]=n,e[4]=k):k=e[4];const $=Dt(k).length>0,M=n?.metadata?.repository,A=!!M?.url;let I;e[5]===Symbol.for("react.memo_cache_sentinel")?(I=kt(Us),e[5]=I):I=e[5];let R;e[6]!==n?(R=it(n),e[6]=n,e[7]=R):R=e[7];let L;e[8]!==R?(L={resolver:I,values:R},e[8]=R,e[9]=L):L=e[9];const C=Pt(L),z=C.formState.isDirty;let P;e[10]!==C||e[11]!==u?(P=async()=>{if(!await C.trigger())return;const U=C.getValues(),ye=qs(U);await u(ye),C.reset(U)},e[10]=C,e[11]=u,e[12]=P):P=e[12];const D=P;let V;e[13]!==n||e[14]!==C?(V=()=>{C.reset(it(n))},e[13]=n,e[14]=C,e[15]=V):V=e[15];const g=V;let F;e[16]!==n.id||e[17]!==v||e[18]!==d?(F=async()=>{const{token:T,tokenInfo:U,error:ye}=await Bt({connectionId:n.id});if(ye||!T){Ce.error(`Authentication failed: ${ye}`);return}if(U)try{const De=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:U.accessToken,refreshToken:U.refreshToken,expiresIn:U.expiresIn,scope:U.scope,clientId:U.clientId,clientSecret:U.clientSecret,tokenEndpoint:U.tokenEndpoint})});if(!De.ok)console.error("Failed to save OAuth token:",await De.text()),await v.update.mutateAsync({id:n.id,data:{connection_token:T}});else try{await v.update.mutateAsync({id:n.id,data:{}})}catch(Qe){console.warn("Failed to refresh connection tools after OAuth:",Qe)}}catch(De){console.error("Error saving OAuth token:",De),await v.update.mutateAsync({id:n.id,data:{connection_token:T}})}else await v.update.mutateAsync({id:n.id,data:{connection_token:T}});const bt=new URL(`/mcp/${n.id}`,window.location.origin);await d.invalidateQueries({queryKey:Ye.isMCPAuthenticated(bt.href,null)}),Ce.success("Authentication successful")},e[16]=n.id,e[17]=v,e[18]=d,e[19]=F):F=e[19];const O=F;let S;e[20]!==n.id||e[21]!==d?(S=async()=>{try{const T=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!T.ok){const ye=await T.text();Ce.error(`Failed to remove OAuth: ${ye}`);return}const U=new URL(`/mcp/${n.id}`,window.location.origin);await d.invalidateQueries({queryKey:Ye.isMCPAuthenticated(U.href,null)}),Ce.success("OAuth removed. You can now re-authenticate with a different account.")}catch(T){console.error("Error removing OAuth token:",T),Ce.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=d,e[22]=S):S=e[22];const H=S,K=p.length,se=l.length,ne=x.length,oe=K>0||i;let Te;e[23]===Symbol.for("react.memo_cache_sentinel")?(Te={id:"settings",label:"Settings"},e[23]=Te):Te=e[23];let re;e[24]!==i||e[25]!==h||e[26]!==oe||e[27]!==K?(re=h&&oe?[{id:"tools",label:"Tools",count:i?void 0:K}]:[],e[24]=i,e[25]=h,e[26]=oe,e[27]=K,e[28]=re):re=e[28];let ie;e[29]!==h||e[30]!==se?(ie=h&&se>0?[{id:"prompts",label:"Prompts",count:se}]:[],e[29]=h,e[30]=se,e[31]=ie):ie=e[31];let ae;e[32]!==h||e[33]!==ne?(ae=h&&ne>0?[{id:"resources",label:"Resources",count:ne}]:[],e[32]=h,e[33]=ne,e[34]=ae):ae=e[34];let we;if(e[35]!==c||e[36]!==A||e[37]!==h||e[38]!==re||e[39]!==ie||e[40]!==ae){let T;e[42]!==A?(T=A?[{id:"readme",label:"README"}]:[],e[42]=A,e[43]=T):T=e[43],we=[Te,...re,...ie,...ae,...h?(c||[]).map(Gs):[],...T],e[35]=c,e[36]=A,e[37]=h,e[38]=re,e[39]=ie,e[40]=ae,e[41]=we}else we=e[41];const _e=we,jt=h&&_e.some(Qs)?"tools":"settings",E=_e.some(T=>T.id===a)?a:jt;let ke;e[44]!==m?(ke=T=>{m({search:U=>({...U,tab:T}),replace:!0})},e[44]=m,e[45]=ke):ke=e[45];const ce=ke;let le;e[46]!==c?(le=c||[],e[46]=c,e[47]=le):le=e[47];let Pe;if(e[48]!==E||e[49]!==le){let T;e[51]!==E?(T=U=>U.name===E,e[51]=E,e[52]=T):T=e[52],Pe=le.find(T),e[48]=E,e[49]=le,e[50]=Pe}else Pe=e[50];const Ie=Pe;let de;e[53]!==r?(de=t.jsx(Ze,{children:t.jsx(Xt,{asChild:!0,children:t.jsx(at,{to:"/$org/$project/mcps",params:{org:r,project:Se},children:"Connections"})})}),e[53]=r,e[54]=de):de=e[54];let $e;e[55]===Symbol.for("react.memo_cache_sentinel")?($e=t.jsx(Kt,{}),e[55]=$e):$e=e[55];let me;e[56]!==n.title?(me=t.jsx(Ze,{children:t.jsx(zt,{children:n.title})}),e[56]=n.title,e[57]=me):me=e[57];let Ae;e[58]!==de||e[59]!==me?(Ae=t.jsx(Wt,{children:t.jsxs(qt,{children:[de,$e,me]})}),e[58]=de,e[59]=me,e[60]=Ae):Ae=e[60];const Ue=Ae;let ue;e[61]!==D||e[62]!==g||e[63]!==z||e[64]!==f?(ue=t.jsx(Vt,{onSave:D,onUndo:g,isDirty:z,isSaving:f}),e[61]=D,e[62]=g,e[63]=z,e[64]=f,e[65]=ue):ue=e[65];const Fe=n.icon??"settings";let pe;e[66]!==n.title||e[67]!==Fe||e[68]!==w?(pe=t.jsx(Ke,{title:n.title,url:w,icon:Fe}),e[66]=n.title,e[67]=Fe,e[68]=w,e[69]=pe):pe=e[69];let fe;e[70]!==ue||e[71]!==pe?(fe=t.jsxs(qe,{children:[ue,pe]}),e[70]=ue,e[71]=pe,e[72]=fe):fe=e[72];let xe;e[73]!==_.hasOAuthToken||e[74]!==n||e[75]!==C||e[76]!==O||e[77]!==H||e[78]!==h?(xe=t.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:t.jsx(bs,{form:C,connection:n,isMCPAuthenticated:h,hasOAuthToken:_.hasOAuthToken,onReauthenticate:O,onRemoveOAuth:H})}),e[73]=_.hasOAuthToken,e[74]=n,e[75]=C,e[76]=O,e[77]=H,e[78]=h,e[79]=xe):xe=e[79];let he;e[80]!==E||e[81]!==ce||e[82]!==_e?(he=t.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:t.jsx(Ht,{tabs:_e,activeTab:E,onTabChange:ce,className:"flex-1"})}),e[80]=E,e[81]=ce,e[82]=_e,e[83]=he):he=e[83];let Ve;e[84]===Symbol.for("react.memo_cache_sentinel")?(Ve=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Ee,{size:32,className:"animate-spin text-muted-foreground"})}),e[84]=Ve):Ve=e[84];let ge;e[85]!==Ie||e[86]!==E||e[87]!==_.isServerError||e[88]!==_.supportsOAuth||e[89]!==n||e[90]!==o||e[91]!==C||e[92]!==O||e[93]!==ce||e[94]!==$||e[95]!==A||e[96]!==i||e[97]!==h||e[98]!==r||e[99]!==l||e[100]!==M||e[101]!==x||e[102]!==p?(ge=t.jsx(Y.Suspense,{fallback:Ve,children:E==="tools"?t.jsx(Fs,{tools:p,connectionId:o,org:r,isLoading:i}):E==="prompts"?t.jsx(ks,{prompts:l,connectionId:o,org:r}):E==="resources"?t.jsx(Rs,{resources:x,connectionId:o,org:r}):E==="settings"?t.jsx(Et,{connection:n,form:C,hasMcpBinding:$,isMCPAuthenticated:h,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:O,onViewReadme:A?()=>ce("readme"):void 0}):E==="readme"&&A?t.jsx(Ps,{repository:M}):Ie&&h?t.jsx(Gt,{connectionId:o,org:r,activeCollection:Ie},E):t.jsx(Ne,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[85]=Ie,e[86]=E,e[87]=_.isServerError,e[88]=_.supportsOAuth,e[89]=n,e[90]=o,e[91]=C,e[92]=O,e[93]=ce,e[94]=$,e[95]=A,e[96]=i,e[97]=h,e[98]=r,e[99]=l,e[100]=M,e[101]=x,e[102]=p,e[103]=ge):ge=e[103];let je;e[104]!==E||e[105]!==ge?(je=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(dt,{children:ge},E)}),e[104]=E,e[105]=ge,e[106]=je):je=e[106];let be;e[107]!==he||e[108]!==je?(be=t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[he,je]}),e[107]=he,e[108]=je,e[109]=be):be=e[109];let ve;e[110]!==xe||e[111]!==be?(ve=t.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[xe,be]}),e[110]=xe,e[111]=be,e[112]=ve):ve=e[112];let Me;return e[113]!==Ue||e[114]!==fe||e[115]!==ve?(Me=t.jsxs(Qt,{breadcrumb:Ue,children:[fe,ve]}),e[113]=Ue,e[114]=fe,e[115]=ve,e[116]=Me):Me=e[116],Me}function Qs(s){return s.id==="tools"}function Gs(s){return{id:s.name,label:s.displayName}}function Js(){const s=X.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=Re(e);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/$project/mcps/$connectionId"},s[1]=o):o=s[1];const{connectionId:r,org:a}=St(o),{org:c}=ct();let u;s[2]===Symbol.for("react.memo_cache_sentinel")?(u={from:"/shell/$org/$project/mcps/$connectionId"},s[2]=u):u=s[2];const l=Tt(u).tab??"",x=We(r),p=ut(),i=Mt(x??void 0);let b;s[3]!==r||s[4]!==c.id?(b={connectionId:r,orgId:c.id},s[3]=r,s[4]=c.id,s[5]=b):b=s[5];const m=Rt(b);let d;s[6]!==m?(d={client:m},s[6]=m,s[7]=d):d=s[7];const{data:j}=Ut(d);let w;s[8]!==m?(w={client:m},s[8]=m,s[9]=w):w=s[9];const{data:v}=Ft(w),_=!(x?.connection_type==="VIRTUAL")&&x?.tools&&x.tools.length>0,y=!_;let h;s[10]!==m||s[11]!==y?(h={client:m,enabled:y},s[10]=m,s[11]=y,s[12]=h):h=s[12];const{data:k,isLoading:B}=Lt(h);let $;s[13]!==j?.prompts?($=j?.prompts??[],s[13]=j?.prompts,s[14]=$):$=s[14];let M;s[15]!==$?(M=$.map(en),s[15]=$,s[16]=M):M=s[16];const A=M;let I;s[17]!==v?.resources?(I=v?.resources??[],s[17]=v?.resources,s[18]=I):I=s[18];let R;s[19]!==I?(R=I.map(Zs),s[19]=I,s[20]=R):R=s[20];const L=R;let C;s[21]!==x||s[22]!==_||s[23]!==k?.tools?(C=_?x.tools??[]:(k?.tools??[]).map(Ys),s[21]=x,s[22]=_,s[23]=k?.tools,s[24]=C):C=s[24];const z=C;let P;s[25]!==p.update||s[26]!==r?(P=async g=>{await p.update.mutateAsync({id:r,data:g})},s[25]=p.update,s[26]=r,s[27]=P):P=s[27];const D=P;if(!x){let g;return s[28]!==n||s[29]!==a?(g=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ne,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(Be,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:a,project:Se}}),children:"Back to connections"})})}),s[28]=n,s[29]=a,s[30]=g):g=s[30],g}let V;return s[31]!==p.update.isPending||s[32]!==i||s[33]!==x||s[34]!==r||s[35]!==D||s[36]!==B||s[37]!==a||s[38]!==A||s[39]!==l||s[40]!==L||s[41]!==z?(V=t.jsx(Hs,{org:a,connection:x,connectionId:r,requestedTabId:l,collections:i,onUpdate:D,isUpdating:p.update.isPending,prompts:A,resources:L,tools:z,isLoadingTools:B}),s[31]=p.update.isPending,s[32]=i,s[33]=x,s[34]=r,s[35]=D,s[36]=B,s[37]=a,s[38]=A,s[39]=l,s[40]=L,s[41]=z,s[42]=V):V=s[42],V}function Ys(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations}}function Zs(s){return{uri:s.uri,name:s.name,description:s.description}}function en(s){return{name:s.name,description:s.description}}function tn(){const s=X.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(dt,{children:t.jsx(Y.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ee,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Js,{})})}),s[0]=e):e=s[0],e}function ar(){const s=X.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tn,{}),s[0]=e):e=s[0],e}export{ar as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as be,j as e,r as X,u as Fe,m as Be,b as Ue,a as He,d as Le,ai as Me,l as ze,k as Re,i as Xe,O as g,t as D,o as ke,aj as We,s as C,ak as Ke}from"./index-DwBgLSti.js";import{g as Ge}from"./generate-id-Dyweu44Y.js";import{C as qe,a as Qe}from"./collection-table-wrapper-fNhnYl-G.js";import{C as Je}from"./collection-search-CBYSITVU.js";import{C as Ye}from"./connection-card-Cwh5xUmA.js";import{B as L}from"./badge-Do8iK9u9.js";import{i as Ze}from"./AlertCircle-BzYW4X7z.js";import{i as et}from"./CheckCircle-lzDHXhkH.js";import{E as M}from"./empty-state-sMx3NP6e.js";import{E as tt}from"./error-boundary-lFjWy2-n.js";import{I as nt}from"./integration-icon-qV_BsBQR.js";import{P as E}from"./index-B_nMIrSY.js";import{u as st,U as re}from"./use-list-state-DvpdPuz-.js";import{u as ot}from"./use-binding-DbH4Xe03.js";import{f as rt,e as it}from"./registry-utils-DMdc5PTp.js";import{f as ie,a as ae,b as ce,c as le,d as de,e as me,A as ue,g as pe}from"./alert-dialog-BvNipqK_.js";import{B as at,a as ct,b as lt,c as dt}from"./breadcrumb-DeYbtjMk.js";import{B as S}from"./button-D6YZfFzy.js";import{D as mt,a as ut,b as pt,c as xt,d as ht,e as gt}from"./dialog-DSPMVHyJ.js";import{D as xe,a as he,b as ge,c as F}from"./dropdown-menu-CRT7qGQ9.js";import{a as ft,F as f,b as j,c as y,d as v,f as _}from"./form-BMtUcs2k.js";import{I as T}from"./input-B7id4I1j.js";import{S as jt,a as yt,b as vt,c as _t,d as $}from"./select-CkeKfTEx.js";import{T as Ct}from"./textarea-GWXLFYfv.js";import{g as Nt,h as bt}from"./use-connection-BEGrPCmR.js";import{u as fe,a as kt}from"./constants-8URKDp4Y.js";import{b as wt}from"./use-mcp-tools-BAsmCzEJ.js";import{n as z}from"./Container-jfv9L6Hc.js";import{i as je}from"./DotsVertical-PhooMqUv.js";import{s as ye}from"./Eye-B9ZDOUkE.js";import{s as R}from"./Globe02-BPmEw10H.js";import{i as St}from"./Loading01-BHMOj-H5.js";import{i as Tt}from"./Terminal-BblMM2fp.js";import{s as ve}from"./Trash01-CkTOgej8.js";import{f as _e}from"./format-time-CMKyl-GC.js";import{r as Dt,E as Pt,e as we}from"./env-vars-editor-DuW-Il-b.js";import"./ArrowDown-B35oswmj.js";import"./ArrowUp-G8RCE5_O.js";import"./Check-Bv0pZ3gl.js";import"./Grid01-CJW4ZLO5.js";import"./List-sG42OZ_v.js";import"./tooltip-D71dCz4E.js";import"./view-mode-toggle-2-qyK3LU.js";import"./table-Csfk_VXo.js";import"./SearchMd-BLcaRHQs.js";import"./card-BNyCnFpQ.js";import"./AlertTriangle-DniGvpwb.js";import"./use-mobile-Bs0AkxK7.js";import"./avatar-BNKSN34R.js";import"./useQuery-CPsXfVfR.js";import"./use-view-mode-DMPiUC22.js";import"./binder-BBB8LQyx.js";import"./ChevronRight-DgAfR8pA.js";import"./label-29qY4FPs.js";import"./ChevronDown-CggIFEVQ.js";import"./useMutation-DgG1LVg-.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./Plus-DNqvDLOK.js";function Ce(s){const o=be.c(3),{status:i}=s;if(i==="active"){let c;return o[0]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(L,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[e.jsx(et,{size:12}),"Active"]}),o[0]=c):c=o[0],c}if(i==="error"){let c;return o[1]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(L,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[e.jsx(Ze,{size:12}),"Error"]}),o[1]=c):c=o[1],c}let d;return o[2]===Symbol.for("react.memo_cache_sentinel")?(d=e.jsx(L,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),o[2]=d):d=o[2],d}const It=ke({key:C(),value:C()}),Et=ke({title:C().min(1,"Name is required"),description:C().nullable().optional(),ui_type:Ke(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:C().optional(),connection_token:C().nullable().optional(),npx_package:C().optional(),stdio_command:C().optional(),stdio_args:C().optional(),stdio_cwd:C().optional(),env_vars:We(It).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 U(s){const o=s.trim();if(!o)return"";try{const i=new URL(o),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return o.replace(/\/+$/,"")}}function $t(s){const o=s.trim().split(/\s+/).filter(Boolean);if(o.length<2)return null;const i=o[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const c=o.slice(1).find(N=>!N.startsWith("-"));return c?{packageName:c}:null}function B(s){const{uiType:o}=s,i=U(s.connectionUrl??"");if((o==="HTTP"||o==="SSE"||o==="Websocket")&&i===U("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 d=(s.npxPackage??"").trim();return o==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function Ne(s){if(s.registryItems.length===0||s.uiType!=="HTTP"&&s.uiType!=="SSE"&&s.uiType!=="Websocket")return null;const o=U(s.connectionUrl??"");if(!o)return null;const i=s.registryItems.find(N=>(N.server?.remotes??[]).some(O=>U(O.url??"")===o));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",c=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:c}:null}function Ot(s,o){const i={command:"npx",args:["-y",s]},d=we(o);return Object.keys(d).length>0&&(i.envVars=d),i}function At(s,o,i,d){const c={command:s};o.trim()&&(c.args=o.trim().split(/\s+/)),i?.trim()&&(c.cwd=i.trim());const N=we(d);return Object.keys(N).length>0&&(c.envVars=N),c}function Vt(s){return s.command==="npx"}function Ft(s){return s.args?.find(o=>!o.startsWith("-"))??""}function Bt(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Ut(s,o){switch(o.type){case"edit":return{mode:"editing",connection:o.connection};case"delete":return{mode:"deleting",connection:o.connection};case"force-delete":return{mode:"force-deleting",connection:o.connection,agentNames:o.agentNames};case"close":return{mode:"idle"}}}function Ht(){const{org:s}=Fe(),o=Be(),i=Ue(),d=He({strict:!1}),{data:c}=Le.useSession(),{stdioEnabled:N}=Me(),l=st({namespace:s.slug,resource:"connections"}),O=Nt(),A=bt(l),[u,b]=X.useReducer(Ut,{mode:"idle"}),W=ot(A)[0],K=W?.id??"",G=rt(W?.tools),Se=fe({connectionId:K||null,orgId:s.id}),{data:Te}=wt({client:Se,toolName:G,toolArguments:{limit:200},enabled:!!(K&&G),staleTime:3600*1e3,select:t=>t.structuredContent??t}),q=it(Te??[]),Q=d.action==="create",De=()=>{i({to:"/$org/$project/mcps",params:{org:s.slug,project:g},search:{action:"create"}})},J=()=>{i({to:"/$org/$project/mcps",params:{org:s.slug,project:g},search:{}})},r=ze({resolver:Re(Et),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),p=r.watch("ui_type"),Y=r.watch("connection_url"),Pe=r.watch("npx_package"),P=B({uiType:p,connectionUrl:Y??"",npxPackage:Pe??""})??Ne({uiType:p,connectionUrl:Y??"",registryItems:q}),m=u.mode==="editing"?u.connection:null;X.useEffect(()=>{if(m){const t=Xe(m.connection_headers)?m.connection_headers:null;if(t&&m.connection_type==="STDIO"){const n=Dt(t.envVars);if(Vt(t)){const a=Ft(t);r.reset({title:m.title,description:m.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:n})}else{const a=Bt(t);r.reset({title:m.title,description:m.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:n})}}else r.reset({title:m.title,description:m.description,ui_type:m.connection_type,connection_url:m.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[m,r]);const Z=fe({connectionId:kt,orgId:s.id}),ee=()=>{o.invalidateQueries({predicate:t=>{const n=t.queryKey;return n[1]===s.id&&n[3]==="collection"&&n[4]==="CONNECTIONS"}})},te=t=>{const n=t.content;return Array.isArray(n)&&n[0]?.type==="text"&&typeof n[0].text=="string"?n[0].text:"Unknown error"},Ie=async()=>{if(u.mode!=="deleting")return;const t=u.connection;b({type:"close"});try{const n=await Z.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:t.id}});if(n.isError){const a=te(n),k=a.replace(/^Error:\s*/,"");try{const x=JSON.parse(k);if(x.code==="CONNECTION_IN_USE"&&x.agentNames){b({type:"force-delete",connection:t,agentNames:x.agentNames.map(w=>`"${w}"`).join(", ")});return}}catch{}D.error(`Failed to delete connection: ${a}`);return}ee(),D.success("Connection deleted successfully")}catch(n){const a=n instanceof Error?n.message:String(n);D.error(`Failed to delete connection: ${a}`)}},Ee=async()=>{if(u.mode!=="force-deleting")return;const t=u.connection.id;b({type:"close"});try{const n=await Z.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:t,force:!0}});if(n.isError){D.error(`Failed to delete connection: ${te(n)}`);return}ee(),D.success("Connection deleted successfully")}catch(n){const a=n instanceof Error?n.message:String(n);D.error(`Failed to delete connection: ${a}`)}},$e=async t=>{let n,a=null,k=null,x=null;if(t.ui_type==="NPX"?(n="STDIO",a="",x=Ot(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(n="STDIO",a="",x=At(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(n=t.ui_type,a=t.connection_url||"",k=t.connection_token||null),m){await O.update.mutateAsync({id:m.id,data:{title:t.title,description:t.description||null,connection_type:n,connection_url:a,...k&&{connection_token:k},...x&&{connection_headers:x}}}),b({type:"close"}),r.reset();return}const w=Ge("conn");await O.create.mutateAsync({id:w,title:t.title,description:t.description||null,connection_type:n,connection_url:a,connection_token:k,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:c?.user?.id||"system",organization_id:s.id,icon:null,app_name:null,app_id:null,connection_headers:x,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),J(),r.reset(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:w}})},ne=t=>{t||(Q?J():b({type:"close"}),r.reset())},V=t=>{const n=t.trim();if(!n)return;const a=!!r.formState.dirtyFields.title,k=!!r.formState.dirtyFields.description,x=!!r.formState.dirtyFields.env_vars,w=h=>{if(h&&(!a&&!r.getValues("title").trim()&&h.title&&r.setValue("title",h.title,{shouldDirty:!1}),!k&&!(r.getValues("description")??"").trim()&&h.description&&r.setValue("description",h.description,{shouldDirty:!1}),!x&&h.envVarKeys?.length)){const se=r.getValues("env_vars")??[],Ve=new Set(se.map(I=>I.key)),oe=h.envVarKeys.filter(I=>!Ve.has(I));oe.length>0&&r.setValue("env_vars",[...se,...oe.map(I=>({key:I,value:""}))],{shouldDirty:!0})}},H=$t(n);if(H&&N){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",H.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),w(B({uiType:"NPX",npxPackage:H.packageName}));return}if(n.startsWith("http://")||n.startsWith("https://")){const h=p==="HTTP"||p==="SSE"||p==="Websocket"?p:"HTTP";r.setValue("ui_type",h,{shouldDirty:!0}),r.setValue("connection_url",n,{shouldDirty:!0}),w(B({uiType:h,connectionUrl:n})??Ne({uiType:h,connectionUrl:n,registryItems:q}));return}p==="NPX"&&w(B({uiType:"NPX",npxPackage:n}))},Oe=[{id:"title",header:"Name",render:t=>e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(nt,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(z,{})}),e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title})]}),cellClassName:"w-32 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-muted-foreground truncate block",title:t.description||"",children:t.description||"—"}),cellClassName:"flex-1 min-w-0 max-w-0",wrap:!1,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-xs font-medium",children:t.connection_type}),cellClassName:"w-16 shrink-0",sortable:!0},{id:"status",header:"Status",render:t=>e.jsx(Ce,{status:t.status}),cellClassName:"w-28 shrink-0",sortable:!1},{id:"updated_by",header:"Updated by",render:t=>e.jsx(re,{id:t.updated_by??t.created_by,size:"3xs"}),cellClassName:"w-32 shrink-0",sortable:!0},{id:"updated_at",header:"Updated",render:t=>e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:t.updated_at?_e(new Date(t.updated_at)):"—"}),cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(xe,{children:[e.jsx(he,{asChild:!0,children:e.jsx(S,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:n=>n.stopPropagation(),children:e.jsx(je,{size:20})})}),e.jsxs(ge,{align:"end",onClick:n=>n.stopPropagation(),children:[e.jsxs(F,{onClick:n=>{n.stopPropagation(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}})},children:[e.jsx(ye,{size:16}),"Open"]}),e.jsxs(F,{variant:"destructive",onClick:n=>{n.stopPropagation(),b({type:"delete",connection:t})},children:[e.jsx(ve,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],Ae=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:g}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(S,{onClick:De,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(E,{children:[e.jsx(mt,{open:Q||u.mode==="editing",onOpenChange:ne,children:e.jsxs(ut,{className:"sm:max-w-[525px]",children:[e.jsxs(pt,{children:[e.jsx(xt,{children:m?"Edit Connection":"Create Connection"}),e.jsx(ht,{children:m?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(ft,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit($e),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(f,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Type *"}),e.jsxs(jt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(v,{children:e.jsx(yt,{children:e.jsx(vt,{})})}),e.jsxs(_t,{children:[e.jsx($,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx($,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"SSE"]})}),e.jsx($,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"Websocket"]})}),N&&e.jsxs(e.Fragment,{children:[e.jsx($,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx($,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Tt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(_,{})]})}),p==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(f,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"NPM Package *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:n=>{const a=n.clipboardData.getData("text");a&&(n.preventDefault(),r.setValue("npx_package",a.trim(),{shouldDirty:!0}),V(a))},onBlur:n=>{V(n.target.value),t.onBlur()}})}),e.jsx(_,{})]})})}),p==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(f,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Command *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(_,{})]})}),e.jsx(f,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Arguments"}),e.jsx(v,{children:e.jsx(T,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(_,{})]})})]}),e.jsx(f,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Working Directory"}),e.jsx(v,{children:e.jsx(T,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(_,{})]})})]}),(p==="NPX"||p==="STDIO")&&e.jsx(f,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Environment Variables"}),e.jsx(v,{children:e.jsx(Pt,{value:t.value??[],onChange:t.onChange})}),e.jsx(_,{})]})}),p!=="NPX"&&p!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(f,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"URL *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:n=>{const a=n.clipboardData.getData("text");a&&(n.preventDefault(),r.setValue("connection_url",a.trim(),{shouldDirty:!0}),V(a))},onBlur:n=>{V(n.target.value),t.onBlur()}})}),e.jsx(_,{})]})}),e.jsx(f,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:P?.token?.label??"Token (optional)"}),e.jsx(v,{children:e.jsx(T,{type:"password",placeholder:P?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),P?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.token.helperText,P.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.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"})]})]}),e.jsx(_,{})]})})]}),e.jsx(f,{control:r.control,name:"title",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Name *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"My Connection",...t})}),e.jsx(_,{})]})}),e.jsx(f,{control:r.control,name:"description",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Description"}),e.jsx(v,{children:e.jsx(Ct,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(_,{})]})})]}),e.jsxs(gt,{children:[e.jsx(S,{type:"button",variant:"outline",onClick:()=>ne(!1),children:"Cancel"}),e.jsx(S,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":m?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(ie,{open:u.mode==="deleting",onOpenChange:t=>!t&&b({type:"close"}),children:e.jsxs(ae,{children:[e.jsxs(ce,{children:[e.jsx(le,{children:"Delete Connection?"}),e.jsxs(de,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="deleting"&&u.connection.title}),"."]})]}),e.jsxs(me,{children:[e.jsx(ue,{children:"Cancel"}),e.jsx(pe,{onClick:Ie,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(ie,{open:u.mode==="force-deleting",onOpenChange:t=>!t&&b({type:"close"}),children:e.jsxs(ae,{children:[e.jsxs(ce,{children:[e.jsx(le,{children:"Connection Used by Agents"}),e.jsx(de,{asChild:!0,children:e.jsxs("div",{children:[e.jsxs("p",{children:["The connection"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="force-deleting"&&u.connection.title})," ","is currently used by the following agent(s):"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="force-deleting"&&u.agentNames}),"."]}),e.jsx("p",{className:"mt-2",children:"Deleting this connection will remove it from those agents, which may impact existing workflows that depend on them."})]})})]}),e.jsxs(me,{children:[e.jsx(ue,{children:"Cancel"}),e.jsx(pe,{onClick:Ee,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]})]})}),e.jsxs(E.Header,{children:[e.jsx(E.Header.Left,{children:e.jsx(at,{children:e.jsx(ct,{children:e.jsx(lt,{children:e.jsx(dt,{children:"Connections"})})})})}),e.jsxs(E.Header.Right,{children:[e.jsx(qe,{viewMode:l.viewMode,onViewModeChange:l.setViewMode,sortKey:l.sortKey,sortDirection:l.sortDirection,onSort:l.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"}]}),Ae]})]}),e.jsx(Je,{value:l.search,onChange:l.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(l.setSearch(""),t.target.blur())}}),e.jsx(E.Content,{children:l.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:A.length===0?e.jsx(M,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(l.search,"No Connections found"),description:l.search?`No Connections match "${l.search}"`:"Create a connection to get started.",actions:!l.search&&e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:g}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:A.map(t=>e.jsx(Ye,{connection:t,fallbackIcon:e.jsx(z,{}),onClick:()=>i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}}),headerActions:e.jsxs(xe,{children:[e.jsx(he,{asChild:!0,children:e.jsx(S,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:n=>n.stopPropagation(),children:e.jsx(je,{size:20})})}),e.jsxs(ge,{align:"end",onClick:n=>n.stopPropagation(),children:[e.jsxs(F,{onClick:n=>{n.stopPropagation(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}})},children:[e.jsx(ye,{size:16}),"Open"]}),e.jsxs(F,{variant:"destructive",onClick:n=>{n.stopPropagation(),b({type:"delete",connection:t})},children:[e.jsx(ve,{size:16}),"Delete"]})]})]}),body:e.jsx(Ce,{status:t.status}),footer:e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(re,{id:t.updated_by??t.created_by,size:"3xs"})}),e.jsx("span",{className:"shrink-0 ml-2",children:t.updated_at?_e(new Date(t.updated_at)):"—"})]})},t.id))})}):e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:e.jsx("div",{className:"min-w-[1000px]",children:e.jsx(Qe,{columns:Oe,data:A,isLoading:!1,sortKey:l.sortKey,sortDirection:l.sortDirection,onSort:l.handleSort,onRowClick:t=>i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}}),emptyState:l.search?e.jsx(M,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${l.search}"`}):e.jsx(M,{image:e.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:e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:g}}),children:"Browse Store"})})})})})})})]})}function Wn(){const s=be.c(1);let o;return s[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(tt,{children:e.jsx(X.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(St,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Ht,{})})}),s[0]=o):o=s[0],o}export{Wn as default};
|
|
1
|
+
import{c as be,j as e,r as X,u as Fe,m as Be,b as Ue,a as He,d as Le,ai as Me,l as ze,k as Re,i as Xe,O as g,t as D,o as ke,aj as We,s as C,ak as Ke}from"./index-D52JGBSW.js";import{g as Ge}from"./generate-id-Dyweu44Y.js";import{C as qe,a as Qe}from"./collection-table-wrapper-BRK1q11U.js";import{C as Je}from"./collection-search-By6ZMwtA.js";import{C as Ye}from"./connection-card-B91SZISg.js";import{B as L}from"./badge-COxDM0wU.js";import{i as Ze}from"./AlertCircle-DxaosN_f.js";import{i as et}from"./CheckCircle-CIh-eFaM.js";import{E as M}from"./empty-state-D0ORcC9s.js";import{E as tt}from"./error-boundary-BLEw7xWo.js";import{I as nt}from"./integration-icon-B4lXAd2V.js";import{P as E}from"./index-DH9RHGRj.js";import{u as st,U as re}from"./use-list-state-CmfVe0Sz.js";import{u as ot}from"./use-binding-Cs2Y-PcQ.js";import{f as rt,e as it}from"./registry-utils-DEhTjpqF.js";import{f as ie,a as ae,b as ce,c as le,d as de,e as me,A as ue,g as pe}from"./alert-dialog-CqcaYkiJ.js";import{B as at,a as ct,b as lt,c as dt}from"./breadcrumb-DNLwlIVn.js";import{B as S}from"./button-Bh5FwGIY.js";import{D as mt,a as ut,b as pt,c as xt,d as ht,e as gt}from"./dialog-BYwNnwwA.js";import{D as xe,a as he,b as ge,c as F}from"./dropdown-menu-usbHDlIZ.js";import{a as ft,F as f,b as j,c as y,d as v,f as _}from"./form-Cci_0GHL.js";import{I as T}from"./input--zCus1rn.js";import{S as jt,a as yt,b as vt,c as _t,d as $}from"./select-DEG2HUsU.js";import{T as Ct}from"./textarea-DGrDCMYg.js";import{g as Nt,h as bt}from"./use-connection-Dj9QSNVL.js";import{u as fe,a as kt}from"./constants-DnuxEo5s.js";import{b as wt}from"./use-mcp-tools-CjZtbvY1.js";import{n as z}from"./Container-adXBBWtI.js";import{i as je}from"./DotsVertical-fI7whvq1.js";import{s as ye}from"./Eye-0EEXzuIs.js";import{s as R}from"./Globe02-McmndEy1.js";import{i as St}from"./Loading01-C_dZ70Y_.js";import{i as Tt}from"./Terminal-Z3ZvfZjV.js";import{s as ve}from"./Trash01-DGNEPK6E.js";import{f as _e}from"./format-time-CMKyl-GC.js";import{r as Dt,E as Pt,e as we}from"./env-vars-editor-CEsz7coi.js";import"./ArrowDown-BCC90_2r.js";import"./ArrowUp-095f00XC.js";import"./Check-DX81M4UN.js";import"./Grid01-D-UJvJ4U.js";import"./List-ChBrkSt3.js";import"./tooltip-DJR7bz1l.js";import"./view-mode-toggle-DnPBouL3.js";import"./table-BE49uKeW.js";import"./SearchMd-C2TJxhWh.js";import"./card-CQpD36Cd.js";import"./AlertTriangle-4A_giHV7.js";import"./use-mobile-DBGLvQCZ.js";import"./avatar-CLwmO-iu.js";import"./useQuery--0jbogka.js";import"./use-view-mode-DyCv_xrc.js";import"./binder-BnqkDZhr.js";import"./ChevronRight-DY1xiCUb.js";import"./label-Dt9hwfoA.js";import"./ChevronDown-C_pFRqX8.js";import"./useMutation-B8qgpkUA.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./Plus-Cqqd1qB7.js";function Ce(s){const o=be.c(3),{status:i}=s;if(i==="active"){let c;return o[0]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(L,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[e.jsx(et,{size:12}),"Active"]}),o[0]=c):c=o[0],c}if(i==="error"){let c;return o[1]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(L,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[e.jsx(Ze,{size:12}),"Error"]}),o[1]=c):c=o[1],c}let d;return o[2]===Symbol.for("react.memo_cache_sentinel")?(d=e.jsx(L,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),o[2]=d):d=o[2],d}const It=ke({key:C(),value:C()}),Et=ke({title:C().min(1,"Name is required"),description:C().nullable().optional(),ui_type:Ke(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:C().optional(),connection_token:C().nullable().optional(),npx_package:C().optional(),stdio_command:C().optional(),stdio_args:C().optional(),stdio_cwd:C().optional(),env_vars:We(It).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 U(s){const o=s.trim();if(!o)return"";try{const i=new URL(o),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return o.replace(/\/+$/,"")}}function $t(s){const o=s.trim().split(/\s+/).filter(Boolean);if(o.length<2)return null;const i=o[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const c=o.slice(1).find(N=>!N.startsWith("-"));return c?{packageName:c}:null}function B(s){const{uiType:o}=s,i=U(s.connectionUrl??"");if((o==="HTTP"||o==="SSE"||o==="Websocket")&&i===U("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 d=(s.npxPackage??"").trim();return o==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function Ne(s){if(s.registryItems.length===0||s.uiType!=="HTTP"&&s.uiType!=="SSE"&&s.uiType!=="Websocket")return null;const o=U(s.connectionUrl??"");if(!o)return null;const i=s.registryItems.find(N=>(N.server?.remotes??[]).some(O=>U(O.url??"")===o));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",c=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:c}:null}function Ot(s,o){const i={command:"npx",args:["-y",s]},d=we(o);return Object.keys(d).length>0&&(i.envVars=d),i}function At(s,o,i,d){const c={command:s};o.trim()&&(c.args=o.trim().split(/\s+/)),i?.trim()&&(c.cwd=i.trim());const N=we(d);return Object.keys(N).length>0&&(c.envVars=N),c}function Vt(s){return s.command==="npx"}function Ft(s){return s.args?.find(o=>!o.startsWith("-"))??""}function Bt(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Ut(s,o){switch(o.type){case"edit":return{mode:"editing",connection:o.connection};case"delete":return{mode:"deleting",connection:o.connection};case"force-delete":return{mode:"force-deleting",connection:o.connection,agentNames:o.agentNames};case"close":return{mode:"idle"}}}function Ht(){const{org:s}=Fe(),o=Be(),i=Ue(),d=He({strict:!1}),{data:c}=Le.useSession(),{stdioEnabled:N}=Me(),l=st({namespace:s.slug,resource:"connections"}),O=Nt(),A=bt(l),[u,b]=X.useReducer(Ut,{mode:"idle"}),W=ot(A)[0],K=W?.id??"",G=rt(W?.tools),Se=fe({connectionId:K||null,orgId:s.id}),{data:Te}=wt({client:Se,toolName:G,toolArguments:{limit:200},enabled:!!(K&&G),staleTime:3600*1e3,select:t=>t.structuredContent??t}),q=it(Te??[]),Q=d.action==="create",De=()=>{i({to:"/$org/$project/mcps",params:{org:s.slug,project:g},search:{action:"create"}})},J=()=>{i({to:"/$org/$project/mcps",params:{org:s.slug,project:g},search:{}})},r=ze({resolver:Re(Et),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),p=r.watch("ui_type"),Y=r.watch("connection_url"),Pe=r.watch("npx_package"),P=B({uiType:p,connectionUrl:Y??"",npxPackage:Pe??""})??Ne({uiType:p,connectionUrl:Y??"",registryItems:q}),m=u.mode==="editing"?u.connection:null;X.useEffect(()=>{if(m){const t=Xe(m.connection_headers)?m.connection_headers:null;if(t&&m.connection_type==="STDIO"){const n=Dt(t.envVars);if(Vt(t)){const a=Ft(t);r.reset({title:m.title,description:m.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:n})}else{const a=Bt(t);r.reset({title:m.title,description:m.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:n})}}else r.reset({title:m.title,description:m.description,ui_type:m.connection_type,connection_url:m.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[m,r]);const Z=fe({connectionId:kt,orgId:s.id}),ee=()=>{o.invalidateQueries({predicate:t=>{const n=t.queryKey;return n[1]===s.id&&n[3]==="collection"&&n[4]==="CONNECTIONS"}})},te=t=>{const n=t.content;return Array.isArray(n)&&n[0]?.type==="text"&&typeof n[0].text=="string"?n[0].text:"Unknown error"},Ie=async()=>{if(u.mode!=="deleting")return;const t=u.connection;b({type:"close"});try{const n=await Z.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:t.id}});if(n.isError){const a=te(n),k=a.replace(/^Error:\s*/,"");try{const x=JSON.parse(k);if(x.code==="CONNECTION_IN_USE"&&x.agentNames){b({type:"force-delete",connection:t,agentNames:x.agentNames.map(w=>`"${w}"`).join(", ")});return}}catch{}D.error(`Failed to delete connection: ${a}`);return}ee(),D.success("Connection deleted successfully")}catch(n){const a=n instanceof Error?n.message:String(n);D.error(`Failed to delete connection: ${a}`)}},Ee=async()=>{if(u.mode!=="force-deleting")return;const t=u.connection.id;b({type:"close"});try{const n=await Z.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:t,force:!0}});if(n.isError){D.error(`Failed to delete connection: ${te(n)}`);return}ee(),D.success("Connection deleted successfully")}catch(n){const a=n instanceof Error?n.message:String(n);D.error(`Failed to delete connection: ${a}`)}},$e=async t=>{let n,a=null,k=null,x=null;if(t.ui_type==="NPX"?(n="STDIO",a="",x=Ot(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(n="STDIO",a="",x=At(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(n=t.ui_type,a=t.connection_url||"",k=t.connection_token||null),m){await O.update.mutateAsync({id:m.id,data:{title:t.title,description:t.description||null,connection_type:n,connection_url:a,...k&&{connection_token:k},...x&&{connection_headers:x}}}),b({type:"close"}),r.reset();return}const w=Ge("conn");await O.create.mutateAsync({id:w,title:t.title,description:t.description||null,connection_type:n,connection_url:a,connection_token:k,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:c?.user?.id||"system",organization_id:s.id,icon:null,app_name:null,app_id:null,connection_headers:x,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),J(),r.reset(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:w}})},ne=t=>{t||(Q?J():b({type:"close"}),r.reset())},V=t=>{const n=t.trim();if(!n)return;const a=!!r.formState.dirtyFields.title,k=!!r.formState.dirtyFields.description,x=!!r.formState.dirtyFields.env_vars,w=h=>{if(h&&(!a&&!r.getValues("title").trim()&&h.title&&r.setValue("title",h.title,{shouldDirty:!1}),!k&&!(r.getValues("description")??"").trim()&&h.description&&r.setValue("description",h.description,{shouldDirty:!1}),!x&&h.envVarKeys?.length)){const se=r.getValues("env_vars")??[],Ve=new Set(se.map(I=>I.key)),oe=h.envVarKeys.filter(I=>!Ve.has(I));oe.length>0&&r.setValue("env_vars",[...se,...oe.map(I=>({key:I,value:""}))],{shouldDirty:!0})}},H=$t(n);if(H&&N){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",H.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),w(B({uiType:"NPX",npxPackage:H.packageName}));return}if(n.startsWith("http://")||n.startsWith("https://")){const h=p==="HTTP"||p==="SSE"||p==="Websocket"?p:"HTTP";r.setValue("ui_type",h,{shouldDirty:!0}),r.setValue("connection_url",n,{shouldDirty:!0}),w(B({uiType:h,connectionUrl:n})??Ne({uiType:h,connectionUrl:n,registryItems:q}));return}p==="NPX"&&w(B({uiType:"NPX",npxPackage:n}))},Oe=[{id:"title",header:"Name",render:t=>e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(nt,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(z,{})}),e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title})]}),cellClassName:"w-32 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-muted-foreground truncate block",title:t.description||"",children:t.description||"—"}),cellClassName:"flex-1 min-w-0 max-w-0",wrap:!1,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-xs font-medium",children:t.connection_type}),cellClassName:"w-16 shrink-0",sortable:!0},{id:"status",header:"Status",render:t=>e.jsx(Ce,{status:t.status}),cellClassName:"w-28 shrink-0",sortable:!1},{id:"updated_by",header:"Updated by",render:t=>e.jsx(re,{id:t.updated_by??t.created_by,size:"3xs"}),cellClassName:"w-32 shrink-0",sortable:!0},{id:"updated_at",header:"Updated",render:t=>e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:t.updated_at?_e(new Date(t.updated_at)):"—"}),cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(xe,{children:[e.jsx(he,{asChild:!0,children:e.jsx(S,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:n=>n.stopPropagation(),children:e.jsx(je,{size:20})})}),e.jsxs(ge,{align:"end",onClick:n=>n.stopPropagation(),children:[e.jsxs(F,{onClick:n=>{n.stopPropagation(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}})},children:[e.jsx(ye,{size:16}),"Open"]}),e.jsxs(F,{variant:"destructive",onClick:n=>{n.stopPropagation(),b({type:"delete",connection:t})},children:[e.jsx(ve,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],Ae=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:g}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(S,{onClick:De,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(E,{children:[e.jsx(mt,{open:Q||u.mode==="editing",onOpenChange:ne,children:e.jsxs(ut,{className:"sm:max-w-[525px]",children:[e.jsxs(pt,{children:[e.jsx(xt,{children:m?"Edit Connection":"Create Connection"}),e.jsx(ht,{children:m?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(ft,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit($e),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(f,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Type *"}),e.jsxs(jt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(v,{children:e.jsx(yt,{children:e.jsx(vt,{})})}),e.jsxs(_t,{children:[e.jsx($,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx($,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"SSE"]})}),e.jsx($,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"Websocket"]})}),N&&e.jsxs(e.Fragment,{children:[e.jsx($,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx($,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Tt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(_,{})]})}),p==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(f,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"NPM Package *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:n=>{const a=n.clipboardData.getData("text");a&&(n.preventDefault(),r.setValue("npx_package",a.trim(),{shouldDirty:!0}),V(a))},onBlur:n=>{V(n.target.value),t.onBlur()}})}),e.jsx(_,{})]})})}),p==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(f,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Command *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(_,{})]})}),e.jsx(f,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Arguments"}),e.jsx(v,{children:e.jsx(T,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(_,{})]})})]}),e.jsx(f,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Working Directory"}),e.jsx(v,{children:e.jsx(T,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(_,{})]})})]}),(p==="NPX"||p==="STDIO")&&e.jsx(f,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Environment Variables"}),e.jsx(v,{children:e.jsx(Pt,{value:t.value??[],onChange:t.onChange})}),e.jsx(_,{})]})}),p!=="NPX"&&p!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(f,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"URL *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:n=>{const a=n.clipboardData.getData("text");a&&(n.preventDefault(),r.setValue("connection_url",a.trim(),{shouldDirty:!0}),V(a))},onBlur:n=>{V(n.target.value),t.onBlur()}})}),e.jsx(_,{})]})}),e.jsx(f,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:P?.token?.label??"Token (optional)"}),e.jsx(v,{children:e.jsx(T,{type:"password",placeholder:P?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),P?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.token.helperText,P.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.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"})]})]}),e.jsx(_,{})]})})]}),e.jsx(f,{control:r.control,name:"title",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Name *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"My Connection",...t})}),e.jsx(_,{})]})}),e.jsx(f,{control:r.control,name:"description",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Description"}),e.jsx(v,{children:e.jsx(Ct,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(_,{})]})})]}),e.jsxs(gt,{children:[e.jsx(S,{type:"button",variant:"outline",onClick:()=>ne(!1),children:"Cancel"}),e.jsx(S,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":m?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(ie,{open:u.mode==="deleting",onOpenChange:t=>!t&&b({type:"close"}),children:e.jsxs(ae,{children:[e.jsxs(ce,{children:[e.jsx(le,{children:"Delete Connection?"}),e.jsxs(de,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="deleting"&&u.connection.title}),"."]})]}),e.jsxs(me,{children:[e.jsx(ue,{children:"Cancel"}),e.jsx(pe,{onClick:Ie,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(ie,{open:u.mode==="force-deleting",onOpenChange:t=>!t&&b({type:"close"}),children:e.jsxs(ae,{children:[e.jsxs(ce,{children:[e.jsx(le,{children:"Connection Used by Agents"}),e.jsx(de,{asChild:!0,children:e.jsxs("div",{children:[e.jsxs("p",{children:["The connection"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="force-deleting"&&u.connection.title})," ","is currently used by the following agent(s):"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="force-deleting"&&u.agentNames}),"."]}),e.jsx("p",{className:"mt-2",children:"Deleting this connection will remove it from those agents, which may impact existing workflows that depend on them."})]})})]}),e.jsxs(me,{children:[e.jsx(ue,{children:"Cancel"}),e.jsx(pe,{onClick:Ee,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]})]})}),e.jsxs(E.Header,{children:[e.jsx(E.Header.Left,{children:e.jsx(at,{children:e.jsx(ct,{children:e.jsx(lt,{children:e.jsx(dt,{children:"Connections"})})})})}),e.jsxs(E.Header.Right,{children:[e.jsx(qe,{viewMode:l.viewMode,onViewModeChange:l.setViewMode,sortKey:l.sortKey,sortDirection:l.sortDirection,onSort:l.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"}]}),Ae]})]}),e.jsx(Je,{value:l.search,onChange:l.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(l.setSearch(""),t.target.blur())}}),e.jsx(E.Content,{children:l.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:A.length===0?e.jsx(M,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(l.search,"No Connections found"),description:l.search?`No Connections match "${l.search}"`:"Create a connection to get started.",actions:!l.search&&e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:g}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:A.map(t=>e.jsx(Ye,{connection:t,fallbackIcon:e.jsx(z,{}),onClick:()=>i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}}),headerActions:e.jsxs(xe,{children:[e.jsx(he,{asChild:!0,children:e.jsx(S,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:n=>n.stopPropagation(),children:e.jsx(je,{size:20})})}),e.jsxs(ge,{align:"end",onClick:n=>n.stopPropagation(),children:[e.jsxs(F,{onClick:n=>{n.stopPropagation(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}})},children:[e.jsx(ye,{size:16}),"Open"]}),e.jsxs(F,{variant:"destructive",onClick:n=>{n.stopPropagation(),b({type:"delete",connection:t})},children:[e.jsx(ve,{size:16}),"Delete"]})]})]}),body:e.jsx(Ce,{status:t.status}),footer:e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(re,{id:t.updated_by??t.created_by,size:"3xs"})}),e.jsx("span",{className:"shrink-0 ml-2",children:t.updated_at?_e(new Date(t.updated_at)):"—"})]})},t.id))})}):e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:e.jsx("div",{className:"min-w-[1000px]",children:e.jsx(Qe,{columns:Oe,data:A,isLoading:!1,sortKey:l.sortKey,sortDirection:l.sortDirection,onSort:l.handleSort,onRowClick:t=>i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}}),emptyState:l.search?e.jsx(M,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${l.search}"`}):e.jsx(M,{image:e.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:e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:g}}),children:"Browse Store"})})})})})})})]})}function Wn(){const s=be.c(1);let o;return s[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(tt,{children:e.jsx(X.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(St,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Ht,{})})}),s[0]=o):o=s[0],o}export{Wn as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as t,E as a}from"./index-D52JGBSW.js";const e=t(a,{target:"draft-7"});export{e as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as y,j as _,ar as b,br as C,c as d,n as f,bs as T}from"./index-
|
|
1
|
+
import{r as y,j as _,ar as b,br as C,c as d,n as f,bs as T}from"./index-D52JGBSW.js";var v=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),w="VisuallyHidden",g=y.forwardRef((t,e)=>_.jsx(b.span,{...t,ref:e,style:{...v,...t.style}}));g.displayName=w;var D=g;const m={authConfig:()=>["authConfig"],threads:t=>["threads",t],virtualMcpThreads:(t,e)=>["threads",t,"virtual-mcp",e],thread:(t,e)=>["thread",t,e],threadMessages:(t,e)=>["thread-messages",t,e],messages:t=>["messages",t],organizations:()=>["organizations"],members:t=>[t,"members"],invitations:t=>[t,"invitations"],organizationRoles:t=>[t,"organization-roles"],connections:t=>[t,"connections"],connectionsByBinding:(t,e)=>[t,"connections",`binding:${e}`],connection:(t,e)=>[t,"connection",e],isMCPAuthenticated:(t,e)=>["is-mcp-authenticated",t,e],mcpTools:(t,e)=>["mcp","tools",t,e],mcpClient:(t,e,n,o)=>["mcp","client",t,e,n,o],mcpToolsList:t=>["mcp","client",t,"tools"],mcpResourcesList:t=>["mcp","client",t,"resources"],mcpPromptsList:t=>["mcp","client",t,"prompts"],mcpReadResource:(t,e)=>["mcp","client",t,"resource",e],mcpGetPrompt:(t,e,n)=>["mcp","client",t,"prompt",e,n],mcpToolCall:(t,e,n)=>["mcp","client",t,"tool-call",e,n],organizationSettings:t=>["organization-settings",t],activeOrganization:t=>["activeOrganization",t],modelsList:t=>["models-list",t],connectionCollections:t=>[t,"collections","discovery"],toolCall:(t,e,n)=>["tool-call",t,e,n],collectionItems:(t,e)=>["collection",t,e],collection:(t,e,n)=>[t,e,"collection",n],collectionItem:(t,e,n,o,i)=>[t,e,n,"collection",o,i],collectionList:(t,e,n,o,i)=>[t,e,n,"collection",o,"list",i],collectionListInfinite:(t,e,n,o,i)=>[t,e,n,"collection",o,"list-infinite",i],githubReadme:(t,e)=>["github-readme",t,e],monitoringStats:()=>["monitoring","stats"],monitoringLogs:t=>["monitoring","logs",t],monitoringLogsInfinite:(t,e)=>["monitoring","logs-infinite",t,e],virtualMcpPrompts:t=>["virtual-mcp",t,"prompts"],connectionPrompts:t=>["connection",t,"prompts"],connectionResources:t=>["connection",t,"resources"],user:t=>["user",t]};class P extends C{constructor(e,n){super(e,n)}send(e,n){const o=S(e);return o?.type==="emit"?(this.onmessage?.(o.message),Promise.resolve()):o?.type==="suppress"?Promise.resolve():super.send(e,n)}}function S(t){const e=t;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const n=e?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"mesh-virtual-mcp",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const I={name:"mesh-sdk",version:"1.0.0"};function R(t,e){const n=e??(typeof window<"u"?window.location.origin:void 0);if(!n)throw new Error("MCP client requires either meshUrl option or a browser environment.");const o=t?`/mcp/${t}`:"/mcp";return new URL(o,n).href}async function h({connectionId:t,orgId:e,token:n,meshUrl:o}){const i=R(t,o),c=new T(I,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),r=new P(new URL(i),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream","x-org-id":e,...n?{Authorization:`Bearer ${n}`}:{}}}});await c.connect(r);const a=m.mcpClient(e,t??"self",n??"",o??"");return c.toJSON=()=>`mcp-client:${a.join(":")}`,c}function A(t){const e=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:c}=t;let r;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==i?(r=m.mcpClient(o,n??"self",i??"",c??""),e[0]=n,e[1]=c,e[2]=o,e[3]=i,e[4]=r):r=e[4];const a=r;let s;e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==i?(s=()=>h({connectionId:n,orgId:o,token:i,meshUrl:c}),e[5]=n,e[6]=c,e[7]=o,e[8]=i,e[9]=s):s=e[9];let l;e[10]!==a||e[11]!==s?(l={queryKey:a,queryFn:s,staleTime:1/0,gcTime:0},e[10]=a,e[11]=s,e[12]=l):l=e[12];const{data:p}=f(l);return p}function O(t){const e=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:c}=t;let r;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==i?(r=n!==void 0?m.mcpClient(o,n??"self",i??"",c??""):["mcp","client","skip",o],e[0]=n,e[1]=c,e[2]=o,e[3]=i,e[4]=r):r=e[4];const a=r;let s;e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==i?(s=async()=>n===void 0?null:h({connectionId:n,orgId:o,token:i,meshUrl:c}),e[5]=n,e[6]=c,e[7]=o,e[8]=i,e[9]=s):s=e[9];let l;e[10]!==a||e[11]!==s?(l={queryKey:a,queryFn:s,staleTime:1/0,gcTime:0},e[10]=a,e[11]=s,e[12]=l):l=e[12];const{data:p}=f(l);return p??null}const M={SELF:t=>`${t}_self`,REGISTRY:t=>`${t}_registry`,COMMUNITY_REGISTRY:t=>`${t}_community-registry`,DEV_ASSETS:t=>`${t}_dev-assets`},$="self";function j(t){return{id:M.REGISTRY(t),title:"Deco Store",description:"Official deco MCP registry with curated integrations",connection_type:"HTTP",connection_url:"https://api.decocms.com/mcp/registry",icon:"https://assets.decocache.com/decocms/00ccf6c3-9e13-4517-83b0-75ab84554bb9/596364c63320075ca58483660156b6d9de9b526e.png",app_name:"deco-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function z(){return{id:"community-registry",title:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",connection_type:"HTTP",connection_url:"https://sites-registry.decocache.com/mcp",icon:"https://assets.decocache.com/decocms/cd7ca472-0f72-463a-b0de-6e44bdd0f9b4/mcp.png",app_name:"mcp-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function K(t={}){return{id:t.id,title:"OpenRouter",description:"Access hundreds of LLM models from a single API",icon:"https://assets.decocache.com/decocms/b2e2f64f-6025-45f7-9e8c-3b3ebdd073d8/openrouter_logojpg.jpg",app_name:"openrouter",app_id:"openrouter",connection_type:"HTTP",connection_url:"https://sites-openrouter.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{source:"chat",verified:!1,scopeName:"deco",toolsCount:0,publishedAt:null,repository:null}}}function k(){return{title:"MCP Studio",description:"An app that allows you to create and manage MCPs",icon:"https://assets.decocache.com/mcp/09e44283-f47d-4046-955f-816d227c626f/app.png",app_name:"mcp-studio",app_id:"65a1b407-b6af-41e2-a89f-ce9450c05bbc",connection_type:"HTTP",connection_url:"https://sites-vibemcp.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!1,type:"mcp-studio"}}}function q(t){return{id:L(t),organization_id:t,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:null},connections:[]}}const u="decopilot_";function x(t){return!t||!t.startsWith(u)?null:t.slice(u.length)||null}function L(t){return`${u}${t}`}export{m as K,D as R,P as S,v as V,M as W,$ as a,z as b,h as c,q as d,k as e,K as f,L as g,j as h,x as i,O as j,A as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as I,bI as es,bJ as ts,D as as,bd as q,s as x,bK as Be,bL as Qt,bh as ss,bi as rs,bc as os,be as B,b8 as ke,aj as $e,o as j,bf as S,bg as ue,bM as ns,bN as k,ak as is,bq as ls,c as D,u as be,K as ye,e as Xt,m as We,t as Te,j as d,b as cs,O as us,d as ds}from"./index-
|
|
1
|
+
import{r as I,bI as es,bJ as ts,D as as,bd as q,s as x,bK as Be,bL as Qt,bh as ss,bi as rs,bc as os,be as B,b8 as ke,aj as $e,o as j,bf as S,bg as ue,bM as ns,bN as k,ak as is,bq as ls,c as D,u as be,K as ye,e as Xt,m as We,t as Te,j as d,b as cs,O as us,d as ds}from"./index-D52JGBSW.js";import{u as ft,a as ht,d as ps}from"./constants-DnuxEo5s.js";import{b as ms}from"./use-virtual-mcp-ctHrpgTx.js";import{A as Nt,D as Ke}from"./decopilot-events-Brt4gAR6.js";import{u as gt,a as fs}from"./use-llm-C_wGfF_N.js";import{u as hs}from"./useQuery--0jbogka.js";import{u as qe,L as vt}from"./localstorage-keys-DFOUclc3.js";import{E as yt}from"./error-boundary-BLEw7xWo.js";import{S as U,u as gs}from"./skeleton-_QoQu65Z.js";import{c as Kt,B as ot}from"./button-Bh5FwGIY.js";import{I as vs}from"./input--zCus1rn.js";import{P as ys,a as xs,b as bs}from"./popover-C4pJDbzd.js";import{S as _s,a as Es,b as Ss,c as Is,d as ws}from"./select-DEG2HUsU.js";import{i as Ts}from"./AlertTriangle-4A_giHV7.js";import{t as nt}from"./ChevronDown-C_pFRqX8.js";import{i as Ns}from"./File06-vlWs29hO.js";import{c as Cs}from"./Grid01-D-UJvJ4U.js";import{a as As}from"./Image01-D37M36hG.js";import{s as Ms}from"./RefreshCcw01-aEpj51K0.js";import{i as ea}from"./SearchMd-C2TJxhWh.js";import{t as Rs}from"./Settings01-CUb7_xIo.js";import{b as xt,c as js,a as ks,e as Os}from"./use-connection-Dj9QSNVL.js";import{u as Ps}from"./useSuspenseInfiniteQuery-DU-5JWKq.js";var Oe;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function a(r){throw new Error}t.assertNever=a,t.arrayToEnum=r=>{const o={};for(const i of r)o[i]=i;return o},t.getValidEnumValues=r=>{const o=t.objectKeys(r).filter(n=>typeof r[r[n]]!="number"),i={};for(const n of o)i[n]=r[n];return t.objectValues(i)},t.objectValues=r=>t.objectKeys(r).map(function(o){return r[o]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const o=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&o.push(i);return o},t.find=(r,o)=>{for(const i of r)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function s(r,o=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=s,t.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(Oe||(Oe={}));var Ct;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Ct||(Ct={}));Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Oe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class He extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},s={_errors:[]},r=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)s._errors.push(a(i));else{let n=s,c=0;for(;c<i.path.length;){const l=i.path[c];c===i.path.length-1?(n[l]=n[l]||{_errors:[]},n[l]._errors.push(a(i))):n[l]=n[l]||{_errors:[]},n=n[l],c++}}};return r(this),s}static assert(e){if(!(e instanceof He))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),s=[];for(const r of this.issues)if(r.path.length>0){const o=r.path[0];a[o]=a[o]||[],a[o].push(e(r))}else s.push(e(r));return{formErrors:s,fieldErrors:a}}get formErrors(){return this.flatten()}}He.create=t=>new He(t);var At;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(At||(At={}));var T;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(T||(T={}));const ta=({size:t=24,color:e="currentColor",...a})=>I.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},I.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));ta.displayName="ChevronSelectorVertical";const aa=({size:t=24,color:e="currentColor",...a})=>I.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},I.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));aa.displayName="CurrencyDollar";const sa=({size:t=24,color:e="currentColor",...a})=>I.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},I.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));sa.displayName="LogOut04";const ra=({size:t=24,color:e="currentColor",...a})=>I.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},I.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));ra.displayName="Stars01";var oa="vercel.ai.error",Ds=Symbol.for(oa),Mt,Rt,K=class na extends(Rt=Error,Mt=Ds,Rt){constructor({name:e,message:a,cause:s}){super(a),this[Mt]=!0,this.name=e,this.cause=s}static isInstance(e){return na.hasMarker(e,oa)}static hasMarker(e,a){const s=Symbol.for(a);return e!=null&&typeof e=="object"&&s in e&&typeof e[s]=="boolean"&&e[s]===!0}};function ia(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var la="AI_InvalidArgumentError",ca=`vercel.ai.error.${la}`,$s=Symbol.for(ca),jt,kt,Ls=class extends(kt=K,jt=$s,kt){constructor({message:t,cause:e,argument:a}){super({name:la,message:t,cause:e}),this[jt]=!0,this.argument=a}static isInstance(t){return K.hasMarker(t,ca)}},ua="AI_JSONParseError",da=`vercel.ai.error.${ua}`,Zs=Symbol.for(da),Ot,Pt,Dt=class extends(Pt=K,Ot=Zs,Pt){constructor({text:t,cause:e}){super({name:ua,message:`JSON parsing failed: Text: ${t}.
|
|
2
2
|
Error message: ${ia(e)}`,cause:e}),this[Ot]=!0,this.text=t}static isInstance(t){return K.hasMarker(t,da)}},pa="AI_TypeValidationError",ma=`vercel.ai.error.${pa}`,Fs=Symbol.for(ma),$t,Lt,Ne=class it extends(Lt=K,$t=Fs,Lt){constructor({value:e,cause:a,context:s}){let r="Type validation failed";if(s?.field&&(r+=` for ${s.field}`),s?.entityName||s?.entityId){r+=" (";const o=[];s.entityName&&o.push(s.entityName),s.entityId&&o.push(`id: "${s.entityId}"`),r+=o.join(", "),r+=")"}super({name:pa,message:`${r}: Value: ${JSON.stringify(e)}.
|
|
3
3
|
Error message: ${ia(a)}`,cause:a}),this[$t]=!0,this.value=e,this.context=s}static isInstance(e){return K.hasMarker(e,ma)}static wrap({value:e,cause:a,context:s}){var r,o,i;return it.isInstance(a)&&a.value===e&&((r=a.context)==null?void 0:r.field)===s?.field&&((o=a.context)==null?void 0:o.entityName)===s?.entityName&&((i=a.context)==null?void 0:i.entityId)===s?.entityId?a:new it({value:e,cause:a,context:s})}},Le=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:s="-"}={})=>{const r=()=>{const o=a.length,i=new Array(e);for(let n=0;n<e;n++)i[n]=a[Math.random()*o|0];return i.join("")};if(t==null)return r;if(a.includes(s))throw new Ls({argument:"separator",message:`The separator "${s}" must not be part of the alphabet "${a}".`});return()=>`${t}${s}${r()}`},Us=Le();function Zt(t=globalThis){var e,a,s;return t.window?"runtime/browser":(e=t.navigator)!=null&&e.userAgent?`runtime/${t.navigator.userAgent.toLowerCase()}`:(s=(a=t.process)==null?void 0:a.versions)!=null&&s.node?`runtime/node.js/${t.process.version.substring(0)}`:t.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function ve(t){if(t==null)return{};const e={};if(t instanceof Headers)t.forEach((a,s)=>{e[s.toLowerCase()]=a});else{Array.isArray(t)||(t=Object.entries(t));for(const[a,s]of t)s!=null&&(e[a.toLowerCase()]=s)}return e}function Ft(t,...e){const a=new Headers(ve(t)),s=a.get("user-agent")||"";return a.set("user-agent",[s,...e].filter(Boolean).join(" ")),Object.fromEntries(a.entries())}var zs=/"__proto__"\s*:/,Vs=/"constructor"\s*:/;function Ut(t){const e=JSON.parse(t);return e===null||typeof e!="object"||zs.test(t)===!1&&Vs.test(t)===!1?e:Bs(e)}function Bs(t){let e=[t];for(;e.length;){const a=e;e=[];for(const s of a){if(Object.prototype.hasOwnProperty.call(s,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(s,"constructor")&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const r in s){const o=s[r];o&&typeof o=="object"&&e.push(o)}}}return t}function qs(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return Ut(t)}try{return Ut(t)}finally{Error.stackTraceLimit=e}}function bt(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:a}=t;if(a!=null)for(const s of Object.keys(a))a[s]=ge(a[s])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(ge):ge(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(ge)),t.allOf!=null&&(t.allOf=t.allOf.map(ge)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(ge));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=ge(e[a]);return t}function ge(t){return typeof t=="boolean"?t:bt(t)}var Hs=Symbol("Let zodToJsonSchema decide on which parser to use"),zt={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Ws=t=>typeof t=="string"?{...zt,name:t}:{...zt,...t};function W(){return{}}function Js(t,e){var a,s,r;const o={type:"array"};return(a=t.type)!=null&&a._def&&((r=(s=t.type)==null?void 0:s._def)==null?void 0:r.typeName)!==T.ZodAny&&(o.items=R(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(o.minItems=t.minLength.value),t.maxLength&&(o.maxItems=t.maxLength.value),t.exactLength&&(o.minItems=t.exactLength.value,o.maxItems=t.exactLength.value),o}function Gs(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function Ys(){return{type:"boolean"}}function fa(t,e){return R(t.type._def,e)}var Qs=(t,e)=>R(t.innerType._def,e);function ha(t,e,a){const s=a??e.dateStrategy;if(Array.isArray(s))return{anyOf:s.map((r,o)=>ha(t,e,r))};switch(s){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Xs(t)}}var Xs=t=>{const e={type:"integer",format:"unix-time"};for(const a of t.checks)switch(a.kind){case"min":e.minimum=a.value;break;case"max":e.maximum=a.value;break}return e};function Ks(t,e){return{...R(t.innerType._def,e),default:t.defaultValue()}}function er(t,e){return e.effectStrategy==="input"?R(t.schema._def,e):W()}function tr(t){return{type:"string",enum:Array.from(t.values)}}var ar=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function sr(t,e){const a=[R(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),R(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(r=>!!r),s=[];return a.forEach(r=>{if(ar(r))s.push(...r.allOf);else{let o=r;if("additionalProperties"in r&&r.additionalProperties===!1){const{additionalProperties:i,...n}=r;o=n}s.push(o)}}),s.length?{allOf:s}:void 0}function rr(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var et=void 0,G={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(et===void 0&&(et=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),et),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function ga(t,e){const a={type:"string"};if(t.checks)for(const s of t.checks)switch(s.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,s.value):s.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,s.value):s.value;break;case"email":switch(e.emailStrategy){case"format:email":Y(a,"email",s.message,e);break;case"format:idn-email":Y(a,"idn-email",s.message,e);break;case"pattern:zod":V(a,G.email,s.message,e);break}break;case"url":Y(a,"uri",s.message,e);break;case"uuid":Y(a,"uuid",s.message,e);break;case"regex":V(a,s.regex,s.message,e);break;case"cuid":V(a,G.cuid,s.message,e);break;case"cuid2":V(a,G.cuid2,s.message,e);break;case"startsWith":V(a,RegExp(`^${tt(s.value,e)}`),s.message,e);break;case"endsWith":V(a,RegExp(`${tt(s.value,e)}$`),s.message,e);break;case"datetime":Y(a,"date-time",s.message,e);break;case"date":Y(a,"date",s.message,e);break;case"time":Y(a,"time",s.message,e);break;case"duration":Y(a,"duration",s.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,s.value):s.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,s.value):s.value;break;case"includes":{V(a,RegExp(tt(s.value,e)),s.message,e);break}case"ip":{s.version!=="v6"&&Y(a,"ipv4",s.message,e),s.version!=="v4"&&Y(a,"ipv6",s.message,e);break}case"base64url":V(a,G.base64url,s.message,e);break;case"jwt":V(a,G.jwt,s.message,e);break;case"cidr":{s.version!=="v6"&&V(a,G.ipv4Cidr,s.message,e),s.version!=="v4"&&V(a,G.ipv6Cidr,s.message,e);break}case"emoji":V(a,G.emoji(),s.message,e);break;case"ulid":{V(a,G.ulid,s.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{Y(a,"binary",s.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{V(a,G.base64,s.message,e);break}}break}case"nanoid":V(a,G.nanoid,s.message,e)}return a}function tt(t,e){return e.patternStrategy==="escape"?nr(t):t}var or=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function nr(t){let e="";for(let a=0;a<t.length;a++)or.has(t[a])||(e+="\\"),e+=t[a];return e}function Y(t,e,a,s){var r;t.format||(r=t.anyOf)!=null&&r.some(o=>o.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&s.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function V(t,e,a,s){var r;t.pattern||(r=t.allOf)!=null&&r.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Vt(e,s),...a&&s.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=Vt(e,s)}function Vt(t,e){var a;if(!e.applyRegexFlags||!t.flags)return t.source;const s={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},r=s.i?t.source.toLowerCase():t.source;let o="",i=!1,n=!1,c=!1;for(let l=0;l<r.length;l++){if(i){o+=r[l],i=!1;continue}if(s.i){if(n){if(r[l].match(/[a-z]/)){c?(o+=r[l],o+=`${r[l-2]}-${r[l]}`.toUpperCase(),c=!1):r[l+1]==="-"&&((a=r[l+2])!=null&&a.match(/[a-z]/))?(o+=r[l],c=!0):o+=`${r[l]}${r[l].toUpperCase()}`;continue}}else if(r[l].match(/[a-z]/)){o+=`[${r[l]}${r[l].toUpperCase()}]`;continue}}if(s.m){if(r[l]==="^"){o+=`(^|(?<=[\r
|
|
4
4
|
]))`;continue}else if(r[l]==="$"){o+=`($|(?=[\r
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as A,s as D,c as O,k as v,l as E,j as r,d as N}from"./index-
|
|
1
|
+
import{o as A,s as D,c as O,k as v,l as E,j as r,d as N}from"./index-D52JGBSW.js";import{A as I,a as M,b as L,c as R,d as T,e as $,f as k}from"./alert-dialog-CqcaYkiJ.js";import{B}from"./button-Bh5FwGIY.js";import{F as V,a as q,b as H,c as U,d as G,e as J,f as K}from"./form-Cci_0GHL.js";import{I as P}from"./input--zCus1rn.js";import{S as Q}from"./spinner-CpcUYhT9.js";import{u as W}from"./useMutation-B8qgpkUA.js";function _(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function ne(o){const e=O.c(41),{open:a,onOpenChange:s}=o;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:v(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=W(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(L,{children:[r.jsx(R,{children:"Create a new organization"}),r.jsx(T,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let x;e[6]!==i?(x=b=>i.mutateAsync(b),e[6]=i,e[7]=x):x=e[7],n=t.handleSubmit(x),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=x=>{const{field:b}=x;return r.jsxs(H,{children:[r.jsx(U,{children:"Organization Name"}),r.jsx(G,{children:r.jsx(P,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(J,{children:"The name of your company or organization"}),b.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",_(b.value)]})]}),r.jsx(K,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(V,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(I,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Q,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(B,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let S;e[26]!==d||e[27]!==g?(S=r.jsxs($,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=S):S=e[28];let h;e[29]!==S||e[30]!==n||e[31]!==m||e[32]!==c?(h=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,S]}),e[29]=S,e[30]=n,e[31]=m,e[32]=c,e[33]=h):h=e[33];let p;e[34]!==t||e[35]!==h?(p=r.jsxs(M,{children:[F,r.jsx(q,{...t,children:h})]}),e[34]=t,e[35]=h,e[36]=p):p=e[36];let C;return e[37]!==s||e[38]!==a||e[39]!==p?(C=r.jsx(k,{open:a,onOpenChange:s,children:p}),e[37]=s,e[38]=a,e[39]=p,e[40]=C):C=e[40],C}function Y(o){const{orgSlug:e}=o;window.location.href=`/${e}`}async function Z(o){const e=_(o.name);if(!e)throw new Error("Organization slug is invalid");const a=await N.organization.create({name:o.name,slug:e});if(a?.error)throw new Error(a.error.message||"Failed to create organization");const s=a?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{ne as C};
|
package/dist/client/assets/{create-project-dialog-BjqZAjhY.js → create-project-dialog-lv0TRMx_.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as A,j as e,u as L,b as R,m as k,r as z,l as M,t as B,K as T,O as j,o as V,s as f}from"./index-
|
|
1
|
+
import{c as A,j as e,u as L,b as R,m as k,r as z,l as M,t as B,K as T,O as j,o as V,s as f}from"./index-D52JGBSW.js";import{u as $}from"./useMutation-B8qgpkUA.js";import{u as q,a as O}from"./constants-DnuxEo5s.js";import{D as K,a as U,b as G,c as J,d as Q,e as Y}from"./dialog-BYwNnwwA.js";import{c as H,B as D}from"./button-Bh5FwGIY.js";import{a as W,F as v,b as F,c as N,d as S,f as w}from"./form-Cci_0GHL.js";import{I}from"./input--zCus1rn.js";import{T as X}from"./textarea-DGrDCMYg.js";import{L as Z}from"./label-Dt9hwfoA.js";import{i as ee}from"./Check-DX81M4UN.js";function se(l){return l.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function _(l){return/^[a-z0-9-]+$/.test(l)&&l.length>0&&l.length<=100}const te=["#3B82F6","#8B5CF6","#EC4899","#EF4444","#F97316","#EAB308","#22C55E","#14B8A6","#06B6D4","#6366F1","#64748B","#000000"];function re(l){const s=A.c(16),{value:n,onChange:i}=l;let c;s[0]!==i||s[1]!==n?(c=te.map(o=>e.jsx("button",{type:"button",onClick:()=>i(o),className:H("size-8 rounded-lg transition-all",n===o&&"ring-2 ring-offset-2 ring-primary"),style:{backgroundColor:o},children:n===o&&e.jsx(ee,{className:"size-4 text-white mx-auto"})},o)),s[0]=i,s[1]=n,s[2]=c):c=s[2];let u;s[3]!==c?(u=e.jsx("div",{className:"grid grid-cols-6 gap-2",children:c}),s[3]=c,s[4]=u):u=s[4];const g=n??"#3B82F6";let d;s[5]!==i?(d=o=>i(o.target.value),s[5]=i,s[6]=d):d=s[6];let t;s[7]!==g||s[8]!==d?(t=e.jsx("input",{type:"color",value:g,onChange:d,className:"size-8 rounded cursor-pointer"}),s[7]=g,s[8]=d,s[9]=t):t=s[9];let a;s[10]===Symbol.for("react.memo_cache_sentinel")?(a=e.jsx("span",{className:"text-sm text-muted-foreground",children:"Custom color"}),s[10]=a):a=s[10];let m;s[11]!==t?(m=e.jsxs("div",{className:"flex items-center gap-2",children:[t,a]}),s[11]=t,s[12]=m):m=s[12];let x;return s[13]!==u||s[14]!==m?(x=e.jsxs("div",{className:"space-y-3",children:[u,m]}),s[13]=u,s[14]=m,s[15]=x):x=s[15],x}V({name:f().min(1,"Name is required").max(200),slug:f().min(1,"Slug is required").max(100),description:f().max(1e3).optional(),bannerColor:f().nullable().optional()});function xe({open:l,onOpenChange:s}){const{org:n}=L(),i=R(),c=k(),[u,g]=z.useState(!1),d=q({connectionId:O,orgId:n.id}),t=M({mode:"onChange",defaultValues:{name:"",slug:"",description:"",bannerColor:"#3B82F6"}}),a=$({mutationFn:async r=>{const h=await d.callTool({name:"PROJECT_CREATE",arguments:{organizationId:n.id,slug:r.slug,name:r.name,description:r.description||null,enabledPlugins:[],ui:{banner:null,bannerColor:r.bannerColor??null,icon:null,themeColor:r.bannerColor??null}}});return h.structuredContent??h},onSuccess:r=>{c.invalidateQueries({queryKey:T.projects(n.id)}),B.success("Project created successfully"),s(!1),t.reset({name:"",slug:"",description:"",bannerColor:"#3B82F6"}),g(!1),i({to:"/$org/$project",params:{org:n.slug,project:r.project.slug}})},onError:r=>{B.error("Failed to create project: "+(r instanceof Error?r.message:"Unknown error"))}}),m=async r=>{if(!_(r.slug)){t.setError("slug",{message:"Slug must be lowercase alphanumeric with hyphens only"});return}if(r.slug===j){t.setError("slug",{message:`"${j}" is a reserved slug`});return}await a.mutateAsync(r)},x=r=>{const h=r.target.value;if(t.setValue("name",h),!u){const P=se(h);t.setValue("slug",P)}},o=r=>{g(!0),t.setValue("slug",r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,""))},C=t.watch("bannerColor"),p=t.watch("slug"),b=t.watch("name"),y=p===j,E=p.length>0&&!_(p);return e.jsx(K,{open:l,onOpenChange:s,children:e.jsxs(U,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(G,{children:[e.jsx(J,{children:"Create New Project"}),e.jsxs(Q,{children:["Set up a new project in ",n.name,". You can configure plugins and settings after creation."]})]}),e.jsx(W,{...t,children:e.jsxs("form",{onSubmit:t.handleSubmit(m),className:"space-y-6",children:[e.jsx("div",{className:"h-20 rounded-lg relative",style:{backgroundColor:C??"#3B82F6"},children:e.jsx("div",{className:"absolute -bottom-4 left-4",children:e.jsx("div",{className:"size-12 rounded-lg border-2 border-background flex items-center justify-center text-lg font-semibold text-white",style:{backgroundColor:C??"#3B82F6"},children:b?.charAt(0)?.toUpperCase()||"P"})})}),e.jsxs("div",{className:"space-y-2 pt-4",children:[e.jsx(Z,{children:"Banner Color"}),e.jsx(re,{value:C??null,onChange:r=>t.setValue("bannerColor",r)})]}),e.jsx(v,{control:t.control,name:"name",render:()=>e.jsxs(F,{children:[e.jsx(N,{children:"Project Name *"}),e.jsx(S,{children:e.jsx(I,{value:b,onChange:x,placeholder:"My Awesome Project",autoFocus:!0,disabled:a.isPending})}),e.jsx(w,{})]})}),e.jsx(v,{control:t.control,name:"slug",render:()=>e.jsxs(F,{children:[e.jsx(N,{children:"Slug *"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:["/",n.slug,"/"]}),e.jsx(S,{children:e.jsx(I,{value:p,onChange:o,placeholder:"my-awesome-project",className:"flex-1",disabled:a.isPending})})]}),y&&e.jsxs("p",{className:"text-xs text-destructive",children:['"',j,'" is a reserved slug']}),E&&!y&&e.jsx("p",{className:"text-xs text-destructive",children:"Slug must be lowercase alphanumeric with hyphens only"}),e.jsx(w,{})]})}),e.jsx(v,{control:t.control,name:"description",render:({field:r})=>e.jsxs(F,{children:[e.jsx(N,{children:"Description"}),e.jsx(S,{children:e.jsx(X,{...r,placeholder:"What is this project for?",rows:2,disabled:a.isPending})}),e.jsx(w,{})]})}),e.jsxs(Y,{children:[e.jsx(D,{type:"button",variant:"outline",onClick:()=>s(!1),disabled:a.isPending,children:"Cancel"}),e.jsx(D,{type:"submit",disabled:a.isPending||y||E||!b||!p,children:a.isPending?"Creating...":"Create Project"})]})]})})]})})}export{xe as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-D52JGBSW.js";const c=({size:e=24,color:t="currentColor",...o})=>s.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},s.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));c.displayName="Coins01";const p="https://sites-openrouter.decocache.com/mcp",a="https://sites-deco-ai-gateway.decocache.com/mcp",n=[a];function d(e){if(!e)return!1;try{const t=new URL(e);return n.some(o=>{const r=new URL(o);return t.origin===r.origin&&t.pathname.replace(/\/$/,"")===r.pathname})}catch{return!1}}const h="https://assets.decocache.com/decocms/b2e2f64f-6025-45f7-9e8c-3b3ebdd073d8/openrouter_logojpg.jpg";export{h as O,c as a,p as b,d as i};
|