@decocms/mesh 2.134.0 → 2.135.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/dist/client/assets/{AlertCircle-dxGFeayp.js → AlertCircle-C0eftc-S.js} +1 -1
  2. package/dist/client/assets/{AlignLeft-zf4ygcA_.js → AlignLeft-y_Ps49tB.js} +1 -1
  3. package/dist/client/assets/{ArrowDown-BfANN175.js → ArrowDown-BVK-2NZv.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-DKmEJ5pf.js → ArrowLeft-BNX_fMaj.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-BNm6R5tp.js → ArrowUp-N8lcMBug.js} +1 -1
  6. package/dist/client/assets/{Check-BuBqfL8V.js → Check-Cjs4C9GE.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-B-t884rD.js → CheckCircle-KfoOm4QY.js} +1 -1
  8. package/dist/client/assets/{CheckDone01-C_N43WOE.js → CheckDone01-BesDn4jt.js} +1 -1
  9. package/dist/client/assets/{CheckVerified02-CF--qrDr.js → CheckVerified02-dNCcvCnV.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-D15Vpp0r.js → ChevronDown-jKZz68gN.js} +1 -1
  11. package/dist/client/assets/{ChevronLeft-CJX984rp.js → ChevronLeft-DrJ63fdN.js} +1 -1
  12. package/dist/client/assets/{ChevronRight-u7jqeZNG.js → ChevronRight-O5hZNhHU.js} +1 -1
  13. package/dist/client/assets/{Clock-B88-VhpY.js → Clock-CZrEpwOM.js} +1 -1
  14. package/dist/client/assets/{Code01-DhSY1b20.js → Code01-DVgdcTZ1.js} +1 -1
  15. package/dist/client/assets/{Container-CFxptFeR.js → Container-BADgIox6.js} +1 -1
  16. package/dist/client/assets/{Copy01-D2l3XUry.js → Copy01-CwZDv92A.js} +1 -1
  17. package/dist/client/assets/{Dataflow03-TMmWfgl9.js → Dataflow03-BD9MOeSH.js} +1 -1
  18. package/dist/client/assets/{DotsHorizontal-CZq86zFa.js → DotsHorizontal-M2BFmBhE.js} +1 -1
  19. package/dist/client/assets/{DotsVertical-B78gtBdB.js → DotsVertical-B7FmF1Xu.js} +1 -1
  20. package/dist/client/assets/{Download01-DDJLkXru.js → Download01-9ocXQLzr.js} +1 -1
  21. package/dist/client/assets/{Edit01-CbZPkCJz.js → Edit01-kvm_TgXf.js} +1 -1
  22. package/dist/client/assets/Edit05-D4Vt7tOt.js +1 -0
  23. package/dist/client/assets/{Eye-vR70tVFn.js → Eye-BCmEvczH.js} +1 -1
  24. package/dist/client/assets/{File02-B1NunE2J.js → File02-CK_RNTh6.js} +1 -1
  25. package/dist/client/assets/{File06-D8w_IYOr.js → File06-B3E-bjor.js} +1 -1
  26. package/dist/client/assets/{FilterLines-BY-bo6_s.js → FilterLines-DAyCv-Xk.js} +1 -1
  27. package/dist/client/assets/{Globe01-CL7GrOsx.js → Globe01-jKd57I4x.js} +1 -1
  28. package/dist/client/assets/{Globe02-6j3SB4QZ.js → Globe02-D-yCMf5N.js} +1 -1
  29. package/dist/client/assets/{Grid01-DjcW2Js4.js → Grid01-DRBx9FRw.js} +1 -1
  30. package/dist/client/assets/{Hash02-BMwtcDtI.js → Hash02-CyfLltcT.js} +1 -1
  31. package/dist/client/assets/{Home02-CMWrNstp.js → Home02-BcZSV_S0.js} +1 -1
  32. package/dist/client/assets/{Image01-oZtE9Z5q.js → Image01-Dg_KnZBd.js} +1 -1
  33. package/dist/client/assets/{Inbox01-xF_R8liT.js → Inbox01-nkL2-2Zq.js} +1 -1
  34. package/dist/client/assets/{InfoCircle-B_WtF_e0.js → InfoCircle-Ipgqrfv0.js} +1 -1
  35. package/dist/client/assets/{Key01-Cvjt_ykt.js → Key01-CyP1-GBg.js} +1 -1
  36. package/dist/client/assets/{LayersTwo01-f778oNbj.js → LayersTwo01-rKs-Uww3.js} +1 -1
  37. package/dist/client/assets/{LayoutLeft-BXJHafgx.js → LayoutLeft-BH3urRkN.js} +1 -1
  38. package/dist/client/assets/Link01-D-1AbdDy.js +1 -0
  39. package/dist/client/assets/{LinkExternal01-DY3cItdE.js → LinkExternal01-DIMSPk19.js} +1 -1
  40. package/dist/client/assets/{List-Be3XBHwN.js → List-BzhQuBp2.js} +1 -1
  41. package/dist/client/assets/{Loading01-BLoQsWVt.js → Loading01-BSgMOGt8.js} +1 -1
  42. package/dist/client/assets/{Lock01-Cj3RiFKG.js → Lock01-T7BR0zuk.js} +1 -1
  43. package/dist/client/assets/{Play-CCz3CWMJ.js → Play-CBKoaI1n.js} +1 -1
  44. package/dist/client/assets/{Plus-4zX3n4bH.js → Plus-kcfCg7FH.js} +1 -1
  45. package/dist/client/assets/{RefreshCcw01-DzE0Vt_s.js → RefreshCcw01-DiAOUquJ.js} +1 -1
  46. package/dist/client/assets/{Save01-DiUMsefH.js → Save01-CgyWcG00.js} +1 -1
  47. package/dist/client/assets/{SearchMd-BvHN4xgB.js → SearchMd-DyDznS8C.js} +1 -1
  48. package/dist/client/assets/{Settings01-B5kunEo2.js → Settings01-B90Jx8ZC.js} +1 -1
  49. package/dist/client/assets/{Shield01-DrTQ94s0.js → Shield01-B2Y9HIu6.js} +1 -1
  50. package/dist/client/assets/{Terminal-DQnj9LXz.js → Terminal-BxQK5nsd.js} +1 -1
  51. package/dist/client/assets/{Trash01-BvIumE4M.js → Trash01-Dhrt1Goe.js} +1 -1
  52. package/dist/client/assets/{Upload01-DLPOqCLa.js → Upload01-Dja0ZgIT.js} +1 -1
  53. package/dist/client/assets/{Users03-CUxh9_Jy.js → Users03-DHATZiFL.js} +1 -1
  54. package/dist/client/assets/{X-CpsrVd7E.js → X-BpJJDPzv.js} +1 -1
  55. package/dist/client/assets/{XCircle-BcvU_Xzf.js → XCircle-D52fnGO6.js} +1 -1
  56. package/dist/client/assets/{XClose-CnTCpAeI.js → XClose-DcdK3w1e.js} +1 -1
  57. package/dist/client/assets/{Zap-BACXfgKn.js → Zap-CP5UH1Dw.js} +1 -1
  58. package/dist/client/assets/{agent-connections-preview-BTescy5G.js → agent-connections-preview-v4ndb6aJ.js} +1 -1
  59. package/dist/client/assets/agent-detail-DyOlL9jH.js +2 -0
  60. package/dist/client/assets/{agents-DkUxuyJc.js → agents-CB6IRof4.js} +1 -1
  61. package/dist/client/assets/{alert-dialog-B0yEBEkb.js → alert-dialog-PSmHhGOE.js} +2 -2
  62. package/dist/client/assets/{auth-catchall-CZYx2ePL.js → auth-catchall-CplMsxXE.js} +1 -1
  63. package/dist/client/assets/{avatar-BeiX4aSz.js → avatar-VPsqzp0K.js} +1 -1
  64. package/dist/client/assets/{badge-UPowR1Nj.js → badge-DSAomO1_.js} +1 -1
  65. package/dist/client/assets/{binder-DUACCYIe.js → binder-8_Oel13A.js} +1 -1
  66. package/dist/client/assets/{breadcrumb-DxXcAXh7.js → breadcrumb-Dxn3nF83.js} +1 -1
  67. package/dist/client/assets/{card-BRjix5ol.js → card-CRGkE-QK.js} +1 -1
  68. package/dist/client/assets/{chart-FIHtzVp6.js → chart-B-ayLZ8-.js} +1 -1
  69. package/dist/client/assets/{checkbox-Df-Mj-oX.js → checkbox-Dj6Qb3KC.js} +1 -1
  70. package/dist/client/assets/{circle-alert-CHATLFG-.js → circle-alert-DcuI5GGM.js} +1 -1
  71. package/dist/client/assets/{collapsible-CG7okAAn.js → collapsible-D2Mpu85K.js} +1 -1
  72. package/dist/client/assets/{collection-detail-DnFoqwX5.js → collection-detail-FNWcZVfu.js} +3 -3
  73. package/dist/client/assets/{collection-search-BgstpGbD.js → collection-search-FSS_Lkwz.js} +1 -1
  74. package/dist/client/assets/{collection-tab-CkymCS_K.js → collection-tab-FKeWJS1r.js} +1 -1
  75. package/dist/client/assets/{collection-table-wrapper-B7II4YYC.js → collection-table-wrapper-C3jcR2VW.js} +1 -1
  76. package/dist/client/assets/{collection-tabs-nglpt7Dm.js → collection-tabs-CK4hfCPZ.js} +1 -1
  77. package/dist/client/assets/{command-BvChE5AN.js → command-BK3ZFocj.js} +1 -1
  78. package/dist/client/assets/{connect-C_zUgms_.js → connect-D2cFEIR8.js} +1 -1
  79. package/dist/client/assets/{connection-card-DE2PfyYV.js → connection-card-GLkE1rwd.js} +1 -1
  80. package/dist/client/assets/connection-detail-PegJ7rZR.js +1 -0
  81. package/dist/client/assets/connections-C18lG_Ow.js +1 -0
  82. package/dist/client/assets/{constants--aQ9HnxF.js → constants-3MhIA0pZ.js} +1 -1
  83. package/dist/client/assets/constants-Csevqii0.js +1 -0
  84. package/dist/client/assets/{create-organization-dialog-BW4s7GqS.js → create-organization-dialog-CR8t2T4R.js} +1 -1
  85. package/dist/client/assets/{create-project-dialog-BMiLf2Mr.js → create-project-dialog-DFaC5_HT.js} +1 -1
  86. package/dist/client/assets/{danger-BAlOLeDE.js → danger-BEh_Y1ce.js} +1 -1
  87. package/dist/client/assets/{danger-zone-PDtJsuS3.js → danger-zone-CpwKIZ0p.js} +1 -1
  88. package/dist/client/assets/{decopilot-events-DZodCqX1.js → decopilot-events-CA9aFPSQ.js} +1 -1
  89. package/dist/client/assets/{dependencies-DOcreK8_.js → dependencies-mwSdsJgD.js} +1 -1
  90. package/dist/client/assets/{dialog-CrYlSCa6.js → dialog-CPWJMuHX.js} +1 -1
  91. package/dist/client/assets/{dropdown-menu-DvfBJ25L.js → dropdown-menu-DW1GDWfN.js} +1 -1
  92. package/dist/client/assets/{dynamic-plugin-layout-1UBvkRf8.js → dynamic-plugin-layout-CY4G5d8i.js} +1 -1
  93. package/dist/client/assets/{editable-task-title-emHsd6RF.js → editable-task-title-D4gyoQ4x.js} +1 -1
  94. package/dist/client/assets/{empty-state-C2LU6BeW.js → empty-state-boxcABsi.js} +1 -1
  95. package/dist/client/assets/{env-vars-editor-DM7ragIP.js → env-vars-editor-x5YLFI-P.js} +1 -1
  96. package/dist/client/assets/{extract-connection-data-DtOGbK2O.js → extract-connection-data-D40JrSD8.js} +1 -1
  97. package/dist/client/assets/{file-browser-dzB3GMud.js → file-browser-CrcClgQC.js} +2 -2
  98. package/dist/client/assets/{form-DKOb9Dxi.js → form-7Q-FsNtX.js} +1 -1
  99. package/dist/client/assets/{general-C8KCERL-.js → general-C0buekt8.js} +1 -1
  100. package/dist/client/assets/{grid-view-Dp6SbR5A.js → grid-view-J96VhXfb.js} +1 -1
  101. package/dist/client/assets/{home-DpLONLMM.js → home-H46nCwT5.js} +1 -1
  102. package/dist/client/assets/icon-picker-DPVWLIZ3.js +1 -0
  103. package/dist/client/assets/{index-BkxNgQ-z.js → index-3zbyfLqi.js} +3 -3
  104. package/dist/client/assets/{index-u5kBBr5i.js → index-CW624IAb.js} +3 -3
  105. package/dist/client/assets/{index-nMGos9dp.css → index-Cr3FYIgR.css} +1 -1
  106. package/dist/client/assets/{index-Bq_4mEQF.js → index-CsXxowFD.js} +1 -1
  107. package/dist/client/assets/{index-CuJORTyw.js → index-D7M37zt-.js} +1 -1
  108. package/dist/client/assets/{index-UbMd2WCz.js → index-DFlYm7QG.js} +1 -1
  109. package/dist/client/assets/{index-B4YFEuZr.js → index-DZgOYNf-.js} +1 -1
  110. package/dist/client/assets/{index-CKt9M-ST.js → index-DqzqEzLf.js} +1 -1
  111. package/dist/client/assets/{index-dKQNml8k.js → index-DziKeC8s.js} +1 -1
  112. package/dist/client/assets/{index-ZJA9ZP0w.js → index-ZgdunwGI.js} +1 -1
  113. package/dist/client/assets/{infiniteQueryObserver-DFroUYRE.js → infiniteQueryObserver-DkOiuhUg.js} +1 -1
  114. package/dist/client/assets/{input-BxWPl4Ur.js → input-DVv1wKLp.js} +1 -1
  115. package/dist/client/assets/{integration-icon-DqBJsR0X.js → integration-icon-_0Y5dukY.js} +1 -1
  116. package/dist/client/assets/{label-DQ6CQRMq.js → label-CfzCa7Vm.js} +1 -1
  117. package/dist/client/assets/{layout-0mFUwCP9.js → layout-CFi42XXk.js} +1 -1
  118. package/dist/client/assets/{layout-rnNZXdmD.js → layout-DemCWqB_.js} +1 -1
  119. package/dist/client/assets/{localstorage-keys-2beZrYfY.js → localstorage-keys-D2dx16dH.js} +1 -1
  120. package/dist/client/assets/{login-DcPWsiJb.js → login-BXUbt1kV.js} +1 -1
  121. package/dist/client/assets/{markdown-08iefd1w.js → markdown-89WWPNXO.js} +1 -1
  122. package/dist/client/assets/mcp-app-renderer-MJ3LmhBP.js +11 -0
  123. package/dist/client/assets/{mcp-oauth-hrdldmcp.js → mcp-oauth-CPAKRpWT.js} +1 -1
  124. package/dist/client/assets/{mcp-server-card-DopVvusq.js → mcp-server-card-gl2xF4cu.js} +1 -1
  125. package/dist/client/assets/{mcp-server-detail-6bJ8ASSa.js → mcp-server-detail-CzmUyYsJ.js} +2 -2
  126. package/dist/client/assets/{members-Do6CpQ6P.js → members-BjMeazP1.js} +1 -1
  127. package/dist/client/assets/monaco-editor-Qwuf1rYM.js +19 -0
  128. package/dist/client/assets/{monitoring-CKBrV8zM.js → monitoring-C-vcUHdF.js} +3 -3
  129. package/dist/client/assets/{monitoring-dashboard-edit-CisDX-AH.js → monitoring-dashboard-edit-DdMgOlQK.js} +1 -1
  130. package/dist/client/assets/{monitoring-dashboard-view-CLglwuRf.js → monitoring-dashboard-view-D7MwbzDH.js} +2 -2
  131. package/dist/client/assets/{oauth-callback-EWqhoS77.js → oauth-callback-BnBZDVD6.js} +1 -1
  132. package/dist/client/assets/{page-BIGqii57.js → page-BNQcXJwH.js} +1 -1
  133. package/dist/client/assets/{page-CrIdFE4e.js → page-DvC0ZQe5.js} +1 -1
  134. package/dist/client/assets/{plugin-empty-state-DgfbXovL.js → plugin-empty-state-BuLjcm9B.js} +1 -1
  135. package/dist/client/assets/{plugin-empty-state-AsJFZqlq.js → plugin-empty-state-DfdPh9Ts.js} +1 -1
  136. package/dist/client/assets/{plugin-header-DMTu3kKy.js → plugin-header-Bi-8qclQ.js} +1 -1
  137. package/dist/client/assets/{plugin-header-CdB0sXQc.js → plugin-header-CKLaOHoT.js} +1 -1
  138. package/dist/client/assets/plugins-cGh_gky2.js +1 -0
  139. package/dist/client/assets/popover-7xIJyxqf.js +1 -0
  140. package/dist/client/assets/project-app-view-C_PL72tZ.js +1 -0
  141. package/dist/client/assets/{project-layout-CxbfzuHT.js → project-layout-DIwsntjO.js} +1 -1
  142. package/dist/client/assets/{project-plugins-OrxVzBYc.js → project-plugins-B1sb2cJf.js} +1 -1
  143. package/dist/client/assets/{projects-list-CaeO-dsb.js → projects-list-D0DH8k1c.js} +1 -1
  144. package/dist/client/assets/{readme-viewer-CvFtkeFt.js → readme-viewer-BvJA0DXw.js} +1 -1
  145. package/dist/client/assets/{registry-layout-C_lUsUO4.js → registry-layout-BJCo3ZwE.js} +3 -3
  146. package/dist/client/assets/{registry-utils-Bm8aYhvn.js → registry-utils-Cx5oa6Ne.js} +1 -1
  147. package/dist/client/assets/{reports-layout-COQgk5-M.js → reports-layout-DYTNa8h-.js} +1 -1
  148. package/dist/client/assets/{reset-password-BHTKtR6U.js → reset-password-DFzqJN6I.js} +1 -1
  149. package/dist/client/assets/{resizable-DNctE6m6.js → resizable-PA9Y3YAt.js} +1 -1
  150. package/dist/client/assets/{save-actions-DgW9lLRI.js → save-actions-CXaB5WYr.js} +1 -1
  151. package/dist/client/assets/scroll-area-DoXCMB9j.js +1 -0
  152. package/dist/client/assets/{select-CHQkyynJ.js → select-DaTaxi5W.js} +1 -1
  153. package/dist/client/assets/{shell-layout-CZrDFZIJ.js → shell-layout-BqF7J7La.js} +2 -2
  154. package/dist/client/assets/{sidebar-settings-C8pM5SP-.js → sidebar-settings-BZwWXZuX.js} +1 -1
  155. package/dist/client/assets/{skeleton-Bla1LCSZ.js → skeleton-C9OYLAME.js} +1 -1
  156. package/dist/client/assets/{spinner-B_k6AtHn.js → spinner-RGw-eBKN.js} +1 -1
  157. package/dist/client/assets/{store-invite-CVXBjHsb.js → store-invite-Fvga4enp.js} +1 -1
  158. package/dist/client/assets/{switch-BX7m8ylT.js → switch-CKTW0M5S.js} +1 -1
  159. package/dist/client/assets/{table-BJ3W5Geb.js → table-Dr33PlEJ.js} +1 -1
  160. package/dist/client/assets/{tabs-tcquyh90.js → tabs-t9dEapgX.js} +1 -1
  161. package/dist/client/assets/tasks-OJAbxkK1.js +1 -0
  162. package/dist/client/assets/{tasks-panel-CIityBOn.js → tasks-panel-DLy55FSi.js} +1 -1
  163. package/dist/client/assets/{textarea-CceQB-N2.js → textarea-CNTbi5Nk.js} +1 -1
  164. package/dist/client/assets/{time-range-picker-B9lHM6xz.js → time-range-picker-Do8ix4-A.js} +2 -2
  165. package/dist/client/assets/{toggle-group-KbsXFu3M.js → toggle-group-Ck1YCESf.js} +1 -1
  166. package/dist/client/assets/{tools-list-Cb9H3DsC.js → tools-list-DLfR0anP.js} +1 -1
  167. package/dist/client/assets/{tooltip-DvMRS01W.js → tooltip-CzsT_Xmu.js} +1 -1
  168. package/dist/client/assets/{topbar-portal-CyxFPAeb.js → topbar-portal-pZDSuDEC.js} +1 -1
  169. package/dist/client/assets/{types-9lUbCnT7.js → types-BFBQ7LBo.js} +1 -1
  170. package/dist/client/assets/{use-binding-CVLYzFG-.js → use-binding-Cz4OU82g.js} +1 -1
  171. package/dist/client/assets/{use-connection-DjiXkPUz.js → use-connection-Dlr-wAwU.js} +1 -1
  172. package/dist/client/assets/{use-copy-DiVO6tbG.js → use-copy-C0vtJ5Ye.js} +1 -1
  173. package/dist/client/assets/{use-create-virtual-mcp-DnOGpm5h.js → use-create-virtual-mcp-CsNENE7l.js} +1 -1
  174. package/dist/client/assets/{use-install-from-registry-kgqBLGhb.js → use-install-from-registry-C_roXw8y.js} +1 -1
  175. package/dist/client/assets/{use-list-state-CCFlT7yz.js → use-list-state-DUq5hUJc.js} +1 -1
  176. package/dist/client/assets/{use-llm-Bkjj502R.js → use-llm-B6AzV9Iw.js} +1 -1
  177. package/dist/client/assets/{use-mcp-resources-DS8p1Owh.js → use-mcp-resources-DjDOJ-nS.js} +1 -1
  178. package/dist/client/assets/{use-mcp-tools-CHOGR3no.js → use-mcp-tools-WZlm0cnW.js} +1 -1
  179. package/dist/client/assets/{use-members-94lmhn12.js → use-members-BLjJfltI.js} +1 -1
  180. package/dist/client/assets/{use-mobile-BArkW6j1.js → use-mobile-CzcHKmhL.js} +1 -1
  181. package/dist/client/assets/{use-project-BRlk9_cU.js → use-project-CIyZUlkd.js} +1 -1
  182. package/dist/client/assets/{use-settings-modal-QjZt77PI.js → use-settings-modal-BU5fs4m_.js} +1 -1
  183. package/dist/client/assets/{use-view-mode-3_G2qIMG.js → use-view-mode-BadETRuZ.js} +1 -1
  184. package/dist/client/assets/{use-virtual-mcp-Wj5StsuR.js → use-virtual-mcp-BjGr5L6n.js} +1 -1
  185. package/dist/client/assets/useInfiniteQuery-CGGEgi5q.js +1 -0
  186. package/dist/client/assets/{useMutation-DtOoZO7h.js → useMutation-CqJLXgOK.js} +1 -1
  187. package/dist/client/assets/useQuery-DWLTdDjg.js +1 -0
  188. package/dist/client/assets/useSuspenseInfiniteQuery-YGfVGowO.js +1 -0
  189. package/dist/client/assets/{user-BcEL6pjj.js → user-vKqDbtP6.js} +1 -1
  190. package/dist/client/assets/{workflow-Bdyylvch.js → workflow--wyybZpA.js} +1 -1
  191. package/dist/client/index.html +2 -2
  192. package/dist/server/cli.js +2 -2
  193. package/dist/server/migrate.js +2 -2
  194. package/dist/server/server.js +2 -2
  195. package/package.json +1 -1
  196. package/dist/client/assets/agent-detail-C9_VIiuY.js +0 -2
  197. package/dist/client/assets/connection-detail-CIlY792n.js +0 -1
  198. package/dist/client/assets/connections-e6eEADmb.js +0 -1
  199. package/dist/client/assets/constants-DoLvwboP.js +0 -1
  200. package/dist/client/assets/mcp-app-renderer-DlqJcoS_.js +0 -11
  201. package/dist/client/assets/plugins-AJrV2JnY.js +0 -1
  202. package/dist/client/assets/popover-CJnKtmVV.js +0 -1
  203. package/dist/client/assets/project-app-view-CrOJlRSX.js +0 -1
  204. package/dist/client/assets/scroll-area-Ce3JzMbc.js +0 -19
  205. package/dist/client/assets/tasks-CJro_3w3.js +0 -1
  206. package/dist/client/assets/useInfiniteQuery-cPtxg-KP.js +0 -1
  207. package/dist/client/assets/useQuery-Cj-miqA2.js +0 -1
  208. package/dist/client/assets/useSuspenseInfiniteQuery-D62VIKAF.js +0 -1
@@ -1,2 +0,0 @@
1
- import{r as _,c as k,j as t,E as fe,B as J,v as ae,_ as Je,u as de,V as Ze,s as Qe,t as ce,b as Xe,e as et,O as Fe,l as tt,k as st,aD as lt,q as ot}from"./index-BkxNgQ-z.js";import{b as Oe,i as nt,c as it,u as rt,C as at,d as ct}from"./collapsible-CG7okAAn.js";import{C as dt,E as mt}from"./collection-search-BgstpGbD.js";import{I as ge}from"./integration-icon-DqBJsR0X.js";import{u as ut}from"./index-B4YFEuZr.js";import{B as $e}from"./badge-UPowR1Nj.js";import{I as Me}from"./input-BxWPl4Ur.js";import{S as ft}from"./switch-BX7m8ylT.js";import{T as xt}from"./textarea-CceQB-N2.js";import{a as xe,c as ve,T as pe,b as he}from"./tooltip-DvMRS01W.js";import{h as pt,f as ht}from"./use-connection-DjiXkPUz.js";import{u as gt,a as jt}from"./use-virtual-mcp-Wj5StsuR.js";import{i as Ge}from"./ChevronRight-u7jqeZNG.js";import{n as bt}from"./select-CHQkyynJ.js";import{i as De}from"./File02-B1NunE2J.js";import{i as Le}from"./Loading01-BLoQsWVt.js";import{i as Nt}from"./Play-CCz3CWMJ.js";import{s as Ve}from"./Plus-4zX3n4bH.js";import{t as yt}from"./Users03-CUxh9_Jy.js";import{B as vt,a as Ct,b as Be,d as _t,e as St,c as Tt}from"./breadcrumb-DxXcAXh7.js";import{a as kt,V as wt}from"./layout-rnNZXdmD.js";import{S as Et}from"./save-actions-DgW9lLRI.js";import{a as It}from"./tools-list-Cb9H3DsC.js";import{C as ze}from"./checkbox-Df-Mj-oX.js";import{e as At,a as He,D as Ue,b as Ot,c as $t}from"./dialog-CrYlSCa6.js";import{T as Ce,a as Dt,b as _e,c as Lt}from"./tabs-tcquyh90.js";import{u as je,a as zt}from"./constants--aQ9HnxF.js";import{c as Rt}from"./use-mcp-tools-CHOGR3no.js";import{a as Pt}from"./use-mcp-resources-DS8p1Owh.js";import{u as Mt}from"./decopilot-events-DZodCqX1.js";import{s as Ke}from"./slugify-CEUa2lfQ.js";import{I as Vt,R as Bt,a as Ft}from"./index-Bq_4mEQF.js";import{i as be}from"./Check-BuBqfL8V.js";import{i as Gt}from"./Code01-DhSY1b20.js";import{a as Re}from"./Copy01-D2l3XUry.js";import{i as Se}from"./InfoCircle-B_WtF_e0.js";import{i as Ht}from"./Key01-Cvjt_ykt.js";import{A as Ut}from"./agent-connections-preview-BTescy5G.js";import"./use-llm-Bkjj502R.js";import"./use-binding-CVLYzFG-.js";import"./binder-DUACCYIe.js";import"./useQuery-Cj-miqA2.js";import"./localstorage-keys-2beZrYfY.js";import"./useMutation-DtOoZO7h.js";import"./skeleton-Bla1LCSZ.js";import"./AlignLeft-zf4ygcA_.js";import"./ArrowLeft-DKmEJ5pf.js";import"./ChevronDown-D15Vpp0r.js";import"./Image01-oZtE9Z5q.js";import"./RefreshCcw01-DzE0Vt_s.js";import"./SearchMd-BvHN4xgB.js";import"./Settings01-B5kunEo2.js";import"./useSuspenseInfiniteQuery-D62VIKAF.js";import"./infiniteQueryObserver-DFroUYRE.js";import"./Container-CFxptFeR.js";import"./index-dKQNml8k.js";import"./Save01-DiUMsefH.js";import"./collection-table-wrapper-B7II4YYC.js";import"./dropdown-menu-DvfBJ25L.js";import"./ArrowDown-BfANN175.js";import"./ArrowUp-BNm6R5tp.js";import"./Grid01-DjcW2Js4.js";import"./List-Be3XBHwN.js";import"./table-BJ3W5Geb.js";import"./card-BRjix5ol.js";import"./types-9lUbCnT7.js";import"./Eye-vR70tVFn.js";import"./Globe02-6j3SB4QZ.js";import"./LayersTwo01-f778oNbj.js";import"./X-CpsrVd7E.js";const We=({size:o=24,color:e="currentColor",...s})=>_.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},_.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}));We.displayName="Circle";const Ne=({size:o=24,color:e="currentColor",...s})=>_.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},_.createElement("path",{d:"m9.75 20.75 1.473.818c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l1.473-.818m-9-2.5-1.427-.793c-.3-.166-.45-.25-.558-.368a1 1 0 0 1-.215-.364C3 16.573 3 16.401 3 16.06V14.5m0-5V7.942c0-.343 0-.514.05-.667a1 1 0 0 1 .215-.364c.109-.119.258-.202.558-.368L5.25 5.75m4.5-2.5 1.473-.818c.284-.158.425-.237.576-.267a1 1 0 0 1 .402 0c.15.03.292.11.576.267l1.473.818m4.5 2.5 1.427.793c.3.166.45.25.558.368a1 1 0 0 1 .215.364c.05.153.05.324.05.667V9.5m0 5v1.559c0 .342 0 .514-.05.666a.999.999 0 0 1-.215.364c-.109.119-.258.202-.558.368l-1.427.793m-9-7.5L12 12m0 0 2.25-1.25M12 12v2.5M3 7l2.25 1.25m13.5 0L21 7m-9 12.5V22"}));Ne.displayName="CubeOutline";const Ye=({size:o=24,color:e="currentColor",...s})=>_.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},_.createElement("path",{d:"m12 5.5-4.638 6.747c-.28.406-.42.609-.41.778a.5.5 0 0 0 .195.373c.135.102.38.102.874.102H12v5l4.638-6.747c.28-.406.42-.609.41-.778a.5.5 0 0 0-.195-.373c-.135-.102-.38-.102-.874-.102H12v-5Z"}),_.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}));Ye.displayName="ZapCircle";function Te(o){return o===null?"all":o?.length??0}function Kt(o,e){const s=o[e];if(!s)return"";const i=[];return s.tools===null?i.push("all tools"):s.tools&&s.tools.length>0&&i.push(`${s.tools.length} tools`),s.resources===null?i.push("all resources"):s.resources&&s.resources.length>0&&i.push(`${s.resources.length} resources`),s.prompts===null?i.push("all prompts"):s.prompts&&s.prompts.length>0&&i.push(`${s.prompts.length} prompts`),i.join(", ")}function Wt(o,e){const s=o[e];return s?!((s.tools===void 0||s.tools!==null&&s.tools.length===0)&&(s.resources===void 0||s.resources!==null&&s.resources.length===0)&&(s.prompts===void 0||s.prompts!==null&&s.prompts.length===0)):!1}const Yt={tools:null,resources:null,prompts:null};function ke(){const o=k.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(Le,{className:"animate-spin text-muted-foreground",size:24})}),o[0]=e):e=o[0],e}function we(o){return({error:e})=>e?.message?.includes("Method not found")||e?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:o})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(Je,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:e?.message?e.message.length>200?`${e.message.slice(0,200)}...`:e.message:"An unexpected error occurred"})]})]})}function qt(o){const e=k.c(23),{item:s,isSelected:i,onToggle:l,disabled:n}=o,d=n?"cursor-not-allowed opacity-50":"cursor-pointer",a=i?"bg-accent/25":"hover:bg-muted/50";let r;e[0]!==d||e[1]!==a?(r=ae("flex items-start gap-3 p-4 rounded-lg transition-colors",d,a),e[0]=d,e[1]=a,e[2]=r):r=e[2];let c;e[3]!==s.name?(c=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:s.name}),e[3]=s.name,e[4]=c):c=e[4];let p;e[5]!==s.tags?(p=s.tags&&t.jsx("span",{className:"shrink-0",children:s.tags}),e[5]=s.tags,e[6]=p):p=e[6];let g;e[7]!==c||e[8]!==p?(g=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c,p]}),e[7]=c,e[8]=p,e[9]=g):g=e[9];let x;e[10]!==s.description?(x=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[10]=s.description,e[11]=x):x=e[11];let h;e[12]!==g||e[13]!==x?(h=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[g,x]}),e[12]=g,e[13]=x,e[14]=h):h=e[14];let m;e[15]!==n||e[16]!==i||e[17]!==l?(m=t.jsx(ze,{checked:i,onCheckedChange:l,disabled:n,className:"mt-0.5"}),e[15]=n,e[16]=i,e[17]=l,e[18]=m):m=e[18];let u;return e[19]!==r||e[20]!==h||e[21]!==m?(u=t.jsxs("label",{className:r,children:[h,m]}),e[19]=r,e[20]=h,e[21]=m,e[22]=u):u=e[22],u}function Pe(o){const e=k.c(32),{items:s,selections:i,onToggle:l,onToggleAll:n,emptyMessage:d,disabled:a}=o;let r,c,p,g,x;if(e[0]!==a||e[1]!==d||e[2]!==s||e[3]!==l||e[4]!==n||e[5]!==i){x=Symbol.for("react.early_return_sentinel");e:{const u=s.map(Jt);if(s.length===0){let v;e[11]!==d?(v=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:d})}),e[11]=d,e[12]=v):v=e[12],x=v;break e}p="flex flex-col h-full";const b=a?"cursor-not-allowed opacity-50":"cursor-pointer";let f;e[13]!==b?(f=ae("flex items-start gap-3 p-4",b),e[13]=b,e[14]=f):f=e[14];let j;e[15]!==s.length?(j=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsxs("span",{className:"text-sm font-medium",children:["Select All (",s.length,")"]})}),e[15]=s.length,e[16]=j):j=e[16];const y=i===null;let C;e[17]!==a||e[18]!==n||e[19]!==y?(C=t.jsx(ze,{checked:y,onCheckedChange:n,disabled:a,className:"mt-0.5"}),e[17]=a,e[18]=n,e[19]=y,e[20]=C):C=e[20],e[21]!==C||e[22]!==f||e[23]!==j?(g=t.jsx("div",{className:"px-4 border-b border-border shrink-0",children:t.jsxs("label",{className:f,children:[j,C]})}),e[21]=C,e[22]=f,e[23]=j,e[24]=g):g=e[24],r="flex-1 overflow-auto px-4 py-3 space-y-1",c=s.map(v=>t.jsx(qt,{item:v,isSelected:i===null||i?.includes(v.id),onToggle:()=>l(v.id,u),disabled:a},v.id))}e[0]=a,e[1]=d,e[2]=s,e[3]=l,e[4]=n,e[5]=i,e[6]=r,e[7]=c,e[8]=p,e[9]=g,e[10]=x}else r=e[6],c=e[7],p=e[8],g=e[9],x=e[10];if(x!==Symbol.for("react.early_return_sentinel"))return x;let h;e[25]!==r||e[26]!==c?(h=t.jsx("div",{className:r,children:c}),e[25]=r,e[26]=c,e[27]=h):h=e[27];let m;return e[28]!==p||e[29]!==g||e[30]!==h?(m=t.jsxs("div",{className:p,children:[g,h]}),e[28]=p,e[29]=g,e[30]=h,e[31]=m):m=e[31],m}function Jt(o){return o.id}function Zt(o){const e=k.c(13),{connectionId:s,selections:i,onToggle:l,onToggleAll:n,disabled:d}=o,{org:a}=de();let r;e[0]!==s||e[1]!==a.id?(r={connectionId:s,orgId:a.id},e[0]=s,e[1]=a.id,e[2]=r):r=e[2];const c=je(r);let p;e[3]!==c?(p={client:c},e[3]=c,e[4]=p):p=e[4];const{data:g}=Rt(p);let x;e[5]!==g.tools?(x=g.tools.map(Qt),e[5]=g.tools,e[6]=x):x=e[6];const h=x;let m;return e[7]!==d||e[8]!==h||e[9]!==l||e[10]!==n||e[11]!==i?(m=t.jsx(Pe,{items:h,selections:i,onToggle:l,onToggleAll:n,emptyMessage:"No tools available",disabled:d}),e[7]=d,e[8]=h,e[9]=l,e[10]=n,e[11]=i,e[12]=m):m=e[12],m}function Qt(o){return{id:o.name,name:o.name,description:o.description,tags:t.jsx(It,{annotations:o.annotations,_meta:o._meta})}}function Xt(o){const e=k.c(13),{connectionId:s,selections:i,onToggle:l,onToggleAll:n,disabled:d}=o,{org:a}=de();let r;e[0]!==s||e[1]!==a.id?(r={connectionId:s,orgId:a.id},e[0]=s,e[1]=a.id,e[2]=r):r=e[2];const c=je(r);let p;e[3]!==c?(p={client:c},e[3]=c,e[4]=p):p=e[4];const{data:g}=Pt(p);let x;e[5]!==g.resources?(x=g.resources.map(es),e[5]=g.resources,e[6]=x):x=e[6];const h=x;let m;return e[7]!==d||e[8]!==h||e[9]!==l||e[10]!==n||e[11]!==i?(m=t.jsx(Pe,{items:h,selections:i,onToggle:l,onToggleAll:n,emptyMessage:"No resources available",disabled:d}),e[7]=d,e[8]=h,e[9]=l,e[10]=n,e[11]=i,e[12]=m):m=e[12],m}function es(o){return{id:o.name||o.uri,name:o.name||o.uri,description:o.description}}function ts(o){const e=k.c(13),{connectionId:s,selections:i,onToggle:l,onToggleAll:n,disabled:d}=o,{org:a}=de();let r;e[0]!==s||e[1]!==a.id?(r={connectionId:s,orgId:a.id},e[0]=s,e[1]=a.id,e[2]=r):r=e[2];const c=je(r);let p;e[3]!==c?(p={client:c},e[3]=c,e[4]=p):p=e[4];const{data:g}=Mt(p);let x;e[5]!==g.prompts?(x=g.prompts.map(ss),e[5]=g.prompts,e[6]=x):x=e[6];const h=x;let m;return e[7]!==d||e[8]!==h||e[9]!==l||e[10]!==n||e[11]!==i?(m=t.jsx(Pe,{items:h,selections:i,onToggle:l,onToggleAll:n,emptyMessage:"No prompts available",disabled:d}),e[7]=d,e[8]=h,e[9]=l,e[10]=n,e[11]=i,e[12]=m):m=e[12],m}function ss(o){return{id:o.name,name:o.name,description:o.description}}function ls(o){const e=k.c(24),{connection:s,isSelected:i,hasSelections:l,summary:n,onClick:d,onToggleAll:a,disabled:r}=o,c=r?"cursor-not-allowed opacity-50":"cursor-pointer",p=i?"bg-accent":"hover:bg-muted/50";let g;e[0]!==c||e[1]!==p?(g=ae("flex items-center gap-2 p-2 h-12 rounded-lg transition-colors",c,p),e[0]=c,e[1]=p,e[2]=g):g=e[2];const x=r?void 0:d;let h;e[3]!==s.icon||e[4]!==s.title?(h=t.jsx(ge,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[3]=s.icon,e[4]=s.title,e[5]=h):h=e[5];let m;e[6]!==s.title?(m=t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.title}),e[6]=s.title,e[7]=m):m=e[7];let u;e[8]!==l||e[9]!==n?(u=l&&n&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n}),e[8]=l,e[9]=n,e[10]=u):u=e[10];let b;e[11]!==m||e[12]!==u?(b=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[m,u]}),e[11]=m,e[12]=u,e[13]=b):b=e[13];let f;e[14]!==r||e[15]!==l||e[16]!==a?(f=t.jsx(ze,{checked:l,onCheckedChange:a,onClick:os,disabled:r,className:"shrink-0"}),e[14]=r,e[15]=l,e[16]=a,e[17]=f):f=e[17];let j;return e[18]!==g||e[19]!==x||e[20]!==h||e[21]!==b||e[22]!==f?(j=t.jsxs("div",{className:g,onClick:x,children:[h,b,f]}),e[18]=g,e[19]=x,e[20]=h,e[21]=b,e[22]=f,e[23]=j):j=e[23],j}function os(o){return o.stopPropagation()}function ns(o){const e=k.c(22),{allConnections:s,searchTerm:i,selectedId:l,hasSelections:n,getSelectionSummary:d,onConnectionClick:a,onToggleAll:r,disabled:c}=o;let p;e[0]!==s||e[1]!==i?(p=i?s.filter(m=>m.title.toLowerCase().includes(i.toLowerCase())||m.description?.toLowerCase().includes(i.toLowerCase())):s,e[0]=s,e[1]=i,e[2]=p):p=e[2];const g=p;if(g.length===0){const m=i?"No connections found":"No connections available";let u;return e[3]!==m?(u=t.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground p-4",children:m}),e[3]=m,e[4]=u):u=e[4],u}let x;if(e[5]!==c||e[6]!==g||e[7]!==d||e[8]!==n||e[9]!==a||e[10]!==r||e[11]!==l){let m;e[13]!==c||e[14]!==d||e[15]!==n||e[16]!==a||e[17]!==r||e[18]!==l?(m=u=>t.jsx(ls,{connection:u,isSelected:l===u.id,hasSelections:n(u.id),summary:d(u.id),onClick:()=>a(u.id),onToggleAll:()=>r(u.id),disabled:c},u.id),e[13]=c,e[14]=d,e[15]=n,e[16]=a,e[17]=r,e[18]=l,e[19]=m):m=e[19],x=g.map(m),e[5]=c,e[6]=g,e[7]=d,e[8]=n,e[9]=a,e[10]=r,e[11]=l,e[12]=x}else x=e[12];let h;return e[20]!==x?(h=t.jsx("div",{className:"flex flex-col gap-0.5",children:x}),e[20]=x,e[21]=h):h=e[21],h}function is(o){const e=k.c(75),{currentConnection:s,activeTab:i,selectedId:l,formData:n,toggleTool:d,toggleResource:a,togglePrompt:r,toggleAllTools:c,toggleAllResources:p,toggleAllPrompts:g,onTabChange:x}=o;let h;e[0]!==s.icon||e[1]!==s.title?(h=t.jsx(ge,{icon:s.icon,name:s.title,size:"md",className:"shrink-0"}),e[0]=s.icon,e[1]=s.title,e[2]=h):h=e[2];let m;e[3]!==s.title?(m=t.jsx("h2",{className:"text-lg font-semibold truncate",children:s.title}),e[3]=s.title,e[4]=m):m=e[4];let u;e[5]!==s.description?(u=s.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:s.description}),e[5]=s.description,e[6]=u):u=e[6];let b;e[7]!==m||e[8]!==u?(b=t.jsxs("div",{className:"flex-1 min-w-0",children:[m,u]}),e[7]=m,e[8]=u,e[9]=b):b=e[9];let f;e[10]!==h||e[11]!==b?(f=t.jsx("div",{className:"p-6 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[h,b]})}),e[10]=h,e[11]=b,e[12]=f):f=e[12];let j;e[13]!==x?(j=M=>x(M),e[13]=x,e[14]=j):j=e[14];let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsxs(Ce,{value:"tools",variant:"underline",className:"gap-2",children:[t.jsx(Oe,{size:16}),"Tools"]}),e[15]=y):y=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs(Ce,{value:"resources",variant:"underline",className:"gap-2",children:[t.jsx(Ne,{size:16}),"Resources"]}),e[16]=C):C=e[16];let v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsxs(Dt,{variant:"underline",className:"shrink-0 px-6",children:[y,C,t.jsxs(Ce,{value:"prompts",variant:"underline",className:"gap-2",children:[t.jsx(De,{size:16}),"Prompts"]})]}),e[17]=v):v=e[17];let V;e[18]===Symbol.for("react.memo_cache_sentinel")?(V=we("Tools not supported by this server"),e[18]=V):V=e[18];let R;e[19]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(ke,{}),e[19]=R):R=e[19];let T;e[20]!==n||e[21]!==l?(T=n[l]?n[l].tools:[],e[20]=n,e[21]=l,e[22]=T):T=e[22];let O;e[23]!==l||e[24]!==d?(O=(M,q)=>d(l,M,q),e[23]=l,e[24]=d,e[25]=O):O=e[25];let S;e[26]!==l||e[27]!==c?(S=()=>c(l),e[26]=l,e[27]=c,e[28]=S):S=e[28];let w;e[29]!==l||e[30]!==T||e[31]!==O||e[32]!==S?(w=t.jsx(_e,{value:"tools",className:"flex-1 overflow-hidden mt-0",children:t.jsx(fe,{fallback:V,children:t.jsx(_.Suspense,{fallback:R,children:t.jsx(Zt,{connectionId:l,selections:T,onToggle:O,onToggleAll:S})})})}),e[29]=l,e[30]=T,e[31]=O,e[32]=S,e[33]=w):w=e[33];let z;e[34]===Symbol.for("react.memo_cache_sentinel")?(z=we("Resources not supported by this server"),e[34]=z):z=e[34];let $;e[35]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(ke,{}),e[35]=$):$=e[35];let I;e[36]!==n||e[37]!==l?(I=n[l]?n[l].resources:[],e[36]=n,e[37]=l,e[38]=I):I=e[38];let D;e[39]!==l||e[40]!==a?(D=(M,q)=>a(l,M,q),e[39]=l,e[40]=a,e[41]=D):D=e[41];let A;e[42]!==l||e[43]!==p?(A=()=>p(l),e[42]=l,e[43]=p,e[44]=A):A=e[44];let E;e[45]!==l||e[46]!==I||e[47]!==D||e[48]!==A?(E=t.jsx(_e,{value:"resources",className:"flex-1 overflow-hidden mt-0",children:t.jsx(fe,{fallback:z,children:t.jsx(_.Suspense,{fallback:$,children:t.jsx(Xt,{connectionId:l,selections:I,onToggle:D,onToggleAll:A})})})}),e[45]=l,e[46]=I,e[47]=D,e[48]=A,e[49]=E):E=e[49];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=we("Prompts not supported by this server"),e[50]=B):B=e[50];let P;e[51]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(ke,{}),e[51]=P):P=e[51];let K;e[52]!==n||e[53]!==l?(K=n[l]?n[l].prompts:[],e[52]=n,e[53]=l,e[54]=K):K=e[54];let H;e[55]!==l||e[56]!==r?(H=(M,q)=>r(l,M,q),e[55]=l,e[56]=r,e[57]=H):H=e[57];let W;e[58]!==l||e[59]!==g?(W=()=>g(l),e[58]=l,e[59]=g,e[60]=W):W=e[60];let U;e[61]!==l||e[62]!==K||e[63]!==H||e[64]!==W?(U=t.jsx(_e,{value:"prompts",className:"flex-1 overflow-hidden mt-0",children:t.jsx(fe,{fallback:B,children:t.jsx(_.Suspense,{fallback:P,children:t.jsx(ts,{connectionId:l,selections:K,onToggle:H,onToggleAll:W})})})}),e[61]=l,e[62]=K,e[63]=H,e[64]=W,e[65]=U):U=e[65];let Y;e[66]!==i||e[67]!==w||e[68]!==E||e[69]!==U||e[70]!==j?(Y=t.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:t.jsxs(Lt,{value:i,onValueChange:j,variant:"underline",className:"flex-1 flex flex-col overflow-hidden",children:[v,w,E,U]})}),e[66]=i,e[67]=w,e[68]=E,e[69]=U,e[70]=j,e[71]=Y):Y=e[71];let Z;return e[72]!==Y||e[73]!==f?(Z=t.jsxs(t.Fragment,{children:[f,Y]}),e[72]=Y,e[73]=f,e[74]=Z):Z=e[74],Z}function rs(o){const e={};for(const s of o)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function Ee(o){return Object.entries(o).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function as(o,e){switch(e.type){case"SET_SEARCH_TERM":return{...o,searchTerm:e.payload};case"SET_SELECTED":return{...o,selectedId:e.payload};case"SET_ACTIVE_TAB":return{...o,activeTab:e.payload};case"RESET":return{searchTerm:"",selectedId:e.payload.selectedId??e.payload.firstConnectionId??null,activeTab:"tools"};case"SELECT_CONNECTION":return{...o,selectedId:e.payload,activeTab:"tools"};default:return o}}const cs=(o,e)=>o.find(s=>s.id===e)??o[0];function ds(o){const e=k.c(77),{open:s,onOpenChange:i,selectedId:l,form:n,connections:d}=o;let a;e[0]!==l?(a={activeTab:"tools",searchTerm:"",selectedId:l},e[0]=l,e[1]=a):a=e[1];const[r,c]=_.useReducer(as,a),p=_.useDeferredValue(r.searchTerm);let g;e[2]!==p?(g={searchTerm:p},e[2]=p,e[3]=g):g=e[3];const x=pt(g);let h;e[4]!==d?(h=d??[],e[4]=d,e[5]=h):h=e[5];let m;e[6]!==h?(m=rs(h),e[6]=h,e[7]=m):m=e[7];const u=m;let b;e[8]!==x||e[9]!==r.selectedId?(b=cs(x,r.selectedId),e[8]=x,e[9]=r.selectedId,e[10]=b):b=e[10];const f=b,j=f?.id??null;let y;e[11]!==u?(y=N=>Wt(u,N),e[11]=u,e[12]=y):y=e[12];const C=y;let v;e[13]!==u?(v=N=>Kt(u,N),e[13]=u,e[14]=v):v=e[14];const V=v;let R;e[15]!==n||e[16]!==u?(R=(N,L,F,Q)=>{const ie=u[N]?.[L];let G;ie===null?G=Q.filter(ye=>ye!==F):ie?.includes(F)?G=ie.filter(ye=>ye!==F):(G=[...ie??[],F],G.length===Q.length&&(G=null));const re={...u};re[N]?re[N]={...re[N]}:re[N]={tools:null,resources:null,prompts:null},re[N][L]=G,n.setValue("connections",Ee(re),{shouldDirty:!0,shouldTouch:!0})},e[15]=n,e[16]=u,e[17]=R):R=e[17];const T=R;let O;e[18]!==n||e[19]!==u?(O=(N,L)=>{const ie=u[N]?.[L]===null?[]:null,G={...u};G[N]?G[N]={...G[N]}:G[N]={tools:null,resources:null,prompts:null},G[N][L]=ie,n.setValue("connections",Ee(G),{shouldDirty:!0,shouldTouch:!0})},e[18]=n,e[19]=u,e[20]=O):O=e[20];const S=O;let w;e[21]!==T?(w=(N,L,F)=>T(N,"tools",L,F),e[21]=T,e[22]=w):w=e[22];const z=w;let $;e[23]!==T?($=(N,L,F)=>T(N,"resources",L,F),e[23]=T,e[24]=$):$=e[24];const I=$;let D;e[25]!==T?(D=(N,L,F)=>T(N,"prompts",L,F),e[25]=T,e[26]=D):D=e[26];const A=D;let E;e[27]!==S?(E=N=>S(N,"tools"),e[27]=S,e[28]=E):E=e[28];const B=E;let P;e[29]!==S?(P=N=>S(N,"resources"),e[29]=S,e[30]=P):P=e[30];const K=P;let H;e[31]!==S?(H=N=>S(N,"prompts"),e[31]=S,e[32]=H):H=e[32];const W=H;let U;e[33]!==n||e[34]!==u?(U=N=>{const L=u[N],F=L&&L.tools===null&&L.resources===null&&L.prompts===null,Q={...u};F?delete Q[N]:Q[N]=Yt,n.setValue("connections",Ee(Q),{shouldDirty:!0,shouldTouch:!0})},e[33]=n,e[34]=u,e[35]=U):U=e[35];const Y=U;let Z;e[36]!==x||e[37]!==i||e[38]!==l?(Z=N=>{N&&c({type:"RESET",payload:{selectedId:l,firstConnectionId:x[0]?.id??null}}),i(N)},e[36]=x,e[37]=i,e[38]=l,e[39]=Z):Z=e[39];const M=Z;let q;e[40]===Symbol.for("react.memo_cache_sentinel")?(q=N=>{c({type:"SELECT_CONNECTION",payload:N})},e[40]=q):q=e[40];const qe=q;let me;e[41]===Symbol.for("react.memo_cache_sentinel")?(me=N=>c({type:"SET_SEARCH_TERM",payload:N}),e[41]=me):me=e[41];let X;e[42]!==r.searchTerm?(X=t.jsx(dt,{value:r.searchTerm,onChange:me,placeholder:"Search connections..."}),e[42]=r.searchTerm,e[43]=X):X=e[43];let ee;e[44]!==x||e[45]!==r.searchTerm||e[46]!==j||e[47]!==V||e[48]!==C||e[49]!==Y?(ee=t.jsx("div",{className:"flex-1 overflow-auto p-2",children:t.jsx(ns,{allConnections:x,searchTerm:r.searchTerm,selectedId:j,hasSelections:C,getSelectionSummary:V,onConnectionClick:qe,onToggleAll:Y})}),e[44]=x,e[45]=r.searchTerm,e[46]=j,e[47]=V,e[48]=C,e[49]=Y,e[50]=ee):ee=e[50];let te;e[51]!==X||e[52]!==ee?(te=t.jsxs("div",{className:"w-full sm:w-72 sm:border-r border-b sm:border-b-0 border-border flex flex-col bg-background sm:h-full max-h-[40vh] sm:max-h-full",children:[X,ee]}),e[51]=X,e[52]=ee,e[53]=te):te=e[53];let se;e[54]!==f||e[55]!==r.activeTab||e[56]!==j||e[57]!==u||e[58]!==W||e[59]!==K||e[60]!==B||e[61]!==A||e[62]!==I||e[63]!==z?(se=t.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:f&&j?t.jsx(is,{currentConnection:f,activeTab:r.activeTab,selectedId:j,formData:u,toggleTool:z,toggleResource:I,togglePrompt:A,toggleAllTools:B,toggleAllResources:K,toggleAllPrompts:W,onTabChange:N=>c({type:"SET_ACTIVE_TAB",payload:N})},j):t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Select a connection to view its tools, resources, and prompts"})}),e[54]=f,e[55]=r.activeTab,e[56]=j,e[57]=u,e[58]=W,e[59]=K,e[60]=B,e[61]=A,e[62]=I,e[63]=z,e[64]=se):se=e[64];let le;e[65]!==te||e[66]!==se?(le=t.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0 flex-col sm:flex-row",children:[te,se]}),e[65]=te,e[66]=se,e[67]=le):le=e[67];let oe;e[68]!==M?(oe=t.jsx(At,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(J,{variant:"outline",onClick:()=>M(!1),children:"Done"})}),e[68]=M,e[69]=oe):oe=e[69];let ne;e[70]!==le||e[71]!==oe?(ne=t.jsxs(He,{className:"sm:max-w-5xl h-[80vh] max-h-[80vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[le,oe]}),e[70]=le,e[71]=oe,e[72]=ne):ne=e[72];let ue;return e[73]!==M||e[74]!==s||e[75]!==ne?(ue=t.jsx(Ue,{open:s,onOpenChange:M,children:ne}),e[73]=M,e[74]=s,e[75]=ne,e[76]=ue):ue=e[76],ue}const ms=Ze.pick({title:!0,description:!0,status:!0,metadata:!0,connections:!0}).extend({title:Qe().min(1,"Name is required").max(255)});function us(o){const e=k.c(8);let s,i;e[0]!==o?({className:s,...i}=o,e[0]=o,e[1]=s,e[2]=i):(s=e[1],i=e[2]);let l;e[3]!==s?(l=ae("grid gap-3",s),e[3]=s,e[4]=l):l=e[4];let n;return e[5]!==i||e[6]!==l?(n=t.jsx(Bt,{"data-slot":"radio-group",className:l,...i}),e[5]=i,e[6]=l,e[7]=n):n=e[7],n}function Ie(o){const e=k.c(9);let s,i;e[0]!==o?({className:s,...i}=o,e[0]=o,e[1]=s,e[2]=i):(s=e[1],i=e[2]);let l;e[3]!==s?(l=ae("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Ft,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(We,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=n):n=e[5];let d;return e[6]!==i||e[7]!==l?(d=t.jsx(Vt,{"data-slot":"radio-group-item",className:l,...i,children:n}),e[6]=i,e[7]=l,e[8]=d):d=e[8],d}function fs(o){const s=new TextEncoder().encode(o),i=Array.from(s,l=>String.fromCharCode(l)).join("");return btoa(i)}function xs(o){const e=k.c(10),{url:s}=o,[i,l]=_.useState(!1);let n;e[0]!==s?(n=async()=>{await navigator.clipboard.writeText(s),l(!0),ce.success("Agent URL copied to clipboard"),setTimeout(()=>l(!1),2e3)},e[0]=s,e[1]=n):n=e[1];const d=n;let a;e[2]!==i?(a=i?t.jsx(be,{size:20,className:"text-green-600"}):t.jsx(Re,{size:20}),e[2]=i,e[3]=a):a=e[3];const r=i?"Copied!":"Copy URL";let c;e[4]!==r?(c=t.jsx("span",{className:"text-xs font-medium",children:r}),e[4]=r,e[5]=c):c=e[5];let p;return e[6]!==d||e[7]!==a||e[8]!==c?(p=t.jsxs(J,{type:"button",variant:"outline",onClick:d,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[a,c]}),e[6]=d,e[7]=a,e[8]=c,e[9]=p):p=e[9],p}function ps(o){const e=k.c(7),{url:s,serverName:i}=o;let l;e[0]!==i||e[1]!==s?(l=()=>{const c=Ke(i),g=fs(JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Cursor"}},null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(c)}&config=${encodeURIComponent(g)}`;window.open(x,"_blank"),ce.success("Opening Cursor...")},e[0]=i,e[1]=s,e[2]=l):l=e[2];const n=l;let d,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),a=t.jsx("span",{className:"text-xs font-medium",children:"Install on Cursor"}),e[3]=d,e[4]=a):(d=e[3],a=e[4]);let r;return e[5]!==n?(r=t.jsxs(J,{type:"button",variant:"outline",onClick:n,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[d,a]}),e[5]=n,e[6]=r):r=e[6],r}function hs(o){const e=k.c(11),{url:s,serverName:i}=o,[l,n]=_.useState(!1);let d;e[0]!==i||e[1]!==s?(d=async()=>{const x=Ke(i),m=JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Claude Code"}},null,2),u=`claude mcp add-json "${x}" '${m.replace(/'/g,"'\\''")}'`;await navigator.clipboard.writeText(u),n(!0),ce.success("Claude Code command copied to clipboard"),setTimeout(()=>n(!1),2e3)},e[0]=i,e[1]=s,e[2]=d):d=e[2];const a=d;let r;e[3]!==l?(r=l?t.jsx(be,{size:20,className:"text-green-600"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[3]=l,e[4]=r):r=e[4];const c=l?"Copied!":"Install on Claude";let p;e[5]!==c?(p=t.jsx("span",{className:"text-xs font-medium",children:c}),e[5]=c,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==r||e[9]!==p?(g=t.jsxs(J,{type:"button",variant:"outline",onClick:a,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[r,p]}),e[7]=a,e[8]=r,e[9]=p,e[10]=g):g=e[10],g}function gs({virtualMcp:o}){const{org:e}=de(),s=je({connectionId:zt,orgId:e.id}),[i,l]=_.useState(null),[n,d]=_.useState(!1),[a,r]=_.useState(!1),c=o.id,p=o.title||`agent-${c.slice(0,8)}`,g=i?`bunx @decocms/typegen@latest --mcp ${c} --key ${i} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${c} --key <api-key> --output client.ts`,x=async()=>{d(!0);try{const u=(await s.callTool({name:"API_KEY_CREATE",arguments:{name:`typegen-${p}`,permissions:{[c]:["*"]}}})).structuredContent?.key;if(!u)throw new Error("No key in response");l(u)}catch{ce.error("Failed to generate API key")}finally{d(!1)}},h=async()=>{await navigator.clipboard.writeText(g),r(!0),ce.success("Command copied to clipboard"),setTimeout(()=>r(!1),2e3)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:"Generate typed client"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Introspects this agent and writes a typed"," ",t.jsx("code",{className:"font-mono",children:"client.ts"})," you can import directly."]})]}),!i&&t.jsxs(J,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:x,disabled:n,children:[n?t.jsx(Le,{size:14,className:"animate-spin"}):t.jsx(Ht,{size:14}),t.jsx("span",{children:n?"Generating…":"Generate API key"})]})]}),i&&t.jsx("p",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-700",children:"Store this key securely — it won't be shown again."}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Generate client"}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:g}),t.jsx(J,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:h,children:a?t.jsx(be,{size:12,className:"text-green-600"}):t.jsx(Re,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Runtime variables"}),t.jsx(js,{apiKey:i})]})}function js(o){const e=k.c(19),{apiKey:s}=o,[i,l]=_.useState(!1),n=window.location.origin,d=s?`MESH_API_KEY=${s}`:"MESH_API_KEY=<api-key>",a=`MESH_BASE_URL=${n}`,r=`${d}
2
- ${a}`;let c;e[0]!==r?(c=async()=>{await navigator.clipboard.writeText(r),l(!0),setTimeout(()=>l(!1),2e3)},e[0]=r,e[1]=c):c=e[1];const p=c,g=!s;let x;e[2]!==g?(x=ae({"opacity-50":g}),e[2]=g,e[3]=x):x=e[3];let h;e[4]!==d||e[5]!==x?(h=t.jsx("span",{className:x,children:d}),e[4]=d,e[5]=x,e[6]=h):h=e[6];let m,u;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("br",{}),u=t.jsx("span",{children:a}),e[7]=m,e[8]=u):(m=e[7],u=e[8]);let b;e[9]!==h?(b=t.jsxs("code",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:[h,m,u]}),e[9]=h,e[10]=b):b=e[10];let f;e[11]!==i?(f=i?t.jsx(be,{size:12,className:"text-green-600"}):t.jsx(Re,{size:12}),e[11]=i,e[12]=f):f=e[12];let j;e[13]!==p||e[14]!==f?(j=t.jsx(J,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:p,children:f}),e[13]=p,e[14]=f,e[15]=j):j=e[15];let y;return e[16]!==b||e[17]!==j?(y=t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[b,j]})}),e[16]=b,e[17]=j,e[18]=y):y=e[18],y}function bs(o){const e=k.c(3),{virtualMcp:s}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=i):i=e[0];let l;return e[1]!==s?(l=t.jsx(_.Suspense,{fallback:i,children:t.jsx(gs,{virtualMcp:s})}),e[1]=s,e[2]=l):l=e[2],l}function Ns(o){const e=k.c(44),{open:s,onOpenChange:i,virtualMcp:l}=o,[n,d]=_.useState("code_execution");let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=P=>{(P==="passthrough"||P==="smart_tool_selection"||P==="code_execution")&&d(P)},e[0]=a):a=e[0];const r=a;let c;e[1]!==n||e[2]!==l.id?(c=new URL(`/mcp/virtual-mcp/${l.id}`,window.location.origin),c.searchParams.set("mode",n),e[1]=n,e[2]=l.id,e[3]=c):c=e[3];let p;e[4]!==l.id||e[5]!==l.title?(p=l.title||`agent-${l.id?.slice(0,8)??"default"}`,e[4]=l.id,e[5]=l.title,e[6]=p):p=e[6];const g=p;let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ot,{children:t.jsx($t,{children:"Connect"})}),e[7]=x):x=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mt-1",children:"How should this agent work?"})}),e[8]=h):h=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(nt,{className:"size-5 text-muted-foreground"})}),e[9]=m):m=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Direct access"}),e[10]=u):u=e[10];let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(xe,{asChild:!0,children:t.jsx(Se,{className:"size-3.5 text-muted-foreground"})}),e[11]=b):b=e[11];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsxs("label",{htmlFor:"mode-passthrough",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[m,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[u,t.jsx(ve,{children:t.jsxs(pe,{children:[b,t.jsx(he,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"All tools are exposed directly via tools/list. Best for small tool surfaces with deterministic behavior."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Best for small teams or when you need predictable behavior"})]}),t.jsx(Ie,{id:"mode-passthrough",value:"passthrough"})]}),e[12]=f):f=e[12];let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(it,{className:"size-5 text-muted-foreground"})}),e[13]=j):j=e[13];let y;e[14]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart discovery"}),e[14]=y):y=e[14];let C;e[15]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(xe,{asChild:!0,children:t.jsx(Se,{className:"size-3.5 text-muted-foreground"})}),e[15]=C):C=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsxs("label",{htmlFor:"mode-smart",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[j,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[y,t.jsx(ve,{children:t.jsxs(pe,{children:[C,t.jsx(he,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Uses meta-tools (GATEWAY_SEARCH_TOOLS, GATEWAY_DESCRIBE_TOOLS, GATEWAY_CALL_TOOL) to keep the tool list small and request details on demand."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Ideal for large teams with many tools - AI finds what it needs"})]}),t.jsx(Ie,{id:"mode-smart",value:"smart_tool_selection"})]}),e[16]=v):v=e[16];let V;e[17]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Gt,{className:"size-5 text-muted-foreground"})}),e[17]=V):V=e[17];let R;e[18]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart execution"}),e[18]=R):R=e[18];let T;e[19]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(xe,{asChild:!0,children:t.jsx(Se,{className:"size-3.5 text-muted-foreground"})}),e[19]=T):T=e[19];let O;e[20]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs("label",{htmlFor:"mode-code",className:"relative flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[V,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[R,t.jsx(ve,{children:t.jsxs(pe,{children:[T,t.jsx(he,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Exposes meta-tools for discovery + sandboxed execution (GATEWAY_RUN_CODE). Reduces overhead on large surfaces by shifting work into a controlled runtime."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Maximum flexibility - AI can write code to orchestrate tools"})]}),t.jsx(Ie,{id:"mode-code",value:"code_execution"}),t.jsx($e,{variant:"outline",className:"absolute -top-2.5 left-1/2 -translate-x-1/2 bg-background z-10",children:"Recommended"})]}),e[20]=O):O=e[20];let S;e[21]!==n?(S=t.jsxs("div",{className:"flex flex-col gap-3",children:[h,t.jsxs(us,{value:n,onValueChange:r,className:"flex flex-col gap-4.5",children:[f,v,O]})]}),e[21]=n,e[22]=S):S=e[22];let w;e[23]!==c.href?(w=t.jsx(xs,{url:c.href}),e[23]=c.href,e[24]=w):w=e[24];let z,$;e[25]!==g||e[26]!==c.href?(z=t.jsx(ps,{url:c.href,serverName:g}),$=t.jsx(hs,{url:c.href,serverName:g}),e[25]=g,e[26]=c.href,e[27]=z,e[28]=$):(z=e[27],$=e[28]);let I;e[29]!==w||e[30]!==z||e[31]!==$?(I=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[w,z,$]})}),e[29]=w,e[30]=z,e[31]=$,e[32]=I):I=e[32];let D;e[33]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx("div",{className:"border-t border-border"}),e[33]=D):D=e[33];let A;e[34]!==l?(A=t.jsx(bs,{virtualMcp:l}),e[34]=l,e[35]=A):A=e[35];let E;e[36]!==S||e[37]!==I||e[38]!==A?(E=t.jsxs(He,{className:"max-h-[80vh] overflow-y-auto sm:max-w-2xl",children:[x,t.jsxs("div",{className:"flex flex-col gap-6",children:[S,I,D,A]})]}),e[36]=S,e[37]=I,e[38]=A,e[39]=E):E=e[39];let B;return e[40]!==i||e[41]!==s||e[42]!==E?(B=t.jsx(Ue,{open:s,onOpenChange:i,children:E}),e[40]=i,e[41]=s,e[42]=E,e[43]=B):B=e[43],B}function ys(o,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...o,shareDialogOpen:e.payload};case"SET_CONNECTION_DIALOG_OPEN":return{...o,connectionDialogOpen:e.payload};case"SET_EDITING_CONNECTION_ID":return{...o,editingConnectionId:e.payload};case"SET_SKILLS_OPEN":return{...o,skillsOpen:e.payload};default:return o}}function Ae(o){const e=k.c(27),{connection_id:s,selected_tools:i,selected_resources:l,selected_prompts:n,onClick:d}=o,a=ht(s);if(!a)return null;let r;e[0]!==i?(r=Te(i),e[0]=i,e[1]=r):r=e[1];const c=r;let p;e[2]!==l?(p=Te(l),e[2]=l,e[3]=p):p=e[3];const g=p;let x;e[4]!==n?(x=Te(n),e[4]=n,e[5]=x):x=e[5];const h=x;let m;e[6]!==a.icon||e[7]!==a.title?(m=t.jsx(ge,{icon:a.icon,name:a.title,size:"xs"}),e[6]=a.icon,e[7]=a.title,e[8]=m):m=e[8];let u;e[9]!==a.title?(u=t.jsx("p",{className:"flex-1 text-sm font-normal text-foreground truncate",children:a.title}),e[9]=a.title,e[10]=u):u=e[10];let b;e[11]!==c?(b=c!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:c==="all"?"all":c}),t.jsx(Oe,{size:12})]}),e[11]=c,e[12]=b):b=e[12];let f;e[13]!==g?(f=g!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:g==="all"?"all":g}),t.jsx(Ne,{size:12})]}),e[13]=g,e[14]=f):f=e[14];let j;e[15]!==h?(j=h!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:h==="all"?"all":h}),t.jsx(De,{size:12})]}),e[15]=h,e[16]=j):j=e[16];let y;e[17]!==b||e[18]!==f||e[19]!==j?(y=t.jsxs($e,{variant:"secondary",className:"bg-muted h-5 gap-2 px-1.5 py-1 flex items-center",children:[b,f,j]}),e[17]=b,e[18]=f,e[19]=j,e[20]=y):y=e[20];let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Ge,{size:16,className:"text-muted-foreground shrink-0"}),e[21]=C):C=e[21];let v;return e[22]!==d||e[23]!==m||e[24]!==u||e[25]!==y?(v=t.jsxs("div",{onClick:d,className:"w-full h-12 flex items-center gap-2 px-3 rounded-lg border border-border hover:bg-accent/50 transition-colors cursor-pointer",children:[m,u,y,C]}),e[22]=d,e[23]=m,e[24]=u,e[25]=y,e[26]=v):v=e[26],v}Ae.Fallback=function(){return t.jsxs("div",{className:"w-full h-12 flex items-center gap-2 px-3 rounded-lg border border-border",children:[t.jsx("div",{className:"size-5 rounded bg-muted animate-pulse shrink-0"}),t.jsx("div",{className:"flex-1 h-4 rounded bg-muted animate-pulse"}),t.jsxs($e,{variant:"secondary",className:"bg-muted h-5 gap-2 px-1.5 py-1 flex items-center",children:[t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(Oe,{size:12})]}),t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(Ne,{size:12})]}),t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(De,{size:12})]})]}),t.jsx(Ge,{size:16,className:"text-muted-foreground shrink-0"})]})};function vs({virtualMcp:o}){const{org:e}=de(),s=jt(),i=tt({resolver:st(ms),defaultValues:o}),l=i.watch("connections"),[n,d]=_.useReducer(ys,{shareDialogOpen:!1,connectionDialogOpen:!1,editingConnectionId:null,skillsOpen:!1}),[,a]=ut(),{setVirtualMcpId:r}=rt();_.useEffect(()=>{a(!0),r(o.id)},[o.id]);const c=()=>{r(o.id),a(!0)},p=i.formState.isDirty,g=async()=>{const f=i.getValues(),j=await s.update.mutateAsync({id:o.id,data:f});i.reset(j)},x=()=>{i.reset(o)},h=()=>{d({type:"SET_EDITING_CONNECTION_ID",payload:null}),d({type:"SET_CONNECTION_DIALOG_OPEN",payload:!0})},m=f=>{d({type:"SET_EDITING_CONNECTION_ID",payload:f}),d({type:"SET_CONNECTION_DIALOG_OPEN",payload:!0})},u=s.update.isPending,b=t.jsx(vt,{children:t.jsxs(Ct,{children:[t.jsx(Be,{children:t.jsx(_t,{asChild:!0,children:t.jsx(lt,{to:"/$org/$project/agents",params:{org:e.slug,project:Fe},children:"Agents"})})}),t.jsx(St,{}),t.jsx(Be,{children:t.jsx(Tt,{children:o.title})})]})});return t.jsxs(kt,{breadcrumb:b,children:[t.jsxs(wt,{children:[t.jsx(Et,{onSave:g,onUndo:x,isDirty:p,isSaving:u}),t.jsxs(pe,{delayDuration:0,children:[t.jsx(xe,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsxs(J,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 border border-input",onClick:c,"aria-label":"Test Agent",children:[t.jsx(Nt,{size:14}),"Test Agent"]})})}),t.jsx(he,{side:"bottom",children:"Test this agent in chat"})]}),t.jsxs(J,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 border border-input",onClick:()=>d({type:"SET_SHARE_DIALOG_OPEN",payload:!0}),children:[t.jsx(Ye,{size:14}),"Connect"]})]}),t.jsx("div",{className:"flex h-full w-full bg-background overflow-auto",children:t.jsxs("div",{className:"flex flex-col w-full",children:[t.jsxs("div",{className:"flex items-start justify-between gap-4 p-6 shrink-0",children:[t.jsxs("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[t.jsx(ge,{icon:o.icon,name:i.watch("title")||"Agent",size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(yt,{})}),t.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[t.jsx(Me,{...i.register("title"),className:"h-auto py-0.5 text-lg! font-medium leading-7 px-1 -mx-1 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Agent Name"}),t.jsx(Me,{...i.register("description"),className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-1 -mx-1 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})]})]}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(ft,{checked:i.watch("status")==="active",onCheckedChange:f=>i.setValue("status",f?"active":"inactive",{shouldDirty:!0})})})]}),t.jsxs(at,{open:n.skillsOpen,onOpenChange:f=>d({type:"SET_SKILLS_OPEN",payload:f}),className:"border-t border-border shrink-0 max-h-[400px] overflow-hidden flex flex-col",children:[l.length===0?t.jsxs("button",{type:"button",onClick:h,className:"w-full flex items-center justify-between px-6 py-4 hover:bg-muted/50 transition-colors cursor-pointer",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Skills"}),t.jsxs("div",{className:"h-7 px-2 inline-flex items-center justify-center gap-1 rounded-md text-sm text-muted-foreground",children:[t.jsx(Ve,{size:14}),"Add"]})]}):t.jsx(ct,{asChild:!0,children:t.jsxs("button",{type:"button",className:"w-full flex items-center justify-between px-6 py-4 hover:bg-muted/50 transition-colors cursor-pointer",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Skills"}),t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"ease-(--ease-out-expo)",style:{width:n.skillsOpen?0:"auto",marginRight:n.skillsOpen?0:4,opacity:n.skillsOpen?0:1,pointerEvents:n.skillsOpen?"none":"auto",transitionProperty:"all",transitionDuration:n.skillsOpen?"0ms":"200ms"},children:t.jsx(Ut,{connectionIds:l.map(f=>f.connection_id),maxVisibleIcons:2})}),t.jsxs("div",{role:"button",tabIndex:0,className:"h-7 inline-flex items-center justify-center rounded-md text-sm text-muted-foreground overflow-hidden transition-all duration-200 ease-(--ease-out-expo) hover:bg-accent hover:text-accent-foreground",style:{width:n.skillsOpen?"auto":28,paddingLeft:n.skillsOpen?8:0,paddingRight:n.skillsOpen?8:0,gap:n.skillsOpen?4:0},onPointerDown:f=>{f.stopPropagation()},onClick:f=>{f.stopPropagation(),f.preventDefault(),h()},onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.stopPropagation(),f.preventDefault(),h())},children:[t.jsx(Ve,{size:14,className:"shrink-0"}),t.jsx("span",{className:"overflow-hidden whitespace-nowrap transition-all duration-200 ease-(--ease-out-expo)",style:{width:n.skillsOpen?"auto":0,opacity:n.skillsOpen?1:0},children:"Add"})]}),t.jsx("div",{className:"h-7 inline-flex items-center justify-center overflow-hidden transition-all duration-200 ease-(--ease-out-expo)",style:{width:n.skillsOpen?28:0,opacity:n.skillsOpen?1:0},children:t.jsx(bt,{size:16,className:"shrink-0"})})]})]})}),t.jsx("div",{className:"grid overflow-hidden transition-[grid-template-rows] duration-200 ease-(--ease-out-expo)",style:{gridTemplateRows:n.skillsOpen?"1fr":"0fr"},children:t.jsx("div",{className:"min-h-0 overflow-hidden",children:t.jsx("div",{className:"overflow-y-auto max-h-[300px] mask-[linear-gradient(to_bottom,black_calc(100%-40px),transparent_100%)]",children:t.jsx("div",{className:"flex flex-col gap-2 px-6 pb-4 pt-2",children:l.map(f=>t.jsx(_.Suspense,{fallback:t.jsx(Ae.Fallback,{}),children:t.jsx(Ae,{connection_id:f.connection_id,selected_tools:f.selected_tools,selected_resources:f.selected_resources,selected_prompts:f.selected_prompts,onClick:()=>m(f.connection_id)})},f.connection_id))})})})})]}),t.jsxs("div",{className:"flex flex-col flex-1 p-6 border-t border-border overflow-auto",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Instructions"}),t.jsx(ot,{name:"metadata.instructions",control:i.control,render:({field:f})=>t.jsx(xt,{...f,value:f.value??"",placeholder:"Write instructions here...",className:"min-h-[200px] resize-none text-sm placeholder:text-muted-foreground/50 leading-relaxed border-0 rounded-none shadow-none px-0 focus-visible:ring-0 focus-visible:ring-offset-0 focus:border-0 bg-transparent"})})]})]})}),t.jsx(ds,{open:n.connectionDialogOpen,onOpenChange:f=>d({type:"SET_CONNECTION_DIALOG_OPEN",payload:f}),selectedId:n.editingConnectionId,form:i,connections:l}),t.jsx(Ns,{open:n.shareDialogOpen,onOpenChange:f=>d({type:"SET_SHARE_DIALOG_OPEN",payload:f}),virtualMcp:o})]})}function Cs(){const o=k.c(6),e=Xe();let s;o[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/$project/agents/$agentId"},o[0]=s):s=o[0];const i=et(s),{org:l,agentId:n}=i,d=gt(n);if(!d){let r;return o[1]!==e||o[2]!==l?(r=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(mt,{title:"Agent not found",description:"This Agent may have been deleted or you may not have access.",actions:t.jsx(J,{variant:"outline",onClick:()=>e({to:"/$org/$project/agents",params:{org:l,project:Fe}}),children:"Back to agents"})})}),o[1]=e,o[2]=l,o[3]=r):r=o[3],r}let a;return o[4]!==d?(a=t.jsx(vs,{virtualMcp:d}),o[4]=d,o[5]=a):a=o[5],a}function Vl(){const o=k.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(fe,{children:t.jsx(_.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Cs,{})})}),o[0]=e):e=o[0],e}export{Vl as default};
@@ -1 +0,0 @@
1
- import{c as U,j as t,b as Ne,B as Ue,O as ge,aD as it,u as Be,c0 as Qe,aB as gt,p as jt,r as X,o as at,bI as bt,bQ as vt,s as z,aF as Ge,aG as Nt,E as ct,e as yt,a as _t,n as Ct,k as St,l as wt,i as Tt,t as ve,K as Je}from"./index-BkxNgQ-z.js";import{E as Z,C as ze}from"./collection-search-BgstpGbD.js";import{E as kt,r as Pt,e as lt}from"./env-vars-editor-DM7ragIP.js";import{g as Ke}from"./types-9lUbCnT7.js";import{S as It}from"./save-actions-DgW9lLRI.js";import{b as $t,a as At}from"./use-binding-CVLYzFG-.js";import{u as Vt,S as Mt}from"./index-ZJA9ZP0w.js";import{f as Dt,g as dt}from"./use-connection-DjiXkPUz.js";import{u as mt}from"./constants--aQ9HnxF.js";import{d as Ot}from"./use-mcp-tools-CHOGR3no.js";import{b as Rt}from"./use-mcp-resources-DS8p1Owh.js";import{a as Et}from"./decopilot-events-DZodCqX1.js";import{a as Lt}from"./mcp-oauth-hrdldmcp.js";import{b as Ye,c as Ut,d as Ft,e as Bt,B as zt,a as Kt}from"./breadcrumb-DxXcAXh7.js";import{C as Xt}from"./collection-tabs-nglpt7Dm.js";import{i as Oe}from"./Loading01-BLoQsWVt.js";import{V as Xe,a as Ht}from"./layout-rnNZXdmD.js";import{C as Wt}from"./collection-tab-CkymCS_K.js";import{I as Re}from"./integration-icon-DqBJsR0X.js";import{B as Fe}from"./badge-UPowR1Nj.js";import{D as qt,a as Qt,b as Gt,c as Ze}from"./dropdown-menu-DvfBJ25L.js";import{F as W,a as Jt,b as q,d as K,f as Q,c as Y,e as Yt}from"./form-DKOb9Dxi.js";import{I as G}from"./input-BxWPl4Ur.js";import{S as et,a as tt,b as st,c as nt,d as H}from"./select-CHQkyynJ.js";import{i as ut}from"./CheckCircle-B-t884rD.js";import{t as Zt}from"./ChevronDown-D15Vpp0r.js";import{n as es}from"./Container-CFxptFeR.js";import{s as De}from"./Globe02-6j3SB4QZ.js";import{s as ts}from"./RefreshCcw01-DzE0Vt_s.js";import{i as ss}from"./Terminal-DQnj9LXz.js";import{s as ns}from"./Trash01-BvIumE4M.js";import{t as He}from"./Users03-CUxh9_Jy.js";import{s as os}from"./XClose-CnTCpAeI.js";import{U as rs}from"./user-BcEL6pjj.js";import{b as is,a as as}from"./use-virtual-mcp-Wj5StsuR.js";import{i as cs}from"./ChevronRight-u7jqeZNG.js";import{s as ls}from"./Plus-4zX3n4bH.js";import{f as ds}from"./formatDistanceToNow-Cb2QZZJn.js";import{a as pt,C as ft}from"./collection-table-wrapper-B7II4YYC.js";import{C as We}from"./card-BRjix5ol.js";import{R as ms}from"./readme-viewer-CvFtkeFt.js";import{T as us,a as ps}from"./tools-list-Cb9H3DsC.js";import{M as fs}from"./mcp-app-renderer-DlqJcoS_.js";import"./SearchMd-BvHN4xgB.js";import"./Save01-DiUMsefH.js";import"./binder-DUACCYIe.js";import"./File06-D8w_IYOr.js";import"./Key01-Cvjt_ykt.js";import"./constants-DoLvwboP.js";import"./registry-utils-Bm8aYhvn.js";import"./extract-connection-data-DtOGbK2O.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-kgqBLGhb.js";import"./index-CuJORTyw.js";import"./circle-alert-CHATLFG-.js";import"./index-Bq_4mEQF.js";import"./index-CKt9M-ST.js";import"./index-u5kBBr5i.js";import"./collapsible-CG7okAAn.js";import"./use-llm-Bkjj502R.js";import"./useQuery-Cj-miqA2.js";import"./localstorage-keys-2beZrYfY.js";import"./useMutation-DtOoZO7h.js";import"./tabs-tcquyh90.js";import"./checkbox-Df-Mj-oX.js";import"./Check-BuBqfL8V.js";import"./dialog-CrYlSCa6.js";import"./X-CpsrVd7E.js";import"./skeleton-Bla1LCSZ.js";import"./AlignLeft-zf4ygcA_.js";import"./ArrowLeft-DKmEJ5pf.js";import"./Image01-oZtE9Z5q.js";import"./Settings01-B5kunEo2.js";import"./useSuspenseInfiniteQuery-D62VIKAF.js";import"./infiniteQueryObserver-DFroUYRE.js";import"./popover-CJnKtmVV.js";import"./spinner-B_k6AtHn.js";import"./tooltip-DvMRS01W.js";import"./index-dKQNml8k.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-BNm6R5tp.js";import"./Edit01-CbZPkCJz.js";import"./XCircle-BcvU_Xzf.js";import"./AlertCircle-dxGFeayp.js";import"./use-copy-DiVO6tbG.js";import"./Code01-DhSY1b20.js";import"./use-create-virtual-mcp-DnOGpm5h.js";import"./Copy01-D2l3XUry.js";import"./marked.esm-BaswSlok.js";import"./markdown-08iefd1w.js";import"./Eye-vR70tVFn.js";import"./LayersTwo01-f778oNbj.js";import"./index-B4YFEuZr.js";import"./Clock-B88-VhpY.js";import"./DotsVertical-B78gtBdB.js";import"./empty-state-C2LU6BeW.js";import"./Inbox01-xF_R8liT.js";import"./use-list-state-CCFlT7yz.js";import"./use-view-mode-3_G2qIMG.js";import"./use-mobile-BArkW6j1.js";import"./alert-dialog-B0yEBEkb.js";import"./label-DQ6CQRMq.js";import"./avatar-BeiX4aSz.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowDown-BfANN175.js";import"./Grid01-DjcW2Js4.js";import"./List-Be3XBHwN.js";import"./table-BJ3W5Geb.js";function xs(s){const e=U.c(14),{virtualMcp:n,org:o}=s;let i;e[0]!==o||e[1]!==n.id?(i={org:o,project:ge,agentId:n.id},e[0]=o,e[1]=n.id,e[2]=i):i=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(He,{size:16}),e[3]=a):a=e[3];let l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(Re,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[4]=n.icon,e[5]=n.title,e[6]=l):l=e[6];let j;e[7]!==n.title?(j=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(cs,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=f):f=e[9];let m;return e[10]!==i||e[11]!==l||e[12]!==j?(m=t.jsxs(it,{to:"/$org/$project/agents/$agentId",params:i,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[l,j,f]}),e[10]=i,e[11]=l,e[12]=j,e[13]=m):m=e[13],m}function ot(s){const e=U.c(20),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:j}=s,f=Ne(),m=as();let x;e[0]!==m.create||e[1]!==i||e[2]!==a||e[3]!==n||e[4]!==o||e[5]!==f||e[6]!==l?(x=async()=>{const d=await m.create.mutateAsync({title:`${o} Agent`,description:i??null,icon:a??null,status:"active",connections:[{connection_id:n,selected_tools:null,selected_resources:null,selected_prompts:null}]});f({to:"/$org/$project/agents/$agentId",params:{org:l,project:ge,agentId:d.id}})},e[0]=m.create,e[1]=i,e[2]=a,e[3]=n,e[4]=o,e[5]=f,e[6]=l,e[7]=x):x=e[7];const c=x;if(j){let d;e[8]!==m.create.isPending?(d=m.create.isPending?t.jsx(Oe,{size:16,className:"animate-spin"}):t.jsx(ls,{size:16}),e[8]=m.create.isPending,e[9]=d):d=e[9];let u;return e[10]!==m.create.isPending||e[11]!==c||e[12]!==d?(u=t.jsx(Ue,{variant:"ghost",className:"size-6 p-0",onClick:c,disabled:m.create.isPending,children:d}),e[10]=m.create.isPending,e[11]=c,e[12]=d,e[13]=u):u=e[13],u}let r;e[14]!==m.create.isPending?(r=m.create.isPending?t.jsx(Oe,{className:"animate-spin text-muted-foreground"}):t.jsx(He,{className:"size-3 text-muted-foreground"}),e[14]=m.create.isPending,e[15]=r):r=e[15];let h;return e[16]!==m.create.isPending||e[17]!==c||e[18]!==r?(h=t.jsxs(Ue,{variant:"outline",size:"sm",onClick:c,disabled:m.create.isPending,children:[r,"Create an agent"]}),e[16]=m.create.isPending,e[17]=c,e[18]=r,e[19]=h):h=e[19],h}function hs(s){const e=U.c(26),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l}=s;let j;e[0]!==n?(j={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=j):j=e[1];const f=is(j);if(!(f.length>0)){let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=u):u=e[2];let b;return e[3]!==i||e[4]!==a||e[5]!==n||e[6]!==o||e[7]!==l?(b=t.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[u,t.jsx(ot,{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:!1})]}),e[3]=i,e[4]=a,e[5]=n,e[6]=o,e[7]=l,e[8]=b):b=e[8],b}let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Agents"}),e[9]=x):x=e[9];let c;e[10]!==i||e[11]!==a||e[12]!==n||e[13]!==o||e[14]!==l?(c=t.jsx("div",{className:"flex flex-col gap-1",children:t.jsxs("div",{className:"flex items-center justify-between",children:[x,t.jsx(ot,{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:!0})]})}),e[10]=i,e[11]=a,e[12]=n,e[13]=o,e[14]=l,e[15]=c):c=e[15];let r;if(e[16]!==l||e[17]!==f){let u;e[19]!==l?(u=b=>t.jsx(xs,{virtualMcp:b,org:l},b.id),e[19]=l,e[20]=u):u=e[20],r=f.map(u),e[16]=l,e[17]=f,e[18]=r}else r=e[18];let h;e[21]!==r?(h=t.jsx("div",{className:"flex flex-col gap-2",children:r}),e[21]=r,e[22]=h):h=e[22];let d;return e[23]!==c||e[24]!==h?(d=t.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[c,h]}),e[23]=c,e[24]=h,e[25]=d):d=e[25],d}function gs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:i}){const a=Qe({control:s.control,name:"ui_type"}),l=Qe({control:s.control,name:"connection_url"}),{stdioEnabled:j}=gt(),f=(()=>{if(typeof l!="string"||!l)return!1;try{const r=new URL(l);return r.hostname==="api.githubcopilot.com"&&r.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),m=j||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",c=x?jt(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(He,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),c&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:c})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(W,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),a!=="NPX"&&a!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(et,{value:r.value,onValueChange:r.onChange,children:[t.jsx(K,{children:t.jsxs(tt,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(De,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(st,{})]})}),t.jsxs(nt,{children:[t.jsx(H,{value:"HTTP",children:"HTTP"}),t.jsx(H,{value:"SSE",children:"SSE"}),t.jsx(H,{value:"Websocket",children:"Websocket"}),m&&t.jsxs(t.Fragment,{children:[t.jsx(H,{value:"NPX",children:"NPX Package"}),t.jsx(H,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(W,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(q,{className:"flex-1 min-w-0",children:t.jsx(K,{children:t.jsx(G,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(et,{value:r.value,onValueChange:r.onChange,children:[t.jsx(K,{children:t.jsx(tt,{className:"h-10",children:t.jsx(st,{})})}),t.jsxs(nt,{children:[t.jsx(H,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(H,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(H,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"Websocket"]})}),m&&t.jsxs(t.Fragment,{children:[t.jsx(H,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(es,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(H,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ss,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(Q,{})]})}),a==="NPX"&&t.jsx(W,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(K,{children:t.jsx(G,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),a==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(W,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(K,{children:t.jsx(G,{placeholder:"node, bun, python...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),t.jsx(W,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(K,{children:t.jsx(G,{placeholder:"arg1 arg2 --flag value",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(Q,{})]})})]}),t.jsx(W,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(K,{children:t.jsx(G,{placeholder:"/path/to/project (optional)",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})})]}),(a==="NPX"||a==="STDIO")&&t.jsx(W,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(K,{children:t.jsx(kt,{value:r.value??[],onChange:r.onChange})}),t.jsx(Q,{})]})}),a!=="NPX"&&a!=="STDIO"&&t.jsx(W,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:f?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(qt,{children:[t.jsx(Qt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Fe,{variant:"success",className:"gap-1.5",children:[t.jsx(ut,{size:12}),"Authenticated via OAuth",t.jsx(Zt,{size:12})]})})}),t.jsxs(Gt,{align:"start",children:[t.jsxs(Ze,{onClick:o,children:[t.jsx(ts,{size:16}),"Re-authenticate"]}),t.jsxs(Ze,{variant:"destructive",onClick:i,children:[t.jsx(ns,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&r.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>r.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(os,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(K,{children:t.jsx(G,{type:"password",placeholder:f?"Paste your GitHub PAT":"Enter access token...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),f&&t.jsxs(Yt,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(Q,{})]})})]})}function js(s){const e=U.c(43),{form:n,connection:o,isMCPAuthenticated:i,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:j}=s,{org:f}=Be();let m;e[0]!==o.icon||e[1]!==o.title?(m=t.jsx(Re,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}),e[0]=o.icon,e[1]=o.title,e[2]=m):m=e[2];let x;e[3]!==n.control?(x=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(W,{control:n.control,name:"title",render:vs}),t.jsx(W,{control:n.control,name:"description",render:bs})]}),e[3]=n.control,e[4]=x):x=e[4];let c;e[5]!==m||e[6]!==x?(c=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[m,x]}),e[5]=m,e[6]=x,e[7]=c):c=e[7];let r;e[8]!==o||e[9]!==n||e[10]!==a||e[11]!==l||e[12]!==j?(r=t.jsx(gs,{form:n,connection:o,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:j}),e[8]=o,e[9]=n,e[10]=a,e[11]=l,e[12]=j,e[13]=r):r=e[13];let h;e[14]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[14]=h):h=e[14];let d;e[15]!==i?(d=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[h,i?t.jsxs(Fe,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[t.jsx(ut,{size:12}),"Connected"]}):t.jsx(Fe,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[15]=i,e[16]=d):d=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[17]=u):u=e[17];let b;e[18]!==o.created_by?(b=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[u,t.jsx(rs,{id:o.created_by,size:"2xs"})]}),e[18]=o.created_by,e[19]=b):b=e[19];let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[20]=v):v=e[20];let _;e[21]!==o.updated_at?(_=o.updated_at?ds(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[21]=o.updated_at,e[22]=_):_=e[22];let S;e[23]!==_?(S=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[v,t.jsx("span",{className:"text-sm text-foreground",children:_})]}),e[23]=_,e[24]=S):S=e[24];let p;e[25]!==S||e[26]!==d||e[27]!==b?(p=t.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[d,b,S]}),e[25]=S,e[26]=d,e[27]=b,e[28]=p):p=e[28];let C;e[29]!==o.description||e[30]!==o.icon||e[31]!==o.id||e[32]!==o.title||e[33]!==f.slug?(C=t.jsx(hs,{connectionId:o.id,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,org:f.slug}),e[29]=o.description,e[30]=o.icon,e[31]=o.id,e[32]=o.title,e[33]=f.slug,e[34]=C):C=e[34];let w;e[35]!==p||e[36]!==C||e[37]!==c||e[38]!==r?(w=t.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[c,r,p,C]}),e[35]=p,e[36]=C,e[37]=c,e[38]=r,e[39]=w):w=e[39];let g;return e[40]!==n||e[41]!==w?(g=t.jsx(Jt,{...n,children:w}),e[40]=n,e[41]=w,e[42]=g):g=e[42],g}function bs(s){const{field:e}=s;return t.jsxs(q,{className:"w-full space-y-0",children:[t.jsx(K,{children:t.jsx(G,{...e,value:e.value||"",className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Q,{})]})}function vs(s){const{field:e}=s;return t.jsxs(q,{className:"flex-1 space-y-0",children:[t.jsx(K,{children:t.jsx(G,{...e,className:"h-auto py-0.5 text-lg! font-medium leading-7 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})}),t.jsx(Q,{})]})}function Ns(s){const e=U.c(39),{prompts:n,connectionId:o,org:i,onPromptClick:a,showToolbar:l,emptyMessage:j}=s,f=l===void 0?!0:l,m=j===void 0?"This connection doesn't have any prompts yet.":j,x=Ne(),[c,r]=X.useState(""),[h,d]=X.useState("table"),[u,b]=X.useState("name"),[v,_]=X.useState("asc");let S;e[0]!==v||e[1]!==u?(S=T=>{u===T?(_(ws),v==="desc"&&b(void 0)):(b(T),_("asc"))},e[0]=v,e[1]=u,e[2]=S):S=e[2];const p=S;let C;e[3]!==o||e[4]!==x||e[5]!==a||e[6]!==i?(C=T=>{a?a(T):o&&i&&x({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:ge,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(T.name)}})},e[3]=o,e[4]=x,e[5]=a,e[6]=i,e[7]=C):C=e[7];const w=C;let g;if(e[8]!==n||e[9]!==c||e[10]!==v||e[11]!==u){const T=!n||n.length===0?[]:c.trim()?(()=>{const F=c.toLowerCase();return n.filter(B=>B.name.toLowerCase().includes(F)||B.description&&B.description.toLowerCase().includes(F))})():n;g=!u||!v?T:[...T].sort((F,B)=>{const je=F[u]||"",ee=B[u]||"",J=String(je).localeCompare(String(ee));return v==="asc"?J:-J}),e[8]=n,e[9]=c,e[10]=v,e[11]=u,e[12]=g}else g=e[12];const I=g;let D;e[13]===Symbol.for("react.memo_cache_sentinel")?(D=[{id:"name",header:"Name",render:Ss,sortable:!0},{id:"description",header:"Description",render:Cs,cellClassName:"flex-1",sortable:!0}],e[13]=D):D=e[13];const A=D;let V;e[14]===Symbol.for("react.memo_cache_sentinel")?(V=A.filter(_s).map(ys),e[14]=V):V=e[14];const L=V;let y;e[15]!==p||e[16]!==f||e[17]!==v||e[18]!==u||e[19]!==h?(y=f&&t.jsx(Xe,{children:t.jsx(ft,{viewMode:h,onViewModeChange:d,sortKey:u,sortDirection:v,onSort:p,sortOptions:L})}),e[15]=p,e[16]=f,e[17]=v,e[18]=u,e[19]=h,e[20]=y):y=e[20];let R;e[21]===Symbol.for("react.memo_cache_sentinel")?(R=T=>{T.key==="Escape"&&(r(""),T.target.blur())},e[21]=R):R=e[21];let M;e[22]!==c?(M=t.jsx(ze,{value:c,onChange:r,placeholder:"Search prompts...",onKeyDown:R}),e[22]=c,e[23]=M):M=e[23];let N;e[24]!==m||e[25]!==w||e[26]!==p||e[27]!==c||e[28]!==v||e[29]!==u||e[30]!==I||e[31]!==h?(N=h==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:I.length===0?t.jsx(Z,{image:null,title:c?"No prompts found":"No prompts available",description:c?"Try adjusting your search terms":m}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:I.map(T=>t.jsx(We,{className:"cursor-pointer transition-colors",onClick:()=>w(T),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Re,{icon:null,name:T.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:T.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:T.description||"No description"})]})]})},T.name))})}):t.jsx(pt,{columns:A,data:I,isLoading:!1,sortKey:u,sortDirection:v,onSort:p,onRowClick:T=>w(T),emptyState:t.jsx(Z,{image:null,title:c?"No prompts found":"No prompts available",description:c?"Try adjusting your search terms":m})}),e[24]=m,e[25]=w,e[26]=p,e[27]=c,e[28]=v,e[29]=u,e[30]=I,e[31]=h,e[32]=N):N=e[32];let $;e[33]!==M||e[34]!==N?($=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[M,N]}),e[33]=M,e[34]=N,e[35]=$):$=e[35];let P;return e[36]!==$||e[37]!==y?(P=t.jsxs(t.Fragment,{children:[y,$]}),e[36]=$,e[37]=y,e[38]=P):P=e[38],P}function ys(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function _s(s){return s.sortable}function Cs(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ss(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function ws(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Ts(s){const e=U.c(4),{prompts:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx(Ns,{prompts:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}function ks(s){const e=U.c(2),{repository:n}=s;let o;return e[0]!==n?(o=t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(ms,{repository:n})}),e[0]=n,e[1]=o):o=e[1],o}function Ps(s){const e=U.c(36),{resources:n,onResourceClick:o,showToolbar:i,emptyMessage:a}=s,l=i===void 0?!0:i,j=a===void 0?"This connection doesn't have any resources yet.":a,[f,m]=X.useState(""),[x,c]=X.useState("table"),[r,h]=X.useState("name"),[d,u]=X.useState("asc");let b;e[0]!==d||e[1]!==r?(b=N=>{r===N?(u(Os),d==="desc"&&h(void 0)):(h(N),u("asc"))},e[0]=d,e[1]=r,e[2]=b):b=e[2];const v=b;let _;e[3]!==o?(_=N=>{o&&o(N)},e[3]=o,e[4]=_):_=e[4];const S=_;let p;if(e[5]!==n||e[6]!==f||e[7]!==d||e[8]!==r){const N=!n||n.length===0?[]:f.trim()?(()=>{const $=f.toLowerCase();return n.filter(P=>P.uri.toLowerCase().includes($)||P.name&&P.name.toLowerCase().includes($)||P.description&&P.description.toLowerCase().includes($))})():n;p=!r||!d?N:[...N].sort(($,P)=>{const T=$[r]||"",F=P[r]||"",B=String(T).localeCompare(String(F));return d==="asc"?B:-B}),e[5]=n,e[6]=f,e[7]=d,e[8]=r,e[9]=p}else p=e[9];const C=p;let w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=[{id:"name",header:"Name",render:Ds,sortable:!0},{id:"uri",header:"URI",render:Ms,sortable:!0},{id:"description",header:"Description",render:Vs,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:As,sortable:!0}],e[10]=w):w=e[10];const g=w;let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=g.filter($s).map(Is),e[11]=I):I=e[11];const D=I;let A;e[12]!==v||e[13]!==l||e[14]!==d||e[15]!==r||e[16]!==x?(A=l&&t.jsx(Xe,{children:t.jsx(ft,{viewMode:x,onViewModeChange:c,sortKey:r,sortDirection:d,onSort:v,sortOptions:D})}),e[12]=v,e[13]=l,e[14]=d,e[15]=r,e[16]=x,e[17]=A):A=e[17];let V;e[18]===Symbol.for("react.memo_cache_sentinel")?(V=N=>{N.key==="Escape"&&(m(""),N.target.blur())},e[18]=V):V=e[18];let L;e[19]!==f?(L=t.jsx(ze,{value:f,onChange:m,placeholder:"Search resources...",onKeyDown:V}),e[19]=f,e[20]=L):L=e[20];let y;e[21]!==j||e[22]!==S||e[23]!==v||e[24]!==f||e[25]!==d||e[26]!==r||e[27]!==C||e[28]!==x?(y=x==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:C.length===0?t.jsx(Z,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":j}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:C.map(N=>t.jsx(We,{className:"cursor-pointer transition-colors",onClick:()=>S(N),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Re,{icon:null,name:N.name||N.uri,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:N.name||N.uri}),t.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:N.uri}),N.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:N.description})]})]})},N.uri))})}):t.jsx(pt,{columns:g,data:C,isLoading:!1,sortKey:r,sortDirection:d,onSort:v,onRowClick:N=>S(N),emptyState:t.jsx(Z,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":j})}),e[21]=j,e[22]=S,e[23]=v,e[24]=f,e[25]=d,e[26]=r,e[27]=C,e[28]=x,e[29]=y):y=e[29];let R;e[30]!==L||e[31]!==y?(R=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[L,y]}),e[30]=L,e[31]=y,e[32]=R):R=e[32];let M;return e[33]!==R||e[34]!==A?(M=t.jsxs(t.Fragment,{children:[A,R]}),e[33]=R,e[34]=A,e[35]=M):M=e[35],M}function Is(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function $s(s){return s.sortable}function As(s){return t.jsx("span",{className:"text-sm text-muted-foreground",children:s.mimeType||"—"})}function Vs(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ms(s){return t.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:s.uri})}function Ds(s){return t.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name||s.uri})}function Os(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Rs(s){const e=U.c(4),{resources:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx(Ps,{resources:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}const Es=at({key:z().min(1,"Key is required"),value:z()}),Ls=at({title:z().min(1,"Name is required"),description:z().nullable().optional(),ui_type:Nt(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:z().optional(),connection_token:z().nullable().optional(),npx_package:z().optional(),stdio_command:z().optional(),stdio_args:z().optional(),stdio_cwd:z().optional(),env_vars:Ge(Es).optional(),configuration_scopes:Ge(z()).nullable().optional(),configuration_state:bt(z(),vt()).nullable().optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Us(s){const e=U.c(5),{tools:n,connectionId:o,org:i,isLoading:a}=s;let l;return e[0]!==o||e[1]!==a||e[2]!==i||e[3]!==n?(l=t.jsx(us,{tools:n,connectionId:o,org:i,isLoading:a}),e[0]=o,e[1]=a,e[2]=i,e[3]=n,e[4]=l):l=e[4],l}function Fs(s){const e=U.c(27),{tools:n,connectionId:o,org:i}=s,a=Ne(),{org:l}=Be();let j;e[0]!==o||e[1]!==l.id?(j={connectionId:o,orgId:l.id},e[0]=o,e[1]=l.id,e[2]=j):j=e[2];const f=mt(j),[m,x]=X.useState("");let c,r,h,d;if(e[3]!==f||e[4]!==o||e[5]!==a||e[6]!==i||e[7]!==m||e[8]!==n){const v=(n??[]).filter(Bs),_=m.toLowerCase().trim(),S=_?v.filter(g=>g.name.toLowerCase().includes(_)||g.description&&g.description.toLowerCase().includes(_)):v;let p;e[13]!==o||e[14]!==a||e[15]!==i?(p=g=>{a({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:ge,connectionId:o,collectionName:"tools",itemId:encodeURIComponent(g.name)}})},e[13]=o,e[14]=a,e[15]=i,e[16]=p):p=e[16];const C=p;h="flex flex-col h-full overflow-hidden";let w;e[17]===Symbol.for("react.memo_cache_sentinel")?(w=g=>{g.key==="Escape"&&(x(""),g.target.blur())},e[17]=w):w=e[17],e[18]!==m?(d=t.jsx(ze,{value:m,onChange:x,placeholder:"Search apps...",onKeyDown:w}),e[18]=m,e[19]=d):d=e[19],c="flex-1 overflow-auto p-5",r=S.length===0?t.jsx(Z,{image:null,title:m?"No apps found":"No apps available",description:m?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:S.map(g=>{const I=Ke(g._meta);return t.jsxs(We,{className:"cursor-pointer transition-colors overflow-hidden",onClick:()=>C(g),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(fs,{resourceURI:I,toolName:g.name,displayMode:"inline",minHeight:200,maxHeight:200,client:f})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:g.name}),t.jsx(ps,{annotations:g.annotations,_meta:g._meta})]}),g.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:g.description})]})]},g.name)})}),e[3]=f,e[4]=o,e[5]=a,e[6]=i,e[7]=m,e[8]=n,e[9]=c,e[10]=r,e[11]=h,e[12]=d}else c=e[9],r=e[10],h=e[11],d=e[12];let u;e[20]!==c||e[21]!==r?(u=t.jsx("div",{className:c,children:r}),e[20]=c,e[21]=r,e[22]=u):u=e[22];let b;return e[23]!==h||e[24]!==d||e[25]!==u?(b=t.jsxs("div",{className:h,children:[d,u]}),e[23]=h,e[24]=d,e[25]=u,e[26]=b):b=e[26],b}function Bs(s){return!!Ke(s._meta)}function zs(s){return s.command==="npx"}function Ks(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Xs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Hs(s,e){const n={command:"npx",args:["-y",s]},o=lt(e);return Object.keys(o).length>0&&(n.envVars=o),n}function Ws(s,e,n,o){const i={command:s};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const a=lt(o);return Object.keys(a).length>0&&(i.envVars=a),i}function rt(s,e){const n={title:s.title,description:s.description??"",configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Tt(s.connection_headers)){const o=s.connection_headers,i=Pt(o.envVars);if(zs(o)){const l=Ks(o);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i}}const a=Xs(o);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:i}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function qs(s){let e,n=null,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=Hs(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=Ws(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",o=s.connection_token||null),{title:s.title,description:s.description||null,connection_type:e,connection_url:n,...o&&{connection_token:o},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function Qs(s){const e=U.c(116),{connection:n,connectionId:o,org:i,requestedTabId:a,collections:l,onUpdate:j,isUpdating:f,prompts:m,resources:x,tools:c,isLoadingTools:r}=s;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={from:"/$org/$project/mcps/$connectionId"},e[0]=h):h=e[0];const d=Ne(h),u=Ct(),b=dt();let v;e[1]!==o?(v={connectionId:o},e[1]=o,e[2]=v):v=e[2];const _=Vt(v),p=n?.connection_type==="VIRTUAL"||_.isAuthenticated;let C;e[3]!==n?(C={connections:[n],binding:"MCP"},e[3]=n,e[4]=C):C=e[4];const g=At(C).length>0,I=n?.metadata?.repository,D=!!I?.url;let A;e[5]===Symbol.for("react.memo_cache_sentinel")?(A=St(Ls),e[5]=A):A=e[5];let V;e[6]!==n?(V=rt(n),e[6]=n,e[7]=V):V=e[7];let L;e[8]!==V?(L={resolver:A,values:V},e[8]=V,e[9]=L):L=e[9];const y=wt(L),R=y.formState.isDirty;let M;e[10]!==y||e[11]!==j?(M=async()=>{if(!await y.trigger())return;const E=y.getValues(),he=qs(E);await j(he),y.reset(E)},e[10]=y,e[11]=j,e[12]=M):M=e[12];const N=M;let $;e[13]!==n||e[14]!==y?($=()=>{y.reset(rt(n))},e[13]=n,e[14]=y,e[15]=$):$=e[15];const P=$;let T;e[16]!==n.id||e[17]!==b||e[18]!==u?(T=async()=>{const{token:k,tokenInfo:E,error:he}=await Lt({connectionId:n.id});if(he||!k){ve.error(`Authentication failed: ${he}`);return}if(E)try{const Me=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:E.accessToken,refreshToken:E.refreshToken,expiresIn:E.expiresIn,scope:E.scope,clientId:E.clientId,clientSecret:E.clientSecret,tokenEndpoint:E.tokenEndpoint})});if(!Me.ok)console.error("Failed to save OAuth token:",await Me.text()),await b.update.mutateAsync({id:n.id,data:{connection_token:k}});else try{await b.update.mutateAsync({id:n.id,data:{}})}catch(qe){console.warn("Failed to refresh connection tools after OAuth:",qe)}}catch(Me){console.error("Error saving OAuth token:",Me),await b.update.mutateAsync({id:n.id,data:{connection_token:k}})}else await b.update.mutateAsync({id:n.id,data:{connection_token:k}});const ht=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:Je.isMCPAuthenticated(ht.href,null)}),ve.success("Authentication successful")},e[16]=n.id,e[17]=b,e[18]=u,e[19]=T):T=e[19];const F=T;let B;e[20]!==n.id||e[21]!==u?(B=async()=>{try{const k=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!k.ok){const he=await k.text();ve.error(`Failed to remove OAuth: ${he}`);return}const E=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:Je.isMCPAuthenticated(E.href,null)}),ve.success("OAuth removed. You can now re-authenticate with a different account.")}catch(k){console.error("Error removing OAuth token:",k),ve.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=u,e[22]=B):B=e[22];const je=B,ee=c.length,J=m.length,ye=x.length;let _e;e[23]!==c?(_e=c.filter(Ys),e[23]=c,e[24]=_e):_e=e[24];const Ce=_e.length,Ee=ee>0||r;let Se;e[25]===Symbol.for("react.memo_cache_sentinel")?(Se={id:"settings",label:"Settings"},e[25]=Se):Se=e[25];let te;e[26]!==r||e[27]!==p||e[28]!==Ee||e[29]!==ee?(te=p&&Ee?[{id:"tools",label:"Tools",count:r?void 0:ee}]:[],e[26]=r,e[27]=p,e[28]=Ee,e[29]=ee,e[30]=te):te=e[30];let se;e[31]!==p||e[32]!==J?(se=p&&J>0?[{id:"prompts",label:"Prompts",count:J}]:[],e[31]=p,e[32]=J,e[33]=se):se=e[33];let ne;e[34]!==p||e[35]!==ye?(ne=p&&ye>0?[{id:"resources",label:"Resources",count:ye}]:[],e[34]=p,e[35]=ye,e[36]=ne):ne=e[36];let oe;e[37]!==p||e[38]!==Ce?(oe=p&&Ce>0?[{id:"ui",label:"UI",count:Ce}]:[],e[37]=p,e[38]=Ce,e[39]=oe):oe=e[39];let we;if(e[40]!==l||e[41]!==D||e[42]!==p||e[43]!==te||e[44]!==se||e[45]!==ne||e[46]!==oe){let k;e[48]!==D?(k=D?[{id:"readme",label:"README"}]:[],e[48]=D,e[49]=k):k=e[49],we=[Se,...te,...se,...ne,...oe,...p?(l||[]).map(Js):[],...k],e[40]=l,e[41]=D,e[42]=p,e[43]=te,e[44]=se,e[45]=ne,e[46]=oe,e[47]=we}else we=e[47];const be=we,xt=p&&be.some(Gs)?"tools":"settings",O=be.some(k=>k.id===a)?a:xt;let Te;e[50]!==d?(Te=k=>{d({search:E=>({...E,tab:k}),replace:!0})},e[50]=d,e[51]=Te):Te=e[51];const re=Te;let ie;e[52]!==l?(ie=l||[],e[52]=l,e[53]=ie):ie=e[53];let ke;if(e[54]!==O||e[55]!==ie){let k;e[57]!==O?(k=E=>E.name===O,e[57]=O,e[58]=k):k=e[58],ke=ie.find(k),e[54]=O,e[55]=ie,e[56]=ke}else ke=e[56];const Pe=ke;let ae;e[59]!==i?(ae=t.jsx(Ye,{children:t.jsx(Ft,{asChild:!0,children:t.jsx(it,{to:"/$org/$project/mcps",params:{org:i,project:ge},children:"Connections"})})}),e[59]=i,e[60]=ae):ae=e[60];let Ie;e[61]===Symbol.for("react.memo_cache_sentinel")?(Ie=t.jsx(Bt,{}),e[61]=Ie):Ie=e[61];let ce;e[62]!==n.title?(ce=t.jsx(Ye,{children:t.jsx(Ut,{children:n.title})}),e[62]=n.title,e[63]=ce):ce=e[63];let $e;e[64]!==ae||e[65]!==ce?($e=t.jsx(zt,{children:t.jsxs(Kt,{children:[ae,Ie,ce]})}),e[64]=ae,e[65]=ce,e[66]=$e):$e=e[66];const Le=$e;let le;e[67]!==N||e[68]!==P||e[69]!==R||e[70]!==f?(le=t.jsx(Xe,{children:t.jsx(It,{onSave:N,onUndo:P,isDirty:R,isSaving:f})}),e[67]=N,e[68]=P,e[69]=R,e[70]=f,e[71]=le):le=e[71];let de;e[72]!==_.hasOAuthToken||e[73]!==n||e[74]!==y||e[75]!==F||e[76]!==je||e[77]!==p?(de=t.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:t.jsx(js,{form:y,connection:n,isMCPAuthenticated:p,hasOAuthToken:_.hasOAuthToken,onReauthenticate:F,onRemoveOAuth:je})}),e[72]=_.hasOAuthToken,e[73]=n,e[74]=y,e[75]=F,e[76]=je,e[77]=p,e[78]=de):de=e[78];let me;e[79]!==O||e[80]!==re||e[81]!==be?(me=t.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:t.jsx(Xt,{tabs:be,activeTab:O,onTabChange:re,className:"flex-1"})}),e[79]=O,e[80]=re,e[81]=be,e[82]=me):me=e[82];let Ae;e[83]===Symbol.for("react.memo_cache_sentinel")?(Ae=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),e[83]=Ae):Ae=e[83];let ue;e[84]!==Pe||e[85]!==O||e[86]!==_.isServerError||e[87]!==_.supportsOAuth||e[88]!==n||e[89]!==o||e[90]!==y||e[91]!==F||e[92]!==re||e[93]!==g||e[94]!==D||e[95]!==r||e[96]!==p||e[97]!==i||e[98]!==m||e[99]!==I||e[100]!==x||e[101]!==c?(ue=t.jsx(X.Suspense,{fallback:Ae,children:O==="tools"?t.jsx(Us,{tools:c,connectionId:o,org:i,isLoading:r}):O==="ui"?t.jsx(Fs,{tools:c,connectionId:o,org:i}):O==="prompts"?t.jsx(Ts,{prompts:m,connectionId:o,org:i}):O==="resources"?t.jsx(Rs,{resources:x,connectionId:o,org:i}):O==="settings"?t.jsx(Mt,{connection:n,form:y,hasMcpBinding:g,isMCPAuthenticated:p,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:F,onViewReadme:D?()=>re("readme"):void 0}):O==="readme"&&D?t.jsx(ks,{repository:I}):Pe&&p?t.jsx(Wt,{connectionId:o,org:i,activeCollection:Pe},O):t.jsx(Z,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[84]=Pe,e[85]=O,e[86]=_.isServerError,e[87]=_.supportsOAuth,e[88]=n,e[89]=o,e[90]=y,e[91]=F,e[92]=re,e[93]=g,e[94]=D,e[95]=r,e[96]=p,e[97]=i,e[98]=m,e[99]=I,e[100]=x,e[101]=c,e[102]=ue):ue=e[102];let pe;e[103]!==O||e[104]!==ue?(pe=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(ct,{children:ue},O)}),e[103]=O,e[104]=ue,e[105]=pe):pe=e[105];let fe;e[106]!==me||e[107]!==pe?(fe=t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[me,pe]}),e[106]=me,e[107]=pe,e[108]=fe):fe=e[108];let xe;e[109]!==de||e[110]!==fe?(xe=t.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[de,fe]}),e[109]=de,e[110]=fe,e[111]=xe):xe=e[111];let Ve;return e[112]!==Le||e[113]!==le||e[114]!==xe?(Ve=t.jsxs(Ht,{breadcrumb:Le,children:[le,xe]}),e[112]=Le,e[113]=le,e[114]=xe,e[115]=Ve):Ve=e[115],Ve}function Gs(s){return s.id==="tools"}function Js(s){return{id:s.name,label:s.displayName}}function Ys(s){return!!Ke(s._meta)}function Zs(){const s=U.c(43);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$connectionId"},s[0]=e):e=s[0];const n=Ne(e);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/$project/mcps/$connectionId"},s[1]=o):o=s[1];const{connectionId:i,org:a}=yt(o),{org:l}=Be();let j;s[2]===Symbol.for("react.memo_cache_sentinel")?(j={from:"/shell/$org/$project/mcps/$connectionId"},s[2]=j):j=s[2];const m=_t(j).tab??"",x=Dt(i),c=dt(),r=$t(x??void 0);let h;s[3]!==i||s[4]!==l.id?(h={connectionId:i,orgId:l.id},s[3]=i,s[4]=l.id,s[5]=h):h=s[5];const d=mt(h);let u;s[6]!==d?(u={client:d},s[6]=d,s[7]=u):u=s[7];const{data:b}=Et(u);let v;s[8]!==d?(v={client:d},s[8]=d,s[9]=v):v=s[9];const{data:_}=Rt(v),S=x?.connection_type==="VIRTUAL";let p;s[10]!==d||s[11]!==S?(p={client:d,enabled:S},s[10]=d,s[11]=S,s[12]=p):p=s[12];const{data:C,isLoading:w}=Ot(p);let g;s[13]!==b?.prompts?(g=b?.prompts??[],s[13]=b?.prompts,s[14]=g):g=s[14];let I;s[15]!==g?(I=g.map(sn),s[15]=g,s[16]=I):I=s[16];const D=I;let A;s[17]!==_?.resources?(A=_?.resources??[],s[17]=_?.resources,s[18]=A):A=s[18];let V;s[19]!==A?(V=A.map(tn),s[19]=A,s[20]=V):V=s[20];const L=V;let y;s[21]!==x?.tools||s[22]!==S||s[23]!==C?.tools?(y=S?(C?.tools??[]).map(en):x?.tools??[],s[21]=x?.tools,s[22]=S,s[23]=C?.tools,s[24]=y):y=s[24];const R=y;let M;s[25]!==c.update||s[26]!==i?(M=async P=>{await c.update.mutateAsync({id:i,data:P})},s[25]=c.update,s[26]=i,s[27]=M):M=s[27];const N=M;if(!x){let P;return s[28]!==n||s[29]!==a?(P=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Z,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(Ue,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:a,project:ge}}),children:"Back to connections"})})}),s[28]=n,s[29]=a,s[30]=P):P=s[30],P}let $;return s[31]!==c.update.isPending||s[32]!==r||s[33]!==x||s[34]!==i||s[35]!==N||s[36]!==w||s[37]!==a||s[38]!==D||s[39]!==m||s[40]!==L||s[41]!==R?($=t.jsx(Qs,{org:a,connection:x,connectionId:i,requestedTabId:m,collections:r,onUpdate:N,isUpdating:c.update.isPending,prompts:D,resources:L,tools:R,isLoadingTools:w}),s[31]=c.update.isPending,s[32]=r,s[33]=x,s[34]=i,s[35]=N,s[36]=w,s[37]=a,s[38]=D,s[39]=m,s[40]=L,s[41]=R,s[42]=$):$=s[42],$}function en(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations,_meta:s._meta}}function tn(s){return{uri:s.uri,name:s.name,description:s.description}}function sn(s){return{name:s.name,description:s.description}}function nn(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ct,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Zs,{})})}),s[0]=e):e=s[0],e}function cr(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(nn,{}),s[0]=e):e=s[0],e}export{cr as default};
@@ -1 +0,0 @@
1
- import{c as be,j as e,E as Fe,r as X,u as Be,n as Ue,b as He,a as Le,d as Me,aB as ze,l as Re,k as Xe,i as We,B as S,O as g,t as D,o as ke,aF as Ke,s as C,aG as Ge}from"./index-BkxNgQ-z.js";import{g as qe}from"./generate-id-Dyweu44Y.js";import{C as Qe,a as Je}from"./collection-table-wrapper-B7II4YYC.js";import{C as Ye,E as L}from"./collection-search-BgstpGbD.js";import{C as Ze}from"./connection-card-DE2PfyYV.js";import{B as M}from"./badge-UPowR1Nj.js";import{i as et}from"./AlertCircle-dxGFeayp.js";import{i as tt}from"./CheckCircle-B-t884rD.js";import{I as nt}from"./integration-icon-DqBJsR0X.js";import{P as E}from"./index-B4YFEuZr.js";import{U as re}from"./user-BcEL6pjj.js";import{u as st}from"./use-binding-CVLYzFG-.js";import{u as ot}from"./use-list-state-CCFlT7yz.js";import{f as rt,e as it}from"./registry-utils-Bm8aYhvn.js";import{f as ie,a as ae,b as ce,c as le,d as de,e as me,A as ue,h as pe}from"./alert-dialog-B0yEBEkb.js";import{B as at,a as ct,b as lt,c as dt}from"./breadcrumb-DxXcAXh7.js";import{D as mt,a as ut,b as pt,c as xt,d as ht,e as gt}from"./dialog-CrYlSCa6.js";import{D as xe,a as he,b as ge,c as F}from"./dropdown-menu-DvfBJ25L.js";import{a as ft,F as f,b as j,c as y,d as v,f as _}from"./form-DKOb9Dxi.js";import{I as T}from"./input-BxWPl4Ur.js";import{S as jt,a as yt,b as vt,c as _t,d as $}from"./select-CHQkyynJ.js";import{T as Ct}from"./textarea-CceQB-N2.js";import{g as Nt,h as bt}from"./use-connection-DjiXkPUz.js";import{u as fe,a as kt}from"./constants--aQ9HnxF.js";import{b as wt}from"./use-mcp-tools-CHOGR3no.js";import{n as z}from"./Container-CFxptFeR.js";import{i as je}from"./DotsVertical-B78gtBdB.js";import{s as ye}from"./Eye-vR70tVFn.js";import{s as R}from"./Globe02-6j3SB4QZ.js";import{i as St}from"./Loading01-BLoQsWVt.js";import{i as Tt}from"./Terminal-DQnj9LXz.js";import{s as ve}from"./Trash01-BvIumE4M.js";import{f as _e}from"./format-time-CMKyl-GC.js";import{r as Dt,E as Pt,e as we}from"./env-vars-editor-DM7ragIP.js";import"./ArrowDown-BfANN175.js";import"./ArrowUp-BNm6R5tp.js";import"./Check-BuBqfL8V.js";import"./Grid01-DjcW2Js4.js";import"./List-Be3XBHwN.js";import"./tooltip-DvMRS01W.js";import"./index-dKQNml8k.js";import"./table-BJ3W5Geb.js";import"./SearchMd-BvHN4xgB.js";import"./card-BRjix5ol.js";import"./localstorage-keys-2beZrYfY.js";import"./useQuery-Cj-miqA2.js";import"./useMutation-DtOoZO7h.js";import"./avatar-BeiX4aSz.js";import"./binder-DUACCYIe.js";import"./use-view-mode-3_G2qIMG.js";import"./use-mobile-BArkW6j1.js";import"./ChevronRight-u7jqeZNG.js";import"./X-CpsrVd7E.js";import"./label-DQ6CQRMq.js";import"./ChevronDown-D15Vpp0r.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./Plus-4zX3n4bH.js";function Ce(s){const o=be.c(3),{status:i}=s;if(i==="active"){let c;return o[0]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(M,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[e.jsx(tt,{size:12}),"Active"]}),o[0]=c):c=o[0],c}if(i==="error"){let c;return o[1]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(M,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[e.jsx(et,{size:12}),"Error"]}),o[1]=c):c=o[1],c}let d;return o[2]===Symbol.for("react.memo_cache_sentinel")?(d=e.jsx(M,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),o[2]=d):d=o[2],d}const It=ke({key:C(),value:C()}),Et=ke({title:C().min(1,"Name is required"),description:C().nullable().optional(),ui_type:Ge(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:C().optional(),connection_token:C().nullable().optional(),npx_package:C().optional(),stdio_command:C().optional(),stdio_args:C().optional(),stdio_cwd:C().optional(),env_vars:Ke(It).optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function U(s){const o=s.trim();if(!o)return"";try{const i=new URL(o),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return o.replace(/\/+$/,"")}}function $t(s){const o=s.trim().split(/\s+/).filter(Boolean);if(o.length<2)return null;const i=o[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const c=o.slice(1).find(N=>!N.startsWith("-"));return c?{packageName:c}:null}function B(s){const{uiType:o}=s,i=U(s.connectionUrl??"");if((o==="HTTP"||o==="SSE"||o==="Websocket")&&i===U("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const d=(s.npxPackage??"").trim();return o==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function Ne(s){if(s.registryItems.length===0||s.uiType!=="HTTP"&&s.uiType!=="SSE"&&s.uiType!=="Websocket")return null;const o=U(s.connectionUrl??"");if(!o)return null;const i=s.registryItems.find(N=>(N.server?.remotes??[]).some(O=>U(O.url??"")===o));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",c=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:c}:null}function Ot(s,o){const i={command:"npx",args:["-y",s]},d=we(o);return Object.keys(d).length>0&&(i.envVars=d),i}function At(s,o,i,d){const c={command:s};o.trim()&&(c.args=o.trim().split(/\s+/)),i?.trim()&&(c.cwd=i.trim());const N=we(d);return Object.keys(N).length>0&&(c.envVars=N),c}function Vt(s){return s.command==="npx"}function Ft(s){return s.args?.find(o=>!o.startsWith("-"))??""}function Bt(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Ut(s,o){switch(o.type){case"edit":return{mode:"editing",connection:o.connection};case"delete":return{mode:"deleting",connection:o.connection};case"force-delete":return{mode:"force-deleting",connection:o.connection,agentNames:o.agentNames};case"close":return{mode:"idle"}}}function Ht(){const{org:s}=Be(),o=Ue(),i=He(),d=Le({strict:!1}),{data:c}=Me.useSession(),{stdioEnabled:N}=ze(),l=ot({namespace:s.slug,resource:"connections"}),O=Nt(),A=bt(l),[u,b]=X.useReducer(Ut,{mode:"idle"}),W=st(A)[0],K=W?.id??"",G=rt(W?.tools),Se=fe({connectionId:K||null,orgId:s.id}),{data:Te}=wt({client:Se,toolName:G,toolArguments:{limit:200},enabled:!!(K&&G),staleTime:3600*1e3,select:t=>t.structuredContent??t}),q=it(Te??[]),Q=d.action==="create",De=()=>{i({to:"/$org/$project/mcps",params:{org:s.slug,project:g},search:{action:"create"}})},J=()=>{i({to:"/$org/$project/mcps",params:{org:s.slug,project:g},search:{}})},r=Re({resolver:Xe(Et),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),p=r.watch("ui_type"),Y=r.watch("connection_url"),Pe=r.watch("npx_package"),P=B({uiType:p,connectionUrl:Y??"",npxPackage:Pe??""})??Ne({uiType:p,connectionUrl:Y??"",registryItems:q}),m=u.mode==="editing"?u.connection:null;X.useEffect(()=>{if(m){const t=We(m.connection_headers)?m.connection_headers:null;if(t&&m.connection_type==="STDIO"){const n=Dt(t.envVars);if(Vt(t)){const a=Ft(t);r.reset({title:m.title,description:m.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:n})}else{const a=Bt(t);r.reset({title:m.title,description:m.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:n})}}else r.reset({title:m.title,description:m.description,ui_type:m.connection_type,connection_url:m.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[m,r]);const Z=fe({connectionId:kt,orgId:s.id}),ee=()=>{o.invalidateQueries({predicate:t=>{const n=t.queryKey;return n[1]===s.id&&n[3]==="collection"&&n[4]==="CONNECTIONS"}})},te=t=>{const n=t.content;return Array.isArray(n)&&n[0]?.type==="text"&&typeof n[0].text=="string"?n[0].text:"Unknown error"},Ie=async()=>{if(u.mode!=="deleting")return;const t=u.connection;b({type:"close"});try{const n=await Z.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:t.id}});if(n.isError){const a=te(n),k=a.replace(/^Error:\s*/,"");try{const x=JSON.parse(k);if(x.code==="CONNECTION_IN_USE"&&x.agentNames){b({type:"force-delete",connection:t,agentNames:x.agentNames.map(w=>`"${w}"`).join(", ")});return}}catch{}D.error(`Failed to delete connection: ${a}`);return}ee(),D.success("Connection deleted successfully")}catch(n){const a=n instanceof Error?n.message:String(n);D.error(`Failed to delete connection: ${a}`)}},Ee=async()=>{if(u.mode!=="force-deleting")return;const t=u.connection.id;b({type:"close"});try{const n=await Z.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:t,force:!0}});if(n.isError){D.error(`Failed to delete connection: ${te(n)}`);return}ee(),D.success("Connection deleted successfully")}catch(n){const a=n instanceof Error?n.message:String(n);D.error(`Failed to delete connection: ${a}`)}},$e=async t=>{let n,a=null,k=null,x=null;if(t.ui_type==="NPX"?(n="STDIO",a="",x=Ot(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(n="STDIO",a="",x=At(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(n=t.ui_type,a=t.connection_url||"",k=t.connection_token||null),m){await O.update.mutateAsync({id:m.id,data:{title:t.title,description:t.description||null,connection_type:n,connection_url:a,...k&&{connection_token:k},...x&&{connection_headers:x}}}),b({type:"close"}),r.reset();return}const w=qe("conn");await O.create.mutateAsync({id:w,title:t.title,description:t.description||null,connection_type:n,connection_url:a,connection_token:k,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:c?.user?.id||"system",organization_id:s.id,icon:null,app_name:null,app_id:null,connection_headers:x,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),J(),r.reset(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:w}})},ne=t=>{t||(Q?J():b({type:"close"}),r.reset())},V=t=>{const n=t.trim();if(!n)return;const a=!!r.formState.dirtyFields.title,k=!!r.formState.dirtyFields.description,x=!!r.formState.dirtyFields.env_vars,w=h=>{if(h&&(!a&&!r.getValues("title").trim()&&h.title&&r.setValue("title",h.title,{shouldDirty:!1}),!k&&!(r.getValues("description")??"").trim()&&h.description&&r.setValue("description",h.description,{shouldDirty:!1}),!x&&h.envVarKeys?.length)){const se=r.getValues("env_vars")??[],Ve=new Set(se.map(I=>I.key)),oe=h.envVarKeys.filter(I=>!Ve.has(I));oe.length>0&&r.setValue("env_vars",[...se,...oe.map(I=>({key:I,value:""}))],{shouldDirty:!0})}},H=$t(n);if(H&&N){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",H.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),w(B({uiType:"NPX",npxPackage:H.packageName}));return}if(n.startsWith("http://")||n.startsWith("https://")){const h=p==="HTTP"||p==="SSE"||p==="Websocket"?p:"HTTP";r.setValue("ui_type",h,{shouldDirty:!0}),r.setValue("connection_url",n,{shouldDirty:!0}),w(B({uiType:h,connectionUrl:n})??Ne({uiType:h,connectionUrl:n,registryItems:q}));return}p==="NPX"&&w(B({uiType:"NPX",npxPackage:n}))},Oe=[{id:"title",header:"Name",render:t=>e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(nt,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(z,{})}),e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title})]}),cellClassName:"w-32 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-muted-foreground truncate block",title:t.description||"",children:t.description||"—"}),cellClassName:"flex-1 min-w-0 max-w-0",wrap:!1,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-xs font-medium",children:t.connection_type}),cellClassName:"w-16 shrink-0",sortable:!0},{id:"status",header:"Status",render:t=>e.jsx(Ce,{status:t.status}),cellClassName:"w-28 shrink-0",sortable:!1},{id:"updated_by",header:"Updated by",render:t=>e.jsx(re,{id:t.updated_by??t.created_by,size:"3xs"}),cellClassName:"w-32 shrink-0",sortable:!0},{id:"updated_at",header:"Updated",render:t=>e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:t.updated_at?_e(new Date(t.updated_at)):"—"}),cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(xe,{children:[e.jsx(he,{asChild:!0,children:e.jsx(S,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:n=>n.stopPropagation(),children:e.jsx(je,{size:20})})}),e.jsxs(ge,{align:"end",onClick:n=>n.stopPropagation(),children:[e.jsxs(F,{onClick:n=>{n.stopPropagation(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}})},children:[e.jsx(ye,{size:16}),"Open"]}),e.jsxs(F,{variant:"destructive",onClick:n=>{n.stopPropagation(),b({type:"delete",connection:t})},children:[e.jsx(ve,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],Ae=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:g}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(S,{onClick:De,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(E,{children:[e.jsx(mt,{open:Q||u.mode==="editing",onOpenChange:ne,children:e.jsxs(ut,{className:"sm:max-w-[525px]",children:[e.jsxs(pt,{children:[e.jsx(xt,{children:m?"Edit Connection":"Create Connection"}),e.jsx(ht,{children:m?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(ft,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit($e),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(f,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Type *"}),e.jsxs(jt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(v,{children:e.jsx(yt,{children:e.jsx(vt,{})})}),e.jsxs(_t,{children:[e.jsx($,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx($,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"SSE"]})}),e.jsx($,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"Websocket"]})}),N&&e.jsxs(e.Fragment,{children:[e.jsx($,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx($,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Tt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(_,{})]})}),p==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(f,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"NPM Package *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:n=>{const a=n.clipboardData.getData("text");a&&(n.preventDefault(),r.setValue("npx_package",a.trim(),{shouldDirty:!0}),V(a))},onBlur:n=>{V(n.target.value),t.onBlur()}})}),e.jsx(_,{})]})})}),p==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(f,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Command *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(_,{})]})}),e.jsx(f,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Arguments"}),e.jsx(v,{children:e.jsx(T,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(_,{})]})})]}),e.jsx(f,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Working Directory"}),e.jsx(v,{children:e.jsx(T,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(_,{})]})})]}),(p==="NPX"||p==="STDIO")&&e.jsx(f,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Environment Variables"}),e.jsx(v,{children:e.jsx(Pt,{value:t.value??[],onChange:t.onChange})}),e.jsx(_,{})]})}),p!=="NPX"&&p!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(f,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"URL *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:n=>{const a=n.clipboardData.getData("text");a&&(n.preventDefault(),r.setValue("connection_url",a.trim(),{shouldDirty:!0}),V(a))},onBlur:n=>{V(n.target.value),t.onBlur()}})}),e.jsx(_,{})]})}),e.jsx(f,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:P?.token?.label??"Token (optional)"}),e.jsx(v,{children:e.jsx(T,{type:"password",placeholder:P?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),P?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.token.helperText,P.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(_,{})]})})]}),e.jsx(f,{control:r.control,name:"title",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Name *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"My Connection",...t})}),e.jsx(_,{})]})}),e.jsx(f,{control:r.control,name:"description",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Description"}),e.jsx(v,{children:e.jsx(Ct,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(_,{})]})})]}),e.jsxs(gt,{children:[e.jsx(S,{type:"button",variant:"outline",onClick:()=>ne(!1),children:"Cancel"}),e.jsx(S,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":m?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(ie,{open:u.mode==="deleting",onOpenChange:t=>!t&&b({type:"close"}),children:e.jsxs(ae,{children:[e.jsxs(ce,{children:[e.jsx(le,{children:"Delete Connection?"}),e.jsxs(de,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="deleting"&&u.connection.title}),"."]})]}),e.jsxs(me,{children:[e.jsx(ue,{children:"Cancel"}),e.jsx(pe,{onClick:Ie,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(ie,{open:u.mode==="force-deleting",onOpenChange:t=>!t&&b({type:"close"}),children:e.jsxs(ae,{children:[e.jsxs(ce,{children:[e.jsx(le,{children:"Connection Used by Agents"}),e.jsx(de,{asChild:!0,children:e.jsxs("div",{children:[e.jsxs("p",{children:["The connection"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="force-deleting"&&u.connection.title})," ","is currently used by the following agent(s):"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="force-deleting"&&u.agentNames}),"."]}),e.jsx("p",{className:"mt-2",children:"Deleting this connection will remove it from those agents, which may impact existing workflows that depend on them."})]})})]}),e.jsxs(me,{children:[e.jsx(ue,{children:"Cancel"}),e.jsx(pe,{onClick:Ee,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]})]})}),e.jsxs(E.Header,{children:[e.jsx(E.Header.Left,{children:e.jsx(at,{children:e.jsx(ct,{children:e.jsx(lt,{children:e.jsx(dt,{children:"Connections"})})})})}),e.jsxs(E.Header.Right,{children:[e.jsx(Qe,{viewMode:l.viewMode,onViewModeChange:l.setViewMode,sortKey:l.sortKey,sortDirection:l.sortDirection,onSort:l.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}]}),Ae]})]}),e.jsx(Ye,{value:l.search,onChange:l.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(l.setSearch(""),t.target.blur())}}),e.jsx(E.Content,{children:l.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:A.length===0?e.jsx(L,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(l.search,"No Connections found"),description:l.search?`No Connections match "${l.search}"`:"Create a connection to get started.",actions:!l.search&&e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:g}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:A.map(t=>e.jsx(Ze,{connection:t,fallbackIcon:e.jsx(z,{}),onClick:()=>i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}}),headerActions:e.jsxs(xe,{children:[e.jsx(he,{asChild:!0,children:e.jsx(S,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:n=>n.stopPropagation(),children:e.jsx(je,{size:20})})}),e.jsxs(ge,{align:"end",onClick:n=>n.stopPropagation(),children:[e.jsxs(F,{onClick:n=>{n.stopPropagation(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}})},children:[e.jsx(ye,{size:16}),"Open"]}),e.jsxs(F,{variant:"destructive",onClick:n=>{n.stopPropagation(),b({type:"delete",connection:t})},children:[e.jsx(ve,{size:16}),"Delete"]})]})]}),body:e.jsx(Ce,{status:t.status}),footer:e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(re,{id:t.updated_by??t.created_by,size:"3xs"})}),e.jsx("span",{className:"shrink-0 ml-2",children:t.updated_at?_e(new Date(t.updated_at)):"—"})]})},t.id))})}):e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:e.jsx("div",{className:"min-w-[1000px]",children:e.jsx(Je,{columns:Oe,data:A,isLoading:!1,sortKey:l.sortKey,sortDirection:l.sortDirection,onSort:l.handleSort,onRowClick:t=>i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}}),emptyState:l.search?e.jsx(L,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${l.search}"`}):e.jsx(L,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:g}}),children:"Browse Store"})})})})})})})]})}function Xn(){const s=be.c(1);let o;return s[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(Fe,{children:e.jsx(X.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(St,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Ht,{})})}),s[0]=o):o=s[0],o}export{Xn as default};
@@ -1 +0,0 @@
1
- import{a0 as a,a1 as t}from"./index-BkxNgQ-z.js";const e=a(t,{target:"draft-7"});export{e as B};
@@ -1,11 +0,0 @@
1
- import{r as N,c as O,v as S,j as d}from"./index-BkxNgQ-z.js";import{u as B}from"./use-mcp-resources-DS8p1Owh.js";import{W as z,T as F}from"./types-9lUbCnT7.js";const U=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function W(n,e={}){const s=`<meta http-equiv="Content-Security-Policy" content="${Y(e)}">`,o=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,a=n.match(o);if(a){const r=(a.index??0)+a[0].length;return n.slice(0,r)+`
2
- `+s+n.slice(r)}const i=/<html(\s[^>]*)?>|<HTML(\s[^>]*)?>/i,c=n.match(i);if(c){const r=(c.index??0)+c[0].length;return n.slice(0,r)+`
3
- <head>
4
- `+s+`
5
- </head>`+n.slice(r)}const u=/<!DOCTYPE[^>]*>/i,l=n.match(u);if(l){const r=(l.index??0)+l[0].length;return n.slice(0,r)+`
6
- <head>
7
- `+s+`
8
- </head>`+n.slice(r)}return`<head>
9
- `+s+`
10
- </head>
11
- `+n}const q=/^https?:\/\/[a-zA-Z0-9._-]+(:\d+)?$/;function I(n){return!n||n.length===0?[]:n.filter(e=>q.test(e))}function Y(n){if(n.csp)return n.csp;const e=n.resourceCsp;if(!e)return U;const t=I(e.resourceDomains),s=I(e.connectDomains),o=I(e.frameDomains),a=I(e.baseUriDomains),i=t.length>0,c=s.length>0,u=o.length>0,l=a.length>0;if(!i&&!c&&!u&&!l)return U;const r=t.join(" ");return["default-src 'none'",i?`script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval' ${r}`:"script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'",i?`style-src 'unsafe-inline' ${r}`:"style-src 'unsafe-inline'",i?`img-src * data: blob: ${r}`:"img-src * data: blob:",i?`font-src data: ${r}`:"font-src data:",c?`connect-src ${s.join(" ")}`:"connect-src 'none'",u?`frame-src ${o.join(" ")}`:"frame-src 'none'","worker-src blob:","form-action 'none'",l?`base-uri ${a.join(" ")}`:"base-uri 'none'"].join("; ")}const Z={name:"MCP Mesh",version:"1.0.0"},G={openLinks:{},serverTools:{},serverResources:{},logging:{},message:{},downloadFile:{}},J=15e3;function K(){return typeof window>"u"?"light":window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function Q(n,e){return{theme:K(),displayMode:n,availableDisplayModes:["inline","fullscreen"],...e!=null&&{containerDimensions:{maxHeight:e}}}}class V{bridge=null;timeout=null;disposed=!1;snapshot;listeners=new Set;config;constructor(e){this.config=e,this.snapshot=Object.freeze({height:e.minHeight,isLoading:!0,error:null})}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.snapshot;updateConfig(e){const t=this.config;this.config=e,!(!this.bridge||this.disposed)&&(e.toolInput!==t.toolInput&&e.toolInput!=null&&this.bridge.sendToolInput({arguments:e.toolInput}),e.toolResult!==t.toolResult&&e.toolResult!=null&&this.bridge.sendToolResult(e.toolResult))}set(e){const t=this.snapshot,s={...t,...e};if(!(s.height===t.height&&s.isLoading===t.isLoading&&s.error===t.error)){this.snapshot=Object.freeze(s);for(const o of this.listeners)o()}}teardown(){this.disposed=!0,this.bridge&&(this.bridge.teardownResource({}).catch(()=>{}),this.bridge.close(),this.bridge=null),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}attach=e=>{if(this.teardown(),this.disposed=!1,this.set({height:this.config.minHeight,isLoading:!0,error:null}),!!e){e.onerror=()=>{this.disposed||this.set({error:"Failed to load app",isLoading:!1})};try{const{client:t,displayMode:s,maxHeight:o}=this.config,a=Q(s,o),i=new z(t,Z,G,{hostContext:a});this.bridge=i,this.registerHandlers(i),this.startInitTimeout(),this.registerInitHandler(i),this.connectTransport(i,e)}catch(t){this.clearTimeout(),console.error("Failed to create AppBridge:",t),this.set({error:t instanceof Error?t.message:"Unknown error",isLoading:!1})}}};registerHandlers(e){e.onopenlink=async({url:t})=>{let s=null;try{s=new URL(t)}catch{}if(!s||!["http:","https:"].includes(s.protocol))throw new Error("Only http and https URLs are allowed");return window.open(t,"_blank","noopener,noreferrer"),{}},e.onmessage=async t=>(this.config.onMessage?.(t),{}),e.onsizechange=({height:t})=>{if(!this.disposed&&t!=null){const{minHeight:s,maxHeight:o}=this.config;this.set({height:Math.max(s,Math.min(o,t))})}},e.onloggingmessage=({level:t,data:s})=>{console[t==="error"?"error":"debug"](`[MCP App ${this.config.toolName??"unknown"}]`,s)},e.ondownloadfile=async({contents:t})=>{for(const s of t)if(s.type==="resource"){const o=s.resource,a="blob"in o?new Blob([Uint8Array.from(atob(o.blob),u=>u.charCodeAt(0))],{type:o.mimeType}):new Blob([o.text??""],{type:o.mimeType}),i=URL.createObjectURL(a),c=document.createElement("a");c.href=i,c.download=o.uri.split("/").pop()??"download",c.click(),URL.revokeObjectURL(i)}else s.type==="resource_link"&&window.open(s.uri,"_blank");return{}}}registerInitHandler(e){e.oninitialized=()=>{if(this.disposed)return;this.clearTimeout(),this.set({isLoading:!1});const{toolInput:t,toolResult:s}=this.config;t!=null&&e.sendToolInput({arguments:t}),s!=null&&e.sendToolResult(s)}}startInitTimeout(){this.timeout=setTimeout(()=>{this.disposed||this.set({error:"App took too long to load",isLoading:!1})},J)}clearTimeout(){this.timeout&&(globalThis.clearTimeout(this.timeout),this.timeout=null)}connectTransport(e,t){if(!t.contentWindow){console.warn("iframe contentWindow not yet available");return}const s=new F(t.contentWindow,t.contentWindow);e.connect(s).catch(o=>{this.disposed||(this.clearTimeout(),console.error("AppBridge connect failed:",o),this.set({error:o instanceof Error?o.message:"Connection failed",isLoading:!1}))})}}function X(n){const e=N.useRef(new V(n));N.useEffect(()=>{e.current.updateConfig(n)},[n]);const{height:t,isLoading:s,error:o}=N.useSyncExternalStore(e.current.subscribe,e.current.getSnapshot);return{height:t,isLoading:s,error:o,iframeRef:e.current.attach}}function ee(n){const e=n?.contents?.[0];return!e||!("text"in e)||!e.text?null:W(e.text,{resourceCsp:e._meta?.ui?.csp})}function oe(n){const e=O.c(37),{resourceURI:t,toolName:s,toolInput:o,toolResult:a,displayMode:i,minHeight:c,maxHeight:u,client:l,onMessage:r,className:h}=n,C=i===void 0?"inline":i,D=c===void 0?150:c,H=u===void 0?600:u;let T;e[0]!==l||e[1]!==t?(T={client:l,uri:t,staleTime:3e4},e[0]=l,e[1]=t,e[2]=T):T=e[2];const{data:$}=B(T),y=ee($);let v;e[3]!==l||e[4]!==C||e[5]!==H||e[6]!==D||e[7]!==r||e[8]!==o||e[9]!==s||e[10]!==a?(v={client:l,displayMode:C,minHeight:D,maxHeight:H,toolName:s,toolInput:o,toolResult:a,onMessage:r},e[3]=l,e[4]=C,e[5]=H,e[6]=D,e[7]=r,e[8]=o,e[9]=s,e[10]=a,e[11]=v):v=e[11];const{height:_,isLoading:R,error:j,iframeRef:P}=X(v);if(!y)return null;if(j){let w;e[12]!==h?(w=S("flex items-center justify-center p-4 text-destructive bg-destructive/10 rounded-lg",h),e[12]=h,e[13]=w):w=e[13];let x;e[14]!==j?(x=d.jsx("span",{className:"text-sm",children:j}),e[14]=j,e[15]=x):x=e[15];let L;return e[16]!==w||e[17]!==x?(L=d.jsx("div",{className:w,children:x}),e[16]=w,e[17]=x,e[18]=L):L=e[18],L}let f;e[19]!==h?(f=S("relative w-full overflow-hidden rounded-lg",h),e[19]=h,e[20]=f):f=e[20];const k=`${_}px`;let m;e[21]!==k?(m={height:k},e[21]=k,e[22]=m):m=e[22];let p;e[23]!==R?(p=R&&d.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background z-10",children:d.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[d.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),d.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),e[23]=R,e[24]=p):p=e[24];const A=R&&"invisible";let g;e[25]!==A?(g=S("w-full h-full border-0",A),e[25]=A,e[26]=g):g=e[26];const E=`MCP App: ${s??t}`;let b;e[27]!==y||e[28]!==P||e[29]!==g||e[30]!==E?(b=d.jsx("iframe",{ref:P,srcDoc:y,sandbox:"allow-scripts allow-same-origin allow-forms allow-popups",className:g,title:E}),e[27]=y,e[28]=P,e[29]=g,e[30]=E,e[31]=b):b=e[31];let M;return e[32]!==b||e[33]!==f||e[34]!==m||e[35]!==p?(M=d.jsxs("div",{className:f,style:m,children:[p,b]}),e[32]=b,e[33]=f,e[34]=m,e[35]=p,e[36]=M):M=e[36],M}export{oe as M};
@@ -1 +0,0 @@
1
- import{c as r,j as i}from"./index-BkxNgQ-z.js";import{P as m}from"./project-plugins-OrxVzBYc.js";import"./useQuery-Cj-miqA2.js";import"./useMutation-DtOoZO7h.js";import"./constants--aQ9HnxF.js";import"./switch-BX7m8ylT.js";import"./label-DQ6CQRMq.js";import"./Container-CFxptFeR.js";import"./use-connection-DjiXkPUz.js";import"./use-binding-CVLYzFG-.js";import"./binder-DUACCYIe.js";import"./use-install-from-registry-kgqBLGhb.js";import"./extract-connection-data-DtOGbK2O.js";import"./constants-DoLvwboP.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-Bm8aYhvn.js";import"./generate-id-Dyweu44Y.js";import"./Loading01-BLoQsWVt.js";import"./Plus-4zX3n4bH.js";import"./select-CHQkyynJ.js";import"./index-dKQNml8k.js";import"./Check-BuBqfL8V.js";import"./ChevronDown-D15Vpp0r.js";function q(){const o=r.c(1);let t;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(m,{}),o[0]=t):t=o[0],t}export{q as default};
@@ -1 +0,0 @@
1
- import{r as i,G as $,j as c,aW as H,aH as G,I as A,H as _,M as g,aU as b,T as j,aV as L,aX as w,b0 as z,b1 as U,U as K,b2 as V,b3 as W,b4 as Z,aY as X,aZ as Y,a$ as q,c as R,v as B}from"./index-BkxNgQ-z.js";var C="Popover",[E]=K(C,[w]),P=w(),[J,d]=E(C),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:s,modal:a=!1}=t,p=P(e),l=i.useRef(null),[u,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:s,caller:C});return c.jsx(H,{...p,children:c.jsx(J,{scope:e,contentId:G(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(m=>!m),[f]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:a,children:o})})};N.displayName=C;var F="PopoverAnchor",Q=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(F,o),s=P(o),{onCustomAnchorAdd:a,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(a(),()=>p()),[a,p]),c.jsx(b,{...s,...r,ref:e})});Q.displayName=F;var S="PopoverTrigger",y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(S,o),s=P(o),a=A(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":k(n.open),...r,ref:a,onClick:g(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(b,{asChild:!0,...s,children:p})});y.displayName=S;var O="PopoverPortal",[ee,oe]=E(O,{forceMount:void 0}),M=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,s=d(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(j,{present:o||s.open,children:c.jsx(L,{asChild:!0,container:n,children:r})})})};M.displayName=O;var v="PopoverContent",D=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,s=d(v,t.__scopePopover);return c.jsx(j,{present:r||s.open,children:s.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});D.displayName=v;var te=V("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(null),n=A(e,r),s=i.useRef(!1);return i.useEffect(()=>{const a=r.current;if(a)return z(a)},[]),c.jsx(U,{as:te,allowPinchZoom:!0,children:c.jsx(T,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(t.onCloseAutoFocus,a=>{a.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(t.onPointerDownOutside,a=>{const p=a.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,u=p.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:g(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(T,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||o.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const a=s.target;o.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&n.current&&s.preventDefault()}})}),T=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:h,...x}=t,f=d(v,o),m=P(o);return W(),c.jsx(Z,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:s,children:c.jsx(X,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(Y,{"data-state":k(f.open),role:"dialog",id:f.contentId,...m,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),I="PopoverClose",se=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(I,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});se.displayName=I;var ae="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(q,{...n,...r,ref:e})});ce.displayName=ae;function k(t){return t?"open":"closed"}var ie=N,pe=y,le=M,ue=D;function fe(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(12);let o,r,n,s;e[0]!==t?({className:o,align:n,sideOffset:s,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s):(o=e[1],r=e[2],n=e[3],s=e[4]);const a=n===void 0?"center":n,p=s===void 0?4:s;let l;e[5]!==o?(l=B("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let u;return e[7]!==a||e[8]!==r||e[9]!==p||e[10]!==l?(u=c.jsx(le,{children:c.jsx(ue,{"data-slot":"popover-content",align:a,sideOffset:p,className:l,...r})}),e[7]=a,e[8]=r,e[9]=p,e[10]=l,e[11]=u):u=e[11],u}export{ge as P,fe as a,ve as b};
@@ -1 +0,0 @@
1
- import{c as x,e as g,j as i,r as _,E as I,u as P}from"./index-BkxNgQ-z.js";import{f as C}from"./use-connection-DjiXkPUz.js";import{u as M}from"./constants--aQ9HnxF.js";import{u as R}from"./use-mcp-tools-CHOGR3no.js";import{M as $}from"./mcp-app-renderer-DlqJcoS_.js";import{g as b,M as h}from"./types-9lUbCnT7.js";import"./useMutation-DtOoZO7h.js";import"./useQuery-Cj-miqA2.js";import"./use-mcp-resources-DS8p1Owh.js";const j={};function y(t){const e=x.c(8),{client:o,toolName:c,resourceURI:a}=t;let s;e[0]!==o||e[1]!==c?(s={client:o,toolName:c,toolArguments:j},e[0]=o,e[1]=c,e[2]=s):s=e[2];const{data:n}=R(s);let l;return e[3]!==o||e[4]!==a||e[5]!==c||e[6]!==n?(l=i.jsx($,{resourceURI:a,toolName:c,toolInput:j,toolResult:n,displayMode:"fullscreen",minHeight:h.fullscreen.minHeight,maxHeight:h.fullscreen.maxHeight,client:o,className:"h-full"}),e[3]=o,e[4]=a,e[5]=c,e[6]=n,e[7]=l):l=e[7],l}function v(t){const e=x.c(16),{connectionId:o,toolName:c}=t,{org:a}=P();let s;e[0]!==o||e[1]!==a.id?(s={connectionId:o,orgId:a.id},e[0]=o,e[1]=a.id,e[2]=s):s=e[2];const n=M(s),l=C(o),m=decodeURIComponent(c);let d,f;if(e[3]!==l?.tools||e[4]!==m){let r;e[7]!==m?(r=N=>N.name===m,e[7]=m,e[8]=r):r=e[8],f=(l?.tools??[]).find(r),d=f?._meta?b(f._meta):void 0,e[3]=l?.tools,e[4]=m,e[5]=d,e[6]=f}else d=e[5],f=e[6];const u=d;if(!l){let r;return e[9]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:"Connection not found"})}),e[9]=r):r=e[9],r}if(!f||!u){let r;return e[10]!==m?(r=i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',m,'" not found or has no UI']})}),e[10]=m,e[11]=r):r=e[11],r}let p;return e[12]!==n||e[13]!==m||e[14]!==u?(p=i.jsx(y,{client:n,toolName:m,resourceURI:u}),e[12]=n,e[13]=m,e[14]=u,e[15]=p):p=e[15],p}function w(){const t=x.c(8);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/$project/apps/$connectionId/$toolName"},t[0]=e):e=t[0];const{connectionId:o,toolName:c}=g(e),a=`${o}:${c}`;let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[i.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),i.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),t[1]=s):s=t[1];let n;t[2]!==o||t[3]!==c?(n=i.jsx(_.Suspense,{fallback:s,children:i.jsx(v,{connectionId:o,toolName:c})}),t[2]=o,t[3]=c,t[4]=n):n=t[4];let l;return t[5]!==a||t[6]!==n?(l=i.jsx(I,{fallback:void 0,children:n},a),t[5]=a,t[6]=n,t[7]=l):l=t[7],l}export{w as default};
@@ -1,19 +0,0 @@
1
- import{r as a,bF as k,j as h,c as ve,bX as pe,I as F,D as tt,H as J,U as rt,T as ie,M as W,bE as z,bC as nt,v as Ae}from"./index-BkxNgQ-z.js";import{S as Le}from"./spinner-B_k6AtHn.js";import{e as ot}from"./select-CHQkyynJ.js";const it=({size:e=24,color:t="currentColor",...r})=>a.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},a.createElement("path",{d:"M21 10H3m13-8v4M8 2v4m-.2 16h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 19.72 21 18.88 21 17.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 4 17.88 4 16.2 4H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 6.28 3 7.12 3 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 22 6.12 22 7.8 22Z"}));it.displayName="Calendar";function Pe(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function lt(e){if(Array.isArray(e))return e}function at(e,t,r){return(t=ht(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ct(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,l,s=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(d){u=!0,o=d}finally{try{if(!c&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(u)throw o}}return s}}function st(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Re(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xe(Object(r),!0).forEach(function(n){at(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ut(e,t){if(e==null)return{};var r,n,o=dt(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function dt(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function ft(e,t){return lt(e)||ct(e,t)||mt(e,t)||st()}function pt(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ht(e){var t=pt(e,"string");return typeof t=="symbol"?t:t+""}function mt(e,t){if(e){if(typeof e=="string")return Pe(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pe(e,t):void 0}}function gt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function je(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ce(Object(r),!0).forEach(function(n){gt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ce(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return t.reduceRight(function(o,i){return i(o)},n)}}function Y(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var l=arguments.length,s=new Array(l),c=0;c<l;c++)s[c]=arguments[c];return t.apply(r,[].concat(o,s))}}}function re(e){return{}.toString.call(e).includes("Object")}function bt(e){return!Object.keys(e).length}function K(e){return typeof e=="function"}function wt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function St(e,t){return re(t)||V("changeType"),Object.keys(t).some(function(r){return!wt(e,r)})&&V("changeField"),t}function yt(e){K(e)||V("selectorType")}function Et(e){K(e)||re(e)||V("handlerType"),re(e)&&Object.values(e).some(function(t){return!K(t)})&&V("handlersType")}function Pt(e){e||V("initialIsRequired"),re(e)||V("initialType"),bt(e)&&V("initialContent")}function xt(e,t){throw new Error(e[t]||e.default)}var Rt={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},V=Y(xt)(Rt),Z={changes:St,selector:yt,handler:Et,initial:Pt};function Ct(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Z.initial(e),Z.handler(t);var r={current:e},n=Y(Tt)(r,t),o=Y(Ot)(r),i=Y(Z.changes)(e),l=Y(jt)(r);function s(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return Z.selector(u),u(r.current)}function c(u){vt(n,o,i,l)(u)}return[s,c]}function jt(e,t){return K(t)?t(e.current):t}function Ot(e,t){return e.current=je(je({},e.current),t),t}function Tt(e,t,r){return K(t)?t(e.current):Object.keys(r).forEach(function(n){var o;return(o=t[n])===null||o===void 0?void 0:o.call(t,e.current[n])}),r}var _t={create:Ct},Mt={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function At(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var l=arguments.length,s=new Array(l),c=0;c<l;c++)s[c]=arguments[c];return t.apply(r,[].concat(o,s))}}}function Lt(e){return{}.toString.call(e).includes("Object")}function Dt(e){return e||Oe("configIsRequired"),Lt(e)||Oe("configType"),e.urls?(It(),{paths:{vs:e.urls.monacoBase}}):e}function It(){console.warn(De.deprecation)}function Nt(e,t){throw new Error(e[t]||e.default)}var De={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
3
- You are using deprecated way of configuration.
4
-
5
- Instead of using
6
- monaco.config({ urls: { monacoBase: '...' } })
7
- use
8
- monaco.config({ paths: { vs: '...' } })
9
-
10
- For more please check the link https://github.com/suren-atoyan/monaco-loader#config
11
- `},Oe=At(Nt)(De),Vt={config:Dt},zt=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return function(o){return r.reduceRight(function(i,l){return l(i)},o)}};function Ie(e,t){return Object.keys(t).forEach(function(r){t[r]instanceof Object&&e[r]&&Object.assign(t[r],Ie(e[r],t[r]))}),Re(Re({},e),t)}var Wt={type:"cancelation",msg:"operation is manually canceled"};function he(e){var t=!1,r=new Promise(function(n,o){e.then(function(i){return t?o(Wt):n(i)}),e.catch(o)});return r.cancel=function(){return t=!0},r}var Ht=["monaco"],$t=_t.create({config:Mt,isInitialized:!1,resolve:null,reject:null,monaco:null}),Ne=ft($t,2),Q=Ne[0],le=Ne[1];function kt(e){var t=Vt.config(e),r=t.monaco,n=ut(t,Ht);le(function(o){return{config:Ie(o.config,n),monaco:r}})}function Ut(){var e=Q(function(t){var r=t.monaco,n=t.isInitialized,o=t.resolve;return{monaco:r,isInitialized:n,resolve:o}});if(!e.isInitialized){if(le({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),he(me);if(window.monaco&&window.monaco.editor)return Ve(window.monaco),e.resolve(window.monaco),he(me);zt(Ft,Xt)(Yt)}return he(me)}function Ft(e){return document.body.appendChild(e)}function Bt(e){var t=document.createElement("script");return e&&(t.src=e),t}function Xt(e){var t=Q(function(n){var o=n.config,i=n.reject;return{config:o,reject:i}}),r=Bt("".concat(t.config.paths.vs,"/loader.js"));return r.onload=function(){return e()},r.onerror=t.reject,r}function Yt(){var e=Q(function(r){var n=r.config,o=r.resolve,i=r.reject;return{config:n,resolve:o,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(r){var n=r.m||r;Ve(n),e.resolve(n)},function(r){e.reject(r)})}function Ve(e){Q().monaco||le({monaco:e})}function qt(){return Q(function(e){var t=e.monaco;return t})}var me=new Promise(function(e,t){return le({resolve:e,reject:t})}),ae={config:kt,init:Ut,__getMonacoInstance:qt},Kt={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},ge=Kt,Jt={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Qt=Jt;function Gt({children:e}){return k.createElement("div",{style:Qt.container},e)}var Zt=Gt,er=Zt;function tr({width:e,height:t,isEditorReady:r,loading:n,_ref:o,className:i,wrapperProps:l}){return k.createElement("section",{style:{...ge.wrapper,width:e,height:t},...l},!r&&k.createElement(er,null,n),k.createElement("div",{ref:o,style:{...ge.fullWidth,...!r&&ge.hide},className:i}))}var rr=tr,ze=a.memo(rr);function nr(e){a.useEffect(e,[])}var We=nr;function or(e,t,r=!0){let n=a.useRef(!0);a.useEffect(n.current||!r?()=>{n.current=!1}:e,t)}var M=or;function q(){}function H(e,t,r,n){return ir(e,n)||lr(e,t,r,n)}function ir(e,t){return e.editor.getModel(He(e,t))}function lr(e,t,r,n){return e.editor.createModel(t,r,n?He(e,n):void 0)}function He(e,t){return e.Uri.parse(t)}function ar({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:l,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:c=!1,theme:u="light",loading:d="Loading...",options:f={},height:p="100%",width:v="100%",className:R,wrapperProps:A={},beforeMount:D=q,onMount:T=q}){let[P,x]=a.useState(!1),[y,w]=a.useState(!0),S=a.useRef(null),b=a.useRef(null),j=a.useRef(null),g=a.useRef(T),m=a.useRef(D),_=a.useRef(!1);We(()=>{let E=ae.init();return E.then(C=>(b.current=C)&&w(!1)).catch(C=>C?.type!=="cancelation"&&console.error("Monaco initialization: error:",C)),()=>S.current?X():E.cancel()}),M(()=>{if(S.current&&b.current){let E=S.current.getOriginalEditor(),C=H(b.current,e||"",n||r||"text",i||"");C!==E.getModel()&&E.setModel(C)}},[i],P),M(()=>{if(S.current&&b.current){let E=S.current.getModifiedEditor(),C=H(b.current,t||"",o||r||"text",l||"");C!==E.getModel()&&E.setModel(C)}},[l],P),M(()=>{let E=S.current.getModifiedEditor();E.getOption(b.current.editor.EditorOption.readOnly)?E.setValue(t||""):t!==E.getValue()&&(E.executeEdits("",[{range:E.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),E.pushUndoStop())},[t],P),M(()=>{S.current?.getModel()?.original.setValue(e||"")},[e],P),M(()=>{let{original:E,modified:C}=S.current.getModel();b.current.editor.setModelLanguage(E,n||r||"text"),b.current.editor.setModelLanguage(C,o||r||"text")},[r,n,o],P),M(()=>{b.current?.editor.setTheme(u)},[u],P),M(()=>{S.current?.updateOptions(f)},[f],P);let B=a.useCallback(()=>{if(!b.current)return;m.current(b.current);let E=H(b.current,e||"",n||r||"text",i||""),C=H(b.current,t||"",o||r||"text",l||"");S.current?.setModel({original:E,modified:C})},[r,t,o,e,n,i,l]),G=a.useCallback(()=>{!_.current&&j.current&&(S.current=b.current.editor.createDiffEditor(j.current,{automaticLayout:!0,...f}),B(),b.current?.editor.setTheme(u),x(!0),_.current=!0)},[f,u,B]);a.useEffect(()=>{P&&g.current(S.current,b.current)},[P]),a.useEffect(()=>{!y&&!P&&G()},[y,P,G]);function X(){let E=S.current?.getModel();s||E?.original?.dispose(),c||E?.modified?.dispose(),S.current?.dispose()}return k.createElement(ze,{width:v,height:p,isEditorReady:P,loading:d,_ref:j,className:R,wrapperProps:A})}var cr=ar;a.memo(cr);function sr(e){let t=a.useRef();return a.useEffect(()=>{t.current=e},[e]),t.current}var ur=sr,ee=new Map;function dr({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:o,path:i,theme:l="light",line:s,loading:c="Loading...",options:u={},overrideServices:d={},saveViewState:f=!0,keepCurrentModel:p=!1,width:v="100%",height:R="100%",className:A,wrapperProps:D={},beforeMount:T=q,onMount:P=q,onChange:x,onValidate:y=q}){let[w,S]=a.useState(!1),[b,j]=a.useState(!0),g=a.useRef(null),m=a.useRef(null),_=a.useRef(null),B=a.useRef(P),G=a.useRef(T),X=a.useRef(),E=a.useRef(n),C=ur(i),ye=a.useRef(!1),ue=a.useRef(!1);We(()=>{let O=ae.init();return O.then(N=>(g.current=N)&&j(!1)).catch(N=>N?.type!=="cancelation"&&console.error("Monaco initialization: error:",N)),()=>m.current?et():O.cancel()}),M(()=>{let O=H(g.current,e||n||"",t||o||"",i||r||"");O!==m.current?.getModel()&&(f&&ee.set(C,m.current?.saveViewState()),m.current?.setModel(O),f&&m.current?.restoreViewState(ee.get(i)))},[i],w),M(()=>{m.current?.updateOptions(u)},[u],w),M(()=>{!m.current||n===void 0||(m.current.getOption(g.current.editor.EditorOption.readOnly)?m.current.setValue(n):n!==m.current.getValue()&&(ue.current=!0,m.current.executeEdits("",[{range:m.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),m.current.pushUndoStop(),ue.current=!1))},[n],w),M(()=>{let O=m.current?.getModel();O&&o&&g.current?.editor.setModelLanguage(O,o)},[o],w),M(()=>{s!==void 0&&m.current?.revealLine(s)},[s],w),M(()=>{g.current?.editor.setTheme(l)},[l],w);let Ee=a.useCallback(()=>{if(!(!_.current||!g.current)&&!ye.current){G.current(g.current);let O=i||r,N=H(g.current,n||e||"",t||o||"",O||"");m.current=g.current?.editor.create(_.current,{model:N,automaticLayout:!0,...u},d),f&&m.current.restoreViewState(ee.get(O)),g.current.editor.setTheme(l),s!==void 0&&m.current.revealLine(s),S(!0),ye.current=!0}},[e,t,r,n,o,i,u,d,f,l,s]);a.useEffect(()=>{w&&B.current(m.current,g.current)},[w]),a.useEffect(()=>{!b&&!w&&Ee()},[b,w,Ee]),E.current=n,a.useEffect(()=>{w&&x&&(X.current?.dispose(),X.current=m.current?.onDidChangeModelContent(O=>{ue.current||x(m.current.getValue(),O)}))},[w,x]),a.useEffect(()=>{if(w){let O=g.current.editor.onDidChangeMarkers(N=>{let de=m.current.getModel()?.uri;if(de&&N.find(fe=>fe.path===de.path)){let fe=g.current.editor.getModelMarkers({resource:de});y?.(fe)}});return()=>{O?.dispose()}}return()=>{}},[w,y]);function et(){X.current?.dispose(),p?f&&ee.set(i,m.current.saveViewState()):m.current.getModel()?.dispose(),m.current.dispose()}return k.createElement(ze,{width:v,height:R,isEditorReady:w,loading:c,_ref:_,className:A,wrapperProps:D})}var fr=dr,pr=a.memo(fr),hr=pr;async function mr(e){const t=e.getModel();if(!t)throw new Error("[Monaco] No model found in editor");const r=t.getValue(),o=r.replace(/export default (async )?function/,"export default $1function __default")+`
12
- type __ExpandRecursively<T> = T extends (...args: infer A) => infer R
13
- ? (...args: __ExpandRecursively<A>) => __ExpandRecursively<R>
14
- : T extends object
15
- ? T extends infer O ? { [K in keyof O]: __ExpandRecursively<O[K]> } : never
16
- : T;
17
- type __InferredOutput = __ExpandRecursively<Awaited<ReturnType<typeof __default>>>;
18
- declare const __outputValue: __InferredOutput;
19
- `;t.setValue(o);const i=t.findMatches("__outputValue",!1,!1,!1,null,!1);if(!i||i.length===0)return t.setValue(r),null;const l=i[0];if(!l)return t.setValue(r),null;const s={lineNumber:l.range.startLineNumber,column:l.range.startColumn+1};try{const u=await(await ae.init()).languages.typescript.getTypeScriptWorker();if(!u)return t.setValue(r),null;const d=await u(t.uri);await new Promise(v=>setTimeout(v,100));const f=t.getOffsetAt(s),p=await d.getQuickInfoAtPosition(t.uri.toString(),f);if(t.setValue(r),p){const R=p.displayParts.map(D=>D.text).join("").replace(/^const __outputValue:\s*/,"");return $(R)}else return null}catch(c){return t.setValue(r),console.error("Error getting return type:",c),null}}function $(e){if(e=e.trim(),e==="string")return{type:"string"};if(e==="number")return{type:"number"};if(e==="boolean")return{type:"boolean"};if(e==="null")return{type:"null"};if(e==="undefined")return{type:"null"};if(e==="unknown"||e==="any")return{};if(e==="never")return{not:{}};if(e.endsWith("[]")){const n=e.slice(0,-2);return{type:"array",items:$(n)}}const t=e.match(/^Array<(.+)>$/);if(t&&t[1])return{type:"array",items:$(t[1])};const r=e.match(/^Record<(.+),\s*(.+)>$/);if(r&&r[2])return{type:"object",additionalProperties:$(r[2].trim())};if(e.includes("|")){const n=gr(e);if(n.length>1)return n.every(i=>/^["']/.test(i.trim()))?{type:"string",enum:n.map(i=>i.trim().replace(/^["']|["']$/g,""))}:{anyOf:n.map(i=>$(i.trim()))}}return/^["'].*["']$/.test(e)?{type:"string",const:e.slice(1,-1)}:/^-?\d+(\.\d+)?$/.test(e)?{type:"number",const:parseFloat(e)}:e.startsWith("{")&&e.endsWith("}")?vr(e):{description:`TypeScript type: ${e}`}}function gr(e){const t=[];let r=0,n="";for(let o=0;o<e.length;o++){const i=e[o];if(i==="{"||i==="<"||i==="("||i==="[")r++;else if(i==="}"||i===">"||i===")"||i==="]")r--;else if(i==="|"&&r===0){t.push(n.trim()),n="";continue}n+=i}return n.trim()&&t.push(n.trim()),t}function vr(e){const t=e.slice(1,-1).trim();if(!t)return{type:"object",properties:{}};const r={},n=[];let o=0,i="";for(let s=0;s<t.length;s++){const c=t[s];if(c==="{"||c==="<"||c==="("||c==="[")o++;else if(c==="}"||c===">"||c===")"||c==="]")o--;else if(c===";"&&o===0){i.trim()&&Te(i.trim(),r,n),i="";continue}i+=c}i.trim()&&Te(i.trim(),r,n);const l={type:"object",properties:r};return n.length>0&&(l.required=n),l}function Te(e,t,r){const n=e.match(/^(\w+)(\?)?:\s*(.+)$/s);if(n){const o=n[1],i=n[2],l=n[3];o&&l&&(t[o]=$(l.trim()),i||r.push(o))}}class br extends a.Component{constructor(t){super(t),this.state={hasError:!1,mountKey:0}}static getDerivedStateFromError(t){if(t.message?.includes("InstantiationService has been disposed"))return{hasError:!0};throw t}componentDidCatch(t){t.message?.includes("InstantiationService has been disposed")&&this.setState(r=>({hasError:!1,mountKey:r.mountKey+1}))}render(){return this.state.hasError?h.jsx("div",{className:"flex items-center justify-center h-full w-full bg-[#1e1e1e] text-gray-400",children:h.jsx(Le,{size:"sm"})}):a.cloneElement(this.props.children,{mountKey:this.state.mountKey})}}let te=null;const wr=async()=>{if(te)return te;const[e,t,r]=await Promise.all([pe(()=>import("./standalone-DS4gw9AE.js"),[]),pe(()=>import("./typescript-Ca_eWjgL.js"),[]),pe(()=>import("./estree-CwOGYdhi.js"),[])]);return te={format:e.format,plugins:[t.default,r.default]},te};ae.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});const Sr={parser:"typescript",semi:!0,singleQuote:!1,tabWidth:2,trailingComma:"es5",printWidth:80},_e={fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,stickyScroll:{enabled:!1},wordWrap:"on",folding:!0,bracketPairColorization:{enabled:!0},suggestOnTriggerCharacters:!0,quickSuggestions:{other:!0,comments:!1,strings:!0},minimap:{enabled:!1},parameterHints:{enabled:!0},inlineSuggest:{enabled:!0},autoClosingBrackets:"always",autoClosingQuotes:"always",autoSurround:"languageDefined",padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8},theme:"light"},yr=h.jsx("div",{className:"flex items-center justify-center h-full w-full text-gray-400",children:h.jsx(Le,{size:"sm"})}),Er=a.memo(function({code:t,onChange:r,onSave:n,readOnly:o=!1,height:i=300,language:l="typescript",foldOnMount:s=!1,mountKey:c=0}){const u=a.useRef(null),d=a.useRef(null),f=a.useRef(n);f.current=n;const p=a.useRef(l);p.current=l;const v=a.useId(),R=`${v}-${c}`,A=l==="typescript"?`file:///workflow-${v.replace(/:/g,"-")}-${c}.tsx`:void 0,D=o?{..._e,readOnly:!0}:_e,T=async x=>{const y=x.getModel();if(!y){console.warn("No model found");return}const w=y.getValue();if(p.current==="json"){try{const b=JSON.parse(w),j=JSON.stringify(b,null,2);if(j!==w){const g=y.getFullModelRange();x.executeEdits("json-format",[{range:g,text:j}])}}catch(b){console.error("JSON formatting failed:",b)}return}try{const{format:b,plugins:j}=await wr(),g=await b(w,{...Sr,plugins:j});if(g!==w){const m=y.getFullModelRange();x.executeEdits("prettier",[{range:m,text:g}])}}catch(b){console.error("Prettier formatting failed:",b)}},P=async(x,y)=>{u.current=x,s&&d.current&&(d.current.style.visibility="hidden",await x.getAction("editor.foldLevel2")?.run(),d.current.style.visibility="visible"),l==="typescript"&&(y.languages.typescript.typescriptDefaults.setCompilerOptions({target:y.languages.typescript.ScriptTarget.ESNext,module:y.languages.typescript.ModuleKind.ESNext,moduleResolution:y.languages.typescript.ModuleResolutionKind.NodeJs,allowNonTsExtensions:!0,allowJs:!0,strict:!1,noEmit:!0,esModuleInterop:!0,jsx:y.languages.typescript.JsxEmit.React,allowSyntheticDefaultImports:!0}),y.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1})),x.addCommand(y.KeyMod.CtrlCmd|y.KeyCode.KeyS,async()=>{await T(x);const w=await mr(x),S=x.getValue();f.current?.(S,w)})};return h.jsx("div",{ref:d,className:"h-full",children:h.jsx(hr,{height:i,language:l,value:t,path:A,onChange:r,onMount:P,loading:yr,options:D},R)})}),$r=a.memo(function(t){const r=ve.c(2);let n;return r[0]!==t?(n=h.jsx(br,{children:h.jsx(Er,{...t})}),r[0]=t,r[1]=n):n=r[1],n});function Pr(e,t){return a.useReducer((r,n)=>t[r][n]??r,e)}var be="ScrollArea",[$e]=rt(be),[xr,L]=$e(be),ke=a.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:o,scrollHideDelay:i=600,...l}=e,[s,c]=a.useState(null),[u,d]=a.useState(null),[f,p]=a.useState(null),[v,R]=a.useState(null),[A,D]=a.useState(null),[T,P]=a.useState(0),[x,y]=a.useState(0),[w,S]=a.useState(!1),[b,j]=a.useState(!1),g=F(t,_=>c(_)),m=tt(o);return h.jsx(xr,{scope:r,type:n,dir:m,scrollHideDelay:i,scrollArea:s,viewport:u,onViewportChange:d,content:f,onContentChange:p,scrollbarX:v,onScrollbarXChange:R,scrollbarXEnabled:w,onScrollbarXEnabledChange:S,scrollbarY:A,onScrollbarYChange:D,scrollbarYEnabled:b,onScrollbarYEnabledChange:j,onCornerWidthChange:P,onCornerHeightChange:y,children:h.jsx(J.div,{dir:m,...l,ref:g,style:{position:"relative","--radix-scroll-area-corner-width":T+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});ke.displayName=be;var Ue="ScrollAreaViewport",Fe=a.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:o,...i}=e,l=L(Ue,r),s=a.useRef(null),c=F(t,s,l.onViewportChange);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),h.jsx(J.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:h.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});Fe.displayName=Ue;var I="ScrollAreaScrollbar",Be=a.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=L(I,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:l}=o,s=e.orientation==="horizontal";return a.useEffect(()=>(s?i(!0):l(!0),()=>{s?i(!1):l(!1)}),[s,i,l]),o.type==="hover"?h.jsx(Rr,{...n,ref:t,forceMount:r}):o.type==="scroll"?h.jsx(Cr,{...n,ref:t,forceMount:r}):o.type==="auto"?h.jsx(Xe,{...n,ref:t,forceMount:r}):o.type==="always"?h.jsx(we,{...n,ref:t}):null});Be.displayName=I;var Rr=a.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=L(I,e.__scopeScrollArea),[i,l]=a.useState(!1);return a.useEffect(()=>{const s=o.scrollArea;let c=0;if(s){const u=()=>{window.clearTimeout(c),l(!0)},d=()=>{c=window.setTimeout(()=>l(!1),o.scrollHideDelay)};return s.addEventListener("pointerenter",u),s.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),s.removeEventListener("pointerenter",u),s.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),h.jsx(ie,{present:r||i,children:h.jsx(Xe,{"data-state":i?"visible":"hidden",...n,ref:t})})}),Cr=a.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=L(I,e.__scopeScrollArea),i=e.orientation==="horizontal",l=se(()=>c("SCROLL_END"),100),[s,c]=Pr("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return a.useEffect(()=>{if(s==="idle"){const u=window.setTimeout(()=>c("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[s,o.scrollHideDelay,c]),a.useEffect(()=>{const u=o.viewport,d=i?"scrollLeft":"scrollTop";if(u){let f=u[d];const p=()=>{const v=u[d];f!==v&&(c("SCROLL"),l()),f=v};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[o.viewport,i,c,l]),h.jsx(ie,{present:r||s!=="hidden",children:h.jsx(we,{"data-state":s==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:W(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:W(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Xe=a.forwardRef((e,t)=>{const r=L(I,e.__scopeScrollArea),{forceMount:n,...o}=e,[i,l]=a.useState(!1),s=e.orientation==="horizontal",c=se(()=>{if(r.viewport){const u=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;l(s?u:d)}},10);return U(r.viewport,c),U(r.content,c),h.jsx(ie,{present:n||i,children:h.jsx(we,{"data-state":i?"visible":"hidden",...o,ref:t})})}),we=a.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,o=L(I,e.__scopeScrollArea),i=a.useRef(null),l=a.useRef(0),[s,c]=a.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Qe(s.viewport,s.content),d={...n,sizes:s,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:p=>l.current=p};function f(p,v){return Ar(p,l.current,s,v)}return r==="horizontal"?h.jsx(jr,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,v=Me(p,s,o.dir);i.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=f(p,o.dir))}}):r==="vertical"?h.jsx(Or,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,v=Me(p,s);i.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=f(p))}}):null}),jr=a.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=L(I,e.__scopeScrollArea),[l,s]=a.useState(),c=a.useRef(null),u=F(t,c,i.onScrollbarXChange);return a.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),h.jsx(qe,{"data-orientation":"horizontal",...o,ref:u,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ce(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(i.viewport){const p=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(p),Ze(p,f)&&d.preventDefault()}},onResize:()=>{c.current&&i.viewport&&l&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:oe(l.paddingLeft),paddingEnd:oe(l.paddingRight)}})}})}),Or=a.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=L(I,e.__scopeScrollArea),[l,s]=a.useState(),c=a.useRef(null),u=F(t,c,i.onScrollbarYChange);return a.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),h.jsx(qe,{"data-orientation":"vertical",...o,ref:u,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ce(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(i.viewport){const p=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(p),Ze(p,f)&&d.preventDefault()}},onResize:()=>{c.current&&i.viewport&&l&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:oe(l.paddingTop),paddingEnd:oe(l.paddingBottom)}})}})}),[Tr,Ye]=$e(I),qe=a.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:o,onThumbChange:i,onThumbPointerUp:l,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:f,...p}=e,v=L(I,r),[R,A]=a.useState(null),D=F(t,g=>A(g)),T=a.useRef(null),P=a.useRef(""),x=v.viewport,y=n.content-n.viewport,w=z(d),S=z(c),b=se(f,10);function j(g){if(T.current){const m=g.clientX-T.current.left,_=g.clientY-T.current.top;u({x:m,y:_})}}return a.useEffect(()=>{const g=m=>{const _=m.target;R?.contains(_)&&w(m,y)};return document.addEventListener("wheel",g,{passive:!1}),()=>document.removeEventListener("wheel",g,{passive:!1})},[x,R,y,w]),a.useEffect(S,[n,S]),U(R,b),U(v.content,b),h.jsx(Tr,{scope:r,scrollbar:R,hasThumb:o,onThumbChange:z(i),onThumbPointerUp:z(l),onThumbPositionChange:S,onThumbPointerDown:z(s),children:h.jsx(J.div,{...p,ref:D,style:{position:"absolute",...p.style},onPointerDown:W(e.onPointerDown,g=>{g.button===0&&(g.target.setPointerCapture(g.pointerId),T.current=R.getBoundingClientRect(),P.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),j(g))}),onPointerMove:W(e.onPointerMove,j),onPointerUp:W(e.onPointerUp,g=>{const m=g.target;m.hasPointerCapture(g.pointerId)&&m.releasePointerCapture(g.pointerId),document.body.style.webkitUserSelect=P.current,v.viewport&&(v.viewport.style.scrollBehavior=""),T.current=null})})})}),ne="ScrollAreaThumb",Ke=a.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ye(ne,e.__scopeScrollArea);return h.jsx(ie,{present:r||o.hasThumb,children:h.jsx(_r,{ref:t,...n})})}),_r=a.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...o}=e,i=L(ne,r),l=Ye(ne,r),{onThumbPositionChange:s}=l,c=F(t,f=>l.onThumbChange(f)),u=a.useRef(void 0),d=se(()=>{u.current&&(u.current(),u.current=void 0)},100);return a.useEffect(()=>{const f=i.viewport;if(f){const p=()=>{if(d(),!u.current){const v=Lr(f,s);u.current=v,s()}};return s(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[i.viewport,d,s]),h.jsx(J.div,{"data-state":l.hasThumb?"visible":"hidden",...o,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:W(e.onPointerDownCapture,f=>{const v=f.target.getBoundingClientRect(),R=f.clientX-v.left,A=f.clientY-v.top;l.onThumbPointerDown({x:R,y:A})}),onPointerUp:W(e.onPointerUp,l.onThumbPointerUp)})});Ke.displayName=ne;var Se="ScrollAreaCorner",Je=a.forwardRef((e,t)=>{const r=L(Se,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?h.jsx(Mr,{...e,ref:t}):null});Je.displayName=Se;var Mr=a.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,o=L(Se,r),[i,l]=a.useState(0),[s,c]=a.useState(0),u=!!(i&&s);return U(o.scrollbarX,()=>{const d=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(d),c(d)}),U(o.scrollbarY,()=>{const d=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(d),l(d)}),u?h.jsx(J.div,{...n,ref:t,style:{width:i,height:s,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function oe(e){return e?parseInt(e,10):0}function Qe(e,t){const r=e/t;return isNaN(r)?0:r}function ce(e){const t=Qe(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function Ar(e,t,r,n="ltr"){const o=ce(r),i=o/2,l=t||i,s=o-l,c=r.scrollbar.paddingStart+l,u=r.scrollbar.size-r.scrollbar.paddingEnd-s,d=r.content-r.viewport,f=n==="ltr"?[0,d]:[d*-1,0];return Ge([c,u],f)(e)}function Me(e,t,r="ltr"){const n=ce(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,l=t.content-t.viewport,s=i-n,c=r==="ltr"?[0,l]:[l*-1,0],u=ot(e,c);return Ge([0,l],[0,s])(u)}function Ge(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function Ze(e,t){return e>0&&e<t}var Lr=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return(function o(){const i={left:e.scrollLeft,top:e.scrollTop},l=r.left!==i.left,s=r.top!==i.top;(l||s)&&t(),r=i,n=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(n)};function se(e,t){const r=z(e),n=a.useRef(0);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),a.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function U(e,t){const r=z(t);nt(()=>{let n=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}var Dr=ke,Ir=Fe,Nr=Je;function kr(e){const t=ve.c(17);let r,n,o,i;t[0]!==e?({className:n,children:r,hideScrollbar:i,...o}=e,t[0]=e,t[1]=r,t[2]=n,t[3]=o,t[4]=i):(r=t[1],n=t[2],o=t[3],i=t[4]);const l=i===void 0?!1:i;let s;t[5]!==n?(s=Ae("relative h-full w-full",n),t[5]=n,t[6]=s):s=t[6];let c;t[7]!==r?(c=h.jsx(Ir,{"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:ring-ring/50",children:h.jsx("div",{className:"flex min-w-0 flex-col",children:r})}),t[7]=r,t[8]=c):c=t[8];let u;t[9]!==l?(u=h.jsx(Vr,{hideScrollbar:l}),t[9]=l,t[10]=u):u=t[10];let d;t[11]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsx(Nr,{}),t[11]=d):d=t[11];let f;return t[12]!==o||t[13]!==s||t[14]!==c||t[15]!==u?(f=h.jsxs(Dr,{"data-slot":"scroll-area",className:s,...o,children:[c,u,d]}),t[12]=o,t[13]=s,t[14]=c,t[15]=u,t[16]=f):f=t[16],f}function Vr(e){const t=ve.c(15);let r,n,o,i;t[0]!==e?({className:r,orientation:o,hideScrollbar:i,...n}=e,t[0]=e,t[1]=r,t[2]=n,t[3]=o,t[4]=i):(r=t[1],n=t[2],o=t[3],i=t[4]);const l=o===void 0?"vertical":o,s=i===void 0?!1:i,c=l==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=l==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",d=s&&"hidden";let f;t[5]!==r||t[6]!==c||t[7]!==u||t[8]!==d?(f=Ae("select-none touch-none p-px transition-colors",c,u,d,r),t[5]=r,t[6]=c,t[7]=u,t[8]=d,t[9]=f):f=t[9];let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx(Ke,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),t[10]=p):p=t[10];let v;return t[11]!==l||t[12]!==n||t[13]!==f?(v=h.jsx(Be,{"data-slot":"scroll-area-scrollbar",orientation:l,className:f,...n,children:p}),t[11]=l,t[12]=n,t[13]=f,t[14]=v):v=t[14],v}export{$r as M,Vr as S,kr as a,it as n};
@@ -1 +0,0 @@
1
- import{c as n,j as r,E as d,r as f,u as x,b as j}from"./index-BkxNgQ-z.js";import{T as h}from"./tasks-panel-CIityBOn.js";import{P as p}from"./index-B4YFEuZr.js";import{B as g,a as b,b as T,c as k}from"./breadcrumb-DxXcAXh7.js";import{i as B}from"./Loading01-BLoQsWVt.js";import{u as S}from"./collapsible-CG7okAAn.js";import"./index-u5kBBr5i.js";import"./popover-CJnKtmVV.js";import"./skeleton-Bla1LCSZ.js";import"./spinner-B_k6AtHn.js";import"./tooltip-DvMRS01W.js";import"./index-dKQNml8k.js";import"./constants--aQ9HnxF.js";import"./decopilot-events-DZodCqX1.js";import"./useQuery-Cj-miqA2.js";import"./dialog-CrYlSCa6.js";import"./X-CpsrVd7E.js";import"./form-DKOb9Dxi.js";import"./label-DQ6CQRMq.js";import"./input-BxWPl4Ur.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-BNm6R5tp.js";import"./ChevronDown-D15Vpp0r.js";import"./Edit01-CbZPkCJz.js";import"./Users03-CUxh9_Jy.js";import"./XCircle-BcvU_Xzf.js";import"./AlertCircle-dxGFeayp.js";import"./select-CHQkyynJ.js";import"./Check-BuBqfL8V.js";import"./tabs-tcquyh90.js";import"./localstorage-keys-2beZrYfY.js";import"./useMutation-DtOoZO7h.js";import"./ArrowLeft-DKmEJ5pf.js";import"./use-copy-DiVO6tbG.js";import"./badge-UPowR1Nj.js";import"./Code01-DhSY1b20.js";import"./integration-icon-DqBJsR0X.js";import"./Container-CFxptFeR.js";import"./use-virtual-mcp-Wj5StsuR.js";import"./use-connection-DjiXkPUz.js";import"./SearchMd-BvHN4xgB.js";import"./use-create-virtual-mcp-DnOGpm5h.js";import"./use-mcp-resources-DS8p1Owh.js";import"./ChevronRight-u7jqeZNG.js";import"./Copy01-D2l3XUry.js";import"./marked.esm-BaswSlok.js";import"./markdown-08iefd1w.js";import"./mcp-app-renderer-DlqJcoS_.js";import"./types-9lUbCnT7.js";import"./Eye-vR70tVFn.js";import"./Globe02-6j3SB4QZ.js";import"./LayersTwo01-f778oNbj.js";import"./XClose-CnTCpAeI.js";import"./collection-search-BgstpGbD.js";import"./generate-id-Dyweu44Y.js";import"./Clock-B88-VhpY.js";import"./Trash01-BvIumE4M.js";import"./user-BcEL6pjj.js";import"./avatar-BeiX4aSz.js";import"./format-time-CMKyl-GC.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./CheckCircle-B-t884rD.js";import"./Plus-4zX3n4bH.js";import"./use-llm-Bkjj502R.js";import"./use-binding-CVLYzFG-.js";import"./binder-DUACCYIe.js";import"./checkbox-Df-Mj-oX.js";import"./AlignLeft-zf4ygcA_.js";import"./Image01-oZtE9Z5q.js";import"./RefreshCcw01-DzE0Vt_s.js";import"./Settings01-B5kunEo2.js";import"./useSuspenseInfiniteQuery-D62VIKAF.js";import"./infiniteQueryObserver-DFroUYRE.js";function v(){const t=n.c(8),{org:o,project:s}=x(),a=j(),{switchToTask:c}=S();let i;t[0]!==a||t[1]!==o.slug||t[2]!==s.slug||t[3]!==c?(i=async u=>{await c(u),a({to:"/$org/$project",params:{org:o.slug,project:s.slug}})},t[0]=a,t[1]=o.slug,t[2]=s.slug,t[3]=c,t[4]=i):i=t[4];const l=i;let m;t[5]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx(p.Header,{children:r.jsx(p.Header.Left,{children:r.jsx(g,{children:r.jsx(b,{children:r.jsx(T,{children:r.jsx(k,{children:"Tasks"})})})})})}),t[5]=m):m=t[5];let e;return t[6]!==l?(e=r.jsxs(p,{children:[m,r.jsx(p.Content,{children:r.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:r.jsx(h,{onTaskSelect:l})})})]}),t[6]=l,t[7]=e):e=t[7],e}function Kt(){const t=n.c(1);let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx(d,{children:r.jsx(f.Suspense,{fallback:r.jsx("div",{className:"flex h-full items-center justify-center",children:r.jsx(B,{size:32,className:"animate-spin text-muted-foreground"})}),children:r.jsx(v,{})})}),t[0]=o):o=t[0],o}export{Kt as default};
@@ -1 +0,0 @@
1
- import{I as u}from"./infiniteQueryObserver-DFroUYRE.js";import{Y as i}from"./index-BkxNgQ-z.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +0,0 @@
1
- import{Y as u,a3 as s}from"./index-BkxNgQ-z.js";function o(e,r){return u(e,s,r)}export{o as u};
@@ -1 +0,0 @@
1
- import{I as s}from"./infiniteQueryObserver-DFroUYRE.js";import{Y as u,Z as n}from"./index-BkxNgQ-z.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};