decocms 2.175.2 → 2.175.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. package/dist/client/assets/{AlertCircle-CnfwZdxb.js → AlertCircle-Bu9DNwe-.js} +1 -1
  2. package/dist/client/assets/{AlignLeft-zj1VrWVO.js → AlignLeft-CJvAdEi-.js} +1 -1
  3. package/dist/client/assets/{ArrowDown-BnnQhLmg.js → ArrowDown-BrkOB1Av.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-C3_bzjZf.js → ArrowLeft-BLUY3Pjw.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-BuKX1RSZ.js → ArrowUp-Bl5YEbbF.js} +1 -1
  6. package/dist/client/assets/{Check-7kB05ju_.js → Check-CN56KhoF.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-DrGaevdP.js → CheckCircle-B4pYO1ZS.js} +1 -1
  8. package/dist/client/assets/{CheckDone01-CVJEgdwq.js → CheckDone01-DgXembQE.js} +1 -1
  9. package/dist/client/assets/{CheckVerified02-DmV5dzDn.js → CheckVerified02-BTUqey_K.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-DHeagNGb.js → ChevronDown-BURkaeCD.js} +1 -1
  11. package/dist/client/assets/{ChevronLeft-W2gkpjgL.js → ChevronLeft-C1fUg8Ja.js} +1 -1
  12. package/dist/client/assets/{ChevronRight-Blv21S_7.js → ChevronRight-Df5oEIdG.js} +1 -1
  13. package/dist/client/assets/{ChevronUp-J7upZD3-.js → ChevronUp-Ql_IhfwF.js} +1 -1
  14. package/dist/client/assets/{Clock-9Mm0U0Dg.js → Clock-DY1djxCP.js} +1 -1
  15. package/dist/client/assets/{Code01-DDbKsccR.js → Code01-ClhNhs6L.js} +1 -1
  16. package/dist/client/assets/{Coins01-DTz6uYyF.js → Coins01-C0DqkhBz.js} +1 -1
  17. package/dist/client/assets/{Container-Ci_1Xm4L.js → Container-De-pv4QL.js} +1 -1
  18. package/dist/client/assets/{Copy01-BexEalI-.js → Copy01-E3kqWO3T.js} +1 -1
  19. package/dist/client/assets/{Dataflow03-CKfLDuKw.js → Dataflow03-DVfc8SxS.js} +1 -1
  20. package/dist/client/assets/{DotsHorizontal-3xIvFzgk.js → DotsHorizontal-zFut2S5z.js} +1 -1
  21. package/dist/client/assets/{DotsVertical-7N_NB6wt.js → DotsVertical-ZWNLrGdE.js} +1 -1
  22. package/dist/client/assets/{Download01-D-oC1d8d.js → Download01-D_QoltgV.js} +1 -1
  23. package/dist/client/assets/{Edit01-gYPHsLoC.js → Edit01-KzFCPjcw.js} +1 -1
  24. package/dist/client/assets/{Edit05-BA2Lz_6R.js → Edit05-DFdmrfVO.js} +1 -1
  25. package/dist/client/assets/{Eye-Cn6YseXl.js → Eye-CUyEl5IU.js} +1 -1
  26. package/dist/client/assets/{EyeOff-L-SLicw9.js → EyeOff-D3iBtnD1.js} +1 -1
  27. package/dist/client/assets/{File02-Dx1Iz50W.js → File02-CqU_tyTM.js} +1 -1
  28. package/dist/client/assets/{File06-Dqc-K1-5.js → File06-B23HFdp6.js} +1 -1
  29. package/dist/client/assets/{FilterLines-DCrzLWfV.js → FilterLines-B4Jg_hkv.js} +1 -1
  30. package/dist/client/assets/{Globe01-DW2rHI0i.js → Globe01-BAfb6FiF.js} +1 -1
  31. package/dist/client/assets/{Globe02-CyGtzZ8k.js → Globe02-DAjgLqHS.js} +1 -1
  32. package/dist/client/assets/{Grid01-Dqz--q3o.js → Grid01-B7q4cvPD.js} +1 -1
  33. package/dist/client/assets/{Hash02-pqCZ_ykD.js → Hash02-BPlWtian.js} +1 -1
  34. package/dist/client/assets/{Home02-D2W6xjpZ.js → Home02-BYbFBx09.js} +1 -1
  35. package/dist/client/assets/{Image01-U7ZIAIPc.js → Image01-C62qGXSk.js} +1 -1
  36. package/dist/client/assets/{Inbox01-DpRIO4ZY.js → Inbox01-BF4_faho.js} +1 -1
  37. package/dist/client/assets/{InfoCircle-CvSmMU6H.js → InfoCircle-DhO0vGS4.js} +1 -1
  38. package/dist/client/assets/{Key01-Dq5b7fdA.js → Key01-Bfc7gsTd.js} +1 -1
  39. package/dist/client/assets/{LayersTwo01-Li6JqY2K.js → LayersTwo01-CsbV79W9.js} +1 -1
  40. package/dist/client/assets/{LayoutLeft-BAk65lFq.js → LayoutLeft-BjhMzXil.js} +1 -1
  41. package/dist/client/assets/{Link01-NJWLnzFs.js → Link01-CBvOA17k.js} +1 -1
  42. package/dist/client/assets/{LinkExternal01-B8e_Oa3I.js → LinkExternal01-v1Fp9c9j.js} +1 -1
  43. package/dist/client/assets/{List-Cc_Ri6eQ.js → List-DxiRK8pO.js} +1 -1
  44. package/dist/client/assets/{Loading01-Cbk1oNZ2.js → Loading01-CDOurw-F.js} +1 -1
  45. package/dist/client/assets/{Lock01-dP10fLup.js → Lock01-jAI5MKWg.js} +1 -1
  46. package/dist/client/assets/{Play-DqxAqUbl.js → Play-DSE8IZVS.js} +1 -1
  47. package/dist/client/assets/{Plus-CqWob4tu.js → Plus-OTc7Ql1V.js} +1 -1
  48. package/dist/client/assets/{RefreshCcw01-B6R5Js1R.js → RefreshCcw01-QnfLSKau.js} +1 -1
  49. package/dist/client/assets/{Save01-BfieBu6m.js → Save01-Df_qJsfN.js} +1 -1
  50. package/dist/client/assets/{SearchMd-DJI6OMcD.js → SearchMd-D6jy19cO.js} +1 -1
  51. package/dist/client/assets/{Settings01-BWkL3Bf9.js → Settings01-Bl2wNagM.js} +1 -1
  52. package/dist/client/assets/{Shield01-DMT1motk.js → Shield01-B145EOAd.js} +1 -1
  53. package/dist/client/assets/{Terminal-zNrinv6B.js → Terminal-D3ILbCbK.js} +1 -1
  54. package/dist/client/assets/{Tool01-CUx5BAY-.js → Tool01-BBVRBzC0.js} +1 -1
  55. package/dist/client/assets/{Trash01-C0891dQq.js → Trash01-DhGTBhjv.js} +1 -1
  56. package/dist/client/assets/{Upload01-ngHWsp64.js → Upload01-DvtQC2yf.js} +1 -1
  57. package/dist/client/assets/{Users03-FsZwQwZq.js → Users03-B2n8Cd76.js} +1 -1
  58. package/dist/client/assets/{X-CeRZ6ROs.js → X-DVxsAMCH.js} +1 -1
  59. package/dist/client/assets/{XAxis-B4Pxztvn.js → XAxis-D14vbkR0.js} +1 -1
  60. package/dist/client/assets/{XCircle-X3Ds2fko.js → XCircle-l3Ck-71_.js} +1 -1
  61. package/dist/client/assets/{XClose-BieEiV6P.js → XClose-C8g1LxXV.js} +1 -1
  62. package/dist/client/assets/{Zap-B-qa654H.js → Zap-DUVjsAS1.js} +1 -1
  63. package/dist/client/assets/{agent-connections-preview-BXeLz6mJ.js → agent-connections-preview-D0-1Au_l.js} +1 -1
  64. package/dist/client/assets/{agent-detail-2cFCKx9t.js → agent-detail-BALBko9m.js} +1 -1
  65. package/dist/client/assets/{agents-DS-16MLo.js → agents-BuGtmP_d.js} +1 -1
  66. package/dist/client/assets/{ai-providers-logos-Bb5LHAPU.js → ai-providers-logos-NSo4Ckh1.js} +1 -1
  67. package/dist/client/assets/{alert-dialog-DgTufZ_p.js → alert-dialog-DfOenbUZ.js} +1 -1
  68. package/dist/client/assets/{auth-catchall-zO2o6cw1.js → auth-catchall-BAl96W8M.js} +1 -1
  69. package/dist/client/assets/{automation-detail-CyiDphKi.js → automation-detail-D16eCAb7.js} +1 -1
  70. package/dist/client/assets/{automations-CBvKrAy1.js → automations-UpOWNkQ6.js} +1 -1
  71. package/dist/client/assets/{avatar-w6QMWHVj.js → avatar-DexhTB4g.js} +1 -1
  72. package/dist/client/assets/{badge-B-_hRtCy.js → badge-C7XTRm7k.js} +1 -1
  73. package/dist/client/assets/{binder-BEJ4wRzw.js → binder--omYMrhv.js} +1 -1
  74. package/dist/client/assets/{breadcrumb-Dk9kRV2t.js → breadcrumb-h9Dq7GJ0.js} +1 -1
  75. package/dist/client/assets/{card-BSGld6G2.js → card-Cm-keK-z.js} +1 -1
  76. package/dist/client/assets/{chart-CEfru1MQ.js → chart-BkIsuiHb.js} +1 -1
  77. package/dist/client/assets/{checkbox-COsQJsO9.js → checkbox-B92JdB3t.js} +1 -1
  78. package/dist/client/assets/{collapsible-BCGKc4Wz.js → collapsible-B5VFLcG-.js} +1 -1
  79. package/dist/client/assets/{collection-detail-BimbOEiL.js → collection-detail-BUpBhGP1.js} +1 -1
  80. package/dist/client/assets/{collection-display-button-CuyLh-NC.js → collection-display-button-CEqdF8O7.js} +1 -1
  81. package/dist/client/assets/{collection-search-aJlY7LHs.js → collection-search-CPQlTmfx.js} +1 -1
  82. package/dist/client/assets/{collection-table-wrapper-CcbJTCba.js → collection-table-wrapper-BVpN3w_L.js} +1 -1
  83. package/dist/client/assets/{collection-tabs-B2Xeppc1.js → collection-tabs-DwGvAiHF.js} +1 -1
  84. package/dist/client/assets/{command-CyHipwcz.js → command-BYr1e0yf.js} +1 -1
  85. package/dist/client/assets/{connect-3nC8bK4k.js → connect-DKqC06uo.js} +1 -1
  86. package/dist/client/assets/{connection-card-iA_b7WBI.js → connection-card-BDqdYEuX.js} +1 -1
  87. package/dist/client/assets/{connection-detail-B4CoR-IH.js → connection-detail-CHMgcK2a.js} +1 -1
  88. package/dist/client/assets/{connection-status-BddpcBJZ.js → connection-status-B854Axgl.js} +1 -1
  89. package/dist/client/assets/{connections-B-zXLcDP.js → connections-DxOgNXy0.js} +1 -1
  90. package/dist/client/assets/{constants-CDL9XClm.js → constants-BZUBXkLq.js} +1 -1
  91. package/dist/client/assets/constants-DgbSVhNJ.js +1 -0
  92. package/dist/client/assets/{context-DDV_uL9a.js → context-GHqlq7Gd.js} +1 -1
  93. package/dist/client/assets/{create-organization-dialog-CG01zre5.js → create-organization-dialog-Cum8PmLv.js} +1 -1
  94. package/dist/client/assets/{create-project-dialog-5e-piQzY.js → create-project-dialog-d10TQ9K8.js} +1 -1
  95. package/dist/client/assets/{danger-_ZcnVgTL.js → danger-qmT_QFAs.js} +1 -1
  96. package/dist/client/assets/{danger-zone-e3foS_su.js → danger-zone-daxj8FQE.js} +1 -1
  97. package/dist/client/assets/{dependencies-DUviAtSp.js → dependencies-sz-4aCSB.js} +1 -1
  98. package/dist/client/assets/{dialog-DxTRqiug.js → dialog-PlqYdiap.js} +1 -1
  99. package/dist/client/assets/{dropdown-menu-CdjuOUR6.js → dropdown-menu-V8gWmDzD.js} +1 -1
  100. package/dist/client/assets/{dynamic-plugin-layout-DszdejBu.js → dynamic-plugin-layout-PDo9TaOG.js} +1 -1
  101. package/dist/client/assets/{editable-task-title-44X_8A19.js → editable-task-title-CXa2sXGX.js} +1 -1
  102. package/dist/client/assets/{empty-state-v8jdj56V.js → empty-state-BUpyINsX.js} +1 -1
  103. package/dist/client/assets/{empty-state-Bj_isc1T.js → empty-state-CADB2xYt.js} +1 -1
  104. package/dist/client/assets/{env-vars-editor-Bs6jziXp.js → env-vars-editor-Crsr3jiO.js} +1 -1
  105. package/dist/client/assets/{extract-connection-data-Cyjq-Q5I.js → extract-connection-data-CBWW8njI.js} +1 -1
  106. package/dist/client/assets/{file-browser-4NMlO2k_.js → file-browser-Ba38jp_3.js} +2 -2
  107. package/dist/client/assets/{form-BV3tSlED.js → form-CnUcVXlu.js} +1 -1
  108. package/dist/client/assets/{general-LSfgt8-y.js → general-D78WAnZa.js} +1 -1
  109. package/dist/client/assets/{grid-view-BD9vYk3H.js → grid-view-D92iM48j.js} +1 -1
  110. package/dist/client/assets/{home-Ck605SqF.js → home-Dh3Zkl7g.js} +1 -1
  111. package/dist/client/assets/{index-L6huQtcJ.js → index-AtuNXtl1.js} +1 -1
  112. package/dist/client/assets/{index-B70G5L15.js → index-BAS3V89m.js} +1 -1
  113. package/dist/client/assets/{index-zJEaoyYS.js → index-BG9x5ELw.js} +1 -1
  114. package/dist/client/assets/{index-rWegviRE.js → index-Bs-gkatC.js} +1 -1
  115. package/dist/client/assets/{index-BE93ZIdg.js → index-CMdtjEkH.js} +1 -1
  116. package/dist/client/assets/{index-DlhaGZnK.js → index-Ce1KA469.js} +1 -1
  117. package/dist/client/assets/{index-Dg_kVhT7.js → index-D0LkSlcd.js} +1 -1
  118. package/dist/client/assets/{index-CZ7yh8sQ.js → index-DDOXVfmG.js} +1 -1
  119. package/dist/client/assets/{index-uQDoUdMq.js → index-DINW__d9.js} +1 -1
  120. package/dist/client/assets/{index-BXUNq6d7.js → index-SkQC2bL2.js} +3 -3
  121. package/dist/client/assets/{infiniteQueryObserver-DXFe0xIV.js → infiniteQueryObserver-dFlgfKVl.js} +1 -1
  122. package/dist/client/assets/{input-BFH8rk50.js → input-C4xXFdLa.js} +1 -1
  123. package/dist/client/assets/{integration-icon-D6SJHU0f.js → integration-icon-9nN5AvVn.js} +1 -1
  124. package/dist/client/assets/{label-DE7vX487.js → label-B5UIAzjB.js} +1 -1
  125. package/dist/client/assets/{layout-B_GGomJW.js → layout-C93ItuDu.js} +1 -1
  126. package/dist/client/assets/{layout-B2GnF_Vp.js → layout-DIeoK390.js} +1 -1
  127. package/dist/client/assets/{login-CgzRmuxY.js → login-Cum9TENA.js} +1 -1
  128. package/dist/client/assets/{logo-upload-Bfzj_LQV.js → logo-upload-HuBGdFvy.js} +1 -1
  129. package/dist/client/assets/{markdown-Da-6gcG9.js → markdown-C7LUMDS1.js} +1 -1
  130. package/dist/client/assets/{mcp-app-renderer-CNc9yMN5.js → mcp-app-renderer-8UT29L5G.js} +1 -1
  131. package/dist/client/assets/{mcp-server-card-s9NGsKpt.js → mcp-server-card--KsSGXj4.js} +1 -1
  132. package/dist/client/assets/{mcp-server-detail-fMXGyX4W.js → mcp-server-detail-DpFZrrxK.js} +2 -2
  133. package/dist/client/assets/{members-BvBWfv9e.js → members-Cv4ALw5c.js} +1 -1
  134. package/dist/client/assets/{monaco-editor-VspAvYbk.js → monaco-editor-CGQB1ouQ.js} +1 -1
  135. package/dist/client/assets/{monitoring-dashboard-edit-Bdujw4Ym.js → monitoring-dashboard-edit-_8LF_BxB.js} +1 -1
  136. package/dist/client/assets/{monitoring-dashboard-view-CSfkxnkl.js → monitoring-dashboard-view-CZdUWDWw.js} +1 -1
  137. package/dist/client/assets/{monitoring-B1jfqgQN.js → monitoring-jUgSe2al.js} +1 -1
  138. package/dist/client/assets/{monitoring-stats-row-Ds_uiyYJ.js → monitoring-stats-row-DOJg3snj.js} +1 -1
  139. package/dist/client/assets/{oauth-callback-BNPNdlSW.js → oauth-callback-DUHDiUnV.js} +1 -1
  140. package/dist/client/assets/{oauth-callback-ai-provider-CODmoIp9.js → oauth-callback-ai-provider-DJ-b74-1.js} +1 -1
  141. package/dist/client/assets/{org-ai-providers-CQKU4ds_.js → org-ai-providers-DUCq5EUw.js} +1 -1
  142. package/dist/client/assets/{page-BfphKBfj.js → page-DAq05p7G.js} +1 -1
  143. package/dist/client/assets/{page-Bbbh0c0Z.js → page-SgyDrWHD.js} +1 -1
  144. package/dist/client/assets/{plugin-empty-state-Cx_CuKe3.js → plugin-empty-state-CrnlpA9V.js} +1 -1
  145. package/dist/client/assets/{plugin-empty-state-BWhKyfJ8.js → plugin-empty-state-Dnds-DCV.js} +1 -1
  146. package/dist/client/assets/{plugin-header-ET8DV5kQ.js → plugin-header-C1XYEeTv.js} +1 -1
  147. package/dist/client/assets/{plugin-header-ncr8MkbN.js → plugin-header-CIduSygp.js} +1 -1
  148. package/dist/client/assets/plugins-CJcJdSWL.js +1 -0
  149. package/dist/client/assets/{popover-BcyJids_.js → popover-U_QlVu0r.js} +1 -1
  150. package/dist/client/assets/{project-app-view-BdLdOYqG.js → project-app-view-D9t5-mJm.js} +1 -1
  151. package/dist/client/assets/{project-layout-DReK69oR.js → project-layout-BL0jttJZ.js} +1 -1
  152. package/dist/client/assets/{project-plugins-CXWguN_r.js → project-plugins-By0aRQeH.js} +1 -1
  153. package/dist/client/assets/{projects-list-CZANuMq5.js → projects-list-C2BO1TYf.js} +1 -1
  154. package/dist/client/assets/{registry-layout-CqXQ571U.js → registry-layout-CNpSd9I3.js} +1 -1
  155. package/dist/client/assets/{registry-utils-CaVl1vKg.js → registry-utils-Bi8LTB_e.js} +1 -1
  156. package/dist/client/assets/{reports-layout-CQyNOFqA.js → reports-layout-DH4L5-lG.js} +1 -1
  157. package/dist/client/assets/{reset-password-Bt_v8_59.js → reset-password-BiJO11OF.js} +1 -1
  158. package/dist/client/assets/{resizable-B4X_WbHf.js → resizable-XfUJo45G.js} +1 -1
  159. package/dist/client/assets/{save-actions-Py9YKTe0.js → save-actions-AenTNPs2.js} +1 -1
  160. package/dist/client/assets/{scroll-area-R7PT492V.js → scroll-area-BvqSXnHA.js} +1 -1
  161. package/dist/client/assets/{select-B-f7jgVG.js → select-Bqr12jkn.js} +1 -1
  162. package/dist/client/assets/{select-virtual-mcp-YanYQUBn.js → select-virtual-mcp-DorfgjZR.js} +1 -1
  163. package/dist/client/assets/{sheet-7nFLkS7G.js → sheet-D7MnTm5h.js} +1 -1
  164. package/dist/client/assets/{shell-layout-Dp8xiQMR.js → shell-layout-F6dMRYN1.js} +2 -2
  165. package/dist/client/assets/{sidebar-settings-w0p27D0n.js → sidebar-settings-ZSwNsZur.js} +1 -1
  166. package/dist/client/assets/{skeleton-CK2-6UkT.js → skeleton-xiE088f2.js} +1 -1
  167. package/dist/client/assets/{spinner-B1-EIDBS.js → spinner-Bt_p6wlU.js} +1 -1
  168. package/dist/client/assets/{store-invite-DVPM6U-x.js → store-invite-BxsZ0zsl.js} +1 -1
  169. package/dist/client/assets/{switch-4UL4iV3X.js → switch-BIAgKxiJ.js} +1 -1
  170. package/dist/client/assets/{table-Bu98B5a-.js → table-c-SrSmwK.js} +1 -1
  171. package/dist/client/assets/{tabs-Cif80TZ4.js → tabs-CytiJeE2.js} +1 -1
  172. package/dist/client/assets/{task-status-BWKjAgiX.js → task-status-9RY3Ya8o.js} +1 -1
  173. package/dist/client/assets/tasks-C43Ik9tC.js +1 -0
  174. package/dist/client/assets/{tasks-panel-D6Bb-wiS.js → tasks-panel-CftcenZ4.js} +1 -1
  175. package/dist/client/assets/{textarea-DPLd5P1K.js → textarea-Buug1Hxe.js} +1 -1
  176. package/dist/client/assets/{time-range-picker-FJd_w9AH.js → time-range-picker-BlD0TDtN.js} +1 -1
  177. package/dist/client/assets/{toggle-group-B4QQy8X1.js → toggle-group-abCGptw4.js} +1 -1
  178. package/dist/client/assets/{tools-list-BgmW-tI4.js → tools-list-BdA1jEJI.js} +1 -1
  179. package/dist/client/assets/{tooltip-BGPUMzDS.js → tooltip-Ckpai_jH.js} +1 -1
  180. package/dist/client/assets/{topbar-portal-CLOTo-7w.js → topbar-portal-B-Tb-3gt.js} +1 -1
  181. package/dist/client/assets/{types-DZ5M-eMJ.js → types-CUEMI47Y.js} +1 -1
  182. package/dist/client/assets/{use-automations-D7j59hRT.js → use-automations-Cw8FAF0H.js} +1 -1
  183. package/dist/client/assets/{use-binding-CZ8osTa1.js → use-binding-f1akiPTf.js} +1 -1
  184. package/dist/client/assets/{use-collections-yY78nnLx.js → use-collections-C3CSj681.js} +1 -1
  185. package/dist/client/assets/{use-connection-lXrlfojY.js → use-connection-DSkVzqSP.js} +1 -1
  186. package/dist/client/assets/{use-copy-DZJI58oZ.js → use-copy-F9tiQWTi.js} +1 -1
  187. package/dist/client/assets/{use-create-virtual-mcp-DK_WDS9Y.js → use-create-virtual-mcp-C5n2ShE6.js} +1 -1
  188. package/dist/client/assets/{use-infinite-scroll-C-TK62Eo.js → use-infinite-scroll-C1Dhvj0C.js} +1 -1
  189. package/dist/client/assets/{use-install-from-registry-C24f0cqa.js → use-install-from-registry-BQfcs7M8.js} +1 -1
  190. package/dist/client/assets/{use-list-state-D6LU1koz.js → use-list-state-Djxe5eyh.js} +1 -1
  191. package/dist/client/assets/{use-mcp-prompts-DT9l3i02.js → use-mcp-prompts-D5tu2gbi.js} +1 -1
  192. package/dist/client/assets/{use-mcp-resources-DhBJVSsg.js → use-mcp-resources-D0eHe68n.js} +1 -1
  193. package/dist/client/assets/{use-mcp-tools-CwVNqTmj.js → use-mcp-tools-DTZxAm-y.js} +1 -1
  194. package/dist/client/assets/{use-members-fpZqw1dy.js → use-members-DdPysVve.js} +1 -1
  195. package/dist/client/assets/{use-mobile-B0lEbMk3.js → use-mobile-DqlomLIB.js} +1 -1
  196. package/dist/client/assets/{use-project-BnRSDoVD.js → use-project-Cdk7AuZE.js} +1 -1
  197. package/dist/client/assets/{use-store-discovery-C9fJhQ4Y.js → use-store-discovery-C_al4z4H.js} +1 -1
  198. package/dist/client/assets/{use-view-mode-0w9n1sJ-.js → use-view-mode-Ag3VBJ77.js} +1 -1
  199. package/dist/client/assets/{use-virtual-mcp-CyoGC0aH.js → use-virtual-mcp-V0XoWMM_.js} +1 -1
  200. package/dist/client/assets/useInfiniteQuery-BXEdoCXW.js +1 -0
  201. package/dist/client/assets/{useMutation-CkdHuTyE.js → useMutation-CXgAMvoC.js} +1 -1
  202. package/dist/client/assets/useQuery-CtOvMPbo.js +1 -0
  203. package/dist/client/assets/useSuspenseInfiniteQuery-Ds_6ilsi.js +1 -0
  204. package/dist/client/assets/{user-sbKkVV9F.js → user-C2BDT4Rq.js} +1 -1
  205. package/dist/client/assets/{workflow-CpP3zoVI.js → workflow-Bp2ajWVc.js} +1 -1
  206. package/dist/client/index.html +1 -1
  207. package/dist/server/cli.js +243 -243
  208. package/dist/server/node_modules/pg-int8/LICENSE +13 -0
  209. package/dist/server/node_modules/pg-int8/README.md +16 -0
  210. package/dist/server/node_modules/pg-int8/index.js +100 -0
  211. package/dist/server/node_modules/pg-int8/package.json +24 -0
  212. package/dist/server/node_modules/postgres-array/index.d.ts +4 -0
  213. package/dist/server/node_modules/postgres-array/index.js +97 -0
  214. package/dist/server/node_modules/{xtend/LICENSE → postgres-array/license} +2 -1
  215. package/dist/server/node_modules/postgres-array/package.json +35 -0
  216. package/dist/server/node_modules/postgres-array/readme.md +43 -0
  217. package/dist/server/node_modules/postgres-bytea/index.js +33 -0
  218. package/dist/server/node_modules/{pg/LICENSE → postgres-bytea/license} +6 -6
  219. package/dist/server/node_modules/postgres-bytea/package.json +34 -0
  220. package/dist/server/node_modules/postgres-bytea/readme.md +34 -0
  221. package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
  222. package/dist/server/node_modules/postgres-interval/index.js +125 -0
  223. package/dist/server/node_modules/postgres-interval/license +21 -0
  224. package/dist/server/node_modules/postgres-interval/package.json +36 -0
  225. package/dist/server/node_modules/postgres-interval/readme.md +48 -0
  226. package/dist/server/server.js +217 -217
  227. package/package.json +1 -1
  228. package/dist/client/assets/constants-DxY-8FrK.js +0 -1
  229. package/dist/client/assets/plugins-BdyM0ZUw.js +0 -1
  230. package/dist/client/assets/tasks-tenjlvFT.js +0 -1
  231. package/dist/client/assets/useInfiniteQuery-BlrmUHYA.js +0 -1
  232. package/dist/client/assets/useQuery-Bmc4jnG2.js +0 -1
  233. package/dist/client/assets/useSuspenseInfiniteQuery-DD4jjrsx.js +0 -1
  234. package/dist/server/node_modules/pg/README.md +0 -95
  235. package/dist/server/node_modules/pg/esm/index.mjs +0 -20
  236. package/dist/server/node_modules/pg/lib/client.js +0 -743
  237. package/dist/server/node_modules/pg/lib/connection-parameters.js +0 -171
  238. package/dist/server/node_modules/pg/lib/connection.js +0 -221
  239. package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +0 -122
  240. package/dist/server/node_modules/pg/lib/crypto/sasl.js +0 -212
  241. package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +0 -43
  242. package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +0 -89
  243. package/dist/server/node_modules/pg/lib/crypto/utils.js +0 -9
  244. package/dist/server/node_modules/pg/lib/defaults.js +0 -91
  245. package/dist/server/node_modules/pg/lib/index.js +0 -73
  246. package/dist/server/node_modules/pg/lib/native/client.js +0 -323
  247. package/dist/server/node_modules/pg/lib/native/index.js +0 -2
  248. package/dist/server/node_modules/pg/lib/native/query.js +0 -165
  249. package/dist/server/node_modules/pg/lib/query.js +0 -252
  250. package/dist/server/node_modules/pg/lib/result.js +0 -109
  251. package/dist/server/node_modules/pg/lib/stream.js +0 -83
  252. package/dist/server/node_modules/pg/lib/type-overrides.js +0 -35
  253. package/dist/server/node_modules/pg/lib/utils.js +0 -217
  254. package/dist/server/node_modules/pg/package.json +0 -76
  255. package/dist/server/node_modules/xtend/.jshintrc +0 -30
  256. package/dist/server/node_modules/xtend/README.md +0 -32
  257. package/dist/server/node_modules/xtend/immutable.js +0 -19
  258. package/dist/server/node_modules/xtend/mutable.js +0 -17
  259. package/dist/server/node_modules/xtend/package.json +0 -55
  260. package/dist/server/node_modules/xtend/test.js +0 -103
@@ -1 +1 @@
1
- import{r as Z,c as P,u as Be,j as t,y as gt,v as jt,K as Qe,O as ke,J as lt,e as He,B as Ie,c4 as Ze,at as vt,p as bt,E as Nt,g as yt,x as _t,q as Ct,t as St,b as wt,a as kt,w as Te}from"./index-BXUNq6d7.js";import{E as at}from"./empty-state-v8jdj56V.js";import{E as Tt,c as It,r as At,e as ct}from"./env-vars-editor-Bs6jziXp.js";import{a as Dt}from"./use-binding-CZ8osTa1.js";import{n as $t,u as Ot,S as Pt}from"./index-zJEaoyYS.js";import{u as Et,a as dt}from"./use-connection-lXrlfojY.js";import{u as qe,a as Mt}from"./constants-CDL9XClm.js";import{d as Vt}from"./use-mcp-tools-CwVNqTmj.js";import{b as Ut}from"./use-mcp-resources-DhBJVSsg.js";import{a as Lt}from"./use-mcp-prompts-DT9l3i02.js";import{b as et,c as Rt,d as Ft,e as zt,B as Bt,a as Ht}from"./breadcrumb-Dk9kRV2t.js";import{b as Wt,d as Xt,c as Gt,A as Kt,e as Qt,h as qt,a as Jt,f as Yt}from"./alert-dialog-DgTufZ_p.js";import{S as Zt,a as es,b as ts,c as ss,d as ns}from"./sheet-7nFLkS7G.js";import{F as W,b as X,c as q,d as L,f as J,e as os,a as rs}from"./form-BV3tSlED.js";import{I as Y}from"./input-BFH8rk50.js";import{i as is}from"./Loading01-Cbk1oNZ2.js";import{a as ls}from"./layout-B2GnF_Vp.js";import{c as as,B as cs,a as ds,C as ms}from"./monitoring-stats-row-Ds_uiyYJ.js";import{C as us,a as xs,b as fs}from"./chart-CEfru1MQ.js";import{b as ps}from"./use-virtual-mcp-CyoGC0aH.js";import{i as mt}from"./ChevronRight-Blv21S_7.js";import{t as ut}from"./Users03-FsZwQwZq.js";import{I as xt}from"./integration-icon-D6SJHU0f.js";import{c as hs,T as Re,a as gs,b as Fe}from"./tabs-Cif80TZ4.js";import{a as js}from"./Tool01-CUx5BAY-.js";import{g as Je}from"./types-DZ5M-eMJ.js";import{M as vs}from"./mcp-app-renderer-CNc9yMN5.js";import{C as bs}from"./collection-search-aJlY7LHs.js";import{T as Ns}from"./tools-list-BgmW-tI4.js";import{C as ys}from"./card-BSGld6G2.js";import{t as _s}from"./Settings01-BWkL3Bf9.js";import{U as Cs}from"./user-sbKkVV9F.js";import{f as Ss}from"./format-time-CMKyl-GC.js";import{B as ws}from"./badge-B-_hRtCy.js";import{D as ks,a as Ts,b as Is,c as tt}from"./dropdown-menu-CdjuOUR6.js";import{S as st,a as nt,b as ot,c as rt,d as H}from"./select-B-f7jgVG.js";import{i as As}from"./CheckCircle-DrGaevdP.js";import{t as Ds}from"./ChevronDown-DHeagNGb.js";import{n as $s}from"./Container-Ci_1Xm4L.js";import{s as ze}from"./Globe02-CyGtzZ8k.js";import{s as Os}from"./RefreshCcw01-B6R5Js1R.js";import{i as Ps}from"./Terminal-zNrinv6B.js";import{s as Es}from"./Trash01-C0891dQq.js";import{s as Ms}from"./XClose-BieEiV6P.js";import"./Plus-CqWob4tu.js";import"./binder-BEJ4wRzw.js";import"./File06-Dqc-K1-5.js";import"./Key01-Dq5b7fdA.js";import"./constants-DxY-8FrK.js";import"./registry-utils-CaVl1vKg.js";import"./extract-connection-data-Cyjq-Q5I.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-C24f0cqa.js";import"./index-BE93ZIdg.js";import"./index-CZ7yh8sQ.js";import"./ChevronUp-J7upZD3-.js";import"./index-DlhaGZnK.js";import"./select-virtual-mcp-YanYQUBn.js";import"./popover-BcyJids_.js";import"./tooltip-BGPUMzDS.js";import"./index-L6huQtcJ.js";import"./Check-7kB05ju_.js";import"./SearchMd-DJI6OMcD.js";import"./use-create-virtual-mcp-DK_WDS9Y.js";import"./use-collections-yY78nnLx.js";import"./useMutation-CkdHuTyE.js";import"./useQuery-Bmc4jnG2.js";import"./X-CeRZ6ROs.js";import"./label-DE7vX487.js";import"./index-rWegviRE.js";import"./collection-display-button-CuyLh-NC.js";import"./ArrowDown-BnnQhLmg.js";import"./ArrowUp-BuKX1RSZ.js";import"./Grid01-Dqz--q3o.js";import"./List-Cc_Ri6eQ.js";import"./collection-table-wrapper-CcbJTCba.js";import"./table-Bu98B5a-.js";import"./Eye-Cn6YseXl.js";import"./LayersTwo01-Li6JqY2K.js";import"./avatar-w6QMWHVj.js";import"./differenceInSeconds-NQ4PDo0z.js";const ft=({size:s=24,color:e="currentColor",...n})=>Z.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Z.createElement("path",{d:"m12 21-.1-.15c-.695-1.042-1.042-1.563-1.5-1.94a4 4 0 0 0-1.378-.737C8.453 18 7.827 18 6.575 18H5.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C2 16.48 2 15.92 2 14.8V6.2c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C3.52 3 4.08 3 5.2 3h.4c2.24 0 3.36 0 4.216.436a4 4 0 0 1 1.748 1.748C12 6.04 12 7.16 12 9.4M12 21V9.4M12 21l.1-.15c.695-1.042 1.042-1.563 1.5-1.94a3.999 3.999 0 0 1 1.378-.737C15.547 18 16.173 18 17.425 18H18.8c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 16.48 22 15.92 22 14.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 3 19.92 3 18.8 3h-.4c-2.24 0-3.36 0-4.216.436a4 4 0 0 0-1.748 1.748C12 6.04 12 7.16 12 9.4"}));ft.displayName="BookOpen01";const Vs=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Us(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Ls={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Rs(s){const e=P.c(3),{connectionId:n,orgId:r,timeframe:i}=s;let o;e[0]!==r?(o={connectionId:Mt,orgId:r},e[0]=r,e[1]=o):o=e[1];const c=qe(o),a=Us(i),{data:m}=jt({queryKey:Qe.connectionActivity(n,i,r),queryFn:async()=>{const x=await c.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return x.structuredContent??x},staleTime:3e5}),d=as(m?.logs??[],a),u=d.data,f=d.totalCalls>0;let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[2]=l):l=e[2],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:d.totalCalls.toLocaleString()}),l]}),d.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:d.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),d.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(d.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),f?t.jsxs("div",{children:[t.jsx(us,{config:Ls,className:"h-16 w-full",children:t.jsxs(cs,{data:u,barCategoryGap:"4%",children:[t.jsx(xs,{content:t.jsx(fs,{labelFormatter:zs}),cursor:{fill:"var(--muted)"}}),t.jsx(ds,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(Fs)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Fs(s,e){return t.jsx(ms,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function zs(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function Bs(){const s=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 Hs(s){const e=P.c(13),{connectionId:n}=s,[r,i]=Z.useState("14d"),{org:o}=Be();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=c):c=e[0];let a;e[1]!==r?(a=Vs.map(l=>t.jsx("button",{type:"button",onClick:()=>i(l.value),className:gt("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",r===l.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:l.label},l.value)),e[1]=r,e[2]=a):a=e[2];let m;e[3]!==a?(m=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[c,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:a})]}),e[3]=a,e[4]=m):m=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Bs,{}),e[5]=d):d=e[5];let u;e[6]!==n||e[7]!==o.id||e[8]!==r?(u=t.jsx(Z.Suspense,{fallback:d,children:t.jsx(Rs,{connectionId:n,orgId:o.id,timeframe:r})}),e[6]=n,e[7]=o.id,e[8]=r,e[9]=u):u=e[9];let f;return e[10]!==m||e[11]!==u?(f=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,u]}),e[10]=m,e[11]=u,e[12]=f):f=e[12],f}function Ws(s){const e=P.c(14),{virtualMcp:n,org:r}=s;let i;e[0]!==r||e[1]!==n.id?(i={org:r,project:ke,agentId:n.id},e[0]=r,e[1]=n.id,e[2]=i):i=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(ut,{size:16}),e[3]=o):o=e[3];let c;e[4]!==n.icon||e[5]!==n.title?(c=t.jsx(xt,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:o}),e[4]=n.icon,e[5]=n.title,e[6]=c):c=e[6];let a;e[7]!==n.title?(a=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=a):a=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(mt,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=m):m=e[9];let d;return e[10]!==i||e[11]!==c||e[12]!==a?(d=t.jsxs(lt,{to:"/$org/$project/agents/$agentId/",params:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group",children:[c,a,m]}),e[10]=i,e[11]=c,e[12]=a,e[13]=d):d=e[13],d}function Xs(s){const e=P.c(7),{virtualMcps:n,org:r}=s;let i;if(e[0]!==r||e[1]!==n){let c;e[3]!==r?(c=a=>t.jsx(Ws,{virtualMcp:a,org:r},a.id),e[3]=r,e[4]=c):c=e[4],i=n.map(c),e[0]=r,e[1]=n,e[2]=i}else i=e[2];let o;return e[5]!==i?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:i})}),e[5]=i,e[6]=o):o=e[6],o}function Gs(s){const e=P.c(7),{connection:n}=s,{org:r}=Be();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const o=ps(i);if(!(o.length>0)){let d;return e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(t.Fragment,{}),e[2]=d):d=e[2],d}let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=a):a=e[3];let m;return e[4]!==r.slug||e[5]!==o?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[a,t.jsx("div",{className:"px-5 py-4",children:t.jsx(Xs,{virtualMcps:o,org:r.slug})})]}),e[4]=r.slug,e[5]=o,e[6]=m):m=e[6],m}function Ks(s){const e=P.c(27),{tools:n,connectionId:r,org:i}=s,o=He(),{org:c}=Be();let a;e[0]!==r||e[1]!==c.id?(a={connectionId:r,orgId:c.id},e[0]=r,e[1]=c.id,e[2]=a):a=e[2];const m=qe(a),[d,u]=Z.useState("");let f,l,x,g;if(e[3]!==m||e[4]!==r||e[5]!==o||e[6]!==i||e[7]!==d||e[8]!==n){const T=(n??[]).filter(Qs),y=d.toLowerCase().trim(),j=y?T.filter(h=>h.name.toLowerCase().includes(y)||h.description&&h.description.toLowerCase().includes(y)):T;let S;e[13]!==r||e[14]!==o||e[15]!==i?(S=h=>{o({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:ke,connectionId:r,collectionName:"tools",itemId:encodeURIComponent(h.name)}})},e[13]=r,e[14]=o,e[15]=i,e[16]=S):S=e[16];const I=S;x="flex flex-col h-full overflow-hidden";let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=h=>{h.key==="Escape"&&(u(""),h.target.blur())},e[17]=b):b=e[17],e[18]!==d?(g=t.jsx(bs,{value:d,onChange:u,placeholder:"Search apps...",onKeyDown:b}),e[18]=d,e[19]=g):g=e[19],f="flex-1 overflow-auto p-5",l=j.length===0?t.jsx(at,{image:null,title:d?"No apps found":"No apps available",description:d?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:j.map(h=>{const A=Je(h._meta);return t.jsxs(ys,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>I(h),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(vs,{resourceURI:A,toolInfo:{tool:h},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),t.jsx(Ns,{annotations:h.annotations,_meta:h._meta})]}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]})]},h.name)})}),e[3]=m,e[4]=r,e[5]=o,e[6]=i,e[7]=d,e[8]=n,e[9]=f,e[10]=l,e[11]=x,e[12]=g}else f=e[9],l=e[10],x=e[11],g=e[12];let N;e[20]!==f||e[21]!==l?(N=t.jsx("div",{className:f,children:l}),e[20]=f,e[21]=l,e[22]=N):N=e[22];let v;return e[23]!==x||e[24]!==g||e[25]!==N?(v=t.jsxs("div",{className:x,children:[g,N]}),e[23]=x,e[24]=g,e[25]=N,e[26]=v):v=e[26],v}function Qs(s){return!!Je(s._meta)}function pt(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=c=>c.charAt(0).toUpperCase()+c.slice(1),r=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),i=e.map(n),o=e[e.length-1];return i.length>=2&&o&&r.has(o)?[i.pop(),...i].join(" "):i.join(" ")}function Ke(s){const e=P.c(2),{label:n}=s;let r;return e[0]!==n?(r=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]=r):r=e[1],r}function qs(s){const e=P.c(71),{tools:n,prompts:r,resources:i,connectionId:o,org:c}=s;let a;e[0]!==r?(a=r===void 0?[]:r,e[0]=r,e[1]=a):a=e[1];const m=a;let d;e[2]!==i?(d=i===void 0?[]:i,e[2]=i,e[3]=d):d=e[3];const u=d,f=He();let l;e[4]!==o||e[5]!==f||e[6]!==c?(l=function(V){!o||!c||f({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:c,project:ke,connectionId:o,collectionName:"tools",itemId:encodeURIComponent(V)}})},e[4]=o,e[5]=f,e[6]=c,e[7]=l):l=e[7];const x=l;let g,N,v,T,y,j,S,I,b,h,A,_;if(e[8]!==o||e[9]!==x||e[10]!==c||e[11]!==m.length||e[12]!==u.length||e[13]!==n){I=Symbol.for("react.early_return_sentinel");e:{const F=n.filter(en);let V;if(e[26]!==o||e[27]!==c||e[28]!==n?(V=o&&c&&n.some(Zs),e[26]=o,e[27]=c,e[28]=n,e[29]=V):V=e[29],v=V,n.length+m.length+u.length===0){let k;e[30]===Symbol.for("react.memo_cache_sentinel")?(k=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[30]=k):k=e[30],I=k;break e}S="rounded-xl border border-border bg-card overflow-hidden",N=hs,T="tools",y="underline";let K;e[31]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx(Re,{value:"tools",variant:"underline",children:"Tools"}),e[31]=K):K=e[31];let z;e[32]!==v?(z=v&&t.jsx(Re,{value:"apps",variant:"underline",children:"UI"}),e[32]=v,e[33]=z):z=e[33];let U,Q;e[34]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Re,{value:"prompts",variant:"underline",children:"Prompts"}),Q=t.jsx(Re,{value:"resources",variant:"underline",children:"Resources"}),e[34]=U,e[35]=Q):(U=e[34],Q=e[35]),e[36]!==z?(j=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(gs,{variant:"underline",className:"gap-1",children:[K,z,U,Q]})}),e[36]=z,e[37]=j):j=e[37],g=Fe,A="tools",_="h-auto",b="divide-y divide-border",h=F.length>0?F.map(k=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>x(k.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(js,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:pt(k.name)}),k.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:k.description})]}),t.jsx(mt,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},k.name)):t.jsx(Ke,{label:"tools"})}e[8]=o,e[9]=x,e[10]=c,e[11]=m.length,e[12]=u.length,e[13]=n,e[14]=g,e[15]=N,e[16]=v,e[17]=T,e[18]=y,e[19]=j,e[20]=S,e[21]=I,e[22]=b,e[23]=h,e[24]=A,e[25]=_}else g=e[14],N=e[15],v=e[16],T=e[17],y=e[18],j=e[19],S=e[20],I=e[21],b=e[22],h=e[23],A=e[24],_=e[25];if(I!==Symbol.for("react.early_return_sentinel"))return I;let C;e[38]!==b||e[39]!==h?(C=t.jsx("div",{className:b,children:h}),e[38]=b,e[39]=h,e[40]=C):C=e[40];let $;e[41]!==g||e[42]!==C||e[43]!==A||e[44]!==_?($=t.jsx(g,{value:A,className:_,children:C}),e[41]=g,e[42]=C,e[43]=A,e[44]=_,e[45]=$):$=e[45];let p;e[46]!==o||e[47]!==v||e[48]!==c||e[49]!==n?(p=v&&t.jsx(Fe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(Ks,{tools:n,connectionId:o,org:c})}),e[46]=o,e[47]=v,e[48]=c,e[49]=n,e[50]=p):p=e[50];let O;e[51]!==m?(O=m.length>0?m.map(Ys):t.jsx(Ke,{label:"prompts"}),e[51]=m,e[52]=O):O=e[52];let D;e[53]!==O?(D=t.jsx(Fe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:O})}),e[53]=O,e[54]=D):D=e[54];let w;e[55]!==u?(w=u.length>0?u.map(Js):t.jsx(Ke,{label:"resources"}),e[55]=u,e[56]=w):w=e[56];let M;e[57]!==w?(M=t.jsx(Fe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:w})}),e[57]=w,e[58]=M):M=e[58];let R;e[59]!==N||e[60]!==T||e[61]!==y||e[62]!==j||e[63]!==$||e[64]!==p||e[65]!==D||e[66]!==M?(R=t.jsxs(N,{defaultValue:T,variant:y,children:[j,$,p,D,M]}),e[59]=N,e[60]=T,e[61]=y,e[62]=j,e[63]=$,e[64]=p,e[65]=D,e[66]=M,e[67]=R):R=e[67];let G;return e[68]!==S||e[69]!==R?(G=t.jsx("div",{className:S,children:R}),e[68]=S,e[69]=R,e[70]=G):G=e[70],G}function Js(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx($t,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function Ys(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(ft,{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:pt(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function Zs(s){return Je(s._meta)}function en(s){return!/^COLLECTION_/i.test(s.name)}function tn(s){const e=P.c(22),{connection:n,onOpenSettings:r,onDisconnect:i}=s;let o;e[0]!==n.icon||e[1]!==n.title?(o=t.jsx(xt,{icon:n.icon,name:n.title,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=o):o=e[2];let c;e[3]!==n.title?(c=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none",children:n.title})}),e[3]=n.title,e[4]=c):c=e[4];let a;e[5]!==n.description?(a=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:n.description}),e[5]=n.description,e[6]=a):a=e[6];let m;e[7]!==c||e[8]!==a?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,a]}),e[7]=c,e[8]=a,e[9]=m):m=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(_s,{size:15}),e[10]=d):d=e[10];let u;e[11]!==r?(u=t.jsx(Ie,{variant:"ghost",size:"icon",onClick:r,title:"Configure connection",className:"h-8 w-8 text-muted-foreground hover:text-foreground",children:d}),e[11]=r,e[12]=u):u=e[12];let f;e[13]!==i?(f=t.jsx(Ie,{variant:"outline",size:"sm",onClick:i,className:"text-destructive border-destructive/25 hover:bg-destructive/5 hover:text-destructive hover:border-destructive/40",children:"Disconnect"}),e[13]=i,e[14]=f):f=e[14];let l;e[15]!==u||e[16]!==f?(l=t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u,f]}),e[15]=u,e[16]=f,e[17]=l):l=e[17];let x;return e[18]!==o||e[19]!==m||e[20]!==l?(x=t.jsxs("div",{className:"flex items-center gap-6 py-7 px-8 bg-background border-b border-border shrink-0",children:[o,m,l]}),e[18]=o,e[19]=m,e[20]=l,e[21]=x):x=e[21],x}function sn(s){const e=P.c(21),{connection:n,onOpenSettings:r}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Connection"}),e[0]=i):i=e[0];let o;e[1]!==r?(o=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[i,t.jsx("button",{type:"button",onClick:r,className:"text-xs text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors cursor-pointer",children:"Configure"})]}),e[1]=r,e[2]=o):o=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("span",{className:"text-xs text-muted-foreground",children:"Added by"}),e[3]=c):c=e[3];let a;e[4]!==n.created_by?(a=t.jsxs("div",{className:"flex items-center justify-between",children:[c,t.jsx(Cs,{id:n.created_by,size:"2xs"})]}),e[4]=n.created_by,e[5]=a):a=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("span",{className:"text-xs text-muted-foreground",children:"Updated"}),e[6]=m):m=e[6];let d;e[7]!==n.updated_at?(d=n.updated_at?Ss(new Date(n.updated_at)):"—",e[7]=n.updated_at,e[8]=d):d=e[8];let u;e[9]!==d?(u=t.jsxs("div",{className:"flex items-center justify-between",children:[m,t.jsx("span",{className:"text-xs text-foreground",children:d})]}),e[9]=d,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("span",{className:"text-xs text-muted-foreground",children:"Protocol"}),e[11]=f):f=e[11];let l;e[12]!==n.connection_type?(l=t.jsxs("div",{className:"flex items-center justify-between",children:[f,t.jsx("span",{className:"text-xs font-mono text-foreground",children:n.connection_type})]}),e[12]=n.connection_type,e[13]=l):l=e[13];let x;e[14]!==a||e[15]!==u||e[16]!==l?(x=t.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[a,u,l]}),e[14]=a,e[15]=u,e[16]=l,e[17]=x):x=e[17];let g;return e[18]!==x||e[19]!==o?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[o,x]}),e[18]=x,e[19]=o,e[20]=g):g=e[20],g}function nn({form:s,connection:e,hasOAuthToken:n,onReauthenticate:r,onRemoveOAuth:i}){const o=Ze({control:s.control,name:"ui_type"}),c=Ze({control:s.control,name:"connection_url"}),{stdioEnabled:a}=vt(),m=(()=>{if(typeof c!="string"||!c)return!1;try{const l=new URL(c);return l.hostname==="api.githubcopilot.com"&&l.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),d=a||e.connection_type==="STDIO",u=e.connection_type==="VIRTUAL",f=u?bt(e.connection_url):null;return u?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(ut,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),f&&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:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(W,{control:s.control,name:"ui_type",render:({field:l})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{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(st,{value:l.value,onValueChange:l.onChange,children:[t.jsx(L,{children:t.jsxs(nt,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ze,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(ot,{})]})}),t.jsxs(rt,{children:[t.jsx(H,{value:"HTTP",children:"HTTP"}),t.jsx(H,{value:"SSE",children:"SSE"}),t.jsx(H,{value:"Websocket",children:"Websocket"}),d&&t.jsxs(t.Fragment,{children:[t.jsx(H,{value:"NPX",children:"NPX Package"}),t.jsx(H,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(W,{control:s.control,name:"connection_url",render:({field:x})=>t.jsx(X,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(Y,{placeholder:"https://example.com/mcp",...x,value:x.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(st,{value:l.value,onValueChange:l.onChange,children:[t.jsx(L,{children:t.jsx(nt,{className:"h-10",children:t.jsx(ot,{})})}),t.jsxs(rt,{children:[t.jsx(H,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ze,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(H,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ze,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(H,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ze,{className:"w-4 h-4"}),"Websocket"]})}),d&&t.jsxs(t.Fragment,{children:[t.jsx(H,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx($s,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(H,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ps,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(J,{})]})}),o==="NPX"&&t.jsx(W,{control:s.control,name:"npx_package",render:({field:l})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(L,{children:t.jsx(Y,{placeholder:"@perplexity-ai/mcp-server",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(J,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(W,{control:s.control,name:"stdio_command",render:({field:l})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(L,{children:t.jsx(Y,{placeholder:"node, bun, python...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(J,{})]})}),t.jsx(W,{control:s.control,name:"stdio_args",render:({field:l})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(L,{children:t.jsx(Y,{placeholder:"arg1 arg2 --flag value",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(J,{})]})})]}),t.jsx(W,{control:s.control,name:"stdio_cwd",render:({field:l})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(L,{children:t.jsx(Y,{placeholder:"/path/to/project (optional)",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(J,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(W,{control:s.control,name:"env_vars",render:({field:l})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(L,{children:t.jsx(Tt,{value:l.value??[],onChange:l.onChange})}),t.jsx(J,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(W,{control:s.control,name:"connection_token",render:({field:l})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{className:"text-xs text-muted-foreground font-medium",children:m?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(ks,{children:[t.jsx(Ts,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(ws,{variant:"success",className:"gap-1.5",children:[t.jsx(As,{size:12}),"Authenticated via OAuth",t.jsx(Ds,{size:12})]})})}),t.jsxs(Is,{align:"start",children:[t.jsxs(tt,{onClick:r,children:[t.jsx(Os,{size:16}),"Re-authenticate"]}),t.jsxs(tt,{variant:"destructive",onClick:i,children:[t.jsx(Es,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&l.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>l.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Ms,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(Y,{type:"password",placeholder:m?"Paste your GitHub PAT":"Enter access token...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(os,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(J,{})]})})]})}function on(s){return s.command==="npx"}function rn(s){return s.args?.find(e=>!e.startsWith("-"))??""}function ln(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function an(s,e){const n={command:"npx",args:["-y",s]},r=ct(e);return Object.keys(r).length>0&&(n.envVars=r),n}function cn(s,e,n,r){const i={command:s};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const o=ct(r);return Object.keys(o).length>0&&(i.envVars=o),i}function it(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&wt(s.connection_headers)){const r=s.connection_headers,i=At(r.envVars);if(on(r)){const c=rn(r);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i}}const o=ln(r);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:i}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function dn(s){let e,n=null,r=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=an(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=cn(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",r=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...r&&{connection_token:r},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function mn(s){const e=P.c(129),{connection:n,connectionId:r,org:i,onUpdate:o,isUpdating:c,tools:a,prompts:m,resources:d}=s;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={from:"/$org/$project/mcps/$connectionId"},e[0]=u):u=e[0];const f=He(u),l=_t(),x=dt(),[g,N]=Z.useState(!1),[v,T]=Z.useState(!1);let y;e[1]!==r?(y={connectionId:r},e[1]=r,e[2]=y):y=e[2];const j=Ot(y),I=n?.connection_type==="VIRTUAL"||j.isAuthenticated;let b;e[3]!==n?(b={connections:[n],binding:"MCP"},e[3]=n,e[4]=b):b=e[4];const A=Dt(b).length>0;let _;e[5]===Symbol.for("react.memo_cache_sentinel")?(_=Ct(It),e[5]=_):_=e[5];let C;e[6]!==n?(C=it(n),e[6]=n,e[7]=C):C=e[7];let $;e[8]!==C?($={resolver:_,values:C},e[8]=C,e[9]=$):$=e[9];const p=St($),O=p.formState.isDirty;let D;e[10]!==p||e[11]!==o?(D=async()=>{if(!await p.trigger())return;const E=p.getValues(),we=dn(E);await o(we),p.reset(E)},e[10]=p,e[11]=o,e[12]=D):D=e[12];const w=D;let M;e[13]!==n||e[14]!==p?(M=()=>{p.reset(it(n))},e[13]=n,e[14]=p,e[15]=M):M=e[15];const R=M;let G;e[16]!==n.id||e[17]!==x.update||e[18]!==l?(G=async()=>{const{token:B,tokenInfo:E,error:we}=await kt({connectionId:n.id});if(we||!B){Te.error(`Authentication failed: ${we}`);return}if(E)try{const Le=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:E.accessToken,refreshToken:E.refreshToken,expiresIn:E.expiresIn,scope:E.scope,clientId:E.clientId,clientSecret:E.clientSecret,tokenEndpoint:E.tokenEndpoint})});if(!Le.ok)console.error("Failed to save OAuth token:",await Le.text()),await x.update.mutateAsync({id:n.id,data:{connection_token:B}});else try{await x.update.mutateAsync({id:n.id,data:{}})}catch(Ye){console.warn("Failed to refresh connection tools after OAuth:",Ye)}}catch(Le){console.error("Error saving OAuth token:",Le),await x.update.mutateAsync({id:n.id,data:{connection_token:B}})}else await x.update.mutateAsync({id:n.id,data:{connection_token:B}});const ht=new URL(`/mcp/${n.id}`,window.location.origin);await l.invalidateQueries({queryKey:Qe.isMCPAuthenticated(ht.href,null)}),Te.success("Authentication successful")},e[16]=n.id,e[17]=x.update,e[18]=l,e[19]=G):G=e[19];const F=G;let V;e[20]!==n.id||e[21]!==l?(V=async()=>{try{const B=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!B.ok){const we=await B.text();Te.error(`Failed to remove OAuth: ${we}`);return}const E=new URL(`/mcp/${n.id}`,window.location.origin);await l.invalidateQueries({queryKey:Qe.isMCPAuthenticated(E.href,null)}),Te.success("OAuth removed. You can now re-authenticate with a different account.")}catch(B){console.error("Error removing OAuth token:",B),Te.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=l,e[22]=V):V=e[22];const Ae=V;let K;e[23]!==n.id||e[24]!==x.delete||e[25]!==f||e[26]!==i?(K=async()=>{await x.delete.mutateAsync(n.id),f({to:"/$org/$project/mcps",params:{org:i,project:ke}})},e[23]=n.id,e[24]=x.delete,e[25]=f,e[26]=i,e[27]=K):K=e[27];const z=K;let U;e[28]!==i?(U=t.jsx(et,{children:t.jsx(Ft,{asChild:!0,children:t.jsx(lt,{to:"/$org/$project/mcps",params:{org:i,project:ke},children:"Connections"})})}),e[28]=i,e[29]=U):U=e[29];let Q;e[30]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(zt,{}),e[30]=Q):Q=e[30];let k;e[31]!==n.title?(k=t.jsx(et,{children:t.jsx(Rt,{children:n.title})}),e[31]=n.title,e[32]=k):k=e[32];let De;e[33]!==U||e[34]!==k?(De=t.jsx(Bt,{children:t.jsxs(Ht,{children:[U,Q,k]})}),e[33]=U,e[34]=k,e[35]=De):De=e[35];const We=De;let $e;e[36]===Symbol.for("react.memo_cache_sentinel")?($e=t.jsx(Gt,{children:"Disconnect connection?"}),e[36]=$e):$e=e[36];let ee;e[37]!==n.title?(ee=t.jsxs(Wt,{children:[$e,t.jsxs(Xt,{children:["This will permanently remove"," ",t.jsx("span",{className:"font-medium text-foreground",children:n.title}),". This action cannot be undone."]})]}),e[37]=n.title,e[38]=ee):ee=e[38];let Oe;e[39]===Symbol.for("react.memo_cache_sentinel")?(Oe=t.jsx(Kt,{children:"Cancel"}),e[39]=Oe):Oe=e[39];let te;e[40]!==z?(te=t.jsxs(Qt,{children:[Oe,t.jsx(qt,{onClick:z,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]}),e[40]=z,e[41]=te):te=e[41];let se;e[42]!==ee||e[43]!==te?(se=t.jsxs(Jt,{children:[ee,te]}),e[42]=ee,e[43]=te,e[44]=se):se=e[44];let ne;e[45]!==v||e[46]!==se?(ne=t.jsx(Yt,{open:v,onOpenChange:T,children:se}),e[45]=v,e[46]=se,e[47]=ne):ne=e[47];let oe;e[48]!==n.title?(oe=t.jsx(Zt,{className:"text-base",children:n.title}),e[48]=n.title,e[49]=oe):oe=e[49];let Pe;e[50]===Symbol.for("react.memo_cache_sentinel")?(Pe=t.jsx(es,{className:"text-xs",children:"Update URL, authentication, and other settings"}),e[50]=Pe):Pe=e[50];let re;e[51]!==oe?(re=t.jsxs(ts,{className:"px-6 py-4 border-b border-border shrink-0",children:[oe,Pe]}),e[51]=oe,e[52]=re):re=e[52];let ie;e[53]!==p.control?(ie=t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(W,{control:p.control,name:"title",render:xn}),t.jsx(W,{control:p.control,name:"description",render:un})]}),e[53]=p.control,e[54]=ie):ie=e[54];let le;e[55]!==j.hasOAuthToken||e[56]!==n||e[57]!==p||e[58]!==F||e[59]!==Ae?(le=t.jsx(nn,{form:p,connection:n,hasOAuthToken:j.hasOAuthToken,onReauthenticate:F,onRemoveOAuth:Ae}),e[55]=j.hasOAuthToken,e[56]=n,e[57]=p,e[58]=F,e[59]=Ae,e[60]=le):le=e[60];let ae;e[61]!==j.isServerError||e[62]!==j.supportsOAuth||e[63]!==n||e[64]!==p||e[65]!==F||e[66]!==A||e[67]!==I?(ae=t.jsx(Pt,{connection:n,form:p,hasMcpBinding:A,isMCPAuthenticated:I,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:F,onViewReadme:void 0}),e[61]=j.isServerError,e[62]=j.supportsOAuth,e[63]=n,e[64]=p,e[65]=F,e[66]=A,e[67]=I,e[68]=ae):ae=e[68];let ce;e[69]!==ie||e[70]!==le||e[71]!==ae?(ce=t.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-5 flex flex-col gap-6",children:[ie,le,ae]}),e[69]=ie,e[70]=le,e[71]=ae,e[72]=ce):ce=e[72];const Xe=!O||c,Ge=c?"Saving…":"Save changes";let de;e[73]!==w||e[74]!==Xe||e[75]!==Ge?(de=t.jsx(Ie,{onClick:w,disabled:Xe,className:"flex-1",children:Ge}),e[73]=w,e[74]=Xe,e[75]=Ge,e[76]=de):de=e[76];let me;e[77]!==R||e[78]!==O?(me=O&&t.jsx(Ie,{variant:"outline",onClick:R,children:"Undo"}),e[77]=R,e[78]=O,e[79]=me):me=e[79];let ue;e[80]!==de||e[81]!==me?(ue=t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[de,me]}),e[80]=de,e[81]=me,e[82]=ue):ue=e[82];let xe;e[83]!==p||e[84]!==ce||e[85]!==ue?(xe=t.jsxs(rs,{...p,children:[ce,ue]}),e[83]=p,e[84]=ce,e[85]=ue,e[86]=xe):xe=e[86];let fe;e[87]!==re||e[88]!==xe?(fe=t.jsxs(ss,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[re,xe]}),e[87]=re,e[88]=xe,e[89]=fe):fe=e[89];let pe;e[90]!==g||e[91]!==fe?(pe=t.jsx(ns,{open:g,onOpenChange:N,children:fe}),e[90]=g,e[91]=fe,e[92]=pe):pe=e[92];let Ee,Me;e[93]===Symbol.for("react.memo_cache_sentinel")?(Ee=()=>N(!0),Me=()=>T(!0),e[93]=Ee,e[94]=Me):(Ee=e[93],Me=e[94]);let he;e[95]!==n?(he=t.jsx(tn,{connection:n,onOpenSettings:Ee,onDisconnect:Me}),e[95]=n,e[96]=he):he=e[96];let ge;e[97]!==r?(ge=t.jsx(Hs,{connectionId:r}),e[97]=r,e[98]=ge):ge=e[98];let je;e[99]!==r||e[100]!==i||e[101]!==m||e[102]!==d||e[103]!==a?(je=t.jsx(qs,{tools:a,prompts:m,resources:d,connectionId:r,org:i}),e[99]=r,e[100]=i,e[101]=m,e[102]=d,e[103]=a,e[104]=je):je=e[104];let ve;e[105]!==ge||e[106]!==je?(ve=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-5",children:[ge,je]}),e[105]=ge,e[106]=je,e[107]=ve):ve=e[107];let be;e[108]!==n?(be=t.jsx(Gs,{connection:n}),e[108]=n,e[109]=be):be=e[109];let Ve;e[110]===Symbol.for("react.memo_cache_sentinel")?(Ve=()=>N(!0),e[110]=Ve):Ve=e[110];let Ne;e[111]!==n?(Ne=t.jsx(sn,{connection:n,onOpenSettings:Ve}),e[111]=n,e[112]=Ne):Ne=e[112];let ye;e[113]!==be||e[114]!==Ne?(ye=t.jsxs("div",{className:"w-72 shrink-0 flex flex-col gap-5",children:[be,Ne]}),e[113]=be,e[114]=Ne,e[115]=ye):ye=e[115];let _e;e[116]!==ve||e[117]!==ye?(_e=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsxs("div",{className:"flex gap-6 p-6",children:[ve,ye]})}),e[116]=ve,e[117]=ye,e[118]=_e):_e=e[118];let Ce;e[119]!==he||e[120]!==_e?(Ce=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[he,_e]}),e[119]=he,e[120]=_e,e[121]=Ce):Ce=e[121];let Se;e[122]!==We||e[123]!==Ce?(Se=t.jsx(ls,{breadcrumb:We,children:Ce}),e[122]=We,e[123]=Ce,e[124]=Se):Se=e[124];let Ue;return e[125]!==ne||e[126]!==pe||e[127]!==Se?(Ue=t.jsxs(t.Fragment,{children:[ne,pe,Se]}),e[125]=ne,e[126]=pe,e[127]=Se,e[128]=Ue):Ue=e[128],Ue}function un(s){const{field:e}=s;return t.jsxs(X,{children:[t.jsx(q,{children:"Description"}),t.jsx(L,{children:t.jsx(Y,{...e,value:e.value||""})}),t.jsx(J,{})]})}function xn(s){const{field:e}=s;return t.jsxs(X,{children:[t.jsx(q,{children:"Name"}),t.jsx(L,{children:t.jsx(Y,{...e})}),t.jsx(J,{})]})}function fn(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$connectionId"},s[0]=e):e=s[0];const n=He(e);let r;s[1]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/$project/mcps/$connectionId"},s[1]=r):r=s[1];const{connectionId:i,org:o}=yt(r),{org:c}=Be(),a=Et(i),m=dt();let d;s[2]!==i||s[3]!==c.id?(d={connectionId:i,orgId:c.id},s[2]=i,s[3]=c.id,s[4]=d):d=s[4];const u=qe(d),l=!(a?.connection_type==="VIRTUAL")&&a?.tools&&a.tools.length>0,x=!l;let g;s[5]!==u||s[6]!==x?(g={client:u,enabled:x},s[5]=u,s[6]=x,s[7]=g):g=s[7];const{data:N}=Vt(g);let v;s[8]!==a||s[9]!==l||s[10]!==N?.tools?(v=l?a.tools??[]:(N?.tools??[]).map(gn),s[8]=a,s[9]=l,s[10]=N?.tools,s[11]=v):v=s[11];const T=v;let y;s[12]!==u?(y={client:u},s[12]=u,s[13]=y):y=s[13];const{data:j}=Lt(y);let S;s[14]!==u?(S={client:u},s[14]=u,s[15]=S):S=s[15];const{data:I}=Ut(S);let b;s[16]!==j?.prompts?(b=j?.prompts??[],s[16]=j?.prompts,s[17]=b):b=s[17];let h;s[18]!==b?(h=b.map(hn),s[18]=b,s[19]=h):h=s[19];const A=h;let _;s[20]!==I?.resources?(_=I?.resources??[],s[20]=I?.resources,s[21]=_):_=s[21];let C;s[22]!==_?(C=_.map(pn),s[22]=_,s[23]=C):C=s[23];const $=C;let p;s[24]!==m.update||s[25]!==i?(p=async w=>{await m.update.mutateAsync({id:i,data:w})},s[24]=m.update,s[25]=i,s[26]=p):p=s[26];const O=p;if(!a){let w;return s[27]!==n||s[28]!==o?(w=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(at,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(Ie,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:o,project:ke}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=w):w=s[29],w}let D;return s[30]!==m.update.isPending||s[31]!==a||s[32]!==i||s[33]!==O||s[34]!==o||s[35]!==A||s[36]!==$||s[37]!==T?(D=t.jsx(mn,{org:o,connection:a,connectionId:i,onUpdate:O,isUpdating:m.update.isPending,tools:T,prompts:A,resources:$}),s[30]=m.update.isPending,s[31]=a,s[32]=i,s[33]=O,s[34]=o,s[35]=A,s[36]=$,s[37]=T,s[38]=D):D=s[38],D}function pn(s){return{name:s.name,description:s.description,uri:s.uri}}function hn(s){return{name:s.name,description:s.description}}function gn(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations,_meta:s._meta}}function jn(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Nt,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(is,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(fn,{})})}),s[0]=e):e=s[0],e}function Ko(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(jn,{}),s[0]=e):e=s[0],e}export{Ko as default};
1
+ import{r as Z,c as P,u as Be,j as t,y as gt,v as jt,K as Qe,O as ke,J as lt,e as He,B as Ie,c4 as Ze,at as vt,p as bt,E as Nt,g as yt,x as _t,q as Ct,t as St,b as wt,a as kt,w as Te}from"./index-SkQC2bL2.js";import{E as at}from"./empty-state-BUpyINsX.js";import{E as Tt,c as It,r as At,e as ct}from"./env-vars-editor-Crsr3jiO.js";import{a as Dt}from"./use-binding-f1akiPTf.js";import{n as $t,u as Ot,S as Pt}from"./index-BG9x5ELw.js";import{u as Et,a as dt}from"./use-connection-DSkVzqSP.js";import{u as qe,a as Mt}from"./constants-BZUBXkLq.js";import{d as Vt}from"./use-mcp-tools-DTZxAm-y.js";import{b as Ut}from"./use-mcp-resources-D0eHe68n.js";import{a as Lt}from"./use-mcp-prompts-D5tu2gbi.js";import{b as et,c as Rt,d as Ft,e as zt,B as Bt,a as Ht}from"./breadcrumb-h9Dq7GJ0.js";import{b as Wt,d as Xt,c as Gt,A as Kt,e as Qt,h as qt,a as Jt,f as Yt}from"./alert-dialog-DfOenbUZ.js";import{S as Zt,a as es,b as ts,c as ss,d as ns}from"./sheet-D7MnTm5h.js";import{F as W,b as X,c as q,d as L,f as J,e as os,a as rs}from"./form-CnUcVXlu.js";import{I as Y}from"./input-C4xXFdLa.js";import{i as is}from"./Loading01-CDOurw-F.js";import{a as ls}from"./layout-DIeoK390.js";import{c as as,B as cs,a as ds,C as ms}from"./monitoring-stats-row-DOJg3snj.js";import{C as us,a as xs,b as fs}from"./chart-BkIsuiHb.js";import{b as ps}from"./use-virtual-mcp-V0XoWMM_.js";import{i as mt}from"./ChevronRight-Df5oEIdG.js";import{t as ut}from"./Users03-B2n8Cd76.js";import{I as xt}from"./integration-icon-9nN5AvVn.js";import{c as hs,T as Re,a as gs,b as Fe}from"./tabs-CytiJeE2.js";import{a as js}from"./Tool01-BBVRBzC0.js";import{g as Je}from"./types-CUEMI47Y.js";import{M as vs}from"./mcp-app-renderer-8UT29L5G.js";import{C as bs}from"./collection-search-CPQlTmfx.js";import{T as Ns}from"./tools-list-BdA1jEJI.js";import{C as ys}from"./card-Cm-keK-z.js";import{t as _s}from"./Settings01-Bl2wNagM.js";import{U as Cs}from"./user-C2BDT4Rq.js";import{f as Ss}from"./format-time-CMKyl-GC.js";import{B as ws}from"./badge-C7XTRm7k.js";import{D as ks,a as Ts,b as Is,c as tt}from"./dropdown-menu-V8gWmDzD.js";import{S as st,a as nt,b as ot,c as rt,d as H}from"./select-Bqr12jkn.js";import{i as As}from"./CheckCircle-B4pYO1ZS.js";import{t as Ds}from"./ChevronDown-BURkaeCD.js";import{n as $s}from"./Container-De-pv4QL.js";import{s as ze}from"./Globe02-DAjgLqHS.js";import{s as Os}from"./RefreshCcw01-QnfLSKau.js";import{i as Ps}from"./Terminal-D3ILbCbK.js";import{s as Es}from"./Trash01-DhGTBhjv.js";import{s as Ms}from"./XClose-C8g1LxXV.js";import"./Plus-OTc7Ql1V.js";import"./binder--omYMrhv.js";import"./File06-B23HFdp6.js";import"./Key01-Bfc7gsTd.js";import"./constants-DgbSVhNJ.js";import"./registry-utils-Bi8LTB_e.js";import"./extract-connection-data-CBWW8njI.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-BQfcs7M8.js";import"./index-CMdtjEkH.js";import"./index-DDOXVfmG.js";import"./ChevronUp-Ql_IhfwF.js";import"./index-Ce1KA469.js";import"./select-virtual-mcp-DorfgjZR.js";import"./popover-U_QlVu0r.js";import"./tooltip-Ckpai_jH.js";import"./index-AtuNXtl1.js";import"./Check-CN56KhoF.js";import"./SearchMd-D6jy19cO.js";import"./use-create-virtual-mcp-C5n2ShE6.js";import"./use-collections-C3CSj681.js";import"./useMutation-CXgAMvoC.js";import"./useQuery-CtOvMPbo.js";import"./X-DVxsAMCH.js";import"./label-B5UIAzjB.js";import"./index-Bs-gkatC.js";import"./collection-display-button-CEqdF8O7.js";import"./ArrowDown-BrkOB1Av.js";import"./ArrowUp-Bl5YEbbF.js";import"./Grid01-B7q4cvPD.js";import"./List-DxiRK8pO.js";import"./collection-table-wrapper-BVpN3w_L.js";import"./table-c-SrSmwK.js";import"./Eye-CUyEl5IU.js";import"./LayersTwo01-CsbV79W9.js";import"./avatar-DexhTB4g.js";import"./differenceInSeconds-NQ4PDo0z.js";const ft=({size:s=24,color:e="currentColor",...n})=>Z.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Z.createElement("path",{d:"m12 21-.1-.15c-.695-1.042-1.042-1.563-1.5-1.94a4 4 0 0 0-1.378-.737C8.453 18 7.827 18 6.575 18H5.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C2 16.48 2 15.92 2 14.8V6.2c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C3.52 3 4.08 3 5.2 3h.4c2.24 0 3.36 0 4.216.436a4 4 0 0 1 1.748 1.748C12 6.04 12 7.16 12 9.4M12 21V9.4M12 21l.1-.15c.695-1.042 1.042-1.563 1.5-1.94a3.999 3.999 0 0 1 1.378-.737C15.547 18 16.173 18 17.425 18H18.8c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 16.48 22 15.92 22 14.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 3 19.92 3 18.8 3h-.4c-2.24 0-3.36 0-4.216.436a4 4 0 0 0-1.748 1.748C12 6.04 12 7.16 12 9.4"}));ft.displayName="BookOpen01";const Vs=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Us(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Ls={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Rs(s){const e=P.c(3),{connectionId:n,orgId:r,timeframe:i}=s;let o;e[0]!==r?(o={connectionId:Mt,orgId:r},e[0]=r,e[1]=o):o=e[1];const c=qe(o),a=Us(i),{data:m}=jt({queryKey:Qe.connectionActivity(n,i,r),queryFn:async()=>{const x=await c.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return x.structuredContent??x},staleTime:3e5}),d=as(m?.logs??[],a),u=d.data,f=d.totalCalls>0;let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[2]=l):l=e[2],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:d.totalCalls.toLocaleString()}),l]}),d.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:d.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),d.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(d.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),f?t.jsxs("div",{children:[t.jsx(us,{config:Ls,className:"h-16 w-full",children:t.jsxs(cs,{data:u,barCategoryGap:"4%",children:[t.jsx(xs,{content:t.jsx(fs,{labelFormatter:zs}),cursor:{fill:"var(--muted)"}}),t.jsx(ds,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(Fs)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Fs(s,e){return t.jsx(ms,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function zs(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function Bs(){const s=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 Hs(s){const e=P.c(13),{connectionId:n}=s,[r,i]=Z.useState("14d"),{org:o}=Be();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=c):c=e[0];let a;e[1]!==r?(a=Vs.map(l=>t.jsx("button",{type:"button",onClick:()=>i(l.value),className:gt("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",r===l.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:l.label},l.value)),e[1]=r,e[2]=a):a=e[2];let m;e[3]!==a?(m=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[c,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:a})]}),e[3]=a,e[4]=m):m=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Bs,{}),e[5]=d):d=e[5];let u;e[6]!==n||e[7]!==o.id||e[8]!==r?(u=t.jsx(Z.Suspense,{fallback:d,children:t.jsx(Rs,{connectionId:n,orgId:o.id,timeframe:r})}),e[6]=n,e[7]=o.id,e[8]=r,e[9]=u):u=e[9];let f;return e[10]!==m||e[11]!==u?(f=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,u]}),e[10]=m,e[11]=u,e[12]=f):f=e[12],f}function Ws(s){const e=P.c(14),{virtualMcp:n,org:r}=s;let i;e[0]!==r||e[1]!==n.id?(i={org:r,project:ke,agentId:n.id},e[0]=r,e[1]=n.id,e[2]=i):i=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(ut,{size:16}),e[3]=o):o=e[3];let c;e[4]!==n.icon||e[5]!==n.title?(c=t.jsx(xt,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:o}),e[4]=n.icon,e[5]=n.title,e[6]=c):c=e[6];let a;e[7]!==n.title?(a=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=a):a=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(mt,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=m):m=e[9];let d;return e[10]!==i||e[11]!==c||e[12]!==a?(d=t.jsxs(lt,{to:"/$org/$project/agents/$agentId/",params:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group",children:[c,a,m]}),e[10]=i,e[11]=c,e[12]=a,e[13]=d):d=e[13],d}function Xs(s){const e=P.c(7),{virtualMcps:n,org:r}=s;let i;if(e[0]!==r||e[1]!==n){let c;e[3]!==r?(c=a=>t.jsx(Ws,{virtualMcp:a,org:r},a.id),e[3]=r,e[4]=c):c=e[4],i=n.map(c),e[0]=r,e[1]=n,e[2]=i}else i=e[2];let o;return e[5]!==i?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:i})}),e[5]=i,e[6]=o):o=e[6],o}function Gs(s){const e=P.c(7),{connection:n}=s,{org:r}=Be();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const o=ps(i);if(!(o.length>0)){let d;return e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(t.Fragment,{}),e[2]=d):d=e[2],d}let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=a):a=e[3];let m;return e[4]!==r.slug||e[5]!==o?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[a,t.jsx("div",{className:"px-5 py-4",children:t.jsx(Xs,{virtualMcps:o,org:r.slug})})]}),e[4]=r.slug,e[5]=o,e[6]=m):m=e[6],m}function Ks(s){const e=P.c(27),{tools:n,connectionId:r,org:i}=s,o=He(),{org:c}=Be();let a;e[0]!==r||e[1]!==c.id?(a={connectionId:r,orgId:c.id},e[0]=r,e[1]=c.id,e[2]=a):a=e[2];const m=qe(a),[d,u]=Z.useState("");let f,l,x,g;if(e[3]!==m||e[4]!==r||e[5]!==o||e[6]!==i||e[7]!==d||e[8]!==n){const T=(n??[]).filter(Qs),y=d.toLowerCase().trim(),j=y?T.filter(h=>h.name.toLowerCase().includes(y)||h.description&&h.description.toLowerCase().includes(y)):T;let S;e[13]!==r||e[14]!==o||e[15]!==i?(S=h=>{o({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:ke,connectionId:r,collectionName:"tools",itemId:encodeURIComponent(h.name)}})},e[13]=r,e[14]=o,e[15]=i,e[16]=S):S=e[16];const I=S;x="flex flex-col h-full overflow-hidden";let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=h=>{h.key==="Escape"&&(u(""),h.target.blur())},e[17]=b):b=e[17],e[18]!==d?(g=t.jsx(bs,{value:d,onChange:u,placeholder:"Search apps...",onKeyDown:b}),e[18]=d,e[19]=g):g=e[19],f="flex-1 overflow-auto p-5",l=j.length===0?t.jsx(at,{image:null,title:d?"No apps found":"No apps available",description:d?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:j.map(h=>{const A=Je(h._meta);return t.jsxs(ys,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>I(h),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(vs,{resourceURI:A,toolInfo:{tool:h},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),t.jsx(Ns,{annotations:h.annotations,_meta:h._meta})]}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]})]},h.name)})}),e[3]=m,e[4]=r,e[5]=o,e[6]=i,e[7]=d,e[8]=n,e[9]=f,e[10]=l,e[11]=x,e[12]=g}else f=e[9],l=e[10],x=e[11],g=e[12];let N;e[20]!==f||e[21]!==l?(N=t.jsx("div",{className:f,children:l}),e[20]=f,e[21]=l,e[22]=N):N=e[22];let v;return e[23]!==x||e[24]!==g||e[25]!==N?(v=t.jsxs("div",{className:x,children:[g,N]}),e[23]=x,e[24]=g,e[25]=N,e[26]=v):v=e[26],v}function Qs(s){return!!Je(s._meta)}function pt(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=c=>c.charAt(0).toUpperCase()+c.slice(1),r=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),i=e.map(n),o=e[e.length-1];return i.length>=2&&o&&r.has(o)?[i.pop(),...i].join(" "):i.join(" ")}function Ke(s){const e=P.c(2),{label:n}=s;let r;return e[0]!==n?(r=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]=r):r=e[1],r}function qs(s){const e=P.c(71),{tools:n,prompts:r,resources:i,connectionId:o,org:c}=s;let a;e[0]!==r?(a=r===void 0?[]:r,e[0]=r,e[1]=a):a=e[1];const m=a;let d;e[2]!==i?(d=i===void 0?[]:i,e[2]=i,e[3]=d):d=e[3];const u=d,f=He();let l;e[4]!==o||e[5]!==f||e[6]!==c?(l=function(V){!o||!c||f({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:c,project:ke,connectionId:o,collectionName:"tools",itemId:encodeURIComponent(V)}})},e[4]=o,e[5]=f,e[6]=c,e[7]=l):l=e[7];const x=l;let g,N,v,T,y,j,S,I,b,h,A,_;if(e[8]!==o||e[9]!==x||e[10]!==c||e[11]!==m.length||e[12]!==u.length||e[13]!==n){I=Symbol.for("react.early_return_sentinel");e:{const F=n.filter(en);let V;if(e[26]!==o||e[27]!==c||e[28]!==n?(V=o&&c&&n.some(Zs),e[26]=o,e[27]=c,e[28]=n,e[29]=V):V=e[29],v=V,n.length+m.length+u.length===0){let k;e[30]===Symbol.for("react.memo_cache_sentinel")?(k=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[30]=k):k=e[30],I=k;break e}S="rounded-xl border border-border bg-card overflow-hidden",N=hs,T="tools",y="underline";let K;e[31]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx(Re,{value:"tools",variant:"underline",children:"Tools"}),e[31]=K):K=e[31];let z;e[32]!==v?(z=v&&t.jsx(Re,{value:"apps",variant:"underline",children:"UI"}),e[32]=v,e[33]=z):z=e[33];let U,Q;e[34]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Re,{value:"prompts",variant:"underline",children:"Prompts"}),Q=t.jsx(Re,{value:"resources",variant:"underline",children:"Resources"}),e[34]=U,e[35]=Q):(U=e[34],Q=e[35]),e[36]!==z?(j=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(gs,{variant:"underline",className:"gap-1",children:[K,z,U,Q]})}),e[36]=z,e[37]=j):j=e[37],g=Fe,A="tools",_="h-auto",b="divide-y divide-border",h=F.length>0?F.map(k=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>x(k.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(js,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:pt(k.name)}),k.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:k.description})]}),t.jsx(mt,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},k.name)):t.jsx(Ke,{label:"tools"})}e[8]=o,e[9]=x,e[10]=c,e[11]=m.length,e[12]=u.length,e[13]=n,e[14]=g,e[15]=N,e[16]=v,e[17]=T,e[18]=y,e[19]=j,e[20]=S,e[21]=I,e[22]=b,e[23]=h,e[24]=A,e[25]=_}else g=e[14],N=e[15],v=e[16],T=e[17],y=e[18],j=e[19],S=e[20],I=e[21],b=e[22],h=e[23],A=e[24],_=e[25];if(I!==Symbol.for("react.early_return_sentinel"))return I;let C;e[38]!==b||e[39]!==h?(C=t.jsx("div",{className:b,children:h}),e[38]=b,e[39]=h,e[40]=C):C=e[40];let $;e[41]!==g||e[42]!==C||e[43]!==A||e[44]!==_?($=t.jsx(g,{value:A,className:_,children:C}),e[41]=g,e[42]=C,e[43]=A,e[44]=_,e[45]=$):$=e[45];let p;e[46]!==o||e[47]!==v||e[48]!==c||e[49]!==n?(p=v&&t.jsx(Fe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(Ks,{tools:n,connectionId:o,org:c})}),e[46]=o,e[47]=v,e[48]=c,e[49]=n,e[50]=p):p=e[50];let O;e[51]!==m?(O=m.length>0?m.map(Ys):t.jsx(Ke,{label:"prompts"}),e[51]=m,e[52]=O):O=e[52];let D;e[53]!==O?(D=t.jsx(Fe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:O})}),e[53]=O,e[54]=D):D=e[54];let w;e[55]!==u?(w=u.length>0?u.map(Js):t.jsx(Ke,{label:"resources"}),e[55]=u,e[56]=w):w=e[56];let M;e[57]!==w?(M=t.jsx(Fe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:w})}),e[57]=w,e[58]=M):M=e[58];let R;e[59]!==N||e[60]!==T||e[61]!==y||e[62]!==j||e[63]!==$||e[64]!==p||e[65]!==D||e[66]!==M?(R=t.jsxs(N,{defaultValue:T,variant:y,children:[j,$,p,D,M]}),e[59]=N,e[60]=T,e[61]=y,e[62]=j,e[63]=$,e[64]=p,e[65]=D,e[66]=M,e[67]=R):R=e[67];let G;return e[68]!==S||e[69]!==R?(G=t.jsx("div",{className:S,children:R}),e[68]=S,e[69]=R,e[70]=G):G=e[70],G}function Js(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx($t,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function Ys(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(ft,{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:pt(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function Zs(s){return Je(s._meta)}function en(s){return!/^COLLECTION_/i.test(s.name)}function tn(s){const e=P.c(22),{connection:n,onOpenSettings:r,onDisconnect:i}=s;let o;e[0]!==n.icon||e[1]!==n.title?(o=t.jsx(xt,{icon:n.icon,name:n.title,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=o):o=e[2];let c;e[3]!==n.title?(c=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none",children:n.title})}),e[3]=n.title,e[4]=c):c=e[4];let a;e[5]!==n.description?(a=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:n.description}),e[5]=n.description,e[6]=a):a=e[6];let m;e[7]!==c||e[8]!==a?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,a]}),e[7]=c,e[8]=a,e[9]=m):m=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(_s,{size:15}),e[10]=d):d=e[10];let u;e[11]!==r?(u=t.jsx(Ie,{variant:"ghost",size:"icon",onClick:r,title:"Configure connection",className:"h-8 w-8 text-muted-foreground hover:text-foreground",children:d}),e[11]=r,e[12]=u):u=e[12];let f;e[13]!==i?(f=t.jsx(Ie,{variant:"outline",size:"sm",onClick:i,className:"text-destructive border-destructive/25 hover:bg-destructive/5 hover:text-destructive hover:border-destructive/40",children:"Disconnect"}),e[13]=i,e[14]=f):f=e[14];let l;e[15]!==u||e[16]!==f?(l=t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u,f]}),e[15]=u,e[16]=f,e[17]=l):l=e[17];let x;return e[18]!==o||e[19]!==m||e[20]!==l?(x=t.jsxs("div",{className:"flex items-center gap-6 py-7 px-8 bg-background border-b border-border shrink-0",children:[o,m,l]}),e[18]=o,e[19]=m,e[20]=l,e[21]=x):x=e[21],x}function sn(s){const e=P.c(21),{connection:n,onOpenSettings:r}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Connection"}),e[0]=i):i=e[0];let o;e[1]!==r?(o=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[i,t.jsx("button",{type:"button",onClick:r,className:"text-xs text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors cursor-pointer",children:"Configure"})]}),e[1]=r,e[2]=o):o=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("span",{className:"text-xs text-muted-foreground",children:"Added by"}),e[3]=c):c=e[3];let a;e[4]!==n.created_by?(a=t.jsxs("div",{className:"flex items-center justify-between",children:[c,t.jsx(Cs,{id:n.created_by,size:"2xs"})]}),e[4]=n.created_by,e[5]=a):a=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("span",{className:"text-xs text-muted-foreground",children:"Updated"}),e[6]=m):m=e[6];let d;e[7]!==n.updated_at?(d=n.updated_at?Ss(new Date(n.updated_at)):"—",e[7]=n.updated_at,e[8]=d):d=e[8];let u;e[9]!==d?(u=t.jsxs("div",{className:"flex items-center justify-between",children:[m,t.jsx("span",{className:"text-xs text-foreground",children:d})]}),e[9]=d,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("span",{className:"text-xs text-muted-foreground",children:"Protocol"}),e[11]=f):f=e[11];let l;e[12]!==n.connection_type?(l=t.jsxs("div",{className:"flex items-center justify-between",children:[f,t.jsx("span",{className:"text-xs font-mono text-foreground",children:n.connection_type})]}),e[12]=n.connection_type,e[13]=l):l=e[13];let x;e[14]!==a||e[15]!==u||e[16]!==l?(x=t.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[a,u,l]}),e[14]=a,e[15]=u,e[16]=l,e[17]=x):x=e[17];let g;return e[18]!==x||e[19]!==o?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[o,x]}),e[18]=x,e[19]=o,e[20]=g):g=e[20],g}function nn({form:s,connection:e,hasOAuthToken:n,onReauthenticate:r,onRemoveOAuth:i}){const o=Ze({control:s.control,name:"ui_type"}),c=Ze({control:s.control,name:"connection_url"}),{stdioEnabled:a}=vt(),m=(()=>{if(typeof c!="string"||!c)return!1;try{const l=new URL(c);return l.hostname==="api.githubcopilot.com"&&l.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),d=a||e.connection_type==="STDIO",u=e.connection_type==="VIRTUAL",f=u?bt(e.connection_url):null;return u?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(ut,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),f&&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:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(W,{control:s.control,name:"ui_type",render:({field:l})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{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(st,{value:l.value,onValueChange:l.onChange,children:[t.jsx(L,{children:t.jsxs(nt,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ze,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(ot,{})]})}),t.jsxs(rt,{children:[t.jsx(H,{value:"HTTP",children:"HTTP"}),t.jsx(H,{value:"SSE",children:"SSE"}),t.jsx(H,{value:"Websocket",children:"Websocket"}),d&&t.jsxs(t.Fragment,{children:[t.jsx(H,{value:"NPX",children:"NPX Package"}),t.jsx(H,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(W,{control:s.control,name:"connection_url",render:({field:x})=>t.jsx(X,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(Y,{placeholder:"https://example.com/mcp",...x,value:x.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(st,{value:l.value,onValueChange:l.onChange,children:[t.jsx(L,{children:t.jsx(nt,{className:"h-10",children:t.jsx(ot,{})})}),t.jsxs(rt,{children:[t.jsx(H,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ze,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(H,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ze,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(H,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ze,{className:"w-4 h-4"}),"Websocket"]})}),d&&t.jsxs(t.Fragment,{children:[t.jsx(H,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx($s,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(H,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ps,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(J,{})]})}),o==="NPX"&&t.jsx(W,{control:s.control,name:"npx_package",render:({field:l})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(L,{children:t.jsx(Y,{placeholder:"@perplexity-ai/mcp-server",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(J,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(W,{control:s.control,name:"stdio_command",render:({field:l})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(L,{children:t.jsx(Y,{placeholder:"node, bun, python...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(J,{})]})}),t.jsx(W,{control:s.control,name:"stdio_args",render:({field:l})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(L,{children:t.jsx(Y,{placeholder:"arg1 arg2 --flag value",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(J,{})]})})]}),t.jsx(W,{control:s.control,name:"stdio_cwd",render:({field:l})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(L,{children:t.jsx(Y,{placeholder:"/path/to/project (optional)",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(J,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(W,{control:s.control,name:"env_vars",render:({field:l})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(L,{children:t.jsx(Tt,{value:l.value??[],onChange:l.onChange})}),t.jsx(J,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(W,{control:s.control,name:"connection_token",render:({field:l})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{className:"text-xs text-muted-foreground font-medium",children:m?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(ks,{children:[t.jsx(Ts,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(ws,{variant:"success",className:"gap-1.5",children:[t.jsx(As,{size:12}),"Authenticated via OAuth",t.jsx(Ds,{size:12})]})})}),t.jsxs(Is,{align:"start",children:[t.jsxs(tt,{onClick:r,children:[t.jsx(Os,{size:16}),"Re-authenticate"]}),t.jsxs(tt,{variant:"destructive",onClick:i,children:[t.jsx(Es,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&l.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>l.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Ms,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(Y,{type:"password",placeholder:m?"Paste your GitHub PAT":"Enter access token...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(os,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(J,{})]})})]})}function on(s){return s.command==="npx"}function rn(s){return s.args?.find(e=>!e.startsWith("-"))??""}function ln(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function an(s,e){const n={command:"npx",args:["-y",s]},r=ct(e);return Object.keys(r).length>0&&(n.envVars=r),n}function cn(s,e,n,r){const i={command:s};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const o=ct(r);return Object.keys(o).length>0&&(i.envVars=o),i}function it(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&wt(s.connection_headers)){const r=s.connection_headers,i=At(r.envVars);if(on(r)){const c=rn(r);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i}}const o=ln(r);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:i}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function dn(s){let e,n=null,r=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=an(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=cn(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",r=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...r&&{connection_token:r},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function mn(s){const e=P.c(129),{connection:n,connectionId:r,org:i,onUpdate:o,isUpdating:c,tools:a,prompts:m,resources:d}=s;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={from:"/$org/$project/mcps/$connectionId"},e[0]=u):u=e[0];const f=He(u),l=_t(),x=dt(),[g,N]=Z.useState(!1),[v,T]=Z.useState(!1);let y;e[1]!==r?(y={connectionId:r},e[1]=r,e[2]=y):y=e[2];const j=Ot(y),I=n?.connection_type==="VIRTUAL"||j.isAuthenticated;let b;e[3]!==n?(b={connections:[n],binding:"MCP"},e[3]=n,e[4]=b):b=e[4];const A=Dt(b).length>0;let _;e[5]===Symbol.for("react.memo_cache_sentinel")?(_=Ct(It),e[5]=_):_=e[5];let C;e[6]!==n?(C=it(n),e[6]=n,e[7]=C):C=e[7];let $;e[8]!==C?($={resolver:_,values:C},e[8]=C,e[9]=$):$=e[9];const p=St($),O=p.formState.isDirty;let D;e[10]!==p||e[11]!==o?(D=async()=>{if(!await p.trigger())return;const E=p.getValues(),we=dn(E);await o(we),p.reset(E)},e[10]=p,e[11]=o,e[12]=D):D=e[12];const w=D;let M;e[13]!==n||e[14]!==p?(M=()=>{p.reset(it(n))},e[13]=n,e[14]=p,e[15]=M):M=e[15];const R=M;let G;e[16]!==n.id||e[17]!==x.update||e[18]!==l?(G=async()=>{const{token:B,tokenInfo:E,error:we}=await kt({connectionId:n.id});if(we||!B){Te.error(`Authentication failed: ${we}`);return}if(E)try{const Le=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:E.accessToken,refreshToken:E.refreshToken,expiresIn:E.expiresIn,scope:E.scope,clientId:E.clientId,clientSecret:E.clientSecret,tokenEndpoint:E.tokenEndpoint})});if(!Le.ok)console.error("Failed to save OAuth token:",await Le.text()),await x.update.mutateAsync({id:n.id,data:{connection_token:B}});else try{await x.update.mutateAsync({id:n.id,data:{}})}catch(Ye){console.warn("Failed to refresh connection tools after OAuth:",Ye)}}catch(Le){console.error("Error saving OAuth token:",Le),await x.update.mutateAsync({id:n.id,data:{connection_token:B}})}else await x.update.mutateAsync({id:n.id,data:{connection_token:B}});const ht=new URL(`/mcp/${n.id}`,window.location.origin);await l.invalidateQueries({queryKey:Qe.isMCPAuthenticated(ht.href,null)}),Te.success("Authentication successful")},e[16]=n.id,e[17]=x.update,e[18]=l,e[19]=G):G=e[19];const F=G;let V;e[20]!==n.id||e[21]!==l?(V=async()=>{try{const B=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!B.ok){const we=await B.text();Te.error(`Failed to remove OAuth: ${we}`);return}const E=new URL(`/mcp/${n.id}`,window.location.origin);await l.invalidateQueries({queryKey:Qe.isMCPAuthenticated(E.href,null)}),Te.success("OAuth removed. You can now re-authenticate with a different account.")}catch(B){console.error("Error removing OAuth token:",B),Te.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=l,e[22]=V):V=e[22];const Ae=V;let K;e[23]!==n.id||e[24]!==x.delete||e[25]!==f||e[26]!==i?(K=async()=>{await x.delete.mutateAsync(n.id),f({to:"/$org/$project/mcps",params:{org:i,project:ke}})},e[23]=n.id,e[24]=x.delete,e[25]=f,e[26]=i,e[27]=K):K=e[27];const z=K;let U;e[28]!==i?(U=t.jsx(et,{children:t.jsx(Ft,{asChild:!0,children:t.jsx(lt,{to:"/$org/$project/mcps",params:{org:i,project:ke},children:"Connections"})})}),e[28]=i,e[29]=U):U=e[29];let Q;e[30]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(zt,{}),e[30]=Q):Q=e[30];let k;e[31]!==n.title?(k=t.jsx(et,{children:t.jsx(Rt,{children:n.title})}),e[31]=n.title,e[32]=k):k=e[32];let De;e[33]!==U||e[34]!==k?(De=t.jsx(Bt,{children:t.jsxs(Ht,{children:[U,Q,k]})}),e[33]=U,e[34]=k,e[35]=De):De=e[35];const We=De;let $e;e[36]===Symbol.for("react.memo_cache_sentinel")?($e=t.jsx(Gt,{children:"Disconnect connection?"}),e[36]=$e):$e=e[36];let ee;e[37]!==n.title?(ee=t.jsxs(Wt,{children:[$e,t.jsxs(Xt,{children:["This will permanently remove"," ",t.jsx("span",{className:"font-medium text-foreground",children:n.title}),". This action cannot be undone."]})]}),e[37]=n.title,e[38]=ee):ee=e[38];let Oe;e[39]===Symbol.for("react.memo_cache_sentinel")?(Oe=t.jsx(Kt,{children:"Cancel"}),e[39]=Oe):Oe=e[39];let te;e[40]!==z?(te=t.jsxs(Qt,{children:[Oe,t.jsx(qt,{onClick:z,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]}),e[40]=z,e[41]=te):te=e[41];let se;e[42]!==ee||e[43]!==te?(se=t.jsxs(Jt,{children:[ee,te]}),e[42]=ee,e[43]=te,e[44]=se):se=e[44];let ne;e[45]!==v||e[46]!==se?(ne=t.jsx(Yt,{open:v,onOpenChange:T,children:se}),e[45]=v,e[46]=se,e[47]=ne):ne=e[47];let oe;e[48]!==n.title?(oe=t.jsx(Zt,{className:"text-base",children:n.title}),e[48]=n.title,e[49]=oe):oe=e[49];let Pe;e[50]===Symbol.for("react.memo_cache_sentinel")?(Pe=t.jsx(es,{className:"text-xs",children:"Update URL, authentication, and other settings"}),e[50]=Pe):Pe=e[50];let re;e[51]!==oe?(re=t.jsxs(ts,{className:"px-6 py-4 border-b border-border shrink-0",children:[oe,Pe]}),e[51]=oe,e[52]=re):re=e[52];let ie;e[53]!==p.control?(ie=t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(W,{control:p.control,name:"title",render:xn}),t.jsx(W,{control:p.control,name:"description",render:un})]}),e[53]=p.control,e[54]=ie):ie=e[54];let le;e[55]!==j.hasOAuthToken||e[56]!==n||e[57]!==p||e[58]!==F||e[59]!==Ae?(le=t.jsx(nn,{form:p,connection:n,hasOAuthToken:j.hasOAuthToken,onReauthenticate:F,onRemoveOAuth:Ae}),e[55]=j.hasOAuthToken,e[56]=n,e[57]=p,e[58]=F,e[59]=Ae,e[60]=le):le=e[60];let ae;e[61]!==j.isServerError||e[62]!==j.supportsOAuth||e[63]!==n||e[64]!==p||e[65]!==F||e[66]!==A||e[67]!==I?(ae=t.jsx(Pt,{connection:n,form:p,hasMcpBinding:A,isMCPAuthenticated:I,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:F,onViewReadme:void 0}),e[61]=j.isServerError,e[62]=j.supportsOAuth,e[63]=n,e[64]=p,e[65]=F,e[66]=A,e[67]=I,e[68]=ae):ae=e[68];let ce;e[69]!==ie||e[70]!==le||e[71]!==ae?(ce=t.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-5 flex flex-col gap-6",children:[ie,le,ae]}),e[69]=ie,e[70]=le,e[71]=ae,e[72]=ce):ce=e[72];const Xe=!O||c,Ge=c?"Saving…":"Save changes";let de;e[73]!==w||e[74]!==Xe||e[75]!==Ge?(de=t.jsx(Ie,{onClick:w,disabled:Xe,className:"flex-1",children:Ge}),e[73]=w,e[74]=Xe,e[75]=Ge,e[76]=de):de=e[76];let me;e[77]!==R||e[78]!==O?(me=O&&t.jsx(Ie,{variant:"outline",onClick:R,children:"Undo"}),e[77]=R,e[78]=O,e[79]=me):me=e[79];let ue;e[80]!==de||e[81]!==me?(ue=t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[de,me]}),e[80]=de,e[81]=me,e[82]=ue):ue=e[82];let xe;e[83]!==p||e[84]!==ce||e[85]!==ue?(xe=t.jsxs(rs,{...p,children:[ce,ue]}),e[83]=p,e[84]=ce,e[85]=ue,e[86]=xe):xe=e[86];let fe;e[87]!==re||e[88]!==xe?(fe=t.jsxs(ss,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[re,xe]}),e[87]=re,e[88]=xe,e[89]=fe):fe=e[89];let pe;e[90]!==g||e[91]!==fe?(pe=t.jsx(ns,{open:g,onOpenChange:N,children:fe}),e[90]=g,e[91]=fe,e[92]=pe):pe=e[92];let Ee,Me;e[93]===Symbol.for("react.memo_cache_sentinel")?(Ee=()=>N(!0),Me=()=>T(!0),e[93]=Ee,e[94]=Me):(Ee=e[93],Me=e[94]);let he;e[95]!==n?(he=t.jsx(tn,{connection:n,onOpenSettings:Ee,onDisconnect:Me}),e[95]=n,e[96]=he):he=e[96];let ge;e[97]!==r?(ge=t.jsx(Hs,{connectionId:r}),e[97]=r,e[98]=ge):ge=e[98];let je;e[99]!==r||e[100]!==i||e[101]!==m||e[102]!==d||e[103]!==a?(je=t.jsx(qs,{tools:a,prompts:m,resources:d,connectionId:r,org:i}),e[99]=r,e[100]=i,e[101]=m,e[102]=d,e[103]=a,e[104]=je):je=e[104];let ve;e[105]!==ge||e[106]!==je?(ve=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-5",children:[ge,je]}),e[105]=ge,e[106]=je,e[107]=ve):ve=e[107];let be;e[108]!==n?(be=t.jsx(Gs,{connection:n}),e[108]=n,e[109]=be):be=e[109];let Ve;e[110]===Symbol.for("react.memo_cache_sentinel")?(Ve=()=>N(!0),e[110]=Ve):Ve=e[110];let Ne;e[111]!==n?(Ne=t.jsx(sn,{connection:n,onOpenSettings:Ve}),e[111]=n,e[112]=Ne):Ne=e[112];let ye;e[113]!==be||e[114]!==Ne?(ye=t.jsxs("div",{className:"w-72 shrink-0 flex flex-col gap-5",children:[be,Ne]}),e[113]=be,e[114]=Ne,e[115]=ye):ye=e[115];let _e;e[116]!==ve||e[117]!==ye?(_e=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsxs("div",{className:"flex gap-6 p-6",children:[ve,ye]})}),e[116]=ve,e[117]=ye,e[118]=_e):_e=e[118];let Ce;e[119]!==he||e[120]!==_e?(Ce=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[he,_e]}),e[119]=he,e[120]=_e,e[121]=Ce):Ce=e[121];let Se;e[122]!==We||e[123]!==Ce?(Se=t.jsx(ls,{breadcrumb:We,children:Ce}),e[122]=We,e[123]=Ce,e[124]=Se):Se=e[124];let Ue;return e[125]!==ne||e[126]!==pe||e[127]!==Se?(Ue=t.jsxs(t.Fragment,{children:[ne,pe,Se]}),e[125]=ne,e[126]=pe,e[127]=Se,e[128]=Ue):Ue=e[128],Ue}function un(s){const{field:e}=s;return t.jsxs(X,{children:[t.jsx(q,{children:"Description"}),t.jsx(L,{children:t.jsx(Y,{...e,value:e.value||""})}),t.jsx(J,{})]})}function xn(s){const{field:e}=s;return t.jsxs(X,{children:[t.jsx(q,{children:"Name"}),t.jsx(L,{children:t.jsx(Y,{...e})}),t.jsx(J,{})]})}function fn(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$connectionId"},s[0]=e):e=s[0];const n=He(e);let r;s[1]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/$project/mcps/$connectionId"},s[1]=r):r=s[1];const{connectionId:i,org:o}=yt(r),{org:c}=Be(),a=Et(i),m=dt();let d;s[2]!==i||s[3]!==c.id?(d={connectionId:i,orgId:c.id},s[2]=i,s[3]=c.id,s[4]=d):d=s[4];const u=qe(d),l=!(a?.connection_type==="VIRTUAL")&&a?.tools&&a.tools.length>0,x=!l;let g;s[5]!==u||s[6]!==x?(g={client:u,enabled:x},s[5]=u,s[6]=x,s[7]=g):g=s[7];const{data:N}=Vt(g);let v;s[8]!==a||s[9]!==l||s[10]!==N?.tools?(v=l?a.tools??[]:(N?.tools??[]).map(gn),s[8]=a,s[9]=l,s[10]=N?.tools,s[11]=v):v=s[11];const T=v;let y;s[12]!==u?(y={client:u},s[12]=u,s[13]=y):y=s[13];const{data:j}=Lt(y);let S;s[14]!==u?(S={client:u},s[14]=u,s[15]=S):S=s[15];const{data:I}=Ut(S);let b;s[16]!==j?.prompts?(b=j?.prompts??[],s[16]=j?.prompts,s[17]=b):b=s[17];let h;s[18]!==b?(h=b.map(hn),s[18]=b,s[19]=h):h=s[19];const A=h;let _;s[20]!==I?.resources?(_=I?.resources??[],s[20]=I?.resources,s[21]=_):_=s[21];let C;s[22]!==_?(C=_.map(pn),s[22]=_,s[23]=C):C=s[23];const $=C;let p;s[24]!==m.update||s[25]!==i?(p=async w=>{await m.update.mutateAsync({id:i,data:w})},s[24]=m.update,s[25]=i,s[26]=p):p=s[26];const O=p;if(!a){let w;return s[27]!==n||s[28]!==o?(w=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(at,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(Ie,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:o,project:ke}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=w):w=s[29],w}let D;return s[30]!==m.update.isPending||s[31]!==a||s[32]!==i||s[33]!==O||s[34]!==o||s[35]!==A||s[36]!==$||s[37]!==T?(D=t.jsx(mn,{org:o,connection:a,connectionId:i,onUpdate:O,isUpdating:m.update.isPending,tools:T,prompts:A,resources:$}),s[30]=m.update.isPending,s[31]=a,s[32]=i,s[33]=O,s[34]=o,s[35]=A,s[36]=$,s[37]=T,s[38]=D):D=s[38],D}function pn(s){return{name:s.name,description:s.description,uri:s.uri}}function hn(s){return{name:s.name,description:s.description}}function gn(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations,_meta:s._meta}}function jn(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Nt,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(is,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(fn,{})})}),s[0]=e):e=s[0],e}function Ko(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(jn,{}),s[0]=e):e=s[0],e}export{Ko as default};
@@ -1 +1 @@
1
- import{r as c,c as n,j as r}from"./index-BXUNq6d7.js";import{B as a}from"./badge-B-_hRtCy.js";import{i as l}from"./AlertCircle-CnfwZdxb.js";import{i as m}from"./CheckCircle-DrGaevdP.js";const u=({size:s=24,color:e="currentColor",...o})=>c.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},c.createElement("path",{d:"m7.5 12 3 3 6-6M7.8 21h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21Z"}));u.displayName="CheckSquare";function x(s){const e=n.c(3),{status:o}=s;if(o==="active"){let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=r.jsxs(a,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[r.jsx(m,{size:12}),"Active"]}),e[0]=t):t=e[0],t}if(o==="error"){let t;return e[1]===Symbol.for("react.memo_cache_sentinel")?(t=r.jsxs(a,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[r.jsx(l,{size:12}),"Error"]}),e[1]=t):t=e[1],t}let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(a,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),e[2]=i):i=e[2],i}export{x as C,u as i};
1
+ import{r as c,c as n,j as r}from"./index-SkQC2bL2.js";import{B as a}from"./badge-C7XTRm7k.js";import{i as l}from"./AlertCircle-Bu9DNwe-.js";import{i as m}from"./CheckCircle-B4pYO1ZS.js";const u=({size:s=24,color:e="currentColor",...o})=>c.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},c.createElement("path",{d:"m7.5 12 3 3 6-6M7.8 21h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21Z"}));u.displayName="CheckSquare";function x(s){const e=n.c(3),{status:o}=s;if(o==="active"){let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=r.jsxs(a,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[r.jsx(m,{size:12}),"Active"]}),e[0]=t):t=e[0],t}if(o==="error"){let t;return e[1]===Symbol.for("react.memo_cache_sentinel")?(t=r.jsxs(a,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[r.jsx(l,{size:12}),"Error"]}),e[1]=t):t=e[1],t}let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(a,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),e[2]=i):i=e[2],i}export{x as C,u as i};
@@ -1 +1 @@
1
- import{c as de,u as rt,e as ct,j as t,O as re,B as z,E as wt,r as Y,x as Dt,d as It,f as At,at as Pt,aw as $t,t as Et,q as Lt,b as Ot,y as he,w as Q}from"./index-BXUNq6d7.js";import{g as zt}from"./generate-id-Dyweu44Y.js";import{C as Vt}from"./collection-display-button-CuyLh-NC.js";import{C as Ft}from"./collection-search-aJlY7LHs.js";import{C as Ut}from"./collection-tabs-B2Xeppc1.js";import{C as be}from"./connection-card-iA_b7WBI.js";import{I as ge}from"./integration-icon-D6SJHU0f.js";import{f as lt}from"./format-time-CMKyl-GC.js";import{D as Fe,b as Ue,c as Me,d as Be,a as at,e as dt}from"./dialog-DxTRqiug.js";import{i as Ye}from"./ChevronRight-Blv21S_7.js";import{n as ae}from"./Container-Ci_1Xm4L.js";import{s as mt}from"./Plus-CqWob4tu.js";import{a as Je}from"./Tool01-CUx5BAY-.js";import{i as Mt,C as Bt}from"./connection-status-BddpcBJZ.js";import{E as Rt}from"./empty-state-v8jdj56V.js";import{a as Ht,P as xe}from"./index-rWegviRE.js";import{U as Xt}from"./user-sbKkVV9F.js";import{u as Kt}from"./use-binding-CZ8osTa1.js";import{u as Wt}from"./use-infinite-scroll-C-TK62Eo.js";import{u as Gt}from"./use-list-state-D6LU1koz.js";import{u as qt}from"./use-store-discovery-C9fJhQ4Y.js";import{f as Qt,g as Ze}from"./registry-utils-CaVl1vKg.js";import{s as Yt}from"./slugify-CEUa2lfQ.js";import{f as Ie,a as Ae,b as Pe,c as $e,d as Ee,e as Le,A as Oe,h as ze}from"./alert-dialog-DgTufZ_p.js";import{B as Ve}from"./badge-B-_hRtCy.js";import{B as Jt,a as Zt,b as en,c as tn}from"./breadcrumb-Dk9kRV2t.js";import{C as pt}from"./checkbox-COsQJsO9.js";import{D as et,a as tt,b as nt,c as Ce}from"./dropdown-menu-CdjuOUR6.js";import{a as nn,F as Z,b as ee,c as te,d as ne,f as se}from"./form-BV3tSlED.js";import{I as le}from"./input-BFH8rk50.js";import{S as sn,a as on,b as rn,c as cn,d as fe}from"./select-B-f7jgVG.js";import{T as ln}from"./textarea-DPLd5P1K.js";import{a as an,b as st}from"./use-connection-lXrlfojY.js";import{u as dn,a as mn}from"./constants-CDL9XClm.js";import{b as pn}from"./use-virtual-mcp-CyoGC0aH.js";import{i as un}from"./CheckVerified02-DmV5dzDn.js";import{t as xn}from"./ChevronDown-DHeagNGb.js";import{i as fn}from"./DotsVertical-7N_NB6wt.js";import{s as hn}from"./Eye-Cn6YseXl.js";import{s as De}from"./Globe02-CyGtzZ8k.js";import{i as ut}from"./Loading01-Cbk1oNZ2.js";import{i as gn}from"./Terminal-zNrinv6B.js";import{s as xt}from"./Trash01-C0891dQq.js";import{s as jn}from"./XClose-BieEiV6P.js";import{r as yn,E as vn,c as Cn,e as ft}from"./env-vars-editor-Bs6jziXp.js";import"./ArrowDown-BnnQhLmg.js";import"./ArrowUp-BuKX1RSZ.js";import"./Check-7kB05ju_.js";import"./Grid01-Dqz--q3o.js";import"./List-Cc_Ri6eQ.js";import"./tooltip-BGPUMzDS.js";import"./index-L6huQtcJ.js";import"./SearchMd-DJI6OMcD.js";import"./card-BSGld6G2.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./X-CeRZ6ROs.js";import"./AlertCircle-CnfwZdxb.js";import"./CheckCircle-DrGaevdP.js";import"./useQuery-Bmc4jnG2.js";import"./useMutation-CkdHuTyE.js";import"./avatar-w6QMWHVj.js";import"./binder-BEJ4wRzw.js";import"./use-view-mode-0w9n1sJ-.js";import"./use-mobile-B0lEbMk3.js";import"./useInfiniteQuery-BlrmUHYA.js";import"./infiniteQueryObserver-DXFe0xIV.js";import"./label-DE7vX487.js";import"./ChevronUp-J7upZD3-.js";import"./use-collections-yY78nnLx.js";function Nn(i){const e=de.c(63),{open:s,onClose:r,appName:c,appIcon:l,appDescription:m,instances:g}=i,{org:N}=rt(),j=ct(),d=N.slug;let x;e[0]!==j||e[1]!==r||e[2]!==d?(x=function(V){j({to:"/$org/$project/mcps/$connectionId",params:{org:d,project:re,connectionId:V}}),r()},e[0]=j,e[1]=r,e[2]=d,e[3]=x):x=e[3];const v=x;let f;e[4]!==c||e[5]!==j||e[6]!==r||e[7]!==d?(f=function(){j({to:"/$org/$project/mcps",params:{org:d,project:re},search:{install:c}}),r()},e[4]=c,e[5]=j,e[6]=r,e[7]=d,e[8]=f):f=e[8];const h=f;let y;if(e[9]!==g){const w=new Set;y=[];for(const V of g)for(const W of V.tools??[])w.has(W.name)||(w.add(W.name),y.push({name:W.name,description:W.description,connectionId:V.id}));e[9]=g,e[10]=y}else y=e[10];let k;e[11]!==j||e[12]!==r||e[13]!==d?(k=function(V,W){j({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:d,project:re,connectionId:W,collectionName:"tools",itemId:encodeURIComponent(V)}}),r()},e[11]=j,e[12]=r,e[13]=d,e[14]=k):k=e[14];const T=k;let C;e[15]!==r?(C=w=>!w&&r(),e[15]=r,e[16]=C):C=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(ae,{}),e[17]=b):b=e[17];let D;e[18]!==l||e[19]!==c?(D=t.jsx(ge,{icon:l,name:c,size:"md",className:"shrink-0 shadow-sm mt-0.5",fallbackIcon:b}),e[18]=l,e[19]=c,e[20]=D):D=e[20];let I;e[21]!==c?(I=t.jsx(Fe,{className:"text-base font-semibold leading-snug",children:c}),e[21]=c,e[22]=I):I=e[22];let $;e[23]!==m?($=m&&t.jsx("p",{className:"text-sm text-muted-foreground mt-0.5 line-clamp-2",children:m}),e[23]=m,e[24]=$):$=e[24];let O;e[25]!==I||e[26]!==$?(O=t.jsxs("div",{className:"min-w-0",children:[I,$]}),e[25]=I,e[26]=$,e[27]=O):O=e[27];let R;e[28]!==D||e[29]!==O?(R=t.jsx(Ue,{className:"px-6 pt-6 pb-5 shrink-0",children:t.jsxs("div",{className:"flex items-start gap-4",children:[D,O]})}),e[28]=D,e[29]=O,e[30]=R):R=e[30];const P=g.length!==1?"s":"";let F;e[31]!==P?(F=t.jsxs("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:["Connection",P]}),e[31]=P,e[32]=F):F=e[32];let J;e[33]===Symbol.for("react.memo_cache_sentinel")?(J=t.jsx(mt,{size:14}),e[33]=J):J=e[33];let q;e[34]!==h?(q=t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:h,children:[J,"Add connection"]}),e[34]=h,e[35]=q):q=e[35];let U;e[36]!==F||e[37]!==q?(U=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3",children:[F,q]}),e[36]=F,e[37]=q,e[38]=U):U=e[38];let X;if(e[39]!==g||e[40]!==v){let w;e[42]!==v?(w=V=>t.jsxs("button",{type:"button",className:"w-full flex items-center gap-3 px-6 py-3 hover:bg-muted/40 transition-colors text-left cursor-pointer",onClick:()=>v(V.id),children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:V.title}),(V.updated_at||V.created_at)&&t.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Last updated"," ",lt(new Date(V.updated_at??V.created_at))]})]}),t.jsx(Ye,{size:16,className:"text-muted-foreground shrink-0"})]},V.id),e[42]=v,e[43]=w):w=e[43],X=g.map(w),e[39]=g,e[40]=v,e[41]=X}else X=e[41];let E;e[44]!==X?(E=t.jsx("div",{className:"pb-2",children:X}),e[44]=X,e[45]=E):E=e[45];let M;e[46]!==U||e[47]!==E?(M=t.jsxs("div",{children:[U,E]}),e[46]=U,e[47]=E,e[48]=M):M=e[48];let _;e[49]!==l||e[50]!==T||e[51]!==y?(_=y.length>0&&t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 px-6 py-3",children:[t.jsx(Je,{size:14,className:"text-muted-foreground"}),t.jsxs("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:["Actions (",y.length,")"]})]}),t.jsx("div",{className:"pb-2",children:y.map(w=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-6 py-2.5 hover:bg-muted/40 transition-colors text-left cursor-pointer",onClick:()=>T(w.name,w.connectionId),children:[t.jsx(ge,{icon:l,name:w.name,size:"xs",className:"shrink-0 mt-0.5",fallbackIcon:t.jsx(Je,{size:12})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:w.name}),w.description&&t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:w.description})]}),t.jsx(Ye,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},w.name))})]}),e[49]=l,e[50]=T,e[51]=y,e[52]=_):_=e[52];let K;e[53]!==M||e[54]!==_?(K=t.jsxs("div",{className:"flex-1 overflow-y-auto divide-y divide-border",children:[M,_]}),e[53]=M,e[54]=_,e[55]=K):K=e[55];let ie;e[56]!==R||e[57]!==K?(ie=t.jsxs(Me,{className:"sm:max-w-xl p-0 gap-0 overflow-hidden flex flex-col max-h-[80vh]",children:[R,K]}),e[56]=R,e[57]=K,e[58]=ie):ie=e[58];let ce;return e[59]!==s||e[60]!==ie||e[61]!==C?(ce=t.jsx(Be,{open:s,onOpenChange:C,children:ie}),e[59]=s,e[60]=ie,e[61]=C,e[62]=ce):ce=e[62],ce}function ot(i){return i.title.trim().replace(/\s+\(\d+\)$/,"")}function bn(i){const e=new Map;for(const c of i){if(c.connection_type==="VIRTUAL")continue;const l=ot(c),m=e.get(l);m?m.push(c):e.set(l,[c])}const s=[],r=new Set;for(const c of i){if(c.connection_type==="VIRTUAL")continue;const l=ot(c);if(r.has(l))continue;r.add(l);const m=e.get(l),g=m[0];m.length===1?s.push({type:"single",connection:g}):s.push({type:"group",key:l,icon:g.icon,title:g.app_name?g.title.replace(/\s*\(\d+\)\s*$/,""):g.title,connections:m})}return s}function Sn(i){const e=new Set,s=[];for(const r of i)r.created_by&&!e.has(r.created_by)&&(e.add(r.created_by),s.push(r.created_by));return s}function Se(i){const e=i.trim();if(!e)return"";try{const s=new URL(e),r=s.pathname.length>1?s.pathname.replace(/\/+$/,""):s.pathname;return`${s.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function _n(i){const e=i.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const s=e[0]?.toLowerCase();if(s!=="npx"&&s!=="bunx")return null;const c=e.slice(1).find(l=>!l.startsWith("-"));return c?{packageName:c}:null}function Ne(i){const{uiType:e}=i,s=Se(i.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&s===Se("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(i.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function it(i){if(i.registryItems.length===0||i.uiType!=="HTTP"&&i.uiType!=="SSE"&&i.uiType!=="Websocket")return null;const e=Se(i.connectionUrl??"");if(!e)return null;const s=i.registryItems.find(l=>(l.server?.remotes??[]).some(g=>Se(g.url??"")===e));if(!s)return null;const r=s.title||s.name||s.server?.title||s.server?.name||"",c=s.server?.description||s.description||s.summary||null;return r?{id:"registry",title:r,description:c}:null}function kn(i,e){const s={command:"npx",args:["-y",i]},r=ft(e);return Object.keys(r).length>0&&(s.envVars=r),s}function Tn(i,e,s,r){const c={command:i};e.trim()&&(c.args=e.trim().split(/\s+/)),s?.trim()&&(c.cwd=s.trim());const l=ft(r);return Object.keys(l).length>0&&(c.envVars=l),c}function wn(i){return i.command==="npx"}function Dn(i){return i.args?.find(e=>!e.startsWith("-"))??""}function In(i){return{command:i.command,args:i.args?.join(" ")??"",cwd:i.cwd??""}}function An(i,e){switch(e.type){case"edit":return{mode:"editing",connection:e.connection};case"delete":return{mode:"deleting",connection:e.connection};case"force-delete":return{mode:"force-deleting",connection:e.connection,agentNames:e.agentNames};case"close":return{mode:"idle"}}}function Pn(i){const e=de.c(74),{group:s,onOpen:r,selectionMode:c,selectedIds:l,onToggleSelect:m}=i;let g;if(e[0]!==s.connections||e[1]!==l){let P;e[3]!==l?(P=F=>l.has(F.id),e[3]=l,e[4]=P):P=e[4],g=s.connections.every(P),e[0]=s.connections,e[1]=l,e[2]=g}else g=e[2];const N=g;let j;if(e[5]!==s.connections||e[6]!==l){let P;e[8]!==l?(P=F=>l.has(F.id),e[8]=l,e[9]=P):P=e[9],j=s.connections.some(P),e[5]=s.connections,e[6]=l,e[7]=j}else j=e[7];const d=j;let x,v,f,h,y,k,T,C,b,D,I;if(e[10]!==N||e[11]!==s.connections||e[12]!==s.icon||e[13]!==s.title||e[14]!==r||e[15]!==m||e[16]!==l||e[17]!==c||e[18]!==d){const P=Sn(s.connections),F=s.connections.reduce(En,s.connections[0]),J=F.updated_at??F.created_at;x=be;const q=`${s.connections.length} instances`;e[30]!==s.icon||e[31]!==s.title||e[32]!==q?(b={title:s.title,icon:s.icon,description:q},e[30]=s.icon,e[31]=s.title,e[32]=q,e[33]=b):b=e[33],e[34]!==N||e[35]!==s.connections||e[36]!==r||e[37]!==m||e[38]!==l||e[39]!==c?(D=()=>c?(()=>{for(const _ of s.connections)N?l.has(_.id)&&m(_.id):l.has(_.id)||m(_.id)})():r(),e[34]=N,e[35]=s.connections,e[36]=r,e[37]=m,e[38]=l,e[39]=c,e[40]=D):D=e[40];const U=c&&N&&"ring-2 ring-primary",X=c&&d&&!N&&"ring-1 ring-primary/50";e[41]!==U||e[42]!==X?(I=he(U,X),e[41]=U,e[42]=X,e[43]=I):I=e[43],e[44]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(ae,{}),e[44]=v):v=e[44],e[45]!==N||e[46]!==s.connections||e[47]!==m||e[48]!==l||e[49]!==c||e[50]!==d?(f=c?t.jsx(pt,{checked:N?!0:d?"indeterminate":!1,onCheckedChange:()=>{for(const _ of s.connections)N?l.has(_.id)&&m(_.id):l.has(_.id)||m(_.id)}}):t.jsxs(Ve,{variant:"secondary",className:"text-xs tabular-nums",children:["x",s.connections.length]}),e[45]=N,e[46]=s.connections,e[47]=m,e[48]=l,e[49]=c,e[50]=d,e[51]=f):f=e[51];let E;e[52]!==s.connections?(E=s.connections.slice(0,6).map($n),e[52]=s.connections,e[53]=E):E=e[53],e[54]!==E?(h=t.jsx("div",{className:"flex items-center gap-1",children:E}),e[54]=E,e[55]=h):h=e[55],T="flex items-center justify-between text-xs text-muted-foreground w-full min-w-0";const M=P.map(_=>t.jsx(Xt,{id:_,size:"3xs",avatarOnly:P.length>1},_));e[56]!==M?(C=t.jsx("div",{className:"flex items-center -space-x-1.5",children:M}),e[56]=M,e[57]=C):C=e[57],y="shrink-0 ml-2",k=J?lt(new Date(J)):"—",e[10]=N,e[11]=s.connections,e[12]=s.icon,e[13]=s.title,e[14]=r,e[15]=m,e[16]=l,e[17]=c,e[18]=d,e[19]=x,e[20]=v,e[21]=f,e[22]=h,e[23]=y,e[24]=k,e[25]=T,e[26]=C,e[27]=b,e[28]=D,e[29]=I}else x=e[19],v=e[20],f=e[21],h=e[22],y=e[23],k=e[24],T=e[25],C=e[26],b=e[27],D=e[28],I=e[29];let $;e[58]!==y||e[59]!==k?($=t.jsx("span",{className:y,children:k}),e[58]=y,e[59]=k,e[60]=$):$=e[60];let O;e[61]!==$||e[62]!==T||e[63]!==C?(O=t.jsxs("div",{className:T,children:[C,$]}),e[61]=$,e[62]=T,e[63]=C,e[64]=O):O=e[64];let R;return e[65]!==x||e[66]!==v||e[67]!==f||e[68]!==h||e[69]!==O||e[70]!==b||e[71]!==D||e[72]!==I?(R=t.jsx(t.Fragment,{children:t.jsx(x,{connection:b,onClick:D,className:I,fallbackIcon:v,headerActions:f,body:h,footer:O})}),e[65]=x,e[66]=v,e[67]=f,e[68]=h,e[69]=O,e[70]=b,e[71]=D,e[72]=I,e[73]=R):R=e[73],R}function $n(i){return t.jsx(Bt,{status:i.status},i.id)}function En(i,e){const s=e.updated_at??e.created_at,r=i.updated_at??i.created_at;return s?r?new Date(s)>new Date(r)?e:i:e:i}function Ln(i){const e=de.c(28),{count:s,total:r,onSelectAll:c,onDeselectAll:l,onDelete:m,onAddToAgent:g,onToggleStatus:N,onCancel:j}=i;if(s===0)return null;let d;e[0]!==s?(d=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[s," selected"]}),e[0]=s,e[1]=d):d=e[1];let x;e[2]!==s||e[3]!==l||e[4]!==c||e[5]!==r?(x=s<r?t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:c,children:["Select all (",r,")"]}):t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:"Clear selection"}),e[2]=s,e[3]=l,e[4]=c,e[5]=r,e[6]=x):x=e[6];let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(mt,{size:13}),e[7]=v):v=e[7];let f;e[8]!==g?(f=t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:[v,"Add to Agent"]}),e[8]=g,e[9]=f):f=e[9];let h;e[10]!==N?(h=t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("active"),children:"Enable"}),e[10]=N,e[11]=h):h=e[11];let y;e[12]!==N?(y=t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("inactive"),children:"Disable"}),e[12]=N,e[13]=y):y=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(xt,{size:13}),e[14]=k):k=e[14];let T;e[15]!==m?(T=t.jsxs(z,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:[k,"Delete"]}),e[15]=m,e[16]=T):T=e[16];let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(jn,{size:13}),e[17]=C):C=e[17];let b;e[18]!==j?(b=t.jsx(z,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:j,children:C}),e[18]=j,e[19]=b):b=e[19];let D;return e[20]!==d||e[21]!==b||e[22]!==x||e[23]!==f||e[24]!==h||e[25]!==y||e[26]!==T?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[d,x,f,h,y,T,b]})}),e[20]=d,e[21]=b,e[22]=x,e[23]=f,e[24]=h,e[25]=y,e[26]=T,e[27]=D):D=e[27],D}function On(i){const e=de.c(25),{open:s,onOpenChange:r,agents:c,onConfirm:l}=i,[m,g]=Y.useState(null);let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsxs(Ue,{children:[t.jsx(Fe,{children:"Add to Agent"}),t.jsx(at,{children:"Select an agent to add the selected connections to."})]}),e[0]=N):N=e[0];let j;e[1]!==c||e[2]!==m?(j=c.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):c.map(C=>t.jsxs("button",{type:"button",onClick:()=>g(C.id),className:he("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",m===C.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(ge,{icon:C.icon,name:C.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:C.title}),C.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:C.description})]})]},C.id)),e[1]=c,e[2]=m,e[3]=j):j=e[3];let d;e[4]!==j?(d=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[4]=j,e[5]=d):d=e[5];let x;e[6]!==r?(x=t.jsx(z,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e[6]=r,e[7]=x):x=e[7];const v=!m;let f;e[8]!==l||e[9]!==r||e[10]!==m?(f=()=>{m&&(l(m),r(!1),g(null))},e[8]=l,e[9]=r,e[10]=m,e[11]=f):f=e[11];let h;e[12]!==v||e[13]!==f?(h=t.jsx(z,{disabled:v,onClick:f,children:"Add"}),e[12]=v,e[13]=f,e[14]=h):h=e[14];let y;e[15]!==x||e[16]!==h?(y=t.jsxs(dt,{children:[x,h]}),e[15]=x,e[16]=h,e[17]=y):y=e[17];let k;e[18]!==d||e[19]!==y?(k=t.jsxs(Me,{className:"sm:max-w-[400px]",children:[N,d,y]}),e[18]=d,e[19]=y,e[20]=k):k=e[20];let T;return e[21]!==r||e[22]!==s||e[23]!==k?(T=t.jsx(Be,{open:s,onOpenChange:r,children:k}),e[21]=r,e[22]=s,e[23]=k,e[24]=T):T=e[24],T}function zn(i){const e=de.c(20),{open:s,onOpenChange:r,count:c,onConfirm:l}=i,m=c!==1?"s":"";let g;e[0]!==c||e[1]!==m?(g=t.jsxs($e,{children:["Delete ",c," connection",m,"?"]}),e[0]=c,e[1]=m,e[2]=g):g=e[2];const N=c!==1?"s":"";let j;e[3]!==N?(j=t.jsxs(Ee,{children:["This will permanently delete the selected connection",N,". This action cannot be undone."]}),e[3]=N,e[4]=j):j=e[4];let d;e[5]!==g||e[6]!==j?(d=t.jsxs(Pe,{children:[g,j]}),e[5]=g,e[6]=j,e[7]=d):d=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Oe,{children:"Cancel"}),e[8]=x):x=e[8];const v=c!==1?"s":"";let f;e[9]!==c||e[10]!==l||e[11]!==v?(f=t.jsxs(Le,{children:[x,t.jsxs(ze,{onClick:l,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",c," connection",v]})]}),e[9]=c,e[10]=l,e[11]=v,e[12]=f):f=e[12];let h;e[13]!==d||e[14]!==f?(h=t.jsxs(Ae,{children:[d,f]}),e[13]=d,e[14]=f,e[15]=h):h=e[15];let y;return e[16]!==r||e[17]!==s||e[18]!==h?(y=t.jsx(Ie,{open:s,onOpenChange:r,children:h}),e[16]=r,e[17]=s,e[18]=h,e[19]=y):y=e[19],y}function Vn(){const{org:i}=rt(),e=Dt(),s=ct(),r=It({strict:!1}),{data:c}=At.useSession(),{stdioEnabled:l}=Pt(),m=Gt({namespace:i.slug,resource:"connections"}),g=an(),N=st(m),j=st(),[d,x]=Y.useReducer(An,{mode:"idle"}),[v,f]=Y.useState(new Set),h=v.size>0,[y,k]=Y.useState(!1),[T,C]=Y.useState(!1),[b,D]=Y.useState("all"),[I,$]=Y.useState(null),[O,R]=Y.useState("ALL"),[P,F]=Y.useState("ALL"),J=pn(),U=N.filter(n=>!(n.connection_type==="VIRTUAL"||O!=="ALL"&&n.connection_type!==O||P!=="ALL"&&n.status!==P)),X=bn(U),E=n=>{f(o=>{const a=new Set(o);return a.has(n)?a.delete(n):a.add(n),a})},M=()=>{f(new Set)},_=Kt(j).sort((n,o)=>{const a=n.app_name==="@deco/management-mcp",u=o.app_name==="@deco/management-mcp";return a&&!u?1:!a&&u?-1:0}),[K,ie]=Ht($t.selectedRegistry(i.slug),n=>n??""),ce=(K?_.find(n=>n.id===K):void 0)??_[0],w=ce?.id??"",V=Qt(ce?.tools),W=qt({registryId:w,listToolName:V}),_e=W.items,ht=Wt(W.loadMore,W.hasMore,W.isLoadingMore),Re=new Set(j.filter(n=>n.connection_type!=="VIRTUAL"&&n.app_name).map(n=>n.app_name)),ke=m.search.toLowerCase(),He=b==="all"?_e.filter(n=>{if(!ke)return!0;const o=n._meta?.["mcp.mesh"],a=[o?.friendly_name,n.server?.name,n.server?.title,n.name,n.title,n.id].filter(Boolean).join(" "),u=[o?.short_description,o?.mesh_description,n.server?.description,n.description].filter(Boolean).join(" ");return a.toLowerCase().includes(ke)||u.toLowerCase().includes(ke)}):[],Te=He.filter(n=>n.verified||n._meta?.["mcp.mesh"]?.verified||n.meta?.verified),we=He.filter(n=>!n.verified&&!n._meta?.["mcp.mesh"]?.verified&&!n.meta?.verified),gt=b==="all"?[]:X,je=n=>{const o=Yt(n.name||n.title||n.server?.title||""),a=typeof n.id=="string"&&n.id.includes("/"),u=typeof n.server?.name=="string"&&n.server.name.includes("/"),S=a&&!u?n.id:n.server?.name||n.id||"";s({to:"/$org/$project/store/$appName",params:{org:i.slug,project:re,appName:o},search:{registryId:w,serverName:S}})},Xe=r.action==="create",jt=()=>{s({to:"/$org/$project/mcps",params:{org:i.slug,project:re},search:{action:"create"}})},Ke=()=>{s({to:"/$org/$project/mcps",params:{org:i.slug,project:re},search:{}})},p=Et({resolver:Lt(Cn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),H=p.watch("ui_type"),We=p.watch("connection_url"),yt=p.watch("npx_package"),me=Ne({uiType:H,connectionUrl:We??"",npxPackage:yt??""})??it({uiType:H,connectionUrl:We??"",registryItems:_e}),A=d.mode==="editing"?d.connection:null;Y.useEffect(()=>{if(A){const n=Ot(A.connection_headers)?A.connection_headers:null;if(n&&A.connection_type==="STDIO"){const o=yn(n.envVars);if(wn(n)){const a=Dn(n);p.reset({title:A.title,description:A.description,icon:A.icon??null,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o})}else{const a=In(n);p.reset({title:A.title,description:A.description,icon:A.icon??null,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:o})}}else p.reset({title:A.title,description:A.description,icon:A.icon??null,ui_type:A.connection_type,connection_url:A.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else p.reset({title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[A,p]);const pe=dn({connectionId:mn,orgId:i.id}),ye=()=>{e.invalidateQueries({predicate:n=>{const o=n.queryKey;return o[1]===i.id&&o[3]==="collection"&&o[4]==="CONNECTIONS"}})},vt=async()=>{k(!1);const n=[...v];let o=0;for(const a of n)try{(await pe.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:a,force:!0}})).isError||o++}catch{}ye(),Q.success(`Deleted ${o} connection${o!==1?"s":""}`),M()},Ct=async n=>{const o=[...v];let a=0;for(const u of o)try{await g.update.mutateAsync({id:u,data:{status:n}}),a++}catch{}ye(),Q.success(`${n==="active"?"Enabled":"Disabled"} ${a} connection${a!==1?"s":""}`),M()},Nt=async n=>{const o=J.find(S=>S.id===n);if(!o||!pe)return;const a=new Set(o.connections.map(S=>S.connection_id)),u=[...v].filter(S=>!a.has(S)).map(S=>({connection_id:S,selected_tools:null,selected_resources:null,selected_prompts:null}));if(u.length===0){Q.info("All selected connections are already in that agent");return}try{await pe.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:n,data:{connections:[...o.connections,...u]}}}),e.invalidateQueries({predicate:S=>{const L=S.queryKey;return L[1]===i.id&&L[3]==="collection"&&L[4]==="VIRTUAL_MCP"}}),Q.success(`Added ${u.length} connection${u.length!==1?"s":""} to "${o.title}"`),M()}catch{Q.error("Failed to add connections to agent")}},Ge=n=>{const o=n.content;return Array.isArray(o)&&o[0]?.type==="text"&&typeof o[0].text=="string"?o[0].text:"Unknown error"},bt=async()=>{if(d.mode!=="deleting")return;const n=d.connection;x({type:"close"});try{const o=await pe.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:n.id}});if(o.isError){const a=Ge(o),u=a.replace(/^Error:\s*/,"");try{const S=JSON.parse(u);if(S.code==="CONNECTION_IN_USE"&&S.agentNames){x({type:"force-delete",connection:n,agentNames:S.agentNames.map(L=>`"${L}"`).join(", ")});return}}catch{}Q.error(`Failed to delete connection: ${a}`);return}ye(),Q.success("Connection deleted successfully")}catch(o){const a=o instanceof Error?o.message:String(o);Q.error(`Failed to delete connection: ${a}`)}},St=async()=>{if(d.mode!=="force-deleting")return;const n=d.connection.id;x({type:"close"});try{const o=await pe.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:n,force:!0}});if(o.isError){Q.error(`Failed to delete connection: ${Ge(o)}`);return}ye(),Q.success("Connection deleted successfully")}catch(o){const a=o instanceof Error?o.message:String(o);Q.error(`Failed to delete connection: ${a}`)}},_t=async n=>{let o,a=null,u=null,S=null;if(n.ui_type==="NPX"?(o="STDIO",a="",S=kn(n.npx_package||"",n.env_vars||[])):n.ui_type==="STDIO"?(o="STDIO",a="",S=Tn(n.stdio_command||"",n.stdio_args||"",n.stdio_cwd,n.env_vars||[])):(o=n.ui_type,a=n.connection_url||"",u=n.connection_token||null),A){await g.update.mutateAsync({id:A.id,data:{title:n.title,description:n.description||null,icon:n.icon??null,connection_type:o,connection_url:a,...u&&{connection_token:u},...S&&{connection_headers:S}}}),x({type:"close"}),p.reset();return}const L=zt("conn");await g.create.mutateAsync({id:L,title:n.title,description:n.description||null,connection_type:o,connection_url:a,connection_token:u,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:c?.user?.id||"system",organization_id:i.id,icon:n.icon??null,app_name:null,app_id:null,connection_headers:S,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),Ke(),p.reset(),s({to:"/$org/$project/mcps/$connectionId",params:{org:i.slug,project:re,connectionId:L}})},qe=n=>{n||(Xe?Ke():x({type:"close"}),p.reset())},ve=n=>{const o=n.trim();if(!o)return;const a=!!p.formState.dirtyFields.title,u=!!p.formState.dirtyFields.description,S=!!p.formState.dirtyFields.env_vars,L=B=>{if(B&&(!a&&!p.getValues("title").trim()&&B.title&&p.setValue("title",B.title,{shouldDirty:!1}),!u&&!(p.getValues("description")??"").trim()&&B.description&&p.setValue("description",B.description,{shouldDirty:!1}),!S&&B.envVarKeys?.length)){const G=p.getValues("env_vars")??[],Tt=new Set(G.map(ue=>ue.key)),Qe=B.envVarKeys.filter(ue=>!Tt.has(ue));Qe.length>0&&p.setValue("env_vars",[...G,...Qe.map(ue=>({key:ue,value:""}))],{shouldDirty:!0})}},oe=_n(o);if(oe&&l){p.setValue("ui_type","NPX",{shouldDirty:!0}),p.setValue("npx_package",oe.packageName,{shouldDirty:!0}),p.setValue("connection_url","",{shouldDirty:!0}),p.setValue("connection_token",null,{shouldDirty:!0}),L(Ne({uiType:"NPX",npxPackage:oe.packageName}));return}if(o.startsWith("http://")||o.startsWith("https://")){const B=H==="HTTP"||H==="SSE"||H==="Websocket"?H:"HTTP";p.setValue("ui_type",B,{shouldDirty:!0}),p.setValue("connection_url",o,{shouldDirty:!0}),L(Ne({uiType:B,connectionUrl:o})??it({uiType:B,connectionUrl:o,registryItems:_e}));return}H==="NPX"&&L(Ne({uiType:"NPX",npxPackage:o}))},kt=t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(z,{variant:"outline",onClick:jt,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})});return t.jsxs(t.Fragment,{children:[t.jsxs(xe,{children:[t.jsx(Be,{open:Xe||d.mode==="editing",onOpenChange:qe,children:t.jsxs(Me,{className:"sm:max-w-[525px]",children:[t.jsxs(Ue,{children:[t.jsx(Fe,{children:A?"Edit Connection":"Create Connection"}),t.jsx(at,{children:A?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),t.jsx(nn,{...p,children:t.jsxs("form",{onSubmit:p.handleSubmit(_t),children:[t.jsxs("div",{className:"grid gap-4 py-4",children:[t.jsx(Z,{control:p.control,name:"ui_type",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Type *"}),t.jsxs(sn,{value:n.value,onValueChange:n.onChange,children:[t.jsx(ne,{children:t.jsx(on,{children:t.jsx(rn,{})})}),t.jsxs(cn,{children:[t.jsx(fe,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(fe,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(fe,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(fe,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ae,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(fe,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(gn,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(se,{})]})}),H==="NPX"&&t.jsx(t.Fragment,{children:t.jsx(Z,{control:p.control,name:"npx_package",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"NPM Package *"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"@perplexity-ai/mcp-server",...n,value:n.value??"",onPaste:o=>{const a=o.clipboardData.getData("text");a&&(o.preventDefault(),p.setValue("npx_package",a.trim(),{shouldDirty:!0}),ve(a))},onBlur:o=>{ve(o.target.value),n.onBlur()}})}),t.jsx(se,{})]})})}),H==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Z,{control:p.control,name:"stdio_command",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Command *"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"node, bun, python...",...n,value:n.value??""})}),t.jsx(se,{})]})}),t.jsx(Z,{control:p.control,name:"stdio_args",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Arguments"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"arg1 arg2 --flag value",...n,value:n.value??""})}),t.jsx(se,{})]})})]}),t.jsx(Z,{control:p.control,name:"stdio_cwd",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Working Directory"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"/path/to/project (optional)",...n,value:n.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(se,{})]})})]}),(H==="NPX"||H==="STDIO")&&t.jsx(Z,{control:p.control,name:"env_vars",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Environment Variables"}),t.jsx(ne,{children:t.jsx(vn,{value:n.value??[],onChange:n.onChange})}),t.jsx(se,{})]})}),H!=="NPX"&&H!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Z,{control:p.control,name:"connection_url",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"URL *"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"https://example.com/mcp",...n,value:n.value??"",onPaste:o=>{const a=o.clipboardData.getData("text");a&&(o.preventDefault(),p.setValue("connection_url",a.trim(),{shouldDirty:!0}),ve(a))},onBlur:o=>{ve(o.target.value),n.onBlur()}})}),t.jsx(se,{})]})}),t.jsx(Z,{control:p.control,name:"connection_token",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:me?.token?.label??"Token (optional)"}),t.jsx(ne,{children:t.jsx(le,{type:"password",placeholder:me?.token?.placeholder??"Bearer token or API key",...n,value:n.value??""})}),me?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[me.token.helperText,me.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(se,{})]})})]}),t.jsx(Z,{control:p.control,name:"title",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Name *"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"My Connection",...n})}),t.jsx(se,{})]})}),t.jsx(Z,{control:p.control,name:"description",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Description"}),t.jsx(ne,{children:t.jsx(ln,{placeholder:"A brief description of this connection",rows:3,...n,value:n.value??""})}),t.jsx(se,{})]})})]}),t.jsxs(dt,{children:[t.jsx(z,{type:"button",variant:"outline",onClick:()=>qe(!1),children:"Cancel"}),t.jsx(z,{type:"submit",disabled:p.formState.isSubmitting,className:"min-w-40",children:p.formState.isSubmitting?"Saving...":A?"Update Connection":"Create Connection"})]})]})})]})}),t.jsx(Ie,{open:d.mode==="deleting",onOpenChange:n=>!n&&x({type:"close"}),children:t.jsxs(Ae,{children:[t.jsxs(Pe,{children:[t.jsx($e,{children:"Delete Connection?"}),t.jsxs(Ee,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:d.mode==="deleting"&&d.connection.title}),"."]})]}),t.jsxs(Le,{children:[t.jsx(Oe,{children:"Cancel"}),t.jsx(ze,{onClick:bt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),t.jsx(Ie,{open:d.mode==="force-deleting",onOpenChange:n=>!n&&x({type:"close"}),children:t.jsxs(Ae,{children:[t.jsxs(Pe,{children:[t.jsx($e,{children:"Connection Used by Agents"}),t.jsx(Ee,{asChild:!0,children:t.jsxs("div",{children:[t.jsxs("p",{children:["The connection"," ",t.jsx("span",{className:"font-medium text-foreground",children:d.mode==="force-deleting"&&d.connection.title})," ","is currently used by the following agent(s):"," ",t.jsx("span",{className:"font-medium text-foreground",children:d.mode==="force-deleting"&&d.agentNames}),"."]}),t.jsx("p",{className:"mt-2",children:"Deleting this connection will remove it from those agents, which may impact existing workflows that depend on them."})]})})]}),t.jsxs(Le,{children:[t.jsx(Oe,{children:"Cancel"}),t.jsx(ze,{onClick:St,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]})]})}),t.jsx(zn,{open:y,onOpenChange:k,count:v.size,onConfirm:vt}),t.jsx(On,{open:T,onOpenChange:C,agents:J,onConfirm:Nt}),t.jsxs(xe.Header,{children:[t.jsx(xe.Header.Left,{children:t.jsx(Jt,{children:t.jsx(Zt,{children:t.jsx(en,{children:t.jsx(tn,{children:"Connections"})})})})}),t.jsxs(xe.Header.Right,{children:[t.jsx(Vt,{sortKey:m.sortKey,sortDirection:m.sortDirection,onSort:m.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:O,onChange:n=>R(n||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:P,onChange:n=>F(n||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]}]}),kt]})]}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("div",{children:t.jsx(Ft,{value:m.search,onChange:m.setSearch,placeholder:"Search for a Connection...",onKeyDown:n=>{n.key==="Escape"&&(m.setSearch(""),n.target.blur())}})}),t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border",children:[t.jsx(Ut,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:b,onTabChange:n=>D(n)}),_.length>0&&t.jsx("div",{className:he(b!=="all"&&"invisible pointer-events-none"),children:t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 px-2 gap-1.5 text-sm font-normal",children:[(()=>{const n=_.find(o=>o.id===(K||_[0]?.id))??_[0];return t.jsxs(t.Fragment,{children:[t.jsx(ge,{icon:n?.icon,name:n?.title??"",size:"2xs",className:"shrink-0 rounded-sm"}),t.jsx("span",{children:n?.title})]})})(),t.jsx(xn,{size:14,className:"text-muted-foreground"})]})}),t.jsx(nt,{align:"end",children:_.map(n=>t.jsxs(Ce,{onClick:()=>ie(n.id),className:he(K===n.id||!K&&n.id===_[0]?.id?"bg-accent":""),children:[t.jsx(ge,{icon:n.icon,name:n.title,size:"2xs",className:"shrink-0 rounded-sm"}),n.title]},n.id))})]})})]})]}),t.jsx(xe.Content,{children:t.jsx("div",{className:"flex-1 overflow-auto p-5",children:(b==="all"?Te.length===0&&we.length===0:U.length===0)?t.jsx(Rt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:m.search?`No Connections match "${m.search}"`:"Create a connection to get started."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[gt.map(n=>{if(n.type==="group")return t.jsx(Pn,{group:n,onOpen:()=>$({appName:n.title,appIcon:n.icon,instances:n.connections}),selectionMode:h,selectedIds:v,onToggleSelect:E},n.key);const o=n.connection,a=v.has(o.id);return t.jsx(be,{connection:o,fallbackIcon:t.jsx(ae,{}),onClick:()=>h?E(o.id):$({appName:o.app_name||o.title,appIcon:o.icon,appDescription:o.description,instances:[o]}),className:he(a&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:h,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[h&&t.jsx(pt,{checked:a,onCheckedChange:()=>E(o.id),onClick:u=>u.stopPropagation()}),t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:u=>u.stopPropagation(),children:t.jsx(fn,{size:20})})}),t.jsxs(nt,{align:"end",onClick:u=>u.stopPropagation(),children:[t.jsxs(Ce,{onClick:u=>{u.stopPropagation(),s({to:"/$org/$project/mcps/$connectionId",params:{org:i.slug,project:re,connectionId:o.id}})},children:[t.jsx(hn,{size:16}),"Open"]}),t.jsxs(Ce,{onClick:u=>{u.stopPropagation(),E(o.id)},children:[t.jsx(Mt,{size:16}),"Select"]}),t.jsxs(Ce,{variant:"destructive",onClick:u=>{u.stopPropagation(),x({type:"delete",connection:o})},children:[t.jsx(xt,{size:16}),"Delete"]})]})]})]})},o.id)}),b==="all"&&Te.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(un,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"Verified"}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Te.map(n=>{const o=n.server?.name||n.name||n.id||"",a=Re.has(o),u=n._meta?.["mcp.mesh"],S=u?.friendlyName||u?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",L=n.server?.description||n.description||null,oe=n.server?.icons?.[0]?.src||Ze(n.server?.repository)||null,B=j.filter(G=>G.connection_type!=="VIRTUAL"&&G.app_name===o);return t.jsx(be,{connection:{title:S,description:L,icon:oe},fallbackIcon:t.jsx(ae,{}),onClick:()=>a?$({appName:S,appIcon:oe,appDescription:L,instances:B}):je(n),headerActionsAlwaysVisible:!0,headerActions:a?t.jsx(Ve,{variant:"secondary",className:"text-xs",children:"Connected"}):t.jsx(z,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:G=>{G.stopPropagation(),je(n)},children:"Connect"})},`catalog-${n.id}`)}),b==="all"&&we.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"All connections"}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),we.map(n=>{const o=n.server?.name||n.name||n.id||"",a=Re.has(o),u=n._meta?.["mcp.mesh"],S=u?.friendlyName||u?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",L=n.server?.description||n.description||null,oe=n.server?.icons?.[0]?.src||Ze(n.server?.repository)||null,B=j.filter(G=>G.connection_type!=="VIRTUAL"&&G.app_name===o);return t.jsx(be,{connection:{title:S,description:L,icon:oe},fallbackIcon:t.jsx(ae,{}),onClick:()=>a?$({appName:S,appIcon:oe,appDescription:L,instances:B}):je(n),headerActionsAlwaysVisible:!0,headerActions:a?t.jsx(Ve,{variant:"secondary",className:"text-xs",children:"Connected"}):t.jsx(z,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:G=>{G.stopPropagation(),je(n)},children:"Connect"})},`catalog-${n.id}`)}),b==="all"&&w&&t.jsx("div",{ref:ht,className:"col-span-full h-4"}),b==="all"&&W.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ut,{size:24,className:"animate-spin text-muted-foreground"})})]})})}),h&&t.jsx(Ln,{count:v.size,total:U.length,onSelectAll:()=>{f(new Set(U.map(n=>n.id)))},onDeselectAll:()=>f(new Set),onDelete:()=>k(!0),onAddToAgent:()=>C(!0),onToggleStatus:Ct,onCancel:M})]}),I&&t.jsx(Nn,{open:!0,onClose:()=>$(null),appName:I.appName,appIcon:I.appIcon,appDescription:I.appDescription,instances:I.instances})]})}function eo(){const i=de.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(wt,{children:t.jsx(Y.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ut,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Vn,{})})}),i[0]=e):e=i[0],e}export{eo as default};
1
+ import{c as de,u as rt,e as ct,j as t,O as re,B as z,E as wt,r as Y,x as Dt,d as It,f as At,at as Pt,aw as $t,t as Et,q as Lt,b as Ot,y as he,w as Q}from"./index-SkQC2bL2.js";import{g as zt}from"./generate-id-Dyweu44Y.js";import{C as Vt}from"./collection-display-button-CEqdF8O7.js";import{C as Ft}from"./collection-search-CPQlTmfx.js";import{C as Ut}from"./collection-tabs-DwGvAiHF.js";import{C as be}from"./connection-card-BDqdYEuX.js";import{I as ge}from"./integration-icon-9nN5AvVn.js";import{f as lt}from"./format-time-CMKyl-GC.js";import{D as Fe,b as Ue,c as Me,d as Be,a as at,e as dt}from"./dialog-PlqYdiap.js";import{i as Ye}from"./ChevronRight-Df5oEIdG.js";import{n as ae}from"./Container-De-pv4QL.js";import{s as mt}from"./Plus-OTc7Ql1V.js";import{a as Je}from"./Tool01-BBVRBzC0.js";import{i as Mt,C as Bt}from"./connection-status-B854Axgl.js";import{E as Rt}from"./empty-state-BUpyINsX.js";import{a as Ht,P as xe}from"./index-Bs-gkatC.js";import{U as Xt}from"./user-C2BDT4Rq.js";import{u as Kt}from"./use-binding-f1akiPTf.js";import{u as Wt}from"./use-infinite-scroll-C1Dhvj0C.js";import{u as Gt}from"./use-list-state-Djxe5eyh.js";import{u as qt}from"./use-store-discovery-C_al4z4H.js";import{f as Qt,g as Ze}from"./registry-utils-Bi8LTB_e.js";import{s as Yt}from"./slugify-CEUa2lfQ.js";import{f as Ie,a as Ae,b as Pe,c as $e,d as Ee,e as Le,A as Oe,h as ze}from"./alert-dialog-DfOenbUZ.js";import{B as Ve}from"./badge-C7XTRm7k.js";import{B as Jt,a as Zt,b as en,c as tn}from"./breadcrumb-h9Dq7GJ0.js";import{C as pt}from"./checkbox-B92JdB3t.js";import{D as et,a as tt,b as nt,c as Ce}from"./dropdown-menu-V8gWmDzD.js";import{a as nn,F as Z,b as ee,c as te,d as ne,f as se}from"./form-CnUcVXlu.js";import{I as le}from"./input-C4xXFdLa.js";import{S as sn,a as on,b as rn,c as cn,d as fe}from"./select-Bqr12jkn.js";import{T as ln}from"./textarea-Buug1Hxe.js";import{a as an,b as st}from"./use-connection-DSkVzqSP.js";import{u as dn,a as mn}from"./constants-BZUBXkLq.js";import{b as pn}from"./use-virtual-mcp-V0XoWMM_.js";import{i as un}from"./CheckVerified02-BTUqey_K.js";import{t as xn}from"./ChevronDown-BURkaeCD.js";import{i as fn}from"./DotsVertical-ZWNLrGdE.js";import{s as hn}from"./Eye-CUyEl5IU.js";import{s as De}from"./Globe02-DAjgLqHS.js";import{i as ut}from"./Loading01-CDOurw-F.js";import{i as gn}from"./Terminal-D3ILbCbK.js";import{s as xt}from"./Trash01-DhGTBhjv.js";import{s as jn}from"./XClose-C8g1LxXV.js";import{r as yn,E as vn,c as Cn,e as ft}from"./env-vars-editor-Crsr3jiO.js";import"./ArrowDown-BrkOB1Av.js";import"./ArrowUp-Bl5YEbbF.js";import"./Check-CN56KhoF.js";import"./Grid01-B7q4cvPD.js";import"./List-DxiRK8pO.js";import"./tooltip-Ckpai_jH.js";import"./index-AtuNXtl1.js";import"./SearchMd-D6jy19cO.js";import"./card-Cm-keK-z.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./X-DVxsAMCH.js";import"./AlertCircle-Bu9DNwe-.js";import"./CheckCircle-B4pYO1ZS.js";import"./useQuery-CtOvMPbo.js";import"./useMutation-CXgAMvoC.js";import"./avatar-DexhTB4g.js";import"./binder--omYMrhv.js";import"./use-view-mode-Ag3VBJ77.js";import"./use-mobile-DqlomLIB.js";import"./useInfiniteQuery-BXEdoCXW.js";import"./infiniteQueryObserver-dFlgfKVl.js";import"./label-B5UIAzjB.js";import"./ChevronUp-Ql_IhfwF.js";import"./use-collections-C3CSj681.js";function Nn(i){const e=de.c(63),{open:s,onClose:r,appName:c,appIcon:l,appDescription:m,instances:g}=i,{org:N}=rt(),j=ct(),d=N.slug;let x;e[0]!==j||e[1]!==r||e[2]!==d?(x=function(V){j({to:"/$org/$project/mcps/$connectionId",params:{org:d,project:re,connectionId:V}}),r()},e[0]=j,e[1]=r,e[2]=d,e[3]=x):x=e[3];const v=x;let f;e[4]!==c||e[5]!==j||e[6]!==r||e[7]!==d?(f=function(){j({to:"/$org/$project/mcps",params:{org:d,project:re},search:{install:c}}),r()},e[4]=c,e[5]=j,e[6]=r,e[7]=d,e[8]=f):f=e[8];const h=f;let y;if(e[9]!==g){const w=new Set;y=[];for(const V of g)for(const W of V.tools??[])w.has(W.name)||(w.add(W.name),y.push({name:W.name,description:W.description,connectionId:V.id}));e[9]=g,e[10]=y}else y=e[10];let k;e[11]!==j||e[12]!==r||e[13]!==d?(k=function(V,W){j({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:d,project:re,connectionId:W,collectionName:"tools",itemId:encodeURIComponent(V)}}),r()},e[11]=j,e[12]=r,e[13]=d,e[14]=k):k=e[14];const T=k;let C;e[15]!==r?(C=w=>!w&&r(),e[15]=r,e[16]=C):C=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(ae,{}),e[17]=b):b=e[17];let D;e[18]!==l||e[19]!==c?(D=t.jsx(ge,{icon:l,name:c,size:"md",className:"shrink-0 shadow-sm mt-0.5",fallbackIcon:b}),e[18]=l,e[19]=c,e[20]=D):D=e[20];let I;e[21]!==c?(I=t.jsx(Fe,{className:"text-base font-semibold leading-snug",children:c}),e[21]=c,e[22]=I):I=e[22];let $;e[23]!==m?($=m&&t.jsx("p",{className:"text-sm text-muted-foreground mt-0.5 line-clamp-2",children:m}),e[23]=m,e[24]=$):$=e[24];let O;e[25]!==I||e[26]!==$?(O=t.jsxs("div",{className:"min-w-0",children:[I,$]}),e[25]=I,e[26]=$,e[27]=O):O=e[27];let R;e[28]!==D||e[29]!==O?(R=t.jsx(Ue,{className:"px-6 pt-6 pb-5 shrink-0",children:t.jsxs("div",{className:"flex items-start gap-4",children:[D,O]})}),e[28]=D,e[29]=O,e[30]=R):R=e[30];const P=g.length!==1?"s":"";let F;e[31]!==P?(F=t.jsxs("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:["Connection",P]}),e[31]=P,e[32]=F):F=e[32];let J;e[33]===Symbol.for("react.memo_cache_sentinel")?(J=t.jsx(mt,{size:14}),e[33]=J):J=e[33];let q;e[34]!==h?(q=t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:h,children:[J,"Add connection"]}),e[34]=h,e[35]=q):q=e[35];let U;e[36]!==F||e[37]!==q?(U=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3",children:[F,q]}),e[36]=F,e[37]=q,e[38]=U):U=e[38];let X;if(e[39]!==g||e[40]!==v){let w;e[42]!==v?(w=V=>t.jsxs("button",{type:"button",className:"w-full flex items-center gap-3 px-6 py-3 hover:bg-muted/40 transition-colors text-left cursor-pointer",onClick:()=>v(V.id),children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:V.title}),(V.updated_at||V.created_at)&&t.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Last updated"," ",lt(new Date(V.updated_at??V.created_at))]})]}),t.jsx(Ye,{size:16,className:"text-muted-foreground shrink-0"})]},V.id),e[42]=v,e[43]=w):w=e[43],X=g.map(w),e[39]=g,e[40]=v,e[41]=X}else X=e[41];let E;e[44]!==X?(E=t.jsx("div",{className:"pb-2",children:X}),e[44]=X,e[45]=E):E=e[45];let M;e[46]!==U||e[47]!==E?(M=t.jsxs("div",{children:[U,E]}),e[46]=U,e[47]=E,e[48]=M):M=e[48];let _;e[49]!==l||e[50]!==T||e[51]!==y?(_=y.length>0&&t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 px-6 py-3",children:[t.jsx(Je,{size:14,className:"text-muted-foreground"}),t.jsxs("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:["Actions (",y.length,")"]})]}),t.jsx("div",{className:"pb-2",children:y.map(w=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-6 py-2.5 hover:bg-muted/40 transition-colors text-left cursor-pointer",onClick:()=>T(w.name,w.connectionId),children:[t.jsx(ge,{icon:l,name:w.name,size:"xs",className:"shrink-0 mt-0.5",fallbackIcon:t.jsx(Je,{size:12})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:w.name}),w.description&&t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:w.description})]}),t.jsx(Ye,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},w.name))})]}),e[49]=l,e[50]=T,e[51]=y,e[52]=_):_=e[52];let K;e[53]!==M||e[54]!==_?(K=t.jsxs("div",{className:"flex-1 overflow-y-auto divide-y divide-border",children:[M,_]}),e[53]=M,e[54]=_,e[55]=K):K=e[55];let ie;e[56]!==R||e[57]!==K?(ie=t.jsxs(Me,{className:"sm:max-w-xl p-0 gap-0 overflow-hidden flex flex-col max-h-[80vh]",children:[R,K]}),e[56]=R,e[57]=K,e[58]=ie):ie=e[58];let ce;return e[59]!==s||e[60]!==ie||e[61]!==C?(ce=t.jsx(Be,{open:s,onOpenChange:C,children:ie}),e[59]=s,e[60]=ie,e[61]=C,e[62]=ce):ce=e[62],ce}function ot(i){return i.title.trim().replace(/\s+\(\d+\)$/,"")}function bn(i){const e=new Map;for(const c of i){if(c.connection_type==="VIRTUAL")continue;const l=ot(c),m=e.get(l);m?m.push(c):e.set(l,[c])}const s=[],r=new Set;for(const c of i){if(c.connection_type==="VIRTUAL")continue;const l=ot(c);if(r.has(l))continue;r.add(l);const m=e.get(l),g=m[0];m.length===1?s.push({type:"single",connection:g}):s.push({type:"group",key:l,icon:g.icon,title:g.app_name?g.title.replace(/\s*\(\d+\)\s*$/,""):g.title,connections:m})}return s}function Sn(i){const e=new Set,s=[];for(const r of i)r.created_by&&!e.has(r.created_by)&&(e.add(r.created_by),s.push(r.created_by));return s}function Se(i){const e=i.trim();if(!e)return"";try{const s=new URL(e),r=s.pathname.length>1?s.pathname.replace(/\/+$/,""):s.pathname;return`${s.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function _n(i){const e=i.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const s=e[0]?.toLowerCase();if(s!=="npx"&&s!=="bunx")return null;const c=e.slice(1).find(l=>!l.startsWith("-"));return c?{packageName:c}:null}function Ne(i){const{uiType:e}=i,s=Se(i.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&s===Se("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(i.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function it(i){if(i.registryItems.length===0||i.uiType!=="HTTP"&&i.uiType!=="SSE"&&i.uiType!=="Websocket")return null;const e=Se(i.connectionUrl??"");if(!e)return null;const s=i.registryItems.find(l=>(l.server?.remotes??[]).some(g=>Se(g.url??"")===e));if(!s)return null;const r=s.title||s.name||s.server?.title||s.server?.name||"",c=s.server?.description||s.description||s.summary||null;return r?{id:"registry",title:r,description:c}:null}function kn(i,e){const s={command:"npx",args:["-y",i]},r=ft(e);return Object.keys(r).length>0&&(s.envVars=r),s}function Tn(i,e,s,r){const c={command:i};e.trim()&&(c.args=e.trim().split(/\s+/)),s?.trim()&&(c.cwd=s.trim());const l=ft(r);return Object.keys(l).length>0&&(c.envVars=l),c}function wn(i){return i.command==="npx"}function Dn(i){return i.args?.find(e=>!e.startsWith("-"))??""}function In(i){return{command:i.command,args:i.args?.join(" ")??"",cwd:i.cwd??""}}function An(i,e){switch(e.type){case"edit":return{mode:"editing",connection:e.connection};case"delete":return{mode:"deleting",connection:e.connection};case"force-delete":return{mode:"force-deleting",connection:e.connection,agentNames:e.agentNames};case"close":return{mode:"idle"}}}function Pn(i){const e=de.c(74),{group:s,onOpen:r,selectionMode:c,selectedIds:l,onToggleSelect:m}=i;let g;if(e[0]!==s.connections||e[1]!==l){let P;e[3]!==l?(P=F=>l.has(F.id),e[3]=l,e[4]=P):P=e[4],g=s.connections.every(P),e[0]=s.connections,e[1]=l,e[2]=g}else g=e[2];const N=g;let j;if(e[5]!==s.connections||e[6]!==l){let P;e[8]!==l?(P=F=>l.has(F.id),e[8]=l,e[9]=P):P=e[9],j=s.connections.some(P),e[5]=s.connections,e[6]=l,e[7]=j}else j=e[7];const d=j;let x,v,f,h,y,k,T,C,b,D,I;if(e[10]!==N||e[11]!==s.connections||e[12]!==s.icon||e[13]!==s.title||e[14]!==r||e[15]!==m||e[16]!==l||e[17]!==c||e[18]!==d){const P=Sn(s.connections),F=s.connections.reduce(En,s.connections[0]),J=F.updated_at??F.created_at;x=be;const q=`${s.connections.length} instances`;e[30]!==s.icon||e[31]!==s.title||e[32]!==q?(b={title:s.title,icon:s.icon,description:q},e[30]=s.icon,e[31]=s.title,e[32]=q,e[33]=b):b=e[33],e[34]!==N||e[35]!==s.connections||e[36]!==r||e[37]!==m||e[38]!==l||e[39]!==c?(D=()=>c?(()=>{for(const _ of s.connections)N?l.has(_.id)&&m(_.id):l.has(_.id)||m(_.id)})():r(),e[34]=N,e[35]=s.connections,e[36]=r,e[37]=m,e[38]=l,e[39]=c,e[40]=D):D=e[40];const U=c&&N&&"ring-2 ring-primary",X=c&&d&&!N&&"ring-1 ring-primary/50";e[41]!==U||e[42]!==X?(I=he(U,X),e[41]=U,e[42]=X,e[43]=I):I=e[43],e[44]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(ae,{}),e[44]=v):v=e[44],e[45]!==N||e[46]!==s.connections||e[47]!==m||e[48]!==l||e[49]!==c||e[50]!==d?(f=c?t.jsx(pt,{checked:N?!0:d?"indeterminate":!1,onCheckedChange:()=>{for(const _ of s.connections)N?l.has(_.id)&&m(_.id):l.has(_.id)||m(_.id)}}):t.jsxs(Ve,{variant:"secondary",className:"text-xs tabular-nums",children:["x",s.connections.length]}),e[45]=N,e[46]=s.connections,e[47]=m,e[48]=l,e[49]=c,e[50]=d,e[51]=f):f=e[51];let E;e[52]!==s.connections?(E=s.connections.slice(0,6).map($n),e[52]=s.connections,e[53]=E):E=e[53],e[54]!==E?(h=t.jsx("div",{className:"flex items-center gap-1",children:E}),e[54]=E,e[55]=h):h=e[55],T="flex items-center justify-between text-xs text-muted-foreground w-full min-w-0";const M=P.map(_=>t.jsx(Xt,{id:_,size:"3xs",avatarOnly:P.length>1},_));e[56]!==M?(C=t.jsx("div",{className:"flex items-center -space-x-1.5",children:M}),e[56]=M,e[57]=C):C=e[57],y="shrink-0 ml-2",k=J?lt(new Date(J)):"—",e[10]=N,e[11]=s.connections,e[12]=s.icon,e[13]=s.title,e[14]=r,e[15]=m,e[16]=l,e[17]=c,e[18]=d,e[19]=x,e[20]=v,e[21]=f,e[22]=h,e[23]=y,e[24]=k,e[25]=T,e[26]=C,e[27]=b,e[28]=D,e[29]=I}else x=e[19],v=e[20],f=e[21],h=e[22],y=e[23],k=e[24],T=e[25],C=e[26],b=e[27],D=e[28],I=e[29];let $;e[58]!==y||e[59]!==k?($=t.jsx("span",{className:y,children:k}),e[58]=y,e[59]=k,e[60]=$):$=e[60];let O;e[61]!==$||e[62]!==T||e[63]!==C?(O=t.jsxs("div",{className:T,children:[C,$]}),e[61]=$,e[62]=T,e[63]=C,e[64]=O):O=e[64];let R;return e[65]!==x||e[66]!==v||e[67]!==f||e[68]!==h||e[69]!==O||e[70]!==b||e[71]!==D||e[72]!==I?(R=t.jsx(t.Fragment,{children:t.jsx(x,{connection:b,onClick:D,className:I,fallbackIcon:v,headerActions:f,body:h,footer:O})}),e[65]=x,e[66]=v,e[67]=f,e[68]=h,e[69]=O,e[70]=b,e[71]=D,e[72]=I,e[73]=R):R=e[73],R}function $n(i){return t.jsx(Bt,{status:i.status},i.id)}function En(i,e){const s=e.updated_at??e.created_at,r=i.updated_at??i.created_at;return s?r?new Date(s)>new Date(r)?e:i:e:i}function Ln(i){const e=de.c(28),{count:s,total:r,onSelectAll:c,onDeselectAll:l,onDelete:m,onAddToAgent:g,onToggleStatus:N,onCancel:j}=i;if(s===0)return null;let d;e[0]!==s?(d=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[s," selected"]}),e[0]=s,e[1]=d):d=e[1];let x;e[2]!==s||e[3]!==l||e[4]!==c||e[5]!==r?(x=s<r?t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:c,children:["Select all (",r,")"]}):t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:"Clear selection"}),e[2]=s,e[3]=l,e[4]=c,e[5]=r,e[6]=x):x=e[6];let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(mt,{size:13}),e[7]=v):v=e[7];let f;e[8]!==g?(f=t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:[v,"Add to Agent"]}),e[8]=g,e[9]=f):f=e[9];let h;e[10]!==N?(h=t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("active"),children:"Enable"}),e[10]=N,e[11]=h):h=e[11];let y;e[12]!==N?(y=t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("inactive"),children:"Disable"}),e[12]=N,e[13]=y):y=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(xt,{size:13}),e[14]=k):k=e[14];let T;e[15]!==m?(T=t.jsxs(z,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:[k,"Delete"]}),e[15]=m,e[16]=T):T=e[16];let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(jn,{size:13}),e[17]=C):C=e[17];let b;e[18]!==j?(b=t.jsx(z,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:j,children:C}),e[18]=j,e[19]=b):b=e[19];let D;return e[20]!==d||e[21]!==b||e[22]!==x||e[23]!==f||e[24]!==h||e[25]!==y||e[26]!==T?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[d,x,f,h,y,T,b]})}),e[20]=d,e[21]=b,e[22]=x,e[23]=f,e[24]=h,e[25]=y,e[26]=T,e[27]=D):D=e[27],D}function On(i){const e=de.c(25),{open:s,onOpenChange:r,agents:c,onConfirm:l}=i,[m,g]=Y.useState(null);let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsxs(Ue,{children:[t.jsx(Fe,{children:"Add to Agent"}),t.jsx(at,{children:"Select an agent to add the selected connections to."})]}),e[0]=N):N=e[0];let j;e[1]!==c||e[2]!==m?(j=c.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):c.map(C=>t.jsxs("button",{type:"button",onClick:()=>g(C.id),className:he("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",m===C.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(ge,{icon:C.icon,name:C.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:C.title}),C.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:C.description})]})]},C.id)),e[1]=c,e[2]=m,e[3]=j):j=e[3];let d;e[4]!==j?(d=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[4]=j,e[5]=d):d=e[5];let x;e[6]!==r?(x=t.jsx(z,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e[6]=r,e[7]=x):x=e[7];const v=!m;let f;e[8]!==l||e[9]!==r||e[10]!==m?(f=()=>{m&&(l(m),r(!1),g(null))},e[8]=l,e[9]=r,e[10]=m,e[11]=f):f=e[11];let h;e[12]!==v||e[13]!==f?(h=t.jsx(z,{disabled:v,onClick:f,children:"Add"}),e[12]=v,e[13]=f,e[14]=h):h=e[14];let y;e[15]!==x||e[16]!==h?(y=t.jsxs(dt,{children:[x,h]}),e[15]=x,e[16]=h,e[17]=y):y=e[17];let k;e[18]!==d||e[19]!==y?(k=t.jsxs(Me,{className:"sm:max-w-[400px]",children:[N,d,y]}),e[18]=d,e[19]=y,e[20]=k):k=e[20];let T;return e[21]!==r||e[22]!==s||e[23]!==k?(T=t.jsx(Be,{open:s,onOpenChange:r,children:k}),e[21]=r,e[22]=s,e[23]=k,e[24]=T):T=e[24],T}function zn(i){const e=de.c(20),{open:s,onOpenChange:r,count:c,onConfirm:l}=i,m=c!==1?"s":"";let g;e[0]!==c||e[1]!==m?(g=t.jsxs($e,{children:["Delete ",c," connection",m,"?"]}),e[0]=c,e[1]=m,e[2]=g):g=e[2];const N=c!==1?"s":"";let j;e[3]!==N?(j=t.jsxs(Ee,{children:["This will permanently delete the selected connection",N,". This action cannot be undone."]}),e[3]=N,e[4]=j):j=e[4];let d;e[5]!==g||e[6]!==j?(d=t.jsxs(Pe,{children:[g,j]}),e[5]=g,e[6]=j,e[7]=d):d=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Oe,{children:"Cancel"}),e[8]=x):x=e[8];const v=c!==1?"s":"";let f;e[9]!==c||e[10]!==l||e[11]!==v?(f=t.jsxs(Le,{children:[x,t.jsxs(ze,{onClick:l,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",c," connection",v]})]}),e[9]=c,e[10]=l,e[11]=v,e[12]=f):f=e[12];let h;e[13]!==d||e[14]!==f?(h=t.jsxs(Ae,{children:[d,f]}),e[13]=d,e[14]=f,e[15]=h):h=e[15];let y;return e[16]!==r||e[17]!==s||e[18]!==h?(y=t.jsx(Ie,{open:s,onOpenChange:r,children:h}),e[16]=r,e[17]=s,e[18]=h,e[19]=y):y=e[19],y}function Vn(){const{org:i}=rt(),e=Dt(),s=ct(),r=It({strict:!1}),{data:c}=At.useSession(),{stdioEnabled:l}=Pt(),m=Gt({namespace:i.slug,resource:"connections"}),g=an(),N=st(m),j=st(),[d,x]=Y.useReducer(An,{mode:"idle"}),[v,f]=Y.useState(new Set),h=v.size>0,[y,k]=Y.useState(!1),[T,C]=Y.useState(!1),[b,D]=Y.useState("all"),[I,$]=Y.useState(null),[O,R]=Y.useState("ALL"),[P,F]=Y.useState("ALL"),J=pn(),U=N.filter(n=>!(n.connection_type==="VIRTUAL"||O!=="ALL"&&n.connection_type!==O||P!=="ALL"&&n.status!==P)),X=bn(U),E=n=>{f(o=>{const a=new Set(o);return a.has(n)?a.delete(n):a.add(n),a})},M=()=>{f(new Set)},_=Kt(j).sort((n,o)=>{const a=n.app_name==="@deco/management-mcp",u=o.app_name==="@deco/management-mcp";return a&&!u?1:!a&&u?-1:0}),[K,ie]=Ht($t.selectedRegistry(i.slug),n=>n??""),ce=(K?_.find(n=>n.id===K):void 0)??_[0],w=ce?.id??"",V=Qt(ce?.tools),W=qt({registryId:w,listToolName:V}),_e=W.items,ht=Wt(W.loadMore,W.hasMore,W.isLoadingMore),Re=new Set(j.filter(n=>n.connection_type!=="VIRTUAL"&&n.app_name).map(n=>n.app_name)),ke=m.search.toLowerCase(),He=b==="all"?_e.filter(n=>{if(!ke)return!0;const o=n._meta?.["mcp.mesh"],a=[o?.friendly_name,n.server?.name,n.server?.title,n.name,n.title,n.id].filter(Boolean).join(" "),u=[o?.short_description,o?.mesh_description,n.server?.description,n.description].filter(Boolean).join(" ");return a.toLowerCase().includes(ke)||u.toLowerCase().includes(ke)}):[],Te=He.filter(n=>n.verified||n._meta?.["mcp.mesh"]?.verified||n.meta?.verified),we=He.filter(n=>!n.verified&&!n._meta?.["mcp.mesh"]?.verified&&!n.meta?.verified),gt=b==="all"?[]:X,je=n=>{const o=Yt(n.name||n.title||n.server?.title||""),a=typeof n.id=="string"&&n.id.includes("/"),u=typeof n.server?.name=="string"&&n.server.name.includes("/"),S=a&&!u?n.id:n.server?.name||n.id||"";s({to:"/$org/$project/store/$appName",params:{org:i.slug,project:re,appName:o},search:{registryId:w,serverName:S}})},Xe=r.action==="create",jt=()=>{s({to:"/$org/$project/mcps",params:{org:i.slug,project:re},search:{action:"create"}})},Ke=()=>{s({to:"/$org/$project/mcps",params:{org:i.slug,project:re},search:{}})},p=Et({resolver:Lt(Cn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),H=p.watch("ui_type"),We=p.watch("connection_url"),yt=p.watch("npx_package"),me=Ne({uiType:H,connectionUrl:We??"",npxPackage:yt??""})??it({uiType:H,connectionUrl:We??"",registryItems:_e}),A=d.mode==="editing"?d.connection:null;Y.useEffect(()=>{if(A){const n=Ot(A.connection_headers)?A.connection_headers:null;if(n&&A.connection_type==="STDIO"){const o=yn(n.envVars);if(wn(n)){const a=Dn(n);p.reset({title:A.title,description:A.description,icon:A.icon??null,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o})}else{const a=In(n);p.reset({title:A.title,description:A.description,icon:A.icon??null,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:o})}}else p.reset({title:A.title,description:A.description,icon:A.icon??null,ui_type:A.connection_type,connection_url:A.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else p.reset({title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[A,p]);const pe=dn({connectionId:mn,orgId:i.id}),ye=()=>{e.invalidateQueries({predicate:n=>{const o=n.queryKey;return o[1]===i.id&&o[3]==="collection"&&o[4]==="CONNECTIONS"}})},vt=async()=>{k(!1);const n=[...v];let o=0;for(const a of n)try{(await pe.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:a,force:!0}})).isError||o++}catch{}ye(),Q.success(`Deleted ${o} connection${o!==1?"s":""}`),M()},Ct=async n=>{const o=[...v];let a=0;for(const u of o)try{await g.update.mutateAsync({id:u,data:{status:n}}),a++}catch{}ye(),Q.success(`${n==="active"?"Enabled":"Disabled"} ${a} connection${a!==1?"s":""}`),M()},Nt=async n=>{const o=J.find(S=>S.id===n);if(!o||!pe)return;const a=new Set(o.connections.map(S=>S.connection_id)),u=[...v].filter(S=>!a.has(S)).map(S=>({connection_id:S,selected_tools:null,selected_resources:null,selected_prompts:null}));if(u.length===0){Q.info("All selected connections are already in that agent");return}try{await pe.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:n,data:{connections:[...o.connections,...u]}}}),e.invalidateQueries({predicate:S=>{const L=S.queryKey;return L[1]===i.id&&L[3]==="collection"&&L[4]==="VIRTUAL_MCP"}}),Q.success(`Added ${u.length} connection${u.length!==1?"s":""} to "${o.title}"`),M()}catch{Q.error("Failed to add connections to agent")}},Ge=n=>{const o=n.content;return Array.isArray(o)&&o[0]?.type==="text"&&typeof o[0].text=="string"?o[0].text:"Unknown error"},bt=async()=>{if(d.mode!=="deleting")return;const n=d.connection;x({type:"close"});try{const o=await pe.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:n.id}});if(o.isError){const a=Ge(o),u=a.replace(/^Error:\s*/,"");try{const S=JSON.parse(u);if(S.code==="CONNECTION_IN_USE"&&S.agentNames){x({type:"force-delete",connection:n,agentNames:S.agentNames.map(L=>`"${L}"`).join(", ")});return}}catch{}Q.error(`Failed to delete connection: ${a}`);return}ye(),Q.success("Connection deleted successfully")}catch(o){const a=o instanceof Error?o.message:String(o);Q.error(`Failed to delete connection: ${a}`)}},St=async()=>{if(d.mode!=="force-deleting")return;const n=d.connection.id;x({type:"close"});try{const o=await pe.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:n,force:!0}});if(o.isError){Q.error(`Failed to delete connection: ${Ge(o)}`);return}ye(),Q.success("Connection deleted successfully")}catch(o){const a=o instanceof Error?o.message:String(o);Q.error(`Failed to delete connection: ${a}`)}},_t=async n=>{let o,a=null,u=null,S=null;if(n.ui_type==="NPX"?(o="STDIO",a="",S=kn(n.npx_package||"",n.env_vars||[])):n.ui_type==="STDIO"?(o="STDIO",a="",S=Tn(n.stdio_command||"",n.stdio_args||"",n.stdio_cwd,n.env_vars||[])):(o=n.ui_type,a=n.connection_url||"",u=n.connection_token||null),A){await g.update.mutateAsync({id:A.id,data:{title:n.title,description:n.description||null,icon:n.icon??null,connection_type:o,connection_url:a,...u&&{connection_token:u},...S&&{connection_headers:S}}}),x({type:"close"}),p.reset();return}const L=zt("conn");await g.create.mutateAsync({id:L,title:n.title,description:n.description||null,connection_type:o,connection_url:a,connection_token:u,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:c?.user?.id||"system",organization_id:i.id,icon:n.icon??null,app_name:null,app_id:null,connection_headers:S,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),Ke(),p.reset(),s({to:"/$org/$project/mcps/$connectionId",params:{org:i.slug,project:re,connectionId:L}})},qe=n=>{n||(Xe?Ke():x({type:"close"}),p.reset())},ve=n=>{const o=n.trim();if(!o)return;const a=!!p.formState.dirtyFields.title,u=!!p.formState.dirtyFields.description,S=!!p.formState.dirtyFields.env_vars,L=B=>{if(B&&(!a&&!p.getValues("title").trim()&&B.title&&p.setValue("title",B.title,{shouldDirty:!1}),!u&&!(p.getValues("description")??"").trim()&&B.description&&p.setValue("description",B.description,{shouldDirty:!1}),!S&&B.envVarKeys?.length)){const G=p.getValues("env_vars")??[],Tt=new Set(G.map(ue=>ue.key)),Qe=B.envVarKeys.filter(ue=>!Tt.has(ue));Qe.length>0&&p.setValue("env_vars",[...G,...Qe.map(ue=>({key:ue,value:""}))],{shouldDirty:!0})}},oe=_n(o);if(oe&&l){p.setValue("ui_type","NPX",{shouldDirty:!0}),p.setValue("npx_package",oe.packageName,{shouldDirty:!0}),p.setValue("connection_url","",{shouldDirty:!0}),p.setValue("connection_token",null,{shouldDirty:!0}),L(Ne({uiType:"NPX",npxPackage:oe.packageName}));return}if(o.startsWith("http://")||o.startsWith("https://")){const B=H==="HTTP"||H==="SSE"||H==="Websocket"?H:"HTTP";p.setValue("ui_type",B,{shouldDirty:!0}),p.setValue("connection_url",o,{shouldDirty:!0}),L(Ne({uiType:B,connectionUrl:o})??it({uiType:B,connectionUrl:o,registryItems:_e}));return}H==="NPX"&&L(Ne({uiType:"NPX",npxPackage:o}))},kt=t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(z,{variant:"outline",onClick:jt,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})});return t.jsxs(t.Fragment,{children:[t.jsxs(xe,{children:[t.jsx(Be,{open:Xe||d.mode==="editing",onOpenChange:qe,children:t.jsxs(Me,{className:"sm:max-w-[525px]",children:[t.jsxs(Ue,{children:[t.jsx(Fe,{children:A?"Edit Connection":"Create Connection"}),t.jsx(at,{children:A?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),t.jsx(nn,{...p,children:t.jsxs("form",{onSubmit:p.handleSubmit(_t),children:[t.jsxs("div",{className:"grid gap-4 py-4",children:[t.jsx(Z,{control:p.control,name:"ui_type",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Type *"}),t.jsxs(sn,{value:n.value,onValueChange:n.onChange,children:[t.jsx(ne,{children:t.jsx(on,{children:t.jsx(rn,{})})}),t.jsxs(cn,{children:[t.jsx(fe,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(fe,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(fe,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(fe,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ae,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(fe,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(gn,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(se,{})]})}),H==="NPX"&&t.jsx(t.Fragment,{children:t.jsx(Z,{control:p.control,name:"npx_package",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"NPM Package *"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"@perplexity-ai/mcp-server",...n,value:n.value??"",onPaste:o=>{const a=o.clipboardData.getData("text");a&&(o.preventDefault(),p.setValue("npx_package",a.trim(),{shouldDirty:!0}),ve(a))},onBlur:o=>{ve(o.target.value),n.onBlur()}})}),t.jsx(se,{})]})})}),H==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Z,{control:p.control,name:"stdio_command",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Command *"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"node, bun, python...",...n,value:n.value??""})}),t.jsx(se,{})]})}),t.jsx(Z,{control:p.control,name:"stdio_args",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Arguments"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"arg1 arg2 --flag value",...n,value:n.value??""})}),t.jsx(se,{})]})})]}),t.jsx(Z,{control:p.control,name:"stdio_cwd",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Working Directory"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"/path/to/project (optional)",...n,value:n.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(se,{})]})})]}),(H==="NPX"||H==="STDIO")&&t.jsx(Z,{control:p.control,name:"env_vars",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Environment Variables"}),t.jsx(ne,{children:t.jsx(vn,{value:n.value??[],onChange:n.onChange})}),t.jsx(se,{})]})}),H!=="NPX"&&H!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Z,{control:p.control,name:"connection_url",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"URL *"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"https://example.com/mcp",...n,value:n.value??"",onPaste:o=>{const a=o.clipboardData.getData("text");a&&(o.preventDefault(),p.setValue("connection_url",a.trim(),{shouldDirty:!0}),ve(a))},onBlur:o=>{ve(o.target.value),n.onBlur()}})}),t.jsx(se,{})]})}),t.jsx(Z,{control:p.control,name:"connection_token",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:me?.token?.label??"Token (optional)"}),t.jsx(ne,{children:t.jsx(le,{type:"password",placeholder:me?.token?.placeholder??"Bearer token or API key",...n,value:n.value??""})}),me?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[me.token.helperText,me.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(se,{})]})})]}),t.jsx(Z,{control:p.control,name:"title",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Name *"}),t.jsx(ne,{children:t.jsx(le,{placeholder:"My Connection",...n})}),t.jsx(se,{})]})}),t.jsx(Z,{control:p.control,name:"description",render:({field:n})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Description"}),t.jsx(ne,{children:t.jsx(ln,{placeholder:"A brief description of this connection",rows:3,...n,value:n.value??""})}),t.jsx(se,{})]})})]}),t.jsxs(dt,{children:[t.jsx(z,{type:"button",variant:"outline",onClick:()=>qe(!1),children:"Cancel"}),t.jsx(z,{type:"submit",disabled:p.formState.isSubmitting,className:"min-w-40",children:p.formState.isSubmitting?"Saving...":A?"Update Connection":"Create Connection"})]})]})})]})}),t.jsx(Ie,{open:d.mode==="deleting",onOpenChange:n=>!n&&x({type:"close"}),children:t.jsxs(Ae,{children:[t.jsxs(Pe,{children:[t.jsx($e,{children:"Delete Connection?"}),t.jsxs(Ee,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:d.mode==="deleting"&&d.connection.title}),"."]})]}),t.jsxs(Le,{children:[t.jsx(Oe,{children:"Cancel"}),t.jsx(ze,{onClick:bt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),t.jsx(Ie,{open:d.mode==="force-deleting",onOpenChange:n=>!n&&x({type:"close"}),children:t.jsxs(Ae,{children:[t.jsxs(Pe,{children:[t.jsx($e,{children:"Connection Used by Agents"}),t.jsx(Ee,{asChild:!0,children:t.jsxs("div",{children:[t.jsxs("p",{children:["The connection"," ",t.jsx("span",{className:"font-medium text-foreground",children:d.mode==="force-deleting"&&d.connection.title})," ","is currently used by the following agent(s):"," ",t.jsx("span",{className:"font-medium text-foreground",children:d.mode==="force-deleting"&&d.agentNames}),"."]}),t.jsx("p",{className:"mt-2",children:"Deleting this connection will remove it from those agents, which may impact existing workflows that depend on them."})]})})]}),t.jsxs(Le,{children:[t.jsx(Oe,{children:"Cancel"}),t.jsx(ze,{onClick:St,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]})]})}),t.jsx(zn,{open:y,onOpenChange:k,count:v.size,onConfirm:vt}),t.jsx(On,{open:T,onOpenChange:C,agents:J,onConfirm:Nt}),t.jsxs(xe.Header,{children:[t.jsx(xe.Header.Left,{children:t.jsx(Jt,{children:t.jsx(Zt,{children:t.jsx(en,{children:t.jsx(tn,{children:"Connections"})})})})}),t.jsxs(xe.Header.Right,{children:[t.jsx(Vt,{sortKey:m.sortKey,sortDirection:m.sortDirection,onSort:m.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:O,onChange:n=>R(n||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:P,onChange:n=>F(n||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]}]}),kt]})]}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("div",{children:t.jsx(Ft,{value:m.search,onChange:m.setSearch,placeholder:"Search for a Connection...",onKeyDown:n=>{n.key==="Escape"&&(m.setSearch(""),n.target.blur())}})}),t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border",children:[t.jsx(Ut,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:b,onTabChange:n=>D(n)}),_.length>0&&t.jsx("div",{className:he(b!=="all"&&"invisible pointer-events-none"),children:t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 px-2 gap-1.5 text-sm font-normal",children:[(()=>{const n=_.find(o=>o.id===(K||_[0]?.id))??_[0];return t.jsxs(t.Fragment,{children:[t.jsx(ge,{icon:n?.icon,name:n?.title??"",size:"2xs",className:"shrink-0 rounded-sm"}),t.jsx("span",{children:n?.title})]})})(),t.jsx(xn,{size:14,className:"text-muted-foreground"})]})}),t.jsx(nt,{align:"end",children:_.map(n=>t.jsxs(Ce,{onClick:()=>ie(n.id),className:he(K===n.id||!K&&n.id===_[0]?.id?"bg-accent":""),children:[t.jsx(ge,{icon:n.icon,name:n.title,size:"2xs",className:"shrink-0 rounded-sm"}),n.title]},n.id))})]})})]})]}),t.jsx(xe.Content,{children:t.jsx("div",{className:"flex-1 overflow-auto p-5",children:(b==="all"?Te.length===0&&we.length===0:U.length===0)?t.jsx(Rt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:m.search?`No Connections match "${m.search}"`:"Create a connection to get started."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[gt.map(n=>{if(n.type==="group")return t.jsx(Pn,{group:n,onOpen:()=>$({appName:n.title,appIcon:n.icon,instances:n.connections}),selectionMode:h,selectedIds:v,onToggleSelect:E},n.key);const o=n.connection,a=v.has(o.id);return t.jsx(be,{connection:o,fallbackIcon:t.jsx(ae,{}),onClick:()=>h?E(o.id):$({appName:o.app_name||o.title,appIcon:o.icon,appDescription:o.description,instances:[o]}),className:he(a&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:h,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[h&&t.jsx(pt,{checked:a,onCheckedChange:()=>E(o.id),onClick:u=>u.stopPropagation()}),t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:u=>u.stopPropagation(),children:t.jsx(fn,{size:20})})}),t.jsxs(nt,{align:"end",onClick:u=>u.stopPropagation(),children:[t.jsxs(Ce,{onClick:u=>{u.stopPropagation(),s({to:"/$org/$project/mcps/$connectionId",params:{org:i.slug,project:re,connectionId:o.id}})},children:[t.jsx(hn,{size:16}),"Open"]}),t.jsxs(Ce,{onClick:u=>{u.stopPropagation(),E(o.id)},children:[t.jsx(Mt,{size:16}),"Select"]}),t.jsxs(Ce,{variant:"destructive",onClick:u=>{u.stopPropagation(),x({type:"delete",connection:o})},children:[t.jsx(xt,{size:16}),"Delete"]})]})]})]})},o.id)}),b==="all"&&Te.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(un,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"Verified"}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Te.map(n=>{const o=n.server?.name||n.name||n.id||"",a=Re.has(o),u=n._meta?.["mcp.mesh"],S=u?.friendlyName||u?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",L=n.server?.description||n.description||null,oe=n.server?.icons?.[0]?.src||Ze(n.server?.repository)||null,B=j.filter(G=>G.connection_type!=="VIRTUAL"&&G.app_name===o);return t.jsx(be,{connection:{title:S,description:L,icon:oe},fallbackIcon:t.jsx(ae,{}),onClick:()=>a?$({appName:S,appIcon:oe,appDescription:L,instances:B}):je(n),headerActionsAlwaysVisible:!0,headerActions:a?t.jsx(Ve,{variant:"secondary",className:"text-xs",children:"Connected"}):t.jsx(z,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:G=>{G.stopPropagation(),je(n)},children:"Connect"})},`catalog-${n.id}`)}),b==="all"&&we.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"All connections"}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),we.map(n=>{const o=n.server?.name||n.name||n.id||"",a=Re.has(o),u=n._meta?.["mcp.mesh"],S=u?.friendlyName||u?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",L=n.server?.description||n.description||null,oe=n.server?.icons?.[0]?.src||Ze(n.server?.repository)||null,B=j.filter(G=>G.connection_type!=="VIRTUAL"&&G.app_name===o);return t.jsx(be,{connection:{title:S,description:L,icon:oe},fallbackIcon:t.jsx(ae,{}),onClick:()=>a?$({appName:S,appIcon:oe,appDescription:L,instances:B}):je(n),headerActionsAlwaysVisible:!0,headerActions:a?t.jsx(Ve,{variant:"secondary",className:"text-xs",children:"Connected"}):t.jsx(z,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:G=>{G.stopPropagation(),je(n)},children:"Connect"})},`catalog-${n.id}`)}),b==="all"&&w&&t.jsx("div",{ref:ht,className:"col-span-full h-4"}),b==="all"&&W.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ut,{size:24,className:"animate-spin text-muted-foreground"})})]})})}),h&&t.jsx(Ln,{count:v.size,total:U.length,onSelectAll:()=>{f(new Set(U.map(n=>n.id)))},onDeselectAll:()=>f(new Set),onDelete:()=>k(!0),onAddToAgent:()=>C(!0),onToggleStatus:Ct,onCancel:M})]}),I&&t.jsx(Nn,{open:!0,onClose:()=>$(null),appName:I.appName,appIcon:I.appIcon,appDescription:I.appDescription,instances:I.instances})]})}function eo(){const i=de.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(wt,{children:t.jsx(Y.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ut,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Vn,{})})}),i[0]=e):e=i[0],e}export{eo as default};
@@ -1 +1 @@
1
- import{bO as h,c as d,v as g,bP as y}from"./index-BXUNq6d7.js";const m={authConfig:()=>["authConfig"],threads:e=>["threads",e],virtualMcpThreads:(e,t)=>["threads",e,"virtual-mcp",t],thread:(e,t)=>["thread",e,t],threadMessages:(e,t)=>["thread-messages",e,t],messages:e=>["messages",e],organizations:()=>["organizations"],members:e=>[e,"members"],invitations:e=>[e,"invitations"],organizationRoles:e=>[e,"organization-roles"],connections:e=>[e,"connections"],connectionsByBinding:(e,t)=>[e,"connections",`binding:${t}`],connection:(e,t)=>[e,"connection",t],isMCPAuthenticated:(e,t)=>["is-mcp-authenticated",e,t],mcpTools:(e,t)=>["mcp","tools",e,t],mcpClient:(e,t,n,o)=>["mcp","client",e,t,n,o],mcpToolsList:e=>["mcp","client",e,"tools"],mcpResourcesList:e=>["mcp","client",e,"resources"],mcpPromptsList:e=>["mcp","client",e,"prompts"],mcpReadResource:(e,t)=>["mcp","client",e,"resource",t],mcpGetPrompt:(e,t,n)=>["mcp","client",e,"prompt",t,n],mcpToolCall:(e,t,n)=>["mcp","client",e,"tool-call",t,n],organizationSettings:e=>["organization-settings",e],activeOrganization:e=>["activeOrganization",e],modelsList:e=>["models-list",e],connectionCollections:e=>[e,"collections","discovery"],toolCall:(e,t,n)=>["tool-call",e,t,n],collectionItems:(e,t)=>["collection",e,t],collection:(e,t,n)=>[e,t,"collection",n],collectionItem:(e,t,n,o,i)=>[e,t,n,"collection",o,i],collectionList:(e,t,n,o,i)=>[e,t,n,"collection",o,"list",i],collectionListInfinite:(e,t,n,o,i)=>[e,t,n,"collection",o,"list-infinite",i],githubReadme:(e,t)=>["github-readme",e,t],monitoringStats:()=>["monitoring","stats"],monitoringLogs:e=>["monitoring","logs",e],monitoringLogsInfinite:(e,t)=>["monitoring","logs-infinite",e,t],virtualMcpPrompts:e=>["virtual-mcp",e,"prompts"],connectionPrompts:e=>["connection",e,"prompts"],connectionResources:e=>["connection",e,"resources"],user:e=>["user",e]};class _ extends h{constructor(t,n){super(t,n)}send(t,n){const o=C(t);return o?.type==="emit"?(this.onmessage?.(o.message),Promise.resolve()):o?.type==="suppress"?Promise.resolve():super.send(t,n)}}function C(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"mesh-virtual-mcp",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const b={name:"mesh-sdk",version:"1.0.0"};function T(e,t){const n=t??(typeof window<"u"?window.location.origin:void 0);if(!n)throw new Error("MCP client requires either meshUrl option or a browser environment.");const o=e?`/mcp/${e}`:"/mcp";return new URL(o,n).href}async function f({connectionId:e,orgId:t,token:n,meshUrl:o}){const i=T(e,o),s=new y(b,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),r=new _(new URL(i),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream","x-org-id":t,...n?{Authorization:`Bearer ${n}`}:{}}}});await s.connect(r);const l=m.mcpClient(t,e??"self",n??"",o??"");return s.toJSON=()=>`mcp-client:${l.join(":")}`,s}function S(e){const t=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:s}=e;let r;t[0]!==n||t[1]!==s||t[2]!==o||t[3]!==i?(r=m.mcpClient(o,n??"self",i??"",s??""),t[0]=n,t[1]=s,t[2]=o,t[3]=i,t[4]=r):r=t[4];const l=r;let c;t[5]!==n||t[6]!==s||t[7]!==o||t[8]!==i?(c=()=>f({connectionId:n,orgId:o,token:i,meshUrl:s}),t[5]=n,t[6]=s,t[7]=o,t[8]=i,t[9]=c):c=t[9];let a;t[10]!==l||t[11]!==c?(a={queryKey:l,queryFn:c,staleTime:1/0,gcTime:0},t[10]=l,t[11]=c,t[12]=a):a=t[12];const{data:u}=g(a);return u}function w(e){const t=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:s}=e;let r;t[0]!==n||t[1]!==s||t[2]!==o||t[3]!==i?(r=n!==void 0?m.mcpClient(o,n??"self",i??"",s??""):["mcp","client","skip",o],t[0]=n,t[1]=s,t[2]=o,t[3]=i,t[4]=r):r=t[4];const l=r;let c;t[5]!==n||t[6]!==s||t[7]!==o||t[8]!==i?(c=async()=>n===void 0?null:f({connectionId:n,orgId:o,token:i,meshUrl:s}),t[5]=n,t[6]=s,t[7]=o,t[8]=i,t[9]=c):c=t[9];let a;t[10]!==l||t[11]!==c?(a={queryKey:l,queryFn:c,staleTime:1/0,gcTime:0},t[10]=l,t[11]=c,t[12]=a):a=t[12];const{data:u}=g(a);return u??null}const P={SELF:e=>`${e}_self`,REGISTRY:e=>`${e}_registry`,COMMUNITY_REGISTRY:e=>`${e}_community-registry`,DEV_ASSETS:e=>`${e}_dev-assets`},M="self";function R(e){return{id:P.REGISTRY(e),title:"Deco Store",description:"Official deco MCP registry with curated integrations",connection_type:"HTTP",connection_url:"https://studio.decocms.com/org/deco/registry/mcp",icon:"https://assets.decocache.com/decocms/00ccf6c3-9e13-4517-83b0-75ab84554bb9/596364c63320075ca58483660156b6d9de9b526e.png",app_name:"deco-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function L(){return{id:"community-registry",title:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",connection_type:"HTTP",connection_url:"https://sites-registry.decocache.com/mcp",icon:"https://assets.decocache.com/decocms/cd7ca472-0f72-463a-b0de-6e44bdd0f9b4/mcp.png",app_name:"mcp-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function D(e){return{id:v(e),organization_id:e,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:null},connections:[]}}const p="decopilot_";function E(e){return!e||!e.startsWith(p)?null:e.slice(p.length)||null}function v(e){return`${p}${e}`}export{m as K,_ as S,P as W,M as a,L as b,f as c,D as d,R as e,w as f,v as g,E as i,S as u};
1
+ import{bO as h,c as d,v as g,bP as y}from"./index-SkQC2bL2.js";const m={authConfig:()=>["authConfig"],threads:e=>["threads",e],virtualMcpThreads:(e,t)=>["threads",e,"virtual-mcp",t],thread:(e,t)=>["thread",e,t],threadMessages:(e,t)=>["thread-messages",e,t],messages:e=>["messages",e],organizations:()=>["organizations"],members:e=>[e,"members"],invitations:e=>[e,"invitations"],organizationRoles:e=>[e,"organization-roles"],connections:e=>[e,"connections"],connectionsByBinding:(e,t)=>[e,"connections",`binding:${t}`],connection:(e,t)=>[e,"connection",t],isMCPAuthenticated:(e,t)=>["is-mcp-authenticated",e,t],mcpTools:(e,t)=>["mcp","tools",e,t],mcpClient:(e,t,n,o)=>["mcp","client",e,t,n,o],mcpToolsList:e=>["mcp","client",e,"tools"],mcpResourcesList:e=>["mcp","client",e,"resources"],mcpPromptsList:e=>["mcp","client",e,"prompts"],mcpReadResource:(e,t)=>["mcp","client",e,"resource",t],mcpGetPrompt:(e,t,n)=>["mcp","client",e,"prompt",t,n],mcpToolCall:(e,t,n)=>["mcp","client",e,"tool-call",t,n],organizationSettings:e=>["organization-settings",e],activeOrganization:e=>["activeOrganization",e],modelsList:e=>["models-list",e],connectionCollections:e=>[e,"collections","discovery"],toolCall:(e,t,n)=>["tool-call",e,t,n],collectionItems:(e,t)=>["collection",e,t],collection:(e,t,n)=>[e,t,"collection",n],collectionItem:(e,t,n,o,i)=>[e,t,n,"collection",o,i],collectionList:(e,t,n,o,i)=>[e,t,n,"collection",o,"list",i],collectionListInfinite:(e,t,n,o,i)=>[e,t,n,"collection",o,"list-infinite",i],githubReadme:(e,t)=>["github-readme",e,t],monitoringStats:()=>["monitoring","stats"],monitoringLogs:e=>["monitoring","logs",e],monitoringLogsInfinite:(e,t)=>["monitoring","logs-infinite",e,t],virtualMcpPrompts:e=>["virtual-mcp",e,"prompts"],connectionPrompts:e=>["connection",e,"prompts"],connectionResources:e=>["connection",e,"resources"],user:e=>["user",e]};class _ extends h{constructor(t,n){super(t,n)}send(t,n){const o=C(t);return o?.type==="emit"?(this.onmessage?.(o.message),Promise.resolve()):o?.type==="suppress"?Promise.resolve():super.send(t,n)}}function C(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"mesh-virtual-mcp",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const b={name:"mesh-sdk",version:"1.0.0"};function T(e,t){const n=t??(typeof window<"u"?window.location.origin:void 0);if(!n)throw new Error("MCP client requires either meshUrl option or a browser environment.");const o=e?`/mcp/${e}`:"/mcp";return new URL(o,n).href}async function f({connectionId:e,orgId:t,token:n,meshUrl:o}){const i=T(e,o),s=new y(b,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),r=new _(new URL(i),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream","x-org-id":t,...n?{Authorization:`Bearer ${n}`}:{}}}});await s.connect(r);const l=m.mcpClient(t,e??"self",n??"",o??"");return s.toJSON=()=>`mcp-client:${l.join(":")}`,s}function S(e){const t=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:s}=e;let r;t[0]!==n||t[1]!==s||t[2]!==o||t[3]!==i?(r=m.mcpClient(o,n??"self",i??"",s??""),t[0]=n,t[1]=s,t[2]=o,t[3]=i,t[4]=r):r=t[4];const l=r;let c;t[5]!==n||t[6]!==s||t[7]!==o||t[8]!==i?(c=()=>f({connectionId:n,orgId:o,token:i,meshUrl:s}),t[5]=n,t[6]=s,t[7]=o,t[8]=i,t[9]=c):c=t[9];let a;t[10]!==l||t[11]!==c?(a={queryKey:l,queryFn:c,staleTime:1/0,gcTime:0},t[10]=l,t[11]=c,t[12]=a):a=t[12];const{data:u}=g(a);return u}function w(e){const t=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:s}=e;let r;t[0]!==n||t[1]!==s||t[2]!==o||t[3]!==i?(r=n!==void 0?m.mcpClient(o,n??"self",i??"",s??""):["mcp","client","skip",o],t[0]=n,t[1]=s,t[2]=o,t[3]=i,t[4]=r):r=t[4];const l=r;let c;t[5]!==n||t[6]!==s||t[7]!==o||t[8]!==i?(c=async()=>n===void 0?null:f({connectionId:n,orgId:o,token:i,meshUrl:s}),t[5]=n,t[6]=s,t[7]=o,t[8]=i,t[9]=c):c=t[9];let a;t[10]!==l||t[11]!==c?(a={queryKey:l,queryFn:c,staleTime:1/0,gcTime:0},t[10]=l,t[11]=c,t[12]=a):a=t[12];const{data:u}=g(a);return u??null}const P={SELF:e=>`${e}_self`,REGISTRY:e=>`${e}_registry`,COMMUNITY_REGISTRY:e=>`${e}_community-registry`,DEV_ASSETS:e=>`${e}_dev-assets`},M="self";function R(e){return{id:P.REGISTRY(e),title:"Deco Store",description:"Official deco MCP registry with curated integrations",connection_type:"HTTP",connection_url:"https://studio.decocms.com/org/deco/registry/mcp",icon:"https://assets.decocache.com/decocms/00ccf6c3-9e13-4517-83b0-75ab84554bb9/596364c63320075ca58483660156b6d9de9b526e.png",app_name:"deco-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function L(){return{id:"community-registry",title:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",connection_type:"HTTP",connection_url:"https://sites-registry.decocache.com/mcp",icon:"https://assets.decocache.com/decocms/cd7ca472-0f72-463a-b0de-6e44bdd0f9b4/mcp.png",app_name:"mcp-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function D(e){return{id:v(e),organization_id:e,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:null},connections:[]}}const p="decopilot_";function E(e){return!e||!e.startsWith(p)?null:e.slice(p.length)||null}function v(e){return`${p}${e}`}export{m as K,_ as S,P as W,M as a,L as b,f as c,D as d,R as e,w as f,v as g,E as i,S as u};
@@ -0,0 +1 @@
1
+ import{ah as a,ai as t}from"./index-SkQC2bL2.js";const e=a(t,{target:"draft-7"});export{e as B};