@decocms/mesh 2.136.0 → 2.136.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/dist/client/assets/{AlertCircle-BmterM6-.js → AlertCircle-CXJCnY_R.js} +1 -1
  2. package/dist/client/assets/{AlignLeft-D-24Asic.js → AlignLeft-Ckpqqq7X.js} +1 -1
  3. package/dist/client/assets/{ArrowDown-DhmtNBCn.js → ArrowDown-BXCgJapO.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-BwnRcCxk.js → ArrowLeft-ihbjidrQ.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-B2lliNjJ.js → ArrowUp-B3tPpNuu.js} +1 -1
  6. package/dist/client/assets/{Check-Dy5Jwsdl.js → Check-G22LpKFd.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-DCJamcsS.js → CheckCircle-Dl3Eh5mw.js} +1 -1
  8. package/dist/client/assets/{CheckDone01-BMlUtSk0.js → CheckDone01-DQOA8kaK.js} +1 -1
  9. package/dist/client/assets/{CheckVerified02-BEvXxeXZ.js → CheckVerified02-C58oaMz8.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-B8UJn4iH.js → ChevronDown-DAk1F2Sn.js} +1 -1
  11. package/dist/client/assets/{ChevronLeft-LqDMtl3T.js → ChevronLeft-CGPjZdmg.js} +1 -1
  12. package/dist/client/assets/{ChevronRight-UHmTzu6U.js → ChevronRight-BT7U8Kip.js} +1 -1
  13. package/dist/client/assets/{Clock-CHKtyQRJ.js → Clock-CPO-Cqx6.js} +1 -1
  14. package/dist/client/assets/{Code01-Ce_GLriH.js → Code01-UXkm6aqY.js} +1 -1
  15. package/dist/client/assets/{Container-nefPC-Vi.js → Container-CyEPuAYL.js} +1 -1
  16. package/dist/client/assets/{Copy01-DTrKcR-Q.js → Copy01-tzx60ICS.js} +1 -1
  17. package/dist/client/assets/{Dataflow03-DMAzBi98.js → Dataflow03-mD5gBD1P.js} +1 -1
  18. package/dist/client/assets/{DotsHorizontal-BmF1jyTg.js → DotsHorizontal-9qiIYu_T.js} +1 -1
  19. package/dist/client/assets/{DotsVertical-N7qtMw5m.js → DotsVertical-DHxrk-2J.js} +1 -1
  20. package/dist/client/assets/{Download01-C8dWfeAI.js → Download01-DM18IWVp.js} +1 -1
  21. package/dist/client/assets/{Edit01-CMeQdBcS.js → Edit01-D3PaS600.js} +1 -1
  22. package/dist/client/assets/{Edit05-DZ_UN_S5.js → Edit05-B64h7zay.js} +1 -1
  23. package/dist/client/assets/{Eye-DxLOh0i-.js → Eye-C_LYW9jG.js} +1 -1
  24. package/dist/client/assets/{File02-vPAwJvd9.js → File02-CY9LI3Y-.js} +1 -1
  25. package/dist/client/assets/{File06-CJFI46Rj.js → File06-Dy7xo8XS.js} +1 -1
  26. package/dist/client/assets/{FilterLines-BfBD1RVS.js → FilterLines-BvkJQ7ij.js} +1 -1
  27. package/dist/client/assets/{Globe01-CFu5KWUK.js → Globe01-39jWI59e.js} +1 -1
  28. package/dist/client/assets/{Globe02-KBI1AO62.js → Globe02-X-Xm1ngz.js} +1 -1
  29. package/dist/client/assets/{Grid01-CqnSySeu.js → Grid01-DTf5JuyC.js} +1 -1
  30. package/dist/client/assets/{Hash02-DJ4pr-VX.js → Hash02-AH6eTaow.js} +1 -1
  31. package/dist/client/assets/{Home02-Do5D--q6.js → Home02-DzIcdgJH.js} +1 -1
  32. package/dist/client/assets/{Image01-C8E_92eh.js → Image01-Dvb2vnmH.js} +1 -1
  33. package/dist/client/assets/{Inbox01-DFatNHSu.js → Inbox01-CsvPcK33.js} +1 -1
  34. package/dist/client/assets/{InfoCircle-BbDPfNIr.js → InfoCircle-D2mDfen0.js} +1 -1
  35. package/dist/client/assets/{Key01-5M9GOooO.js → Key01-C3Fh3hes.js} +1 -1
  36. package/dist/client/assets/{LayersTwo01-D3z_72X4.js → LayersTwo01-CRgWs3EX.js} +1 -1
  37. package/dist/client/assets/{LayoutLeft-CuouUkb7.js → LayoutLeft-C-0_xlw0.js} +1 -1
  38. package/dist/client/assets/{Link01-phTHWMEc.js → Link01-C74Jreax.js} +1 -1
  39. package/dist/client/assets/{LinkExternal01-3GykVej2.js → LinkExternal01-D6xwQf32.js} +1 -1
  40. package/dist/client/assets/{List-C81A8jh_.js → List-DJEz6yKj.js} +1 -1
  41. package/dist/client/assets/{Loading01-BWjBCSBL.js → Loading01-B3gOoSbd.js} +1 -1
  42. package/dist/client/assets/{Lock01-BF4OPECE.js → Lock01-CodP_ius.js} +1 -1
  43. package/dist/client/assets/{Play-CGCsuB7w.js → Play-CxAaQi_l.js} +1 -1
  44. package/dist/client/assets/{Plus-CK3qvOs-.js → Plus-Bo0L9uYY.js} +1 -1
  45. package/dist/client/assets/{RefreshCcw01-DCU1xktc.js → RefreshCcw01-v6pXwg6P.js} +1 -1
  46. package/dist/client/assets/{Save01-sMmuMs88.js → Save01-CU3VjXKO.js} +1 -1
  47. package/dist/client/assets/{SearchMd-CpD1Xdqo.js → SearchMd-Cpf31N-H.js} +1 -1
  48. package/dist/client/assets/{Settings01-Bhz_Vu7B.js → Settings01-BmEB9pVn.js} +1 -1
  49. package/dist/client/assets/{Shield01-B4VkgvZ4.js → Shield01-CqrrEAw-.js} +1 -1
  50. package/dist/client/assets/{Terminal-EynP_hYL.js → Terminal-BS-6VR5p.js} +1 -1
  51. package/dist/client/assets/{Trash01-p1zJKNMp.js → Trash01-HuK-pEft.js} +1 -1
  52. package/dist/client/assets/{Upload01-CuSBdknv.js → Upload01-DcyyJb_e.js} +1 -1
  53. package/dist/client/assets/{Users03-C4-0uA3w.js → Users03-CPWgVi4r.js} +1 -1
  54. package/dist/client/assets/{X-C0j62Xtl.js → X-uHaUni9w.js} +1 -1
  55. package/dist/client/assets/{XCircle-BtpMj0Vx.js → XCircle-C4iqiznn.js} +1 -1
  56. package/dist/client/assets/{XClose-BoXt6_S8.js → XClose-DGYV-4S5.js} +1 -1
  57. package/dist/client/assets/{Zap-D7Nzarh3.js → Zap-5c_DBEtK.js} +1 -1
  58. package/dist/client/assets/{agent-connections-preview-CHU0g32U.js → agent-connections-preview-BsjSZYGn.js} +1 -1
  59. package/dist/client/assets/agent-detail-BxRuQLTH.js +2 -0
  60. package/dist/client/assets/agents-KBFzt520.js +1 -0
  61. package/dist/client/assets/{alert-dialog-D1XudKG9.js → alert-dialog-D3oCqQtu.js} +1 -1
  62. package/dist/client/assets/{auth-catchall-BgPC7rSe.js → auth-catchall-bz6gJ41s.js} +1 -1
  63. package/dist/client/assets/{avatar-DNxsCl6r.js → avatar-rYlL0ZoJ.js} +1 -1
  64. package/dist/client/assets/{badge-D8RzvYJ4.js → badge-CxJArm69.js} +1 -1
  65. package/dist/client/assets/{binder-Blih3Yob.js → binder-BXDCztlr.js} +1 -1
  66. package/dist/client/assets/{breadcrumb-N-YM-0qC.js → breadcrumb-CGrLS5HH.js} +1 -1
  67. package/dist/client/assets/{card-DpIJfsV8.js → card-CAORA3L1.js} +1 -1
  68. package/dist/client/assets/{chart-ClRGWH0O.js → chart-DX1_yJHY.js} +1 -1
  69. package/dist/client/assets/{checkbox-CUOTkCKW.js → checkbox-BCSzUsPR.js} +1 -1
  70. package/dist/client/assets/{circle-alert-D8ryfTOx.js → circle-alert-B4C3d1aQ.js} +1 -1
  71. package/dist/client/assets/{collapsible-CpgZSwBN.js → collapsible-sQONDG4w.js} +1 -1
  72. package/dist/client/assets/{collection-detail-B3RGhDtS.js → collection-detail-B42SRwNb.js} +3 -3
  73. package/dist/client/assets/{collection-display-button-DrtKZPsB.js → collection-display-button-M7dfC2Rf.js} +1 -1
  74. package/dist/client/assets/{collection-search-Cq4rjP0Z.js → collection-search-q4T1hb73.js} +1 -1
  75. package/dist/client/assets/collection-tab-e-VwhAzh.js +1 -0
  76. package/dist/client/assets/{collection-table-wrapper-CyGYWMWl.js → collection-table-wrapper-DXH0yXJC.js} +1 -1
  77. package/dist/client/assets/{collection-tabs-r7GKXx3H.js → collection-tabs-BbVq4J-5.js} +1 -1
  78. package/dist/client/assets/{command-DazlgUs5.js → command-CPQN970u.js} +1 -1
  79. package/dist/client/assets/{connect-CvX0kEdi.js → connect-BGH3KdkD.js} +1 -1
  80. package/dist/client/assets/{connection-card-BEmi4FHw.js → connection-card-DTiOZbAC.js} +1 -1
  81. package/dist/client/assets/connection-detail-DznxU3SC.js +1 -0
  82. package/dist/client/assets/connections-AQfSUAp3.js +1 -0
  83. package/dist/client/assets/{constants-BLSLjUCX.js → constants-D9bRXDQp.js} +1 -1
  84. package/dist/client/assets/constants-DvJZMaim.js +1 -0
  85. package/dist/client/assets/{create-organization-dialog-_OZHP19d.js → create-organization-dialog-Bs4zbKG7.js} +1 -1
  86. package/dist/client/assets/{create-project-dialog-CBSHMrrx.js → create-project-dialog-BkL7vqeo.js} +1 -1
  87. package/dist/client/assets/{danger-CPETFW7T.js → danger-C_vn0auF.js} +1 -1
  88. package/dist/client/assets/{danger-zone-LxdCiZtW.js → danger-zone-CdUOoCFt.js} +1 -1
  89. package/dist/client/assets/{decopilot-events-BEPzMc6y.js → decopilot-events-DHSwekTa.js} +1 -1
  90. package/dist/client/assets/dependencies-DTmw6OGT.js +1 -0
  91. package/dist/client/assets/{dialog-BEh9NHdw.js → dialog-Baq_fjtR.js} +1 -1
  92. package/dist/client/assets/{dropdown-menu-BBy53YtY.js → dropdown-menu-CSqO4Mxn.js} +1 -1
  93. package/dist/client/assets/dynamic-plugin-layout-d0KDA7MF.js +1 -0
  94. package/dist/client/assets/{editable-task-title-CQx9B12m.js → editable-task-title-HUenZvZX.js} +1 -1
  95. package/dist/client/assets/{empty-state-Cd-Y6dcy.js → empty-state-BPClkF2j.js} +1 -1
  96. package/dist/client/assets/{env-vars-editor-CFN3JqN6.js → env-vars-editor-DDp7f4JN.js} +1 -1
  97. package/dist/client/assets/{extract-connection-data-Bjwt_XIu.js → extract-connection-data-BkJeK0tX.js} +1 -1
  98. package/dist/client/assets/{file-browser-B3GXvhIi.js → file-browser-DVzV35Ko.js} +2 -2
  99. package/dist/client/assets/{form-DKOen-4i.js → form-C5R0_qWR.js} +1 -1
  100. package/dist/client/assets/{general-i_n7wxur.js → general-mBNwCpsS.js} +1 -1
  101. package/dist/client/assets/{grid-view-1tJniq0A.js → grid-view-7eQhfO8f.js} +1 -1
  102. package/dist/client/assets/{home-B-4A2LlA.js → home-okrTp5Gh.js} +1 -1
  103. package/dist/client/assets/{icon-picker-BXWmqDNl.js → icon-picker-DevrZ9IQ.js} +1 -1
  104. package/dist/client/assets/{index-DVmCBhSl.js → index-B-STjJpH.js} +1 -1
  105. package/dist/client/assets/{index-9MR1Aak3.js → index-BK6i23a9.js} +1 -1
  106. package/dist/client/assets/{index-DYkmX0JZ.js → index-BWSvBz7o.js} +1 -1
  107. package/dist/client/assets/{index-xQ2t379n.js → index-B_0vsVr1.js} +3 -3
  108. package/dist/client/assets/{index-Bxe5mObN.js → index-ByA6j7_H.js} +1 -1
  109. package/dist/client/assets/{index-CrfXnuko.js → index-CvEIDmnk.js} +1 -1
  110. package/dist/client/assets/index-DYY56DJY.js +1 -0
  111. package/dist/client/assets/{index-C79VipEf.js → index-QCmdl8uj.js} +1 -1
  112. package/dist/client/assets/{index-D3pPaynQ.js → index-UbeVlDrq.js} +1 -1
  113. package/dist/client/assets/{infiniteQueryObserver-bwcxH-lX.js → infiniteQueryObserver-DKiK82rX.js} +1 -1
  114. package/dist/client/assets/{input-CquIDQAg.js → input-CW7SVowR.js} +1 -1
  115. package/dist/client/assets/{integration-icon-CyNzGslP.js → integration-icon-DAFtApWT.js} +1 -1
  116. package/dist/client/assets/{label-DgKgIZIr.js → label-DWU1nKSS.js} +1 -1
  117. package/dist/client/assets/{layout-BaoRfV41.js → layout-CzVwolFw.js} +1 -1
  118. package/dist/client/assets/{layout-Dknw5WOk.js → layout-DEcRD72T.js} +1 -1
  119. package/dist/client/assets/{localstorage-keys-BVjc41qz.js → localstorage-keys-BAzeyS9J.js} +1 -1
  120. package/dist/client/assets/{login-CbUqOEDM.js → login-OPfY3bsF.js} +1 -1
  121. package/dist/client/assets/{markdown-Ba8nOSsK.js → markdown-DCSB9ejV.js} +1 -1
  122. package/dist/client/assets/{mcp-app-renderer-DYp1_awD.js → mcp-app-renderer-BtuEhdWL.js} +1 -1
  123. package/dist/client/assets/{mcp-oauth-BKgRq621.js → mcp-oauth-D8pA0WRM.js} +1 -1
  124. package/dist/client/assets/{mcp-server-card-CpB9f-pn.js → mcp-server-card-D7xlSyX7.js} +1 -1
  125. package/dist/client/assets/mcp-server-detail-DdKXdUu2.js +2 -0
  126. package/dist/client/assets/members-YKyOsCaT.js +3 -0
  127. package/dist/client/assets/{monaco-editor-Bqq988E3.js → monaco-editor-zyWgiZEt.js} +1 -1
  128. package/dist/client/assets/{monitoring-Cw8c9SQ5.js → monitoring-SM_c8qxT.js} +2 -2
  129. package/dist/client/assets/monitoring-dashboard-edit-cexdjvMw.js +1 -0
  130. package/dist/client/assets/{monitoring-dashboard-view-CmbMs5N1.js → monitoring-dashboard-view-C3qQNwfm.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-3thxiCVs.js → oauth-callback-1SC3hH5y.js} +1 -1
  132. package/dist/client/assets/page-DfTTOYQt.js +1 -0
  133. package/dist/client/assets/page-hoODnFtN.js +1 -0
  134. package/dist/client/assets/{plugin-empty-state-CgwqeTLL.js → plugin-empty-state-Cl_h_OgT.js} +1 -1
  135. package/dist/client/assets/{plugin-empty-state-n7cn669C.js → plugin-empty-state-Doboc7Tq.js} +1 -1
  136. package/dist/client/assets/{plugin-header-AGaevBZn.js → plugin-header-C4Dfehzm.js} +1 -1
  137. package/dist/client/assets/{plugin-header-BxEyDthP.js → plugin-header-DNeaPoeS.js} +1 -1
  138. package/dist/client/assets/plugins-H9eiCXso.js +1 -0
  139. package/dist/client/assets/{popover-BGz1EQnh.js → popover-BNZ96bFv.js} +1 -1
  140. package/dist/client/assets/project-app-view-Bsbq4Qf_.js +1 -0
  141. package/dist/client/assets/project-layout-B4cnkESa.js +1 -0
  142. package/dist/client/assets/{project-plugins-R_POmKuz.js → project-plugins-CqDaIw1P.js} +1 -1
  143. package/dist/client/assets/{projects-list-DvHzim4C.js → projects-list-CgsVuZof.js} +1 -1
  144. package/dist/client/assets/{readme-viewer-CSo2KaPk.js → readme-viewer-CKidIXa3.js} +1 -1
  145. package/dist/client/assets/{registry-layout-BRpD6JKO.js → registry-layout-oUh5Zl7W.js} +2 -2
  146. package/dist/client/assets/{registry-utils-Cjdxmsng.js → registry-utils-DXJps8H7.js} +1 -1
  147. package/dist/client/assets/{reports-layout-WypzA6IP.js → reports-layout-CFJRqv-Q.js} +2 -2
  148. package/dist/client/assets/{reset-password-C2yglusd.js → reset-password-ZQI9gTW6.js} +1 -1
  149. package/dist/client/assets/{resizable-BeoLLDMu.js → resizable-CWRglWOX.js} +1 -1
  150. package/dist/client/assets/{save-actions-OW6B8GGT.js → save-actions-eGQZXGI3.js} +1 -1
  151. package/dist/client/assets/{scroll-area-BlV5UvCB.js → scroll-area-By1z4ZyY.js} +1 -1
  152. package/dist/client/assets/{select-CDsJtNMV.js → select-CYY4CENz.js} +1 -1
  153. package/dist/client/assets/shell-layout-DMKfJTmj.js +3 -0
  154. package/dist/client/assets/{sidebar-settings-CYmJoaNT.js → sidebar-settings-ILgspCqY.js} +1 -1
  155. package/dist/client/assets/{skeleton-Ct9swv0n.js → skeleton-C4ZMp7sl.js} +1 -1
  156. package/dist/client/assets/{spinner-DfUcLZCl.js → spinner-oA3jiJW_.js} +1 -1
  157. package/dist/client/assets/{store-invite-ZCHtOCWs.js → store-invite-Bfy0Alsf.js} +1 -1
  158. package/dist/client/assets/{switch-a3WrSRQb.js → switch-BSc4dVNg.js} +1 -1
  159. package/dist/client/assets/{table-BCfVNRpI.js → table-RFgqEt_E.js} +1 -1
  160. package/dist/client/assets/{tabs-DN8uQx_4.js → tabs-BZ-xfLNG.js} +1 -1
  161. package/dist/client/assets/tasks-Cy-gkHRX.js +1 -0
  162. package/dist/client/assets/{tasks-panel-Bcd4i-z8.js → tasks-panel-C7RwVTDD.js} +1 -1
  163. package/dist/client/assets/{textarea-BvEkv28R.js → textarea-4HpXofT0.js} +1 -1
  164. package/dist/client/assets/{time-range-picker-CTYo_Gy_.js → time-range-picker-Cx2A-Fs_.js} +1 -1
  165. package/dist/client/assets/{toggle-group-BuwLTYBs.js → toggle-group-CVFHcp8K.js} +1 -1
  166. package/dist/client/assets/{tools-list-DKmevE2X.js → tools-list-BYphEqhu.js} +1 -1
  167. package/dist/client/assets/{tooltip-B6yKYOIf.js → tooltip-Cz-bAWiO.js} +1 -1
  168. package/dist/client/assets/{topbar-portal-CUBonFlI.js → topbar-portal-DOwsTUY4.js} +1 -1
  169. package/dist/client/assets/{types-CnPYT6I7.js → types-B46wd5bS.js} +1 -1
  170. package/dist/client/assets/{use-binding-BSjPQ0Be.js → use-binding-Dz1SRdBY.js} +1 -1
  171. package/dist/client/assets/use-collections-vccihohV.js +1 -0
  172. package/dist/client/assets/use-connection-DeEn4qfI.js +1 -0
  173. package/dist/client/assets/{use-copy-oq5GkYwB.js → use-copy-CykDvxn6.js} +1 -1
  174. package/dist/client/assets/{use-create-virtual-mcp-COKyzJBE.js → use-create-virtual-mcp-DB14T-Ft.js} +1 -1
  175. package/dist/client/assets/use-install-from-registry-BeHRHLDl.js +1 -0
  176. package/dist/client/assets/{use-list-state-DhRtf36X.js → use-list-state-ykkfYLR3.js} +1 -1
  177. package/dist/client/assets/use-llm-B_iPCa-K.js +1 -0
  178. package/dist/client/assets/{use-mcp-resources-B792gs6l.js → use-mcp-resources-Rqzq7A0J.js} +1 -1
  179. package/dist/client/assets/{use-mcp-tools-DScmBuoc.js → use-mcp-tools-BXihKxpu.js} +1 -1
  180. package/dist/client/assets/{use-members-Chfn3LoP.js → use-members-DAcqcxDX.js} +1 -1
  181. package/dist/client/assets/{use-mobile-CZlm25dt.js → use-mobile-B2VAoWT2.js} +1 -1
  182. package/dist/client/assets/{use-project-BUsmU3t_.js → use-project-D96OXk4y.js} +1 -1
  183. package/dist/client/assets/{use-settings-modal-D18j_l44.js → use-settings-modal-CouKpdi3.js} +1 -1
  184. package/dist/client/assets/{use-view-mode-5Lt8g0uo.js → use-view-mode-DyK0fMBe.js} +1 -1
  185. package/dist/client/assets/use-virtual-mcp-OwU65kyR.js +1 -0
  186. package/dist/client/assets/useInfiniteQuery-Cl9EtkM0.js +1 -0
  187. package/dist/client/assets/{useMutation-tQLZk7P3.js → useMutation-lBFQDcxE.js} +1 -1
  188. package/dist/client/assets/useQuery-DcRkCB2j.js +1 -0
  189. package/dist/client/assets/useSuspenseInfiniteQuery-DdSDu-rZ.js +1 -0
  190. package/dist/client/assets/{user-CI081yAV.js → user-C73vNaiS.js} +1 -1
  191. package/dist/client/assets/workflow-S9BhswBs.js +1 -0
  192. package/dist/client/index.html +1 -1
  193. package/package.json +1 -1
  194. package/dist/client/assets/agent-detail-DURsxgC5.js +0 -2
  195. package/dist/client/assets/agents-Cl7pGBMM.js +0 -1
  196. package/dist/client/assets/collection-tab-CDCwjyV8.js +0 -1
  197. package/dist/client/assets/connection-detail-CJDHlEwZ.js +0 -1
  198. package/dist/client/assets/connections-DZjwaIPT.js +0 -1
  199. package/dist/client/assets/constants-D_mJYCD9.js +0 -1
  200. package/dist/client/assets/dependencies-Cz-sRh-1.js +0 -1
  201. package/dist/client/assets/dynamic-plugin-layout-p6ER6wNw.js +0 -1
  202. package/dist/client/assets/index-C6W9eJZm.js +0 -1
  203. package/dist/client/assets/mcp-server-detail-CCUSuXBZ.js +0 -2
  204. package/dist/client/assets/members-C3L37RaV.js +0 -3
  205. package/dist/client/assets/monitoring-dashboard-edit-BMa2OOFc.js +0 -1
  206. package/dist/client/assets/page-D6s6DLQp.js +0 -1
  207. package/dist/client/assets/page-DojbxRSJ.js +0 -1
  208. package/dist/client/assets/plugins-DPuuPP05.js +0 -1
  209. package/dist/client/assets/project-app-view-B5525387.js +0 -1
  210. package/dist/client/assets/project-layout-DDwGJ0ig.js +0 -1
  211. package/dist/client/assets/shell-layout-DfbBuM37.js +0 -3
  212. package/dist/client/assets/tasks-Bgtg3aZ6.js +0 -1
  213. package/dist/client/assets/use-connection-Dtj63U01.js +0 -1
  214. package/dist/client/assets/use-install-from-registry-DD_AL_1f.js +0 -1
  215. package/dist/client/assets/use-llm-5n5wwCT_.js +0 -1
  216. package/dist/client/assets/use-virtual-mcp-COkdNvVv.js +0 -1
  217. package/dist/client/assets/useInfiniteQuery-fRddscS9.js +0 -1
  218. package/dist/client/assets/useQuery-BLe-0FCm.js +0 -1
  219. package/dist/client/assets/useSuspenseInfiniteQuery-D0p_NlPn.js +0 -1
  220. package/dist/client/assets/workflow-Bu6-o0iD.js +0 -1
@@ -1,2 +0,0 @@
1
- import{r as _,c as k,j as t,E as fe,B as J,v as ae,_ as Ze,u as de,V as Qe,s as Xe,t as ce,b as et,e as tt,O as Ge,l as st,k as lt,aD as ot,q as Me}from"./index-xQ2t379n.js";import{b as Ae,i as nt,c as it,u as rt,C as at,d as ct}from"./collapsible-CpgZSwBN.js";import{C as dt,E as mt}from"./collection-search-Cq4rjP0Z.js";import{I as ut}from"./icon-picker-BXWmqDNl.js";import{I as Oe}from"./integration-icon-CyNzGslP.js";import{u as ft}from"./index-C79VipEf.js";import{B as $e}from"./badge-D8RzvYJ4.js";import{I as Ve}from"./input-CquIDQAg.js";import{S as pt}from"./switch-a3WrSRQb.js";import{T as xt}from"./textarea-BvEkv28R.js";import{a as pe,c as ve,T as xe,b as he}from"./tooltip-B6yKYOIf.js";import{h as ht,f as gt}from"./use-connection-Dtj63U01.js";import{u as jt,a as bt}from"./use-virtual-mcp-COkdNvVv.js";import{i as He}from"./ChevronRight-UHmTzu6U.js";import{n as Nt}from"./select-CDsJtNMV.js";import{i as De}from"./File02-vPAwJvd9.js";import{i as Le}from"./Loading01-BWjBCSBL.js";import{i as vt}from"./Play-CGCsuB7w.js";import{s as Be}from"./Plus-CK3qvOs-.js";import{t as yt}from"./Users03-C4-0uA3w.js";import{B as Ct,a as _t,b as Fe,d as St,e as Tt,c as kt}from"./breadcrumb-N-YM-0qC.js";import{a as wt,V as Et}from"./layout-BaoRfV41.js";import{S as It}from"./save-actions-OW6B8GGT.js";import{a as At}from"./tools-list-DKmevE2X.js";import{C as ze}from"./checkbox-CUOTkCKW.js";import{e as Ot,a as Ue,D as Ke,b as $t,c as Dt}from"./dialog-BEh9NHdw.js";import{T as ye,a as Lt,b as Ce,c as zt}from"./tabs-DN8uQx_4.js";import{u as ge,a as Rt}from"./constants-BLSLjUCX.js";import{c as Pt}from"./use-mcp-tools-DScmBuoc.js";import{a as Mt}from"./use-mcp-resources-B792gs6l.js";import{u as Vt}from"./decopilot-events-BEPzMc6y.js";import{s as We}from"./slugify-CEUa2lfQ.js";import{I as Bt,R as Ft,a as Gt}from"./index-DVmCBhSl.js";import{i as je}from"./Check-Dy5Jwsdl.js";import{i as Ht}from"./Code01-Ce_GLriH.js";import{a as Re}from"./Copy01-DTrKcR-Q.js";import{i as _e}from"./InfoCircle-BbDPfNIr.js";import{i as Ut}from"./Key01-5M9GOooO.js";import{A as Kt}from"./agent-connections-preview-CHU0g32U.js";import"./use-llm-5n5wwCT_.js";import"./use-binding-BSjPQ0Be.js";import"./binder-Blih3Yob.js";import"./useQuery-BLe-0FCm.js";import"./localstorage-keys-BVjc41qz.js";import"./useMutation-tQLZk7P3.js";import"./skeleton-Ct9swv0n.js";import"./AlignLeft-D-24Asic.js";import"./ArrowLeft-BwnRcCxk.js";import"./ChevronDown-B8UJn4iH.js";import"./Image01-C8E_92eh.js";import"./RefreshCcw01-DCU1xktc.js";import"./SearchMd-CpD1Xdqo.js";import"./Settings01-Bhz_Vu7B.js";import"./useSuspenseInfiniteQuery-D0p_NlPn.js";import"./infiniteQueryObserver-bwcxH-lX.js";import"./popover-BGz1EQnh.js";import"./scroll-area-BlV5UvCB.js";import"./Container-nefPC-Vi.js";import"./Edit05-DZ_UN_S5.js";import"./Link01-phTHWMEc.js";import"./XClose-BoXt6_S8.js";import"./index-CrfXnuko.js";import"./Save01-sMmuMs88.js";import"./collection-display-button-DrtKZPsB.js";import"./dropdown-menu-BBy53YtY.js";import"./ArrowDown-DhmtNBCn.js";import"./ArrowUp-B2lliNjJ.js";import"./Grid01-CqnSySeu.js";import"./List-C81A8jh_.js";import"./collection-table-wrapper-CyGYWMWl.js";import"./table-BCfVNRpI.js";import"./card-DpIJfsV8.js";import"./types-CnPYT6I7.js";import"./Eye-DxLOh0i-.js";import"./Globe02-KBI1AO62.js";import"./LayersTwo01-D3z_72X4.js";import"./X-C0j62Xtl.js";const Ye=({size:o=24,color:e="currentColor",...s})=>_.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},_.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}));Ye.displayName="Circle";const be=({size:o=24,color:e="currentColor",...s})=>_.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},_.createElement("path",{d:"m9.75 20.75 1.473.818c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l1.473-.818m-9-2.5-1.427-.793c-.3-.166-.45-.25-.558-.368a1 1 0 0 1-.215-.364C3 16.573 3 16.401 3 16.06V14.5m0-5V7.942c0-.343 0-.514.05-.667a1 1 0 0 1 .215-.364c.109-.119.258-.202.558-.368L5.25 5.75m4.5-2.5 1.473-.818c.284-.158.425-.237.576-.267a1 1 0 0 1 .402 0c.15.03.292.11.576.267l1.473.818m4.5 2.5 1.427.793c.3.166.45.25.558.368a1 1 0 0 1 .215.364c.05.153.05.324.05.667V9.5m0 5v1.559c0 .342 0 .514-.05.666a.999.999 0 0 1-.215.364c-.109.119-.258.202-.558.368l-1.427.793m-9-7.5L12 12m0 0 2.25-1.25M12 12v2.5M3 7l2.25 1.25m13.5 0L21 7m-9 12.5V22"}));be.displayName="CubeOutline";const qe=({size:o=24,color:e="currentColor",...s})=>_.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},_.createElement("path",{d:"m12 5.5-4.638 6.747c-.28.406-.42.609-.41.778a.5.5 0 0 0 .195.373c.135.102.38.102.874.102H12v5l4.638-6.747c.28-.406.42-.609.41-.778a.5.5 0 0 0-.195-.373c-.135-.102-.38-.102-.874-.102H12v-5Z"}),_.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}));qe.displayName="ZapCircle";function Se(o){return o===null?"all":o?.length??0}function Wt(o,e){const s=o[e];if(!s)return"";const n=[];return s.tools===null?n.push("all tools"):s.tools&&s.tools.length>0&&n.push(`${s.tools.length} tools`),s.resources===null?n.push("all resources"):s.resources&&s.resources.length>0&&n.push(`${s.resources.length} resources`),s.prompts===null?n.push("all prompts"):s.prompts&&s.prompts.length>0&&n.push(`${s.prompts.length} prompts`),n.join(", ")}function Yt(o,e){const s=o[e];return s?!((s.tools===void 0||s.tools!==null&&s.tools.length===0)&&(s.resources===void 0||s.resources!==null&&s.resources.length===0)&&(s.prompts===void 0||s.prompts!==null&&s.prompts.length===0)):!1}const qt={tools:null,resources:null,prompts:null};function Te(){const o=k.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(Le,{className:"animate-spin text-muted-foreground",size:24})}),o[0]=e):e=o[0],e}function ke(o){return({error:e})=>e?.message?.includes("Method not found")||e?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:o})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(Ze,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:e?.message?e.message.length>200?`${e.message.slice(0,200)}...`:e.message:"An unexpected error occurred"})]})]})}function Jt(o){const e=k.c(23),{item:s,isSelected:n,onToggle:l,disabled:i}=o,d=i?"cursor-not-allowed opacity-50":"cursor-pointer",a=n?"bg-accent/25":"hover:bg-muted/50";let r;e[0]!==d||e[1]!==a?(r=ae("flex items-start gap-3 p-4 rounded-lg transition-colors",d,a),e[0]=d,e[1]=a,e[2]=r):r=e[2];let c;e[3]!==s.name?(c=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:s.name}),e[3]=s.name,e[4]=c):c=e[4];let x;e[5]!==s.tags?(x=s.tags&&t.jsx("span",{className:"shrink-0",children:s.tags}),e[5]=s.tags,e[6]=x):x=e[6];let g;e[7]!==c||e[8]!==x?(g=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c,x]}),e[7]=c,e[8]=x,e[9]=g):g=e[9];let p;e[10]!==s.description?(p=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[10]=s.description,e[11]=p):p=e[11];let h;e[12]!==g||e[13]!==p?(h=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[g,p]}),e[12]=g,e[13]=p,e[14]=h):h=e[14];let u;e[15]!==i||e[16]!==n||e[17]!==l?(u=t.jsx(ze,{checked:n,onCheckedChange:l,disabled:i,className:"mt-0.5"}),e[15]=i,e[16]=n,e[17]=l,e[18]=u):u=e[18];let f;return e[19]!==r||e[20]!==h||e[21]!==u?(f=t.jsxs("label",{className:r,children:[h,u]}),e[19]=r,e[20]=h,e[21]=u,e[22]=f):f=e[22],f}function Pe(o){const e=k.c(32),{items:s,selections:n,onToggle:l,onToggleAll:i,emptyMessage:d,disabled:a}=o;let r,c,x,g,p;if(e[0]!==a||e[1]!==d||e[2]!==s||e[3]!==l||e[4]!==i||e[5]!==n){p=Symbol.for("react.early_return_sentinel");e:{const f=s.map(Zt);if(s.length===0){let y;e[11]!==d?(y=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:d})}),e[11]=d,e[12]=y):y=e[12],p=y;break e}x="flex flex-col h-full";const b=a?"cursor-not-allowed opacity-50":"cursor-pointer";let m;e[13]!==b?(m=ae("flex items-start gap-3 p-4",b),e[13]=b,e[14]=m):m=e[14];let j;e[15]!==s.length?(j=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsxs("span",{className:"text-sm font-medium",children:["Select All (",s.length,")"]})}),e[15]=s.length,e[16]=j):j=e[16];const v=n===null;let C;e[17]!==a||e[18]!==i||e[19]!==v?(C=t.jsx(ze,{checked:v,onCheckedChange:i,disabled:a,className:"mt-0.5"}),e[17]=a,e[18]=i,e[19]=v,e[20]=C):C=e[20],e[21]!==C||e[22]!==m||e[23]!==j?(g=t.jsx("div",{className:"px-4 border-b border-border shrink-0",children:t.jsxs("label",{className:m,children:[j,C]})}),e[21]=C,e[22]=m,e[23]=j,e[24]=g):g=e[24],r="flex-1 overflow-auto px-4 py-3 space-y-1",c=s.map(y=>t.jsx(Jt,{item:y,isSelected:n===null||n?.includes(y.id),onToggle:()=>l(y.id,f),disabled:a},y.id))}e[0]=a,e[1]=d,e[2]=s,e[3]=l,e[4]=i,e[5]=n,e[6]=r,e[7]=c,e[8]=x,e[9]=g,e[10]=p}else r=e[6],c=e[7],x=e[8],g=e[9],p=e[10];if(p!==Symbol.for("react.early_return_sentinel"))return p;let h;e[25]!==r||e[26]!==c?(h=t.jsx("div",{className:r,children:c}),e[25]=r,e[26]=c,e[27]=h):h=e[27];let u;return e[28]!==x||e[29]!==g||e[30]!==h?(u=t.jsxs("div",{className:x,children:[g,h]}),e[28]=x,e[29]=g,e[30]=h,e[31]=u):u=e[31],u}function Zt(o){return o.id}function Qt(o){const e=k.c(13),{connectionId:s,selections:n,onToggle:l,onToggleAll:i,disabled:d}=o,{org:a}=de();let r;e[0]!==s||e[1]!==a.id?(r={connectionId:s,orgId:a.id},e[0]=s,e[1]=a.id,e[2]=r):r=e[2];const c=ge(r);let x;e[3]!==c?(x={client:c},e[3]=c,e[4]=x):x=e[4];const{data:g}=Pt(x);let p;e[5]!==g.tools?(p=g.tools.map(Xt),e[5]=g.tools,e[6]=p):p=e[6];const h=p;let u;return e[7]!==d||e[8]!==h||e[9]!==l||e[10]!==i||e[11]!==n?(u=t.jsx(Pe,{items:h,selections:n,onToggle:l,onToggleAll:i,emptyMessage:"No tools available",disabled:d}),e[7]=d,e[8]=h,e[9]=l,e[10]=i,e[11]=n,e[12]=u):u=e[12],u}function Xt(o){return{id:o.name,name:o.name,description:o.description,tags:t.jsx(At,{annotations:o.annotations,_meta:o._meta})}}function es(o){const e=k.c(13),{connectionId:s,selections:n,onToggle:l,onToggleAll:i,disabled:d}=o,{org:a}=de();let r;e[0]!==s||e[1]!==a.id?(r={connectionId:s,orgId:a.id},e[0]=s,e[1]=a.id,e[2]=r):r=e[2];const c=ge(r);let x;e[3]!==c?(x={client:c},e[3]=c,e[4]=x):x=e[4];const{data:g}=Mt(x);let p;e[5]!==g.resources?(p=g.resources.map(ts),e[5]=g.resources,e[6]=p):p=e[6];const h=p;let u;return e[7]!==d||e[8]!==h||e[9]!==l||e[10]!==i||e[11]!==n?(u=t.jsx(Pe,{items:h,selections:n,onToggle:l,onToggleAll:i,emptyMessage:"No resources available",disabled:d}),e[7]=d,e[8]=h,e[9]=l,e[10]=i,e[11]=n,e[12]=u):u=e[12],u}function ts(o){return{id:o.name||o.uri,name:o.name||o.uri,description:o.description}}function ss(o){const e=k.c(13),{connectionId:s,selections:n,onToggle:l,onToggleAll:i,disabled:d}=o,{org:a}=de();let r;e[0]!==s||e[1]!==a.id?(r={connectionId:s,orgId:a.id},e[0]=s,e[1]=a.id,e[2]=r):r=e[2];const c=ge(r);let x;e[3]!==c?(x={client:c},e[3]=c,e[4]=x):x=e[4];const{data:g}=Vt(x);let p;e[5]!==g.prompts?(p=g.prompts.map(ls),e[5]=g.prompts,e[6]=p):p=e[6];const h=p;let u;return e[7]!==d||e[8]!==h||e[9]!==l||e[10]!==i||e[11]!==n?(u=t.jsx(Pe,{items:h,selections:n,onToggle:l,onToggleAll:i,emptyMessage:"No prompts available",disabled:d}),e[7]=d,e[8]=h,e[9]=l,e[10]=i,e[11]=n,e[12]=u):u=e[12],u}function ls(o){return{id:o.name,name:o.name,description:o.description}}function os(o){const e=k.c(24),{connection:s,isSelected:n,hasSelections:l,summary:i,onClick:d,onToggleAll:a,disabled:r}=o,c=r?"cursor-not-allowed opacity-50":"cursor-pointer",x=n?"bg-accent":"hover:bg-muted/50";let g;e[0]!==c||e[1]!==x?(g=ae("flex items-center gap-2 p-2 h-12 rounded-lg transition-colors",c,x),e[0]=c,e[1]=x,e[2]=g):g=e[2];const p=r?void 0:d;let h;e[3]!==s.icon||e[4]!==s.title?(h=t.jsx(Oe,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[3]=s.icon,e[4]=s.title,e[5]=h):h=e[5];let u;e[6]!==s.title?(u=t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.title}),e[6]=s.title,e[7]=u):u=e[7];let f;e[8]!==l||e[9]!==i?(f=l&&i&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i}),e[8]=l,e[9]=i,e[10]=f):f=e[10];let b;e[11]!==u||e[12]!==f?(b=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[u,f]}),e[11]=u,e[12]=f,e[13]=b):b=e[13];let m;e[14]!==r||e[15]!==l||e[16]!==a?(m=t.jsx(ze,{checked:l,onCheckedChange:a,onClick:ns,disabled:r,className:"shrink-0"}),e[14]=r,e[15]=l,e[16]=a,e[17]=m):m=e[17];let j;return e[18]!==g||e[19]!==p||e[20]!==h||e[21]!==b||e[22]!==m?(j=t.jsxs("div",{className:g,onClick:p,children:[h,b,m]}),e[18]=g,e[19]=p,e[20]=h,e[21]=b,e[22]=m,e[23]=j):j=e[23],j}function ns(o){return o.stopPropagation()}function is(o){const e=k.c(22),{allConnections:s,searchTerm:n,selectedId:l,hasSelections:i,getSelectionSummary:d,onConnectionClick:a,onToggleAll:r,disabled:c}=o;let x;e[0]!==s||e[1]!==n?(x=n?s.filter(u=>u.title.toLowerCase().includes(n.toLowerCase())||u.description?.toLowerCase().includes(n.toLowerCase())):s,e[0]=s,e[1]=n,e[2]=x):x=e[2];const g=x;if(g.length===0){const u=n?"No connections found":"No connections available";let f;return e[3]!==u?(f=t.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground p-4",children:u}),e[3]=u,e[4]=f):f=e[4],f}let p;if(e[5]!==c||e[6]!==g||e[7]!==d||e[8]!==i||e[9]!==a||e[10]!==r||e[11]!==l){let u;e[13]!==c||e[14]!==d||e[15]!==i||e[16]!==a||e[17]!==r||e[18]!==l?(u=f=>t.jsx(os,{connection:f,isSelected:l===f.id,hasSelections:i(f.id),summary:d(f.id),onClick:()=>a(f.id),onToggleAll:()=>r(f.id),disabled:c},f.id),e[13]=c,e[14]=d,e[15]=i,e[16]=a,e[17]=r,e[18]=l,e[19]=u):u=e[19],p=g.map(u),e[5]=c,e[6]=g,e[7]=d,e[8]=i,e[9]=a,e[10]=r,e[11]=l,e[12]=p}else p=e[12];let h;return e[20]!==p?(h=t.jsx("div",{className:"flex flex-col gap-0.5",children:p}),e[20]=p,e[21]=h):h=e[21],h}function rs(o){const e=k.c(75),{currentConnection:s,activeTab:n,selectedId:l,formData:i,toggleTool:d,toggleResource:a,togglePrompt:r,toggleAllTools:c,toggleAllResources:x,toggleAllPrompts:g,onTabChange:p}=o;let h;e[0]!==s.icon||e[1]!==s.title?(h=t.jsx(Oe,{icon:s.icon,name:s.title,size:"md",className:"shrink-0"}),e[0]=s.icon,e[1]=s.title,e[2]=h):h=e[2];let u;e[3]!==s.title?(u=t.jsx("h2",{className:"text-lg font-semibold truncate",children:s.title}),e[3]=s.title,e[4]=u):u=e[4];let f;e[5]!==s.description?(f=s.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:s.description}),e[5]=s.description,e[6]=f):f=e[6];let b;e[7]!==u||e[8]!==f?(b=t.jsxs("div",{className:"flex-1 min-w-0",children:[u,f]}),e[7]=u,e[8]=f,e[9]=b):b=e[9];let m;e[10]!==h||e[11]!==b?(m=t.jsx("div",{className:"p-6 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[h,b]})}),e[10]=h,e[11]=b,e[12]=m):m=e[12];let j;e[13]!==p?(j=M=>p(M),e[13]=p,e[14]=j):j=e[14];let v;e[15]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsxs(ye,{value:"tools",variant:"underline",className:"gap-2",children:[t.jsx(Ae,{size:16}),"Tools"]}),e[15]=v):v=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs(ye,{value:"resources",variant:"underline",className:"gap-2",children:[t.jsx(be,{size:16}),"Resources"]}),e[16]=C):C=e[16];let y;e[17]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsxs(Lt,{variant:"underline",className:"shrink-0 px-6",children:[v,C,t.jsxs(ye,{value:"prompts",variant:"underline",className:"gap-2",children:[t.jsx(De,{size:16}),"Prompts"]})]}),e[17]=y):y=e[17];let V;e[18]===Symbol.for("react.memo_cache_sentinel")?(V=ke("Tools not supported by this server"),e[18]=V):V=e[18];let R;e[19]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(Te,{}),e[19]=R):R=e[19];let T;e[20]!==i||e[21]!==l?(T=i[l]?i[l].tools:[],e[20]=i,e[21]=l,e[22]=T):T=e[22];let O;e[23]!==l||e[24]!==d?(O=(M,q)=>d(l,M,q),e[23]=l,e[24]=d,e[25]=O):O=e[25];let S;e[26]!==l||e[27]!==c?(S=()=>c(l),e[26]=l,e[27]=c,e[28]=S):S=e[28];let w;e[29]!==l||e[30]!==T||e[31]!==O||e[32]!==S?(w=t.jsx(Ce,{value:"tools",className:"flex-1 overflow-hidden mt-0",children:t.jsx(fe,{fallback:V,children:t.jsx(_.Suspense,{fallback:R,children:t.jsx(Qt,{connectionId:l,selections:T,onToggle:O,onToggleAll:S})})})}),e[29]=l,e[30]=T,e[31]=O,e[32]=S,e[33]=w):w=e[33];let z;e[34]===Symbol.for("react.memo_cache_sentinel")?(z=ke("Resources not supported by this server"),e[34]=z):z=e[34];let $;e[35]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Te,{}),e[35]=$):$=e[35];let I;e[36]!==i||e[37]!==l?(I=i[l]?i[l].resources:[],e[36]=i,e[37]=l,e[38]=I):I=e[38];let D;e[39]!==l||e[40]!==a?(D=(M,q)=>a(l,M,q),e[39]=l,e[40]=a,e[41]=D):D=e[41];let A;e[42]!==l||e[43]!==x?(A=()=>x(l),e[42]=l,e[43]=x,e[44]=A):A=e[44];let E;e[45]!==l||e[46]!==I||e[47]!==D||e[48]!==A?(E=t.jsx(Ce,{value:"resources",className:"flex-1 overflow-hidden mt-0",children:t.jsx(fe,{fallback:z,children:t.jsx(_.Suspense,{fallback:$,children:t.jsx(es,{connectionId:l,selections:I,onToggle:D,onToggleAll:A})})})}),e[45]=l,e[46]=I,e[47]=D,e[48]=A,e[49]=E):E=e[49];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=ke("Prompts not supported by this server"),e[50]=B):B=e[50];let P;e[51]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Te,{}),e[51]=P):P=e[51];let K;e[52]!==i||e[53]!==l?(K=i[l]?i[l].prompts:[],e[52]=i,e[53]=l,e[54]=K):K=e[54];let H;e[55]!==l||e[56]!==r?(H=(M,q)=>r(l,M,q),e[55]=l,e[56]=r,e[57]=H):H=e[57];let W;e[58]!==l||e[59]!==g?(W=()=>g(l),e[58]=l,e[59]=g,e[60]=W):W=e[60];let U;e[61]!==l||e[62]!==K||e[63]!==H||e[64]!==W?(U=t.jsx(Ce,{value:"prompts",className:"flex-1 overflow-hidden mt-0",children:t.jsx(fe,{fallback:B,children:t.jsx(_.Suspense,{fallback:P,children:t.jsx(ss,{connectionId:l,selections:K,onToggle:H,onToggleAll:W})})})}),e[61]=l,e[62]=K,e[63]=H,e[64]=W,e[65]=U):U=e[65];let Y;e[66]!==n||e[67]!==w||e[68]!==E||e[69]!==U||e[70]!==j?(Y=t.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:t.jsxs(zt,{value:n,onValueChange:j,variant:"underline",className:"flex-1 flex flex-col overflow-hidden",children:[y,w,E,U]})}),e[66]=n,e[67]=w,e[68]=E,e[69]=U,e[70]=j,e[71]=Y):Y=e[71];let Z;return e[72]!==Y||e[73]!==m?(Z=t.jsxs(t.Fragment,{children:[m,Y]}),e[72]=Y,e[73]=m,e[74]=Z):Z=e[74],Z}function as(o){const e={};for(const s of o)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function we(o){return Object.entries(o).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function cs(o,e){switch(e.type){case"SET_SEARCH_TERM":return{...o,searchTerm:e.payload};case"SET_SELECTED":return{...o,selectedId:e.payload};case"SET_ACTIVE_TAB":return{...o,activeTab:e.payload};case"RESET":return{searchTerm:"",selectedId:e.payload.selectedId??e.payload.firstConnectionId??null,activeTab:"tools"};case"SELECT_CONNECTION":return{...o,selectedId:e.payload,activeTab:"tools"};default:return o}}const ds=(o,e)=>o.find(s=>s.id===e)??o[0];function ms(o){const e=k.c(77),{open:s,onOpenChange:n,selectedId:l,form:i,connections:d}=o;let a;e[0]!==l?(a={activeTab:"tools",searchTerm:"",selectedId:l},e[0]=l,e[1]=a):a=e[1];const[r,c]=_.useReducer(cs,a),x=_.useDeferredValue(r.searchTerm);let g;e[2]!==x?(g={searchTerm:x},e[2]=x,e[3]=g):g=e[3];const p=ht(g);let h;e[4]!==d?(h=d??[],e[4]=d,e[5]=h):h=e[5];let u;e[6]!==h?(u=as(h),e[6]=h,e[7]=u):u=e[7];const f=u;let b;e[8]!==p||e[9]!==r.selectedId?(b=ds(p,r.selectedId),e[8]=p,e[9]=r.selectedId,e[10]=b):b=e[10];const m=b,j=m?.id??null;let v;e[11]!==f?(v=N=>Yt(f,N),e[11]=f,e[12]=v):v=e[12];const C=v;let y;e[13]!==f?(y=N=>Wt(f,N),e[13]=f,e[14]=y):y=e[14];const V=y;let R;e[15]!==i||e[16]!==f?(R=(N,L,F,Q)=>{const ie=f[N]?.[L];let G;ie===null?G=Q.filter(Ne=>Ne!==F):ie?.includes(F)?G=ie.filter(Ne=>Ne!==F):(G=[...ie??[],F],G.length===Q.length&&(G=null));const re={...f};re[N]?re[N]={...re[N]}:re[N]={tools:null,resources:null,prompts:null},re[N][L]=G,i.setValue("connections",we(re),{shouldDirty:!0,shouldTouch:!0})},e[15]=i,e[16]=f,e[17]=R):R=e[17];const T=R;let O;e[18]!==i||e[19]!==f?(O=(N,L)=>{const ie=f[N]?.[L]===null?[]:null,G={...f};G[N]?G[N]={...G[N]}:G[N]={tools:null,resources:null,prompts:null},G[N][L]=ie,i.setValue("connections",we(G),{shouldDirty:!0,shouldTouch:!0})},e[18]=i,e[19]=f,e[20]=O):O=e[20];const S=O;let w;e[21]!==T?(w=(N,L,F)=>T(N,"tools",L,F),e[21]=T,e[22]=w):w=e[22];const z=w;let $;e[23]!==T?($=(N,L,F)=>T(N,"resources",L,F),e[23]=T,e[24]=$):$=e[24];const I=$;let D;e[25]!==T?(D=(N,L,F)=>T(N,"prompts",L,F),e[25]=T,e[26]=D):D=e[26];const A=D;let E;e[27]!==S?(E=N=>S(N,"tools"),e[27]=S,e[28]=E):E=e[28];const B=E;let P;e[29]!==S?(P=N=>S(N,"resources"),e[29]=S,e[30]=P):P=e[30];const K=P;let H;e[31]!==S?(H=N=>S(N,"prompts"),e[31]=S,e[32]=H):H=e[32];const W=H;let U;e[33]!==i||e[34]!==f?(U=N=>{const L=f[N],F=L&&L.tools===null&&L.resources===null&&L.prompts===null,Q={...f};F?delete Q[N]:Q[N]=qt,i.setValue("connections",we(Q),{shouldDirty:!0,shouldTouch:!0})},e[33]=i,e[34]=f,e[35]=U):U=e[35];const Y=U;let Z;e[36]!==p||e[37]!==n||e[38]!==l?(Z=N=>{N&&c({type:"RESET",payload:{selectedId:l,firstConnectionId:p[0]?.id??null}}),n(N)},e[36]=p,e[37]=n,e[38]=l,e[39]=Z):Z=e[39];const M=Z;let q;e[40]===Symbol.for("react.memo_cache_sentinel")?(q=N=>{c({type:"SELECT_CONNECTION",payload:N})},e[40]=q):q=e[40];const Je=q;let me;e[41]===Symbol.for("react.memo_cache_sentinel")?(me=N=>c({type:"SET_SEARCH_TERM",payload:N}),e[41]=me):me=e[41];let X;e[42]!==r.searchTerm?(X=t.jsx(dt,{value:r.searchTerm,onChange:me,placeholder:"Search connections..."}),e[42]=r.searchTerm,e[43]=X):X=e[43];let ee;e[44]!==p||e[45]!==r.searchTerm||e[46]!==j||e[47]!==V||e[48]!==C||e[49]!==Y?(ee=t.jsx("div",{className:"flex-1 overflow-auto p-2",children:t.jsx(is,{allConnections:p,searchTerm:r.searchTerm,selectedId:j,hasSelections:C,getSelectionSummary:V,onConnectionClick:Je,onToggleAll:Y})}),e[44]=p,e[45]=r.searchTerm,e[46]=j,e[47]=V,e[48]=C,e[49]=Y,e[50]=ee):ee=e[50];let te;e[51]!==X||e[52]!==ee?(te=t.jsxs("div",{className:"w-full sm:w-72 sm:border-r border-b sm:border-b-0 border-border flex flex-col bg-background sm:h-full max-h-[40vh] sm:max-h-full",children:[X,ee]}),e[51]=X,e[52]=ee,e[53]=te):te=e[53];let se;e[54]!==m||e[55]!==r.activeTab||e[56]!==j||e[57]!==f||e[58]!==W||e[59]!==K||e[60]!==B||e[61]!==A||e[62]!==I||e[63]!==z?(se=t.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:m&&j?t.jsx(rs,{currentConnection:m,activeTab:r.activeTab,selectedId:j,formData:f,toggleTool:z,toggleResource:I,togglePrompt:A,toggleAllTools:B,toggleAllResources:K,toggleAllPrompts:W,onTabChange:N=>c({type:"SET_ACTIVE_TAB",payload:N})},j):t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Select a connection to view its tools, resources, and prompts"})}),e[54]=m,e[55]=r.activeTab,e[56]=j,e[57]=f,e[58]=W,e[59]=K,e[60]=B,e[61]=A,e[62]=I,e[63]=z,e[64]=se):se=e[64];let le;e[65]!==te||e[66]!==se?(le=t.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0 flex-col sm:flex-row",children:[te,se]}),e[65]=te,e[66]=se,e[67]=le):le=e[67];let oe;e[68]!==M?(oe=t.jsx(Ot,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(J,{variant:"outline",onClick:()=>M(!1),children:"Done"})}),e[68]=M,e[69]=oe):oe=e[69];let ne;e[70]!==le||e[71]!==oe?(ne=t.jsxs(Ue,{className:"sm:max-w-5xl h-[80vh] max-h-[80vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[le,oe]}),e[70]=le,e[71]=oe,e[72]=ne):ne=e[72];let ue;return e[73]!==M||e[74]!==s||e[75]!==ne?(ue=t.jsx(Ke,{open:s,onOpenChange:M,children:ne}),e[73]=M,e[74]=s,e[75]=ne,e[76]=ue):ue=e[76],ue}const us=Qe.pick({title:!0,description:!0,icon:!0,status:!0,metadata:!0,connections:!0}).extend({title:Xe().min(1,"Name is required").max(255)});function fs(o){const e=k.c(8);let s,n;e[0]!==o?({className:s,...n}=o,e[0]=o,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let l;e[3]!==s?(l=ae("grid gap-3",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==n||e[6]!==l?(i=t.jsx(Ft,{"data-slot":"radio-group",className:l,...n}),e[5]=n,e[6]=l,e[7]=i):i=e[7],i}function Ee(o){const e=k.c(9);let s,n;e[0]!==o?({className:s,...n}=o,e[0]=o,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let l;e[3]!==s?(l=ae("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Gt,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(Ye,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=i):i=e[5];let d;return e[6]!==n||e[7]!==l?(d=t.jsx(Bt,{"data-slot":"radio-group-item",className:l,...n,children:i}),e[6]=n,e[7]=l,e[8]=d):d=e[8],d}function ps(o){const s=new TextEncoder().encode(o),n=Array.from(s,l=>String.fromCharCode(l)).join("");return btoa(n)}function xs(o){const e=k.c(10),{url:s}=o,[n,l]=_.useState(!1);let i;e[0]!==s?(i=async()=>{await navigator.clipboard.writeText(s),l(!0),ce.success("Agent URL copied to clipboard"),setTimeout(()=>l(!1),2e3)},e[0]=s,e[1]=i):i=e[1];const d=i;let a;e[2]!==n?(a=n?t.jsx(je,{size:20,className:"text-green-600"}):t.jsx(Re,{size:20}),e[2]=n,e[3]=a):a=e[3];const r=n?"Copied!":"Copy URL";let c;e[4]!==r?(c=t.jsx("span",{className:"text-xs font-medium",children:r}),e[4]=r,e[5]=c):c=e[5];let x;return e[6]!==d||e[7]!==a||e[8]!==c?(x=t.jsxs(J,{type:"button",variant:"outline",onClick:d,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[a,c]}),e[6]=d,e[7]=a,e[8]=c,e[9]=x):x=e[9],x}function hs(o){const e=k.c(7),{url:s,serverName:n}=o;let l;e[0]!==n||e[1]!==s?(l=()=>{const c=We(n),g=ps(JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Cursor"}},null,2)),p=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(c)}&config=${encodeURIComponent(g)}`;window.open(p,"_blank"),ce.success("Opening Cursor...")},e[0]=n,e[1]=s,e[2]=l):l=e[2];const i=l;let d,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),a=t.jsx("span",{className:"text-xs font-medium",children:"Install on Cursor"}),e[3]=d,e[4]=a):(d=e[3],a=e[4]);let r;return e[5]!==i?(r=t.jsxs(J,{type:"button",variant:"outline",onClick:i,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[d,a]}),e[5]=i,e[6]=r):r=e[6],r}function gs(o){const e=k.c(11),{url:s,serverName:n}=o,[l,i]=_.useState(!1);let d;e[0]!==n||e[1]!==s?(d=async()=>{const p=We(n),u=JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Claude Code"}},null,2),f=`claude mcp add-json "${p}" '${u.replace(/'/g,"'\\''")}'`;await navigator.clipboard.writeText(f),i(!0),ce.success("Claude Code command copied to clipboard"),setTimeout(()=>i(!1),2e3)},e[0]=n,e[1]=s,e[2]=d):d=e[2];const a=d;let r;e[3]!==l?(r=l?t.jsx(je,{size:20,className:"text-green-600"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[3]=l,e[4]=r):r=e[4];const c=l?"Copied!":"Install on Claude";let x;e[5]!==c?(x=t.jsx("span",{className:"text-xs font-medium",children:c}),e[5]=c,e[6]=x):x=e[6];let g;return e[7]!==a||e[8]!==r||e[9]!==x?(g=t.jsxs(J,{type:"button",variant:"outline",onClick:a,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[r,x]}),e[7]=a,e[8]=r,e[9]=x,e[10]=g):g=e[10],g}function js({virtualMcp:o}){const{org:e}=de(),s=ge({connectionId:Rt,orgId:e.id}),[n,l]=_.useState(null),[i,d]=_.useState(!1),[a,r]=_.useState(!1),c=o.id,x=o.title||`agent-${c.slice(0,8)}`,g=n?`bunx @decocms/typegen@latest --mcp ${c} --key ${n} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${c} --key <api-key> --output client.ts`,p=async()=>{d(!0);try{const f=(await s.callTool({name:"API_KEY_CREATE",arguments:{name:`typegen-${x}`,permissions:{[c]:["*"]}}})).structuredContent?.key;if(!f)throw new Error("No key in response");l(f)}catch{ce.error("Failed to generate API key")}finally{d(!1)}},h=async()=>{await navigator.clipboard.writeText(g),r(!0),ce.success("Command copied to clipboard"),setTimeout(()=>r(!1),2e3)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:"Generate typed client"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Introspects this agent and writes a typed"," ",t.jsx("code",{className:"font-mono",children:"client.ts"})," you can import directly."]})]}),!n&&t.jsxs(J,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:p,disabled:i,children:[i?t.jsx(Le,{size:14,className:"animate-spin"}):t.jsx(Ut,{size:14}),t.jsx("span",{children:i?"Generating…":"Generate API key"})]})]}),n&&t.jsx("p",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-700",children:"Store this key securely — it won't be shown again."}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Generate client"}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:g}),t.jsx(J,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:h,children:a?t.jsx(je,{size:12,className:"text-green-600"}):t.jsx(Re,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Runtime variables"}),t.jsx(bs,{apiKey:n})]})}function bs(o){const e=k.c(19),{apiKey:s}=o,[n,l]=_.useState(!1),i=window.location.origin,d=s?`MESH_API_KEY=${s}`:"MESH_API_KEY=<api-key>",a=`MESH_BASE_URL=${i}`,r=`${d}
2
- ${a}`;let c;e[0]!==r?(c=async()=>{await navigator.clipboard.writeText(r),l(!0),setTimeout(()=>l(!1),2e3)},e[0]=r,e[1]=c):c=e[1];const x=c,g=!s;let p;e[2]!==g?(p=ae({"opacity-50":g}),e[2]=g,e[3]=p):p=e[3];let h;e[4]!==d||e[5]!==p?(h=t.jsx("span",{className:p,children:d}),e[4]=d,e[5]=p,e[6]=h):h=e[6];let u,f;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("br",{}),f=t.jsx("span",{children:a}),e[7]=u,e[8]=f):(u=e[7],f=e[8]);let b;e[9]!==h?(b=t.jsxs("code",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:[h,u,f]}),e[9]=h,e[10]=b):b=e[10];let m;e[11]!==n?(m=n?t.jsx(je,{size:12,className:"text-green-600"}):t.jsx(Re,{size:12}),e[11]=n,e[12]=m):m=e[12];let j;e[13]!==x||e[14]!==m?(j=t.jsx(J,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:x,children:m}),e[13]=x,e[14]=m,e[15]=j):j=e[15];let v;return e[16]!==b||e[17]!==j?(v=t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[b,j]})}),e[16]=b,e[17]=j,e[18]=v):v=e[18],v}function Ns(o){const e=k.c(3),{virtualMcp:s}=o;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=n):n=e[0];let l;return e[1]!==s?(l=t.jsx(_.Suspense,{fallback:n,children:t.jsx(js,{virtualMcp:s})}),e[1]=s,e[2]=l):l=e[2],l}function vs(o){const e=k.c(44),{open:s,onOpenChange:n,virtualMcp:l}=o,[i,d]=_.useState("code_execution");let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=P=>{(P==="passthrough"||P==="smart_tool_selection"||P==="code_execution")&&d(P)},e[0]=a):a=e[0];const r=a;let c;e[1]!==i||e[2]!==l.id?(c=new URL(`/mcp/virtual-mcp/${l.id}`,window.location.origin),c.searchParams.set("mode",i),e[1]=i,e[2]=l.id,e[3]=c):c=e[3];let x;e[4]!==l.id||e[5]!==l.title?(x=l.title||`agent-${l.id?.slice(0,8)??"default"}`,e[4]=l.id,e[5]=l.title,e[6]=x):x=e[6];const g=x;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx($t,{children:t.jsx(Dt,{children:"Connect"})}),e[7]=p):p=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mt-1",children:"How should this agent work?"})}),e[8]=h):h=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(nt,{className:"size-5 text-muted-foreground"})}),e[9]=u):u=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Direct access"}),e[10]=f):f=e[10];let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(pe,{asChild:!0,children:t.jsx(_e,{className:"size-3.5 text-muted-foreground"})}),e[11]=b):b=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("label",{htmlFor:"mode-passthrough",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[u,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[f,t.jsx(ve,{children:t.jsxs(xe,{children:[b,t.jsx(he,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"All tools are exposed directly via tools/list. Best for small tool surfaces with deterministic behavior."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Best for small teams or when you need predictable behavior"})]}),t.jsx(Ee,{id:"mode-passthrough",value:"passthrough"})]}),e[12]=m):m=e[12];let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(it,{className:"size-5 text-muted-foreground"})}),e[13]=j):j=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart discovery"}),e[14]=v):v=e[14];let C;e[15]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(pe,{asChild:!0,children:t.jsx(_e,{className:"size-3.5 text-muted-foreground"})}),e[15]=C):C=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsxs("label",{htmlFor:"mode-smart",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[j,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[v,t.jsx(ve,{children:t.jsxs(xe,{children:[C,t.jsx(he,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Uses meta-tools (GATEWAY_SEARCH_TOOLS, GATEWAY_DESCRIBE_TOOLS, GATEWAY_CALL_TOOL) to keep the tool list small and request details on demand."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Ideal for large teams with many tools - AI finds what it needs"})]}),t.jsx(Ee,{id:"mode-smart",value:"smart_tool_selection"})]}),e[16]=y):y=e[16];let V;e[17]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Ht,{className:"size-5 text-muted-foreground"})}),e[17]=V):V=e[17];let R;e[18]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart execution"}),e[18]=R):R=e[18];let T;e[19]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(pe,{asChild:!0,children:t.jsx(_e,{className:"size-3.5 text-muted-foreground"})}),e[19]=T):T=e[19];let O;e[20]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs("label",{htmlFor:"mode-code",className:"relative flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[V,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[R,t.jsx(ve,{children:t.jsxs(xe,{children:[T,t.jsx(he,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Exposes meta-tools for discovery + sandboxed execution (GATEWAY_RUN_CODE). Reduces overhead on large surfaces by shifting work into a controlled runtime."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Maximum flexibility - AI can write code to orchestrate tools"})]}),t.jsx(Ee,{id:"mode-code",value:"code_execution"}),t.jsx($e,{variant:"outline",className:"absolute -top-2.5 left-1/2 -translate-x-1/2 bg-background z-10",children:"Recommended"})]}),e[20]=O):O=e[20];let S;e[21]!==i?(S=t.jsxs("div",{className:"flex flex-col gap-3",children:[h,t.jsxs(fs,{value:i,onValueChange:r,className:"flex flex-col gap-4.5",children:[m,y,O]})]}),e[21]=i,e[22]=S):S=e[22];let w;e[23]!==c.href?(w=t.jsx(xs,{url:c.href}),e[23]=c.href,e[24]=w):w=e[24];let z,$;e[25]!==g||e[26]!==c.href?(z=t.jsx(hs,{url:c.href,serverName:g}),$=t.jsx(gs,{url:c.href,serverName:g}),e[25]=g,e[26]=c.href,e[27]=z,e[28]=$):(z=e[27],$=e[28]);let I;e[29]!==w||e[30]!==z||e[31]!==$?(I=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[w,z,$]})}),e[29]=w,e[30]=z,e[31]=$,e[32]=I):I=e[32];let D;e[33]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx("div",{className:"border-t border-border"}),e[33]=D):D=e[33];let A;e[34]!==l?(A=t.jsx(Ns,{virtualMcp:l}),e[34]=l,e[35]=A):A=e[35];let E;e[36]!==S||e[37]!==I||e[38]!==A?(E=t.jsxs(Ue,{className:"max-h-[80vh] overflow-y-auto sm:max-w-2xl",children:[p,t.jsxs("div",{className:"flex flex-col gap-6",children:[S,I,D,A]})]}),e[36]=S,e[37]=I,e[38]=A,e[39]=E):E=e[39];let B;return e[40]!==n||e[41]!==s||e[42]!==E?(B=t.jsx(Ke,{open:s,onOpenChange:n,children:E}),e[40]=n,e[41]=s,e[42]=E,e[43]=B):B=e[43],B}function ys(o,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...o,shareDialogOpen:e.payload};case"SET_CONNECTION_DIALOG_OPEN":return{...o,connectionDialogOpen:e.payload};case"SET_EDITING_CONNECTION_ID":return{...o,editingConnectionId:e.payload};case"SET_SKILLS_OPEN":return{...o,skillsOpen:e.payload};default:return o}}function Ie(o){const e=k.c(27),{connection_id:s,selected_tools:n,selected_resources:l,selected_prompts:i,onClick:d}=o,a=gt(s);if(!a)return null;let r;e[0]!==n?(r=Se(n),e[0]=n,e[1]=r):r=e[1];const c=r;let x;e[2]!==l?(x=Se(l),e[2]=l,e[3]=x):x=e[3];const g=x;let p;e[4]!==i?(p=Se(i),e[4]=i,e[5]=p):p=e[5];const h=p;let u;e[6]!==a.icon||e[7]!==a.title?(u=t.jsx(Oe,{icon:a.icon,name:a.title,size:"xs"}),e[6]=a.icon,e[7]=a.title,e[8]=u):u=e[8];let f;e[9]!==a.title?(f=t.jsx("p",{className:"flex-1 text-sm font-normal text-foreground truncate",children:a.title}),e[9]=a.title,e[10]=f):f=e[10];let b;e[11]!==c?(b=c!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:c==="all"?"all":c}),t.jsx(Ae,{size:12})]}),e[11]=c,e[12]=b):b=e[12];let m;e[13]!==g?(m=g!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:g==="all"?"all":g}),t.jsx(be,{size:12})]}),e[13]=g,e[14]=m):m=e[14];let j;e[15]!==h?(j=h!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:h==="all"?"all":h}),t.jsx(De,{size:12})]}),e[15]=h,e[16]=j):j=e[16];let v;e[17]!==b||e[18]!==m||e[19]!==j?(v=t.jsxs($e,{variant:"secondary",className:"bg-muted h-5 gap-2 px-1.5 py-1 flex items-center",children:[b,m,j]}),e[17]=b,e[18]=m,e[19]=j,e[20]=v):v=e[20];let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(He,{size:16,className:"text-muted-foreground shrink-0"}),e[21]=C):C=e[21];let y;return e[22]!==d||e[23]!==u||e[24]!==f||e[25]!==v?(y=t.jsxs("div",{onClick:d,className:"w-full h-12 flex items-center gap-2 px-3 rounded-lg border border-border hover:bg-accent/50 transition-colors cursor-pointer",children:[u,f,v,C]}),e[22]=d,e[23]=u,e[24]=f,e[25]=v,e[26]=y):y=e[26],y}Ie.Fallback=function(){return t.jsxs("div",{className:"w-full h-12 flex items-center gap-2 px-3 rounded-lg border border-border",children:[t.jsx("div",{className:"size-5 rounded bg-muted animate-pulse shrink-0"}),t.jsx("div",{className:"flex-1 h-4 rounded bg-muted animate-pulse"}),t.jsxs($e,{variant:"secondary",className:"bg-muted h-5 gap-2 px-1.5 py-1 flex items-center",children:[t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(Ae,{size:12})]}),t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(be,{size:12})]}),t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(De,{size:12})]})]}),t.jsx(He,{size:16,className:"text-muted-foreground shrink-0"})]})};function Cs({virtualMcp:o}){const{org:e}=de(),s=bt(),n=st({resolver:lt(us),defaultValues:o}),l=n.watch("connections"),[i,d]=_.useReducer(ys,{shareDialogOpen:!1,connectionDialogOpen:!1,editingConnectionId:null,skillsOpen:!1}),[,a]=ft(),{setVirtualMcpId:r}=rt();_.useEffect(()=>{a(!0),r(o.id)},[o.id]);const c=()=>{r(o.id),a(!0)},x=n.formState.isDirty,g=async()=>{const m=n.getValues(),j=await s.update.mutateAsync({id:o.id,data:m});n.reset(j)},p=()=>{n.reset(o)},h=()=>{d({type:"SET_EDITING_CONNECTION_ID",payload:null}),d({type:"SET_CONNECTION_DIALOG_OPEN",payload:!0})},u=m=>{d({type:"SET_EDITING_CONNECTION_ID",payload:m}),d({type:"SET_CONNECTION_DIALOG_OPEN",payload:!0})},f=s.update.isPending,b=t.jsx(Ct,{children:t.jsxs(_t,{children:[t.jsx(Fe,{children:t.jsx(St,{asChild:!0,children:t.jsx(ot,{to:"/$org/$project/agents",params:{org:e.slug,project:Ge},children:"Agents"})})}),t.jsx(Tt,{}),t.jsx(Fe,{children:t.jsx(kt,{children:o.title})})]})});return t.jsxs(wt,{breadcrumb:b,children:[t.jsxs(Et,{children:[t.jsx(It,{onSave:g,onUndo:p,isDirty:x,isSaving:f}),t.jsxs(xe,{delayDuration:0,children:[t.jsx(pe,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsxs(J,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 border border-input",onClick:c,"aria-label":"Test Agent",children:[t.jsx(vt,{size:14}),"Test Agent"]})})}),t.jsx(he,{side:"bottom",children:"Test this agent in chat"})]}),t.jsxs(J,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 border border-input",onClick:()=>d({type:"SET_SHARE_DIALOG_OPEN",payload:!0}),children:[t.jsx(qe,{size:14}),"Connect"]})]}),t.jsx("div",{className:"flex h-full w-full bg-background overflow-auto",children:t.jsxs("div",{className:"flex flex-col w-full",children:[t.jsxs("div",{className:"flex items-start justify-between gap-4 p-6 shrink-0",children:[t.jsxs("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[t.jsx(Me,{control:n.control,name:"icon",render:({field:m})=>t.jsx(ut,{value:m.value,onChange:m.onChange,name:n.watch("title")||"Agent",size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(yt,{})})}),t.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[t.jsx(Ve,{...n.register("title"),className:"h-auto py-0.5 text-lg! font-medium leading-7 px-1 -mx-1 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Agent Name"}),t.jsx(Ve,{...n.register("description"),className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-1 -mx-1 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})]})]}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(pt,{checked:n.watch("status")==="active",onCheckedChange:m=>n.setValue("status",m?"active":"inactive",{shouldDirty:!0})})})]}),t.jsxs(at,{open:i.skillsOpen,onOpenChange:m=>d({type:"SET_SKILLS_OPEN",payload:m}),className:"border-t border-border shrink-0 max-h-[400px] overflow-hidden flex flex-col",children:[l.length===0?t.jsxs("button",{type:"button",onClick:h,className:"w-full flex items-center justify-between px-6 py-4 hover:bg-muted/50 transition-colors cursor-pointer",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Skills"}),t.jsxs("div",{className:"h-7 px-2 inline-flex items-center justify-center gap-1 rounded-md text-sm text-muted-foreground",children:[t.jsx(Be,{size:14}),"Add"]})]}):t.jsx(ct,{asChild:!0,children:t.jsxs("button",{type:"button",className:"w-full flex items-center justify-between px-6 py-4 hover:bg-muted/50 transition-colors cursor-pointer",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Skills"}),t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"ease-(--ease-out-expo)",style:{width:i.skillsOpen?0:"auto",marginRight:i.skillsOpen?0:4,opacity:i.skillsOpen?0:1,pointerEvents:i.skillsOpen?"none":"auto",transitionProperty:"all",transitionDuration:i.skillsOpen?"0ms":"200ms"},children:t.jsx(Kt,{connectionIds:l.map(m=>m.connection_id),maxVisibleIcons:2})}),t.jsxs("div",{role:"button",tabIndex:0,className:"h-7 inline-flex items-center justify-center rounded-md text-sm text-muted-foreground overflow-hidden transition-all duration-200 ease-(--ease-out-expo) hover:bg-accent hover:text-accent-foreground",style:{width:i.skillsOpen?"auto":28,paddingLeft:i.skillsOpen?8:0,paddingRight:i.skillsOpen?8:0,gap:i.skillsOpen?4:0},onPointerDown:m=>{m.stopPropagation()},onClick:m=>{m.stopPropagation(),m.preventDefault(),h()},onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.stopPropagation(),m.preventDefault(),h())},children:[t.jsx(Be,{size:14,className:"shrink-0"}),t.jsx("span",{className:"overflow-hidden whitespace-nowrap transition-all duration-200 ease-(--ease-out-expo)",style:{width:i.skillsOpen?"auto":0,opacity:i.skillsOpen?1:0},children:"Add"})]}),t.jsx("div",{className:"h-7 inline-flex items-center justify-center overflow-hidden transition-all duration-200 ease-(--ease-out-expo)",style:{width:i.skillsOpen?28:0,opacity:i.skillsOpen?1:0},children:t.jsx(Nt,{size:16,className:"shrink-0"})})]})]})}),t.jsx("div",{className:"grid overflow-hidden transition-[grid-template-rows] duration-200 ease-(--ease-out-expo)",style:{gridTemplateRows:i.skillsOpen?"1fr":"0fr"},children:t.jsx("div",{className:"min-h-0 overflow-hidden",children:t.jsx("div",{className:"overflow-y-auto max-h-[300px] mask-[linear-gradient(to_bottom,black_calc(100%-40px),transparent_100%)]",children:t.jsx("div",{className:"flex flex-col gap-2 px-6 pb-4 pt-2",children:l.map(m=>t.jsx(_.Suspense,{fallback:t.jsx(Ie.Fallback,{}),children:t.jsx(Ie,{connection_id:m.connection_id,selected_tools:m.selected_tools,selected_resources:m.selected_resources,selected_prompts:m.selected_prompts,onClick:()=>u(m.connection_id)})},m.connection_id))})})})})]}),t.jsxs("div",{className:"flex flex-col flex-1 p-6 border-t border-border overflow-auto",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Instructions"}),t.jsx(Me,{name:"metadata.instructions",control:n.control,render:({field:m})=>t.jsx(xt,{...m,value:m.value??"",placeholder:"Write instructions here...",className:"min-h-[200px] resize-none text-sm placeholder:text-muted-foreground/50 leading-relaxed border-0 rounded-none shadow-none px-0 focus-visible:ring-0 focus-visible:ring-offset-0 focus:border-0 bg-transparent"})})]})]})}),t.jsx(ms,{open:i.connectionDialogOpen,onOpenChange:m=>d({type:"SET_CONNECTION_DIALOG_OPEN",payload:m}),selectedId:i.editingConnectionId,form:n,connections:l}),t.jsx(vs,{open:i.shareDialogOpen,onOpenChange:m=>d({type:"SET_SHARE_DIALOG_OPEN",payload:m}),virtualMcp:o})]})}function _s(){const o=k.c(6),e=et();let s;o[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/$project/agents/$agentId"},o[0]=s):s=o[0];const n=tt(s),{org:l,agentId:i}=n,d=jt(i);if(!d){let r;return o[1]!==e||o[2]!==l?(r=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(mt,{title:"Agent not found",description:"This Agent may have been deleted or you may not have access.",actions:t.jsx(J,{variant:"outline",onClick:()=>e({to:"/$org/$project/agents",params:{org:l,project:Ge}}),children:"Back to agents"})})}),o[1]=e,o[2]=l,o[3]=r):r=o[3],r}let a;return o[4]!==d?(a=t.jsx(Cs,{virtualMcp:d}),o[4]=d,o[5]=a):a=o[5],a}function Yl(){const o=k.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(fe,{children:t.jsx(_.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(_s,{})})}),o[0]=e):e=o[0],e}export{Yl as default};
@@ -1 +0,0 @@
1
- import{c as ie,j as t,E as ne,r as X,u as ae,b as le,B as q,O as V}from"./index-xQ2t379n.js";import{C as ce}from"./collection-display-button-DrtKZPsB.js";import{C as de,E as Q}from"./collection-search-Cq4rjP0Z.js";import{P as j}from"./index-C79VipEf.js";import{B as me,a as pe,b as ue,c as ge}from"./breadcrumb-N-YM-0qC.js";import{C as he}from"./collection-table-wrapper-CyGYWMWl.js";import{C as fe}from"./connection-card-BEmi4FHw.js";import{I as xe}from"./integration-icon-CyNzGslP.js";import{u as je}from"./use-list-state-DhRtf36X.js";import{u as Ce}from"./use-create-virtual-mcp-COKyzJBE.js";import{i as be}from"./constants-BLSLjUCX.js";import{b as ye,a as we}from"./use-virtual-mcp-COkdNvVv.js";import{c as Ne,b as De,d as Se,A as _e,e as ke,h as ve,a as Ae,f as Ie}from"./alert-dialog-D1XudKG9.js";import{D as Y,a as Z,b as ee,c as R}from"./dropdown-menu-BBy53YtY.js";import{i as te}from"./DotsVertical-N7qtMw5m.js";import{s as se}from"./Eye-DxLOh0i-.js";import{i as Pe}from"./Loading01-BWjBCSBL.js";import{s as oe}from"./Trash01-p1zJKNMp.js";import{t as C}from"./Users03-C4-0uA3w.js";import{U as $e}from"./user-CI081yAV.js";import{A as re}from"./agent-connections-preview-CHU0g32U.js";import{f as ze}from"./format-time-CMKyl-GC.js";import"./ArrowDown-DhmtNBCn.js";import"./ArrowUp-B2lliNjJ.js";import"./Check-Dy5Jwsdl.js";import"./Grid01-CqnSySeu.js";import"./List-C81A8jh_.js";import"./tooltip-B6yKYOIf.js";import"./index-CrfXnuko.js";import"./badge-D8RzvYJ4.js";import"./SearchMd-CpD1Xdqo.js";import"./input-CquIDQAg.js";import"./localstorage-keys-BVjc41qz.js";import"./useQuery-BLe-0FCm.js";import"./useMutation-tQLZk7P3.js";import"./ChevronRight-UHmTzu6U.js";import"./table-BCfVNRpI.js";import"./card-DpIJfsV8.js";import"./Container-nefPC-Vi.js";import"./use-view-mode-5Lt8g0uo.js";import"./use-mobile-CZlm25dt.js";import"./use-connection-Dtj63U01.js";import"./avatar-DNxsCl6r.js";import"./differenceInSeconds-NQ4PDo0z.js";function Me(e,r){switch(r.type){case"delete":return{mode:"deleting",virtualMcp:r.virtualMcp};case"close":return{mode:"idle"}}}function Be(){const e=ie.c(65),{org:r}=ae(),n=le();let b;e[0]!==r.slug?(b={namespace:r.slug,resource:"agents"},e[0]=r.slug,e[1]=b):b=e[1];const s=je(b),x=ye(s);let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y={navigateOnCreate:!0},e[2]=y):y=e[2];const{createVirtualMCP:T,isCreating:w}=Ce(y),U=we();let N;e[3]===Symbol.for("react.memo_cache_sentinel")?(N={mode:"idle"},e[3]=N):N=e[3];const[i,D]=X.useReducer(Me,N);let S;e[4]!==U||e[5]!==i.mode||e[6]!==i.virtualMcp?(S=async()=>{if(i.mode!=="deleting")return;const o=i.virtualMcp.id;if(D({type:"close"}),!(!o||be(o)))try{await U.delete.mutateAsync(o)}catch{}},e[4]=U,e[5]=i.mode,e[6]=i.virtualMcp,e[7]=S):S=e[7];const L=S;let _,k,v,A,I;e[8]===Symbol.for("react.memo_cache_sentinel")?(_={id:"title",header:"Name",render:Fe,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},k={id:"description",header:"Description",render:He,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},v={id:"connections",header:"Connections",render:Ue,cellClassName:"w-28 shrink-0"},A={id:"updated_by",header:"Updated by",render:Te,cellClassName:"w-32 shrink-0",sortable:!0},I={id:"updated_at",header:"Updated",render:Re,cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},e[8]=_,e[9]=k,e[10]=v,e[11]=A,e[12]=I):(_=e[8],k=e[9],v=e[10],A=e[11],I=e[12]);let P;e[13]!==n||e[14]!==r.slug?(P=[_,k,v,A,I,{id:"actions",header:"",render:o=>t.jsxs(Y,{children:[t.jsx(Z,{asChild:!0,children:t.jsx(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ve,children:t.jsx(te,{size:20})})}),t.jsxs(ee,{align:"end",onClick:Ke,children:[t.jsxs(R,{onClick:a=>{a.stopPropagation(),n({to:"/$org/$project/agents/$agentId",params:{org:r.slug,project:V,agentId:o.id}})},children:[t.jsx(se,{size:16}),"Open"]}),t.jsxs(R,{variant:"destructive",onClick:a=>{a.stopPropagation(),D({type:"delete",virtualMcp:o})},children:[t.jsx(oe,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[13]=n,e[14]=r.slug,e[15]=P):P=e[15];const H=P,F=w?"Creating...":"Create Agent";let $;e[16]!==T||e[17]!==w||e[18]!==F?($=t.jsx(q,{onClick:T,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:w,children:F}),e[16]=T,e[17]=w,e[18]=F,e[19]=$):$=e[19];const G=$,J=i.mode==="deleting";let z;e[20]===Symbol.for("react.memo_cache_sentinel")?(z=o=>!o&&D({type:"close"}),e[20]=z):z=e[20];let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Ne,{children:"Delete Agent?"}),e[21]=M):M=e[21];const W=i.mode==="deleting"&&i.virtualMcp.title;let l;e[22]!==W?(l=t.jsxs(De,{children:[M,t.jsxs(Se,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),e[22]=W,e[23]=l):l=e[23];let B;e[24]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(_e,{children:"Cancel"}),e[24]=B):B=e[24];let c;e[25]!==L?(c=t.jsxs(ke,{children:[B,t.jsx(ve,{onClick:L,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[25]=L,e[26]=c):c=e[26];let d;e[27]!==l||e[28]!==c?(d=t.jsxs(Ae,{children:[l,c]}),e[27]=l,e[28]=c,e[29]=d):d=e[29];let m;e[30]!==J||e[31]!==d?(m=t.jsx(Ie,{open:J,onOpenChange:z,children:d}),e[30]=J,e[31]=d,e[32]=m):m=e[32];let O;e[33]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(j.Header.Left,{children:t.jsx(me,{children:t.jsx(pe,{children:t.jsx(ue,{children:t.jsx(ge,{children:"Agents"})})})})}),e[33]=O):O=e[33];let E;e[34]===Symbol.for("react.memo_cache_sentinel")?(E=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],e[34]=E):E=e[34];let p;e[35]!==s.handleSort||e[36]!==s.setViewMode||e[37]!==s.sortDirection||e[38]!==s.sortKey||e[39]!==s.viewMode?(p=t.jsx(ce,{viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:E}),e[35]=s.handleSort,e[36]=s.setViewMode,e[37]=s.sortDirection,e[38]=s.sortKey,e[39]=s.viewMode,e[40]=p):p=e[40];let u;e[41]!==G||e[42]!==p?(u=t.jsxs(j.Header,{children:[O,t.jsxs(j.Header.Right,{children:[p,G]})]}),e[41]=G,e[42]=p,e[43]=u):u=e[43];let g;e[44]!==s?(g=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[44]=s,e[45]=g):g=e[45];let h;e[46]!==s.search||e[47]!==s.setSearch||e[48]!==g?(h=t.jsx(de,{value:s.search,onChange:s.setSearch,placeholder:"Search for an agent...",onKeyDown:g}),e[46]=s.search,e[47]=s.setSearch,e[48]=g,e[49]=h):h=e[49];let f;e[50]!==H||e[51]!==s.handleSort||e[52]!==s.search||e[53]!==s.sortDirection||e[54]!==s.sortKey||e[55]!==s.viewMode||e[56]!==n||e[57]!==r.slug||e[58]!==x?(f=t.jsx(j.Content,{children:s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:x.length===0?t.jsx(Q,{image:t.jsx(C,{size:36,className:"text-muted-foreground"}),title:s.search?"No agents found":"No agents yet",description:s.search?`No agents match "${s.search}"`:"Create an agent to aggregate tools from multiple Connections."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:x.map(o=>t.jsx(fe,{connection:{id:o.id??"",title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(C,{}),onClick:()=>n({to:"/$org/$project/agents/$agentId",params:{org:r.slug,project:V,agentId:o.id}}),footer:t.jsx("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:t.jsxs("span",{children:[o.connections.length," connection",o.connections.length!==1?"s":""]})}),headerActions:t.jsxs(Y,{children:[t.jsx(Z,{asChild:!0,children:t.jsx(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ee,children:t.jsx(te,{size:20})})}),t.jsxs(ee,{align:"end",onClick:Oe,children:[t.jsxs(R,{onClick:a=>{a.stopPropagation(),n({to:"/$org/$project/agents/$agentId",params:{org:r.slug,project:V,agentId:o.id}})},children:[t.jsx(se,{size:16}),"Open"]}),t.jsxs(R,{variant:"destructive",onClick:a=>{a.stopPropagation(),D({type:"delete",virtualMcp:o})},children:[t.jsx(oe,{size:16}),"Delete"]})]})]})},o.id??"default"))})}):t.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:t.jsx(he,{columns:H,data:x,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>n({to:"/$org/$project/agents/$agentId",params:{org:r.slug,project:V,agentId:o.id}}),emptyState:s.search?t.jsx(Q,{image:t.jsx(C,{size:36,className:"text-muted-foreground"}),title:"No agents found",description:`No agents match "${s.search}"`}):t.jsx(Q,{image:t.jsx(C,{size:36,className:"text-muted-foreground"}),title:"No agents yet",description:"Create an agent to aggregate tools from multiple Connections."})})})}),e[50]=H,e[51]=s.handleSort,e[52]=s.search,e[53]=s.sortDirection,e[54]=s.sortKey,e[55]=s.viewMode,e[56]=n,e[57]=r.slug,e[58]=x,e[59]=f):f=e[59];let K;return e[60]!==m||e[61]!==u||e[62]!==h||e[63]!==f?(K=t.jsxs(j,{children:[m,u,h,f]}),e[60]=m,e[61]=u,e[62]=h,e[63]=f,e[64]=K):K=e[64],K}function Oe(e){return e.stopPropagation()}function Ee(e){return e.stopPropagation()}function Ke(e){return e.stopPropagation()}function Ve(e){return e.stopPropagation()}function Re(e){return t.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:e.updated_at?ze(new Date(e.updated_at)):"—"})}function Te(e){return t.jsx($e,{id:e.updated_by??e.created_by,size:"3xs"})}function Ue(e){return t.jsx(X.Suspense,{fallback:t.jsx(re.Fallback,{}),children:t.jsx(re,{connectionIds:e.connections.map(Le),maxVisibleIcons:2})})}function Le(e){return e.connection_id}function He(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Fe(e){return t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(xe,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(C,{size:16})}),t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})]})}function Ot(){const e=ie.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ne,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Pe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Be,{})})}),e[0]=r):r=e[0],r}export{Ot as default};
@@ -1 +0,0 @@
1
- import{c as Ae,j as t,B as Ie,b as Ye,d as Ze,u as et,r as tt,O as $e,t as st}from"./index-xQ2t379n.js";import{g as Oe}from"./generate-id-Dyweu44Y.js";import{C as Fe}from"./collection-display-button-DrtKZPsB.js";import{C as ot,E as it}from"./collection-search-Cq4rjP0Z.js";import{C as nt}from"./card-DpIJfsV8.js";import{I as ke}from"./integration-icon-CyNzGslP.js";import{D as Ke,a as Ue,b as Le,c as k}from"./dropdown-menu-BBy53YtY.js";import{a as Be}from"./Copy01-DTrKcR-Q.js";import{i as Re}from"./DotsVertical-N7qtMw5m.js";import{i as Ve}from"./Edit01-CMeQdBcS.js";import{s as Ge}from"./Eye-DxLOh0i-.js";import{s as Je}from"./Trash01-p1zJKNMp.js";import{C as rt}from"./collection-table-wrapper-CyGYWMWl.js";import{E as ze}from"./empty-state-Cd-Y6dcy.js";import{n as Ee}from"./Inbox01-DFatNHSu.js";import{U as lt}from"./user-CI081yAV.js";import{u as at}from"./use-list-state-DhRtf36X.js";import{B as ct}from"./constants-D_mJYCD9.js";import{A as dt,h as pt,c as mt,b as ut,d as ft,e as ht,a as xt,f as gt}from"./alert-dialog-D1XudKG9.js";import{u as jt,e as Ct}from"./use-connection-Dtj63U01.js";import{u as vt}from"./constants-BLSLjUCX.js";import{s as bt}from"./Plus-CK3qvOs-.js";import{V as yt}from"./layout-BaoRfV41.js";function Nt(n,e){const s=n.properties||{};for(const i in s){const l=s[i];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const r=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of r)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function wt(n){const e=Ae.c(25),{item:s,schema:r,actions:i}=n;let l;e[0]!==s||e[1]!==r?(l=Nt(r,s),e[0]=s,e[1]=r,e[2]=l):l=e[2];const u=l,p=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let j;e[3]!==i?(j=i&&Object.keys(i).length>0,e[3]=i,e[4]=j):j=e[4];const o=j;let m;e[5]!==u||e[6]!==s.title?(m=t.jsx(ke,{icon:u,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=u,e[6]=s.title,e[7]=m):m=e[7];let f;e[8]!==s.title?(f=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=f):f=e[9];const d=p||"No description";let c;e[10]!==d?(c=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:d}),e[10]=d,e[11]=c):c=e[11];let C;e[12]!==f||e[13]!==c?(C=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[f,c]}),e[12]=f,e[13]=c,e[14]=C):C=e[14];let y;e[15]!==m||e[16]!==C?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[m,C]}),e[15]=m,e[16]=C,e[17]=y):y=e[17];let a;e[18]!==i||e[19]!==o||e[20]!==s?(a=o&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:At,onMouseDown:_t,children:t.jsxs(Ke,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(Ie,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Dt,children:t.jsx(Re,{size:20})})}),t.jsxs(Le,{align:"end",onClick:St,children:[i.open&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.open?.(s)},children:[t.jsx(Ge,{size:16}),"Open"]}),i.edit&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.edit?.(s)},children:[t.jsx(Ve,{size:16}),"Edit"]}),i.duplicate&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.duplicate?.(s)},children:[t.jsx(Be,{size:16}),"Duplicate"]}),i.delete&&t.jsxs(k,{variant:"destructive",onClick:h=>{h.stopPropagation(),i.delete?.(s)},children:[t.jsx(Je,{size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=o,e[20]=s,e[21]=a):a=e[21];let S;return e[22]!==y||e[23]!==a?(S=t.jsxs(nt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,a]}),e[22]=y,e[23]=a,e[24]=S):S=e[24],S}function St(n){return n.stopPropagation()}function Dt(n){return n.stopPropagation()}function _t(n){return n.stopPropagation()}function At(n){return n.stopPropagation()}const It=["icon","avatar","logo"],Me=["created_at","created_by","id"];function Pt(n){return Object.keys(n).find(e=>It.includes(e.toLowerCase()))}function We(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function Tt(n){const e=Ae.c(32),{data:s,schema:r,viewMode:i,onViewModeChange:l,search:u,sortKey:p,sortDirection:j,onSort:o,actions:m,onItemClick:f,headerActions:d,emptyState:c,readOnly:C,columns:y,hideToolbar:a,sortableFields:S}=n,h=l===void 0?Mt:l,x=j===void 0?"asc":j,P=o===void 0?Et:o;let v;e[0]!==m?(v=m===void 0?{}:m,e[0]=m,e[1]=v):v=e[1];const D=v,_=f===void 0?zt:f,z=d===void 0?null:d,b=c===void 0?null:c,T=C===void 0?!1:C,N=y===void 0?void 0:y,F=a===void 0?!1:a,w=S===void 0?void 0:S;let E;e[2]!==N||e[3]!==r||e[4]!==w?(E=N?N.filter(Ot).filter(M=>!w||w.includes(M.id)).map($t):We(r,w),e[2]=N,e[3]=r,e[4]=w,e[5]=E):E=e[5];const $=E;let A;e[6]!==z||e[7]!==F||e[8]!==P||e[9]!==h||e[10]!==x||e[11]!==p||e[12]!==$||e[13]!==i?(A=!F&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:z}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Fe,{viewMode:i,onViewModeChange:h,sortKey:p,sortDirection:x,onSort:P,sortOptions:$})})]})}),e[6]=z,e[7]=F,e[8]=P,e[9]=h,e[10]=x,e[11]=p,e[12]=$,e[13]=i,e[14]=A):A=e[14];let O;e[15]!==D||e[16]!==N||e[17]!==s||e[18]!==b||e[19]!==_||e[20]!==P||e[21]!==T||e[22]!==r||e[23]!==u||e[24]!==x||e[25]!==p||e[26]!==w||e[27]!==i?(O=i==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:b||t.jsx(ze,{icon:t.jsx(Ee,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:s.map(M=>t.jsx("div",{onClick:()=>_?.(M),className:"cursor-pointer h-full",children:t.jsx(wt,{item:M,schema:r,readOnly:T,actions:D})},M.id))})}):t.jsx(rt,{columns:Kt(N,r,w,D),data:s,sortKey:p,sortDirection:x,onSort:P,onRowClick:_,emptyState:b||t.jsx(ze,{icon:t.jsx(Ee,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}),e[15]=D,e[16]=N,e[17]=s,e[18]=b,e[19]=_,e[20]=P,e[21]=T,e[22]=r,e[23]=u,e[24]=x,e[25]=p,e[26]=w,e[27]=i,e[28]=O):O=e[28];let I;return e[29]!==A||e[30]!==O?(I=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[A,O]}),e[29]=A,e[30]=O,e[31]=I):I=e[31],I}function $t(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Ot(n){return n.sortable!==!1}function zt(){}function Et(){}function Mt(){}function Ft(n){return{id:"actions",header:"",render:e=>t.jsxs(Ke,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(Ie,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Re,{size:20})})}),t.jsxs(Le,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ge,{size:16}),"Open"]}),n.edit&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Ve,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Be,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(k,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(Je,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function He(n){const e=n.type;return Array.isArray(e)?e.every(s=>He({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function kt(n,e){const s=n.properties||{},r=Object.keys(s).filter(o=>{const m=s[o];return m&&He(m)}),i=Pt(s),l=[],u=new Set;i&&r.includes(i)&&(l.push(i),u.add(i));const p=["title","description","updated_at","updated_by"];for(const o of p)r.includes(o)&&!u.has(o)&&(l.push(o),u.add(o));const j=r.filter(o=>!u.has(o)&&!Me.includes(o)).sort((o,m)=>o.localeCompare(m));for(const o of j)l.push(o),u.add(o);for(const o of Me)r.includes(o)&&!u.has(o)&&(l.push(o),u.add(o));return l.map(o=>{const m=s[o],f=e?e.includes(o):!["id"].includes(o);return o===i?{id:o,header:"",render:d=>{const c=d[o];return t.jsx(ke,{icon:c,name:d.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:o==="description"?{id:o,header:"Description",render:d=>{const c=d[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(c)})},sortable:f,cellClassName:"max-w-[50ch]"}:o==="created_by"||o==="updated_by"?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c?t.jsx(lt,{id:String(c),size:"xs"}):"—"},sortable:f,cellClassName:"max-w-[250px]"}:m?.format==="date-time"||o.endsWith("_at")?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c?t.jsx("span",{className:"block truncate max-w-full",children:new Date(c).toLocaleDateString()}):"—"},sortable:f,cellClassName:"max-w-[200px]"}:{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(c)})},sortable:f,cellClassName:"max-w-[200px]"}})}function Kt(n,e,s,r){const i=n||kt(e,s);return i.some(p=>p.id==="actions")?i:Object.keys(r).length>0?[...i,Ft(r)]:i}function ds(n){const e=Ae.c(113),{connectionId:s,org:r,activeCollection:i}=n,l=i.name,u=i.schema??ct,p=i.hasCreateTool,j=i.hasUpdateTool,o=i.hasDeleteTool,m=Ye(),{data:f}=Ze.useSession(),d=f?.user?.id||"unknown",{org:c}=et();let C;e[0]!==s||e[1]!==c.id?(C={connectionId:s,orgId:c.id},e[0]=s,e[1]=c.id,e[2]=C):C=e[2];const y=vt(C),a=jt(s,l,y),S=`${s}-${l}`;let h;e[3]!==r||e[4]!==S?(h={namespace:r,resource:S,defaultSortKey:"updated_at"},e[3]=r,e[4]=S,e[5]=h):h=e[5];const{search:x,searchTerm:P,setSearch:v,viewMode:D,setViewMode:_,sortKey:z,sortDirection:b,handleSort:T}=at(h);let N;e[6]!==P||e[7]!==b||e[8]!==z?(N={searchTerm:P,sortKey:z,sortDirection:b},e[6]=P,e[7]=b,e[8]=z,e[9]=N):N=e[9];const F=Ct(s,l,y,N),w=!p&&!j&&!o;let E;e[10]!==l||e[11]!==s||e[12]!==m||e[13]!==r?(E=g=>{m({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:$e,connectionId:s,collectionName:l,itemId:g.id}})},e[10]=l,e[11]=s,e[12]=m,e[13]=r,e[14]=E):E=e[14];const $=E;let A;e[15]!==a.create||e[16]!==d?(A=async g=>{const me=new Date().toISOString();await a.create.mutateAsync({...g,id:Oe("conn"),title:`${g.title} (Copy)`,created_at:me,updated_at:me,created_by:d,updated_by:d})},e[15]=a.create,e[16]=d,e[17]=A):A=e[17];const O=A,[I,M]=tt.useState(null);let oe;e[18]===Symbol.for("react.memo_cache_sentinel")?(oe=g=>{M(g)},e[18]=oe):oe=e[18];const qe=oe;let K;e[19]!==$||e[20]!==j?(K=j&&{edit:$},e[19]=$,e[20]=j,e[21]=K):K=e[21];let U;e[22]!==O||e[23]!==p?(U=p&&{duplicate:O},e[22]=O,e[23]=p,e[24]=U):U=e[24];let L;e[25]!==o?(L=o&&{delete:qe},e[25]=o,e[26]=L):L=e[26];let ie;e[27]!==L||e[28]!==K||e[29]!==U?(ie={...K,...U,...L},e[27]=L,e[28]=K,e[29]=U,e[30]=ie):ie=e[30];const ue=ie;let ne;e[31]!==a.delete||e[32]!==I?(ne=async()=>{I&&(await a.delete.mutateAsync(I.id),M(null))},e[31]=a.delete,e[32]=I,e[33]=ne):ne=e[33];const fe=ne;let re;e[34]!==a.create||e[35]!==l||e[36]!==s||e[37]!==p||e[38]!==m||e[39]!==r||e[40]!==d?(re=async()=>{if(!p){st.error("Create operation is not available for this collection");return}const g=new Date().toISOString(),me={id:Oe("conn"),title:"New Item",description:"A brief description of the item",created_at:g,updated_at:g,created_by:d,updated_by:d};try{const _e=await a.create.mutateAsync(me);m({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:$e,connectionId:s,collectionName:l,itemId:_e.id}})}catch(_e){console.error("Failed to create item:",_e)}},e[34]=a.create,e[35]=l,e[36]=s,e[37]=p,e[38]=m,e[39]=r,e[40]=d,e[41]=re):re=e[41];const he=re;let le;e[42]!==u?(le=We(u),e[42]=u,e[43]=le):le=e[43];const xe=le,Pe=(F?.length??0)>0,Qe=p&&Pe,Xe=p&&!Pe&&!x;let ae;e[44]!==a.create||e[45]!==he||e[46]!==p?(ae=p?t.jsxs(Ie,{onClick:he,size:"sm",disabled:a.create.isPending,className:"h-7",children:[t.jsx(bt,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[44]=a.create,e[45]=he,e[46]=p,e[47]=ae):ae=e[47];const Te=ae,ge=z;let B;e[48]!==T||e[49]!==_||e[50]!==b||e[51]!==xe||e[52]!==ge||e[53]!==D?(B=t.jsx(Fe,{viewMode:D,onViewModeChange:_,sortKey:ge,sortDirection:b,onSort:T,sortOptions:xe}),e[48]=T,e[49]=_,e[50]=b,e[51]=xe,e[52]=ge,e[53]=D,e[54]=B):B=e[54];const je=Qe&&Te;let R;e[55]!==B||e[56]!==je?(R=t.jsxs(yt,{children:[B,je]}),e[55]=B,e[56]=je,e[57]=R):R=e[57];const Ce=`Search ${l}...`;let V;e[58]!==v?(V=g=>{g.key==="Escape"&&(v(""),g.target.blur())},e[58]=v,e[59]=V):V=e[59];let G;e[60]!==x||e[61]!==v||e[62]!==Ce||e[63]!==V?(G=t.jsx(ot,{value:x,onChange:v,placeholder:Ce,onKeyDown:V}),e[60]=x,e[61]=v,e[62]=Ce,e[63]=V,e[64]=G):G=e[64];let J;e[65]!==F?(J=F??[],e[65]=F,e[66]=J):J=e[66];const ve=z;let W;e[67]!==$?(W=g=>$(g),e[67]=$,e[68]=W):W=e[68];const be="No items found",ye=x?"Try adjusting your search terms":"This collection doesn't have any items yet.",Ne=Xe?Te:void 0;let H;e[69]!==be||e[70]!==ye||e[71]!==Ne?(H=t.jsx(it,{image:null,title:be,description:ye,actions:Ne}),e[69]=be,e[70]=ye,e[71]=Ne,e[72]=H):H=e[72];let q;e[73]!==T||e[74]!==w||e[75]!==ue||e[76]!==u||e[77]!==x||e[78]!==v||e[79]!==_||e[80]!==b||e[81]!==J||e[82]!==ve||e[83]!==W||e[84]!==H||e[85]!==D?(q=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Tt,{hideToolbar:!0,data:J,schema:u,viewMode:D,onViewModeChange:_,search:x,onSearchChange:v,sortKey:ve,sortDirection:b,onSort:T,actions:ue,onItemClick:W,readOnly:w,emptyState:H})}),e[73]=T,e[74]=w,e[75]=ue,e[76]=u,e[77]=x,e[78]=v,e[79]=_,e[80]=b,e[81]=J,e[82]=ve,e[83]=W,e[84]=H,e[85]=D,e[86]=q):q=e[86];let Q;e[87]!==G||e[88]!==q?(Q=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[G,q]}),e[87]=G,e[88]=q,e[89]=Q):Q=e[89];const we=!!I;let ce;e[90]===Symbol.for("react.memo_cache_sentinel")?(ce=g=>{g||M(null)},e[90]=ce):ce=e[90];let de;e[91]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx(mt,{children:"Delete item?"}),e[91]=de):de=e[91];const Se=I?.title;let X;e[92]!==Se?(X=t.jsxs(ut,{children:[de,t.jsxs(ft,{children:['Are you sure you want to delete "',Se,'"? This action cannot be undone.']})]}),e[92]=Se,e[93]=X):X=e[93];let Y;e[94]!==a.delete.isPending?(Y=t.jsx(dt,{disabled:a.delete.isPending,children:"Cancel"}),e[94]=a.delete.isPending,e[95]=Y):Y=e[95];const De=a.delete.isPending?"Deleting...":"Delete";let Z;e[96]!==a.delete.isPending||e[97]!==fe||e[98]!==De?(Z=t.jsx(pt,{onClick:fe,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:De}),e[96]=a.delete.isPending,e[97]=fe,e[98]=De,e[99]=Z):Z=e[99];let ee;e[100]!==Y||e[101]!==Z?(ee=t.jsxs(ht,{children:[Y,Z]}),e[100]=Y,e[101]=Z,e[102]=ee):ee=e[102];let te;e[103]!==X||e[104]!==ee?(te=t.jsxs(xt,{children:[X,ee]}),e[103]=X,e[104]=ee,e[105]=te):te=e[105];let se;e[106]!==we||e[107]!==te?(se=t.jsx(gt,{open:we,onOpenChange:ce,children:te}),e[106]=we,e[107]=te,e[108]=se):se=e[108];let pe;return e[109]!==R||e[110]!==Q||e[111]!==se?(pe=t.jsxs(t.Fragment,{children:[R,Q,se]}),e[109]=R,e[110]=Q,e[111]=se,e[112]=pe):pe=e[112],pe}export{ds as C};
@@ -1 +0,0 @@
1
- import{c as U,j as t,b as Ne,B as Ue,O as ge,aD as it,u as Be,q as gt,c0 as Qe,aB as jt,p as bt,r as X,o as at,bI as vt,bQ as Nt,s as z,bb as Ge,bc as yt,E as ct,e as _t,a as Ct,n as St,k as wt,l as Tt,i as kt,t as ve,K as Je}from"./index-xQ2t379n.js";import{E as Z,C as ze}from"./collection-search-Cq4rjP0Z.js";import{E as Pt,r as It,e as lt}from"./env-vars-editor-CFN3JqN6.js";import{g as Ke}from"./types-CnPYT6I7.js";import{S as $t}from"./save-actions-OW6B8GGT.js";import{b as At,a as Vt}from"./use-binding-BSjPQ0Be.js";import{u as Mt,S as Dt}from"./index-9MR1Aak3.js";import{f as Ot,g as dt}from"./use-connection-Dtj63U01.js";import{u as mt}from"./constants-BLSLjUCX.js";import{d as Rt}from"./use-mcp-tools-DScmBuoc.js";import{b as Et}from"./use-mcp-resources-B792gs6l.js";import{a as Lt}from"./decopilot-events-BEPzMc6y.js";import{a as Ut}from"./mcp-oauth-BKgRq621.js";import{b as Ye,c as Ft,d as Bt,e as zt,B as Kt,a as Xt}from"./breadcrumb-N-YM-0qC.js";import{C as qt}from"./collection-tabs-r7GKXx3H.js";import{i as Oe}from"./Loading01-BWjBCSBL.js";import{V as Xe,a as Ht}from"./layout-BaoRfV41.js";import{C as Wt}from"./collection-tab-CDCwjyV8.js";import{I as Qt}from"./icon-picker-BXWmqDNl.js";import{I as Re}from"./integration-icon-CyNzGslP.js";import{B as Fe}from"./badge-D8RzvYJ4.js";import{D as Gt,a as Jt,b as Yt,c as Ze}from"./dropdown-menu-BBy53YtY.js";import{F as H,a as Zt,b as W,d as K,f as Q,c as Y,e as es}from"./form-DKOen-4i.js";import{I as G}from"./input-CquIDQAg.js";import{S as et,a as tt,b as st,c as nt,d as q}from"./select-CDsJtNMV.js";import{i as ut}from"./CheckCircle-DCJamcsS.js";import{t as ts}from"./ChevronDown-B8UJn4iH.js";import{n as ss}from"./Container-nefPC-Vi.js";import{s as De}from"./Globe02-KBI1AO62.js";import{s as ns}from"./RefreshCcw01-DCU1xktc.js";import{i as os}from"./Terminal-EynP_hYL.js";import{s as rs}from"./Trash01-p1zJKNMp.js";import{t as qe}from"./Users03-C4-0uA3w.js";import{s as is}from"./XClose-BoXt6_S8.js";import{U as as}from"./user-CI081yAV.js";import{b as cs,a as ls}from"./use-virtual-mcp-COkdNvVv.js";import{i as ds}from"./ChevronRight-UHmTzu6U.js";import{s as ms}from"./Plus-CK3qvOs-.js";import{f as us}from"./formatDistanceToNow-Cb2QZZJn.js";import{C as pt}from"./collection-display-button-DrtKZPsB.js";import{C as ft}from"./collection-table-wrapper-CyGYWMWl.js";import{C as He}from"./card-DpIJfsV8.js";import{R as ps}from"./readme-viewer-CSo2KaPk.js";import{T as fs,a as xs}from"./tools-list-DKmevE2X.js";import{M as hs}from"./mcp-app-renderer-DYp1_awD.js";import"./SearchMd-CpD1Xdqo.js";import"./Save01-sMmuMs88.js";import"./binder-Blih3Yob.js";import"./File06-CJFI46Rj.js";import"./Key01-5M9GOooO.js";import"./constants-D_mJYCD9.js";import"./registry-utils-Cjdxmsng.js";import"./extract-connection-data-Bjwt_XIu.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-DD_AL_1f.js";import"./index-DYkmX0JZ.js";import"./circle-alert-D8ryfTOx.js";import"./index-DVmCBhSl.js";import"./index-Bxe5mObN.js";import"./index-D3pPaynQ.js";import"./collapsible-CpgZSwBN.js";import"./use-llm-5n5wwCT_.js";import"./useQuery-BLe-0FCm.js";import"./localstorage-keys-BVjc41qz.js";import"./useMutation-tQLZk7P3.js";import"./tabs-DN8uQx_4.js";import"./checkbox-CUOTkCKW.js";import"./Check-Dy5Jwsdl.js";import"./dialog-BEh9NHdw.js";import"./X-C0j62Xtl.js";import"./skeleton-Ct9swv0n.js";import"./AlignLeft-D-24Asic.js";import"./ArrowLeft-BwnRcCxk.js";import"./Image01-C8E_92eh.js";import"./Settings01-Bhz_Vu7B.js";import"./useSuspenseInfiniteQuery-D0p_NlPn.js";import"./infiniteQueryObserver-bwcxH-lX.js";import"./popover-BGz1EQnh.js";import"./spinner-DfUcLZCl.js";import"./tooltip-B6yKYOIf.js";import"./index-CrfXnuko.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-B2lliNjJ.js";import"./Edit01-CMeQdBcS.js";import"./XCircle-BtpMj0Vx.js";import"./AlertCircle-BmterM6-.js";import"./use-copy-oq5GkYwB.js";import"./Code01-Ce_GLriH.js";import"./use-create-virtual-mcp-COKyzJBE.js";import"./Copy01-DTrKcR-Q.js";import"./marked.esm-BaswSlok.js";import"./markdown-Ba8nOSsK.js";import"./Eye-DxLOh0i-.js";import"./LayersTwo01-D3z_72X4.js";import"./index-C79VipEf.js";import"./Clock-CHKtyQRJ.js";import"./DotsVertical-N7qtMw5m.js";import"./empty-state-Cd-Y6dcy.js";import"./Inbox01-DFatNHSu.js";import"./use-list-state-DhRtf36X.js";import"./use-view-mode-5Lt8g0uo.js";import"./use-mobile-CZlm25dt.js";import"./alert-dialog-D1XudKG9.js";import"./scroll-area-BlV5UvCB.js";import"./Edit05-DZ_UN_S5.js";import"./Link01-phTHWMEc.js";import"./label-DgKgIZIr.js";import"./avatar-DNxsCl6r.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowDown-DhmtNBCn.js";import"./Grid01-CqnSySeu.js";import"./List-C81A8jh_.js";import"./table-BCfVNRpI.js";function gs(s){const e=U.c(14),{virtualMcp:n,org:o}=s;let i;e[0]!==o||e[1]!==n.id?(i={org:o,project:ge,agentId:n.id},e[0]=o,e[1]=n.id,e[2]=i):i=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(qe,{size:16}),e[3]=a):a=e[3];let l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(Re,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[4]=n.icon,e[5]=n.title,e[6]=l):l=e[6];let j;e[7]!==n.title?(j=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ds,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=f):f=e[9];let m;return e[10]!==i||e[11]!==l||e[12]!==j?(m=t.jsxs(it,{to:"/$org/$project/agents/$agentId",params:i,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[l,j,f]}),e[10]=i,e[11]=l,e[12]=j,e[13]=m):m=e[13],m}function ot(s){const e=U.c(20),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:j}=s,f=Ne(),m=ls();let x;e[0]!==m.create||e[1]!==i||e[2]!==a||e[3]!==n||e[4]!==o||e[5]!==f||e[6]!==l?(x=async()=>{const d=await m.create.mutateAsync({title:`${o} Agent`,description:i??null,icon:a??null,status:"active",connections:[{connection_id:n,selected_tools:null,selected_resources:null,selected_prompts:null}]});f({to:"/$org/$project/agents/$agentId",params:{org:l,project:ge,agentId:d.id}})},e[0]=m.create,e[1]=i,e[2]=a,e[3]=n,e[4]=o,e[5]=f,e[6]=l,e[7]=x):x=e[7];const c=x;if(j){let d;e[8]!==m.create.isPending?(d=m.create.isPending?t.jsx(Oe,{size:16,className:"animate-spin"}):t.jsx(ms,{size:16}),e[8]=m.create.isPending,e[9]=d):d=e[9];let u;return e[10]!==m.create.isPending||e[11]!==c||e[12]!==d?(u=t.jsx(Ue,{variant:"ghost",className:"size-6 p-0",onClick:c,disabled:m.create.isPending,children:d}),e[10]=m.create.isPending,e[11]=c,e[12]=d,e[13]=u):u=e[13],u}let r;e[14]!==m.create.isPending?(r=m.create.isPending?t.jsx(Oe,{className:"animate-spin text-muted-foreground"}):t.jsx(qe,{className:"size-3 text-muted-foreground"}),e[14]=m.create.isPending,e[15]=r):r=e[15];let h;return e[16]!==m.create.isPending||e[17]!==c||e[18]!==r?(h=t.jsxs(Ue,{variant:"outline",size:"sm",onClick:c,disabled:m.create.isPending,children:[r,"Create an agent"]}),e[16]=m.create.isPending,e[17]=c,e[18]=r,e[19]=h):h=e[19],h}function js(s){const e=U.c(26),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l}=s;let j;e[0]!==n?(j={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=j):j=e[1];const f=cs(j);if(!(f.length>0)){let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=u):u=e[2];let b;return e[3]!==i||e[4]!==a||e[5]!==n||e[6]!==o||e[7]!==l?(b=t.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[u,t.jsx(ot,{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:!1})]}),e[3]=i,e[4]=a,e[5]=n,e[6]=o,e[7]=l,e[8]=b):b=e[8],b}let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Agents"}),e[9]=x):x=e[9];let c;e[10]!==i||e[11]!==a||e[12]!==n||e[13]!==o||e[14]!==l?(c=t.jsx("div",{className:"flex flex-col gap-1",children:t.jsxs("div",{className:"flex items-center justify-between",children:[x,t.jsx(ot,{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:!0})]})}),e[10]=i,e[11]=a,e[12]=n,e[13]=o,e[14]=l,e[15]=c):c=e[15];let r;if(e[16]!==l||e[17]!==f){let u;e[19]!==l?(u=b=>t.jsx(gs,{virtualMcp:b,org:l},b.id),e[19]=l,e[20]=u):u=e[20],r=f.map(u),e[16]=l,e[17]=f,e[18]=r}else r=e[18];let h;e[21]!==r?(h=t.jsx("div",{className:"flex flex-col gap-2",children:r}),e[21]=r,e[22]=h):h=e[22];let d;return e[23]!==c||e[24]!==h?(d=t.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[c,h]}),e[23]=c,e[24]=h,e[25]=d):d=e[25],d}function bs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:i}){const a=Qe({control:s.control,name:"ui_type"}),l=Qe({control:s.control,name:"connection_url"}),{stdioEnabled:j}=jt(),f=(()=>{if(typeof l!="string"||!l)return!1;try{const r=new URL(l);return r.hostname==="api.githubcopilot.com"&&r.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),m=j||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",c=x?bt(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(qe,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),c&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:c})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(H,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),a!=="NPX"&&a!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(et,{value:r.value,onValueChange:r.onChange,children:[t.jsx(K,{children:t.jsxs(tt,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(De,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(st,{})]})}),t.jsxs(nt,{children:[t.jsx(q,{value:"HTTP",children:"HTTP"}),t.jsx(q,{value:"SSE",children:"SSE"}),t.jsx(q,{value:"Websocket",children:"Websocket"}),m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:"NPX Package"}),t.jsx(q,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(H,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(W,{className:"flex-1 min-w-0",children:t.jsx(K,{children:t.jsx(G,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(et,{value:r.value,onValueChange:r.onChange,children:[t.jsx(K,{children:t.jsx(tt,{className:"h-10",children:t.jsx(st,{})})}),t.jsxs(nt,{children:[t.jsx(q,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(q,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(q,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"Websocket"]})}),m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ss,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(os,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(Q,{})]})}),a==="NPX"&&t.jsx(H,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(K,{children:t.jsx(G,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),a==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(H,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(K,{children:t.jsx(G,{placeholder:"node, bun, python...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),t.jsx(H,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(K,{children:t.jsx(G,{placeholder:"arg1 arg2 --flag value",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(Q,{})]})})]}),t.jsx(H,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(K,{children:t.jsx(G,{placeholder:"/path/to/project (optional)",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})})]}),(a==="NPX"||a==="STDIO")&&t.jsx(H,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(K,{children:t.jsx(Pt,{value:r.value??[],onChange:r.onChange})}),t.jsx(Q,{})]})}),a!=="NPX"&&a!=="STDIO"&&t.jsx(H,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:f?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Gt,{children:[t.jsx(Jt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Fe,{variant:"success",className:"gap-1.5",children:[t.jsx(ut,{size:12}),"Authenticated via OAuth",t.jsx(ts,{size:12})]})})}),t.jsxs(Yt,{align:"start",children:[t.jsxs(Ze,{onClick:o,children:[t.jsx(ns,{size:16}),"Re-authenticate"]}),t.jsxs(Ze,{variant:"destructive",onClick:i,children:[t.jsx(rs,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&r.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>r.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(is,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(K,{children:t.jsx(G,{type:"password",placeholder:f?"Paste your GitHub PAT":"Enter access token...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),f&&t.jsxs(es,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(Q,{})]})})]})}function vs(s){const e=U.c(45),{form:n,connection:o,isMCPAuthenticated:i,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:j}=s,{org:f}=Be();let m;e[0]!==o.app_name||e[1]!==o.icon||e[2]!==o.title||e[3]!==n.control?(m=o.app_name&&o.icon?t.jsx(Re,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}):t.jsx(gt,{control:n.control,name:"icon",render:k=>{const{field:I}=k;return t.jsx(Qt,{value:I.value,onChange:I.onChange,name:o.title,size:"lg",className:"shadow-sm"})}}),e[0]=o.app_name,e[1]=o.icon,e[2]=o.title,e[3]=n.control,e[4]=m):m=e[4];let x;e[5]!==n.control?(x=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(H,{control:n.control,name:"title",render:ys}),t.jsx(H,{control:n.control,name:"description",render:Ns})]}),e[5]=n.control,e[6]=x):x=e[6];let c;e[7]!==m||e[8]!==x?(c=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[m,x]}),e[7]=m,e[8]=x,e[9]=c):c=e[9];let r;e[10]!==o||e[11]!==n||e[12]!==a||e[13]!==l||e[14]!==j?(r=t.jsx(bs,{form:n,connection:o,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:j}),e[10]=o,e[11]=n,e[12]=a,e[13]=l,e[14]=j,e[15]=r):r=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[16]=h):h=e[16];let d;e[17]!==i?(d=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[h,i?t.jsxs(Fe,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[t.jsx(ut,{size:12}),"Connected"]}):t.jsx(Fe,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[17]=i,e[18]=d):d=e[18];let u;e[19]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[19]=u):u=e[19];let b;e[20]!==o.created_by?(b=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[u,t.jsx(as,{id:o.created_by,size:"2xs"})]}),e[20]=o.created_by,e[21]=b):b=e[21];let v;e[22]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[22]=v):v=e[22];let _;e[23]!==o.updated_at?(_=o.updated_at?us(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[23]=o.updated_at,e[24]=_):_=e[24];let S;e[25]!==_?(S=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[v,t.jsx("span",{className:"text-sm text-foreground",children:_})]}),e[25]=_,e[26]=S):S=e[26];let p;e[27]!==S||e[28]!==d||e[29]!==b?(p=t.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[d,b,S]}),e[27]=S,e[28]=d,e[29]=b,e[30]=p):p=e[30];let C;e[31]!==o.description||e[32]!==o.icon||e[33]!==o.id||e[34]!==o.title||e[35]!==f.slug?(C=t.jsx(js,{connectionId:o.id,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,org:f.slug}),e[31]=o.description,e[32]=o.icon,e[33]=o.id,e[34]=o.title,e[35]=f.slug,e[36]=C):C=e[36];let w;e[37]!==p||e[38]!==C||e[39]!==c||e[40]!==r?(w=t.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[c,r,p,C]}),e[37]=p,e[38]=C,e[39]=c,e[40]=r,e[41]=w):w=e[41];let g;return e[42]!==n||e[43]!==w?(g=t.jsx(Zt,{...n,children:w}),e[42]=n,e[43]=w,e[44]=g):g=e[44],g}function Ns(s){const{field:e}=s;return t.jsxs(W,{className:"w-full space-y-0",children:[t.jsx(K,{children:t.jsx(G,{...e,value:e.value||"",className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Q,{})]})}function ys(s){const{field:e}=s;return t.jsxs(W,{className:"flex-1 space-y-0",children:[t.jsx(K,{children:t.jsx(G,{...e,className:"h-auto py-0.5 text-lg! font-medium leading-7 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})}),t.jsx(Q,{})]})}function _s(s){const e=U.c(39),{prompts:n,connectionId:o,org:i,onPromptClick:a,showToolbar:l,emptyMessage:j}=s,f=l===void 0?!0:l,m=j===void 0?"This connection doesn't have any prompts yet.":j,x=Ne(),[c,r]=X.useState(""),[h,d]=X.useState("table"),[u,b]=X.useState("name"),[v,_]=X.useState("asc");let S;e[0]!==v||e[1]!==u?(S=T=>{u===T?(_(ks),v==="desc"&&b(void 0)):(b(T),_("asc"))},e[0]=v,e[1]=u,e[2]=S):S=e[2];const p=S;let C;e[3]!==o||e[4]!==x||e[5]!==a||e[6]!==i?(C=T=>{a?a(T):o&&i&&x({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:ge,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(T.name)}})},e[3]=o,e[4]=x,e[5]=a,e[6]=i,e[7]=C):C=e[7];const w=C;let g;if(e[8]!==n||e[9]!==c||e[10]!==v||e[11]!==u){const T=!n||n.length===0?[]:c.trim()?(()=>{const F=c.toLowerCase();return n.filter(B=>B.name.toLowerCase().includes(F)||B.description&&B.description.toLowerCase().includes(F))})():n;g=!u||!v?T:[...T].sort((F,B)=>{const je=F[u]||"",ee=B[u]||"",J=String(je).localeCompare(String(ee));return v==="asc"?J:-J}),e[8]=n,e[9]=c,e[10]=v,e[11]=u,e[12]=g}else g=e[12];const k=g;let I;e[13]===Symbol.for("react.memo_cache_sentinel")?(I=[{id:"name",header:"Name",render:Ts,sortable:!0},{id:"description",header:"Description",render:ws,cellClassName:"flex-1",sortable:!0}],e[13]=I):I=e[13];const V=I;let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=V.filter(Ss).map(Cs),e[14]=M):M=e[14];const L=M;let y;e[15]!==p||e[16]!==f||e[17]!==v||e[18]!==u||e[19]!==h?(y=f&&t.jsx(Xe,{children:t.jsx(pt,{viewMode:h,onViewModeChange:d,sortKey:u,sortDirection:v,onSort:p,sortOptions:L})}),e[15]=p,e[16]=f,e[17]=v,e[18]=u,e[19]=h,e[20]=y):y=e[20];let R;e[21]===Symbol.for("react.memo_cache_sentinel")?(R=T=>{T.key==="Escape"&&(r(""),T.target.blur())},e[21]=R):R=e[21];let D;e[22]!==c?(D=t.jsx(ze,{value:c,onChange:r,placeholder:"Search prompts...",onKeyDown:R}),e[22]=c,e[23]=D):D=e[23];let N;e[24]!==m||e[25]!==w||e[26]!==p||e[27]!==c||e[28]!==v||e[29]!==u||e[30]!==k||e[31]!==h?(N=h==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:k.length===0?t.jsx(Z,{image:null,title:c?"No prompts found":"No prompts available",description:c?"Try adjusting your search terms":m}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:k.map(T=>t.jsx(He,{className:"cursor-pointer transition-colors",onClick:()=>w(T),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Re,{icon:null,name:T.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:T.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:T.description||"No description"})]})]})},T.name))})}):t.jsx(ft,{columns:V,data:k,isLoading:!1,sortKey:u,sortDirection:v,onSort:p,onRowClick:T=>w(T),emptyState:t.jsx(Z,{image:null,title:c?"No prompts found":"No prompts available",description:c?"Try adjusting your search terms":m})}),e[24]=m,e[25]=w,e[26]=p,e[27]=c,e[28]=v,e[29]=u,e[30]=k,e[31]=h,e[32]=N):N=e[32];let A;e[33]!==D||e[34]!==N?(A=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[D,N]}),e[33]=D,e[34]=N,e[35]=A):A=e[35];let $;return e[36]!==A||e[37]!==y?($=t.jsxs(t.Fragment,{children:[y,A]}),e[36]=A,e[37]=y,e[38]=$):$=e[38],$}function Cs(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Ss(s){return s.sortable}function ws(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ts(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function ks(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Ps(s){const e=U.c(4),{prompts:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx(_s,{prompts:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}function Is(s){const e=U.c(2),{repository:n}=s;let o;return e[0]!==n?(o=t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(ps,{repository:n})}),e[0]=n,e[1]=o):o=e[1],o}function $s(s){const e=U.c(36),{resources:n,onResourceClick:o,showToolbar:i,emptyMessage:a}=s,l=i===void 0?!0:i,j=a===void 0?"This connection doesn't have any resources yet.":a,[f,m]=X.useState(""),[x,c]=X.useState("table"),[r,h]=X.useState("name"),[d,u]=X.useState("asc");let b;e[0]!==d||e[1]!==r?(b=N=>{r===N?(u(Es),d==="desc"&&h(void 0)):(h(N),u("asc"))},e[0]=d,e[1]=r,e[2]=b):b=e[2];const v=b;let _;e[3]!==o?(_=N=>{o&&o(N)},e[3]=o,e[4]=_):_=e[4];const S=_;let p;if(e[5]!==n||e[6]!==f||e[7]!==d||e[8]!==r){const N=!n||n.length===0?[]:f.trim()?(()=>{const A=f.toLowerCase();return n.filter($=>$.uri.toLowerCase().includes(A)||$.name&&$.name.toLowerCase().includes(A)||$.description&&$.description.toLowerCase().includes(A))})():n;p=!r||!d?N:[...N].sort((A,$)=>{const T=A[r]||"",F=$[r]||"",B=String(T).localeCompare(String(F));return d==="asc"?B:-B}),e[5]=n,e[6]=f,e[7]=d,e[8]=r,e[9]=p}else p=e[9];const C=p;let w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=[{id:"name",header:"Name",render:Rs,sortable:!0},{id:"uri",header:"URI",render:Os,sortable:!0},{id:"description",header:"Description",render:Ds,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Ms,sortable:!0}],e[10]=w):w=e[10];const g=w;let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=g.filter(Vs).map(As),e[11]=k):k=e[11];const I=k;let V;e[12]!==v||e[13]!==l||e[14]!==d||e[15]!==r||e[16]!==x?(V=l&&t.jsx(Xe,{children:t.jsx(pt,{viewMode:x,onViewModeChange:c,sortKey:r,sortDirection:d,onSort:v,sortOptions:I})}),e[12]=v,e[13]=l,e[14]=d,e[15]=r,e[16]=x,e[17]=V):V=e[17];let M;e[18]===Symbol.for("react.memo_cache_sentinel")?(M=N=>{N.key==="Escape"&&(m(""),N.target.blur())},e[18]=M):M=e[18];let L;e[19]!==f?(L=t.jsx(ze,{value:f,onChange:m,placeholder:"Search resources...",onKeyDown:M}),e[19]=f,e[20]=L):L=e[20];let y;e[21]!==j||e[22]!==S||e[23]!==v||e[24]!==f||e[25]!==d||e[26]!==r||e[27]!==C||e[28]!==x?(y=x==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:C.length===0?t.jsx(Z,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":j}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:C.map(N=>t.jsx(He,{className:"cursor-pointer transition-colors",onClick:()=>S(N),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Re,{icon:null,name:N.name||N.uri,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:N.name||N.uri}),t.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:N.uri}),N.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:N.description})]})]})},N.uri))})}):t.jsx(ft,{columns:g,data:C,isLoading:!1,sortKey:r,sortDirection:d,onSort:v,onRowClick:N=>S(N),emptyState:t.jsx(Z,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":j})}),e[21]=j,e[22]=S,e[23]=v,e[24]=f,e[25]=d,e[26]=r,e[27]=C,e[28]=x,e[29]=y):y=e[29];let R;e[30]!==L||e[31]!==y?(R=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[L,y]}),e[30]=L,e[31]=y,e[32]=R):R=e[32];let D;return e[33]!==R||e[34]!==V?(D=t.jsxs(t.Fragment,{children:[V,R]}),e[33]=R,e[34]=V,e[35]=D):D=e[35],D}function As(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Vs(s){return s.sortable}function Ms(s){return t.jsx("span",{className:"text-sm text-muted-foreground",children:s.mimeType||"—"})}function Ds(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Os(s){return t.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:s.uri})}function Rs(s){return t.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name||s.uri})}function Es(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Ls(s){const e=U.c(4),{resources:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx($s,{resources:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}const Us=at({key:z().min(1,"Key is required"),value:z()}),Fs=at({title:z().min(1,"Name is required"),description:z().nullable().optional(),icon:z().nullable().optional(),ui_type:yt(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:z().optional(),connection_token:z().nullable().optional(),npx_package:z().optional(),stdio_command:z().optional(),stdio_args:z().optional(),stdio_cwd:z().optional(),env_vars:Ge(Us).optional(),configuration_scopes:Ge(z()).nullable().optional(),configuration_state:vt(z(),Nt()).nullable().optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Bs(s){const e=U.c(5),{tools:n,connectionId:o,org:i,isLoading:a}=s;let l;return e[0]!==o||e[1]!==a||e[2]!==i||e[3]!==n?(l=t.jsx(fs,{tools:n,connectionId:o,org:i,isLoading:a}),e[0]=o,e[1]=a,e[2]=i,e[3]=n,e[4]=l):l=e[4],l}function zs(s){const e=U.c(27),{tools:n,connectionId:o,org:i}=s,a=Ne(),{org:l}=Be();let j;e[0]!==o||e[1]!==l.id?(j={connectionId:o,orgId:l.id},e[0]=o,e[1]=l.id,e[2]=j):j=e[2];const f=mt(j),[m,x]=X.useState("");let c,r,h,d;if(e[3]!==f||e[4]!==o||e[5]!==a||e[6]!==i||e[7]!==m||e[8]!==n){const v=(n??[]).filter(Ks),_=m.toLowerCase().trim(),S=_?v.filter(g=>g.name.toLowerCase().includes(_)||g.description&&g.description.toLowerCase().includes(_)):v;let p;e[13]!==o||e[14]!==a||e[15]!==i?(p=g=>{a({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:ge,connectionId:o,collectionName:"tools",itemId:encodeURIComponent(g.name)}})},e[13]=o,e[14]=a,e[15]=i,e[16]=p):p=e[16];const C=p;h="flex flex-col h-full overflow-hidden";let w;e[17]===Symbol.for("react.memo_cache_sentinel")?(w=g=>{g.key==="Escape"&&(x(""),g.target.blur())},e[17]=w):w=e[17],e[18]!==m?(d=t.jsx(ze,{value:m,onChange:x,placeholder:"Search apps...",onKeyDown:w}),e[18]=m,e[19]=d):d=e[19],c="flex-1 overflow-auto p-5",r=S.length===0?t.jsx(Z,{image:null,title:m?"No apps found":"No apps available",description:m?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:S.map(g=>{const k=Ke(g._meta);return t.jsxs(He,{className:"cursor-pointer transition-colors overflow-hidden",onClick:()=>C(g),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(hs,{resourceURI:k,toolInfo:{tool:g},displayMode:"inline",minHeight:200,maxHeight:200,client:f})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:g.name}),t.jsx(xs,{annotations:g.annotations,_meta:g._meta})]}),g.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:g.description})]})]},g.name)})}),e[3]=f,e[4]=o,e[5]=a,e[6]=i,e[7]=m,e[8]=n,e[9]=c,e[10]=r,e[11]=h,e[12]=d}else c=e[9],r=e[10],h=e[11],d=e[12];let u;e[20]!==c||e[21]!==r?(u=t.jsx("div",{className:c,children:r}),e[20]=c,e[21]=r,e[22]=u):u=e[22];let b;return e[23]!==h||e[24]!==d||e[25]!==u?(b=t.jsxs("div",{className:h,children:[d,u]}),e[23]=h,e[24]=d,e[25]=u,e[26]=b):b=e[26],b}function Ks(s){return!!Ke(s._meta)}function Xs(s){return s.command==="npx"}function qs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Hs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Ws(s,e){const n={command:"npx",args:["-y",s]},o=lt(e);return Object.keys(o).length>0&&(n.envVars=o),n}function Qs(s,e,n,o){const i={command:s};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const a=lt(o);return Object.keys(a).length>0&&(i.envVars=a),i}function rt(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&kt(s.connection_headers)){const o=s.connection_headers,i=It(o.envVars);if(Xs(o)){const l=qs(o);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i}}const a=Hs(o);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:i}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function Gs(s){let e,n=null,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=Ws(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=Qs(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",o=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...o&&{connection_token:o},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function Js(s){const e=U.c(116),{connection:n,connectionId:o,org:i,requestedTabId:a,collections:l,onUpdate:j,isUpdating:f,prompts:m,resources:x,tools:c,isLoadingTools:r}=s;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={from:"/$org/$project/mcps/$connectionId"},e[0]=h):h=e[0];const d=Ne(h),u=St(),b=dt();let v;e[1]!==o?(v={connectionId:o},e[1]=o,e[2]=v):v=e[2];const _=Mt(v),p=n?.connection_type==="VIRTUAL"||_.isAuthenticated;let C;e[3]!==n?(C={connections:[n],binding:"MCP"},e[3]=n,e[4]=C):C=e[4];const g=Vt(C).length>0,k=n?.metadata?.repository,I=!!k?.url;let V;e[5]===Symbol.for("react.memo_cache_sentinel")?(V=wt(Fs),e[5]=V):V=e[5];let M;e[6]!==n?(M=rt(n),e[6]=n,e[7]=M):M=e[7];let L;e[8]!==M?(L={resolver:V,values:M},e[8]=M,e[9]=L):L=e[9];const y=Tt(L),R=y.formState.isDirty;let D;e[10]!==y||e[11]!==j?(D=async()=>{if(!await y.trigger())return;const E=y.getValues(),he=Gs(E);await j(he),y.reset(E)},e[10]=y,e[11]=j,e[12]=D):D=e[12];const N=D;let A;e[13]!==n||e[14]!==y?(A=()=>{y.reset(rt(n))},e[13]=n,e[14]=y,e[15]=A):A=e[15];const $=A;let T;e[16]!==n.id||e[17]!==b||e[18]!==u?(T=async()=>{const{token:P,tokenInfo:E,error:he}=await Ut({connectionId:n.id});if(he||!P){ve.error(`Authentication failed: ${he}`);return}if(E)try{const Me=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:E.accessToken,refreshToken:E.refreshToken,expiresIn:E.expiresIn,scope:E.scope,clientId:E.clientId,clientSecret:E.clientSecret,tokenEndpoint:E.tokenEndpoint})});if(!Me.ok)console.error("Failed to save OAuth token:",await Me.text()),await b.update.mutateAsync({id:n.id,data:{connection_token:P}});else try{await b.update.mutateAsync({id:n.id,data:{}})}catch(We){console.warn("Failed to refresh connection tools after OAuth:",We)}}catch(Me){console.error("Error saving OAuth token:",Me),await b.update.mutateAsync({id:n.id,data:{connection_token:P}})}else await b.update.mutateAsync({id:n.id,data:{connection_token:P}});const ht=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:Je.isMCPAuthenticated(ht.href,null)}),ve.success("Authentication successful")},e[16]=n.id,e[17]=b,e[18]=u,e[19]=T):T=e[19];const F=T;let B;e[20]!==n.id||e[21]!==u?(B=async()=>{try{const P=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!P.ok){const he=await P.text();ve.error(`Failed to remove OAuth: ${he}`);return}const E=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:Je.isMCPAuthenticated(E.href,null)}),ve.success("OAuth removed. You can now re-authenticate with a different account.")}catch(P){console.error("Error removing OAuth token:",P),ve.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=u,e[22]=B):B=e[22];const je=B,ee=c.length,J=m.length,ye=x.length;let _e;e[23]!==c?(_e=c.filter(en),e[23]=c,e[24]=_e):_e=e[24];const Ce=_e.length,Ee=ee>0||r;let Se;e[25]===Symbol.for("react.memo_cache_sentinel")?(Se={id:"settings",label:"Settings"},e[25]=Se):Se=e[25];let te;e[26]!==r||e[27]!==p||e[28]!==Ee||e[29]!==ee?(te=p&&Ee?[{id:"tools",label:"Tools",count:r?void 0:ee}]:[],e[26]=r,e[27]=p,e[28]=Ee,e[29]=ee,e[30]=te):te=e[30];let se;e[31]!==p||e[32]!==J?(se=p&&J>0?[{id:"prompts",label:"Prompts",count:J}]:[],e[31]=p,e[32]=J,e[33]=se):se=e[33];let ne;e[34]!==p||e[35]!==ye?(ne=p&&ye>0?[{id:"resources",label:"Resources",count:ye}]:[],e[34]=p,e[35]=ye,e[36]=ne):ne=e[36];let oe;e[37]!==p||e[38]!==Ce?(oe=p&&Ce>0?[{id:"ui",label:"UI",count:Ce}]:[],e[37]=p,e[38]=Ce,e[39]=oe):oe=e[39];let we;if(e[40]!==l||e[41]!==I||e[42]!==p||e[43]!==te||e[44]!==se||e[45]!==ne||e[46]!==oe){let P;e[48]!==I?(P=I?[{id:"readme",label:"README"}]:[],e[48]=I,e[49]=P):P=e[49],we=[Se,...te,...se,...ne,...oe,...p?(l||[]).map(Zs):[],...P],e[40]=l,e[41]=I,e[42]=p,e[43]=te,e[44]=se,e[45]=ne,e[46]=oe,e[47]=we}else we=e[47];const be=we,xt=p&&be.some(Ys)?"tools":"settings",O=be.some(P=>P.id===a)?a:xt;let Te;e[50]!==d?(Te=P=>{d({search:E=>({...E,tab:P}),replace:!0})},e[50]=d,e[51]=Te):Te=e[51];const re=Te;let ie;e[52]!==l?(ie=l||[],e[52]=l,e[53]=ie):ie=e[53];let ke;if(e[54]!==O||e[55]!==ie){let P;e[57]!==O?(P=E=>E.name===O,e[57]=O,e[58]=P):P=e[58],ke=ie.find(P),e[54]=O,e[55]=ie,e[56]=ke}else ke=e[56];const Pe=ke;let ae;e[59]!==i?(ae=t.jsx(Ye,{children:t.jsx(Bt,{asChild:!0,children:t.jsx(it,{to:"/$org/$project/mcps",params:{org:i,project:ge},children:"Connections"})})}),e[59]=i,e[60]=ae):ae=e[60];let Ie;e[61]===Symbol.for("react.memo_cache_sentinel")?(Ie=t.jsx(zt,{}),e[61]=Ie):Ie=e[61];let ce;e[62]!==n.title?(ce=t.jsx(Ye,{children:t.jsx(Ft,{children:n.title})}),e[62]=n.title,e[63]=ce):ce=e[63];let $e;e[64]!==ae||e[65]!==ce?($e=t.jsx(Kt,{children:t.jsxs(Xt,{children:[ae,Ie,ce]})}),e[64]=ae,e[65]=ce,e[66]=$e):$e=e[66];const Le=$e;let le;e[67]!==N||e[68]!==$||e[69]!==R||e[70]!==f?(le=t.jsx(Xe,{children:t.jsx($t,{onSave:N,onUndo:$,isDirty:R,isSaving:f})}),e[67]=N,e[68]=$,e[69]=R,e[70]=f,e[71]=le):le=e[71];let de;e[72]!==_.hasOAuthToken||e[73]!==n||e[74]!==y||e[75]!==F||e[76]!==je||e[77]!==p?(de=t.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:t.jsx(vs,{form:y,connection:n,isMCPAuthenticated:p,hasOAuthToken:_.hasOAuthToken,onReauthenticate:F,onRemoveOAuth:je})}),e[72]=_.hasOAuthToken,e[73]=n,e[74]=y,e[75]=F,e[76]=je,e[77]=p,e[78]=de):de=e[78];let me;e[79]!==O||e[80]!==re||e[81]!==be?(me=t.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:t.jsx(qt,{tabs:be,activeTab:O,onTabChange:re,className:"flex-1"})}),e[79]=O,e[80]=re,e[81]=be,e[82]=me):me=e[82];let Ae;e[83]===Symbol.for("react.memo_cache_sentinel")?(Ae=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),e[83]=Ae):Ae=e[83];let ue;e[84]!==Pe||e[85]!==O||e[86]!==_.isServerError||e[87]!==_.supportsOAuth||e[88]!==n||e[89]!==o||e[90]!==y||e[91]!==F||e[92]!==re||e[93]!==g||e[94]!==I||e[95]!==r||e[96]!==p||e[97]!==i||e[98]!==m||e[99]!==k||e[100]!==x||e[101]!==c?(ue=t.jsx(X.Suspense,{fallback:Ae,children:O==="tools"?t.jsx(Bs,{tools:c,connectionId:o,org:i,isLoading:r}):O==="ui"?t.jsx(zs,{tools:c,connectionId:o,org:i}):O==="prompts"?t.jsx(Ps,{prompts:m,connectionId:o,org:i}):O==="resources"?t.jsx(Ls,{resources:x,connectionId:o,org:i}):O==="settings"?t.jsx(Dt,{connection:n,form:y,hasMcpBinding:g,isMCPAuthenticated:p,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:F,onViewReadme:I?()=>re("readme"):void 0}):O==="readme"&&I?t.jsx(Is,{repository:k}):Pe&&p?t.jsx(Wt,{connectionId:o,org:i,activeCollection:Pe},O):t.jsx(Z,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[84]=Pe,e[85]=O,e[86]=_.isServerError,e[87]=_.supportsOAuth,e[88]=n,e[89]=o,e[90]=y,e[91]=F,e[92]=re,e[93]=g,e[94]=I,e[95]=r,e[96]=p,e[97]=i,e[98]=m,e[99]=k,e[100]=x,e[101]=c,e[102]=ue):ue=e[102];let pe;e[103]!==O||e[104]!==ue?(pe=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(ct,{children:ue},O)}),e[103]=O,e[104]=ue,e[105]=pe):pe=e[105];let fe;e[106]!==me||e[107]!==pe?(fe=t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[me,pe]}),e[106]=me,e[107]=pe,e[108]=fe):fe=e[108];let xe;e[109]!==de||e[110]!==fe?(xe=t.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[de,fe]}),e[109]=de,e[110]=fe,e[111]=xe):xe=e[111];let Ve;return e[112]!==Le||e[113]!==le||e[114]!==xe?(Ve=t.jsxs(Ht,{breadcrumb:Le,children:[le,xe]}),e[112]=Le,e[113]=le,e[114]=xe,e[115]=Ve):Ve=e[115],Ve}function Ys(s){return s.id==="tools"}function Zs(s){return{id:s.name,label:s.displayName}}function en(s){return!!Ke(s._meta)}function tn(){const s=U.c(43);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$connectionId"},s[0]=e):e=s[0];const n=Ne(e);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/$project/mcps/$connectionId"},s[1]=o):o=s[1];const{connectionId:i,org:a}=_t(o),{org:l}=Be();let j;s[2]===Symbol.for("react.memo_cache_sentinel")?(j={from:"/shell/$org/$project/mcps/$connectionId"},s[2]=j):j=s[2];const m=Ct(j).tab??"",x=Ot(i),c=dt(),r=At(x??void 0);let h;s[3]!==i||s[4]!==l.id?(h={connectionId:i,orgId:l.id},s[3]=i,s[4]=l.id,s[5]=h):h=s[5];const d=mt(h);let u;s[6]!==d?(u={client:d},s[6]=d,s[7]=u):u=s[7];const{data:b}=Lt(u);let v;s[8]!==d?(v={client:d},s[8]=d,s[9]=v):v=s[9];const{data:_}=Et(v),S=x?.connection_type==="VIRTUAL";let p;s[10]!==d||s[11]!==S?(p={client:d,enabled:S},s[10]=d,s[11]=S,s[12]=p):p=s[12];const{data:C,isLoading:w}=Rt(p);let g;s[13]!==b?.prompts?(g=b?.prompts??[],s[13]=b?.prompts,s[14]=g):g=s[14];let k;s[15]!==g?(k=g.map(on),s[15]=g,s[16]=k):k=s[16];const I=k;let V;s[17]!==_?.resources?(V=_?.resources??[],s[17]=_?.resources,s[18]=V):V=s[18];let M;s[19]!==V?(M=V.map(nn),s[19]=V,s[20]=M):M=s[20];const L=M;let y;s[21]!==x?.tools||s[22]!==S||s[23]!==C?.tools?(y=S?(C?.tools??[]).map(sn):x?.tools??[],s[21]=x?.tools,s[22]=S,s[23]=C?.tools,s[24]=y):y=s[24];const R=y;let D;s[25]!==c.update||s[26]!==i?(D=async $=>{await c.update.mutateAsync({id:i,data:$})},s[25]=c.update,s[26]=i,s[27]=D):D=s[27];const N=D;if(!x){let $;return s[28]!==n||s[29]!==a?($=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Z,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(Ue,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:a,project:ge}}),children:"Back to connections"})})}),s[28]=n,s[29]=a,s[30]=$):$=s[30],$}let A;return s[31]!==c.update.isPending||s[32]!==r||s[33]!==x||s[34]!==i||s[35]!==N||s[36]!==w||s[37]!==a||s[38]!==I||s[39]!==m||s[40]!==L||s[41]!==R?(A=t.jsx(Js,{org:a,connection:x,connectionId:i,requestedTabId:m,collections:r,onUpdate:N,isUpdating:c.update.isPending,prompts:I,resources:L,tools:R,isLoadingTools:w}),s[31]=c.update.isPending,s[32]=r,s[33]=x,s[34]=i,s[35]=N,s[36]=w,s[37]=a,s[38]=I,s[39]=m,s[40]=L,s[41]=R,s[42]=A):A=s[42],A}function sn(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations,_meta:s._meta}}function nn(s){return{uri:s.uri,name:s.name,description:s.description}}function on(s){return{name:s.name,description:s.description}}function rn(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ct,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(tn,{})})}),s[0]=e):e=s[0],e}function xr(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(rn,{}),s[0]=e):e=s[0],e}export{xr as default};
@@ -1 +0,0 @@
1
- import{r as U,c as fe,j as t,E as vt,u as bt,n as Ct,b as Nt,a as _t,d as kt,aB as wt,l as St,k as Tt,i as Dt,B as O,O as Q,v as oe,t as J,o as ct,bb as It,s as Y,bc as Pt}from"./index-xQ2t379n.js";import{g as At}from"./generate-id-Dyweu44Y.js";import{C as $t}from"./collection-display-button-DrtKZPsB.js";import{C as Et,E as Ee}from"./collection-search-Cq4rjP0Z.js";import{T as Ot,a as zt,b as Se,c as pe,d as Lt,e as Vt}from"./table-BCfVNRpI.js";import{C as lt}from"./connection-card-BEmi4FHw.js";import{B as je}from"./badge-D8RzvYJ4.js";import{i as Ft}from"./AlertCircle-BmterM6-.js";import{i as Bt}from"./CheckCircle-DCJamcsS.js";import{I as Ne}from"./integration-icon-CyNzGslP.js";import{P as be}from"./index-C79VipEf.js";import{U as _e}from"./user-CI081yAV.js";import{u as Mt}from"./use-binding-BSjPQ0Be.js";import{u as Ut}from"./use-list-state-DhRtf36X.js";import{f as Ht,e as Rt}from"./registry-utils-Cjdxmsng.js";import{f as ze,a as Le,b as Ve,c as Fe,d as Be,e as Me,A as Ue,h as He}from"./alert-dialog-D1XudKG9.js";import{B as Wt,a as Xt,b as Kt,c as Gt}from"./breadcrumb-N-YM-0qC.js";import{C as De}from"./checkbox-CUOTkCKW.js";import{D as qe,a as Qe,b as Je,c as Ye,d as Ze,e as at}from"./dialog-BEh9NHdw.js";import{D as Re,a as We,b as Xe,c as ge}from"./dropdown-menu-BBy53YtY.js";import{a as qt,F as Z,b as ee,c as te,d as ne,f as se}from"./form-DKOen-4i.js";import{I as xe}from"./input-CquIDQAg.js";import{S as Qt,a as Jt,b as Yt,c as Zt,d as Ce}from"./select-CDsJtNMV.js";import{T as en}from"./textarea-BvEkv28R.js";import{g as tn,h as nn}from"./use-connection-Dtj63U01.js";import{u as ot,a as sn}from"./constants-BLSLjUCX.js";import{b as on}from"./use-mcp-tools-DScmBuoc.js";import{b as rn}from"./use-virtual-mcp-COkdNvVv.js";import{n as cn}from"./ArrowDown-DhmtNBCn.js";import{i as ln}from"./ArrowUp-B2lliNjJ.js";import{t as an}from"./ChevronDown-B8UJn4iH.js";import{n as he}from"./Container-nefPC-Vi.js";import{i as Ke}from"./DotsVertical-N7qtMw5m.js";import{s as Ge}from"./Eye-DxLOh0i-.js";import{s as Oe}from"./Globe02-KBI1AO62.js";import{i as dn}from"./Loading01-BWjBCSBL.js";import{s as mn}from"./Plus-CK3qvOs-.js";import{i as un}from"./Terminal-EynP_hYL.js";import{s as Ie}from"./Trash01-p1zJKNMp.js";import{s as dt}from"./XClose-BoXt6_S8.js";import{f as ke}from"./format-time-CMKyl-GC.js";import{r as pn,E as xn,e as mt}from"./env-vars-editor-CFN3JqN6.js";import"./Check-Dy5Jwsdl.js";import"./Grid01-CqnSySeu.js";import"./List-C81A8jh_.js";import"./tooltip-B6yKYOIf.js";import"./index-CrfXnuko.js";import"./SearchMd-CpD1Xdqo.js";import"./card-DpIJfsV8.js";import"./localstorage-keys-BVjc41qz.js";import"./useQuery-BLe-0FCm.js";import"./useMutation-tQLZk7P3.js";import"./avatar-DNxsCl6r.js";import"./binder-Blih3Yob.js";import"./use-view-mode-5Lt8g0uo.js";import"./use-mobile-CZlm25dt.js";import"./ChevronRight-UHmTzu6U.js";import"./X-C0j62Xtl.js";import"./label-DgKgIZIr.js";import"./differenceInSeconds-NQ4PDo0z.js";const ut=({size:o=24,color:e="currentColor",...n})=>U.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},U.createElement("path",{d:"m7.5 12 3 3 6-6M7.8 21h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21Z"}));ut.displayName="CheckSquare";function Pe(o){const e=fe.c(3),{status:n}=o;if(n==="active"){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs(je,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[t.jsx(Bt,{size:12}),"Active"]}),e[0]=l):l=e[0],l}if(n==="error"){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs(je,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[t.jsx(Ft,{size:12}),"Error"]}),e[1]=l):l=e[1],l}let c;return e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(je,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),e[2]=c):c=e[2],c}function it(o){return o.title.trim().replace(/\s+\(\d+\)$/,"")}function hn(o){const e=new Map;for(const l of o){if(l.connection_type==="VIRTUAL")continue;const u=it(l),r=e.get(u);r?r.push(l):e.set(u,[l])}const n=[],c=new Set;for(const l of o){if(l.connection_type==="VIRTUAL")continue;const u=it(l);if(c.has(u))continue;c.add(u);const r=e.get(u),h=r[0];r.length===1?n.push({type:"single",connection:h}):n.push({type:"group",key:u,icon:h.icon,title:h.app_name?h.title.replace(/\s*\(\d+\)\s*$/,""):h.title,connections:r})}return n}function pt(o){const e=new Set,n=[];for(const c of o)c.created_by&&!e.has(c.created_by)&&(e.add(c.created_by),n.push(c.created_by));return n}function fn(o){let e=0,n=0,c=0;for(const l of o)l.connection_type!=="VIRTUAL"&&(l.status==="active"?e++:l.status==="error"?c++:n++);return{active:e,inactive:n,error:c,total:e+n+c}}const gn=ct({key:Y(),value:Y()}),jn=ct({title:Y().min(1,"Name is required"),description:Y().nullable().optional(),icon:Y().nullable().optional(),ui_type:Pt(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:Y().optional(),connection_token:Y().nullable().optional(),npx_package:Y().optional(),stdio_command:Y().optional(),stdio_args:Y().optional(),stdio_cwd:Y().optional(),env_vars:It(gn).optional()}).refine(o=>o.ui_type==="NPX"?!!o.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(o=>o.ui_type==="STDIO"?!!o.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(o=>o.ui_type==="HTTP"||o.ui_type==="SSE"||o.ui_type==="Websocket"?!!o.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Ae(o){const e=o.trim();if(!e)return"";try{const n=new URL(e),c=n.pathname.length>1?n.pathname.replace(/\/+$/,""):n.pathname;return`${n.origin}${c}`}catch{return e.replace(/\/+$/,"")}}function yn(o){const e=o.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const n=e[0]?.toLowerCase();if(n!=="npx"&&n!=="bunx")return null;const l=e.slice(1).find(u=>!u.startsWith("-"));return l?{packageName:l}:null}function Te(o){const{uiType:e}=o,n=Ae(o.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&n===Ae("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const c=(o.npxPackage??"").trim();return e==="NPX"&&c==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function rt(o){if(o.registryItems.length===0||o.uiType!=="HTTP"&&o.uiType!=="SSE"&&o.uiType!=="Websocket")return null;const e=Ae(o.connectionUrl??"");if(!e)return null;const n=o.registryItems.find(u=>(u.server?.remotes??[]).some(h=>Ae(h.url??"")===e));if(!n)return null;const c=n.title||n.name||n.server?.title||n.server?.name||"",l=n.server?.description||n.description||n.summary||null;return c?{id:"registry",title:c,description:l}:null}function vn(o,e){const n={command:"npx",args:["-y",o]},c=mt(e);return Object.keys(c).length>0&&(n.envVars=c),n}function bn(o,e,n,c){const l={command:o};e.trim()&&(l.args=e.trim().split(/\s+/)),n?.trim()&&(l.cwd=n.trim());const u=mt(c);return Object.keys(u).length>0&&(l.envVars=u),l}function Cn(o){return o.command==="npx"}function Nn(o){return o.args?.find(e=>!e.startsWith("-"))??""}function _n(o){return{command:o.command,args:o.args?.join(" ")??"",cwd:o.cwd??""}}function kn(o,e){switch(e.type){case"edit":return{mode:"editing",connection:e.connection};case"delete":return{mode:"deleting",connection:e.connection};case"force-delete":return{mode:"force-deleting",connection:e.connection,agentNames:e.agentNames};case"close":return{mode:"idle"}}}function wn(o){const e=fe.c(107),{group:n,onNavigate:c,onDelete:l,selectionMode:u,selectedIds:r,onToggleSelect:h}=o,[b,d]=U.useState(!1);let f;if(e[0]!==n.connections||e[1]!==r){let $;e[3]!==r?($=E=>r.has(E.id),e[3]=r,e[4]=$):$=e[4],f=n.connections.every($),e[0]=n.connections,e[1]=r,e[2]=f}else f=e[2];const p=f;let T;if(e[5]!==n.connections||e[6]!==r){let $;e[8]!==r?($=E=>r.has(E.id),e[8]=r,e[9]=$):$=e[9],T=n.connections.some($),e[5]=n.connections,e[6]=r,e[7]=T}else T=e[7];const x=T;let j,y,w,_,C,I,A,z,M,N,k;if(e[10]!==p||e[11]!==n.connections||e[12]!==n.icon||e[13]!==n.title||e[14]!==h||e[15]!==r||e[16]!==u||e[17]!==x){const $=pt(n.connections),E=n.connections.reduce(In,n.connections[0]),de=E.updated_at??E.created_at;j=lt;const D=`${n.connections.length} instances`;e[29]!==n.icon||e[30]!==n.title||e[31]!==D?(M={title:n.title,icon:n.icon,description:D},e[29]=n.icon,e[30]=n.title,e[31]=D,e[32]=M):M=e[32],e[33]!==p||e[34]!==n.connections||e[35]!==h||e[36]!==r||e[37]!==u?(N=()=>u?(()=>{for(const R of n.connections)p?r.has(R.id)&&h(R.id):r.has(R.id)||h(R.id)})():d(!0),e[33]=p,e[34]=n.connections,e[35]=h,e[36]=r,e[37]=u,e[38]=N):N=e[38];const le=u&&p&&"ring-2 ring-primary",me=u&&x&&!p&&"ring-1 ring-primary/50";e[39]!==le||e[40]!==me?(k=oe(le,me),e[39]=le,e[40]=me,e[41]=k):k=e[41],e[42]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(he,{}),e[42]=y):y=e[42],e[43]!==p||e[44]!==n.connections||e[45]!==h||e[46]!==r||e[47]!==u||e[48]!==x?(w=u?t.jsx(De,{checked:p?!0:x?"indeterminate":!1,onCheckedChange:()=>{for(const R of n.connections)p?r.has(R.id)&&h(R.id):r.has(R.id)||h(R.id)}}):t.jsxs(je,{variant:"secondary",className:"text-xs tabular-nums",children:["x",n.connections.length]}),e[43]=p,e[44]=n.connections,e[45]=h,e[46]=r,e[47]=u,e[48]=x,e[49]=w):w=e[49];let ue;e[50]!==n.connections?(ue=n.connections.slice(0,6).map(Dn),e[50]=n.connections,e[51]=ue):ue=e[51],e[52]!==ue?(_=t.jsx("div",{className:"flex items-center gap-1",children:ue}),e[52]=ue,e[53]=_):_=e[53],A="flex items-center justify-between text-xs text-muted-foreground w-full min-w-0";const ye=$.map(R=>t.jsx(_e,{id:R,size:"3xs",avatarOnly:$.length>1},R));e[54]!==ye?(z=t.jsx("div",{className:"flex items-center -space-x-1.5",children:ye}),e[54]=ye,e[55]=z):z=e[55],C="shrink-0 ml-2",I=de?ke(new Date(de)):"—",e[10]=p,e[11]=n.connections,e[12]=n.icon,e[13]=n.title,e[14]=h,e[15]=r,e[16]=u,e[17]=x,e[18]=j,e[19]=y,e[20]=w,e[21]=_,e[22]=C,e[23]=I,e[24]=A,e[25]=z,e[26]=M,e[27]=N,e[28]=k}else j=e[18],y=e[19],w=e[20],_=e[21],C=e[22],I=e[23],A=e[24],z=e[25],M=e[26],N=e[27],k=e[28];let v;e[56]!==C||e[57]!==I?(v=t.jsx("span",{className:C,children:I}),e[56]=C,e[57]=I,e[58]=v):v=e[58];let H;e[59]!==v||e[60]!==A||e[61]!==z?(H=t.jsxs("div",{className:A,children:[z,v]}),e[59]=v,e[60]=A,e[61]=z,e[62]=H):H=e[62];let V;e[63]!==j||e[64]!==y||e[65]!==w||e[66]!==_||e[67]!==H||e[68]!==M||e[69]!==N||e[70]!==k?(V=t.jsx(j,{connection:M,onClick:N,className:k,fallbackIcon:y,headerActions:w,body:_,footer:H}),e[63]=j,e[64]=y,e[65]=w,e[66]=_,e[67]=H,e[68]=M,e[69]=N,e[70]=k,e[71]=V):V=e[71];let W;e[72]===Symbol.for("react.memo_cache_sentinel")?(W=t.jsx(he,{}),e[72]=W):W=e[72];let X;e[73]!==n.icon||e[74]!==n.title?(X=t.jsx(Ne,{icon:n.icon,name:n.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:W}),e[73]=n.icon,e[74]=n.title,e[75]=X):X=e[75];let K;e[76]!==n.connections.length?(K=t.jsxs(je,{variant:"secondary",className:"ml-2 text-xs tabular-nums",children:["x",n.connections.length]}),e[76]=n.connections.length,e[77]=K):K=e[77];let g;e[78]!==n.title||e[79]!==K?(g=t.jsxs(Ye,{children:[n.title,K]}),e[78]=n.title,e[79]=K,e[80]=g):g=e[80];let S;e[81]!==n.connections.length?(S=t.jsxs(Ze,{children:[n.connections.length," installed instances"]}),e[81]=n.connections.length,e[82]=S):S=e[82];let L;e[83]!==g||e[84]!==S?(L=t.jsxs("div",{children:[g,S]}),e[83]=g,e[84]=S,e[85]=L):L=e[85];let ie;e[86]!==X||e[87]!==L?(ie=t.jsx(Je,{className:"px-6 pt-6 pb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[X,L]})}),e[86]=X,e[87]=L,e[88]=ie):ie=e[88];let re;if(e[89]!==n.connections||e[90]!==l||e[91]!==c){let $;e[93]!==l||e[94]!==c?($=E=>t.jsxs("div",{className:"flex items-center gap-3 px-6 py-3 hover:bg-muted/30 cursor-pointer transition-colors",onClick:()=>{d(!1),c(E.id)},children:[t.jsx(Ne,{icon:E.icon,name:E.title,size:"sm",className:"shrink-0",fallbackIcon:t.jsx(he,{})}),t.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:E.title}),t.jsx(Pe,{status:E.status})]}),t.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground shrink-0",children:[t.jsx(_e,{id:E.created_by,size:"3xs"}),t.jsx("span",{children:E.created_at?ke(new Date(E.created_at)):"—"})]}),t.jsxs(Re,{children:[t.jsx(We,{asChild:!0,children:t.jsx(O,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:Tn,children:t.jsx(Ke,{size:16})})}),t.jsxs(Xe,{align:"end",onClick:Sn,children:[t.jsxs(ge,{onClick:()=>{d(!1),c(E.id)},children:[t.jsx(Ge,{size:16}),"Open"]}),t.jsxs(ge,{variant:"destructive",onClick:()=>l(E),children:[t.jsx(Ie,{size:16}),"Delete"]})]})]})]},E.id),e[93]=l,e[94]=c,e[95]=$):$=e[95],re=n.connections.map($),e[89]=n.connections,e[90]=l,e[91]=c,e[92]=re}else re=e[92];let ae;e[96]!==re?(ae=t.jsx("div",{className:"divide-y max-h-80 overflow-auto",children:re}),e[96]=re,e[97]=ae):ae=e[97];let ce;e[98]!==ie||e[99]!==ae?(ce=t.jsxs(Qe,{className:"sm:max-w-lg p-0 gap-0",children:[ie,ae]}),e[98]=ie,e[99]=ae,e[100]=ce):ce=e[100];let m;e[101]!==b||e[102]!==ce?(m=t.jsx(qe,{open:b,onOpenChange:d,children:ce}),e[101]=b,e[102]=ce,e[103]=m):m=e[103];let F;return e[104]!==V||e[105]!==m?(F=t.jsxs(t.Fragment,{children:[V,m]}),e[104]=V,e[105]=m,e[106]=F):F=e[106],F}function Sn(o){return o.stopPropagation()}function Tn(o){return o.stopPropagation()}function Dn(o){return t.jsx(Pe,{status:o.status},o.id)}function In(o,e){const n=e.updated_at??e.created_at,c=o.updated_at??o.created_at;return n?c?new Date(n)>new Date(c)?e:o:e:o}function Pn(o){const e=fe.c(28),{count:n,total:c,onSelectAll:l,onDeselectAll:u,onDelete:r,onAddToAgent:h,onToggleStatus:b,onCancel:d}=o;if(n===0)return null;let f;e[0]!==n?(f=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=f):f=e[1];let p;e[2]!==n||e[3]!==u||e[4]!==l||e[5]!==c?(p=n<c?t.jsxs(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:["Select all (",c,")"]}):t.jsx(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:"Clear selection"}),e[2]=n,e[3]=u,e[4]=l,e[5]=c,e[6]=p):p=e[6];let T;e[7]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(mn,{size:13}),e[7]=T):T=e[7];let x;e[8]!==h?(x=t.jsxs(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:[T,"Add to Agent"]}),e[8]=h,e[9]=x):x=e[9];let j;e[10]!==b?(j=t.jsx(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>b("active"),children:"Enable"}),e[10]=b,e[11]=j):j=e[11];let y;e[12]!==b?(y=t.jsx(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>b("inactive"),children:"Disable"}),e[12]=b,e[13]=y):y=e[13];let w;e[14]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(Ie,{size:13}),e[14]=w):w=e[14];let _;e[15]!==r?(_=t.jsxs(O,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:[w,"Delete"]}),e[15]=r,e[16]=_):_=e[16];let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(dt,{size:13}),e[17]=C):C=e[17];let I;e[18]!==d?(I=t.jsx(O,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:C}),e[18]=d,e[19]=I):I=e[19];let A;return e[20]!==f||e[21]!==I||e[22]!==p||e[23]!==x||e[24]!==j||e[25]!==y||e[26]!==_?(A=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[f,p,x,j,y,_,I]})}),e[20]=f,e[21]=I,e[22]=p,e[23]=x,e[24]=j,e[25]=y,e[26]=_,e[27]=A):A=e[27],A}function An(o){const e=fe.c(25),{open:n,onOpenChange:c,agents:l,onConfirm:u}=o,[r,h]=U.useState(null);let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsxs(Je,{children:[t.jsx(Ye,{children:"Add to Agent"}),t.jsx(Ze,{children:"Select an agent to add the selected connections to."})]}),e[0]=b):b=e[0];let d;e[1]!==l||e[2]!==r?(d=l.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):l.map(C=>t.jsxs("button",{type:"button",onClick:()=>h(C.id),className:oe("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",r===C.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Ne,{icon:C.icon,name:C.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:C.title}),C.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:C.description})]})]},C.id)),e[1]=l,e[2]=r,e[3]=d):d=e[3];let f;e[4]!==d?(f=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:d}),e[4]=d,e[5]=f):f=e[5];let p;e[6]!==c?(p=t.jsx(O,{variant:"outline",onClick:()=>c(!1),children:"Cancel"}),e[6]=c,e[7]=p):p=e[7];const T=!r;let x;e[8]!==u||e[9]!==c||e[10]!==r?(x=()=>{r&&(u(r),c(!1),h(null))},e[8]=u,e[9]=c,e[10]=r,e[11]=x):x=e[11];let j;e[12]!==T||e[13]!==x?(j=t.jsx(O,{disabled:T,onClick:x,children:"Add"}),e[12]=T,e[13]=x,e[14]=j):j=e[14];let y;e[15]!==p||e[16]!==j?(y=t.jsxs(at,{children:[p,j]}),e[15]=p,e[16]=j,e[17]=y):y=e[17];let w;e[18]!==f||e[19]!==y?(w=t.jsxs(Qe,{className:"sm:max-w-[400px]",children:[b,f,y]}),e[18]=f,e[19]=y,e[20]=w):w=e[20];let _;return e[21]!==c||e[22]!==n||e[23]!==w?(_=t.jsx(qe,{open:n,onOpenChange:c,children:w}),e[21]=c,e[22]=n,e[23]=w,e[24]=_):_=e[24],_}function $n(o){const e=fe.c(20),{open:n,onOpenChange:c,count:l,onConfirm:u}=o,r=l!==1?"s":"";let h;e[0]!==l||e[1]!==r?(h=t.jsxs(Fe,{children:["Delete ",l," connection",r,"?"]}),e[0]=l,e[1]=r,e[2]=h):h=e[2];const b=l!==1?"s":"";let d;e[3]!==b?(d=t.jsxs(Be,{children:["This will permanently delete the selected connection",b,". This action cannot be undone."]}),e[3]=b,e[4]=d):d=e[4];let f;e[5]!==h||e[6]!==d?(f=t.jsxs(Ve,{children:[h,d]}),e[5]=h,e[6]=d,e[7]=f):f=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Ue,{children:"Cancel"}),e[8]=p):p=e[8];const T=l!==1?"s":"";let x;e[9]!==l||e[10]!==u||e[11]!==T?(x=t.jsxs(Me,{children:[p,t.jsxs(He,{onClick:u,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",l," connection",T]})]}),e[9]=l,e[10]=u,e[11]=T,e[12]=x):x=e[12];let j;e[13]!==f||e[14]!==x?(j=t.jsxs(Le,{children:[f,x]}),e[13]=f,e[14]=x,e[15]=j):j=e[15];let y;return e[16]!==c||e[17]!==n||e[18]!==j?(y=t.jsx(ze,{open:n,onOpenChange:c,children:j}),e[16]=c,e[17]=n,e[18]=j,e[19]=y):y=e[19],y}function En(o){const e=fe.c(37),{columns:n,grouped:c,sortKey:l,sortDirection:u,onSort:r,onRowClick:h,selectionMode:b,selectedIds:d,onToggleSelect:f,emptyState:p}=o;let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=new Set,e[0]=T):T=e[0];const[x,j]=U.useState(T);let y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y=N=>{j(k=>{const v=new Set(k);return v.has(N)?v.delete(N):v.add(N),v})},e[1]=y):y=e[1];const w=y;if(c.length===0&&p){let N;return e[2]!==p?(N=t.jsx("div",{className:"flex items-center justify-center h-full",children:p}),e[2]=p,e[3]=N):N=e[3],N}const _=n.length;let C;if(e[4]!==_||e[5]!==n||e[6]!==r||e[7]!==u||e[8]!==l){let N;e[10]!==_||e[11]!==r||e[12]!==u||e[13]!==l?(N=(k,v)=>{const H=l===k.id,V=v===_-1;return t.jsx(Ot,{className:oe("px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider",V&&"w-8","group transition-colors select-none",k.sortable&&"hover:bg-accent cursor-pointer",k.cellClassName),onClick:k.sortable&&r?()=>r(k.id):void 0,children:t.jsxs("span",{className:"flex items-center gap-1",children:[k.header,k.sortable&&t.jsx("span",{className:"w-4 flex items-center justify-center",children:H&&u&&(u==="asc"?t.jsx(ln,{size:16,className:"text-muted-foreground"}):t.jsx(cn,{size:16,className:"text-muted-foreground"}))})]})},k.id)},e[10]=_,e[11]=r,e[12]=u,e[13]=l,e[14]=N):N=e[14],C=n.map(N),e[4]=_,e[5]=n,e[6]=r,e[7]=u,e[8]=l,e[9]=C}else C=e[9];let I;e[15]!==C?(I=t.jsx(zt,{className:"border-b-0",children:t.jsx(Se,{className:"h-9 hover:bg-transparent border-b border-border",children:C})}),e[15]=C,e[16]=I):I=e[16];let A;if(e[17]!==n||e[18]!==x||e[19]!==c||e[20]!==h||e[21]!==f||e[22]!==d||e[23]!==b){let N;e[25]!==n||e[26]!==x||e[27]!==h||e[28]!==f||e[29]!==d||e[30]!==b?(N=k=>{if(k.type==="single"){const g=k.connection;return t.jsx(Se,{className:oe("group/data-row transition-colors border-b-0 hover:bg-accent/50 cursor-pointer",b&&d.has(g.id)&&"bg-primary/5"),onClick:()=>h(g),children:n.map(S=>t.jsx(pe,{className:oe("px-5 py-4 h-16 align-middle text-sm text-foreground",S.cellClassName),children:t.jsx("div",{className:"min-w-0 w-full truncate overflow-hidden whitespace-nowrap",children:S.render?S.render(g):null})},S.id))},g.id)}const v=k,H=x.has(v.key),V=v.connections.every(g=>d.has(g.id)),W=v.connections.some(g=>d.has(g.id)),X=pt(v.connections),K=v.connections.reduce(zn,v.connections[0]);return t.jsxs(U.Fragment,{children:[t.jsx(Se,{className:"border-b-0 hover:bg-accent/50 cursor-pointer transition-colors",onClick:()=>w(v.key),children:n.map(g=>{const S=oe("px-5 py-3 h-14 align-middle text-sm",g.cellClassName);if(g.id==="select")return t.jsx(pe,{className:S,children:t.jsx(De,{checked:V?!0:W?"indeterminate":!1,onCheckedChange:()=>{for(const L of v.connections)V?d.has(L.id)&&f(L.id):d.has(L.id)||f(L.id)},onClick:On})},g.id);if(g.id==="title")return t.jsx(pe,{className:S,children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(Ne,{icon:v.icon,name:v.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(he,{})}),t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:v.title}),t.jsxs(je,{variant:"secondary",className:"text-xs tabular-nums",children:["x",v.connections.length]})]})},g.id);if(g.id==="updated_by")return t.jsx(pe,{className:S,children:t.jsx("div",{className:"flex items-center -space-x-1.5",children:X.map(L=>t.jsx(_e,{id:L,size:"3xs",avatarOnly:X.length>1},L))})},g.id);if(g.id==="updated_at"){const L=K.updated_at??K.created_at;return t.jsx(pe,{className:S,children:t.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:L?ke(new Date(L)):"—"})},g.id)}return g.id==="actions"?t.jsx(pe,{className:S,children:t.jsx(an,{size:16,className:oe("text-muted-foreground transition-transform",H&&"rotate-180")})},g.id):t.jsx(pe,{className:S},g.id)})}),H&&v.connections.map(g=>t.jsx(Se,{className:oe("group/data-row transition-colors border-b-0 hover:bg-accent/50 cursor-pointer bg-muted/20",b&&d.has(g.id)&&"bg-primary/5"),onClick:()=>h(g),children:n.map(S=>t.jsx(pe,{className:oe("px-5 py-3 h-14 align-middle text-sm text-foreground",S.cellClassName,S.id==="title"&&"pl-12"),children:t.jsx("div",{className:"min-w-0 w-full truncate overflow-hidden whitespace-nowrap",children:S.render?S.render(g):null})},S.id))},g.id))]},v.key)},e[25]=n,e[26]=x,e[27]=h,e[28]=f,e[29]=d,e[30]=b,e[31]=N):N=e[31],A=c.map(N),e[17]=n,e[18]=x,e[19]=c,e[20]=h,e[21]=f,e[22]=d,e[23]=b,e[24]=A}else A=e[24];let z;e[32]!==A?(z=t.jsx(Lt,{children:A}),e[32]=A,e[33]=z):z=e[33];let M;return e[34]!==I||e[35]!==z?(M=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsxs(Vt,{className:"w-full border-collapse",children:[I,z]})}),e[34]=I,e[35]=z,e[36]=M):M=e[36],M}function On(o){return o.stopPropagation()}function zn(o,e){const n=e.updated_at??e.created_at,c=o.updated_at??o.created_at;return n?c?new Date(n)>new Date(c)?e:o:e:o}function Ln(){const{org:o}=bt(),e=Ct(),n=Nt(),c=_t({strict:!1}),{data:l}=kt.useSession(),{stdioEnabled:u}=wt(),r=Ut({namespace:o.slug,resource:"connections"}),h=tn(),b=nn(r),[d,f]=U.useReducer(kn,{mode:"idle"}),[p,T]=U.useState(!1),[x,j]=U.useState(new Set),[y,w]=U.useState(!1),[_,C]=U.useState(!1),[I,A]=U.useState("ALL"),[z,M]=U.useState("ALL"),N=rn(),k=b.filter(s=>!(s.connection_type==="VIRTUAL"||I!=="ALL"&&s.connection_type!==I||z!=="ALL"&&s.status!==z)),v=fn(b),H=hn(k),V=s=>{j(i=>{const a=new Set(i);return a.has(s)?a.delete(s):a.add(s),a})},W=()=>{T(!1),j(new Set)},X=Mt(b)[0],K=X?.id??"",g=Ht(X?.tools),S=ot({connectionId:K||null,orgId:o.id}),{data:L}=on({client:S,toolName:g,toolArguments:{limit:200},enabled:!!(K&&g),staleTime:3600*1e3,select:s=>s.structuredContent??s}),ie=Rt(L??[]),re=c.action==="create",ae=()=>{n({to:"/$org/$project/mcps",params:{org:o.slug,project:Q},search:{action:"create"}})},ce=()=>{n({to:"/$org/$project/mcps",params:{org:o.slug,project:Q},search:{}})},m=St({resolver:Tt(jn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),F=m.watch("ui_type"),$=m.watch("connection_url"),E=m.watch("npx_package"),de=Te({uiType:F,connectionUrl:$??"",npxPackage:E??""})??rt({uiType:F,connectionUrl:$??"",registryItems:ie}),D=d.mode==="editing"?d.connection:null;U.useEffect(()=>{if(D){const s=Dt(D.connection_headers)?D.connection_headers:null;if(s&&D.connection_type==="STDIO"){const i=pn(s.envVars);if(Cn(s)){const a=Nn(s);m.reset({title:D.title,description:D.description,icon:D.icon??null,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i})}else{const a=_n(s);m.reset({title:D.title,description:D.description,icon:D.icon??null,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:i})}}else m.reset({title:D.title,description:D.description,icon:D.icon??null,ui_type:D.connection_type,connection_url:D.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else m.reset({title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[D,m]);const le=ot({connectionId:sn,orgId:o.id}),me=()=>{e.invalidateQueries({predicate:s=>{const i=s.queryKey;return i[1]===o.id&&i[3]==="collection"&&i[4]==="CONNECTIONS"}})},ue=async()=>{w(!1);const s=[...x];let i=0;for(const a of s)try{(await le.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:a,force:!0}})).isError||i++}catch{}me(),J.success(`Deleted ${i} connection${i!==1?"s":""}`),W()},ye=async s=>{const i=[...x];let a=0;for(const B of i)try{await h.update.mutateAsync({id:B,data:{status:s}}),a++}catch{}me(),J.success(`${s==="active"?"Enabled":"Disabled"} ${a} connection${a!==1?"s":""}`),W()},R=async s=>{const i=N.find(P=>P.id===s);if(!i||!le)return;const a=new Set(i.connections.map(P=>P.connection_id)),B=[...x].filter(P=>!a.has(P)).map(P=>({connection_id:P,selected_tools:null,selected_resources:null,selected_prompts:null}));if(B.length===0){J.info("All selected connections are already in that agent");return}try{await le.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:s,data:{connections:[...i.connections,...B]}}}),e.invalidateQueries({predicate:P=>{const G=P.queryKey;return G[1]===o.id&&G[3]==="collection"&&G[4]==="VIRTUAL_MCP"}}),J.success(`Added ${B.length} connection${B.length!==1?"s":""} to "${i.title}"`),W()}catch{J.error("Failed to add connections to agent")}},et=s=>{const i=s.content;return Array.isArray(i)&&i[0]?.type==="text"&&typeof i[0].text=="string"?i[0].text:"Unknown error"},xt=async()=>{if(d.mode!=="deleting")return;const s=d.connection;f({type:"close"});try{const i=await le.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:s.id}});if(i.isError){const a=et(i),B=a.replace(/^Error:\s*/,"");try{const P=JSON.parse(B);if(P.code==="CONNECTION_IN_USE"&&P.agentNames){f({type:"force-delete",connection:s,agentNames:P.agentNames.map(G=>`"${G}"`).join(", ")});return}}catch{}J.error(`Failed to delete connection: ${a}`);return}me(),J.success("Connection deleted successfully")}catch(i){const a=i instanceof Error?i.message:String(i);J.error(`Failed to delete connection: ${a}`)}},ht=async()=>{if(d.mode!=="force-deleting")return;const s=d.connection.id;f({type:"close"});try{const i=await le.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:s,force:!0}});if(i.isError){J.error(`Failed to delete connection: ${et(i)}`);return}me(),J.success("Connection deleted successfully")}catch(i){const a=i instanceof Error?i.message:String(i);J.error(`Failed to delete connection: ${a}`)}},ft=async s=>{let i,a=null,B=null,P=null;if(s.ui_type==="NPX"?(i="STDIO",a="",P=vn(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(i="STDIO",a="",P=bn(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(i=s.ui_type,a=s.connection_url||"",B=s.connection_token||null),D){await h.update.mutateAsync({id:D.id,data:{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:i,connection_url:a,...B&&{connection_token:B},...P&&{connection_headers:P}}}),f({type:"close"}),m.reset();return}const G=At("conn");await h.create.mutateAsync({id:G,title:s.title,description:s.description||null,connection_type:i,connection_url:a,connection_token:B,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:l?.user?.id||"system",organization_id:o.id,icon:s.icon??null,app_name:null,app_id:null,connection_headers:P,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),ce(),m.reset(),n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:G}})},tt=s=>{s||(re?ce():f({type:"close"}),m.reset())},we=s=>{const i=s.trim();if(!i)return;const a=!!m.formState.dirtyFields.title,B=!!m.formState.dirtyFields.description,P=!!m.formState.dirtyFields.env_vars,G=q=>{if(q&&(!a&&!m.getValues("title").trim()&&q.title&&m.setValue("title",q.title,{shouldDirty:!1}),!B&&!(m.getValues("description")??"").trim()&&q.description&&m.setValue("description",q.description,{shouldDirty:!1}),!P&&q.envVarKeys?.length)){const nt=m.getValues("env_vars")??[],yt=new Set(nt.map(ve=>ve.key)),st=q.envVarKeys.filter(ve=>!yt.has(ve));st.length>0&&m.setValue("env_vars",[...nt,...st.map(ve=>({key:ve,value:""}))],{shouldDirty:!0})}},$e=yn(i);if($e&&u){m.setValue("ui_type","NPX",{shouldDirty:!0}),m.setValue("npx_package",$e.packageName,{shouldDirty:!0}),m.setValue("connection_url","",{shouldDirty:!0}),m.setValue("connection_token",null,{shouldDirty:!0}),G(Te({uiType:"NPX",npxPackage:$e.packageName}));return}if(i.startsWith("http://")||i.startsWith("https://")){const q=F==="HTTP"||F==="SSE"||F==="Websocket"?F:"HTTP";m.setValue("ui_type",q,{shouldDirty:!0}),m.setValue("connection_url",i,{shouldDirty:!0}),G(Te({uiType:q,connectionUrl:i})??rt({uiType:q,connectionUrl:i,registryItems:ie}));return}F==="NPX"&&G(Te({uiType:"NPX",npxPackage:i}))},gt=[...p?[{id:"select",header:"",render:s=>t.jsx(De,{checked:x.has(s.id),onCheckedChange:()=>V(s.id),onClick:i=>i.stopPropagation()}),cellClassName:"w-10 shrink-0"}]:[],{id:"title",header:"Name",render:s=>t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(Ne,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(he,{})}),t.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:s.title,children:s.title})]}),cellClassName:"w-32 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:s=>t.jsx("span",{className:"text-sm text-muted-foreground truncate block",title:s.description||"",children:s.description||"—"}),cellClassName:"flex-1 min-w-0 max-w-0",wrap:!1,sortable:!0},{id:"connection_type",header:"Type",accessor:s=>t.jsx("span",{className:"text-xs font-medium",children:s.connection_type}),cellClassName:"w-16 shrink-0",sortable:!0},{id:"status",header:"Status",render:s=>t.jsx(Pe,{status:s.status}),cellClassName:"w-28 shrink-0",sortable:!1},{id:"updated_by",header:"Updated by",render:s=>t.jsx(_e,{id:s.updated_by??s.created_by,size:"3xs"}),cellClassName:"w-32 shrink-0",sortable:!0},{id:"updated_at",header:"Updated",render:s=>t.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:s.updated_at?ke(new Date(s.updated_at)):"—"}),cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:s=>t.jsxs(Re,{children:[t.jsx(We,{asChild:!0,children:t.jsx(O,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:i=>i.stopPropagation(),children:t.jsx(Ke,{size:20})})}),t.jsxs(Xe,{align:"end",onClick:i=>i.stopPropagation(),children:[t.jsxs(ge,{onClick:i=>{i.stopPropagation(),n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:s.id}})},children:[t.jsx(Ge,{size:16}),"Open"]}),t.jsxs(ge,{variant:"destructive",onClick:i=>{i.stopPropagation(),f({type:"delete",connection:s})},children:[t.jsx(Ie,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],jt=t.jsx("div",{className:"flex items-center gap-2",children:p?t.jsxs(O,{variant:"ghost",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:W,children:[t.jsx(dt,{size:14}),"Cancel"]}):t.jsxs(t.Fragment,{children:[t.jsxs(O,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:()=>T(!0),children:[t.jsx(ut,{size:14}),"Select"]}),t.jsx(O,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:o.slug,project:Q}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),t.jsx(O,{onClick:ae,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]})});return t.jsxs(be,{children:[t.jsx(qe,{open:re||d.mode==="editing",onOpenChange:tt,children:t.jsxs(Qe,{className:"sm:max-w-[525px]",children:[t.jsxs(Je,{children:[t.jsx(Ye,{children:D?"Edit Connection":"Create Connection"}),t.jsx(Ze,{children:D?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),t.jsx(qt,{...m,children:t.jsxs("form",{onSubmit:m.handleSubmit(ft),children:[t.jsxs("div",{className:"grid gap-4 py-4",children:[t.jsx(Z,{control:m.control,name:"ui_type",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Type *"}),t.jsxs(Qt,{value:s.value,onValueChange:s.onChange,children:[t.jsx(ne,{children:t.jsx(Jt,{children:t.jsx(Yt,{})})}),t.jsxs(Zt,{children:[t.jsx(Ce,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(Ce,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(Ce,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(Ce,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(he,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(Ce,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(un,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(se,{})]})}),F==="NPX"&&t.jsx(t.Fragment,{children:t.jsx(Z,{control:m.control,name:"npx_package",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"NPM Package *"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"@perplexity-ai/mcp-server",...s,value:s.value??"",onPaste:i=>{const a=i.clipboardData.getData("text");a&&(i.preventDefault(),m.setValue("npx_package",a.trim(),{shouldDirty:!0}),we(a))},onBlur:i=>{we(i.target.value),s.onBlur()}})}),t.jsx(se,{})]})})}),F==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Z,{control:m.control,name:"stdio_command",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Command *"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"node, bun, python...",...s,value:s.value??""})}),t.jsx(se,{})]})}),t.jsx(Z,{control:m.control,name:"stdio_args",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Arguments"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"arg1 arg2 --flag value",...s,value:s.value??""})}),t.jsx(se,{})]})})]}),t.jsx(Z,{control:m.control,name:"stdio_cwd",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Working Directory"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"/path/to/project (optional)",...s,value:s.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(se,{})]})})]}),(F==="NPX"||F==="STDIO")&&t.jsx(Z,{control:m.control,name:"env_vars",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Environment Variables"}),t.jsx(ne,{children:t.jsx(xn,{value:s.value??[],onChange:s.onChange})}),t.jsx(se,{})]})}),F!=="NPX"&&F!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Z,{control:m.control,name:"connection_url",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"URL *"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"https://example.com/mcp",...s,value:s.value??"",onPaste:i=>{const a=i.clipboardData.getData("text");a&&(i.preventDefault(),m.setValue("connection_url",a.trim(),{shouldDirty:!0}),we(a))},onBlur:i=>{we(i.target.value),s.onBlur()}})}),t.jsx(se,{})]})}),t.jsx(Z,{control:m.control,name:"connection_token",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:de?.token?.label??"Token (optional)"}),t.jsx(ne,{children:t.jsx(xe,{type:"password",placeholder:de?.token?.placeholder??"Bearer token or API key",...s,value:s.value??""})}),de?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[de.token.helperText,de.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(se,{})]})})]}),t.jsx(Z,{control:m.control,name:"title",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Name *"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"My Connection",...s})}),t.jsx(se,{})]})}),t.jsx(Z,{control:m.control,name:"description",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Description"}),t.jsx(ne,{children:t.jsx(en,{placeholder:"A brief description of this connection",rows:3,...s,value:s.value??""})}),t.jsx(se,{})]})})]}),t.jsxs(at,{children:[t.jsx(O,{type:"button",variant:"outline",onClick:()=>tt(!1),children:"Cancel"}),t.jsx(O,{type:"submit",disabled:m.formState.isSubmitting,className:"min-w-40",children:m.formState.isSubmitting?"Saving...":D?"Update Connection":"Create Connection"})]})]})})]})}),t.jsx(ze,{open:d.mode==="deleting",onOpenChange:s=>!s&&f({type:"close"}),children:t.jsxs(Le,{children:[t.jsxs(Ve,{children:[t.jsx(Fe,{children:"Delete Connection?"}),t.jsxs(Be,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:d.mode==="deleting"&&d.connection.title}),"."]})]}),t.jsxs(Me,{children:[t.jsx(Ue,{children:"Cancel"}),t.jsx(He,{onClick:xt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),t.jsx(ze,{open:d.mode==="force-deleting",onOpenChange:s=>!s&&f({type:"close"}),children:t.jsxs(Le,{children:[t.jsxs(Ve,{children:[t.jsx(Fe,{children:"Connection Used by Agents"}),t.jsx(Be,{asChild:!0,children:t.jsxs("div",{children:[t.jsxs("p",{children:["The connection"," ",t.jsx("span",{className:"font-medium text-foreground",children:d.mode==="force-deleting"&&d.connection.title})," ","is currently used by the following agent(s):"," ",t.jsx("span",{className:"font-medium text-foreground",children:d.mode==="force-deleting"&&d.agentNames}),"."]}),t.jsx("p",{className:"mt-2",children:"Deleting this connection will remove it from those agents, which may impact existing workflows that depend on them."})]})})]}),t.jsxs(Me,{children:[t.jsx(Ue,{children:"Cancel"}),t.jsx(He,{onClick:ht,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]})]})}),t.jsx($n,{open:y,onOpenChange:w,count:x.size,onConfirm:ue}),t.jsx(An,{open:_,onOpenChange:C,agents:N,onConfirm:R}),t.jsxs(be.Header,{children:[t.jsx(be.Header.Left,{children:t.jsx(Wt,{children:t.jsx(Xt,{children:t.jsx(Kt,{children:t.jsxs(Gt,{className:"flex items-center gap-2",children:["Connections",t.jsxs("span",{className:"text-xs font-normal text-muted-foreground tabular-nums",children:[v.total," total",v.active>0&&` · ${v.active} active`,v.error>0&&` · ${v.error} errors`]})]})})})})}),t.jsxs(be.Header.Right,{children:[t.jsx($t,{viewMode:r.viewMode,onViewModeChange:r.setViewMode,sortKey:r.sortKey,sortDirection:r.sortDirection,onSort:r.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:I,onChange:s=>A(s||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:z,onChange:s=>M(s||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]}]}),jt]})]}),t.jsx("div",{className:"flex items-center gap-3 px-5 pb-0",children:t.jsx("div",{className:"flex-1",children:t.jsx(Et,{value:r.search,onChange:r.setSearch,placeholder:"Search for a Connection...",onKeyDown:s=>{s.key==="Escape"&&(r.setSearch(""),s.target.blur())}})})}),t.jsx(be.Content,{children:r.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:k.length===0?t.jsx(Ee,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:r.search?`No Connections match "${r.search}"`:"Create a connection to get started.",actions:!r.search&&t.jsx(O,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:o.slug,project:Q}}),children:"Browse Store"})}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:H.map(s=>{if(s.type==="group")return t.jsx(wn,{group:s,onNavigate:a=>n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:a}}),onDelete:a=>f({type:"delete",connection:a}),selectionMode:p,selectedIds:x,onToggleSelect:V},s.key);const i=s.connection;return t.jsxs("div",{className:"relative",children:[p&&t.jsx("div",{className:"absolute top-3 left-3 z-10",children:t.jsx(De,{checked:x.has(i.id),onCheckedChange:()=>V(i.id)})}),t.jsx(lt,{connection:i,fallbackIcon:t.jsx(he,{}),onClick:()=>p?V(i.id):n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:i.id}}),className:oe(p&&x.has(i.id)&&"ring-2 ring-primary"),headerActions:p?void 0:t.jsxs(Re,{children:[t.jsx(We,{asChild:!0,children:t.jsx(O,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:a=>a.stopPropagation(),children:t.jsx(Ke,{size:20})})}),t.jsxs(Xe,{align:"end",onClick:a=>a.stopPropagation(),children:[t.jsxs(ge,{onClick:a=>{a.stopPropagation(),n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:i.id}})},children:[t.jsx(Ge,{size:16}),"Open"]}),t.jsxs(ge,{variant:"destructive",onClick:a=>{a.stopPropagation(),f({type:"delete",connection:i})},children:[t.jsx(Ie,{size:16}),"Delete"]})]})]}),body:t.jsx(Pe,{status:i.status}),footer:t.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(_e,{id:i.updated_by??i.created_by,size:"3xs"})}),t.jsx("span",{className:"shrink-0 ml-2",children:i.updated_at?ke(new Date(i.updated_at)):"—"})]})})]},i.id)})})}):t.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:t.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:t.jsx("div",{className:"min-w-[1000px]",children:t.jsx(En,{columns:gt,grouped:H,sortKey:r.sortKey,sortDirection:r.sortDirection,onSort:r.handleSort,onRowClick:s=>p?V(s.id):n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:s.id}}),selectionMode:p,selectedIds:x,onToggleSelect:V,emptyState:r.search?t.jsx(Ee,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${r.search}"`}):t.jsx(Ee,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:t.jsx(O,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:o.slug,project:Q}}),children:"Browse Store"})})})})})})}),p&&t.jsx(Pn,{count:x.size,total:k.length,onSelectAll:()=>{j(new Set(k.map(s=>s.id)))},onDeselectAll:()=>j(new Set),onDelete:()=>w(!0),onAddToAgent:()=>C(!0),onToggleStatus:ye,onCancel:W})]})}function Rs(){const o=fe.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(vt,{children:t.jsx(U.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(dn,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ln,{})})}),o[0]=e):e=o[0],e}export{Rs as default};
@@ -1 +0,0 @@
1
- import{a0 as a,a1 as t}from"./index-xQ2t379n.js";const e=a(t,{target:"draft-7"});export{e as B};
@@ -1 +0,0 @@
1
- import{c as K,j as t,u as ue,n as fe,r as pe,v as ne,K as ee,B as xe,t as re}from"./index-xQ2t379n.js";import{u as he}from"./useQuery-BLe-0FCm.js";import{u as oe}from"./useMutation-tQLZk7P3.js";import{P as je,a as ge,b as Ce}from"./popover-BGz1EQnh.js";import{C as be,a as ve,b as Ne,c as ye,d as Ee,e as Te}from"./command-DazlgUs5.js";import{s as _e}from"./Plus-CK3qvOs-.js";import{i as Ie}from"./X-C0j62Xtl.js";import{h as Pe}from"./use-connection-Dtj63U01.js";import{a as Se,u as Oe}from"./constants-BLSLjUCX.js";import{u as te}from"./unwrap-tool-result-BYXdCQMg.js";import"./index-Bxe5mObN.js";import"./SearchMd-CpD1Xdqo.js";function ie(e){const n=K.c(6),{icon:o,title:c}=e;if(o){let a;return n[0]!==o?(a=t.jsx("img",{src:o,alt:"",className:"size-5 shrink-0 rounded"}),n[0]=o,n[1]=a):a=n[1],a}let i;n[2]!==c?(i=c.charAt(0).toUpperCase(),n[2]=c,n[3]=i):i=n[3];let r;return n[4]!==i?(r=t.jsx("div",{className:"size-5 shrink-0 rounded bg-muted flex items-center justify-center",children:t.jsx("span",{className:"text-[10px] font-medium text-muted-foreground",children:i})}),n[4]=i,n[5]=r):r=n[5],r}function we(){const e=K.c(72),{org:n,project:o}=ue();let c;e[0]!==n.id?(c={connectionId:Se,orgId:n.id},e[0]=n.id,e[1]=c):c=e[1];const i=Oe(c),r=fe(),a=Pe(),l=o.id??"",[Q,se]=pe.useState(!1);let d;e[2]!==l?(d=ee.projectConnections(l),e[2]=l,e[3]=d):d=e[3];const L=!!o.id;let m;e[4]!==i||e[5]!==l?(m=async()=>{const s=await i.callTool({name:"PROJECT_CONNECTION_LIST",arguments:{projectId:l}});return te(s)},e[4]=i,e[5]=l,e[6]=m):m=e[6];let P;e[7]!==d||e[8]!==L||e[9]!==m?(P={queryKey:d,enabled:L,queryFn:m},e[7]=d,e[8]=L,e[9]=m,e[10]=P):P=e[10];const{data:$}=he(P);let S;e[11]!==$?.connections?(S=new Set(($?.connections??[]).map(Re)),e[11]=$?.connections,e[12]=S):S=e[12];const u=S;let O;e[13]!==u?(O=s=>u.has(s.id),e[13]=u,e[14]=O):O=e[14];const I=(a??[]).filter(O);let w;e[15]!==u?(w=s=>!u.has(s.id),e[15]=u,e[16]=w):w=e[16];const le=(a??[]).filter(w);let k;e[17]!==n.id||e[18]!==o.slug||e[19]!==l||e[20]!==r?(k=()=>{r.invalidateQueries({queryKey:ee.projectConnections(l)}),r.invalidateQueries({queryKey:ee.project(n.id,o.slug)})},e[17]=n.id,e[18]=o.slug,e[19]=l,e[20]=r,e[21]=k):k=e[21];const f=k;let p;e[22]!==i||e[23]!==o.id?(p=async s=>{const Z=await i.callTool({name:"PROJECT_CONNECTION_ADD",arguments:{projectId:o.id,connectionId:s}});te(Z)},e[22]=i,e[23]=o.id,e[24]=p):p=e[24];let x;e[25]!==f?(x=()=>f(),e[25]=f,e[26]=x):x=e[26];let z;e[27]!==x||e[28]!==p?(z={mutationFn:p,onSuccess:x,onError:ze},e[27]=x,e[28]=p,e[29]=z):z=e[29];const J=oe(z);let h;e[30]!==i||e[31]!==o.id?(h=async s=>{const Z=await i.callTool({name:"PROJECT_CONNECTION_REMOVE",arguments:{projectId:o.id,connectionId:s}});te(Z)},e[30]=i,e[31]=o.id,e[32]=h):h=e[32];let j;e[33]!==f?(j=()=>f(),e[33]=f,e[34]=j):j=e[34];let R;e[35]!==h||e[36]!==j?(R={mutationFn:h,onSuccess:j,onError:ke},e[35]=h,e[36]=j,e[37]=R):R=e[37];const A=oe(R);let F;e[38]!==J?(F=s=>{se(!1),J.mutate(s)},e[38]=J,e[39]=F):F=e[39];const U=F;let D;e[40]!==A?(D=s=>{A.mutate(s)},e[40]=A,e[41]=D):D=e[41];const ce=D,ae="space-y-4",B=ge;let g;e[42]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ce,{asChild:!0,children:t.jsxs(xe,{variant:"outline",size:"sm",className:"gap-1.5",children:[t.jsx(_e,{size:14}),"Add connection"]})}),e[42]=g):g=e[42];const G=je,de="w-72 p-0",me="start",V=Ne;let C;e[43]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(ye,{placeholder:"Search connections..."}),e[43]=C):C=e[43];const Y=ve;let b;e[44]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Ee,{children:"No connections found."}),e[44]=b):b=e[44];const H=be;let M;e[45]!==U?(M=s=>t.jsxs(Te,{value:s.title,onSelect:()=>U(s.id),children:[t.jsx(ie,{icon:s.icon,title:s.title}),t.jsx("span",{className:"truncate",children:s.title}),t.jsx("span",{className:ne("ml-auto inline-block size-1.5 shrink-0 rounded-full",s.status==="active"?"bg-success":s.status==="error"?"bg-destructive":"bg-muted-foreground")})]},s.id),e[45]=U,e[46]=M):M=e[46];const W=le.map(M);let v;e[47]!==H||e[48]!==W?(v=t.jsx(H,{children:W}),e[47]=H,e[48]=W,e[49]=v):v=e[49];let N;e[50]!==Y||e[51]!==b||e[52]!==v?(N=t.jsxs(Y,{children:[b,v]}),e[50]=Y,e[51]=b,e[52]=v,e[53]=N):N=e[53];let y;e[54]!==V||e[55]!==C||e[56]!==N?(y=t.jsxs(V,{children:[C,N]}),e[54]=V,e[55]=C,e[56]=N,e[57]=y):y=e[57];let E;e[58]!==G||e[59]!==y?(E=t.jsx(G,{className:de,align:me,children:y}),e[58]=G,e[59]=y,e[60]=E):E=e[60];let T;e[61]!==B||e[62]!==Q||e[63]!==g||e[64]!==E?(T=t.jsxs(B,{open:Q,onOpenChange:se,children:[g,E]}),e[61]=B,e[62]=Q,e[63]=g,e[64]=E,e[65]=T):T=e[65];const X=I.length>0&&t.jsx("div",{className:"flex flex-col",children:I.map(s=>t.jsxs("div",{className:"flex items-center justify-between gap-4 py-3 border-b border-border last:border-0",children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[t.jsx(ie,{icon:s.icon,title:s.title}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.title}),t.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:s.connection_type}),t.jsx("span",{className:ne("inline-block size-1.5 rounded-full",s.status==="active"?"bg-success":s.status==="error"?"bg-destructive":"bg-muted-foreground")})]})]})]}),t.jsx("button",{type:"button",onClick:()=>ce(s.id),disabled:A.isPending,className:"shrink-0 rounded-md p-1 text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors",children:t.jsx(Ie,{size:14})})]},s.id))});let _;e[66]!==I.length?(_=I.length===0&&t.jsx("p",{className:"text-sm text-muted-foreground py-4",children:"No connections added yet. Add connections from the organization to make them available in this project."}),e[66]=I.length,e[67]=_):_=e[67];let q;return e[68]!==T||e[69]!==X||e[70]!==_?(q=t.jsxs("div",{className:ae,children:[T,X,_]}),e[68]=T,e[69]=X,e[70]=_,e[71]=q):q=e[71],q}function ke(e){re.error("Failed to remove connection: "+(e instanceof Error?e.message:"Unknown error"))}function ze(e){re.error("Failed to add connection: "+(e instanceof Error?e.message:"Unknown error"))}function Re(e){return e.id}function Ae(){const e=K.c(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Connections"}),t.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose which organization connections are available to this project."})]}),t.jsx(we,{})]}),e[0]=n):n=e[0],n}function Ve(){const e=K.c(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Ae,{}),e[0]=n):n=e[0],n}export{Ve as default};
@@ -1 +0,0 @@
1
- import{c as R,u as W,e as A,d as X,K as Z,j as n,r as q,aE as J,B as ee,aD as te,b8 as ne}from"./index-xQ2t379n.js";import{i as v}from"./Loading01-BWjBCSBL.js";import{c as ie}from"./binder-Blih3Yob.js";import{P as $}from"./topbar-portal-CUBonFlI.js";import{u as se}from"./useQuery-BLe-0FCm.js";import{h as oe}from"./use-connection-Dtj63U01.js";import{a as le,u as re,j as ce}from"./constants-BLSLjUCX.js";import{t as ae}from"./Settings01-Bhz_Vu7B.js";import{P as E}from"./index-C79VipEf.js";import"./useMutation-tQLZk7P3.js";import"./localstorage-keys-BVjc41qz.js";import"./tooltip-B6yKYOIf.js";import"./index-CrfXnuko.js";function de(t,e){return t?t.filter(m=>ie(m,e)):[]}function K(t){return{id:t.id,title:t.title,icon:t.icon,description:t.description,app_name:t.app_name,app_id:t.app_id,tools:t.tools,metadata:t.metadata}}function me(t){const e=R.c(35),{binding:m,renderHeader:f,renderEmptyState:i}=t,{org:o,project:l}=W();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const{org:r,project:g,pluginId:u}=A(a),Q=oe(),{data:y}=X.useSession();let _;e[1]!==o.id?(_={connectionId:le,orgId:o.id},e[1]=o.id,e[2]=_):_=e[2];const H=re(_);let x;e[3]!==u||e[4]!==l.id?(x=Z.projectPluginConfig(l.id??"",u),e[3]=u,e[4]=l.id,e[5]=x):x=e[5];let p;e[6]!==u||e[7]!==l.id||e[8]!==H?(p=async()=>{const s=await H.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:l.id,pluginId:u}});return s.structuredContent??s},e[6]=u,e[7]=l.id,e[8]=H,e[9]=p):p=e[9];const T=!!l.id&&!!u;let b;e[10]!==x||e[11]!==p||e[12]!==T?(b={queryKey:x,queryFn:p,enabled:T},e[10]=x,e[11]=p,e[12]=T,e[13]=b):b=e[13];const{data:U,isLoading:Y}=se(b),D=de(Q,m),F=U?.config?.connectionId,j=F?D.find(s=>s.id===F):null,P=ce({connectionId:j?.id,orgId:o.id}),w=y?.user?{user:{id:y.user.id,name:y.user.name,email:y.user.email,image:y.user.image}}:null,z={id:o.id,slug:o.slug,name:o.name};if(Y){let s;return e[14]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),e[14]=s):s=e[14],s}if(D.length===0){const s={connectionId:null,connection:null,toolCaller:null,org:z,session:w};let c;e[15]!==i?(c=i(),e[15]=i,e[16]=c):c=e[16];let d;return e[17]!==c?(d=n.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:c}),e[17]=c,e[18]=d):d=e[18],n.jsx($,{value:s,children:d})}if(!j){const s={connectionId:null,connection:null,toolCaller:null,org:z,session:w};let c;e[19]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[n.jsx(ae,{size:48,className:"text-muted-foreground mb-2"}),n.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a connection to be configured. Go to project settings to select which integration to use."})]}),e[19]=c):c=e[19];const d=r??o.slug,O=g??l.slug??"";let L;return e[20]!==d||e[21]!==O?(L=n.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:[c,n.jsx(ee,{asChild:!0,children:n.jsx(te,{to:"/$org/$project/settings",params:{org:d,project:O},children:"Go to Project Settings"})})]}),e[20]=d,e[21]=O,e[22]=L):L=e[22],n.jsx($,{value:s,children:L})}let S;e[23]!==P?(S=(s,c)=>P?P.callTool({name:s,arguments:c}).then(fe):Promise.reject(new Error("MCP client is not available")),e[23]=P,e[24]=S):S=e[24];const V={connectionId:j.id,connection:K(j),toolCaller:S,org:z,session:w},B=E,G=E,k=E,M=f({connections:[K(j)],selectedConnectionId:j.id,onConnectionChange:ue});let h;e[25]!==M||e[26]!==k.Header.Left?(h=n.jsx(k.Header.Left,{children:M}),e[25]=M,e[26]=k.Header.Left,e[27]=h):h=e[27];let C;e[28]!==h||e[29]!==G.Header?(C=n.jsx(G.Header,{children:h}),e[28]=h,e[29]=G.Header,e[30]=C):C=e[30];let N;e[31]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(E.Content,{children:n.jsx(q.Suspense,{fallback:n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),children:n.jsx(J,{})})}),e[31]=N):N=e[31];let I;return e[32]!==B||e[33]!==C?(I=n.jsxs(B,{children:[C,N]}),e[32]=B,e[33]=C,e[34]=I):I=e[34],n.jsx($,{value:V,children:I})}function ue(){}function fe(t){return t.structuredContent??t}function Le(){const t=R.c(12);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{pluginId:m}=A(e);let f;t[1]!==m?(f=ne.find(r=>r.id===m),t[1]=m,t[2]=f):f=t[2];const i=f;if(i?.renderHeader&&i?.renderEmptyState&&i?.binding){let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),t[3]=r):r=t[3];let g;return t[4]!==i.binding||t[5]!==i.renderEmptyState||t[6]!==i.renderHeader?(g=n.jsx(q.Suspense,{fallback:r,children:n.jsx(me,{binding:i.binding,renderHeader:i.renderHeader,renderEmptyState:i.renderEmptyState})}),t[4]=i.binding,t[5]=i.renderEmptyState,t[6]=i.renderHeader,t[7]=g):g=t[7],g}const o=i?.LayoutComponent;if(!o){let r;return t[8]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(J,{}),t[8]=r):r=t[8],r}let l;t[9]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),t[9]=l):l=t[9];let a;return t[10]!==o?(a=n.jsx(q.Suspense,{fallback:l,children:n.jsx(o,{})}),t[10]=o,t[11]=a):a=t[11],a}export{Le as default};
@@ -1 +0,0 @@
1
- import{C as i,L as n,O as l,P as u,V as C,i as c,p as P,u as p}from"./index-xQ2t379n.js";import{E as M,b as L,a as g,c as d,u as E,d as T,e as S,f as x,g as O,h as y}from"./use-connection-Dtj63U01.js";import{S as e}from"./constants-BLSLjUCX.js";import{K as f,a as R,W as b,c as h,g as A,b as I,d as K,e as V,f as D,h as W,i as U,u as w,j as Q}from"./constants-BLSLjUCX.js";import{u as j,a as Y,b as F,c as G,d as k}from"./use-mcp-tools-DScmBuoc.js";import{l as B,r as H,u as J,a as q,b as z}from"./use-mcp-resources-B792gs6l.js";import{A as Z,D as $,g as ss,l as es,u as as,a as ts}from"./decopilot-events-BEPzMc6y.js";import{u as rs,a as is,b as ns}from"./use-virtual-mcp-COkdNvVv.js";import{a as us,h as Cs,i as cs}from"./mcp-oauth-BKgRq621.js";import{a as ps,c as ms,e as Ms,g as Ls}from"./usage-B8eRkRZY.js";import"./useMutation-tQLZk7P3.js";import"./useQuery-BLe-0FCm.js";export{Z as ALL_DECOPILOT_EVENT_TYPES,i as ConnectionEntitySchema,$ as DECOPILOT_EVENTS,M as EMPTY_COLLECTION_LIST_RESULT,f as KEYS,n as Locator,l as ORG_ADMIN_PROJECT_SLUG,u as ProjectContextProvider,R as SELF_MCP_ALIAS_ID,e as StreamableHTTPClientTransport,C as VirtualMCPEntitySchema,b as WellKnownOrgMCPId,ps as addUsage,us as authenticateMcp,L as buildCollectionQueryKey,g as buildOrderByExpression,d as buildWhereExpression,ms as calculateUsageStats,h as createMCPClient,Ms as emptyUsageStats,Ls as getCostFromUsage,A as getDecopilotId,ss as getPrompt,I as getWellKnownCommunityRegistryConnection,K as getWellKnownDecopilotVirtualMCP,V as getWellKnownMcpStudioConnection,D as getWellKnownOpenRouterConnection,W as getWellKnownRegistryConnection,Cs as handleOAuthCallback,cs as isConnectionAuthenticated,U as isDecopilot,c as isStdioParameters,es as listPrompts,B as listResources,P as parseVirtualUrl,H as readResource,E as useCollectionActions,T as useCollectionItem,S as useCollectionList,x as useConnection,O as useConnectionActions,y as useConnections,w as useMCPClient,Q as useMCPClientOptional,as as useMCPPromptsList,ts as useMCPPromptsListQuery,J as useMCPReadResource,q as useMCPResourcesList,z as useMCPResourcesListQuery,j as useMCPToolCall,Y as useMCPToolCallMutation,F as useMCPToolCallQuery,G as useMCPToolsList,k as useMCPToolsListQuery,p as useProjectContext,rs as useVirtualMCP,is as useVirtualMCPActions,ns as useVirtualMCPs};