@decocms/mesh 2.123.4 → 2.124.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/dist/client/assets/{AlertCircle-DiDJuuO7.js → AlertCircle-FqZvtfh1.js} +1 -1
  2. package/dist/client/assets/{AlertOctagon-T8X2xR5Y.js → AlertOctagon-raXiOXHj.js} +1 -1
  3. package/dist/client/assets/{AlertTriangle-BR7J9Jvh.js → AlertTriangle-Cag6cydu.js} +1 -1
  4. package/dist/client/assets/ArrowDown-BzwwIvol.js +1 -0
  5. package/dist/client/assets/{ArrowLeft-CZ4ZZXqO.js → ArrowLeft-CHSuXHTI.js} +1 -1
  6. package/dist/client/assets/ArrowUp-lkpB-gsw.js +1 -0
  7. package/dist/client/assets/{Check-ebSdGxZp.js → Check-BEIYk4IG.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-BX10u03U.js → CheckCircle-BwIxyhQy.js} +1 -1
  9. package/dist/client/assets/{CheckDone01-BKZeNjYI.js → CheckDone01-Duh5ZNi_.js} +1 -1
  10. package/dist/client/assets/{CheckVerified02-Bc-TzDsw.js → CheckVerified02-DFKFrqtt.js} +1 -1
  11. package/dist/client/assets/{ChevronDown-BxrIQ2Hg.js → ChevronDown-DDsgD0_a.js} +1 -1
  12. package/dist/client/assets/{ChevronRight-D1zpPr9G.js → ChevronRight-dj0VUAfs.js} +1 -1
  13. package/dist/client/assets/{Clock-ByTlM-Ae.js → Clock-Dv-gTw8O.js} +1 -1
  14. package/dist/client/assets/{Code01-62o0ASv5.js → Code01-DbWG3kai.js} +1 -1
  15. package/dist/client/assets/{Container-Cr2TCDTS.js → Container-BY7Dg1ME.js} +1 -1
  16. package/dist/client/assets/{Copy01-CfVZSokb.js → Copy01-BpXeBtQY.js} +1 -1
  17. package/dist/client/assets/{Dataflow03-CEYvQeh9.js → Dataflow03-Ce5PVi3u.js} +1 -1
  18. package/dist/client/assets/{DotsHorizontal-D_wKOZTi.js → DotsHorizontal--qP7BuAi.js} +1 -1
  19. package/dist/client/assets/{DotsVertical-BNJZVkhj.js → DotsVertical-_M8uWFPN.js} +1 -1
  20. package/dist/client/assets/{Download01-CMusldak.js → Download01-Cvq7FqwC.js} +1 -1
  21. package/dist/client/assets/{Edit01-BySGjbs-.js → Edit01-BOdZHKPa.js} +1 -1
  22. package/dist/client/assets/{Eye-Wh_bq-Y4.js → Eye-D_CQVe6k.js} +1 -1
  23. package/dist/client/assets/{File02-Drnn3tnJ.js → File02-BtCmWw9V.js} +1 -1
  24. package/dist/client/assets/{File06-CL04kImU.js → File06-D2nPQ2vd.js} +1 -1
  25. package/dist/client/assets/{FilterLines-DgwYDfry.js → FilterLines-CeQtwyiF.js} +1 -1
  26. package/dist/client/assets/{Globe01-BMVTN5_w.js → Globe01-BUNBHHR9.js} +1 -1
  27. package/dist/client/assets/{Globe02-BD3ZCWms.js → Globe02-DXh1wFnz.js} +1 -1
  28. package/dist/client/assets/{Grid01-BWcrgmNx.js → Grid01-DDvgvRE8.js} +1 -1
  29. package/dist/client/assets/{Hash02-Dqi3bcQt.js → Hash02-CCi87yL-.js} +1 -1
  30. package/dist/client/assets/{Home02-lTWiIHtK.js → Home02-WM8fzzhX.js} +1 -1
  31. package/dist/client/assets/{Image01-DcX1niB5.js → Image01-ToJS21L5.js} +1 -1
  32. package/dist/client/assets/{Inbox01-8_gDqife.js → Inbox01-Dl3sNTM-.js} +1 -1
  33. package/dist/client/assets/{InfoCircle-BKPaDpeK.js → InfoCircle-CHNw8w2I.js} +1 -1
  34. package/dist/client/assets/{Key01-CyWdmMm6.js → Key01-CBasGMu5.js} +1 -1
  35. package/dist/client/assets/{LinkExternal01-DPNrtGWV.js → LinkExternal01-BIouwr8D.js} +1 -1
  36. package/dist/client/assets/{List-DqeEnxu3.js → List-iNTJ6fUY.js} +1 -1
  37. package/dist/client/assets/{Loading01-BZRHfswB.js → Loading01-BFMhWWtD.js} +1 -1
  38. package/dist/client/assets/{Lock01-BDqkVPGz.js → Lock01-C4Sc75k7.js} +1 -1
  39. package/dist/client/assets/{Pin01-BDMJN64-.js → Pin01-BE9Oh0sU.js} +1 -1
  40. package/dist/client/assets/{Play-BKXV9SNy.js → Play-gsrF7xxW.js} +1 -1
  41. package/dist/client/assets/{Plus-YlJja9E2.js → Plus-Ck954sGm.js} +1 -1
  42. package/dist/client/assets/{RefreshCcw01-Ci0qepHw.js → RefreshCcw01-zTyzcouM.js} +1 -1
  43. package/dist/client/assets/{RefreshCw01-Sv3Ciq4-.js → RefreshCw01-DbiZ19Ml.js} +1 -1
  44. package/dist/client/assets/{Rows03-DjbwBGBI.js → Rows03-B0JH9Ohl.js} +1 -1
  45. package/dist/client/assets/{Save01-CUHpjboy.js → Save01-CGYgsRh8.js} +1 -1
  46. package/dist/client/assets/{SearchMd-CdY2Qz31.js → SearchMd-Dvn1Eo76.js} +1 -1
  47. package/dist/client/assets/{Settings01-hHMZndAB.js → Settings01-CE-2gHzf.js} +1 -1
  48. package/dist/client/assets/{Shield01-BC6B_xBt.js → Shield01-BB8IGqoD.js} +1 -1
  49. package/dist/client/assets/{Terminal-D2rGQta9.js → Terminal-DQESGxaj.js} +1 -1
  50. package/dist/client/assets/{Trash01-DjSET-_p.js → Trash01-BC7PAlKV.js} +1 -1
  51. package/dist/client/assets/{Upload01-C0CPwbYb.js → Upload01-CASznv9t.js} +1 -1
  52. package/dist/client/assets/{Users03-BiJcw06H.js → Users03-DJ0q7ZN3.js} +1 -1
  53. package/dist/client/assets/{XCircle-oJlXTAnn.js → XCircle-JhpX2IQK.js} +1 -1
  54. package/dist/client/assets/{XClose-CNjsPY9p.js → XClose-Cpw_0BW6.js} +1 -1
  55. package/dist/client/assets/{agent-connections-preview-CyTgEjXK.js → agent-connections-preview-Dhs8DGJ9.js} +1 -1
  56. package/dist/client/assets/agent-detail-C8HmsASY.js +2 -0
  57. package/dist/client/assets/agents-BUO9Of5M.js +1 -0
  58. package/dist/client/assets/alert-dialog-K0UnFp_v.js +7 -0
  59. package/dist/client/assets/{auth-catchall-BSjXqHGj.js → auth-catchall-Cts5maQI.js} +1 -1
  60. package/dist/client/assets/{avatar-CLzAk7bk.js → avatar-BLu12sL5.js} +1 -1
  61. package/dist/client/assets/{badge-zj5rJqFG.js → badge-D4ZHiXFA.js} +1 -1
  62. package/dist/client/assets/{binder-Yx0eVQL7.js → binder-BeV9Iq0g.js} +1 -1
  63. package/dist/client/assets/{breadcrumb-p3FP4YzT.js → breadcrumb-kQQ-d55s.js} +1 -1
  64. package/dist/client/assets/{button-BlFVi9O-.js → button-BxOn_P7A.js} +1 -1
  65. package/dist/client/assets/{card-C5XZXHnb.js → card-DMS-g9Fe.js} +1 -1
  66. package/dist/client/assets/{chart-CECGc95G.js → chart-Dm5seKC_.js} +1 -1
  67. package/dist/client/assets/{checkbox-C81GTltZ.js → checkbox-QVK1EYTJ.js} +1 -1
  68. package/dist/client/assets/{circle-alert-DTrbbil0.js → circle-alert-BGE5uKTO.js} +1 -1
  69. package/dist/client/assets/{collection-detail-DC6lEGsR.js → collection-detail-BNuWQnMo.js} +3 -3
  70. package/dist/client/assets/collection-search-WzmN-NEH.js +1 -0
  71. package/dist/client/assets/collection-tab-CqF7e-el.js +1 -0
  72. package/dist/client/assets/collection-table-wrapper-DpYYlIci.js +1 -0
  73. package/dist/client/assets/{collection-tabs-DXae7bMN.js → collection-tabs-BzQ9gNkb.js} +1 -1
  74. package/dist/client/assets/{command-C0Lk3OoX.js → command-pJXSXf5S.js} +1 -1
  75. package/dist/client/assets/{connect-B0zgap2s.js → connect-DpHmbRge.js} +1 -1
  76. package/dist/client/assets/{connection-card-Bfx8qlqL.js → connection-card-CRsOF1KU.js} +1 -1
  77. package/dist/client/assets/connection-detail-B1dOB0AI.js +1 -0
  78. package/dist/client/assets/connections-EWXE105G.js +1 -0
  79. package/dist/client/assets/{constants-DS4O9R8r.js → constants-9bKBT988.js} +1 -1
  80. package/dist/client/assets/constants-CS_UcM7e.js +1 -0
  81. package/dist/client/assets/context-LmNUO0nU.js +23 -0
  82. package/dist/client/assets/{create-organization-dialog-BFIfEtVL.js → create-organization-dialog-CuKocaBI.js} +1 -1
  83. package/dist/client/assets/{create-project-dialog-D2mtQ7wt.js → create-project-dialog-heqHF5Xt.js} +1 -1
  84. package/dist/client/assets/deco-constants-YxoGHwHI.js +1 -0
  85. package/dist/client/assets/{dialog-BED3woG1.js → dialog-8Qx5GCEw.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-Db2R0f6-.js → dropdown-menu-BbhseL--.js} +1 -1
  87. package/dist/client/assets/{dynamic-plugin-layout-BzLyvc2d.js → dynamic-plugin-layout-Ch1QuglW.js} +1 -1
  88. package/dist/client/assets/empty-state-C7VZap1W.js +1 -0
  89. package/dist/client/assets/{empty-state-CIZqXQMR.js → empty-state-CSzTWTZI.js} +1 -1
  90. package/dist/client/assets/{env-vars-editor-CDWwUXgx.js → env-vars-editor-C0KF8UB-.js} +1 -1
  91. package/dist/client/assets/{error-boundary-DFWzxGF2.js → error-boundary-BpCU-F5d.js} +1 -1
  92. package/dist/client/assets/{extract-connection-data-1y_2LKN1.js → extract-connection-data-CLG2vt6G.js} +1 -1
  93. package/dist/client/assets/{file-browser-BLbb-Y8y.js → file-browser-4BKj7MWu.js} +2 -2
  94. package/dist/client/assets/{form-DdvC8UfL.js → form-Dn5Ilwyi.js} +1 -1
  95. package/dist/client/assets/{grid-view-CqSeu3_O.js → grid-view-aIHLkNPN.js} +1 -1
  96. package/dist/client/assets/{home-DlTcQ85K.js → home-md1YObTz.js} +1 -1
  97. package/dist/client/assets/index-BpxApmrT.css +1 -0
  98. package/dist/client/assets/{index-Cs9SJKB2.js → index-BtVQ48XT.js} +1 -1
  99. package/dist/client/assets/{index-Bb5ajAZZ.js → index-CIUI9_Ip.js} +63 -65
  100. package/dist/client/assets/{index-BG2jkRwM.js → index-CWIKLTkS.js} +1 -1
  101. package/dist/client/assets/{index-Chdo1wOf.js → index-DQipirM0.js} +3 -3
  102. package/dist/client/assets/{index-C5tdq0OE.js → index-DdzAhdkZ.js} +1 -1
  103. package/dist/client/assets/{index-6Tp9fsVX.js → index-DlglR7Dv.js} +1 -1
  104. package/dist/client/assets/{index-D8_oQFvH.js → index-Du85XF43.js} +1 -1
  105. package/dist/client/assets/{index-CNFSBpm2.js → index-ow5WSrzH.js} +1 -1
  106. package/dist/client/assets/{infiniteQueryObserver-DOxbID_2.js → infiniteQueryObserver-45WqMl59.js} +1 -1
  107. package/dist/client/assets/{input-C2bYHqSZ.js → input-D3a40-af.js} +1 -1
  108. package/dist/client/assets/{integration-icon-CHfvIBul.js → integration-icon-6FQvxTss.js} +1 -1
  109. package/dist/client/assets/{label-Cz00Hk_C.js → label-_-PuJzKE.js} +1 -1
  110. package/dist/client/assets/{layout-D8HdJww7.js → layout-C5y_iFls.js} +1 -1
  111. package/dist/client/assets/{localstorage-keys-D6jY_B8O.js → localstorage-keys-Xr0m_-Nl.js} +1 -1
  112. package/dist/client/assets/{login-B4sEC044.js → login-CGG5vJdW.js} +1 -1
  113. package/dist/client/assets/{markdown-W0glOUUc.js → markdown-DumqyZQo.js} +2 -2
  114. package/dist/client/assets/{mcp-oauth-CxZiVIG0.js → mcp-oauth-ZHptqU19.js} +1 -1
  115. package/dist/client/assets/{mcp-server-card-MyE_33s4.js → mcp-server-card-uS3QofMZ.js} +1 -1
  116. package/dist/client/assets/mcp-server-detail-BKF_R4E0.js +2 -0
  117. package/dist/client/assets/members-BRSEA55l.js +3 -0
  118. package/dist/client/assets/{monitoring-DnyUAZQs.js → monitoring-ChGczzDH.js} +2 -2
  119. package/dist/client/assets/{monitoring-dashboard-edit-CeSLs60r.js → monitoring-dashboard-edit-1EYxjqsS.js} +1 -1
  120. package/dist/client/assets/{monitoring-dashboard-view-CXYrse_E.js → monitoring-dashboard-view-B9ky_iuo.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-CtEIzTst.js → oauth-callback-DiCjOlTo.js} +1 -1
  122. package/dist/client/assets/page-Bd4vke_j.js +1 -0
  123. package/dist/client/assets/page-BqTRzB6R.js +1 -0
  124. package/dist/client/assets/{plugin-empty-state-C3dQRExn.js → plugin-empty-state-3Ic2Cddr.js} +1 -1
  125. package/dist/client/assets/{plugin-empty-state-CtOLvnau.js → plugin-empty-state-B0aoDY0o.js} +1 -1
  126. package/dist/client/assets/{plugin-header-BpYtnCvY.js → plugin-header-1MpH5dMN.js} +1 -1
  127. package/dist/client/assets/{plugin-header-wMO8zy_s.js → plugin-header-lqwqxxa8.js} +1 -1
  128. package/dist/client/assets/{popover-B4On8gSm.js → popover-O7pPZSal.js} +1 -1
  129. package/dist/client/assets/project-layout-Dk2D-43Q.js +1 -0
  130. package/dist/client/assets/projects-list-CApnnFAH.js +1 -0
  131. package/dist/client/assets/ranking-layout-CB_f3cVs.js +1 -0
  132. package/dist/client/assets/{readme-viewer-gb5hrmSg.js → readme-viewer-61IpnmPP.js} +1 -1
  133. package/dist/client/assets/{registry-layout-Cyki9u_h.js → registry-layout-DGM76yIZ.js} +1 -1
  134. package/dist/client/assets/{registry-utils-BL6Np0uD.js → registry-utils-DSUIffwE.js} +1 -1
  135. package/dist/client/assets/{reports-layout-DImwy6ND.js → reports-layout-BMSW5Pvz.js} +2 -2
  136. package/dist/client/assets/{reset-password-ButVRXi9.js → reset-password-R313_uMV.js} +1 -1
  137. package/dist/client/assets/{resizable-DUdJ1A_O.js → resizable-Dz9Hl0cL.js} +1 -1
  138. package/dist/client/assets/{save-actions-BiCpAXjr.js → save-actions-De5hNsxX.js} +1 -1
  139. package/dist/client/assets/{scroll-area-C9Z4g4D3.js → scroll-area-dZhjEr7K.js} +1 -1
  140. package/dist/client/assets/{select-DwyzrBGR.js → select-BSYdCUMN.js} +1 -1
  141. package/dist/client/assets/shell-layout-CGTPLB_Q.js +3 -0
  142. package/dist/client/assets/{skeleton-DdrlSfda.js → skeleton-D-Lsp11A.js} +1 -1
  143. package/dist/client/assets/{spinner-DeIV40-d.js → spinner-BL4ZMZYA.js} +1 -1
  144. package/dist/client/assets/{store-invite-DHfus7Si.js → store-invite-B0hYE1ZZ.js} +1 -1
  145. package/dist/client/assets/{switch-BW_XeGpN.js → switch-DyckCxcC.js} +1 -1
  146. package/dist/client/assets/{table-N5hQy-1m.js → table-D0pFXKN4.js} +1 -1
  147. package/dist/client/assets/tasks-DPZywEmF.js +1 -0
  148. package/dist/client/assets/{textarea-B5CEImaf.js → textarea-DX9d61Sr.js} +1 -1
  149. package/dist/client/assets/{time-range-picker-B3M_kZtN.js → time-range-picker-fngIp4Wo.js} +1 -1
  150. package/dist/client/assets/{toggle-group-k8q-T2Qa.js → toggle-group-Z0vsy7J4.js} +1 -1
  151. package/dist/client/assets/tools-list-B0lut0n1.js +1 -0
  152. package/dist/client/assets/{tooltip-BWW8lvJo.js → tooltip-B7RjBzxU.js} +1 -1
  153. package/dist/client/assets/{topbar-portal-m9wB0x-E.js → topbar-portal-D44GN90b.js} +1 -1
  154. package/dist/client/assets/{typewriter-title-DcVIzze1.js → typewriter-title-CkssIeLy.js} +1 -1
  155. package/dist/client/assets/{use-binding-DT0OPEEL.js → use-binding-oEpPFbv0.js} +1 -1
  156. package/dist/client/assets/{use-connection-O4z2Mc_F.js → use-connection-DXequUdB.js} +1 -1
  157. package/dist/client/assets/{use-copy-Drx5AGFH.js → use-copy-h8i-bDIZ.js} +1 -1
  158. package/dist/client/assets/{use-create-virtual-mcp-CZu2JnDv.js → use-create-virtual-mcp-DG-_igKD.js} +1 -1
  159. package/dist/client/assets/use-deco-chat-open-BAG5m-JA.js +1 -0
  160. package/dist/client/assets/{use-install-from-registry-Dc84s0lp.js → use-install-from-registry-BCGIZz8M.js} +1 -1
  161. package/dist/client/assets/{use-list-state-DQM_pDDC.js → use-list-state-DjtYoYEW.js} +1 -1
  162. package/dist/client/assets/{use-llm-Z9GIoSzc.js → use-llm-DDqwpIPn.js} +1 -1
  163. package/dist/client/assets/{use-mcp-prompts-uD1aNW_g.js → use-mcp-prompts-CqOiamVC.js} +1 -1
  164. package/dist/client/assets/{use-mcp-tools-B8wkpbTs.js → use-mcp-tools-Dt6WorDi.js} +1 -1
  165. package/dist/client/assets/{use-mobile-ziAtnWz2.js → use-mobile-CYG2M3Mj.js} +1 -1
  166. package/dist/client/assets/{use-organization-settings-BJEr33WT.js → use-organization-settings-Db9DvZjz.js} +1 -1
  167. package/dist/client/assets/{use-project-Dz1PHkz5.js → use-project-x4-rNIeb.js} +1 -1
  168. package/dist/client/assets/{use-settings-modal-CYH_HZlL.js → use-settings-modal-D-E-U1i_.js} +1 -1
  169. package/dist/client/assets/{use-view-mode-CRJUL6S-.js → use-view-mode-C5FzaFBT.js} +1 -1
  170. package/dist/client/assets/{use-virtual-mcp-BateG3is.js → use-virtual-mcp-Bq4iD2DN.js} +1 -1
  171. package/dist/client/assets/useInfiniteQuery-qwQj5SMK.js +1 -0
  172. package/dist/client/assets/{useMutation-BTkDU0tp.js → useMutation-8rEyObWg.js} +1 -1
  173. package/dist/client/assets/useQuery-CqT-L2b-.js +1 -0
  174. package/dist/client/assets/useSuspenseInfiniteQuery-BKpm_7Fb.js +1 -0
  175. package/dist/client/assets/view-mode-toggle-DumSmhPz.js +1 -0
  176. package/dist/client/assets/workflow-Nf6onDYr.js +1 -0
  177. package/dist/client/index.html +2 -2
  178. package/dist/server/cli.js +168 -168
  179. package/dist/server/migrate.js +2 -2
  180. package/dist/server/server.js +2 -2
  181. package/package.json +1 -1
  182. package/dist/client/assets/ArrowUp-CBTnQfpb.js +0 -1
  183. package/dist/client/assets/Tool01-8K3JOGke.js +0 -1
  184. package/dist/client/assets/agent-detail-9DFcapAu.js +0 -2
  185. package/dist/client/assets/agents-4gtiAnuv.js +0 -1
  186. package/dist/client/assets/alert-dialog-DG1mgLiN.js +0 -7
  187. package/dist/client/assets/collection-tab-dYtQ3dOc.js +0 -1
  188. package/dist/client/assets/collection-table-wrapper-D3UQPYYs.js +0 -1
  189. package/dist/client/assets/connection-detail-CFl60IV3.js +0 -1
  190. package/dist/client/assets/connections-40Z9p3na.js +0 -1
  191. package/dist/client/assets/constants-0nWmzfAq.js +0 -1
  192. package/dist/client/assets/context-CJpih0Aq.js +0 -23
  193. package/dist/client/assets/deco-constants-B2fB4qCk.js +0 -1
  194. package/dist/client/assets/empty-state-DwKYfPjb.js +0 -1
  195. package/dist/client/assets/index-BHAz67cr.css +0 -1
  196. package/dist/client/assets/mcp-server-detail-DPKP-AVk.js +0 -2
  197. package/dist/client/assets/members-C0wNcB0L.js +0 -3
  198. package/dist/client/assets/page-BaeXPwI_.js +0 -1
  199. package/dist/client/assets/page-wIVLNXO6.js +0 -1
  200. package/dist/client/assets/project-layout-1AjzWWMn.js +0 -1
  201. package/dist/client/assets/projects-list-DNSZsINF.js +0 -1
  202. package/dist/client/assets/ranking-layout-BgeMngBH.js +0 -1
  203. package/dist/client/assets/shell-layout-BGf6BKNx.js +0 -3
  204. package/dist/client/assets/tasks-CKkoq9mO.js +0 -1
  205. package/dist/client/assets/tools-list-TXvbi7bf.js +0 -1
  206. package/dist/client/assets/use-deco-chat-open-Qq9AtQ8h.js +0 -1
  207. package/dist/client/assets/useInfiniteQuery-BHuahm2t.js +0 -1
  208. package/dist/client/assets/useQuery-C0AkqYB7.js +0 -1
  209. package/dist/client/assets/useSuspenseInfiniteQuery-DPaJK1nP.js +0 -1
  210. package/dist/client/assets/workflow-CTPlOYoh.js +0 -1
@@ -0,0 +1 @@
1
+ import{c as v,j as i}from"./index-DQipirM0.js";import{i as w}from"./Loading01-BFMhWWtD.js";import{i as C}from"./SearchMd-Dvn1Eo76.js";import{I as k}from"./input-D3a40-af.js";import{c as b}from"./button-BxOn_P7A.js";function R(j){const e=v.c(21),{value:m,onChange:d,placeholder:g,onKeyDown:f,className:p,isSearching:u,disabled:n}=j,x=g===void 0?"Search...":g;let t;e[0]!==p?(t=b("shrink-0 w-full border-b border-border h-12",p),e[0]=p,e[1]=t):t=e[1];const h=n?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let r;e[4]!==u?(r=u?i.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):i.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=u,e[5]=r):r=e[5];let o;e[6]!==d?(o=N=>d(N.target.value),e[6]=d,e[7]=o):o=e[7];let l;e[8]!==n||e[9]!==f||e[10]!==x||e[11]!==o||e[12]!==m?(l=i.jsx(k,{value:m,onChange:o,onKeyDown:f,placeholder:x,disabled:n,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[8]=n,e[9]=f,e[10]=x,e[11]=o,e[12]=m,e[13]=l):l=e[13];let a;e[14]!==s||e[15]!==r||e[16]!==l?(a=i.jsxs("label",{className:s,children:[r,l]}),e[14]=s,e[15]=r,e[16]=l,e[17]=a):a=e[17];let c;return e[18]!==t||e[19]!==a?(c=i.jsx("div",{className:t,children:a}),e[18]=t,e[19]=a,e[20]=c):c=e[20],c}export{R as C};
@@ -0,0 +1 @@
1
+ import{c as Ae,j as t,b as Ye,d as Ze,u as et,r as tt,O as $e,t as st}from"./index-DQipirM0.js";import{g as Oe}from"./generate-id-Dyweu44Y.js";import{a as ot,C as Fe}from"./collection-table-wrapper-DpYYlIci.js";import{C as it}from"./collection-search-WzmN-NEH.js";import{C as nt}from"./card-DMS-g9Fe.js";import{I as ke}from"./integration-icon-6FQvxTss.js";import{D as Ke,a as Ue,b as Le,c as k}from"./dropdown-menu-BbhseL--.js";import{B as Ie}from"./button-BxOn_P7A.js";import{a as Be}from"./Copy01-BpXeBtQY.js";import{i as Re}from"./DotsVertical-_M8uWFPN.js";import{i as Ve}from"./Edit01-BOdZHKPa.js";import{s as Ge}from"./Eye-D_CQVe6k.js";import{s as Je}from"./Trash01-BC7PAlKV.js";import{E as ze}from"./empty-state-CSzTWTZI.js";import{n as Ee}from"./Inbox01-Dl3sNTM-.js";import{U as rt,u as lt}from"./use-list-state-DjtYoYEW.js";import{E as at}from"./empty-state-C7VZap1W.js";import{B as ct}from"./constants-CS_UcM7e.js";import{A as dt,g as pt,c as mt,b as ut,d as ft,e as ht,a as xt,f as gt}from"./alert-dialog-K0UnFp_v.js";import{u as jt,e as Ct}from"./use-connection-DXequUdB.js";import{u as vt}from"./constants-9bKBT988.js";import{s as bt}from"./Plus-Ck954sGm.js";import{V as yt}from"./layout-C5y_iFls.js";function Nt(n,e){const s=n.properties||{};for(const i in s){const l=s[i];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const r=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of r)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function wt(n){const e=Ae.c(25),{item:s,schema:r,actions:i}=n;let l;e[0]!==s||e[1]!==r?(l=Nt(r,s),e[0]=s,e[1]=r,e[2]=l):l=e[2];const u=l,p=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let j;e[3]!==i?(j=i&&Object.keys(i).length>0,e[3]=i,e[4]=j):j=e[4];const o=j;let m;e[5]!==u||e[6]!==s.title?(m=t.jsx(ke,{icon:u,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=u,e[6]=s.title,e[7]=m):m=e[7];let f;e[8]!==s.title?(f=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=f):f=e[9];const d=p||"No description";let c;e[10]!==d?(c=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:d}),e[10]=d,e[11]=c):c=e[11];let C;e[12]!==f||e[13]!==c?(C=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[f,c]}),e[12]=f,e[13]=c,e[14]=C):C=e[14];let y;e[15]!==m||e[16]!==C?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[m,C]}),e[15]=m,e[16]=C,e[17]=y):y=e[17];let a;e[18]!==i||e[19]!==o||e[20]!==s?(a=o&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:At,onMouseDown:_t,children:t.jsxs(Ke,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(Ie,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Dt,children:t.jsx(Re,{size:20})})}),t.jsxs(Le,{align:"end",onClick:St,children:[i.open&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.open?.(s)},children:[t.jsx(Ge,{size:16}),"Open"]}),i.edit&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.edit?.(s)},children:[t.jsx(Ve,{size:16}),"Edit"]}),i.duplicate&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.duplicate?.(s)},children:[t.jsx(Be,{size:16}),"Duplicate"]}),i.delete&&t.jsxs(k,{variant:"destructive",onClick:h=>{h.stopPropagation(),i.delete?.(s)},children:[t.jsx(Je,{size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=o,e[20]=s,e[21]=a):a=e[21];let S;return e[22]!==y||e[23]!==a?(S=t.jsxs(nt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,a]}),e[22]=y,e[23]=a,e[24]=S):S=e[24],S}function St(n){return n.stopPropagation()}function Dt(n){return n.stopPropagation()}function _t(n){return n.stopPropagation()}function At(n){return n.stopPropagation()}const It=["icon","avatar","logo"],Me=["created_at","created_by","id"];function Pt(n){return Object.keys(n).find(e=>It.includes(e.toLowerCase()))}function We(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function Tt(n){const e=Ae.c(32),{data:s,schema:r,viewMode:i,onViewModeChange:l,search:u,sortKey:p,sortDirection:j,onSort:o,actions:m,onItemClick:f,headerActions:d,emptyState:c,readOnly:C,columns:y,hideToolbar:a,sortableFields:S}=n,h=l===void 0?Mt:l,x=j===void 0?"asc":j,P=o===void 0?Et:o;let v;e[0]!==m?(v=m===void 0?{}:m,e[0]=m,e[1]=v):v=e[1];const D=v,_=f===void 0?zt:f,z=d===void 0?null:d,b=c===void 0?null:c,T=C===void 0?!1:C,N=y===void 0?void 0:y,F=a===void 0?!1:a,w=S===void 0?void 0:S;let E;e[2]!==N||e[3]!==r||e[4]!==w?(E=N?N.filter(Ot).filter(M=>!w||w.includes(M.id)).map($t):We(r,w),e[2]=N,e[3]=r,e[4]=w,e[5]=E):E=e[5];const $=E;let A;e[6]!==z||e[7]!==F||e[8]!==P||e[9]!==h||e[10]!==x||e[11]!==p||e[12]!==$||e[13]!==i?(A=!F&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:z}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Fe,{viewMode:i,onViewModeChange:h,sortKey:p,sortDirection:x,onSort:P,sortOptions:$})})]})}),e[6]=z,e[7]=F,e[8]=P,e[9]=h,e[10]=x,e[11]=p,e[12]=$,e[13]=i,e[14]=A):A=e[14];let O;e[15]!==D||e[16]!==N||e[17]!==s||e[18]!==b||e[19]!==_||e[20]!==P||e[21]!==T||e[22]!==r||e[23]!==u||e[24]!==x||e[25]!==p||e[26]!==w||e[27]!==i?(O=i==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:b||t.jsx(ze,{icon:t.jsx(Ee,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:s.map(M=>t.jsx("div",{onClick:()=>_?.(M),className:"cursor-pointer h-full",children:t.jsx(wt,{item:M,schema:r,readOnly:T,actions:D})},M.id))})}):t.jsx(ot,{columns:Kt(N,r,w,D),data:s,sortKey:p,sortDirection:x,onSort:P,onRowClick:_,emptyState:b||t.jsx(ze,{icon:t.jsx(Ee,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}),e[15]=D,e[16]=N,e[17]=s,e[18]=b,e[19]=_,e[20]=P,e[21]=T,e[22]=r,e[23]=u,e[24]=x,e[25]=p,e[26]=w,e[27]=i,e[28]=O):O=e[28];let I;return e[29]!==A||e[30]!==O?(I=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[A,O]}),e[29]=A,e[30]=O,e[31]=I):I=e[31],I}function $t(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Ot(n){return n.sortable!==!1}function zt(){}function Et(){}function Mt(){}function Ft(n){return{id:"actions",header:"",render:e=>t.jsxs(Ke,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(Ie,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Re,{size:20})})}),t.jsxs(Le,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ge,{size:16}),"Open"]}),n.edit&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Ve,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Be,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(k,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(Je,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function He(n){const e=n.type;return Array.isArray(e)?e.every(s=>He({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function kt(n,e){const s=n.properties||{},r=Object.keys(s).filter(o=>{const m=s[o];return m&&He(m)}),i=Pt(s),l=[],u=new Set;i&&r.includes(i)&&(l.push(i),u.add(i));const p=["title","description","updated_at","updated_by"];for(const o of p)r.includes(o)&&!u.has(o)&&(l.push(o),u.add(o));const j=r.filter(o=>!u.has(o)&&!Me.includes(o)).sort((o,m)=>o.localeCompare(m));for(const o of j)l.push(o),u.add(o);for(const o of Me)r.includes(o)&&!u.has(o)&&(l.push(o),u.add(o));return l.map(o=>{const m=s[o],f=e?e.includes(o):!["id"].includes(o);return o===i?{id:o,header:"",render:d=>{const c=d[o];return t.jsx(ke,{icon:c,name:d.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:o==="description"?{id:o,header:"Description",render:d=>{const c=d[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(c)})},sortable:f,cellClassName:"max-w-[50ch]"}:o==="created_by"||o==="updated_by"?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c?t.jsx(rt,{id:String(c),size:"xs"}):"—"},sortable:f,cellClassName:"max-w-[250px]"}:m?.format==="date-time"||o.endsWith("_at")?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c?t.jsx("span",{className:"block truncate max-w-full",children:new Date(c).toLocaleDateString()}):"—"},sortable:f,cellClassName:"max-w-[200px]"}:{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(c)})},sortable:f,cellClassName:"max-w-[200px]"}})}function Kt(n,e,s,r){const i=n||kt(e,s);return i.some(p=>p.id==="actions")?i:Object.keys(r).length>0?[...i,Ft(r)]:i}function ds(n){const e=Ae.c(113),{connectionId:s,org:r,activeCollection:i}=n,l=i.name,u=i.schema??ct,p=i.hasCreateTool,j=i.hasUpdateTool,o=i.hasDeleteTool,m=Ye(),{data:f}=Ze.useSession(),d=f?.user?.id||"unknown",{org:c}=et();let C;e[0]!==s||e[1]!==c.id?(C={connectionId:s,orgId:c.id},e[0]=s,e[1]=c.id,e[2]=C):C=e[2];const y=vt(C),a=jt(s,l,y),S=`${s}-${l}`;let h;e[3]!==r||e[4]!==S?(h={namespace:r,resource:S,defaultSortKey:"updated_at"},e[3]=r,e[4]=S,e[5]=h):h=e[5];const{search:x,searchTerm:P,setSearch:v,viewMode:D,setViewMode:_,sortKey:z,sortDirection:b,handleSort:T}=lt(h);let N;e[6]!==P||e[7]!==b||e[8]!==z?(N={searchTerm:P,sortKey:z,sortDirection:b},e[6]=P,e[7]=b,e[8]=z,e[9]=N):N=e[9];const F=Ct(s,l,y,N),w=!p&&!j&&!o;let E;e[10]!==l||e[11]!==s||e[12]!==m||e[13]!==r?(E=g=>{m({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:$e,connectionId:s,collectionName:l,itemId:g.id}})},e[10]=l,e[11]=s,e[12]=m,e[13]=r,e[14]=E):E=e[14];const $=E;let A;e[15]!==a.create||e[16]!==d?(A=async g=>{const me=new Date().toISOString();await a.create.mutateAsync({...g,id:Oe("conn"),title:`${g.title} (Copy)`,created_at:me,updated_at:me,created_by:d,updated_by:d})},e[15]=a.create,e[16]=d,e[17]=A):A=e[17];const O=A,[I,M]=tt.useState(null);let oe;e[18]===Symbol.for("react.memo_cache_sentinel")?(oe=g=>{M(g)},e[18]=oe):oe=e[18];const qe=oe;let K;e[19]!==$||e[20]!==j?(K=j&&{edit:$},e[19]=$,e[20]=j,e[21]=K):K=e[21];let U;e[22]!==O||e[23]!==p?(U=p&&{duplicate:O},e[22]=O,e[23]=p,e[24]=U):U=e[24];let L;e[25]!==o?(L=o&&{delete:qe},e[25]=o,e[26]=L):L=e[26];let ie;e[27]!==L||e[28]!==K||e[29]!==U?(ie={...K,...U,...L},e[27]=L,e[28]=K,e[29]=U,e[30]=ie):ie=e[30];const ue=ie;let ne;e[31]!==a.delete||e[32]!==I?(ne=async()=>{I&&(await a.delete.mutateAsync(I.id),M(null))},e[31]=a.delete,e[32]=I,e[33]=ne):ne=e[33];const fe=ne;let re;e[34]!==a.create||e[35]!==l||e[36]!==s||e[37]!==p||e[38]!==m||e[39]!==r||e[40]!==d?(re=async()=>{if(!p){st.error("Create operation is not available for this collection");return}const g=new Date().toISOString(),me={id:Oe("conn"),title:"New Item",description:"A brief description of the item",created_at:g,updated_at:g,created_by:d,updated_by:d};try{const _e=await a.create.mutateAsync(me);m({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:$e,connectionId:s,collectionName:l,itemId:_e.id}})}catch(_e){console.error("Failed to create item:",_e)}},e[34]=a.create,e[35]=l,e[36]=s,e[37]=p,e[38]=m,e[39]=r,e[40]=d,e[41]=re):re=e[41];const he=re;let le;e[42]!==u?(le=We(u),e[42]=u,e[43]=le):le=e[43];const xe=le,Pe=(F?.length??0)>0,Qe=p&&Pe,Xe=p&&!Pe&&!x;let ae;e[44]!==a.create||e[45]!==he||e[46]!==p?(ae=p?t.jsxs(Ie,{onClick:he,size:"sm",disabled:a.create.isPending,className:"h-7",children:[t.jsx(bt,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[44]=a.create,e[45]=he,e[46]=p,e[47]=ae):ae=e[47];const Te=ae,ge=z;let B;e[48]!==T||e[49]!==_||e[50]!==b||e[51]!==xe||e[52]!==ge||e[53]!==D?(B=t.jsx(Fe,{viewMode:D,onViewModeChange:_,sortKey:ge,sortDirection:b,onSort:T,sortOptions:xe}),e[48]=T,e[49]=_,e[50]=b,e[51]=xe,e[52]=ge,e[53]=D,e[54]=B):B=e[54];const je=Qe&&Te;let R;e[55]!==B||e[56]!==je?(R=t.jsxs(yt,{children:[B,je]}),e[55]=B,e[56]=je,e[57]=R):R=e[57];const Ce=`Search ${l}...`;let V;e[58]!==v?(V=g=>{g.key==="Escape"&&(v(""),g.target.blur())},e[58]=v,e[59]=V):V=e[59];let G;e[60]!==x||e[61]!==v||e[62]!==Ce||e[63]!==V?(G=t.jsx(it,{value:x,onChange:v,placeholder:Ce,onKeyDown:V}),e[60]=x,e[61]=v,e[62]=Ce,e[63]=V,e[64]=G):G=e[64];let J;e[65]!==F?(J=F??[],e[65]=F,e[66]=J):J=e[66];const ve=z;let W;e[67]!==$?(W=g=>$(g),e[67]=$,e[68]=W):W=e[68];const be="No items found",ye=x?"Try adjusting your search terms":"This collection doesn't have any items yet.",Ne=Xe?Te:void 0;let H;e[69]!==be||e[70]!==ye||e[71]!==Ne?(H=t.jsx(at,{image:null,title:be,description:ye,actions:Ne}),e[69]=be,e[70]=ye,e[71]=Ne,e[72]=H):H=e[72];let q;e[73]!==T||e[74]!==w||e[75]!==ue||e[76]!==u||e[77]!==x||e[78]!==v||e[79]!==_||e[80]!==b||e[81]!==J||e[82]!==ve||e[83]!==W||e[84]!==H||e[85]!==D?(q=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Tt,{hideToolbar:!0,data:J,schema:u,viewMode:D,onViewModeChange:_,search:x,onSearchChange:v,sortKey:ve,sortDirection:b,onSort:T,actions:ue,onItemClick:W,readOnly:w,emptyState:H})}),e[73]=T,e[74]=w,e[75]=ue,e[76]=u,e[77]=x,e[78]=v,e[79]=_,e[80]=b,e[81]=J,e[82]=ve,e[83]=W,e[84]=H,e[85]=D,e[86]=q):q=e[86];let Q;e[87]!==G||e[88]!==q?(Q=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[G,q]}),e[87]=G,e[88]=q,e[89]=Q):Q=e[89];const we=!!I;let ce;e[90]===Symbol.for("react.memo_cache_sentinel")?(ce=g=>{g||M(null)},e[90]=ce):ce=e[90];let de;e[91]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx(mt,{children:"Delete item?"}),e[91]=de):de=e[91];const Se=I?.title;let X;e[92]!==Se?(X=t.jsxs(ut,{children:[de,t.jsxs(ft,{children:['Are you sure you want to delete "',Se,'"? This action cannot be undone.']})]}),e[92]=Se,e[93]=X):X=e[93];let Y;e[94]!==a.delete.isPending?(Y=t.jsx(dt,{disabled:a.delete.isPending,children:"Cancel"}),e[94]=a.delete.isPending,e[95]=Y):Y=e[95];const De=a.delete.isPending?"Deleting...":"Delete";let Z;e[96]!==a.delete.isPending||e[97]!==fe||e[98]!==De?(Z=t.jsx(pt,{onClick:fe,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:De}),e[96]=a.delete.isPending,e[97]=fe,e[98]=De,e[99]=Z):Z=e[99];let ee;e[100]!==Y||e[101]!==Z?(ee=t.jsxs(ht,{children:[Y,Z]}),e[100]=Y,e[101]=Z,e[102]=ee):ee=e[102];let te;e[103]!==X||e[104]!==ee?(te=t.jsxs(xt,{children:[X,ee]}),e[103]=X,e[104]=ee,e[105]=te):te=e[105];let se;e[106]!==we||e[107]!==te?(se=t.jsx(gt,{open:we,onOpenChange:ce,children:te}),e[106]=we,e[107]=te,e[108]=se):se=e[108];let pe;return e[109]!==R||e[110]!==Q||e[111]!==se?(pe=t.jsxs(t.Fragment,{children:[R,Q,se]}),e[109]=R,e[110]=Q,e[111]=se,e[112]=pe):pe=e[112],pe}export{ds as C};
@@ -0,0 +1 @@
1
+ import{r as T,c as k,j as t}from"./index-DQipirM0.js";import{c as y,B as V}from"./button-BxOn_P7A.js";import{c as L,a as $,D as B,b as E}from"./dropdown-menu-BbhseL--.js";import{n as z}from"./ArrowDown-BzwwIvol.js";import{i as D}from"./ArrowUp-lkpB-gsw.js";import{i as R}from"./Check-BEIYk4IG.js";import{c as H}from"./Grid01-DDvgvRE8.js";import{i as I}from"./List-iNTJ6fUY.js";import{c as K,T as W,a as _,b as O}from"./tooltip-B7RjBzxU.js";import{V as A}from"./view-mode-toggle-DumSmhPz.js";import{T as P,a as q,b as S,c as F,d as G,e as J}from"./table-D0pFXKN4.js";const M=({size:N=24,color:e="currentColor",...s})=>T.createElement("svg",{viewBox:"0 0 24 24",width:N,height:N,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},T.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));M.displayName="Sliders01";function ae(N){const e=k.c(16),{viewMode:s,onViewModeChange:x,sortKey:p,sortDirection:d,onSort:a,sortOptions:i}=N;let l;e[0]!==i?(l=i===void 0?[]:i,e[0]=i,e[1]=l):l=e[1];const m=l;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(K,{children:t.jsxs(W,{children:[t.jsx(_,{asChild:!0,children:t.jsx($,{asChild:!0,children:t.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",children:t.jsx(M,{size:16})})})}),t.jsx(O,{children:"Search filters"})]})}),e[2]=u):u=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c={value:"table",icon:t.jsx(I,{})},e[3]=c):c=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=[c,{value:"cards",icon:t.jsx(H,{})}],e[4]=r):r=e[4];let o;e[5]!==x||e[6]!==s?(o=t.jsx("div",{className:"p-2 border-b border-border",children:t.jsx(A,{value:s,onValueChange:x,fullWidth:!0,options:r})}),e[5]=x,e[6]=s,e[7]=o):o=e[7];let f;e[8]!==a||e[9]!==d||e[10]!==p||e[11]!==m?(f=m.length>0&&a&&t.jsxs("div",{className:"p-1 flex flex-col gap-0.5",children:[t.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),m.map(g=>{const b=p===g.id;return t.jsx(L,{onClick:()=>a(g.id),className:y("h-8 px-2 py-0 cursor-pointer",b&&"bg-accent"),children:t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[b&&t.jsx(R,{size:16,className:"text-foreground shrink-0"}),!b&&t.jsx("div",{className:"w-4 shrink-0"}),t.jsx("span",{className:"text-sm text-foreground flex-1",children:g.label}),b&&d&&(d==="asc"?t.jsx(D,{size:16,className:"text-foreground shrink-0"}):t.jsx(z,{size:16,className:"text-foreground shrink-0"}))]})},g.id)})]}),e[8]=a,e[9]=d,e[10]=p,e[11]=m,e[12]=f):f=e[12];let h;return e[13]!==o||e[14]!==f?(h=t.jsxs(B,{children:[u,t.jsxs(E,{align:"end",className:"w-[200px] p-0 gap-0",children:[o,f]})]}),e[13]=o,e[14]=f,e[15]=h):h=e[15],h}function Q(N){const e=k.c(29),{columns:s,data:x,sortKey:p,sortDirection:d,onSort:a,onRowClick:i,rowClassName:l}=N;let m;e[0]!==d?(m=function(n,v){return t.jsx("div",{className:"w-4 flex items-center justify-center",children:v&&d&&(d==="asc"?t.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):t.jsx(z,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=d,e[1]=m):m=e[1];const u=m;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=function(n,v){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return n===v-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),C},e[2]=c):c=e[2];const r=c;let o;if(e[3]!==s||e[4]!==a||e[5]!==u||e[6]!==p){let j;e[8]!==s.length||e[9]!==a||e[10]!==u||e[11]!==p?(j=(n,v)=>{const C=p===n.id;return t.jsx(P,{className:y(r(v,s.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&a?()=>a(n.id):void 0,children:t.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&u(n.id,C)]})},n.id)},e[8]=s.length,e[9]=a,e[10]=u,e[11]=p,e[12]=j):j=e[12],o=s.map(j),e[3]=s,e[4]=a,e[5]=u,e[6]=p,e[7]=o}else o=e[7];let f;e[13]!==o?(f=t.jsx(q,{className:"border-b-0",children:t.jsx(S,{className:"h-9 hover:bg-transparent border-b border-border",children:o})}),e[13]=o,e[14]=f):f=e[14];let h;if(e[15]!==s||e[16]!==x||e[17]!==i||e[18]!==l){let j;e[20]!==s||e[21]!==i||e[22]!==l?(j=(n,v)=>{const C=l?.(n);return t.jsx(S,{"data-row-index":v,className:y("group/data-row transition-colors border-b-0 hover:bg-accent/50",i?"cursor-pointer":"",C),onClick:i?()=>i(n):void 0,children:s.map(w=>t.jsx(F,{className:y("px-5 py-4 h-16 align-middle text-sm text-foreground",w.cellClassName,w.wrap?"whitespace-normal wrap-break-word":""),children:t.jsx("div",{className:y(w.wrap?"w-full":"min-w-0 w-full",!w.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:w.render?w.render(n):w.accessor?w.accessor(n):null})},w.id))},v)},e[20]=s,e[21]=i,e[22]=l,e[23]=j):j=e[23],h=x.map(j),e[15]=s,e[16]=x,e[17]=i,e[18]=l,e[19]=h}else h=e[19];let g;e[24]!==h?(g=t.jsx(G,{children:h}),e[24]=h,e[25]=g):g=e[25];let b;return e[26]!==f||e[27]!==g?(b=t.jsxs(J,{className:"w-full border-collapse",children:[f,g]}),e[26]=f,e[27]=g,e[28]=b):b=e[28],b}function le(N){const e=k.c(12),{columns:s,data:x,isLoading:p,sortKey:d,sortDirection:a,onSort:i,onRowClick:l,emptyState:m}=N;if(p===void 0?!1:p){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=r):r=e[0],r}if(x.length===0){let r;e[1]!==m?(r=m||t.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=m,e[2]=r):r=e[2];let o;return e[3]!==r?(o=t.jsx("div",{className:"flex items-center justify-center h-full",children:r}),e[3]=r,e[4]=o):o=e[4],o}let c;return e[5]!==s||e[6]!==x||e[7]!==l||e[8]!==i||e[9]!==a||e[10]!==d?(c=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Q,{columns:s,data:x,sortKey:d,sortDirection:a,onSort:i,onRowClick:l})}),e[5]=s,e[6]=x,e[7]=l,e[8]=i,e[9]=a,e[10]=d,e[11]=c):c=e[11],c}export{ae as C,le as a};
@@ -1 +1 @@
1
- import{c as x,j as u}from"./index-Chdo1wOf.js";import{c as m}from"./button-BlFVi9O-.js";import{B as g}from"./badge-zj5rJqFG.js";function v(f){const e=x.c(12),{tabs:l,activeTab:n,onTabChange:s,className:a}=f;let t;e[0]!==a?(t=m("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==l){let c;e[6]!==n||e[7]!==s?(c=o=>{const d=n===o.id;return u.jsxs("button",{type:"button",onClick:()=>s(o.id),className:m("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&u.jsx(g,{variant:"secondary",className:m("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=u.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{v as C};
1
+ import{c as x,j as u}from"./index-DQipirM0.js";import{c as m}from"./button-BxOn_P7A.js";import{B as g}from"./badge-D4ZHiXFA.js";function v(f){const e=x.c(12),{tabs:l,activeTab:n,onTabChange:s,className:a}=f;let t;e[0]!==a?(t=m("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==l){let c;e[6]!==n||e[7]!==s?(c=o=>{const d=n===o.id;return u.jsxs("button",{type:"button",onClick:()=>s(o.id),className:m("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&u.jsx(g,{variant:"secondary",className:m("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=u.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{v as C};
@@ -1 +1 @@
1
- import{c as r,u as i,n as u,K as p,d as f,j as n}from"./index-Chdo1wOf.js";import{_ as m}from"./index-Cs9SJKB2.js";import{c as d}from"./button-BlFVi9O-.js";import{i as x}from"./SearchMd-CdY2Qz31.js";function v(){const a=r.c(4),{locator:e}=i();let t;a[0]!==e?(t=p.members(e),a[0]=e,a[1]=t):t=a[1];let s;return a[2]!==t?(s={queryKey:t,queryFn:g},a[2]=t,a[3]=s):s=a[3],u(s)}function g(){return f.organization.listMembers()}function _(a){const e=r.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=d("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function j(a){const e=r.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(x,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=d("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=l):l=e[5];let c;return e[6]!==s||e[7]!==l?(c=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(m.Input,{"data-slot":"command-input",className:l,...s})]}),e[6]=s,e[7]=l,e[8]=c):c=e[8],c}function C(a){const e=r.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=d("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function w(a){const e=r.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(m.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function $(a){const e=r.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=d("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function k(a){const e=r.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=d("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function E(a){const e=r.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=d("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}export{$ as C,E as a,k as b,w as c,C as d,_ as e,j as f,v as u};
1
+ import{c as r,u as i,n as u,K as p,d as f,j as n}from"./index-DQipirM0.js";import{_ as m}from"./index-BtVQ48XT.js";import{c as d}from"./button-BxOn_P7A.js";import{i as x}from"./SearchMd-Dvn1Eo76.js";function v(){const a=r.c(4),{locator:e}=i();let t;a[0]!==e?(t=p.members(e),a[0]=e,a[1]=t):t=a[1];let s;return a[2]!==t?(s={queryKey:t,queryFn:g},a[2]=t,a[3]=s):s=a[3],u(s)}function g(){return f.organization.listMembers()}function _(a){const e=r.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=d("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function j(a){const e=r.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(x,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=d("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=l):l=e[5];let c;return e[6]!==s||e[7]!==l?(c=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(m.Input,{"data-slot":"command-input",className:l,...s})]}),e[6]=s,e[7]=l,e[8]=c):c=e[8],c}function C(a){const e=r.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=d("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function w(a){const e=r.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(m.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function $(a){const e=r.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=d("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function k(a){const e=r.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=d("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function E(a){const e=r.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=d("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}export{$ as C,E as a,k as b,w as c,C as d,_ as e,j as f,v as u};
@@ -1 +1 @@
1
- import{c as T,bv as M,j as e,bw as P,m as q,r as R,t as h,e as O}from"./index-Chdo1wOf.js";import{u as A}from"./useQuery-C0AkqYB7.js";import{u as _}from"./useMutation-BTkDU0tp.js";import{B as y}from"./button-BlFVi9O-.js";import{C as N,a as v}from"./card-C5XZXHnb.js";import{i as L,a as U}from"./mcp-oauth-CxZiVIG0.js";import{c as C,C as K,a as w}from"./circle-alert-DTrbbil0.js";const Q=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],D=C("external-link",Q);const H=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],k=C("loader-circle",H);const J=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],B=C("refresh-cw",J),Y=t=>{const n=T.c(6);let i;n[0]!==t?({...i}=t,n[0]=t,n[1]=i):i=n[1];const{theme:a}=M(),d=a===void 0?"system":a;let r;n[2]===Symbol.for("react.memo_cache_sentinel")?(r={"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},n[2]=r):r=n[2];let m;return n[3]!==i||n[4]!==d?(m=e.jsx(P,{theme:d,className:"toaster group",style:r,...i}),n[3]=i,n[4]=d,n[5]=m):m=n[5],m},b={session:t=>["user-sandbox-session",t]};function V({sessionId:t,onComplete:n,onError:i}){const a=q(),[p,d]=R.useState(null),{data:r,isLoading:m,error:j}=A({queryKey:b.session(t),queryFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}`);if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to load session")}return s.json()}}),F=_({mutationFn:async({appName:s,connectionId:o})=>{const l=await fetch(`/api/user-sandbox/sessions/${t}/configure`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s,connection_id:o})});if(!l.ok){const u=await l.json();throw new Error(u.error||"Configuration failed")}return l.json()},onSuccess:()=>{a.invalidateQueries({queryKey:b.session(t)})}}),x=_({mutationFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to complete")}return s.json()},onSuccess:s=>{s.redirectUrl?window.location.href=s.redirectUrl:(h.success("Setup complete!"),a.invalidateQueries({queryKey:b.session(t)}),n?.({agentId:s.agentId,redirectUrl:s.redirectUrl}))},onError:s=>{const o=s instanceof Error?s:new Error("Failed to complete");h.error(o.message),i?.(o)}}),S=async s=>{d(s.app_name);try{const o=await fetch(`/api/user-sandbox/sessions/${t}/provision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s.app_name})});if(!o.ok){const g=await o.json();throw new Error(g.error||"Failed to provision connection")}const u=(await o.json()).connection_id;if(s.connection_type==="HTTP"||s.connection_type==="SSE"||s.connection_type==="Websocket"){const g=`/mcp/${u}`,z=await L({url:g,token:null});if(!z.isAuthenticated&&z.supportsOAuth){h.info("Opening authentication window...");const c=await U({connectionId:u,clientName:s.title,timeout:3e5});if(c.error)throw new Error(c.error);if(c.tokenInfo){const E=await fetch(`/api/connections/${u}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:c.tokenInfo.accessToken,refreshToken:c.tokenInfo.refreshToken,expiresIn:c.tokenInfo.expiresIn,scope:c.tokenInfo.scope,clientId:c.tokenInfo.clientId,clientSecret:c.tokenInfo.clientSecret,tokenEndpoint:c.tokenInfo.tokenEndpoint})});if(!E.ok){const $=await E.json().catch(()=>({}));throw new Error($.error||"Failed to save authentication tokens. Please try again.")}}}}await F.mutateAsync({appName:s.app_name,connectionId:u}),h.success(`${s.title} connected successfully`)}catch(o){console.error("Connection error:",o);const l=o instanceof Error?o:new Error("Failed to connect");h.error(l.message),i?.(l)}finally{d(null)}},I=r?.apps.every(s=>s.status.configured),f=r?.session.status==="completed";return m?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx(k,{className:"size-8 animate-spin text-muted-foreground"})}):j?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsx(N,{className:"max-w-md w-full",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx("div",{className:"size-12 rounded-full bg-destructive/10 flex items-center justify-center",children:e.jsx(K,{className:"size-6 text-destructive"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Session Error"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:j instanceof Error?j.message:"Failed to load"})]})]})})})}):r?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(Y,{}),e.jsxs("div",{className:"max-w-lg mx-auto px-4 py-12",children:[e.jsxs("div",{className:"text-center mb-8",children:[r.template.icon&&e.jsx("div",{className:"size-16 mx-auto mb-4 rounded-xl bg-muted flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:r.template.icon,alt:"",className:"size-10 object-contain"})}),e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:r.template.title}),r.template.description&&e.jsx("p",{className:"text-muted-foreground mt-2",children:r.template.description})]}),f&&e.jsx(N,{className:"mb-6 border-green-500/20 bg-green-500/5",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"size-10 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(w,{className:"size-5 text-green-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Setup Complete"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your integrations are ready to use."})]})]})})}),e.jsx("div",{className:"space-y-3",children:r.apps.map(s=>e.jsx(N,{children:e.jsx(v,{className:"py-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"size-10 rounded-lg bg-muted flex items-center justify-center shrink-0 overflow-hidden",children:s.icon?e.jsx("img",{src:s.icon,alt:"",className:"size-6 object-contain"}):e.jsx("span",{className:"text-lg",children:"📦"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.status.configured?e.jsxs("span",{className:"text-green-600 dark:text-green-400 flex items-center gap-1",children:[e.jsx(w,{className:"size-3"})," Connected"]}):s.requires_oauth?"Requires authentication":"Ready to connect"})]}),!s.status.configured&&!f&&e.jsx(y,{size:"sm",onClick:()=>S(s),disabled:p!==null||x.isPending,children:p===s.app_name?e.jsxs(e.Fragment,{children:[e.jsx(k,{className:"size-4 mr-2 animate-spin"}),"Connecting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"size-4 mr-2"}),"Connect"]})}),s.status.configured&&!f&&e.jsxs(y,{size:"sm",variant:"outline",onClick:()=>S(s),disabled:p!==null||x.isPending,children:[e.jsx(B,{className:"size-4 mr-2"}),"Reconnect"]}),f&&e.jsx("div",{className:"size-8 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(w,{className:"size-4 text-green-500"})})]})})},s.app_name))}),I&&!f&&e.jsx("div",{className:"mt-6",children:e.jsx(y,{className:"w-full",size:"lg",onClick:()=>x.mutate(),disabled:x.isPending,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(k,{className:"size-4 mr-2 animate-spin"}),"Completing..."]}):"Complete Setup"})}),e.jsx("div",{className:"mt-8 pt-6 border-t text-center",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Session expires:"," ",new Date(r.session.expires_at).toLocaleString()]})})]})]}):null}function oe(){const t=T.c(3);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/connect/$sessionId"},t[0]=n):n=t[0];const{sessionId:i}=O(n);let a;return t[1]!==i?(a=e.jsx(V,{sessionId:i}),t[1]=i,t[2]=a):a=t[2],a}export{oe as default};
1
+ import{c as T,bu as M,j as e,bv as P,m as q,r as R,t as h,e as O}from"./index-DQipirM0.js";import{u as A}from"./useQuery-CqT-L2b-.js";import{u as _}from"./useMutation-8rEyObWg.js";import{B as y}from"./button-BxOn_P7A.js";import{C as N,a as v}from"./card-DMS-g9Fe.js";import{i as L,a as U}from"./mcp-oauth-ZHptqU19.js";import{c as C,C as K,a as k}from"./circle-alert-BGE5uKTO.js";const Q=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],D=C("external-link",Q);const H=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],w=C("loader-circle",H);const J=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],B=C("refresh-cw",J),Y=t=>{const n=T.c(6);let i;n[0]!==t?({...i}=t,n[0]=t,n[1]=i):i=n[1];const{theme:a}=M(),d=a===void 0?"system":a;let r;n[2]===Symbol.for("react.memo_cache_sentinel")?(r={"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},n[2]=r):r=n[2];let m;return n[3]!==i||n[4]!==d?(m=e.jsx(P,{theme:d,className:"toaster group",style:r,...i}),n[3]=i,n[4]=d,n[5]=m):m=n[5],m},b={session:t=>["user-sandbox-session",t]};function V({sessionId:t,onComplete:n,onError:i}){const a=q(),[p,d]=R.useState(null),{data:r,isLoading:m,error:j}=A({queryKey:b.session(t),queryFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}`);if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to load session")}return s.json()}}),F=_({mutationFn:async({appName:s,connectionId:o})=>{const l=await fetch(`/api/user-sandbox/sessions/${t}/configure`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s,connection_id:o})});if(!l.ok){const u=await l.json();throw new Error(u.error||"Configuration failed")}return l.json()},onSuccess:()=>{a.invalidateQueries({queryKey:b.session(t)})}}),x=_({mutationFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to complete")}return s.json()},onSuccess:s=>{s.redirectUrl?window.location.href=s.redirectUrl:(h.success("Setup complete!"),a.invalidateQueries({queryKey:b.session(t)}),n?.({agentId:s.agentId,redirectUrl:s.redirectUrl}))},onError:s=>{const o=s instanceof Error?s:new Error("Failed to complete");h.error(o.message),i?.(o)}}),S=async s=>{d(s.app_name);try{const o=await fetch(`/api/user-sandbox/sessions/${t}/provision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s.app_name})});if(!o.ok){const g=await o.json();throw new Error(g.error||"Failed to provision connection")}const u=(await o.json()).connection_id;if(s.connection_type==="HTTP"||s.connection_type==="SSE"||s.connection_type==="Websocket"){const g=`/mcp/${u}`,z=await L({url:g,token:null});if(!z.isAuthenticated&&z.supportsOAuth){h.info("Opening authentication window...");const c=await U({connectionId:u,clientName:s.title,timeout:3e5});if(c.error)throw new Error(c.error);if(c.tokenInfo){const E=await fetch(`/api/connections/${u}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:c.tokenInfo.accessToken,refreshToken:c.tokenInfo.refreshToken,expiresIn:c.tokenInfo.expiresIn,scope:c.tokenInfo.scope,clientId:c.tokenInfo.clientId,clientSecret:c.tokenInfo.clientSecret,tokenEndpoint:c.tokenInfo.tokenEndpoint})});if(!E.ok){const $=await E.json().catch(()=>({}));throw new Error($.error||"Failed to save authentication tokens. Please try again.")}}}}await F.mutateAsync({appName:s.app_name,connectionId:u}),h.success(`${s.title} connected successfully`)}catch(o){console.error("Connection error:",o);const l=o instanceof Error?o:new Error("Failed to connect");h.error(l.message),i?.(l)}finally{d(null)}},I=r?.apps.every(s=>s.status.configured),f=r?.session.status==="completed";return m?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx(w,{className:"size-8 animate-spin text-muted-foreground"})}):j?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsx(N,{className:"max-w-md w-full",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx("div",{className:"size-12 rounded-full bg-destructive/10 flex items-center justify-center",children:e.jsx(K,{className:"size-6 text-destructive"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Session Error"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:j instanceof Error?j.message:"Failed to load"})]})]})})})}):r?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(Y,{}),e.jsxs("div",{className:"max-w-lg mx-auto px-4 py-12",children:[e.jsxs("div",{className:"text-center mb-8",children:[r.template.icon&&e.jsx("div",{className:"size-16 mx-auto mb-4 rounded-xl bg-muted flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:r.template.icon,alt:"",className:"size-10 object-contain"})}),e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:r.template.title}),r.template.description&&e.jsx("p",{className:"text-muted-foreground mt-2",children:r.template.description})]}),f&&e.jsx(N,{className:"mb-6 border-green-500/20 bg-green-500/5",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"size-10 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-5 text-green-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Setup Complete"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your integrations are ready to use."})]})]})})}),e.jsx("div",{className:"space-y-3",children:r.apps.map(s=>e.jsx(N,{children:e.jsx(v,{className:"py-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"size-10 rounded-lg bg-muted flex items-center justify-center shrink-0 overflow-hidden",children:s.icon?e.jsx("img",{src:s.icon,alt:"",className:"size-6 object-contain"}):e.jsx("span",{className:"text-lg",children:"📦"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.status.configured?e.jsxs("span",{className:"text-green-600 dark:text-green-400 flex items-center gap-1",children:[e.jsx(k,{className:"size-3"})," Connected"]}):s.requires_oauth?"Requires authentication":"Ready to connect"})]}),!s.status.configured&&!f&&e.jsx(y,{size:"sm",onClick:()=>S(s),disabled:p!==null||x.isPending,children:p===s.app_name?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Connecting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"size-4 mr-2"}),"Connect"]})}),s.status.configured&&!f&&e.jsxs(y,{size:"sm",variant:"outline",onClick:()=>S(s),disabled:p!==null||x.isPending,children:[e.jsx(B,{className:"size-4 mr-2"}),"Reconnect"]}),f&&e.jsx("div",{className:"size-8 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-4 text-green-500"})})]})})},s.app_name))}),I&&!f&&e.jsx("div",{className:"mt-6",children:e.jsx(y,{className:"w-full",size:"lg",onClick:()=>x.mutate(),disabled:x.isPending,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Completing..."]}):"Complete Setup"})}),e.jsx("div",{className:"mt-8 pt-6 border-t text-center",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Session expires:"," ",new Date(r.session.expires_at).toLocaleString()]})})]})]}):null}function oe(){const t=T.c(3);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/connect/$sessionId"},t[0]=n):n=t[0];const{sessionId:i}=O(n);let a;return t[1]!==i?(a=e.jsx(V,{sessionId:i}),t[1]=i,t[2]=a):a=t[2],a}export{oe as default};
@@ -1 +1 @@
1
- import{c as $,j as t}from"./index-Chdo1wOf.js";import{C as q}from"./card-C5XZXHnb.js";import{c as N}from"./button-BlFVi9O-.js";import{I as B}from"./integration-icon-CHfvIBul.js";function L(g){const e=$.c(46),{connection:s,onClick:C,headerActions:b,body:k,footer:y,className:I,size:A,fallbackIcon:w}=g,E=A===void 0?"md":A,i=E==="sm"?"p-4":"p-6",P=E==="sm"?"text-sm":"text-base",R=E==="sm"?"text-xs":"text-sm",S=C&&"hover:bg-muted/50";let l;e[0]!==I||e[1]!==S?(l=N("cursor-pointer transition-colors group overflow-hidden flex flex-col",S,I),e[0]=I,e[1]=S,e[2]=l):l=e[2];let o;e[3]!==i?(o=N("flex flex-col gap-4",i),e[3]=i,e[4]=o):o=e[4];let n;e[5]!==s.icon||e[6]!==s.title||e[7]!==w?(n=t.jsx(B,{icon:s.icon,name:s.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:w}),e[5]=s.icon,e[6]=s.title,e[7]=w,e[8]=n):n=e[8];let c;e[9]!==b?(c=b&&t.jsx("div",{className:N("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:F,children:b}),e[9]=b,e[10]=c):c=e[10];let r;e[11]!==c?(r=t.jsx("div",{className:"relative",children:c}),e[11]=c,e[12]=r):r=e[12];let a;e[13]!==n||e[14]!==r?(a=t.jsxs("div",{className:"flex items-start justify-between",children:[n,r]}),e[13]=n,e[14]=r,e[15]=a):a=e[15];let d;e[16]!==P?(d=N("font-medium text-foreground truncate",P),e[16]=P,e[17]=d):d=e[17];let m;e[18]!==s.title||e[19]!==d?(m=t.jsx("h3",{className:d,children:s.title}),e[18]=s.title,e[19]=d,e[20]=m):m=e[20];let f;e[21]!==R?(f=N("text-muted-foreground line-clamp-2",R),e[21]=R,e[22]=f):f=e[22];const _=s.description||"No description";let x;e[23]!==f||e[24]!==_?(x=t.jsx("p",{className:f,children:_}),e[23]=f,e[24]=_,e[25]=x):x=e[25];let p;e[26]!==m||e[27]!==x?(p=t.jsxs("div",{className:"flex flex-col gap-0",children:[m,x]}),e[26]=m,e[27]=x,e[28]=p):p=e[28];let h;e[29]!==k?(h=k&&t.jsx("div",{children:k}),e[29]=k,e[30]=h):h=e[30];let u;e[31]!==p||e[32]!==h||e[33]!==o||e[34]!==a?(u=t.jsxs("div",{className:o,children:[a,p,h]}),e[31]=p,e[32]=h,e[33]=o,e[34]=a,e[35]=u):u=e[35];let j;e[36]!==y||e[37]!==i?(j=y&&t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:N("h-14 flex items-center",i),onClick:D,children:y})}),e[36]=y,e[37]=i,e[38]=j):j=e[38];let v;e[39]!==u||e[40]!==j?(v=t.jsxs("div",{className:"flex flex-col flex-1",children:[u,j]}),e[39]=u,e[40]=j,e[41]=v):v=e[41];let z;return e[42]!==C||e[43]!==v||e[44]!==l?(z=t.jsx(q,{className:l,onClick:C,children:v}),e[42]=C,e[43]=v,e[44]=l,e[45]=z):z=e[45],z}function D(g){return g.stopPropagation()}function F(g){return g.stopPropagation()}export{L as C};
1
+ import{c as $,j as t}from"./index-DQipirM0.js";import{C as q}from"./card-DMS-g9Fe.js";import{c as N}from"./button-BxOn_P7A.js";import{I as B}from"./integration-icon-6FQvxTss.js";function L(g){const e=$.c(46),{connection:s,onClick:C,headerActions:b,body:k,footer:y,className:I,size:A,fallbackIcon:w}=g,E=A===void 0?"md":A,i=E==="sm"?"p-4":"p-6",P=E==="sm"?"text-sm":"text-base",R=E==="sm"?"text-xs":"text-sm",S=C&&"hover:bg-muted/50";let l;e[0]!==I||e[1]!==S?(l=N("cursor-pointer transition-colors group overflow-hidden flex flex-col",S,I),e[0]=I,e[1]=S,e[2]=l):l=e[2];let o;e[3]!==i?(o=N("flex flex-col gap-4",i),e[3]=i,e[4]=o):o=e[4];let n;e[5]!==s.icon||e[6]!==s.title||e[7]!==w?(n=t.jsx(B,{icon:s.icon,name:s.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:w}),e[5]=s.icon,e[6]=s.title,e[7]=w,e[8]=n):n=e[8];let c;e[9]!==b?(c=b&&t.jsx("div",{className:N("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:F,children:b}),e[9]=b,e[10]=c):c=e[10];let r;e[11]!==c?(r=t.jsx("div",{className:"relative",children:c}),e[11]=c,e[12]=r):r=e[12];let a;e[13]!==n||e[14]!==r?(a=t.jsxs("div",{className:"flex items-start justify-between",children:[n,r]}),e[13]=n,e[14]=r,e[15]=a):a=e[15];let d;e[16]!==P?(d=N("font-medium text-foreground truncate",P),e[16]=P,e[17]=d):d=e[17];let m;e[18]!==s.title||e[19]!==d?(m=t.jsx("h3",{className:d,children:s.title}),e[18]=s.title,e[19]=d,e[20]=m):m=e[20];let f;e[21]!==R?(f=N("text-muted-foreground line-clamp-2",R),e[21]=R,e[22]=f):f=e[22];const _=s.description||"No description";let x;e[23]!==f||e[24]!==_?(x=t.jsx("p",{className:f,children:_}),e[23]=f,e[24]=_,e[25]=x):x=e[25];let p;e[26]!==m||e[27]!==x?(p=t.jsxs("div",{className:"flex flex-col gap-0",children:[m,x]}),e[26]=m,e[27]=x,e[28]=p):p=e[28];let h;e[29]!==k?(h=k&&t.jsx("div",{children:k}),e[29]=k,e[30]=h):h=e[30];let u;e[31]!==p||e[32]!==h||e[33]!==o||e[34]!==a?(u=t.jsxs("div",{className:o,children:[a,p,h]}),e[31]=p,e[32]=h,e[33]=o,e[34]=a,e[35]=u):u=e[35];let j;e[36]!==y||e[37]!==i?(j=y&&t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:N("h-14 flex items-center",i),onClick:D,children:y})}),e[36]=y,e[37]=i,e[38]=j):j=e[38];let v;e[39]!==u||e[40]!==j?(v=t.jsxs("div",{className:"flex flex-col flex-1",children:[u,j]}),e[39]=u,e[40]=j,e[41]=v):v=e[41];let z;return e[42]!==C||e[43]!==v||e[44]!==l?(z=t.jsx(q,{className:l,onClick:C,children:v}),e[42]=C,e[43]=v,e[44]=l,e[45]=z):z=e[45],z}function D(g){return g.stopPropagation()}function F(g){return g.stopPropagation()}export{L as C};
@@ -0,0 +1 @@
1
+ import{c as X,j as t,b as Ee,O as Se,aD as at,u as ct,bz as Ge,ai as vt,p as Nt,bx as Xe,r as Y,o as lt,b7 as yt,bf as _t,s as W,aj as Je,ak as Ct,e as St,a as Tt,m as wt,k as kt,l as Pt,i as It,t as Ce,K as Ye}from"./index-DQipirM0.js";import{E as ye}from"./empty-state-C7VZap1W.js";import{E as dt}from"./error-boundary-BpCU-F5d.js";import{E as $t,r as At,e as mt}from"./env-vars-editor-C0KF8UB-.js";import{P as Ke}from"./index-ow5WSrzH.js";import{S as Vt}from"./save-actions-De5hNsxX.js";import{b as Mt,a as Dt}from"./use-binding-oEpPFbv0.js";import{u as Ot,S as Rt}from"./index-DdzAhdkZ.js";import{f as We,g as ut}from"./use-connection-DXequUdB.js";import{u as Et}from"./constants-9bKBT988.js";import{d as Lt}from"./use-mcp-tools-Dt6WorDi.js";import{b as Ut,d as Ft}from"./use-mcp-prompts-CqOiamVC.js";import{a as zt}from"./mcp-oauth-ZHptqU19.js";import{b as Ze,c as Bt,d as Xt,e as Kt,B as Wt,a as qt}from"./breadcrumb-kQQ-d55s.js";import{B as ze}from"./button-BxOn_P7A.js";import{C as Ht}from"./collection-tabs-BzQ9gNkb.js";import{i as Re}from"./Loading01-BFMhWWtD.js";import{V as qe,a as Qt}from"./layout-C5y_iFls.js";import{C as Gt}from"./collection-tab-CqF7e-el.js";import{I as Le}from"./integration-icon-6FQvxTss.js";import{B as Be}from"./badge-D4ZHiXFA.js";import{D as Jt,a as Yt,b as Zt,c as et}from"./dropdown-menu-BbhseL--.js";import{F as G,a as es,b as J,d as q,f as Z,c as te,e as ts}from"./form-Dn5Ilwyi.js";import{I as ee}from"./input-D3a40-af.js";import{S as tt,a as st,b as nt,c as ot,d as Q}from"./select-BSYdCUMN.js";import{i as pt}from"./CheckCircle-BwIxyhQy.js";import{t as ss}from"./ChevronDown-DDsgD0_a.js";import{n as ns}from"./Container-BY7Dg1ME.js";import{s as Oe}from"./Globe02-DXh1wFnz.js";import{s as os}from"./RefreshCcw01-zTyzcouM.js";import{i as rs}from"./Terminal-DQESGxaj.js";import{s as is}from"./Trash01-BC7PAlKV.js";import{t as He}from"./Users03-DJ0q7ZN3.js";import{s as as}from"./XClose-Cpw_0BW6.js";import{U as cs}from"./use-list-state-DjtYoYEW.js";import{b as ls,a as ds}from"./use-virtual-mcp-Bq4iD2DN.js";import{i as ms}from"./ChevronRight-dj0VUAfs.js";import{s as us}from"./Plus-Ck954sGm.js";import{f as ps}from"./formatDistanceToNow-Cb2QZZJn.js";import{a as ft,C as xt}from"./collection-table-wrapper-DpYYlIci.js";import{C as ht}from"./collection-search-WzmN-NEH.js";import{C as gt}from"./card-DMS-g9Fe.js";import{R as fs}from"./readme-viewer-61IpnmPP.js";import{T as xs}from"./tools-list-B0lut0n1.js";import"./AlertTriangle-Cag6cydu.js";import"./tooltip-B7RjBzxU.js";import"./Pin01-BE9Oh0sU.js";import"./use-organization-settings-Db9DvZjz.js";import"./useMutation-8rEyObWg.js";import"./Save01-CGYgsRh8.js";import"./binder-BeV9Iq0g.js";import"./File06-D2nPQ2vd.js";import"./Key01-CBasGMu5.js";import"./constants-CS_UcM7e.js";import"./registry-utils-DSUIffwE.js";import"./extract-connection-data-CLG2vt6G.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-BCGIZz8M.js";import"./index-CWIKLTkS.js";import"./circle-alert-BGE5uKTO.js";import"./index-BtVQ48XT.js";import"./index-CIUI9_Ip.js";import"./context-LmNUO0nU.js";import"./decopilot-events-Brt4gAR6.js";import"./use-llm-DDqwpIPn.js";import"./useQuery-CqT-L2b-.js";import"./localstorage-keys-Xr0m_-Nl.js";import"./skeleton-D-Lsp11A.js";import"./popover-O7pPZSal.js";import"./Grid01-DDvgvRE8.js";import"./Image01-ToJS21L5.js";import"./SearchMd-Dvn1Eo76.js";import"./Settings01-CE-2gHzf.js";import"./useSuspenseInfiniteQuery-BKpm_7Fb.js";import"./infiniteQueryObserver-45WqMl59.js";import"./spinner-BL4ZMZYA.js";import"./dialog-8Qx5GCEw.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-lkpB-gsw.js";import"./Edit01-BOdZHKPa.js";import"./XCircle-JhpX2IQK.js";import"./AlertCircle-FqZvtfh1.js";import"./use-deco-chat-open-BAG5m-JA.js";import"./ArrowLeft-CHSuXHTI.js";import"./use-copy-h8i-bDIZ.js";import"./Check-BEIYk4IG.js";import"./Code01-DbWG3kai.js";import"./use-create-virtual-mcp-DG-_igKD.js";import"./deco-constants-YxoGHwHI.js";import"./Copy01-BpXeBtQY.js";import"./marked.esm-BaswSlok.js";import"./markdown-DumqyZQo.js";import"./Eye-D_CQVe6k.js";import"./Clock-Dv-gTw8O.js";import"./index-DlglR7Dv.js";import"./use-mobile-CYG2M3Mj.js";import"./DotsVertical-_M8uWFPN.js";import"./empty-state-CSzTWTZI.js";import"./Inbox01-Dl3sNTM-.js";import"./alert-dialog-K0UnFp_v.js";import"./label-_-PuJzKE.js";import"./avatar-BLu12sL5.js";import"./use-view-mode-C5FzaFBT.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowDown-BzwwIvol.js";import"./List-iNTJ6fUY.js";import"./view-mode-toggle-DumSmhPz.js";import"./table-D0pFXKN4.js";import"./RefreshCw01-DbiZ19Ml.js";function hs(s){const e=X.c(14),{virtualMcp:n,org:o}=s;let r;e[0]!==o||e[1]!==n.id?(r={org:o,project:Se,agentId:n.id},e[0]=o,e[1]=n.id,e[2]=r):r=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 c;e[4]!==n.icon||e[5]!==n.title?(c=t.jsx(Le,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[4]=n.icon,e[5]=n.title,e[6]=c):c=e[6];let u;e[7]!==n.title?(u=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ms,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=f):f=e[9];let l;return e[10]!==r||e[11]!==c||e[12]!==u?(l=t.jsxs(at,{to:"/$org/$project/agents/$agentId",params:r,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[c,u,f]}),e[10]=r,e[11]=c,e[12]=u,e[13]=l):l=e[13],l}function rt(s){const e=X.c(20),{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:a,org:c,hasExistingVirtualMcps:u}=s,f=Ee(),l=ds();let x;e[0]!==l.create||e[1]!==r||e[2]!==a||e[3]!==n||e[4]!==o||e[5]!==f||e[6]!==c?(x=async()=>{const m=await l.create.mutateAsync({title:`${o} Agent`,description:r??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:c,project:Se,agentId:m.id}})},e[0]=l.create,e[1]=r,e[2]=a,e[3]=n,e[4]=o,e[5]=f,e[6]=c,e[7]=x):x=e[7];const p=x;if(u){let m;e[8]!==l.create.isPending?(m=l.create.isPending?t.jsx(Re,{size:16,className:"animate-spin"}):t.jsx(us,{size:16}),e[8]=l.create.isPending,e[9]=m):m=e[9];let d;return e[10]!==l.create.isPending||e[11]!==p||e[12]!==m?(d=t.jsx(ze,{variant:"ghost",className:"size-6 p-0",onClick:p,disabled:l.create.isPending,children:m}),e[10]=l.create.isPending,e[11]=p,e[12]=m,e[13]=d):d=e[13],d}let i;e[14]!==l.create.isPending?(i=l.create.isPending?t.jsx(Re,{className:"animate-spin text-muted-foreground"}):t.jsx(He,{className:"size-3 text-muted-foreground"}),e[14]=l.create.isPending,e[15]=i):i=e[15];let b;return e[16]!==l.create.isPending||e[17]!==p||e[18]!==i?(b=t.jsxs(ze,{variant:"outline",size:"sm",onClick:p,disabled:l.create.isPending,children:[i,"Create an agent"]}),e[16]=l.create.isPending,e[17]=p,e[18]=i,e[19]=b):b=e[19],b}function gs(s){const e=X.c(26),{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:a,org:c}=s;let u;e[0]!==n?(u={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=u):u=e[1];const f=ls(u);if(!(f.length>0)){let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=d):d=e[2];let j;return e[3]!==r||e[4]!==a||e[5]!==n||e[6]!==o||e[7]!==c?(j=t.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[d,t.jsx(rt,{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:a,org:c,hasExistingVirtualMcps:!1})]}),e[3]=r,e[4]=a,e[5]=n,e[6]=o,e[7]=c,e[8]=j):j=e[8],j}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 p;e[10]!==r||e[11]!==a||e[12]!==n||e[13]!==o||e[14]!==c?(p=t.jsx("div",{className:"flex flex-col gap-1",children:t.jsxs("div",{className:"flex items-center justify-between",children:[x,t.jsx(rt,{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:a,org:c,hasExistingVirtualMcps:!0})]})}),e[10]=r,e[11]=a,e[12]=n,e[13]=o,e[14]=c,e[15]=p):p=e[15];let i;if(e[16]!==c||e[17]!==f){let d;e[19]!==c?(d=j=>t.jsx(hs,{virtualMcp:j,org:c},j.id),e[19]=c,e[20]=d):d=e[20],i=f.map(d),e[16]=c,e[17]=f,e[18]=i}else i=e[18];let b;e[21]!==i?(b=t.jsx("div",{className:"flex flex-col gap-2",children:i}),e[21]=i,e[22]=b):b=e[22];let m;return e[23]!==p||e[24]!==b?(m=t.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[p,b]}),e[23]=p,e[24]=b,e[25]=m):m=e[25],m}function js({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:r}){const a=Ge({control:s.control,name:"ui_type"}),c=Ge({control:s.control,name:"connection_url"}),{stdioEnabled:u}=vt(),f=(()=>{if(typeof c!="string"||!c)return!1;try{const i=new URL(c);return i.hostname==="api.githubcopilot.com"&&i.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),l=u||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?Nt(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."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{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(tt,{value:i.value,onValueChange:i.onChange,children:[t.jsx(q,{children:t.jsxs(st,{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(Oe,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(nt,{})]})}),t.jsxs(ot,{children:[t.jsx(Q,{value:"HTTP",children:"HTTP"}),t.jsx(Q,{value:"SSE",children:"SSE"}),t.jsx(Q,{value:"Websocket",children:"Websocket"}),l&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{value:"NPX",children:"NPX Package"}),t.jsx(Q,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(G,{control:s.control,name:"connection_url",render:({field:b})=>t.jsx(J,{className:"flex-1 min-w-0",children:t.jsx(q,{children:t.jsx(ee,{placeholder:"https://example.com/mcp",...b,value:b.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(tt,{value:i.value,onValueChange:i.onChange,children:[t.jsx(q,{children:t.jsx(st,{className:"h-10",children:t.jsx(nt,{})})}),t.jsxs(ot,{children:[t.jsx(Q,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(Q,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(Q,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ns,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(Q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(rs,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(Z,{})]})}),a==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"@perplexity-ai/mcp-server",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})}),a==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"node, bun, python...",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"arg1 arg2 --flag value",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(Z,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"/path/to/project (optional)",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})})]}),(a==="NPX"||a==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(q,{children:t.jsx($t,{value:i.value??[],onChange:i.onChange})}),t.jsx(Z,{})]})}),a!=="NPX"&&a!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{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(Jt,{children:[t.jsx(Yt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Be,{variant:"success",className:"gap-1.5",children:[t.jsx(pt,{size:12}),"Authenticated via OAuth",t.jsx(ss,{size:12})]})})}),t.jsxs(Zt,{align:"start",children:[t.jsxs(et,{onClick:o,children:[t.jsx(os,{size:16}),"Re-authenticate"]}),t.jsxs(et,{variant:"destructive",onClick:r,children:[t.jsx(is,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&i.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:()=>i.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(as,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(ee,{type:"password",placeholder:f?"Paste your GitHub PAT":"Enter access token...",...i,value:i.value||"",className:"h-10 rounded-lg"})}),f&&t.jsxs(ts,{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(Z,{})]})})]})}function bs(s){const e=X.c(43),{form:n,connection:o,isMCPAuthenticated:r,hasOAuthToken:a,onReauthenticate:c,onRemoveOAuth:u}=s,{org:f}=ct();let l;e[0]!==o.icon||e[1]!==o.title?(l=t.jsx(Le,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}),e[0]=o.icon,e[1]=o.title,e[2]=l):l=e[2];let x;e[3]!==n.control?(x=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(G,{control:n.control,name:"title",render:Ns}),t.jsx(G,{control:n.control,name:"description",render:vs})]}),e[3]=n.control,e[4]=x):x=e[4];let p;e[5]!==l||e[6]!==x?(p=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[l,x]}),e[5]=l,e[6]=x,e[7]=p):p=e[7];let i;e[8]!==o||e[9]!==n||e[10]!==a||e[11]!==c||e[12]!==u?(i=t.jsx(js,{form:n,connection:o,hasOAuthToken:a,onReauthenticate:c,onRemoveOAuth:u}),e[8]=o,e[9]=n,e[10]=a,e[11]=c,e[12]=u,e[13]=i):i=e[13];let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[14]=b):b=e[14];let m;e[15]!==r?(m=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[b,r?t.jsxs(Be,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[t.jsx(pt,{size:12}),"Connected"]}):t.jsx(Be,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[15]=r,e[16]=m):m=e[16];let d;e[17]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[17]=d):d=e[17];let j;e[18]!==o.created_by?(j=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[d,t.jsx(cs,{id:o.created_by,size:"2xs"})]}),e[18]=o.created_by,e[19]=j):j=e[19];let w;e[20]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[20]=w):w=e[20];let v;e[21]!==o.updated_at?(v=o.updated_at?ps(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[21]=o.updated_at,e[22]=v):v=e[22];let y;e[23]!==v?(y=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[w,t.jsx("span",{className:"text-sm text-foreground",children:v})]}),e[23]=v,e[24]=y):y=e[24];let _;e[25]!==y||e[26]!==m||e[27]!==j?(_=t.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[m,j,y]}),e[25]=y,e[26]=m,e[27]=j,e[28]=_):_=e[28];let N;e[29]!==o.description||e[30]!==o.icon||e[31]!==o.id||e[32]!==o.title||e[33]!==f.slug?(N=t.jsx(gs,{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]=N):N=e[34];let h;e[35]!==_||e[36]!==N||e[37]!==p||e[38]!==i?(h=t.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[p,i,_,N]}),e[35]=_,e[36]=N,e[37]=p,e[38]=i,e[39]=h):h=e[39];let k;return e[40]!==n||e[41]!==h?(k=t.jsx(es,{...n,children:h}),e[40]=n,e[41]=h,e[42]=k):k=e[42],k}function vs(s){const{field:e}=s;return t.jsxs(J,{className:"w-full space-y-0",children:[t.jsx(q,{children:t.jsx(ee,{...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(Z,{})]})}function Ns(s){const{field:e}=s;return t.jsxs(J,{className:"flex-1 space-y-0",children:[t.jsx(q,{children:t.jsx(ee,{...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(Z,{})]})}function ys(s){const e=X.c(42),{prompts:n,connectionId:o,org:r,connectionTitle:a,connectionIcon:c,onPromptClick:u,showToolbar:f,emptyMessage:l}=s,x=f===void 0?!0:f,p=l===void 0?"This connection doesn't have any prompts yet.":l,i=Ee(),m=Xe().location.href,[d,j]=Y.useState(""),[w,v]=Y.useState("table"),[y,_]=Y.useState("name"),[N,h]=Y.useState("asc");let k;e[0]!==N||e[1]!==y?(k=S=>{y===S?(h(ws),N==="desc"&&_(void 0)):(_(S),h("asc"))},e[0]=N,e[1]=y,e[2]=k):k=e[2];const z=k;let $;e[3]!==o||e[4]!==i||e[5]!==u||e[6]!==r?($=S=>{u?u(S):o&&r&&i({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:Se,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(S.name)}})},e[3]=o,e[4]=i,e[5]=u,e[6]=r,e[7]=$):$=e[7];const M=$;let A;if(e[8]!==n||e[9]!==d||e[10]!==N||e[11]!==y){const S=!n||n.length===0?[]:d.trim()?(()=>{const H=d.toLowerCase();return n.filter(K=>K.name.toLowerCase().includes(H)||K.description&&K.description.toLowerCase().includes(H))})():n;A=!y||!N?S:[...S].sort((H,K)=>{const se=H[y]||"",ne=K[y]||"",oe=String(se).localeCompare(String(ne));return N==="asc"?oe:-oe}),e[8]=n,e[9]=d,e[10]=N,e[11]=y,e[12]=A}else A=e[12];const I=A;let E;e[13]===Symbol.for("react.memo_cache_sentinel")?(E=[{id:"name",header:"Name",render:Ts,sortable:!0},{id:"description",header:"Description",render:Ss,cellClassName:"flex-1",sortable:!0}],e[13]=E):E=e[13];const L=E;let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=L.filter(Cs).map(_s),e[14]=C):C=e[14];const B=C;let P;e[15]!==c||e[16]!==a||e[17]!==z||e[18]!==x||e[19]!==N||e[20]!==y||e[21]!==m||e[22]!==w?(P=x&&t.jsxs(qe,{children:[t.jsx(xt,{viewMode:w,onViewModeChange:v,sortKey:y,sortDirection:N,onSort:z,sortOptions:B}),t.jsx(Ke,{title:a?`${a}: Prompts`:"Prompts",url:m,icon:c??"description"})]}),e[15]=c,e[16]=a,e[17]=z,e[18]=x,e[19]=N,e[20]=y,e[21]=m,e[22]=w,e[23]=P):P=e[23];let D;e[24]===Symbol.for("react.memo_cache_sentinel")?(D=S=>{S.key==="Escape"&&(j(""),S.target.blur())},e[24]=D):D=e[24];let V;e[25]!==d?(V=t.jsx(ht,{value:d,onChange:j,placeholder:"Search prompts...",onKeyDown:D}),e[25]=d,e[26]=V):V=e[26];let g;e[27]!==p||e[28]!==M||e[29]!==z||e[30]!==d||e[31]!==N||e[32]!==y||e[33]!==I||e[34]!==w?(g=w==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:I.length===0?t.jsx(ye,{image:null,title:d?"No prompts found":"No prompts available",description:d?"Try adjusting your search terms":p}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:I.map(S=>t.jsx(gt,{className:"cursor-pointer transition-colors",onClick:()=>M(S),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Le,{icon:null,name:S.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:S.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:S.description||"No description"})]})]})},S.name))})}):t.jsx(ft,{columns:L,data:I,isLoading:!1,sortKey:y,sortDirection:N,onSort:z,onRowClick:S=>M(S),emptyState:t.jsx(ye,{image:null,title:d?"No prompts found":"No prompts available",description:d?"Try adjusting your search terms":p})}),e[27]=p,e[28]=M,e[29]=z,e[30]=d,e[31]=N,e[32]=y,e[33]=I,e[34]=w,e[35]=g):g=e[35];let F;e[36]!==V||e[37]!==g?(F=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[V,g]}),e[36]=V,e[37]=g,e[38]=F):F=e[38];let O;return e[39]!==F||e[40]!==P?(O=t.jsxs(t.Fragment,{children:[P,F]}),e[39]=F,e[40]=P,e[41]=O):O=e[41],O}function _s(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Cs(s){return s.sortable}function Ss(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ts(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function ws(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function ks(s){const e=X.c(6),{prompts:n,connectionId:o,org:r}=s,a=We(o),c=a?.title,u=a?.icon;let f;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==c||e[4]!==u?(f=t.jsx(ys,{prompts:n,connectionId:o,org:r,connectionTitle:c,connectionIcon:u}),e[0]=o,e[1]=r,e[2]=n,e[3]=c,e[4]=u,e[5]=f):f=e[5],f}function Ps(s){const e=X.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(fs,{repository:n})}),e[0]=n,e[1]=o):o=e[1],o}function Is(s){const e=X.c(39),{resources:n,connectionTitle:o,connectionIcon:r,onResourceClick:a,showToolbar:c,emptyMessage:u}=s,f=c===void 0?!0:c,l=u===void 0?"This connection doesn't have any resources yet.":u,p=Xe().location.href,[i,b]=Y.useState(""),[m,d]=Y.useState("table"),[j,w]=Y.useState("name"),[v,y]=Y.useState("asc");let _;e[0]!==v||e[1]!==j?(_=g=>{j===g?(y(Rs),v==="desc"&&w(void 0)):(w(g),y("asc"))},e[0]=v,e[1]=j,e[2]=_):_=e[2];const N=_;let h;e[3]!==a?(h=g=>{a&&a(g)},e[3]=a,e[4]=h):h=e[4];const k=h;let z;if(e[5]!==n||e[6]!==i||e[7]!==v||e[8]!==j){const g=!n||n.length===0?[]:i.trim()?(()=>{const F=i.toLowerCase();return n.filter(O=>O.uri.toLowerCase().includes(F)||O.name&&O.name.toLowerCase().includes(F)||O.description&&O.description.toLowerCase().includes(F))})():n;z=!j||!v?g:[...g].sort((F,O)=>{const S=F[j]||"",H=O[j]||"",K=String(S).localeCompare(String(H));return v==="asc"?K:-K}),e[5]=n,e[6]=i,e[7]=v,e[8]=j,e[9]=z}else z=e[9];const $=z;let M;e[10]===Symbol.for("react.memo_cache_sentinel")?(M=[{id:"name",header:"Name",render:Os,sortable:!0},{id:"uri",header:"URI",render:Ds,sortable:!0},{id:"description",header:"Description",render:Ms,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Vs,sortable:!0}],e[10]=M):M=e[10];const A=M;let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=A.filter(As).map($s),e[11]=I):I=e[11];const E=I;let L;e[12]!==r||e[13]!==o||e[14]!==N||e[15]!==f||e[16]!==v||e[17]!==j||e[18]!==p||e[19]!==m?(L=f&&t.jsxs(qe,{children:[t.jsx(xt,{viewMode:m,onViewModeChange:d,sortKey:j,sortDirection:v,onSort:N,sortOptions:E}),t.jsx(Ke,{title:o?`${o}: Resources`:"Resources",url:p,icon:r??"folder"})]}),e[12]=r,e[13]=o,e[14]=N,e[15]=f,e[16]=v,e[17]=j,e[18]=p,e[19]=m,e[20]=L):L=e[20];let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=g=>{g.key==="Escape"&&(b(""),g.target.blur())},e[21]=C):C=e[21];let B;e[22]!==i?(B=t.jsx(ht,{value:i,onChange:b,placeholder:"Search resources...",onKeyDown:C}),e[22]=i,e[23]=B):B=e[23];let P;e[24]!==l||e[25]!==k||e[26]!==N||e[27]!==i||e[28]!==v||e[29]!==j||e[30]!==$||e[31]!==m?(P=m==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:$.length===0?t.jsx(ye,{image:null,title:i?"No resources found":"No resources available",description:i?"Try adjusting your search terms":l}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:$.map(g=>t.jsx(gt,{className:"cursor-pointer transition-colors",onClick:()=>k(g),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Le,{icon:null,name:g.name||g.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:g.name||g.uri}),t.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:g.uri}),g.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:g.description})]})]})},g.uri))})}):t.jsx(ft,{columns:A,data:$,isLoading:!1,sortKey:j,sortDirection:v,onSort:N,onRowClick:g=>k(g),emptyState:t.jsx(ye,{image:null,title:i?"No resources found":"No resources available",description:i?"Try adjusting your search terms":l})}),e[24]=l,e[25]=k,e[26]=N,e[27]=i,e[28]=v,e[29]=j,e[30]=$,e[31]=m,e[32]=P):P=e[32];let D;e[33]!==B||e[34]!==P?(D=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[B,P]}),e[33]=B,e[34]=P,e[35]=D):D=e[35];let V;return e[36]!==D||e[37]!==L?(V=t.jsxs(t.Fragment,{children:[L,D]}),e[36]=D,e[37]=L,e[38]=V):V=e[38],V}function $s(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function As(s){return s.sortable}function Vs(s){return t.jsx("span",{className:"text-sm text-muted-foreground",children:s.mimeType||"—"})}function Ms(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ds(s){return t.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:s.uri})}function Os(s){return t.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name||s.uri})}function Rs(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Es(s){const e=X.c(6),{resources:n,connectionId:o,org:r}=s,a=We(o),c=a?.title,u=a?.icon;let f;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==c||e[4]!==u?(f=t.jsx(Is,{resources:n,connectionId:o,org:r,connectionTitle:c,connectionIcon:u}),e[0]=o,e[1]=r,e[2]=n,e[3]=c,e[4]=u,e[5]=f):f=e[5],f}const Ls=lt({key:W().min(1,"Key is required"),value:W()}),Us=lt({title:W().min(1,"Name is required"),description:W().nullable().optional(),ui_type:Ct(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:W().optional(),connection_token:W().nullable().optional(),npx_package:W().optional(),stdio_command:W().optional(),stdio_args:W().optional(),stdio_cwd:W().optional(),env_vars:Je(Ls).optional(),configuration_scopes:Je(W()).nullable().optional(),configuration_state:yt(W(),_t()).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 Fs(s){const e=X.c(5),{tools:n,connectionId:o,org:r,isLoading:a}=s;let c;return e[0]!==o||e[1]!==a||e[2]!==r||e[3]!==n?(c=t.jsx(xs,{tools:n,connectionId:o,org:r,isLoading:a}),e[0]=o,e[1]=a,e[2]=r,e[3]=n,e[4]=c):c=e[4],c}function zs(s){return s.command==="npx"}function Bs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Xs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Ks(s,e){const n={command:"npx",args:["-y",s]},o=mt(e);return Object.keys(o).length>0&&(n.envVars=o),n}function Ws(s,e,n,o){const r={command:s};e.trim()&&(r.args=e.trim().split(/\s+/)),n?.trim()&&(r.cwd=n.trim());const a=mt(o);return Object.keys(a).length>0&&(r.envVars=a),r}function it(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"&&It(s.connection_headers)){const o=s.connection_headers,r=At(o.envVars);if(zs(o)){const c=Bs(o);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}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:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function qs(s){let e,n=null,o=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Ks(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=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},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function Hs(s){const e=X.c(117),{connection:n,connectionId:o,org:r,requestedTabId:a,collections:c,onUpdate:u,isUpdating:f,prompts:l,resources:x,tools:p,isLoadingTools:i}=s;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={from:"/$org/$project/mcps/$connectionId"},e[0]=b):b=e[0];const m=Ee(b),d=wt(),w=Xe().location.href,v=ut();let y;e[1]!==o?(y={connectionId:o},e[1]=o,e[2]=y):y=e[2];const _=Ot(y),h=n?.connection_type==="VIRTUAL"||_.isAuthenticated;let k;e[3]!==n?(k={connections:[n],binding:"MCP"},e[3]=n,e[4]=k):k=e[4];const $=Dt(k).length>0,M=n?.metadata?.repository,A=!!M?.url;let I;e[5]===Symbol.for("react.memo_cache_sentinel")?(I=kt(Us),e[5]=I):I=e[5];let E;e[6]!==n?(E=it(n),e[6]=n,e[7]=E):E=e[7];let L;e[8]!==E?(L={resolver:I,values:E},e[8]=E,e[9]=L):L=e[9];const C=Pt(L),B=C.formState.isDirty;let P;e[10]!==C||e[11]!==u?(P=async()=>{if(!await C.trigger())return;const U=C.getValues(),Ne=qs(U);await u(Ne),C.reset(U)},e[10]=C,e[11]=u,e[12]=P):P=e[12];const D=P;let V;e[13]!==n||e[14]!==C?(V=()=>{C.reset(it(n))},e[13]=n,e[14]=C,e[15]=V):V=e[15];const g=V;let F;e[16]!==n.id||e[17]!==v||e[18]!==d?(F=async()=>{const{token:T,tokenInfo:U,error:Ne}=await zt({connectionId:n.id});if(Ne||!T){Ce.error(`Authentication failed: ${Ne}`);return}if(U)try{const De=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:U.accessToken,refreshToken:U.refreshToken,expiresIn:U.expiresIn,scope:U.scope,clientId:U.clientId,clientSecret:U.clientSecret,tokenEndpoint:U.tokenEndpoint})});if(!De.ok)console.error("Failed to save OAuth token:",await De.text()),await v.update.mutateAsync({id:n.id,data:{connection_token:T}});else try{await v.update.mutateAsync({id:n.id,data:{}})}catch(Qe){console.warn("Failed to refresh connection tools after OAuth:",Qe)}}catch(De){console.error("Error saving OAuth token:",De),await v.update.mutateAsync({id:n.id,data:{connection_token:T}})}else await v.update.mutateAsync({id:n.id,data:{connection_token:T}});const bt=new URL(`/mcp/${n.id}`,window.location.origin);await d.invalidateQueries({queryKey:Ye.isMCPAuthenticated(bt.href,null)}),Ce.success("Authentication successful")},e[16]=n.id,e[17]=v,e[18]=d,e[19]=F):F=e[19];const O=F;let S;e[20]!==n.id||e[21]!==d?(S=async()=>{try{const T=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!T.ok){const Ne=await T.text();Ce.error(`Failed to remove OAuth: ${Ne}`);return}const U=new URL(`/mcp/${n.id}`,window.location.origin);await d.invalidateQueries({queryKey:Ye.isMCPAuthenticated(U.href,null)}),Ce.success("OAuth removed. You can now re-authenticate with a different account.")}catch(T){console.error("Error removing OAuth token:",T),Ce.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=d,e[22]=S):S=e[22];const H=S,K=p.length,se=l.length,ne=x.length,oe=K>0||i;let Te;e[23]===Symbol.for("react.memo_cache_sentinel")?(Te={id:"settings",label:"Settings"},e[23]=Te):Te=e[23];let re;e[24]!==i||e[25]!==h||e[26]!==oe||e[27]!==K?(re=h&&oe?[{id:"tools",label:"Tools",count:i?void 0:K}]:[],e[24]=i,e[25]=h,e[26]=oe,e[27]=K,e[28]=re):re=e[28];let ie;e[29]!==h||e[30]!==se?(ie=h&&se>0?[{id:"prompts",label:"Prompts",count:se}]:[],e[29]=h,e[30]=se,e[31]=ie):ie=e[31];let ae;e[32]!==h||e[33]!==ne?(ae=h&&ne>0?[{id:"resources",label:"Resources",count:ne}]:[],e[32]=h,e[33]=ne,e[34]=ae):ae=e[34];let we;if(e[35]!==c||e[36]!==A||e[37]!==h||e[38]!==re||e[39]!==ie||e[40]!==ae){let T;e[42]!==A?(T=A?[{id:"readme",label:"README"}]:[],e[42]=A,e[43]=T):T=e[43],we=[Te,...re,...ie,...ae,...h?(c||[]).map(Gs):[],...T],e[35]=c,e[36]=A,e[37]=h,e[38]=re,e[39]=ie,e[40]=ae,e[41]=we}else we=e[41];const _e=we,jt=h&&_e.some(Qs)?"tools":"settings",R=_e.some(T=>T.id===a)?a:jt;let ke;e[44]!==m?(ke=T=>{m({search:U=>({...U,tab:T}),replace:!0})},e[44]=m,e[45]=ke):ke=e[45];const ce=ke;let le;e[46]!==c?(le=c||[],e[46]=c,e[47]=le):le=e[47];let Pe;if(e[48]!==R||e[49]!==le){let T;e[51]!==R?(T=U=>U.name===R,e[51]=R,e[52]=T):T=e[52],Pe=le.find(T),e[48]=R,e[49]=le,e[50]=Pe}else Pe=e[50];const Ie=Pe;let de;e[53]!==r?(de=t.jsx(Ze,{children:t.jsx(Xt,{asChild:!0,children:t.jsx(at,{to:"/$org/$project/mcps",params:{org:r,project:Se},children:"Connections"})})}),e[53]=r,e[54]=de):de=e[54];let $e;e[55]===Symbol.for("react.memo_cache_sentinel")?($e=t.jsx(Kt,{}),e[55]=$e):$e=e[55];let me;e[56]!==n.title?(me=t.jsx(Ze,{children:t.jsx(Bt,{children:n.title})}),e[56]=n.title,e[57]=me):me=e[57];let Ae;e[58]!==de||e[59]!==me?(Ae=t.jsx(Wt,{children:t.jsxs(qt,{children:[de,$e,me]})}),e[58]=de,e[59]=me,e[60]=Ae):Ae=e[60];const Ue=Ae;let ue;e[61]!==D||e[62]!==g||e[63]!==B||e[64]!==f?(ue=t.jsx(Vt,{onSave:D,onUndo:g,isDirty:B,isSaving:f}),e[61]=D,e[62]=g,e[63]=B,e[64]=f,e[65]=ue):ue=e[65];const Fe=n.icon??"settings";let pe;e[66]!==n.title||e[67]!==Fe||e[68]!==w?(pe=t.jsx(Ke,{title:n.title,url:w,icon:Fe}),e[66]=n.title,e[67]=Fe,e[68]=w,e[69]=pe):pe=e[69];let fe;e[70]!==ue||e[71]!==pe?(fe=t.jsxs(qe,{children:[ue,pe]}),e[70]=ue,e[71]=pe,e[72]=fe):fe=e[72];let xe;e[73]!==_.hasOAuthToken||e[74]!==n||e[75]!==C||e[76]!==O||e[77]!==H||e[78]!==h?(xe=t.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:t.jsx(bs,{form:C,connection:n,isMCPAuthenticated:h,hasOAuthToken:_.hasOAuthToken,onReauthenticate:O,onRemoveOAuth:H})}),e[73]=_.hasOAuthToken,e[74]=n,e[75]=C,e[76]=O,e[77]=H,e[78]=h,e[79]=xe):xe=e[79];let he;e[80]!==R||e[81]!==ce||e[82]!==_e?(he=t.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:t.jsx(Ht,{tabs:_e,activeTab:R,onTabChange:ce,className:"flex-1"})}),e[80]=R,e[81]=ce,e[82]=_e,e[83]=he):he=e[83];let Ve;e[84]===Symbol.for("react.memo_cache_sentinel")?(Ve=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Re,{size:32,className:"animate-spin text-muted-foreground"})}),e[84]=Ve):Ve=e[84];let ge;e[85]!==Ie||e[86]!==R||e[87]!==_.isServerError||e[88]!==_.supportsOAuth||e[89]!==n||e[90]!==o||e[91]!==C||e[92]!==O||e[93]!==ce||e[94]!==$||e[95]!==A||e[96]!==i||e[97]!==h||e[98]!==r||e[99]!==l||e[100]!==M||e[101]!==x||e[102]!==p?(ge=t.jsx(Y.Suspense,{fallback:Ve,children:R==="tools"?t.jsx(Fs,{tools:p,connectionId:o,org:r,isLoading:i}):R==="prompts"?t.jsx(ks,{prompts:l,connectionId:o,org:r}):R==="resources"?t.jsx(Es,{resources:x,connectionId:o,org:r}):R==="settings"?t.jsx(Rt,{connection:n,form:C,hasMcpBinding:$,isMCPAuthenticated:h,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:O,onViewReadme:A?()=>ce("readme"):void 0}):R==="readme"&&A?t.jsx(Ps,{repository:M}):Ie&&h?t.jsx(Gt,{connectionId:o,org:r,activeCollection:Ie},R):t.jsx(ye,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[85]=Ie,e[86]=R,e[87]=_.isServerError,e[88]=_.supportsOAuth,e[89]=n,e[90]=o,e[91]=C,e[92]=O,e[93]=ce,e[94]=$,e[95]=A,e[96]=i,e[97]=h,e[98]=r,e[99]=l,e[100]=M,e[101]=x,e[102]=p,e[103]=ge):ge=e[103];let je;e[104]!==R||e[105]!==ge?(je=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(dt,{children:ge},R)}),e[104]=R,e[105]=ge,e[106]=je):je=e[106];let be;e[107]!==he||e[108]!==je?(be=t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[he,je]}),e[107]=he,e[108]=je,e[109]=be):be=e[109];let ve;e[110]!==xe||e[111]!==be?(ve=t.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[xe,be]}),e[110]=xe,e[111]=be,e[112]=ve):ve=e[112];let Me;return e[113]!==Ue||e[114]!==fe||e[115]!==ve?(Me=t.jsxs(Qt,{breadcrumb:Ue,children:[fe,ve]}),e[113]=Ue,e[114]=fe,e[115]=ve,e[116]=Me):Me=e[116],Me}function Qs(s){return s.id==="tools"}function Gs(s){return{id:s.name,label:s.displayName}}function Js(){const s=X.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=Ee(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:r,org:a}=St(o),{org:c}=ct();let u;s[2]===Symbol.for("react.memo_cache_sentinel")?(u={from:"/shell/$org/$project/mcps/$connectionId"},s[2]=u):u=s[2];const l=Tt(u).tab??"",x=We(r),p=ut(),i=Mt(x??void 0);let b;s[3]!==r||s[4]!==c.id?(b={connectionId:r,orgId:c.id},s[3]=r,s[4]=c.id,s[5]=b):b=s[5];const m=Et(b);let d;s[6]!==m?(d={client:m},s[6]=m,s[7]=d):d=s[7];const{data:j}=Ut(d);let w;s[8]!==m?(w={client:m},s[8]=m,s[9]=w):w=s[9];const{data:v}=Ft(w),_=!(x?.connection_type==="VIRTUAL")&&x?.tools&&x.tools.length>0,N=!_;let h;s[10]!==m||s[11]!==N?(h={client:m,enabled:N},s[10]=m,s[11]=N,s[12]=h):h=s[12];const{data:k,isLoading:z}=Lt(h);let $;s[13]!==j?.prompts?($=j?.prompts??[],s[13]=j?.prompts,s[14]=$):$=s[14];let M;s[15]!==$?(M=$.map(en),s[15]=$,s[16]=M):M=s[16];const A=M;let I;s[17]!==v?.resources?(I=v?.resources??[],s[17]=v?.resources,s[18]=I):I=s[18];let E;s[19]!==I?(E=I.map(Zs),s[19]=I,s[20]=E):E=s[20];const L=E;let C;s[21]!==x||s[22]!==_||s[23]!==k?.tools?(C=_?x.tools??[]:(k?.tools??[]).map(Ys),s[21]=x,s[22]=_,s[23]=k?.tools,s[24]=C):C=s[24];const B=C;let P;s[25]!==p.update||s[26]!==r?(P=async g=>{await p.update.mutateAsync({id:r,data:g})},s[25]=p.update,s[26]=r,s[27]=P):P=s[27];const D=P;if(!x){let g;return s[28]!==n||s[29]!==a?(g=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ye,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(ze,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:a,project:Se}}),children:"Back to connections"})})}),s[28]=n,s[29]=a,s[30]=g):g=s[30],g}let V;return s[31]!==p.update.isPending||s[32]!==i||s[33]!==x||s[34]!==r||s[35]!==D||s[36]!==z||s[37]!==a||s[38]!==A||s[39]!==l||s[40]!==L||s[41]!==B?(V=t.jsx(Hs,{org:a,connection:x,connectionId:r,requestedTabId:l,collections:i,onUpdate:D,isUpdating:p.update.isPending,prompts:A,resources:L,tools:B,isLoadingTools:z}),s[31]=p.update.isPending,s[32]=i,s[33]=x,s[34]=r,s[35]=D,s[36]=z,s[37]=a,s[38]=A,s[39]=l,s[40]=L,s[41]=B,s[42]=V):V=s[42],V}function Ys(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations}}function Zs(s){return{uri:s.uri,name:s.name,description:s.description}}function en(s){return{name:s.name,description:s.description}}function tn(){const s=X.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(dt,{children:t.jsx(Y.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Re,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Js,{})})}),s[0]=e):e=s[0],e}function ar(){const s=X.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tn,{}),s[0]=e):e=s[0],e}export{ar as default};
@@ -0,0 +1 @@
1
+ import{c as be,j as e,r as X,u as Fe,m as Be,b as Ue,a as He,d as Le,ai as Me,l as ze,k as Re,i as Xe,O as g,t as D,o as ke,aj as We,s as C,ak as Ke}from"./index-DQipirM0.js";import{g as Ge}from"./generate-id-Dyweu44Y.js";import{C as qe,a as Qe}from"./collection-table-wrapper-DpYYlIci.js";import{C as Je}from"./collection-search-WzmN-NEH.js";import{C as Ye}from"./connection-card-CRsOF1KU.js";import{B as L}from"./badge-D4ZHiXFA.js";import{i as Ze}from"./AlertCircle-FqZvtfh1.js";import{i as et}from"./CheckCircle-BwIxyhQy.js";import{E as M}from"./empty-state-C7VZap1W.js";import{E as tt}from"./error-boundary-BpCU-F5d.js";import{I as nt}from"./integration-icon-6FQvxTss.js";import{P as E}from"./index-DlglR7Dv.js";import{u as st,U as re}from"./use-list-state-DjtYoYEW.js";import{u as ot}from"./use-binding-oEpPFbv0.js";import{f as rt,e as it}from"./registry-utils-DSUIffwE.js";import{f as ie,a as ae,b as ce,c as le,d as de,e as me,A as ue,g as pe}from"./alert-dialog-K0UnFp_v.js";import{B as at,a as ct,b as lt,c as dt}from"./breadcrumb-kQQ-d55s.js";import{B as S}from"./button-BxOn_P7A.js";import{D as mt,a as ut,b as pt,c as xt,d as ht,e as gt}from"./dialog-8Qx5GCEw.js";import{D as xe,a as he,b as ge,c as F}from"./dropdown-menu-BbhseL--.js";import{a as ft,F as f,b as j,c as y,d as v,f as _}from"./form-Dn5Ilwyi.js";import{I as T}from"./input-D3a40-af.js";import{S as jt,a as yt,b as vt,c as _t,d as $}from"./select-BSYdCUMN.js";import{T as Ct}from"./textarea-DX9d61Sr.js";import{g as Nt,h as bt}from"./use-connection-DXequUdB.js";import{u as fe,a as kt}from"./constants-9bKBT988.js";import{b as wt}from"./use-mcp-tools-Dt6WorDi.js";import{n as z}from"./Container-BY7Dg1ME.js";import{i as je}from"./DotsVertical-_M8uWFPN.js";import{s as ye}from"./Eye-D_CQVe6k.js";import{s as R}from"./Globe02-DXh1wFnz.js";import{i as St}from"./Loading01-BFMhWWtD.js";import{i as Tt}from"./Terminal-DQESGxaj.js";import{s as ve}from"./Trash01-BC7PAlKV.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-C0KF8UB-.js";import"./ArrowDown-BzwwIvol.js";import"./ArrowUp-lkpB-gsw.js";import"./Check-BEIYk4IG.js";import"./Grid01-DDvgvRE8.js";import"./List-iNTJ6fUY.js";import"./tooltip-B7RjBzxU.js";import"./view-mode-toggle-DumSmhPz.js";import"./table-D0pFXKN4.js";import"./SearchMd-Dvn1Eo76.js";import"./card-DMS-g9Fe.js";import"./AlertTriangle-Cag6cydu.js";import"./use-mobile-CYG2M3Mj.js";import"./avatar-BLu12sL5.js";import"./useQuery-CqT-L2b-.js";import"./use-view-mode-C5FzaFBT.js";import"./binder-BeV9Iq0g.js";import"./ChevronRight-dj0VUAfs.js";import"./label-_-PuJzKE.js";import"./ChevronDown-DDsgD0_a.js";import"./useMutation-8rEyObWg.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./Plus-Ck954sGm.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(L,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[e.jsx(et,{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(L,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[e.jsx(Ze,{size:12}),"Error"]}),o[1]=c):c=o[1],c}let d;return o[2]===Symbol.for("react.memo_cache_sentinel")?(d=e.jsx(L,{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:Ke(["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:We(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}=Fe(),o=Be(),i=Ue(),d=He({strict:!1}),{data:c}=Le.useSession(),{stdioEnabled:N}=Me(),l=st({namespace:s.slug,resource:"connections"}),O=Nt(),A=bt(l),[u,b]=X.useReducer(Ut,{mode:"idle"}),W=ot(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=ze({resolver:Re(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=Xe(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=Ge("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(Je,{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(M,{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(Ye,{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(Qe,{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(M,{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(M,{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 Wn(){const s=be.c(1);let o;return s[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(tt,{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{Wn as default};
@@ -1 +1 @@
1
- import{r as y,j as _,ar as b,br as C,c as d,n as f,bs as T}from"./index-Chdo1wOf.js";var v=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),w="VisuallyHidden",g=y.forwardRef((t,e)=>_.jsx(b.span,{...t,ref:e,style:{...v,...t.style}}));g.displayName=w;var D=g;const m={authConfig:()=>["authConfig"],threads:t=>["threads",t],virtualMcpThreads:(t,e)=>["threads",t,"virtual-mcp",e],thread:(t,e)=>["thread",t,e],threadMessages:(t,e)=>["thread-messages",t,e],messages:t=>["messages",t],organizations:()=>["organizations"],members:t=>[t,"members"],invitations:t=>[t,"invitations"],organizationRoles:t=>[t,"organization-roles"],connections:t=>[t,"connections"],connectionsByBinding:(t,e)=>[t,"connections",`binding:${e}`],connection:(t,e)=>[t,"connection",e],isMCPAuthenticated:(t,e)=>["is-mcp-authenticated",t,e],mcpTools:(t,e)=>["mcp","tools",t,e],mcpClient:(t,e,n,o)=>["mcp","client",t,e,n,o],mcpToolsList:t=>["mcp","client",t,"tools"],mcpResourcesList:t=>["mcp","client",t,"resources"],mcpPromptsList:t=>["mcp","client",t,"prompts"],mcpReadResource:(t,e)=>["mcp","client",t,"resource",e],mcpGetPrompt:(t,e,n)=>["mcp","client",t,"prompt",e,n],mcpToolCall:(t,e,n)=>["mcp","client",t,"tool-call",e,n],organizationSettings:t=>["organization-settings",t],activeOrganization:t=>["activeOrganization",t],modelsList:t=>["models-list",t],connectionCollections:t=>[t,"collections","discovery"],toolCall:(t,e,n)=>["tool-call",t,e,n],collectionItems:(t,e)=>["collection",t,e],collection:(t,e,n)=>[t,e,"collection",n],collectionItem:(t,e,n,o,i)=>[t,e,n,"collection",o,i],collectionList:(t,e,n,o,i)=>[t,e,n,"collection",o,"list",i],collectionListInfinite:(t,e,n,o,i)=>[t,e,n,"collection",o,"list-infinite",i],githubReadme:(t,e)=>["github-readme",t,e],monitoringStats:()=>["monitoring","stats"],monitoringLogs:t=>["monitoring","logs",t],monitoringLogsInfinite:(t,e)=>["monitoring","logs-infinite",t,e],virtualMcpPrompts:t=>["virtual-mcp",t,"prompts"],connectionPrompts:t=>["connection",t,"prompts"],connectionResources:t=>["connection",t,"resources"],user:t=>["user",t]};class P extends C{constructor(e,n){super(e,n)}send(e,n){const o=S(e);return o?.type==="emit"?(this.onmessage?.(o.message),Promise.resolve()):o?.type==="suppress"?Promise.resolve():super.send(e,n)}}function S(t){const e=t;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const n=e?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"mesh-virtual-mcp",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const I={name:"mesh-sdk",version:"1.0.0"};function R(t,e){const n=e??(typeof window<"u"?window.location.origin:void 0);if(!n)throw new Error("MCP client requires either meshUrl option or a browser environment.");const o=t?`/mcp/${t}`:"/mcp";return new URL(o,n).href}async function h({connectionId:t,orgId:e,token:n,meshUrl:o}){const i=R(t,o),c=new T(I,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),r=new P(new URL(i),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream","x-org-id":e,...n?{Authorization:`Bearer ${n}`}:{}}}});await c.connect(r);const a=m.mcpClient(e,t??"self",n??"",o??"");return c.toJSON=()=>`mcp-client:${a.join(":")}`,c}function A(t){const e=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:c}=t;let r;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==i?(r=m.mcpClient(o,n??"self",i??"",c??""),e[0]=n,e[1]=c,e[2]=o,e[3]=i,e[4]=r):r=e[4];const a=r;let s;e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==i?(s=()=>h({connectionId:n,orgId:o,token:i,meshUrl:c}),e[5]=n,e[6]=c,e[7]=o,e[8]=i,e[9]=s):s=e[9];let l;e[10]!==a||e[11]!==s?(l={queryKey:a,queryFn:s,staleTime:1/0,gcTime:0},e[10]=a,e[11]=s,e[12]=l):l=e[12];const{data:p}=f(l);return p}function O(t){const e=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:c}=t;let r;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==i?(r=n!==void 0?m.mcpClient(o,n??"self",i??"",c??""):["mcp","client","skip",o],e[0]=n,e[1]=c,e[2]=o,e[3]=i,e[4]=r):r=e[4];const a=r;let s;e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==i?(s=async()=>n===void 0?null:h({connectionId:n,orgId:o,token:i,meshUrl:c}),e[5]=n,e[6]=c,e[7]=o,e[8]=i,e[9]=s):s=e[9];let l;e[10]!==a||e[11]!==s?(l={queryKey:a,queryFn:s,staleTime:1/0,gcTime:0},e[10]=a,e[11]=s,e[12]=l):l=e[12];const{data:p}=f(l);return p??null}const M={SELF:t=>`${t}_self`,REGISTRY:t=>`${t}_registry`,COMMUNITY_REGISTRY:t=>`${t}_community-registry`,DEV_ASSETS:t=>`${t}_dev-assets`},$="self";function j(t){return{id:M.REGISTRY(t),title:"Deco Store",description:"Official deco MCP registry with curated integrations",connection_type:"HTTP",connection_url:"https://api.decocms.com/mcp/registry",icon:"https://assets.decocache.com/decocms/00ccf6c3-9e13-4517-83b0-75ab84554bb9/596364c63320075ca58483660156b6d9de9b526e.png",app_name:"deco-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function z(){return{id:"community-registry",title:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",connection_type:"HTTP",connection_url:"https://sites-registry.decocache.com/mcp",icon:"https://assets.decocache.com/decocms/cd7ca472-0f72-463a-b0de-6e44bdd0f9b4/mcp.png",app_name:"mcp-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function K(t={}){return{id:t.id,title:"OpenRouter",description:"Access hundreds of LLM models from a single API",icon:"https://assets.decocache.com/decocms/b2e2f64f-6025-45f7-9e8c-3b3ebdd073d8/openrouter_logojpg.jpg",app_name:"openrouter",app_id:"openrouter",connection_type:"HTTP",connection_url:"https://sites-openrouter.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{source:"chat",verified:!1,scopeName:"deco",toolsCount:0,publishedAt:null,repository:null}}}function k(){return{title:"MCP Studio",description:"An app that allows you to create and manage MCPs",icon:"https://assets.decocache.com/mcp/09e44283-f47d-4046-955f-816d227c626f/app.png",app_name:"mcp-studio",app_id:"65a1b407-b6af-41e2-a89f-ce9450c05bbc",connection_type:"HTTP",connection_url:"https://sites-vibemcp.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!1,type:"mcp-studio"}}}function q(t){return{id:L(t),organization_id:t,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:null},connections:[]}}const u="decopilot_";function x(t){return!t||!t.startsWith(u)?null:t.slice(u.length)||null}function L(t){return`${u}${t}`}export{m as K,D as R,P as S,v as V,M as W,$ as a,z as b,h as c,q as d,k as e,K as f,L as g,j as h,x as i,O as j,A as u};
1
+ import{r as y,j as _,am as b,bq as C,c as d,n as f,br as T}from"./index-DQipirM0.js";var v=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),w="VisuallyHidden",g=y.forwardRef((t,e)=>_.jsx(b.span,{...t,ref:e,style:{...v,...t.style}}));g.displayName=w;var D=g;const m={authConfig:()=>["authConfig"],threads:t=>["threads",t],virtualMcpThreads:(t,e)=>["threads",t,"virtual-mcp",e],thread:(t,e)=>["thread",t,e],threadMessages:(t,e)=>["thread-messages",t,e],messages:t=>["messages",t],organizations:()=>["organizations"],members:t=>[t,"members"],invitations:t=>[t,"invitations"],organizationRoles:t=>[t,"organization-roles"],connections:t=>[t,"connections"],connectionsByBinding:(t,e)=>[t,"connections",`binding:${e}`],connection:(t,e)=>[t,"connection",e],isMCPAuthenticated:(t,e)=>["is-mcp-authenticated",t,e],mcpTools:(t,e)=>["mcp","tools",t,e],mcpClient:(t,e,n,o)=>["mcp","client",t,e,n,o],mcpToolsList:t=>["mcp","client",t,"tools"],mcpResourcesList:t=>["mcp","client",t,"resources"],mcpPromptsList:t=>["mcp","client",t,"prompts"],mcpReadResource:(t,e)=>["mcp","client",t,"resource",e],mcpGetPrompt:(t,e,n)=>["mcp","client",t,"prompt",e,n],mcpToolCall:(t,e,n)=>["mcp","client",t,"tool-call",e,n],organizationSettings:t=>["organization-settings",t],activeOrganization:t=>["activeOrganization",t],modelsList:t=>["models-list",t],connectionCollections:t=>[t,"collections","discovery"],toolCall:(t,e,n)=>["tool-call",t,e,n],collectionItems:(t,e)=>["collection",t,e],collection:(t,e,n)=>[t,e,"collection",n],collectionItem:(t,e,n,o,i)=>[t,e,n,"collection",o,i],collectionList:(t,e,n,o,i)=>[t,e,n,"collection",o,"list",i],collectionListInfinite:(t,e,n,o,i)=>[t,e,n,"collection",o,"list-infinite",i],githubReadme:(t,e)=>["github-readme",t,e],monitoringStats:()=>["monitoring","stats"],monitoringLogs:t=>["monitoring","logs",t],monitoringLogsInfinite:(t,e)=>["monitoring","logs-infinite",t,e],virtualMcpPrompts:t=>["virtual-mcp",t,"prompts"],connectionPrompts:t=>["connection",t,"prompts"],connectionResources:t=>["connection",t,"resources"],user:t=>["user",t]};class P extends C{constructor(e,n){super(e,n)}send(e,n){const o=S(e);return o?.type==="emit"?(this.onmessage?.(o.message),Promise.resolve()):o?.type==="suppress"?Promise.resolve():super.send(e,n)}}function S(t){const e=t;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const n=e?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"mesh-virtual-mcp",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const I={name:"mesh-sdk",version:"1.0.0"};function R(t,e){const n=e??(typeof window<"u"?window.location.origin:void 0);if(!n)throw new Error("MCP client requires either meshUrl option or a browser environment.");const o=t?`/mcp/${t}`:"/mcp";return new URL(o,n).href}async function h({connectionId:t,orgId:e,token:n,meshUrl:o}){const i=R(t,o),c=new T(I,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),r=new P(new URL(i),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream","x-org-id":e,...n?{Authorization:`Bearer ${n}`}:{}}}});await c.connect(r);const a=m.mcpClient(e,t??"self",n??"",o??"");return c.toJSON=()=>`mcp-client:${a.join(":")}`,c}function A(t){const e=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:c}=t;let r;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==i?(r=m.mcpClient(o,n??"self",i??"",c??""),e[0]=n,e[1]=c,e[2]=o,e[3]=i,e[4]=r):r=e[4];const a=r;let s;e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==i?(s=()=>h({connectionId:n,orgId:o,token:i,meshUrl:c}),e[5]=n,e[6]=c,e[7]=o,e[8]=i,e[9]=s):s=e[9];let l;e[10]!==a||e[11]!==s?(l={queryKey:a,queryFn:s,staleTime:1/0,gcTime:0},e[10]=a,e[11]=s,e[12]=l):l=e[12];const{data:p}=f(l);return p}function O(t){const e=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:c}=t;let r;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==i?(r=n!==void 0?m.mcpClient(o,n??"self",i??"",c??""):["mcp","client","skip",o],e[0]=n,e[1]=c,e[2]=o,e[3]=i,e[4]=r):r=e[4];const a=r;let s;e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==i?(s=async()=>n===void 0?null:h({connectionId:n,orgId:o,token:i,meshUrl:c}),e[5]=n,e[6]=c,e[7]=o,e[8]=i,e[9]=s):s=e[9];let l;e[10]!==a||e[11]!==s?(l={queryKey:a,queryFn:s,staleTime:1/0,gcTime:0},e[10]=a,e[11]=s,e[12]=l):l=e[12];const{data:p}=f(l);return p??null}const M={SELF:t=>`${t}_self`,REGISTRY:t=>`${t}_registry`,COMMUNITY_REGISTRY:t=>`${t}_community-registry`,DEV_ASSETS:t=>`${t}_dev-assets`},$="self";function j(t){return{id:M.REGISTRY(t),title:"Deco Store",description:"Official deco MCP registry with curated integrations",connection_type:"HTTP",connection_url:"https://api.decocms.com/mcp/registry",icon:"https://assets.decocache.com/decocms/00ccf6c3-9e13-4517-83b0-75ab84554bb9/596364c63320075ca58483660156b6d9de9b526e.png",app_name:"deco-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function z(){return{id:"community-registry",title:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",connection_type:"HTTP",connection_url:"https://sites-registry.decocache.com/mcp",icon:"https://assets.decocache.com/decocms/cd7ca472-0f72-463a-b0de-6e44bdd0f9b4/mcp.png",app_name:"mcp-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function K(t={}){return{id:t.id,title:"OpenRouter",description:"Access hundreds of LLM models from a single API",icon:"https://assets.decocache.com/decocms/b2e2f64f-6025-45f7-9e8c-3b3ebdd073d8/openrouter_logojpg.jpg",app_name:"openrouter",app_id:"openrouter",connection_type:"HTTP",connection_url:"https://sites-openrouter.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{source:"chat",verified:!1,scopeName:"deco",toolsCount:0,publishedAt:null,repository:null}}}function k(){return{title:"MCP Studio",description:"An app that allows you to create and manage MCPs",icon:"https://assets.decocache.com/mcp/09e44283-f47d-4046-955f-816d227c626f/app.png",app_name:"mcp-studio",app_id:"65a1b407-b6af-41e2-a89f-ce9450c05bbc",connection_type:"HTTP",connection_url:"https://sites-vibemcp.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!1,type:"mcp-studio"}}}function q(t){return{id:L(t),organization_id:t,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:null},connections:[]}}const u="decopilot_";function x(t){return!t||!t.startsWith(u)?null:t.slice(u.length)||null}function L(t){return`${u}${t}`}export{m as K,D as R,P as S,v as V,M as W,$ as a,z as b,h as c,q as d,k as e,K as f,L as g,j as h,x as i,O as j,A as u};
@@ -0,0 +1 @@
1
+ import{D as t,E as a}from"./index-DQipirM0.js";const e=t(a,{target:"draft-7"});export{e as B};