@decocms/mesh 2.133.2 → 2.134.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 (196) hide show
  1. package/dist/client/assets/{AlertCircle-BIVpB2eV.js → AlertCircle-dxGFeayp.js} +1 -1
  2. package/dist/client/assets/{AlignLeft-DWMdThfD.js → AlignLeft-zf4ygcA_.js} +1 -1
  3. package/dist/client/assets/{ArrowDown-CnXnoX-V.js → ArrowDown-BfANN175.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-CvCy8CyB.js → ArrowLeft-DKmEJ5pf.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-8t9O2FqG.js → ArrowUp-BNm6R5tp.js} +1 -1
  6. package/dist/client/assets/{Check-Bs28PslG.js → Check-BuBqfL8V.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-BnSsCPeL.js → CheckCircle-B-t884rD.js} +1 -1
  8. package/dist/client/assets/{CheckDone01-GZyUwk0p.js → CheckDone01-C_N43WOE.js} +1 -1
  9. package/dist/client/assets/{CheckVerified02-CmWWqvRE.js → CheckVerified02-CF--qrDr.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-CIw5H_8I.js → ChevronDown-D15Vpp0r.js} +1 -1
  11. package/dist/client/assets/{ChevronLeft-fmgWXUdB.js → ChevronLeft-CJX984rp.js} +1 -1
  12. package/dist/client/assets/{ChevronRight-8LnYcsyR.js → ChevronRight-u7jqeZNG.js} +1 -1
  13. package/dist/client/assets/{Clock-D17OAEFV.js → Clock-B88-VhpY.js} +1 -1
  14. package/dist/client/assets/{Code01-C0MNem7b.js → Code01-DhSY1b20.js} +1 -1
  15. package/dist/client/assets/{Container-C4kCziiV.js → Container-CFxptFeR.js} +1 -1
  16. package/dist/client/assets/{Copy01-Czr6qLQt.js → Copy01-D2l3XUry.js} +1 -1
  17. package/dist/client/assets/{Dataflow03-COO3w9be.js → Dataflow03-TMmWfgl9.js} +1 -1
  18. package/dist/client/assets/{DotsHorizontal-cZJVkNRf.js → DotsHorizontal-CZq86zFa.js} +1 -1
  19. package/dist/client/assets/{DotsVertical-D9CMW5-2.js → DotsVertical-B78gtBdB.js} +1 -1
  20. package/dist/client/assets/{Download01-B6ed2sYF.js → Download01-DDJLkXru.js} +1 -1
  21. package/dist/client/assets/{Edit01-DLZcWIR-.js → Edit01-CbZPkCJz.js} +1 -1
  22. package/dist/client/assets/{Eye-DPTzoZL8.js → Eye-vR70tVFn.js} +1 -1
  23. package/dist/client/assets/{File02-Cgzx7ek0.js → File02-B1NunE2J.js} +1 -1
  24. package/dist/client/assets/{File06-BzbT2v0z.js → File06-D8w_IYOr.js} +1 -1
  25. package/dist/client/assets/{FilterLines-BilIABo8.js → FilterLines-BY-bo6_s.js} +1 -1
  26. package/dist/client/assets/{Globe01-BVjXPHzv.js → Globe01-CL7GrOsx.js} +1 -1
  27. package/dist/client/assets/{Globe02-vxtQsT0f.js → Globe02-6j3SB4QZ.js} +1 -1
  28. package/dist/client/assets/{Grid01-CILFuUHo.js → Grid01-DjcW2Js4.js} +1 -1
  29. package/dist/client/assets/{Hash02-BfcBwRkC.js → Hash02-BMwtcDtI.js} +1 -1
  30. package/dist/client/assets/{Home02-rg_Tmz0p.js → Home02-CMWrNstp.js} +1 -1
  31. package/dist/client/assets/{Image01-B_6vFaZi.js → Image01-oZtE9Z5q.js} +1 -1
  32. package/dist/client/assets/{Inbox01-DNp0SuVa.js → Inbox01-xF_R8liT.js} +1 -1
  33. package/dist/client/assets/{InfoCircle-D_SeJKcX.js → InfoCircle-B_WtF_e0.js} +1 -1
  34. package/dist/client/assets/{Key01-BjbQkebS.js → Key01-Cvjt_ykt.js} +1 -1
  35. package/dist/client/assets/{LayersTwo01-BexG7k2g.js → LayersTwo01-f778oNbj.js} +1 -1
  36. package/dist/client/assets/{LayoutLeft-CN9jLsLc.js → LayoutLeft-BXJHafgx.js} +1 -1
  37. package/dist/client/assets/{LinkExternal01-DPyIyKMU.js → LinkExternal01-DY3cItdE.js} +1 -1
  38. package/dist/client/assets/{List-BcuB27Kb.js → List-Be3XBHwN.js} +1 -1
  39. package/dist/client/assets/{Loading01-W-w3cVps.js → Loading01-BLoQsWVt.js} +1 -1
  40. package/dist/client/assets/{Lock01-C37ifJ66.js → Lock01-Cj3RiFKG.js} +1 -1
  41. package/dist/client/assets/{Play-BVXIxZqO.js → Play-CCz3CWMJ.js} +1 -1
  42. package/dist/client/assets/{Plus-7RI9qITc.js → Plus-4zX3n4bH.js} +1 -1
  43. package/dist/client/assets/{RefreshCcw01-BM6X0J3F.js → RefreshCcw01-DzE0Vt_s.js} +1 -1
  44. package/dist/client/assets/{Save01-83pceB_J.js → Save01-DiUMsefH.js} +1 -1
  45. package/dist/client/assets/{SearchMd-BzFnoImC.js → SearchMd-BvHN4xgB.js} +1 -1
  46. package/dist/client/assets/{Settings01-D3dDBLbY.js → Settings01-B5kunEo2.js} +1 -1
  47. package/dist/client/assets/{Shield01-qdbJX99G.js → Shield01-DrTQ94s0.js} +1 -1
  48. package/dist/client/assets/{Terminal-DEkQfpQH.js → Terminal-DQnj9LXz.js} +1 -1
  49. package/dist/client/assets/{Trash01-BsNnpu_l.js → Trash01-BvIumE4M.js} +1 -1
  50. package/dist/client/assets/{Upload01-Jb2KX5F9.js → Upload01-DLPOqCLa.js} +1 -1
  51. package/dist/client/assets/{Users03-BY0qO7qD.js → Users03-CUxh9_Jy.js} +1 -1
  52. package/dist/client/assets/{X-B9LxUp5o.js → X-CpsrVd7E.js} +1 -1
  53. package/dist/client/assets/{XCircle-Dkkdz5ph.js → XCircle-BcvU_Xzf.js} +1 -1
  54. package/dist/client/assets/{XClose-7hYEQUhK.js → XClose-CnTCpAeI.js} +1 -1
  55. package/dist/client/assets/{Zap-iEj-0nMA.js → Zap-BACXfgKn.js} +1 -1
  56. package/dist/client/assets/{agent-connections-preview-DNcTIqVr.js → agent-connections-preview-BTescy5G.js} +1 -1
  57. package/dist/client/assets/{agent-detail-BdpmQjrg.js → agent-detail-C9_VIiuY.js} +1 -1
  58. package/dist/client/assets/{agents-kyg0nDcz.js → agents-DkUxuyJc.js} +1 -1
  59. package/dist/client/assets/{alert-dialog-DQT_qq2D.js → alert-dialog-B0yEBEkb.js} +1 -1
  60. package/dist/client/assets/{auth-catchall--SSmWnAf.js → auth-catchall-CZYx2ePL.js} +1 -1
  61. package/dist/client/assets/{avatar-CV6z8E70.js → avatar-BeiX4aSz.js} +1 -1
  62. package/dist/client/assets/{badge-DaJA40lr.js → badge-UPowR1Nj.js} +1 -1
  63. package/dist/client/assets/{binder-Bx_2YVEH.js → binder-DUACCYIe.js} +1 -1
  64. package/dist/client/assets/{breadcrumb-h53M2ozZ.js → breadcrumb-DxXcAXh7.js} +1 -1
  65. package/dist/client/assets/{card-HOT-tKY7.js → card-BRjix5ol.js} +1 -1
  66. package/dist/client/assets/{chart-BIHnGavY.js → chart-FIHtzVp6.js} +1 -1
  67. package/dist/client/assets/{checkbox-C2xwBknU.js → checkbox-Df-Mj-oX.js} +1 -1
  68. package/dist/client/assets/{circle-alert-BRVau5r5.js → circle-alert-CHATLFG-.js} +1 -1
  69. package/dist/client/assets/collapsible-CG7okAAn.js +23 -0
  70. package/dist/client/assets/{collection-detail-C8c5RTfO.js → collection-detail-DnFoqwX5.js} +1 -1
  71. package/dist/client/assets/{collection-search-DWb-q4sb.js → collection-search-BgstpGbD.js} +1 -1
  72. package/dist/client/assets/{collection-tab-CGcalnFw.js → collection-tab-CkymCS_K.js} +1 -1
  73. package/dist/client/assets/{collection-table-wrapper-LUpcpQuR.js → collection-table-wrapper-B7II4YYC.js} +1 -1
  74. package/dist/client/assets/{collection-tabs-wwfnwWzq.js → collection-tabs-nglpt7Dm.js} +1 -1
  75. package/dist/client/assets/{command-BL2WDnzB.js → command-BvChE5AN.js} +1 -1
  76. package/dist/client/assets/{connect-BA2fi6ZL.js → connect-C_zUgms_.js} +1 -1
  77. package/dist/client/assets/{connection-card-CbQYVkic.js → connection-card-DE2PfyYV.js} +1 -1
  78. package/dist/client/assets/{connection-detail-CqhIu8V8.js → connection-detail-CIlY792n.js} +1 -1
  79. package/dist/client/assets/{connections-Bqt-ueC2.js → connections-e6eEADmb.js} +1 -1
  80. package/dist/client/assets/{constants-Bj4b22ad.js → constants--aQ9HnxF.js} +1 -1
  81. package/dist/client/assets/constants-DoLvwboP.js +1 -0
  82. package/dist/client/assets/{create-organization-dialog-CHicv9TM.js → create-organization-dialog-BW4s7GqS.js} +1 -1
  83. package/dist/client/assets/{create-project-dialog-BB0XeLGb.js → create-project-dialog-BMiLf2Mr.js} +1 -1
  84. package/dist/client/assets/{danger-CYug_-FH.js → danger-BAlOLeDE.js} +1 -1
  85. package/dist/client/assets/{danger-zone-DJn-yaAs.js → danger-zone-PDtJsuS3.js} +1 -1
  86. package/dist/client/assets/{decopilot-events-CdHUYzEf.js → decopilot-events-DZodCqX1.js} +1 -1
  87. package/dist/client/assets/{dependencies-BQ4LI5wU.js → dependencies-DOcreK8_.js} +1 -1
  88. package/dist/client/assets/{dialog-DDOb23Pi.js → dialog-CrYlSCa6.js} +1 -1
  89. package/dist/client/assets/{dropdown-menu-BaaJ3KIr.js → dropdown-menu-DvfBJ25L.js} +1 -1
  90. package/dist/client/assets/{dynamic-plugin-layout-DWZ0FIFu.js → dynamic-plugin-layout-1UBvkRf8.js} +1 -1
  91. package/dist/client/assets/{editable-task-title-nQdI1V_W.js → editable-task-title-emHsd6RF.js} +1 -1
  92. package/dist/client/assets/{empty-state-cgNnxJVh.js → empty-state-C2LU6BeW.js} +1 -1
  93. package/dist/client/assets/{env-vars-editor-DIkYTN09.js → env-vars-editor-DM7ragIP.js} +1 -1
  94. package/dist/client/assets/{extract-connection-data-DSMZDJ4i.js → extract-connection-data-DtOGbK2O.js} +1 -1
  95. package/dist/client/assets/{file-browser-B5uJssDR.js → file-browser-dzB3GMud.js} +2 -2
  96. package/dist/client/assets/{form-CZlsOGpj.js → form-DKOb9Dxi.js} +1 -1
  97. package/dist/client/assets/{general-BPWx4fPN.js → general-C8KCERL-.js} +1 -1
  98. package/dist/client/assets/{grid-view-Bz5fCwwy.js → grid-view-Dp6SbR5A.js} +1 -1
  99. package/dist/client/assets/{home-DHOzeT_v.js → home-DpLONLMM.js} +1 -1
  100. package/dist/client/assets/{index-ehKjC5PZ.js → index-B4YFEuZr.js} +1 -1
  101. package/dist/client/assets/{index-BiG-bBX7.js → index-BkxNgQ-z.js} +3 -3
  102. package/dist/client/assets/{index-jbQKqjQl.js → index-Bq_4mEQF.js} +1 -1
  103. package/dist/client/assets/{index-CBDYR7h7.js → index-CKt9M-ST.js} +1 -1
  104. package/dist/client/assets/{index-CAR0mh84.js → index-CuJORTyw.js} +1 -1
  105. package/dist/client/assets/{index-mMuYpq4A.js → index-UbMd2WCz.js} +1 -1
  106. package/dist/client/assets/{index-B-s7dcGH.js → index-ZJA9ZP0w.js} +1 -1
  107. package/dist/client/assets/{index-BxikKkX5.js → index-dKQNml8k.js} +1 -1
  108. package/dist/client/assets/{index-D1gbzHrb.js → index-u5kBBr5i.js} +1 -1
  109. package/dist/client/assets/{infiniteQueryObserver-BZCRT6X1.js → infiniteQueryObserver-DFroUYRE.js} +1 -1
  110. package/dist/client/assets/{input-BcOk4EWn.js → input-BxWPl4Ur.js} +1 -1
  111. package/dist/client/assets/{integration-icon-DJplt18U.js → integration-icon-DqBJsR0X.js} +1 -1
  112. package/dist/client/assets/{label-BLk50aKt.js → label-DQ6CQRMq.js} +1 -1
  113. package/dist/client/assets/{layout-6pwn8f6O.js → layout-0mFUwCP9.js} +1 -1
  114. package/dist/client/assets/{layout-BluQBehB.js → layout-rnNZXdmD.js} +1 -1
  115. package/dist/client/assets/{localstorage-keys-BS2STbF7.js → localstorage-keys-2beZrYfY.js} +1 -1
  116. package/dist/client/assets/{login-CGh2490Y.js → login-DcPWsiJb.js} +1 -1
  117. package/dist/client/assets/{markdown-94xyd8w7.js → markdown-08iefd1w.js} +1 -1
  118. package/dist/client/assets/{mcp-app-renderer-CPkL4-A0.js → mcp-app-renderer-DlqJcoS_.js} +1 -1
  119. package/dist/client/assets/{mcp-oauth-DhVZXZzz.js → mcp-oauth-hrdldmcp.js} +1 -1
  120. package/dist/client/assets/{mcp-server-card-Csi3P08i.js → mcp-server-card-DopVvusq.js} +1 -1
  121. package/dist/client/assets/{mcp-server-detail-DPle4t4_.js → mcp-server-detail-6bJ8ASSa.js} +2 -2
  122. package/dist/client/assets/{members-DdERnJEy.js → members-Do6CpQ6P.js} +1 -1
  123. package/dist/client/assets/{monitoring-DljoOm7H.js → monitoring-CKBrV8zM.js} +1 -1
  124. package/dist/client/assets/{monitoring-dashboard-edit-CA-n4NwW.js → monitoring-dashboard-edit-CisDX-AH.js} +1 -1
  125. package/dist/client/assets/{monitoring-dashboard-view-CA9jMLxL.js → monitoring-dashboard-view-CLglwuRf.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-BeMNWxMx.js → oauth-callback-EWqhoS77.js} +1 -1
  127. package/dist/client/assets/{page-Dd_JJkvy.js → page-BIGqii57.js} +1 -1
  128. package/dist/client/assets/{page-B-g-Vlk_.js → page-CrIdFE4e.js} +1 -1
  129. package/dist/client/assets/{plugin-empty-state-C3IVEK8r.js → plugin-empty-state-AsJFZqlq.js} +1 -1
  130. package/dist/client/assets/{plugin-empty-state-Beu1zYui.js → plugin-empty-state-DgfbXovL.js} +1 -1
  131. package/dist/client/assets/{plugin-header-K9IDC0OG.js → plugin-header-CdB0sXQc.js} +1 -1
  132. package/dist/client/assets/{plugin-header-B0VvIolY.js → plugin-header-DMTu3kKy.js} +1 -1
  133. package/dist/client/assets/plugins-AJrV2JnY.js +1 -0
  134. package/dist/client/assets/{popover-Cnhlur36.js → popover-CJnKtmVV.js} +1 -1
  135. package/dist/client/assets/{project-app-view-DdjQoakQ.js → project-app-view-CrOJlRSX.js} +1 -1
  136. package/dist/client/assets/{project-layout-COuxbNbP.js → project-layout-CxbfzuHT.js} +1 -1
  137. package/dist/client/assets/{project-plugins-DlaP9lSP.js → project-plugins-OrxVzBYc.js} +1 -1
  138. package/dist/client/assets/{projects-list-Cjk5rvoU.js → projects-list-CaeO-dsb.js} +1 -1
  139. package/dist/client/assets/purify.es-C0_7NiBM.js +2 -0
  140. package/dist/client/assets/{readme-viewer-D1PTXNQQ.js → readme-viewer-CvFtkeFt.js} +1 -1
  141. package/dist/client/assets/{registry-layout-C_3CFS9T.js → registry-layout-C_lUsUO4.js} +1 -1
  142. package/dist/client/assets/{registry-utils-B4prNmYa.js → registry-utils-Bm8aYhvn.js} +1 -1
  143. package/dist/client/assets/{reports-layout-BTeFiemL.js → reports-layout-COQgk5-M.js} +1 -1
  144. package/dist/client/assets/{reset-password-BOnVZBj0.js → reset-password-BHTKtR6U.js} +1 -1
  145. package/dist/client/assets/{resizable-BC2aG7ea.js → resizable-DNctE6m6.js} +1 -1
  146. package/dist/client/assets/{save-actions-p2U4N3h5.js → save-actions-DgW9lLRI.js} +1 -1
  147. package/dist/client/assets/{scroll-area-CrSif9aa.js → scroll-area-Ce3JzMbc.js} +1 -1
  148. package/dist/client/assets/{select-DJV0GpEL.js → select-CHQkyynJ.js} +1 -1
  149. package/dist/client/assets/{shell-layout-DkJCvYuh.js → shell-layout-CZrDFZIJ.js} +2 -2
  150. package/dist/client/assets/{sidebar-settings-C9nkZoUb.js → sidebar-settings-C8pM5SP-.js} +1 -1
  151. package/dist/client/assets/{skeleton-DhcP44Ov.js → skeleton-Bla1LCSZ.js} +1 -1
  152. package/dist/client/assets/{spinner-DSMOMT7g.js → spinner-B_k6AtHn.js} +1 -1
  153. package/dist/client/assets/{store-invite-CrF5fKpc.js → store-invite-CVXBjHsb.js} +1 -1
  154. package/dist/client/assets/{switch-CR-VYNUs.js → switch-BX7m8ylT.js} +1 -1
  155. package/dist/client/assets/{table-DxvlU5EN.js → table-BJ3W5Geb.js} +1 -1
  156. package/dist/client/assets/{tabs-C-5F-MJ5.js → tabs-tcquyh90.js} +1 -1
  157. package/dist/client/assets/tasks-CJro_3w3.js +1 -0
  158. package/dist/client/assets/{tasks-panel-CmBpoAsV.js → tasks-panel-CIityBOn.js} +1 -1
  159. package/dist/client/assets/{textarea-Bkod2qAV.js → textarea-CceQB-N2.js} +1 -1
  160. package/dist/client/assets/{time-range-picker-CygOsj38.js → time-range-picker-B9lHM6xz.js} +1 -1
  161. package/dist/client/assets/{toggle-group-CwfkuVwg.js → toggle-group-KbsXFu3M.js} +1 -1
  162. package/dist/client/assets/{tools-list-CmIBKUpX.js → tools-list-Cb9H3DsC.js} +1 -1
  163. package/dist/client/assets/{tooltip-BacoSwd7.js → tooltip-DvMRS01W.js} +1 -1
  164. package/dist/client/assets/{topbar-portal-Dfkwqxry.js → topbar-portal-CyxFPAeb.js} +1 -1
  165. package/dist/client/assets/{types-C6Uddd8z.js → types-9lUbCnT7.js} +1 -1
  166. package/dist/client/assets/{use-binding-CoVeLP6R.js → use-binding-CVLYzFG-.js} +1 -1
  167. package/dist/client/assets/{use-connection-CsobI-JA.js → use-connection-DjiXkPUz.js} +1 -1
  168. package/dist/client/assets/{use-copy-De63ENVh.js → use-copy-DiVO6tbG.js} +1 -1
  169. package/dist/client/assets/{use-create-virtual-mcp-52zuHZ4A.js → use-create-virtual-mcp-DnOGpm5h.js} +1 -1
  170. package/dist/client/assets/{use-install-from-registry-BUdVd5Au.js → use-install-from-registry-kgqBLGhb.js} +1 -1
  171. package/dist/client/assets/{use-list-state-DZ0uTI_k.js → use-list-state-CCFlT7yz.js} +1 -1
  172. package/dist/client/assets/{use-llm-DTbAtUds.js → use-llm-Bkjj502R.js} +1 -1
  173. package/dist/client/assets/{use-mcp-resources-ucs4znYI.js → use-mcp-resources-DS8p1Owh.js} +1 -1
  174. package/dist/client/assets/{use-mcp-tools-nHTt7uoJ.js → use-mcp-tools-CHOGR3no.js} +1 -1
  175. package/dist/client/assets/{use-members-C4nvWeOW.js → use-members-94lmhn12.js} +1 -1
  176. package/dist/client/assets/{use-mobile-BwubTGYW.js → use-mobile-BArkW6j1.js} +1 -1
  177. package/dist/client/assets/{use-project-BVlUC7fM.js → use-project-BRlk9_cU.js} +1 -1
  178. package/dist/client/assets/{use-settings-modal-BivXkS-c.js → use-settings-modal-QjZt77PI.js} +1 -1
  179. package/dist/client/assets/{use-view-mode-RJVvlb7k.js → use-view-mode-3_G2qIMG.js} +1 -1
  180. package/dist/client/assets/{use-virtual-mcp-r6ou4ewu.js → use-virtual-mcp-Wj5StsuR.js} +1 -1
  181. package/dist/client/assets/useInfiniteQuery-cPtxg-KP.js +1 -0
  182. package/dist/client/assets/{useMutation-Cxle_Mtw.js → useMutation-DtOoZO7h.js} +1 -1
  183. package/dist/client/assets/useQuery-Cj-miqA2.js +1 -0
  184. package/dist/client/assets/useSuspenseInfiniteQuery-D62VIKAF.js +1 -0
  185. package/dist/client/assets/{user-DiQL4i6w.js → user-BcEL6pjj.js} +1 -1
  186. package/dist/client/assets/{workflow-CY-tfdwy.js → workflow-Bdyylvch.js} +1 -1
  187. package/dist/client/index.html +1 -1
  188. package/package.json +1 -1
  189. package/dist/client/assets/collapsible-DRIF4wXT.js +0 -23
  190. package/dist/client/assets/constants-DTlOAYW2.js +0 -1
  191. package/dist/client/assets/plugins-Cw7F1EwF.js +0 -1
  192. package/dist/client/assets/purify.es-Bzr520pe.js +0 -2
  193. package/dist/client/assets/tasks-KFAnwTNo.js +0 -1
  194. package/dist/client/assets/useInfiniteQuery-BZXsD1Nv.js +0 -1
  195. package/dist/client/assets/useQuery-Us1whSan.js +0 -1
  196. package/dist/client/assets/useSuspenseInfiniteQuery-DcGj9DQ4.js +0 -1
@@ -1 +1 @@
1
- import{c as be,j as e,E as Fe,r as X,u as Be,n as Ue,b as He,a as Le,d as Me,aB as ze,l as Re,k as Xe,i as We,B as S,O as g,t as D,o as ke,aF as Ke,s as C,aG as Ge}from"./index-BiG-bBX7.js";import{g as qe}from"./generate-id-Dyweu44Y.js";import{C as Qe,a as Je}from"./collection-table-wrapper-LUpcpQuR.js";import{C as Ye,E as L}from"./collection-search-DWb-q4sb.js";import{C as Ze}from"./connection-card-CbQYVkic.js";import{B as M}from"./badge-DaJA40lr.js";import{i as et}from"./AlertCircle-BIVpB2eV.js";import{i as tt}from"./CheckCircle-BnSsCPeL.js";import{I as nt}from"./integration-icon-DJplt18U.js";import{P as E}from"./index-ehKjC5PZ.js";import{U as re}from"./user-DiQL4i6w.js";import{u as st}from"./use-binding-CoVeLP6R.js";import{u as ot}from"./use-list-state-DZ0uTI_k.js";import{f as rt,e as it}from"./registry-utils-B4prNmYa.js";import{f as ie,a as ae,b as ce,c as le,d as de,e as me,A as ue,h as pe}from"./alert-dialog-DQT_qq2D.js";import{B as at,a as ct,b as lt,c as dt}from"./breadcrumb-h53M2ozZ.js";import{D as mt,a as ut,b as pt,c as xt,d as ht,e as gt}from"./dialog-DDOb23Pi.js";import{D as xe,a as he,b as ge,c as F}from"./dropdown-menu-BaaJ3KIr.js";import{a as ft,F as f,b as j,c as y,d as v,f as _}from"./form-CZlsOGpj.js";import{I as T}from"./input-BcOk4EWn.js";import{S as jt,a as yt,b as vt,c as _t,d as $}from"./select-DJV0GpEL.js";import{T as Ct}from"./textarea-Bkod2qAV.js";import{g as Nt,h as bt}from"./use-connection-CsobI-JA.js";import{u as fe,a as kt}from"./constants-Bj4b22ad.js";import{b as wt}from"./use-mcp-tools-nHTt7uoJ.js";import{n as z}from"./Container-C4kCziiV.js";import{i as je}from"./DotsVertical-D9CMW5-2.js";import{s as ye}from"./Eye-DPTzoZL8.js";import{s as R}from"./Globe02-vxtQsT0f.js";import{i as St}from"./Loading01-W-w3cVps.js";import{i as Tt}from"./Terminal-DEkQfpQH.js";import{s as ve}from"./Trash01-BsNnpu_l.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-DIkYTN09.js";import"./ArrowDown-CnXnoX-V.js";import"./ArrowUp-8t9O2FqG.js";import"./Check-Bs28PslG.js";import"./Grid01-CILFuUHo.js";import"./List-BcuB27Kb.js";import"./tooltip-BacoSwd7.js";import"./index-BxikKkX5.js";import"./table-DxvlU5EN.js";import"./SearchMd-BzFnoImC.js";import"./card-HOT-tKY7.js";import"./localstorage-keys-BS2STbF7.js";import"./useQuery-Us1whSan.js";import"./useMutation-Cxle_Mtw.js";import"./avatar-CV6z8E70.js";import"./binder-Bx_2YVEH.js";import"./use-view-mode-RJVvlb7k.js";import"./use-mobile-BwubTGYW.js";import"./ChevronRight-8LnYcsyR.js";import"./X-B9LxUp5o.js";import"./label-BLk50aKt.js";import"./ChevronDown-CIw5H_8I.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./Plus-7RI9qITc.js";function Ce(s){const o=be.c(3),{status:i}=s;if(i==="active"){let c;return o[0]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(M,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[e.jsx(tt,{size:12}),"Active"]}),o[0]=c):c=o[0],c}if(i==="error"){let c;return o[1]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(M,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[e.jsx(et,{size:12}),"Error"]}),o[1]=c):c=o[1],c}let d;return o[2]===Symbol.for("react.memo_cache_sentinel")?(d=e.jsx(M,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),o[2]=d):d=o[2],d}const It=ke({key:C(),value:C()}),Et=ke({title:C().min(1,"Name is required"),description:C().nullable().optional(),ui_type:Ge(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:C().optional(),connection_token:C().nullable().optional(),npx_package:C().optional(),stdio_command:C().optional(),stdio_args:C().optional(),stdio_cwd:C().optional(),env_vars:Ke(It).optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function U(s){const o=s.trim();if(!o)return"";try{const i=new URL(o),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return o.replace(/\/+$/,"")}}function $t(s){const o=s.trim().split(/\s+/).filter(Boolean);if(o.length<2)return null;const i=o[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const c=o.slice(1).find(N=>!N.startsWith("-"));return c?{packageName:c}:null}function B(s){const{uiType:o}=s,i=U(s.connectionUrl??"");if((o==="HTTP"||o==="SSE"||o==="Websocket")&&i===U("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const d=(s.npxPackage??"").trim();return o==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function Ne(s){if(s.registryItems.length===0||s.uiType!=="HTTP"&&s.uiType!=="SSE"&&s.uiType!=="Websocket")return null;const o=U(s.connectionUrl??"");if(!o)return null;const i=s.registryItems.find(N=>(N.server?.remotes??[]).some(O=>U(O.url??"")===o));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",c=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:c}:null}function Ot(s,o){const i={command:"npx",args:["-y",s]},d=we(o);return Object.keys(d).length>0&&(i.envVars=d),i}function At(s,o,i,d){const c={command:s};o.trim()&&(c.args=o.trim().split(/\s+/)),i?.trim()&&(c.cwd=i.trim());const N=we(d);return Object.keys(N).length>0&&(c.envVars=N),c}function Vt(s){return s.command==="npx"}function Ft(s){return s.args?.find(o=>!o.startsWith("-"))??""}function Bt(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Ut(s,o){switch(o.type){case"edit":return{mode:"editing",connection:o.connection};case"delete":return{mode:"deleting",connection:o.connection};case"force-delete":return{mode:"force-deleting",connection:o.connection,agentNames:o.agentNames};case"close":return{mode:"idle"}}}function Ht(){const{org:s}=Be(),o=Ue(),i=He(),d=Le({strict:!1}),{data:c}=Me.useSession(),{stdioEnabled:N}=ze(),l=ot({namespace:s.slug,resource:"connections"}),O=Nt(),A=bt(l),[u,b]=X.useReducer(Ut,{mode:"idle"}),W=st(A)[0],K=W?.id??"",G=rt(W?.tools),Se=fe({connectionId:K||null,orgId:s.id}),{data:Te}=wt({client:Se,toolName:G,toolArguments:{limit:200},enabled:!!(K&&G),staleTime:3600*1e3,select:t=>t.structuredContent??t}),q=it(Te??[]),Q=d.action==="create",De=()=>{i({to:"/$org/$project/mcps",params:{org:s.slug,project:g},search:{action:"create"}})},J=()=>{i({to:"/$org/$project/mcps",params:{org:s.slug,project:g},search:{}})},r=Re({resolver:Xe(Et),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),p=r.watch("ui_type"),Y=r.watch("connection_url"),Pe=r.watch("npx_package"),P=B({uiType:p,connectionUrl:Y??"",npxPackage:Pe??""})??Ne({uiType:p,connectionUrl:Y??"",registryItems:q}),m=u.mode==="editing"?u.connection:null;X.useEffect(()=>{if(m){const t=We(m.connection_headers)?m.connection_headers:null;if(t&&m.connection_type==="STDIO"){const n=Dt(t.envVars);if(Vt(t)){const a=Ft(t);r.reset({title:m.title,description:m.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:n})}else{const a=Bt(t);r.reset({title:m.title,description:m.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:n})}}else r.reset({title:m.title,description:m.description,ui_type:m.connection_type,connection_url:m.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[m,r]);const Z=fe({connectionId:kt,orgId:s.id}),ee=()=>{o.invalidateQueries({predicate:t=>{const n=t.queryKey;return n[1]===s.id&&n[3]==="collection"&&n[4]==="CONNECTIONS"}})},te=t=>{const n=t.content;return Array.isArray(n)&&n[0]?.type==="text"&&typeof n[0].text=="string"?n[0].text:"Unknown error"},Ie=async()=>{if(u.mode!=="deleting")return;const t=u.connection;b({type:"close"});try{const n=await Z.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:t.id}});if(n.isError){const a=te(n),k=a.replace(/^Error:\s*/,"");try{const x=JSON.parse(k);if(x.code==="CONNECTION_IN_USE"&&x.agentNames){b({type:"force-delete",connection:t,agentNames:x.agentNames.map(w=>`"${w}"`).join(", ")});return}}catch{}D.error(`Failed to delete connection: ${a}`);return}ee(),D.success("Connection deleted successfully")}catch(n){const a=n instanceof Error?n.message:String(n);D.error(`Failed to delete connection: ${a}`)}},Ee=async()=>{if(u.mode!=="force-deleting")return;const t=u.connection.id;b({type:"close"});try{const n=await Z.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:t,force:!0}});if(n.isError){D.error(`Failed to delete connection: ${te(n)}`);return}ee(),D.success("Connection deleted successfully")}catch(n){const a=n instanceof Error?n.message:String(n);D.error(`Failed to delete connection: ${a}`)}},$e=async t=>{let n,a=null,k=null,x=null;if(t.ui_type==="NPX"?(n="STDIO",a="",x=Ot(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(n="STDIO",a="",x=At(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(n=t.ui_type,a=t.connection_url||"",k=t.connection_token||null),m){await O.update.mutateAsync({id:m.id,data:{title:t.title,description:t.description||null,connection_type:n,connection_url:a,...k&&{connection_token:k},...x&&{connection_headers:x}}}),b({type:"close"}),r.reset();return}const w=qe("conn");await O.create.mutateAsync({id:w,title:t.title,description:t.description||null,connection_type:n,connection_url:a,connection_token:k,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:c?.user?.id||"system",organization_id:s.id,icon:null,app_name:null,app_id:null,connection_headers:x,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),J(),r.reset(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:w}})},ne=t=>{t||(Q?J():b({type:"close"}),r.reset())},V=t=>{const n=t.trim();if(!n)return;const a=!!r.formState.dirtyFields.title,k=!!r.formState.dirtyFields.description,x=!!r.formState.dirtyFields.env_vars,w=h=>{if(h&&(!a&&!r.getValues("title").trim()&&h.title&&r.setValue("title",h.title,{shouldDirty:!1}),!k&&!(r.getValues("description")??"").trim()&&h.description&&r.setValue("description",h.description,{shouldDirty:!1}),!x&&h.envVarKeys?.length)){const se=r.getValues("env_vars")??[],Ve=new Set(se.map(I=>I.key)),oe=h.envVarKeys.filter(I=>!Ve.has(I));oe.length>0&&r.setValue("env_vars",[...se,...oe.map(I=>({key:I,value:""}))],{shouldDirty:!0})}},H=$t(n);if(H&&N){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",H.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),w(B({uiType:"NPX",npxPackage:H.packageName}));return}if(n.startsWith("http://")||n.startsWith("https://")){const h=p==="HTTP"||p==="SSE"||p==="Websocket"?p:"HTTP";r.setValue("ui_type",h,{shouldDirty:!0}),r.setValue("connection_url",n,{shouldDirty:!0}),w(B({uiType:h,connectionUrl:n})??Ne({uiType:h,connectionUrl:n,registryItems:q}));return}p==="NPX"&&w(B({uiType:"NPX",npxPackage:n}))},Oe=[{id:"title",header:"Name",render:t=>e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(nt,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(z,{})}),e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title})]}),cellClassName:"w-32 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-muted-foreground truncate block",title:t.description||"",children:t.description||"—"}),cellClassName:"flex-1 min-w-0 max-w-0",wrap:!1,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-xs font-medium",children:t.connection_type}),cellClassName:"w-16 shrink-0",sortable:!0},{id:"status",header:"Status",render:t=>e.jsx(Ce,{status:t.status}),cellClassName:"w-28 shrink-0",sortable:!1},{id:"updated_by",header:"Updated by",render:t=>e.jsx(re,{id:t.updated_by??t.created_by,size:"3xs"}),cellClassName:"w-32 shrink-0",sortable:!0},{id:"updated_at",header:"Updated",render:t=>e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:t.updated_at?_e(new Date(t.updated_at)):"—"}),cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(xe,{children:[e.jsx(he,{asChild:!0,children:e.jsx(S,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:n=>n.stopPropagation(),children:e.jsx(je,{size:20})})}),e.jsxs(ge,{align:"end",onClick:n=>n.stopPropagation(),children:[e.jsxs(F,{onClick:n=>{n.stopPropagation(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}})},children:[e.jsx(ye,{size:16}),"Open"]}),e.jsxs(F,{variant:"destructive",onClick:n=>{n.stopPropagation(),b({type:"delete",connection:t})},children:[e.jsx(ve,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],Ae=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:g}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(S,{onClick:De,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(E,{children:[e.jsx(mt,{open:Q||u.mode==="editing",onOpenChange:ne,children:e.jsxs(ut,{className:"sm:max-w-[525px]",children:[e.jsxs(pt,{children:[e.jsx(xt,{children:m?"Edit Connection":"Create Connection"}),e.jsx(ht,{children:m?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(ft,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit($e),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(f,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Type *"}),e.jsxs(jt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(v,{children:e.jsx(yt,{children:e.jsx(vt,{})})}),e.jsxs(_t,{children:[e.jsx($,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx($,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"SSE"]})}),e.jsx($,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"Websocket"]})}),N&&e.jsxs(e.Fragment,{children:[e.jsx($,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx($,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Tt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(_,{})]})}),p==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(f,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"NPM Package *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:n=>{const a=n.clipboardData.getData("text");a&&(n.preventDefault(),r.setValue("npx_package",a.trim(),{shouldDirty:!0}),V(a))},onBlur:n=>{V(n.target.value),t.onBlur()}})}),e.jsx(_,{})]})})}),p==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(f,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Command *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(_,{})]})}),e.jsx(f,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Arguments"}),e.jsx(v,{children:e.jsx(T,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(_,{})]})})]}),e.jsx(f,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Working Directory"}),e.jsx(v,{children:e.jsx(T,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(_,{})]})})]}),(p==="NPX"||p==="STDIO")&&e.jsx(f,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Environment Variables"}),e.jsx(v,{children:e.jsx(Pt,{value:t.value??[],onChange:t.onChange})}),e.jsx(_,{})]})}),p!=="NPX"&&p!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(f,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"URL *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:n=>{const a=n.clipboardData.getData("text");a&&(n.preventDefault(),r.setValue("connection_url",a.trim(),{shouldDirty:!0}),V(a))},onBlur:n=>{V(n.target.value),t.onBlur()}})}),e.jsx(_,{})]})}),e.jsx(f,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:P?.token?.label??"Token (optional)"}),e.jsx(v,{children:e.jsx(T,{type:"password",placeholder:P?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),P?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.token.helperText,P.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(_,{})]})})]}),e.jsx(f,{control:r.control,name:"title",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Name *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"My Connection",...t})}),e.jsx(_,{})]})}),e.jsx(f,{control:r.control,name:"description",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Description"}),e.jsx(v,{children:e.jsx(Ct,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(_,{})]})})]}),e.jsxs(gt,{children:[e.jsx(S,{type:"button",variant:"outline",onClick:()=>ne(!1),children:"Cancel"}),e.jsx(S,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":m?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(ie,{open:u.mode==="deleting",onOpenChange:t=>!t&&b({type:"close"}),children:e.jsxs(ae,{children:[e.jsxs(ce,{children:[e.jsx(le,{children:"Delete Connection?"}),e.jsxs(de,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="deleting"&&u.connection.title}),"."]})]}),e.jsxs(me,{children:[e.jsx(ue,{children:"Cancel"}),e.jsx(pe,{onClick:Ie,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(ie,{open:u.mode==="force-deleting",onOpenChange:t=>!t&&b({type:"close"}),children:e.jsxs(ae,{children:[e.jsxs(ce,{children:[e.jsx(le,{children:"Connection Used by Agents"}),e.jsx(de,{asChild:!0,children:e.jsxs("div",{children:[e.jsxs("p",{children:["The connection"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="force-deleting"&&u.connection.title})," ","is currently used by the following agent(s):"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="force-deleting"&&u.agentNames}),"."]}),e.jsx("p",{className:"mt-2",children:"Deleting this connection will remove it from those agents, which may impact existing workflows that depend on them."})]})})]}),e.jsxs(me,{children:[e.jsx(ue,{children:"Cancel"}),e.jsx(pe,{onClick:Ee,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]})]})}),e.jsxs(E.Header,{children:[e.jsx(E.Header.Left,{children:e.jsx(at,{children:e.jsx(ct,{children:e.jsx(lt,{children:e.jsx(dt,{children:"Connections"})})})})}),e.jsxs(E.Header.Right,{children:[e.jsx(Qe,{viewMode:l.viewMode,onViewModeChange:l.setViewMode,sortKey:l.sortKey,sortDirection:l.sortDirection,onSort:l.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}]}),Ae]})]}),e.jsx(Ye,{value:l.search,onChange:l.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(l.setSearch(""),t.target.blur())}}),e.jsx(E.Content,{children:l.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:A.length===0?e.jsx(L,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(l.search,"No Connections found"),description:l.search?`No Connections match "${l.search}"`:"Create a connection to get started.",actions:!l.search&&e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:g}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:A.map(t=>e.jsx(Ze,{connection:t,fallbackIcon:e.jsx(z,{}),onClick:()=>i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}}),headerActions:e.jsxs(xe,{children:[e.jsx(he,{asChild:!0,children:e.jsx(S,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:n=>n.stopPropagation(),children:e.jsx(je,{size:20})})}),e.jsxs(ge,{align:"end",onClick:n=>n.stopPropagation(),children:[e.jsxs(F,{onClick:n=>{n.stopPropagation(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}})},children:[e.jsx(ye,{size:16}),"Open"]}),e.jsxs(F,{variant:"destructive",onClick:n=>{n.stopPropagation(),b({type:"delete",connection:t})},children:[e.jsx(ve,{size:16}),"Delete"]})]})]}),body:e.jsx(Ce,{status:t.status}),footer:e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(re,{id:t.updated_by??t.created_by,size:"3xs"})}),e.jsx("span",{className:"shrink-0 ml-2",children:t.updated_at?_e(new Date(t.updated_at)):"—"})]})},t.id))})}):e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:e.jsx("div",{className:"min-w-[1000px]",children:e.jsx(Je,{columns:Oe,data:A,isLoading:!1,sortKey:l.sortKey,sortDirection:l.sortDirection,onSort:l.handleSort,onRowClick:t=>i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}}),emptyState:l.search?e.jsx(L,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${l.search}"`}):e.jsx(L,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:g}}),children:"Browse Store"})})})})})})})]})}function Xn(){const s=be.c(1);let o;return s[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(Fe,{children:e.jsx(X.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(St,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Ht,{})})}),s[0]=o):o=s[0],o}export{Xn as default};
1
+ import{c as be,j as e,E as Fe,r as X,u as Be,n as Ue,b as He,a as Le,d as Me,aB as ze,l as Re,k as Xe,i as We,B as S,O as g,t as D,o as ke,aF as Ke,s as C,aG as Ge}from"./index-BkxNgQ-z.js";import{g as qe}from"./generate-id-Dyweu44Y.js";import{C as Qe,a as Je}from"./collection-table-wrapper-B7II4YYC.js";import{C as Ye,E as L}from"./collection-search-BgstpGbD.js";import{C as Ze}from"./connection-card-DE2PfyYV.js";import{B as M}from"./badge-UPowR1Nj.js";import{i as et}from"./AlertCircle-dxGFeayp.js";import{i as tt}from"./CheckCircle-B-t884rD.js";import{I as nt}from"./integration-icon-DqBJsR0X.js";import{P as E}from"./index-B4YFEuZr.js";import{U as re}from"./user-BcEL6pjj.js";import{u as st}from"./use-binding-CVLYzFG-.js";import{u as ot}from"./use-list-state-CCFlT7yz.js";import{f as rt,e as it}from"./registry-utils-Bm8aYhvn.js";import{f as ie,a as ae,b as ce,c as le,d as de,e as me,A as ue,h as pe}from"./alert-dialog-B0yEBEkb.js";import{B as at,a as ct,b as lt,c as dt}from"./breadcrumb-DxXcAXh7.js";import{D as mt,a as ut,b as pt,c as xt,d as ht,e as gt}from"./dialog-CrYlSCa6.js";import{D as xe,a as he,b as ge,c as F}from"./dropdown-menu-DvfBJ25L.js";import{a as ft,F as f,b as j,c as y,d as v,f as _}from"./form-DKOb9Dxi.js";import{I as T}from"./input-BxWPl4Ur.js";import{S as jt,a as yt,b as vt,c as _t,d as $}from"./select-CHQkyynJ.js";import{T as Ct}from"./textarea-CceQB-N2.js";import{g as Nt,h as bt}from"./use-connection-DjiXkPUz.js";import{u as fe,a as kt}from"./constants--aQ9HnxF.js";import{b as wt}from"./use-mcp-tools-CHOGR3no.js";import{n as z}from"./Container-CFxptFeR.js";import{i as je}from"./DotsVertical-B78gtBdB.js";import{s as ye}from"./Eye-vR70tVFn.js";import{s as R}from"./Globe02-6j3SB4QZ.js";import{i as St}from"./Loading01-BLoQsWVt.js";import{i as Tt}from"./Terminal-DQnj9LXz.js";import{s as ve}from"./Trash01-BvIumE4M.js";import{f as _e}from"./format-time-CMKyl-GC.js";import{r as Dt,E as Pt,e as we}from"./env-vars-editor-DM7ragIP.js";import"./ArrowDown-BfANN175.js";import"./ArrowUp-BNm6R5tp.js";import"./Check-BuBqfL8V.js";import"./Grid01-DjcW2Js4.js";import"./List-Be3XBHwN.js";import"./tooltip-DvMRS01W.js";import"./index-dKQNml8k.js";import"./table-BJ3W5Geb.js";import"./SearchMd-BvHN4xgB.js";import"./card-BRjix5ol.js";import"./localstorage-keys-2beZrYfY.js";import"./useQuery-Cj-miqA2.js";import"./useMutation-DtOoZO7h.js";import"./avatar-BeiX4aSz.js";import"./binder-DUACCYIe.js";import"./use-view-mode-3_G2qIMG.js";import"./use-mobile-BArkW6j1.js";import"./ChevronRight-u7jqeZNG.js";import"./X-CpsrVd7E.js";import"./label-DQ6CQRMq.js";import"./ChevronDown-D15Vpp0r.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./Plus-4zX3n4bH.js";function Ce(s){const o=be.c(3),{status:i}=s;if(i==="active"){let c;return o[0]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(M,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[e.jsx(tt,{size:12}),"Active"]}),o[0]=c):c=o[0],c}if(i==="error"){let c;return o[1]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(M,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[e.jsx(et,{size:12}),"Error"]}),o[1]=c):c=o[1],c}let d;return o[2]===Symbol.for("react.memo_cache_sentinel")?(d=e.jsx(M,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),o[2]=d):d=o[2],d}const It=ke({key:C(),value:C()}),Et=ke({title:C().min(1,"Name is required"),description:C().nullable().optional(),ui_type:Ge(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:C().optional(),connection_token:C().nullable().optional(),npx_package:C().optional(),stdio_command:C().optional(),stdio_args:C().optional(),stdio_cwd:C().optional(),env_vars:Ke(It).optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function U(s){const o=s.trim();if(!o)return"";try{const i=new URL(o),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return o.replace(/\/+$/,"")}}function $t(s){const o=s.trim().split(/\s+/).filter(Boolean);if(o.length<2)return null;const i=o[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const c=o.slice(1).find(N=>!N.startsWith("-"));return c?{packageName:c}:null}function B(s){const{uiType:o}=s,i=U(s.connectionUrl??"");if((o==="HTTP"||o==="SSE"||o==="Websocket")&&i===U("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const d=(s.npxPackage??"").trim();return o==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function Ne(s){if(s.registryItems.length===0||s.uiType!=="HTTP"&&s.uiType!=="SSE"&&s.uiType!=="Websocket")return null;const o=U(s.connectionUrl??"");if(!o)return null;const i=s.registryItems.find(N=>(N.server?.remotes??[]).some(O=>U(O.url??"")===o));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",c=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:c}:null}function Ot(s,o){const i={command:"npx",args:["-y",s]},d=we(o);return Object.keys(d).length>0&&(i.envVars=d),i}function At(s,o,i,d){const c={command:s};o.trim()&&(c.args=o.trim().split(/\s+/)),i?.trim()&&(c.cwd=i.trim());const N=we(d);return Object.keys(N).length>0&&(c.envVars=N),c}function Vt(s){return s.command==="npx"}function Ft(s){return s.args?.find(o=>!o.startsWith("-"))??""}function Bt(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Ut(s,o){switch(o.type){case"edit":return{mode:"editing",connection:o.connection};case"delete":return{mode:"deleting",connection:o.connection};case"force-delete":return{mode:"force-deleting",connection:o.connection,agentNames:o.agentNames};case"close":return{mode:"idle"}}}function Ht(){const{org:s}=Be(),o=Ue(),i=He(),d=Le({strict:!1}),{data:c}=Me.useSession(),{stdioEnabled:N}=ze(),l=ot({namespace:s.slug,resource:"connections"}),O=Nt(),A=bt(l),[u,b]=X.useReducer(Ut,{mode:"idle"}),W=st(A)[0],K=W?.id??"",G=rt(W?.tools),Se=fe({connectionId:K||null,orgId:s.id}),{data:Te}=wt({client:Se,toolName:G,toolArguments:{limit:200},enabled:!!(K&&G),staleTime:3600*1e3,select:t=>t.structuredContent??t}),q=it(Te??[]),Q=d.action==="create",De=()=>{i({to:"/$org/$project/mcps",params:{org:s.slug,project:g},search:{action:"create"}})},J=()=>{i({to:"/$org/$project/mcps",params:{org:s.slug,project:g},search:{}})},r=Re({resolver:Xe(Et),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),p=r.watch("ui_type"),Y=r.watch("connection_url"),Pe=r.watch("npx_package"),P=B({uiType:p,connectionUrl:Y??"",npxPackage:Pe??""})??Ne({uiType:p,connectionUrl:Y??"",registryItems:q}),m=u.mode==="editing"?u.connection:null;X.useEffect(()=>{if(m){const t=We(m.connection_headers)?m.connection_headers:null;if(t&&m.connection_type==="STDIO"){const n=Dt(t.envVars);if(Vt(t)){const a=Ft(t);r.reset({title:m.title,description:m.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:n})}else{const a=Bt(t);r.reset({title:m.title,description:m.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:n})}}else r.reset({title:m.title,description:m.description,ui_type:m.connection_type,connection_url:m.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[m,r]);const Z=fe({connectionId:kt,orgId:s.id}),ee=()=>{o.invalidateQueries({predicate:t=>{const n=t.queryKey;return n[1]===s.id&&n[3]==="collection"&&n[4]==="CONNECTIONS"}})},te=t=>{const n=t.content;return Array.isArray(n)&&n[0]?.type==="text"&&typeof n[0].text=="string"?n[0].text:"Unknown error"},Ie=async()=>{if(u.mode!=="deleting")return;const t=u.connection;b({type:"close"});try{const n=await Z.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:t.id}});if(n.isError){const a=te(n),k=a.replace(/^Error:\s*/,"");try{const x=JSON.parse(k);if(x.code==="CONNECTION_IN_USE"&&x.agentNames){b({type:"force-delete",connection:t,agentNames:x.agentNames.map(w=>`"${w}"`).join(", ")});return}}catch{}D.error(`Failed to delete connection: ${a}`);return}ee(),D.success("Connection deleted successfully")}catch(n){const a=n instanceof Error?n.message:String(n);D.error(`Failed to delete connection: ${a}`)}},Ee=async()=>{if(u.mode!=="force-deleting")return;const t=u.connection.id;b({type:"close"});try{const n=await Z.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:t,force:!0}});if(n.isError){D.error(`Failed to delete connection: ${te(n)}`);return}ee(),D.success("Connection deleted successfully")}catch(n){const a=n instanceof Error?n.message:String(n);D.error(`Failed to delete connection: ${a}`)}},$e=async t=>{let n,a=null,k=null,x=null;if(t.ui_type==="NPX"?(n="STDIO",a="",x=Ot(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(n="STDIO",a="",x=At(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(n=t.ui_type,a=t.connection_url||"",k=t.connection_token||null),m){await O.update.mutateAsync({id:m.id,data:{title:t.title,description:t.description||null,connection_type:n,connection_url:a,...k&&{connection_token:k},...x&&{connection_headers:x}}}),b({type:"close"}),r.reset();return}const w=qe("conn");await O.create.mutateAsync({id:w,title:t.title,description:t.description||null,connection_type:n,connection_url:a,connection_token:k,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:c?.user?.id||"system",organization_id:s.id,icon:null,app_name:null,app_id:null,connection_headers:x,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),J(),r.reset(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:w}})},ne=t=>{t||(Q?J():b({type:"close"}),r.reset())},V=t=>{const n=t.trim();if(!n)return;const a=!!r.formState.dirtyFields.title,k=!!r.formState.dirtyFields.description,x=!!r.formState.dirtyFields.env_vars,w=h=>{if(h&&(!a&&!r.getValues("title").trim()&&h.title&&r.setValue("title",h.title,{shouldDirty:!1}),!k&&!(r.getValues("description")??"").trim()&&h.description&&r.setValue("description",h.description,{shouldDirty:!1}),!x&&h.envVarKeys?.length)){const se=r.getValues("env_vars")??[],Ve=new Set(se.map(I=>I.key)),oe=h.envVarKeys.filter(I=>!Ve.has(I));oe.length>0&&r.setValue("env_vars",[...se,...oe.map(I=>({key:I,value:""}))],{shouldDirty:!0})}},H=$t(n);if(H&&N){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",H.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),w(B({uiType:"NPX",npxPackage:H.packageName}));return}if(n.startsWith("http://")||n.startsWith("https://")){const h=p==="HTTP"||p==="SSE"||p==="Websocket"?p:"HTTP";r.setValue("ui_type",h,{shouldDirty:!0}),r.setValue("connection_url",n,{shouldDirty:!0}),w(B({uiType:h,connectionUrl:n})??Ne({uiType:h,connectionUrl:n,registryItems:q}));return}p==="NPX"&&w(B({uiType:"NPX",npxPackage:n}))},Oe=[{id:"title",header:"Name",render:t=>e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(nt,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(z,{})}),e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title})]}),cellClassName:"w-32 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-muted-foreground truncate block",title:t.description||"",children:t.description||"—"}),cellClassName:"flex-1 min-w-0 max-w-0",wrap:!1,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-xs font-medium",children:t.connection_type}),cellClassName:"w-16 shrink-0",sortable:!0},{id:"status",header:"Status",render:t=>e.jsx(Ce,{status:t.status}),cellClassName:"w-28 shrink-0",sortable:!1},{id:"updated_by",header:"Updated by",render:t=>e.jsx(re,{id:t.updated_by??t.created_by,size:"3xs"}),cellClassName:"w-32 shrink-0",sortable:!0},{id:"updated_at",header:"Updated",render:t=>e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:t.updated_at?_e(new Date(t.updated_at)):"—"}),cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(xe,{children:[e.jsx(he,{asChild:!0,children:e.jsx(S,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:n=>n.stopPropagation(),children:e.jsx(je,{size:20})})}),e.jsxs(ge,{align:"end",onClick:n=>n.stopPropagation(),children:[e.jsxs(F,{onClick:n=>{n.stopPropagation(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}})},children:[e.jsx(ye,{size:16}),"Open"]}),e.jsxs(F,{variant:"destructive",onClick:n=>{n.stopPropagation(),b({type:"delete",connection:t})},children:[e.jsx(ve,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],Ae=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:g}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(S,{onClick:De,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(E,{children:[e.jsx(mt,{open:Q||u.mode==="editing",onOpenChange:ne,children:e.jsxs(ut,{className:"sm:max-w-[525px]",children:[e.jsxs(pt,{children:[e.jsx(xt,{children:m?"Edit Connection":"Create Connection"}),e.jsx(ht,{children:m?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(ft,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit($e),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(f,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Type *"}),e.jsxs(jt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(v,{children:e.jsx(yt,{children:e.jsx(vt,{})})}),e.jsxs(_t,{children:[e.jsx($,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx($,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"SSE"]})}),e.jsx($,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"Websocket"]})}),N&&e.jsxs(e.Fragment,{children:[e.jsx($,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx($,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Tt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(_,{})]})}),p==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(f,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"NPM Package *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:n=>{const a=n.clipboardData.getData("text");a&&(n.preventDefault(),r.setValue("npx_package",a.trim(),{shouldDirty:!0}),V(a))},onBlur:n=>{V(n.target.value),t.onBlur()}})}),e.jsx(_,{})]})})}),p==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(f,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Command *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(_,{})]})}),e.jsx(f,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Arguments"}),e.jsx(v,{children:e.jsx(T,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(_,{})]})})]}),e.jsx(f,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Working Directory"}),e.jsx(v,{children:e.jsx(T,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(_,{})]})})]}),(p==="NPX"||p==="STDIO")&&e.jsx(f,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Environment Variables"}),e.jsx(v,{children:e.jsx(Pt,{value:t.value??[],onChange:t.onChange})}),e.jsx(_,{})]})}),p!=="NPX"&&p!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(f,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"URL *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:n=>{const a=n.clipboardData.getData("text");a&&(n.preventDefault(),r.setValue("connection_url",a.trim(),{shouldDirty:!0}),V(a))},onBlur:n=>{V(n.target.value),t.onBlur()}})}),e.jsx(_,{})]})}),e.jsx(f,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:P?.token?.label??"Token (optional)"}),e.jsx(v,{children:e.jsx(T,{type:"password",placeholder:P?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),P?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.token.helperText,P.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(_,{})]})})]}),e.jsx(f,{control:r.control,name:"title",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Name *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"My Connection",...t})}),e.jsx(_,{})]})}),e.jsx(f,{control:r.control,name:"description",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Description"}),e.jsx(v,{children:e.jsx(Ct,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(_,{})]})})]}),e.jsxs(gt,{children:[e.jsx(S,{type:"button",variant:"outline",onClick:()=>ne(!1),children:"Cancel"}),e.jsx(S,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":m?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(ie,{open:u.mode==="deleting",onOpenChange:t=>!t&&b({type:"close"}),children:e.jsxs(ae,{children:[e.jsxs(ce,{children:[e.jsx(le,{children:"Delete Connection?"}),e.jsxs(de,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="deleting"&&u.connection.title}),"."]})]}),e.jsxs(me,{children:[e.jsx(ue,{children:"Cancel"}),e.jsx(pe,{onClick:Ie,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(ie,{open:u.mode==="force-deleting",onOpenChange:t=>!t&&b({type:"close"}),children:e.jsxs(ae,{children:[e.jsxs(ce,{children:[e.jsx(le,{children:"Connection Used by Agents"}),e.jsx(de,{asChild:!0,children:e.jsxs("div",{children:[e.jsxs("p",{children:["The connection"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="force-deleting"&&u.connection.title})," ","is currently used by the following agent(s):"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="force-deleting"&&u.agentNames}),"."]}),e.jsx("p",{className:"mt-2",children:"Deleting this connection will remove it from those agents, which may impact existing workflows that depend on them."})]})})]}),e.jsxs(me,{children:[e.jsx(ue,{children:"Cancel"}),e.jsx(pe,{onClick:Ee,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]})]})}),e.jsxs(E.Header,{children:[e.jsx(E.Header.Left,{children:e.jsx(at,{children:e.jsx(ct,{children:e.jsx(lt,{children:e.jsx(dt,{children:"Connections"})})})})}),e.jsxs(E.Header.Right,{children:[e.jsx(Qe,{viewMode:l.viewMode,onViewModeChange:l.setViewMode,sortKey:l.sortKey,sortDirection:l.sortDirection,onSort:l.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}]}),Ae]})]}),e.jsx(Ye,{value:l.search,onChange:l.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(l.setSearch(""),t.target.blur())}}),e.jsx(E.Content,{children:l.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:A.length===0?e.jsx(L,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(l.search,"No Connections found"),description:l.search?`No Connections match "${l.search}"`:"Create a connection to get started.",actions:!l.search&&e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:g}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:A.map(t=>e.jsx(Ze,{connection:t,fallbackIcon:e.jsx(z,{}),onClick:()=>i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}}),headerActions:e.jsxs(xe,{children:[e.jsx(he,{asChild:!0,children:e.jsx(S,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:n=>n.stopPropagation(),children:e.jsx(je,{size:20})})}),e.jsxs(ge,{align:"end",onClick:n=>n.stopPropagation(),children:[e.jsxs(F,{onClick:n=>{n.stopPropagation(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}})},children:[e.jsx(ye,{size:16}),"Open"]}),e.jsxs(F,{variant:"destructive",onClick:n=>{n.stopPropagation(),b({type:"delete",connection:t})},children:[e.jsx(ve,{size:16}),"Delete"]})]})]}),body:e.jsx(Ce,{status:t.status}),footer:e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(re,{id:t.updated_by??t.created_by,size:"3xs"})}),e.jsx("span",{className:"shrink-0 ml-2",children:t.updated_at?_e(new Date(t.updated_at)):"—"})]})},t.id))})}):e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:e.jsx("div",{className:"min-w-[1000px]",children:e.jsx(Je,{columns:Oe,data:A,isLoading:!1,sortKey:l.sortKey,sortDirection:l.sortDirection,onSort:l.handleSort,onRowClick:t=>i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}}),emptyState:l.search?e.jsx(L,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${l.search}"`}):e.jsx(L,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:g}}),children:"Browse Store"})})})})})})})]})}function Xn(){const s=be.c(1);let o;return s[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(Fe,{children:e.jsx(X.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(St,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Ht,{})})}),s[0]=o):o=s[0],o}export{Xn as default};
@@ -1 +1 @@
1
- import{bA as h,c as d,m as f,bB as _}from"./index-BiG-bBX7.js";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 y extends h{constructor(e,n){super(e,n)}send(e,n){const o=b(e);return o?.type==="emit"?(this.onmessage?.(o.message),Promise.resolve()):o?.type==="suppress"?Promise.resolve():super.send(e,n)}}function b(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 C={name:"mesh-sdk",version:"1.0.0"};function T(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 g({connectionId:t,orgId:e,token:n,meshUrl:o}){const i=T(t,o),c=new _(C,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),r=new y(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 S(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=()=>g({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:u}=f(l);return u}function I(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:g({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:u}=f(l);return u??null}const P={SELF:t=>`${t}_self`,REGISTRY:t=>`${t}_registry`,COMMUNITY_REGISTRY:t=>`${t}_community-registry`,DEV_ASSETS:t=>`${t}_dev-assets`},M="self";function R(t){return{id:P.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 L(){return{id:"community-registry",title:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",connection_type:"HTTP",connection_url:"https://sites-registry.decocache.com/mcp",icon:"https://assets.decocache.com/decocms/cd7ca472-0f72-463a-b0de-6e44bdd0f9b4/mcp.png",app_name:"mcp-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function D(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 A(){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 E(t){return{id:v(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 p="decopilot_";function O(t){return!t||!t.startsWith(p)?null:t.slice(p.length)||null}function v(t){return`${p}${t}`}export{m as K,y as S,P as W,M as a,L as b,g as c,E as d,A as e,D as f,v as g,R as h,O as i,I as j,S as u};
1
+ import{bA as h,c as d,m as f,bB as _}from"./index-BkxNgQ-z.js";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 y extends h{constructor(e,n){super(e,n)}send(e,n){const o=b(e);return o?.type==="emit"?(this.onmessage?.(o.message),Promise.resolve()):o?.type==="suppress"?Promise.resolve():super.send(e,n)}}function b(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 C={name:"mesh-sdk",version:"1.0.0"};function T(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 g({connectionId:t,orgId:e,token:n,meshUrl:o}){const i=T(t,o),c=new _(C,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),r=new y(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 S(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=()=>g({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:u}=f(l);return u}function I(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:g({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:u}=f(l);return u??null}const P={SELF:t=>`${t}_self`,REGISTRY:t=>`${t}_registry`,COMMUNITY_REGISTRY:t=>`${t}_community-registry`,DEV_ASSETS:t=>`${t}_dev-assets`},M="self";function R(t){return{id:P.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 L(){return{id:"community-registry",title:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",connection_type:"HTTP",connection_url:"https://sites-registry.decocache.com/mcp",icon:"https://assets.decocache.com/decocms/cd7ca472-0f72-463a-b0de-6e44bdd0f9b4/mcp.png",app_name:"mcp-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function D(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 A(){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 E(t){return{id:v(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 p="decopilot_";function O(t){return!t||!t.startsWith(p)?null:t.slice(p.length)||null}function v(t){return`${p}${t}`}export{m as K,y as S,P as W,M as a,L as b,g as c,E as d,A as e,D as f,v as g,R as h,O as i,I as j,S as u};
@@ -0,0 +1 @@
1
+ import{a0 as a,a1 as t}from"./index-BkxNgQ-z.js";const e=a(t,{target:"draft-7"});export{e as B};
@@ -1 +1 @@
1
- import{o as A,s as D,c as O,k as v,l as E,j as r,B as N,d as I}from"./index-BiG-bBX7.js";import{A as M,a as L,b as R,c as T,d as $,e as k,f as B}from"./alert-dialog-DQT_qq2D.js";import{F as V,a as q,b as H,c as U,d as G,e as J,f as K}from"./form-CZlsOGpj.js";import{I as P}from"./input-BcOk4EWn.js";import{S as Q}from"./spinner-DSMOMT7g.js";import{u as W}from"./useMutation-Cxle_Mtw.js";function _(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function se(o){const e=O.c(41),{open:a,onOpenChange:s}=o;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:v(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=W(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(R,{children:[r.jsx(T,{children:"Create a new organization"}),r.jsx($,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let p;e[6]!==i?(p=b=>i.mutateAsync(b),e[6]=i,e[7]=p):p=e[7],n=t.handleSubmit(p),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=p=>{const{field:b}=p;return r.jsxs(H,{children:[r.jsx(U,{children:"Organization Name"}),r.jsx(G,{children:r.jsx(P,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(J,{children:"The name of your company or organization"}),b.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",_(b.value)]})]}),r.jsx(K,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(V,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(M,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Q,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(N,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let S;e[26]!==d||e[27]!==g?(S=r.jsxs(k,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=S):S=e[28];let h;e[29]!==S||e[30]!==n||e[31]!==m||e[32]!==c?(h=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,S]}),e[29]=S,e[30]=n,e[31]=m,e[32]=c,e[33]=h):h=e[33];let x;e[34]!==t||e[35]!==h?(x=r.jsxs(L,{children:[F,r.jsx(q,{...t,children:h})]}),e[34]=t,e[35]=h,e[36]=x):x=e[36];let C;return e[37]!==s||e[38]!==a||e[39]!==x?(C=r.jsx(B,{open:a,onOpenChange:s,children:x}),e[37]=s,e[38]=a,e[39]=x,e[40]=C):C=e[40],C}function Y(o){const{orgSlug:e}=o;window.location.href=`/${e}`}async function Z(o){const e=_(o.name);if(!e)throw new Error("Organization slug is invalid");const a=await I.organization.create({name:o.name,slug:e});if(a?.error)throw new Error(a.error.message||"Failed to create organization");const s=a?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{se as C};
1
+ import{o as A,s as D,c as O,k as v,l as E,j as r,B as N,d as I}from"./index-BkxNgQ-z.js";import{A as M,a as L,b as R,c as T,d as $,e as k,f as B}from"./alert-dialog-B0yEBEkb.js";import{F as V,a as q,b as H,c as U,d as G,e as J,f as K}from"./form-DKOb9Dxi.js";import{I as P}from"./input-BxWPl4Ur.js";import{S as Q}from"./spinner-B_k6AtHn.js";import{u as W}from"./useMutation-DtOoZO7h.js";function _(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function se(o){const e=O.c(41),{open:a,onOpenChange:s}=o;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:v(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=W(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(R,{children:[r.jsx(T,{children:"Create a new organization"}),r.jsx($,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let p;e[6]!==i?(p=b=>i.mutateAsync(b),e[6]=i,e[7]=p):p=e[7],n=t.handleSubmit(p),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=p=>{const{field:b}=p;return r.jsxs(H,{children:[r.jsx(U,{children:"Organization Name"}),r.jsx(G,{children:r.jsx(P,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(J,{children:"The name of your company or organization"}),b.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",_(b.value)]})]}),r.jsx(K,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(V,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(M,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Q,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(N,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let S;e[26]!==d||e[27]!==g?(S=r.jsxs(k,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=S):S=e[28];let h;e[29]!==S||e[30]!==n||e[31]!==m||e[32]!==c?(h=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,S]}),e[29]=S,e[30]=n,e[31]=m,e[32]=c,e[33]=h):h=e[33];let x;e[34]!==t||e[35]!==h?(x=r.jsxs(L,{children:[F,r.jsx(q,{...t,children:h})]}),e[34]=t,e[35]=h,e[36]=x):x=e[36];let C;return e[37]!==s||e[38]!==a||e[39]!==x?(C=r.jsx(B,{open:a,onOpenChange:s,children:x}),e[37]=s,e[38]=a,e[39]=x,e[40]=C):C=e[40],C}function Y(o){const{orgSlug:e}=o;window.location.href=`/${e}`}async function Z(o){const e=_(o.name);if(!e)throw new Error("Organization slug is invalid");const a=await I.organization.create({name:o.name,slug:e});if(a?.error)throw new Error(a.error.message||"Failed to create organization");const s=a?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{se as C};
@@ -1 +1 @@
1
- import{c as A,j as e,v as L,u as R,b as k,n as z,r as M,l as T,t as B,K as V,O as j,B as D,o as $,s as f}from"./index-BiG-bBX7.js";import{u as q}from"./useMutation-Cxle_Mtw.js";import{u as O,a as K}from"./constants-Bj4b22ad.js";import{D as U,a as G,b as J,c as Q,d as Y,e as H}from"./dialog-DDOb23Pi.js";import{a as W,F as v,b as F,c as N,d as S,f as w}from"./form-CZlsOGpj.js";import{I}from"./input-BcOk4EWn.js";import{T as X}from"./textarea-Bkod2qAV.js";import{L as Z}from"./label-BLk50aKt.js";import{i as ee}from"./Check-Bs28PslG.js";function se(l){return l.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function _(l){return/^[a-z0-9-]+$/.test(l)&&l.length>0&&l.length<=100}const te=["#3B82F6","#8B5CF6","#EC4899","#EF4444","#F97316","#EAB308","#22C55E","#14B8A6","#06B6D4","#6366F1","#64748B","#000000"];function ne(l){const s=A.c(16),{value:r,onChange:i}=l;let c;s[0]!==i||s[1]!==r?(c=te.map(o=>e.jsx("button",{type:"button",onClick:()=>i(o),className:L("size-8 rounded-lg transition-all",r===o&&"ring-2 ring-offset-2 ring-primary"),style:{backgroundColor:o},children:r===o&&e.jsx(ee,{className:"size-4 text-white mx-auto"})},o)),s[0]=i,s[1]=r,s[2]=c):c=s[2];let u;s[3]!==c?(u=e.jsx("div",{className:"grid grid-cols-6 gap-2",children:c}),s[3]=c,s[4]=u):u=s[4];const g=r??"#3B82F6";let d;s[5]!==i?(d=o=>i(o.target.value),s[5]=i,s[6]=d):d=s[6];let t;s[7]!==g||s[8]!==d?(t=e.jsx("input",{type:"color",value:g,onChange:d,className:"size-8 rounded cursor-pointer"}),s[7]=g,s[8]=d,s[9]=t):t=s[9];let a;s[10]===Symbol.for("react.memo_cache_sentinel")?(a=e.jsx("span",{className:"text-sm text-muted-foreground",children:"Custom color"}),s[10]=a):a=s[10];let m;s[11]!==t?(m=e.jsxs("div",{className:"flex items-center gap-2",children:[t,a]}),s[11]=t,s[12]=m):m=s[12];let x;return s[13]!==u||s[14]!==m?(x=e.jsxs("div",{className:"space-y-3",children:[u,m]}),s[13]=u,s[14]=m,s[15]=x):x=s[15],x}$({name:f().min(1,"Name is required").max(200),slug:f().min(1,"Slug is required").max(100),description:f().max(1e3).optional(),bannerColor:f().nullable().optional()});function ge({open:l,onOpenChange:s}){const{org:r}=R(),i=k(),c=z(),[u,g]=M.useState(!1),d=O({connectionId:K,orgId:r.id}),t=T({mode:"onChange",defaultValues:{name:"",slug:"",description:"",bannerColor:"#3B82F6"}}),a=q({mutationFn:async n=>{const p=await d.callTool({name:"PROJECT_CREATE",arguments:{organizationId:r.id,slug:n.slug,name:n.name,description:n.description||null,enabledPlugins:[],ui:{banner:null,bannerColor:n.bannerColor??null,icon:null,themeColor:n.bannerColor??null}}});return p.structuredContent??p},onSuccess:n=>{c.invalidateQueries({queryKey:V.projects(r.id)}),B.success("Project created successfully"),s(!1),t.reset({name:"",slug:"",description:"",bannerColor:"#3B82F6"}),g(!1),i({to:"/$org/$project",params:{org:r.slug,project:n.project.slug}})},onError:n=>{B.error("Failed to create project: "+(n instanceof Error?n.message:"Unknown error"))}}),m=async n=>{if(!_(n.slug)){t.setError("slug",{message:"Slug must be lowercase alphanumeric with hyphens only"});return}if(n.slug===j){t.setError("slug",{message:`"${j}" is a reserved slug`});return}await a.mutateAsync(n)},x=n=>{const p=n.target.value;if(t.setValue("name",p),!u){const P=se(p);t.setValue("slug",P)}},o=n=>{g(!0),t.setValue("slug",n.target.value.toLowerCase().replace(/[^a-z0-9-]/g,""))},C=t.watch("bannerColor"),h=t.watch("slug"),b=t.watch("name"),y=h===j,E=h.length>0&&!_(h);return e.jsx(U,{open:l,onOpenChange:s,children:e.jsxs(G,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(J,{children:[e.jsx(Q,{children:"Create New Project"}),e.jsxs(Y,{children:["Set up a new project in ",r.name,". You can configure plugins and settings after creation."]})]}),e.jsx(W,{...t,children:e.jsxs("form",{onSubmit:t.handleSubmit(m),className:"space-y-6",children:[e.jsx("div",{className:"h-20 rounded-lg relative",style:{backgroundColor:C??"#3B82F6"},children:e.jsx("div",{className:"absolute -bottom-4 left-4",children:e.jsx("div",{className:"size-12 rounded-lg border-2 border-background flex items-center justify-center text-lg font-semibold text-white",style:{backgroundColor:C??"#3B82F6"},children:b?.charAt(0)?.toUpperCase()||"P"})})}),e.jsxs("div",{className:"space-y-2 pt-4",children:[e.jsx(Z,{children:"Banner Color"}),e.jsx(ne,{value:C??null,onChange:n=>t.setValue("bannerColor",n)})]}),e.jsx(v,{control:t.control,name:"name",render:()=>e.jsxs(F,{children:[e.jsx(N,{children:"Project Name *"}),e.jsx(S,{children:e.jsx(I,{value:b,onChange:x,placeholder:"My Awesome Project",autoFocus:!0,disabled:a.isPending})}),e.jsx(w,{})]})}),e.jsx(v,{control:t.control,name:"slug",render:()=>e.jsxs(F,{children:[e.jsx(N,{children:"Slug *"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:["/",r.slug,"/"]}),e.jsx(S,{children:e.jsx(I,{value:h,onChange:o,placeholder:"my-awesome-project",className:"flex-1",disabled:a.isPending})})]}),y&&e.jsxs("p",{className:"text-xs text-destructive",children:['"',j,'" is a reserved slug']}),E&&!y&&e.jsx("p",{className:"text-xs text-destructive",children:"Slug must be lowercase alphanumeric with hyphens only"}),e.jsx(w,{})]})}),e.jsx(v,{control:t.control,name:"description",render:({field:n})=>e.jsxs(F,{children:[e.jsx(N,{children:"Description"}),e.jsx(S,{children:e.jsx(X,{...n,placeholder:"What is this project for?",rows:2,disabled:a.isPending})}),e.jsx(w,{})]})}),e.jsxs(H,{children:[e.jsx(D,{type:"button",variant:"outline",onClick:()=>s(!1),disabled:a.isPending,children:"Cancel"}),e.jsx(D,{type:"submit",disabled:a.isPending||y||E||!b||!h,children:a.isPending?"Creating...":"Create Project"})]})]})})]})})}export{ge as C};
1
+ import{c as A,j as e,v as L,u as R,b as k,n as z,r as M,l as T,t as B,K as V,O as j,B as D,o as $,s as f}from"./index-BkxNgQ-z.js";import{u as q}from"./useMutation-DtOoZO7h.js";import{u as O,a as K}from"./constants--aQ9HnxF.js";import{D as U,a as G,b as J,c as Q,d as Y,e as H}from"./dialog-CrYlSCa6.js";import{a as W,F as v,b as F,c as N,d as S,f as w}from"./form-DKOb9Dxi.js";import{I}from"./input-BxWPl4Ur.js";import{T as X}from"./textarea-CceQB-N2.js";import{L as Z}from"./label-DQ6CQRMq.js";import{i as ee}from"./Check-BuBqfL8V.js";function se(l){return l.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function _(l){return/^[a-z0-9-]+$/.test(l)&&l.length>0&&l.length<=100}const te=["#3B82F6","#8B5CF6","#EC4899","#EF4444","#F97316","#EAB308","#22C55E","#14B8A6","#06B6D4","#6366F1","#64748B","#000000"];function ne(l){const s=A.c(16),{value:r,onChange:i}=l;let c;s[0]!==i||s[1]!==r?(c=te.map(o=>e.jsx("button",{type:"button",onClick:()=>i(o),className:L("size-8 rounded-lg transition-all",r===o&&"ring-2 ring-offset-2 ring-primary"),style:{backgroundColor:o},children:r===o&&e.jsx(ee,{className:"size-4 text-white mx-auto"})},o)),s[0]=i,s[1]=r,s[2]=c):c=s[2];let u;s[3]!==c?(u=e.jsx("div",{className:"grid grid-cols-6 gap-2",children:c}),s[3]=c,s[4]=u):u=s[4];const g=r??"#3B82F6";let d;s[5]!==i?(d=o=>i(o.target.value),s[5]=i,s[6]=d):d=s[6];let t;s[7]!==g||s[8]!==d?(t=e.jsx("input",{type:"color",value:g,onChange:d,className:"size-8 rounded cursor-pointer"}),s[7]=g,s[8]=d,s[9]=t):t=s[9];let a;s[10]===Symbol.for("react.memo_cache_sentinel")?(a=e.jsx("span",{className:"text-sm text-muted-foreground",children:"Custom color"}),s[10]=a):a=s[10];let m;s[11]!==t?(m=e.jsxs("div",{className:"flex items-center gap-2",children:[t,a]}),s[11]=t,s[12]=m):m=s[12];let x;return s[13]!==u||s[14]!==m?(x=e.jsxs("div",{className:"space-y-3",children:[u,m]}),s[13]=u,s[14]=m,s[15]=x):x=s[15],x}$({name:f().min(1,"Name is required").max(200),slug:f().min(1,"Slug is required").max(100),description:f().max(1e3).optional(),bannerColor:f().nullable().optional()});function ge({open:l,onOpenChange:s}){const{org:r}=R(),i=k(),c=z(),[u,g]=M.useState(!1),d=O({connectionId:K,orgId:r.id}),t=T({mode:"onChange",defaultValues:{name:"",slug:"",description:"",bannerColor:"#3B82F6"}}),a=q({mutationFn:async n=>{const p=await d.callTool({name:"PROJECT_CREATE",arguments:{organizationId:r.id,slug:n.slug,name:n.name,description:n.description||null,enabledPlugins:[],ui:{banner:null,bannerColor:n.bannerColor??null,icon:null,themeColor:n.bannerColor??null}}});return p.structuredContent??p},onSuccess:n=>{c.invalidateQueries({queryKey:V.projects(r.id)}),B.success("Project created successfully"),s(!1),t.reset({name:"",slug:"",description:"",bannerColor:"#3B82F6"}),g(!1),i({to:"/$org/$project",params:{org:r.slug,project:n.project.slug}})},onError:n=>{B.error("Failed to create project: "+(n instanceof Error?n.message:"Unknown error"))}}),m=async n=>{if(!_(n.slug)){t.setError("slug",{message:"Slug must be lowercase alphanumeric with hyphens only"});return}if(n.slug===j){t.setError("slug",{message:`"${j}" is a reserved slug`});return}await a.mutateAsync(n)},x=n=>{const p=n.target.value;if(t.setValue("name",p),!u){const P=se(p);t.setValue("slug",P)}},o=n=>{g(!0),t.setValue("slug",n.target.value.toLowerCase().replace(/[^a-z0-9-]/g,""))},C=t.watch("bannerColor"),h=t.watch("slug"),b=t.watch("name"),y=h===j,E=h.length>0&&!_(h);return e.jsx(U,{open:l,onOpenChange:s,children:e.jsxs(G,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(J,{children:[e.jsx(Q,{children:"Create New Project"}),e.jsxs(Y,{children:["Set up a new project in ",r.name,". You can configure plugins and settings after creation."]})]}),e.jsx(W,{...t,children:e.jsxs("form",{onSubmit:t.handleSubmit(m),className:"space-y-6",children:[e.jsx("div",{className:"h-20 rounded-lg relative",style:{backgroundColor:C??"#3B82F6"},children:e.jsx("div",{className:"absolute -bottom-4 left-4",children:e.jsx("div",{className:"size-12 rounded-lg border-2 border-background flex items-center justify-center text-lg font-semibold text-white",style:{backgroundColor:C??"#3B82F6"},children:b?.charAt(0)?.toUpperCase()||"P"})})}),e.jsxs("div",{className:"space-y-2 pt-4",children:[e.jsx(Z,{children:"Banner Color"}),e.jsx(ne,{value:C??null,onChange:n=>t.setValue("bannerColor",n)})]}),e.jsx(v,{control:t.control,name:"name",render:()=>e.jsxs(F,{children:[e.jsx(N,{children:"Project Name *"}),e.jsx(S,{children:e.jsx(I,{value:b,onChange:x,placeholder:"My Awesome Project",autoFocus:!0,disabled:a.isPending})}),e.jsx(w,{})]})}),e.jsx(v,{control:t.control,name:"slug",render:()=>e.jsxs(F,{children:[e.jsx(N,{children:"Slug *"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:["/",r.slug,"/"]}),e.jsx(S,{children:e.jsx(I,{value:h,onChange:o,placeholder:"my-awesome-project",className:"flex-1",disabled:a.isPending})})]}),y&&e.jsxs("p",{className:"text-xs text-destructive",children:['"',j,'" is a reserved slug']}),E&&!y&&e.jsx("p",{className:"text-xs text-destructive",children:"Slug must be lowercase alphanumeric with hyphens only"}),e.jsx(w,{})]})}),e.jsx(v,{control:t.control,name:"description",render:({field:n})=>e.jsxs(F,{children:[e.jsx(N,{children:"Description"}),e.jsx(S,{children:e.jsx(X,{...n,placeholder:"What is this project for?",rows:2,disabled:a.isPending})}),e.jsx(w,{})]})}),e.jsxs(H,{children:[e.jsx(D,{type:"button",variant:"outline",onClick:()=>s(!1),disabled:a.isPending,children:"Cancel"}),e.jsx(D,{type:"submit",disabled:a.isPending||y||E||!b||!h,children:a.isPending?"Creating...":"Create Project"})]})]})})]})})}export{ge as C};
@@ -1 +1 @@
1
- import{c as o,j as r}from"./index-BiG-bBX7.js";import{D as s}from"./danger-zone-DJn-yaAs.js";import"./useMutation-Cxle_Mtw.js";import"./constants-Bj4b22ad.js";import"./input-BcOk4EWn.js";import"./alert-dialog-DQT_qq2D.js";function n(){const t=o.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsxs("div",{className:"flex flex-col gap-6",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Danger Zone"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Irreversible and destructive actions."})]}),r.jsx(s,{})]}),t[0]=e):e=t[0],e}function f(){const t=o.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(n,{}),t[0]=e):e=t[0],e}export{f as default};
1
+ import{c as o,j as r}from"./index-BkxNgQ-z.js";import{D as s}from"./danger-zone-PDtJsuS3.js";import"./useMutation-DtOoZO7h.js";import"./constants--aQ9HnxF.js";import"./input-BxWPl4Ur.js";import"./alert-dialog-B0yEBEkb.js";function n(){const t=o.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsxs("div",{className:"flex flex-col gap-6",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Danger Zone"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Irreversible and destructive actions."})]}),r.jsx(s,{})]}),t[0]=e):e=t[0],e}function f(){const t=o.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(n,{}),t[0]=e):e=t[0],e}export{f as default};
@@ -1 +1 @@
1
- import{c as B,u as G,b as J,n as Q,r as L,O as M,j as t,K as U,t as F,B as Z}from"./index-BiG-bBX7.js";import{u as H}from"./useMutation-Cxle_Mtw.js";import{a as Y,u as z}from"./constants-Bj4b22ad.js";import{I as V}from"./input-BcOk4EWn.js";import{c as W,g as X,d as ee,b as te,A as se,e as le,h as ne,a as re,f as oe}from"./alert-dialog-DQT_qq2D.js";function fe(){const e=B.c(45),{org:n,project:s}=G(),S=J(),E=Q(),[x,R]=L.useState(""),[P,k]=L.useState(!1),K=s.slug===M;let h;e[0]!==n.id?(h={connectionId:Y,orgId:n.id},e[0]=n.id,e[1]=h):h=e[1];const I=z(h);let r;e[2]!==I||e[3]!==s.id?(r=async()=>{const l=await I.callTool({name:"PROJECT_DELETE",arguments:{projectId:s.id}});return l.structuredContent??l},e[2]=I,e[3]=s.id,e[4]=r):r=e[4];let o;e[5]!==S||e[6]!==n.id||e[7]!==n.slug||e[8]!==E?(o=l=>{l.success?(E.invalidateQueries({queryKey:U.projects(n.id)}),F.success("Project deleted"),S({to:"/$org/$project/projects",params:{org:n.slug,project:M}})):F.error(l.message??"Failed to delete project")},e[5]=S,e[6]=n.id,e[7]=n.slug,e[8]=E,e[9]=o):o=e[9];let p;e[10]!==r||e[11]!==o?(p={mutationFn:r,onSuccess:o,onError:ae},e[10]=r,e[11]=o,e[12]=p):p=e[12];const g=H(p);if(K)return null;const $=x===s.name;let j;e[13]!==g?(j=()=>{g.mutate()},e[13]=g,e[14]=j):j=e[14];const O=j;let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=l=>{k(l),l||R("")},e[15]=b):b=e[15];const q=b;let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"Danger Zone"}),e[16]=D):D=e[16];let v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Delete Project"}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Permanently delete this project and all its data. This action cannot be undone."})]}),e[17]=v):v=e[17];let _;e[18]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(X,{asChild:!0,children:t.jsx(Z,{variant:"outline",className:"shrink-0 bg-destructive/10 text-destructive border-0 hover:bg-destructive/15 hover:text-destructive",children:"Delete Project"})}),e[18]=_):_=e[18];let a;e[19]!==s.name?(a=t.jsxs(W,{children:['Delete "',s.name,'"?']}),e[19]=s.name,e[20]=a):a=e[20];let y;e[21]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ee,{children:"This action cannot be undone. All project data will be permanently deleted."}),e[21]=y):y=e[21];let i;e[22]!==a?(i=t.jsxs(te,{children:[a,y]}),e[22]=a,e[23]=i):i=e[23];let c;e[24]!==s.name?(c=t.jsxs("p",{className:"text-sm mb-2",children:["Type ",t.jsx("strong",{children:s.name})," to confirm:"]}),e[24]=s.name,e[25]=c):c=e[25];let C;e[26]===Symbol.for("react.memo_cache_sentinel")?(C=l=>R(l.target.value),e[26]=C):C=e[26];let d;e[27]!==x||e[28]!==s.name?(d=t.jsx(V,{value:x,onChange:C,placeholder:s.name}),e[27]=x,e[28]=s.name,e[29]=d):d=e[29];let m;e[30]!==c||e[31]!==d?(m=t.jsxs("div",{className:"py-4",children:[c,d]}),e[30]=c,e[31]=d,e[32]=m):m=e[32];let A;e[33]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(se,{children:"Cancel"}),e[33]=A):A=e[33];const T=!$||g.isPending,w=g.isPending?"Deleting...":"Delete Project";let u;e[34]!==O||e[35]!==T||e[36]!==w?(u=t.jsxs(le,{children:[A,t.jsx(ne,{onClick:O,disabled:T,className:"bg-destructive/10 text-destructive hover:bg-destructive/15 hover:text-destructive border-0",children:w})]}),e[34]=O,e[35]=T,e[36]=w,e[37]=u):u=e[37];let f;e[38]!==i||e[39]!==m||e[40]!==u?(f=t.jsxs(re,{children:[i,m,u]}),e[38]=i,e[39]=m,e[40]=u,e[41]=f):f=e[41];let N;return e[42]!==P||e[43]!==f?(N=t.jsxs("div",{className:"flex flex-col",children:[D,t.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[v,t.jsxs(oe,{open:P,onOpenChange:q,children:[_,f]})]})]}),e[42]=P,e[43]=f,e[44]=N):N=e[44],N}function ae(e){F.error("Failed to delete project: "+(e instanceof Error?e.message:"Unknown error"))}export{fe as D};
1
+ import{c as B,u as G,b as J,n as Q,r as L,O as M,j as t,K as U,t as F,B as Z}from"./index-BkxNgQ-z.js";import{u as H}from"./useMutation-DtOoZO7h.js";import{a as Y,u as z}from"./constants--aQ9HnxF.js";import{I as V}from"./input-BxWPl4Ur.js";import{c as W,g as X,d as ee,b as te,A as se,e as le,h as ne,a as re,f as oe}from"./alert-dialog-B0yEBEkb.js";function fe(){const e=B.c(45),{org:n,project:s}=G(),S=J(),E=Q(),[x,R]=L.useState(""),[P,k]=L.useState(!1),K=s.slug===M;let h;e[0]!==n.id?(h={connectionId:Y,orgId:n.id},e[0]=n.id,e[1]=h):h=e[1];const I=z(h);let r;e[2]!==I||e[3]!==s.id?(r=async()=>{const l=await I.callTool({name:"PROJECT_DELETE",arguments:{projectId:s.id}});return l.structuredContent??l},e[2]=I,e[3]=s.id,e[4]=r):r=e[4];let o;e[5]!==S||e[6]!==n.id||e[7]!==n.slug||e[8]!==E?(o=l=>{l.success?(E.invalidateQueries({queryKey:U.projects(n.id)}),F.success("Project deleted"),S({to:"/$org/$project/projects",params:{org:n.slug,project:M}})):F.error(l.message??"Failed to delete project")},e[5]=S,e[6]=n.id,e[7]=n.slug,e[8]=E,e[9]=o):o=e[9];let p;e[10]!==r||e[11]!==o?(p={mutationFn:r,onSuccess:o,onError:ae},e[10]=r,e[11]=o,e[12]=p):p=e[12];const g=H(p);if(K)return null;const $=x===s.name;let j;e[13]!==g?(j=()=>{g.mutate()},e[13]=g,e[14]=j):j=e[14];const O=j;let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=l=>{k(l),l||R("")},e[15]=b):b=e[15];const q=b;let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"Danger Zone"}),e[16]=D):D=e[16];let v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Delete Project"}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Permanently delete this project and all its data. This action cannot be undone."})]}),e[17]=v):v=e[17];let _;e[18]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(X,{asChild:!0,children:t.jsx(Z,{variant:"outline",className:"shrink-0 bg-destructive/10 text-destructive border-0 hover:bg-destructive/15 hover:text-destructive",children:"Delete Project"})}),e[18]=_):_=e[18];let a;e[19]!==s.name?(a=t.jsxs(W,{children:['Delete "',s.name,'"?']}),e[19]=s.name,e[20]=a):a=e[20];let y;e[21]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ee,{children:"This action cannot be undone. All project data will be permanently deleted."}),e[21]=y):y=e[21];let i;e[22]!==a?(i=t.jsxs(te,{children:[a,y]}),e[22]=a,e[23]=i):i=e[23];let c;e[24]!==s.name?(c=t.jsxs("p",{className:"text-sm mb-2",children:["Type ",t.jsx("strong",{children:s.name})," to confirm:"]}),e[24]=s.name,e[25]=c):c=e[25];let C;e[26]===Symbol.for("react.memo_cache_sentinel")?(C=l=>R(l.target.value),e[26]=C):C=e[26];let d;e[27]!==x||e[28]!==s.name?(d=t.jsx(V,{value:x,onChange:C,placeholder:s.name}),e[27]=x,e[28]=s.name,e[29]=d):d=e[29];let m;e[30]!==c||e[31]!==d?(m=t.jsxs("div",{className:"py-4",children:[c,d]}),e[30]=c,e[31]=d,e[32]=m):m=e[32];let A;e[33]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(se,{children:"Cancel"}),e[33]=A):A=e[33];const T=!$||g.isPending,w=g.isPending?"Deleting...":"Delete Project";let u;e[34]!==O||e[35]!==T||e[36]!==w?(u=t.jsxs(le,{children:[A,t.jsx(ne,{onClick:O,disabled:T,className:"bg-destructive/10 text-destructive hover:bg-destructive/15 hover:text-destructive border-0",children:w})]}),e[34]=O,e[35]=T,e[36]=w,e[37]=u):u=e[37];let f;e[38]!==i||e[39]!==m||e[40]!==u?(f=t.jsxs(re,{children:[i,m,u]}),e[38]=i,e[39]=m,e[40]=u,e[41]=f):f=e[41];let N;return e[42]!==P||e[43]!==f?(N=t.jsxs("div",{className:"flex flex-col",children:[D,t.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[v,t.jsxs(oe,{open:P,onOpenChange:q,children:[_,f]})]})]}),e[42]=P,e[43]=f,e[44]=N):N=e[44],N}function ae(e){F.error("Failed to delete project: "+(e instanceof Error?e.message:"Unknown error"))}export{fe as D};
@@ -1 +1 @@
1
- import{c as l,m as u,ay as m,az as f}from"./index-BiG-bBX7.js";import{u as y}from"./useQuery-Us1whSan.js";import{K as n}from"./constants-Bj4b22ad.js";async function c(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(e){if(e instanceof m&&e.code===f.MethodNotFound)return{prompts:[]};throw e}}async function d(r,t,e){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:t,arguments:e??{}})}function b(r){const t=l.c(12);let e,s;t[0]!==r?({client:e,...s}=r,t[0]=r,t[1]=e,t[2]=s):(e=t[1],s=t[2]);let i;t[3]!==e?(i=n.mcpPromptsList(e),t[3]=e,t[4]=i):i=t[4];let o;t[5]!==e?(o=()=>c(e),t[5]=e,t[6]=o):o=t[6];const p=s.staleTime??3e4;let a;return t[7]!==s||t[8]!==i||t[9]!==o||t[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},t[7]=s,t[8]=i,t[9]=o,t[10]=p,t[11]=a):a=t[11],u(a)}function L(r){const t=l.c(12);let e,s;t[0]!==r?({client:e,...s}=r,t[0]=r,t[1]=e,t[2]=s):(e=t[1],s=t[2]);let i;t[3]!==e?(i=n.mcpPromptsList(e),t[3]=e,t[4]=i):i=t[4];let o;t[5]!==e?(o=()=>c(e),t[5]=e,t[6]=o):o=t[6];const p=s.staleTime??3e4;let a;return t[7]!==s||t[8]!==i||t[9]!==o||t[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},t[7]=s,t[8]=i,t[9]=o,t[10]=p,t[11]=a):a=t[11],y(a)}const P={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},C=Object.values(P);export{C as A,P as D,L as a,d as g,c as l,b as u};
1
+ import{c as l,m as u,ay as m,az as f}from"./index-BkxNgQ-z.js";import{u as y}from"./useQuery-Cj-miqA2.js";import{K as n}from"./constants--aQ9HnxF.js";async function c(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(e){if(e instanceof m&&e.code===f.MethodNotFound)return{prompts:[]};throw e}}async function d(r,t,e){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:t,arguments:e??{}})}function b(r){const t=l.c(12);let e,s;t[0]!==r?({client:e,...s}=r,t[0]=r,t[1]=e,t[2]=s):(e=t[1],s=t[2]);let i;t[3]!==e?(i=n.mcpPromptsList(e),t[3]=e,t[4]=i):i=t[4];let o;t[5]!==e?(o=()=>c(e),t[5]=e,t[6]=o):o=t[6];const p=s.staleTime??3e4;let a;return t[7]!==s||t[8]!==i||t[9]!==o||t[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},t[7]=s,t[8]=i,t[9]=o,t[10]=p,t[11]=a):a=t[11],u(a)}function L(r){const t=l.c(12);let e,s;t[0]!==r?({client:e,...s}=r,t[0]=r,t[1]=e,t[2]=s):(e=t[1],s=t[2]);let i;t[3]!==e?(i=n.mcpPromptsList(e),t[3]=e,t[4]=i):i=t[4];let o;t[5]!==e?(o=()=>c(e),t[5]=e,t[6]=o):o=t[6];const p=s.staleTime??3e4;let a;return t[7]!==s||t[8]!==i||t[9]!==o||t[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},t[7]=s,t[8]=i,t[9]=o,t[10]=p,t[11]=a):a=t[11],y(a)}const P={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},C=Object.values(P);export{C as A,P as D,L as a,d as g,c as l,b as u};
@@ -1 +1 @@
1
- import{c as K,j as t,u as ue,n as fe,r as pe,v as ne,K as ee,B as xe,t as re}from"./index-BiG-bBX7.js";import{u as he}from"./useQuery-Us1whSan.js";import{u as oe}from"./useMutation-Cxle_Mtw.js";import{P as je,a as ge,b as Ce}from"./popover-Cnhlur36.js";import{C as be,a as ve,b as Ne,c as ye,d as Ee,e as Te}from"./command-BL2WDnzB.js";import{s as _e}from"./Plus-7RI9qITc.js";import{i as Ie}from"./X-B9LxUp5o.js";import{h as Pe}from"./use-connection-CsobI-JA.js";import{a as Se,u as Oe}from"./constants-Bj4b22ad.js";import{u as te}from"./unwrap-tool-result-BYXdCQMg.js";import"./index-CBDYR7h7.js";import"./SearchMd-BzFnoImC.js";function ie(e){const n=K.c(6),{icon:o,title:c}=e;if(o){let a;return n[0]!==o?(a=t.jsx("img",{src:o,alt:"",className:"size-5 shrink-0 rounded"}),n[0]=o,n[1]=a):a=n[1],a}let i;n[2]!==c?(i=c.charAt(0).toUpperCase(),n[2]=c,n[3]=i):i=n[3];let r;return n[4]!==i?(r=t.jsx("div",{className:"size-5 shrink-0 rounded bg-muted flex items-center justify-center",children:t.jsx("span",{className:"text-[10px] font-medium text-muted-foreground",children:i})}),n[4]=i,n[5]=r):r=n[5],r}function we(){const e=K.c(72),{org:n,project:o}=ue();let c;e[0]!==n.id?(c={connectionId:Se,orgId:n.id},e[0]=n.id,e[1]=c):c=e[1];const i=Oe(c),r=fe(),a=Pe(),l=o.id??"",[Q,se]=pe.useState(!1);let d;e[2]!==l?(d=ee.projectConnections(l),e[2]=l,e[3]=d):d=e[3];const L=!!o.id;let m;e[4]!==i||e[5]!==l?(m=async()=>{const s=await i.callTool({name:"PROJECT_CONNECTION_LIST",arguments:{projectId:l}});return te(s)},e[4]=i,e[5]=l,e[6]=m):m=e[6];let P;e[7]!==d||e[8]!==L||e[9]!==m?(P={queryKey:d,enabled:L,queryFn:m},e[7]=d,e[8]=L,e[9]=m,e[10]=P):P=e[10];const{data:$}=he(P);let S;e[11]!==$?.connections?(S=new Set(($?.connections??[]).map(Re)),e[11]=$?.connections,e[12]=S):S=e[12];const u=S;let O;e[13]!==u?(O=s=>u.has(s.id),e[13]=u,e[14]=O):O=e[14];const I=(a??[]).filter(O);let w;e[15]!==u?(w=s=>!u.has(s.id),e[15]=u,e[16]=w):w=e[16];const le=(a??[]).filter(w);let k;e[17]!==n.id||e[18]!==o.slug||e[19]!==l||e[20]!==r?(k=()=>{r.invalidateQueries({queryKey:ee.projectConnections(l)}),r.invalidateQueries({queryKey:ee.project(n.id,o.slug)})},e[17]=n.id,e[18]=o.slug,e[19]=l,e[20]=r,e[21]=k):k=e[21];const f=k;let p;e[22]!==i||e[23]!==o.id?(p=async s=>{const Z=await i.callTool({name:"PROJECT_CONNECTION_ADD",arguments:{projectId:o.id,connectionId:s}});te(Z)},e[22]=i,e[23]=o.id,e[24]=p):p=e[24];let x;e[25]!==f?(x=()=>f(),e[25]=f,e[26]=x):x=e[26];let z;e[27]!==x||e[28]!==p?(z={mutationFn:p,onSuccess:x,onError:ze},e[27]=x,e[28]=p,e[29]=z):z=e[29];const J=oe(z);let h;e[30]!==i||e[31]!==o.id?(h=async s=>{const Z=await i.callTool({name:"PROJECT_CONNECTION_REMOVE",arguments:{projectId:o.id,connectionId:s}});te(Z)},e[30]=i,e[31]=o.id,e[32]=h):h=e[32];let j;e[33]!==f?(j=()=>f(),e[33]=f,e[34]=j):j=e[34];let R;e[35]!==h||e[36]!==j?(R={mutationFn:h,onSuccess:j,onError:ke},e[35]=h,e[36]=j,e[37]=R):R=e[37];const A=oe(R);let F;e[38]!==J?(F=s=>{se(!1),J.mutate(s)},e[38]=J,e[39]=F):F=e[39];const U=F;let D;e[40]!==A?(D=s=>{A.mutate(s)},e[40]=A,e[41]=D):D=e[41];const ce=D,ae="space-y-4",B=ge;let g;e[42]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ce,{asChild:!0,children:t.jsxs(xe,{variant:"outline",size:"sm",className:"gap-1.5",children:[t.jsx(_e,{size:14}),"Add connection"]})}),e[42]=g):g=e[42];const G=je,de="w-72 p-0",me="start",V=Ne;let C;e[43]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(ye,{placeholder:"Search connections..."}),e[43]=C):C=e[43];const Y=ve;let b;e[44]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Ee,{children:"No connections found."}),e[44]=b):b=e[44];const H=be;let M;e[45]!==U?(M=s=>t.jsxs(Te,{value:s.title,onSelect:()=>U(s.id),children:[t.jsx(ie,{icon:s.icon,title:s.title}),t.jsx("span",{className:"truncate",children:s.title}),t.jsx("span",{className:ne("ml-auto inline-block size-1.5 shrink-0 rounded-full",s.status==="active"?"bg-success":s.status==="error"?"bg-destructive":"bg-muted-foreground")})]},s.id),e[45]=U,e[46]=M):M=e[46];const W=le.map(M);let v;e[47]!==H||e[48]!==W?(v=t.jsx(H,{children:W}),e[47]=H,e[48]=W,e[49]=v):v=e[49];let N;e[50]!==Y||e[51]!==b||e[52]!==v?(N=t.jsxs(Y,{children:[b,v]}),e[50]=Y,e[51]=b,e[52]=v,e[53]=N):N=e[53];let y;e[54]!==V||e[55]!==C||e[56]!==N?(y=t.jsxs(V,{children:[C,N]}),e[54]=V,e[55]=C,e[56]=N,e[57]=y):y=e[57];let E;e[58]!==G||e[59]!==y?(E=t.jsx(G,{className:de,align:me,children:y}),e[58]=G,e[59]=y,e[60]=E):E=e[60];let T;e[61]!==B||e[62]!==Q||e[63]!==g||e[64]!==E?(T=t.jsxs(B,{open:Q,onOpenChange:se,children:[g,E]}),e[61]=B,e[62]=Q,e[63]=g,e[64]=E,e[65]=T):T=e[65];const X=I.length>0&&t.jsx("div",{className:"flex flex-col",children:I.map(s=>t.jsxs("div",{className:"flex items-center justify-between gap-4 py-3 border-b border-border last:border-0",children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[t.jsx(ie,{icon:s.icon,title:s.title}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.title}),t.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:s.connection_type}),t.jsx("span",{className:ne("inline-block size-1.5 rounded-full",s.status==="active"?"bg-success":s.status==="error"?"bg-destructive":"bg-muted-foreground")})]})]})]}),t.jsx("button",{type:"button",onClick:()=>ce(s.id),disabled:A.isPending,className:"shrink-0 rounded-md p-1 text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors",children:t.jsx(Ie,{size:14})})]},s.id))});let _;e[66]!==I.length?(_=I.length===0&&t.jsx("p",{className:"text-sm text-muted-foreground py-4",children:"No connections added yet. Add connections from the organization to make them available in this project."}),e[66]=I.length,e[67]=_):_=e[67];let q;return e[68]!==T||e[69]!==X||e[70]!==_?(q=t.jsxs("div",{className:ae,children:[T,X,_]}),e[68]=T,e[69]=X,e[70]=_,e[71]=q):q=e[71],q}function ke(e){re.error("Failed to remove connection: "+(e instanceof Error?e.message:"Unknown error"))}function ze(e){re.error("Failed to add connection: "+(e instanceof Error?e.message:"Unknown error"))}function Re(e){return e.id}function Ae(){const e=K.c(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Connections"}),t.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose which organization connections are available to this project."})]}),t.jsx(we,{})]}),e[0]=n):n=e[0],n}function Ve(){const e=K.c(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Ae,{}),e[0]=n):n=e[0],n}export{Ve as default};
1
+ import{c as K,j as t,u as ue,n as fe,r as pe,v as ne,K as ee,B as xe,t as re}from"./index-BkxNgQ-z.js";import{u as he}from"./useQuery-Cj-miqA2.js";import{u as oe}from"./useMutation-DtOoZO7h.js";import{P as je,a as ge,b as Ce}from"./popover-CJnKtmVV.js";import{C as be,a as ve,b as Ne,c as ye,d as Ee,e as Te}from"./command-BvChE5AN.js";import{s as _e}from"./Plus-4zX3n4bH.js";import{i as Ie}from"./X-CpsrVd7E.js";import{h as Pe}from"./use-connection-DjiXkPUz.js";import{a as Se,u as Oe}from"./constants--aQ9HnxF.js";import{u as te}from"./unwrap-tool-result-BYXdCQMg.js";import"./index-CKt9M-ST.js";import"./SearchMd-BvHN4xgB.js";function ie(e){const n=K.c(6),{icon:o,title:c}=e;if(o){let a;return n[0]!==o?(a=t.jsx("img",{src:o,alt:"",className:"size-5 shrink-0 rounded"}),n[0]=o,n[1]=a):a=n[1],a}let i;n[2]!==c?(i=c.charAt(0).toUpperCase(),n[2]=c,n[3]=i):i=n[3];let r;return n[4]!==i?(r=t.jsx("div",{className:"size-5 shrink-0 rounded bg-muted flex items-center justify-center",children:t.jsx("span",{className:"text-[10px] font-medium text-muted-foreground",children:i})}),n[4]=i,n[5]=r):r=n[5],r}function we(){const e=K.c(72),{org:n,project:o}=ue();let c;e[0]!==n.id?(c={connectionId:Se,orgId:n.id},e[0]=n.id,e[1]=c):c=e[1];const i=Oe(c),r=fe(),a=Pe(),l=o.id??"",[Q,se]=pe.useState(!1);let d;e[2]!==l?(d=ee.projectConnections(l),e[2]=l,e[3]=d):d=e[3];const L=!!o.id;let m;e[4]!==i||e[5]!==l?(m=async()=>{const s=await i.callTool({name:"PROJECT_CONNECTION_LIST",arguments:{projectId:l}});return te(s)},e[4]=i,e[5]=l,e[6]=m):m=e[6];let P;e[7]!==d||e[8]!==L||e[9]!==m?(P={queryKey:d,enabled:L,queryFn:m},e[7]=d,e[8]=L,e[9]=m,e[10]=P):P=e[10];const{data:$}=he(P);let S;e[11]!==$?.connections?(S=new Set(($?.connections??[]).map(Re)),e[11]=$?.connections,e[12]=S):S=e[12];const u=S;let O;e[13]!==u?(O=s=>u.has(s.id),e[13]=u,e[14]=O):O=e[14];const I=(a??[]).filter(O);let w;e[15]!==u?(w=s=>!u.has(s.id),e[15]=u,e[16]=w):w=e[16];const le=(a??[]).filter(w);let k;e[17]!==n.id||e[18]!==o.slug||e[19]!==l||e[20]!==r?(k=()=>{r.invalidateQueries({queryKey:ee.projectConnections(l)}),r.invalidateQueries({queryKey:ee.project(n.id,o.slug)})},e[17]=n.id,e[18]=o.slug,e[19]=l,e[20]=r,e[21]=k):k=e[21];const f=k;let p;e[22]!==i||e[23]!==o.id?(p=async s=>{const Z=await i.callTool({name:"PROJECT_CONNECTION_ADD",arguments:{projectId:o.id,connectionId:s}});te(Z)},e[22]=i,e[23]=o.id,e[24]=p):p=e[24];let x;e[25]!==f?(x=()=>f(),e[25]=f,e[26]=x):x=e[26];let z;e[27]!==x||e[28]!==p?(z={mutationFn:p,onSuccess:x,onError:ze},e[27]=x,e[28]=p,e[29]=z):z=e[29];const J=oe(z);let h;e[30]!==i||e[31]!==o.id?(h=async s=>{const Z=await i.callTool({name:"PROJECT_CONNECTION_REMOVE",arguments:{projectId:o.id,connectionId:s}});te(Z)},e[30]=i,e[31]=o.id,e[32]=h):h=e[32];let j;e[33]!==f?(j=()=>f(),e[33]=f,e[34]=j):j=e[34];let R;e[35]!==h||e[36]!==j?(R={mutationFn:h,onSuccess:j,onError:ke},e[35]=h,e[36]=j,e[37]=R):R=e[37];const A=oe(R);let F;e[38]!==J?(F=s=>{se(!1),J.mutate(s)},e[38]=J,e[39]=F):F=e[39];const U=F;let D;e[40]!==A?(D=s=>{A.mutate(s)},e[40]=A,e[41]=D):D=e[41];const ce=D,ae="space-y-4",B=ge;let g;e[42]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ce,{asChild:!0,children:t.jsxs(xe,{variant:"outline",size:"sm",className:"gap-1.5",children:[t.jsx(_e,{size:14}),"Add connection"]})}),e[42]=g):g=e[42];const G=je,de="w-72 p-0",me="start",V=Ne;let C;e[43]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(ye,{placeholder:"Search connections..."}),e[43]=C):C=e[43];const Y=ve;let b;e[44]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Ee,{children:"No connections found."}),e[44]=b):b=e[44];const H=be;let M;e[45]!==U?(M=s=>t.jsxs(Te,{value:s.title,onSelect:()=>U(s.id),children:[t.jsx(ie,{icon:s.icon,title:s.title}),t.jsx("span",{className:"truncate",children:s.title}),t.jsx("span",{className:ne("ml-auto inline-block size-1.5 shrink-0 rounded-full",s.status==="active"?"bg-success":s.status==="error"?"bg-destructive":"bg-muted-foreground")})]},s.id),e[45]=U,e[46]=M):M=e[46];const W=le.map(M);let v;e[47]!==H||e[48]!==W?(v=t.jsx(H,{children:W}),e[47]=H,e[48]=W,e[49]=v):v=e[49];let N;e[50]!==Y||e[51]!==b||e[52]!==v?(N=t.jsxs(Y,{children:[b,v]}),e[50]=Y,e[51]=b,e[52]=v,e[53]=N):N=e[53];let y;e[54]!==V||e[55]!==C||e[56]!==N?(y=t.jsxs(V,{children:[C,N]}),e[54]=V,e[55]=C,e[56]=N,e[57]=y):y=e[57];let E;e[58]!==G||e[59]!==y?(E=t.jsx(G,{className:de,align:me,children:y}),e[58]=G,e[59]=y,e[60]=E):E=e[60];let T;e[61]!==B||e[62]!==Q||e[63]!==g||e[64]!==E?(T=t.jsxs(B,{open:Q,onOpenChange:se,children:[g,E]}),e[61]=B,e[62]=Q,e[63]=g,e[64]=E,e[65]=T):T=e[65];const X=I.length>0&&t.jsx("div",{className:"flex flex-col",children:I.map(s=>t.jsxs("div",{className:"flex items-center justify-between gap-4 py-3 border-b border-border last:border-0",children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[t.jsx(ie,{icon:s.icon,title:s.title}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.title}),t.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:s.connection_type}),t.jsx("span",{className:ne("inline-block size-1.5 rounded-full",s.status==="active"?"bg-success":s.status==="error"?"bg-destructive":"bg-muted-foreground")})]})]})]}),t.jsx("button",{type:"button",onClick:()=>ce(s.id),disabled:A.isPending,className:"shrink-0 rounded-md p-1 text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors",children:t.jsx(Ie,{size:14})})]},s.id))});let _;e[66]!==I.length?(_=I.length===0&&t.jsx("p",{className:"text-sm text-muted-foreground py-4",children:"No connections added yet. Add connections from the organization to make them available in this project."}),e[66]=I.length,e[67]=_):_=e[67];let q;return e[68]!==T||e[69]!==X||e[70]!==_?(q=t.jsxs("div",{className:ae,children:[T,X,_]}),e[68]=T,e[69]=X,e[70]=_,e[71]=q):q=e[71],q}function ke(e){re.error("Failed to remove connection: "+(e instanceof Error?e.message:"Unknown error"))}function ze(e){re.error("Failed to add connection: "+(e instanceof Error?e.message:"Unknown error"))}function Re(e){return e.id}function Ae(){const e=K.c(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Connections"}),t.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose which organization connections are available to this project."})]}),t.jsx(we,{})]}),e[0]=n):n=e[0],n}function Ve(){const e=K.c(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Ae,{}),e[0]=n):n=e[0],n}export{Ve as default};
@@ -1 +1 @@
1
- import{c as n,j as i,a8 as g,v as c,a9 as u,aa as m,ab as x,ac as j,ad as N,ae as b,af as D}from"./index-BiG-bBX7.js";import{i as h}from"./X-B9LxUp5o.js";function C(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(N,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(b,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function w(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(u,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function T(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(m,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{C as D,w as a,T as b,B as c,E as d,R as e,k as f};
1
+ import{c as n,j as i,a8 as g,v as c,a9 as u,aa as m,ab as x,ac as j,ad as N,ae as b,af as D}from"./index-BkxNgQ-z.js";import{i as h}from"./X-CpsrVd7E.js";function C(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(N,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(b,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function w(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(u,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function T(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(m,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{C as D,w as a,T as b,B as c,E as d,R as e,k as f};
@@ -1 +1 @@
1
- import{c,j as d,ah as p,v as u,ai as f,aj as m,ak as g,al as x,am as v,an as b,ao as h,ap as w,aq as j,ar as N,as as z}from"./index-BiG-bBX7.js";import{i as y}from"./Check-Bs28PslG.js";import{i as D}from"./ChevronRight-8LnYcsyR.js";function S(n){const e=c.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(g,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(n){const e=c.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(p,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function C(n){const e=c.c(10);let t,s,a;e[0]!==n?({className:t,sideOffset:a,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);const o=a===void 0?4:a;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==o||e[8]!==r?(i=d.jsx(x,{children:d.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:o,className:r,...s})}),e[6]=s,e[7]=o,e[8]=r,e[9]=i):i=e[9],i}function I(n){const e=c.c(12);let t,s,a,o;e[0]!==n?({className:t,inset:s,variant:o,...a}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);const r=o===void 0?"default":o;let i;e[5]!==t?(i=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==a||e[9]!==i||e[10]!==r?(l=d.jsx(m,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:i,...a}),e[7]=s,e[8]=a,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function T(n){const e=c.c(13);let t,s,a,o;e[0]!==n?({className:a,children:s,checked:t,...o}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]!==a?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",a),e[5]=a,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(w,{children:d.jsx(y,{className:"size-4"})})}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==o||e[11]!==r?(l=d.jsxs(f,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...o,children:[i,s]}),e[8]=t,e[9]=s,e[10]=o,e[11]=r,e[12]=l):l=e[12],l}function R(n){const e=c.c(10);let t,s,a;e[0]!==n?({className:t,inset:s,...a}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);let o;e[4]!==t?(o=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=o):o=e[5];let r;return e[6]!==s||e[7]!==a||e[8]!==o?(r=d.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:o,...a}),e[6]=s,e[7]=a,e[8]=o,e[9]=r):r=e[9],r}function E(n){const e=c.c(8);let t,s;e[0]!==n?({className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=d.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function L(n){const e=c.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function O(n){const e=c.c(13);let t,s,a,o;e[0]!==n?({className:s,inset:a,children:t,...o}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(D,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==o||e[11]!==r?(l=d.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...o,children:[t,i]}),e[8]=t,e[9]=a,e[10]=o,e[11]=r,e[12]=l):l=e[12],l}function q(n){const e=c.c(8);let t,s;e[0]!==n?({className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=d.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{S as D,k as a,C as b,I as c,L as d,O as e,q as f,E as g,T as h,R as i};
1
+ import{c,j as d,ah as p,v as u,ai as f,aj as m,ak as g,al as x,am as v,an as b,ao as h,ap as w,aq as j,ar as N,as as z}from"./index-BkxNgQ-z.js";import{i as y}from"./Check-BuBqfL8V.js";import{i as D}from"./ChevronRight-u7jqeZNG.js";function S(n){const e=c.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(g,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(n){const e=c.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(p,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function C(n){const e=c.c(10);let t,s,a;e[0]!==n?({className:t,sideOffset:a,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);const o=a===void 0?4:a;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==o||e[8]!==r?(i=d.jsx(x,{children:d.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:o,className:r,...s})}),e[6]=s,e[7]=o,e[8]=r,e[9]=i):i=e[9],i}function I(n){const e=c.c(12);let t,s,a,o;e[0]!==n?({className:t,inset:s,variant:o,...a}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);const r=o===void 0?"default":o;let i;e[5]!==t?(i=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==a||e[9]!==i||e[10]!==r?(l=d.jsx(m,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:i,...a}),e[7]=s,e[8]=a,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function T(n){const e=c.c(13);let t,s,a,o;e[0]!==n?({className:a,children:s,checked:t,...o}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]!==a?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",a),e[5]=a,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(w,{children:d.jsx(y,{className:"size-4"})})}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==o||e[11]!==r?(l=d.jsxs(f,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...o,children:[i,s]}),e[8]=t,e[9]=s,e[10]=o,e[11]=r,e[12]=l):l=e[12],l}function R(n){const e=c.c(10);let t,s,a;e[0]!==n?({className:t,inset:s,...a}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);let o;e[4]!==t?(o=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=o):o=e[5];let r;return e[6]!==s||e[7]!==a||e[8]!==o?(r=d.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:o,...a}),e[6]=s,e[7]=a,e[8]=o,e[9]=r):r=e[9],r}function E(n){const e=c.c(8);let t,s;e[0]!==n?({className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=d.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function L(n){const e=c.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function O(n){const e=c.c(13);let t,s,a,o;e[0]!==n?({className:s,inset:a,children:t,...o}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(D,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==o||e[11]!==r?(l=d.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...o,children:[t,i]}),e[8]=t,e[9]=a,e[10]=o,e[11]=r,e[12]=l):l=e[12],l}function q(n){const e=c.c(8);let t,s;e[0]!==n?({className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=d.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{S as D,k as a,C as b,I as c,L as d,O as e,q as f,E as g,T as h,R as i};
@@ -1 +1 @@
1
- import{c as R,u as W,e as A,d as X,K as Z,j as n,r as q,aE as J,B as ee,aD as te,b8 as ne}from"./index-BiG-bBX7.js";import{i as v}from"./Loading01-W-w3cVps.js";import{c as ie}from"./binder-Bx_2YVEH.js";import{P as $}from"./topbar-portal-Dfkwqxry.js";import{u as se}from"./useQuery-Us1whSan.js";import{h as oe}from"./use-connection-CsobI-JA.js";import{a as le,u as re,j as ce}from"./constants-Bj4b22ad.js";import{t as ae}from"./Settings01-D3dDBLbY.js";import{P as E}from"./index-ehKjC5PZ.js";import"./useMutation-Cxle_Mtw.js";import"./localstorage-keys-BS2STbF7.js";import"./tooltip-BacoSwd7.js";import"./index-BxikKkX5.js";function de(t,e){return t?t.filter(m=>ie(m,e)):[]}function K(t){return{id:t.id,title:t.title,icon:t.icon,description:t.description,app_name:t.app_name,app_id:t.app_id,tools:t.tools,metadata:t.metadata}}function me(t){const e=R.c(35),{binding:m,renderHeader:f,renderEmptyState:i}=t,{org:o,project:l}=W();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const{org:r,project:g,pluginId:u}=A(a),Q=oe(),{data:y}=X.useSession();let _;e[1]!==o.id?(_={connectionId:le,orgId:o.id},e[1]=o.id,e[2]=_):_=e[2];const H=re(_);let x;e[3]!==u||e[4]!==l.id?(x=Z.projectPluginConfig(l.id??"",u),e[3]=u,e[4]=l.id,e[5]=x):x=e[5];let p;e[6]!==u||e[7]!==l.id||e[8]!==H?(p=async()=>{const s=await H.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:l.id,pluginId:u}});return s.structuredContent??s},e[6]=u,e[7]=l.id,e[8]=H,e[9]=p):p=e[9];const T=!!l.id&&!!u;let b;e[10]!==x||e[11]!==p||e[12]!==T?(b={queryKey:x,queryFn:p,enabled:T},e[10]=x,e[11]=p,e[12]=T,e[13]=b):b=e[13];const{data:U,isLoading:Y}=se(b),D=de(Q,m),F=U?.config?.connectionId,j=F?D.find(s=>s.id===F):null,P=ce({connectionId:j?.id,orgId:o.id}),w=y?.user?{user:{id:y.user.id,name:y.user.name,email:y.user.email,image:y.user.image}}:null,z={id:o.id,slug:o.slug,name:o.name};if(Y){let s;return e[14]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),e[14]=s):s=e[14],s}if(D.length===0){const s={connectionId:null,connection:null,toolCaller:null,org:z,session:w};let c;e[15]!==i?(c=i(),e[15]=i,e[16]=c):c=e[16];let d;return e[17]!==c?(d=n.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:c}),e[17]=c,e[18]=d):d=e[18],n.jsx($,{value:s,children:d})}if(!j){const s={connectionId:null,connection:null,toolCaller:null,org:z,session:w};let c;e[19]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[n.jsx(ae,{size:48,className:"text-muted-foreground mb-2"}),n.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a connection to be configured. Go to project settings to select which integration to use."})]}),e[19]=c):c=e[19];const d=r??o.slug,O=g??l.slug??"";let L;return e[20]!==d||e[21]!==O?(L=n.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:[c,n.jsx(ee,{asChild:!0,children:n.jsx(te,{to:"/$org/$project/settings",params:{org:d,project:O},children:"Go to Project Settings"})})]}),e[20]=d,e[21]=O,e[22]=L):L=e[22],n.jsx($,{value:s,children:L})}let S;e[23]!==P?(S=(s,c)=>P?P.callTool({name:s,arguments:c}).then(fe):Promise.reject(new Error("MCP client is not available")),e[23]=P,e[24]=S):S=e[24];const V={connectionId:j.id,connection:K(j),toolCaller:S,org:z,session:w},B=E,G=E,k=E,M=f({connections:[K(j)],selectedConnectionId:j.id,onConnectionChange:ue});let h;e[25]!==M||e[26]!==k.Header.Left?(h=n.jsx(k.Header.Left,{children:M}),e[25]=M,e[26]=k.Header.Left,e[27]=h):h=e[27];let C;e[28]!==h||e[29]!==G.Header?(C=n.jsx(G.Header,{children:h}),e[28]=h,e[29]=G.Header,e[30]=C):C=e[30];let N;e[31]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(E.Content,{children:n.jsx(q.Suspense,{fallback:n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),children:n.jsx(J,{})})}),e[31]=N):N=e[31];let I;return e[32]!==B||e[33]!==C?(I=n.jsxs(B,{children:[C,N]}),e[32]=B,e[33]=C,e[34]=I):I=e[34],n.jsx($,{value:V,children:I})}function ue(){}function fe(t){return t.structuredContent??t}function Le(){const t=R.c(12);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{pluginId:m}=A(e);let f;t[1]!==m?(f=ne.find(r=>r.id===m),t[1]=m,t[2]=f):f=t[2];const i=f;if(i?.renderHeader&&i?.renderEmptyState&&i?.binding){let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),t[3]=r):r=t[3];let g;return t[4]!==i.binding||t[5]!==i.renderEmptyState||t[6]!==i.renderHeader?(g=n.jsx(q.Suspense,{fallback:r,children:n.jsx(me,{binding:i.binding,renderHeader:i.renderHeader,renderEmptyState:i.renderEmptyState})}),t[4]=i.binding,t[5]=i.renderEmptyState,t[6]=i.renderHeader,t[7]=g):g=t[7],g}const o=i?.LayoutComponent;if(!o){let r;return t[8]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(J,{}),t[8]=r):r=t[8],r}let l;t[9]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),t[9]=l):l=t[9];let a;return t[10]!==o?(a=n.jsx(q.Suspense,{fallback:l,children:n.jsx(o,{})}),t[10]=o,t[11]=a):a=t[11],a}export{Le as default};
1
+ import{c as R,u as W,e as A,d as X,K as Z,j as n,r as q,aE as J,B as ee,aD as te,b8 as ne}from"./index-BkxNgQ-z.js";import{i as v}from"./Loading01-BLoQsWVt.js";import{c as ie}from"./binder-DUACCYIe.js";import{P as $}from"./topbar-portal-CyxFPAeb.js";import{u as se}from"./useQuery-Cj-miqA2.js";import{h as oe}from"./use-connection-DjiXkPUz.js";import{a as le,u as re,j as ce}from"./constants--aQ9HnxF.js";import{t as ae}from"./Settings01-B5kunEo2.js";import{P as E}from"./index-B4YFEuZr.js";import"./useMutation-DtOoZO7h.js";import"./localstorage-keys-2beZrYfY.js";import"./tooltip-DvMRS01W.js";import"./index-dKQNml8k.js";function de(t,e){return t?t.filter(m=>ie(m,e)):[]}function K(t){return{id:t.id,title:t.title,icon:t.icon,description:t.description,app_name:t.app_name,app_id:t.app_id,tools:t.tools,metadata:t.metadata}}function me(t){const e=R.c(35),{binding:m,renderHeader:f,renderEmptyState:i}=t,{org:o,project:l}=W();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const{org:r,project:g,pluginId:u}=A(a),Q=oe(),{data:y}=X.useSession();let _;e[1]!==o.id?(_={connectionId:le,orgId:o.id},e[1]=o.id,e[2]=_):_=e[2];const H=re(_);let x;e[3]!==u||e[4]!==l.id?(x=Z.projectPluginConfig(l.id??"",u),e[3]=u,e[4]=l.id,e[5]=x):x=e[5];let p;e[6]!==u||e[7]!==l.id||e[8]!==H?(p=async()=>{const s=await H.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:l.id,pluginId:u}});return s.structuredContent??s},e[6]=u,e[7]=l.id,e[8]=H,e[9]=p):p=e[9];const T=!!l.id&&!!u;let b;e[10]!==x||e[11]!==p||e[12]!==T?(b={queryKey:x,queryFn:p,enabled:T},e[10]=x,e[11]=p,e[12]=T,e[13]=b):b=e[13];const{data:U,isLoading:Y}=se(b),D=de(Q,m),F=U?.config?.connectionId,j=F?D.find(s=>s.id===F):null,P=ce({connectionId:j?.id,orgId:o.id}),w=y?.user?{user:{id:y.user.id,name:y.user.name,email:y.user.email,image:y.user.image}}:null,z={id:o.id,slug:o.slug,name:o.name};if(Y){let s;return e[14]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),e[14]=s):s=e[14],s}if(D.length===0){const s={connectionId:null,connection:null,toolCaller:null,org:z,session:w};let c;e[15]!==i?(c=i(),e[15]=i,e[16]=c):c=e[16];let d;return e[17]!==c?(d=n.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:c}),e[17]=c,e[18]=d):d=e[18],n.jsx($,{value:s,children:d})}if(!j){const s={connectionId:null,connection:null,toolCaller:null,org:z,session:w};let c;e[19]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[n.jsx(ae,{size:48,className:"text-muted-foreground mb-2"}),n.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a connection to be configured. Go to project settings to select which integration to use."})]}),e[19]=c):c=e[19];const d=r??o.slug,O=g??l.slug??"";let L;return e[20]!==d||e[21]!==O?(L=n.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:[c,n.jsx(ee,{asChild:!0,children:n.jsx(te,{to:"/$org/$project/settings",params:{org:d,project:O},children:"Go to Project Settings"})})]}),e[20]=d,e[21]=O,e[22]=L):L=e[22],n.jsx($,{value:s,children:L})}let S;e[23]!==P?(S=(s,c)=>P?P.callTool({name:s,arguments:c}).then(fe):Promise.reject(new Error("MCP client is not available")),e[23]=P,e[24]=S):S=e[24];const V={connectionId:j.id,connection:K(j),toolCaller:S,org:z,session:w},B=E,G=E,k=E,M=f({connections:[K(j)],selectedConnectionId:j.id,onConnectionChange:ue});let h;e[25]!==M||e[26]!==k.Header.Left?(h=n.jsx(k.Header.Left,{children:M}),e[25]=M,e[26]=k.Header.Left,e[27]=h):h=e[27];let C;e[28]!==h||e[29]!==G.Header?(C=n.jsx(G.Header,{children:h}),e[28]=h,e[29]=G.Header,e[30]=C):C=e[30];let N;e[31]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(E.Content,{children:n.jsx(q.Suspense,{fallback:n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),children:n.jsx(J,{})})}),e[31]=N):N=e[31];let I;return e[32]!==B||e[33]!==C?(I=n.jsxs(B,{children:[C,N]}),e[32]=B,e[33]=C,e[34]=I):I=e[34],n.jsx($,{value:V,children:I})}function ue(){}function fe(t){return t.structuredContent??t}function Le(){const t=R.c(12);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{pluginId:m}=A(e);let f;t[1]!==m?(f=ne.find(r=>r.id===m),t[1]=m,t[2]=f):f=t[2];const i=f;if(i?.renderHeader&&i?.renderEmptyState&&i?.binding){let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),t[3]=r):r=t[3];let g;return t[4]!==i.binding||t[5]!==i.renderEmptyState||t[6]!==i.renderHeader?(g=n.jsx(q.Suspense,{fallback:r,children:n.jsx(me,{binding:i.binding,renderHeader:i.renderHeader,renderEmptyState:i.renderEmptyState})}),t[4]=i.binding,t[5]=i.renderEmptyState,t[6]=i.renderHeader,t[7]=g):g=t[7],g}const o=i?.LayoutComponent;if(!o){let r;return t[8]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(J,{}),t[8]=r):r=t[8],r}let l;t[9]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),t[9]=l):l=t[9];let a;return t[10]!==o?(a=n.jsx(q.Suspense,{fallback:l,children:n.jsx(o,{})}),t[10]=o,t[11]=a):a=t[11],a}export{Le as default};
@@ -1,4 +1,4 @@
1
- import{c as R,r as D,v as E,j as t}from"./index-BiG-bBX7.js";import{i as de}from"./AlertCircle-BIVpB2eV.js";import{i as ue}from"./CheckCircle-BnSsCPeL.js";import{n as Y}from"./ChevronLeft-fmgWXUdB.js";import{i as me}from"./Loading01-W-w3cVps.js";import{i as fe}from"./XCircle-Dkkdz5ph.js";import{s as Z}from"./XClose-7hYEQUhK.js";import{c as xe}from"./usage-B8eRkRZY.js";import{I as pe}from"./integration-icon-DJplt18U.js";import{a as he,u as ge}from"./collapsible-DRIF4wXT.js";function A(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}function ee(s){if(!s)return"—";const e=typeof s=="string"?new Date(s):s;return isNaN(e.getTime())?"—":e.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function be(s){return s?s.replace(/-\d{8}(?:-[a-z0-9]+)*$/i,"").replace(/-/g," "):"—"}function je(s){const e=R.c(4),{items:n}=s;let a;e[0]!==n?(a=n.map(ve),e[0]=n,e[1]=a):a=e[1];let r;return e[2]!==a?(r=t.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-6",children:a}),e[2]=a,e[3]=r):r=e[3],r}function ve(s){return t.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[t.jsx("span",{className:"text-xs text-muted-foreground truncate",children:s.label}),t.jsx("span",{className:"text-sm text-foreground tabular-nums truncate",children:s.value})]},s.label)}function Ne(s){const e=R.c(30),{userTokens:n,assistantTokens:a,otherTokens:r}=s,k=n+a+r,w=k>0?n/k*100:0,o=k>0?a/k*100:0,N=k>0?r/k*100:0;let u;e[0]!==w?(u=w>0&&t.jsx("div",{className:"h-full bg-chart-1",style:{width:`${w}%`}}),e[0]=w,e[1]=u):u=e[1];let g;e[2]!==o?(g=o>0&&t.jsx("div",{className:"h-full bg-chart-2",style:{width:`${o}%`}}),e[2]=o,e[3]=g):g=e[3];let v;e[4]!==N?(v=N>0&&t.jsx("div",{className:"h-full bg-muted-foreground/30",style:{width:`${N}%`}}),e[4]=N,e[5]=v):v=e[5];let h;e[6]!==u||e[7]!==g||e[8]!==v?(h=t.jsxs("div",{className:"flex h-2 w-full overflow-hidden rounded-full bg-muted",children:[u,g,v]}),e[6]=u,e[7]=g,e[8]=v,e[9]=h):h=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-1 shrink-0"}),e[10]=x):x=e[10];let c;e[11]!==w?(c=w.toFixed(1),e[11]=w,e[12]=c):c=e[12];let b;e[13]!==c?(b=t.jsxs("div",{className:"flex items-center gap-1.5",children:[x,t.jsxs("span",{className:"text-xs text-muted-foreground",children:["User ",c,"%"]})]}),e[13]=c,e[14]=b):b=e[14];let d;e[15]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-2 shrink-0"}),e[15]=d):d=e[15];let m;e[16]!==o?(m=o.toFixed(1),e[16]=o,e[17]=m):m=e[17];let f;e[18]!==m?(f=t.jsxs("div",{className:"flex items-center gap-1.5",children:[d,t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Assistant ",m,"%"]})]}),e[18]=m,e[19]=f):f=e[19];let l;e[20]!==N||e[21]!==r?(l=r>0&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-muted-foreground/30 shrink-0"}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Other ",N.toFixed(1),"%"]})]}),e[20]=N,e[21]=r,e[22]=l):l=e[22];let i;e[23]!==f||e[24]!==l||e[25]!==b?(i=t.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[b,f,l]}),e[23]=f,e[24]=l,e[25]=b,e[26]=i):i=e[26];let p;return e[27]!==i||e[28]!==h?(p=t.jsxs("div",{className:"flex flex-col gap-2",children:[h,i]}),e[27]=i,e[28]=h,e[29]=p):p=e[29],p}function Be(s){const e=R.c(61),{onClose:n,back:a,className:r}=s,[k,w]=D.useState(null),{messages:o,tasks:N,activeTaskId:u,selectedModel:g,selectedVirtualMcp:v,virtualMcps:h}=he();let x,c,b,d,m,f,l,i;if(e[0]!==u||e[1]!==a||e[2]!==r||e[3]!==o||e[4]!==n||e[5]!==k?.id||e[6]!==g||e[7]!==v?.title||e[8]!==N||e[9]!==h){i=Symbol.for("react.early_return_sentinel");e:{let $;e[18]!==u?($=j=>j.id===u,e[18]=u,e[19]=$):$=e[19];const L=N.find($),S=xe(o),F=g?.thinking?.limits?.contextWindow??null,Q=F&&F>0?(S.totalTokens/F*100).toFixed(1):null,J=o;let P;e[20]!==J?(P=J.filter(Ce).reduce(_e,0),e[20]=J,e[21]=P):P=e[21];const U=P,V=o;let B;e[22]!==V?(B=V.filter(Se).reduce(Te,0),e[22]=V,e[23]=B):B=e[23];const O=B,H=Math.max(0,S.totalTokens-U-O),te=o[0],se=o.at(-1),ne=te?.metadata?.created_at??L?.created_at,le=se?.metadata?.created_at??L?.updated_at,W=o.filter(we);let K;e[24]!==h?(K=j=>(j.parts??[]).filter(ye).map(y=>{const _=y.input?.agent_id,C=_?h.find(ce=>ce.id===_):null,z=y.state==="input-streaming"||y.state==="input-available"||y.state==="output-available"&&y.preliminary===!0,I=y.state==="output-error",oe=y.state==="approval-requested";return{part:y,agentTitle:C?.title??"Subtask",agentIcon:C?.icon??null,isRunning:z,isError:I,isApproval:oe}}),e[24]=h,e[25]=K):K=e[25];const X=o.flatMap(K),ae=g?.thinking?.id?be(g.thinking.id):"—",re=v?.title??"Decopilot",ie=[{label:"Session",value:L?.title??"New chat"},{label:"Messages",value:W.length},{label:"Agent",value:re},{label:"Model",value:ae},{label:"Context Limit",value:F?A(F):"—"},{label:"Total Tokens",value:S.totalTokens>0?A(S.totalTokens):"0"},{label:"Usage",value:Q!==null?`${Q}%`:"—"},{label:"Input Tokens",value:S.inputTokens>0?A(S.inputTokens):"0"},{label:"Output Tokens",value:S.outputTokens>0?A(S.outputTokens):"0"},{label:"Reasoning Tokens",value:S.reasoningTokens>0?A(S.reasoningTokens):"0"},{label:"Cost",value:S.cost>0?`$${S.cost<.001?S.cost.toFixed(6):S.cost.toFixed(4)}`:"$0.00"},{label:"Session Created",value:ee(ne)},{label:"Last Activity",value:ee(le)}];if(!L&&W.length===0){let j;e[26]!==r?(j=E("flex flex-col h-full w-full border-l border-border bg-background",r),e[26]=r,e[27]=j):j=e[27];let y;e[28]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Context"}),e[28]=y):y=e[28];let _;e[29]!==a?(_=a?t.jsx(Y,{size:14,className:"text-muted-foreground"}):t.jsx(Z,{size:14,className:"text-muted-foreground"}),e[29]=a,e[30]=_):_=e[30];let C;e[31]!==n||e[32]!==_?(C=t.jsxs("div",{className:"h-11 px-4 flex items-center justify-between shrink-0 border-b border-border/50",children:[y,t.jsx("button",{type:"button",onClick:n,className:"flex size-6 items-center justify-center rounded hover:bg-accent transition-colors",children:_})]}),e[31]=n,e[32]=_,e[33]=C):C=e[33];let z;e[34]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx("div",{className:"flex-1 flex items-center justify-center px-4 text-center",children:t.jsx("p",{className:"text-xs text-muted-foreground",children:"Start a conversation to see context"})}),e[34]=z):z=e[34];let I;e[35]!==j||e[36]!==C?(I=t.jsxs("div",{className:j,children:[C,z]}),e[35]=j,e[36]=C,e[37]=I):I=e[37],i=I;break e}e[38]!==r?(f=E("flex flex-col h-full w-full border-l border-border bg-background overflow-y-auto",r),e[38]=r,e[39]=f):f=e[39];let q;e[40]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Context"}),e[40]=q):q=e[40];let M;e[41]!==a?(M=a?t.jsx(Y,{size:14}):t.jsx(Z,{size:14}),e[41]=a,e[42]=M):M=e[42],e[43]!==n||e[44]!==M?(l=t.jsxs("div",{className:"flex h-11 shrink-0 items-center justify-between border-b border-border/50 px-4",children:[q,t.jsx("button",{type:"button",onClick:n,className:"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:M})]}),e[43]=n,e[44]=M,e[45]=l):l=e[45],x="flex flex-col gap-8 p-6",c=X.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Subtasks"}),t.jsx("div",{className:"flex flex-col gap-1",children:X.map(ke)})]}),b=t.jsx(je,{items:ie});let G;e[46]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx("span",{className:"text-xs text-muted-foreground",children:"Context Breakdown"}),e[46]=G):G=e[46],e[47]!==O||e[48]!==H||e[49]!==U?(d=t.jsxs("div",{className:"flex flex-col gap-3",children:[G,t.jsx(Ne,{userTokens:U,assistantTokens:O,otherTokens:H})]}),e[47]=O,e[48]=H,e[49]=U,e[50]=d):d=e[50],m=W.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Raw messages"}),t.jsx("div",{className:"flex flex-col gap-1",children:W.map(j=>{const y=j.metadata?.created_at,_=k?.id===j.id;return t.jsxs("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[t.jsxs("button",{type:"button",onClick:()=>w(_?null:j),className:"flex items-center justify-between gap-2 px-3 py-2 text-xs hover:bg-accent/50 w-full text-left cursor-pointer",children:[t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("span",{className:E("shrink-0 font-medium",j.role==="user"?"text-chart-1":"text-chart-2"),children:j.role}),t.jsx("span",{className:"text-muted-foreground",children:"•"}),t.jsx("span",{className:"truncate text-muted-foreground font-mono",children:j.id})]}),y&&t.jsx("span",{className:"shrink-0 text-muted-foreground tabular-nums",children:new Date(y).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})})]}),_&&t.jsx("pre",{className:"text-xs font-mono bg-muted px-3 py-2 overflow-auto whitespace-pre-wrap break-all border-t border-border/50 max-h-64",children:JSON.stringify(j,null,2)})]},j.id)})})]})}e[0]=u,e[1]=a,e[2]=r,e[3]=o,e[4]=n,e[5]=k?.id,e[6]=g,e[7]=v?.title,e[8]=N,e[9]=h,e[10]=x,e[11]=c,e[12]=b,e[13]=d,e[14]=m,e[15]=f,e[16]=l,e[17]=i}else x=e[10],c=e[11],b=e[12],d=e[13],m=e[14],f=e[15],l=e[16],i=e[17];if(i!==Symbol.for("react.early_return_sentinel"))return i;let p;e[51]!==x||e[52]!==c||e[53]!==b||e[54]!==d||e[55]!==m?(p=t.jsxs("div",{className:x,children:[c,b,d,m]}),e[51]=x,e[52]=c,e[53]=b,e[54]=d,e[55]=m,e[56]=p):p=e[56];let T;return e[57]!==f||e[58]!==l||e[59]!==p?(T=t.jsxs("div",{className:f,children:[l,p]}),e[57]=f,e[58]=l,e[59]=p,e[60]=T):T=e[60],T}function ke(s,e){return t.jsxs("div",{className:"flex items-center gap-2 text-xs min-w-0",children:[t.jsx(pe,{icon:s.agentIcon,name:s.agentTitle,size:"xs",className:"size-6 rounded-md shrink-0"}),t.jsx("span",{className:E("shrink-0 font-medium",s.isError?"text-destructive":"text-foreground"),children:s.agentTitle}),s.part.input?.prompt&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-muted-foreground/50",children:"·"}),t.jsx("span",{className:"truncate text-muted-foreground",children:s.part.input.prompt})]}),t.jsx("span",{className:"ml-auto shrink-0",children:s.isRunning?t.jsx(me,{size:12,className:"animate-spin text-muted-foreground"}):s.isError?t.jsx(fe,{size:12,className:"text-destructive"}):s.isApproval?t.jsx(de,{size:12,className:"text-warning"}):t.jsx(ue,{size:12,className:"text-emerald-500"})})]},e)}function ye(s){return s.type==="tool-subtask"}function we(s){return s.role!=="system"}function Te(s,e){const n=e.metadata?.usage;return s+(n?.outputTokens??0)}function Se(s){return s.role==="assistant"}function _e(s,e){const n=e.metadata?.usage;return s+(n?.inputTokens??0)}function Ce(s){return s.role==="user"}function $e(s){const e=R.c(22),{text:n,className:a,speed:r}=s,k=a===void 0?"":a,w=r===void 0?30:r,[o,N]=D.useState(!1),u=n.length/w*1e3,g=n.length,v=`${n.length}ch`;let h;e[0]!==u?(h=()=>{N(!1);const $=setTimeout(()=>{N(!0)},u);return()=>clearTimeout($)},e[0]=u,e[1]=h):h=e[1];let x;e[2]!==u||e[3]!==n?(x=[n,u],e[2]=u,e[3]=n,e[4]=x):x=e[4],D.useEffect(h,x);let c;e[5]!==k?(c=E(k,"block overflow-hidden inline-flex"),e[5]=k,e[6]=c):c=e[6];const b=`${u}ms`;let d;e[7]!==v||e[8]!==g||e[9]!==b?(d={"--typewriter-duration":b,"--typewriter-steps":g,"--typewriter-max-width":v},e[7]=v,e[8]=g,e[9]=b,e[10]=d):d=e[10];const m=d,f=o&&"truncate";let l;e[11]!==f?(l=E("typewriter-text",f),e[11]=f,e[12]=l):l=e[12];let i;e[13]!==l||e[14]!==n?(i=t.jsx("span",{className:l,children:n}),e[13]=l,e[14]=n,e[15]=i):i=e[15];let p;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("style",{children:`
1
+ import{c as R,r as D,v as E,j as t}from"./index-BkxNgQ-z.js";import{i as de}from"./AlertCircle-dxGFeayp.js";import{i as ue}from"./CheckCircle-B-t884rD.js";import{n as Y}from"./ChevronLeft-CJX984rp.js";import{i as me}from"./Loading01-BLoQsWVt.js";import{i as fe}from"./XCircle-BcvU_Xzf.js";import{s as Z}from"./XClose-CnTCpAeI.js";import{c as xe}from"./usage-B8eRkRZY.js";import{I as pe}from"./integration-icon-DqBJsR0X.js";import{a as he,u as ge}from"./collapsible-CG7okAAn.js";function A(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}function ee(s){if(!s)return"—";const e=typeof s=="string"?new Date(s):s;return isNaN(e.getTime())?"—":e.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function be(s){return s?s.replace(/-\d{8}(?:-[a-z0-9]+)*$/i,"").replace(/-/g," "):"—"}function je(s){const e=R.c(4),{items:n}=s;let a;e[0]!==n?(a=n.map(ve),e[0]=n,e[1]=a):a=e[1];let r;return e[2]!==a?(r=t.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-6",children:a}),e[2]=a,e[3]=r):r=e[3],r}function ve(s){return t.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[t.jsx("span",{className:"text-xs text-muted-foreground truncate",children:s.label}),t.jsx("span",{className:"text-sm text-foreground tabular-nums truncate",children:s.value})]},s.label)}function Ne(s){const e=R.c(30),{userTokens:n,assistantTokens:a,otherTokens:r}=s,k=n+a+r,w=k>0?n/k*100:0,o=k>0?a/k*100:0,N=k>0?r/k*100:0;let u;e[0]!==w?(u=w>0&&t.jsx("div",{className:"h-full bg-chart-1",style:{width:`${w}%`}}),e[0]=w,e[1]=u):u=e[1];let g;e[2]!==o?(g=o>0&&t.jsx("div",{className:"h-full bg-chart-2",style:{width:`${o}%`}}),e[2]=o,e[3]=g):g=e[3];let v;e[4]!==N?(v=N>0&&t.jsx("div",{className:"h-full bg-muted-foreground/30",style:{width:`${N}%`}}),e[4]=N,e[5]=v):v=e[5];let h;e[6]!==u||e[7]!==g||e[8]!==v?(h=t.jsxs("div",{className:"flex h-2 w-full overflow-hidden rounded-full bg-muted",children:[u,g,v]}),e[6]=u,e[7]=g,e[8]=v,e[9]=h):h=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-1 shrink-0"}),e[10]=x):x=e[10];let c;e[11]!==w?(c=w.toFixed(1),e[11]=w,e[12]=c):c=e[12];let b;e[13]!==c?(b=t.jsxs("div",{className:"flex items-center gap-1.5",children:[x,t.jsxs("span",{className:"text-xs text-muted-foreground",children:["User ",c,"%"]})]}),e[13]=c,e[14]=b):b=e[14];let d;e[15]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-2 shrink-0"}),e[15]=d):d=e[15];let m;e[16]!==o?(m=o.toFixed(1),e[16]=o,e[17]=m):m=e[17];let f;e[18]!==m?(f=t.jsxs("div",{className:"flex items-center gap-1.5",children:[d,t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Assistant ",m,"%"]})]}),e[18]=m,e[19]=f):f=e[19];let l;e[20]!==N||e[21]!==r?(l=r>0&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-muted-foreground/30 shrink-0"}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Other ",N.toFixed(1),"%"]})]}),e[20]=N,e[21]=r,e[22]=l):l=e[22];let i;e[23]!==f||e[24]!==l||e[25]!==b?(i=t.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[b,f,l]}),e[23]=f,e[24]=l,e[25]=b,e[26]=i):i=e[26];let p;return e[27]!==i||e[28]!==h?(p=t.jsxs("div",{className:"flex flex-col gap-2",children:[h,i]}),e[27]=i,e[28]=h,e[29]=p):p=e[29],p}function Be(s){const e=R.c(61),{onClose:n,back:a,className:r}=s,[k,w]=D.useState(null),{messages:o,tasks:N,activeTaskId:u,selectedModel:g,selectedVirtualMcp:v,virtualMcps:h}=he();let x,c,b,d,m,f,l,i;if(e[0]!==u||e[1]!==a||e[2]!==r||e[3]!==o||e[4]!==n||e[5]!==k?.id||e[6]!==g||e[7]!==v?.title||e[8]!==N||e[9]!==h){i=Symbol.for("react.early_return_sentinel");e:{let $;e[18]!==u?($=j=>j.id===u,e[18]=u,e[19]=$):$=e[19];const L=N.find($),S=xe(o),F=g?.thinking?.limits?.contextWindow??null,Q=F&&F>0?(S.totalTokens/F*100).toFixed(1):null,J=o;let P;e[20]!==J?(P=J.filter(Ce).reduce(_e,0),e[20]=J,e[21]=P):P=e[21];const U=P,V=o;let B;e[22]!==V?(B=V.filter(Se).reduce(Te,0),e[22]=V,e[23]=B):B=e[23];const O=B,H=Math.max(0,S.totalTokens-U-O),te=o[0],se=o.at(-1),ne=te?.metadata?.created_at??L?.created_at,le=se?.metadata?.created_at??L?.updated_at,W=o.filter(we);let K;e[24]!==h?(K=j=>(j.parts??[]).filter(ye).map(y=>{const _=y.input?.agent_id,C=_?h.find(ce=>ce.id===_):null,z=y.state==="input-streaming"||y.state==="input-available"||y.state==="output-available"&&y.preliminary===!0,I=y.state==="output-error",oe=y.state==="approval-requested";return{part:y,agentTitle:C?.title??"Subtask",agentIcon:C?.icon??null,isRunning:z,isError:I,isApproval:oe}}),e[24]=h,e[25]=K):K=e[25];const X=o.flatMap(K),ae=g?.thinking?.id?be(g.thinking.id):"—",re=v?.title??"Decopilot",ie=[{label:"Session",value:L?.title??"New chat"},{label:"Messages",value:W.length},{label:"Agent",value:re},{label:"Model",value:ae},{label:"Context Limit",value:F?A(F):"—"},{label:"Total Tokens",value:S.totalTokens>0?A(S.totalTokens):"0"},{label:"Usage",value:Q!==null?`${Q}%`:"—"},{label:"Input Tokens",value:S.inputTokens>0?A(S.inputTokens):"0"},{label:"Output Tokens",value:S.outputTokens>0?A(S.outputTokens):"0"},{label:"Reasoning Tokens",value:S.reasoningTokens>0?A(S.reasoningTokens):"0"},{label:"Cost",value:S.cost>0?`$${S.cost<.001?S.cost.toFixed(6):S.cost.toFixed(4)}`:"$0.00"},{label:"Session Created",value:ee(ne)},{label:"Last Activity",value:ee(le)}];if(!L&&W.length===0){let j;e[26]!==r?(j=E("flex flex-col h-full w-full border-l border-border bg-background",r),e[26]=r,e[27]=j):j=e[27];let y;e[28]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Context"}),e[28]=y):y=e[28];let _;e[29]!==a?(_=a?t.jsx(Y,{size:14,className:"text-muted-foreground"}):t.jsx(Z,{size:14,className:"text-muted-foreground"}),e[29]=a,e[30]=_):_=e[30];let C;e[31]!==n||e[32]!==_?(C=t.jsxs("div",{className:"h-11 px-4 flex items-center justify-between shrink-0 border-b border-border/50",children:[y,t.jsx("button",{type:"button",onClick:n,className:"flex size-6 items-center justify-center rounded hover:bg-accent transition-colors",children:_})]}),e[31]=n,e[32]=_,e[33]=C):C=e[33];let z;e[34]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx("div",{className:"flex-1 flex items-center justify-center px-4 text-center",children:t.jsx("p",{className:"text-xs text-muted-foreground",children:"Start a conversation to see context"})}),e[34]=z):z=e[34];let I;e[35]!==j||e[36]!==C?(I=t.jsxs("div",{className:j,children:[C,z]}),e[35]=j,e[36]=C,e[37]=I):I=e[37],i=I;break e}e[38]!==r?(f=E("flex flex-col h-full w-full border-l border-border bg-background overflow-y-auto",r),e[38]=r,e[39]=f):f=e[39];let q;e[40]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Context"}),e[40]=q):q=e[40];let M;e[41]!==a?(M=a?t.jsx(Y,{size:14}):t.jsx(Z,{size:14}),e[41]=a,e[42]=M):M=e[42],e[43]!==n||e[44]!==M?(l=t.jsxs("div",{className:"flex h-11 shrink-0 items-center justify-between border-b border-border/50 px-4",children:[q,t.jsx("button",{type:"button",onClick:n,className:"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:M})]}),e[43]=n,e[44]=M,e[45]=l):l=e[45],x="flex flex-col gap-8 p-6",c=X.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Subtasks"}),t.jsx("div",{className:"flex flex-col gap-1",children:X.map(ke)})]}),b=t.jsx(je,{items:ie});let G;e[46]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx("span",{className:"text-xs text-muted-foreground",children:"Context Breakdown"}),e[46]=G):G=e[46],e[47]!==O||e[48]!==H||e[49]!==U?(d=t.jsxs("div",{className:"flex flex-col gap-3",children:[G,t.jsx(Ne,{userTokens:U,assistantTokens:O,otherTokens:H})]}),e[47]=O,e[48]=H,e[49]=U,e[50]=d):d=e[50],m=W.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Raw messages"}),t.jsx("div",{className:"flex flex-col gap-1",children:W.map(j=>{const y=j.metadata?.created_at,_=k?.id===j.id;return t.jsxs("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[t.jsxs("button",{type:"button",onClick:()=>w(_?null:j),className:"flex items-center justify-between gap-2 px-3 py-2 text-xs hover:bg-accent/50 w-full text-left cursor-pointer",children:[t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("span",{className:E("shrink-0 font-medium",j.role==="user"?"text-chart-1":"text-chart-2"),children:j.role}),t.jsx("span",{className:"text-muted-foreground",children:"•"}),t.jsx("span",{className:"truncate text-muted-foreground font-mono",children:j.id})]}),y&&t.jsx("span",{className:"shrink-0 text-muted-foreground tabular-nums",children:new Date(y).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})})]}),_&&t.jsx("pre",{className:"text-xs font-mono bg-muted px-3 py-2 overflow-auto whitespace-pre-wrap break-all border-t border-border/50 max-h-64",children:JSON.stringify(j,null,2)})]},j.id)})})]})}e[0]=u,e[1]=a,e[2]=r,e[3]=o,e[4]=n,e[5]=k?.id,e[6]=g,e[7]=v?.title,e[8]=N,e[9]=h,e[10]=x,e[11]=c,e[12]=b,e[13]=d,e[14]=m,e[15]=f,e[16]=l,e[17]=i}else x=e[10],c=e[11],b=e[12],d=e[13],m=e[14],f=e[15],l=e[16],i=e[17];if(i!==Symbol.for("react.early_return_sentinel"))return i;let p;e[51]!==x||e[52]!==c||e[53]!==b||e[54]!==d||e[55]!==m?(p=t.jsxs("div",{className:x,children:[c,b,d,m]}),e[51]=x,e[52]=c,e[53]=b,e[54]=d,e[55]=m,e[56]=p):p=e[56];let T;return e[57]!==f||e[58]!==l||e[59]!==p?(T=t.jsxs("div",{className:f,children:[l,p]}),e[57]=f,e[58]=l,e[59]=p,e[60]=T):T=e[60],T}function ke(s,e){return t.jsxs("div",{className:"flex items-center gap-2 text-xs min-w-0",children:[t.jsx(pe,{icon:s.agentIcon,name:s.agentTitle,size:"xs",className:"size-6 rounded-md shrink-0"}),t.jsx("span",{className:E("shrink-0 font-medium",s.isError?"text-destructive":"text-foreground"),children:s.agentTitle}),s.part.input?.prompt&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-muted-foreground/50",children:"·"}),t.jsx("span",{className:"truncate text-muted-foreground",children:s.part.input.prompt})]}),t.jsx("span",{className:"ml-auto shrink-0",children:s.isRunning?t.jsx(me,{size:12,className:"animate-spin text-muted-foreground"}):s.isError?t.jsx(fe,{size:12,className:"text-destructive"}):s.isApproval?t.jsx(de,{size:12,className:"text-warning"}):t.jsx(ue,{size:12,className:"text-emerald-500"})})]},e)}function ye(s){return s.type==="tool-subtask"}function we(s){return s.role!=="system"}function Te(s,e){const n=e.metadata?.usage;return s+(n?.outputTokens??0)}function Se(s){return s.role==="assistant"}function _e(s,e){const n=e.metadata?.usage;return s+(n?.inputTokens??0)}function Ce(s){return s.role==="user"}function $e(s){const e=R.c(22),{text:n,className:a,speed:r}=s,k=a===void 0?"":a,w=r===void 0?30:r,[o,N]=D.useState(!1),u=n.length/w*1e3,g=n.length,v=`${n.length}ch`;let h;e[0]!==u?(h=()=>{N(!1);const $=setTimeout(()=>{N(!0)},u);return()=>clearTimeout($)},e[0]=u,e[1]=h):h=e[1];let x;e[2]!==u||e[3]!==n?(x=[n,u],e[2]=u,e[3]=n,e[4]=x):x=e[4],D.useEffect(h,x);let c;e[5]!==k?(c=E(k,"block overflow-hidden inline-flex"),e[5]=k,e[6]=c):c=e[6];const b=`${u}ms`;let d;e[7]!==v||e[8]!==g||e[9]!==b?(d={"--typewriter-duration":b,"--typewriter-steps":g,"--typewriter-max-width":v},e[7]=v,e[8]=g,e[9]=b,e[10]=d):d=e[10];const m=d,f=o&&"truncate";let l;e[11]!==f?(l=E("typewriter-text",f),e[11]=f,e[12]=l):l=e[12];let i;e[13]!==l||e[14]!==n?(i=t.jsx("span",{className:l,children:n}),e[13]=l,e[14]=n,e[15]=i):i=e[15];let p;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("style",{children:`
2
2
  .typewriter-text {
3
3
  display: inline-block;
4
4
  width: 0;
@@ -1 +1 @@
1
- import{c as v,v as h,j as t,B as b}from"./index-BiG-bBX7.js";function y(N){const e=v.c(21),{icon:o,illustration:a,title:u,description:d,buttonProps:s,buttonComponent:x,className:j,children:p}=N;let l;e[0]!==j?(l=h("flex flex-col items-center justify-center py-16 text-center",j),e[0]=j,e[1]=l):l=e[1];let i;e[2]!==o||e[3]!==a?(i=a?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:a}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=a,e[4]=i):i=e[4];let n;e[5]!==u?(n=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[5]=u,e[6]=n):n=e[6];let c;e[7]!==d?(c=d&&t.jsx("div",{className:"text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=c):c=e[8];let r;e[9]!==n||e[10]!==c?(r=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[n,c]}),e[9]=n,e[10]=c,e[11]=r):r=e[11];let m;e[12]!==x||e[13]!==s?(m=(x??s)&&t.jsx("div",{className:"mt-4",children:x??(s&&t.jsx(b,{size:"sm",className:h(s?.className),...s}))}),e[12]=x,e[13]=s,e[14]=m):m=e[14];let f;return e[15]!==p||e[16]!==l||e[17]!==i||e[18]!==r||e[19]!==m?(f=t.jsxs("div",{className:l,children:[i,r,m,p]}),e[15]=p,e[16]=l,e[17]=i,e[18]=r,e[19]=m,e[20]=f):f=e[20],f}export{y as E};
1
+ import{c as v,v as h,j as t,B as b}from"./index-BkxNgQ-z.js";function y(N){const e=v.c(21),{icon:o,illustration:a,title:u,description:d,buttonProps:s,buttonComponent:x,className:j,children:p}=N;let l;e[0]!==j?(l=h("flex flex-col items-center justify-center py-16 text-center",j),e[0]=j,e[1]=l):l=e[1];let i;e[2]!==o||e[3]!==a?(i=a?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:a}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=a,e[4]=i):i=e[4];let n;e[5]!==u?(n=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[5]=u,e[6]=n):n=e[6];let c;e[7]!==d?(c=d&&t.jsx("div",{className:"text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=c):c=e[8];let r;e[9]!==n||e[10]!==c?(r=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[n,c]}),e[9]=n,e[10]=c,e[11]=r):r=e[11];let m;e[12]!==x||e[13]!==s?(m=(x??s)&&t.jsx("div",{className:"mt-4",children:x??(s&&t.jsx(b,{size:"sm",className:h(s?.className),...s}))}),e[12]=x,e[13]=s,e[14]=m):m=e[14];let f;return e[15]!==p||e[16]!==l||e[17]!==i||e[18]!==r||e[19]!==m?(f=t.jsxs("div",{className:l,children:[i,r,m,p]}),e[15]=p,e[16]=l,e[17]=i,e[18]=r,e[19]=m,e[20]=f):f=e[20],f}export{y as E};
@@ -1 +1 @@
1
- import{c as V,j as o,B as C}from"./index-BiG-bBX7.js";import{I as P}from"./input-BcOk4EWn.js";import{s as A}from"./Plus-7RI9qITc.js";import{s as R}from"./Trash01-BsNnpu_l.js";function z(i){const e=i.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(l=>e.includes(l))||["sk_","rk_","whsec_","pk_live","sk_live"].some(l=>e.startsWith(l))||["_key","_secret","_token","_password","_auth","_pat"].some(l=>e.endsWith(l)))}function L(i){const e=V.c(34),{value:t,onChange:s,keyPlaceholder:j,valuePlaceholder:l,className:E}=i,h=j===void 0?"VARIABLE_NAME":j,p=l===void 0?"value...":l;let k;e[0]!==s||e[1]!==t?(k=()=>{s([...t,{key:"",value:""}])},e[0]=s,e[1]=t,e[2]=k):k=e[2];const N=k;let y;e[3]!==s||e[4]!==t?(y=n=>{s(t.filter((c,r)=>r!==n))},e[3]=s,e[4]=t,e[5]=y):y=e[5];const m=y;let g;e[6]!==s||e[7]!==t?(g=(n,c)=>{const r=[...t],a=r[n];a&&(r[n]={key:c,value:a.value},s(r))},e[6]=s,e[7]=t,e[8]=g):g=e[8];const _=g;let x;e[9]!==s||e[10]!==t?(x=(n,c)=>{const r=[...t],a=r[n];a&&(r[n]={key:a.key,value:c},s(r))},e[9]=s,e[10]=t,e[11]=x):x=e[11];const v=x;let u;if(e[12]!==_||e[13]!==m||e[14]!==v||e[15]!==h||e[16]!==t||e[17]!==p){let n;e[19]!==_||e[20]!==m||e[21]!==v||e[22]!==h||e[23]!==p?(n=(c,r)=>o.jsxs("div",{className:"flex gap-2 items-center",children:[o.jsx(P,{placeholder:h,value:c.key,onChange:a=>_(r,a.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),o.jsx(P,{type:z(c.key)?"password":"text",placeholder:p,value:c.value,onChange:a=>v(r,a.target.value),className:"h-10 rounded-lg flex-1"}),o.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>m(r),children:o.jsx(R,{size:16})})]},r),e[19]=_,e[20]=m,e[21]=v,e[22]=h,e[23]=p,e[24]=n):n=e[24],u=t.map(n),e[12]=_,e[13]=m,e[14]=v,e[15]=h,e[16]=t,e[17]=p,e[18]=u}else u=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(A,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let f;e[26]!==N?(f=o.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:N,children:[w,"Add Environment Variable"]}),e[26]=N,e[27]=f):f=e[27];let d;e[28]!==u||e[29]!==f?(d=o.jsxs("div",{className:"flex flex-col gap-2",children:[u,f]}),e[28]=u,e[29]=f,e[30]=d):d=e[30];let b;return e[31]!==E||e[32]!==d?(b=o.jsx("div",{className:E,children:d}),e[31]=E,e[32]=d,e[33]=b):b=e[33],b}function T(i){const e={};for(const{key:t,value:s}of i)t.trim()&&(e[t.trim()]=s);return e}function W(i){return i?Object.entries(i).map(([e,t])=>({key:e,value:t})):[]}export{L as E,T as e,W as r};
1
+ import{c as V,j as o,B as C}from"./index-BkxNgQ-z.js";import{I as P}from"./input-BxWPl4Ur.js";import{s as A}from"./Plus-4zX3n4bH.js";import{s as R}from"./Trash01-BvIumE4M.js";function z(i){const e=i.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(l=>e.includes(l))||["sk_","rk_","whsec_","pk_live","sk_live"].some(l=>e.startsWith(l))||["_key","_secret","_token","_password","_auth","_pat"].some(l=>e.endsWith(l)))}function L(i){const e=V.c(34),{value:t,onChange:s,keyPlaceholder:j,valuePlaceholder:l,className:E}=i,h=j===void 0?"VARIABLE_NAME":j,p=l===void 0?"value...":l;let k;e[0]!==s||e[1]!==t?(k=()=>{s([...t,{key:"",value:""}])},e[0]=s,e[1]=t,e[2]=k):k=e[2];const N=k;let y;e[3]!==s||e[4]!==t?(y=n=>{s(t.filter((c,r)=>r!==n))},e[3]=s,e[4]=t,e[5]=y):y=e[5];const m=y;let g;e[6]!==s||e[7]!==t?(g=(n,c)=>{const r=[...t],a=r[n];a&&(r[n]={key:c,value:a.value},s(r))},e[6]=s,e[7]=t,e[8]=g):g=e[8];const _=g;let x;e[9]!==s||e[10]!==t?(x=(n,c)=>{const r=[...t],a=r[n];a&&(r[n]={key:a.key,value:c},s(r))},e[9]=s,e[10]=t,e[11]=x):x=e[11];const v=x;let u;if(e[12]!==_||e[13]!==m||e[14]!==v||e[15]!==h||e[16]!==t||e[17]!==p){let n;e[19]!==_||e[20]!==m||e[21]!==v||e[22]!==h||e[23]!==p?(n=(c,r)=>o.jsxs("div",{className:"flex gap-2 items-center",children:[o.jsx(P,{placeholder:h,value:c.key,onChange:a=>_(r,a.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),o.jsx(P,{type:z(c.key)?"password":"text",placeholder:p,value:c.value,onChange:a=>v(r,a.target.value),className:"h-10 rounded-lg flex-1"}),o.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>m(r),children:o.jsx(R,{size:16})})]},r),e[19]=_,e[20]=m,e[21]=v,e[22]=h,e[23]=p,e[24]=n):n=e[24],u=t.map(n),e[12]=_,e[13]=m,e[14]=v,e[15]=h,e[16]=t,e[17]=p,e[18]=u}else u=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(A,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let f;e[26]!==N?(f=o.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:N,children:[w,"Add Environment Variable"]}),e[26]=N,e[27]=f):f=e[27];let d;e[28]!==u||e[29]!==f?(d=o.jsxs("div",{className:"flex flex-col gap-2",children:[u,f]}),e[28]=u,e[29]=f,e[30]=d):d=e[30];let b;return e[31]!==E||e[32]!==d?(b=o.jsx("div",{className:E,children:d}),e[31]=E,e[32]=d,e[33]=b):b=e[33],b}function T(i){const e={};for(const{key:t,value:s}of i)t.trim()&&(e[t.trim()]=s);return e}function W(i){return i?Object.entries(i).map(([e,t])=>({key:e,value:t})):[]}export{L as E,T as e,W as r};
@@ -1 +1 @@
1
- import"./constants-DTlOAYW2.js";import{g as A}from"./github-icon-Dp3wHhYE.js";import{g as D}from"./registry-utils-B4prNmYa.js";import{g as H}from"./generate-id-Dyweu44Y.js";const E="mcp.mesh";function O(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function R(e){const r=e?.identifier||e?.name;return r?r.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):"Unknown"}function j(e,r,d,i){const n=e.server,t=e._meta?.[E],f=new Date().toISOString(),b=t?.friendlyName||t?.friendly_name||e.title||n?.title||n?.name||"Unnamed MCP Server",v=n?.description||null,x=n?.icons?.[0]?.src||A(n?.repository)||null,o=t?.oauth_config,I=o&&typeof o.authorizationEndpoint=="string"&&typeof o.tokenEndpoint=="string"&&typeof o.clientId=="string"&&Array.isArray(o.scopes)&&(o.grantType==="authorization_code"||o.grantType==="client_credentials")?o:null,N=t?.configuration_state,P=t?.configuration_scopes,T=n?.repository?{url:n.repository.url,source:n.repository.source,subfolder:n.repository.subfolder}:null,u=n?.packages??[],m=n?.remotes??[],C=i?.packageIndex??0,S=i?.remoteIndex??0,y=u.length>0&&i?.packageIndex!==void 0,a=y?u[C]:null,s=y?null:m[S];let c,l,_=null;if(a){const h=a.identifier||a.name;c="STDIO",l="";const g={};if(a.environmentVariables)for(const k of a.environmentVariables)k.name&&(g[k.name]="");_={command:"npx",args:h?["-y",h]:[],...Object.keys(g).length>0&&{envVars:g}}}else s?(c=D(s.type)||"HTTP",l=s.url||""):(c="HTTP",l="");const w=m.length>1,M=u.length>1;let p="";a&&M?p=` (${R(a)})`:s&&w&&(p=` (${O(s)})`);const U=b+p;return{id:H("conn"),title:U,description:v,icon:x,app_name:t?.appName||n?.name||null,app_id:t?.id||e.id||null,connection_type:c,connection_url:l,connection_token:null,connection_headers:_,oauth_config:I,configuration_state:N??null,configuration_scopes:P??null,metadata:{source:"store",registry_item_id:e.id,verified:t?.verified??!1,scopeName:t?.scopeName??null,toolsCount:t?.tools?.length??0,publishedAt:t?.publishedAt??null,repository:T},created_at:f,updated_at:f,created_by:d,organization_id:r,tools:null,bindings:null,status:"inactive"}}export{E as M,j as e};
1
+ import"./constants-DoLvwboP.js";import{g as A}from"./github-icon-Dp3wHhYE.js";import{g as D}from"./registry-utils-Bm8aYhvn.js";import{g as H}from"./generate-id-Dyweu44Y.js";const E="mcp.mesh";function O(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function R(e){const r=e?.identifier||e?.name;return r?r.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):"Unknown"}function j(e,r,d,i){const n=e.server,t=e._meta?.[E],f=new Date().toISOString(),b=t?.friendlyName||t?.friendly_name||e.title||n?.title||n?.name||"Unnamed MCP Server",v=n?.description||null,x=n?.icons?.[0]?.src||A(n?.repository)||null,o=t?.oauth_config,I=o&&typeof o.authorizationEndpoint=="string"&&typeof o.tokenEndpoint=="string"&&typeof o.clientId=="string"&&Array.isArray(o.scopes)&&(o.grantType==="authorization_code"||o.grantType==="client_credentials")?o:null,N=t?.configuration_state,P=t?.configuration_scopes,T=n?.repository?{url:n.repository.url,source:n.repository.source,subfolder:n.repository.subfolder}:null,u=n?.packages??[],m=n?.remotes??[],C=i?.packageIndex??0,S=i?.remoteIndex??0,y=u.length>0&&i?.packageIndex!==void 0,a=y?u[C]:null,s=y?null:m[S];let c,l,_=null;if(a){const h=a.identifier||a.name;c="STDIO",l="";const g={};if(a.environmentVariables)for(const k of a.environmentVariables)k.name&&(g[k.name]="");_={command:"npx",args:h?["-y",h]:[],...Object.keys(g).length>0&&{envVars:g}}}else s?(c=D(s.type)||"HTTP",l=s.url||""):(c="HTTP",l="");const w=m.length>1,M=u.length>1;let p="";a&&M?p=` (${R(a)})`:s&&w&&(p=` (${O(s)})`);const U=b+p;return{id:H("conn"),title:U,description:v,icon:x,app_name:t?.appName||n?.name||null,app_id:t?.id||e.id||null,connection_type:c,connection_url:l,connection_token:null,connection_headers:_,oauth_config:I,configuration_state:N??null,configuration_scopes:P??null,metadata:{source:"store",registry_item_id:e.id,verified:t?.verified??!1,scopeName:t?.scopeName??null,toolsCount:t?.tools?.length??0,publishedAt:t?.publishedAt??null,repository:T},created_at:f,updated_at:f,created_by:d,organization_id:r,tools:null,bindings:null,status:"inactive"}}export{E as M,j as e};