@decocms/mesh 2.129.0 → 2.130.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/dist/client/assets/{AlertCircle-DFllIHYc.js → AlertCircle-Y6iSJK0t.js} +1 -1
  2. package/dist/client/assets/{AlertOctagon-DkJGqjxz.js → AlertOctagon-r7aH80QB.js} +1 -1
  3. package/dist/client/assets/{ArrowDown-BCqJRKTw.js → ArrowDown-DPy5cnDQ.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-DUx23LCt.js → ArrowLeft-p4dfchJF.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-CKW1WeCp.js → ArrowUp-Dx6U6WtF.js} +1 -1
  6. package/dist/client/assets/{Check-CFpzkHgf.js → Check-BIaai9j0.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-DAEjX2-S.js → CheckCircle-DvhMgeYT.js} +1 -1
  8. package/dist/client/assets/{CheckDone01-BeTexMq0.js → CheckDone01-kUo2KMa3.js} +1 -1
  9. package/dist/client/assets/{CheckVerified02-Cl4WUPt6.js → CheckVerified02-DfOayhlO.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-CZDY410N.js → ChevronDown-Dyskz-ZD.js} +1 -1
  11. package/dist/client/assets/{ChevronRight-DmlQyyes.js → ChevronRight-D6p6jiry.js} +1 -1
  12. package/dist/client/assets/{Clock-BYhPEf3s.js → Clock-Dymou738.js} +1 -1
  13. package/dist/client/assets/{Code01-tDuxE9sy.js → Code01-BYnTXqsh.js} +1 -1
  14. package/dist/client/assets/{Container-CwxPOY0d.js → Container-DBGOFJUc.js} +1 -1
  15. package/dist/client/assets/{Copy01-CbgFtFXW.js → Copy01-CPaHCgqg.js} +1 -1
  16. package/dist/client/assets/{Dataflow03-IGdQIxop.js → Dataflow03-D8kdCLb1.js} +1 -1
  17. package/dist/client/assets/{DotsHorizontal-Dy3izT0z.js → DotsHorizontal-Ra63dU8X.js} +1 -1
  18. package/dist/client/assets/{DotsVertical-D74uB5qh.js → DotsVertical-DcLEsGDj.js} +1 -1
  19. package/dist/client/assets/{Download01-CaDNSpb8.js → Download01-BP0Ze81Q.js} +1 -1
  20. package/dist/client/assets/{Edit01-D8XxDVwQ.js → Edit01-BEBZ-Ht5.js} +1 -1
  21. package/dist/client/assets/{Eye-BIF9gjXL.js → Eye-VtlrDhJf.js} +1 -1
  22. package/dist/client/assets/{File02-DUrYDugN.js → File02-Dcc2k6VI.js} +1 -1
  23. package/dist/client/assets/{File06-CGEI1byM.js → File06-DCHaBaad.js} +1 -1
  24. package/dist/client/assets/{FilterLines-ezUjepvA.js → FilterLines-D64nKG0E.js} +1 -1
  25. package/dist/client/assets/{Globe01-DQFjI7NL.js → Globe01-Rd2g694_.js} +1 -1
  26. package/dist/client/assets/{Globe02-BxR836tG.js → Globe02-nOidPs01.js} +1 -1
  27. package/dist/client/assets/{Grid01-NpQl-yoZ.js → Grid01-C8gF-dWK.js} +1 -1
  28. package/dist/client/assets/{Hash02-D1T_na-O.js → Hash02-fd4i0k8G.js} +1 -1
  29. package/dist/client/assets/{Home02-DJFtS4tr.js → Home02-ABQZ6xOx.js} +1 -1
  30. package/dist/client/assets/{Image01-Cqm47hN-.js → Image01-BrzUQQ9K.js} +1 -1
  31. package/dist/client/assets/{Inbox01-DiDAxgDg.js → Inbox01-DK0JkUYE.js} +1 -1
  32. package/dist/client/assets/{InfoCircle-CNFZi0eo.js → InfoCircle-DO1owwAA.js} +1 -1
  33. package/dist/client/assets/{Key01-BMRBT_9o.js → Key01-bHmq-6W2.js} +1 -1
  34. package/dist/client/assets/{LinkExternal01-y5rFoKhK.js → LinkExternal01-DyOgk9O3.js} +1 -1
  35. package/dist/client/assets/{List-CIQbhdro.js → List-mX8yEKmx.js} +1 -1
  36. package/dist/client/assets/{Loading01-Ccov_H-l.js → Loading01-Jv8Mbea8.js} +1 -1
  37. package/dist/client/assets/{Lock01-BjIJeI7d.js → Lock01-DPx3YF5B.js} +1 -1
  38. package/dist/client/assets/{Play-CipTDlMn.js → Play-DciA3rqD.js} +1 -1
  39. package/dist/client/assets/{Plus-DJThru9X.js → Plus-Cecv4wEo.js} +1 -1
  40. package/dist/client/assets/{RefreshCcw01-Df3WKdLs.js → RefreshCcw01-Busgf2jQ.js} +1 -1
  41. package/dist/client/assets/{Rows03-Agi3cY0I.js → Rows03-CBXDKtLW.js} +1 -1
  42. package/dist/client/assets/{Save01-CkhL7WEQ.js → Save01-P2clZJAi.js} +1 -1
  43. package/dist/client/assets/{SearchMd-ePwgMcp4.js → SearchMd-CS2uMIPl.js} +1 -1
  44. package/dist/client/assets/{Settings01-MsrMRIJf.js → Settings01-BAgxhvm4.js} +1 -1
  45. package/dist/client/assets/{Shield01-Cz2zDuKP.js → Shield01-Dw8oloiN.js} +1 -1
  46. package/dist/client/assets/{Terminal-CzMkefpC.js → Terminal-d72o721Q.js} +1 -1
  47. package/dist/client/assets/{Tool01-nfCGcgBE.js → Tool01-DkfecWlX.js} +1 -1
  48. package/dist/client/assets/{Trash01-B_x31FCQ.js → Trash01-CKATI1mI.js} +1 -1
  49. package/dist/client/assets/{Upload01-BVrA_p4D.js → Upload01-jmiBld-4.js} +1 -1
  50. package/dist/client/assets/{Users03-Ca4cP5ST.js → Users03-CLx_Qxdb.js} +1 -1
  51. package/dist/client/assets/{X-ep0AhpnZ.js → X-RC7YVNJU.js} +1 -1
  52. package/dist/client/assets/{XCircle-CcrJwxck.js → XCircle-BgJPZWR5.js} +1 -1
  53. package/dist/client/assets/{XClose-mrXHjywb.js → XClose-D-4ELBrc.js} +1 -1
  54. package/dist/client/assets/{agent-connections-preview-GRtBimaN.js → agent-connections-preview-Dac4pEFh.js} +1 -1
  55. package/dist/client/assets/{agent-detail-fZVm9X6-.js → agent-detail-D5a7TiOz.js} +2 -2
  56. package/dist/client/assets/{agents-C9M716Em.js → agents-vcyOPs3U.js} +1 -1
  57. package/dist/client/assets/{alert-dialog-zUkzI1I7.js → alert-dialog-CdqWA8wc.js} +2 -2
  58. package/dist/client/assets/{auth-catchall-fybxbD8B.js → auth-catchall-B-_Zqliv.js} +1 -1
  59. package/dist/client/assets/{avatar-KzEgSlwf.js → avatar-tLGNC2ok.js} +1 -1
  60. package/dist/client/assets/{badge-CrsiM596.js → badge-0EzsH3AB.js} +1 -1
  61. package/dist/client/assets/{binder-5QwQ3F8k.js → binder-w9dF9fSa.js} +1 -1
  62. package/dist/client/assets/{breadcrumb-r6RP68pk.js → breadcrumb-BcJj21EL.js} +1 -1
  63. package/dist/client/assets/{card-BaUmkbam.js → card-c-CJHmFC.js} +1 -1
  64. package/dist/client/assets/{chart-B4Ia32VW.js → chart-PoFYShLf.js} +1 -1
  65. package/dist/client/assets/{checkbox-vQNHi_v9.js → checkbox-kw1ENx9l.js} +1 -1
  66. package/dist/client/assets/{circle-alert-D6oWLxFc.js → circle-alert-orNW2INv.js} +1 -1
  67. package/dist/client/assets/{collection-detail-CFInmxp-.js → collection-detail-DcWT7KrG.js} +1 -1
  68. package/dist/client/assets/{collection-search-BGdQ1HZ8.js → collection-search-DeB-znan.js} +1 -1
  69. package/dist/client/assets/{collection-tab-BHc2Ls-Q.js → collection-tab-DnFTZr-h.js} +1 -1
  70. package/dist/client/assets/{collection-table-wrapper-M66G0byU.js → collection-table-wrapper-BkrnGVuo.js} +1 -1
  71. package/dist/client/assets/{collection-tabs-DItGBx7f.js → collection-tabs-CI_dPETO.js} +1 -1
  72. package/dist/client/assets/{command-KORb7ru1.js → command-CtwsQYlg.js} +1 -1
  73. package/dist/client/assets/{connect-CzYEo8md.js → connect-Cjj5OaBk.js} +1 -1
  74. package/dist/client/assets/{connection-card-DT2iuc8p.js → connection-card-DmcuYZ2d.js} +1 -1
  75. package/dist/client/assets/{connection-detail-BN6XxwJe.js → connection-detail-DOePEdlc.js} +1 -1
  76. package/dist/client/assets/{connections-ziNJ3ykn.js → connections-CQQbEDkG.js} +1 -1
  77. package/dist/client/assets/constants-DK6m0rOQ.js +1 -0
  78. package/dist/client/assets/{constants-C_615zcG.js → constants-DyBxaLKI.js} +1 -1
  79. package/dist/client/assets/{context-BIs40mE3.js → context-GOV4Tst1.js} +2 -2
  80. package/dist/client/assets/{create-organization-dialog-DBkFyVL_.js → create-organization-dialog-BolmWoUA.js} +1 -1
  81. package/dist/client/assets/{create-project-dialog-Bcpvnfjn.js → create-project-dialog-MbK1spLU.js} +1 -1
  82. package/dist/client/assets/{dialog-BzlH8DMm.js → dialog-L8ZakXii.js} +1 -1
  83. package/dist/client/assets/{dropdown-menu-un00sO73.js → dropdown-menu-VTiqKHN9.js} +1 -1
  84. package/dist/client/assets/{dynamic-plugin-layout-lJBDHqhW.js → dynamic-plugin-layout-CMgyIw65.js} +1 -1
  85. package/dist/client/assets/{editable-thread-title-BXoC2F2B.js → editable-thread-title-CPogfRoD.js} +1 -1
  86. package/dist/client/assets/{empty-state-CzmPKPTk.js → empty-state-CevFdaoX.js} +1 -1
  87. package/dist/client/assets/{env-vars-editor-BXh1cAnk.js → env-vars-editor-CZ9xwqbP.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-BfKkaRZL.js → extract-connection-data-bPHhUn8L.js} +1 -1
  89. package/dist/client/assets/{file-browser-Cu1bln-O.js → file-browser-BBOKW0fZ.js} +2 -2
  90. package/dist/client/assets/{form-BZ0ccRRa.js → form-p8UY3zWX.js} +1 -1
  91. package/dist/client/assets/{grid-view-Cv27YWYR.js → grid-view-CBiwYQ_M.js} +1 -1
  92. package/dist/client/assets/{home-Dm_ASFW3.js → home-gtPjmaoD.js} +1 -1
  93. package/dist/client/assets/{index-CyQ-uP58.js → index-0HoOnen3.js} +3 -3
  94. package/dist/client/assets/{index-SPlTfTNO.js → index-BPWcS_Kf.js} +2 -2
  95. package/dist/client/assets/{index-CXMp_veu.js → index-BRPNbM-s.js} +1 -1
  96. package/dist/client/assets/{index-D6zrhjd3.js → index-BymQJSqf.js} +1 -1
  97. package/dist/client/assets/{index-CouTVB4u.js → index-CWyCvGNo.js} +1 -1
  98. package/dist/client/assets/{index-CkihBNKz.js → index-CmPWq7Ch.js} +1 -1
  99. package/dist/client/assets/index-CqCzS9v2.js +1 -0
  100. package/dist/client/assets/{index-B09G3SMh.js → index-Cz17zD6m.js} +1 -1
  101. package/dist/client/assets/{index-BTQG2DxP.js → index-G8oxxr2G.js} +1 -1
  102. package/dist/client/assets/{infiniteQueryObserver-BvfDXev6.js → infiniteQueryObserver-Be7iTEXe.js} +1 -1
  103. package/dist/client/assets/{input-Xyw1Rs5H.js → input-BtUicd3Q.js} +1 -1
  104. package/dist/client/assets/{integration-icon-BmabWqd3.js → integration-icon-5VjL1GgL.js} +1 -1
  105. package/dist/client/assets/{label-B9X06NrD.js → label-D6atofYo.js} +1 -1
  106. package/dist/client/assets/{layout-2YnSaip-.js → layout-Cgu_nW-7.js} +1 -1
  107. package/dist/client/assets/{localstorage-keys-DNCBj8Gv.js → localstorage-keys-BoChS3hJ.js} +1 -1
  108. package/dist/client/assets/{login-BcqaQ8OJ.js → login-BJHT5HcO.js} +1 -1
  109. package/dist/client/assets/{markdown-DE0d269S.js → markdown-C4hTkq3E.js} +1 -1
  110. package/dist/client/assets/{mcp-oauth-dc0YrLAp.js → mcp-oauth-D5R57Lko.js} +1 -1
  111. package/dist/client/assets/{mcp-server-card-BgAf5sxh.js → mcp-server-card-BiIhdNix.js} +1 -1
  112. package/dist/client/assets/{mcp-server-detail-a4HlkEwh.js → mcp-server-detail-BhlbPBsp.js} +2 -2
  113. package/dist/client/assets/{members-vlAhS-xk.js → members-OikP95XQ.js} +1 -1
  114. package/dist/client/assets/{monitoring-B8ViJcuj.js → monitoring-DapgIfZL.js} +1 -1
  115. package/dist/client/assets/{monitoring-dashboard-edit-9lG0jGgS.js → monitoring-dashboard-edit-Yzekapph.js} +1 -1
  116. package/dist/client/assets/{monitoring-dashboard-view-AyjrHVH9.js → monitoring-dashboard-view-DRykeaHO.js} +2 -2
  117. package/dist/client/assets/{oauth-callback-DEcWaD8W.js → oauth-callback-DZIR2PjB.js} +1 -1
  118. package/dist/client/assets/{page-L5wi1xJD.js → page-PH6ZVWlA.js} +1 -1
  119. package/dist/client/assets/{page-Dst-G5FY.js → page-iyMzbA2I.js} +1 -1
  120. package/dist/client/assets/{plugin-empty-state-FWA0Jb1Z.js → plugin-empty-state-kz2uan6n.js} +1 -1
  121. package/dist/client/assets/{plugin-empty-state-4dVaQq4C.js → plugin-empty-state-y1tYhlY3.js} +1 -1
  122. package/dist/client/assets/{plugin-header-DerB5s8s.js → plugin-header-BJbVVCoY.js} +1 -1
  123. package/dist/client/assets/{plugin-header-gerJlK-i.js → plugin-header-nmFTSFoR.js} +1 -1
  124. package/dist/client/assets/popover-P8B4MdX3.js +1 -0
  125. package/dist/client/assets/{project-layout-Bq2NwHqQ.js → project-layout-BqSVP5TE.js} +1 -1
  126. package/dist/client/assets/{projects-list-Bfrhv7v-.js → projects-list-3Z4u-J4l.js} +1 -1
  127. package/dist/client/assets/{ranking-layout-Bz2FMj3O.js → ranking-layout-DDk0F0da.js} +1 -1
  128. package/dist/client/assets/{readme-viewer-D0xX-U32.js → readme-viewer-BFDmw5ln.js} +1 -1
  129. package/dist/client/assets/{registry-layout-BJov_nag.js → registry-layout-tBKkcjtf.js} +1 -1
  130. package/dist/client/assets/{registry-utils-Dr7PbEVZ.js → registry-utils-BPK3KAEQ.js} +1 -1
  131. package/dist/client/assets/{reports-layout-VEiewUO1.js → reports-layout-C1Rj5mWL.js} +1 -1
  132. package/dist/client/assets/{reset-password-Cv1xeKO6.js → reset-password-CoNNt1yx.js} +1 -1
  133. package/dist/client/assets/{resizable-Cf9qjEcV.js → resizable-CpFkObl0.js} +1 -1
  134. package/dist/client/assets/{save-actions-8q-tMpO7.js → save-actions-CNp28sAN.js} +1 -1
  135. package/dist/client/assets/{scroll-area-DSF7aa78.js → scroll-area-Bhoi0n_B.js} +4 -4
  136. package/dist/client/assets/{select-BWSXn9LF.js → select-DOO2sOs0.js} +1 -1
  137. package/dist/client/assets/{shell-layout-C4umZGSP.js → shell-layout-CSB6jzfL.js} +2 -2
  138. package/dist/client/assets/{skeleton-CGDNbJij.js → skeleton-CR236scd.js} +1 -1
  139. package/dist/client/assets/{spinner-DdFkIebA.js → spinner-DzG2AImj.js} +1 -1
  140. package/dist/client/assets/{store-invite-BpVpumwK.js → store-invite-CeIOMnWs.js} +1 -1
  141. package/dist/client/assets/{switch-DCjQmRaz.js → switch-UjGh-56-.js} +1 -1
  142. package/dist/client/assets/{table-KBcJzih3.js → table-CK5AQN01.js} +1 -1
  143. package/dist/client/assets/{tabs-A5nHR5hM.js → tabs-ZEd61iZd.js} +1 -1
  144. package/dist/client/assets/{tasks-C_zqDZzb.js → tasks-C15WiR9-.js} +1 -1
  145. package/dist/client/assets/{textarea-BflLsOYJ.js → textarea-Ca7XZUqN.js} +1 -1
  146. package/dist/client/assets/{time-range-picker-C7BBQ3V_.js → time-range-picker-GPYqbq-o.js} +1 -1
  147. package/dist/client/assets/{toggle-group-CVheqlM7.js → toggle-group-BgEBi3gu.js} +1 -1
  148. package/dist/client/assets/{tools-list-DEuI3Via.js → tools-list-DJeaOzT_.js} +1 -1
  149. package/dist/client/assets/{tooltip-CNx0bR-5.js → tooltip-BWlQ9UL9.js} +1 -1
  150. package/dist/client/assets/{topbar-portal-BPt1GU-U.js → topbar-portal-CMlW5IwY.js} +1 -1
  151. package/dist/client/assets/{types-BOWXxXIK.js → types-BPCR06YW.js} +1 -1
  152. package/dist/client/assets/{use-binding-rYSemil4.js → use-binding-CcrgjIcJ.js} +1 -1
  153. package/dist/client/assets/{use-connection-B5TQguFn.js → use-connection-B6TFiTxb.js} +1 -1
  154. package/dist/client/assets/{use-copy-DFl3Lkrw.js → use-copy-DfInz4oY.js} +1 -1
  155. package/dist/client/assets/{use-create-virtual-mcp-ClS20pFb.js → use-create-virtual-mcp-pELq4UZ_.js} +1 -1
  156. package/dist/client/assets/{use-deco-chat-open-DUl097r7.js → use-deco-chat-open-BmqwFIXp.js} +1 -1
  157. package/dist/client/assets/{use-install-from-registry-BBtc_IYr.js → use-install-from-registry-BCXPqkOi.js} +1 -1
  158. package/dist/client/assets/{use-list-state-CSmezZQi.js → use-list-state-Bpa4-xTU.js} +1 -1
  159. package/dist/client/assets/{use-llm-_rAHFXdn.js → use-llm-7gZpMpM0.js} +1 -1
  160. package/dist/client/assets/{use-mcp-prompts-CgOsBYjP.js → use-mcp-prompts-BIRErCHu.js} +1 -1
  161. package/dist/client/assets/{use-mcp-tools-Cr3o97c-.js → use-mcp-tools-BjSYCbSh.js} +1 -1
  162. package/dist/client/assets/{use-members-BO46Bzs-.js → use-members-BUeDkAPW.js} +1 -1
  163. package/dist/client/assets/{use-mobile-CcJ4cdUT.js → use-mobile-B9jSIPRg.js} +1 -1
  164. package/dist/client/assets/{use-project-ab2lCPHD.js → use-project-B6kYJzwY.js} +1 -1
  165. package/dist/client/assets/{use-settings-modal-DnkPiNI5.js → use-settings-modal-Bi52YF5w.js} +1 -1
  166. package/dist/client/assets/{use-view-mode-nDNhs-vV.js → use-view-mode-CHcflreW.js} +1 -1
  167. package/dist/client/assets/{use-virtual-mcp-DZfG-iWT.js → use-virtual-mcp-C4mcpRPm.js} +1 -1
  168. package/dist/client/assets/useInfiniteQuery-78QQc26G.js +1 -0
  169. package/dist/client/assets/{useMutation-DMT5NBQ4.js → useMutation-C13VGcqo.js} +1 -1
  170. package/dist/client/assets/useQuery-CI6Jq2Tz.js +1 -0
  171. package/dist/client/assets/useSuspenseInfiniteQuery-BfZMgfKc.js +1 -0
  172. package/dist/client/assets/{workflow-BjckQ0gZ.js → workflow-N0cDVEpp.js} +1 -1
  173. package/dist/client/index.html +1 -1
  174. package/dist/server/cli.js +4 -4
  175. package/dist/server/migrate.js +3 -3
  176. package/dist/server/server.js +4 -4
  177. package/package.json +1 -1
  178. package/dist/client/assets/constants-D6R-nCdz.js +0 -1
  179. package/dist/client/assets/index-CdCtpL83.js +0 -1
  180. package/dist/client/assets/popover-2STAmX7J.js +0 -1
  181. package/dist/client/assets/useInfiniteQuery-fhnMOikS.js +0 -1
  182. package/dist/client/assets/useQuery-DLHdWLmJ.js +0 -1
  183. package/dist/client/assets/useSuspenseInfiniteQuery-TsQmjpXC.js +0 -1
@@ -1 +1 @@
1
- import{c as F,j as t,b as Ne,B as Ue,O as ge,aJ as it,u as ze,b$ as Qe,az as gt,p as jt,r as K,o as at,bz as bt,bH as vt,s as B,aA as Ge,aB as Nt,E as ct,e as yt,a as _t,m as Ct,k as St,l as wt,i as Tt,t as ve,K as Je}from"./index-CyQ-uP58.js";import{E as Z,C as Be}from"./collection-search-BGdQ1HZ8.js";import{E as kt,r as Pt,e as lt}from"./env-vars-editor-BXh1cAnk.js";import{g as He}from"./types-BOWXxXIK.js";import{S as It}from"./save-actions-8q-tMpO7.js";import{b as $t,a as At}from"./use-binding-rYSemil4.js";import{u as Vt,S as Mt}from"./index-B09G3SMh.js";import{f as Dt,g as dt}from"./use-connection-B5TQguFn.js";import{u as mt}from"./constants-C_615zcG.js";import{d as Ot}from"./use-mcp-tools-Cr3o97c-.js";import{b as Rt,e as Et}from"./use-mcp-prompts-CgOsBYjP.js";import{a as Lt}from"./mcp-oauth-dc0YrLAp.js";import{b as Ye,c as Ut,d as Ft,e as zt,B as Bt,a as Ht}from"./breadcrumb-r6RP68pk.js";import{C as Kt}from"./collection-tabs-DItGBx7f.js";import{i as Oe}from"./Loading01-Ccov_H-l.js";import{V as Ke,a as Xt}from"./layout-2YnSaip-.js";import{C as Wt}from"./collection-tab-BHc2Ls-Q.js";import{I as Re}from"./integration-icon-BmabWqd3.js";import{B as Fe}from"./badge-CrsiM596.js";import{D as qt,a as Qt,b as Gt,c as Ze}from"./dropdown-menu-un00sO73.js";import{F as W,a as Jt,b as q,d as H,f as Q,c as Y,e as Yt}from"./form-BZ0ccRRa.js";import{I as G}from"./input-Xyw1Rs5H.js";import{S as et,a as tt,b as st,c as nt,d as X}from"./select-BWSXn9LF.js";import{i as ut}from"./CheckCircle-DAEjX2-S.js";import{t as Zt}from"./ChevronDown-CZDY410N.js";import{n as es}from"./Container-CwxPOY0d.js";import{s as De}from"./Globe02-BxR836tG.js";import{s as ts}from"./RefreshCcw01-Df3WKdLs.js";import{i as ss}from"./Terminal-CzMkefpC.js";import{s as ns}from"./Trash01-B_x31FCQ.js";import{t as Xe}from"./Users03-Ca4cP5ST.js";import{s as os}from"./XClose-mrXHjywb.js";import{U as rs}from"./use-list-state-CSmezZQi.js";import{b as is,a as as}from"./use-virtual-mcp-DZfG-iWT.js";import{i as cs}from"./ChevronRight-DmlQyyes.js";import{s as ls}from"./Plus-DJThru9X.js";import{f as ds}from"./formatDistanceToNow-Cb2QZZJn.js";import{a as pt,C as ft}from"./collection-table-wrapper-M66G0byU.js";import{C as We}from"./card-BaUmkbam.js";import{R as ms}from"./readme-viewer-D0xX-U32.js";import{T as us,a as ps}from"./tools-list-DEuI3Via.js";import{M as fs}from"./index-SPlTfTNO.js";import"./SearchMd-ePwgMcp4.js";import"./Save01-CkhL7WEQ.js";import"./binder-5QwQ3F8k.js";import"./File06-CGEI1byM.js";import"./Key01-BMRBT_9o.js";import"./constants-D6R-nCdz.js";import"./registry-utils-Dr7PbEVZ.js";import"./extract-connection-data-BfKkaRZL.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-BBtc_IYr.js";import"./index-CXMp_veu.js";import"./circle-alert-D6oWLxFc.js";import"./index-CkihBNKz.js";import"./index-CdCtpL83.js";import"./context-BIs40mE3.js";import"./decopilot-events-Brt4gAR6.js";import"./use-llm-_rAHFXdn.js";import"./useQuery-DLHdWLmJ.js";import"./localstorage-keys-DNCBj8Gv.js";import"./useMutation-DMT5NBQ4.js";import"./skeleton-CGDNbJij.js";import"./popover-2STAmX7J.js";import"./Grid01-NpQl-yoZ.js";import"./Image01-Cqm47hN-.js";import"./Settings01-MsrMRIJf.js";import"./useSuspenseInfiniteQuery-TsQmjpXC.js";import"./infiniteQueryObserver-BvfDXev6.js";import"./index-BTQG2DxP.js";import"./use-mobile-CcJ4cdUT.js";import"./X-ep0AhpnZ.js";import"./tooltip-CNx0bR-5.js";import"./index-D6zrhjd3.js";import"./Copy01-CbgFtFXW.js";import"./DotsVertical-D74uB5qh.js";import"./Edit01-D8XxDVwQ.js";import"./Eye-BIF9gjXL.js";import"./empty-state-CzmPKPTk.js";import"./Inbox01-DiDAxgDg.js";import"./alert-dialog-zUkzI1I7.js";import"./Check-CFpzkHgf.js";import"./label-B9X06NrD.js";import"./avatar-KzEgSlwf.js";import"./use-view-mode-nDNhs-vV.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowDown-BCqJRKTw.js";import"./ArrowUp-CKW1WeCp.js";import"./List-CIQbhdro.js";import"./table-KBcJzih3.js";import"./spinner-DdFkIebA.js";import"./dialog-BzlH8DMm.js";import"./usage-B8eRkRZY.js";import"./XCircle-CcrJwxck.js";import"./AlertCircle-DFllIHYc.js";import"./ArrowLeft-DUx23LCt.js";import"./use-copy-DFl3Lkrw.js";import"./tabs-A5nHR5hM.js";import"./use-deco-chat-open-DUl097r7.js";import"./Code01-tDuxE9sy.js";import"./use-create-virtual-mcp-ClS20pFb.js";import"./marked.esm-BaswSlok.js";import"./markdown-DE0d269S.js";import"./deco-constants-BmtTfZbQ.js";import"./Clock-BYhPEf3s.js";function xs(s){const e=F.c(14),{virtualMcp:n,org:o}=s;let i;e[0]!==o||e[1]!==n.id?(i={org:o,project:ge,agentId:n.id},e[0]=o,e[1]=n.id,e[2]=i):i=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Xe,{size:16}),e[3]=a):a=e[3];let l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(Re,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[4]=n.icon,e[5]=n.title,e[6]=l):l=e[6];let g;e[7]!==n.title?(g=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=g):g=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(cs,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=x):x=e[9];let m;return e[10]!==i||e[11]!==l||e[12]!==g?(m=t.jsxs(it,{to:"/$org/$project/agents/$agentId",params:i,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[l,g,x]}),e[10]=i,e[11]=l,e[12]=g,e[13]=m):m=e[13],m}function ot(s){const e=F.c(20),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:g}=s,x=Ne(),m=as();let f;e[0]!==m.create||e[1]!==i||e[2]!==a||e[3]!==n||e[4]!==o||e[5]!==x||e[6]!==l?(f=async()=>{const d=await m.create.mutateAsync({title:`${o} Agent`,description:i??null,icon:a??null,status:"active",connections:[{connection_id:n,selected_tools:null,selected_resources:null,selected_prompts:null}]});x({to:"/$org/$project/agents/$agentId",params:{org:l,project:ge,agentId:d.id}})},e[0]=m.create,e[1]=i,e[2]=a,e[3]=n,e[4]=o,e[5]=x,e[6]=l,e[7]=f):f=e[7];const c=f;if(g){let d;e[8]!==m.create.isPending?(d=m.create.isPending?t.jsx(Oe,{size:16,className:"animate-spin"}):t.jsx(ls,{size:16}),e[8]=m.create.isPending,e[9]=d):d=e[9];let u;return e[10]!==m.create.isPending||e[11]!==c||e[12]!==d?(u=t.jsx(Ue,{variant:"ghost",className:"size-6 p-0",onClick:c,disabled:m.create.isPending,children:d}),e[10]=m.create.isPending,e[11]=c,e[12]=d,e[13]=u):u=e[13],u}let r;e[14]!==m.create.isPending?(r=m.create.isPending?t.jsx(Oe,{className:"animate-spin text-muted-foreground"}):t.jsx(Xe,{className:"size-3 text-muted-foreground"}),e[14]=m.create.isPending,e[15]=r):r=e[15];let h;return e[16]!==m.create.isPending||e[17]!==c||e[18]!==r?(h=t.jsxs(Ue,{variant:"outline",size:"sm",onClick:c,disabled:m.create.isPending,children:[r,"Create an agent"]}),e[16]=m.create.isPending,e[17]=c,e[18]=r,e[19]=h):h=e[19],h}function hs(s){const e=F.c(26),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l}=s;let g;e[0]!==n?(g={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=g):g=e[1];const x=is(g);if(!(x.length>0)){let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=u):u=e[2];let b;return e[3]!==i||e[4]!==a||e[5]!==n||e[6]!==o||e[7]!==l?(b=t.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[u,t.jsx(ot,{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:!1})]}),e[3]=i,e[4]=a,e[5]=n,e[6]=o,e[7]=l,e[8]=b):b=e[8],b}let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Agents"}),e[9]=f):f=e[9];let c;e[10]!==i||e[11]!==a||e[12]!==n||e[13]!==o||e[14]!==l?(c=t.jsx("div",{className:"flex flex-col gap-1",children:t.jsxs("div",{className:"flex items-center justify-between",children:[f,t.jsx(ot,{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:!0})]})}),e[10]=i,e[11]=a,e[12]=n,e[13]=o,e[14]=l,e[15]=c):c=e[15];let r;if(e[16]!==l||e[17]!==x){let u;e[19]!==l?(u=b=>t.jsx(xs,{virtualMcp:b,org:l},b.id),e[19]=l,e[20]=u):u=e[20],r=x.map(u),e[16]=l,e[17]=x,e[18]=r}else r=e[18];let h;e[21]!==r?(h=t.jsx("div",{className:"flex flex-col gap-2",children:r}),e[21]=r,e[22]=h):h=e[22];let d;return e[23]!==c||e[24]!==h?(d=t.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[c,h]}),e[23]=c,e[24]=h,e[25]=d):d=e[25],d}function gs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:i}){const a=Qe({control:s.control,name:"ui_type"}),l=Qe({control:s.control,name:"connection_url"}),{stdioEnabled:g}=gt(),x=(()=>{if(typeof l!="string"||!l)return!1;try{const r=new URL(l);return r.hostname==="api.githubcopilot.com"&&r.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),m=g||e.connection_type==="STDIO",f=e.connection_type==="VIRTUAL",c=f?jt(e.connection_url):null;return f?t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(Xe,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),c&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:c})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(W,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),a!=="NPX"&&a!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(et,{value:r.value,onValueChange:r.onChange,children:[t.jsx(H,{children:t.jsxs(tt,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(De,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(st,{})]})}),t.jsxs(nt,{children:[t.jsx(X,{value:"HTTP",children:"HTTP"}),t.jsx(X,{value:"SSE",children:"SSE"}),t.jsx(X,{value:"Websocket",children:"Websocket"}),m&&t.jsxs(t.Fragment,{children:[t.jsx(X,{value:"NPX",children:"NPX Package"}),t.jsx(X,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(W,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(q,{className:"flex-1 min-w-0",children:t.jsx(H,{children:t.jsx(G,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(et,{value:r.value,onValueChange:r.onChange,children:[t.jsx(H,{children:t.jsx(tt,{className:"h-10",children:t.jsx(st,{})})}),t.jsxs(nt,{children:[t.jsx(X,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(X,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(X,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"Websocket"]})}),m&&t.jsxs(t.Fragment,{children:[t.jsx(X,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(es,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(X,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ss,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(Q,{})]})}),a==="NPX"&&t.jsx(W,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(H,{children:t.jsx(G,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),a==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(W,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(H,{children:t.jsx(G,{placeholder:"node, bun, python...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),t.jsx(W,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(H,{children:t.jsx(G,{placeholder:"arg1 arg2 --flag value",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(Q,{})]})})]}),t.jsx(W,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(H,{children:t.jsx(G,{placeholder:"/path/to/project (optional)",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})})]}),(a==="NPX"||a==="STDIO")&&t.jsx(W,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(H,{children:t.jsx(kt,{value:r.value??[],onChange:r.onChange})}),t.jsx(Q,{})]})}),a!=="NPX"&&a!=="STDIO"&&t.jsx(W,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:x?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(qt,{children:[t.jsx(Qt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Fe,{variant:"success",className:"gap-1.5",children:[t.jsx(ut,{size:12}),"Authenticated via OAuth",t.jsx(Zt,{size:12})]})})}),t.jsxs(Gt,{align:"start",children:[t.jsxs(Ze,{onClick:o,children:[t.jsx(ts,{size:16}),"Re-authenticate"]}),t.jsxs(Ze,{variant:"destructive",onClick:i,children:[t.jsx(ns,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&r.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>r.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(os,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(H,{children:t.jsx(G,{type:"password",placeholder:x?"Paste your GitHub PAT":"Enter access token...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),x&&t.jsxs(Yt,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(Q,{})]})})]})}function js(s){const e=F.c(43),{form:n,connection:o,isMCPAuthenticated:i,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:g}=s,{org:x}=ze();let m;e[0]!==o.icon||e[1]!==o.title?(m=t.jsx(Re,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}),e[0]=o.icon,e[1]=o.title,e[2]=m):m=e[2];let f;e[3]!==n.control?(f=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(W,{control:n.control,name:"title",render:vs}),t.jsx(W,{control:n.control,name:"description",render:bs})]}),e[3]=n.control,e[4]=f):f=e[4];let c;e[5]!==m||e[6]!==f?(c=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[m,f]}),e[5]=m,e[6]=f,e[7]=c):c=e[7];let r;e[8]!==o||e[9]!==n||e[10]!==a||e[11]!==l||e[12]!==g?(r=t.jsx(gs,{form:n,connection:o,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:g}),e[8]=o,e[9]=n,e[10]=a,e[11]=l,e[12]=g,e[13]=r):r=e[13];let h;e[14]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[14]=h):h=e[14];let d;e[15]!==i?(d=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[h,i?t.jsxs(Fe,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[t.jsx(ut,{size:12}),"Connected"]}):t.jsx(Fe,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[15]=i,e[16]=d):d=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[17]=u):u=e[17];let b;e[18]!==o.created_by?(b=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[u,t.jsx(rs,{id:o.created_by,size:"2xs"})]}),e[18]=o.created_by,e[19]=b):b=e[19];let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[20]=v):v=e[20];let _;e[21]!==o.updated_at?(_=o.updated_at?ds(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[21]=o.updated_at,e[22]=_):_=e[22];let I;e[23]!==_?(I=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[v,t.jsx("span",{className:"text-sm text-foreground",children:_})]}),e[23]=_,e[24]=I):I=e[24];let p;e[25]!==I||e[26]!==d||e[27]!==b?(p=t.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[d,b,I]}),e[25]=I,e[26]=d,e[27]=b,e[28]=p):p=e[28];let S;e[29]!==o.description||e[30]!==o.icon||e[31]!==o.id||e[32]!==o.title||e[33]!==x.slug?(S=t.jsx(hs,{connectionId:o.id,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,org:x.slug}),e[29]=o.description,e[30]=o.icon,e[31]=o.id,e[32]=o.title,e[33]=x.slug,e[34]=S):S=e[34];let w;e[35]!==p||e[36]!==S||e[37]!==c||e[38]!==r?(w=t.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[c,r,p,S]}),e[35]=p,e[36]=S,e[37]=c,e[38]=r,e[39]=w):w=e[39];let j;return e[40]!==n||e[41]!==w?(j=t.jsx(Jt,{...n,children:w}),e[40]=n,e[41]=w,e[42]=j):j=e[42],j}function bs(s){const{field:e}=s;return t.jsxs(q,{className:"w-full space-y-0",children:[t.jsx(H,{children:t.jsx(G,{...e,value:e.value||"",className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Q,{})]})}function vs(s){const{field:e}=s;return t.jsxs(q,{className:"flex-1 space-y-0",children:[t.jsx(H,{children:t.jsx(G,{...e,className:"h-auto py-0.5 text-lg! font-medium leading-7 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})}),t.jsx(Q,{})]})}function Ns(s){const e=F.c(39),{prompts:n,connectionId:o,org:i,onPromptClick:a,showToolbar:l,emptyMessage:g}=s,x=l===void 0?!0:l,m=g===void 0?"This connection doesn't have any prompts yet.":g,f=Ne(),[c,r]=K.useState(""),[h,d]=K.useState("table"),[u,b]=K.useState("name"),[v,_]=K.useState("asc");let I;e[0]!==v||e[1]!==u?(I=C=>{u===C?(_(ws),v==="desc"&&b(void 0)):(b(C),_("asc"))},e[0]=v,e[1]=u,e[2]=I):I=e[2];const p=I;let S;e[3]!==o||e[4]!==f||e[5]!==a||e[6]!==i?(S=C=>{a?a(C):o&&i&&f({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:ge,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(C.name)}})},e[3]=o,e[4]=f,e[5]=a,e[6]=i,e[7]=S):S=e[7];const w=S;let j;if(e[8]!==n||e[9]!==c||e[10]!==v||e[11]!==u){const C=!n||n.length===0?[]:c.trim()?(()=>{const O=c.toLowerCase();return n.filter(z=>z.name.toLowerCase().includes(O)||z.description&&z.description.toLowerCase().includes(O))})():n;j=!u||!v?C:[...C].sort((O,z)=>{const je=O[u]||"",ee=z[u]||"",J=String(je).localeCompare(String(ee));return v==="asc"?J:-J}),e[8]=n,e[9]=c,e[10]=v,e[11]=u,e[12]=j}else j=e[12];const $=j;let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=[{id:"name",header:"Name",render:Ss,sortable:!0},{id:"description",header:"Description",render:Cs,cellClassName:"flex-1",sortable:!0}],e[13]=k):k=e[13];const E=k;let V;e[14]===Symbol.for("react.memo_cache_sentinel")?(V=E.filter(_s).map(ys),e[14]=V):V=e[14];const M=V;let y;e[15]!==p||e[16]!==x||e[17]!==v||e[18]!==u||e[19]!==h?(y=x&&t.jsx(Ke,{children:t.jsx(ft,{viewMode:h,onViewModeChange:d,sortKey:u,sortDirection:v,onSort:p,sortOptions:M})}),e[15]=p,e[16]=x,e[17]=v,e[18]=u,e[19]=h,e[20]=y):y=e[20];let L;e[21]===Symbol.for("react.memo_cache_sentinel")?(L=C=>{C.key==="Escape"&&(r(""),C.target.blur())},e[21]=L):L=e[21];let A;e[22]!==c?(A=t.jsx(Be,{value:c,onChange:r,placeholder:"Search prompts...",onKeyDown:L}),e[22]=c,e[23]=A):A=e[23];let N;e[24]!==m||e[25]!==w||e[26]!==p||e[27]!==c||e[28]!==v||e[29]!==u||e[30]!==$||e[31]!==h?(N=h==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:$.length===0?t.jsx(Z,{image:null,title:c?"No prompts found":"No prompts available",description:c?"Try adjusting your search terms":m}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:$.map(C=>t.jsx(We,{className:"cursor-pointer transition-colors",onClick:()=>w(C),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Re,{icon:null,name:C.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:C.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:C.description||"No description"})]})]})},C.name))})}):t.jsx(pt,{columns:E,data:$,isLoading:!1,sortKey:u,sortDirection:v,onSort:p,onRowClick:C=>w(C),emptyState:t.jsx(Z,{image:null,title:c?"No prompts found":"No prompts available",description:c?"Try adjusting your search terms":m})}),e[24]=m,e[25]=w,e[26]=p,e[27]=c,e[28]=v,e[29]=u,e[30]=$,e[31]=h,e[32]=N):N=e[32];let P;e[33]!==A||e[34]!==N?(P=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[A,N]}),e[33]=A,e[34]=N,e[35]=P):P=e[35];let D;return e[36]!==P||e[37]!==y?(D=t.jsxs(t.Fragment,{children:[y,P]}),e[36]=P,e[37]=y,e[38]=D):D=e[38],D}function ys(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function _s(s){return s.sortable}function Cs(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ss(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function ws(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Ts(s){const e=F.c(4),{prompts:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx(Ns,{prompts:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}function ks(s){const e=F.c(2),{repository:n}=s;let o;return e[0]!==n?(o=t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(ms,{repository:n})}),e[0]=n,e[1]=o):o=e[1],o}function Ps(s){const e=F.c(36),{resources:n,onResourceClick:o,showToolbar:i,emptyMessage:a}=s,l=i===void 0?!0:i,g=a===void 0?"This connection doesn't have any resources yet.":a,[x,m]=K.useState(""),[f,c]=K.useState("table"),[r,h]=K.useState("name"),[d,u]=K.useState("asc");let b;e[0]!==d||e[1]!==r?(b=N=>{r===N?(u(Os),d==="desc"&&h(void 0)):(h(N),u("asc"))},e[0]=d,e[1]=r,e[2]=b):b=e[2];const v=b;let _;e[3]!==o?(_=N=>{o&&o(N)},e[3]=o,e[4]=_):_=e[4];const I=_;let p;if(e[5]!==n||e[6]!==x||e[7]!==d||e[8]!==r){const N=!n||n.length===0?[]:x.trim()?(()=>{const P=x.toLowerCase();return n.filter(D=>D.uri.toLowerCase().includes(P)||D.name&&D.name.toLowerCase().includes(P)||D.description&&D.description.toLowerCase().includes(P))})():n;p=!r||!d?N:[...N].sort((P,D)=>{const C=P[r]||"",O=D[r]||"",z=String(C).localeCompare(String(O));return d==="asc"?z:-z}),e[5]=n,e[6]=x,e[7]=d,e[8]=r,e[9]=p}else p=e[9];const S=p;let w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=[{id:"name",header:"Name",render:Ds,sortable:!0},{id:"uri",header:"URI",render:Ms,sortable:!0},{id:"description",header:"Description",render:Vs,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:As,sortable:!0}],e[10]=w):w=e[10];const j=w;let $;e[11]===Symbol.for("react.memo_cache_sentinel")?($=j.filter($s).map(Is),e[11]=$):$=e[11];const k=$;let E;e[12]!==v||e[13]!==l||e[14]!==d||e[15]!==r||e[16]!==f?(E=l&&t.jsx(Ke,{children:t.jsx(ft,{viewMode:f,onViewModeChange:c,sortKey:r,sortDirection:d,onSort:v,sortOptions:k})}),e[12]=v,e[13]=l,e[14]=d,e[15]=r,e[16]=f,e[17]=E):E=e[17];let V;e[18]===Symbol.for("react.memo_cache_sentinel")?(V=N=>{N.key==="Escape"&&(m(""),N.target.blur())},e[18]=V):V=e[18];let M;e[19]!==x?(M=t.jsx(Be,{value:x,onChange:m,placeholder:"Search resources...",onKeyDown:V}),e[19]=x,e[20]=M):M=e[20];let y;e[21]!==g||e[22]!==I||e[23]!==v||e[24]!==x||e[25]!==d||e[26]!==r||e[27]!==S||e[28]!==f?(y=f==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:S.length===0?t.jsx(Z,{image:null,title:x?"No resources found":"No resources available",description:x?"Try adjusting your search terms":g}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:S.map(N=>t.jsx(We,{className:"cursor-pointer transition-colors",onClick:()=>I(N),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Re,{icon:null,name:N.name||N.uri,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:N.name||N.uri}),t.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:N.uri}),N.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:N.description})]})]})},N.uri))})}):t.jsx(pt,{columns:j,data:S,isLoading:!1,sortKey:r,sortDirection:d,onSort:v,onRowClick:N=>I(N),emptyState:t.jsx(Z,{image:null,title:x?"No resources found":"No resources available",description:x?"Try adjusting your search terms":g})}),e[21]=g,e[22]=I,e[23]=v,e[24]=x,e[25]=d,e[26]=r,e[27]=S,e[28]=f,e[29]=y):y=e[29];let L;e[30]!==M||e[31]!==y?(L=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[M,y]}),e[30]=M,e[31]=y,e[32]=L):L=e[32];let A;return e[33]!==L||e[34]!==E?(A=t.jsxs(t.Fragment,{children:[E,L]}),e[33]=L,e[34]=E,e[35]=A):A=e[35],A}function Is(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function $s(s){return s.sortable}function As(s){return t.jsx("span",{className:"text-sm text-muted-foreground",children:s.mimeType||"—"})}function Vs(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ms(s){return t.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:s.uri})}function Ds(s){return t.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name||s.uri})}function Os(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Rs(s){const e=F.c(4),{resources:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx(Ps,{resources:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}const Es=at({key:B().min(1,"Key is required"),value:B()}),Ls=at({title:B().min(1,"Name is required"),description:B().nullable().optional(),ui_type:Nt(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:B().optional(),connection_token:B().nullable().optional(),npx_package:B().optional(),stdio_command:B().optional(),stdio_args:B().optional(),stdio_cwd:B().optional(),env_vars:Ge(Es).optional(),configuration_scopes:Ge(B()).nullable().optional(),configuration_state:bt(B(),vt()).nullable().optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Us(s){const e=F.c(5),{tools:n,connectionId:o,org:i,isLoading:a}=s;let l;return e[0]!==o||e[1]!==a||e[2]!==i||e[3]!==n?(l=t.jsx(us,{tools:n,connectionId:o,org:i,isLoading:a}),e[0]=o,e[1]=a,e[2]=i,e[3]=n,e[4]=l):l=e[4],l}function Fs(s){const e=F.c(27),{tools:n,connectionId:o,org:i}=s,a=Ne(),{org:l}=ze();let g;e[0]!==o||e[1]!==l.id?(g={connectionId:o,orgId:l.id},e[0]=o,e[1]=l.id,e[2]=g):g=e[2];const x=mt(g),[m,f]=K.useState("");let c,r,h,d;if(e[3]!==x||e[4]!==o||e[5]!==a||e[6]!==i||e[7]!==m||e[8]!==n){const v=(n??[]).filter(zs),_=m.toLowerCase().trim(),I=_?v.filter(j=>j.name.toLowerCase().includes(_)||j.description&&j.description.toLowerCase().includes(_)):v;let p;e[13]!==o||e[14]!==a||e[15]!==i?(p=j=>{a({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:ge,connectionId:o,collectionName:"tools",itemId:encodeURIComponent(j.name)}})},e[13]=o,e[14]=a,e[15]=i,e[16]=p):p=e[16];const S=p;h="flex flex-col h-full overflow-hidden";let w;e[17]===Symbol.for("react.memo_cache_sentinel")?(w=j=>{j.key==="Escape"&&(f(""),j.target.blur())},e[17]=w):w=e[17],e[18]!==m?(d=t.jsx(Be,{value:m,onChange:f,placeholder:"Search apps...",onKeyDown:w}),e[18]=m,e[19]=d):d=e[19],c="flex-1 overflow-auto p-5",r=I.length===0?t.jsx(Z,{image:null,title:m?"No apps found":"No apps available",description:m?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:I.map(j=>{const $=He(j._meta);return t.jsxs(We,{className:"cursor-pointer transition-colors overflow-hidden",onClick:()=>S(j),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(fs,{resourceURI:$,toolName:j.name,displayMode:"inline",minHeight:200,maxHeight:200,client:x})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:j.name}),t.jsx(ps,{annotations:j.annotations,_meta:j._meta})]}),j.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j.description})]})]},j.name)})}),e[3]=x,e[4]=o,e[5]=a,e[6]=i,e[7]=m,e[8]=n,e[9]=c,e[10]=r,e[11]=h,e[12]=d}else c=e[9],r=e[10],h=e[11],d=e[12];let u;e[20]!==c||e[21]!==r?(u=t.jsx("div",{className:c,children:r}),e[20]=c,e[21]=r,e[22]=u):u=e[22];let b;return e[23]!==h||e[24]!==d||e[25]!==u?(b=t.jsxs("div",{className:h,children:[d,u]}),e[23]=h,e[24]=d,e[25]=u,e[26]=b):b=e[26],b}function zs(s){return!!He(s._meta)}function Bs(s){return s.command==="npx"}function Hs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Ks(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Xs(s,e){const n={command:"npx",args:["-y",s]},o=lt(e);return Object.keys(o).length>0&&(n.envVars=o),n}function Ws(s,e,n,o){const i={command:s};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const a=lt(o);return Object.keys(a).length>0&&(i.envVars=a),i}function rt(s,e){const n={title:s.title,description:s.description??"",configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Tt(s.connection_headers)){const o=s.connection_headers,i=Pt(o.envVars);if(Bs(o)){const l=Hs(o);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i}}const a=Ks(o);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:i}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function qs(s){let e,n=null,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=Xs(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=Ws(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",o=s.connection_token||null),{title:s.title,description:s.description||null,connection_type:e,connection_url:n,...o&&{connection_token:o},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function Qs(s){const e=F.c(116),{connection:n,connectionId:o,org:i,requestedTabId:a,collections:l,onUpdate:g,isUpdating:x,prompts:m,resources:f,tools:c,isLoadingTools:r}=s;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={from:"/$org/$project/mcps/$connectionId"},e[0]=h):h=e[0];const d=Ne(h),u=Ct(),b=dt();let v;e[1]!==o?(v={connectionId:o},e[1]=o,e[2]=v):v=e[2];const _=Vt(v),p=n?.connection_type==="VIRTUAL"||_.isAuthenticated;let S;e[3]!==n?(S={connections:[n],binding:"MCP"},e[3]=n,e[4]=S):S=e[4];const j=At(S).length>0,$=n?.metadata?.repository,k=!!$?.url;let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=St(Ls),e[5]=E):E=e[5];let V;e[6]!==n?(V=rt(n),e[6]=n,e[7]=V):V=e[7];let M;e[8]!==V?(M={resolver:E,values:V},e[8]=V,e[9]=M):M=e[9];const y=wt(M),L=y.formState.isDirty;let A;e[10]!==y||e[11]!==g?(A=async()=>{if(!await y.trigger())return;const U=y.getValues(),he=qs(U);await g(he),y.reset(U)},e[10]=y,e[11]=g,e[12]=A):A=e[12];const N=A;let P;e[13]!==n||e[14]!==y?(P=()=>{y.reset(rt(n))},e[13]=n,e[14]=y,e[15]=P):P=e[15];const D=P;let C;e[16]!==n.id||e[17]!==b||e[18]!==u?(C=async()=>{const{token:T,tokenInfo:U,error:he}=await Lt({connectionId:n.id});if(he||!T){ve.error(`Authentication failed: ${he}`);return}if(U)try{const Me=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:U.accessToken,refreshToken:U.refreshToken,expiresIn:U.expiresIn,scope:U.scope,clientId:U.clientId,clientSecret:U.clientSecret,tokenEndpoint:U.tokenEndpoint})});if(!Me.ok)console.error("Failed to save OAuth token:",await Me.text()),await b.update.mutateAsync({id:n.id,data:{connection_token:T}});else try{await b.update.mutateAsync({id:n.id,data:{}})}catch(qe){console.warn("Failed to refresh connection tools after OAuth:",qe)}}catch(Me){console.error("Error saving OAuth token:",Me),await b.update.mutateAsync({id:n.id,data:{connection_token:T}})}else await b.update.mutateAsync({id:n.id,data:{connection_token:T}});const ht=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:Je.isMCPAuthenticated(ht.href,null)}),ve.success("Authentication successful")},e[16]=n.id,e[17]=b,e[18]=u,e[19]=C):C=e[19];const O=C;let z;e[20]!==n.id||e[21]!==u?(z=async()=>{try{const T=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!T.ok){const he=await T.text();ve.error(`Failed to remove OAuth: ${he}`);return}const U=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:Je.isMCPAuthenticated(U.href,null)}),ve.success("OAuth removed. You can now re-authenticate with a different account.")}catch(T){console.error("Error removing OAuth token:",T),ve.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=u,e[22]=z):z=e[22];const je=z,ee=c.length,J=m.length,ye=f.length;let _e;e[23]!==c?(_e=c.filter(Ys),e[23]=c,e[24]=_e):_e=e[24];const Ce=_e.length,Ee=ee>0||r;let Se;e[25]===Symbol.for("react.memo_cache_sentinel")?(Se={id:"settings",label:"Settings"},e[25]=Se):Se=e[25];let te;e[26]!==r||e[27]!==p||e[28]!==Ee||e[29]!==ee?(te=p&&Ee?[{id:"tools",label:"Tools",count:r?void 0:ee}]:[],e[26]=r,e[27]=p,e[28]=Ee,e[29]=ee,e[30]=te):te=e[30];let se;e[31]!==p||e[32]!==J?(se=p&&J>0?[{id:"prompts",label:"Prompts",count:J}]:[],e[31]=p,e[32]=J,e[33]=se):se=e[33];let ne;e[34]!==p||e[35]!==ye?(ne=p&&ye>0?[{id:"resources",label:"Resources",count:ye}]:[],e[34]=p,e[35]=ye,e[36]=ne):ne=e[36];let oe;e[37]!==p||e[38]!==Ce?(oe=p&&Ce>0?[{id:"ui",label:"UI",count:Ce}]:[],e[37]=p,e[38]=Ce,e[39]=oe):oe=e[39];let we;if(e[40]!==l||e[41]!==k||e[42]!==p||e[43]!==te||e[44]!==se||e[45]!==ne||e[46]!==oe){let T;e[48]!==k?(T=k?[{id:"readme",label:"README"}]:[],e[48]=k,e[49]=T):T=e[49],we=[Se,...te,...se,...ne,...oe,...p?(l||[]).map(Js):[],...T],e[40]=l,e[41]=k,e[42]=p,e[43]=te,e[44]=se,e[45]=ne,e[46]=oe,e[47]=we}else we=e[47];const be=we,xt=p&&be.some(Gs)?"tools":"settings",R=be.some(T=>T.id===a)?a:xt;let Te;e[50]!==d?(Te=T=>{d({search:U=>({...U,tab:T}),replace:!0})},e[50]=d,e[51]=Te):Te=e[51];const re=Te;let ie;e[52]!==l?(ie=l||[],e[52]=l,e[53]=ie):ie=e[53];let ke;if(e[54]!==R||e[55]!==ie){let T;e[57]!==R?(T=U=>U.name===R,e[57]=R,e[58]=T):T=e[58],ke=ie.find(T),e[54]=R,e[55]=ie,e[56]=ke}else ke=e[56];const Pe=ke;let ae;e[59]!==i?(ae=t.jsx(Ye,{children:t.jsx(Ft,{asChild:!0,children:t.jsx(it,{to:"/$org/$project/mcps",params:{org:i,project:ge},children:"Connections"})})}),e[59]=i,e[60]=ae):ae=e[60];let Ie;e[61]===Symbol.for("react.memo_cache_sentinel")?(Ie=t.jsx(zt,{}),e[61]=Ie):Ie=e[61];let ce;e[62]!==n.title?(ce=t.jsx(Ye,{children:t.jsx(Ut,{children:n.title})}),e[62]=n.title,e[63]=ce):ce=e[63];let $e;e[64]!==ae||e[65]!==ce?($e=t.jsx(Bt,{children:t.jsxs(Ht,{children:[ae,Ie,ce]})}),e[64]=ae,e[65]=ce,e[66]=$e):$e=e[66];const Le=$e;let le;e[67]!==N||e[68]!==D||e[69]!==L||e[70]!==x?(le=t.jsx(Ke,{children:t.jsx(It,{onSave:N,onUndo:D,isDirty:L,isSaving:x})}),e[67]=N,e[68]=D,e[69]=L,e[70]=x,e[71]=le):le=e[71];let de;e[72]!==_.hasOAuthToken||e[73]!==n||e[74]!==y||e[75]!==O||e[76]!==je||e[77]!==p?(de=t.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:t.jsx(js,{form:y,connection:n,isMCPAuthenticated:p,hasOAuthToken:_.hasOAuthToken,onReauthenticate:O,onRemoveOAuth:je})}),e[72]=_.hasOAuthToken,e[73]=n,e[74]=y,e[75]=O,e[76]=je,e[77]=p,e[78]=de):de=e[78];let me;e[79]!==R||e[80]!==re||e[81]!==be?(me=t.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:t.jsx(Kt,{tabs:be,activeTab:R,onTabChange:re,className:"flex-1"})}),e[79]=R,e[80]=re,e[81]=be,e[82]=me):me=e[82];let Ae;e[83]===Symbol.for("react.memo_cache_sentinel")?(Ae=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),e[83]=Ae):Ae=e[83];let ue;e[84]!==Pe||e[85]!==R||e[86]!==_.isServerError||e[87]!==_.supportsOAuth||e[88]!==n||e[89]!==o||e[90]!==y||e[91]!==O||e[92]!==re||e[93]!==j||e[94]!==k||e[95]!==r||e[96]!==p||e[97]!==i||e[98]!==m||e[99]!==$||e[100]!==f||e[101]!==c?(ue=t.jsx(K.Suspense,{fallback:Ae,children:R==="tools"?t.jsx(Us,{tools:c,connectionId:o,org:i,isLoading:r}):R==="ui"?t.jsx(Fs,{tools:c,connectionId:o,org:i}):R==="prompts"?t.jsx(Ts,{prompts:m,connectionId:o,org:i}):R==="resources"?t.jsx(Rs,{resources:f,connectionId:o,org:i}):R==="settings"?t.jsx(Mt,{connection:n,form:y,hasMcpBinding:j,isMCPAuthenticated:p,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:O,onViewReadme:k?()=>re("readme"):void 0}):R==="readme"&&k?t.jsx(ks,{repository:$}):Pe&&p?t.jsx(Wt,{connectionId:o,org:i,activeCollection:Pe},R):t.jsx(Z,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[84]=Pe,e[85]=R,e[86]=_.isServerError,e[87]=_.supportsOAuth,e[88]=n,e[89]=o,e[90]=y,e[91]=O,e[92]=re,e[93]=j,e[94]=k,e[95]=r,e[96]=p,e[97]=i,e[98]=m,e[99]=$,e[100]=f,e[101]=c,e[102]=ue):ue=e[102];let pe;e[103]!==R||e[104]!==ue?(pe=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(ct,{children:ue},R)}),e[103]=R,e[104]=ue,e[105]=pe):pe=e[105];let fe;e[106]!==me||e[107]!==pe?(fe=t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[me,pe]}),e[106]=me,e[107]=pe,e[108]=fe):fe=e[108];let xe;e[109]!==de||e[110]!==fe?(xe=t.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[de,fe]}),e[109]=de,e[110]=fe,e[111]=xe):xe=e[111];let Ve;return e[112]!==Le||e[113]!==le||e[114]!==xe?(Ve=t.jsxs(Xt,{breadcrumb:Le,children:[le,xe]}),e[112]=Le,e[113]=le,e[114]=xe,e[115]=Ve):Ve=e[115],Ve}function Gs(s){return s.id==="tools"}function Js(s){return{id:s.name,label:s.displayName}}function Ys(s){return!!He(s._meta)}function Zs(){const s=F.c(43);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$connectionId"},s[0]=e):e=s[0];const n=Ne(e);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/$project/mcps/$connectionId"},s[1]=o):o=s[1];const{connectionId:i,org:a}=yt(o),{org:l}=ze();let g;s[2]===Symbol.for("react.memo_cache_sentinel")?(g={from:"/shell/$org/$project/mcps/$connectionId"},s[2]=g):g=s[2];const m=_t(g).tab??"",f=Dt(i),c=dt(),r=$t(f??void 0);let h;s[3]!==i||s[4]!==l.id?(h={connectionId:i,orgId:l.id},s[3]=i,s[4]=l.id,s[5]=h):h=s[5];const d=mt(h);let u;s[6]!==d?(u={client:d},s[6]=d,s[7]=u):u=s[7];const{data:b}=Rt(u);let v;s[8]!==d?(v={client:d},s[8]=d,s[9]=v):v=s[9];const{data:_}=Et(v),p=!(f?.connection_type==="VIRTUAL")&&f?.tools&&f.tools.length>0,S=!p;let w;s[10]!==d||s[11]!==S?(w={client:d,enabled:S},s[10]=d,s[11]=S,s[12]=w):w=s[12];const{data:j,isLoading:$}=Ot(w);let k;s[13]!==b?.prompts?(k=b?.prompts??[],s[13]=b?.prompts,s[14]=k):k=s[14];let E;s[15]!==k?(E=k.map(sn),s[15]=k,s[16]=E):E=s[16];const V=E;let M;s[17]!==_?.resources?(M=_?.resources??[],s[17]=_?.resources,s[18]=M):M=s[18];let y;s[19]!==M?(y=M.map(tn),s[19]=M,s[20]=y):y=s[20];const L=y;let A;s[21]!==f||s[22]!==p||s[23]!==j?.tools?(A=p?f.tools??[]:(j?.tools??[]).map(en),s[21]=f,s[22]=p,s[23]=j?.tools,s[24]=A):A=s[24];const N=A;let P;s[25]!==c.update||s[26]!==i?(P=async O=>{await c.update.mutateAsync({id:i,data:O})},s[25]=c.update,s[26]=i,s[27]=P):P=s[27];const D=P;if(!f){let O;return s[28]!==n||s[29]!==a?(O=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Z,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(Ue,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:a,project:ge}}),children:"Back to connections"})})}),s[28]=n,s[29]=a,s[30]=O):O=s[30],O}let C;return s[31]!==c.update.isPending||s[32]!==r||s[33]!==f||s[34]!==i||s[35]!==D||s[36]!==$||s[37]!==a||s[38]!==V||s[39]!==m||s[40]!==L||s[41]!==N?(C=t.jsx(Qs,{org:a,connection:f,connectionId:i,requestedTabId:m,collections:r,onUpdate:D,isUpdating:c.update.isPending,prompts:V,resources:L,tools:N,isLoadingTools:$}),s[31]=c.update.isPending,s[32]=r,s[33]=f,s[34]=i,s[35]=D,s[36]=$,s[37]=a,s[38]=V,s[39]=m,s[40]=L,s[41]=N,s[42]=C):C=s[42],C}function en(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations,_meta:s._meta}}function tn(s){return{uri:s.uri,name:s.name,description:s.description}}function sn(s){return{name:s.name,description:s.description}}function nn(){const s=F.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ct,{children:t.jsx(K.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Zs,{})})}),s[0]=e):e=s[0],e}function rr(){const s=F.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(nn,{}),s[0]=e):e=s[0],e}export{rr as default};
1
+ import{c as F,j as t,b as Ne,B as Ue,O as ge,aI as it,u as Be,b_ as Ge,az as gt,p as jt,r as X,o as at,by as bt,bG as vt,s as z,aA as Qe,aB as Nt,E as ct,e as yt,a as _t,m as Ct,k as St,l as wt,i as Tt,t as ve,K as Je}from"./index-0HoOnen3.js";import{E as Z,C as ze}from"./collection-search-DeB-znan.js";import{E as kt,r as Pt,e as lt}from"./env-vars-editor-CZ9xwqbP.js";import{g as Ke}from"./types-BPCR06YW.js";import{S as It}from"./save-actions-CNp28sAN.js";import{b as $t,a as At}from"./use-binding-CcrgjIcJ.js";import{u as Vt,S as Mt}from"./index-Cz17zD6m.js";import{f as Dt,g as dt}from"./use-connection-B6TFiTxb.js";import{u as mt}from"./constants-DyBxaLKI.js";import{d as Ot}from"./use-mcp-tools-BjSYCbSh.js";import{b as Rt,e as Et}from"./use-mcp-prompts-BIRErCHu.js";import{a as Lt}from"./mcp-oauth-D5R57Lko.js";import{b as Ye,c as Ut,d as Ft,e as Bt,B as zt,a as Kt}from"./breadcrumb-BcJj21EL.js";import{C as Xt}from"./collection-tabs-CI_dPETO.js";import{i as Oe}from"./Loading01-Jv8Mbea8.js";import{V as Xe,a as Ht}from"./layout-Cgu_nW-7.js";import{C as Wt}from"./collection-tab-DnFTZr-h.js";import{I as Re}from"./integration-icon-5VjL1GgL.js";import{B as Fe}from"./badge-0EzsH3AB.js";import{D as qt,a as Gt,b as Qt,c as Ze}from"./dropdown-menu-VTiqKHN9.js";import{F as W,a as Jt,b as q,d as K,f as G,c as Y,e as Yt}from"./form-p8UY3zWX.js";import{I as Q}from"./input-BtUicd3Q.js";import{S as et,a as tt,b as st,c as nt,d as H}from"./select-DOO2sOs0.js";import{i as ut}from"./CheckCircle-DvhMgeYT.js";import{t as Zt}from"./ChevronDown-Dyskz-ZD.js";import{n as es}from"./Container-DBGOFJUc.js";import{s as De}from"./Globe02-nOidPs01.js";import{s as ts}from"./RefreshCcw01-Busgf2jQ.js";import{i as ss}from"./Terminal-d72o721Q.js";import{s as ns}from"./Trash01-CKATI1mI.js";import{t as He}from"./Users03-CLx_Qxdb.js";import{s as os}from"./XClose-D-4ELBrc.js";import{U as rs}from"./use-list-state-Bpa4-xTU.js";import{b as is,a as as}from"./use-virtual-mcp-C4mcpRPm.js";import{i as cs}from"./ChevronRight-D6p6jiry.js";import{s as ls}from"./Plus-Cecv4wEo.js";import{f as ds}from"./formatDistanceToNow-Cb2QZZJn.js";import{a as pt,C as ft}from"./collection-table-wrapper-BkrnGVuo.js";import{C as We}from"./card-c-CJHmFC.js";import{R as ms}from"./readme-viewer-BFDmw5ln.js";import{T as us,a as ps}from"./tools-list-DJeaOzT_.js";import{M as fs}from"./index-BPWcS_Kf.js";import"./SearchMd-CS2uMIPl.js";import"./Save01-P2clZJAi.js";import"./binder-w9dF9fSa.js";import"./File06-DCHaBaad.js";import"./Key01-bHmq-6W2.js";import"./constants-DK6m0rOQ.js";import"./registry-utils-BPK3KAEQ.js";import"./extract-connection-data-bPHhUn8L.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-BCXPqkOi.js";import"./index-BRPNbM-s.js";import"./circle-alert-orNW2INv.js";import"./index-CmPWq7Ch.js";import"./index-CqCzS9v2.js";import"./context-GOV4Tst1.js";import"./decopilot-events-Brt4gAR6.js";import"./use-llm-7gZpMpM0.js";import"./useQuery-CI6Jq2Tz.js";import"./localstorage-keys-BoChS3hJ.js";import"./useMutation-C13VGcqo.js";import"./skeleton-CR236scd.js";import"./popover-P8B4MdX3.js";import"./Grid01-C8gF-dWK.js";import"./Image01-BrzUQQ9K.js";import"./Settings01-BAgxhvm4.js";import"./useSuspenseInfiniteQuery-BfZMgfKc.js";import"./infiniteQueryObserver-Be7iTEXe.js";import"./index-G8oxxr2G.js";import"./use-mobile-B9jSIPRg.js";import"./X-RC7YVNJU.js";import"./tooltip-BWlQ9UL9.js";import"./index-BymQJSqf.js";import"./Copy01-CPaHCgqg.js";import"./DotsVertical-DcLEsGDj.js";import"./Edit01-BEBZ-Ht5.js";import"./Eye-VtlrDhJf.js";import"./empty-state-CevFdaoX.js";import"./Inbox01-DK0JkUYE.js";import"./alert-dialog-CdqWA8wc.js";import"./Check-BIaai9j0.js";import"./label-D6atofYo.js";import"./avatar-tLGNC2ok.js";import"./use-view-mode-CHcflreW.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowDown-DPy5cnDQ.js";import"./ArrowUp-Dx6U6WtF.js";import"./List-mX8yEKmx.js";import"./table-CK5AQN01.js";import"./spinner-DzG2AImj.js";import"./dialog-L8ZakXii.js";import"./usage-B8eRkRZY.js";import"./XCircle-BgJPZWR5.js";import"./AlertCircle-Y6iSJK0t.js";import"./ArrowLeft-p4dfchJF.js";import"./use-copy-DfInz4oY.js";import"./tabs-ZEd61iZd.js";import"./use-deco-chat-open-BmqwFIXp.js";import"./Code01-BYnTXqsh.js";import"./use-create-virtual-mcp-pELq4UZ_.js";import"./marked.esm-BaswSlok.js";import"./markdown-C4hTkq3E.js";import"./deco-constants-BmtTfZbQ.js";import"./Clock-Dymou738.js";function xs(s){const e=F.c(14),{virtualMcp:n,org:o}=s;let i;e[0]!==o||e[1]!==n.id?(i={org:o,project:ge,agentId:n.id},e[0]=o,e[1]=n.id,e[2]=i):i=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(He,{size:16}),e[3]=a):a=e[3];let l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(Re,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[4]=n.icon,e[5]=n.title,e[6]=l):l=e[6];let g;e[7]!==n.title?(g=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=g):g=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(cs,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=x):x=e[9];let m;return e[10]!==i||e[11]!==l||e[12]!==g?(m=t.jsxs(it,{to:"/$org/$project/agents/$agentId",params:i,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[l,g,x]}),e[10]=i,e[11]=l,e[12]=g,e[13]=m):m=e[13],m}function ot(s){const e=F.c(20),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:g}=s,x=Ne(),m=as();let f;e[0]!==m.create||e[1]!==i||e[2]!==a||e[3]!==n||e[4]!==o||e[5]!==x||e[6]!==l?(f=async()=>{const d=await m.create.mutateAsync({title:`${o} Agent`,description:i??null,icon:a??null,status:"active",connections:[{connection_id:n,selected_tools:null,selected_resources:null,selected_prompts:null}]});x({to:"/$org/$project/agents/$agentId",params:{org:l,project:ge,agentId:d.id}})},e[0]=m.create,e[1]=i,e[2]=a,e[3]=n,e[4]=o,e[5]=x,e[6]=l,e[7]=f):f=e[7];const c=f;if(g){let d;e[8]!==m.create.isPending?(d=m.create.isPending?t.jsx(Oe,{size:16,className:"animate-spin"}):t.jsx(ls,{size:16}),e[8]=m.create.isPending,e[9]=d):d=e[9];let u;return e[10]!==m.create.isPending||e[11]!==c||e[12]!==d?(u=t.jsx(Ue,{variant:"ghost",className:"size-6 p-0",onClick:c,disabled:m.create.isPending,children:d}),e[10]=m.create.isPending,e[11]=c,e[12]=d,e[13]=u):u=e[13],u}let r;e[14]!==m.create.isPending?(r=m.create.isPending?t.jsx(Oe,{className:"animate-spin text-muted-foreground"}):t.jsx(He,{className:"size-3 text-muted-foreground"}),e[14]=m.create.isPending,e[15]=r):r=e[15];let h;return e[16]!==m.create.isPending||e[17]!==c||e[18]!==r?(h=t.jsxs(Ue,{variant:"outline",size:"sm",onClick:c,disabled:m.create.isPending,children:[r,"Create an agent"]}),e[16]=m.create.isPending,e[17]=c,e[18]=r,e[19]=h):h=e[19],h}function hs(s){const e=F.c(26),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l}=s;let g;e[0]!==n?(g={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=g):g=e[1];const x=is(g);if(!(x.length>0)){let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=u):u=e[2];let b;return e[3]!==i||e[4]!==a||e[5]!==n||e[6]!==o||e[7]!==l?(b=t.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[u,t.jsx(ot,{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:!1})]}),e[3]=i,e[4]=a,e[5]=n,e[6]=o,e[7]=l,e[8]=b):b=e[8],b}let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Agents"}),e[9]=f):f=e[9];let c;e[10]!==i||e[11]!==a||e[12]!==n||e[13]!==o||e[14]!==l?(c=t.jsx("div",{className:"flex flex-col gap-1",children:t.jsxs("div",{className:"flex items-center justify-between",children:[f,t.jsx(ot,{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:!0})]})}),e[10]=i,e[11]=a,e[12]=n,e[13]=o,e[14]=l,e[15]=c):c=e[15];let r;if(e[16]!==l||e[17]!==x){let u;e[19]!==l?(u=b=>t.jsx(xs,{virtualMcp:b,org:l},b.id),e[19]=l,e[20]=u):u=e[20],r=x.map(u),e[16]=l,e[17]=x,e[18]=r}else r=e[18];let h;e[21]!==r?(h=t.jsx("div",{className:"flex flex-col gap-2",children:r}),e[21]=r,e[22]=h):h=e[22];let d;return e[23]!==c||e[24]!==h?(d=t.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[c,h]}),e[23]=c,e[24]=h,e[25]=d):d=e[25],d}function gs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:i}){const a=Ge({control:s.control,name:"ui_type"}),l=Ge({control:s.control,name:"connection_url"}),{stdioEnabled:g}=gt(),x=(()=>{if(typeof l!="string"||!l)return!1;try{const r=new URL(l);return r.hostname==="api.githubcopilot.com"&&r.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),m=g||e.connection_type==="STDIO",f=e.connection_type==="VIRTUAL",c=f?jt(e.connection_url):null;return f?t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(He,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),c&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:c})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(W,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),a!=="NPX"&&a!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(et,{value:r.value,onValueChange:r.onChange,children:[t.jsx(K,{children:t.jsxs(tt,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(De,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(st,{})]})}),t.jsxs(nt,{children:[t.jsx(H,{value:"HTTP",children:"HTTP"}),t.jsx(H,{value:"SSE",children:"SSE"}),t.jsx(H,{value:"Websocket",children:"Websocket"}),m&&t.jsxs(t.Fragment,{children:[t.jsx(H,{value:"NPX",children:"NPX Package"}),t.jsx(H,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(W,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(q,{className:"flex-1 min-w-0",children:t.jsx(K,{children:t.jsx(Q,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(et,{value:r.value,onValueChange:r.onChange,children:[t.jsx(K,{children:t.jsx(tt,{className:"h-10",children:t.jsx(st,{})})}),t.jsxs(nt,{children:[t.jsx(H,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(H,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(H,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"Websocket"]})}),m&&t.jsxs(t.Fragment,{children:[t.jsx(H,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(es,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(H,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ss,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(G,{})]})}),a==="NPX"&&t.jsx(W,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(K,{children:t.jsx(Q,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})}),a==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(W,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(K,{children:t.jsx(Q,{placeholder:"node, bun, python...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})}),t.jsx(W,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(K,{children:t.jsx(Q,{placeholder:"arg1 arg2 --flag value",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(G,{})]})})]}),t.jsx(W,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(K,{children:t.jsx(Q,{placeholder:"/path/to/project (optional)",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})})]}),(a==="NPX"||a==="STDIO")&&t.jsx(W,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(K,{children:t.jsx(kt,{value:r.value??[],onChange:r.onChange})}),t.jsx(G,{})]})}),a!=="NPX"&&a!=="STDIO"&&t.jsx(W,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:x?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(qt,{children:[t.jsx(Gt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Fe,{variant:"success",className:"gap-1.5",children:[t.jsx(ut,{size:12}),"Authenticated via OAuth",t.jsx(Zt,{size:12})]})})}),t.jsxs(Qt,{align:"start",children:[t.jsxs(Ze,{onClick:o,children:[t.jsx(ts,{size:16}),"Re-authenticate"]}),t.jsxs(Ze,{variant:"destructive",onClick:i,children:[t.jsx(ns,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&r.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>r.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(os,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(K,{children:t.jsx(Q,{type:"password",placeholder:x?"Paste your GitHub PAT":"Enter access token...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),x&&t.jsxs(Yt,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(G,{})]})})]})}function js(s){const e=F.c(43),{form:n,connection:o,isMCPAuthenticated:i,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:g}=s,{org:x}=Be();let m;e[0]!==o.icon||e[1]!==o.title?(m=t.jsx(Re,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}),e[0]=o.icon,e[1]=o.title,e[2]=m):m=e[2];let f;e[3]!==n.control?(f=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(W,{control:n.control,name:"title",render:vs}),t.jsx(W,{control:n.control,name:"description",render:bs})]}),e[3]=n.control,e[4]=f):f=e[4];let c;e[5]!==m||e[6]!==f?(c=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[m,f]}),e[5]=m,e[6]=f,e[7]=c):c=e[7];let r;e[8]!==o||e[9]!==n||e[10]!==a||e[11]!==l||e[12]!==g?(r=t.jsx(gs,{form:n,connection:o,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:g}),e[8]=o,e[9]=n,e[10]=a,e[11]=l,e[12]=g,e[13]=r):r=e[13];let h;e[14]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[14]=h):h=e[14];let d;e[15]!==i?(d=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[h,i?t.jsxs(Fe,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[t.jsx(ut,{size:12}),"Connected"]}):t.jsx(Fe,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[15]=i,e[16]=d):d=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[17]=u):u=e[17];let b;e[18]!==o.created_by?(b=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[u,t.jsx(rs,{id:o.created_by,size:"2xs"})]}),e[18]=o.created_by,e[19]=b):b=e[19];let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[20]=v):v=e[20];let _;e[21]!==o.updated_at?(_=o.updated_at?ds(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[21]=o.updated_at,e[22]=_):_=e[22];let I;e[23]!==_?(I=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[v,t.jsx("span",{className:"text-sm text-foreground",children:_})]}),e[23]=_,e[24]=I):I=e[24];let p;e[25]!==I||e[26]!==d||e[27]!==b?(p=t.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[d,b,I]}),e[25]=I,e[26]=d,e[27]=b,e[28]=p):p=e[28];let S;e[29]!==o.description||e[30]!==o.icon||e[31]!==o.id||e[32]!==o.title||e[33]!==x.slug?(S=t.jsx(hs,{connectionId:o.id,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,org:x.slug}),e[29]=o.description,e[30]=o.icon,e[31]=o.id,e[32]=o.title,e[33]=x.slug,e[34]=S):S=e[34];let w;e[35]!==p||e[36]!==S||e[37]!==c||e[38]!==r?(w=t.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[c,r,p,S]}),e[35]=p,e[36]=S,e[37]=c,e[38]=r,e[39]=w):w=e[39];let j;return e[40]!==n||e[41]!==w?(j=t.jsx(Jt,{...n,children:w}),e[40]=n,e[41]=w,e[42]=j):j=e[42],j}function bs(s){const{field:e}=s;return t.jsxs(q,{className:"w-full space-y-0",children:[t.jsx(K,{children:t.jsx(Q,{...e,value:e.value||"",className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(G,{})]})}function vs(s){const{field:e}=s;return t.jsxs(q,{className:"flex-1 space-y-0",children:[t.jsx(K,{children:t.jsx(Q,{...e,className:"h-auto py-0.5 text-lg! font-medium leading-7 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})}),t.jsx(G,{})]})}function Ns(s){const e=F.c(39),{prompts:n,connectionId:o,org:i,onPromptClick:a,showToolbar:l,emptyMessage:g}=s,x=l===void 0?!0:l,m=g===void 0?"This connection doesn't have any prompts yet.":g,f=Ne(),[c,r]=X.useState(""),[h,d]=X.useState("table"),[u,b]=X.useState("name"),[v,_]=X.useState("asc");let I;e[0]!==v||e[1]!==u?(I=C=>{u===C?(_(ws),v==="desc"&&b(void 0)):(b(C),_("asc"))},e[0]=v,e[1]=u,e[2]=I):I=e[2];const p=I;let S;e[3]!==o||e[4]!==f||e[5]!==a||e[6]!==i?(S=C=>{a?a(C):o&&i&&f({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:ge,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(C.name)}})},e[3]=o,e[4]=f,e[5]=a,e[6]=i,e[7]=S):S=e[7];const w=S;let j;if(e[8]!==n||e[9]!==c||e[10]!==v||e[11]!==u){const C=!n||n.length===0?[]:c.trim()?(()=>{const O=c.toLowerCase();return n.filter(B=>B.name.toLowerCase().includes(O)||B.description&&B.description.toLowerCase().includes(O))})():n;j=!u||!v?C:[...C].sort((O,B)=>{const je=O[u]||"",ee=B[u]||"",J=String(je).localeCompare(String(ee));return v==="asc"?J:-J}),e[8]=n,e[9]=c,e[10]=v,e[11]=u,e[12]=j}else j=e[12];const $=j;let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=[{id:"name",header:"Name",render:Ss,sortable:!0},{id:"description",header:"Description",render:Cs,cellClassName:"flex-1",sortable:!0}],e[13]=k):k=e[13];const E=k;let V;e[14]===Symbol.for("react.memo_cache_sentinel")?(V=E.filter(_s).map(ys),e[14]=V):V=e[14];const M=V;let y;e[15]!==p||e[16]!==x||e[17]!==v||e[18]!==u||e[19]!==h?(y=x&&t.jsx(Xe,{children:t.jsx(ft,{viewMode:h,onViewModeChange:d,sortKey:u,sortDirection:v,onSort:p,sortOptions:M})}),e[15]=p,e[16]=x,e[17]=v,e[18]=u,e[19]=h,e[20]=y):y=e[20];let L;e[21]===Symbol.for("react.memo_cache_sentinel")?(L=C=>{C.key==="Escape"&&(r(""),C.target.blur())},e[21]=L):L=e[21];let A;e[22]!==c?(A=t.jsx(ze,{value:c,onChange:r,placeholder:"Search prompts...",onKeyDown:L}),e[22]=c,e[23]=A):A=e[23];let N;e[24]!==m||e[25]!==w||e[26]!==p||e[27]!==c||e[28]!==v||e[29]!==u||e[30]!==$||e[31]!==h?(N=h==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:$.length===0?t.jsx(Z,{image:null,title:c?"No prompts found":"No prompts available",description:c?"Try adjusting your search terms":m}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:$.map(C=>t.jsx(We,{className:"cursor-pointer transition-colors",onClick:()=>w(C),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Re,{icon:null,name:C.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:C.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:C.description||"No description"})]})]})},C.name))})}):t.jsx(pt,{columns:E,data:$,isLoading:!1,sortKey:u,sortDirection:v,onSort:p,onRowClick:C=>w(C),emptyState:t.jsx(Z,{image:null,title:c?"No prompts found":"No prompts available",description:c?"Try adjusting your search terms":m})}),e[24]=m,e[25]=w,e[26]=p,e[27]=c,e[28]=v,e[29]=u,e[30]=$,e[31]=h,e[32]=N):N=e[32];let P;e[33]!==A||e[34]!==N?(P=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[A,N]}),e[33]=A,e[34]=N,e[35]=P):P=e[35];let D;return e[36]!==P||e[37]!==y?(D=t.jsxs(t.Fragment,{children:[y,P]}),e[36]=P,e[37]=y,e[38]=D):D=e[38],D}function ys(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function _s(s){return s.sortable}function Cs(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ss(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function ws(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Ts(s){const e=F.c(4),{prompts:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx(Ns,{prompts:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}function ks(s){const e=F.c(2),{repository:n}=s;let o;return e[0]!==n?(o=t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(ms,{repository:n})}),e[0]=n,e[1]=o):o=e[1],o}function Ps(s){const e=F.c(36),{resources:n,onResourceClick:o,showToolbar:i,emptyMessage:a}=s,l=i===void 0?!0:i,g=a===void 0?"This connection doesn't have any resources yet.":a,[x,m]=X.useState(""),[f,c]=X.useState("table"),[r,h]=X.useState("name"),[d,u]=X.useState("asc");let b;e[0]!==d||e[1]!==r?(b=N=>{r===N?(u(Os),d==="desc"&&h(void 0)):(h(N),u("asc"))},e[0]=d,e[1]=r,e[2]=b):b=e[2];const v=b;let _;e[3]!==o?(_=N=>{o&&o(N)},e[3]=o,e[4]=_):_=e[4];const I=_;let p;if(e[5]!==n||e[6]!==x||e[7]!==d||e[8]!==r){const N=!n||n.length===0?[]:x.trim()?(()=>{const P=x.toLowerCase();return n.filter(D=>D.uri.toLowerCase().includes(P)||D.name&&D.name.toLowerCase().includes(P)||D.description&&D.description.toLowerCase().includes(P))})():n;p=!r||!d?N:[...N].sort((P,D)=>{const C=P[r]||"",O=D[r]||"",B=String(C).localeCompare(String(O));return d==="asc"?B:-B}),e[5]=n,e[6]=x,e[7]=d,e[8]=r,e[9]=p}else p=e[9];const S=p;let w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=[{id:"name",header:"Name",render:Ds,sortable:!0},{id:"uri",header:"URI",render:Ms,sortable:!0},{id:"description",header:"Description",render:Vs,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:As,sortable:!0}],e[10]=w):w=e[10];const j=w;let $;e[11]===Symbol.for("react.memo_cache_sentinel")?($=j.filter($s).map(Is),e[11]=$):$=e[11];const k=$;let E;e[12]!==v||e[13]!==l||e[14]!==d||e[15]!==r||e[16]!==f?(E=l&&t.jsx(Xe,{children:t.jsx(ft,{viewMode:f,onViewModeChange:c,sortKey:r,sortDirection:d,onSort:v,sortOptions:k})}),e[12]=v,e[13]=l,e[14]=d,e[15]=r,e[16]=f,e[17]=E):E=e[17];let V;e[18]===Symbol.for("react.memo_cache_sentinel")?(V=N=>{N.key==="Escape"&&(m(""),N.target.blur())},e[18]=V):V=e[18];let M;e[19]!==x?(M=t.jsx(ze,{value:x,onChange:m,placeholder:"Search resources...",onKeyDown:V}),e[19]=x,e[20]=M):M=e[20];let y;e[21]!==g||e[22]!==I||e[23]!==v||e[24]!==x||e[25]!==d||e[26]!==r||e[27]!==S||e[28]!==f?(y=f==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:S.length===0?t.jsx(Z,{image:null,title:x?"No resources found":"No resources available",description:x?"Try adjusting your search terms":g}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:S.map(N=>t.jsx(We,{className:"cursor-pointer transition-colors",onClick:()=>I(N),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Re,{icon:null,name:N.name||N.uri,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:N.name||N.uri}),t.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:N.uri}),N.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:N.description})]})]})},N.uri))})}):t.jsx(pt,{columns:j,data:S,isLoading:!1,sortKey:r,sortDirection:d,onSort:v,onRowClick:N=>I(N),emptyState:t.jsx(Z,{image:null,title:x?"No resources found":"No resources available",description:x?"Try adjusting your search terms":g})}),e[21]=g,e[22]=I,e[23]=v,e[24]=x,e[25]=d,e[26]=r,e[27]=S,e[28]=f,e[29]=y):y=e[29];let L;e[30]!==M||e[31]!==y?(L=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[M,y]}),e[30]=M,e[31]=y,e[32]=L):L=e[32];let A;return e[33]!==L||e[34]!==E?(A=t.jsxs(t.Fragment,{children:[E,L]}),e[33]=L,e[34]=E,e[35]=A):A=e[35],A}function Is(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function $s(s){return s.sortable}function As(s){return t.jsx("span",{className:"text-sm text-muted-foreground",children:s.mimeType||"—"})}function Vs(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ms(s){return t.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:s.uri})}function Ds(s){return t.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name||s.uri})}function Os(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Rs(s){const e=F.c(4),{resources:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx(Ps,{resources:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}const Es=at({key:z().min(1,"Key is required"),value:z()}),Ls=at({title:z().min(1,"Name is required"),description:z().nullable().optional(),ui_type:Nt(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:z().optional(),connection_token:z().nullable().optional(),npx_package:z().optional(),stdio_command:z().optional(),stdio_args:z().optional(),stdio_cwd:z().optional(),env_vars:Qe(Es).optional(),configuration_scopes:Qe(z()).nullable().optional(),configuration_state:bt(z(),vt()).nullable().optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Us(s){const e=F.c(5),{tools:n,connectionId:o,org:i,isLoading:a}=s;let l;return e[0]!==o||e[1]!==a||e[2]!==i||e[3]!==n?(l=t.jsx(us,{tools:n,connectionId:o,org:i,isLoading:a}),e[0]=o,e[1]=a,e[2]=i,e[3]=n,e[4]=l):l=e[4],l}function Fs(s){const e=F.c(27),{tools:n,connectionId:o,org:i}=s,a=Ne(),{org:l}=Be();let g;e[0]!==o||e[1]!==l.id?(g={connectionId:o,orgId:l.id},e[0]=o,e[1]=l.id,e[2]=g):g=e[2];const x=mt(g),[m,f]=X.useState("");let c,r,h,d;if(e[3]!==x||e[4]!==o||e[5]!==a||e[6]!==i||e[7]!==m||e[8]!==n){const v=(n??[]).filter(Bs),_=m.toLowerCase().trim(),I=_?v.filter(j=>j.name.toLowerCase().includes(_)||j.description&&j.description.toLowerCase().includes(_)):v;let p;e[13]!==o||e[14]!==a||e[15]!==i?(p=j=>{a({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:ge,connectionId:o,collectionName:"tools",itemId:encodeURIComponent(j.name)}})},e[13]=o,e[14]=a,e[15]=i,e[16]=p):p=e[16];const S=p;h="flex flex-col h-full overflow-hidden";let w;e[17]===Symbol.for("react.memo_cache_sentinel")?(w=j=>{j.key==="Escape"&&(f(""),j.target.blur())},e[17]=w):w=e[17],e[18]!==m?(d=t.jsx(ze,{value:m,onChange:f,placeholder:"Search apps...",onKeyDown:w}),e[18]=m,e[19]=d):d=e[19],c="flex-1 overflow-auto p-5",r=I.length===0?t.jsx(Z,{image:null,title:m?"No apps found":"No apps available",description:m?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:I.map(j=>{const $=Ke(j._meta);return t.jsxs(We,{className:"cursor-pointer transition-colors overflow-hidden",onClick:()=>S(j),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(fs,{resourceURI:$,toolName:j.name,displayMode:"inline",minHeight:200,maxHeight:200,client:x})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:j.name}),t.jsx(ps,{annotations:j.annotations,_meta:j._meta})]}),j.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j.description})]})]},j.name)})}),e[3]=x,e[4]=o,e[5]=a,e[6]=i,e[7]=m,e[8]=n,e[9]=c,e[10]=r,e[11]=h,e[12]=d}else c=e[9],r=e[10],h=e[11],d=e[12];let u;e[20]!==c||e[21]!==r?(u=t.jsx("div",{className:c,children:r}),e[20]=c,e[21]=r,e[22]=u):u=e[22];let b;return e[23]!==h||e[24]!==d||e[25]!==u?(b=t.jsxs("div",{className:h,children:[d,u]}),e[23]=h,e[24]=d,e[25]=u,e[26]=b):b=e[26],b}function Bs(s){return!!Ke(s._meta)}function zs(s){return s.command==="npx"}function Ks(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Xs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Hs(s,e){const n={command:"npx",args:["-y",s]},o=lt(e);return Object.keys(o).length>0&&(n.envVars=o),n}function Ws(s,e,n,o){const i={command:s};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const a=lt(o);return Object.keys(a).length>0&&(i.envVars=a),i}function rt(s,e){const n={title:s.title,description:s.description??"",configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Tt(s.connection_headers)){const o=s.connection_headers,i=Pt(o.envVars);if(zs(o)){const l=Ks(o);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i}}const a=Xs(o);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:i}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function qs(s){let e,n=null,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=Hs(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=Ws(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",o=s.connection_token||null),{title:s.title,description:s.description||null,connection_type:e,connection_url:n,...o&&{connection_token:o},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function Gs(s){const e=F.c(116),{connection:n,connectionId:o,org:i,requestedTabId:a,collections:l,onUpdate:g,isUpdating:x,prompts:m,resources:f,tools:c,isLoadingTools:r}=s;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={from:"/$org/$project/mcps/$connectionId"},e[0]=h):h=e[0];const d=Ne(h),u=Ct(),b=dt();let v;e[1]!==o?(v={connectionId:o},e[1]=o,e[2]=v):v=e[2];const _=Vt(v),p=n?.connection_type==="VIRTUAL"||_.isAuthenticated;let S;e[3]!==n?(S={connections:[n],binding:"MCP"},e[3]=n,e[4]=S):S=e[4];const j=At(S).length>0,$=n?.metadata?.repository,k=!!$?.url;let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=St(Ls),e[5]=E):E=e[5];let V;e[6]!==n?(V=rt(n),e[6]=n,e[7]=V):V=e[7];let M;e[8]!==V?(M={resolver:E,values:V},e[8]=V,e[9]=M):M=e[9];const y=wt(M),L=y.formState.isDirty;let A;e[10]!==y||e[11]!==g?(A=async()=>{if(!await y.trigger())return;const U=y.getValues(),he=qs(U);await g(he),y.reset(U)},e[10]=y,e[11]=g,e[12]=A):A=e[12];const N=A;let P;e[13]!==n||e[14]!==y?(P=()=>{y.reset(rt(n))},e[13]=n,e[14]=y,e[15]=P):P=e[15];const D=P;let C;e[16]!==n.id||e[17]!==b||e[18]!==u?(C=async()=>{const{token:T,tokenInfo:U,error:he}=await Lt({connectionId:n.id});if(he||!T){ve.error(`Authentication failed: ${he}`);return}if(U)try{const Me=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:U.accessToken,refreshToken:U.refreshToken,expiresIn:U.expiresIn,scope:U.scope,clientId:U.clientId,clientSecret:U.clientSecret,tokenEndpoint:U.tokenEndpoint})});if(!Me.ok)console.error("Failed to save OAuth token:",await Me.text()),await b.update.mutateAsync({id:n.id,data:{connection_token:T}});else try{await b.update.mutateAsync({id:n.id,data:{}})}catch(qe){console.warn("Failed to refresh connection tools after OAuth:",qe)}}catch(Me){console.error("Error saving OAuth token:",Me),await b.update.mutateAsync({id:n.id,data:{connection_token:T}})}else await b.update.mutateAsync({id:n.id,data:{connection_token:T}});const ht=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:Je.isMCPAuthenticated(ht.href,null)}),ve.success("Authentication successful")},e[16]=n.id,e[17]=b,e[18]=u,e[19]=C):C=e[19];const O=C;let B;e[20]!==n.id||e[21]!==u?(B=async()=>{try{const T=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!T.ok){const he=await T.text();ve.error(`Failed to remove OAuth: ${he}`);return}const U=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:Je.isMCPAuthenticated(U.href,null)}),ve.success("OAuth removed. You can now re-authenticate with a different account.")}catch(T){console.error("Error removing OAuth token:",T),ve.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=u,e[22]=B):B=e[22];const je=B,ee=c.length,J=m.length,ye=f.length;let _e;e[23]!==c?(_e=c.filter(Ys),e[23]=c,e[24]=_e):_e=e[24];const Ce=_e.length,Ee=ee>0||r;let Se;e[25]===Symbol.for("react.memo_cache_sentinel")?(Se={id:"settings",label:"Settings"},e[25]=Se):Se=e[25];let te;e[26]!==r||e[27]!==p||e[28]!==Ee||e[29]!==ee?(te=p&&Ee?[{id:"tools",label:"Tools",count:r?void 0:ee}]:[],e[26]=r,e[27]=p,e[28]=Ee,e[29]=ee,e[30]=te):te=e[30];let se;e[31]!==p||e[32]!==J?(se=p&&J>0?[{id:"prompts",label:"Prompts",count:J}]:[],e[31]=p,e[32]=J,e[33]=se):se=e[33];let ne;e[34]!==p||e[35]!==ye?(ne=p&&ye>0?[{id:"resources",label:"Resources",count:ye}]:[],e[34]=p,e[35]=ye,e[36]=ne):ne=e[36];let oe;e[37]!==p||e[38]!==Ce?(oe=p&&Ce>0?[{id:"ui",label:"UI",count:Ce}]:[],e[37]=p,e[38]=Ce,e[39]=oe):oe=e[39];let we;if(e[40]!==l||e[41]!==k||e[42]!==p||e[43]!==te||e[44]!==se||e[45]!==ne||e[46]!==oe){let T;e[48]!==k?(T=k?[{id:"readme",label:"README"}]:[],e[48]=k,e[49]=T):T=e[49],we=[Se,...te,...se,...ne,...oe,...p?(l||[]).map(Js):[],...T],e[40]=l,e[41]=k,e[42]=p,e[43]=te,e[44]=se,e[45]=ne,e[46]=oe,e[47]=we}else we=e[47];const be=we,xt=p&&be.some(Qs)?"tools":"settings",R=be.some(T=>T.id===a)?a:xt;let Te;e[50]!==d?(Te=T=>{d({search:U=>({...U,tab:T}),replace:!0})},e[50]=d,e[51]=Te):Te=e[51];const re=Te;let ie;e[52]!==l?(ie=l||[],e[52]=l,e[53]=ie):ie=e[53];let ke;if(e[54]!==R||e[55]!==ie){let T;e[57]!==R?(T=U=>U.name===R,e[57]=R,e[58]=T):T=e[58],ke=ie.find(T),e[54]=R,e[55]=ie,e[56]=ke}else ke=e[56];const Pe=ke;let ae;e[59]!==i?(ae=t.jsx(Ye,{children:t.jsx(Ft,{asChild:!0,children:t.jsx(it,{to:"/$org/$project/mcps",params:{org:i,project:ge},children:"Connections"})})}),e[59]=i,e[60]=ae):ae=e[60];let Ie;e[61]===Symbol.for("react.memo_cache_sentinel")?(Ie=t.jsx(Bt,{}),e[61]=Ie):Ie=e[61];let ce;e[62]!==n.title?(ce=t.jsx(Ye,{children:t.jsx(Ut,{children:n.title})}),e[62]=n.title,e[63]=ce):ce=e[63];let $e;e[64]!==ae||e[65]!==ce?($e=t.jsx(zt,{children:t.jsxs(Kt,{children:[ae,Ie,ce]})}),e[64]=ae,e[65]=ce,e[66]=$e):$e=e[66];const Le=$e;let le;e[67]!==N||e[68]!==D||e[69]!==L||e[70]!==x?(le=t.jsx(Xe,{children:t.jsx(It,{onSave:N,onUndo:D,isDirty:L,isSaving:x})}),e[67]=N,e[68]=D,e[69]=L,e[70]=x,e[71]=le):le=e[71];let de;e[72]!==_.hasOAuthToken||e[73]!==n||e[74]!==y||e[75]!==O||e[76]!==je||e[77]!==p?(de=t.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:t.jsx(js,{form:y,connection:n,isMCPAuthenticated:p,hasOAuthToken:_.hasOAuthToken,onReauthenticate:O,onRemoveOAuth:je})}),e[72]=_.hasOAuthToken,e[73]=n,e[74]=y,e[75]=O,e[76]=je,e[77]=p,e[78]=de):de=e[78];let me;e[79]!==R||e[80]!==re||e[81]!==be?(me=t.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:t.jsx(Xt,{tabs:be,activeTab:R,onTabChange:re,className:"flex-1"})}),e[79]=R,e[80]=re,e[81]=be,e[82]=me):me=e[82];let Ae;e[83]===Symbol.for("react.memo_cache_sentinel")?(Ae=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),e[83]=Ae):Ae=e[83];let ue;e[84]!==Pe||e[85]!==R||e[86]!==_.isServerError||e[87]!==_.supportsOAuth||e[88]!==n||e[89]!==o||e[90]!==y||e[91]!==O||e[92]!==re||e[93]!==j||e[94]!==k||e[95]!==r||e[96]!==p||e[97]!==i||e[98]!==m||e[99]!==$||e[100]!==f||e[101]!==c?(ue=t.jsx(X.Suspense,{fallback:Ae,children:R==="tools"?t.jsx(Us,{tools:c,connectionId:o,org:i,isLoading:r}):R==="ui"?t.jsx(Fs,{tools:c,connectionId:o,org:i}):R==="prompts"?t.jsx(Ts,{prompts:m,connectionId:o,org:i}):R==="resources"?t.jsx(Rs,{resources:f,connectionId:o,org:i}):R==="settings"?t.jsx(Mt,{connection:n,form:y,hasMcpBinding:j,isMCPAuthenticated:p,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:O,onViewReadme:k?()=>re("readme"):void 0}):R==="readme"&&k?t.jsx(ks,{repository:$}):Pe&&p?t.jsx(Wt,{connectionId:o,org:i,activeCollection:Pe},R):t.jsx(Z,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[84]=Pe,e[85]=R,e[86]=_.isServerError,e[87]=_.supportsOAuth,e[88]=n,e[89]=o,e[90]=y,e[91]=O,e[92]=re,e[93]=j,e[94]=k,e[95]=r,e[96]=p,e[97]=i,e[98]=m,e[99]=$,e[100]=f,e[101]=c,e[102]=ue):ue=e[102];let pe;e[103]!==R||e[104]!==ue?(pe=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(ct,{children:ue},R)}),e[103]=R,e[104]=ue,e[105]=pe):pe=e[105];let fe;e[106]!==me||e[107]!==pe?(fe=t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[me,pe]}),e[106]=me,e[107]=pe,e[108]=fe):fe=e[108];let xe;e[109]!==de||e[110]!==fe?(xe=t.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[de,fe]}),e[109]=de,e[110]=fe,e[111]=xe):xe=e[111];let Ve;return e[112]!==Le||e[113]!==le||e[114]!==xe?(Ve=t.jsxs(Ht,{breadcrumb:Le,children:[le,xe]}),e[112]=Le,e[113]=le,e[114]=xe,e[115]=Ve):Ve=e[115],Ve}function Qs(s){return s.id==="tools"}function Js(s){return{id:s.name,label:s.displayName}}function Ys(s){return!!Ke(s._meta)}function Zs(){const s=F.c(43);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$connectionId"},s[0]=e):e=s[0];const n=Ne(e);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/$project/mcps/$connectionId"},s[1]=o):o=s[1];const{connectionId:i,org:a}=yt(o),{org:l}=Be();let g;s[2]===Symbol.for("react.memo_cache_sentinel")?(g={from:"/shell/$org/$project/mcps/$connectionId"},s[2]=g):g=s[2];const m=_t(g).tab??"",f=Dt(i),c=dt(),r=$t(f??void 0);let h;s[3]!==i||s[4]!==l.id?(h={connectionId:i,orgId:l.id},s[3]=i,s[4]=l.id,s[5]=h):h=s[5];const d=mt(h);let u;s[6]!==d?(u={client:d},s[6]=d,s[7]=u):u=s[7];const{data:b}=Rt(u);let v;s[8]!==d?(v={client:d},s[8]=d,s[9]=v):v=s[9];const{data:_}=Et(v),p=!(f?.connection_type==="VIRTUAL")&&f?.tools&&f.tools.length>0,S=!p;let w;s[10]!==d||s[11]!==S?(w={client:d,enabled:S},s[10]=d,s[11]=S,s[12]=w):w=s[12];const{data:j,isLoading:$}=Ot(w);let k;s[13]!==b?.prompts?(k=b?.prompts??[],s[13]=b?.prompts,s[14]=k):k=s[14];let E;s[15]!==k?(E=k.map(sn),s[15]=k,s[16]=E):E=s[16];const V=E;let M;s[17]!==_?.resources?(M=_?.resources??[],s[17]=_?.resources,s[18]=M):M=s[18];let y;s[19]!==M?(y=M.map(tn),s[19]=M,s[20]=y):y=s[20];const L=y;let A;s[21]!==f||s[22]!==p||s[23]!==j?.tools?(A=p?f.tools??[]:(j?.tools??[]).map(en),s[21]=f,s[22]=p,s[23]=j?.tools,s[24]=A):A=s[24];const N=A;let P;s[25]!==c.update||s[26]!==i?(P=async O=>{await c.update.mutateAsync({id:i,data:O})},s[25]=c.update,s[26]=i,s[27]=P):P=s[27];const D=P;if(!f){let O;return s[28]!==n||s[29]!==a?(O=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Z,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(Ue,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:a,project:ge}}),children:"Back to connections"})})}),s[28]=n,s[29]=a,s[30]=O):O=s[30],O}let C;return s[31]!==c.update.isPending||s[32]!==r||s[33]!==f||s[34]!==i||s[35]!==D||s[36]!==$||s[37]!==a||s[38]!==V||s[39]!==m||s[40]!==L||s[41]!==N?(C=t.jsx(Gs,{org:a,connection:f,connectionId:i,requestedTabId:m,collections:r,onUpdate:D,isUpdating:c.update.isPending,prompts:V,resources:L,tools:N,isLoadingTools:$}),s[31]=c.update.isPending,s[32]=r,s[33]=f,s[34]=i,s[35]=D,s[36]=$,s[37]=a,s[38]=V,s[39]=m,s[40]=L,s[41]=N,s[42]=C):C=s[42],C}function en(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations,_meta:s._meta}}function tn(s){return{uri:s.uri,name:s.name,description:s.description}}function sn(s){return{name:s.name,description:s.description}}function nn(){const s=F.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ct,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Zs,{})})}),s[0]=e):e=s[0],e}function rr(){const s=F.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(nn,{}),s[0]=e):e=s[0],e}export{rr as default};
@@ -1 +1 @@
1
- import{c as be,j as e,E as Fe,r as X,u as Be,m as Ue,b as He,a as ze,d as Le,az as Me,l as Re,k as Xe,i as We,B as S,O as g,t as D,o as ke,aA as Ke,s as C,aB as Ge}from"./index-CyQ-uP58.js";import{g as qe}from"./generate-id-Dyweu44Y.js";import{C as Qe,a as Je}from"./collection-table-wrapper-M66G0byU.js";import{C as Ye,E as z}from"./collection-search-BGdQ1HZ8.js";import{C as Ze}from"./connection-card-DT2iuc8p.js";import{B as L}from"./badge-CrsiM596.js";import{i as et}from"./AlertCircle-DFllIHYc.js";import{i as tt}from"./CheckCircle-DAEjX2-S.js";import{I as nt}from"./integration-icon-BmabWqd3.js";import{P as E}from"./index-BTQG2DxP.js";import{u as st,U as re}from"./use-list-state-CSmezZQi.js";import{u as ot}from"./use-binding-rYSemil4.js";import{f as rt,e as it}from"./registry-utils-Dr7PbEVZ.js";import{f as ie,a as ae,b as ce,c as le,d as de,e as me,A as ue,g as pe}from"./alert-dialog-zUkzI1I7.js";import{B as at,a as ct,b as lt,c as dt}from"./breadcrumb-r6RP68pk.js";import{D as mt,a as ut,b as pt,c as xt,d as ht,e as gt}from"./dialog-BzlH8DMm.js";import{D as xe,a as he,b as ge,c as F}from"./dropdown-menu-un00sO73.js";import{a as jt,F as j,b as f,c as y,d as v,f as _}from"./form-BZ0ccRRa.js";import{I as T}from"./input-Xyw1Rs5H.js";import{S as ft,a as yt,b as vt,c as _t,d as $}from"./select-BWSXn9LF.js";import{T as Ct}from"./textarea-BflLsOYJ.js";import{g as Nt,h as bt}from"./use-connection-B5TQguFn.js";import{u as je,a as kt}from"./constants-C_615zcG.js";import{b as wt}from"./use-mcp-tools-Cr3o97c-.js";import{n as M}from"./Container-CwxPOY0d.js";import{i as fe}from"./DotsVertical-D74uB5qh.js";import{s as ye}from"./Eye-BIF9gjXL.js";import{s as R}from"./Globe02-BxR836tG.js";import{i as St}from"./Loading01-Ccov_H-l.js";import{i as Tt}from"./Terminal-CzMkefpC.js";import{s as ve}from"./Trash01-B_x31FCQ.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-BXh1cAnk.js";import"./ArrowDown-BCqJRKTw.js";import"./ArrowUp-CKW1WeCp.js";import"./Check-CFpzkHgf.js";import"./Grid01-NpQl-yoZ.js";import"./List-CIQbhdro.js";import"./tooltip-CNx0bR-5.js";import"./index-D6zrhjd3.js";import"./table-KBcJzih3.js";import"./SearchMd-ePwgMcp4.js";import"./card-BaUmkbam.js";import"./use-mobile-CcJ4cdUT.js";import"./X-ep0AhpnZ.js";import"./avatar-KzEgSlwf.js";import"./useQuery-DLHdWLmJ.js";import"./use-view-mode-nDNhs-vV.js";import"./binder-5QwQ3F8k.js";import"./ChevronRight-DmlQyyes.js";import"./label-B9X06NrD.js";import"./ChevronDown-CZDY410N.js";import"./useMutation-DMT5NBQ4.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./Plus-DJThru9X.js";function Ce(s){const o=be.c(3),{status:i}=s;if(i==="active"){let c;return o[0]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(L,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[e.jsx(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(L,{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(L,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),o[2]=d):d=o[2],d}const It=ke({key:C(),value:C()}),Et=ke({title:C().min(1,"Name is required"),description:C().nullable().optional(),ui_type: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=ze({strict:!1}),{data:c}=Le.useSession(),{stdioEnabled:N}=Me(),l=st({namespace:s.slug,resource:"connections"}),O=Nt(),A=bt(l),[u,b]=X.useReducer(Ut,{mode:"idle"}),W=ot(A)[0],K=W?.id??"",G=rt(W?.tools),Se=je({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=je({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(M,{})}),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(fe,{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(jt,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit($e),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(j,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(f,{children:[e.jsx(y,{children:"Type *"}),e.jsxs(ft,{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(M,{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(j,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(f,{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(j,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(f,{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(j,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(f,{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(j,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(f,{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(j,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(f,{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(j,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(f,{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(j,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(f,{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(j,{control:r.control,name:"title",render:({field:t})=>e.jsxs(f,{children:[e.jsx(y,{children:"Name *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"My Connection",...t})}),e.jsx(_,{})]})}),e.jsx(j,{control:r.control,name:"description",render:({field:t})=>e.jsxs(f,{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(z,{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(M,{}),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(fe,{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(z,{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(z,{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 Mn(){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{Mn as default};
1
+ import{c as be,j as e,E as Fe,r as X,u as Be,m as Ue,b as He,a as ze,d as Le,az as Me,l as Re,k as Xe,i as We,B as S,O as g,t as D,o as ke,aA as Ke,s as C,aB as Ge}from"./index-0HoOnen3.js";import{g as qe}from"./generate-id-Dyweu44Y.js";import{C as Qe,a as Je}from"./collection-table-wrapper-BkrnGVuo.js";import{C as Ye,E as z}from"./collection-search-DeB-znan.js";import{C as Ze}from"./connection-card-DmcuYZ2d.js";import{B as L}from"./badge-0EzsH3AB.js";import{i as et}from"./AlertCircle-Y6iSJK0t.js";import{i as tt}from"./CheckCircle-DvhMgeYT.js";import{I as nt}from"./integration-icon-5VjL1GgL.js";import{P as E}from"./index-G8oxxr2G.js";import{u as st,U as re}from"./use-list-state-Bpa4-xTU.js";import{u as ot}from"./use-binding-CcrgjIcJ.js";import{f as rt,e as it}from"./registry-utils-BPK3KAEQ.js";import{f as ie,a as ae,b as ce,c as le,d as de,e as me,A as ue,g as pe}from"./alert-dialog-CdqWA8wc.js";import{B as at,a as ct,b as lt,c as dt}from"./breadcrumb-BcJj21EL.js";import{D as mt,a as ut,b as pt,c as xt,d as ht,e as gt}from"./dialog-L8ZakXii.js";import{D as xe,a as he,b as ge,c as F}from"./dropdown-menu-VTiqKHN9.js";import{a as jt,F as j,b as f,c as y,d as v,f as _}from"./form-p8UY3zWX.js";import{I as T}from"./input-BtUicd3Q.js";import{S as ft,a as yt,b as vt,c as _t,d as $}from"./select-DOO2sOs0.js";import{T as Ct}from"./textarea-Ca7XZUqN.js";import{g as Nt,h as bt}from"./use-connection-B6TFiTxb.js";import{u as je,a as kt}from"./constants-DyBxaLKI.js";import{b as wt}from"./use-mcp-tools-BjSYCbSh.js";import{n as M}from"./Container-DBGOFJUc.js";import{i as fe}from"./DotsVertical-DcLEsGDj.js";import{s as ye}from"./Eye-VtlrDhJf.js";import{s as R}from"./Globe02-nOidPs01.js";import{i as St}from"./Loading01-Jv8Mbea8.js";import{i as Tt}from"./Terminal-d72o721Q.js";import{s as ve}from"./Trash01-CKATI1mI.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-CZ9xwqbP.js";import"./ArrowDown-DPy5cnDQ.js";import"./ArrowUp-Dx6U6WtF.js";import"./Check-BIaai9j0.js";import"./Grid01-C8gF-dWK.js";import"./List-mX8yEKmx.js";import"./tooltip-BWlQ9UL9.js";import"./index-BymQJSqf.js";import"./table-CK5AQN01.js";import"./SearchMd-CS2uMIPl.js";import"./card-c-CJHmFC.js";import"./use-mobile-B9jSIPRg.js";import"./X-RC7YVNJU.js";import"./avatar-tLGNC2ok.js";import"./useQuery-CI6Jq2Tz.js";import"./use-view-mode-CHcflreW.js";import"./binder-w9dF9fSa.js";import"./ChevronRight-D6p6jiry.js";import"./label-D6atofYo.js";import"./ChevronDown-Dyskz-ZD.js";import"./useMutation-C13VGcqo.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./Plus-Cecv4wEo.js";function Ce(s){const o=be.c(3),{status:i}=s;if(i==="active"){let c;return o[0]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(L,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[e.jsx(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(L,{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(L,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),o[2]=d):d=o[2],d}const It=ke({key:C(),value:C()}),Et=ke({title:C().min(1,"Name is required"),description:C().nullable().optional(),ui_type: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=ze({strict:!1}),{data:c}=Le.useSession(),{stdioEnabled:N}=Me(),l=st({namespace:s.slug,resource:"connections"}),O=Nt(),A=bt(l),[u,b]=X.useReducer(Ut,{mode:"idle"}),W=ot(A)[0],K=W?.id??"",G=rt(W?.tools),Se=je({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=je({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(M,{})}),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(fe,{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(jt,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit($e),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(j,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(f,{children:[e.jsx(y,{children:"Type *"}),e.jsxs(ft,{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(M,{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(j,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(f,{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(j,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(f,{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(j,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(f,{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(j,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(f,{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(j,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(f,{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(j,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(f,{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(j,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(f,{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(j,{control:r.control,name:"title",render:({field:t})=>e.jsxs(f,{children:[e.jsx(y,{children:"Name *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"My Connection",...t})}),e.jsx(_,{})]})}),e.jsx(j,{control:r.control,name:"description",render:({field:t})=>e.jsxs(f,{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(z,{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(M,{}),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(fe,{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(z,{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(z,{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 Mn(){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{Mn as default};
@@ -0,0 +1 @@
1
+ import{a0 as a,a1 as t}from"./index-0HoOnen3.js";const e=a(t,{target:"draft-7"});export{e as B};
@@ -1 +1 @@
1
- import{bR as h,c as d,n as f,bS as _}from"./index-CyQ-uP58.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 w(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 E(){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 O(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 $(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,O as d,E as e,D as f,v as g,R as h,$ as i,I as j,w as u};
1
+ import{bQ as h,c as d,n as f,bR as _}from"./index-0HoOnen3.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 E(){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 O(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 $(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,O as d,E as e,D as f,v as g,R as h,$ as i,I as j,S as u};