decocms 3.17.1 → 3.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-DtsIkyhv.js → AlertCircle-kk9FGUJy.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CC6Cv2i7.js → ArrowUpRight-XiN-bNvq.js} +1 -1
- package/dist/client/assets/{Check-vtGHgjfG.js → Check-BCfJiZjb.js} +1 -1
- package/dist/client/assets/{CheckCircle-BVxEOwgz.js → CheckCircle-DUtE0DmA.js} +1 -1
- package/dist/client/assets/{ChevronDown--sdzrX52.js → ChevronDown-BEW-c3gB.js} +1 -1
- package/dist/client/assets/{ChevronLeft-HhUtQNOL.js → ChevronLeft-CMqbWQ59.js} +1 -1
- package/dist/client/assets/{ChevronRight-I6954Qlw.js → ChevronRight-zMBQRLRl.js} +1 -1
- package/dist/client/assets/{ChevronUp-B7_FaTuI.js → ChevronUp-GpCP941Q.js} +1 -1
- package/dist/client/assets/{Container-UwZa4Sjq.js → Container-C-qyCnTQ.js} +1 -1
- package/dist/client/assets/{DotsVertical-CRhU-CQp.js → DotsVertical-CToOc1lA.js} +1 -1
- package/dist/client/assets/{Eye-CrIialez.js → Eye-DJA4t4LG.js} +1 -1
- package/dist/client/assets/{FilterLines-CcSUEwfK.js → FilterLines-CWGo6iBt.js} +1 -1
- package/dist/client/assets/{Globe01-CWUyneqk.js → Globe01-BIDyppIG.js} +1 -1
- package/dist/client/assets/{HardDrive-B4ApPRkU.js → HardDrive-zH516u4z.js} +1 -1
- package/dist/client/assets/{Key01-D8nYbfp6.js → Key01-CzVuKrFC.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CYBI43zr.js → LayoutLeft-BdJGuKDp.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BBQVGsHV.js → LinkExternal01-BjJ3q250.js} +1 -1
- package/dist/client/assets/{Monitor01-BqyNv3z7.js → Monitor01-BZbk9qOn.js} +1 -1
- package/dist/client/assets/{Palette-Dc7v0Lbc.js → Palette-BRbkJewR.js} +1 -1
- package/dist/client/assets/{Play-Bfu6rzoI.js → Play-C4g6iAp0.js} +1 -1
- package/dist/client/assets/{Plus-CAk921Ey.js → Plus-p_eZ4_sI.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-CJHsMXtu.js → RefreshCcw01-qZip7VuS.js} +1 -1
- package/dist/client/assets/{SearchMd-BGGjtsz7.js → SearchMd-CeenWY4R.js} +1 -1
- package/dist/client/assets/{Settings02-B3pc9FAS.js → Settings02-CaiJb4hz.js} +1 -1
- package/dist/client/assets/{Shield01-CevvPkir.js → Shield01-BqdSTZVE.js} +1 -1
- package/dist/client/assets/{Star01-B2sYJOUY.js → Star01-CfjDLIEN.js} +1 -1
- package/dist/client/assets/{Stars01-ChUleI_g.js → Stars01-BBw3zOME.js} +1 -1
- package/dist/client/assets/{Stars02-DR0TfdJs.js → Stars02-CkrNg1qh.js} +1 -1
- package/dist/client/assets/{Sun-D0Tw1Afb.js → Sun-dLAn0e4t.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-UKGE6L3t.js → SwitchHorizontal01-BEpb72lq.js} +1 -1
- package/dist/client/assets/{Tool01-NFK8H_gw.js → Tool01-DkOxZLha.js} +1 -1
- package/dist/client/assets/{Trash01-BV0g0LQO.js → Trash01-xXJmX-sD.js} +1 -1
- package/dist/client/assets/{Upload01-VAW7QmhA.js → Upload01-DxZby23M.js} +1 -1
- package/dist/client/assets/{User01-DaoMnnxf.js → User01-CzXXeh_v.js} +1 -1
- package/dist/client/assets/{Users01-BlMLYKx0.js → Users01-94UCCjNj.js} +1 -1
- package/dist/client/assets/{Users03-B7HqdPkm.js → Users03-CwkYSEUE.js} +1 -1
- package/dist/client/assets/{X-Tdfyixv6.js → X-DwTKQTxe.js} +1 -1
- package/dist/client/assets/{XCircle-B14veD9i.js → XCircle-BapiRyFg.js} +1 -1
- package/dist/client/assets/{XClose-Blplvetp.js → XClose-KPa7x8br.js} +1 -1
- package/dist/client/assets/{Zap-DXci2BUM.js → Zap-BcSt62LH.js} +1 -1
- package/dist/client/assets/{ZapSquare-DzpMrwRR.js → ZapSquare-b4NUHEFQ.js} +1 -1
- package/dist/client/assets/{ZoomOut-CT9E4Qhq.js → ZoomOut-C5miuqST.js} +1 -1
- package/dist/client/assets/{access-gate-DiknBkEw.js → access-gate-8HW9OuOb.js} +1 -1
- package/dist/client/assets/{accordion-CtA-xauN.js → accordion-BIaDH-L5.js} +1 -1
- package/dist/client/assets/{add-section-modal-DlaN-qAI.js → add-section-modal-CmX0FN0o.js} +1 -1
- package/dist/client/assets/{agent-capabilities-CmInpctC.js → agent-capabilities-Vf98w6Vs.js} +1 -1
- package/dist/client/assets/{agent-icon-zELPPL2m.js → agent-icon-gyWkxLBk.js} +1 -1
- package/dist/client/assets/{agent-icons-x_5O6PzC.js → agent-icons-dnfBtPac.js} +1 -1
- package/dist/client/assets/{agents-list-Bszw9lN6.js → agents-list-C3f_Royz.js} +1 -1
- package/dist/client/assets/{ai-providers-BEo_1p1S.js → ai-providers-BLKqKorT.js} +1 -1
- package/dist/client/assets/{alert-CfEuO2dR.js → alert-CsiirETr.js} +1 -1
- package/dist/client/assets/{alert-dialog-CU8ZYA21.js → alert-dialog-BuTseZND.js} +1 -1
- package/dist/client/assets/app-editor-2_JzmjTF.js +1 -0
- package/dist/client/assets/{auth-catchall-CKY6yLJq.js → auth-catchall-ZFdl3UC_.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CUDE_iDP.js → auth-split-layout-BE5JLVch.js} +1 -1
- package/dist/client/assets/{automation-list-row-CH--ZnEF.js → automation-list-row-CKNK1BAe.js} +1 -1
- package/dist/client/assets/{automation-runs-yWXMKQTD.js → automation-runs-BUXJQuB4.js} +1 -1
- package/dist/client/assets/{automations-qMMzEqRX.js → automations-BA25-sZf.js} +1 -1
- package/dist/client/assets/{avatar-DXzeiiiO.js → avatar--94y31lg.js} +1 -1
- package/dist/client/assets/{badge-zsFX23zy.js → badge-UXeMkv1N.js} +1 -1
- package/dist/client/assets/{brand-context-4BmiQwTN.js → brand-context-CqaG6QTo.js} +1 -1
- package/dist/client/assets/{buckets-CCG_qbCS.js → buckets-Dg1MrAKJ.js} +1 -1
- package/dist/client/assets/{calendar-Crmr906f.js → calendar-CJCfeKbq.js} +1 -1
- package/dist/client/assets/{capability-load-error-BravgH0a.js → capability-load-error-D9xVNApx.js} +1 -1
- package/dist/client/assets/{card-D5IvObwB.js → card-CgXj3w0j.js} +1 -1
- package/dist/client/assets/{chat-context-LqGwxYAF.js → chat-context-CWAb0_7m.js} +1 -1
- package/dist/client/assets/{checkbox-OOQKZtC_.js → checkbox-D0ucHXyU.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DhicbQB5.js → cli-auth-success-D7tyPLCS.js} +1 -1
- package/dist/client/assets/{collection-detail-BbVWcOS7.js → collection-detail-LRaP_NyB.js} +1 -1
- package/dist/client/assets/{collection-display-button-D5hrgHkh.js → collection-display-button-zpu5JdsR.js} +1 -1
- package/dist/client/assets/{collection-search-DGClB-Gb.js → collection-search-DetB6uj9.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-VWPtHFYE.js → collection-table-wrapper-DsC9xhMF.js} +1 -1
- package/dist/client/assets/{collection-tabs-BQEO65ib.js → collection-tabs-BJeLyyG1.js} +1 -1
- package/dist/client/assets/{collections-C_m5uhEc.js → collections-D6clkX5p.js} +1 -1
- package/dist/client/assets/{command-DzVv4p4m.js → command-CzRkAUH-.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-CZAbswkh.js → connect-desktop-dialog-DkxlyLoV.js} +1 -1
- package/dist/client/assets/{connection-card-CDttZAWV.js → connection-card-CeEDgo5u.js} +1 -1
- package/dist/client/assets/{connection-detail-CWgx3CGW.js → connection-detail-KvDZ2-Wm.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BgC55lri.js → connection-form-helpers-D1KznvTK.js} +1 -1
- package/dist/client/assets/{connections-BTE9TZOq.js → connections-1SUnkdnY.js} +1 -1
- package/dist/client/assets/{constants-BCfpLdj8.js → constants-Cyw8HlyN.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-nEWZU_3q.js → decopilot-sse-pool-0KCpBXCU.js} +1 -1
- package/dist/client/assets/{dialog-CLtwKT7T.js → dialog-CvHDSOMQ.js} +1 -1
- package/dist/client/assets/{domain-settings-DnOdm4Gh.js → domain-settings-CPNKHgv3.js} +1 -1
- package/dist/client/assets/{drawer-BewkeO2E.js → drawer-BCVb0_Ol.js} +1 -1
- package/dist/client/assets/{dropdown-menu-COlaUXPy.js → dropdown-menu-D39dKUR6.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-CboUuftB.js → dynamic-plugin-layout-C-ivPtv7.js} +1 -1
- package/dist/client/assets/{empty-state-Cm-JBk7p.js → empty-state-B9ubyBEL.js} +1 -1
- package/dist/client/assets/{empty-state-CZdqlaa-.js → empty-state-BUXcxrjO.js} +1 -1
- package/dist/client/assets/{extract-connection-data-F1Fp1AMr.js → extract-connection-data-F7Hf5agN.js} +1 -1
- package/dist/client/assets/{features-BPybOqVM.js → features-ik9fVjiY.js} +1 -1
- package/dist/client/assets/{file-explorer-Dfpjlouj.js → file-explorer-0jyhjp97.js} +1 -1
- package/dist/client/assets/{file-type-icon-DfjHHTyz.js → file-type-icon-CWTUMGMk.js} +1 -1
- package/dist/client/assets/{files-Jq4xd8Mr.js → files-6hTuIWXI.js} +1 -1
- package/dist/client/assets/{form-hhL2WFgR.js → form-Bm14S2fw.js} +1 -1
- package/dist/client/assets/{general-Bs5LdWae.js → general-DUMngie3.js} +1 -1
- package/dist/client/assets/{generate-id-D01ICZCx.js → generate-id-DRkpi1K_.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CvAVXvxg.js → github-repo-picker-BRIiungm.js} +1 -1
- package/dist/client/assets/{header-tab-button-D5FYUotU.js → header-tab-button-CtyhaUoh.js} +1 -1
- package/dist/client/assets/{hover-card-CeQv0SdX.js → hover-card-CoPuK3sz.js} +1 -1
- package/dist/client/assets/{image-field-DlsH5ki1.js → image-field-Bc96qNtk.js} +1 -1
- package/dist/client/assets/{index-MDvkqSr6.js → index-46rIaXY5.js} +1 -1
- package/dist/client/assets/{index-BZAd5qB-.js → index-B7NrgKCO.js} +1 -1
- package/dist/client/assets/{index-CW2GDOZp.js → index-BPW95yv1.js} +3 -3
- package/dist/client/assets/{index-C2ou5Sih.js → index-BXMoMgIx.js} +1 -1
- package/dist/client/assets/{index-Cu5tt_hf.js → index-BwNRRrEM.js} +1 -1
- package/dist/client/assets/{index-DVjiRpca.js → index-C3xtZZkB.js} +1 -1
- package/dist/client/assets/{index-CtKv8aMq.js → index-CU8sRbSt.js} +1 -1
- package/dist/client/assets/{index-DljQCipR.js → index-CUopo4gE.js} +1 -1
- package/dist/client/assets/{index-BsTDIiyh.js → index-CZxxRf5L.js} +1 -1
- package/dist/client/assets/{index-C3xxqIK9.js → index-CaHoJer0.js} +1 -1
- package/dist/client/assets/{index-BTfRGSGJ.js → index-DO2HEAud.js} +1 -1
- package/dist/client/assets/{index-CZHEDR-7.js → index-DVTNQZZw.js} +1 -1
- package/dist/client/assets/{index-Dtlw9Wg_.js → index-DzkseZbE.js} +1 -1
- package/dist/client/assets/{index-IBdkM0WT.js → index-Lo8_OOo7.js} +4 -4
- package/dist/client/assets/{index-8WMbGW3I.js → index-NXk-KEYm.js} +1 -1
- package/dist/client/assets/{index-redirect-BQ64Fw6U.js → index-redirect-DZfBU3ca.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CNU9jr7j.js → infiniteQueryObserver-BwWnRM4l.js} +1 -1
- package/dist/client/assets/{input-C6I0qBHa.js → input-Di4NLV7k.js} +1 -1
- package/dist/client/assets/{integration-icon-CRQNKwzw.js → integration-icon-BltEmUHe.js} +1 -1
- package/dist/client/assets/{label-CBS86XNa.js → label-BiUZV55U.js} +1 -1
- package/dist/client/assets/{layout-f-vBvuP7.js → layout-WwJpht6M.js} +1 -1
- package/dist/client/assets/{login-mW1jrlie.js → login-D6T8yD13.js} +1 -1
- package/dist/client/assets/{members-C0DJ4-OC.js → members-BaP_UV0b.js} +1 -1
- package/dist/client/assets/{monaco-editor--4Yuy9-K.js → monaco-editor-Bqkz-12r.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-B05aJEZ3.js → monitoring-stats-row-BMi5DzAN.js} +1 -1
- package/dist/client/assets/{oauth-callback-BAaF4Jac.js → oauth-callback-C0p3We4S.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CXA6h4bA.js → oauth-callback-ai-provider-b3zuaQJ5.js} +1 -1
- package/dist/client/assets/{onboarding-DwclTGQV.js → onboarding-CuXC9Ufz.js} +1 -1
- package/dist/client/assets/{org-install-ClS1U1Is.js → org-install-BGGt6TSx.js} +1 -1
- package/dist/client/assets/{org-layout-D2q337za.js → org-layout-BtG5PY_T.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-BU42ml-u.js → org-plugin-layout-DfPAfLHM.js} +1 -1
- package/dist/client/assets/{page-seo-form-BSUK8MM8.js → page-seo-form-BJyw-bVr.js} +1 -1
- package/dist/client/assets/page-seo-sheet-CppVgk_x.js +1 -0
- package/dist/client/assets/{pair-CZ7RQwEQ.js → pair-BoH0kSdH.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-DUHVGpp4.js → plugin-empty-state-DtPrUQKq.js} +1 -1
- package/dist/client/assets/{plugin-header-Ce72Z8AJ.js → plugin-header-BQxiKz1o.js} +1 -1
- package/dist/client/assets/{plugin-layout-quK7uCnU.js → plugin-layout-B8BjC_OI.js} +1 -1
- package/dist/client/assets/{popover-Cb-Bmegp.js → popover-CH09SbYZ.js} +1 -1
- package/dist/client/assets/{post-editor-BAaD8Gds.js → post-editor-08-P4Wpe.js} +1 -1
- package/dist/client/assets/{primitives-D8jiHpwv.js → primitives-R43NPEda.js} +1 -1
- package/dist/client/assets/{profile-B_6YhXTS.js → profile-Dn87XUJN.js} +1 -1
- package/dist/client/assets/project-app-view-4o9PlJDq.js +1 -0
- package/dist/client/assets/record-editor-BD7d8_-n.js +1 -0
- package/dist/client/assets/registry-DgXY6Nz_.js +2 -0
- package/dist/client/assets/{registry-layout-CCF3dO1N.js → registry-layout-BLuSgnGn.js} +1 -1
- package/dist/client/assets/{require-capability-9UoybC--.js → require-capability-CObBU8yr.js} +1 -1
- package/dist/client/assets/{required-auth-layout-chyvqjm-.js → required-auth-layout-DhSSTgwg.js} +1 -1
- package/dist/client/assets/{reset-password-bYeIRZhU.js → reset-password-Cw-Mv-5i.js} +1 -1
- package/dist/client/assets/{resizable-C3e36PAj.js → resizable-B7uSgqAA.js} +1 -1
- package/dist/client/assets/{roles-DUk2EDKN.js → roles-CcnWfj9G.js} +1 -1
- package/dist/client/assets/{save-status-SrY_Xvn_.js → save-status-Dp40V924.js} +1 -1
- package/dist/client/assets/{schema-form-q1GGwsV5.js → schema-form-BNdSdk8W.js} +1 -1
- package/dist/client/assets/{scroll-area-DqzfAJq4.js → scroll-area-DYAwC7xi.js} +1 -1
- package/dist/client/assets/{search-input-dUUxotu4.js → search-input-BtfHd_PV.js} +1 -1
- package/dist/client/assets/{secrets--HC37_lL.js → secrets-BDg0g7CD.js} +1 -1
- package/dist/client/assets/{sections-editor-9HzWjIQN.js → sections-editor-CuwHqnaB.js} +1 -1
- package/dist/client/assets/{select-CuTEW-jA.js → select-hcACDMsW.js} +1 -1
- package/dist/client/assets/{select-model-DeVtvLgk.js → select-model-C26R1tgl.js} +1 -1
- package/dist/client/assets/{seo-editor-CxXb6Pa5.js → seo-editor-zTGMVBFq.js} +1 -1
- package/dist/client/assets/{settings-layout-DsImRu68.js → settings-layout-CTPG2oCB.js} +1 -1
- package/dist/client/assets/{settings-section-Dqo82vZl.js → settings-section-DaO8RKe8.js} +1 -1
- package/dist/client/assets/{sheet-XNQn2l1w.js → sheet-SJlzhsz6.js} +1 -1
- package/dist/client/assets/{shell-controls-DOdJ_gGX.js → shell-controls-HljoHbdq.js} +1 -1
- package/dist/client/assets/{shell-layout-BU6DfdCA.js → shell-layout-Bx0_HWew.js} +1 -1
- package/dist/client/assets/{shell-route-loading-D_OJep1W.js → shell-route-loading-DgxSF9Gz.js} +1 -1
- package/dist/client/assets/{sidebar-BVvI-fKb.js → sidebar-BlFrlbv4.js} +1 -1
- package/dist/client/assets/{skeleton-BsmA3SJi.js → skeleton-80rKQxzP.js} +1 -1
- package/dist/client/assets/{sortable.esm-BLbNDEWA.js → sortable.esm-BaSbMOPy.js} +1 -1
- package/dist/client/assets/{spinner-CA6Z7ply.js → spinner-cv9nof4V.js} +1 -1
- package/dist/client/assets/{sso-CaRqQ4Z-.js → sso-CNDry1vR.js} +1 -1
- package/dist/client/assets/{store-D79L8ARY.js → store-lbTr2IAY.js} +1 -1
- package/dist/client/assets/store-registry-Cl954hdf.js +2 -0
- package/dist/client/assets/{switch-kiGGiVP7.js → switch-C1S18UCI.js} +1 -1
- package/dist/client/assets/{tab-id-AROsVU94.js → tab-id-CjVVlM3-.js} +1 -1
- package/dist/client/assets/{table-D-3eWTFI.js → table-dExp9p1h.js} +1 -1
- package/dist/client/assets/{tabs-_BMD3gqc.js → tabs-Bq9Z53Au.js} +1 -1
- package/dist/client/assets/{task-status-DDOPfPO7.js → task-status-BFm8_crC.js} +1 -1
- package/dist/client/assets/{textarea-CvogFpDT.js → textarea-DZUFH_8Z.js} +1 -1
- package/dist/client/assets/{toggle-group-BAx4pQQl.js → toggle-group-DLVyaUSb.js} +1 -1
- package/dist/client/assets/{toolbar-CcJJYCIE.js → toolbar-DXw8ox-I.js} +1 -1
- package/dist/client/assets/{tools-list-C2KBBz4b.js → tools-list-BYjG31fh.js} +1 -1
- package/dist/client/assets/{tooltip-6V7elEEX.js → tooltip-Dx-dkmdA.js} +1 -1
- package/dist/client/assets/{types-fKs_ggmz.js → types-9t7kxiEp.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BSAUX_gL.js → use-ai-providers-DNKllTrr.js} +1 -1
- package/dist/client/assets/{use-automations-ByU0cONY.js → use-automations-BzEG8Xwk.js} +1 -1
- package/dist/client/assets/{use-capability-DLwHss1A.js → use-capability-DltTWnuY.js} +1 -1
- package/dist/client/assets/{use-collections-BauLzZZO.js → use-collections-Br1yV-tu.js} +1 -1
- package/dist/client/assets/{use-connection-C4GFr9nL.js → use-connection-Ccv-Xgx3.js} +1 -1
- package/dist/client/assets/{use-copy-B4x7tAnY.js → use-copy-DGQz-cTK.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CP1TTRIQ.js → use-create-virtual-mcp-BOjPY_wj.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-tQOo4KW5.js → use-debounced-autosave-BFZuou80.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CvS5aoFM.js → use-delete-connection-CFNX2gL_.js} +1 -1
- package/dist/client/assets/{use-file-configs-DXuMASqs.js → use-file-configs-DRfNjR38.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CUCni0HP.js → use-infinite-scroll-CrpZ3N3L.js} +1 -1
- package/dist/client/assets/{use-list-state-Cy-nbUe7.js → use-list-state-CBkbv-v0.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-r6vl6hj5.js → use-mcp-prompts-BT401n3U.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BH6fBXOQ.js → use-mcp-tools-tUtdLLx8.js} +1 -1
- package/dist/client/assets/{use-members-CN7LSdK8.js → use-members-xRWwaUef.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-B17xxfnF.js → use-navigate-to-agent-Db_2WXW0.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Ct06vKxv.js → use-org-auth-client-CMqB1f1E.js} +1 -1
- package/dist/client/assets/{use-org-sso-VGIrGw_f.js → use-org-sso-Djv2CS89.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CTeY8LZY.js → use-organization-roles-DXMaPXzD.js} +1 -1
- package/dist/client/assets/{use-organization-settings--FTRiCSw.js → use-organization-settings-ra7pFykJ.js} +1 -1
- package/dist/client/assets/{use-registry-connections-D9b3sQhT.js → use-registry-connections-CDLIXx4R.js} +1 -1
- package/dist/client/assets/{use-secrets-YYVI-1hB.js → use-secrets-CY-T9J2S.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BDpAOn6X.js → use-status-sounds-BwDHROCY.js} +1 -1
- package/dist/client/assets/{use-view-mode-4iMRc-bf.js → use-view-mode-D6qHHEdi.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BzRoDsnX.js → use-virtual-mcp-CmpTXBlT.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Dx_1Wo2M.js +1 -0
- package/dist/client/assets/{useRouterState-DwQFoqEO.js → useRouterState-icfF47GL.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CUKR0Y-5.js +1 -0
- package/dist/client/assets/{user-CEZjs4lV.js → user-DZGegFV7.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BwZQDE89.js → view-mode-toggle-DUj5Q_6q.js} +1 -1
- package/dist/client/assets/workflow-detail-DTAgTfGE.js +1 -0
- package/dist/client/assets/{workflow-2WDykuxZ.js → workflow-onVtDDMA.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +142 -133
- package/dist/server/server.js +3 -3
- package/package.json +1 -1
- package/dist/client/assets/app-editor-Qvrv5Jlv.js +0 -1
- package/dist/client/assets/page-seo-sheet-rUbxuV0U.js +0 -1
- package/dist/client/assets/project-app-view-DLZKJqsT.js +0 -1
- package/dist/client/assets/record-editor-DV-uP4sg.js +0 -1
- package/dist/client/assets/registry-BdCcAkG7.js +0 -2
- package/dist/client/assets/store-registry-RjLPX_BT.js +0 -2
- package/dist/client/assets/useInfiniteQuery-DKdeEHtH.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BgTbRsAD.js +0 -1
- package/dist/client/assets/workflow-detail-B48uxbIE.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as f,c as u,j as m}from"./index-
|
|
1
|
+
import{e as f,c as u,j as m}from"./index-BPW95yv1.js";import{B as g}from"./badge-UXeMkv1N.js";function h(x){const e=f.c(12),{tabs:l,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==l){let c;e[6]!==n||e[7]!==s?(c=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as t,W as i,ba as p,aI as r,aH as a,cs as m,bT as h,U as c,aK as b}from"./index-
|
|
1
|
+
import{T as t,W as i,ba as p,aI as r,aH as a,cs as m,bT as h,U as c,aK as b}from"./index-BPW95yv1.js";const N=t({id:i().describe("Unique identifier for the entity"),title:i().describe("Human-readable title for the entity"),description:i().nullish().describe("Description of the entity"),created_at:i().datetime(),updated_at:i().datetime(),created_by:i().optional(),updated_by:i().optional()}),f=t({field:a(i()),operator:r(["eq","gt","gte","lt","lte","in","like","contains"]),value:p()}),u=m(()=>h([f,t({operator:r(["and","or","not"]),conditions:a(u)})])),C=t({field:a(i()),direction:r(["asc","desc"]),nulls:r(["first","last"]).optional()}),S=t({where:u.optional().describe("Filter expression"),orderBy:a(C).optional().describe("Sort expressions"),limit:c().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:c().int().min(0).optional().describe("Number of items to skip")});function O(e){return t({items:a(e).describe("Array of collection items"),totalCount:c().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:b().optional().describe("Whether there are more items available")})}const I=t({id:i().describe("ID of the entity to retrieve")});function T(e){return t({item:e.nullable().describe("The retrieved item, or null if not found")})}function y(e){return t({data:e.partial().describe("Data for the new entity (id may be auto-generated)")})}function E(e){return t({item:e.describe("The created entity with generated id")})}function _(e){return t({id:i().describe("ID of the entity to update"),data:e.partial().describe("Partial entity data to update")})}function L(e){return t({item:e.describe("The updated entity")})}const D=t({id:i().describe("ID of the entity to delete")});function g(e){return t({item:e.describe("The deleted entity")})}function U(e,n,l){const o=e.toUpperCase(),d=l?.readOnly??!1,s=[{name:`COLLECTION_${o}_LIST`,inputSchema:S,outputSchema:O(n)},{name:`COLLECTION_${o}_GET`,inputSchema:I,outputSchema:T(n)}];return d||s.push({name:`COLLECTION_${o}_CREATE`,inputSchema:y(n),outputSchema:E(n),opt:!0},{name:`COLLECTION_${o}_UPDATE`,inputSchema:_(n),outputSchema:L(n),opt:!0},{name:`COLLECTION_${o}_DELETE`,inputSchema:D,outputSchema:g(n),opt:!0}),s}export{N as B,U as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as d,c as i,j as n}from"./index-
|
|
1
|
+
import{e as d,c as i,j as n}from"./index-BPW95yv1.js";import{_ as m}from"./index-NXk-KEYm.js";import{D as k,c as N,e as j,b,a as w}from"./dialog-CvHDSOMQ.js";import{i as y}from"./SearchMd-CeenWY4R.js";function C(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function S(a){const e=d.c(24);let t,s,o,l,r;e[0]!==a?({title:l,description:r,children:t,className:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=l,e[5]=r):(t=e[1],s=e[2],o=e[3],l=e[4],r=e[5]);const _=l===void 0?"Command Palette":l,v=r===void 0?"Search for a command to run...":r;let c;e[6]!==_?(c=n.jsx(N,{children:_}),e[6]=_,e[7]=c):c=e[7];let p;e[8]!==v?(p=n.jsx(j,{children:v}),e[8]=v,e[9]=p):p=e[9];let u;e[10]!==c||e[11]!==p?(u=n.jsxs(b,{className:"sr-only",children:[c,p]}),e[10]=c,e[11]=p,e[12]=u):u=e[12];let f;e[13]!==s?(f=i("overflow-hidden p-0",s),e[13]=s,e[14]=f):f=e[14];let x;e[15]!==t?(x=n.jsx(C,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:t}),e[15]=t,e[16]=x):x=e[16];let g;e[17]!==f||e[18]!==x?(g=n.jsx(w,{className:f,closeButtonClassName:"hidden",children:x}),e[17]=f,e[18]=x,e[19]=g):g=e[19];let h;return e[20]!==o||e[21]!==u||e[22]!==g?(h=n.jsxs(k,{...o,children:[u,g]}),e[20]=o,e[21]=u,e[22]=g,e[23]=h):h=e[23],h}function z(a){const e=d.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(y,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=i("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=l):l=e[5];let r;return e[6]!==s||e[7]!==l?(r=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(m.Input,{"data-slot":"command-input",className:l,...s})]}),e[6]=s,e[7]=l,e[8]=r):r=e[8],r}function G(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function L(a){const e=d.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(m.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function R(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function B(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function H(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}export{L as C,R as a,C as b,z as c,G as d,H as e,B as f,S as g};
|
package/dist/client/assets/{connect-desktop-dialog-CZAbswkh.js → connect-desktop-dialog-DkxlyLoV.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as P,r as T,q as A,G as _,a as B,j as s,B as L,K as z,o as K}from"./index-
|
|
1
|
+
import{e as P,r as T,q as A,G as _,a as B,j as s,B as L,K as z,o as K}from"./index-BPW95yv1.js";import{c as Y,e as q,b as F,a as M,D as O}from"./dialog-CvHDSOMQ.js";import{S as R}from"./spinner-cv9nof4V.js";import{i as Q}from"./Check-BCfJiZjb.js";import{a as $}from"./Eye-DJA4t4LG.js";import{S as G,u as H}from"./constants-Cyw8HlyN.js";import{u as W}from"./chat-context-CWAb0_7m.js";const E="bunx decocms link",v={"claude-code":"Claude Code",codex:"Codex"};function w(n){return n.map(e=>v[e]).filter(e=>!!e)}function N(n){return Object.keys(v).filter(e=>!n.includes(e)).map(e=>v[e]).filter(e=>!!e)}function ie(n){const e=P.c(35),{open:h,onOpenChange:j}=n,t=W(),[C,y]=T.useState(!1),{org:i}=A(),k=_();let x;e[0]!==i.id||e[1]!==i.slug?(x={connectionId:G,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=x):x=e[2];const b=H(x);let o;e[3]!==b?(o=async()=>{const S=await b.callTool({name:"LINK_DISCONNECT",arguments:{}});if(S?.isError)throw new Error(S.content?.[0]?.text??"Failed to disconnect desktop")},e[3]=b,e[4]=o):o=e[4];let a;e[5]!==i.id||e[6]!==k?(a=()=>{k.invalidateQueries({queryKey:z.currentLink(i.id)})},e[5]=i.id,e[6]=k,e[7]=a):a=e[7];let f;e[8]!==o||e[9]!==a?(f={mutationFn:o,onSuccess:a,onError:J},e[8]=o,e[9]=a,e[10]=f):f=e[10];const p=B(f),D=t.online?"Desktop connected":"Connect your desktop";let l;e[11]!==D?(l=s.jsx(Y,{children:D}),e[11]=D,e[12]=l):l=e[12];const I=t.online?"Your desktop is online. Pick a desktop agent in the chat to use it.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let r;e[13]!==I?(r=s.jsx(q,{children:I}),e[13]=I,e[14]=r):r=e[14];let c;e[15]!==l||e[16]!==r?(c=s.jsxs(F,{children:[l,r]}),e[15]=l,e[16]=r,e[17]=c):c=e[17];let d;e[18]!==C||e[19]!==t.online?(d=!t.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:E}),s.jsx(L,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(E),y(!0),setTimeout(()=>y(!1),1500)},children:C?s.jsx(Q,{size:14}):s.jsx($,{size:14})})]}),e[18]=C,e[19]=t.online,e[20]=d):d=e[20];let m;e[21]!==p||e[22]!==t.capabilities||e[23]!==t.hostname||e[24]!==t.machineId||e[25]!==t.online?(m=t.online?s.jsxs("div",{className:"flex flex-col gap-1 text-sm",children:[s.jsxs("p",{className:"text-foreground",children:[t.hostname??t.machineId??"Your desktop"," is linked."]}),w(t.capabilities).length>0&&s.jsxs("p",{className:"text-muted-foreground",children:["Available: ",w(t.capabilities).join(", ")]}),N(t.capabilities).length>0&&s.jsxs("p",{className:"text-muted-foreground",children:[N(t.capabilities).join(" and ")," ",N(t.capabilities).length>1?"were":"was"," ","not detected on this desktop. Install the CLI and sign in there — it appears here automatically within a minute."]}),s.jsx("div",{className:"flex justify-end pt-2",children:s.jsx(L,{type:"button",variant:"outline",size:"sm",disabled:p.isPending,onClick:()=>p.mutate(),className:"text-destructive hover:text-destructive",children:p.isPending?"Disconnecting…":"Disconnect desktop"})})]}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(R,{size:"sm"}),"Waiting for desktop…"]}),e[21]=p,e[22]=t.capabilities,e[23]=t.hostname,e[24]=t.machineId,e[25]=t.online,e[26]=m):m=e[26];let u;e[27]!==d||e[28]!==m||e[29]!==c?(u=s.jsxs(M,{className:"sm:max-w-md",children:[c,d,m]}),e[27]=d,e[28]=m,e[29]=c,e[30]=u):u=e[30];let g;return e[31]!==j||e[32]!==h||e[33]!==u?(g=s.jsx(O,{open:h,onOpenChange:j,children:u}),e[31]=j,e[32]=h,e[33]=u,e[34]=g):g=e[34],g}function J(n){K.error(`Disconnect failed: ${n.message}`)}export{ie as C,w as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as _}from"./connection-slug-eyAPH6o3.js";import{e as R,q as $,b6 as k,K as D,c as E,j as x}from"./index-
|
|
1
|
+
import{g as _}from"./connection-slug-eyAPH6o3.js";import{e as R,q as $,b6 as k,K as D,c as E,j as x}from"./index-BPW95yv1.js";import{u as K}from"./use-registry-connections-CDLIXx4R.js";import{b as Q}from"./use-organization-settings-ra7pFykJ.js";import{S as w,c as q}from"./constants-Cyw8HlyN.js";import{u as F}from"./useInfiniteQuery-Dx_1Wo2M.js";import{i as H,f as G}from"./extract-connection-data-F7Hf5agN.js";import{C as U}from"./card-CgXj3w0j.js";import{I as V}from"./integration-icon-BltEmUHe.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),r=e.get(l);r?r.push(o):e.set(l,[o])}const t=[],u=new Set;for(const o of s){const l=_(o);if(u.has(l))continue;u.add(l);const r=e.get(l),m=r[0];r.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:r})}return t}function ce(){const s=R.c(6),e=K(),t=Q(),u=$().project.enabledPlugins??[];let o;if(s[0]!==u||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=r=>t(r.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(X),u.includes("private-registry")&&t(w)&&o.push({id:w,title:"Private Registry",icon:null}),s[0]=u,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function X(s){return{id:s.id,title:s.title,icon:s.icon}}const Y=24,S=3;function A(s){return s.id.includes("community-registry")}function z(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,u,o){const l=s.map(c=>c.id).sort().join(","),r=z(o),{data:m,fetchNextPage:d,hasNextPage:f,isFetchingNextPage:p,isLoading:b}=F({queryKey:D.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:c})=>{const n=c??{};return await Promise.all(s.map(async i=>{const y=n[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=H(i.id,e);let h;for(let v=0;v<S;v++){let C=null;try{C=await q({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const P=await C.callTool({name:j,arguments:I}),N=P.structuredContent??P,M=N.nextCursor||N.cursor||void 0,L=G(N?[N]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:L,nextCursor:M}}catch(I){h=I}finally{await C?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,h),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:c=>{const n={};let a=!1;for(const i of c)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,a=!0):n[i.registryId]="EXHAUSTED");return a?n:void 0},staleTime:3600*1e3,placeholderData:k,retry:!1,enabled:s.length>0}),g=[];if(m?.pages)for(const c of m.pages)for(const n of c)for(const a of n.items)g.push({...a,_sourceName:a._sourceName??n.registryTitle,_sourceIcon:a._sourceIcon??n.registryIcon,_registryId:a._registryId??n.registryId});return{items:g,hasMore:f??!1,isLoadingMore:p,isInitialLoading:b,fetchNextPage:()=>{f&&!p&&d()}}}function ue(s,e){const t=R.c(16),{org:u}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const m=r,d=T(l,u.id,u.slug,!0,e),f=T(m,u.id,u.slug,!0,e);let p;if(t[4]!==f.items||t[5]!==d.items){const y=new Set;p=[];const j=[...d.items,...f.items];for(const h of j){const v=`${h._registryId}:${h.id}`;y.has(v)||(y.add(v),p.push(h))}t[4]=f.items,t[5]=d.items,t[6]=p}else p=t[6];const b=d.isInitialLoading||f.isInitialLoading,g=d.isLoadingMore||f.isLoadingMore,c=d.hasMore||f.hasMore;let n;t[7]!==f||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),f.hasMore&&f.fetchNextPage()},t[7]=f,t[8]=d,t[9]=n):n=t[9];const a=n;let i;return t[10]!==c||t[11]!==b||t[12]!==g||t[13]!==p||t[14]!==a?(i={items:p,hasMore:c,isLoadingMore:g,isInitialLoading:b,loadMore:a},t[10]=c,t[11]=b,t[12]=g,t[13]=p,t[14]=a,t[15]=i):i=t[15],i}function W(s){return A(s)}function Z(s){return!A(s)}function fe(s){const e=R.c(37),{connection:t,onClick:u,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:m,className:d,fallbackIcon:f}=s,p=l===void 0?!1:l,b=u&&"hover:bg-muted/50";let g;e[0]!==d||e[1]!==b?(g=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",b,d),e[0]=d,e[1]=b,e[2]=g):g=e[2];let c;e[3]!==t.icon||e[4]!==t.title||e[5]!==f?(c=x.jsx(V,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=t.icon,e[4]=t.title,e[5]=f,e[6]=c):c=e[6];let n;e[7]!==o||e[8]!==p?(n=o&&x.jsx("div",{className:E("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:J,children:o}),e[7]=o,e[8]=p,e[9]=n):n=e[9];let a;e[10]!==n?(a=x.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i=x.jsxs("div",{className:"flex items-start justify-between",children:[c,a]}),e[12]=c,e[13]=a,e[14]=i):i=e[14];let y;e[15]!==t.title?(y=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=y):y=e[16];const j=t.description||"No description";let h;e[17]!==j?(h=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=h):h=e[18];let v;e[19]!==h||e[20]!==y?(v=x.jsxs("div",{className:"flex flex-col gap-1",children:[y,h]}),e[19]=h,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==r?(C=r&&x.jsx("div",{children:r}),e[22]=r,e[23]=C):C=e[23];let I;e[24]!==v||e[25]!==C||e[26]!==i?(I=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,v,C]}),e[24]=v,e[25]=C,e[26]=i,e[27]=I):I=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:B,children:m})}),e[28]=m,e[29]=P):P=e[29];let N;e[30]!==I||e[31]!==P?(N=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,P]}),e[30]=I,e[31]=P,e[32]=N):N=e[32];let M;return e[33]!==u||e[34]!==N||e[35]!==g?(M=x.jsx(U,{className:g,onClick:u,children:N}),e[33]=u,e[34]=N,e[35]=g,e[36]=M):M=e[36],M}function B(s){return s.stopPropagation()}function J(s){return s.stopPropagation()}export{fe as C,ue as a,ae as g,ce as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as ge,aJ as Ie,ba as Ae,W as ce,aH as De,e as P,j as t,l as je,B as V,r as X,c as ve,q as J,s as $e,K as ne,f as Y,x as de,u as Pe,bb as Oe,E as Me,g as ze,bc as Ee,G as Ve,H as Ue,I as Fe,M as Re,o as G,bd as Le,J as He}from"./index-CW2GDOZp.js";import{g as Be}from"./generate-id-D01ICZCx.js";import{E as be}from"./empty-state-CZdqlaa-.js";import{E as We,c as qe,r as Ge,b as Xe,d as Ke}from"./connection-form-helpers-BgC55lri.js";import{c as Qe,S as Je}from"./index-Cu5tt_hf.js";import{u as Ne,T as Ye}from"./tools-list-C2KBBz4b.js";import{u as Ze}from"./use-members-CN7LSdK8.js";import{A as et}from"./avatar-DXzeiiiO.js";import{a as ye,b as _e,u as tt}from"./use-connection-C4GFr9nL.js";import{u as ae,S as st}from"./constants-BCfpLdj8.js";import{b as nt}from"./use-mcp-tools-BH6fBXOQ.js";import{a as ot}from"./use-mcp-prompts-r6vl6hj5.js";import{I as oe}from"./integration-icon-CRQNKwzw.js";import{s as it}from"./Plus-CAk921Ey.js";import{q as at,s as rt,a5 as lt,R as ct}from"./agent-icon-zELPPL2m.js";import{a as Se}from"./Settings02-B3pc9FAS.js";import{s as re}from"./Trash01-BV0g0LQO.js";import{b as dt,a as mt,d as ut,S as xt,c as pt}from"./sheet-XNQn2l1w.js";import{F as L,b as H,c as B,d as E,f as W,e as ft,a as ht}from"./form-hhL2WFgR.js";import{I as q}from"./input-C6I0qBHa.js";import{u as gt,D as jt}from"./use-delete-connection-CvS5aoFM.js";import{V as vt}from"./layout-f-vBvuP7.js";import{c as bt,C as Nt,B as yt,a as _t,b as St,d as Ct,e as wt}from"./monitoring-stats-row-B05aJEZ3.js";import{a as kt}from"./use-virtual-mcp-BzRoDsnX.js";import{i as Ce}from"./ChevronRight-I6954Qlw.js";import{a as we}from"./Users03-B7HqdPkm.js";import{T as ee,a as Tt,b as te,c as It}from"./tabs-_BMD3gqc.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as At}from"./ZapSquare-DzpMrwRR.js";import{b as Dt}from"./Tool01-NFK8H_gw.js";import{g as le,M as $t}from"./types-fKs_ggmz.js";import{C as Pt}from"./collection-search-DGClB-Gb.js";import{C as Ot}from"./card-D5IvObwB.js";import{B as Mt}from"./badge-zsFX23zy.js";import{D as zt,a as Et,b as Vt,c as me}from"./dropdown-menu-COlaUXPy.js";import{d as ue,S as xe,a as pe,b as fe,c as R}from"./select-CuTEW-jA.js";import{i as Ut}from"./CheckCircle-BVxEOwgz.js";import{t as Ft}from"./ChevronDown--sdzrX52.js";import{n as Rt}from"./Container-UwZa4Sjq.js";import{s as se}from"./Star01-B2sYJOUY.js";import{s as Lt}from"./RefreshCcw01-CJHsMXtu.js";import{s as Ht}from"./XClose-Blplvetp.js";import"./collections-C_m5uhEc.js";import"./ZoomOut-CT9E4Qhq.js";import"./Key01-D8nYbfp6.js";import"./index-DVjiRpca.js";import"./index-CtKv8aMq.js";import"./extract-connection-data-F1Fp1AMr.js";import"./use-registry-connections-D9b3sQhT.js";import"./use-organization-settings--FTRiCSw.js";import"./index-8WMbGW3I.js";import"./popover-Cb-Bmegp.js";import"./tooltip-6V7elEEX.js";import"./Check-vtGHgjfG.js";import"./SearchMd-BGGjtsz7.js";import"./use-create-virtual-mcp-CP1TTRIQ.js";import"./use-navigate-to-agent-B17xxfnF.js";import"./Eye-CrIialez.js";import"./use-org-auth-client-Ct06vKxv.js";import"./User01-DaoMnnxf.js";import"./use-collections-BauLzZZO.js";import"./AlertCircle-DtsIkyhv.js";import"./SwitchHorizontal01-UKGE6L3t.js";import"./XCircle-B14veD9i.js";import"./ArrowUpRight-CC6Cv2i7.js";import"./ChevronLeft-HhUtQNOL.js";import"./ChevronUp-B7_FaTuI.js";import"./DotsVertical-CRhU-CQp.js";import"./Globe01-CWUyneqk.js";import"./FilterLines-CcSUEwfK.js";import"./Palette-Dc7v0Lbc.js";import"./HardDrive-B4ApPRkU.js";import"./Stars02-DR0TfdJs.js";import"./LayoutLeft-CYBI43zr.js";import"./LinkExternal01-BBQVGsHV.js";import"./Monitor01-BqyNv3z7.js";import"./Sun-D0Tw1Afb.js";import"./Play-Bfu6rzoI.js";import"./Shield01-CevvPkir.js";import"./Stars01-ChUleI_g.js";import"./Upload01-VAW7QmhA.js";import"./Users01-BlMLYKx0.js";import"./X-Tdfyixv6.js";import"./Zap-DXci2BUM.js";import"./label-CBS86XNa.js";import"./alert-dialog-CU8ZYA21.js";import"./index-MDvkqSr6.js";import"./sidebar-BVvI-fKb.js";const Bt=ge({scopes:De(ce()).describe("List of scopes available"),stateSchema:Ie(ce(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Wt=[{name:"MCP_CONFIGURATION",inputSchema:ge({}),outputSchema:Bt}];function qt(s){const e=P.c(46),{instance:n,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i}=s;let d;e[0]!==n.id?(d={connectionId:n.id},e[0]=n.id,e[1]=d):d=e[1];const l=Ne(d),m=!(n.connection_type==="VIRTUAL")&&l.supportsOAuth&&!l.isAuthenticated,p=n.status!=="active",c=m||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==c?(h=ve("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",c),e[2]=c,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let v;e[7]!==n.title?(v=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=v):v=e[8];let b;e[9]!==n.status||e[10]!==p||e[11]!==m?(b=m?t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?"Disabled (error)":"Disabled"}):null,e[9]=n.status,e[10]=p,e[11]=m,e[12]=b):b=e[12];let j;e[13]!==v||e[14]!==b?(j=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,b]}),e[13]=v,e[14]=b,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==m||e[18]!==r?(N=m&&t.jsx(V,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[16]=n,e[17]=m,e[18]=r,e[19]=N):N=e[19];let T;e[20]!==n||e[21]!==p||e[22]!==i?(T=p?t.jsxs(V,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>i(n,"active"),children:[t.jsx(at,{size:13}),"Enable"]}):t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>i(n,"inactive"),title:"Disable",children:t.jsx(rt,{size:13})}),e[20]=n,e[21]=p,e[22]=i,e[23]=T):T=e[23];let C;e[24]!==n||e[25]!==a?(C=()=>a(n),e[24]=n,e[25]=a,e[26]=C):C=e[26];let y;e[27]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Se,{size:13}),e[27]=y):y=e[27];let I;e[28]!==C?(I=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:C,title:"Configure",children:y}),e[28]=C,e[29]=I):I=e[29];let _;e[30]!==n||e[31]!==o?(_=()=>o(n),e[30]=n,e[31]=o,e[32]=_):_=e[32];let k;e[33]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(re,{size:13}),e[33]=k):k=e[33];let S;e[34]!==_?(S=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:_,title:"Delete",children:k}),e[34]=_,e[35]=S):S=e[35];let f;e[36]!==I||e[37]!==S||e[38]!==N||e[39]!==T?(f=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[N,T,I,S]}),e[36]=I,e[37]=S,e[38]=N,e[39]=T,e[40]=f):f=e[40];let w;return e[41]!==f||e[42]!==h||e[43]!==g||e[44]!==j?(w=t.jsxs("div",{className:h,children:[g,j,f]}),e[41]=f,e[42]=h,e[43]=g,e[44]=j,e[45]=w):w=e[45],w}function Gt(s){const e=P.c(15),{instance:n,onConfigure:a}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>a(n),e[5]=n,e[6]=a,e[7]=i):i=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Se,{size:13}),e[8]=d):d=e[8];let l;e[9]!==i?(l=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i,title:"Configure",children:d})}),e[9]=i,e[10]=l):l=e[10];let x;return e[11]!==r||e[12]!==o||e[13]!==l?(x=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,l]}),e[11]=r,e[12]=o,e[13]=l,e[14]=x):x=e[14],x}function Xt(s){const e=P.c(27),{instances:n,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i,onAdd:d,isAdding:l}=s;if(n.length===0)return null;const x=n.length===1?"Instance":"Instances";let m;e[0]!==x?(m=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:x}),e[0]=x,e[1]=m):m=e[1];let p;e[2]!==l?(p=l?t.jsx(je,{size:13,className:"animate-spin"}):t.jsx(it,{size:13}),e[2]=l,e[3]=p):p=e[3];let c;e[4]!==l||e[5]!==d||e[6]!==p?(c=t.jsxs(V,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:d,disabled:l,children:[p,"Add instance"]}),e[4]=l,e[5]=d,e[6]=p,e[7]=c):c=e[7];let h;e[8]!==m||e[9]!==c?(h=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[m,c]}),e[8]=m,e[9]=c,e[10]=h):h=e[10];let g;if(e[11]!==n||e[12]!==r||e[13]!==a||e[14]!==o||e[15]!==i){let j;e[17]!==r||e[18]!==a||e[19]!==o||e[20]!==i?(j=N=>t.jsx(X.Suspense,{fallback:t.jsx(Gt,{instance:N,onConfigure:a}),children:t.jsx(qt,{instance:N,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i})},N.id),e[17]=r,e[18]=a,e[19]=o,e[20]=i,e[21]=j):j=e[21],g=n.map(j),e[11]=n,e[12]=r,e[13]=a,e[14]=o,e[15]=i,e[16]=g}else g=e[16];let v;e[22]!==g?(v=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:g}),e[22]=g,e[23]=v):v=e[23];let b;return e[24]!==h||e[25]!==v?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[h,v]}),e[24]=h,e[25]=v,e[26]=b):b=e[26],b}const Kt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Qt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Jt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Yt(s){const e=P.c(4),{connectionId:n,orgId:a,orgSlug:r,timeframe:o}=s;let i;e[0]!==a||e[1]!==r?(i={connectionId:st,orgId:a,orgSlug:r},e[0]=a,e[1]=r,e[2]=i):i=e[2];const d=ae(i),l=Qt(o),{data:x}=$e({queryKey:ne.connectionActivity(n,o,a),queryFn:async()=>{const g=await d.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:l.startDate.toISOString(),endDate:l.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return g.structuredContent??g},staleTime:3e5}),m=bt(x?.logs??[],l),p=m.data,c=m.totalCalls>0;let h;return e[3]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[3]=h):h=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:m.totalCalls.toLocaleString()}),h]}),m.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:m.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),m.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(m.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),c?t.jsxs("div",{children:[t.jsx(Nt,{config:Jt,className:"h-16 w-full",children:t.jsxs(yt,{data:p,barCategoryGap:"4%",children:[t.jsx(_t,{content:t.jsx(St,{labelFormatter:es}),cursor:{fill:"var(--muted)"}}),t.jsx(Ct,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:p.map(Zt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[p.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Zt(s,e){return t.jsx(wt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function es(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function ts(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ss(s){const e=P.c(14),{connectionId:n}=s,[a,r]=X.useState("14d"),{org:o}=J();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=i):i=e[0];let d;e[1]!==a?(d=Kt.map(c=>t.jsx("button",{type:"button",onClick:()=>r(c.value),className:ve("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",a===c.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:c.label},c.value)),e[1]=a,e[2]=d):d=e[2];let l;e[3]!==d?(l=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[i,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:d})]}),e[3]=d,e[4]=l):l=e[4];let x;e[5]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(ts,{}),e[5]=x):x=e[5];let m;e[6]!==n||e[7]!==o.id||e[8]!==o.slug||e[9]!==a?(m=t.jsx(X.Suspense,{fallback:x,children:t.jsx(Yt,{connectionId:n,orgId:o.id,orgSlug:o.slug,timeframe:a})}),e[6]=n,e[7]=o.id,e[8]=o.slug,e[9]=a,e[10]=m):m=e[10];let p;return e[11]!==l||e[12]!==m?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,m]}),e[11]=l,e[12]=m,e[13]=p):p=e[13],p}function ns(s){const e=P.c(15),{virtualMcp:n,org:a}=s,r=Y();let o;e[0]!==r||e[1]!==a||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:a,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=a,e[2]=n.id,e[3]=o):o=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(we,{size:16}),e[4]=i):i=e[4];let d;e[5]!==n.icon||e[6]!==n.title?(d=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:i}),e[5]=n.icon,e[6]=n.title,e[7]=d):d=e[7];let l;e[8]!==n.title?(l=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=x):x=e[10];let m;return e[11]!==o||e[12]!==d||e[13]!==l?(m=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[d,l,x]}),e[11]=o,e[12]=d,e[13]=l,e[14]=m):m=e[14],m}function os(s){const e=P.c(7),{virtualMcps:n,org:a}=s;let r;if(e[0]!==a||e[1]!==n){let i;e[3]!==a?(i=d=>t.jsx(ns,{virtualMcp:d,org:a},d.id),e[3]=a,e[4]=i):i=e[4],r=n.map(i),e[0]=a,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function is(s){const e=P.c(7),{connection:n}=s,{org:a}=J();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=kt(r);if(!(o.length>0)){let x;return e[2]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(t.Fragment,{}),e[2]=x):x=e[2],x}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=d):d=e[3];let l;return e[4]!==a.slug||e[5]!==o?(l=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,t.jsx("div",{className:"px-5 py-4",children:t.jsx(os,{virtualMcps:o,org:a.slug})})]}),e[4]=a.slug,e[5]=o,e[6]=l):l=e[6],l}function as(s){const e=P.c(31),{tools:n,connectionId:a,org:r}=s,o=Y(),{org:i}=J();let d;e[0]!==a||e[1]!==i.id||e[2]!==i.slug?(d={connectionId:a,orgId:i.id,orgSlug:i.slug},e[0]=a,e[1]=i.id,e[2]=i.slug,e[3]=d):d=e[3];const l=ae(d),x=ye(a);let m;e[4]!==x||e[5]!==a?(m=x?ke(x):a,e[4]=x,e[5]=a,e[6]=m):m=e[6];const p=m,[c,h]=X.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==c||e[12]!==n){const C=(n??[]).filter(rs),y=c.toLowerCase().trim(),I=y?C.filter(f=>f.name.toLowerCase().includes(y)||f.description&&f.description.toLowerCase().includes(y)):C;let _;e[17]!==p||e[18]!==o||e[19]!==r?(_=f=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(f.name)}})},e[17]=p,e[18]=o,e[19]=r,e[20]=_):_=e[20];const k=_;b="flex flex-col h-full overflow-hidden";let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=f=>{f.key==="Escape"&&(h(""),f.target.blur())},e[21]=S):S=e[21],e[22]!==c?(j=t.jsx(Pt,{value:c,onChange:h,placeholder:"Search apps...",onKeyDown:S}),e[22]=c,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=I.length===0?t.jsx(be,{image:null,title:c?"No apps found":"No apps available",description:c?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:I.map(f=>{const w=le(f._meta);return t.jsxs(Ot,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>k(f),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx($t,{resourceURI:w,toolInfo:{tool:f},displayMode:"inline",minHeight:200,maxHeight:200,client:l})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:f.name}),t.jsx(Ye,{annotations:f.annotations,_meta:f._meta})]}),f.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:f.description})]})]},f.name)})}),e[7]=p,e[8]=l,e[9]=o,e[10]=r,e[11]=c,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let N;e[24]!==g||e[25]!==v?(N=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=N):N=e[26];let T;return e[27]!==b||e[28]!==j||e[29]!==N?(T=t.jsxs("div",{className:b,children:[j,N]}),e[27]=b,e[28]=j,e[29]=N,e[30]=T):T=e[30],T}function rs(s){return!!le(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=i=>i.charAt(0).toUpperCase()+i.slice(1),a=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&a.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let a;return e[0]!==n?(a=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=a):a=e[1],a}function ls(s){const e=P.c(50),{tools:n,prompts:a,resources:r,connectionId:o,org:i}=s;let d;e[0]!==a?(d=a===void 0?[]:a,e[0]=a,e[1]=d):d=e[1];const l=d;let x;e[2]!==r?(x=r===void 0?[]:r,e[2]=r,e[3]=x):x=e[3];const m=x,p=Y(),c=ye(o??"");let h;e[4]!==c||e[5]!==o?(h=c?ke(c):o,e[4]=c,e[5]=o,e[6]=h):h=e[6];const g=h;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==i?(v=function(D){!o||!i||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(D)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=i,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==i||e[14]!==n?(j=o&&i&&n.some(ms),e[12]=o,e[13]=i,e[14]=n,e[15]=j):j=e[15];const N=j;if(n.length+l.length+m.length===0){let u;return e[16]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=u):u=e[16],u}let C;e[17]!==n.length?(C=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=C):C=e[18];let y;e[19]!==N?(y=N&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=N,e[20]=y):y=e[20];let I,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=I,e[22]=_):(I=e[21],_=e[22]);let k;e[23]!==C||e[24]!==y?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Tt,{variant:"underline",className:"gap-1",children:[C,y,I,_]})}),e[23]=C,e[24]=y,e[25]=k):k=e[25];let S;e[26]!==b||e[27]!==n?(S=n.length>0?n.map(u=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>b(u.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Dt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(u.name)}),u.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:u.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},u.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=S):S=e[28];let f;e[29]!==S?(f=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[29]=S,e[30]=f):f=e[30];let w;e[31]!==o||e[32]!==N||e[33]!==i||e[34]!==n?(w=N&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(as,{tools:n,connectionId:o,org:i})}),e[31]=o,e[32]=N,e[33]=i,e[34]=n,e[35]=w):w=e[35];let M;e[36]!==l?(M=l.length>0?l.map(ds):t.jsx(ie,{label:"prompts"}),e[36]=l,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let A;e[40]!==m?(A=m.length>0?m.map(cs):t.jsx(ie,{label:"resources"}),e[40]=m,e[41]=A):A=e[41];let z;e[42]!==A?(z=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[42]=A,e[43]=z):z=e[43];let U;return e[44]!==k||e[45]!==f||e[46]!==w||e[47]!==O||e[48]!==z?(U=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(It,{defaultValue:"tools",variant:"underline",children:[k,f,w,O,z]})}),e[44]=k,e[45]=f,e[46]=w,e[47]=O,e[48]=z,e[49]=U):U=e[49],U}function cs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(lt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function ds(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(At,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function ms(s){return le(s._meta)}function us(s){const e=P.c(13),{connection:n,displayTitle:a}=s,r=a??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(oe,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let i;e[3]!==r?(i=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=i):i=e[4];let d;e[5]!==n.description?(d=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=d):d=e[6];let l;e[7]!==i||e[8]!==d?(l=t.jsxs("div",{className:"flex-1 min-w-0",children:[i,d]}),e[7]=i,e[8]=d,e[9]=l):l=e[9];let x;return e[10]!==o||e[11]!==l?(x=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,l]}),e[10]=o,e[11]=l,e[12]=x):x=e[12],x}function xs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:a,onRemoveOAuth:r}){const o=de({control:s.control,name:"ui_type"}),i=de({control:s.control,name:"connection_url"}),{stdioEnabled:d}=Pe(),l=(()=>{if(typeof i!="string"||!i)return!1;try{const c=new URL(i);return c.hostname==="api.githubcopilot.com"&&c.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),x=d||e.connection_type==="STDIO",m=e.connection_type==="VIRTUAL",p=m?Oe(e.connection_url):null;return m?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(we,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(L,{control:s.control,name:"ui_type",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(ue,{value:c.value,onValueChange:c.onChange,children:[t.jsx(E,{children:t.jsxs(xe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(pe,{})]})}),t.jsxs(fe,{children:[t.jsx(R,{value:"HTTP",children:"HTTP"}),t.jsx(R,{value:"SSE",children:"SSE"}),t.jsx(R,{value:"Websocket",children:"Websocket"}),x&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:"NPX Package"}),t.jsx(R,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(E,{children:t.jsx(q,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(ue,{value:c.value,onValueChange:c.onChange,children:[t.jsx(E,{children:t.jsx(xe,{className:"h-10",children:t.jsx(pe,{})})}),t.jsxs(fe,{children:[t.jsx(R,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(R,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(R,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),x&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Rt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(R,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ct,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(W,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(E,{children:t.jsx(q,{placeholder:"@perplexity-ai/mcp-server",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(E,{children:t.jsx(q,{placeholder:"node, bun, python...",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(E,{children:t.jsx(q,{placeholder:"arg1 arg2 --flag value",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(W,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(E,{children:t.jsx(q,{placeholder:"/path/to/project (optional)",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(E,{children:t.jsx(We,{value:c.value??[],onChange:c.onChange})}),t.jsx(W,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:l?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(zt,{children:[t.jsx(Et,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Mt,{variant:"success",className:"gap-1.5",children:[t.jsx(Ut,{size:12}),"Authenticated via OAuth",t.jsx(Ft,{size:12})]})})}),t.jsxs(Vt,{align:"start",children:[t.jsxs(me,{onClick:a,children:[t.jsx(Lt,{size:16}),"Re-authenticate"]}),t.jsxs(me,{variant:"destructive",onClick:r,children:[t.jsx(re,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&c.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:()=>c.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(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(E,{children:t.jsx(q,{type:"password",placeholder:l?"Paste your GitHub PAT":"Enter access token...",...c,value:c.value||"",className:"h-10 rounded-lg"})}),l&&t.jsxs(ft,{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(W,{})]})})]})}function ps(s){return s.command==="npx"}function fs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function hs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function he(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Le(s.connection_headers)){const a=s.connection_headers,r=Ge(a.envVars);if(ps(a)){const i=fs(a);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:i,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=hs(a);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.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 gs(s){let e,n=null,a=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Xe(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Ke(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",a=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...a&&{connection_token:a},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function js({connection:s,connectionId:e,org:n,isUpdating:a,tools:r,prompts:o,resources:i,siblings:d}){const l=Y({from:"/$org/settings/connections/$appSlug"}),x=Ve(),m=_e(),{org:p}=J(),c=gt({onSuccess:()=>{d.length<=1&&l({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=X.useState(null),[v,b]=X.useState(!1),j=Ne({connectionId:e}),{data:N}=Ze(),T=N?.data?.members??[],C=h??s,y=T.find(u=>u.userId===C.created_by),_=s?.connection_type==="VIRTUAL"||j.isAuthenticated,k={...s,tools:r},S=Qe(k,Wt),f=Ue({resolver:Fe(qe),values:he(h??s)}),w=f.formState.isDirty,M=async()=>{if(!await f.trigger())return;const D=f.getValues(),$=gs(D),F=h?.id??e;await m.update.mutateAsync({id:F,data:$}),f.reset(D)},O=()=>{f.reset(he(h??s))},A=async u=>{const{token:D,tokenInfo:$,error:F}=await He({connectionId:u,orgSlug:p.slug,scope:"offline_access"});if(F||!D){G.error(`Authentication failed: ${F}`);return}if($)try{const K=await fetch(`/api/${p.slug}/connections/${u}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:$.accessToken,refreshToken:$.refreshToken,expiresIn:$.expiresIn,scope:$.scope,clientId:$.clientId,clientSecret:$.clientSecret,tokenEndpoint:$.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await m.update.mutateAsync({id:u,data:{connection_token:D}});else try{await m.update.mutateAsync({id:u,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(K){console.error("Error saving OAuth token:",K),await m.update.mutateAsync({id:u,data:{connection_token:D}})}else await m.update.mutateAsync({id:u,data:{connection_token:D}});const Q=new URL(`/api/${p.slug}/mcp/${u}`,window.location.origin);await x.invalidateQueries({queryKey:ne.isMCPAuthenticated(Q.href,null)}),await x.invalidateQueries({queryKey:ne.mcpClientPrefix()}),G.success("Authentication successful")},z=()=>A(s.id),U=async()=>{try{const u=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!u.ok){const $=await u.text();G.error(`Failed to remove OAuth: ${$}`);return}const D=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await x.invalidateQueries({queryKey:ne.isMCPAuthenticated(D.href,null)}),G.success("OAuth removed. You can now re-authenticate with a different account.")}catch(u){console.error("Error removing OAuth token:",u),G.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(jt,{...c}),t.jsx(dt,{open:h!==null,onOpenChange:u=>{u||g(null)},children:t.jsxs(mt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(ut,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(xt,{className:"text-base",children:h?.title??s.title}),t.jsx(pt,{className:"text-xs",children:"Update URL, authentication, and other settings"}),y&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(et,{url:y.user?.image??void 0,fallback:y.user?.name??y.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:y.user?.name||y.user?.email})]})]}),t.jsxs(ht,{...f,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(L,{control:f.control,name:"title",render:({field:u})=>t.jsxs(H,{children:[t.jsx(B,{children:"Name"}),t.jsx(E,{children:t.jsx(q,{...u})}),t.jsx(W,{})]})}),t.jsx(L,{control:f.control,name:"description",render:({field:u})=>t.jsxs(H,{children:[t.jsx(B,{children:"Description"}),t.jsx(E,{children:t.jsx(q,{...u,value:u.value||""})}),t.jsx(W,{})]})})]}),t.jsx(xs,{form:f,connection:h??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:z,onRemoveOAuth:U}),t.jsx(Je,{connection:h??s,form:f,hasMcpBinding:S,isMCPAuthenticated:_,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:z,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(V,{onClick:M,disabled:!w||a,className:"flex-1",children:a?"Saving…":"Save changes"}),w&&t.jsx(V,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(V,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const u=h??s;g(null),c.requestDelete(u)},children:[t.jsx(re,{size:15}),"Delete"]})]})]},h?.id??s.id)]})}),t.jsx(vt,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(us,{connection:s,displayTitle:(()=>{const u=d[0]??s;return u.app_name?u.title.replace(/\s*\(\d+\)\s*$/,""):u.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ss,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Xt,{instances:d,onConfigure:u=>g(u),onAuthenticate:u=>A(u.id),onDelete:u=>c.requestDelete(u),onToggleStatus:async(u,D)=>{try{await m.update.mutateAsync({id:u.id,data:{status:D}}),G.success(D==="active"?"Connection enabled":"Connection disabled")}catch{G.error("Failed to update connection")}},isAdding:v,onAdd:async()=>{b(!0);try{const u=d[0]??s,D=u.title.replace(/\s*\(\d+\)\s*$/,""),$=d.length+1,F=`${D} (${$})`,Q=Be("conn");await m.create.mutateAsync({id:Q,title:F,description:u.description??null,connection_type:u.connection_type,connection_url:u.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:u.created_by,organization_id:u.organization_id,icon:u.icon??null,app_name:u.app_name??null,app_id:u.app_id??null,connection_headers:u.connection_headers??null,oauth_config:null,configuration_state:u.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/api/${p.slug}/mcp/${Q}`,window.location.origin),Z=await Re({url:K.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await A(Q)}finally{b(!1)}}}),t.jsx(is,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ls,{tools:r,prompts:o,resources:i,connectionId:e,org:n})})]})})]})})]})}function vs(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:r,org:o}=ze(a),{org:i}=J(),d=_e();let l;s[2]!==r?(l={slug:r},s[2]=r,s[3]=l):l=s[3];const x=tt(l),m=x[0]??null,p=m?.id??"",c=p||null;let h;s[4]!==i.id||s[5]!==i.slug||s[6]!==c?(h={connectionId:c,orgId:i.id,orgSlug:i.slug},s[4]=i.id,s[5]=i.slug,s[6]=c,s[7]=h):h=s[7];const g=ae(h);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=nt(v);let j;if(s[10]!==m?.tools||s[11]!==p||s[12]!==x||s[13]!==b){const A=b?b.tools.map(Cs):(m?.tools??[]).map(Ss);e:{if(x.length<=1){j=A;break e}const z=new Set,U=[],u=ys;for(const D of x){const $=D.id===p?A:u(D.tools);for(const F of $)z.has(F.name)||(z.add(F.name),U.push(F))}j=U.length>0?U:A}s[10]=m?.tools,s[11]=p,s[12]=x,s[13]=b,s[14]=j}else j=s[14];const N=j;let T;s[15]!==g?(T={client:g},s[15]=g,s[16]=T):T=s[16];const{data:C}=ot(T);let y;s[17]!==g?(y={client:g},s[17]=g,s[18]=y):y=s[18];const{data:I}=Ee(y);let _;s[19]!==C?.prompts?(_=C?.prompts??[],s[19]=C?.prompts,s[20]=_):_=s[20];let k;s[21]!==_?(k=_.map(Ns),s[21]=_,s[22]=k):k=s[22];const S=k;let f;s[23]!==I?.resources?(f=I?.resources??[],s[23]=I?.resources,s[24]=f):f=s[24];let w;s[25]!==f?(w=f.map(bs),s[25]=f,s[26]=w):w=s[26];const M=w;if(!m){let A;return s[27]!==n||s[28]!==o?(A=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(be,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(V,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=A):A=s[29],A}let O;return s[30]!==d.update.isPending||s[31]!==N||s[32]!==m||s[33]!==p||s[34]!==o||s[35]!==S||s[36]!==M||s[37]!==x?(O=t.jsx(js,{org:o,connection:m,connectionId:p,isUpdating:d.update.isPending,tools:N,prompts:S,resources:M,siblings:x}),s[30]=d.update.isPending,s[31]=N,s[32]=m,s[33]=p,s[34]=o,s[35]=S,s[36]=M,s[37]=x,s[38]=O):O=s[38],O}function bs(s){return{name:s.name,description:s.description,uri:s.uri}}function Ns(s){return{name:s.name,description:s.description}}function ys(s){return(s??[]).map(_s)}function _s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ss(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Cs(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ws(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Me,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(vs,{})})}),s[0]=e):e=s[0],e}function lo(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ws,{}),s[0]=e):e=s[0],e}export{lo as default};
|
|
1
|
+
import{T as ge,aJ as Ie,ba as Ae,W as ce,aH as De,e as P,j as t,l as je,B as V,r as X,c as ve,q as J,s as $e,K as ne,f as Y,x as de,u as Pe,bb as Oe,E as Me,g as ze,bc as Ee,G as Ve,H as Ue,I as Fe,M as Re,o as G,bd as Le,J as He}from"./index-BPW95yv1.js";import{g as Be}from"./generate-id-DRkpi1K_.js";import{E as be}from"./empty-state-BUXcxrjO.js";import{E as We,c as qe,r as Ge,b as Xe,d as Ke}from"./connection-form-helpers-D1KznvTK.js";import{c as Qe,S as Je}from"./index-BwNRRrEM.js";import{u as Ne,T as Ye}from"./tools-list-BYjG31fh.js";import{u as Ze}from"./use-members-xRWwaUef.js";import{A as et}from"./avatar--94y31lg.js";import{a as ye,b as _e,u as tt}from"./use-connection-Ccv-Xgx3.js";import{u as ae,S as st}from"./constants-Cyw8HlyN.js";import{b as nt}from"./use-mcp-tools-tUtdLLx8.js";import{a as ot}from"./use-mcp-prompts-BT401n3U.js";import{I as oe}from"./integration-icon-BltEmUHe.js";import{s as it}from"./Plus-p_eZ4_sI.js";import{q as at,s as rt,a5 as lt,R as ct}from"./agent-icon-gyWkxLBk.js";import{a as Se}from"./Settings02-CaiJb4hz.js";import{s as re}from"./Trash01-xXJmX-sD.js";import{b as dt,a as mt,d as ut,S as xt,c as pt}from"./sheet-SJlzhsz6.js";import{F as L,b as H,c as B,d as E,f as W,e as ft,a as ht}from"./form-Bm14S2fw.js";import{I as q}from"./input-Di4NLV7k.js";import{u as gt,D as jt}from"./use-delete-connection-CFNX2gL_.js";import{V as vt}from"./layout-WwJpht6M.js";import{c as bt,C as Nt,B as yt,a as _t,b as St,d as Ct,e as wt}from"./monitoring-stats-row-BMi5DzAN.js";import{a as kt}from"./use-virtual-mcp-CmpTXBlT.js";import{i as Ce}from"./ChevronRight-zMBQRLRl.js";import{a as we}from"./Users03-CwkYSEUE.js";import{T as ee,a as Tt,b as te,c as It}from"./tabs-Bq9Z53Au.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as At}from"./ZapSquare-b4NUHEFQ.js";import{b as Dt}from"./Tool01-DkOxZLha.js";import{g as le,M as $t}from"./types-9t7kxiEp.js";import{C as Pt}from"./collection-search-DetB6uj9.js";import{C as Ot}from"./card-CgXj3w0j.js";import{B as Mt}from"./badge-UXeMkv1N.js";import{D as zt,a as Et,b as Vt,c as me}from"./dropdown-menu-D39dKUR6.js";import{d as ue,S as xe,a as pe,b as fe,c as R}from"./select-hcACDMsW.js";import{i as Ut}from"./CheckCircle-DUtE0DmA.js";import{t as Ft}from"./ChevronDown-BEW-c3gB.js";import{n as Rt}from"./Container-C-qyCnTQ.js";import{s as se}from"./Star01-CfjDLIEN.js";import{s as Lt}from"./RefreshCcw01-qZip7VuS.js";import{s as Ht}from"./XClose-KPa7x8br.js";import"./collections-D6clkX5p.js";import"./ZoomOut-C5miuqST.js";import"./Key01-CzVuKrFC.js";import"./index-C3xtZZkB.js";import"./index-CU8sRbSt.js";import"./extract-connection-data-F7Hf5agN.js";import"./use-registry-connections-CDLIXx4R.js";import"./use-organization-settings-ra7pFykJ.js";import"./index-NXk-KEYm.js";import"./popover-CH09SbYZ.js";import"./tooltip-Dx-dkmdA.js";import"./Check-BCfJiZjb.js";import"./SearchMd-CeenWY4R.js";import"./use-create-virtual-mcp-BOjPY_wj.js";import"./use-navigate-to-agent-Db_2WXW0.js";import"./Eye-DJA4t4LG.js";import"./use-org-auth-client-CMqB1f1E.js";import"./User01-CzXXeh_v.js";import"./use-collections-Br1yV-tu.js";import"./AlertCircle-kk9FGUJy.js";import"./SwitchHorizontal01-BEpb72lq.js";import"./XCircle-BapiRyFg.js";import"./ArrowUpRight-XiN-bNvq.js";import"./ChevronLeft-CMqbWQ59.js";import"./ChevronUp-GpCP941Q.js";import"./DotsVertical-CToOc1lA.js";import"./Globe01-BIDyppIG.js";import"./FilterLines-CWGo6iBt.js";import"./Palette-BRbkJewR.js";import"./HardDrive-zH516u4z.js";import"./Stars02-CkrNg1qh.js";import"./LayoutLeft-BdJGuKDp.js";import"./LinkExternal01-BjJ3q250.js";import"./Monitor01-BZbk9qOn.js";import"./Sun-dLAn0e4t.js";import"./Play-C4g6iAp0.js";import"./Shield01-BqdSTZVE.js";import"./Stars01-BBw3zOME.js";import"./Upload01-DxZby23M.js";import"./Users01-94UCCjNj.js";import"./X-DwTKQTxe.js";import"./Zap-BcSt62LH.js";import"./label-BiUZV55U.js";import"./alert-dialog-BuTseZND.js";import"./index-46rIaXY5.js";import"./sidebar-BlFrlbv4.js";const Bt=ge({scopes:De(ce()).describe("List of scopes available"),stateSchema:Ie(ce(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Wt=[{name:"MCP_CONFIGURATION",inputSchema:ge({}),outputSchema:Bt}];function qt(s){const e=P.c(46),{instance:n,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i}=s;let d;e[0]!==n.id?(d={connectionId:n.id},e[0]=n.id,e[1]=d):d=e[1];const l=Ne(d),m=!(n.connection_type==="VIRTUAL")&&l.supportsOAuth&&!l.isAuthenticated,p=n.status!=="active",c=m||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==c?(h=ve("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",c),e[2]=c,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let v;e[7]!==n.title?(v=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=v):v=e[8];let b;e[9]!==n.status||e[10]!==p||e[11]!==m?(b=m?t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?"Disabled (error)":"Disabled"}):null,e[9]=n.status,e[10]=p,e[11]=m,e[12]=b):b=e[12];let j;e[13]!==v||e[14]!==b?(j=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,b]}),e[13]=v,e[14]=b,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==m||e[18]!==r?(N=m&&t.jsx(V,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[16]=n,e[17]=m,e[18]=r,e[19]=N):N=e[19];let T;e[20]!==n||e[21]!==p||e[22]!==i?(T=p?t.jsxs(V,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>i(n,"active"),children:[t.jsx(at,{size:13}),"Enable"]}):t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>i(n,"inactive"),title:"Disable",children:t.jsx(rt,{size:13})}),e[20]=n,e[21]=p,e[22]=i,e[23]=T):T=e[23];let C;e[24]!==n||e[25]!==a?(C=()=>a(n),e[24]=n,e[25]=a,e[26]=C):C=e[26];let y;e[27]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Se,{size:13}),e[27]=y):y=e[27];let I;e[28]!==C?(I=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:C,title:"Configure",children:y}),e[28]=C,e[29]=I):I=e[29];let _;e[30]!==n||e[31]!==o?(_=()=>o(n),e[30]=n,e[31]=o,e[32]=_):_=e[32];let k;e[33]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(re,{size:13}),e[33]=k):k=e[33];let S;e[34]!==_?(S=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:_,title:"Delete",children:k}),e[34]=_,e[35]=S):S=e[35];let f;e[36]!==I||e[37]!==S||e[38]!==N||e[39]!==T?(f=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[N,T,I,S]}),e[36]=I,e[37]=S,e[38]=N,e[39]=T,e[40]=f):f=e[40];let w;return e[41]!==f||e[42]!==h||e[43]!==g||e[44]!==j?(w=t.jsxs("div",{className:h,children:[g,j,f]}),e[41]=f,e[42]=h,e[43]=g,e[44]=j,e[45]=w):w=e[45],w}function Gt(s){const e=P.c(15),{instance:n,onConfigure:a}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>a(n),e[5]=n,e[6]=a,e[7]=i):i=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Se,{size:13}),e[8]=d):d=e[8];let l;e[9]!==i?(l=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i,title:"Configure",children:d})}),e[9]=i,e[10]=l):l=e[10];let x;return e[11]!==r||e[12]!==o||e[13]!==l?(x=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,l]}),e[11]=r,e[12]=o,e[13]=l,e[14]=x):x=e[14],x}function Xt(s){const e=P.c(27),{instances:n,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i,onAdd:d,isAdding:l}=s;if(n.length===0)return null;const x=n.length===1?"Instance":"Instances";let m;e[0]!==x?(m=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:x}),e[0]=x,e[1]=m):m=e[1];let p;e[2]!==l?(p=l?t.jsx(je,{size:13,className:"animate-spin"}):t.jsx(it,{size:13}),e[2]=l,e[3]=p):p=e[3];let c;e[4]!==l||e[5]!==d||e[6]!==p?(c=t.jsxs(V,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:d,disabled:l,children:[p,"Add instance"]}),e[4]=l,e[5]=d,e[6]=p,e[7]=c):c=e[7];let h;e[8]!==m||e[9]!==c?(h=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[m,c]}),e[8]=m,e[9]=c,e[10]=h):h=e[10];let g;if(e[11]!==n||e[12]!==r||e[13]!==a||e[14]!==o||e[15]!==i){let j;e[17]!==r||e[18]!==a||e[19]!==o||e[20]!==i?(j=N=>t.jsx(X.Suspense,{fallback:t.jsx(Gt,{instance:N,onConfigure:a}),children:t.jsx(qt,{instance:N,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i})},N.id),e[17]=r,e[18]=a,e[19]=o,e[20]=i,e[21]=j):j=e[21],g=n.map(j),e[11]=n,e[12]=r,e[13]=a,e[14]=o,e[15]=i,e[16]=g}else g=e[16];let v;e[22]!==g?(v=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:g}),e[22]=g,e[23]=v):v=e[23];let b;return e[24]!==h||e[25]!==v?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[h,v]}),e[24]=h,e[25]=v,e[26]=b):b=e[26],b}const Kt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Qt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Jt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Yt(s){const e=P.c(4),{connectionId:n,orgId:a,orgSlug:r,timeframe:o}=s;let i;e[0]!==a||e[1]!==r?(i={connectionId:st,orgId:a,orgSlug:r},e[0]=a,e[1]=r,e[2]=i):i=e[2];const d=ae(i),l=Qt(o),{data:x}=$e({queryKey:ne.connectionActivity(n,o,a),queryFn:async()=>{const g=await d.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:l.startDate.toISOString(),endDate:l.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return g.structuredContent??g},staleTime:3e5}),m=bt(x?.logs??[],l),p=m.data,c=m.totalCalls>0;let h;return e[3]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[3]=h):h=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:m.totalCalls.toLocaleString()}),h]}),m.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:m.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),m.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(m.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),c?t.jsxs("div",{children:[t.jsx(Nt,{config:Jt,className:"h-16 w-full",children:t.jsxs(yt,{data:p,barCategoryGap:"4%",children:[t.jsx(_t,{content:t.jsx(St,{labelFormatter:es}),cursor:{fill:"var(--muted)"}}),t.jsx(Ct,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:p.map(Zt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[p.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Zt(s,e){return t.jsx(wt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function es(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function ts(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ss(s){const e=P.c(14),{connectionId:n}=s,[a,r]=X.useState("14d"),{org:o}=J();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=i):i=e[0];let d;e[1]!==a?(d=Kt.map(c=>t.jsx("button",{type:"button",onClick:()=>r(c.value),className:ve("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",a===c.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:c.label},c.value)),e[1]=a,e[2]=d):d=e[2];let l;e[3]!==d?(l=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[i,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:d})]}),e[3]=d,e[4]=l):l=e[4];let x;e[5]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(ts,{}),e[5]=x):x=e[5];let m;e[6]!==n||e[7]!==o.id||e[8]!==o.slug||e[9]!==a?(m=t.jsx(X.Suspense,{fallback:x,children:t.jsx(Yt,{connectionId:n,orgId:o.id,orgSlug:o.slug,timeframe:a})}),e[6]=n,e[7]=o.id,e[8]=o.slug,e[9]=a,e[10]=m):m=e[10];let p;return e[11]!==l||e[12]!==m?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,m]}),e[11]=l,e[12]=m,e[13]=p):p=e[13],p}function ns(s){const e=P.c(15),{virtualMcp:n,org:a}=s,r=Y();let o;e[0]!==r||e[1]!==a||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:a,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=a,e[2]=n.id,e[3]=o):o=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(we,{size:16}),e[4]=i):i=e[4];let d;e[5]!==n.icon||e[6]!==n.title?(d=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:i}),e[5]=n.icon,e[6]=n.title,e[7]=d):d=e[7];let l;e[8]!==n.title?(l=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=x):x=e[10];let m;return e[11]!==o||e[12]!==d||e[13]!==l?(m=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[d,l,x]}),e[11]=o,e[12]=d,e[13]=l,e[14]=m):m=e[14],m}function os(s){const e=P.c(7),{virtualMcps:n,org:a}=s;let r;if(e[0]!==a||e[1]!==n){let i;e[3]!==a?(i=d=>t.jsx(ns,{virtualMcp:d,org:a},d.id),e[3]=a,e[4]=i):i=e[4],r=n.map(i),e[0]=a,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function is(s){const e=P.c(7),{connection:n}=s,{org:a}=J();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=kt(r);if(!(o.length>0)){let x;return e[2]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(t.Fragment,{}),e[2]=x):x=e[2],x}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=d):d=e[3];let l;return e[4]!==a.slug||e[5]!==o?(l=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,t.jsx("div",{className:"px-5 py-4",children:t.jsx(os,{virtualMcps:o,org:a.slug})})]}),e[4]=a.slug,e[5]=o,e[6]=l):l=e[6],l}function as(s){const e=P.c(31),{tools:n,connectionId:a,org:r}=s,o=Y(),{org:i}=J();let d;e[0]!==a||e[1]!==i.id||e[2]!==i.slug?(d={connectionId:a,orgId:i.id,orgSlug:i.slug},e[0]=a,e[1]=i.id,e[2]=i.slug,e[3]=d):d=e[3];const l=ae(d),x=ye(a);let m;e[4]!==x||e[5]!==a?(m=x?ke(x):a,e[4]=x,e[5]=a,e[6]=m):m=e[6];const p=m,[c,h]=X.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==c||e[12]!==n){const C=(n??[]).filter(rs),y=c.toLowerCase().trim(),I=y?C.filter(f=>f.name.toLowerCase().includes(y)||f.description&&f.description.toLowerCase().includes(y)):C;let _;e[17]!==p||e[18]!==o||e[19]!==r?(_=f=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(f.name)}})},e[17]=p,e[18]=o,e[19]=r,e[20]=_):_=e[20];const k=_;b="flex flex-col h-full overflow-hidden";let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=f=>{f.key==="Escape"&&(h(""),f.target.blur())},e[21]=S):S=e[21],e[22]!==c?(j=t.jsx(Pt,{value:c,onChange:h,placeholder:"Search apps...",onKeyDown:S}),e[22]=c,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=I.length===0?t.jsx(be,{image:null,title:c?"No apps found":"No apps available",description:c?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:I.map(f=>{const w=le(f._meta);return t.jsxs(Ot,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>k(f),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx($t,{resourceURI:w,toolInfo:{tool:f},displayMode:"inline",minHeight:200,maxHeight:200,client:l})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:f.name}),t.jsx(Ye,{annotations:f.annotations,_meta:f._meta})]}),f.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:f.description})]})]},f.name)})}),e[7]=p,e[8]=l,e[9]=o,e[10]=r,e[11]=c,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let N;e[24]!==g||e[25]!==v?(N=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=N):N=e[26];let T;return e[27]!==b||e[28]!==j||e[29]!==N?(T=t.jsxs("div",{className:b,children:[j,N]}),e[27]=b,e[28]=j,e[29]=N,e[30]=T):T=e[30],T}function rs(s){return!!le(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=i=>i.charAt(0).toUpperCase()+i.slice(1),a=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&a.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let a;return e[0]!==n?(a=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=a):a=e[1],a}function ls(s){const e=P.c(50),{tools:n,prompts:a,resources:r,connectionId:o,org:i}=s;let d;e[0]!==a?(d=a===void 0?[]:a,e[0]=a,e[1]=d):d=e[1];const l=d;let x;e[2]!==r?(x=r===void 0?[]:r,e[2]=r,e[3]=x):x=e[3];const m=x,p=Y(),c=ye(o??"");let h;e[4]!==c||e[5]!==o?(h=c?ke(c):o,e[4]=c,e[5]=o,e[6]=h):h=e[6];const g=h;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==i?(v=function(D){!o||!i||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(D)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=i,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==i||e[14]!==n?(j=o&&i&&n.some(ms),e[12]=o,e[13]=i,e[14]=n,e[15]=j):j=e[15];const N=j;if(n.length+l.length+m.length===0){let u;return e[16]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=u):u=e[16],u}let C;e[17]!==n.length?(C=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=C):C=e[18];let y;e[19]!==N?(y=N&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=N,e[20]=y):y=e[20];let I,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=I,e[22]=_):(I=e[21],_=e[22]);let k;e[23]!==C||e[24]!==y?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Tt,{variant:"underline",className:"gap-1",children:[C,y,I,_]})}),e[23]=C,e[24]=y,e[25]=k):k=e[25];let S;e[26]!==b||e[27]!==n?(S=n.length>0?n.map(u=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>b(u.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Dt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(u.name)}),u.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:u.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},u.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=S):S=e[28];let f;e[29]!==S?(f=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[29]=S,e[30]=f):f=e[30];let w;e[31]!==o||e[32]!==N||e[33]!==i||e[34]!==n?(w=N&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(as,{tools:n,connectionId:o,org:i})}),e[31]=o,e[32]=N,e[33]=i,e[34]=n,e[35]=w):w=e[35];let M;e[36]!==l?(M=l.length>0?l.map(ds):t.jsx(ie,{label:"prompts"}),e[36]=l,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let A;e[40]!==m?(A=m.length>0?m.map(cs):t.jsx(ie,{label:"resources"}),e[40]=m,e[41]=A):A=e[41];let z;e[42]!==A?(z=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[42]=A,e[43]=z):z=e[43];let U;return e[44]!==k||e[45]!==f||e[46]!==w||e[47]!==O||e[48]!==z?(U=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(It,{defaultValue:"tools",variant:"underline",children:[k,f,w,O,z]})}),e[44]=k,e[45]=f,e[46]=w,e[47]=O,e[48]=z,e[49]=U):U=e[49],U}function cs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(lt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function ds(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(At,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function ms(s){return le(s._meta)}function us(s){const e=P.c(13),{connection:n,displayTitle:a}=s,r=a??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(oe,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let i;e[3]!==r?(i=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=i):i=e[4];let d;e[5]!==n.description?(d=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=d):d=e[6];let l;e[7]!==i||e[8]!==d?(l=t.jsxs("div",{className:"flex-1 min-w-0",children:[i,d]}),e[7]=i,e[8]=d,e[9]=l):l=e[9];let x;return e[10]!==o||e[11]!==l?(x=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,l]}),e[10]=o,e[11]=l,e[12]=x):x=e[12],x}function xs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:a,onRemoveOAuth:r}){const o=de({control:s.control,name:"ui_type"}),i=de({control:s.control,name:"connection_url"}),{stdioEnabled:d}=Pe(),l=(()=>{if(typeof i!="string"||!i)return!1;try{const c=new URL(i);return c.hostname==="api.githubcopilot.com"&&c.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),x=d||e.connection_type==="STDIO",m=e.connection_type==="VIRTUAL",p=m?Oe(e.connection_url):null;return m?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(we,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(L,{control:s.control,name:"ui_type",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(ue,{value:c.value,onValueChange:c.onChange,children:[t.jsx(E,{children:t.jsxs(xe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(pe,{})]})}),t.jsxs(fe,{children:[t.jsx(R,{value:"HTTP",children:"HTTP"}),t.jsx(R,{value:"SSE",children:"SSE"}),t.jsx(R,{value:"Websocket",children:"Websocket"}),x&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:"NPX Package"}),t.jsx(R,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(E,{children:t.jsx(q,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(ue,{value:c.value,onValueChange:c.onChange,children:[t.jsx(E,{children:t.jsx(xe,{className:"h-10",children:t.jsx(pe,{})})}),t.jsxs(fe,{children:[t.jsx(R,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(R,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(R,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),x&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Rt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(R,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ct,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(W,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(E,{children:t.jsx(q,{placeholder:"@perplexity-ai/mcp-server",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(E,{children:t.jsx(q,{placeholder:"node, bun, python...",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(E,{children:t.jsx(q,{placeholder:"arg1 arg2 --flag value",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(W,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(E,{children:t.jsx(q,{placeholder:"/path/to/project (optional)",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(E,{children:t.jsx(We,{value:c.value??[],onChange:c.onChange})}),t.jsx(W,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:l?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(zt,{children:[t.jsx(Et,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Mt,{variant:"success",className:"gap-1.5",children:[t.jsx(Ut,{size:12}),"Authenticated via OAuth",t.jsx(Ft,{size:12})]})})}),t.jsxs(Vt,{align:"start",children:[t.jsxs(me,{onClick:a,children:[t.jsx(Lt,{size:16}),"Re-authenticate"]}),t.jsxs(me,{variant:"destructive",onClick:r,children:[t.jsx(re,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&c.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:()=>c.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(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(E,{children:t.jsx(q,{type:"password",placeholder:l?"Paste your GitHub PAT":"Enter access token...",...c,value:c.value||"",className:"h-10 rounded-lg"})}),l&&t.jsxs(ft,{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(W,{})]})})]})}function ps(s){return s.command==="npx"}function fs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function hs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function he(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Le(s.connection_headers)){const a=s.connection_headers,r=Ge(a.envVars);if(ps(a)){const i=fs(a);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:i,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=hs(a);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.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 gs(s){let e,n=null,a=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Xe(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Ke(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",a=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...a&&{connection_token:a},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function js({connection:s,connectionId:e,org:n,isUpdating:a,tools:r,prompts:o,resources:i,siblings:d}){const l=Y({from:"/$org/settings/connections/$appSlug"}),x=Ve(),m=_e(),{org:p}=J(),c=gt({onSuccess:()=>{d.length<=1&&l({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=X.useState(null),[v,b]=X.useState(!1),j=Ne({connectionId:e}),{data:N}=Ze(),T=N?.data?.members??[],C=h??s,y=T.find(u=>u.userId===C.created_by),_=s?.connection_type==="VIRTUAL"||j.isAuthenticated,k={...s,tools:r},S=Qe(k,Wt),f=Ue({resolver:Fe(qe),values:he(h??s)}),w=f.formState.isDirty,M=async()=>{if(!await f.trigger())return;const D=f.getValues(),$=gs(D),F=h?.id??e;await m.update.mutateAsync({id:F,data:$}),f.reset(D)},O=()=>{f.reset(he(h??s))},A=async u=>{const{token:D,tokenInfo:$,error:F}=await He({connectionId:u,orgSlug:p.slug,scope:"offline_access"});if(F||!D){G.error(`Authentication failed: ${F}`);return}if($)try{const K=await fetch(`/api/${p.slug}/connections/${u}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:$.accessToken,refreshToken:$.refreshToken,expiresIn:$.expiresIn,scope:$.scope,clientId:$.clientId,clientSecret:$.clientSecret,tokenEndpoint:$.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await m.update.mutateAsync({id:u,data:{connection_token:D}});else try{await m.update.mutateAsync({id:u,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(K){console.error("Error saving OAuth token:",K),await m.update.mutateAsync({id:u,data:{connection_token:D}})}else await m.update.mutateAsync({id:u,data:{connection_token:D}});const Q=new URL(`/api/${p.slug}/mcp/${u}`,window.location.origin);await x.invalidateQueries({queryKey:ne.isMCPAuthenticated(Q.href,null)}),await x.invalidateQueries({queryKey:ne.mcpClientPrefix()}),G.success("Authentication successful")},z=()=>A(s.id),U=async()=>{try{const u=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!u.ok){const $=await u.text();G.error(`Failed to remove OAuth: ${$}`);return}const D=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await x.invalidateQueries({queryKey:ne.isMCPAuthenticated(D.href,null)}),G.success("OAuth removed. You can now re-authenticate with a different account.")}catch(u){console.error("Error removing OAuth token:",u),G.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(jt,{...c}),t.jsx(dt,{open:h!==null,onOpenChange:u=>{u||g(null)},children:t.jsxs(mt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(ut,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(xt,{className:"text-base",children:h?.title??s.title}),t.jsx(pt,{className:"text-xs",children:"Update URL, authentication, and other settings"}),y&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(et,{url:y.user?.image??void 0,fallback:y.user?.name??y.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:y.user?.name||y.user?.email})]})]}),t.jsxs(ht,{...f,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(L,{control:f.control,name:"title",render:({field:u})=>t.jsxs(H,{children:[t.jsx(B,{children:"Name"}),t.jsx(E,{children:t.jsx(q,{...u})}),t.jsx(W,{})]})}),t.jsx(L,{control:f.control,name:"description",render:({field:u})=>t.jsxs(H,{children:[t.jsx(B,{children:"Description"}),t.jsx(E,{children:t.jsx(q,{...u,value:u.value||""})}),t.jsx(W,{})]})})]}),t.jsx(xs,{form:f,connection:h??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:z,onRemoveOAuth:U}),t.jsx(Je,{connection:h??s,form:f,hasMcpBinding:S,isMCPAuthenticated:_,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:z,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(V,{onClick:M,disabled:!w||a,className:"flex-1",children:a?"Saving…":"Save changes"}),w&&t.jsx(V,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(V,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const u=h??s;g(null),c.requestDelete(u)},children:[t.jsx(re,{size:15}),"Delete"]})]})]},h?.id??s.id)]})}),t.jsx(vt,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(us,{connection:s,displayTitle:(()=>{const u=d[0]??s;return u.app_name?u.title.replace(/\s*\(\d+\)\s*$/,""):u.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ss,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Xt,{instances:d,onConfigure:u=>g(u),onAuthenticate:u=>A(u.id),onDelete:u=>c.requestDelete(u),onToggleStatus:async(u,D)=>{try{await m.update.mutateAsync({id:u.id,data:{status:D}}),G.success(D==="active"?"Connection enabled":"Connection disabled")}catch{G.error("Failed to update connection")}},isAdding:v,onAdd:async()=>{b(!0);try{const u=d[0]??s,D=u.title.replace(/\s*\(\d+\)\s*$/,""),$=d.length+1,F=`${D} (${$})`,Q=Be("conn");await m.create.mutateAsync({id:Q,title:F,description:u.description??null,connection_type:u.connection_type,connection_url:u.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:u.created_by,organization_id:u.organization_id,icon:u.icon??null,app_name:u.app_name??null,app_id:u.app_id??null,connection_headers:u.connection_headers??null,oauth_config:null,configuration_state:u.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/api/${p.slug}/mcp/${Q}`,window.location.origin),Z=await Re({url:K.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await A(Q)}finally{b(!1)}}}),t.jsx(is,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ls,{tools:r,prompts:o,resources:i,connectionId:e,org:n})})]})})]})})]})}function vs(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:r,org:o}=ze(a),{org:i}=J(),d=_e();let l;s[2]!==r?(l={slug:r},s[2]=r,s[3]=l):l=s[3];const x=tt(l),m=x[0]??null,p=m?.id??"",c=p||null;let h;s[4]!==i.id||s[5]!==i.slug||s[6]!==c?(h={connectionId:c,orgId:i.id,orgSlug:i.slug},s[4]=i.id,s[5]=i.slug,s[6]=c,s[7]=h):h=s[7];const g=ae(h);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=nt(v);let j;if(s[10]!==m?.tools||s[11]!==p||s[12]!==x||s[13]!==b){const A=b?b.tools.map(Cs):(m?.tools??[]).map(Ss);e:{if(x.length<=1){j=A;break e}const z=new Set,U=[],u=ys;for(const D of x){const $=D.id===p?A:u(D.tools);for(const F of $)z.has(F.name)||(z.add(F.name),U.push(F))}j=U.length>0?U:A}s[10]=m?.tools,s[11]=p,s[12]=x,s[13]=b,s[14]=j}else j=s[14];const N=j;let T;s[15]!==g?(T={client:g},s[15]=g,s[16]=T):T=s[16];const{data:C}=ot(T);let y;s[17]!==g?(y={client:g},s[17]=g,s[18]=y):y=s[18];const{data:I}=Ee(y);let _;s[19]!==C?.prompts?(_=C?.prompts??[],s[19]=C?.prompts,s[20]=_):_=s[20];let k;s[21]!==_?(k=_.map(Ns),s[21]=_,s[22]=k):k=s[22];const S=k;let f;s[23]!==I?.resources?(f=I?.resources??[],s[23]=I?.resources,s[24]=f):f=s[24];let w;s[25]!==f?(w=f.map(bs),s[25]=f,s[26]=w):w=s[26];const M=w;if(!m){let A;return s[27]!==n||s[28]!==o?(A=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(be,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(V,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=A):A=s[29],A}let O;return s[30]!==d.update.isPending||s[31]!==N||s[32]!==m||s[33]!==p||s[34]!==o||s[35]!==S||s[36]!==M||s[37]!==x?(O=t.jsx(js,{org:o,connection:m,connectionId:p,isUpdating:d.update.isPending,tools:N,prompts:S,resources:M,siblings:x}),s[30]=d.update.isPending,s[31]=N,s[32]=m,s[33]=p,s[34]=o,s[35]=S,s[36]=M,s[37]=x,s[38]=O):O=s[38],O}function bs(s){return{name:s.name,description:s.description,uri:s.uri}}function Ns(s){return{name:s.name,description:s.description}}function ys(s){return(s??[]).map(_s)}function _s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ss(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Cs(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ws(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Me,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(vs,{})})}),s[0]=e):e=s[0],e}function lo(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ws,{}),s[0]=e):e=s[0],e}export{lo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as R,aJ as V,ba as A,W as a,aH as j,aI as z,e as W,j as u,B as C}from"./index-
|
|
1
|
+
import{T as R,aJ as V,ba as A,W as a,aH as j,aI as z,e as W,j as u,B as C}from"./index-BPW95yv1.js";import{I as H}from"./input-Di4NLV7k.js";import{s as L}from"./Plus-p_eZ4_sI.js";import{s as q}from"./Trash01-xXJmX-sD.js";const K=R({key:a().min(1,"Key is required"),value:a()}),M=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(K).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:V(a(),A()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function $(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=W.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let T;e[9]!==r||e[10]!==t?(T=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=T):T=e[11];const k=T;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:$(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(q,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=u.jsx(L,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[w,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function I(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=I(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=I(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,J as a,Q as b,M as c,Z as d,Y as i,F as p,D as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as ce,j as t,E as tt,r as X,l as le,q as ke,f as De,d as nt,b as Ae,u as st,p as ot,L as it,H as at,I as ct,B as z,t as ne,G as rt,c as de,o as W,M as lt,J as dt,K as mt}from"./index-CW2GDOZp.js";import{g as ut}from"./generate-id-D01ICZCx.js";import{C as pt}from"./collection-display-button-D5hrgHkh.js";import{S as ht}from"./search-input-dUUxotu4.js";import{C as xt}from"./collection-tabs-BQEO65ib.js";import{u as gt,a as we,g as ft,C as ve}from"./connection-card-CDttZAWV.js";import{E as jt}from"./empty-state-CZdqlaa-.js";import{I as yt}from"./integration-icon-CRQNKwzw.js";import{P as pe}from"./index-MDvkqSr6.js";import{u as Ct,D as vt}from"./use-delete-connection-CvS5aoFM.js";import{u as Ce}from"./use-capability-DLwHss1A.js";import{u as _t}from"./use-infinite-scroll-CUCni0HP.js";import{u as St}from"./use-list-state-Cy-nbUe7.js";import{g as Te,a as bt,e as Nt}from"./extract-connection-data-F1Fp1AMr.js";import{g as xe}from"./connection-slug-eyAPH6o3.js";import{c as Ie,d as Pe,b as Le,f as Oe,e as $e,g as Ee,a as Me,A as ze}from"./alert-dialog-CU8ZYA21.js";import{C as Fe}from"./checkbox-OOQKZtC_.js";import{D as Ve,a as Be,b as Re,c as Ue,e as He,d as Ke}from"./dialog-CLtwKT7T.js";import{b as kt,a as Dt,c as At,D as wt,d as Tt,e as It,f as Pt}from"./drawer-BewkeO2E.js";import{u as Lt}from"./tooltip-6V7elEEX.js";import{D as We,a as Xe,b as qe,c as ae}from"./dropdown-menu-COlaUXPy.js";import{F as J,b as Y,c as Z,d as ee,f as te,a as be}from"./form-hhL2WFgR.js";import{I as ie}from"./input-C6I0qBHa.js";import{d as Ot,S as $t,a as Et,b as Mt,c as re}from"./select-CuTEW-jA.js";import{T as zt}from"./textarea-CvogFpDT.js";import{b as Ge,u as Ft}from"./use-connection-C4GFr9nL.js";import{u as Vt,S as Bt}from"./constants-BCfpLdj8.js";import{a as Rt}from"./use-virtual-mcp-BzRoDsnX.js";import{R as Ut,a4 as Ht,s as Kt,q as Wt}from"./agent-icon-zELPPL2m.js";import{n as ge}from"./Container-UwZa4Sjq.js";import{i as Qe}from"./DotsVertical-CRhU-CQp.js";import{s as Je}from"./Eye-CrIialez.js";import{s as ye}from"./Star01-B2sYJOUY.js";import{s as Ye}from"./Plus-CAk921Ey.js";import{s as Ze}from"./Trash01-BV0g0LQO.js";import{s as et}from"./XClose-Blplvetp.js";import{i as he,a as Ne,E as Xt,c as qt,p as Gt,b as Qt,d as Jt}from"./connection-form-helpers-BgC55lri.js";import"./collections-C_m5uhEc.js";import"./SwitchHorizontal01-UKGE6L3t.js";import"./Check-vtGHgjfG.js";import"./view-mode-toggle-BwZQDE89.js";import"./badge-zsFX23zy.js";import"./SearchMd-BGGjtsz7.js";import"./use-registry-connections-D9b3sQhT.js";import"./use-organization-settings--FTRiCSw.js";import"./useInfiniteQuery-DKdeEHtH.js";import"./infiniteQueryObserver-CNU9jr7j.js";import"./card-D5IvObwB.js";import"./sidebar-BVvI-fKb.js";import"./LayoutLeft-CYBI43zr.js";import"./sheet-XNQn2l1w.js";import"./X-Tdfyixv6.js";import"./use-view-mode-4iMRc-bf.js";import"./ChevronRight-I6954Qlw.js";import"./label-CBS86XNa.js";import"./ChevronDown--sdzrX52.js";import"./ChevronUp-B7_FaTuI.js";import"./use-collections-BauLzZZO.js";import"./AlertCircle-DtsIkyhv.js";import"./Tool01-NFK8H_gw.js";import"./RefreshCcw01-CJHsMXtu.js";import"./XCircle-B14veD9i.js";import"./ArrowUpRight-CC6Cv2i7.js";import"./ZapSquare-DzpMrwRR.js";import"./Users03-B7HqdPkm.js";import"./CheckCircle-BVxEOwgz.js";import"./ChevronLeft-HhUtQNOL.js";import"./ZoomOut-CT9E4Qhq.js";import"./Globe01-CWUyneqk.js";import"./FilterLines-CcSUEwfK.js";import"./Palette-Dc7v0Lbc.js";import"./HardDrive-B4ApPRkU.js";import"./Stars02-DR0TfdJs.js";import"./Key01-D8nYbfp6.js";import"./LinkExternal01-BBQVGsHV.js";import"./Monitor01-BqyNv3z7.js";import"./Sun-D0Tw1Afb.js";import"./Play-Bfu6rzoI.js";import"./Settings02-B3pc9FAS.js";import"./Shield01-CevvPkir.js";import"./Stars01-ChUleI_g.js";import"./Upload01-VAW7QmhA.js";import"./User01-DaoMnnxf.js";import"./Users01-BlMLYKx0.js";import"./Zap-DXci2BUM.js";function Yt(v){const e=ce.c(51),{group:n,onOpen:p,selectionMode:u,selectedIds:m,onToggleSelect:c}=v;let h;if(e[0]!==n.connections||e[1]!==m){let C;e[3]!==m?(C=P=>m.has(P.id),e[3]=m,e[4]=C):C=e[4],h=n.connections.every(C),e[0]=n.connections,e[1]=m,e[2]=h}else h=e[2];const g=h;let y;if(e[5]!==n.connections||e[6]!==m){let C;e[8]!==m?(C=P=>m.has(P.id),e[8]=m,e[9]=C):C=e[9],y=n.connections.some(C),e[5]=n.connections,e[6]=m,e[7]=y}else y=e[7];const x=y,b=`${n.connections.length} instances`;let N;e[10]!==n.icon||e[11]!==n.title||e[12]!==b?(N={title:n.title,icon:n.icon,description:b},e[10]=n.icon,e[11]=n.title,e[12]=b,e[13]=N):N=e[13];let l;e[14]!==g||e[15]!==n.connections||e[16]!==p||e[17]!==c||e[18]!==m||e[19]!==u?(l=()=>u?(()=>{for(const C of n.connections)g?m.has(C.id)&&c(C.id):m.has(C.id)||c(C.id)})():p(),e[14]=g,e[15]=n.connections,e[16]=p,e[17]=c,e[18]=m,e[19]=u,e[20]=l):l=e[20];const j=u&&g&&"ring-2 ring-primary",d=u&&x&&!g&&"ring-1 ring-primary/50";let k;e[21]!==j||e[22]!==d?(k=de(j,d),e[21]=j,e[22]=d,e[23]=k):k=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ge,{}),e[24]=_):_=e[24];let D;e[25]!==g||e[26]!==n.connections||e[27]!==c||e[28]!==m||e[29]!==u||e[30]!==x?(D=u?t.jsx(Fe,{checked:g?!0:x?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)g?m.has(C.id)&&c(C.id):m.has(C.id)||c(C.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=g,e[26]=n.connections,e[27]=c,e[28]=m,e[29]=u,e[30]=x,e[31]=D):D=e[31];const R=u?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let F;e[32]!==R?(F=de("overflow-hidden transition-all duration-150 ease-out",R),e[32]=R,e[33]=F):F=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Xe,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:en,children:t.jsx(Qe,{size:20})})}),e[34]=s):s=e[34];let A;e[35]!==p?(A=C=>{C.stopPropagation(),p()},e[35]=p,e[36]=A):A=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Je,{size:16}),e[37]=V):V=e[37];let $;e[38]!==A?($=t.jsxs(We,{children:[s,t.jsx(qe,{align:"end",onClick:Zt,children:t.jsxs(ae,{onClick:A,children:[V,"Open"]})})]}),e[38]=A,e[39]=$):$=e[39];let w;e[40]!==F||e[41]!==$?(w=t.jsx("div",{className:F,children:$}),e[40]=F,e[41]=$,e[42]=w):w=e[42];let L;e[43]!==D||e[44]!==w?(L=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=L):L=e[45];let B;return e[46]!==L||e[47]!==N||e[48]!==l||e[49]!==k?(B=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:N,onClick:l,className:k,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:L})}),e[46]=L,e[47]=N,e[48]=l,e[49]=k,e[50]=B):B=e[50],B}function Zt(v){return v.stopPropagation()}function en(v){return v.stopPropagation()}function tn(v){const e=ce.c(23),{count:n,total:p,canManage:u,canManageAgents:m,onSelectAll:c,onDeselectAll:h,onDelete:g,onAddToAgent:y,onToggleStatus:x,onCancel:b}=v;if(n===0)return null;let N;e[0]!==n?(N=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=N):N=e[1];let l;e[2]!==n||e[3]!==h||e[4]!==c||e[5]!==p?(l=n<p?t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:c,children:["Select all (",p,")"]}):t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:"Clear selection"}),e[2]=n,e[3]=h,e[4]=c,e[5]=p,e[6]=l):l=e[6];let j;e[7]!==m||e[8]!==y?(j=m&&t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:y,children:[t.jsx(Ye,{size:13}),"Add to Agent"]}),e[7]=m,e[8]=y,e[9]=j):j=e[9];let d;e[10]!==u||e[11]!==g||e[12]!==x?(d=u&&t.jsxs(t.Fragment,{children:[t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("active"),children:"Enable"}),t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("inactive"),children:"Disable"}),t.jsxs(z,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:[t.jsx(Ze,{size:13}),"Delete"]})]}),e[10]=u,e[11]=g,e[12]=x,e[13]=d):d=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(et,{size:13}),e[14]=k):k=e[14];let _;e[15]!==b?(_=t.jsx(z,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:b,children:k}),e[15]=b,e[16]=_):_=e[16];let D;return e[17]!==N||e[18]!==l||e[19]!==j||e[20]!==d||e[21]!==_?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[N,l,j,d,_]})}),e[17]=N,e[18]=l,e[19]=j,e[20]=d,e[21]=_,e[22]=D):D=e[22],D}function nn(v){const e=ce.c(25),{open:n,onOpenChange:p,agents:u,onConfirm:m}=v,[c,h]=X.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs(Re,{children:[t.jsx(Ue,{children:"Add to Agent"}),t.jsx(He,{children:"Select an agent to add the selected connections to."})]}),e[0]=g):g=e[0];let y;e[1]!==u||e[2]!==c?(y=u.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):u.map(D=>t.jsxs("button",{type:"button",onClick:()=>h(D.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",c===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(yt,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[1]=u,e[2]=c,e[3]=y):y=e[3];let x;e[4]!==y?(x=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:y}),e[4]=y,e[5]=x):x=e[5];let b;e[6]!==p?(b=t.jsx(z,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=b):b=e[7];const N=!c;let l;e[8]!==m||e[9]!==p||e[10]!==c?(l=()=>{c&&(m(c),p(!1),h(null))},e[8]=m,e[9]=p,e[10]=c,e[11]=l):l=e[11];let j;e[12]!==N||e[13]!==l?(j=t.jsx(z,{disabled:N,onClick:l,children:"Add"}),e[12]=N,e[13]=l,e[14]=j):j=e[14];let d;e[15]!==b||e[16]!==j?(d=t.jsxs(Ke,{children:[b,j]}),e[15]=b,e[16]=j,e[17]=d):d=e[17];let k;e[18]!==x||e[19]!==d?(k=t.jsxs(Be,{className:"sm:max-w-[400px]",children:[g,x,d]}),e[18]=x,e[19]=d,e[20]=k):k=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==k?(_=t.jsx(Ve,{open:n,onOpenChange:p,children:k}),e[21]=p,e[22]=n,e[23]=k,e[24]=_):_=e[24],_}function sn(v){const e=ce.c(20),{open:n,onOpenChange:p,count:u,onConfirm:m}=v,c=u!==1?"s":"";let h;e[0]!==u||e[1]!==c?(h=t.jsxs(Ie,{children:["Delete ",u," connection",c,"?"]}),e[0]=u,e[1]=c,e[2]=h):h=e[2];const g=u!==1?"s":"";let y;e[3]!==g?(y=t.jsxs(Pe,{children:["This will permanently delete the selected connection",g,". This action cannot be undone."]}),e[3]=g,e[4]=y):y=e[4];let x;e[5]!==h||e[6]!==y?(x=t.jsxs(Le,{children:[h,y]}),e[5]=h,e[6]=y,e[7]=x):x=e[7];let b;e[8]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Oe,{children:"Cancel"}),e[8]=b):b=e[8];const N=u!==1?"s":"";let l;e[9]!==u||e[10]!==m||e[11]!==N?(l=t.jsxs($e,{children:[b,t.jsxs(Ee,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",u," connection",N]})]}),e[9]=u,e[10]=m,e[11]=N,e[12]=l):l=e[12];let j;e[13]!==x||e[14]!==l?(j=t.jsxs(Me,{children:[x,l]}),e[13]=x,e[14]=l,e[15]=j):j=e[15];let d;return e[16]!==p||e[17]!==n||e[18]!==j?(d=t.jsx(ze,{open:n,onOpenChange:p,children:j}),e[16]=p,e[17]=n,e[18]=j,e[19]=d):d=e[19],d}function on(v){return v._registryId?.includes("community-registry")===!0}function an(v){const e=ce.c(58),{item:n,canManage:p,allConnections:u,connectedAppNames:m,connectingItemId:c,onNavigateConnected:h,onConnect:g}=v,[y,x]=X.useState(!1),[b,N]=X.useState(null);let l,j;e[0]!==m||e[1]!==n?(l=Te(n)??"",j=m.has(l),e[0]=m,e[1]=n,e[2]=l,e[3]=j):(l=e[2],j=e[3]);const d=j,k=n._meta?.["mcp.mesh"],_=k?.friendlyName||k?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let R;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(R=n.server?.icons?.[0]?.src||bt(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=R):R=e[6];const F=R;let s;if(e[7]!==u||e[8]!==l){let S;e[10]!==l?(S=se=>se.connection_type!=="VIRTUAL"&&se.app_name===l,e[10]=l,e[11]=S):S=e[11],s=u.filter(S),e[7]=u,e[8]=l,e[9]=s}else s=e[9];const A=s;let V;e[12]!==n?(V=on(n),e[12]=n,e[13]=V):V=e[13];const $=V;let w,L;e[14]!==A||e[15]!==p||e[16]!==$||e[17]!==d||e[18]!==n||e[19]!==g||e[20]!==h?(w=()=>{if(d){const S=A[0];S&&h(S);return}p&&L()},L=()=>{$?(N("connect"),x(!0)):g(n)},e[14]=A,e[15]=p,e[16]=$,e[17]=d,e[18]=n,e[19]=g,e[20]=h,e[21]=w,e[22]=L):(w=e[21],L=e[22]);let B;e[23]!==n||e[24]!==g||e[25]!==b?(B=()=>{ne("connections_community_warning_confirmed",{registry_item_id:n.id}),x(!1),b==="connect"&&g(n),N(null)},e[23]=n,e[24]=g,e[25]=b,e[26]=B):B=e[26];const C=B;let P;e[27]!==D||e[28]!==F||e[29]!==_?(P={title:_,description:D,icon:F},e[27]=D,e[28]=F,e[29]=_,e[30]=P):P=e[30];let Q;e[31]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(ge,{}),e[31]=Q):Q=e[31];let H;e[32]!==$||e[33]!==n._sourceIcon?(H=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=$,e[33]=n._sourceIcon,e[34]=H):H=e[34];let q;e[35]!==p||e[36]!==c||e[37]!==L||e[38]!==d||e[39]!==n.id?(q=d?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(z,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:c!==null,onClick:S=>{S.stopPropagation(),L()},children:c===n.id?t.jsx(le,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=c,e[37]=L,e[38]=d,e[39]=n.id,e[40]=q):q=e[40];let i;e[41]!==H||e[42]!==q?(i=t.jsxs("div",{className:"flex items-center gap-2",children:[H,q]}),e[41]=H,e[42]=q,e[43]=i):i=e[43];let f;e[44]!==w||e[45]!==i||e[46]!==P?(f=t.jsx(ve,{connection:P,fallbackIcon:Q,onClick:w,headerActionsAlwaysVisible:!0,headerActions:i}),e[44]=w,e[45]=i,e[46]=P,e[47]=f):f=e[47];let O;e[48]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(Le,{children:[t.jsx(Ie,{children:"Community MCP Server"}),t.jsx(Pe,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=O):O=e[48];let U;e[49]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Oe,{children:"Cancel"}),e[49]=U):U=e[49];let E;e[50]!==C?(E=t.jsxs(Me,{children:[O,t.jsxs($e,{children:[U,t.jsx(Ee,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=E):E=e[51];let r;e[52]!==y||e[53]!==E?(r=t.jsx(ze,{open:y,onOpenChange:x,children:E}),e[52]=y,e[53]=E,e[54]=r):r=e[54];let I;return e[55]!==f||e[56]!==r?(I=t.jsxs(t.Fragment,{children:[f,r]}),e[55]=f,e[56]=r,e[57]=I):I=e[57],I}function cn({listState:v,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:u,enabledRegistries:m}){const{org:c}=ke(),h=rt(),g=De(),{data:y}=Ae.useSession(),x=Ge(),b=Ft(v),N=Ct(),{granted:l}=Ce("connections:manage"),{granted:j}=Ce("agents:manage"),[d,k]=X.useState(new Set),_=d.size>0,[D,R]=X.useState(!1),[F,s]=X.useState(!1),[A,V]=X.useState(null),$=Rt(),w=b.filter(o=>!(n!=="ALL"&&o.connection_type!==n||p!=="ALL"&&o.status!==p)),L=ft(w),B=o=>{k(a=>{const M=new Set(a);return M.has(o)?M.delete(o):M.add(o),M})},C=()=>{k(new Set)},P=we(m,v.searchTerm),Q=P.items,H=_t(P.loadMore,P.hasMore,P.isLoadingMore),q=new Set(b.filter(o=>o.app_name).map(o=>o.app_name)),i=u==="ALL"||m.some(o=>o.id===u)?u:"ALL",f=v.search.length>0,O=e==="all"||f?Q.filter(o=>{if(i!=="ALL"&&o._registryId!==i)return!1;if(f){const a=Te(o);if(a&&q.has(a))return!1}return!0}):[],U=e==="connected"||f?L:[],E=async o=>{if(!(!c||!y?.user?.id)){ne("connection_add_clicked",{action:"connect_new",registry_item_id:o.id,source:"connections_page"}),V(o.id);try{const a=Nt(o,c.id,y.user.id,{remoteIndex:0}),M=a.connection_type==="STDIO",T=!!a.connection_url,G=M&&a.connection_headers&&typeof a.connection_headers=="object"&&"command"in a.connection_headers;if(!T&&!G){W.error("This MCP Server cannot be connected: no connection method available"),V(null);return}const{id:K}=await x.create.mutateAsync(a),_e=new URL(`/api/${c.slug}/mcp/${K}`,window.location.origin),Se=await lt({url:_e.href,token:null,orgId:c.id});if(Se.supportsOAuth&&!Se.isAuthenticated){const{token:ue,tokenInfo:oe,error:je}=await dt({connectionId:K,orgSlug:c.slug,scope:"offline_access"});if(je||!ue){ne("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:je??"no_token"}),W.error(`Authentication failed: ${je??"no token received"}`);return}else{if(ne("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),oe)try{(await fetch(`/api/${c.slug}/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:oe.accessToken,refreshToken:oe.refreshToken,expiresIn:oe.expiresIn,scope:oe.scope,clientId:oe.clientId,clientSecret:oe.clientSecret,tokenEndpoint:oe.tokenEndpoint})})).ok?await x.update.mutateAsync({id:K,data:{}}):await x.update.mutateAsync({id:K,data:{connection_token:ue}})}catch{await x.update.mutateAsync({id:K,data:{connection_token:ue}})}else await x.update.mutateAsync({id:K,data:{connection_token:ue}});await h.invalidateQueries({queryKey:mt.isMCPAuthenticated(_e.href,null)}),W.success("Authentication successful")}}W.success("Connected successfully")}catch(a){W.error(`Failed to connect: ${a instanceof Error?a.message:String(a)}`)}finally{V(null)}}},r=Vt({connectionId:Bt,orgId:c.id,orgSlug:c.slug}),I=()=>{h.invalidateQueries({predicate:o=>{const a=o.queryKey;return a[1]===c.id&&a[3]==="collection"&&a[4]==="CONNECTIONS"}})},S=async()=>{R(!1);const o=[...d];ne("connections_bulk_delete",{count:o.length});let a=0;for(const M of o)try{(await r.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:M,force:!0}})).isError||a++}catch{}I(),W.success(`Deleted ${a} connection${a!==1?"s":""}`),C()},se=async(o,a)=>{try{await x.update.mutateAsync({id:o,data:{status:a}}),I(),W.success(a==="active"?"Connection enabled":"Connection disabled")}catch{W.error("Failed to update connection")}},fe=async o=>{const a=[...d];ne("connections_bulk_status_toggled",{count:a.length,to_status:o});let M=0;for(const T of a)try{await x.update.mutateAsync({id:T,data:{status:o}}),M++}catch{}I(),W.success(`${o==="active"?"Enabled":"Disabled"} ${M} connection${M!==1?"s":""}`),C()},me=async o=>{const a=$.find(G=>G.id===o);if(!a||!r)return;ne("connections_bulk_add_to_agent",{agent_id:o,count:d.size});const M=new Set(a.connections.map(G=>G.connection_id)),T=[...d].filter(G=>!M.has(G)).map(G=>({connection_id:G,selected_tools:null,selected_resources:null,selected_prompts:null}));if(T.length===0){W.info("All selected connections are already in that agent");return}try{await r.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:o,data:{connections:[...a.connections,...T]}}}),h.invalidateQueries({predicate:G=>{const K=G.queryKey;return K[1]===c.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),W.success(`Added ${T.length} connection${T.length!==1?"s":""} to "${a.title}"`),C()}catch{W.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(vt,{...N}),t.jsx(sn,{open:D,onOpenChange:R,count:d.size,onConfirm:S}),t.jsx(nn,{open:F,onOpenChange:s,agents:$,onConfirm:me}),P.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(f?O.length===0&&w.length===0:e==="all"?O.length===0:w.length===0)?t.jsx(jt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:v.search?`No Connections match "${v.search}"`:l?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[U.map(o=>{if(o.type==="group")return t.jsx(Yt,{group:o,onOpen:()=>{g({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:o.key}})},selectionMode:_,selectedIds:d,onToggleSelect:B},o.key);const a=o.connection,M=d.has(a.id);return t.jsx(ve,{connection:a,fallbackIcon:t.jsx(ge,{}),onClick:()=>_?B(a.id):g({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:xe(a)}}),className:de(M&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(Fe,{checked:M,onCheckedChange:()=>B(a.id),onClick:T=>T.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:de("overflow-hidden transition-all duration-150 ease-out",_?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(We,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:T=>T.stopPropagation(),children:t.jsx(Qe,{size:20})})}),t.jsxs(qe,{align:"end",onClick:T=>T.stopPropagation(),children:[t.jsxs(ae,{onClick:T=>{T.stopPropagation(),g({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:xe(a)}})},children:[t.jsx(Je,{size:16}),"Open"]}),(l||j)&&t.jsxs(ae,{onClick:T=>{T.stopPropagation(),B(a.id)},children:[t.jsx(Ht,{size:16}),"Select"]}),l&&(a.status==="active"?t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"inactive")},children:[t.jsx(Kt,{size:16}),"Disable"]}):t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"active")},children:[t.jsx(Wt,{size:16}),"Enable"]})),l&&t.jsxs(ae,{variant:"destructive",onClick:T=>{T.stopPropagation(),N.requestDelete(a)},children:[t.jsx(Ze,{size:16}),"Delete"]})]})]})})]})},a.id)}),O.map(o=>t.jsx(an,{item:o,canManage:l,allConnections:b,connectedAppNames:q,connectingItemId:A,onNavigateConnected:a=>g({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:xe(a)}}),onConnect:E},`catalog-${o._registryId}:${o.id}`)),(e==="all"||f)&&m.length>0&&t.jsx("div",{ref:H,className:"col-span-full h-4"}),(e==="all"||f)&&P.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(le,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(tn,{count:d.size,total:w.length,canManage:l,canManageAgents:j,onSelectAll:()=>{k(new Set(w.map(o=>o.id)))},onDeselectAll:()=>k(new Set),onDelete:()=>R(!0),onAddToAgent:()=>s(!0),onToggleStatus:fe,onCancel:C})]})}function rn(){const{org:v}=ke(),e=De(),n=nt({strict:!1}),{data:p}=Ae.useSession(),{stdioEnabled:u}=st(),m=Lt(),{granted:c}=Ce("connections:manage"),h=St({namespace:v.slug,resource:"connections"}),g=Ge(),[y,x]=ot(it.connectionsTab(v.slug),i=>n.tab==="all"||n.tab==="connected"?n.tab:i??"all"),[b,N]=X.useState("ALL"),[l,j]=X.useState("ALL"),[d,k]=X.useState("ALL"),_=gt(),R=we(_,h.searchTerm).items,F=h.search!==h.searchTerm,s=at({resolver:ct(qt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),A=s.watch("ui_type"),V=s.watch("connection_url"),$=s.watch("npx_package"),w=he({uiType:A,connectionUrl:V??"",npxPackage:$??""})??Ne({uiType:A,connectionUrl:V??"",registryItems:R}),L=c&&n.action==="create",B=()=>{ne("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:v.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:v.slug},search:{}})},P=async i=>{let f,O=null,U=null,E=null;i.ui_type==="NPX"?(f="STDIO",O="",E=Qt(i.npx_package||"",i.env_vars||[])):i.ui_type==="STDIO"?(f="STDIO",O="",E=Jt(i.stdio_command||"",i.stdio_args||"",i.stdio_cwd,i.env_vars||[])):(f=i.ui_type,O=i.connection_url||"",U=i.connection_token||null);const r=ut("conn");ne("connection_custom_created",{connection_type:f,ui_type:i.ui_type}),await g.create.mutateAsync({id:r,title:i.title,description:i.description||null,connection_type:f,connection_url:O,connection_token:U,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:v.id,icon:i.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),C(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:v.slug,appSlug:xe({app_name:null,connection_url:O,title:i.title,id:r})}})},Q=i=>{i||(L&&C(),s.reset())},H=i=>{const f=i.trim();if(!f)return;const O=!!s.formState.dirtyFields.title,U=!!s.formState.dirtyFields.description,E=!!s.formState.dirtyFields.env_vars,r=S=>{if(S&&(!O&&!s.getValues("title").trim()&&S.title&&s.setValue("title",S.title,{shouldDirty:!1}),!U&&!(s.getValues("description")??"").trim()&&S.description&&s.setValue("description",S.description,{shouldDirty:!1}),!E&&S.envVarKeys?.length)){const se=s.getValues("env_vars")??[],fe=new Set(se.map(o=>o.key)),me=S.envVarKeys.filter(o=>!fe.has(o));me.length>0&&s.setValue("env_vars",[...se,...me.map(o=>({key:o,value:""}))],{shouldDirty:!0})}},I=Gt(f);if(I&&u){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",I.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),r(he({uiType:"NPX",npxPackage:I.packageName}));return}if(f.startsWith("http://")||f.startsWith("https://")){const S=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",S,{shouldDirty:!0}),s.setValue("connection_url",f,{shouldDirty:!0}),r(he({uiType:S,connectionUrl:f})??Ne({uiType:S,connectionUrl:f,registryItems:R}));return}A==="NPX"&&r(he({uiType:"NPX",npxPackage:f}))},q=c?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(z,{variant:"outline",onClick:B,children:[t.jsx(Ye,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const i="Create Connection",f="Create a custom connection in your organization. Fill in the details below.",O=s.formState.isSubmitting?"Saving...":"Create Connection",U=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(J,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Type *"}),t.jsxs(Ot,{value:r.value,onValueChange:r.onChange,children:[t.jsx(ee,{children:t.jsx($t,{children:t.jsx(Et,{})})}),t.jsxs(Mt,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(te,{})]})}),A==="NPX"&&t.jsx(J,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"NPM Package *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value??"",onPaste:I=>{const S=I.clipboardData.getData("text");S&&(I.preventDefault(),s.setValue("npx_package",S.trim(),{shouldDirty:!0}),H(S))},onBlur:I=>{H(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(J,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Command *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"node, bun, python...",...r,value:r.value??""})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Arguments"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...r,value:r.value??""})}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Working Directory"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...r,value:r.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(te,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(J,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Environment Variables"}),t.jsx(ee,{children:t.jsx(Xt,{value:r.value??[],onChange:r.onChange})}),t.jsx(te,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(J,{control:s.control,name:"connection_url",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"URL *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...r,value:r.value??"",onPaste:I=>{const S=I.clipboardData.getData("text");S&&(I.preventDefault(),s.setValue("connection_url",S.trim(),{shouldDirty:!0}),H(S))},onBlur:I=>{H(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:w?.token?.label??"Token (optional)"}),t.jsx(ee,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...r,value:r.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"title",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Name *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"My Connection",...r})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"description",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Description"}),t.jsx(ee,{children:t.jsx(zt,{placeholder:"A brief description of this connection",rows:3,...r,value:r.value??""})}),t.jsx(te,{})]})})]}),E=L;return m?t.jsx(kt,{open:E,onOpenChange:Q,children:t.jsxs(Dt,{className:"max-h-[90vh]",children:[t.jsx(At,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(wt,{children:i}),t.jsx(Tt,{className:"mt-1",children:f})]}),t.jsx(It,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(et,{size:16})})})]})}),t.jsx(be,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:U}),t.jsx(Pt,{children:t.jsx(z,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:O})})]})})]})}):t.jsx(Ve,{open:E,onOpenChange:Q,children:t.jsxs(Be,{className:"sm:max-w-[525px]",children:[t.jsxs(Re,{children:[t.jsx(Ue,{children:i}),t.jsx(He,{children:f})]}),t.jsx(be,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:U}),t.jsxs(Ke,{children:[t.jsx(z,{type:"button",variant:"outline",onClick:()=>Q(!1),children:"Cancel"}),t.jsx(z,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:O})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ht,{value:h.search,onChange:h.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(h.setSearch(""),i.target.blur())}}),t.jsx(pt,{sortKey:h.sortKey,sortDirection:h.sortDirection,onSort:h.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:b,onChange:i=>N(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:l,onChange:i=>j(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:d,onChange:i=>k(i||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(i=>({id:i.id,label:i.id.includes("community-registry")?"Community MCP Registry":i.title}))]}]:[]]})]}),q]}),t.jsx(xt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:y,onTabChange:i=>{const f=i;f!==y&&ne("connections_page_tab_changed",{to_tab:f}),x(f)}}),t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:F?.5:1,transition:F?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:F?"none":"auto"},children:t.jsx(cn,{listState:h,activeTab:y,typeFilter:b,statusFilter:l,registryFilter:d,enabledRegistries:_})})})]})})})]})})}function Bs(){const v=ce.c(1);let e;return v[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tt,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(rn,{})})}),v[0]=e):e=v[0],e}export{Bs as default};
|
|
1
|
+
import{e as ce,j as t,E as tt,r as X,l as le,q as ke,f as De,d as nt,b as Ae,u as st,p as ot,L as it,H as at,I as ct,B as z,t as ne,G as rt,c as de,o as W,M as lt,J as dt,K as mt}from"./index-BPW95yv1.js";import{g as ut}from"./generate-id-DRkpi1K_.js";import{C as pt}from"./collection-display-button-zpu5JdsR.js";import{S as ht}from"./search-input-BtfHd_PV.js";import{C as xt}from"./collection-tabs-BJeLyyG1.js";import{u as gt,a as we,g as ft,C as ve}from"./connection-card-CeEDgo5u.js";import{E as jt}from"./empty-state-BUXcxrjO.js";import{I as yt}from"./integration-icon-BltEmUHe.js";import{P as pe}from"./index-46rIaXY5.js";import{u as Ct,D as vt}from"./use-delete-connection-CFNX2gL_.js";import{u as Ce}from"./use-capability-DltTWnuY.js";import{u as _t}from"./use-infinite-scroll-CrpZ3N3L.js";import{u as St}from"./use-list-state-CBkbv-v0.js";import{g as Te,a as bt,e as Nt}from"./extract-connection-data-F7Hf5agN.js";import{g as xe}from"./connection-slug-eyAPH6o3.js";import{c as Ie,d as Pe,b as Le,f as Oe,e as $e,g as Ee,a as Me,A as ze}from"./alert-dialog-BuTseZND.js";import{C as Fe}from"./checkbox-D0ucHXyU.js";import{D as Ve,a as Be,b as Re,c as Ue,e as He,d as Ke}from"./dialog-CvHDSOMQ.js";import{b as kt,a as Dt,c as At,D as wt,d as Tt,e as It,f as Pt}from"./drawer-BCVb0_Ol.js";import{u as Lt}from"./tooltip-Dx-dkmdA.js";import{D as We,a as Xe,b as qe,c as ae}from"./dropdown-menu-D39dKUR6.js";import{F as J,b as Y,c as Z,d as ee,f as te,a as be}from"./form-Bm14S2fw.js";import{I as ie}from"./input-Di4NLV7k.js";import{d as Ot,S as $t,a as Et,b as Mt,c as re}from"./select-hcACDMsW.js";import{T as zt}from"./textarea-DZUFH_8Z.js";import{b as Ge,u as Ft}from"./use-connection-Ccv-Xgx3.js";import{u as Vt,S as Bt}from"./constants-Cyw8HlyN.js";import{a as Rt}from"./use-virtual-mcp-CmpTXBlT.js";import{R as Ut,a4 as Ht,s as Kt,q as Wt}from"./agent-icon-gyWkxLBk.js";import{n as ge}from"./Container-C-qyCnTQ.js";import{i as Qe}from"./DotsVertical-CToOc1lA.js";import{s as Je}from"./Eye-DJA4t4LG.js";import{s as ye}from"./Star01-CfjDLIEN.js";import{s as Ye}from"./Plus-p_eZ4_sI.js";import{s as Ze}from"./Trash01-xXJmX-sD.js";import{s as et}from"./XClose-KPa7x8br.js";import{i as he,a as Ne,E as Xt,c as qt,p as Gt,b as Qt,d as Jt}from"./connection-form-helpers-D1KznvTK.js";import"./collections-D6clkX5p.js";import"./SwitchHorizontal01-BEpb72lq.js";import"./Check-BCfJiZjb.js";import"./view-mode-toggle-DUj5Q_6q.js";import"./badge-UXeMkv1N.js";import"./SearchMd-CeenWY4R.js";import"./use-registry-connections-CDLIXx4R.js";import"./use-organization-settings-ra7pFykJ.js";import"./useInfiniteQuery-Dx_1Wo2M.js";import"./infiniteQueryObserver-BwWnRM4l.js";import"./card-CgXj3w0j.js";import"./sidebar-BlFrlbv4.js";import"./LayoutLeft-BdJGuKDp.js";import"./sheet-SJlzhsz6.js";import"./X-DwTKQTxe.js";import"./use-view-mode-D6qHHEdi.js";import"./ChevronRight-zMBQRLRl.js";import"./label-BiUZV55U.js";import"./ChevronDown-BEW-c3gB.js";import"./ChevronUp-GpCP941Q.js";import"./use-collections-Br1yV-tu.js";import"./AlertCircle-kk9FGUJy.js";import"./Tool01-DkOxZLha.js";import"./RefreshCcw01-qZip7VuS.js";import"./XCircle-BapiRyFg.js";import"./ArrowUpRight-XiN-bNvq.js";import"./ZapSquare-b4NUHEFQ.js";import"./Users03-CwkYSEUE.js";import"./CheckCircle-DUtE0DmA.js";import"./ChevronLeft-CMqbWQ59.js";import"./ZoomOut-C5miuqST.js";import"./Globe01-BIDyppIG.js";import"./FilterLines-CWGo6iBt.js";import"./Palette-BRbkJewR.js";import"./HardDrive-zH516u4z.js";import"./Stars02-CkrNg1qh.js";import"./Key01-CzVuKrFC.js";import"./LinkExternal01-BjJ3q250.js";import"./Monitor01-BZbk9qOn.js";import"./Sun-dLAn0e4t.js";import"./Play-C4g6iAp0.js";import"./Settings02-CaiJb4hz.js";import"./Shield01-BqdSTZVE.js";import"./Stars01-BBw3zOME.js";import"./Upload01-DxZby23M.js";import"./User01-CzXXeh_v.js";import"./Users01-94UCCjNj.js";import"./Zap-BcSt62LH.js";function Yt(v){const e=ce.c(51),{group:n,onOpen:p,selectionMode:u,selectedIds:m,onToggleSelect:c}=v;let h;if(e[0]!==n.connections||e[1]!==m){let C;e[3]!==m?(C=P=>m.has(P.id),e[3]=m,e[4]=C):C=e[4],h=n.connections.every(C),e[0]=n.connections,e[1]=m,e[2]=h}else h=e[2];const g=h;let y;if(e[5]!==n.connections||e[6]!==m){let C;e[8]!==m?(C=P=>m.has(P.id),e[8]=m,e[9]=C):C=e[9],y=n.connections.some(C),e[5]=n.connections,e[6]=m,e[7]=y}else y=e[7];const x=y,b=`${n.connections.length} instances`;let N;e[10]!==n.icon||e[11]!==n.title||e[12]!==b?(N={title:n.title,icon:n.icon,description:b},e[10]=n.icon,e[11]=n.title,e[12]=b,e[13]=N):N=e[13];let l;e[14]!==g||e[15]!==n.connections||e[16]!==p||e[17]!==c||e[18]!==m||e[19]!==u?(l=()=>u?(()=>{for(const C of n.connections)g?m.has(C.id)&&c(C.id):m.has(C.id)||c(C.id)})():p(),e[14]=g,e[15]=n.connections,e[16]=p,e[17]=c,e[18]=m,e[19]=u,e[20]=l):l=e[20];const j=u&&g&&"ring-2 ring-primary",d=u&&x&&!g&&"ring-1 ring-primary/50";let k;e[21]!==j||e[22]!==d?(k=de(j,d),e[21]=j,e[22]=d,e[23]=k):k=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ge,{}),e[24]=_):_=e[24];let D;e[25]!==g||e[26]!==n.connections||e[27]!==c||e[28]!==m||e[29]!==u||e[30]!==x?(D=u?t.jsx(Fe,{checked:g?!0:x?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)g?m.has(C.id)&&c(C.id):m.has(C.id)||c(C.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=g,e[26]=n.connections,e[27]=c,e[28]=m,e[29]=u,e[30]=x,e[31]=D):D=e[31];const R=u?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let F;e[32]!==R?(F=de("overflow-hidden transition-all duration-150 ease-out",R),e[32]=R,e[33]=F):F=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Xe,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:en,children:t.jsx(Qe,{size:20})})}),e[34]=s):s=e[34];let A;e[35]!==p?(A=C=>{C.stopPropagation(),p()},e[35]=p,e[36]=A):A=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Je,{size:16}),e[37]=V):V=e[37];let $;e[38]!==A?($=t.jsxs(We,{children:[s,t.jsx(qe,{align:"end",onClick:Zt,children:t.jsxs(ae,{onClick:A,children:[V,"Open"]})})]}),e[38]=A,e[39]=$):$=e[39];let w;e[40]!==F||e[41]!==$?(w=t.jsx("div",{className:F,children:$}),e[40]=F,e[41]=$,e[42]=w):w=e[42];let L;e[43]!==D||e[44]!==w?(L=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=L):L=e[45];let B;return e[46]!==L||e[47]!==N||e[48]!==l||e[49]!==k?(B=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:N,onClick:l,className:k,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:L})}),e[46]=L,e[47]=N,e[48]=l,e[49]=k,e[50]=B):B=e[50],B}function Zt(v){return v.stopPropagation()}function en(v){return v.stopPropagation()}function tn(v){const e=ce.c(23),{count:n,total:p,canManage:u,canManageAgents:m,onSelectAll:c,onDeselectAll:h,onDelete:g,onAddToAgent:y,onToggleStatus:x,onCancel:b}=v;if(n===0)return null;let N;e[0]!==n?(N=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=N):N=e[1];let l;e[2]!==n||e[3]!==h||e[4]!==c||e[5]!==p?(l=n<p?t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:c,children:["Select all (",p,")"]}):t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:"Clear selection"}),e[2]=n,e[3]=h,e[4]=c,e[5]=p,e[6]=l):l=e[6];let j;e[7]!==m||e[8]!==y?(j=m&&t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:y,children:[t.jsx(Ye,{size:13}),"Add to Agent"]}),e[7]=m,e[8]=y,e[9]=j):j=e[9];let d;e[10]!==u||e[11]!==g||e[12]!==x?(d=u&&t.jsxs(t.Fragment,{children:[t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("active"),children:"Enable"}),t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("inactive"),children:"Disable"}),t.jsxs(z,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:[t.jsx(Ze,{size:13}),"Delete"]})]}),e[10]=u,e[11]=g,e[12]=x,e[13]=d):d=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(et,{size:13}),e[14]=k):k=e[14];let _;e[15]!==b?(_=t.jsx(z,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:b,children:k}),e[15]=b,e[16]=_):_=e[16];let D;return e[17]!==N||e[18]!==l||e[19]!==j||e[20]!==d||e[21]!==_?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[N,l,j,d,_]})}),e[17]=N,e[18]=l,e[19]=j,e[20]=d,e[21]=_,e[22]=D):D=e[22],D}function nn(v){const e=ce.c(25),{open:n,onOpenChange:p,agents:u,onConfirm:m}=v,[c,h]=X.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs(Re,{children:[t.jsx(Ue,{children:"Add to Agent"}),t.jsx(He,{children:"Select an agent to add the selected connections to."})]}),e[0]=g):g=e[0];let y;e[1]!==u||e[2]!==c?(y=u.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):u.map(D=>t.jsxs("button",{type:"button",onClick:()=>h(D.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",c===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(yt,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[1]=u,e[2]=c,e[3]=y):y=e[3];let x;e[4]!==y?(x=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:y}),e[4]=y,e[5]=x):x=e[5];let b;e[6]!==p?(b=t.jsx(z,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=b):b=e[7];const N=!c;let l;e[8]!==m||e[9]!==p||e[10]!==c?(l=()=>{c&&(m(c),p(!1),h(null))},e[8]=m,e[9]=p,e[10]=c,e[11]=l):l=e[11];let j;e[12]!==N||e[13]!==l?(j=t.jsx(z,{disabled:N,onClick:l,children:"Add"}),e[12]=N,e[13]=l,e[14]=j):j=e[14];let d;e[15]!==b||e[16]!==j?(d=t.jsxs(Ke,{children:[b,j]}),e[15]=b,e[16]=j,e[17]=d):d=e[17];let k;e[18]!==x||e[19]!==d?(k=t.jsxs(Be,{className:"sm:max-w-[400px]",children:[g,x,d]}),e[18]=x,e[19]=d,e[20]=k):k=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==k?(_=t.jsx(Ve,{open:n,onOpenChange:p,children:k}),e[21]=p,e[22]=n,e[23]=k,e[24]=_):_=e[24],_}function sn(v){const e=ce.c(20),{open:n,onOpenChange:p,count:u,onConfirm:m}=v,c=u!==1?"s":"";let h;e[0]!==u||e[1]!==c?(h=t.jsxs(Ie,{children:["Delete ",u," connection",c,"?"]}),e[0]=u,e[1]=c,e[2]=h):h=e[2];const g=u!==1?"s":"";let y;e[3]!==g?(y=t.jsxs(Pe,{children:["This will permanently delete the selected connection",g,". This action cannot be undone."]}),e[3]=g,e[4]=y):y=e[4];let x;e[5]!==h||e[6]!==y?(x=t.jsxs(Le,{children:[h,y]}),e[5]=h,e[6]=y,e[7]=x):x=e[7];let b;e[8]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Oe,{children:"Cancel"}),e[8]=b):b=e[8];const N=u!==1?"s":"";let l;e[9]!==u||e[10]!==m||e[11]!==N?(l=t.jsxs($e,{children:[b,t.jsxs(Ee,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",u," connection",N]})]}),e[9]=u,e[10]=m,e[11]=N,e[12]=l):l=e[12];let j;e[13]!==x||e[14]!==l?(j=t.jsxs(Me,{children:[x,l]}),e[13]=x,e[14]=l,e[15]=j):j=e[15];let d;return e[16]!==p||e[17]!==n||e[18]!==j?(d=t.jsx(ze,{open:n,onOpenChange:p,children:j}),e[16]=p,e[17]=n,e[18]=j,e[19]=d):d=e[19],d}function on(v){return v._registryId?.includes("community-registry")===!0}function an(v){const e=ce.c(58),{item:n,canManage:p,allConnections:u,connectedAppNames:m,connectingItemId:c,onNavigateConnected:h,onConnect:g}=v,[y,x]=X.useState(!1),[b,N]=X.useState(null);let l,j;e[0]!==m||e[1]!==n?(l=Te(n)??"",j=m.has(l),e[0]=m,e[1]=n,e[2]=l,e[3]=j):(l=e[2],j=e[3]);const d=j,k=n._meta?.["mcp.mesh"],_=k?.friendlyName||k?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let R;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(R=n.server?.icons?.[0]?.src||bt(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=R):R=e[6];const F=R;let s;if(e[7]!==u||e[8]!==l){let S;e[10]!==l?(S=se=>se.connection_type!=="VIRTUAL"&&se.app_name===l,e[10]=l,e[11]=S):S=e[11],s=u.filter(S),e[7]=u,e[8]=l,e[9]=s}else s=e[9];const A=s;let V;e[12]!==n?(V=on(n),e[12]=n,e[13]=V):V=e[13];const $=V;let w,L;e[14]!==A||e[15]!==p||e[16]!==$||e[17]!==d||e[18]!==n||e[19]!==g||e[20]!==h?(w=()=>{if(d){const S=A[0];S&&h(S);return}p&&L()},L=()=>{$?(N("connect"),x(!0)):g(n)},e[14]=A,e[15]=p,e[16]=$,e[17]=d,e[18]=n,e[19]=g,e[20]=h,e[21]=w,e[22]=L):(w=e[21],L=e[22]);let B;e[23]!==n||e[24]!==g||e[25]!==b?(B=()=>{ne("connections_community_warning_confirmed",{registry_item_id:n.id}),x(!1),b==="connect"&&g(n),N(null)},e[23]=n,e[24]=g,e[25]=b,e[26]=B):B=e[26];const C=B;let P;e[27]!==D||e[28]!==F||e[29]!==_?(P={title:_,description:D,icon:F},e[27]=D,e[28]=F,e[29]=_,e[30]=P):P=e[30];let Q;e[31]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(ge,{}),e[31]=Q):Q=e[31];let H;e[32]!==$||e[33]!==n._sourceIcon?(H=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=$,e[33]=n._sourceIcon,e[34]=H):H=e[34];let q;e[35]!==p||e[36]!==c||e[37]!==L||e[38]!==d||e[39]!==n.id?(q=d?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(z,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:c!==null,onClick:S=>{S.stopPropagation(),L()},children:c===n.id?t.jsx(le,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=c,e[37]=L,e[38]=d,e[39]=n.id,e[40]=q):q=e[40];let i;e[41]!==H||e[42]!==q?(i=t.jsxs("div",{className:"flex items-center gap-2",children:[H,q]}),e[41]=H,e[42]=q,e[43]=i):i=e[43];let f;e[44]!==w||e[45]!==i||e[46]!==P?(f=t.jsx(ve,{connection:P,fallbackIcon:Q,onClick:w,headerActionsAlwaysVisible:!0,headerActions:i}),e[44]=w,e[45]=i,e[46]=P,e[47]=f):f=e[47];let O;e[48]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(Le,{children:[t.jsx(Ie,{children:"Community MCP Server"}),t.jsx(Pe,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=O):O=e[48];let U;e[49]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Oe,{children:"Cancel"}),e[49]=U):U=e[49];let E;e[50]!==C?(E=t.jsxs(Me,{children:[O,t.jsxs($e,{children:[U,t.jsx(Ee,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=E):E=e[51];let r;e[52]!==y||e[53]!==E?(r=t.jsx(ze,{open:y,onOpenChange:x,children:E}),e[52]=y,e[53]=E,e[54]=r):r=e[54];let I;return e[55]!==f||e[56]!==r?(I=t.jsxs(t.Fragment,{children:[f,r]}),e[55]=f,e[56]=r,e[57]=I):I=e[57],I}function cn({listState:v,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:u,enabledRegistries:m}){const{org:c}=ke(),h=rt(),g=De(),{data:y}=Ae.useSession(),x=Ge(),b=Ft(v),N=Ct(),{granted:l}=Ce("connections:manage"),{granted:j}=Ce("agents:manage"),[d,k]=X.useState(new Set),_=d.size>0,[D,R]=X.useState(!1),[F,s]=X.useState(!1),[A,V]=X.useState(null),$=Rt(),w=b.filter(o=>!(n!=="ALL"&&o.connection_type!==n||p!=="ALL"&&o.status!==p)),L=ft(w),B=o=>{k(a=>{const M=new Set(a);return M.has(o)?M.delete(o):M.add(o),M})},C=()=>{k(new Set)},P=we(m,v.searchTerm),Q=P.items,H=_t(P.loadMore,P.hasMore,P.isLoadingMore),q=new Set(b.filter(o=>o.app_name).map(o=>o.app_name)),i=u==="ALL"||m.some(o=>o.id===u)?u:"ALL",f=v.search.length>0,O=e==="all"||f?Q.filter(o=>{if(i!=="ALL"&&o._registryId!==i)return!1;if(f){const a=Te(o);if(a&&q.has(a))return!1}return!0}):[],U=e==="connected"||f?L:[],E=async o=>{if(!(!c||!y?.user?.id)){ne("connection_add_clicked",{action:"connect_new",registry_item_id:o.id,source:"connections_page"}),V(o.id);try{const a=Nt(o,c.id,y.user.id,{remoteIndex:0}),M=a.connection_type==="STDIO",T=!!a.connection_url,G=M&&a.connection_headers&&typeof a.connection_headers=="object"&&"command"in a.connection_headers;if(!T&&!G){W.error("This MCP Server cannot be connected: no connection method available"),V(null);return}const{id:K}=await x.create.mutateAsync(a),_e=new URL(`/api/${c.slug}/mcp/${K}`,window.location.origin),Se=await lt({url:_e.href,token:null,orgId:c.id});if(Se.supportsOAuth&&!Se.isAuthenticated){const{token:ue,tokenInfo:oe,error:je}=await dt({connectionId:K,orgSlug:c.slug,scope:"offline_access"});if(je||!ue){ne("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:je??"no_token"}),W.error(`Authentication failed: ${je??"no token received"}`);return}else{if(ne("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),oe)try{(await fetch(`/api/${c.slug}/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:oe.accessToken,refreshToken:oe.refreshToken,expiresIn:oe.expiresIn,scope:oe.scope,clientId:oe.clientId,clientSecret:oe.clientSecret,tokenEndpoint:oe.tokenEndpoint})})).ok?await x.update.mutateAsync({id:K,data:{}}):await x.update.mutateAsync({id:K,data:{connection_token:ue}})}catch{await x.update.mutateAsync({id:K,data:{connection_token:ue}})}else await x.update.mutateAsync({id:K,data:{connection_token:ue}});await h.invalidateQueries({queryKey:mt.isMCPAuthenticated(_e.href,null)}),W.success("Authentication successful")}}W.success("Connected successfully")}catch(a){W.error(`Failed to connect: ${a instanceof Error?a.message:String(a)}`)}finally{V(null)}}},r=Vt({connectionId:Bt,orgId:c.id,orgSlug:c.slug}),I=()=>{h.invalidateQueries({predicate:o=>{const a=o.queryKey;return a[1]===c.id&&a[3]==="collection"&&a[4]==="CONNECTIONS"}})},S=async()=>{R(!1);const o=[...d];ne("connections_bulk_delete",{count:o.length});let a=0;for(const M of o)try{(await r.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:M,force:!0}})).isError||a++}catch{}I(),W.success(`Deleted ${a} connection${a!==1?"s":""}`),C()},se=async(o,a)=>{try{await x.update.mutateAsync({id:o,data:{status:a}}),I(),W.success(a==="active"?"Connection enabled":"Connection disabled")}catch{W.error("Failed to update connection")}},fe=async o=>{const a=[...d];ne("connections_bulk_status_toggled",{count:a.length,to_status:o});let M=0;for(const T of a)try{await x.update.mutateAsync({id:T,data:{status:o}}),M++}catch{}I(),W.success(`${o==="active"?"Enabled":"Disabled"} ${M} connection${M!==1?"s":""}`),C()},me=async o=>{const a=$.find(G=>G.id===o);if(!a||!r)return;ne("connections_bulk_add_to_agent",{agent_id:o,count:d.size});const M=new Set(a.connections.map(G=>G.connection_id)),T=[...d].filter(G=>!M.has(G)).map(G=>({connection_id:G,selected_tools:null,selected_resources:null,selected_prompts:null}));if(T.length===0){W.info("All selected connections are already in that agent");return}try{await r.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:o,data:{connections:[...a.connections,...T]}}}),h.invalidateQueries({predicate:G=>{const K=G.queryKey;return K[1]===c.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),W.success(`Added ${T.length} connection${T.length!==1?"s":""} to "${a.title}"`),C()}catch{W.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(vt,{...N}),t.jsx(sn,{open:D,onOpenChange:R,count:d.size,onConfirm:S}),t.jsx(nn,{open:F,onOpenChange:s,agents:$,onConfirm:me}),P.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(f?O.length===0&&w.length===0:e==="all"?O.length===0:w.length===0)?t.jsx(jt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:v.search?`No Connections match "${v.search}"`:l?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[U.map(o=>{if(o.type==="group")return t.jsx(Yt,{group:o,onOpen:()=>{g({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:o.key}})},selectionMode:_,selectedIds:d,onToggleSelect:B},o.key);const a=o.connection,M=d.has(a.id);return t.jsx(ve,{connection:a,fallbackIcon:t.jsx(ge,{}),onClick:()=>_?B(a.id):g({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:xe(a)}}),className:de(M&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(Fe,{checked:M,onCheckedChange:()=>B(a.id),onClick:T=>T.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:de("overflow-hidden transition-all duration-150 ease-out",_?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(We,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:T=>T.stopPropagation(),children:t.jsx(Qe,{size:20})})}),t.jsxs(qe,{align:"end",onClick:T=>T.stopPropagation(),children:[t.jsxs(ae,{onClick:T=>{T.stopPropagation(),g({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:xe(a)}})},children:[t.jsx(Je,{size:16}),"Open"]}),(l||j)&&t.jsxs(ae,{onClick:T=>{T.stopPropagation(),B(a.id)},children:[t.jsx(Ht,{size:16}),"Select"]}),l&&(a.status==="active"?t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"inactive")},children:[t.jsx(Kt,{size:16}),"Disable"]}):t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"active")},children:[t.jsx(Wt,{size:16}),"Enable"]})),l&&t.jsxs(ae,{variant:"destructive",onClick:T=>{T.stopPropagation(),N.requestDelete(a)},children:[t.jsx(Ze,{size:16}),"Delete"]})]})]})})]})},a.id)}),O.map(o=>t.jsx(an,{item:o,canManage:l,allConnections:b,connectedAppNames:q,connectingItemId:A,onNavigateConnected:a=>g({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:xe(a)}}),onConnect:E},`catalog-${o._registryId}:${o.id}`)),(e==="all"||f)&&m.length>0&&t.jsx("div",{ref:H,className:"col-span-full h-4"}),(e==="all"||f)&&P.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(le,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(tn,{count:d.size,total:w.length,canManage:l,canManageAgents:j,onSelectAll:()=>{k(new Set(w.map(o=>o.id)))},onDeselectAll:()=>k(new Set),onDelete:()=>R(!0),onAddToAgent:()=>s(!0),onToggleStatus:fe,onCancel:C})]})}function rn(){const{org:v}=ke(),e=De(),n=nt({strict:!1}),{data:p}=Ae.useSession(),{stdioEnabled:u}=st(),m=Lt(),{granted:c}=Ce("connections:manage"),h=St({namespace:v.slug,resource:"connections"}),g=Ge(),[y,x]=ot(it.connectionsTab(v.slug),i=>n.tab==="all"||n.tab==="connected"?n.tab:i??"all"),[b,N]=X.useState("ALL"),[l,j]=X.useState("ALL"),[d,k]=X.useState("ALL"),_=gt(),R=we(_,h.searchTerm).items,F=h.search!==h.searchTerm,s=at({resolver:ct(qt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),A=s.watch("ui_type"),V=s.watch("connection_url"),$=s.watch("npx_package"),w=he({uiType:A,connectionUrl:V??"",npxPackage:$??""})??Ne({uiType:A,connectionUrl:V??"",registryItems:R}),L=c&&n.action==="create",B=()=>{ne("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:v.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:v.slug},search:{}})},P=async i=>{let f,O=null,U=null,E=null;i.ui_type==="NPX"?(f="STDIO",O="",E=Qt(i.npx_package||"",i.env_vars||[])):i.ui_type==="STDIO"?(f="STDIO",O="",E=Jt(i.stdio_command||"",i.stdio_args||"",i.stdio_cwd,i.env_vars||[])):(f=i.ui_type,O=i.connection_url||"",U=i.connection_token||null);const r=ut("conn");ne("connection_custom_created",{connection_type:f,ui_type:i.ui_type}),await g.create.mutateAsync({id:r,title:i.title,description:i.description||null,connection_type:f,connection_url:O,connection_token:U,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:v.id,icon:i.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),C(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:v.slug,appSlug:xe({app_name:null,connection_url:O,title:i.title,id:r})}})},Q=i=>{i||(L&&C(),s.reset())},H=i=>{const f=i.trim();if(!f)return;const O=!!s.formState.dirtyFields.title,U=!!s.formState.dirtyFields.description,E=!!s.formState.dirtyFields.env_vars,r=S=>{if(S&&(!O&&!s.getValues("title").trim()&&S.title&&s.setValue("title",S.title,{shouldDirty:!1}),!U&&!(s.getValues("description")??"").trim()&&S.description&&s.setValue("description",S.description,{shouldDirty:!1}),!E&&S.envVarKeys?.length)){const se=s.getValues("env_vars")??[],fe=new Set(se.map(o=>o.key)),me=S.envVarKeys.filter(o=>!fe.has(o));me.length>0&&s.setValue("env_vars",[...se,...me.map(o=>({key:o,value:""}))],{shouldDirty:!0})}},I=Gt(f);if(I&&u){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",I.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),r(he({uiType:"NPX",npxPackage:I.packageName}));return}if(f.startsWith("http://")||f.startsWith("https://")){const S=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",S,{shouldDirty:!0}),s.setValue("connection_url",f,{shouldDirty:!0}),r(he({uiType:S,connectionUrl:f})??Ne({uiType:S,connectionUrl:f,registryItems:R}));return}A==="NPX"&&r(he({uiType:"NPX",npxPackage:f}))},q=c?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(z,{variant:"outline",onClick:B,children:[t.jsx(Ye,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const i="Create Connection",f="Create a custom connection in your organization. Fill in the details below.",O=s.formState.isSubmitting?"Saving...":"Create Connection",U=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(J,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Type *"}),t.jsxs(Ot,{value:r.value,onValueChange:r.onChange,children:[t.jsx(ee,{children:t.jsx($t,{children:t.jsx(Et,{})})}),t.jsxs(Mt,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(te,{})]})}),A==="NPX"&&t.jsx(J,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"NPM Package *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value??"",onPaste:I=>{const S=I.clipboardData.getData("text");S&&(I.preventDefault(),s.setValue("npx_package",S.trim(),{shouldDirty:!0}),H(S))},onBlur:I=>{H(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(J,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Command *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"node, bun, python...",...r,value:r.value??""})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Arguments"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...r,value:r.value??""})}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Working Directory"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...r,value:r.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(te,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(J,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Environment Variables"}),t.jsx(ee,{children:t.jsx(Xt,{value:r.value??[],onChange:r.onChange})}),t.jsx(te,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(J,{control:s.control,name:"connection_url",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"URL *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...r,value:r.value??"",onPaste:I=>{const S=I.clipboardData.getData("text");S&&(I.preventDefault(),s.setValue("connection_url",S.trim(),{shouldDirty:!0}),H(S))},onBlur:I=>{H(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:w?.token?.label??"Token (optional)"}),t.jsx(ee,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...r,value:r.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"title",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Name *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"My Connection",...r})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"description",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Description"}),t.jsx(ee,{children:t.jsx(zt,{placeholder:"A brief description of this connection",rows:3,...r,value:r.value??""})}),t.jsx(te,{})]})})]}),E=L;return m?t.jsx(kt,{open:E,onOpenChange:Q,children:t.jsxs(Dt,{className:"max-h-[90vh]",children:[t.jsx(At,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(wt,{children:i}),t.jsx(Tt,{className:"mt-1",children:f})]}),t.jsx(It,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(et,{size:16})})})]})}),t.jsx(be,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:U}),t.jsx(Pt,{children:t.jsx(z,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:O})})]})})]})}):t.jsx(Ve,{open:E,onOpenChange:Q,children:t.jsxs(Be,{className:"sm:max-w-[525px]",children:[t.jsxs(Re,{children:[t.jsx(Ue,{children:i}),t.jsx(He,{children:f})]}),t.jsx(be,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:U}),t.jsxs(Ke,{children:[t.jsx(z,{type:"button",variant:"outline",onClick:()=>Q(!1),children:"Cancel"}),t.jsx(z,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:O})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ht,{value:h.search,onChange:h.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(h.setSearch(""),i.target.blur())}}),t.jsx(pt,{sortKey:h.sortKey,sortDirection:h.sortDirection,onSort:h.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:b,onChange:i=>N(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:l,onChange:i=>j(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:d,onChange:i=>k(i||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(i=>({id:i.id,label:i.id.includes("community-registry")?"Community MCP Registry":i.title}))]}]:[]]})]}),q]}),t.jsx(xt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:y,onTabChange:i=>{const f=i;f!==y&&ne("connections_page_tab_changed",{to_tab:f}),x(f)}}),t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:F?.5:1,transition:F?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:F?"none":"auto"},children:t.jsx(cn,{listState:h,activeTab:y,typeFilter:b,statusFilter:l,registryFilter:d,enabledRegistries:_})})})]})})})]})})}function Bs(){const v=ce.c(1);let e;return v[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tt,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(rn,{})})}),v[0]=e):e=v[0],e}export{Bs as default};
|