decocms 3.4.0 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/dist/client/assets/{AlertCircle-C2xmuErv.js → AlertCircle-PL6o_BFM.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-DY3nGAjH.js → ArrowUpRight-D0PaRtUX.js} +1 -1
  3. package/dist/client/assets/{Check-Bl0EnB2J.js → Check-7lFZ8X77.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-Bt38xVIy.js → CheckCircle-Bjdxpj1j.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-BYvseX6e.js → ChevronDown-DBeUwQYn.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-DoUOCEbQ.js → ChevronLeft-CPLLwlIr.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-CJPo14Wd.js → ChevronRight-BVo14pyp.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-CoYKSGM9.js → ChevronUp-XvIiv-NV.js} +1 -1
  9. package/dist/client/assets/{Container-Bgm498uR.js → Container-BoahFo7F.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-DdI4UlQo.js → DotsVertical-ntZiwo0t.js} +1 -1
  11. package/dist/client/assets/{Eye-D-FtEtW8.js → Eye-DkuHnUAW.js} +1 -1
  12. package/dist/client/assets/{FilterLines-Bn2_q3W3.js → FilterLines-DgBfCVyf.js} +1 -1
  13. package/dist/client/assets/{Globe01-5KEfDt4K.js → Globe01-CcGroxBm.js} +1 -1
  14. package/dist/client/assets/{HardDrive-Bq_J68ys.js → HardDrive-C4j857Fq.js} +1 -1
  15. package/dist/client/assets/{Key01-C484g3YO.js → Key01-o0EwVLiR.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-CnXQOO58.js → LayoutLeft-CD_Gf1ZP.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-DSXCOuPf.js → LinkExternal01-BrUoXKJY.js} +1 -1
  18. package/dist/client/assets/{Monitor01-DxGBVT7-.js → Monitor01-D61B3ma3.js} +1 -1
  19. package/dist/client/assets/{Palette-BL7llRL5.js → Palette-CrqqEUcE.js} +1 -1
  20. package/dist/client/assets/{Play-COr2_UEr.js → Play-UJPgqc1U.js} +1 -1
  21. package/dist/client/assets/{Plus-DyGCHsAC.js → Plus-Tnr53r7A.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-DwuEW87g.js → RefreshCcw01-Cv0pFCb4.js} +1 -1
  23. package/dist/client/assets/{SearchMd-BvLcLD4O.js → SearchMd-UxzEV07r.js} +1 -1
  24. package/dist/client/assets/{Settings02-DdSNGnuW.js → Settings02-DhqQsm8K.js} +1 -1
  25. package/dist/client/assets/{Shield01-B-jBzvZJ.js → Shield01-DpLC5M3q.js} +1 -1
  26. package/dist/client/assets/{Star01-BWl4O-UT.js → Star01-sX328yCS.js} +1 -1
  27. package/dist/client/assets/{Stars01-cmM0sb2I.js → Stars01-Dv9c4Cee.js} +1 -1
  28. package/dist/client/assets/{Stars02-BDvnLwBo.js → Stars02-f0XE-eqW.js} +1 -1
  29. package/dist/client/assets/{Sun-BumCYr1L.js → Sun-PyN_Wt4r.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-DL7oI9Hg.js → SwitchHorizontal01-B9vZRv9t.js} +1 -1
  31. package/dist/client/assets/{Tool01-Cgf_tMbK.js → Tool01-yp4kJRUu.js} +1 -1
  32. package/dist/client/assets/{Trash01-BWWRskAa.js → Trash01-CZeQBZf_.js} +1 -1
  33. package/dist/client/assets/{Upload01-CufDtzzB.js → Upload01-SHM-fhC7.js} +1 -1
  34. package/dist/client/assets/{User01-CL8jgZE5.js → User01-DW9hMolk.js} +1 -1
  35. package/dist/client/assets/{Users01-DVvuBAcj.js → Users01-D2wb7idE.js} +1 -1
  36. package/dist/client/assets/{Users03-DuD0whJZ.js → Users03-DbJl-FlT.js} +1 -1
  37. package/dist/client/assets/{X-Dnhh57X7.js → X-BH0VE8jB.js} +1 -1
  38. package/dist/client/assets/{XCircle-M_oWnCac.js → XCircle-DLzFRLwJ.js} +1 -1
  39. package/dist/client/assets/{XClose-tPJB8Sgg.js → XClose-DNgFZbzC.js} +1 -1
  40. package/dist/client/assets/{Zap-C7nJc6zh.js → Zap-DplWtEq0.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-D8HT6_jN.js → ZapSquare-xDebNl-H.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-DvI5OdTo.js → ZoomOut-CrlW2TUB.js} +1 -1
  43. package/dist/client/assets/{access-gate-DImJJoEr.js → access-gate-BwTL-vjj.js} +1 -1
  44. package/dist/client/assets/{accordion-7MLP1JmO.js → accordion-BTEQZzrz.js} +1 -1
  45. package/dist/client/assets/{add-section-modal--OZiIc-7.js → add-section-modal-DACQp29A.js} +1 -1
  46. package/dist/client/assets/{agent-capabilities-BPRMoWbD.js → agent-capabilities-BPmYbqGN.js} +1 -1
  47. package/dist/client/assets/{agent-icon-WacEkBrp.js → agent-icon-BzrzSnAz.js} +1 -1
  48. package/dist/client/assets/{agent-icons-DSxNh1vt.js → agent-icons-Cd0vLj6N.js} +1 -1
  49. package/dist/client/assets/{agents-list-C2v-b0Uw.js → agents-list-C6qqAI5_.js} +1 -1
  50. package/dist/client/assets/{ai-providers-BwZCii8q.js → ai-providers-kZI6pudu.js} +1 -1
  51. package/dist/client/assets/{alert-B3xreeC3.js → alert-CHelH7PN.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-DXWvjPm6.js → alert-dialog-D0lyxgq7.js} +1 -1
  53. package/dist/client/assets/app-editor-BEzuyKZz.js +1 -0
  54. package/dist/client/assets/{auth-catchall-DkH2zPkq.js → auth-catchall-eEEVSQiw.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-a7pkbs3d.js → auth-split-layout-J4nbOqGk.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-Co4RY6C0.js → automation-list-row-qYSYtkIF.js} +1 -1
  57. package/dist/client/assets/{automation-runs-89AdbVbs.js → automation-runs-C4iv4rJG.js} +1 -1
  58. package/dist/client/assets/{automations-CpHR-q7K.js → automations-BBsp-bnq.js} +1 -1
  59. package/dist/client/assets/{avatar-MwlGDSa1.js → avatar-dR7ViKE5.js} +1 -1
  60. package/dist/client/assets/{badge-CDV4_k2B.js → badge-REAPd24g.js} +1 -1
  61. package/dist/client/assets/{brand-context-CEbbgDr_.js → brand-context-DKgMKp8i.js} +1 -1
  62. package/dist/client/assets/{buckets-B-c_g1Bu.js → buckets-CAG2foTd.js} +1 -1
  63. package/dist/client/assets/{calendar-_Z1zwZng.js → calendar-C4DQ4fqJ.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-U6Dy8kIL.js → capability-load-error-BiSiPTFT.js} +1 -1
  65. package/dist/client/assets/{card-BrXXg9xg.js → card-DjJMgfjm.js} +1 -1
  66. package/dist/client/assets/{chat-context-DKFtpKPJ.js → chat-context-dBrooU1v.js} +1 -1
  67. package/dist/client/assets/{checkbox-COoWVOED.js → checkbox-DLgoLQSR.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-CgA40pPN.js → cli-auth-success-Cf1STb5K.js} +1 -1
  69. package/dist/client/assets/{collection-detail-BZkXi3bA.js → collection-detail-BGZmeA1k.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-BkPkMS-1.js → collection-display-button-DLtr23Rv.js} +1 -1
  71. package/dist/client/assets/{collection-search-HZ4Ln7Q2.js → collection-search-DYrAflR5.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-Bos1aSX0.js → collection-table-wrapper-BZmV-NZH.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-Bt-TX4Xo.js → collection-tabs-Y_drDohR.js} +1 -1
  74. package/dist/client/assets/{collections-DltZgEAo.js → collections-UXWGkaFt.js} +1 -1
  75. package/dist/client/assets/{command-DScV9t-B.js → command-VnXMa00z.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-CLGlbMya.js → connect-desktop-dialog-VMfxWtQ-.js} +1 -1
  77. package/dist/client/assets/{connection-card-BXL7SVUL.js → connection-card-DK49rHkZ.js} +1 -1
  78. package/dist/client/assets/{connection-detail-ZBj-b2U9.js → connection-detail-DzUm5yVg.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-ZyPV2_OX.js → connection-form-helpers-BSgnmPKP.js} +1 -1
  80. package/dist/client/assets/{connections-kRTrf7Rr.js → connections-Bh992QKN.js} +1 -1
  81. package/dist/client/assets/{constants-7h1Iherr.js → constants-B521j7ay.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-DENZDpL-.js → decopilot-sse-pool-D4rmdWQS.js} +1 -1
  83. package/dist/client/assets/{dialog-DrWcnTZj.js → dialog-DqPItn-g.js} +1 -1
  84. package/dist/client/assets/{domain-settings-ShrDeEq2.js → domain-settings-BXCL_xbf.js} +1 -1
  85. package/dist/client/assets/{drawer-Bfik0Ru5.js → drawer-CPIIyCcW.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-CZNwXuzY.js → dropdown-menu-2uydtPAy.js} +1 -1
  87. package/dist/client/assets/{dynamic-plugin-layout-BP4187XS.js → dynamic-plugin-layout-RNpkQxgu.js} +1 -1
  88. package/dist/client/assets/{empty-state-D3IZdm2e.js → empty-state-BLunjf1m.js} +1 -1
  89. package/dist/client/assets/{empty-state-DKLTVUZK.js → empty-state-DLBfWl6Y.js} +1 -1
  90. package/dist/client/assets/{extract-connection-data-nTPi-bUk.js → extract-connection-data-aP9VrOhv.js} +1 -1
  91. package/dist/client/assets/{features-BLxt6ZXO.js → features-CA4znDNw.js} +1 -1
  92. package/dist/client/assets/{file-explorer-qXYPqBrE.js → file-explorer-aonQXi96.js} +1 -1
  93. package/dist/client/assets/{file-type-icon-CNGWzVav.js → file-type-icon-CqbDePIX.js} +1 -1
  94. package/dist/client/assets/{files-DxicSOqn.js → files-d-57Qs8I.js} +1 -1
  95. package/dist/client/assets/{form-DZneHGBX.js → form-BIWGXIbK.js} +1 -1
  96. package/dist/client/assets/{general-BNlVKTyv.js → general-CXp3pwbL.js} +1 -1
  97. package/dist/client/assets/{generate-id-BKVk8ACt.js → generate-id-CdwRTiX7.js} +1 -1
  98. package/dist/client/assets/{github-repo-picker-DhCzx3JE.js → github-repo-picker-Bu6oV3t1.js} +1 -1
  99. package/dist/client/assets/{header-tab-button-FYT24Mc0.js → header-tab-button-Btqu8vce.js} +1 -1
  100. package/dist/client/assets/{hover-card-C3fFUxNZ.js → hover-card-reOs8OTf.js} +1 -1
  101. package/dist/client/assets/{image-field-BPpyMlFF.js → image-field-DoQO0nqy.js} +1 -1
  102. package/dist/client/assets/{index-CrU7PEoz.js → index-2xBvfJLJ.js} +1 -1
  103. package/dist/client/assets/{index-DnL9bwru.js → index-BIMoUWYp.js} +1 -1
  104. package/dist/client/assets/{index-nja5uOPv.js → index-BYSwFuRs.js} +1 -1
  105. package/dist/client/assets/{index-1DdOMz-0.js → index-C1MLUCFq.js} +1 -1
  106. package/dist/client/assets/{index-CHxlbuKY.js → index-C4HbvW_W.js} +3 -3
  107. package/dist/client/assets/{index-CE8bhCJ-.js → index-CM0AvljI.js} +1 -1
  108. package/dist/client/assets/{index-h-7ASBRq.js → index-CgoPiptB.js} +1 -1
  109. package/dist/client/assets/{index-BYABqu1-.js → index-CuEl7ZCd.js} +1 -1
  110. package/dist/client/assets/{index-CO19ITRz.js → index-D8H8ytWG.js} +23 -23
  111. package/dist/client/assets/{index-BGTvYbRH.js → index-DElKj3LD.js} +1 -1
  112. package/dist/client/assets/{index-BzQy6K9H.js → index-DVHW5IXE.js} +1 -1
  113. package/dist/client/assets/{index-DBPwWvUg.js → index-FhXRIQKJ.js} +1 -1
  114. package/dist/client/assets/{index-C7bMF1Zw.js → index-WNtnEHJ2.js} +1 -1
  115. package/dist/client/assets/{index-D8CIGkco.js → index-_FSABeX9.js} +1 -1
  116. package/dist/client/assets/{index-redirect--DRbdQvu.js → index-redirect-3tS7mNzU.js} +1 -1
  117. package/dist/client/assets/{index-fTzwyCrX.js → index-xesYw4pg.js} +1 -1
  118. package/dist/client/assets/{infiniteQueryObserver-ClvxtPxd.js → infiniteQueryObserver-IbMlOZg5.js} +1 -1
  119. package/dist/client/assets/{input-BqbhwOOI.js → input-B5k-Hbp3.js} +1 -1
  120. package/dist/client/assets/{integration-icon-DsdPiq0I.js → integration-icon-C7p8BtkI.js} +1 -1
  121. package/dist/client/assets/{label-DylEtHs-.js → label-BvvzAAWu.js} +1 -1
  122. package/dist/client/assets/{layout-BNJzmBuH.js → layout-BMq59AVz.js} +1 -1
  123. package/dist/client/assets/{login-BqdS0wu4.js → login-BIU3L6eK.js} +1 -1
  124. package/dist/client/assets/{members-N8gPc_Ma.js → members-DGFZlZSL.js} +1 -1
  125. package/dist/client/assets/{monaco-editor-CJckn8Zg.js → monaco-editor-ByT33GfF.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-C5BKUj6s.js → monitoring-stats-row-VdVj1bTz.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-DpOZwh96.js → oauth-callback-C1JOUQQn.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-ai-provider-Bey7NKbP.js → oauth-callback-ai-provider-CUbQRMCQ.js} +1 -1
  129. package/dist/client/assets/{onboarding-DX1TA4nG.js → onboarding-CY5W5FNv.js} +1 -1
  130. package/dist/client/assets/{org-install-Dw27kVYm.js → org-install-DLtxfbHw.js} +1 -1
  131. package/dist/client/assets/{org-layout-BoYrXW7O.js → org-layout-BqXWDd1-.js} +1 -1
  132. package/dist/client/assets/{org-plugin-layout-BZ7QEYUH.js → org-plugin-layout-CbMQy1Lw.js} +1 -1
  133. package/dist/client/assets/{page-seo-form-DBEtnmLl.js → page-seo-form-BmCl6Xlh.js} +1 -1
  134. package/dist/client/assets/page-seo-sheet-Ced60-cr.js +1 -0
  135. package/dist/client/assets/{pair-KHOH6ev_.js → pair-Bhj3cOFh.js} +2 -2
  136. package/dist/client/assets/{plugin-empty-state-z6EfkGXR.js → plugin-empty-state-dJCoaDDO.js} +1 -1
  137. package/dist/client/assets/{plugin-header-CvmTO3qC.js → plugin-header-BmoMpOXz.js} +1 -1
  138. package/dist/client/assets/{plugin-layout-d2cyKIK_.js → plugin-layout-BR81jn44.js} +1 -1
  139. package/dist/client/assets/{popover-CThu0-ID.js → popover-CFPzrMHB.js} +1 -1
  140. package/dist/client/assets/{post-editor-HwjfiT82.js → post-editor-GGFyFznW.js} +1 -1
  141. package/dist/client/assets/{primitives-DOyYgRDx.js → primitives-DYqJBFCL.js} +1 -1
  142. package/dist/client/assets/{profile-DoWLwgvz.js → profile-Cfmj1cf7.js} +1 -1
  143. package/dist/client/assets/project-app-view-eVezvxZo.js +1 -0
  144. package/dist/client/assets/record-editor-52XgVwcw.js +1 -0
  145. package/dist/client/assets/registry-CiIpQiyq.js +2 -0
  146. package/dist/client/assets/{registry-layout-B_UkD5S0.js → registry-layout-BIYEFhu4.js} +1 -1
  147. package/dist/client/assets/{require-capability-BvInsc8R.js → require-capability-OYQug4J7.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-LJYVUIeV.js → required-auth-layout-Bcp4IxxD.js} +1 -1
  149. package/dist/client/assets/{reset-password-DtCxXZ93.js → reset-password-suzhQWSU.js} +1 -1
  150. package/dist/client/assets/{resizable-YbTIAmC6.js → resizable-IfVaIg_U.js} +1 -1
  151. package/dist/client/assets/{roles-deRJzwzx.js → roles-BPJBENaC.js} +1 -1
  152. package/dist/client/assets/{save-status-CznZaqbg.js → save-status-BxvWi0ix.js} +1 -1
  153. package/dist/client/assets/{schema-form-Bz-Y2xaP.js → schema-form-DbvvSf_B.js} +1 -1
  154. package/dist/client/assets/{scroll-area-iVX_9hOT.js → scroll-area-DYzEAvWY.js} +1 -1
  155. package/dist/client/assets/{search-input-BV9iWpXU.js → search-input-BMW004dV.js} +1 -1
  156. package/dist/client/assets/{secrets-DKrtTjxD.js → secrets-Bv4krrbm.js} +1 -1
  157. package/dist/client/assets/{sections-editor-wlO4Df3c.js → sections-editor-tHHOdLOL.js} +1 -1
  158. package/dist/client/assets/{select-Ci_D4qpL.js → select-DPygLpWH.js} +1 -1
  159. package/dist/client/assets/{select-model-B4DZz0S9.js → select-model-BS2yzBPq.js} +1 -1
  160. package/dist/client/assets/{seo-editor-03fUsq4w.js → seo-editor-CCPmPYRi.js} +1 -1
  161. package/dist/client/assets/{settings-layout-DWP_Rn9K.js → settings-layout-BV_kMffR.js} +1 -1
  162. package/dist/client/assets/{settings-section-DKmxECct.js → settings-section-C7gs1p6F.js} +1 -1
  163. package/dist/client/assets/{sheet-B9dMT6Ki.js → sheet-D9aXq4ta.js} +1 -1
  164. package/dist/client/assets/{shell-controls-CCA2MPHn.js → shell-controls-C56-Ps3x.js} +1 -1
  165. package/dist/client/assets/{shell-layout-BNtK431X.js → shell-layout-tWuhPjHz.js} +1 -1
  166. package/dist/client/assets/{shell-route-loading-CaBu7gGK.js → shell-route-loading-Cy1LF1Kf.js} +1 -1
  167. package/dist/client/assets/{sidebar-rRN-0AxT.js → sidebar-DB4iKQD5.js} +1 -1
  168. package/dist/client/assets/{skeleton-IAM_o0Ys.js → skeleton-DH0H1fU3.js} +1 -1
  169. package/dist/client/assets/{sortable.esm-DRxiermK.js → sortable.esm-BKA03RQh.js} +1 -1
  170. package/dist/client/assets/{spinner-ZLpPHnSU.js → spinner-C0Im7y7X.js} +1 -1
  171. package/dist/client/assets/{sso-CdsNChqa.js → sso-BYfRBv2e.js} +1 -1
  172. package/dist/client/assets/{store-BgRTI4Rv.js → store-Cyr13yyM.js} +1 -1
  173. package/dist/client/assets/store-registry-DIjY8LQB.js +2 -0
  174. package/dist/client/assets/{switch-B1bl8sNA.js → switch-BGtkcqu8.js} +1 -1
  175. package/dist/client/assets/{tab-id-C5NSex1c.js → tab-id-B1KAdtlk.js} +1 -1
  176. package/dist/client/assets/{table-DB1Kd-ou.js → table-B34ZqNGn.js} +1 -1
  177. package/dist/client/assets/{tabs-B3X9vNsm.js → tabs-52tGcLiU.js} +1 -1
  178. package/dist/client/assets/{task-status-ClueOciL.js → task-status-Dq99ypn5.js} +1 -1
  179. package/dist/client/assets/{textarea-DywxeOH3.js → textarea-BnccT-U9.js} +1 -1
  180. package/dist/client/assets/{toggle-group-7kzOZFuJ.js → toggle-group-E6TPCKmI.js} +1 -1
  181. package/dist/client/assets/{toolbar-l4lsSaSH.js → toolbar-B-Xmvyb0.js} +1 -1
  182. package/dist/client/assets/{tools-list-Dm1utA0x.js → tools-list-CZ0YST_J.js} +1 -1
  183. package/dist/client/assets/{tooltip-BFGyTrfa.js → tooltip-DgiqborV.js} +1 -1
  184. package/dist/client/assets/{types-ksHhVabW.js → types-DP-Q3z5y.js} +1 -1
  185. package/dist/client/assets/{use-ai-providers-JirMLy_w.js → use-ai-providers-B_aWh-J8.js} +1 -1
  186. package/dist/client/assets/{use-automations-3R13ZeSL.js → use-automations-CQqGzVrP.js} +1 -1
  187. package/dist/client/assets/{use-capability-CQt0iOwa.js → use-capability-CzlbJT0x.js} +1 -1
  188. package/dist/client/assets/{use-collections-hMeHX3z9.js → use-collections-CFs8myDl.js} +1 -1
  189. package/dist/client/assets/{use-connection-_VO3kzZS.js → use-connection-DjURtMK5.js} +1 -1
  190. package/dist/client/assets/{use-copy-BNAf-Qgh.js → use-copy-CKGAQPRW.js} +1 -1
  191. package/dist/client/assets/{use-create-virtual-mcp-DpiN_bgM.js → use-create-virtual-mcp-GqhamUF-.js} +1 -1
  192. package/dist/client/assets/{use-debounced-autosave-kr27xY5y.js → use-debounced-autosave-iWsKgUnH.js} +1 -1
  193. package/dist/client/assets/{use-delete-connection-DFb9AulP.js → use-delete-connection-CjdkJ1LG.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-DrA_HE6r.js → use-file-configs-DD5bg8yH.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-DRY2R8kb.js → use-infinite-scroll-Bo7I5Z4-.js} +1 -1
  196. package/dist/client/assets/{use-list-state-CGdA9sk-.js → use-list-state-BxpSC3kw.js} +1 -1
  197. package/dist/client/assets/{use-mcp-prompts-BIC4osYX.js → use-mcp-prompts-BNFsBgD1.js} +1 -1
  198. package/dist/client/assets/{use-mcp-tools-BZZ0dcgP.js → use-mcp-tools-DCbS4kMk.js} +1 -1
  199. package/dist/client/assets/{use-members-DnfZ8tEp.js → use-members-DZ4oSOx-.js} +1 -1
  200. package/dist/client/assets/{use-navigate-to-agent-DWh1SzWc.js → use-navigate-to-agent-DwD_R1XG.js} +1 -1
  201. package/dist/client/assets/{use-org-auth-client-CwWZc3xb.js → use-org-auth-client-v3u1LDk5.js} +1 -1
  202. package/dist/client/assets/{use-org-sso-BnGud85s.js → use-org-sso-Ck4B3T6D.js} +1 -1
  203. package/dist/client/assets/{use-organization-roles-BIe6gEN_.js → use-organization-roles-BIilFNn5.js} +1 -1
  204. package/dist/client/assets/{use-organization-settings-Dy_wvkUU.js → use-organization-settings-difToZl3.js} +1 -1
  205. package/dist/client/assets/{use-registry-connections-DnATENDO.js → use-registry-connections-KEGYdtt_.js} +1 -1
  206. package/dist/client/assets/{use-secrets-C4Hg3-p8.js → use-secrets-DHcsXoUs.js} +1 -1
  207. package/dist/client/assets/{use-status-sounds-CCM_GgH8.js → use-status-sounds-CPmXHEGX.js} +1 -1
  208. package/dist/client/assets/{use-view-mode-DZhMkEJ1.js → use-view-mode-Bq2h-mAH.js} +1 -1
  209. package/dist/client/assets/{use-virtual-mcp-BaoT8VIh.js → use-virtual-mcp-By6PZUzg.js} +1 -1
  210. package/dist/client/assets/useInfiniteQuery-BkurBcOt.js +1 -0
  211. package/dist/client/assets/{useRouterState-DEBHW9gr.js → useRouterState-BBlCl4XE.js} +1 -1
  212. package/dist/client/assets/useSuspenseInfiniteQuery-C21DKA3_.js +1 -0
  213. package/dist/client/assets/{user-CmhADXs_.js → user-CBbH_JeB.js} +1 -1
  214. package/dist/client/assets/{view-mode-toggle--g2MGXro.js → view-mode-toggle-B0_LJI8Z.js} +1 -1
  215. package/dist/client/assets/{workflow-DuDgvcXi.js → workflow-Ce5v7OlY.js} +1 -1
  216. package/dist/client/assets/workflow-detail-CMT7JAKv.js +1 -0
  217. package/dist/client/index.html +1 -1
  218. package/dist/server/cli.js +16 -10
  219. package/dist/server/migrate.js +1 -1
  220. package/dist/server/server.js +8 -6
  221. package/package.json +1 -1
  222. package/dist/client/assets/app-editor-DaKe0gcW.js +0 -1
  223. package/dist/client/assets/page-seo-sheet-B66TXIq6.js +0 -1
  224. package/dist/client/assets/project-app-view-BA3JXk-V.js +0 -1
  225. package/dist/client/assets/record-editor-B09SHssY.js +0 -1
  226. package/dist/client/assets/registry-CVaj-aEQ.js +0 -2
  227. package/dist/client/assets/store-registry-CxNFeZZm.js +0 -2
  228. package/dist/client/assets/useInfiniteQuery-BdYHzHZ3.js +0 -1
  229. package/dist/client/assets/useSuspenseInfiniteQuery-KU_h5oCb.js +0 -1
  230. package/dist/client/assets/workflow-detail-C8cBg_ad.js +0 -1
@@ -1 +1 @@
1
- import{e as f,c as u,j as m}from"./index-CHxlbuKY.js";import{B as g}from"./badge-CDV4_k2B.js";function h(x){const e=f.c(12),{tabs:l,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==l){let c;e[6]!==n||e[7]!==s?(c=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
1
+ import{e as f,c as u,j as m}from"./index-C4HbvW_W.js";import{B as g}from"./badge-REAPd24g.js";function h(x){const e=f.c(12),{tabs:l,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==l){let c;e[6]!==n||e[7]!==s?(c=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
@@ -1 +1 @@
1
- import{R as t,U as i,b6 as p,aH as r,aG as a,cj as m,bM as h,T as c,aJ as b}from"./index-CHxlbuKY.js";const N=t({id:i().describe("Unique identifier for the entity"),title:i().describe("Human-readable title for the entity"),description:i().nullish().describe("Description of the entity"),created_at:i().datetime(),updated_at:i().datetime(),created_by:i().optional(),updated_by:i().optional()}),f=t({field:a(i()),operator:r(["eq","gt","gte","lt","lte","in","like","contains"]),value:p()}),u=m(()=>h([f,t({operator:r(["and","or","not"]),conditions:a(u)})])),C=t({field:a(i()),direction:r(["asc","desc"]),nulls:r(["first","last"]).optional()}),S=t({where:u.optional().describe("Filter expression"),orderBy:a(C).optional().describe("Sort expressions"),limit:c().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:c().int().min(0).optional().describe("Number of items to skip")});function O(e){return t({items:a(e).describe("Array of collection items"),totalCount:c().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:b().optional().describe("Whether there are more items available")})}const y=t({id:i().describe("ID of the entity to retrieve")});function E(e){return t({item:e.nullable().describe("The retrieved item, or null if not found")})}function I(e){return t({data:e.partial().describe("Data for the new entity (id may be auto-generated)")})}function T(e){return t({item:e.describe("The created entity with generated id")})}function _(e){return t({id:i().describe("ID of the entity to update"),data:e.partial().describe("Partial entity data to update")})}function L(e){return t({item:e.describe("The updated entity")})}const D=t({id:i().describe("ID of the entity to delete")});function g(e){return t({item:e.describe("The deleted entity")})}function U(e,n,l){const o=e.toUpperCase(),d=l?.readOnly??!1,s=[{name:`COLLECTION_${o}_LIST`,inputSchema:S,outputSchema:O(n)},{name:`COLLECTION_${o}_GET`,inputSchema:y,outputSchema:E(n)}];return d||s.push({name:`COLLECTION_${o}_CREATE`,inputSchema:I(n),outputSchema:T(n),opt:!0},{name:`COLLECTION_${o}_UPDATE`,inputSchema:_(n),outputSchema:L(n),opt:!0},{name:`COLLECTION_${o}_DELETE`,inputSchema:D,outputSchema:g(n),opt:!0}),s}export{N as B,U as c};
1
+ import{R as t,U as i,b6 as p,aH as r,aG as a,cj as m,bM as h,T as c,aJ as b}from"./index-C4HbvW_W.js";const N=t({id:i().describe("Unique identifier for the entity"),title:i().describe("Human-readable title for the entity"),description:i().nullish().describe("Description of the entity"),created_at:i().datetime(),updated_at:i().datetime(),created_by:i().optional(),updated_by:i().optional()}),f=t({field:a(i()),operator:r(["eq","gt","gte","lt","lte","in","like","contains"]),value:p()}),u=m(()=>h([f,t({operator:r(["and","or","not"]),conditions:a(u)})])),C=t({field:a(i()),direction:r(["asc","desc"]),nulls:r(["first","last"]).optional()}),S=t({where:u.optional().describe("Filter expression"),orderBy:a(C).optional().describe("Sort expressions"),limit:c().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:c().int().min(0).optional().describe("Number of items to skip")});function O(e){return t({items:a(e).describe("Array of collection items"),totalCount:c().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:b().optional().describe("Whether there are more items available")})}const y=t({id:i().describe("ID of the entity to retrieve")});function E(e){return t({item:e.nullable().describe("The retrieved item, or null if not found")})}function I(e){return t({data:e.partial().describe("Data for the new entity (id may be auto-generated)")})}function T(e){return t({item:e.describe("The created entity with generated id")})}function _(e){return t({id:i().describe("ID of the entity to update"),data:e.partial().describe("Partial entity data to update")})}function L(e){return t({item:e.describe("The updated entity")})}const D=t({id:i().describe("ID of the entity to delete")});function g(e){return t({item:e.describe("The deleted entity")})}function U(e,n,l){const o=e.toUpperCase(),d=l?.readOnly??!1,s=[{name:`COLLECTION_${o}_LIST`,inputSchema:S,outputSchema:O(n)},{name:`COLLECTION_${o}_GET`,inputSchema:y,outputSchema:E(n)}];return d||s.push({name:`COLLECTION_${o}_CREATE`,inputSchema:I(n),outputSchema:T(n),opt:!0},{name:`COLLECTION_${o}_UPDATE`,inputSchema:_(n),outputSchema:L(n),opt:!0},{name:`COLLECTION_${o}_DELETE`,inputSchema:D,outputSchema:g(n),opt:!0}),s}export{N as B,U as c};
@@ -1 +1 @@
1
- import{e as d,c as i,j as n}from"./index-CHxlbuKY.js";import{_ as m}from"./index-BYABqu1-.js";import{D as k,c as N,e as j,b,a as w}from"./dialog-DrWcnTZj.js";import{i as y}from"./SearchMd-BvLcLD4O.js";function C(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function S(a){const e=d.c(24);let t,s,o,l,r;e[0]!==a?({title:l,description:r,children:t,className:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=l,e[5]=r):(t=e[1],s=e[2],o=e[3],l=e[4],r=e[5]);const _=l===void 0?"Command Palette":l,v=r===void 0?"Search for a command to run...":r;let c;e[6]!==_?(c=n.jsx(N,{children:_}),e[6]=_,e[7]=c):c=e[7];let p;e[8]!==v?(p=n.jsx(j,{children:v}),e[8]=v,e[9]=p):p=e[9];let u;e[10]!==c||e[11]!==p?(u=n.jsxs(b,{className:"sr-only",children:[c,p]}),e[10]=c,e[11]=p,e[12]=u):u=e[12];let f;e[13]!==s?(f=i("overflow-hidden p-0",s),e[13]=s,e[14]=f):f=e[14];let x;e[15]!==t?(x=n.jsx(C,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:t}),e[15]=t,e[16]=x):x=e[16];let g;e[17]!==f||e[18]!==x?(g=n.jsx(w,{className:f,closeButtonClassName:"hidden",children:x}),e[17]=f,e[18]=x,e[19]=g):g=e[19];let h;return e[20]!==o||e[21]!==u||e[22]!==g?(h=n.jsxs(k,{...o,children:[u,g]}),e[20]=o,e[21]=u,e[22]=g,e[23]=h):h=e[23],h}function z(a){const e=d.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(y,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=i("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=l):l=e[5];let r;return e[6]!==s||e[7]!==l?(r=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(m.Input,{"data-slot":"command-input",className:l,...s})]}),e[6]=s,e[7]=l,e[8]=r):r=e[8],r}function G(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function L(a){const e=d.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(m.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function R(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function B(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function H(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}export{L as C,R as a,C as b,z as c,G as d,H as e,B as f,S as g};
1
+ import{e as d,c as i,j as n}from"./index-C4HbvW_W.js";import{_ as m}from"./index-CuEl7ZCd.js";import{D as k,c as N,e as j,b,a as w}from"./dialog-DqPItn-g.js";import{i as y}from"./SearchMd-UxzEV07r.js";function C(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function S(a){const e=d.c(24);let t,s,o,l,r;e[0]!==a?({title:l,description:r,children:t,className:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=l,e[5]=r):(t=e[1],s=e[2],o=e[3],l=e[4],r=e[5]);const _=l===void 0?"Command Palette":l,v=r===void 0?"Search for a command to run...":r;let c;e[6]!==_?(c=n.jsx(N,{children:_}),e[6]=_,e[7]=c):c=e[7];let p;e[8]!==v?(p=n.jsx(j,{children:v}),e[8]=v,e[9]=p):p=e[9];let u;e[10]!==c||e[11]!==p?(u=n.jsxs(b,{className:"sr-only",children:[c,p]}),e[10]=c,e[11]=p,e[12]=u):u=e[12];let f;e[13]!==s?(f=i("overflow-hidden p-0",s),e[13]=s,e[14]=f):f=e[14];let x;e[15]!==t?(x=n.jsx(C,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:t}),e[15]=t,e[16]=x):x=e[16];let g;e[17]!==f||e[18]!==x?(g=n.jsx(w,{className:f,closeButtonClassName:"hidden",children:x}),e[17]=f,e[18]=x,e[19]=g):g=e[19];let h;return e[20]!==o||e[21]!==u||e[22]!==g?(h=n.jsxs(k,{...o,children:[u,g]}),e[20]=o,e[21]=u,e[22]=g,e[23]=h):h=e[23],h}function z(a){const e=d.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(y,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=i("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=l):l=e[5];let r;return e[6]!==s||e[7]!==l?(r=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(m.Input,{"data-slot":"command-input",className:l,...s})]}),e[6]=s,e[7]=l,e[8]=r):r=e[8],r}function G(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function L(a){const e=d.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(m.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function R(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function B(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function H(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}export{L as C,R as a,C as b,z as c,G as d,H as e,B as f,S as g};
@@ -1 +1 @@
1
- import{e as P,r as T,q as A,F as _,a as B,j as s,B as L,K as z,o as F}from"./index-CHxlbuKY.js";import{c as K,e as Y,b as q,a as M,D as O}from"./dialog-DrWcnTZj.js";import{S as R}from"./spinner-ZLpPHnSU.js";import{i as Q}from"./Check-Bl0EnB2J.js";import{a as $}from"./Eye-D-FtEtW8.js";import{S as H,u as W}from"./constants-7h1Iherr.js";import{u as G}from"./chat-context-DKFtpKPJ.js";const E="bunx decocms link",v={"claude-code":"Claude Code",codex:"Codex"};function w(n){return n.map(e=>v[e]).filter(e=>!!e)}function N(n){return Object.keys(v).filter(e=>!n.includes(e)).map(e=>v[e]).filter(e=>!!e)}function ie(n){const e=P.c(35),{open:h,onOpenChange:j}=n,t=G(),[C,y]=T.useState(!1),{org:i}=A(),k=_();let x;e[0]!==i.id||e[1]!==i.slug?(x={connectionId:H,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=x):x=e[2];const b=W(x);let o;e[3]!==b?(o=async()=>{const S=await b.callTool({name:"LINK_DISCONNECT",arguments:{}});if(S?.isError)throw new Error(S.content?.[0]?.text??"Failed to disconnect desktop")},e[3]=b,e[4]=o):o=e[4];let a;e[5]!==i.id||e[6]!==k?(a=()=>{k.invalidateQueries({queryKey:z.currentLink(i.id)})},e[5]=i.id,e[6]=k,e[7]=a):a=e[7];let f;e[8]!==o||e[9]!==a?(f={mutationFn:o,onSuccess:a,onError:J},e[8]=o,e[9]=a,e[10]=f):f=e[10];const p=B(f),D=t.online?"Desktop connected":"Connect your desktop";let l;e[11]!==D?(l=s.jsx(K,{children:D}),e[11]=D,e[12]=l):l=e[12];const I=t.online?"Your desktop is online. Pick a desktop agent in the chat to use it.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let r;e[13]!==I?(r=s.jsx(Y,{children:I}),e[13]=I,e[14]=r):r=e[14];let c;e[15]!==l||e[16]!==r?(c=s.jsxs(q,{children:[l,r]}),e[15]=l,e[16]=r,e[17]=c):c=e[17];let d;e[18]!==C||e[19]!==t.online?(d=!t.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:E}),s.jsx(L,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(E),y(!0),setTimeout(()=>y(!1),1500)},children:C?s.jsx(Q,{size:14}):s.jsx($,{size:14})})]}),e[18]=C,e[19]=t.online,e[20]=d):d=e[20];let m;e[21]!==p||e[22]!==t.capabilities||e[23]!==t.hostname||e[24]!==t.machineId||e[25]!==t.online?(m=t.online?s.jsxs("div",{className:"flex flex-col gap-1 text-sm",children:[s.jsxs("p",{className:"text-foreground",children:[t.hostname??t.machineId??"Your desktop"," is linked."]}),w(t.capabilities).length>0&&s.jsxs("p",{className:"text-muted-foreground",children:["Available: ",w(t.capabilities).join(", ")]}),N(t.capabilities).length>0&&s.jsxs("p",{className:"text-muted-foreground",children:[N(t.capabilities).join(" and ")," ",N(t.capabilities).length>1?"were":"was"," ","not detected on this desktop. Install the CLI and sign in there — it appears here automatically within a minute."]}),s.jsx("div",{className:"flex justify-end pt-2",children:s.jsx(L,{type:"button",variant:"outline",size:"sm",disabled:p.isPending,onClick:()=>p.mutate(),className:"text-destructive hover:text-destructive",children:p.isPending?"Disconnecting…":"Disconnect desktop"})})]}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(R,{size:"sm"}),"Waiting for desktop…"]}),e[21]=p,e[22]=t.capabilities,e[23]=t.hostname,e[24]=t.machineId,e[25]=t.online,e[26]=m):m=e[26];let u;e[27]!==d||e[28]!==m||e[29]!==c?(u=s.jsxs(M,{className:"sm:max-w-md",children:[c,d,m]}),e[27]=d,e[28]=m,e[29]=c,e[30]=u):u=e[30];let g;return e[31]!==j||e[32]!==h||e[33]!==u?(g=s.jsx(O,{open:h,onOpenChange:j,children:u}),e[31]=j,e[32]=h,e[33]=u,e[34]=g):g=e[34],g}function J(n){F.error(`Disconnect failed: ${n.message}`)}export{ie as C,w as v};
1
+ import{e as P,r as T,q as A,F as _,a as B,j as s,B as L,K as z,o as F}from"./index-C4HbvW_W.js";import{c as K,e as Y,b as q,a as M,D as O}from"./dialog-DqPItn-g.js";import{S as R}from"./spinner-C0Im7y7X.js";import{i as Q}from"./Check-7lFZ8X77.js";import{a as $}from"./Eye-DkuHnUAW.js";import{S as H,u as W}from"./constants-B521j7ay.js";import{u as G}from"./chat-context-dBrooU1v.js";const E="bunx decocms link",v={"claude-code":"Claude Code",codex:"Codex"};function w(n){return n.map(e=>v[e]).filter(e=>!!e)}function N(n){return Object.keys(v).filter(e=>!n.includes(e)).map(e=>v[e]).filter(e=>!!e)}function ie(n){const e=P.c(35),{open:h,onOpenChange:j}=n,t=G(),[C,y]=T.useState(!1),{org:i}=A(),k=_();let x;e[0]!==i.id||e[1]!==i.slug?(x={connectionId:H,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=x):x=e[2];const b=W(x);let o;e[3]!==b?(o=async()=>{const S=await b.callTool({name:"LINK_DISCONNECT",arguments:{}});if(S?.isError)throw new Error(S.content?.[0]?.text??"Failed to disconnect desktop")},e[3]=b,e[4]=o):o=e[4];let a;e[5]!==i.id||e[6]!==k?(a=()=>{k.invalidateQueries({queryKey:z.currentLink(i.id)})},e[5]=i.id,e[6]=k,e[7]=a):a=e[7];let f;e[8]!==o||e[9]!==a?(f={mutationFn:o,onSuccess:a,onError:J},e[8]=o,e[9]=a,e[10]=f):f=e[10];const p=B(f),D=t.online?"Desktop connected":"Connect your desktop";let l;e[11]!==D?(l=s.jsx(K,{children:D}),e[11]=D,e[12]=l):l=e[12];const I=t.online?"Your desktop is online. Pick a desktop agent in the chat to use it.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let r;e[13]!==I?(r=s.jsx(Y,{children:I}),e[13]=I,e[14]=r):r=e[14];let c;e[15]!==l||e[16]!==r?(c=s.jsxs(q,{children:[l,r]}),e[15]=l,e[16]=r,e[17]=c):c=e[17];let d;e[18]!==C||e[19]!==t.online?(d=!t.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:E}),s.jsx(L,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(E),y(!0),setTimeout(()=>y(!1),1500)},children:C?s.jsx(Q,{size:14}):s.jsx($,{size:14})})]}),e[18]=C,e[19]=t.online,e[20]=d):d=e[20];let m;e[21]!==p||e[22]!==t.capabilities||e[23]!==t.hostname||e[24]!==t.machineId||e[25]!==t.online?(m=t.online?s.jsxs("div",{className:"flex flex-col gap-1 text-sm",children:[s.jsxs("p",{className:"text-foreground",children:[t.hostname??t.machineId??"Your desktop"," is linked."]}),w(t.capabilities).length>0&&s.jsxs("p",{className:"text-muted-foreground",children:["Available: ",w(t.capabilities).join(", ")]}),N(t.capabilities).length>0&&s.jsxs("p",{className:"text-muted-foreground",children:[N(t.capabilities).join(" and ")," ",N(t.capabilities).length>1?"were":"was"," ","not detected on this desktop. Install the CLI and sign in there — it appears here automatically within a minute."]}),s.jsx("div",{className:"flex justify-end pt-2",children:s.jsx(L,{type:"button",variant:"outline",size:"sm",disabled:p.isPending,onClick:()=>p.mutate(),className:"text-destructive hover:text-destructive",children:p.isPending?"Disconnecting…":"Disconnect desktop"})})]}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(R,{size:"sm"}),"Waiting for desktop…"]}),e[21]=p,e[22]=t.capabilities,e[23]=t.hostname,e[24]=t.machineId,e[25]=t.online,e[26]=m):m=e[26];let u;e[27]!==d||e[28]!==m||e[29]!==c?(u=s.jsxs(M,{className:"sm:max-w-md",children:[c,d,m]}),e[27]=d,e[28]=m,e[29]=c,e[30]=u):u=e[30];let g;return e[31]!==j||e[32]!==h||e[33]!==u?(g=s.jsx(O,{open:h,onOpenChange:j,children:u}),e[31]=j,e[32]=h,e[33]=u,e[34]=g):g=e[34],g}function J(n){F.error(`Disconnect failed: ${n.message}`)}export{ie as C,w as v};
@@ -1 +1 @@
1
- import{g as _}from"./connection-slug-eyAPH6o3.js";import{e as R,q as $,b2 as k,K as D,c as E,j as x}from"./index-CHxlbuKY.js";import{u as K}from"./use-registry-connections-DnATENDO.js";import{b as Q}from"./use-organization-settings-Dy_wvkUU.js";import{S as w,c as q}from"./constants-7h1Iherr.js";import{u as F}from"./useInfiniteQuery-BdYHzHZ3.js";import{i as H,f as G}from"./extract-connection-data-nTPi-bUk.js";import{C as U}from"./card-BrXXg9xg.js";import{I as V}from"./integration-icon-DsdPiq0I.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),r=e.get(l);r?r.push(o):e.set(l,[o])}const t=[],u=new Set;for(const o of s){const l=_(o);if(u.has(l))continue;u.add(l);const r=e.get(l),m=r[0];r.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:r})}return t}function ce(){const s=R.c(6),e=K(),t=Q(),u=$().project.enabledPlugins??[];let o;if(s[0]!==u||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=r=>t(r.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(X),u.includes("private-registry")&&t(w)&&o.push({id:w,title:"Private Registry",icon:null}),s[0]=u,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function X(s){return{id:s.id,title:s.title,icon:s.icon}}const Y=24,S=3;function A(s){return s.id.includes("community-registry")}function z(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,u,o){const l=s.map(c=>c.id).sort().join(","),r=z(o),{data:m,fetchNextPage:d,hasNextPage:f,isFetchingNextPage:p,isLoading:b}=F({queryKey:D.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:c})=>{const n=c??{};return await Promise.all(s.map(async i=>{const y=n[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=H(i.id,e);let h;for(let v=0;v<S;v++){let C=null;try{C=await q({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const P=await C.callTool({name:j,arguments:I}),N=P.structuredContent??P,M=N.nextCursor||N.cursor||void 0,L=G(N?[N]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:L,nextCursor:M}}catch(I){h=I}finally{await C?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,h),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:c=>{const n={};let a=!1;for(const i of c)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,a=!0):n[i.registryId]="EXHAUSTED");return a?n:void 0},staleTime:3600*1e3,placeholderData:k,retry:!1,enabled:s.length>0}),g=[];if(m?.pages)for(const c of m.pages)for(const n of c)for(const a of n.items)g.push({...a,_sourceName:a._sourceName??n.registryTitle,_sourceIcon:a._sourceIcon??n.registryIcon,_registryId:a._registryId??n.registryId});return{items:g,hasMore:f??!1,isLoadingMore:p,isInitialLoading:b,fetchNextPage:()=>{f&&!p&&d()}}}function ue(s,e){const t=R.c(16),{org:u}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const m=r,d=T(l,u.id,u.slug,!0,e),f=T(m,u.id,u.slug,!0,e);let p;if(t[4]!==f.items||t[5]!==d.items){const y=new Set;p=[];const j=[...d.items,...f.items];for(const h of j){const v=`${h._registryId}:${h.id}`;y.has(v)||(y.add(v),p.push(h))}t[4]=f.items,t[5]=d.items,t[6]=p}else p=t[6];const b=d.isInitialLoading||f.isInitialLoading,g=d.isLoadingMore||f.isLoadingMore,c=d.hasMore||f.hasMore;let n;t[7]!==f||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),f.hasMore&&f.fetchNextPage()},t[7]=f,t[8]=d,t[9]=n):n=t[9];const a=n;let i;return t[10]!==c||t[11]!==b||t[12]!==g||t[13]!==p||t[14]!==a?(i={items:p,hasMore:c,isLoadingMore:g,isInitialLoading:b,loadMore:a},t[10]=c,t[11]=b,t[12]=g,t[13]=p,t[14]=a,t[15]=i):i=t[15],i}function W(s){return A(s)}function Z(s){return!A(s)}function fe(s){const e=R.c(37),{connection:t,onClick:u,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:m,className:d,fallbackIcon:f}=s,p=l===void 0?!1:l,b=u&&"hover:bg-muted/50";let g;e[0]!==d||e[1]!==b?(g=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",b,d),e[0]=d,e[1]=b,e[2]=g):g=e[2];let c;e[3]!==t.icon||e[4]!==t.title||e[5]!==f?(c=x.jsx(V,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=t.icon,e[4]=t.title,e[5]=f,e[6]=c):c=e[6];let n;e[7]!==o||e[8]!==p?(n=o&&x.jsx("div",{className:E("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:J,children:o}),e[7]=o,e[8]=p,e[9]=n):n=e[9];let a;e[10]!==n?(a=x.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i=x.jsxs("div",{className:"flex items-start justify-between",children:[c,a]}),e[12]=c,e[13]=a,e[14]=i):i=e[14];let y;e[15]!==t.title?(y=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=y):y=e[16];const j=t.description||"No description";let h;e[17]!==j?(h=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=h):h=e[18];let v;e[19]!==h||e[20]!==y?(v=x.jsxs("div",{className:"flex flex-col gap-1",children:[y,h]}),e[19]=h,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==r?(C=r&&x.jsx("div",{children:r}),e[22]=r,e[23]=C):C=e[23];let I;e[24]!==v||e[25]!==C||e[26]!==i?(I=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,v,C]}),e[24]=v,e[25]=C,e[26]=i,e[27]=I):I=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:B,children:m})}),e[28]=m,e[29]=P):P=e[29];let N;e[30]!==I||e[31]!==P?(N=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,P]}),e[30]=I,e[31]=P,e[32]=N):N=e[32];let M;return e[33]!==u||e[34]!==N||e[35]!==g?(M=x.jsx(U,{className:g,onClick:u,children:N}),e[33]=u,e[34]=N,e[35]=g,e[36]=M):M=e[36],M}function B(s){return s.stopPropagation()}function J(s){return s.stopPropagation()}export{fe as C,ue as a,ae as g,ce as u};
1
+ import{g as _}from"./connection-slug-eyAPH6o3.js";import{e as R,q as $,b2 as k,K as D,c as E,j as x}from"./index-C4HbvW_W.js";import{u as K}from"./use-registry-connections-KEGYdtt_.js";import{b as Q}from"./use-organization-settings-difToZl3.js";import{S as w,c as q}from"./constants-B521j7ay.js";import{u as F}from"./useInfiniteQuery-BkurBcOt.js";import{i as H,f as G}from"./extract-connection-data-aP9VrOhv.js";import{C as U}from"./card-DjJMgfjm.js";import{I as V}from"./integration-icon-C7p8BtkI.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),r=e.get(l);r?r.push(o):e.set(l,[o])}const t=[],u=new Set;for(const o of s){const l=_(o);if(u.has(l))continue;u.add(l);const r=e.get(l),m=r[0];r.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:r})}return t}function ce(){const s=R.c(6),e=K(),t=Q(),u=$().project.enabledPlugins??[];let o;if(s[0]!==u||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=r=>t(r.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(X),u.includes("private-registry")&&t(w)&&o.push({id:w,title:"Private Registry",icon:null}),s[0]=u,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function X(s){return{id:s.id,title:s.title,icon:s.icon}}const Y=24,S=3;function A(s){return s.id.includes("community-registry")}function z(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,u,o){const l=s.map(c=>c.id).sort().join(","),r=z(o),{data:m,fetchNextPage:d,hasNextPage:f,isFetchingNextPage:p,isLoading:b}=F({queryKey:D.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:c})=>{const n=c??{};return await Promise.all(s.map(async i=>{const y=n[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=H(i.id,e);let h;for(let v=0;v<S;v++){let C=null;try{C=await q({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const P=await C.callTool({name:j,arguments:I}),N=P.structuredContent??P,M=N.nextCursor||N.cursor||void 0,L=G(N?[N]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:L,nextCursor:M}}catch(I){h=I}finally{await C?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,h),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:c=>{const n={};let a=!1;for(const i of c)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,a=!0):n[i.registryId]="EXHAUSTED");return a?n:void 0},staleTime:3600*1e3,placeholderData:k,retry:!1,enabled:s.length>0}),g=[];if(m?.pages)for(const c of m.pages)for(const n of c)for(const a of n.items)g.push({...a,_sourceName:a._sourceName??n.registryTitle,_sourceIcon:a._sourceIcon??n.registryIcon,_registryId:a._registryId??n.registryId});return{items:g,hasMore:f??!1,isLoadingMore:p,isInitialLoading:b,fetchNextPage:()=>{f&&!p&&d()}}}function ue(s,e){const t=R.c(16),{org:u}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const m=r,d=T(l,u.id,u.slug,!0,e),f=T(m,u.id,u.slug,!0,e);let p;if(t[4]!==f.items||t[5]!==d.items){const y=new Set;p=[];const j=[...d.items,...f.items];for(const h of j){const v=`${h._registryId}:${h.id}`;y.has(v)||(y.add(v),p.push(h))}t[4]=f.items,t[5]=d.items,t[6]=p}else p=t[6];const b=d.isInitialLoading||f.isInitialLoading,g=d.isLoadingMore||f.isLoadingMore,c=d.hasMore||f.hasMore;let n;t[7]!==f||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),f.hasMore&&f.fetchNextPage()},t[7]=f,t[8]=d,t[9]=n):n=t[9];const a=n;let i;return t[10]!==c||t[11]!==b||t[12]!==g||t[13]!==p||t[14]!==a?(i={items:p,hasMore:c,isLoadingMore:g,isInitialLoading:b,loadMore:a},t[10]=c,t[11]=b,t[12]=g,t[13]=p,t[14]=a,t[15]=i):i=t[15],i}function W(s){return A(s)}function Z(s){return!A(s)}function fe(s){const e=R.c(37),{connection:t,onClick:u,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:m,className:d,fallbackIcon:f}=s,p=l===void 0?!1:l,b=u&&"hover:bg-muted/50";let g;e[0]!==d||e[1]!==b?(g=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",b,d),e[0]=d,e[1]=b,e[2]=g):g=e[2];let c;e[3]!==t.icon||e[4]!==t.title||e[5]!==f?(c=x.jsx(V,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=t.icon,e[4]=t.title,e[5]=f,e[6]=c):c=e[6];let n;e[7]!==o||e[8]!==p?(n=o&&x.jsx("div",{className:E("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:J,children:o}),e[7]=o,e[8]=p,e[9]=n):n=e[9];let a;e[10]!==n?(a=x.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i=x.jsxs("div",{className:"flex items-start justify-between",children:[c,a]}),e[12]=c,e[13]=a,e[14]=i):i=e[14];let y;e[15]!==t.title?(y=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=y):y=e[16];const j=t.description||"No description";let h;e[17]!==j?(h=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=h):h=e[18];let v;e[19]!==h||e[20]!==y?(v=x.jsxs("div",{className:"flex flex-col gap-1",children:[y,h]}),e[19]=h,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==r?(C=r&&x.jsx("div",{children:r}),e[22]=r,e[23]=C):C=e[23];let I;e[24]!==v||e[25]!==C||e[26]!==i?(I=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,v,C]}),e[24]=v,e[25]=C,e[26]=i,e[27]=I):I=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:B,children:m})}),e[28]=m,e[29]=P):P=e[29];let N;e[30]!==I||e[31]!==P?(N=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,P]}),e[30]=I,e[31]=P,e[32]=N):N=e[32];let M;return e[33]!==u||e[34]!==N||e[35]!==g?(M=x.jsx(U,{className:g,onClick:u,children:N}),e[33]=u,e[34]=N,e[35]=g,e[36]=M):M=e[36],M}function B(s){return s.stopPropagation()}function J(s){return s.stopPropagation()}export{fe as C,ue as a,ae as g,ce as u};
@@ -1 +1 @@
1
- import{R as ge,aI as Ie,b6 as Ae,U as ce,aG as $e,e as P,j as t,l as je,B as G,r as X,c as ve,q as J,s as De,K as ne,f as Y,w as de,u as Pe,b7 as Oe,E as Me,g as ze,F as Ve,G as Ee,H as Ue,J as Fe,b8 as Re,o as Q,I as Le}from"./index-CHxlbuKY.js";import{g as He}from"./generate-id-BKVk8ACt.js";import{E as be}from"./empty-state-D3IZdm2e.js";import{E as Be,c as Ge,r as We,b as Xe,d as qe}from"./connection-form-helpers-ZyPV2_OX.js";import{c as Ke,S as Qe}from"./index-nja5uOPv.js";import{u as Ne,T as Je}from"./tools-list-Dm1utA0x.js";import{u as Ye}from"./use-members-DnfZ8tEp.js";import{A as Ze}from"./avatar-MwlGDSa1.js";import{a as ye,b as _e,u as et}from"./use-connection-_VO3kzZS.js";import{u as re,S as tt}from"./constants-7h1Iherr.js";import{b as st}from"./use-mcp-tools-BZZ0dcgP.js";import{g as ae,M as nt,a as ot}from"./types-ksHhVabW.js";import{a as it}from"./use-mcp-prompts-BIC4osYX.js";import{I as oe}from"./integration-icon-DsdPiq0I.js";import{s as rt}from"./Plus-DyGCHsAC.js";import{a as Se}from"./Settings02-DdSNGnuW.js";import{s as le}from"./Trash01-BWWRskAa.js";import{b as at,a as lt,d as ct,S as dt,c as mt}from"./sheet-B9dMT6Ki.js";import{F as R,b as L,c as H,d as V,f as B,e as ut,a as xt}from"./form-DZneHGBX.js";import{I as W}from"./input-BqbhwOOI.js";import{u as pt,D as ft}from"./use-delete-connection-DFb9AulP.js";import{V as ht}from"./layout-BNJzmBuH.js";import{c as gt,C as jt,B as vt,a as bt,b as Nt,d as yt,e as _t}from"./monitoring-stats-row-C5BKUj6s.js";import{a as St}from"./use-virtual-mcp-BaoT8VIh.js";import{i as Ce}from"./ChevronRight-CJPo14Wd.js";import{a as we}from"./Users03-DuD0whJZ.js";import{T as ee,a as Ct,b as te,c as wt}from"./tabs-B3X9vNsm.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as kt}from"./ZapSquare-D8HT6_jN.js";import{a3 as Tt,P as It}from"./agent-icon-WacEkBrp.js";import{b as At}from"./Tool01-Cgf_tMbK.js";import{C as $t}from"./collection-search-HZ4Ln7Q2.js";import{C as Dt}from"./card-BrXXg9xg.js";import{B as Pt}from"./badge-CDV4_k2B.js";import{D as Ot,a as Mt,b as zt,c as me}from"./dropdown-menu-CZNwXuzY.js";import{d as ue,S as xe,a as pe,b as fe,c as F}from"./select-Ci_D4qpL.js";import{i as Vt}from"./CheckCircle-Bt38xVIy.js";import{t as Et}from"./ChevronDown-BYvseX6e.js";import{n as Ut}from"./Container-Bgm498uR.js";import{s as se}from"./Star01-BWl4O-UT.js";import{s as Ft}from"./RefreshCcw01-DwuEW87g.js";import{s as Rt}from"./XClose-tPJB8Sgg.js";import"./collections-DltZgEAo.js";import"./ZoomOut-DvI5OdTo.js";import"./Key01-C484g3YO.js";import"./index-h-7ASBRq.js";import"./index-1DdOMz-0.js";import"./extract-connection-data-nTPi-bUk.js";import"./use-registry-connections-DnATENDO.js";import"./use-organization-settings-Dy_wvkUU.js";import"./index-BYABqu1-.js";import"./popover-CThu0-ID.js";import"./tooltip-BFGyTrfa.js";import"./Check-Bl0EnB2J.js";import"./SearchMd-BvLcLD4O.js";import"./use-create-virtual-mcp-DpiN_bgM.js";import"./use-navigate-to-agent-DWh1SzWc.js";import"./Eye-D-FtEtW8.js";import"./use-org-auth-client-CwWZc3xb.js";import"./User01-CL8jgZE5.js";import"./use-collections-hMeHX3z9.js";import"./X-Dnhh57X7.js";import"./label-DylEtHs-.js";import"./alert-dialog-DXWvjPm6.js";import"./index-CrU7PEoz.js";import"./sidebar-rRN-0AxT.js";import"./LayoutLeft-CnXQOO58.js";import"./AlertCircle-C2xmuErv.js";import"./SwitchHorizontal01-DL7oI9Hg.js";import"./XCircle-M_oWnCac.js";import"./ArrowUpRight-DY3nGAjH.js";import"./ChevronLeft-DoUOCEbQ.js";import"./ChevronUp-CoYKSGM9.js";import"./DotsVertical-DdI4UlQo.js";import"./Globe01-5KEfDt4K.js";import"./FilterLines-Bn2_q3W3.js";import"./Palette-BL7llRL5.js";import"./HardDrive-Bq_J68ys.js";import"./Stars02-BDvnLwBo.js";import"./LinkExternal01-DSXCOuPf.js";import"./Monitor01-DxGBVT7-.js";import"./Sun-BumCYr1L.js";import"./Play-COr2_UEr.js";import"./Shield01-B-jBzvZJ.js";import"./Stars01-cmM0sb2I.js";import"./Upload01-CufDtzzB.js";import"./Users01-DVvuBAcj.js";import"./Zap-C7nJc6zh.js";const Lt=ge({scopes:$e(ce()).describe("List of scopes available"),stateSchema:Ie(ce(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Ht=[{name:"MCP_CONFIGURATION",inputSchema:ge({}),outputSchema:Lt}];function Bt(s){const e=P.c(39),{instance:n,onConfigure:i,onAuthenticate:a,onDelete:o}=s;let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const c=Ne(r),d=!(n.connection_type==="VIRTUAL")&&c.supportsOAuth&&!c.isAuthenticated,u=d?"border-destructive/50 bg-destructive/5":"border-transparent";let p;e[2]!==u?(p=ve("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=p):p=e[3];let l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=l):l=e[6];let f;e[7]!==n.title?(f=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=f):f=e[8];let g;e[9]!==d?(g=d&&t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}),e[9]=d,e[10]=g):g=e[10];let v;e[11]!==f||e[12]!==g?(v=t.jsxs("div",{className:"flex-1 min-w-0",children:[f,g]}),e[11]=f,e[12]=g,e[13]=v):v=e[13];let b;e[14]!==n||e[15]!==d||e[16]!==a?(b=d&&t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:"Authorize"}),e[14]=n,e[15]=d,e[16]=a,e[17]=b):b=e[17];let j;e[18]!==n||e[19]!==i?(j=()=>i(n),e[18]=n,e[19]=i,e[20]=j):j=e[20];let _;e[21]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Se,{size:13}),e[21]=_):_=e[21];let w;e[22]!==j?(w=t.jsx(G,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,title:"Configure",children:_}),e[22]=j,e[23]=w):w=e[23];let S;e[24]!==n||e[25]!==o?(S=()=>o(n),e[24]=n,e[25]=o,e[26]=S):S=e[26];let N;e[27]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(le,{size:13}),e[27]=N):N=e[27];let k;e[28]!==S?(k=t.jsx(G,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:S,title:"Delete",children:N}),e[28]=S,e[29]=k):k=e[29];let y;e[30]!==w||e[31]!==k||e[32]!==b?(y=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[b,w,k]}),e[30]=w,e[31]=k,e[32]=b,e[33]=y):y=e[33];let C;return e[34]!==y||e[35]!==p||e[36]!==l||e[37]!==v?(C=t.jsxs("div",{className:p,children:[l,v,y]}),e[34]=y,e[35]=p,e[36]=l,e[37]=v,e[38]=C):C=e[38],C}function Gt(s){const e=P.c(15),{instance:n,onConfigure:i}=s;let a;e[0]!==n.icon||e[1]!==n.title?(a=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=a):a=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let r;e[5]!==n||e[6]!==i?(r=()=>i(n),e[5]=n,e[6]=i,e[7]=r):r=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Se,{size:13}),e[8]=c):c=e[8];let m;e[9]!==r?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(G,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:r,title:"Configure",children:c})}),e[9]=r,e[10]=m):m=e[10];let d;return e[11]!==a||e[12]!==o||e[13]!==m?(d=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[a,o,m]}),e[11]=a,e[12]=o,e[13]=m,e[14]=d):d=e[14],d}function Wt(s){const e=P.c(25),{instances:n,onConfigure:i,onAuthenticate:a,onDelete:o,onAdd:r,isAdding:c}=s;if(n.length===0)return null;const m=n.length===1?"Instance":"Instances";let d;e[0]!==m?(d=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:m}),e[0]=m,e[1]=d):d=e[1];let u;e[2]!==c?(u=c?t.jsx(je,{size:13,className:"animate-spin"}):t.jsx(rt,{size:13}),e[2]=c,e[3]=u):u=e[3];let p;e[4]!==c||e[5]!==r||e[6]!==u?(p=t.jsxs(G,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:r,disabled:c,children:[u,"Add instance"]}),e[4]=c,e[5]=r,e[6]=u,e[7]=p):p=e[7];let l;e[8]!==d||e[9]!==p?(l=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[d,p]}),e[8]=d,e[9]=p,e[10]=l):l=e[10];let f;if(e[11]!==n||e[12]!==a||e[13]!==i||e[14]!==o){let b;e[16]!==a||e[17]!==i||e[18]!==o?(b=j=>t.jsx(X.Suspense,{fallback:t.jsx(Gt,{instance:j,onConfigure:i}),children:t.jsx(Bt,{instance:j,onConfigure:i,onAuthenticate:a,onDelete:o})},j.id),e[16]=a,e[17]=i,e[18]=o,e[19]=b):b=e[19],f=n.map(b),e[11]=n,e[12]=a,e[13]=i,e[14]=o,e[15]=f}else f=e[15];let g;e[20]!==f?(g=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:f}),e[20]=f,e[21]=g):g=e[21];let v;return e[22]!==l||e[23]!==g?(v=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,g]}),e[22]=l,e[23]=g,e[24]=v):v=e[24],v}const Xt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function qt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Kt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Qt(s){const e=P.c(4),{connectionId:n,orgId:i,orgSlug:a,timeframe:o}=s;let r;e[0]!==i||e[1]!==a?(r={connectionId:tt,orgId:i,orgSlug:a},e[0]=i,e[1]=a,e[2]=r):r=e[2];const c=re(r),m=qt(o),{data:d}=De({queryKey:ne.connectionActivity(n,o,i),queryFn:async()=>{const g=await c.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:m.startDate.toISOString(),endDate:m.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return g.structuredContent??g},staleTime:3e5}),u=gt(d?.logs??[],m),p=u.data,l=u.totalCalls>0;let f;return e[3]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[3]=f):f=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:u.totalCalls.toLocaleString()}),f]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),l?t.jsxs("div",{children:[t.jsx(jt,{config:Kt,className:"h-16 w-full",children:t.jsxs(vt,{data:p,barCategoryGap:"4%",children:[t.jsx(bt,{content:t.jsx(Nt,{labelFormatter:Yt}),cursor:{fill:"var(--muted)"}}),t.jsx(yt,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:p.map(Jt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[p.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Jt(s,e){return t.jsx(_t,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function Yt(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function Zt(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function es(s){const e=P.c(14),{connectionId:n}=s,[i,a]=X.useState("14d"),{org:o}=J();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=r):r=e[0];let c;e[1]!==i?(c=Xt.map(l=>t.jsx("button",{type:"button",onClick:()=>a(l.value),className:ve("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",i===l.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:l.label},l.value)),e[1]=i,e[2]=c):c=e[2];let m;e[3]!==c?(m=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:c})]}),e[3]=c,e[4]=m):m=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Zt,{}),e[5]=d):d=e[5];let u;e[6]!==n||e[7]!==o.id||e[8]!==o.slug||e[9]!==i?(u=t.jsx(X.Suspense,{fallback:d,children:t.jsx(Qt,{connectionId:n,orgId:o.id,orgSlug:o.slug,timeframe:i})}),e[6]=n,e[7]=o.id,e[8]=o.slug,e[9]=i,e[10]=u):u=e[10];let p;return e[11]!==m||e[12]!==u?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,u]}),e[11]=m,e[12]=u,e[13]=p):p=e[13],p}function ts(s){const e=P.c(15),{virtualMcp:n,org:i}=s,a=Y();let o;e[0]!==a||e[1]!==i||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();a({to:"/$org/$taskId",params:{org:i,taskId:p},search:{virtualmcpid:n.id}})},e[0]=a,e[1]=i,e[2]=n.id,e[3]=o):o=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(we,{size:16}),e[4]=r):r=e[4];let c;e[5]!==n.icon||e[6]!==n.title?(c=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:r}),e[5]=n.icon,e[6]=n.title,e[7]=c):c=e[7];let m;e[8]!==n.title?(m=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=m):m=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==o||e[12]!==c||e[13]!==m?(u=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[c,m,d]}),e[11]=o,e[12]=c,e[13]=m,e[14]=u):u=e[14],u}function ss(s){const e=P.c(7),{virtualMcps:n,org:i}=s;let a;if(e[0]!==i||e[1]!==n){let r;e[3]!==i?(r=c=>t.jsx(ts,{virtualMcp:c,org:i},c.id),e[3]=i,e[4]=r):r=e[4],a=n.map(r),e[0]=i,e[1]=n,e[2]=a}else a=e[2];let o;return e[5]!==a?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=o):o=e[6],o}function ns(s){const e=P.c(7),{connection:n}=s,{org:i}=J();let a;e[0]!==n.id?(a={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=a):a=e[1];const o=St(a);if(!(o.length>0)){let d;return e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(t.Fragment,{}),e[2]=d):d=e[2],d}let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=c):c=e[3];let m;return e[4]!==i.slug||e[5]!==o?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[c,t.jsx("div",{className:"px-5 py-4",children:t.jsx(ss,{virtualMcps:o,org:i.slug})})]}),e[4]=i.slug,e[5]=o,e[6]=m):m=e[6],m}function os(s){const e=P.c(31),{tools:n,connectionId:i,org:a}=s,o=Y(),{org:r}=J();let c;e[0]!==i||e[1]!==r.id||e[2]!==r.slug?(c={connectionId:i,orgId:r.id,orgSlug:r.slug},e[0]=i,e[1]=r.id,e[2]=r.slug,e[3]=c):c=e[3];const m=re(c),d=ye(i);let u;e[4]!==d||e[5]!==i?(u=d?ke(d):i,e[4]=d,e[5]=i,e[6]=u):u=e[6];const p=u,[l,f]=X.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==m||e[9]!==o||e[10]!==a||e[11]!==l||e[12]!==n){const S=(n??[]).filter(is),N=l.toLowerCase().trim(),k=N?S.filter(h=>h.name.toLowerCase().includes(N)||h.description&&h.description.toLowerCase().includes(N)):S;let y;e[17]!==p||e[18]!==o||e[19]!==a?(y=h=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(h.name)}})},e[17]=p,e[18]=o,e[19]=a,e[20]=y):y=e[20];const C=y;b="flex flex-col h-full overflow-hidden";let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[21]=I):I=e[21],e[22]!==l?(j=t.jsx($t,{value:l,onChange:f,placeholder:"Search apps...",onKeyDown:I}),e[22]=l,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=k.length===0?t.jsx(be,{image:null,title:l?"No apps found":"No apps available",description:l?"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:k.map(h=>{const A=ae(h._meta);return t.jsxs(Dt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>C(h),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(nt,{resourceURI:A,toolInfo:{tool:h},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),t.jsx(Je,{annotations:h.annotations,_meta:h._meta})]}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]})]},h.name)})}),e[7]=p,e[8]=m,e[9]=o,e[10]=a,e[11]=l,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let _;e[24]!==g||e[25]!==v?(_=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=_):_=e[26];let w;return e[27]!==b||e[28]!==j||e[29]!==_?(w=t.jsxs("div",{className:b,children:[j,_]}),e[27]=b,e[28]=j,e[29]=_,e[30]=w):w=e[30],w}function is(s){return!!ae(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=r=>r.charAt(0).toUpperCase()+r.slice(1),i=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),o=e[e.length-1];return a.length>=2&&o&&i.has(o)?[a.pop(),...a].join(" "):a.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=i):i=e[1],i}function rs(s){const e=P.c(50),{tools:n,prompts:i,resources:a,connectionId:o,org:r}=s;let c;e[0]!==i?(c=i===void 0?[]:i,e[0]=i,e[1]=c):c=e[1];const m=c;let d;e[2]!==a?(d=a===void 0?[]:a,e[2]=a,e[3]=d):d=e[3];const u=d,p=Y(),l=ye(o??"");let f;e[4]!==l||e[5]!==o?(f=l?ke(l):o,e[4]=l,e[5]=o,e[6]=f):f=e[6];const g=f;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==r?(v=function($){!o||!r||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:g,collectionName:"tools",itemId:encodeURIComponent($)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=r,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==r||e[14]!==n?(j=o&&r&&n.some(cs),e[12]=o,e[13]=r,e[14]=n,e[15]=j):j=e[15];const _=j;if(n.length+m.length+u.length===0){let x;return e[16]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=x):x=e[16],x}let S;e[17]!==n.length?(S=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=S):S=e[18];let N;e[19]!==_?(N=_&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=_,e[20]=N):N=e[20];let k,y;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),y=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=k,e[22]=y):(k=e[21],y=e[22]);let C;e[23]!==S||e[24]!==N?(C=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Ct,{variant:"underline",className:"gap-1",children:[S,N,k,y]})}),e[23]=S,e[24]=N,e[25]=C):C=e[25];let I;e[26]!==b||e[27]!==n?(I=n.length>0?n.map(x=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>b(x.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(At,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(x.name)}),x.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:x.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},x.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=I):I=e[28];let h;e[29]!==I?(h=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:I})}),e[29]=I,e[30]=h):h=e[30];let A;e[31]!==o||e[32]!==_||e[33]!==r||e[34]!==n?(A=_&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(os,{tools:n,connectionId:o,org:r})}),e[31]=o,e[32]=_,e[33]=r,e[34]=n,e[35]=A):A=e[35];let M;e[36]!==m?(M=m.length>0?m.map(ls):t.jsx(ie,{label:"prompts"}),e[36]=m,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let T;e[40]!==u?(T=u.length>0?u.map(as):t.jsx(ie,{label:"resources"}),e[40]=u,e[41]=T):T=e[41];let z;e[42]!==T?(z=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:T})}),e[42]=T,e[43]=z):z=e[43];let E;return e[44]!==C||e[45]!==h||e[46]!==A||e[47]!==O||e[48]!==z?(E=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(wt,{defaultValue:"tools",variant:"underline",children:[C,h,A,O,z]})}),e[44]=C,e[45]=h,e[46]=A,e[47]=O,e[48]=z,e[49]=E):E=e[49],E}function as(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Tt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function ls(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(kt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function cs(s){return ae(s._meta)}function ds(s){const e=P.c(13),{connection:n,displayTitle:i}=s,a=i??n.title;let o;e[0]!==n.icon||e[1]!==a?(o=t.jsx(oe,{icon:n.icon,name:a,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=o):o=e[2];let r;e[3]!==a?(r=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:a})}),e[3]=a,e[4]=r):r=e[4];let c;e[5]!==n.description?(c=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=c):c=e[6];let m;e[7]!==r||e[8]!==c?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[r,c]}),e[7]=r,e[8]=c,e[9]=m):m=e[9];let d;return e[10]!==o||e[11]!==m?(d=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,m]}),e[10]=o,e[11]=m,e[12]=d):d=e[12],d}function ms({form:s,connection:e,hasOAuthToken:n,onReauthenticate:i,onRemoveOAuth:a}){const o=de({control:s.control,name:"ui_type"}),r=de({control:s.control,name:"connection_url"}),{stdioEnabled:c}=Pe(),m=(()=>{if(typeof r!="string"||!r)return!1;try{const l=new URL(r);return l.hostname==="api.githubcopilot.com"&&l.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),d=c||e.connection_type==="STDIO",u=e.connection_type==="VIRTUAL",p=u?Oe(e.connection_url):null;return u?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(we,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(R,{control:s.control,name:"ui_type",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(ue,{value:l.value,onValueChange:l.onChange,children:[t.jsx(V,{children:t.jsxs(xe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(pe,{})]})}),t.jsxs(fe,{children:[t.jsx(F,{value:"HTTP",children:"HTTP"}),t.jsx(F,{value:"SSE",children:"SSE"}),t.jsx(F,{value:"Websocket",children:"Websocket"}),d&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:"NPX Package"}),t.jsx(F,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(R,{control:s.control,name:"connection_url",render:({field:f})=>t.jsx(L,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(W,{placeholder:"https://example.com/mcp",...f,value:f.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(ue,{value:l.value,onValueChange:l.onChange,children:[t.jsx(V,{children:t.jsx(xe,{className:"h-10",children:t.jsx(pe,{})})}),t.jsxs(fe,{children:[t.jsx(F,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(F,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(F,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),d&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(F,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(It,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(B,{})]})}),o==="NPX"&&t.jsx(R,{control:s.control,name:"npx_package",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(V,{children:t.jsx(W,{placeholder:"@perplexity-ai/mcp-server",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(R,{control:s.control,name:"stdio_command",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(V,{children:t.jsx(W,{placeholder:"node, bun, python...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),t.jsx(R,{control:s.control,name:"stdio_args",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(V,{children:t.jsx(W,{placeholder:"arg1 arg2 --flag value",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(B,{})]})})]}),t.jsx(R,{control:s.control,name:"stdio_cwd",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(V,{children:t.jsx(W,{placeholder:"/path/to/project (optional)",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(R,{control:s.control,name:"env_vars",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(V,{children:t.jsx(Be,{value:l.value??[],onChange:l.onChange})}),t.jsx(B,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(R,{control:s.control,name:"connection_token",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:m?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ot,{children:[t.jsx(Mt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Pt,{variant:"success",className:"gap-1.5",children:[t.jsx(Vt,{size:12}),"Authenticated via OAuth",t.jsx(Et,{size:12})]})})}),t.jsxs(zt,{align:"start",children:[t.jsxs(me,{onClick:i,children:[t.jsx(Ft,{size:16}),"Re-authenticate"]}),t.jsxs(me,{variant:"destructive",onClick:a,children:[t.jsx(le,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&l.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>l.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Rt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(W,{type:"password",placeholder:m?"Paste your GitHub PAT":"Enter access token...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(ut,{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(B,{})]})})]})}function us(s){return s.command==="npx"}function xs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function ps(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function he(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Re(s.connection_headers)){const i=s.connection_headers,a=We(i.envVars);if(us(i)){const r=xs(i);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:r,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const o=ps(i);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:a}}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 fs(s){let e,n=null,i=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=Xe(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=qe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",i=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...i&&{connection_token:i},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function hs({connection:s,connectionId:e,org:n,isUpdating:i,tools:a,prompts:o,resources:r,siblings:c}){const m=Y({from:"/$org/settings/connections/$appSlug"}),d=Ve(),u=_e(),{org:p}=J(),l=pt({onSuccess:()=>{c.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[f,g]=X.useState(null),[v,b]=X.useState(!1),j=Ne({connectionId:e}),{data:_}=Ye(),w=_?.data?.members??[],S=f??s,N=w.find(x=>x.userId===S.created_by),y=s?.connection_type==="VIRTUAL"||j.isAuthenticated,C={...s,tools:a},I=Ke(C,Ht),h=Ee({resolver:Ue(Ge),values:he(f??s)}),A=h.formState.isDirty,M=async()=>{if(!await h.trigger())return;const $=h.getValues(),D=fs($),U=f?.id??e;await u.update.mutateAsync({id:U,data:D}),h.reset($)},O=()=>{h.reset(he(f??s))},T=async x=>{const{token:$,tokenInfo:D,error:U}=await Le({connectionId:x,orgSlug:p.slug,scope:"offline_access"});if(U||!$){Q.error(`Authentication failed: ${U}`);return}if(D)try{const q=await fetch(`/api/${p.slug}/connections/${x}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!q.ok)console.error("Failed to save OAuth token:",await q.text()),await u.update.mutateAsync({id:x,data:{connection_token:$}});else try{await u.update.mutateAsync({id:x,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(q){console.error("Error saving OAuth token:",q),await u.update.mutateAsync({id:x,data:{connection_token:$}})}else await u.update.mutateAsync({id:x,data:{connection_token:$}});const K=new URL(`/api/${p.slug}/mcp/${x}`,window.location.origin);await d.invalidateQueries({queryKey:ne.isMCPAuthenticated(K.href,null)}),await d.invalidateQueries({queryKey:ne.mcpClientPrefix()}),Q.success("Authentication successful")},z=()=>T(s.id),E=async()=>{try{const x=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!x.ok){const D=await x.text();Q.error(`Failed to remove OAuth: ${D}`);return}const $=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await d.invalidateQueries({queryKey:ne.isMCPAuthenticated($.href,null)}),Q.success("OAuth removed. You can now re-authenticate with a different account.")}catch(x){console.error("Error removing OAuth token:",x),Q.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(ft,{...l}),t.jsx(at,{open:f!==null,onOpenChange:x=>{x||g(null)},children:t.jsxs(lt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(ct,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(dt,{className:"text-base",children:f?.title??s.title}),t.jsx(mt,{className:"text-xs",children:"Update URL, authentication, and other settings"}),N&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ze,{url:N.user?.image??void 0,fallback:N.user?.name??N.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:N.user?.name||N.user?.email})]})]}),t.jsxs(xt,{...h,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(R,{control:h.control,name:"title",render:({field:x})=>t.jsxs(L,{children:[t.jsx(H,{children:"Name"}),t.jsx(V,{children:t.jsx(W,{...x})}),t.jsx(B,{})]})}),t.jsx(R,{control:h.control,name:"description",render:({field:x})=>t.jsxs(L,{children:[t.jsx(H,{children:"Description"}),t.jsx(V,{children:t.jsx(W,{...x,value:x.value||""})}),t.jsx(B,{})]})})]}),t.jsx(ms,{form:h,connection:f??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:z,onRemoveOAuth:E}),t.jsx(Qe,{connection:f??s,form:h,hasMcpBinding:I,isMCPAuthenticated:y,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:z,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(G,{onClick:M,disabled:!A||i,className:"flex-1",children:i?"Saving…":"Save changes"}),A&&t.jsx(G,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(G,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const x=f??s;g(null),l.requestDelete(x)},children:[t.jsx(le,{size:15}),"Delete"]})]})]},f?.id??s.id)]})}),t.jsx(ht,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(ds,{connection:s,displayTitle:(()=>{const x=c[0]??s;return x.app_name?x.title.replace(/\s*\(\d+\)\s*$/,""):x.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(es,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Wt,{instances:c,onConfigure:x=>g(x),onAuthenticate:x=>T(x.id),onDelete:x=>l.requestDelete(x),isAdding:v,onAdd:async()=>{b(!0);try{const x=c[0]??s,$=x.title.replace(/\s*\(\d+\)\s*$/,""),D=c.length+1,U=`${$} (${D})`,K=He("conn");await u.create.mutateAsync({id:K,title:U,description:x.description??null,connection_type:x.connection_type,connection_url:x.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:x.created_by,organization_id:x.organization_id,icon:x.icon??null,app_name:x.app_name??null,app_id:x.app_id??null,connection_headers:x.connection_headers??null,oauth_config:null,configuration_state:x.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const q=new URL(`/api/${p.slug}/mcp/${K}`,window.location.origin),Z=await Fe({url:q.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await T(K)}finally{b(!1)}}}),t.jsx(ns,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(rs,{tools:a,prompts:o,resources:r,connectionId:e,org:n})})]})})]})})]})}function gs(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);let i;s[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/settings/connections/$appSlug"},s[1]=i):i=s[1];const{appSlug:a,org:o}=ze(i),{org:r}=J(),c=_e();let m;s[2]!==a?(m={slug:a},s[2]=a,s[3]=m):m=s[3];const d=et(m),u=d[0]??null,p=u?.id??"",l=p||null;let f;s[4]!==r.id||s[5]!==r.slug||s[6]!==l?(f={connectionId:l,orgId:r.id,orgSlug:r.slug},s[4]=r.id,s[5]=r.slug,s[6]=l,s[7]=f):f=s[7];const g=re(f);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=st(v);let j;if(s[10]!==u?.tools||s[11]!==p||s[12]!==d||s[13]!==b){const T=b?b.tools.map(_s):(u?.tools??[]).map(ys);e:{if(d.length<=1){j=T;break e}const z=new Set,E=[],x=bs;for(const $ of d){const D=$.id===p?T:x($.tools);for(const U of D)z.has(U.name)||(z.add(U.name),E.push(U))}j=E.length>0?E:T}s[10]=u?.tools,s[11]=p,s[12]=d,s[13]=b,s[14]=j}else j=s[14];const _=j;let w;s[15]!==g?(w={client:g},s[15]=g,s[16]=w):w=s[16];const{data:S}=it(w);let N;s[17]!==g?(N={client:g},s[17]=g,s[18]=N):N=s[18];const{data:k}=ot(N);let y;s[19]!==S?.prompts?(y=S?.prompts??[],s[19]=S?.prompts,s[20]=y):y=s[20];let C;s[21]!==y?(C=y.map(vs),s[21]=y,s[22]=C):C=s[22];const I=C;let h;s[23]!==k?.resources?(h=k?.resources??[],s[23]=k?.resources,s[24]=h):h=s[24];let A;s[25]!==h?(A=h.map(js),s[25]=h,s[26]=A):A=s[26];const M=A;if(!u){let T;return s[27]!==n||s[28]!==o?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(be,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(G,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=T):T=s[29],T}let O;return s[30]!==c.update.isPending||s[31]!==_||s[32]!==u||s[33]!==p||s[34]!==o||s[35]!==I||s[36]!==M||s[37]!==d?(O=t.jsx(hs,{org:o,connection:u,connectionId:p,isUpdating:c.update.isPending,tools:_,prompts:I,resources:M,siblings:d}),s[30]=c.update.isPending,s[31]=_,s[32]=u,s[33]=p,s[34]=o,s[35]=I,s[36]=M,s[37]=d,s[38]=O):O=s[38],O}function js(s){return{name:s.name,description:s.description,uri:s.uri}}function vs(s){return{name:s.name,description:s.description}}function bs(s){return(s??[]).map(Ns)}function Ns(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ys(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function _s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ss(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Me,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(gs,{})})}),s[0]=e):e=s[0],e}function ro(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ss,{}),s[0]=e):e=s[0],e}export{ro as default};
1
+ import{R as ge,aI as Ie,b6 as Ae,U as ce,aG as $e,e as P,j as t,l as je,B as G,r as X,c as ve,q as J,s as De,K as ne,f as Y,w as de,u as Pe,b7 as Oe,E as Me,g as ze,F as Ve,G as Ee,H as Ue,J as Fe,b8 as Re,o as Q,I as Le}from"./index-C4HbvW_W.js";import{g as He}from"./generate-id-CdwRTiX7.js";import{E as be}from"./empty-state-BLunjf1m.js";import{E as Be,c as Ge,r as We,b as Xe,d as qe}from"./connection-form-helpers-BSgnmPKP.js";import{c as Ke,S as Qe}from"./index-BYSwFuRs.js";import{u as Ne,T as Je}from"./tools-list-CZ0YST_J.js";import{u as Ye}from"./use-members-DZ4oSOx-.js";import{A as Ze}from"./avatar-dR7ViKE5.js";import{a as ye,b as _e,u as et}from"./use-connection-DjURtMK5.js";import{u as re,S as tt}from"./constants-B521j7ay.js";import{b as st}from"./use-mcp-tools-DCbS4kMk.js";import{g as ae,M as nt,a as ot}from"./types-DP-Q3z5y.js";import{a as it}from"./use-mcp-prompts-BNFsBgD1.js";import{I as oe}from"./integration-icon-C7p8BtkI.js";import{s as rt}from"./Plus-Tnr53r7A.js";import{a as Se}from"./Settings02-DhqQsm8K.js";import{s as le}from"./Trash01-CZeQBZf_.js";import{b as at,a as lt,d as ct,S as dt,c as mt}from"./sheet-D9aXq4ta.js";import{F as R,b as L,c as H,d as V,f as B,e as ut,a as xt}from"./form-BIWGXIbK.js";import{I as W}from"./input-B5k-Hbp3.js";import{u as pt,D as ft}from"./use-delete-connection-CjdkJ1LG.js";import{V as ht}from"./layout-BMq59AVz.js";import{c as gt,C as jt,B as vt,a as bt,b as Nt,d as yt,e as _t}from"./monitoring-stats-row-VdVj1bTz.js";import{a as St}from"./use-virtual-mcp-By6PZUzg.js";import{i as Ce}from"./ChevronRight-BVo14pyp.js";import{a as we}from"./Users03-DbJl-FlT.js";import{T as ee,a as Ct,b as te,c as wt}from"./tabs-52tGcLiU.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as kt}from"./ZapSquare-xDebNl-H.js";import{a3 as Tt,P as It}from"./agent-icon-BzrzSnAz.js";import{b as At}from"./Tool01-yp4kJRUu.js";import{C as $t}from"./collection-search-DYrAflR5.js";import{C as Dt}from"./card-DjJMgfjm.js";import{B as Pt}from"./badge-REAPd24g.js";import{D as Ot,a as Mt,b as zt,c as me}from"./dropdown-menu-2uydtPAy.js";import{d as ue,S as xe,a as pe,b as fe,c as F}from"./select-DPygLpWH.js";import{i as Vt}from"./CheckCircle-Bjdxpj1j.js";import{t as Et}from"./ChevronDown-DBeUwQYn.js";import{n as Ut}from"./Container-BoahFo7F.js";import{s as se}from"./Star01-sX328yCS.js";import{s as Ft}from"./RefreshCcw01-Cv0pFCb4.js";import{s as Rt}from"./XClose-DNgFZbzC.js";import"./collections-UXWGkaFt.js";import"./ZoomOut-CrlW2TUB.js";import"./Key01-o0EwVLiR.js";import"./index-CgoPiptB.js";import"./index-C1MLUCFq.js";import"./extract-connection-data-aP9VrOhv.js";import"./use-registry-connections-KEGYdtt_.js";import"./use-organization-settings-difToZl3.js";import"./index-CuEl7ZCd.js";import"./popover-CFPzrMHB.js";import"./tooltip-DgiqborV.js";import"./Check-7lFZ8X77.js";import"./SearchMd-UxzEV07r.js";import"./use-create-virtual-mcp-GqhamUF-.js";import"./use-navigate-to-agent-DwD_R1XG.js";import"./Eye-DkuHnUAW.js";import"./use-org-auth-client-v3u1LDk5.js";import"./User01-DW9hMolk.js";import"./use-collections-CFs8myDl.js";import"./X-BH0VE8jB.js";import"./label-BvvzAAWu.js";import"./alert-dialog-D0lyxgq7.js";import"./index-2xBvfJLJ.js";import"./sidebar-DB4iKQD5.js";import"./LayoutLeft-CD_Gf1ZP.js";import"./AlertCircle-PL6o_BFM.js";import"./SwitchHorizontal01-B9vZRv9t.js";import"./XCircle-DLzFRLwJ.js";import"./ArrowUpRight-D0PaRtUX.js";import"./ChevronLeft-CPLLwlIr.js";import"./ChevronUp-XvIiv-NV.js";import"./DotsVertical-ntZiwo0t.js";import"./Globe01-CcGroxBm.js";import"./FilterLines-DgBfCVyf.js";import"./Palette-CrqqEUcE.js";import"./HardDrive-C4j857Fq.js";import"./Stars02-f0XE-eqW.js";import"./LinkExternal01-BrUoXKJY.js";import"./Monitor01-D61B3ma3.js";import"./Sun-PyN_Wt4r.js";import"./Play-UJPgqc1U.js";import"./Shield01-DpLC5M3q.js";import"./Stars01-Dv9c4Cee.js";import"./Upload01-SHM-fhC7.js";import"./Users01-D2wb7idE.js";import"./Zap-DplWtEq0.js";const Lt=ge({scopes:$e(ce()).describe("List of scopes available"),stateSchema:Ie(ce(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Ht=[{name:"MCP_CONFIGURATION",inputSchema:ge({}),outputSchema:Lt}];function Bt(s){const e=P.c(39),{instance:n,onConfigure:i,onAuthenticate:a,onDelete:o}=s;let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const c=Ne(r),d=!(n.connection_type==="VIRTUAL")&&c.supportsOAuth&&!c.isAuthenticated,u=d?"border-destructive/50 bg-destructive/5":"border-transparent";let p;e[2]!==u?(p=ve("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=p):p=e[3];let l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=l):l=e[6];let f;e[7]!==n.title?(f=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=f):f=e[8];let g;e[9]!==d?(g=d&&t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}),e[9]=d,e[10]=g):g=e[10];let v;e[11]!==f||e[12]!==g?(v=t.jsxs("div",{className:"flex-1 min-w-0",children:[f,g]}),e[11]=f,e[12]=g,e[13]=v):v=e[13];let b;e[14]!==n||e[15]!==d||e[16]!==a?(b=d&&t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:"Authorize"}),e[14]=n,e[15]=d,e[16]=a,e[17]=b):b=e[17];let j;e[18]!==n||e[19]!==i?(j=()=>i(n),e[18]=n,e[19]=i,e[20]=j):j=e[20];let _;e[21]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Se,{size:13}),e[21]=_):_=e[21];let w;e[22]!==j?(w=t.jsx(G,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,title:"Configure",children:_}),e[22]=j,e[23]=w):w=e[23];let S;e[24]!==n||e[25]!==o?(S=()=>o(n),e[24]=n,e[25]=o,e[26]=S):S=e[26];let N;e[27]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(le,{size:13}),e[27]=N):N=e[27];let k;e[28]!==S?(k=t.jsx(G,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:S,title:"Delete",children:N}),e[28]=S,e[29]=k):k=e[29];let y;e[30]!==w||e[31]!==k||e[32]!==b?(y=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[b,w,k]}),e[30]=w,e[31]=k,e[32]=b,e[33]=y):y=e[33];let C;return e[34]!==y||e[35]!==p||e[36]!==l||e[37]!==v?(C=t.jsxs("div",{className:p,children:[l,v,y]}),e[34]=y,e[35]=p,e[36]=l,e[37]=v,e[38]=C):C=e[38],C}function Gt(s){const e=P.c(15),{instance:n,onConfigure:i}=s;let a;e[0]!==n.icon||e[1]!==n.title?(a=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=a):a=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let r;e[5]!==n||e[6]!==i?(r=()=>i(n),e[5]=n,e[6]=i,e[7]=r):r=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Se,{size:13}),e[8]=c):c=e[8];let m;e[9]!==r?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(G,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:r,title:"Configure",children:c})}),e[9]=r,e[10]=m):m=e[10];let d;return e[11]!==a||e[12]!==o||e[13]!==m?(d=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[a,o,m]}),e[11]=a,e[12]=o,e[13]=m,e[14]=d):d=e[14],d}function Wt(s){const e=P.c(25),{instances:n,onConfigure:i,onAuthenticate:a,onDelete:o,onAdd:r,isAdding:c}=s;if(n.length===0)return null;const m=n.length===1?"Instance":"Instances";let d;e[0]!==m?(d=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:m}),e[0]=m,e[1]=d):d=e[1];let u;e[2]!==c?(u=c?t.jsx(je,{size:13,className:"animate-spin"}):t.jsx(rt,{size:13}),e[2]=c,e[3]=u):u=e[3];let p;e[4]!==c||e[5]!==r||e[6]!==u?(p=t.jsxs(G,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:r,disabled:c,children:[u,"Add instance"]}),e[4]=c,e[5]=r,e[6]=u,e[7]=p):p=e[7];let l;e[8]!==d||e[9]!==p?(l=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[d,p]}),e[8]=d,e[9]=p,e[10]=l):l=e[10];let f;if(e[11]!==n||e[12]!==a||e[13]!==i||e[14]!==o){let b;e[16]!==a||e[17]!==i||e[18]!==o?(b=j=>t.jsx(X.Suspense,{fallback:t.jsx(Gt,{instance:j,onConfigure:i}),children:t.jsx(Bt,{instance:j,onConfigure:i,onAuthenticate:a,onDelete:o})},j.id),e[16]=a,e[17]=i,e[18]=o,e[19]=b):b=e[19],f=n.map(b),e[11]=n,e[12]=a,e[13]=i,e[14]=o,e[15]=f}else f=e[15];let g;e[20]!==f?(g=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:f}),e[20]=f,e[21]=g):g=e[21];let v;return e[22]!==l||e[23]!==g?(v=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,g]}),e[22]=l,e[23]=g,e[24]=v):v=e[24],v}const Xt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function qt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Kt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Qt(s){const e=P.c(4),{connectionId:n,orgId:i,orgSlug:a,timeframe:o}=s;let r;e[0]!==i||e[1]!==a?(r={connectionId:tt,orgId:i,orgSlug:a},e[0]=i,e[1]=a,e[2]=r):r=e[2];const c=re(r),m=qt(o),{data:d}=De({queryKey:ne.connectionActivity(n,o,i),queryFn:async()=>{const g=await c.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:m.startDate.toISOString(),endDate:m.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return g.structuredContent??g},staleTime:3e5}),u=gt(d?.logs??[],m),p=u.data,l=u.totalCalls>0;let f;return e[3]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[3]=f):f=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:u.totalCalls.toLocaleString()}),f]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),l?t.jsxs("div",{children:[t.jsx(jt,{config:Kt,className:"h-16 w-full",children:t.jsxs(vt,{data:p,barCategoryGap:"4%",children:[t.jsx(bt,{content:t.jsx(Nt,{labelFormatter:Yt}),cursor:{fill:"var(--muted)"}}),t.jsx(yt,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:p.map(Jt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[p.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Jt(s,e){return t.jsx(_t,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function Yt(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function Zt(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function es(s){const e=P.c(14),{connectionId:n}=s,[i,a]=X.useState("14d"),{org:o}=J();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=r):r=e[0];let c;e[1]!==i?(c=Xt.map(l=>t.jsx("button",{type:"button",onClick:()=>a(l.value),className:ve("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",i===l.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:l.label},l.value)),e[1]=i,e[2]=c):c=e[2];let m;e[3]!==c?(m=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:c})]}),e[3]=c,e[4]=m):m=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Zt,{}),e[5]=d):d=e[5];let u;e[6]!==n||e[7]!==o.id||e[8]!==o.slug||e[9]!==i?(u=t.jsx(X.Suspense,{fallback:d,children:t.jsx(Qt,{connectionId:n,orgId:o.id,orgSlug:o.slug,timeframe:i})}),e[6]=n,e[7]=o.id,e[8]=o.slug,e[9]=i,e[10]=u):u=e[10];let p;return e[11]!==m||e[12]!==u?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,u]}),e[11]=m,e[12]=u,e[13]=p):p=e[13],p}function ts(s){const e=P.c(15),{virtualMcp:n,org:i}=s,a=Y();let o;e[0]!==a||e[1]!==i||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();a({to:"/$org/$taskId",params:{org:i,taskId:p},search:{virtualmcpid:n.id}})},e[0]=a,e[1]=i,e[2]=n.id,e[3]=o):o=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(we,{size:16}),e[4]=r):r=e[4];let c;e[5]!==n.icon||e[6]!==n.title?(c=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:r}),e[5]=n.icon,e[6]=n.title,e[7]=c):c=e[7];let m;e[8]!==n.title?(m=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=m):m=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==o||e[12]!==c||e[13]!==m?(u=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[c,m,d]}),e[11]=o,e[12]=c,e[13]=m,e[14]=u):u=e[14],u}function ss(s){const e=P.c(7),{virtualMcps:n,org:i}=s;let a;if(e[0]!==i||e[1]!==n){let r;e[3]!==i?(r=c=>t.jsx(ts,{virtualMcp:c,org:i},c.id),e[3]=i,e[4]=r):r=e[4],a=n.map(r),e[0]=i,e[1]=n,e[2]=a}else a=e[2];let o;return e[5]!==a?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=o):o=e[6],o}function ns(s){const e=P.c(7),{connection:n}=s,{org:i}=J();let a;e[0]!==n.id?(a={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=a):a=e[1];const o=St(a);if(!(o.length>0)){let d;return e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(t.Fragment,{}),e[2]=d):d=e[2],d}let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=c):c=e[3];let m;return e[4]!==i.slug||e[5]!==o?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[c,t.jsx("div",{className:"px-5 py-4",children:t.jsx(ss,{virtualMcps:o,org:i.slug})})]}),e[4]=i.slug,e[5]=o,e[6]=m):m=e[6],m}function os(s){const e=P.c(31),{tools:n,connectionId:i,org:a}=s,o=Y(),{org:r}=J();let c;e[0]!==i||e[1]!==r.id||e[2]!==r.slug?(c={connectionId:i,orgId:r.id,orgSlug:r.slug},e[0]=i,e[1]=r.id,e[2]=r.slug,e[3]=c):c=e[3];const m=re(c),d=ye(i);let u;e[4]!==d||e[5]!==i?(u=d?ke(d):i,e[4]=d,e[5]=i,e[6]=u):u=e[6];const p=u,[l,f]=X.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==m||e[9]!==o||e[10]!==a||e[11]!==l||e[12]!==n){const S=(n??[]).filter(is),N=l.toLowerCase().trim(),k=N?S.filter(h=>h.name.toLowerCase().includes(N)||h.description&&h.description.toLowerCase().includes(N)):S;let y;e[17]!==p||e[18]!==o||e[19]!==a?(y=h=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(h.name)}})},e[17]=p,e[18]=o,e[19]=a,e[20]=y):y=e[20];const C=y;b="flex flex-col h-full overflow-hidden";let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[21]=I):I=e[21],e[22]!==l?(j=t.jsx($t,{value:l,onChange:f,placeholder:"Search apps...",onKeyDown:I}),e[22]=l,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=k.length===0?t.jsx(be,{image:null,title:l?"No apps found":"No apps available",description:l?"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:k.map(h=>{const A=ae(h._meta);return t.jsxs(Dt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>C(h),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(nt,{resourceURI:A,toolInfo:{tool:h},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),t.jsx(Je,{annotations:h.annotations,_meta:h._meta})]}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]})]},h.name)})}),e[7]=p,e[8]=m,e[9]=o,e[10]=a,e[11]=l,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let _;e[24]!==g||e[25]!==v?(_=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=_):_=e[26];let w;return e[27]!==b||e[28]!==j||e[29]!==_?(w=t.jsxs("div",{className:b,children:[j,_]}),e[27]=b,e[28]=j,e[29]=_,e[30]=w):w=e[30],w}function is(s){return!!ae(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=r=>r.charAt(0).toUpperCase()+r.slice(1),i=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),o=e[e.length-1];return a.length>=2&&o&&i.has(o)?[a.pop(),...a].join(" "):a.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=i):i=e[1],i}function rs(s){const e=P.c(50),{tools:n,prompts:i,resources:a,connectionId:o,org:r}=s;let c;e[0]!==i?(c=i===void 0?[]:i,e[0]=i,e[1]=c):c=e[1];const m=c;let d;e[2]!==a?(d=a===void 0?[]:a,e[2]=a,e[3]=d):d=e[3];const u=d,p=Y(),l=ye(o??"");let f;e[4]!==l||e[5]!==o?(f=l?ke(l):o,e[4]=l,e[5]=o,e[6]=f):f=e[6];const g=f;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==r?(v=function($){!o||!r||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:g,collectionName:"tools",itemId:encodeURIComponent($)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=r,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==r||e[14]!==n?(j=o&&r&&n.some(cs),e[12]=o,e[13]=r,e[14]=n,e[15]=j):j=e[15];const _=j;if(n.length+m.length+u.length===0){let x;return e[16]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=x):x=e[16],x}let S;e[17]!==n.length?(S=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=S):S=e[18];let N;e[19]!==_?(N=_&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=_,e[20]=N):N=e[20];let k,y;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),y=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=k,e[22]=y):(k=e[21],y=e[22]);let C;e[23]!==S||e[24]!==N?(C=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Ct,{variant:"underline",className:"gap-1",children:[S,N,k,y]})}),e[23]=S,e[24]=N,e[25]=C):C=e[25];let I;e[26]!==b||e[27]!==n?(I=n.length>0?n.map(x=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>b(x.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(At,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(x.name)}),x.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:x.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},x.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=I):I=e[28];let h;e[29]!==I?(h=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:I})}),e[29]=I,e[30]=h):h=e[30];let A;e[31]!==o||e[32]!==_||e[33]!==r||e[34]!==n?(A=_&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(os,{tools:n,connectionId:o,org:r})}),e[31]=o,e[32]=_,e[33]=r,e[34]=n,e[35]=A):A=e[35];let M;e[36]!==m?(M=m.length>0?m.map(ls):t.jsx(ie,{label:"prompts"}),e[36]=m,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let T;e[40]!==u?(T=u.length>0?u.map(as):t.jsx(ie,{label:"resources"}),e[40]=u,e[41]=T):T=e[41];let z;e[42]!==T?(z=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:T})}),e[42]=T,e[43]=z):z=e[43];let E;return e[44]!==C||e[45]!==h||e[46]!==A||e[47]!==O||e[48]!==z?(E=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(wt,{defaultValue:"tools",variant:"underline",children:[C,h,A,O,z]})}),e[44]=C,e[45]=h,e[46]=A,e[47]=O,e[48]=z,e[49]=E):E=e[49],E}function as(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Tt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function ls(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(kt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function cs(s){return ae(s._meta)}function ds(s){const e=P.c(13),{connection:n,displayTitle:i}=s,a=i??n.title;let o;e[0]!==n.icon||e[1]!==a?(o=t.jsx(oe,{icon:n.icon,name:a,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=o):o=e[2];let r;e[3]!==a?(r=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:a})}),e[3]=a,e[4]=r):r=e[4];let c;e[5]!==n.description?(c=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=c):c=e[6];let m;e[7]!==r||e[8]!==c?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[r,c]}),e[7]=r,e[8]=c,e[9]=m):m=e[9];let d;return e[10]!==o||e[11]!==m?(d=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,m]}),e[10]=o,e[11]=m,e[12]=d):d=e[12],d}function ms({form:s,connection:e,hasOAuthToken:n,onReauthenticate:i,onRemoveOAuth:a}){const o=de({control:s.control,name:"ui_type"}),r=de({control:s.control,name:"connection_url"}),{stdioEnabled:c}=Pe(),m=(()=>{if(typeof r!="string"||!r)return!1;try{const l=new URL(r);return l.hostname==="api.githubcopilot.com"&&l.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),d=c||e.connection_type==="STDIO",u=e.connection_type==="VIRTUAL",p=u?Oe(e.connection_url):null;return u?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(we,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(R,{control:s.control,name:"ui_type",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(ue,{value:l.value,onValueChange:l.onChange,children:[t.jsx(V,{children:t.jsxs(xe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(pe,{})]})}),t.jsxs(fe,{children:[t.jsx(F,{value:"HTTP",children:"HTTP"}),t.jsx(F,{value:"SSE",children:"SSE"}),t.jsx(F,{value:"Websocket",children:"Websocket"}),d&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:"NPX Package"}),t.jsx(F,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(R,{control:s.control,name:"connection_url",render:({field:f})=>t.jsx(L,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(W,{placeholder:"https://example.com/mcp",...f,value:f.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(ue,{value:l.value,onValueChange:l.onChange,children:[t.jsx(V,{children:t.jsx(xe,{className:"h-10",children:t.jsx(pe,{})})}),t.jsxs(fe,{children:[t.jsx(F,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(F,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(F,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),d&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(F,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(It,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(B,{})]})}),o==="NPX"&&t.jsx(R,{control:s.control,name:"npx_package",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(V,{children:t.jsx(W,{placeholder:"@perplexity-ai/mcp-server",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(R,{control:s.control,name:"stdio_command",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(V,{children:t.jsx(W,{placeholder:"node, bun, python...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),t.jsx(R,{control:s.control,name:"stdio_args",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(V,{children:t.jsx(W,{placeholder:"arg1 arg2 --flag value",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(B,{})]})})]}),t.jsx(R,{control:s.control,name:"stdio_cwd",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(V,{children:t.jsx(W,{placeholder:"/path/to/project (optional)",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(R,{control:s.control,name:"env_vars",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(V,{children:t.jsx(Be,{value:l.value??[],onChange:l.onChange})}),t.jsx(B,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(R,{control:s.control,name:"connection_token",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:m?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ot,{children:[t.jsx(Mt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Pt,{variant:"success",className:"gap-1.5",children:[t.jsx(Vt,{size:12}),"Authenticated via OAuth",t.jsx(Et,{size:12})]})})}),t.jsxs(zt,{align:"start",children:[t.jsxs(me,{onClick:i,children:[t.jsx(Ft,{size:16}),"Re-authenticate"]}),t.jsxs(me,{variant:"destructive",onClick:a,children:[t.jsx(le,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&l.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>l.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Rt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(W,{type:"password",placeholder:m?"Paste your GitHub PAT":"Enter access token...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(ut,{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(B,{})]})})]})}function us(s){return s.command==="npx"}function xs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function ps(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function he(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Re(s.connection_headers)){const i=s.connection_headers,a=We(i.envVars);if(us(i)){const r=xs(i);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:r,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const o=ps(i);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:a}}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 fs(s){let e,n=null,i=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=Xe(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=qe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",i=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...i&&{connection_token:i},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function hs({connection:s,connectionId:e,org:n,isUpdating:i,tools:a,prompts:o,resources:r,siblings:c}){const m=Y({from:"/$org/settings/connections/$appSlug"}),d=Ve(),u=_e(),{org:p}=J(),l=pt({onSuccess:()=>{c.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[f,g]=X.useState(null),[v,b]=X.useState(!1),j=Ne({connectionId:e}),{data:_}=Ye(),w=_?.data?.members??[],S=f??s,N=w.find(x=>x.userId===S.created_by),y=s?.connection_type==="VIRTUAL"||j.isAuthenticated,C={...s,tools:a},I=Ke(C,Ht),h=Ee({resolver:Ue(Ge),values:he(f??s)}),A=h.formState.isDirty,M=async()=>{if(!await h.trigger())return;const $=h.getValues(),D=fs($),U=f?.id??e;await u.update.mutateAsync({id:U,data:D}),h.reset($)},O=()=>{h.reset(he(f??s))},T=async x=>{const{token:$,tokenInfo:D,error:U}=await Le({connectionId:x,orgSlug:p.slug,scope:"offline_access"});if(U||!$){Q.error(`Authentication failed: ${U}`);return}if(D)try{const q=await fetch(`/api/${p.slug}/connections/${x}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!q.ok)console.error("Failed to save OAuth token:",await q.text()),await u.update.mutateAsync({id:x,data:{connection_token:$}});else try{await u.update.mutateAsync({id:x,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(q){console.error("Error saving OAuth token:",q),await u.update.mutateAsync({id:x,data:{connection_token:$}})}else await u.update.mutateAsync({id:x,data:{connection_token:$}});const K=new URL(`/api/${p.slug}/mcp/${x}`,window.location.origin);await d.invalidateQueries({queryKey:ne.isMCPAuthenticated(K.href,null)}),await d.invalidateQueries({queryKey:ne.mcpClientPrefix()}),Q.success("Authentication successful")},z=()=>T(s.id),E=async()=>{try{const x=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!x.ok){const D=await x.text();Q.error(`Failed to remove OAuth: ${D}`);return}const $=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await d.invalidateQueries({queryKey:ne.isMCPAuthenticated($.href,null)}),Q.success("OAuth removed. You can now re-authenticate with a different account.")}catch(x){console.error("Error removing OAuth token:",x),Q.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(ft,{...l}),t.jsx(at,{open:f!==null,onOpenChange:x=>{x||g(null)},children:t.jsxs(lt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(ct,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(dt,{className:"text-base",children:f?.title??s.title}),t.jsx(mt,{className:"text-xs",children:"Update URL, authentication, and other settings"}),N&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ze,{url:N.user?.image??void 0,fallback:N.user?.name??N.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:N.user?.name||N.user?.email})]})]}),t.jsxs(xt,{...h,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(R,{control:h.control,name:"title",render:({field:x})=>t.jsxs(L,{children:[t.jsx(H,{children:"Name"}),t.jsx(V,{children:t.jsx(W,{...x})}),t.jsx(B,{})]})}),t.jsx(R,{control:h.control,name:"description",render:({field:x})=>t.jsxs(L,{children:[t.jsx(H,{children:"Description"}),t.jsx(V,{children:t.jsx(W,{...x,value:x.value||""})}),t.jsx(B,{})]})})]}),t.jsx(ms,{form:h,connection:f??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:z,onRemoveOAuth:E}),t.jsx(Qe,{connection:f??s,form:h,hasMcpBinding:I,isMCPAuthenticated:y,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:z,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(G,{onClick:M,disabled:!A||i,className:"flex-1",children:i?"Saving…":"Save changes"}),A&&t.jsx(G,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(G,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const x=f??s;g(null),l.requestDelete(x)},children:[t.jsx(le,{size:15}),"Delete"]})]})]},f?.id??s.id)]})}),t.jsx(ht,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(ds,{connection:s,displayTitle:(()=>{const x=c[0]??s;return x.app_name?x.title.replace(/\s*\(\d+\)\s*$/,""):x.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(es,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Wt,{instances:c,onConfigure:x=>g(x),onAuthenticate:x=>T(x.id),onDelete:x=>l.requestDelete(x),isAdding:v,onAdd:async()=>{b(!0);try{const x=c[0]??s,$=x.title.replace(/\s*\(\d+\)\s*$/,""),D=c.length+1,U=`${$} (${D})`,K=He("conn");await u.create.mutateAsync({id:K,title:U,description:x.description??null,connection_type:x.connection_type,connection_url:x.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:x.created_by,organization_id:x.organization_id,icon:x.icon??null,app_name:x.app_name??null,app_id:x.app_id??null,connection_headers:x.connection_headers??null,oauth_config:null,configuration_state:x.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const q=new URL(`/api/${p.slug}/mcp/${K}`,window.location.origin),Z=await Fe({url:q.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await T(K)}finally{b(!1)}}}),t.jsx(ns,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(rs,{tools:a,prompts:o,resources:r,connectionId:e,org:n})})]})})]})})]})}function gs(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);let i;s[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/settings/connections/$appSlug"},s[1]=i):i=s[1];const{appSlug:a,org:o}=ze(i),{org:r}=J(),c=_e();let m;s[2]!==a?(m={slug:a},s[2]=a,s[3]=m):m=s[3];const d=et(m),u=d[0]??null,p=u?.id??"",l=p||null;let f;s[4]!==r.id||s[5]!==r.slug||s[6]!==l?(f={connectionId:l,orgId:r.id,orgSlug:r.slug},s[4]=r.id,s[5]=r.slug,s[6]=l,s[7]=f):f=s[7];const g=re(f);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=st(v);let j;if(s[10]!==u?.tools||s[11]!==p||s[12]!==d||s[13]!==b){const T=b?b.tools.map(_s):(u?.tools??[]).map(ys);e:{if(d.length<=1){j=T;break e}const z=new Set,E=[],x=bs;for(const $ of d){const D=$.id===p?T:x($.tools);for(const U of D)z.has(U.name)||(z.add(U.name),E.push(U))}j=E.length>0?E:T}s[10]=u?.tools,s[11]=p,s[12]=d,s[13]=b,s[14]=j}else j=s[14];const _=j;let w;s[15]!==g?(w={client:g},s[15]=g,s[16]=w):w=s[16];const{data:S}=it(w);let N;s[17]!==g?(N={client:g},s[17]=g,s[18]=N):N=s[18];const{data:k}=ot(N);let y;s[19]!==S?.prompts?(y=S?.prompts??[],s[19]=S?.prompts,s[20]=y):y=s[20];let C;s[21]!==y?(C=y.map(vs),s[21]=y,s[22]=C):C=s[22];const I=C;let h;s[23]!==k?.resources?(h=k?.resources??[],s[23]=k?.resources,s[24]=h):h=s[24];let A;s[25]!==h?(A=h.map(js),s[25]=h,s[26]=A):A=s[26];const M=A;if(!u){let T;return s[27]!==n||s[28]!==o?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(be,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(G,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=T):T=s[29],T}let O;return s[30]!==c.update.isPending||s[31]!==_||s[32]!==u||s[33]!==p||s[34]!==o||s[35]!==I||s[36]!==M||s[37]!==d?(O=t.jsx(hs,{org:o,connection:u,connectionId:p,isUpdating:c.update.isPending,tools:_,prompts:I,resources:M,siblings:d}),s[30]=c.update.isPending,s[31]=_,s[32]=u,s[33]=p,s[34]=o,s[35]=I,s[36]=M,s[37]=d,s[38]=O):O=s[38],O}function js(s){return{name:s.name,description:s.description,uri:s.uri}}function vs(s){return{name:s.name,description:s.description}}function bs(s){return(s??[]).map(Ns)}function Ns(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ys(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function _s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ss(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Me,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(gs,{})})}),s[0]=e):e=s[0],e}function ro(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ss,{}),s[0]=e):e=s[0],e}export{ro as default};
@@ -1 +1 @@
1
- import{R,aI as V,b6 as A,U as a,aG as j,aH as z,e as L,j as u,B as C}from"./index-CHxlbuKY.js";import{I as H}from"./input-BqbhwOOI.js";import{s as W}from"./Plus-DyGCHsAC.js";import{s as q}from"./Trash01-BWWRskAa.js";const K=R({key:a().min(1,"Key is required"),value:a()}),M=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(K).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:V(a(),A()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function U(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:U(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(q,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(W,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function I(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=I(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=I(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,J as a,Q as b,M as c,Z as d,Y as i,F as p,D as r};
1
+ import{R,aI as V,b6 as A,U as a,aG as j,aH as z,e as L,j as u,B as C}from"./index-C4HbvW_W.js";import{I as H}from"./input-B5k-Hbp3.js";import{s as W}from"./Plus-Tnr53r7A.js";import{s as q}from"./Trash01-CZeQBZf_.js";const K=R({key:a().min(1,"Key is required"),value:a()}),M=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(K).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:V(a(),A()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function U(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:U(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(q,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(W,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function I(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=I(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=I(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,J as a,Q as b,M as c,Z as d,Y as i,F as p,D as r};
@@ -1 +1 @@
1
- import{e as ae,j as t,E as et,r as W,l as ce,q as Ne,f as ke,d as tt,b as De,u as nt,p as st,L as ot,G as it,H as at,B as z,t as ne,F as rt,c as le,o as Q,J as ct,I as lt,K as dt}from"./index-CHxlbuKY.js";import{g as mt}from"./generate-id-BKVk8ACt.js";import{C as ut}from"./collection-display-button-BkPkMS-1.js";import{S as pt}from"./search-input-BV9iWpXU.js";import{C as ht}from"./collection-tabs-Bt-TX4Xo.js";import{u as xt,a as Ae,g as gt,C as Ce}from"./connection-card-BXL7SVUL.js";import{E as ft}from"./empty-state-D3IZdm2e.js";import{I as jt}from"./integration-icon-DsdPiq0I.js";import{P as me}from"./index-CrU7PEoz.js";import{u as yt,D as Ct}from"./use-delete-connection-DFb9AulP.js";import{u as ye}from"./use-capability-CQt0iOwa.js";import{u as vt}from"./use-infinite-scroll-DRY2R8kb.js";import{u as _t}from"./use-list-state-CGdA9sk-.js";import{g as we,a as St,e as bt}from"./extract-connection-data-nTPi-bUk.js";import{g as pe}from"./connection-slug-eyAPH6o3.js";import{c as Te,d as Ie,b as Pe,f as Le,e as Oe,g as $e,a as Ee,A as Me}from"./alert-dialog-DXWvjPm6.js";import{C as ze}from"./checkbox-COoWVOED.js";import{D as Fe,a as Ve,b as Be,c as Ue,e as He,d as Re}from"./dialog-DrWcnTZj.js";import{b as Nt,a as kt,c as Dt,D as At,d as wt,e as Tt,f as It}from"./drawer-Bfik0Ru5.js";import{u as Pt}from"./tooltip-BFGyTrfa.js";import{D as Ke,a as We,b as Xe,c as he}from"./dropdown-menu-CZNwXuzY.js";import{F as J,b as Y,c as Z,d as ee,f as te,a as Se}from"./form-DZneHGBX.js";import{I as ie}from"./input-BqbhwOOI.js";import{d as Lt,S as Ot,a as $t,b as Et,c as re}from"./select-Ci_D4qpL.js";import{T as Mt}from"./textarea-DywxeOH3.js";import{b as qe,u as zt}from"./use-connection-_VO3kzZS.js";import{u as Ft,S as Vt}from"./constants-7h1Iherr.js";import{a as Bt}from"./use-virtual-mcp-BaoT8VIh.js";import{P as Ut,a2 as Ht}from"./agent-icon-WacEkBrp.js";import{n as xe}from"./Container-Bgm498uR.js";import{i as Ge}from"./DotsVertical-DdI4UlQo.js";import{s as Qe}from"./Eye-D-FtEtW8.js";import{s as je}from"./Star01-BWl4O-UT.js";import{s as Je}from"./Plus-DyGCHsAC.js";import{s as Ye}from"./Trash01-BWWRskAa.js";import{s as Ze}from"./XClose-tPJB8Sgg.js";import{i as ue,a as be,E as Rt,c as Kt,p as Wt,b as Xt,d as qt}from"./connection-form-helpers-ZyPV2_OX.js";import"./collections-DltZgEAo.js";import"./SwitchHorizontal01-DL7oI9Hg.js";import"./Check-Bl0EnB2J.js";import"./view-mode-toggle--g2MGXro.js";import"./badge-CDV4_k2B.js";import"./SearchMd-BvLcLD4O.js";import"./use-registry-connections-DnATENDO.js";import"./use-organization-settings-Dy_wvkUU.js";import"./useInfiniteQuery-BdYHzHZ3.js";import"./infiniteQueryObserver-ClvxtPxd.js";import"./card-BrXXg9xg.js";import"./sidebar-rRN-0AxT.js";import"./LayoutLeft-CnXQOO58.js";import"./sheet-B9dMT6Ki.js";import"./X-Dnhh57X7.js";import"./use-view-mode-DZhMkEJ1.js";import"./ChevronRight-CJPo14Wd.js";import"./label-DylEtHs-.js";import"./ChevronDown-BYvseX6e.js";import"./ChevronUp-CoYKSGM9.js";import"./use-collections-hMeHX3z9.js";import"./AlertCircle-C2xmuErv.js";import"./Tool01-Cgf_tMbK.js";import"./RefreshCcw01-DwuEW87g.js";import"./XCircle-M_oWnCac.js";import"./ArrowUpRight-DY3nGAjH.js";import"./ZapSquare-D8HT6_jN.js";import"./Users03-DuD0whJZ.js";import"./CheckCircle-Bt38xVIy.js";import"./ChevronLeft-DoUOCEbQ.js";import"./ZoomOut-DvI5OdTo.js";import"./Globe01-5KEfDt4K.js";import"./FilterLines-Bn2_q3W3.js";import"./Palette-BL7llRL5.js";import"./HardDrive-Bq_J68ys.js";import"./Stars02-BDvnLwBo.js";import"./Key01-C484g3YO.js";import"./LinkExternal01-DSXCOuPf.js";import"./Monitor01-DxGBVT7-.js";import"./Sun-BumCYr1L.js";import"./Play-COr2_UEr.js";import"./Settings02-DdSNGnuW.js";import"./Shield01-B-jBzvZJ.js";import"./Stars01-cmM0sb2I.js";import"./Upload01-CufDtzzB.js";import"./User01-CL8jgZE5.js";import"./Users01-DVvuBAcj.js";import"./Zap-C7nJc6zh.js";function Gt(v){const e=ae.c(51),{group:n,onOpen:p,selectionMode:u,selectedIds:m,onToggleSelect:a}=v;let h;if(e[0]!==n.connections||e[1]!==m){let C;e[3]!==m?(C=P=>m.has(P.id),e[3]=m,e[4]=C):C=e[4],h=n.connections.every(C),e[0]=n.connections,e[1]=m,e[2]=h}else h=e[2];const x=h;let y;if(e[5]!==n.connections||e[6]!==m){let C;e[8]!==m?(C=P=>m.has(P.id),e[8]=m,e[9]=C):C=e[9],y=n.connections.some(C),e[5]=n.connections,e[6]=m,e[7]=y}else y=e[7];const g=y,b=`${n.connections.length} instances`;let N;e[10]!==n.icon||e[11]!==n.title||e[12]!==b?(N={title:n.title,icon:n.icon,description:b},e[10]=n.icon,e[11]=n.title,e[12]=b,e[13]=N):N=e[13];let l;e[14]!==x||e[15]!==n.connections||e[16]!==p||e[17]!==a||e[18]!==m||e[19]!==u?(l=()=>u?(()=>{for(const C of n.connections)x?m.has(C.id)&&a(C.id):m.has(C.id)||a(C.id)})():p(),e[14]=x,e[15]=n.connections,e[16]=p,e[17]=a,e[18]=m,e[19]=u,e[20]=l):l=e[20];const j=u&&x&&"ring-2 ring-primary",d=u&&g&&!x&&"ring-1 ring-primary/50";let k;e[21]!==j||e[22]!==d?(k=le(j,d),e[21]=j,e[22]=d,e[23]=k):k=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(xe,{}),e[24]=_):_=e[24];let D;e[25]!==x||e[26]!==n.connections||e[27]!==a||e[28]!==m||e[29]!==u||e[30]!==g?(D=u?t.jsx(ze,{checked:x?!0:g?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)x?m.has(C.id)&&a(C.id):m.has(C.id)||a(C.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=x,e[26]=n.connections,e[27]=a,e[28]=m,e[29]=u,e[30]=g,e[31]=D):D=e[31];const U=u?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let F;e[32]!==U?(F=le("overflow-hidden transition-all duration-150 ease-out",U),e[32]=U,e[33]=F):F=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(We,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Jt,children:t.jsx(Ge,{size:20})})}),e[34]=s):s=e[34];let A;e[35]!==p?(A=C=>{C.stopPropagation(),p()},e[35]=p,e[36]=A):A=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Qe,{size:16}),e[37]=V):V=e[37];let $;e[38]!==A?($=t.jsxs(Ke,{children:[s,t.jsx(Xe,{align:"end",onClick:Qt,children:t.jsxs(he,{onClick:A,children:[V,"Open"]})})]}),e[38]=A,e[39]=$):$=e[39];let w;e[40]!==F||e[41]!==$?(w=t.jsx("div",{className:F,children:$}),e[40]=F,e[41]=$,e[42]=w):w=e[42];let L;e[43]!==D||e[44]!==w?(L=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=L):L=e[45];let B;return e[46]!==L||e[47]!==N||e[48]!==l||e[49]!==k?(B=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:N,onClick:l,className:k,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:L})}),e[46]=L,e[47]=N,e[48]=l,e[49]=k,e[50]=B):B=e[50],B}function Qt(v){return v.stopPropagation()}function Jt(v){return v.stopPropagation()}function Yt(v){const e=ae.c(23),{count:n,total:p,canManage:u,canManageAgents:m,onSelectAll:a,onDeselectAll:h,onDelete:x,onAddToAgent:y,onToggleStatus:g,onCancel:b}=v;if(n===0)return null;let N;e[0]!==n?(N=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=N):N=e[1];let l;e[2]!==n||e[3]!==h||e[4]!==a||e[5]!==p?(l=n<p?t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:["Select all (",p,")"]}):t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:"Clear selection"}),e[2]=n,e[3]=h,e[4]=a,e[5]=p,e[6]=l):l=e[6];let j;e[7]!==m||e[8]!==y?(j=m&&t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:y,children:[t.jsx(Je,{size:13}),"Add to Agent"]}),e[7]=m,e[8]=y,e[9]=j):j=e[9];let d;e[10]!==u||e[11]!==x||e[12]!==g?(d=u&&t.jsxs(t.Fragment,{children:[t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>g("active"),children:"Enable"}),t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>g("inactive"),children:"Disable"}),t.jsxs(z,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:x,children:[t.jsx(Ye,{size:13}),"Delete"]})]}),e[10]=u,e[11]=x,e[12]=g,e[13]=d):d=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ze,{size:13}),e[14]=k):k=e[14];let _;e[15]!==b?(_=t.jsx(z,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:b,children:k}),e[15]=b,e[16]=_):_=e[16];let D;return e[17]!==N||e[18]!==l||e[19]!==j||e[20]!==d||e[21]!==_?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[N,l,j,d,_]})}),e[17]=N,e[18]=l,e[19]=j,e[20]=d,e[21]=_,e[22]=D):D=e[22],D}function Zt(v){const e=ae.c(25),{open:n,onOpenChange:p,agents:u,onConfirm:m}=v,[a,h]=W.useState(null);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsxs(Be,{children:[t.jsx(Ue,{children:"Add to Agent"}),t.jsx(He,{children:"Select an agent to add the selected connections to."})]}),e[0]=x):x=e[0];let y;e[1]!==u||e[2]!==a?(y=u.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):u.map(D=>t.jsxs("button",{type:"button",onClick:()=>h(D.id),className:le("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",a===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(jt,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[1]=u,e[2]=a,e[3]=y):y=e[3];let g;e[4]!==y?(g=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:y}),e[4]=y,e[5]=g):g=e[5];let b;e[6]!==p?(b=t.jsx(z,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=b):b=e[7];const N=!a;let l;e[8]!==m||e[9]!==p||e[10]!==a?(l=()=>{a&&(m(a),p(!1),h(null))},e[8]=m,e[9]=p,e[10]=a,e[11]=l):l=e[11];let j;e[12]!==N||e[13]!==l?(j=t.jsx(z,{disabled:N,onClick:l,children:"Add"}),e[12]=N,e[13]=l,e[14]=j):j=e[14];let d;e[15]!==b||e[16]!==j?(d=t.jsxs(Re,{children:[b,j]}),e[15]=b,e[16]=j,e[17]=d):d=e[17];let k;e[18]!==g||e[19]!==d?(k=t.jsxs(Ve,{className:"sm:max-w-[400px]",children:[x,g,d]}),e[18]=g,e[19]=d,e[20]=k):k=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==k?(_=t.jsx(Fe,{open:n,onOpenChange:p,children:k}),e[21]=p,e[22]=n,e[23]=k,e[24]=_):_=e[24],_}function en(v){const e=ae.c(20),{open:n,onOpenChange:p,count:u,onConfirm:m}=v,a=u!==1?"s":"";let h;e[0]!==u||e[1]!==a?(h=t.jsxs(Te,{children:["Delete ",u," connection",a,"?"]}),e[0]=u,e[1]=a,e[2]=h):h=e[2];const x=u!==1?"s":"";let y;e[3]!==x?(y=t.jsxs(Ie,{children:["This will permanently delete the selected connection",x,". This action cannot be undone."]}),e[3]=x,e[4]=y):y=e[4];let g;e[5]!==h||e[6]!==y?(g=t.jsxs(Pe,{children:[h,y]}),e[5]=h,e[6]=y,e[7]=g):g=e[7];let b;e[8]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Le,{children:"Cancel"}),e[8]=b):b=e[8];const N=u!==1?"s":"";let l;e[9]!==u||e[10]!==m||e[11]!==N?(l=t.jsxs(Oe,{children:[b,t.jsxs($e,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",u," connection",N]})]}),e[9]=u,e[10]=m,e[11]=N,e[12]=l):l=e[12];let j;e[13]!==g||e[14]!==l?(j=t.jsxs(Ee,{children:[g,l]}),e[13]=g,e[14]=l,e[15]=j):j=e[15];let d;return e[16]!==p||e[17]!==n||e[18]!==j?(d=t.jsx(Me,{open:n,onOpenChange:p,children:j}),e[16]=p,e[17]=n,e[18]=j,e[19]=d):d=e[19],d}function tn(v){return v._registryId?.includes("community-registry")===!0}function nn(v){const e=ae.c(58),{item:n,canManage:p,allConnections:u,connectedAppNames:m,connectingItemId:a,onNavigateConnected:h,onConnect:x}=v,[y,g]=W.useState(!1),[b,N]=W.useState(null);let l,j;e[0]!==m||e[1]!==n?(l=we(n)??"",j=m.has(l),e[0]=m,e[1]=n,e[2]=l,e[3]=j):(l=e[2],j=e[3]);const d=j,k=n._meta?.["mcp.mesh"],_=k?.friendlyName||k?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let U;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(U=n.server?.icons?.[0]?.src||St(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=U):U=e[6];const F=U;let s;if(e[7]!==u||e[8]!==l){let S;e[10]!==l?(S=oe=>oe.connection_type!=="VIRTUAL"&&oe.app_name===l,e[10]=l,e[11]=S):S=e[11],s=u.filter(S),e[7]=u,e[8]=l,e[9]=s}else s=e[9];const A=s;let V;e[12]!==n?(V=tn(n),e[12]=n,e[13]=V):V=e[13];const $=V;let w,L;e[14]!==A||e[15]!==p||e[16]!==$||e[17]!==d||e[18]!==n||e[19]!==x||e[20]!==h?(w=()=>{if(d){const S=A[0];S&&h(S);return}p&&L()},L=()=>{$?(N("connect"),g(!0)):x(n)},e[14]=A,e[15]=p,e[16]=$,e[17]=d,e[18]=n,e[19]=x,e[20]=h,e[21]=w,e[22]=L):(w=e[21],L=e[22]);let B;e[23]!==n||e[24]!==x||e[25]!==b?(B=()=>{ne("connections_community_warning_confirmed",{registry_item_id:n.id}),g(!1),b==="connect"&&x(n),N(null)},e[23]=n,e[24]=x,e[25]=b,e[26]=B):B=e[26];const C=B;let P;e[27]!==D||e[28]!==F||e[29]!==_?(P={title:_,description:D,icon:F},e[27]=D,e[28]=F,e[29]=_,e[30]=P):P=e[30];let G;e[31]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(xe,{}),e[31]=G):G=e[31];let R;e[32]!==$||e[33]!==n._sourceIcon?(R=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=$,e[33]=n._sourceIcon,e[34]=R):R=e[34];let X;e[35]!==p||e[36]!==a||e[37]!==L||e[38]!==d||e[39]!==n.id?(X=d?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(z,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:a!==null,onClick:S=>{S.stopPropagation(),L()},children:a===n.id?t.jsx(ce,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=a,e[37]=L,e[38]=d,e[39]=n.id,e[40]=X):X=e[40];let o;e[41]!==R||e[42]!==X?(o=t.jsxs("div",{className:"flex items-center gap-2",children:[R,X]}),e[41]=R,e[42]=X,e[43]=o):o=e[43];let f;e[44]!==w||e[45]!==o||e[46]!==P?(f=t.jsx(Ce,{connection:P,fallbackIcon:G,onClick:w,headerActionsAlwaysVisible:!0,headerActions:o}),e[44]=w,e[45]=o,e[46]=P,e[47]=f):f=e[47];let O;e[48]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(Pe,{children:[t.jsx(Te,{children:"Community MCP Server"}),t.jsx(Ie,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=O):O=e[48];let H;e[49]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Le,{children:"Cancel"}),e[49]=H):H=e[49];let E;e[50]!==C?(E=t.jsxs(Ee,{children:[O,t.jsxs(Oe,{children:[H,t.jsx($e,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=E):E=e[51];let r;e[52]!==y||e[53]!==E?(r=t.jsx(Me,{open:y,onOpenChange:g,children:E}),e[52]=y,e[53]=E,e[54]=r):r=e[54];let T;return e[55]!==f||e[56]!==r?(T=t.jsxs(t.Fragment,{children:[f,r]}),e[55]=f,e[56]=r,e[57]=T):T=e[57],T}function sn({listState:v,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:u,enabledRegistries:m}){const{org:a}=Ne(),h=rt(),x=ke(),{data:y}=De.useSession(),g=qe(),b=zt(v),N=yt(),{granted:l}=ye("connections:manage"),{granted:j}=ye("agents:manage"),[d,k]=W.useState(new Set),_=d.size>0,[D,U]=W.useState(!1),[F,s]=W.useState(!1),[A,V]=W.useState(null),$=Bt(),w=b.filter(c=>!(n!=="ALL"&&c.connection_type!==n||p!=="ALL"&&c.status!==p)),L=gt(w),B=c=>{k(i=>{const M=new Set(i);return M.has(c)?M.delete(c):M.add(c),M})},C=()=>{k(new Set)},P=Ae(m,v.searchTerm),G=P.items,R=vt(P.loadMore,P.hasMore,P.isLoadingMore),X=new Set(b.filter(c=>c.app_name).map(c=>c.app_name)),o=u==="ALL"||m.some(c=>c.id===u)?u:"ALL",f=v.search.length>0,O=e==="all"||f?G.filter(c=>{if(o!=="ALL"&&c._registryId!==o)return!1;if(f){const i=we(c);if(i&&X.has(i))return!1}return!0}):[],H=e==="connected"||f?L:[],E=async c=>{if(!(!a||!y?.user?.id)){ne("connection_add_clicked",{action:"connect_new",registry_item_id:c.id,source:"connections_page"}),V(c.id);try{const i=bt(c,a.id,y.user.id,{remoteIndex:0}),M=i.connection_type==="STDIO",I=!!i.connection_url,q=M&&i.connection_headers&&typeof i.connection_headers=="object"&&"command"in i.connection_headers;if(!I&&!q){Q.error("This MCP Server cannot be connected: no connection method available"),V(null);return}const{id:K}=await g.create.mutateAsync(i),ve=new URL(`/api/${a.slug}/mcp/${K}`,window.location.origin),_e=await ct({url:ve.href,token:null,orgId:a.id});if(_e.supportsOAuth&&!_e.isAuthenticated){const{token:de,tokenInfo:se,error:fe}=await lt({connectionId:K,orgSlug:a.slug,scope:"offline_access"});if(fe||!de){ne("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:fe??"no_token"}),Q.error(`Authentication failed: ${fe??"no token received"}`);return}else{if(ne("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),se)try{(await fetch(`/api/${a.slug}/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:se.accessToken,refreshToken:se.refreshToken,expiresIn:se.expiresIn,scope:se.scope,clientId:se.clientId,clientSecret:se.clientSecret,tokenEndpoint:se.tokenEndpoint})})).ok?await g.update.mutateAsync({id:K,data:{}}):await g.update.mutateAsync({id:K,data:{connection_token:de}})}catch{await g.update.mutateAsync({id:K,data:{connection_token:de}})}else await g.update.mutateAsync({id:K,data:{connection_token:de}});await h.invalidateQueries({queryKey:dt.isMCPAuthenticated(ve.href,null)}),Q.success("Authentication successful")}}Q.success("Connected successfully")}catch(i){Q.error(`Failed to connect: ${i instanceof Error?i.message:String(i)}`)}finally{V(null)}}},r=Ft({connectionId:Vt,orgId:a.id,orgSlug:a.slug}),T=()=>{h.invalidateQueries({predicate:c=>{const i=c.queryKey;return i[1]===a.id&&i[3]==="collection"&&i[4]==="CONNECTIONS"}})},S=async()=>{U(!1);const c=[...d];ne("connections_bulk_delete",{count:c.length});let i=0;for(const M of c)try{(await r.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:M,force:!0}})).isError||i++}catch{}T(),Q.success(`Deleted ${i} connection${i!==1?"s":""}`),C()},oe=async c=>{const i=[...d];ne("connections_bulk_status_toggled",{count:i.length,to_status:c});let M=0;for(const I of i)try{await g.update.mutateAsync({id:I,data:{status:c}}),M++}catch{}T(),Q.success(`${c==="active"?"Enabled":"Disabled"} ${M} connection${M!==1?"s":""}`),C()},ge=async c=>{const i=$.find(q=>q.id===c);if(!i||!r)return;ne("connections_bulk_add_to_agent",{agent_id:c,count:d.size});const M=new Set(i.connections.map(q=>q.connection_id)),I=[...d].filter(q=>!M.has(q)).map(q=>({connection_id:q,selected_tools:null,selected_resources:null,selected_prompts:null}));if(I.length===0){Q.info("All selected connections are already in that agent");return}try{await r.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:c,data:{connections:[...i.connections,...I]}}}),h.invalidateQueries({predicate:q=>{const K=q.queryKey;return K[1]===a.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),Q.success(`Added ${I.length} connection${I.length!==1?"s":""} to "${i.title}"`),C()}catch{Q.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(Ct,{...N}),t.jsx(en,{open:D,onOpenChange:U,count:d.size,onConfirm:S}),t.jsx(Zt,{open:F,onOpenChange:s,agents:$,onConfirm:ge}),P.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(f?O.length===0&&w.length===0:e==="all"?O.length===0:w.length===0)?t.jsx(ft,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:v.search?`No Connections match "${v.search}"`:l?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[H.map(c=>{if(c.type==="group")return t.jsx(Gt,{group:c,onOpen:()=>{x({to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:c.key}})},selectionMode:_,selectedIds:d,onToggleSelect:B},c.key);const i=c.connection,M=d.has(i.id);return t.jsx(Ce,{connection:i,fallbackIcon:t.jsx(xe,{}),onClick:()=>_?B(i.id):x({to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:pe(i)}}),className:le(M&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(ze,{checked:M,onCheckedChange:()=>B(i.id),onClick:I=>I.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:le("overflow-hidden transition-all duration-150 ease-out",_?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(Ke,{children:[t.jsx(We,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:I=>I.stopPropagation(),children:t.jsx(Ge,{size:20})})}),t.jsxs(Xe,{align:"end",onClick:I=>I.stopPropagation(),children:[t.jsxs(he,{onClick:I=>{I.stopPropagation(),x({to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:pe(i)}})},children:[t.jsx(Qe,{size:16}),"Open"]}),(l||j)&&t.jsxs(he,{onClick:I=>{I.stopPropagation(),B(i.id)},children:[t.jsx(Ht,{size:16}),"Select"]}),l&&t.jsxs(he,{variant:"destructive",onClick:I=>{I.stopPropagation(),N.requestDelete(i)},children:[t.jsx(Ye,{size:16}),"Delete"]})]})]})})]})},i.id)}),O.map(c=>t.jsx(nn,{item:c,canManage:l,allConnections:b,connectedAppNames:X,connectingItemId:A,onNavigateConnected:i=>x({to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:pe(i)}}),onConnect:E},`catalog-${c._registryId}:${c.id}`)),(e==="all"||f)&&m.length>0&&t.jsx("div",{ref:R,className:"col-span-full h-4"}),(e==="all"||f)&&P.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ce,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(Yt,{count:d.size,total:w.length,canManage:l,canManageAgents:j,onSelectAll:()=>{k(new Set(w.map(c=>c.id)))},onDeselectAll:()=>k(new Set),onDelete:()=>U(!0),onAddToAgent:()=>s(!0),onToggleStatus:oe,onCancel:C})]})}function on(){const{org:v}=Ne(),e=ke(),n=tt({strict:!1}),{data:p}=De.useSession(),{stdioEnabled:u}=nt(),m=Pt(),{granted:a}=ye("connections:manage"),h=_t({namespace:v.slug,resource:"connections"}),x=qe(),[y,g]=st(ot.connectionsTab(v.slug),o=>n.tab==="all"||n.tab==="connected"?n.tab:o??"all"),[b,N]=W.useState("ALL"),[l,j]=W.useState("ALL"),[d,k]=W.useState("ALL"),_=xt(),U=Ae(_,h.searchTerm).items,F=h.search!==h.searchTerm,s=it({resolver:at(Kt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),A=s.watch("ui_type"),V=s.watch("connection_url"),$=s.watch("npx_package"),w=ue({uiType:A,connectionUrl:V??"",npxPackage:$??""})??be({uiType:A,connectionUrl:V??"",registryItems:U}),L=a&&n.action==="create",B=()=>{ne("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:v.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:v.slug},search:{}})},P=async o=>{let f,O=null,H=null,E=null;o.ui_type==="NPX"?(f="STDIO",O="",E=Xt(o.npx_package||"",o.env_vars||[])):o.ui_type==="STDIO"?(f="STDIO",O="",E=qt(o.stdio_command||"",o.stdio_args||"",o.stdio_cwd,o.env_vars||[])):(f=o.ui_type,O=o.connection_url||"",H=o.connection_token||null);const r=mt("conn");ne("connection_custom_created",{connection_type:f,ui_type:o.ui_type}),await x.create.mutateAsync({id:r,title:o.title,description:o.description||null,connection_type:f,connection_url:O,connection_token:H,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:v.id,icon:o.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),C(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:v.slug,appSlug:pe({app_name:null,connection_url:O,title:o.title,id:r})}})},G=o=>{o||(L&&C(),s.reset())},R=o=>{const f=o.trim();if(!f)return;const O=!!s.formState.dirtyFields.title,H=!!s.formState.dirtyFields.description,E=!!s.formState.dirtyFields.env_vars,r=S=>{if(S&&(!O&&!s.getValues("title").trim()&&S.title&&s.setValue("title",S.title,{shouldDirty:!1}),!H&&!(s.getValues("description")??"").trim()&&S.description&&s.setValue("description",S.description,{shouldDirty:!1}),!E&&S.envVarKeys?.length)){const oe=s.getValues("env_vars")??[],ge=new Set(oe.map(i=>i.key)),c=S.envVarKeys.filter(i=>!ge.has(i));c.length>0&&s.setValue("env_vars",[...oe,...c.map(i=>({key:i,value:""}))],{shouldDirty:!0})}},T=Wt(f);if(T&&u){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",T.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),r(ue({uiType:"NPX",npxPackage:T.packageName}));return}if(f.startsWith("http://")||f.startsWith("https://")){const S=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",S,{shouldDirty:!0}),s.setValue("connection_url",f,{shouldDirty:!0}),r(ue({uiType:S,connectionUrl:f})??be({uiType:S,connectionUrl:f,registryItems:U}));return}A==="NPX"&&r(ue({uiType:"NPX",npxPackage:f}))},X=a?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(z,{variant:"outline",onClick:B,children:[t.jsx(Je,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(me,{children:[(()=>{const o="Create Connection",f="Create a custom connection in your organization. Fill in the details below.",O=s.formState.isSubmitting?"Saving...":"Create Connection",H=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(J,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Type *"}),t.jsxs(Lt,{value:r.value,onValueChange:r.onChange,children:[t.jsx(ee,{children:t.jsx(Ot,{children:t.jsx($t,{})})}),t.jsxs(Et,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(te,{})]})}),A==="NPX"&&t.jsx(J,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"NPM Package *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value??"",onPaste:T=>{const S=T.clipboardData.getData("text");S&&(T.preventDefault(),s.setValue("npx_package",S.trim(),{shouldDirty:!0}),R(S))},onBlur:T=>{R(T.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(J,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Command *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"node, bun, python...",...r,value:r.value??""})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Arguments"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...r,value:r.value??""})}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Working Directory"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...r,value:r.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(te,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(J,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Environment Variables"}),t.jsx(ee,{children:t.jsx(Rt,{value:r.value??[],onChange:r.onChange})}),t.jsx(te,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(J,{control:s.control,name:"connection_url",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"URL *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...r,value:r.value??"",onPaste:T=>{const S=T.clipboardData.getData("text");S&&(T.preventDefault(),s.setValue("connection_url",S.trim(),{shouldDirty:!0}),R(S))},onBlur:T=>{R(T.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:w?.token?.label??"Token (optional)"}),t.jsx(ee,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...r,value:r.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"title",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Name *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"My Connection",...r})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"description",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Description"}),t.jsx(ee,{children:t.jsx(Mt,{placeholder:"A brief description of this connection",rows:3,...r,value:r.value??""})}),t.jsx(te,{})]})})]}),E=L;return m?t.jsx(Nt,{open:E,onOpenChange:G,children:t.jsxs(kt,{className:"max-h-[90vh]",children:[t.jsx(Dt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(At,{children:o}),t.jsx(wt,{className:"mt-1",children:f})]}),t.jsx(Tt,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Ze,{size:16})})})]})}),t.jsx(Se,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:H}),t.jsx(It,{children:t.jsx(z,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:O})})]})})]})}):t.jsx(Fe,{open:E,onOpenChange:G,children:t.jsxs(Ve,{className:"sm:max-w-[525px]",children:[t.jsxs(Be,{children:[t.jsx(Ue,{children:o}),t.jsx(He,{children:f})]}),t.jsx(Se,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:H}),t.jsxs(Re,{children:[t.jsx(z,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),t.jsx(z,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:O})]})]})})]})})})(),t.jsx(me.Content,{children:t.jsx(me.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(me.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(pt,{value:h.search,onChange:h.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:o=>{o.key==="Escape"&&(h.setSearch(""),o.target.blur())}}),t.jsx(ut,{sortKey:h.sortKey,sortDirection:h.sortDirection,onSort:h.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:b,onChange:o=>N(o||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:l,onChange:o=>j(o||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:d,onChange:o=>k(o||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(o=>({id:o.id,label:o.id.includes("community-registry")?"Community MCP Registry":o.title}))]}]:[]]})]}),X]}),t.jsx(ht,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:y,onTabChange:o=>{const f=o;f!==y&&ne("connections_page_tab_changed",{to_tab:f}),g(f)}}),t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:F?.5:1,transition:F?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:F?"none":"auto"},children:t.jsx(sn,{listState:h,activeTab:y,typeFilter:b,statusFilter:l,registryFilter:d,enabledRegistries:_})})})]})})})]})})}function zs(){const v=ae.c(1);let e;return v[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(et,{children:t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(on,{})})}),v[0]=e):e=v[0],e}export{zs as default};
1
+ import{e as ae,j as t,E as et,r as W,l as ce,q as Ne,f as ke,d as tt,b as De,u as nt,p as st,L as ot,G as it,H as at,B as z,t as ne,F as rt,c as le,o as Q,J as ct,I as lt,K as dt}from"./index-C4HbvW_W.js";import{g as mt}from"./generate-id-CdwRTiX7.js";import{C as ut}from"./collection-display-button-DLtr23Rv.js";import{S as pt}from"./search-input-BMW004dV.js";import{C as ht}from"./collection-tabs-Y_drDohR.js";import{u as xt,a as Ae,g as gt,C as Ce}from"./connection-card-DK49rHkZ.js";import{E as ft}from"./empty-state-BLunjf1m.js";import{I as jt}from"./integration-icon-C7p8BtkI.js";import{P as me}from"./index-2xBvfJLJ.js";import{u as yt,D as Ct}from"./use-delete-connection-CjdkJ1LG.js";import{u as ye}from"./use-capability-CzlbJT0x.js";import{u as vt}from"./use-infinite-scroll-Bo7I5Z4-.js";import{u as _t}from"./use-list-state-BxpSC3kw.js";import{g as we,a as St,e as bt}from"./extract-connection-data-aP9VrOhv.js";import{g as pe}from"./connection-slug-eyAPH6o3.js";import{c as Te,d as Ie,b as Pe,f as Le,e as Oe,g as $e,a as Ee,A as Me}from"./alert-dialog-D0lyxgq7.js";import{C as ze}from"./checkbox-DLgoLQSR.js";import{D as Fe,a as Ve,b as Be,c as Ue,e as He,d as Re}from"./dialog-DqPItn-g.js";import{b as Nt,a as kt,c as Dt,D as At,d as wt,e as Tt,f as It}from"./drawer-CPIIyCcW.js";import{u as Pt}from"./tooltip-DgiqborV.js";import{D as Ke,a as We,b as Xe,c as he}from"./dropdown-menu-2uydtPAy.js";import{F as J,b as Y,c as Z,d as ee,f as te,a as Se}from"./form-BIWGXIbK.js";import{I as ie}from"./input-B5k-Hbp3.js";import{d as Lt,S as Ot,a as $t,b as Et,c as re}from"./select-DPygLpWH.js";import{T as Mt}from"./textarea-BnccT-U9.js";import{b as qe,u as zt}from"./use-connection-DjURtMK5.js";import{u as Ft,S as Vt}from"./constants-B521j7ay.js";import{a as Bt}from"./use-virtual-mcp-By6PZUzg.js";import{P as Ut,a2 as Ht}from"./agent-icon-BzrzSnAz.js";import{n as xe}from"./Container-BoahFo7F.js";import{i as Ge}from"./DotsVertical-ntZiwo0t.js";import{s as Qe}from"./Eye-DkuHnUAW.js";import{s as je}from"./Star01-sX328yCS.js";import{s as Je}from"./Plus-Tnr53r7A.js";import{s as Ye}from"./Trash01-CZeQBZf_.js";import{s as Ze}from"./XClose-DNgFZbzC.js";import{i as ue,a as be,E as Rt,c as Kt,p as Wt,b as Xt,d as qt}from"./connection-form-helpers-BSgnmPKP.js";import"./collections-UXWGkaFt.js";import"./SwitchHorizontal01-B9vZRv9t.js";import"./Check-7lFZ8X77.js";import"./view-mode-toggle-B0_LJI8Z.js";import"./badge-REAPd24g.js";import"./SearchMd-UxzEV07r.js";import"./use-registry-connections-KEGYdtt_.js";import"./use-organization-settings-difToZl3.js";import"./useInfiniteQuery-BkurBcOt.js";import"./infiniteQueryObserver-IbMlOZg5.js";import"./card-DjJMgfjm.js";import"./sidebar-DB4iKQD5.js";import"./LayoutLeft-CD_Gf1ZP.js";import"./sheet-D9aXq4ta.js";import"./X-BH0VE8jB.js";import"./use-view-mode-Bq2h-mAH.js";import"./ChevronRight-BVo14pyp.js";import"./label-BvvzAAWu.js";import"./ChevronDown-DBeUwQYn.js";import"./ChevronUp-XvIiv-NV.js";import"./use-collections-CFs8myDl.js";import"./AlertCircle-PL6o_BFM.js";import"./Tool01-yp4kJRUu.js";import"./RefreshCcw01-Cv0pFCb4.js";import"./XCircle-DLzFRLwJ.js";import"./ArrowUpRight-D0PaRtUX.js";import"./ZapSquare-xDebNl-H.js";import"./Users03-DbJl-FlT.js";import"./CheckCircle-Bjdxpj1j.js";import"./ChevronLeft-CPLLwlIr.js";import"./ZoomOut-CrlW2TUB.js";import"./Globe01-CcGroxBm.js";import"./FilterLines-DgBfCVyf.js";import"./Palette-CrqqEUcE.js";import"./HardDrive-C4j857Fq.js";import"./Stars02-f0XE-eqW.js";import"./Key01-o0EwVLiR.js";import"./LinkExternal01-BrUoXKJY.js";import"./Monitor01-D61B3ma3.js";import"./Sun-PyN_Wt4r.js";import"./Play-UJPgqc1U.js";import"./Settings02-DhqQsm8K.js";import"./Shield01-DpLC5M3q.js";import"./Stars01-Dv9c4Cee.js";import"./Upload01-SHM-fhC7.js";import"./User01-DW9hMolk.js";import"./Users01-D2wb7idE.js";import"./Zap-DplWtEq0.js";function Gt(v){const e=ae.c(51),{group:n,onOpen:p,selectionMode:u,selectedIds:m,onToggleSelect:a}=v;let h;if(e[0]!==n.connections||e[1]!==m){let C;e[3]!==m?(C=P=>m.has(P.id),e[3]=m,e[4]=C):C=e[4],h=n.connections.every(C),e[0]=n.connections,e[1]=m,e[2]=h}else h=e[2];const x=h;let y;if(e[5]!==n.connections||e[6]!==m){let C;e[8]!==m?(C=P=>m.has(P.id),e[8]=m,e[9]=C):C=e[9],y=n.connections.some(C),e[5]=n.connections,e[6]=m,e[7]=y}else y=e[7];const g=y,b=`${n.connections.length} instances`;let N;e[10]!==n.icon||e[11]!==n.title||e[12]!==b?(N={title:n.title,icon:n.icon,description:b},e[10]=n.icon,e[11]=n.title,e[12]=b,e[13]=N):N=e[13];let l;e[14]!==x||e[15]!==n.connections||e[16]!==p||e[17]!==a||e[18]!==m||e[19]!==u?(l=()=>u?(()=>{for(const C of n.connections)x?m.has(C.id)&&a(C.id):m.has(C.id)||a(C.id)})():p(),e[14]=x,e[15]=n.connections,e[16]=p,e[17]=a,e[18]=m,e[19]=u,e[20]=l):l=e[20];const j=u&&x&&"ring-2 ring-primary",d=u&&g&&!x&&"ring-1 ring-primary/50";let k;e[21]!==j||e[22]!==d?(k=le(j,d),e[21]=j,e[22]=d,e[23]=k):k=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(xe,{}),e[24]=_):_=e[24];let D;e[25]!==x||e[26]!==n.connections||e[27]!==a||e[28]!==m||e[29]!==u||e[30]!==g?(D=u?t.jsx(ze,{checked:x?!0:g?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)x?m.has(C.id)&&a(C.id):m.has(C.id)||a(C.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=x,e[26]=n.connections,e[27]=a,e[28]=m,e[29]=u,e[30]=g,e[31]=D):D=e[31];const U=u?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let F;e[32]!==U?(F=le("overflow-hidden transition-all duration-150 ease-out",U),e[32]=U,e[33]=F):F=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(We,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Jt,children:t.jsx(Ge,{size:20})})}),e[34]=s):s=e[34];let A;e[35]!==p?(A=C=>{C.stopPropagation(),p()},e[35]=p,e[36]=A):A=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Qe,{size:16}),e[37]=V):V=e[37];let $;e[38]!==A?($=t.jsxs(Ke,{children:[s,t.jsx(Xe,{align:"end",onClick:Qt,children:t.jsxs(he,{onClick:A,children:[V,"Open"]})})]}),e[38]=A,e[39]=$):$=e[39];let w;e[40]!==F||e[41]!==$?(w=t.jsx("div",{className:F,children:$}),e[40]=F,e[41]=$,e[42]=w):w=e[42];let L;e[43]!==D||e[44]!==w?(L=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=L):L=e[45];let B;return e[46]!==L||e[47]!==N||e[48]!==l||e[49]!==k?(B=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:N,onClick:l,className:k,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:L})}),e[46]=L,e[47]=N,e[48]=l,e[49]=k,e[50]=B):B=e[50],B}function Qt(v){return v.stopPropagation()}function Jt(v){return v.stopPropagation()}function Yt(v){const e=ae.c(23),{count:n,total:p,canManage:u,canManageAgents:m,onSelectAll:a,onDeselectAll:h,onDelete:x,onAddToAgent:y,onToggleStatus:g,onCancel:b}=v;if(n===0)return null;let N;e[0]!==n?(N=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=N):N=e[1];let l;e[2]!==n||e[3]!==h||e[4]!==a||e[5]!==p?(l=n<p?t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:["Select all (",p,")"]}):t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:"Clear selection"}),e[2]=n,e[3]=h,e[4]=a,e[5]=p,e[6]=l):l=e[6];let j;e[7]!==m||e[8]!==y?(j=m&&t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:y,children:[t.jsx(Je,{size:13}),"Add to Agent"]}),e[7]=m,e[8]=y,e[9]=j):j=e[9];let d;e[10]!==u||e[11]!==x||e[12]!==g?(d=u&&t.jsxs(t.Fragment,{children:[t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>g("active"),children:"Enable"}),t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>g("inactive"),children:"Disable"}),t.jsxs(z,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:x,children:[t.jsx(Ye,{size:13}),"Delete"]})]}),e[10]=u,e[11]=x,e[12]=g,e[13]=d):d=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ze,{size:13}),e[14]=k):k=e[14];let _;e[15]!==b?(_=t.jsx(z,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:b,children:k}),e[15]=b,e[16]=_):_=e[16];let D;return e[17]!==N||e[18]!==l||e[19]!==j||e[20]!==d||e[21]!==_?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[N,l,j,d,_]})}),e[17]=N,e[18]=l,e[19]=j,e[20]=d,e[21]=_,e[22]=D):D=e[22],D}function Zt(v){const e=ae.c(25),{open:n,onOpenChange:p,agents:u,onConfirm:m}=v,[a,h]=W.useState(null);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsxs(Be,{children:[t.jsx(Ue,{children:"Add to Agent"}),t.jsx(He,{children:"Select an agent to add the selected connections to."})]}),e[0]=x):x=e[0];let y;e[1]!==u||e[2]!==a?(y=u.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):u.map(D=>t.jsxs("button",{type:"button",onClick:()=>h(D.id),className:le("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",a===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(jt,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[1]=u,e[2]=a,e[3]=y):y=e[3];let g;e[4]!==y?(g=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:y}),e[4]=y,e[5]=g):g=e[5];let b;e[6]!==p?(b=t.jsx(z,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=b):b=e[7];const N=!a;let l;e[8]!==m||e[9]!==p||e[10]!==a?(l=()=>{a&&(m(a),p(!1),h(null))},e[8]=m,e[9]=p,e[10]=a,e[11]=l):l=e[11];let j;e[12]!==N||e[13]!==l?(j=t.jsx(z,{disabled:N,onClick:l,children:"Add"}),e[12]=N,e[13]=l,e[14]=j):j=e[14];let d;e[15]!==b||e[16]!==j?(d=t.jsxs(Re,{children:[b,j]}),e[15]=b,e[16]=j,e[17]=d):d=e[17];let k;e[18]!==g||e[19]!==d?(k=t.jsxs(Ve,{className:"sm:max-w-[400px]",children:[x,g,d]}),e[18]=g,e[19]=d,e[20]=k):k=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==k?(_=t.jsx(Fe,{open:n,onOpenChange:p,children:k}),e[21]=p,e[22]=n,e[23]=k,e[24]=_):_=e[24],_}function en(v){const e=ae.c(20),{open:n,onOpenChange:p,count:u,onConfirm:m}=v,a=u!==1?"s":"";let h;e[0]!==u||e[1]!==a?(h=t.jsxs(Te,{children:["Delete ",u," connection",a,"?"]}),e[0]=u,e[1]=a,e[2]=h):h=e[2];const x=u!==1?"s":"";let y;e[3]!==x?(y=t.jsxs(Ie,{children:["This will permanently delete the selected connection",x,". This action cannot be undone."]}),e[3]=x,e[4]=y):y=e[4];let g;e[5]!==h||e[6]!==y?(g=t.jsxs(Pe,{children:[h,y]}),e[5]=h,e[6]=y,e[7]=g):g=e[7];let b;e[8]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Le,{children:"Cancel"}),e[8]=b):b=e[8];const N=u!==1?"s":"";let l;e[9]!==u||e[10]!==m||e[11]!==N?(l=t.jsxs(Oe,{children:[b,t.jsxs($e,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",u," connection",N]})]}),e[9]=u,e[10]=m,e[11]=N,e[12]=l):l=e[12];let j;e[13]!==g||e[14]!==l?(j=t.jsxs(Ee,{children:[g,l]}),e[13]=g,e[14]=l,e[15]=j):j=e[15];let d;return e[16]!==p||e[17]!==n||e[18]!==j?(d=t.jsx(Me,{open:n,onOpenChange:p,children:j}),e[16]=p,e[17]=n,e[18]=j,e[19]=d):d=e[19],d}function tn(v){return v._registryId?.includes("community-registry")===!0}function nn(v){const e=ae.c(58),{item:n,canManage:p,allConnections:u,connectedAppNames:m,connectingItemId:a,onNavigateConnected:h,onConnect:x}=v,[y,g]=W.useState(!1),[b,N]=W.useState(null);let l,j;e[0]!==m||e[1]!==n?(l=we(n)??"",j=m.has(l),e[0]=m,e[1]=n,e[2]=l,e[3]=j):(l=e[2],j=e[3]);const d=j,k=n._meta?.["mcp.mesh"],_=k?.friendlyName||k?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let U;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(U=n.server?.icons?.[0]?.src||St(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=U):U=e[6];const F=U;let s;if(e[7]!==u||e[8]!==l){let S;e[10]!==l?(S=oe=>oe.connection_type!=="VIRTUAL"&&oe.app_name===l,e[10]=l,e[11]=S):S=e[11],s=u.filter(S),e[7]=u,e[8]=l,e[9]=s}else s=e[9];const A=s;let V;e[12]!==n?(V=tn(n),e[12]=n,e[13]=V):V=e[13];const $=V;let w,L;e[14]!==A||e[15]!==p||e[16]!==$||e[17]!==d||e[18]!==n||e[19]!==x||e[20]!==h?(w=()=>{if(d){const S=A[0];S&&h(S);return}p&&L()},L=()=>{$?(N("connect"),g(!0)):x(n)},e[14]=A,e[15]=p,e[16]=$,e[17]=d,e[18]=n,e[19]=x,e[20]=h,e[21]=w,e[22]=L):(w=e[21],L=e[22]);let B;e[23]!==n||e[24]!==x||e[25]!==b?(B=()=>{ne("connections_community_warning_confirmed",{registry_item_id:n.id}),g(!1),b==="connect"&&x(n),N(null)},e[23]=n,e[24]=x,e[25]=b,e[26]=B):B=e[26];const C=B;let P;e[27]!==D||e[28]!==F||e[29]!==_?(P={title:_,description:D,icon:F},e[27]=D,e[28]=F,e[29]=_,e[30]=P):P=e[30];let G;e[31]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(xe,{}),e[31]=G):G=e[31];let R;e[32]!==$||e[33]!==n._sourceIcon?(R=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=$,e[33]=n._sourceIcon,e[34]=R):R=e[34];let X;e[35]!==p||e[36]!==a||e[37]!==L||e[38]!==d||e[39]!==n.id?(X=d?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(z,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:a!==null,onClick:S=>{S.stopPropagation(),L()},children:a===n.id?t.jsx(ce,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=a,e[37]=L,e[38]=d,e[39]=n.id,e[40]=X):X=e[40];let o;e[41]!==R||e[42]!==X?(o=t.jsxs("div",{className:"flex items-center gap-2",children:[R,X]}),e[41]=R,e[42]=X,e[43]=o):o=e[43];let f;e[44]!==w||e[45]!==o||e[46]!==P?(f=t.jsx(Ce,{connection:P,fallbackIcon:G,onClick:w,headerActionsAlwaysVisible:!0,headerActions:o}),e[44]=w,e[45]=o,e[46]=P,e[47]=f):f=e[47];let O;e[48]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(Pe,{children:[t.jsx(Te,{children:"Community MCP Server"}),t.jsx(Ie,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=O):O=e[48];let H;e[49]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Le,{children:"Cancel"}),e[49]=H):H=e[49];let E;e[50]!==C?(E=t.jsxs(Ee,{children:[O,t.jsxs(Oe,{children:[H,t.jsx($e,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=E):E=e[51];let r;e[52]!==y||e[53]!==E?(r=t.jsx(Me,{open:y,onOpenChange:g,children:E}),e[52]=y,e[53]=E,e[54]=r):r=e[54];let T;return e[55]!==f||e[56]!==r?(T=t.jsxs(t.Fragment,{children:[f,r]}),e[55]=f,e[56]=r,e[57]=T):T=e[57],T}function sn({listState:v,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:u,enabledRegistries:m}){const{org:a}=Ne(),h=rt(),x=ke(),{data:y}=De.useSession(),g=qe(),b=zt(v),N=yt(),{granted:l}=ye("connections:manage"),{granted:j}=ye("agents:manage"),[d,k]=W.useState(new Set),_=d.size>0,[D,U]=W.useState(!1),[F,s]=W.useState(!1),[A,V]=W.useState(null),$=Bt(),w=b.filter(c=>!(n!=="ALL"&&c.connection_type!==n||p!=="ALL"&&c.status!==p)),L=gt(w),B=c=>{k(i=>{const M=new Set(i);return M.has(c)?M.delete(c):M.add(c),M})},C=()=>{k(new Set)},P=Ae(m,v.searchTerm),G=P.items,R=vt(P.loadMore,P.hasMore,P.isLoadingMore),X=new Set(b.filter(c=>c.app_name).map(c=>c.app_name)),o=u==="ALL"||m.some(c=>c.id===u)?u:"ALL",f=v.search.length>0,O=e==="all"||f?G.filter(c=>{if(o!=="ALL"&&c._registryId!==o)return!1;if(f){const i=we(c);if(i&&X.has(i))return!1}return!0}):[],H=e==="connected"||f?L:[],E=async c=>{if(!(!a||!y?.user?.id)){ne("connection_add_clicked",{action:"connect_new",registry_item_id:c.id,source:"connections_page"}),V(c.id);try{const i=bt(c,a.id,y.user.id,{remoteIndex:0}),M=i.connection_type==="STDIO",I=!!i.connection_url,q=M&&i.connection_headers&&typeof i.connection_headers=="object"&&"command"in i.connection_headers;if(!I&&!q){Q.error("This MCP Server cannot be connected: no connection method available"),V(null);return}const{id:K}=await g.create.mutateAsync(i),ve=new URL(`/api/${a.slug}/mcp/${K}`,window.location.origin),_e=await ct({url:ve.href,token:null,orgId:a.id});if(_e.supportsOAuth&&!_e.isAuthenticated){const{token:de,tokenInfo:se,error:fe}=await lt({connectionId:K,orgSlug:a.slug,scope:"offline_access"});if(fe||!de){ne("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:fe??"no_token"}),Q.error(`Authentication failed: ${fe??"no token received"}`);return}else{if(ne("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),se)try{(await fetch(`/api/${a.slug}/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:se.accessToken,refreshToken:se.refreshToken,expiresIn:se.expiresIn,scope:se.scope,clientId:se.clientId,clientSecret:se.clientSecret,tokenEndpoint:se.tokenEndpoint})})).ok?await g.update.mutateAsync({id:K,data:{}}):await g.update.mutateAsync({id:K,data:{connection_token:de}})}catch{await g.update.mutateAsync({id:K,data:{connection_token:de}})}else await g.update.mutateAsync({id:K,data:{connection_token:de}});await h.invalidateQueries({queryKey:dt.isMCPAuthenticated(ve.href,null)}),Q.success("Authentication successful")}}Q.success("Connected successfully")}catch(i){Q.error(`Failed to connect: ${i instanceof Error?i.message:String(i)}`)}finally{V(null)}}},r=Ft({connectionId:Vt,orgId:a.id,orgSlug:a.slug}),T=()=>{h.invalidateQueries({predicate:c=>{const i=c.queryKey;return i[1]===a.id&&i[3]==="collection"&&i[4]==="CONNECTIONS"}})},S=async()=>{U(!1);const c=[...d];ne("connections_bulk_delete",{count:c.length});let i=0;for(const M of c)try{(await r.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:M,force:!0}})).isError||i++}catch{}T(),Q.success(`Deleted ${i} connection${i!==1?"s":""}`),C()},oe=async c=>{const i=[...d];ne("connections_bulk_status_toggled",{count:i.length,to_status:c});let M=0;for(const I of i)try{await g.update.mutateAsync({id:I,data:{status:c}}),M++}catch{}T(),Q.success(`${c==="active"?"Enabled":"Disabled"} ${M} connection${M!==1?"s":""}`),C()},ge=async c=>{const i=$.find(q=>q.id===c);if(!i||!r)return;ne("connections_bulk_add_to_agent",{agent_id:c,count:d.size});const M=new Set(i.connections.map(q=>q.connection_id)),I=[...d].filter(q=>!M.has(q)).map(q=>({connection_id:q,selected_tools:null,selected_resources:null,selected_prompts:null}));if(I.length===0){Q.info("All selected connections are already in that agent");return}try{await r.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:c,data:{connections:[...i.connections,...I]}}}),h.invalidateQueries({predicate:q=>{const K=q.queryKey;return K[1]===a.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),Q.success(`Added ${I.length} connection${I.length!==1?"s":""} to "${i.title}"`),C()}catch{Q.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(Ct,{...N}),t.jsx(en,{open:D,onOpenChange:U,count:d.size,onConfirm:S}),t.jsx(Zt,{open:F,onOpenChange:s,agents:$,onConfirm:ge}),P.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(f?O.length===0&&w.length===0:e==="all"?O.length===0:w.length===0)?t.jsx(ft,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:v.search?`No Connections match "${v.search}"`:l?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[H.map(c=>{if(c.type==="group")return t.jsx(Gt,{group:c,onOpen:()=>{x({to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:c.key}})},selectionMode:_,selectedIds:d,onToggleSelect:B},c.key);const i=c.connection,M=d.has(i.id);return t.jsx(Ce,{connection:i,fallbackIcon:t.jsx(xe,{}),onClick:()=>_?B(i.id):x({to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:pe(i)}}),className:le(M&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(ze,{checked:M,onCheckedChange:()=>B(i.id),onClick:I=>I.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:le("overflow-hidden transition-all duration-150 ease-out",_?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(Ke,{children:[t.jsx(We,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:I=>I.stopPropagation(),children:t.jsx(Ge,{size:20})})}),t.jsxs(Xe,{align:"end",onClick:I=>I.stopPropagation(),children:[t.jsxs(he,{onClick:I=>{I.stopPropagation(),x({to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:pe(i)}})},children:[t.jsx(Qe,{size:16}),"Open"]}),(l||j)&&t.jsxs(he,{onClick:I=>{I.stopPropagation(),B(i.id)},children:[t.jsx(Ht,{size:16}),"Select"]}),l&&t.jsxs(he,{variant:"destructive",onClick:I=>{I.stopPropagation(),N.requestDelete(i)},children:[t.jsx(Ye,{size:16}),"Delete"]})]})]})})]})},i.id)}),O.map(c=>t.jsx(nn,{item:c,canManage:l,allConnections:b,connectedAppNames:X,connectingItemId:A,onNavigateConnected:i=>x({to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:pe(i)}}),onConnect:E},`catalog-${c._registryId}:${c.id}`)),(e==="all"||f)&&m.length>0&&t.jsx("div",{ref:R,className:"col-span-full h-4"}),(e==="all"||f)&&P.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ce,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(Yt,{count:d.size,total:w.length,canManage:l,canManageAgents:j,onSelectAll:()=>{k(new Set(w.map(c=>c.id)))},onDeselectAll:()=>k(new Set),onDelete:()=>U(!0),onAddToAgent:()=>s(!0),onToggleStatus:oe,onCancel:C})]})}function on(){const{org:v}=Ne(),e=ke(),n=tt({strict:!1}),{data:p}=De.useSession(),{stdioEnabled:u}=nt(),m=Pt(),{granted:a}=ye("connections:manage"),h=_t({namespace:v.slug,resource:"connections"}),x=qe(),[y,g]=st(ot.connectionsTab(v.slug),o=>n.tab==="all"||n.tab==="connected"?n.tab:o??"all"),[b,N]=W.useState("ALL"),[l,j]=W.useState("ALL"),[d,k]=W.useState("ALL"),_=xt(),U=Ae(_,h.searchTerm).items,F=h.search!==h.searchTerm,s=it({resolver:at(Kt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),A=s.watch("ui_type"),V=s.watch("connection_url"),$=s.watch("npx_package"),w=ue({uiType:A,connectionUrl:V??"",npxPackage:$??""})??be({uiType:A,connectionUrl:V??"",registryItems:U}),L=a&&n.action==="create",B=()=>{ne("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:v.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:v.slug},search:{}})},P=async o=>{let f,O=null,H=null,E=null;o.ui_type==="NPX"?(f="STDIO",O="",E=Xt(o.npx_package||"",o.env_vars||[])):o.ui_type==="STDIO"?(f="STDIO",O="",E=qt(o.stdio_command||"",o.stdio_args||"",o.stdio_cwd,o.env_vars||[])):(f=o.ui_type,O=o.connection_url||"",H=o.connection_token||null);const r=mt("conn");ne("connection_custom_created",{connection_type:f,ui_type:o.ui_type}),await x.create.mutateAsync({id:r,title:o.title,description:o.description||null,connection_type:f,connection_url:O,connection_token:H,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:v.id,icon:o.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),C(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:v.slug,appSlug:pe({app_name:null,connection_url:O,title:o.title,id:r})}})},G=o=>{o||(L&&C(),s.reset())},R=o=>{const f=o.trim();if(!f)return;const O=!!s.formState.dirtyFields.title,H=!!s.formState.dirtyFields.description,E=!!s.formState.dirtyFields.env_vars,r=S=>{if(S&&(!O&&!s.getValues("title").trim()&&S.title&&s.setValue("title",S.title,{shouldDirty:!1}),!H&&!(s.getValues("description")??"").trim()&&S.description&&s.setValue("description",S.description,{shouldDirty:!1}),!E&&S.envVarKeys?.length)){const oe=s.getValues("env_vars")??[],ge=new Set(oe.map(i=>i.key)),c=S.envVarKeys.filter(i=>!ge.has(i));c.length>0&&s.setValue("env_vars",[...oe,...c.map(i=>({key:i,value:""}))],{shouldDirty:!0})}},T=Wt(f);if(T&&u){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",T.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),r(ue({uiType:"NPX",npxPackage:T.packageName}));return}if(f.startsWith("http://")||f.startsWith("https://")){const S=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",S,{shouldDirty:!0}),s.setValue("connection_url",f,{shouldDirty:!0}),r(ue({uiType:S,connectionUrl:f})??be({uiType:S,connectionUrl:f,registryItems:U}));return}A==="NPX"&&r(ue({uiType:"NPX",npxPackage:f}))},X=a?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(z,{variant:"outline",onClick:B,children:[t.jsx(Je,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(me,{children:[(()=>{const o="Create Connection",f="Create a custom connection in your organization. Fill in the details below.",O=s.formState.isSubmitting?"Saving...":"Create Connection",H=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(J,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Type *"}),t.jsxs(Lt,{value:r.value,onValueChange:r.onChange,children:[t.jsx(ee,{children:t.jsx(Ot,{children:t.jsx($t,{})})}),t.jsxs(Et,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(te,{})]})}),A==="NPX"&&t.jsx(J,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"NPM Package *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value??"",onPaste:T=>{const S=T.clipboardData.getData("text");S&&(T.preventDefault(),s.setValue("npx_package",S.trim(),{shouldDirty:!0}),R(S))},onBlur:T=>{R(T.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(J,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Command *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"node, bun, python...",...r,value:r.value??""})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Arguments"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...r,value:r.value??""})}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Working Directory"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...r,value:r.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(te,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(J,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Environment Variables"}),t.jsx(ee,{children:t.jsx(Rt,{value:r.value??[],onChange:r.onChange})}),t.jsx(te,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(J,{control:s.control,name:"connection_url",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"URL *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...r,value:r.value??"",onPaste:T=>{const S=T.clipboardData.getData("text");S&&(T.preventDefault(),s.setValue("connection_url",S.trim(),{shouldDirty:!0}),R(S))},onBlur:T=>{R(T.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:w?.token?.label??"Token (optional)"}),t.jsx(ee,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...r,value:r.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"title",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Name *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"My Connection",...r})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"description",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Description"}),t.jsx(ee,{children:t.jsx(Mt,{placeholder:"A brief description of this connection",rows:3,...r,value:r.value??""})}),t.jsx(te,{})]})})]}),E=L;return m?t.jsx(Nt,{open:E,onOpenChange:G,children:t.jsxs(kt,{className:"max-h-[90vh]",children:[t.jsx(Dt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(At,{children:o}),t.jsx(wt,{className:"mt-1",children:f})]}),t.jsx(Tt,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Ze,{size:16})})})]})}),t.jsx(Se,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:H}),t.jsx(It,{children:t.jsx(z,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:O})})]})})]})}):t.jsx(Fe,{open:E,onOpenChange:G,children:t.jsxs(Ve,{className:"sm:max-w-[525px]",children:[t.jsxs(Be,{children:[t.jsx(Ue,{children:o}),t.jsx(He,{children:f})]}),t.jsx(Se,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:H}),t.jsxs(Re,{children:[t.jsx(z,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),t.jsx(z,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:O})]})]})})]})})})(),t.jsx(me.Content,{children:t.jsx(me.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(me.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(pt,{value:h.search,onChange:h.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:o=>{o.key==="Escape"&&(h.setSearch(""),o.target.blur())}}),t.jsx(ut,{sortKey:h.sortKey,sortDirection:h.sortDirection,onSort:h.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:b,onChange:o=>N(o||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:l,onChange:o=>j(o||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:d,onChange:o=>k(o||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(o=>({id:o.id,label:o.id.includes("community-registry")?"Community MCP Registry":o.title}))]}]:[]]})]}),X]}),t.jsx(ht,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:y,onTabChange:o=>{const f=o;f!==y&&ne("connections_page_tab_changed",{to_tab:f}),g(f)}}),t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:F?.5:1,transition:F?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:F?"none":"auto"},children:t.jsx(sn,{listState:h,activeTab:y,typeFilter:b,statusFilter:l,registryFilter:d,enabledRegistries:_})})})]})})})]})})}function zs(){const v=ae.c(1);let e;return v[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(et,{children:t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(on,{})})}),v[0]=e):e=v[0],e}export{zs as default};