decocms 2.179.2 → 2.179.3

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 (383) hide show
  1. package/dist/client/assets/{AlertCircle-QngH9BVd.js → AlertCircle-DcuzO-dN.js} +1 -1
  2. package/dist/client/assets/{AlignLeft-BUW8XsMa.js → AlignLeft-DH6vJ97u.js} +1 -1
  3. package/dist/client/assets/{ArrowDown-Ba2t7m6d.js → ArrowDown-DrJY3Wf3.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-DX2ldnBo.js → ArrowLeft-B0zQkfl0.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-Wy3Qa9X3.js → ArrowUp-B4DKDJey.js} +1 -1
  6. package/dist/client/assets/{Building02-DW6RLSwU.js → Building02-B5vUKe4K.js} +1 -1
  7. package/dist/client/assets/{Check-CLxUgI8Z.js → Check-5nIJP_0B.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-DDKCxiAn.js → CheckCircle-CPfAK_ok.js} +1 -1
  9. package/dist/client/assets/{CheckSquare-IgZnioYh.js → CheckSquare-Bd5OlGNx.js} +1 -1
  10. package/dist/client/assets/{CheckVerified02-Brnp4Z-Q.js → CheckVerified02-BImD45AM.js} +1 -1
  11. package/dist/client/assets/{ChevronDown-D0b1rvAp.js → ChevronDown-t60R5l2B.js} +1 -1
  12. package/dist/client/assets/{ChevronLeft-BOF7bp9d.js → ChevronLeft-lVdUD9SW.js} +1 -1
  13. package/dist/client/assets/{ChevronRight-BEUO8jhU.js → ChevronRight-3uKoJ2yX.js} +1 -1
  14. package/dist/client/assets/{ChevronUp-BWhuIqS7.js → ChevronUp-l7iXrppT.js} +1 -1
  15. package/dist/client/assets/{Clock-Aquumu5W.js → Clock-Cu62NiMl.js} +1 -1
  16. package/dist/client/assets/{Code01-_in0gxFd.js → Code01-DA4cXrzu.js} +1 -1
  17. package/dist/client/assets/{Container-b65PFshp.js → Container-Cvd3ILsk.js} +1 -1
  18. package/dist/client/assets/{Copy01-Ds0OKZs5.js → Copy01-DCmX2pvi.js} +1 -1
  19. package/dist/client/assets/{Dataflow03-CE4IJeUz.js → Dataflow03-SvWKmU9-.js} +1 -1
  20. package/dist/client/assets/{DotsHorizontal-EK1-V4Yv.js → DotsHorizontal-DE3Ptwny.js} +1 -1
  21. package/dist/client/assets/{DotsVertical-Bo0fAyx-.js → DotsVertical-CZep1rYf.js} +1 -1
  22. package/dist/client/assets/{Download01-CN3AkzFm.js → Download01-DOZIvPhC.js} +1 -1
  23. package/dist/client/assets/{Edit01-BeW3IgwV.js → Edit01-Bh7u1xp-.js} +1 -1
  24. package/dist/client/assets/{Edit05-DDQmnS5O.js → Edit05-DwDDlBNQ.js} +1 -1
  25. package/dist/client/assets/{Eye-Cqad01Et.js → Eye-D3Q7o9JY.js} +1 -1
  26. package/dist/client/assets/{EyeOff-rTYDCZUH.js → EyeOff--TPuyP7J.js} +1 -1
  27. package/dist/client/assets/{File02-k_9AZvHT.js → File02-6xeEPCuC.js} +1 -1
  28. package/dist/client/assets/{File06-BAp2UeVQ.js → File06-BocZAjHf.js} +1 -1
  29. package/dist/client/assets/{FilterLines-BQVg1PzI.js → FilterLines-CUdG83Ae.js} +1 -1
  30. package/dist/client/assets/{Globe01-sBw0ReRO.js → Globe01-BTdgnOS2.js} +1 -1
  31. package/dist/client/assets/{Globe02-DlxZmkSI.js → Globe02-X8fGWI0t.js} +1 -1
  32. package/dist/client/assets/{Grid01-B9zEjFyx.js → Grid01-NkSMXhQ7.js} +1 -1
  33. package/dist/client/assets/{Home02-DsMimBHw.js → Home02-BmcJp5G2.js} +1 -1
  34. package/dist/client/assets/{Image01-zSA25K9S.js → Image01-RwxwuRZg.js} +1 -1
  35. package/dist/client/assets/{Inbox01-Bcon6dDK.js → Inbox01-B7dU6IpS.js} +1 -1
  36. package/dist/client/assets/{InfoCircle-CA8mfcG6.js → InfoCircle-BO2XWy7v.js} +1 -1
  37. package/dist/client/assets/{Key01-V3zgT2bk.js → Key01-CjhxaGrC.js} +1 -1
  38. package/dist/client/assets/{LayersTwo01-D3otbQFN.js → LayersTwo01-DEwkReGL.js} +1 -1
  39. package/dist/client/assets/{Link01-VlHez4tu.js → Link01-h9aUM7NA.js} +1 -1
  40. package/dist/client/assets/{LinkExternal01-vs3DKlfq.js → LinkExternal01-CmkQ0Pr-.js} +1 -1
  41. package/dist/client/assets/{List-D6xZGoxJ.js → List-BbeB05v1.js} +1 -1
  42. package/dist/client/assets/{Loading01-DQphO9Su.js → Loading01-D0sCOwf7.js} +1 -1
  43. package/dist/client/assets/{Lock01-Cbqd9PVH.js → Lock01-DFfVnVtc.js} +1 -1
  44. package/dist/client/assets/{Play-jCDYHrdu.js → Play-hGa2UcUZ.js} +1 -1
  45. package/dist/client/assets/{Plus-CURSuoDd.js → Plus-Dcf0Y3wA.js} +1 -1
  46. package/dist/client/assets/{RefreshCcw01-oV1XFIRn.js → RefreshCcw01-BOXuamrY.js} +1 -1
  47. package/dist/client/assets/{Save01-CpNh-fPw.js → Save01-CA0I32a6.js} +1 -1
  48. package/dist/client/assets/{SearchMd-C8ADHGFY.js → SearchMd-BSRGE1t4.js} +1 -1
  49. package/dist/client/assets/{Settings01-B76KnDHb.js → Settings01-CCUkMwLj.js} +1 -1
  50. package/dist/client/assets/{Shield01-BodC6YjW.js → Shield01-BYpsgCVA.js} +1 -1
  51. package/dist/client/assets/{Terminal-BHkLJhoR.js → Terminal-ZymOmGb9.js} +1 -1
  52. package/dist/client/assets/{Tool01-DlbILfZg.js → Tool01-Doogi-IK.js} +1 -1
  53. package/dist/client/assets/{Trash01-CYMRq_nY.js → Trash01-Cs72bTP6.js} +1 -1
  54. package/dist/client/assets/{Upload01-BQ7z5iC5.js → Upload01-ByUvmqDm.js} +1 -1
  55. package/dist/client/assets/{Users03-DEpvReeu.js → Users03-CGvJARf5.js} +1 -1
  56. package/dist/client/assets/{X-BT_y3J3a.js → X-CD9ZB6hw.js} +1 -1
  57. package/dist/client/assets/{XClose-C-H07PEn.js → XClose-BxUlnJUs.js} +1 -1
  58. package/dist/client/assets/{Zap-BY3Hn1l9.js → Zap-0WHKFRes.js} +1 -1
  59. package/dist/client/assets/{agent-connections-preview-DbwllQSw.js → agent-connections-preview-BEmLqtx5.js} +1 -1
  60. package/dist/client/assets/agent-detail-jg81y7ZA.js +2 -0
  61. package/dist/client/assets/agents-PmHD6Xb_.js +1 -0
  62. package/dist/client/assets/{ai-providers-logos-DGTpC_MW.js → ai-providers-logos-C_voEDmL.js} +1 -1
  63. package/dist/client/assets/{alert-dialog-BqCiJDa8.js → alert-dialog-qmvoIx9J.js} +3 -3
  64. package/dist/client/assets/{auth-catchall-DPwCqyhO.js → auth-catchall-ByYcT8WN.js} +1 -1
  65. package/dist/client/assets/automation-detail-C1-q2EzY.js +1 -0
  66. package/dist/client/assets/automations-C9eao1B2.js +1 -0
  67. package/dist/client/assets/avatar-DeGeJRAR.js +1 -0
  68. package/dist/client/assets/badge-Cjjl_FHP.js +1 -0
  69. package/dist/client/assets/{binder-CuBUxi11.js → binder-C1eSZFT4.js} +1 -1
  70. package/dist/client/assets/{breadcrumb-BWfepeob.js → breadcrumb-C8hDXS86.js} +1 -1
  71. package/dist/client/assets/{card-gfMzoGpr.js → card-CoyaoT6W.js} +1 -1
  72. package/dist/client/assets/{checkbox-DygphnIU.js → checkbox-D5DFx9da.js} +1 -1
  73. package/dist/client/assets/{collapsible-BJo6q_NJ.js → collapsible-DcaWkNTt.js} +1 -1
  74. package/dist/client/assets/{collection-detail-fTigPh-V.js → collection-detail-Dsgpohom.js} +3 -3
  75. package/dist/client/assets/{collection-display-button-C42ZnuS7.js → collection-display-button-BcIJp1SX.js} +1 -1
  76. package/dist/client/assets/{collection-search-Dzoe9W56.js → collection-search-nKZEJ_r3.js} +1 -1
  77. package/dist/client/assets/{collection-table-wrapper-Bka5CUqj.js → collection-table-wrapper-Bq15EL3p.js} +1 -1
  78. package/dist/client/assets/{collection-tabs-D9qLvNTu.js → collection-tabs-qLP6ozkD.js} +1 -1
  79. package/dist/client/assets/{command-D_HBfmpj.js → command-Bk-fXiVb.js} +1 -1
  80. package/dist/client/assets/connection-card-BYUbg7iO.js +1 -0
  81. package/dist/client/assets/connection-detail-Zdtj4TKi.js +1 -0
  82. package/dist/client/assets/connections-CMaQr-QY.js +1 -0
  83. package/dist/client/assets/{constants-D5QZg84_.js → constants-DclZTqHf.js} +1 -1
  84. package/dist/client/assets/{context-CGMT963w.js → context-BFi-zuf6.js} +12 -12
  85. package/dist/client/assets/{create-organization-dialog-CeMf7qju.js → create-organization-dialog-pXQ89_sr.js} +1 -1
  86. package/dist/client/assets/{create-project-dialog-Bs_mS8aj.js → create-project-dialog-M-dgrV_c.js} +1 -1
  87. package/dist/client/assets/{danger-gTdMMqBl.js → danger-DqsrtWLB.js} +1 -1
  88. package/dist/client/assets/{danger-zone-BE94J4G-.js → danger-zone-BhDM5wIc.js} +1 -1
  89. package/dist/client/assets/{dependencies-DQ9gMDrw.js → dependencies-CPYZFhhf.js} +1 -1
  90. package/dist/client/assets/dialog-DzGwvQ_K.js +1 -0
  91. package/dist/client/assets/drawer-CAX2URBi.js +1 -0
  92. package/dist/client/assets/{dropdown-menu-DE2pKopg.js → dropdown-menu-BcNYk9_F.js} +1 -1
  93. package/dist/client/assets/dynamic-plugin-layout-D0dkPO22.js +1 -0
  94. package/dist/client/assets/editable-task-title-BR-xQ-UT.js +16 -0
  95. package/dist/client/assets/{empty-state-BjCXvoyS.js → empty-state-BuGXY27l.js} +1 -1
  96. package/dist/client/assets/{empty-state-Bk9Z7Q-U.js → empty-state-CGSu9IQ9.js} +1 -1
  97. package/dist/client/assets/{env-vars-editor-BjeFjhEe.js → env-vars-editor-VoVbIy9n.js} +1 -1
  98. package/dist/client/assets/{extract-connection-data-CZxT3XNH.js → extract-connection-data-DhU56Zd0.js} +1 -1
  99. package/dist/client/assets/{file-browser-C4MCCicp.js → file-browser-DIaRK0us.js} +2 -2
  100. package/dist/client/assets/{form-tOTNzCZe.js → form-DBjkdSps.js} +1 -1
  101. package/dist/client/assets/{general-DOjbT8YE.js → general-DCfBGmuh.js} +1 -1
  102. package/dist/client/assets/{generate-id-kfQDJb0K.js → generate-id-DRuK_WRM.js} +1 -1
  103. package/dist/client/assets/{grid-view-CM2kDBxz.js → grid-view-DsY2qZrB.js} +1 -1
  104. package/dist/client/assets/{home-rO4pkzPH.js → home-C52P_wmy.js} +1 -1
  105. package/dist/client/assets/{index-BLtI6TU9.js → index-BLNBD7Tl.js} +1 -1
  106. package/dist/client/assets/index-BObCXgKJ.js +1 -0
  107. package/dist/client/assets/{index-DyL93sTY.js → index-BzPzEjOV.js} +1 -1
  108. package/dist/client/assets/index-COFAW4F5.js +1 -0
  109. package/dist/client/assets/index-CubWD7-P.css +1 -0
  110. package/dist/client/assets/index-DMmNh7jR.js +218 -0
  111. package/dist/client/assets/index-DYAF-Vgt.js +1 -0
  112. package/dist/client/assets/index-DiczHAor.js +1 -0
  113. package/dist/client/assets/{index-DjVQ8cwy.js → index-Dumm3WtY.js} +2 -2
  114. package/dist/client/assets/{index-Bwlq4qOs.js → index-PFtbLrE4.js} +1 -1
  115. package/dist/client/assets/{index-DiHcYCxZ.js → index-bHgla3gL.js} +1 -1
  116. package/dist/client/assets/index-hmkE8HuP.js +1 -0
  117. package/dist/client/assets/{infiniteQueryObserver-XS4LWR6q.js → infiniteQueryObserver-CZ8w6Ao-.js} +1 -1
  118. package/dist/client/assets/input-Bt_nejZh.js +1 -0
  119. package/dist/client/assets/{integration-icon-C9GR_8Ea.js → integration-icon-Dyr7fOYU.js} +1 -1
  120. package/dist/client/assets/{label-DJvdRQ2A.js → label-DTNkd20e.js} +1 -1
  121. package/dist/client/assets/layout-Ck4QNb1R.js +1 -0
  122. package/dist/client/assets/{layout-10Sxtyop.js → layout-VG2uM_nk.js} +1 -1
  123. package/dist/client/assets/login-x4JJuKeA.js +1 -0
  124. package/dist/client/assets/{logo-upload-iqCQyRXD.js → logo-upload-7WcycT9q.js} +1 -1
  125. package/dist/client/assets/{mcp-app-renderer-C3qFwvPf.js → mcp-app-renderer-hLmmzHl_.js} +1 -1
  126. package/dist/client/assets/{mcp-server-card-DCDS8v4f.js → mcp-server-card-CwYAe4vO.js} +1 -1
  127. package/dist/client/assets/mcp-server-detail-CjZvaa-f.js +2 -0
  128. package/dist/client/assets/{members-CykhAYWe.js → members-Sgl6kVS6.js} +1 -1
  129. package/dist/client/assets/{monaco-editor-DQf5JSy_.js → monaco-editor-BS1-hh4n.js} +4 -4
  130. package/dist/client/assets/monitoring-DWB-fw7M.js +4 -0
  131. package/dist/client/assets/monitoring-dashboard-edit-DdNrWKBz.js +1 -0
  132. package/dist/client/assets/{monitoring-dashboard-view-CXCG5P_H.js → monitoring-dashboard-view-BUxqPLpn.js} +2 -2
  133. package/dist/client/assets/{monitoring-stats-row-BfoeteQX.js → monitoring-stats-row-CiWvBCYV.js} +2 -2
  134. package/dist/client/assets/{oauth-callback-CXrwzvh_.js → oauth-callback-7ed5Z9Xs.js} +1 -1
  135. package/dist/client/assets/{oauth-callback-ai-provider-bQZvbhnr.js → oauth-callback-ai-provider-qEm-Q5-E.js} +1 -1
  136. package/dist/client/assets/{org-ai-providers-4gYTufEL.js → org-ai-providers-CUAlOa9f.js} +1 -1
  137. package/dist/client/assets/page-BQl7Ie3w.js +1 -0
  138. package/dist/client/assets/page-DfQnSuW1.js +1 -0
  139. package/dist/client/assets/{plugin-empty-state-cb7GbeKy.js → plugin-empty-state-DUosCqGd.js} +1 -1
  140. package/dist/client/assets/{plugin-empty-state-CEvZCNFj.js → plugin-empty-state-qFDP0Nr2.js} +1 -1
  141. package/dist/client/assets/{plugin-header-C4ZfQdcs.js → plugin-header-BeGFVTX4.js} +1 -1
  142. package/dist/client/assets/{plugin-header-Do_HgCfI.js → plugin-header-CJlxZY-i.js} +1 -1
  143. package/dist/client/assets/plugins-CzL725OF.js +1 -0
  144. package/dist/client/assets/popover-CF2iI6mL.js +1 -0
  145. package/dist/client/assets/project-app-view-lqZ02NJN.js +1 -0
  146. package/dist/client/assets/project-layout-CBbKmowd.js +1 -0
  147. package/dist/client/assets/{project-plugins-C18qk0lc.js → project-plugins-DqmH9sWQ.js} +1 -1
  148. package/dist/client/assets/{projects-list-CtvT2y9h.js → projects-list-Bz_1RhAg.js} +1 -1
  149. package/dist/client/assets/{registry-layout-Cvu5zKVR.js → registry-layout-6H7s-msc.js} +2 -2
  150. package/dist/client/assets/{registry-utils-Bx7--rIH.js → registry-utils-DZHZD5gP.js} +1 -1
  151. package/dist/client/assets/{reset-password-CSswd9M3.js → reset-password-3HgT81EI.js} +1 -1
  152. package/dist/client/assets/{resizable-B0HQ1vuq.js → resizable-BwEPpKFX.js} +1 -1
  153. package/dist/client/assets/{save-actions-BxTuQTa4.js → save-actions-Z-_7bu1u.js} +1 -1
  154. package/dist/client/assets/scroll-area-CwrVaRUF.js +1 -0
  155. package/dist/client/assets/select-hHfKwVbN.js +1 -0
  156. package/dist/client/assets/select-virtual-mcp-DsImheli.js +1 -0
  157. package/dist/client/assets/shell-layout-Bh0wZbL8.js +3 -0
  158. package/dist/client/assets/{sidebar-settings-pZmI7pGH.js → sidebar-settings-U5rAu7py.js} +1 -1
  159. package/dist/client/assets/{skeleton-NLo71_Sb.js → skeleton-BvrwcS3X.js} +1 -1
  160. package/dist/client/assets/spinner-CSLYV8gq.js +1 -0
  161. package/dist/client/assets/{store-invite-CP9PWG-2.js → store-invite-z_eVOBRF.js} +1 -1
  162. package/dist/client/assets/switch-CoYIum7D.js +1 -0
  163. package/dist/client/assets/{table-BK1bAac3.js → table-BSLV9H8I.js} +1 -1
  164. package/dist/client/assets/tabs-sTqc1_U2.js +1 -0
  165. package/dist/client/assets/{task-status-DCsPkppQ.js → task-status-CrO2oj_v.js} +37 -37
  166. package/dist/client/assets/tasks-CazLoC59.js +1 -0
  167. package/dist/client/assets/tasks-panel-DBJx0hs6.js +1 -0
  168. package/dist/client/assets/textarea-CgJ5x-hs.js +1 -0
  169. package/dist/client/assets/{time-range-picker-CEhZhu7c.js → time-range-picker-BCm8UHQI.js} +1 -1
  170. package/dist/client/assets/toggle-group-C20N8vss.js +1 -0
  171. package/dist/client/assets/{tools-list-DGVVcYEB.js → tools-list-JehNbMf9.js} +1 -1
  172. package/dist/client/assets/tooltip-DHJtaI_Z.js +1 -0
  173. package/dist/client/assets/{topbar-portal-DLbOrsQP.js → topbar-portal-jewy4fLu.js} +1 -1
  174. package/dist/client/assets/{types-BOmhR0hZ.js → types-BtTmvTe4.js} +1 -1
  175. package/dist/client/assets/{use-automations-CPlNdxed.js → use-automations-D-X6Oij9.js} +1 -1
  176. package/dist/client/assets/{use-collections-Le9CzDbY.js → use-collections-DhavVshD.js} +1 -1
  177. package/dist/client/assets/{use-connection-CNeKPAtP.js → use-connection-CVlyXslk.js} +1 -1
  178. package/dist/client/assets/{use-copy-CR_0d0zs.js → use-copy-DkDz3lds.js} +1 -1
  179. package/dist/client/assets/{use-create-virtual-mcp-BOxl7MdZ.js → use-create-virtual-mcp-DZAv89rZ.js} +1 -1
  180. package/dist/client/assets/{use-infinite-scroll-CbBHKCjw.js → use-infinite-scroll-j2WybGGN.js} +1 -1
  181. package/dist/client/assets/{use-install-from-registry-Ckutd61H.js → use-install-from-registry-Ch6GOwHv.js} +1 -1
  182. package/dist/client/assets/{use-list-state-DrSbpG8C.js → use-list-state-Baq-X1EV.js} +1 -1
  183. package/dist/client/assets/{use-mcp-prompts-D4XXlnov.js → use-mcp-prompts-BDRKUj7D.js} +1 -1
  184. package/dist/client/assets/{use-mcp-resources-BueR0w1E.js → use-mcp-resources-BxIahbOo.js} +1 -1
  185. package/dist/client/assets/{use-mcp-tools-CFyULGGP.js → use-mcp-tools-kv4r4Zvn.js} +1 -1
  186. package/dist/client/assets/{use-members-Bgz9FSqE.js → use-members-Coq2XO1k.js} +1 -1
  187. package/dist/client/assets/{use-project-RpN1fut9.js → use-project-XBmxO4XX.js} +1 -1
  188. package/dist/client/assets/{use-store-discovery-BS96E_Li.js → use-store-discovery-D-xa6Q86.js} +1 -1
  189. package/dist/client/assets/use-view-mode-CdGajc1j.js +1 -0
  190. package/dist/client/assets/{use-virtual-mcp-DGT5zflo.js → use-virtual-mcp-DCxXK_bv.js} +1 -1
  191. package/dist/client/assets/useInfiniteQuery-H-W7n7En.js +1 -0
  192. package/dist/client/assets/{useMutation-Betr8yis.js → useMutation-DrLoVqQ7.js} +1 -1
  193. package/dist/client/assets/useQuery-B-AaJTeZ.js +1 -0
  194. package/dist/client/assets/useSuspenseInfiniteQuery-Czq4y4BP.js +1 -0
  195. package/dist/client/assets/{user-ChA79mrb.js → user-8V0wpye0.js} +1 -1
  196. package/dist/client/assets/workflow-Bb3JE-XH.js +1 -0
  197. package/dist/client/index.html +3 -2
  198. package/dist/server/cli.js +1 -1
  199. package/dist/server/node_modules/pg-cloudflare/README.md +112 -0
  200. package/dist/server/node_modules/pg-cloudflare/dist/empty.d.ts +2 -0
  201. package/dist/server/node_modules/pg-cloudflare/dist/empty.js +6 -0
  202. package/dist/server/node_modules/pg-cloudflare/dist/empty.js.map +1 -0
  203. package/dist/server/node_modules/pg-cloudflare/dist/index.d.ts +31 -0
  204. package/dist/server/node_modules/pg-cloudflare/dist/index.js +152 -0
  205. package/dist/server/node_modules/pg-cloudflare/dist/index.js.map +1 -0
  206. package/dist/server/node_modules/pg-cloudflare/esm/index.mjs +3 -0
  207. package/dist/server/node_modules/pg-cloudflare/package.json +39 -0
  208. package/dist/server/node_modules/pg-cloudflare/src/empty.ts +3 -0
  209. package/dist/server/node_modules/pg-cloudflare/src/index.ts +166 -0
  210. package/dist/server/node_modules/pg-cloudflare/src/types.d.ts +25 -0
  211. package/dist/server/node_modules/pg-connection-string/LICENSE +21 -0
  212. package/dist/server/node_modules/pg-connection-string/README.md +105 -0
  213. package/dist/server/node_modules/pg-connection-string/esm/index.mjs +8 -0
  214. package/dist/server/node_modules/pg-connection-string/index.d.ts +36 -0
  215. package/dist/server/node_modules/pg-connection-string/index.js +231 -0
  216. package/dist/server/node_modules/pg-connection-string/package.json +52 -0
  217. package/dist/server/node_modules/pg-pool/LICENSE +21 -0
  218. package/dist/server/node_modules/pg-pool/README.md +357 -0
  219. package/dist/server/node_modules/pg-pool/esm/index.mjs +5 -0
  220. package/dist/server/node_modules/pg-pool/index.js +517 -0
  221. package/dist/server/node_modules/pg-pool/package.json +51 -0
  222. package/dist/server/node_modules/pg-protocol/LICENSE +21 -0
  223. package/dist/server/node_modules/pg-protocol/README.md +3 -0
  224. package/dist/server/node_modules/pg-protocol/dist/b.d.ts +1 -0
  225. package/dist/server/node_modules/pg-protocol/dist/b.js +23 -0
  226. package/dist/server/node_modules/pg-protocol/dist/b.js.map +1 -0
  227. package/dist/server/node_modules/pg-protocol/dist/buffer-reader.d.ts +15 -0
  228. package/dist/server/node_modules/pg-protocol/dist/buffer-reader.js +55 -0
  229. package/dist/server/node_modules/pg-protocol/dist/buffer-reader.js.map +1 -0
  230. package/dist/server/node_modules/pg-protocol/dist/buffer-writer.d.ts +16 -0
  231. package/dist/server/node_modules/pg-protocol/dist/buffer-writer.js +81 -0
  232. package/dist/server/node_modules/pg-protocol/dist/buffer-writer.js.map +1 -0
  233. package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.d.ts +1 -0
  234. package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.js +530 -0
  235. package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.js.map +1 -0
  236. package/dist/server/node_modules/pg-protocol/dist/index.d.ts +6 -0
  237. package/dist/server/node_modules/pg-protocol/dist/index.js +15 -0
  238. package/dist/server/node_modules/pg-protocol/dist/index.js.map +1 -0
  239. package/dist/server/node_modules/pg-protocol/dist/messages.d.ts +162 -0
  240. package/dist/server/node_modules/pg-protocol/dist/messages.js +160 -0
  241. package/dist/server/node_modules/pg-protocol/dist/messages.js.map +1 -0
  242. package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.d.ts +1 -0
  243. package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.js +252 -0
  244. package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.js.map +1 -0
  245. package/dist/server/node_modules/pg-protocol/dist/parser.d.ts +24 -0
  246. package/dist/server/node_modules/pg-protocol/dist/parser.js +324 -0
  247. package/dist/server/node_modules/pg-protocol/dist/parser.js.map +1 -0
  248. package/dist/server/node_modules/pg-protocol/dist/serializer.d.ts +42 -0
  249. package/dist/server/node_modules/pg-protocol/dist/serializer.js +189 -0
  250. package/dist/server/node_modules/pg-protocol/dist/serializer.js.map +1 -0
  251. package/dist/server/node_modules/pg-protocol/esm/index.js +11 -0
  252. package/dist/server/node_modules/pg-protocol/package.json +45 -0
  253. package/dist/server/node_modules/pg-protocol/src/b.ts +25 -0
  254. package/dist/server/node_modules/pg-protocol/src/buffer-reader.ts +58 -0
  255. package/dist/server/node_modules/pg-protocol/src/buffer-writer.ts +85 -0
  256. package/dist/server/node_modules/pg-protocol/src/inbound-parser.test.ts +575 -0
  257. package/dist/server/node_modules/pg-protocol/src/index.ts +11 -0
  258. package/dist/server/node_modules/pg-protocol/src/messages.ts +262 -0
  259. package/dist/server/node_modules/pg-protocol/src/outbound-serializer.test.ts +276 -0
  260. package/dist/server/node_modules/pg-protocol/src/parser.ts +413 -0
  261. package/dist/server/node_modules/pg-protocol/src/serializer.ts +274 -0
  262. package/dist/server/node_modules/pg-protocol/src/testing/buffer-list.ts +67 -0
  263. package/dist/server/node_modules/pg-protocol/src/testing/test-buffers.ts +166 -0
  264. package/dist/server/node_modules/pg-protocol/src/types/chunky.d.ts +1 -0
  265. package/dist/server/node_modules/pg-types/.travis.yml +7 -0
  266. package/dist/server/node_modules/pg-types/Makefile +14 -0
  267. package/dist/server/node_modules/pg-types/README.md +75 -0
  268. package/dist/server/node_modules/pg-types/index.d.ts +137 -0
  269. package/dist/server/node_modules/pg-types/index.js +47 -0
  270. package/dist/server/node_modules/pg-types/index.test-d.ts +21 -0
  271. package/dist/server/node_modules/pg-types/lib/arrayParser.js +11 -0
  272. package/dist/server/node_modules/pg-types/lib/binaryParsers.js +257 -0
  273. package/dist/server/node_modules/pg-types/lib/builtins.js +73 -0
  274. package/dist/server/node_modules/pg-types/lib/textParsers.js +215 -0
  275. package/dist/server/node_modules/pg-types/package.json +42 -0
  276. package/dist/server/node_modules/pg-types/test/index.js +24 -0
  277. package/dist/server/node_modules/pg-types/test/types.js +597 -0
  278. package/dist/server/node_modules/pgpass/README.md +74 -0
  279. package/dist/server/node_modules/pgpass/lib/helper.js +233 -0
  280. package/dist/server/node_modules/pgpass/lib/index.js +23 -0
  281. package/dist/server/node_modules/pgpass/package.json +41 -0
  282. package/dist/server/node_modules/postgres-array/index.d.ts +4 -0
  283. package/dist/server/node_modules/postgres-array/index.js +97 -0
  284. package/dist/server/node_modules/postgres-array/license +21 -0
  285. package/dist/server/node_modules/postgres-array/package.json +35 -0
  286. package/dist/server/node_modules/postgres-array/readme.md +43 -0
  287. package/dist/server/node_modules/postgres-date/index.js +116 -0
  288. package/dist/server/node_modules/postgres-date/license +21 -0
  289. package/dist/server/node_modules/postgres-date/package.json +33 -0
  290. package/dist/server/node_modules/postgres-date/readme.md +49 -0
  291. package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
  292. package/dist/server/node_modules/postgres-interval/index.js +125 -0
  293. package/dist/server/node_modules/postgres-interval/license +21 -0
  294. package/dist/server/node_modules/postgres-interval/package.json +36 -0
  295. package/dist/server/node_modules/postgres-interval/readme.md +48 -0
  296. package/dist/server/node_modules/split2/LICENSE +13 -0
  297. package/dist/server/node_modules/split2/README.md +85 -0
  298. package/dist/server/node_modules/split2/bench.js +27 -0
  299. package/dist/server/node_modules/split2/index.js +141 -0
  300. package/dist/server/node_modules/split2/package.json +39 -0
  301. package/dist/server/node_modules/split2/test.js +409 -0
  302. package/dist/server/node_modules/xtend/.jshintrc +30 -0
  303. package/dist/server/node_modules/xtend/LICENSE +20 -0
  304. package/dist/server/node_modules/xtend/README.md +32 -0
  305. package/dist/server/node_modules/xtend/immutable.js +19 -0
  306. package/dist/server/node_modules/xtend/mutable.js +17 -0
  307. package/dist/server/node_modules/xtend/package.json +55 -0
  308. package/dist/server/node_modules/xtend/test.js +103 -0
  309. package/dist/server/server.js +1 -1
  310. package/package.json +1 -1
  311. package/dist/client/assets/LayoutLeft-CbUmiI7I.js +0 -1
  312. package/dist/client/assets/agent-detail-DqMa-yjy.js +0 -2
  313. package/dist/client/assets/agents-DXD0J3OW.js +0 -1
  314. package/dist/client/assets/automation-detail-bmoX3GK-.js +0 -1
  315. package/dist/client/assets/automations-Dp1WjxxK.js +0 -1
  316. package/dist/client/assets/avatar-BoRF-Me1.js +0 -1
  317. package/dist/client/assets/badge-DIWKuwVU.js +0 -1
  318. package/dist/client/assets/connection-card-DuHVLZ35.js +0 -1
  319. package/dist/client/assets/connection-detail-vcbLbssZ.js +0 -1
  320. package/dist/client/assets/connections-14pDMsUe.js +0 -1
  321. package/dist/client/assets/dialog-B8WS5FOh.js +0 -1
  322. package/dist/client/assets/dynamic-plugin-layout-yMvA298P.js +0 -1
  323. package/dist/client/assets/editable-task-title-oggBOZ_d.js +0 -16
  324. package/dist/client/assets/index-B09Yemt1.js +0 -1
  325. package/dist/client/assets/index-CAsAeYNN.css +0 -1
  326. package/dist/client/assets/index-CMImT9Gt.js +0 -1
  327. package/dist/client/assets/index-D-6rbOIG.js +0 -1
  328. package/dist/client/assets/index-DnJ6a24w.js +0 -218
  329. package/dist/client/assets/index-hCeFdkUk.js +0 -1
  330. package/dist/client/assets/index-qrpgIqks.js +0 -1
  331. package/dist/client/assets/input-BBKBJVKe.js +0 -1
  332. package/dist/client/assets/layout-BjyFY_1R.js +0 -1
  333. package/dist/client/assets/login-ClPbfjlJ.js +0 -1
  334. package/dist/client/assets/mcp-server-detail-lOR_wUNJ.js +0 -2
  335. package/dist/client/assets/monitoring-BPuhRE0m.js +0 -4
  336. package/dist/client/assets/monitoring-dashboard-edit-BVtLOBNe.js +0 -1
  337. package/dist/client/assets/page-CCXJyUyN.js +0 -1
  338. package/dist/client/assets/page-DB3QLlpA.js +0 -1
  339. package/dist/client/assets/plugins-pEgOY1Nz.js +0 -1
  340. package/dist/client/assets/popover-vDURg2rv.js +0 -1
  341. package/dist/client/assets/project-app-view-DfCIvrF7.js +0 -1
  342. package/dist/client/assets/project-layout-CkMdq05b.js +0 -1
  343. package/dist/client/assets/scroll-area-dsTSFUPi.js +0 -1
  344. package/dist/client/assets/select-Bbaj2HCW.js +0 -1
  345. package/dist/client/assets/select-virtual-mcp-CZJoA7HG.js +0 -1
  346. package/dist/client/assets/sheet-B_-2ygzJ.js +0 -1
  347. package/dist/client/assets/shell-layout-Ca5Bbhzi.js +0 -3
  348. package/dist/client/assets/spinner-EdHFCjIL.js +0 -1
  349. package/dist/client/assets/switch-bfk4EFAk.js +0 -1
  350. package/dist/client/assets/tabs-aIY_aIUV.js +0 -1
  351. package/dist/client/assets/tasks-Dw1i-69W.js +0 -1
  352. package/dist/client/assets/tasks-panel-CEAgXi7r.js +0 -1
  353. package/dist/client/assets/textarea-lF0m7xkk.js +0 -1
  354. package/dist/client/assets/toggle-group-Dak-s1p3.js +0 -1
  355. package/dist/client/assets/tooltip-Csc3oeTz.js +0 -1
  356. package/dist/client/assets/use-mobile-Y3tADOOl.js +0 -1
  357. package/dist/client/assets/use-view-mode-BeRbE5Df.js +0 -1
  358. package/dist/client/assets/useInfiniteQuery-ChOuKh6v.js +0 -1
  359. package/dist/client/assets/useQuery-mzOsnjYJ.js +0 -1
  360. package/dist/client/assets/useSuspenseInfiniteQuery-DFs2FFlW.js +0 -1
  361. package/dist/client/assets/workflow-CBDfcQFP.js +0 -1
  362. package/dist/server/node_modules/pg/README.md +0 -95
  363. package/dist/server/node_modules/pg/esm/index.mjs +0 -20
  364. package/dist/server/node_modules/pg/lib/client.js +0 -743
  365. package/dist/server/node_modules/pg/lib/connection-parameters.js +0 -171
  366. package/dist/server/node_modules/pg/lib/connection.js +0 -221
  367. package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +0 -122
  368. package/dist/server/node_modules/pg/lib/crypto/sasl.js +0 -212
  369. package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +0 -43
  370. package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +0 -89
  371. package/dist/server/node_modules/pg/lib/crypto/utils.js +0 -9
  372. package/dist/server/node_modules/pg/lib/defaults.js +0 -91
  373. package/dist/server/node_modules/pg/lib/index.js +0 -73
  374. package/dist/server/node_modules/pg/lib/native/client.js +0 -323
  375. package/dist/server/node_modules/pg/lib/native/index.js +0 -2
  376. package/dist/server/node_modules/pg/lib/native/query.js +0 -165
  377. package/dist/server/node_modules/pg/lib/query.js +0 -252
  378. package/dist/server/node_modules/pg/lib/result.js +0 -109
  379. package/dist/server/node_modules/pg/lib/stream.js +0 -83
  380. package/dist/server/node_modules/pg/lib/type-overrides.js +0 -35
  381. package/dist/server/node_modules/pg/lib/utils.js +0 -217
  382. package/dist/server/node_modules/pg/package.json +0 -76
  383. /package/dist/server/node_modules/{pg → pg-cloudflare}/LICENSE +0 -0
@@ -1 +0,0 @@
1
- import{e as S,u as _,r as $,O as u,j as e,B as p,D as B,v as h}from"./index-DnJ6a24w.js";import{C as I}from"./collection-search-Dzoe9W56.js";import{E as L}from"./empty-state-BjCXvoyS.js";import{P as l}from"./index-B09Yemt1.js";import{u as M,a as E,b as H}from"./use-automations-CPlNdxed.js";import{u as O}from"./use-list-state-DrSbpG8C.js";import{U as R}from"./user-ChA79mrb.js";import{f as F,a as K,b as U,c as G,d as J,e as V,A as q,h as Q}from"./alert-dialog-BqCiJDa8.js";import{B as W}from"./badge-DIWKuwVU.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-BWfepeob.js";import{D as te,a as se,b as re,c as y}from"./dropdown-menu-DE2pKopg.js";import{T as ae,a as oe,b as w,c as ie,d as ne,e as c}from"./table-BK1bAac3.js";import{n as le}from"./ArrowDown-Ba2t7m6d.js";import{i as ce}from"./ArrowUp-Wy3Qa9X3.js";import{i as me}from"./DotsVertical-Bo0fAyx-.js";import{s as de}from"./Eye-Cqad01Et.js";import{i as x}from"./Loading01-DQphO9Su.js";import{s as A}from"./Plus-CURSuoDd.js";import{s as ue}from"./RefreshCcw01-oV1XFIRn.js";import{s as pe}from"./Trash01-CYMRq_nY.js";import"./SearchMd-C8ADHGFY.js";import"./input-BBKBJVKe.js";import"./useQuery-mzOsnjYJ.js";import"./useMutation-Betr8yis.js";import"./tooltip-Csc3oeTz.js";import"./index-hCeFdkUk.js";import"./constants-D5QZg84_.js";import"./use-view-mode-BeRbE5Df.js";import"./use-mobile-Y3tADOOl.js";import"./avatar-BoRF-Me1.js";import"./ChevronRight-BEUO8jhU.js";import"./Check-CLxUgI8Z.js";function Je(){const g=S(),{org:j,locator:D}=_(),{data:a,isLoading:k}=M(),i=E(),T=H(),[m,d]=$.useState(null),s=O({namespace:j.slug,resource:"automations",defaultViewMode:"table"}),f=D.split("/")[0]??j.slug??u,b=async()=>{try{const t=await i.mutateAsync({name:"New Automation",agent:{id:"",mode:"passthrough"},messages:[],models:{credentialId:"",thinking:{id:""}},temperature:.5,active:!0});g({to:"/$org/$project/automations/$automationId",params:{org:f,project:u,automationId:t.id}})}catch{h.error("Failed to create automation")}},z=async()=>{if(m)try{await T.mutateAsync(m.id),h.success("Automation deleted")}catch{h.error("Failed to delete automation")}finally{d(null)}},N=t=>{g({to:"/$org/$project/automations/$automationId",params:{org:f,project:u,automationId:t}})},v=(a??[]).filter(t=>s.searchTerm?t.name.toLowerCase().includes(s.searchTerm.toLowerCase()):!0).sort((t,r)=>{if(!s.sortDirection)return 0;const n=s.sortDirection==="asc"?1:-1,o=s.sortKey;return o==="name"?t.name.localeCompare(r.name)*n:o==="active"?((t.active?1:0)-(r.active?1:0))*n:o==="trigger_count"?((t.trigger_count??0)-(r.trigger_count??0))*n:0}),P="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider group transition-colors select-none";return e.jsxs(l,{children:[e.jsxs(l.Header,{children:[e.jsx(l.Header.Left,{children:e.jsx(X,{children:e.jsx(Y,{children:e.jsx(Z,{children:e.jsxs(ee,{className:"flex items-center gap-2",children:["Automations",a&&a.length>0&&e.jsxs("span",{className:"text-xs font-normal text-muted-foreground tabular-nums",children:[a.length," total"]})]})})})})}),e.jsx(l.Header.Right,{children:e.jsxs(p,{size:"sm",onClick:b,disabled:i.isPending,children:[i.isPending?e.jsx(x,{size:14,className:"animate-spin"}):e.jsx(A,{size:14}),"Create Automation"]})})]}),e.jsx(I,{value:s.search,onChange:s.setSearch,placeholder:"Search automations...",onKeyDown:t=>{t.key==="Escape"&&(s.setSearch(""),t.target.blur())}}),e.jsxs(l.Content,{children:[k?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx(x,{size:24,className:"animate-spin text-muted-foreground"})}):!a||a.length===0?e.jsx("div",{className:"flex items-center h-full",children:e.jsx(L,{image:e.jsx(ue,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations run tasks on a schedule or in response to events.",actions:e.jsxs(p,{size:"sm",onClick:b,disabled:i.isPending,children:[i.isPending?e.jsx(x,{size:14,className:"animate-spin"}):e.jsx(A,{size:14}),"Create Automation"]})})}):e.jsxs(ae,{className:"w-full border-collapse",children:[e.jsx(oe,{className:"border-b-0",children:e.jsx(w,{className:"h-9 hover:bg-transparent border-b border-border",children:[{id:"name",label:"Name",className:"flex-1 min-w-0 cursor-pointer hover:bg-accent"},{id:"active",label:"Status",className:"w-24 shrink-0 cursor-pointer hover:bg-accent"},{id:"trigger_count",label:"Triggers",className:"w-24 shrink-0 cursor-pointer hover:bg-accent"},{id:"created_by",label:"Created by",className:"w-40 shrink-0"},{id:"_actions",label:"",className:"w-12 shrink-0"}].map(({id:t,label:r,className:n})=>{const o=s.sortKey===t,C=t!=="created_by"&&t!=="_actions";return e.jsx(ie,{className:B(P,n),onClick:C?()=>s.handleSort(t):void 0,children:e.jsxs("span",{className:"flex items-center gap-1",children:[r,C&&e.jsxs("span",{className:"w-4 flex items-center justify-center",children:[o&&s.sortDirection==="asc"&&e.jsx(ce,{size:12,className:"text-muted-foreground"}),o&&s.sortDirection==="desc"&&e.jsx(le,{size:12,className:"text-muted-foreground"})]})]})},t)})})}),e.jsx(ne,{children:v.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"py-16 text-center",children:e.jsxs("span",{className:"text-sm text-muted-foreground",children:['No automations match "',s.search,'"']})})}):v.map(t=>e.jsxs(w,{className:"group/data-row border-b-0 hover:bg-accent/50 cursor-pointer transition-colors",onClick:()=>N(t.id),children:[e.jsx(c,{className:"px-5 py-4 h-16 align-middle text-sm font-medium text-foreground flex-1 min-w-0",children:t.name}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle w-24 shrink-0",children:e.jsx(W,{variant:t.active?"default":"secondary",children:t.active?"Active":"Inactive"})}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle text-sm text-muted-foreground w-24 shrink-0",children:t.trigger_count}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle w-40 shrink-0",children:e.jsx(R,{id:t.created_by})}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle w-12 shrink-0",children:e.jsxs(te,{children:[e.jsx(se,{asChild:!0,children:e.jsx(p,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:r=>r.stopPropagation(),children:e.jsx(me,{size:20})})}),e.jsxs(re,{align:"end",onClick:r=>r.stopPropagation(),children:[e.jsxs(y,{onClick:r=>{r.stopPropagation(),N(t.id)},children:[e.jsx(de,{size:16}),"Open"]}),e.jsxs(y,{variant:"destructive",onClick:r=>{r.stopPropagation(),d({id:t.id,name:t.name})},children:[e.jsx(pe,{size:16}),"Delete"]})]})]})})]},t.id))})]}),e.jsx(F,{open:!!m,onOpenChange:t=>!t&&d(null),children:e.jsxs(K,{children:[e.jsxs(U,{children:[e.jsx(G,{children:"Delete Automation?"}),e.jsxs(J,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:m?.name}),". All triggers will be removed."]})]}),e.jsxs(V,{children:[e.jsx(q,{children:"Cancel"}),e.jsx(Q,{onClick:z,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})]})}export{Je as default};
@@ -1 +0,0 @@
1
- import{r as R,c as j,j as i,D as m,a0 as I,aX as $,aY as L,aZ as M}from"./index-DnJ6a24w.js";const V=({size:a=24,color:e="currentColor",...s})=>R.createElement("svg",{viewBox:"0 0 24 24",width:a,height:a,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},R.createElement("path",{d:"M20 21c0-1.396 0-2.093-.172-2.661a4 4 0 0 0-2.667-2.667c-.568-.172-1.265-.172-2.661-.172h-5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C4 18.907 4 19.604 4 21M16.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));V.displayName="User01";function O(a){const e=j.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==t||e[6]!==o?(r=i.jsx(M,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=r):r=e[7],r}function D(a){const e=j.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==t||e[6]!==o?(r=i.jsx($,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=r):r=e[7],r}function T(a){const e=j.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==t||e[6]!==o?(r=i.jsx(L,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=r):r=e[7],r}const S=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],W="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function Z(a){let e=0;for(let t=0;t<a.length;t++)e=a.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%S.length;return S[s]}const U=I("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),_=I("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),B=a=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[a]||e.base};function X(a){const e=j.c(35);let s,t,o,r,n,d,g,l;e[0]!==a?({url:l,fallback:t,shape:r,size:n,objectFit:d,className:s,muted:g,...o}=a,e[0]=a,e[1]=s,e[2]=t,e[3]=o,e[4]=r,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],r=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=r===void 0?"square":r,h=n===void 0?"base":n,u=d===void 0?"cover":d,k=g===void 0?!1:g,[f,x]=R.useState(!1);let F;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],F=c;break e}F=t}const C=F;let z;e:{if(k){z=W;break e}if(typeof t=="string"){let c;e[11]!==t?(c=Z(t),e[11]=t,e[12]=c):c=e[12],z=c;break e}z=S[0]}const y=z;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const E=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m(U({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==y||e[23]!==C||e[24]!==E||e[25]!==f||e[26]!==p||e[27]!==u||e[28]!==h||e[29]!==l?(v=p&&E?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",y),children:i.jsx(V,{size:B(h)})}):i.jsxs(i.Fragment,{children:[l&&!f&&i.jsx(D,{src:l,loading:"lazy",alt:"Avatar",className:m(_({objectFit:u})),onError:()=>x(!0)}),(!l||f)&&i.jsx(T,{className:m(y,"rounded-none"),children:C})]}),e[22]=y,e[23]=C,e[24]=E,e[25]=f,e[26]=p,e[27]=u,e[28]=h,e[29]=l,e[30]=v):v=e[30];let A;return e[31]!==o||e[32]!==v||e[33]!==w?(A=i.jsx(O,{className:w,...o,children:v}),e[31]=o,e[32]=v,e[33]=w,e[34]=A):A=e[34],A}function Y(a){const e=j.c(18);let s,t,o,r,n,d,g,l;e[0]!==a?({shape:r,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=a,e[0]=a,e[1]=s,e[2]=t,e[3]=o,e[4]=r,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],r=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=r===void 0?"square":r,h=n===void 0?"base":n,u=d===void 0?"cover":d,k=g===void 0?!1:g,f=h??"base";let x;return e[9]!==s||e[10]!==t||e[11]!==k||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==f||e[16]!==l?(x=i.jsx(X,{shape:b,url:l,fallback:t,size:f,objectFit:u,className:s,muted:k,...o}),e[9]=s,e[10]=t,e[11]=k,e[12]=u,e[13]=o,e[14]=b,e[15]=f,e[16]=l,e[17]=x):x=e[17],x}Y.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m(U({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{Y as A};
@@ -1 +0,0 @@
1
- import{c as d,D as u,j as l,X as v,a0 as g}from"./index-DnJ6a24w.js";const b=g("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function x(o){const e=d.c(12);let r,s,i,t;e[0]!==o?({className:r,variant:t,asChild:i,...s}=o,e[0]=o,e[1]=r,e[2]=s,e[3]=i,e[4]=t):(r=e[1],s=e[2],i=e[3],t=e[4]);const c=(i===void 0?!1:i)?v:"span";let a;e[5]!==r||e[6]!==t?(a=u(b({variant:t}),r),e[5]=r,e[6]=t,e[7]=a):a=e[7];let n;return e[8]!==c||e[9]!==s||e[10]!==a?(n=l.jsx(c,{"data-slot":"badge",className:a,...s}),e[8]=c,e[9]=s,e[10]=a,e[11]=n):n=e[11],n}export{x as B};
@@ -1 +0,0 @@
1
- import{c as E,D as I,j as t}from"./index-DnJ6a24w.js";import{C as P}from"./card-gfMzoGpr.js";import{I as R}from"./integration-icon-C9GR_8Ea.js";function q(h){const e=E.c(37),{connection:s,onClick:u,headerActions:j,headerActionsAlwaysVisible:A,body:v,footer:N,className:b,fallbackIcon:C}=h,y=A===void 0?!1:A,k=u&&"hover:bg-muted/50";let i;e[0]!==b||e[1]!==k?(i=I("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",k,b),e[0]=b,e[1]=k,e[2]=i):i=e[2];let l;e[3]!==s.icon||e[4]!==s.title||e[5]!==C?(l=t.jsx(R,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:C}),e[3]=s.icon,e[4]=s.title,e[5]=C,e[6]=l):l=e[6];let o;e[7]!==j||e[8]!==y?(o=j&&t.jsx("div",{className:I("transition-opacity",!y&&"opacity-0 group-hover:opacity-100"),onClick:_,children:j}),e[7]=j,e[8]=y,e[9]=o):o=e[9];let n;e[10]!==o?(n=t.jsx("div",{className:"relative",children:o}),e[10]=o,e[11]=n):n=e[11];let c;e[12]!==l||e[13]!==n?(c=t.jsxs("div",{className:"flex items-start justify-between",children:[l,n]}),e[12]=l,e[13]=n,e[14]=c):c=e[14];let r;e[15]!==s.title?(r=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:s.title}),e[15]=s.title,e[16]=r):r=e[16];const w=s.description||"No description";let a;e[17]!==w?(a=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:w}),e[17]=w,e[18]=a):a=e[18];let d;e[19]!==a||e[20]!==r?(d=t.jsxs("div",{className:"flex flex-col gap-1",children:[r,a]}),e[19]=a,e[20]=r,e[21]=d):d=e[21];let f;e[22]!==v?(f=v&&t.jsx("div",{children:v}),e[22]=v,e[23]=f):f=e[23];let m;e[24]!==d||e[25]!==f||e[26]!==c?(m=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[c,d,f]}),e[24]=d,e[25]=f,e[26]=c,e[27]=m):m=e[27];let x;e[28]!==N?(x=N&&t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:V,children:N})}),e[28]=N,e[29]=x):x=e[29];let p;e[30]!==m||e[31]!==x?(p=t.jsxs("div",{className:"flex flex-col flex-1",children:[m,x]}),e[30]=m,e[31]=x,e[32]=p):p=e[32];let g;return e[33]!==u||e[34]!==p||e[35]!==i?(g=t.jsx(P,{className:i,onClick:u,children:p}),e[33]=u,e[34]=p,e[35]=i,e[36]=g):g=e[36],g}function V(h){return h.stopPropagation()}function _(h){return h.stopPropagation()}export{q as C};
@@ -1 +0,0 @@
1
- import{r as B,c as $,j as t,B as X,D as Ne,u as oe,x as Oe,K as le,O as J,Q as ye,e as re,c4 as xe,y as Ve,p as Me,E as Ee,g as ze,w as Re,t as Le,q as Ue,i as Fe,b as Be,v as Z,a as He}from"./index-DnJ6a24w.js";import{g as We}from"./generate-id-kfQDJb0K.js";import{E as Ce}from"./empty-state-BjCXvoyS.js";import{E as Xe,c as Ge,r as Qe,e as _e}from"./env-vars-editor-BjeFjhEe.js";import{d as Ke}from"./registry-utils-Bx7--rIH.js";import{u as Se,n as qe,S as Je}from"./index-DjVQ8cwy.js";import{u as Ye}from"./use-members-Bgz9FSqE.js";import{A as Ze}from"./avatar-BoRF-Me1.js";import{u as we,b as et,a as ke}from"./use-connection-CNeKPAtP.js";import{u as ce,a as tt}from"./constants-D5QZg84_.js";import{d as st}from"./use-mcp-tools-CFyULGGP.js";import{b as nt}from"./use-mcp-resources-BueR0w1E.js";import{a as ot}from"./use-mcp-prompts-D4XXlnov.js";import{B as rt,a as it,b as pe,d as at,e as lt,c as ct}from"./breadcrumb-BWfepeob.js";import{I as ie}from"./integration-icon-C9GR_8Ea.js";import{i as Te}from"./Loading01-DQphO9Su.js";import{s as dt}from"./Plus-CURSuoDd.js";import{t as Ae}from"./Settings01-B76KnDHb.js";import{s as de}from"./Trash01-CYMRq_nY.js";import{f as mt,a as ut,b as xt,c as pt,d as ht,e as ft,A as gt,h as jt}from"./alert-dialog-BqCiJDa8.js";import{S as vt,a as bt,b as Nt,c as yt,d as Ct}from"./sheet-B_-2ygzJ.js";import{F as U,b as F,c as H,d as R,f as W,e as _t,a as St}from"./form-tOTNzCZe.js";import{I as G}from"./input-BBKBJVKe.js";import{g as me}from"./connection-slug-Bw8dtz1U.js";import{a as wt}from"./layout-10Sxtyop.js";import{c as kt,C as Tt,B as At,a as It,b as Dt,d as $t,e as Pt}from"./monitoring-stats-row-BfoeteQX.js";import{b as Ot}from"./use-virtual-mcp-DGT5zflo.js";import{i as Ie}from"./ChevronRight-BEUO8jhU.js";import{t as De}from"./Users03-DEpvReeu.js";import{T as te,a as Vt,b as se,c as Mt}from"./tabs-aIY_aIUV.js";import{a as Et}from"./Tool01-DlbILfZg.js";import{g as ue}from"./types-BOmhR0hZ.js";import{M as zt}from"./mcp-app-renderer-C3qFwvPf.js";import{C as Rt}from"./collection-search-Dzoe9W56.js";import{T as Lt}from"./tools-list-DGVVcYEB.js";import{C as Ut}from"./card-gfMzoGpr.js";import{B as Ft}from"./badge-DIWKuwVU.js";import{D as Bt,a as Ht,b as Wt,c as he}from"./dropdown-menu-DE2pKopg.js";import{S as fe,a as ge,b as je,c as ve,d as L}from"./select-Bbaj2HCW.js";import{i as Xt}from"./CheckCircle-DDKCxiAn.js";import{t as Gt}from"./ChevronDown-D0b1rvAp.js";import{n as Qt}from"./Container-b65PFshp.js";import{s as ne}from"./Globe02-DlxZmkSI.js";import{s as Kt}from"./RefreshCcw01-oV1XFIRn.js";import{i as qt}from"./Terminal-BHkLJhoR.js";import{s as Jt}from"./XClose-C-H07PEn.js";import"./binder-CuBUxi11.js";import"./File06-BAp2UeVQ.js";import"./Key01-V3zgT2bk.js";import"./extract-connection-data-CZxT3XNH.js";import"./use-install-from-registry-Ckutd61H.js";import"./index-DyL93sTY.js";import"./index-D-6rbOIG.js";import"./ChevronUp-BWhuIqS7.js";import"./index-qrpgIqks.js";import"./select-virtual-mcp-CZJoA7HG.js";import"./popover-vDURg2rv.js";import"./tooltip-Csc3oeTz.js";import"./index-hCeFdkUk.js";import"./Check-CLxUgI8Z.js";import"./SearchMd-C8ADHGFY.js";import"./use-create-virtual-mcp-BOxl7MdZ.js";import"./use-collections-Le9CzDbY.js";import"./useMutation-Betr8yis.js";import"./useQuery-mzOsnjYJ.js";import"./X-BT_y3J3a.js";import"./label-DJvdRQ2A.js";import"./slugify-CEUa2lfQ.js";import"./index-B09Yemt1.js";import"./collection-display-button-C42ZnuS7.js";import"./ArrowDown-Ba2t7m6d.js";import"./ArrowUp-Wy3Qa9X3.js";import"./Grid01-B9zEjFyx.js";import"./List-D6xZGoxJ.js";import"./collection-table-wrapper-Bka5CUqj.js";import"./table-BK1bAac3.js";import"./Eye-Cqad01Et.js";import"./LayersTwo01-D3otbQFN.js";const $e=({size:s=24,color:e="currentColor",...n})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},B.createElement("path",{d:"m12 21-.1-.15c-.695-1.042-1.042-1.563-1.5-1.94a4 4 0 0 0-1.378-.737C8.453 18 7.827 18 6.575 18H5.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C2 16.48 2 15.92 2 14.8V6.2c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C3.52 3 4.08 3 5.2 3h.4c2.24 0 3.36 0 4.216.436a4 4 0 0 1 1.748 1.748C12 6.04 12 7.16 12 9.4M12 21V9.4M12 21l.1-.15c.695-1.042 1.042-1.563 1.5-1.94a3.999 3.999 0 0 1 1.378-.737C15.547 18 16.173 18 17.425 18H18.8c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 16.48 22 15.92 22 14.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 3 19.92 3 18.8 3h-.4c-2.24 0-3.36 0-4.216.436a4 4 0 0 0-1.748 1.748C12 6.04 12 7.16 12 9.4"}));$e.displayName="BookOpen01";function Yt(s){const e=$.c(39),{instance:n,onConfigure:r,onAuthenticate:i,onDelete:o}=s;let l;e[0]!==n.id?(l={connectionId:n.id},e[0]=n.id,e[1]=l):l=e[1];const c=Se(l),d=!(n.connection_type==="VIRTUAL")&&c.supportsOAuth&&!c.isAuthenticated,p=d?"border-destructive/50 bg-destructive/5 px-4 py-2.5":"border-transparent";let x;e[2]!==p?(x=Ne("flex items-center gap-3 rounded-lg border transition-colors",p),e[2]=p,e[3]=x):x=e[3];let a;e[4]!==n.icon||e[5]!==n.title?(a=t.jsx(ie,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=a):a=e[6];let f;e[7]!==n.title?(f=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=f):f=e[8];let j;e[9]!==d?(j=d&&t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}),e[9]=d,e[10]=j):j=e[10];let b;e[11]!==f||e[12]!==j?(b=t.jsxs("div",{className:"flex-1 min-w-0",children:[f,j]}),e[11]=f,e[12]=j,e[13]=b):b=e[13];let v;e[14]!==n||e[15]!==d||e[16]!==i?(v=d&&t.jsx(X,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>i(n),children:"Authorize"}),e[14]=n,e[15]=d,e[16]=i,e[17]=v):v=e[17];let g;e[18]!==n||e[19]!==r?(g=()=>r(n),e[18]=n,e[19]=r,e[20]=g):g=e[20];let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Ae,{size:13}),e[21]=C):C=e[21];let A;e[22]!==g?(A=t.jsx(X,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:g,title:"Configure",children:C}),e[22]=g,e[23]=A):A=e[23];let _;e[24]!==n||e[25]!==o?(_=()=>o(n),e[24]=n,e[25]=o,e[26]=_):_=e[26];let N;e[27]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(de,{size:13}),e[27]=N):N=e[27];let w;e[28]!==_?(w=t.jsx(X,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:_,title:"Delete",children:N}),e[28]=_,e[29]=w):w=e[29];let S;e[30]!==A||e[31]!==w||e[32]!==v?(S=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[v,A,w]}),e[30]=A,e[31]=w,e[32]=v,e[33]=S):S=e[33];let T;return e[34]!==S||e[35]!==x||e[36]!==a||e[37]!==b?(T=t.jsxs("div",{className:x,children:[a,b,S]}),e[34]=S,e[35]=x,e[36]=a,e[37]=b,e[38]=T):T=e[38],T}function Zt(s){const e=$.c(15),{instance:n,onConfigure:r}=s;let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(ie,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let l;e[5]!==n||e[6]!==r?(l=()=>r(n),e[5]=n,e[6]=r,e[7]=l):l=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Ae,{size:13}),e[8]=c):c=e[8];let m;e[9]!==l?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(X,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:l,title:"Configure",children:c})}),e[9]=l,e[10]=m):m=e[10];let d;return e[11]!==i||e[12]!==o||e[13]!==m?(d=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent transition-colors",children:[i,o,m]}),e[11]=i,e[12]=o,e[13]=m,e[14]=d):d=e[14],d}function es(s){const e=$.c(25),{instances:n,onConfigure:r,onAuthenticate:i,onDelete:o,onAdd:l,isAdding:c}=s;if(n.length===0)return null;const m=n.length===1?"Instance":"Instances";let d;e[0]!==m?(d=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:m}),e[0]=m,e[1]=d):d=e[1];let p;e[2]!==c?(p=c?t.jsx(Te,{size:13,className:"animate-spin"}):t.jsx(dt,{size:13}),e[2]=c,e[3]=p):p=e[3];let x;e[4]!==c||e[5]!==l||e[6]!==p?(x=t.jsxs(X,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:l,disabled:c,children:[p,"Add instance"]}),e[4]=c,e[5]=l,e[6]=p,e[7]=x):x=e[7];let a;e[8]!==d||e[9]!==x?(a=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[d,x]}),e[8]=d,e[9]=x,e[10]=a):a=e[10];let f;if(e[11]!==n||e[12]!==i||e[13]!==r||e[14]!==o){let v;e[16]!==i||e[17]!==r||e[18]!==o?(v=g=>t.jsx(B.Suspense,{fallback:t.jsx(Zt,{instance:g,onConfigure:r}),children:t.jsx(Yt,{instance:g,onConfigure:r,onAuthenticate:i,onDelete:o})},g.id),e[16]=i,e[17]=r,e[18]=o,e[19]=v):v=e[19],f=n.map(v),e[11]=n,e[12]=i,e[13]=r,e[14]=o,e[15]=f}else f=e[15];let j;e[20]!==f?(j=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:f}),e[20]=f,e[21]=j):j=e[21];let b;return e[22]!==a||e[23]!==j?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[a,j]}),e[22]=a,e[23]=j,e[24]=b):b=e[24],b}const ts=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ss(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const ns={calls:{label:"Tool calls"},errors:{label:"Errors"}};function os(s){const e=$.c(3),{connectionId:n,orgId:r,timeframe:i}=s;let o;e[0]!==r?(o={connectionId:tt,orgId:r},e[0]=r,e[1]=o):o=e[1];const l=ce(o),c=ss(i),{data:m}=Oe({queryKey:le.connectionActivity(n,i,r),queryFn:async()=>{const f=await l.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:c.startDate.toISOString(),endDate:c.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return f.structuredContent??f},staleTime:3e5}),d=kt(m?.logs??[],c),p=d.data,x=d.totalCalls>0;let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[2]=a):a=e[2],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:d.totalCalls.toLocaleString()}),a]}),d.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:d.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),d.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(d.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),x?t.jsxs("div",{children:[t.jsx(Tt,{config:ns,className:"h-16 w-full",children:t.jsxs(At,{data:p,barCategoryGap:"4%",children:[t.jsx(It,{content:t.jsx(Dt,{labelFormatter:is}),cursor:{fill:"var(--muted)"}}),t.jsx($t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:p.map(rs)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[p.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function rs(s,e){return t.jsx(Pt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function is(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function as(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ls(s){const e=$.c(13),{connectionId:n}=s,[r,i]=B.useState("14d"),{org:o}=oe();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=l):l=e[0];let c;e[1]!==r?(c=ts.map(a=>t.jsx("button",{type:"button",onClick:()=>i(a.value),className:Ne("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",r===a.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:a.label},a.value)),e[1]=r,e[2]=c):c=e[2];let m;e[3]!==c?(m=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[l,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:c})]}),e[3]=c,e[4]=m):m=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(as,{}),e[5]=d):d=e[5];let p;e[6]!==n||e[7]!==o.id||e[8]!==r?(p=t.jsx(B.Suspense,{fallback:d,children:t.jsx(os,{connectionId:n,orgId:o.id,timeframe:r})}),e[6]=n,e[7]=o.id,e[8]=r,e[9]=p):p=e[9];let x;return e[10]!==m||e[11]!==p?(x=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,p]}),e[10]=m,e[11]=p,e[12]=x):x=e[12],x}function cs(s){const e=$.c(14),{virtualMcp:n,org:r}=s;let i;e[0]!==r||e[1]!==n.id?(i={org:r,project:J,agentId:n.id},e[0]=r,e[1]=n.id,e[2]=i):i=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(De,{size:16}),e[3]=o):o=e[3];let l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(ie,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:o}),e[4]=n.icon,e[5]=n.title,e[6]=l):l=e[6];let c;e[7]!==n.title?(c=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=c):c=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ie,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=m):m=e[9];let d;return e[10]!==i||e[11]!==l||e[12]!==c?(d=t.jsxs(ye,{to:"/$org/$project/agents/$agentId/",params:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group",children:[l,c,m]}),e[10]=i,e[11]=l,e[12]=c,e[13]=d):d=e[13],d}function ds(s){const e=$.c(7),{virtualMcps:n,org:r}=s;let i;if(e[0]!==r||e[1]!==n){let l;e[3]!==r?(l=c=>t.jsx(cs,{virtualMcp:c,org:r},c.id),e[3]=r,e[4]=l):l=e[4],i=n.map(l),e[0]=r,e[1]=n,e[2]=i}else i=e[2];let o;return e[5]!==i?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:i})}),e[5]=i,e[6]=o):o=e[6],o}function ms(s){const e=$.c(7),{connection:n}=s,{org:r}=oe();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const o=Ot(i);if(!(o.length>0)){let d;return e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(t.Fragment,{}),e[2]=d):d=e[2],d}let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=c):c=e[3];let m;return e[4]!==r.slug||e[5]!==o?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[c,t.jsx("div",{className:"px-5 py-4",children:t.jsx(ds,{virtualMcps:o,org:r.slug})})]}),e[4]=r.slug,e[5]=o,e[6]=m):m=e[6],m}function us(s){const e=$.c(30),{tools:n,connectionId:r,org:i}=s,o=re(),{org:l}=oe();let c;e[0]!==r||e[1]!==l.id?(c={connectionId:r,orgId:l.id},e[0]=r,e[1]=l.id,e[2]=c):c=e[2];const m=ce(c),d=we(r);let p;e[3]!==d||e[4]!==r?(p=d?me(d):r,e[3]=d,e[4]=r,e[5]=p):p=e[5];const x=p,[a,f]=B.useState("");let j,b,v,g;if(e[6]!==x||e[7]!==m||e[8]!==o||e[9]!==i||e[10]!==a||e[11]!==n){const _=(n??[]).filter(xs),N=a.toLowerCase().trim(),w=N?_.filter(h=>h.name.toLowerCase().includes(N)||h.description&&h.description.toLowerCase().includes(N)):_;let S;e[16]!==x||e[17]!==o||e[18]!==i?(S=h=>{o({to:"/$org/$project/mcps/$appSlug/$collectionName/$itemId",params:{org:i,project:J,appSlug:x,collectionName:"tools",itemId:encodeURIComponent(h.name)}})},e[16]=x,e[17]=o,e[18]=i,e[19]=S):S=e[19];const T=S;v="flex flex-col h-full overflow-hidden";let I;e[20]===Symbol.for("react.memo_cache_sentinel")?(I=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[20]=I):I=e[20],e[21]!==a?(g=t.jsx(Rt,{value:a,onChange:f,placeholder:"Search apps...",onKeyDown:I}),e[21]=a,e[22]=g):g=e[22],j="flex-1 overflow-auto p-5",b=w.length===0?t.jsx(Ce,{image:null,title:a?"No apps found":"No apps available",description:a?"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:w.map(h=>{const D=ue(h._meta);return t.jsxs(Ut,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>T(h),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(zt,{resourceURI:D,toolInfo:{tool:h},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),t.jsx(Lt,{annotations:h.annotations,_meta:h._meta})]}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]})]},h.name)})}),e[6]=x,e[7]=m,e[8]=o,e[9]=i,e[10]=a,e[11]=n,e[12]=j,e[13]=b,e[14]=v,e[15]=g}else j=e[12],b=e[13],v=e[14],g=e[15];let C;e[23]!==j||e[24]!==b?(C=t.jsx("div",{className:j,children:b}),e[23]=j,e[24]=b,e[25]=C):C=e[25];let A;return e[26]!==v||e[27]!==g||e[28]!==C?(A=t.jsxs("div",{className:v,children:[g,C]}),e[26]=v,e[27]=g,e[28]=C,e[29]=A):A=e[29],A}function xs(s){return!!ue(s._meta)}function Pe(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),r=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),i=e.map(n),o=e[e.length-1];return i.length>=2&&o&&r.has(o)?[i.pop(),...i].join(" "):i.join(" ")}function ae(s){const e=$.c(2),{label:n}=s;let r;return e[0]!==n?(r=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=r):r=e[1],r}function ps(s){const e=$.c(50),{tools:n,prompts:r,resources:i,connectionId:o,org:l}=s;let c;e[0]!==r?(c=r===void 0?[]:r,e[0]=r,e[1]=c):c=e[1];const m=c;let d;e[2]!==i?(d=i===void 0?[]:i,e[2]=i,e[3]=d):d=e[3];const p=d,x=re(),a=we(o??"");let f;e[4]!==a||e[5]!==o?(f=a?me(a):o,e[4]=a,e[5]=o,e[6]=f):f=e[6];const j=f;let b;e[7]!==j||e[8]!==o||e[9]!==x||e[10]!==l?(b=function(Q){!o||!l||x({to:"/$org/$project/mcps/$appSlug/$collectionName/$itemId",params:{org:l,project:J,appSlug:j,collectionName:"tools",itemId:encodeURIComponent(Q)}})},e[7]=j,e[8]=o,e[9]=x,e[10]=l,e[11]=b):b=e[11];const v=b;let g;e[12]!==o||e[13]!==l||e[14]!==n?(g=o&&l&&n.some(gs),e[12]=o,e[13]=l,e[14]=n,e[15]=g):g=e[15];const C=g;if(n.length+m.length+p.length===0){let y;return e[16]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=y):y=e[16],y}let _;e[17]!==n.length?(_=t.jsxs(te,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=_):_=e[18];let N;e[19]!==C?(N=C&&t.jsx(te,{value:"apps",variant:"underline",children:"UI"}),e[19]=C,e[20]=N):N=e[20];let w,S;e[21]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(te,{value:"prompts",variant:"underline",children:"Prompts"}),S=t.jsx(te,{value:"resources",variant:"underline",children:"Resources"}),e[21]=w,e[22]=S):(w=e[21],S=e[22]);let T;e[23]!==_||e[24]!==N?(T=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Vt,{variant:"underline",className:"gap-1",children:[_,N,w,S]})}),e[23]=_,e[24]=N,e[25]=T):T=e[25];let I;e[26]!==v||e[27]!==n?(I=n.length>0?n.map(y=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>v(y.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Et,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Pe(y.name)}),y.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:y.description})]}),t.jsx(Ie,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},y.name)):t.jsx(ae,{label:"tools"}),e[26]=v,e[27]=n,e[28]=I):I=e[28];let h;e[29]!==I?(h=t.jsx(se,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:I})}),e[29]=I,e[30]=h):h=e[30];let D;e[31]!==o||e[32]!==C||e[33]!==l||e[34]!==n?(D=C&&t.jsx(se,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(us,{tools:n,connectionId:o,org:l})}),e[31]=o,e[32]=C,e[33]=l,e[34]=n,e[35]=D):D=e[35];let E;e[36]!==m?(E=m.length>0?m.map(fs):t.jsx(ae,{label:"prompts"}),e[36]=m,e[37]=E):E=e[37];let P;e[38]!==E?(P=t.jsx(se,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[38]=E,e[39]=P):P=e[39];let O;e[40]!==p?(O=p.length>0?p.map(hs):t.jsx(ae,{label:"resources"}),e[40]=p,e[41]=O):O=e[41];let M;e[42]!==O?(M=t.jsx(se,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:O})}),e[42]=O,e[43]=M):M=e[43];let z;return e[44]!==T||e[45]!==h||e[46]!==D||e[47]!==P||e[48]!==M?(z=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Mt,{defaultValue:"tools",variant:"underline",children:[T,h,D,P,M]})}),e[44]=T,e[45]=h,e[46]=D,e[47]=P,e[48]=M,e[49]=z):z=e[49],z}function hs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(qe,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function fs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx($e,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Pe(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function gs(s){return ue(s._meta)}function js(s){const e=$.c(13),{connection:n,displayTitle:r}=s,i=r??n.title;let o;e[0]!==n.icon||e[1]!==i?(o=t.jsx(ie,{icon:n.icon,name:i,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=i,e[2]=o):o=e[2];let l;e[3]!==i?(l=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none",children:i})}),e[3]=i,e[4]=l):l=e[4];let c;e[5]!==n.description?(c=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:n.description}),e[5]=n.description,e[6]=c):c=e[6];let m;e[7]!==l||e[8]!==c?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,c]}),e[7]=l,e[8]=c,e[9]=m):m=e[9];let d;return e[10]!==o||e[11]!==m?(d=t.jsxs("div",{className:"flex items-center gap-6 py-7 px-8 bg-background border-b border-border shrink-0",children:[o,m]}),e[10]=o,e[11]=m,e[12]=d):d=e[12],d}function vs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:r,onRemoveOAuth:i}){const o=xe({control:s.control,name:"ui_type"}),l=xe({control:s.control,name:"connection_url"}),{stdioEnabled:c}=Ve(),m=(()=>{if(typeof l!="string"||!l)return!1;try{const a=new URL(l);return a.hostname==="api.githubcopilot.com"&&a.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),d=c||e.connection_type==="STDIO",p=e.connection_type==="VIRTUAL",x=p?Me(e.connection_url):null;return p?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(De,{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."})]}),x&&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:x})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(U,{control:s.control,name:"ui_type",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(fe,{value:a.value,onValueChange:a.onChange,children:[t.jsx(R,{children:t.jsxs(ge,{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(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(je,{})]})}),t.jsxs(ve,{children:[t.jsx(L,{value:"HTTP",children:"HTTP"}),t.jsx(L,{value:"SSE",children:"SSE"}),t.jsx(L,{value:"Websocket",children:"Websocket"}),d&&t.jsxs(t.Fragment,{children:[t.jsx(L,{value:"NPX",children:"NPX Package"}),t.jsx(L,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(U,{control:s.control,name:"connection_url",render:({field:f})=>t.jsx(F,{className:"flex-1 min-w-0",children:t.jsx(R,{children:t.jsx(G,{placeholder:"https://example.com/mcp",...f,value:f.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(fe,{value:a.value,onValueChange:a.onChange,children:[t.jsx(R,{children:t.jsx(ge,{className:"h-10",children:t.jsx(je,{})})}),t.jsxs(ve,{children:[t.jsx(L,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(L,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(L,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),"Websocket"]})}),d&&t.jsxs(t.Fragment,{children:[t.jsx(L,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Qt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(L,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(qt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(W,{})]})}),o==="NPX"&&t.jsx(U,{control:s.control,name:"npx_package",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(R,{children:t.jsx(G,{placeholder:"@perplexity-ai/mcp-server",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(U,{control:s.control,name:"stdio_command",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(R,{children:t.jsx(G,{placeholder:"node, bun, python...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(U,{control:s.control,name:"stdio_args",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(R,{children:t.jsx(G,{placeholder:"arg1 arg2 --flag value",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(W,{})]})})]}),t.jsx(U,{control:s.control,name:"stdio_cwd",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(R,{children:t.jsx(G,{placeholder:"/path/to/project (optional)",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(U,{control:s.control,name:"env_vars",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(R,{children:t.jsx(Xe,{value:a.value??[],onChange:a.onChange})}),t.jsx(W,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(U,{control:s.control,name:"connection_token",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:m?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Bt,{children:[t.jsx(Ht,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Ft,{variant:"success",className:"gap-1.5",children:[t.jsx(Xt,{size:12}),"Authenticated via OAuth",t.jsx(Gt,{size:12})]})})}),t.jsxs(Wt,{align:"start",children:[t.jsxs(he,{onClick:r,children:[t.jsx(Kt,{size:16}),"Re-authenticate"]}),t.jsxs(he,{variant:"destructive",onClick:i,children:[t.jsx(de,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&a.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:()=>a.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(Jt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(R,{children:t.jsx(G,{type:"password",placeholder:m?"Paste your GitHub PAT":"Enter access token...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(_t,{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(W,{})]})})]})}function bs(s){return s.command==="npx"}function Ns(s){return s.args?.find(e=>!e.startsWith("-"))??""}function ys(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Cs(s,e){const n={command:"npx",args:["-y",s]},r=_e(e);return Object.keys(r).length>0&&(n.envVars=r),n}function _s(s,e,n,r){const i={command:s};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const o=_e(r);return Object.keys(o).length>0&&(i.envVars=o),i}function be(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Be(s.connection_headers)){const r=s.connection_headers,i=Qe(r.envVars);if(bs(r)){const l=Ns(r);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i}}const o=ys(r);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars: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 Ss(s){let e,n=null,r=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=Cs(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=_s(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",r=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...r&&{connection_token:r},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:r,tools:i,prompts:o,resources:l,siblings:c}){const m=re({from:"/$org/$project/mcps/$appSlug"}),d=Re(),p=ke(),[x,a]=B.useState(null),[f,j]=B.useState(null),[b,v]=B.useState(!1),g=Se({connectionId:e}),{data:C}=Ye(),A=C?.data?.members??[],_=x??s,N=A.find(u=>u.userId===_.created_by),S=s?.connection_type==="VIRTUAL"||g.isAuthenticated,I=Ke({connections:[s],binding:"MCP"}).length>0,h=Le({resolver:Ue(Ge),values:be(x??s)}),D=h.formState.isDirty,E=async()=>{if(!await h.trigger())return;const k=h.getValues(),V=Ss(k),K=x?.id??e;await p.update.mutateAsync({id:K,data:V}),h.reset(k)},P=()=>{h.reset(be(x??s))},O=async u=>{const{token:k,tokenInfo:V,error:K}=await He({connectionId:u});if(K||!k){Z.error(`Authentication failed: ${K}`);return}if(V)try{const q=await fetch(`/api/connections/${u}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:V.accessToken,refreshToken:V.refreshToken,expiresIn:V.expiresIn,scope:V.scope,clientId:V.clientId,clientSecret:V.clientSecret,tokenEndpoint:V.tokenEndpoint})});if(!q.ok)console.error("Failed to save OAuth token:",await q.text()),await p.update.mutateAsync({id:u,data:{connection_token:k}});else try{await p.update.mutateAsync({id:u,data:{}})}catch(ee){console.warn("Failed to refresh connection tools after OAuth:",ee)}}catch(q){console.error("Error saving OAuth token:",q),await p.update.mutateAsync({id:u,data:{connection_token:k}})}else await p.update.mutateAsync({id:u,data:{connection_token:k}});const Y=new URL(`/mcp/${u}`,window.location.origin);await d.invalidateQueries({queryKey:le.isMCPAuthenticated(Y.href,null)}),Z.success("Authentication successful")},M=()=>O(s.id),z=async()=>{try{const u=await fetch(`/api/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!u.ok){const V=await u.text();Z.error(`Failed to remove OAuth: ${V}`);return}const k=new URL(`/mcp/${s.id}`,window.location.origin);await d.invalidateQueries({queryKey:le.isMCPAuthenticated(k.href,null)}),Z.success("OAuth removed. You can now re-authenticate with a different account.")}catch(u){console.error("Error removing OAuth token:",u),Z.error("Failed to remove OAuth")}},y=async u=>{await p.delete.mutateAsync(u.id),c.length<=1&&m({to:"/$org/$project/mcps",params:{org:n,project:J}}),j(null)},Q=t.jsx(rt,{children:t.jsxs(it,{children:[t.jsx(pe,{children:t.jsx(at,{asChild:!0,children:t.jsx(ye,{to:"/$org/$project/mcps",params:{org:n,project:J},children:"Connections"})})}),t.jsx(lt,{}),t.jsx(pe,{children:t.jsx(ct,{children:(()=>{const u=c[0]??s;return u.app_name?u.title.replace(/\s*\(\d+\)\s*$/,""):u.title})()})})]})});return t.jsxs(t.Fragment,{children:[t.jsx(mt,{open:f!==null,onOpenChange:u=>{u||j(null)},children:t.jsxs(ut,{children:[t.jsxs(xt,{children:[t.jsx(pt,{children:"Disconnect instance?"}),t.jsxs(ht,{children:["This will permanently remove"," ",t.jsx("span",{className:"font-medium text-foreground",children:f?.title}),". This action cannot be undone."]})]}),t.jsxs(ft,{children:[t.jsx(gt,{children:"Cancel"}),t.jsx(jt,{onClick:()=>f&&y(f),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]})}),t.jsx(vt,{open:x!==null,onOpenChange:u=>{u||a(null)},children:t.jsxs(bt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(Nt,{className:"px-6 py-4 border-b border-border shrink-0",children:[t.jsx(yt,{className:"text-base",children:x?.title??s.title}),t.jsx(Ct,{className:"text-xs",children:"Update URL, authentication, and other settings"}),N&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ze,{url:N.user?.image??void 0,fallback:N.user?.name??N.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:N.user?.name||N.user?.email})]})]}),t.jsxs(St,{...h,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-5 flex flex-col gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(U,{control:h.control,name:"title",render:({field:u})=>t.jsxs(F,{children:[t.jsx(H,{children:"Name"}),t.jsx(R,{children:t.jsx(G,{...u})}),t.jsx(W,{})]})}),t.jsx(U,{control:h.control,name:"description",render:({field:u})=>t.jsxs(F,{children:[t.jsx(H,{children:"Description"}),t.jsx(R,{children:t.jsx(G,{...u,value:u.value||""})}),t.jsx(W,{})]})})]}),t.jsx(vs,{form:h,connection:x??s,hasOAuthToken:g.hasOAuthToken,onReauthenticate:M,onRemoveOAuth:z}),t.jsx(Je,{connection:x??s,form:h,hasMcpBinding:I,isMCPAuthenticated:S,supportsOAuth:g.supportsOAuth,isServerError:g.isServerError,onAuthenticate:M,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(X,{onClick:E,disabled:!D||r,className:"flex-1",children:r?"Saving…":"Save changes"}),D&&t.jsx(X,{variant:"outline",onClick:P,children:"Undo"}),t.jsxs(X,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const u=x??s;a(null),j(u)},children:[t.jsx(de,{size:15}),"Delete"]})]})]},x?.id??s.id)]})}),t.jsx(wt,{breadcrumb:Q,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(js,{connection:s,displayTitle:(()=>{const u=c[0]??s;return u.app_name?u.title.replace(/\s*\(\d+\)\s*$/,""):u.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ls,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(es,{instances:c,onConfigure:u=>a(u),onAuthenticate:u=>O(u.id),onDelete:u=>j(u),isAdding:b,onAdd:async()=>{v(!0);try{const u=c[0]??s,k=u.title.replace(/\s*\(\d+\)\s*$/,""),V=c.length+1,K=`${k} (${V})`,Y=We("conn");await p.create.mutateAsync({id:Y,title:K,description:u.description??null,connection_type:u.connection_type,connection_url:u.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:u.created_by,organization_id:u.organization_id,icon:u.icon??null,app_name:u.app_name??null,app_id:u.app_id??null,connection_headers:u.connection_headers??null,oauth_config:null,configuration_state:u.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const q=new URL(`/mcp/${Y}`,window.location.origin),ee=await Fe({url:q.href,token:null});ee.supportsOAuth&&!ee.isAuthenticated&&await O(Y)}finally{v(!1)}}}),t.jsx(ms,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ps,{tools:i,prompts:o,resources:l,connectionId:e,org:n})})]})})]})})]})}function ks(){const s=$.c(31);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$appSlug"},s[0]=e):e=s[0];const n=re(e);let r;s[1]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/$project/mcps/$appSlug"},s[1]=r):r=s[1];const{appSlug:i,org:o}=ze(r),{org:l}=oe(),c=et(),m=ke();let d;s[2]!==i?(d=y=>y.connection_type!=="VIRTUAL"&&me(y)===i,s[2]=i,s[3]=d):d=s[3];const p=c.filter(d),x=p[0]??null,a=x?.id??"",f=ce({connectionId:a||null,orgId:l.id}),b=!(x?.connection_type==="VIRTUAL")&&x?.tools&&x.tools.length>0,v=!b;let g;s[4]!==f||s[5]!==v?(g={client:f,enabled:v},s[4]=f,s[5]=v,s[6]=g):g=s[6];const{data:C}=st(g),A=b?x?.tools??[]:(C?.tools??[]).map(Is);let _;e:{if(p.length<=1){_=A;break e}const y=new Set,Q=[];for(const u of p)for(const k of u.tools??[])y.has(k.name)||(y.add(k.name),Q.push({name:k.name,description:k.description,inputSchema:k.inputSchema??{},outputSchema:k.outputSchema,annotations:k.annotations,_meta:k._meta}));_=Q.length>0?Q:A}const N=_;let w;s[7]!==f?(w={client:f},s[7]=f,s[8]=w):w=s[8];const{data:S}=ot(w);let T;s[9]!==f?(T={client:f},s[9]=f,s[10]=T):T=s[10];const{data:I}=nt(T);let h;s[11]!==S?.prompts?(h=S?.prompts??[],s[11]=S?.prompts,s[12]=h):h=s[12];let D;s[13]!==h?(D=h.map(As),s[13]=h,s[14]=D):D=s[14];const E=D;let P;s[15]!==I?.resources?(P=I?.resources??[],s[15]=I?.resources,s[16]=P):P=s[16];let O;s[17]!==P?(O=P.map(Ts),s[17]=P,s[18]=O):O=s[18];const M=O;if(!x){let y;return s[19]!==n||s[20]!==o?(y=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ce,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(X,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:o,project:J}}),children:"Back to connections"})})}),s[19]=n,s[20]=o,s[21]=y):y=s[21],y}let z;return s[22]!==m.update.isPending||s[23]!==N||s[24]!==x||s[25]!==a||s[26]!==o||s[27]!==E||s[28]!==M||s[29]!==p?(z=t.jsx(ws,{org:o,connection:x,connectionId:a,isUpdating:m.update.isPending,tools:N,prompts:E,resources:M,siblings:p}),s[22]=m.update.isPending,s[23]=N,s[24]=x,s[25]=a,s[26]=o,s[27]=E,s[28]=M,s[29]=p,s[30]=z):z=s[30],z}function Ts(s){return{name:s.name,description:s.description,uri:s.uri}}function As(s){return{name:s.name,description:s.description}}function Is(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations,_meta:s._meta}}function Ds(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ee,{children:t.jsx(B.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Te,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ks,{})})}),s[0]=e):e=s[0],e}function no(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ds,{}),s[0]=e):e=s[0],e}export{no as default};
@@ -1 +0,0 @@
1
- import{c as me,j as t,E as wt,r as K,u as At,w as Dt,e as It,d as Pt,f as $t,y as Et,z as Je,t as Ot,q as Lt,b as Vt,B as P,D as se,O as W,v as $,i as zt,a as Ft,K as Mt}from"./index-DnJ6a24w.js";import{g as Ut}from"./generate-id-kfQDJb0K.js";import{C as Bt}from"./collection-display-button-C42ZnuS7.js";import{C as Rt}from"./collection-search-Dzoe9W56.js";import{C as Ht}from"./collection-tabs-D9qLvNTu.js";import{C as be}from"./connection-card-DuHVLZ35.js";import{E as Kt}from"./empty-state-BjCXvoyS.js";import{I as Ae}from"./integration-icon-C9GR_8Ea.js";import{u as Ze,P as ae}from"./index-B09Yemt1.js";import{u as Xt,f as Wt,g as et}from"./registry-utils-Bx7--rIH.js";import{u as Gt}from"./use-infinite-scroll-CbBHKCjw.js";import{u as qt}from"./use-list-state-DrSbpG8C.js";import{u as Qt}from"./use-store-discovery-BS96E_Li.js";import{g as oe}from"./connection-slug-Bw8dtz1U.js";import{s as Yt}from"./slugify-CEUa2lfQ.js";import{f as De,a as Ie,b as Pe,c as $e,d as Ee,e as Oe,A as Le,h as Ve}from"./alert-dialog-BqCiJDa8.js";import{B as Jt,a as Zt,b as en,c as tn}from"./breadcrumb-BWfepeob.js";import{C as ot}from"./checkbox-DygphnIU.js";import{D as it,a as rt,b as ct,c as lt,d as at,e as dt}from"./dialog-B8WS5FOh.js";import{D as ze,a as Fe,b as Me,c as ue}from"./dropdown-menu-DE2pKopg.js";import{a as nn,F as M,b as U,c as B,d as R,f as H}from"./form-tOTNzCZe.js";import{I as ne}from"./input-BBKBJVKe.js";import{S as sn,a as on,b as rn,c as cn,d as de}from"./select-Bbaj2HCW.js";import{T as ln}from"./textarea-lF0m7xkk.js";import{a as an,b as tt}from"./use-connection-CNeKPAtP.js";import{u as dn,a as un}from"./constants-D5QZg84_.js";import{b as pn}from"./use-virtual-mcp-DGT5zflo.js";import{i as mn}from"./CheckSquare-IgZnioYh.js";import{i as hn}from"./CheckVerified02-Brnp4Z-Q.js";import{t as xn}from"./ChevronDown-D0b1rvAp.js";import{n as pe}from"./Container-b65PFshp.js";import{i as ut}from"./DotsVertical-Bo0fAyx-.js";import{s as pt}from"./Eye-Cqad01Et.js";import{s as we}from"./Globe02-DlxZmkSI.js";import{i as Se}from"./Loading01-DQphO9Su.js";import{s as fn}from"./Plus-CURSuoDd.js";import{i as gn}from"./Terminal-BHkLJhoR.js";import{s as mt}from"./Trash01-CYMRq_nY.js";import{s as jn}from"./XClose-C-H07PEn.js";import{r as yn,E as vn,c as Cn,e as ht}from"./env-vars-editor-BjeFjhEe.js";import{e as bn}from"./extract-connection-data-CZxT3XNH.js";import"./ArrowDown-Ba2t7m6d.js";import"./ArrowUp-Wy3Qa9X3.js";import"./Check-CLxUgI8Z.js";import"./Grid01-B9zEjFyx.js";import"./List-D6xZGoxJ.js";import"./tooltip-Csc3oeTz.js";import"./index-hCeFdkUk.js";import"./badge-DIWKuwVU.js";import"./SearchMd-C8ADHGFY.js";import"./card-gfMzoGpr.js";import"./useQuery-mzOsnjYJ.js";import"./useMutation-Betr8yis.js";import"./binder-CuBUxi11.js";import"./use-view-mode-BeRbE5Df.js";import"./use-mobile-Y3tADOOl.js";import"./useInfiniteQuery-ChOuKh6v.js";import"./infiniteQueryObserver-XS4LWR6q.js";import"./ChevronRight-BEUO8jhU.js";import"./X-BT_y3J3a.js";import"./label-DJvdRQ2A.js";import"./ChevronUp-BWhuIqS7.js";import"./use-collections-Le9CzDbY.js";function nt(i){return oe(i)}function Sn(i){const e=new Map;for(const c of i){if(c.connection_type==="VIRTUAL")continue;const l=nt(c),d=e.get(l);d?d.push(c):e.set(l,[c])}const o=[],a=new Set;for(const c of i){if(c.connection_type==="VIRTUAL")continue;const l=nt(c);if(a.has(l))continue;a.add(l);const d=e.get(l),h=d[0];d.length===1?o.push({type:"single",connection:h}):o.push({type:"group",key:l,icon:h.icon,title:h.app_name?h.title.replace(/\s*\(\d+\)\s*$/,""):h.title,connections:d})}return o}function Ne(i){const e=i.trim();if(!e)return"";try{const o=new URL(e),a=o.pathname.length>1?o.pathname.replace(/\/+$/,""):o.pathname;return`${o.origin}${a}`}catch{return e.replace(/\/+$/,"")}}function Nn(i){const e=i.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const o=e[0]?.toLowerCase();if(o!=="npx"&&o!=="bunx")return null;const c=e.slice(1).find(l=>!l.startsWith("-"));return c?{packageName:c}:null}function Ce(i){const{uiType:e}=i,o=Ne(i.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&o===Ne("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 a=(i.npxPackage??"").trim();return e==="NPX"&&a==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function st(i){if(i.registryItems.length===0||i.uiType!=="HTTP"&&i.uiType!=="SSE"&&i.uiType!=="Websocket")return null;const e=Ne(i.connectionUrl??"");if(!e)return null;const o=i.registryItems.find(l=>(l.server?.remotes??[]).some(h=>Ne(h.url??"")===e));if(!o)return null;const a=o.title||o.name||o.server?.title||o.server?.name||"",c=o.server?.description||o.description||o.summary||null;return a?{id:"registry",title:a,description:c}:null}function _n(i,e){const o={command:"npx",args:["-y",i]},a=ht(e);return Object.keys(a).length>0&&(o.envVars=a),o}function kn(i,e,o,a){const c={command:i};e.trim()&&(c.args=e.trim().split(/\s+/)),o?.trim()&&(c.cwd=o.trim());const l=ht(a);return Object.keys(l).length>0&&(c.envVars=l),c}function Tn(i){return i.command==="npx"}function wn(i){return i.args?.find(e=>!e.startsWith("-"))??""}function An(i){return{command:i.command,args:i.args?.join(" ")??"",cwd:i.cwd??""}}function Dn(i,e){switch(e.type){case"edit":return{mode:"editing",connection:e.connection};case"delete":return{mode:"deleting",connection:e.connection};case"force-delete":return{mode:"force-deleting",connection:e.connection,agentNames:e.agentNames};case"close":return{mode:"idle"}}}function In(i){const e=me.c(51),{group:o,onOpen:a,selectionMode:c,selectedIds:l,onToggleSelect:d}=i;let h;if(e[0]!==o.connections||e[1]!==l){let N;e[3]!==l?(N=J=>l.has(J.id),e[3]=l,e[4]=N):N=e[4],h=o.connections.every(N),e[0]=o.connections,e[1]=l,e[2]=h}else h=e[2];const C=h;let y;if(e[5]!==o.connections||e[6]!==l){let N;e[8]!==l?(N=J=>l.has(J.id),e[8]=l,e[9]=N):N=e[9],y=o.connections.some(N),e[5]=o.connections,e[6]=l,e[7]=y}else y=e[7];const m=y,f=`${o.connections.length} instances`;let v;e[10]!==o.icon||e[11]!==o.title||e[12]!==f?(v={title:o.title,icon:o.icon,description:f},e[10]=o.icon,e[11]=o.title,e[12]=f,e[13]=v):v=e[13];let x;e[14]!==C||e[15]!==o.connections||e[16]!==a||e[17]!==d||e[18]!==l||e[19]!==c?(x=()=>c?(()=>{for(const N of o.connections)C?l.has(N.id)&&d(N.id):l.has(N.id)||d(N.id)})():a(),e[14]=C,e[15]=o.connections,e[16]=a,e[17]=d,e[18]=l,e[19]=c,e[20]=x):x=e[20];const g=c&&C&&"ring-2 ring-primary",b=c&&m&&!C&&"ring-1 ring-primary/50";let k;e[21]!==g||e[22]!==b?(k=se(g,b),e[21]=g,e[22]=b,e[23]=k):k=e[23];let D;e[24]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(pe,{}),e[24]=D):D=e[24];let S;e[25]!==C||e[26]!==o.connections||e[27]!==d||e[28]!==l||e[29]!==c||e[30]!==m?(S=c?t.jsx(ot,{checked:C?!0:m?"indeterminate":!1,onCheckedChange:()=>{for(const N of o.connections)C?l.has(N.id)&&d(N.id):l.has(N.id)||d(N.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",o.connections.length]})]}),e[25]=C,e[26]=o.connections,e[27]=d,e[28]=l,e[29]=c,e[30]=m,e[31]=S):S=e[31];const A=c?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let O;e[32]!==A?(O=se("overflow-hidden transition-all duration-150 ease-out",A),e[32]=A,e[33]=O):O=e[33];let G;e[34]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(Fe,{asChild:!0,children:t.jsx(P,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:$n,children:t.jsx(ut,{size:20})})}),e[34]=G):G=e[34];let q;e[35]!==a?(q=N=>{N.stopPropagation(),a()},e[35]=a,e[36]=q):q=e[36];let Q;e[37]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(pt,{size:16}),e[37]=Q):Q=e[37];let Y;e[38]!==q?(Y=t.jsxs(ze,{children:[G,t.jsx(Me,{align:"end",onClick:Pn,children:t.jsxs(ue,{onClick:q,children:[Q,"Open"]})})]}),e[38]=q,e[39]=Y):Y=e[39];let X;e[40]!==O||e[41]!==Y?(X=t.jsx("div",{className:O,children:Y}),e[40]=O,e[41]=Y,e[42]=X):X=e[42];let te;e[43]!==S||e[44]!==X?(te=t.jsxs("div",{className:"flex items-center gap-1",children:[S,X]}),e[43]=S,e[44]=X,e[45]=te):te=e[45];let z;return e[46]!==te||e[47]!==v||e[48]!==x||e[49]!==k?(z=t.jsx(t.Fragment,{children:t.jsx(be,{connection:v,onClick:x,className:k,fallbackIcon:D,headerActionsAlwaysVisible:!0,headerActions:te})}),e[46]=te,e[47]=v,e[48]=x,e[49]=k,e[50]=z):z=e[50],z}function Pn(i){return i.stopPropagation()}function $n(i){return i.stopPropagation()}function En(i){const e=me.c(28),{count:o,total:a,onSelectAll:c,onDeselectAll:l,onDelete:d,onAddToAgent:h,onToggleStatus:C,onCancel:y}=i;if(o===0)return null;let m;e[0]!==o?(m=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[o," selected"]}),e[0]=o,e[1]=m):m=e[1];let f;e[2]!==o||e[3]!==l||e[4]!==c||e[5]!==a?(f=o<a?t.jsxs(P,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:c,children:["Select all (",a,")"]}):t.jsx(P,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:"Clear selection"}),e[2]=o,e[3]=l,e[4]=c,e[5]=a,e[6]=f):f=e[6];let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(fn,{size:13}),e[7]=v):v=e[7];let x;e[8]!==h?(x=t.jsxs(P,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:[v,"Add to Agent"]}),e[8]=h,e[9]=x):x=e[9];let g;e[10]!==C?(g=t.jsx(P,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>C("active"),children:"Enable"}),e[10]=C,e[11]=g):g=e[11];let b;e[12]!==C?(b=t.jsx(P,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>C("inactive"),children:"Disable"}),e[12]=C,e[13]=b):b=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(mt,{size:13}),e[14]=k):k=e[14];let D;e[15]!==d?(D=t.jsxs(P,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[k,"Delete"]}),e[15]=d,e[16]=D):D=e[16];let S;e[17]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(jn,{size:13}),e[17]=S):S=e[17];let A;e[18]!==y?(A=t.jsx(P,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:y,children:S}),e[18]=y,e[19]=A):A=e[19];let O;return e[20]!==m||e[21]!==A||e[22]!==f||e[23]!==x||e[24]!==g||e[25]!==b||e[26]!==D?(O=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[m,f,x,g,b,D,A]})}),e[20]=m,e[21]=A,e[22]=f,e[23]=x,e[24]=g,e[25]=b,e[26]=D,e[27]=O):O=e[27],O}function On(i){const e=me.c(25),{open:o,onOpenChange:a,agents:c,onConfirm:l}=i,[d,h]=K.useState(null);let C;e[0]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs(ct,{children:[t.jsx(lt,{children:"Add to Agent"}),t.jsx(at,{children:"Select an agent to add the selected connections to."})]}),e[0]=C):C=e[0];let y;e[1]!==c||e[2]!==d?(y=c.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):c.map(S=>t.jsxs("button",{type:"button",onClick:()=>h(S.id),className:se("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",d===S.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Ae,{icon:S.icon,name:S.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:S.title}),S.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:S.description})]})]},S.id)),e[1]=c,e[2]=d,e[3]=y):y=e[3];let m;e[4]!==y?(m=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:y}),e[4]=y,e[5]=m):m=e[5];let f;e[6]!==a?(f=t.jsx(P,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e[6]=a,e[7]=f):f=e[7];const v=!d;let x;e[8]!==l||e[9]!==a||e[10]!==d?(x=()=>{d&&(l(d),a(!1),h(null))},e[8]=l,e[9]=a,e[10]=d,e[11]=x):x=e[11];let g;e[12]!==v||e[13]!==x?(g=t.jsx(P,{disabled:v,onClick:x,children:"Add"}),e[12]=v,e[13]=x,e[14]=g):g=e[14];let b;e[15]!==f||e[16]!==g?(b=t.jsxs(dt,{children:[f,g]}),e[15]=f,e[16]=g,e[17]=b):b=e[17];let k;e[18]!==m||e[19]!==b?(k=t.jsxs(rt,{className:"sm:max-w-[400px]",children:[C,m,b]}),e[18]=m,e[19]=b,e[20]=k):k=e[20];let D;return e[21]!==a||e[22]!==o||e[23]!==k?(D=t.jsx(it,{open:o,onOpenChange:a,children:k}),e[21]=a,e[22]=o,e[23]=k,e[24]=D):D=e[24],D}function Ln(i){const e=me.c(20),{open:o,onOpenChange:a,count:c,onConfirm:l}=i,d=c!==1?"s":"";let h;e[0]!==c||e[1]!==d?(h=t.jsxs($e,{children:["Delete ",c," connection",d,"?"]}),e[0]=c,e[1]=d,e[2]=h):h=e[2];const C=c!==1?"s":"";let y;e[3]!==C?(y=t.jsxs(Ee,{children:["This will permanently delete the selected connection",C,". This action cannot be undone."]}),e[3]=C,e[4]=y):y=e[4];let m;e[5]!==h||e[6]!==y?(m=t.jsxs(Pe,{children:[h,y]}),e[5]=h,e[6]=y,e[7]=m):m=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Le,{children:"Cancel"}),e[8]=f):f=e[8];const v=c!==1?"s":"";let x;e[9]!==c||e[10]!==l||e[11]!==v?(x=t.jsxs(Oe,{children:[f,t.jsxs(Ve,{onClick:l,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",c," connection",v]})]}),e[9]=c,e[10]=l,e[11]=v,e[12]=x):x=e[12];let g;e[13]!==m||e[14]!==x?(g=t.jsxs(Ie,{children:[m,x]}),e[13]=m,e[14]=x,e[15]=g):g=e[15];let b;return e[16]!==a||e[17]!==o||e[18]!==g?(b=t.jsx(De,{open:o,onOpenChange:a,children:g}),e[16]=a,e[17]=o,e[18]=g,e[19]=b):b=e[19],b}function Vn(){const{org:i}=At(),e=Dt(),o=It(),a=Pt({strict:!1}),{data:c}=$t.useSession(),{stdioEnabled:l}=Et(),d=qt({namespace:i.slug,resource:"connections"}),h=an(),C=tt(d),y=tt(),[m,f]=K.useReducer(Dn,{mode:"idle"}),[v,x]=K.useState(new Set),g=v.size>0,[b,k]=K.useState(!1),[D,S]=K.useState(!1),[A,O]=Ze(Je.connectionsTab(i.slug),n=>a.tab==="all"||a.tab==="connected"?a.tab:n??"all"),[G,q]=K.useState("ALL"),[Q,Y]=K.useState("ALL"),X=pn(),z=C.filter(n=>!(n.connection_type==="VIRTUAL"||G!=="ALL"&&n.connection_type!==G||Q!=="ALL"&&n.status!==Q)),N=Sn(z),J=n=>{x(s=>{const r=new Set(s);return r.has(n)?r.delete(n):r.add(n),r})},he=()=>{x(new Set)},Z=Xt(y).sort((n,s)=>{const r=n.app_name==="@deco/management-mcp",u=s.app_name==="@deco/management-mcp";return r&&!u?1:!r&&u?-1:0}),[ie,xt]=Ze(Je.selectedRegistry(i.slug),n=>n??""),Ue=(ie?Z.find(n=>n.id===ie):void 0)??Z[0],_e=Ue?.id??"",ft=Wt(Ue?.tools),re=Qt({registryId:_e,listToolName:ft}),ke=re.items,gt=Gt(re.loadMore,re.hasMore,re.isLoadingMore),Be=new Set(y.filter(n=>n.connection_type!=="VIRTUAL"&&n.app_name).map(n=>n.app_name)),ee=d.search.toLowerCase(),Re=A==="all"||ee?ke.filter(n=>{if(!ee)return!0;const s=n._meta?.["mcp.mesh"],r=[s?.friendly_name,n.server?.name,n.server?.title,n.name,n.title,n.id].filter(Boolean).join(" "),u=[s?.short_description,s?.mesh_description,n.server?.description,n.description].filter(Boolean).join(" ");return r.toLowerCase().includes(ee)||u.toLowerCase().includes(ee)}):[],xe=Re.filter(n=>n.verified||n._meta?.["mcp.mesh"]?.verified||n.meta?.verified),fe=Re.filter(n=>!n.verified&&!n._meta?.["mcp.mesh"]?.verified&&!n.meta?.verified),jt=A==="all"&&!ee?[]:N,He=n=>{const s=Yt(n.name||n.title||n.server?.title||""),r=typeof n.id=="string"&&n.id.includes("/"),u=typeof n.server?.name=="string"&&n.server.name.includes("/"),j=r&&!u?n.id:n.server?.name||n.id||"";o({to:"/$org/$project/store/$appName",params:{org:i.slug,project:W,appName:s},search:{registryId:_e,serverName:j}})},[ge,Te]=K.useState(null),Ke=async n=>{if(!(!i||!c?.user?.id)){Te(n.id);try{const s=bn(n,i.id,c.user.id,{remoteIndex:0}),r=s.connection_type==="STDIO",u=!!s.connection_url,j=r&&s.connection_headers&&typeof s.connection_headers=="object"&&"command"in s.connection_headers;if(!u&&!j){$.error("This MCP Server cannot be connected: no connection method available"),Te(null);return}const I=n.id??n.title,F=y.filter(V=>V.app_name===I||V.title===s.title);if(F.length>0){const V=s.title||"MCP Server";s.title=`${V} (${F.length+1})`}const{id:_}=await h.create.mutateAsync(s),w=new URL(`/mcp/${_}`,window.location.origin),ve=await zt({url:w.href,token:null});if(ve.supportsOAuth&&!ve.isAuthenticated){const{token:V,tokenInfo:E,error:Ye}=await Ft({connectionId:_});if(Ye||!V){$.error(`Authentication failed: ${Ye??"no token received"}`);return}else{if(E)try{(await fetch(`/api/connections/${_}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:E.accessToken,refreshToken:E.refreshToken,expiresIn:E.expiresIn,scope:E.scope,clientId:E.clientId,clientSecret:E.clientSecret,tokenEndpoint:E.tokenEndpoint})})).ok?await h.update.mutateAsync({id:_,data:{}}):await h.update.mutateAsync({id:_,data:{connection_token:V}})}catch{await h.update.mutateAsync({id:_,data:{connection_token:V}})}else await h.update.mutateAsync({id:_,data:{connection_token:V}});await e.invalidateQueries({queryKey:Mt.isMCPAuthenticated(w.href,null)}),$.success("Authentication successful")}}$.success("Connected successfully")}catch(s){$.error(`Failed to connect: ${s instanceof Error?s.message:String(s)}`)}finally{Te(null)}}},Xe=a.action==="create",yt=()=>{o({to:"/$org/$project/mcps",params:{org:i.slug,project:W},search:{action:"create"}})},We=()=>{o({to:"/$org/$project/mcps",params:{org:i.slug,project:W},search:{}})},p=Ot({resolver:Lt(Cn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),L=p.watch("ui_type"),Ge=p.watch("connection_url"),vt=p.watch("npx_package"),ce=Ce({uiType:L,connectionUrl:Ge??"",npxPackage:vt??""})??st({uiType:L,connectionUrl:Ge??"",registryItems:ke}),T=m.mode==="editing"?m.connection:null;K.useEffect(()=>{if(T){const n=Vt(T.connection_headers)?T.connection_headers:null;if(n&&T.connection_type==="STDIO"){const s=yn(n.envVars);if(Tn(n)){const r=wn(n);p.reset({title:T.title,description:T.description,icon:T.icon??null,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:r,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:s})}else{const r=An(n);p.reset({title:T.title,description:T.description,icon:T.icon??null,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:r.command,stdio_args:r.args,stdio_cwd:r.cwd,env_vars:s})}}else p.reset({title:T.title,description:T.description,icon:T.icon??null,ui_type:T.connection_type,connection_url:T.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else p.reset({title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[T,p]);const le=dn({connectionId:un,orgId:i.id}),je=()=>{e.invalidateQueries({predicate:n=>{const s=n.queryKey;return s[1]===i.id&&s[3]==="collection"&&s[4]==="CONNECTIONS"}})},Ct=async()=>{k(!1);const n=[...v];let s=0;for(const r of n)try{(await le.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:r,force:!0}})).isError||s++}catch{}je(),$.success(`Deleted ${s} connection${s!==1?"s":""}`),he()},bt=async n=>{const s=[...v];let r=0;for(const u of s)try{await h.update.mutateAsync({id:u,data:{status:n}}),r++}catch{}je(),$.success(`${n==="active"?"Enabled":"Disabled"} ${r} connection${r!==1?"s":""}`),he()},St=async n=>{const s=X.find(j=>j.id===n);if(!s||!le)return;const r=new Set(s.connections.map(j=>j.connection_id)),u=[...v].filter(j=>!r.has(j)).map(j=>({connection_id:j,selected_tools:null,selected_resources:null,selected_prompts:null}));if(u.length===0){$.info("All selected connections are already in that agent");return}try{await le.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:n,data:{connections:[...s.connections,...u]}}}),e.invalidateQueries({predicate:j=>{const I=j.queryKey;return I[1]===i.id&&I[3]==="collection"&&I[4]==="VIRTUAL_MCP"}}),$.success(`Added ${u.length} connection${u.length!==1?"s":""} to "${s.title}"`),he()}catch{$.error("Failed to add connections to agent")}},qe=n=>{const s=n.content;return Array.isArray(s)&&s[0]?.type==="text"&&typeof s[0].text=="string"?s[0].text:"Unknown error"},Nt=async()=>{if(m.mode!=="deleting")return;const n=m.connection;f({type:"close"});try{const s=await le.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:n.id}});if(s.isError){const r=qe(s),u=r.replace(/^Error:\s*/,"");try{const j=JSON.parse(u);if(j.code==="CONNECTION_IN_USE"&&j.agentNames){f({type:"force-delete",connection:n,agentNames:j.agentNames.map(I=>`"${I}"`).join(", ")});return}}catch{}$.error(`Failed to delete connection: ${r}`);return}je(),$.success("Connection deleted successfully")}catch(s){const r=s instanceof Error?s.message:String(s);$.error(`Failed to delete connection: ${r}`)}},_t=async()=>{if(m.mode!=="force-deleting")return;const n=m.connection.id;f({type:"close"});try{const s=await le.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:n,force:!0}});if(s.isError){$.error(`Failed to delete connection: ${qe(s)}`);return}je(),$.success("Connection deleted successfully")}catch(s){const r=s instanceof Error?s.message:String(s);$.error(`Failed to delete connection: ${r}`)}},kt=async n=>{let s,r=null,u=null,j=null;if(n.ui_type==="NPX"?(s="STDIO",r="",j=_n(n.npx_package||"",n.env_vars||[])):n.ui_type==="STDIO"?(s="STDIO",r="",j=kn(n.stdio_command||"",n.stdio_args||"",n.stdio_cwd,n.env_vars||[])):(s=n.ui_type,r=n.connection_url||"",u=n.connection_token||null),T){await h.update.mutateAsync({id:T.id,data:{title:n.title,description:n.description||null,icon:n.icon??null,connection_type:s,connection_url:r,...u&&{connection_token:u},...j&&{connection_headers:j}}}),f({type:"close"}),p.reset();return}const I=Ut("conn");await h.create.mutateAsync({id:I,title:n.title,description:n.description||null,connection_type:s,connection_url:r,connection_token:u,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:c?.user?.id||"system",organization_id:i.id,icon:n.icon??null,app_name:null,app_id:null,connection_headers:j,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),We(),p.reset(),o({to:"/$org/$project/mcps/$appSlug",params:{org:i.slug,project:W,appSlug:oe({app_name:null,connection_url:r,title:n.title,id:I})}})},Qe=n=>{n||(Xe?We():f({type:"close"}),p.reset())},ye=n=>{const s=n.trim();if(!s)return;const r=!!p.formState.dirtyFields.title,u=!!p.formState.dirtyFields.description,j=!!p.formState.dirtyFields.env_vars,I=_=>{if(_&&(!r&&!p.getValues("title").trim()&&_.title&&p.setValue("title",_.title,{shouldDirty:!1}),!u&&!(p.getValues("description")??"").trim()&&_.description&&p.setValue("description",_.description,{shouldDirty:!1}),!j&&_.envVarKeys?.length)){const w=p.getValues("env_vars")??[],ve=new Set(w.map(E=>E.key)),V=_.envVarKeys.filter(E=>!ve.has(E));V.length>0&&p.setValue("env_vars",[...w,...V.map(E=>({key:E,value:""}))],{shouldDirty:!0})}},F=Nn(s);if(F&&l){p.setValue("ui_type","NPX",{shouldDirty:!0}),p.setValue("npx_package",F.packageName,{shouldDirty:!0}),p.setValue("connection_url","",{shouldDirty:!0}),p.setValue("connection_token",null,{shouldDirty:!0}),I(Ce({uiType:"NPX",npxPackage:F.packageName}));return}if(s.startsWith("http://")||s.startsWith("https://")){const _=L==="HTTP"||L==="SSE"||L==="Websocket"?L:"HTTP";p.setValue("ui_type",_,{shouldDirty:!0}),p.setValue("connection_url",s,{shouldDirty:!0}),I(Ce({uiType:_,connectionUrl:s})??st({uiType:_,connectionUrl:s,registryItems:ke}));return}L==="NPX"&&I(Ce({uiType:"NPX",npxPackage:s}))},Tt=t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(P,{variant:"outline",onClick:yt,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})});return t.jsx(t.Fragment,{children:t.jsxs(ae,{children:[t.jsx(it,{open:Xe||m.mode==="editing",onOpenChange:Qe,children:t.jsxs(rt,{className:"sm:max-w-[525px]",children:[t.jsxs(ct,{children:[t.jsx(lt,{children:T?"Edit Connection":"Create Connection"}),t.jsx(at,{children:T?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),t.jsx(nn,{...p,children:t.jsxs("form",{onSubmit:p.handleSubmit(kt),children:[t.jsxs("div",{className:"grid gap-4 py-4",children:[t.jsx(M,{control:p.control,name:"ui_type",render:({field:n})=>t.jsxs(U,{children:[t.jsx(B,{children:"Type *"}),t.jsxs(sn,{value:n.value,onValueChange:n.onChange,children:[t.jsx(R,{children:t.jsx(on,{children:t.jsx(rn,{})})}),t.jsxs(cn,{children:[t.jsx(de,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(we,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(de,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(we,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(de,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(we,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(de,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(pe,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(de,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(gn,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(H,{})]})}),L==="NPX"&&t.jsx(t.Fragment,{children:t.jsx(M,{control:p.control,name:"npx_package",render:({field:n})=>t.jsxs(U,{children:[t.jsx(B,{children:"NPM Package *"}),t.jsx(R,{children:t.jsx(ne,{placeholder:"@perplexity-ai/mcp-server",...n,value:n.value??"",onPaste:s=>{const r=s.clipboardData.getData("text");r&&(s.preventDefault(),p.setValue("npx_package",r.trim(),{shouldDirty:!0}),ye(r))},onBlur:s=>{ye(s.target.value),n.onBlur()}})}),t.jsx(H,{})]})})}),L==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(M,{control:p.control,name:"stdio_command",render:({field:n})=>t.jsxs(U,{children:[t.jsx(B,{children:"Command *"}),t.jsx(R,{children:t.jsx(ne,{placeholder:"node, bun, python...",...n,value:n.value??""})}),t.jsx(H,{})]})}),t.jsx(M,{control:p.control,name:"stdio_args",render:({field:n})=>t.jsxs(U,{children:[t.jsx(B,{children:"Arguments"}),t.jsx(R,{children:t.jsx(ne,{placeholder:"arg1 arg2 --flag value",...n,value:n.value??""})}),t.jsx(H,{})]})})]}),t.jsx(M,{control:p.control,name:"stdio_cwd",render:({field:n})=>t.jsxs(U,{children:[t.jsx(B,{children:"Working Directory"}),t.jsx(R,{children:t.jsx(ne,{placeholder:"/path/to/project (optional)",...n,value:n.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(H,{})]})})]}),(L==="NPX"||L==="STDIO")&&t.jsx(M,{control:p.control,name:"env_vars",render:({field:n})=>t.jsxs(U,{children:[t.jsx(B,{children:"Environment Variables"}),t.jsx(R,{children:t.jsx(vn,{value:n.value??[],onChange:n.onChange})}),t.jsx(H,{})]})}),L!=="NPX"&&L!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(M,{control:p.control,name:"connection_url",render:({field:n})=>t.jsxs(U,{children:[t.jsx(B,{children:"URL *"}),t.jsx(R,{children:t.jsx(ne,{placeholder:"https://example.com/mcp",...n,value:n.value??"",onPaste:s=>{const r=s.clipboardData.getData("text");r&&(s.preventDefault(),p.setValue("connection_url",r.trim(),{shouldDirty:!0}),ye(r))},onBlur:s=>{ye(s.target.value),n.onBlur()}})}),t.jsx(H,{})]})}),t.jsx(M,{control:p.control,name:"connection_token",render:({field:n})=>t.jsxs(U,{children:[t.jsx(B,{children:ce?.token?.label??"Token (optional)"}),t.jsx(R,{children:t.jsx(ne,{type:"password",placeholder:ce?.token?.placeholder??"Bearer token or API key",...n,value:n.value??""})}),ce?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[ce.token.helperText,ce.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(H,{})]})})]}),t.jsx(M,{control:p.control,name:"title",render:({field:n})=>t.jsxs(U,{children:[t.jsx(B,{children:"Name *"}),t.jsx(R,{children:t.jsx(ne,{placeholder:"My Connection",...n})}),t.jsx(H,{})]})}),t.jsx(M,{control:p.control,name:"description",render:({field:n})=>t.jsxs(U,{children:[t.jsx(B,{children:"Description"}),t.jsx(R,{children:t.jsx(ln,{placeholder:"A brief description of this connection",rows:3,...n,value:n.value??""})}),t.jsx(H,{})]})})]}),t.jsxs(dt,{children:[t.jsx(P,{type:"button",variant:"outline",onClick:()=>Qe(!1),children:"Cancel"}),t.jsx(P,{type:"submit",disabled:p.formState.isSubmitting,className:"min-w-40",children:p.formState.isSubmitting?"Saving...":T?"Update Connection":"Create Connection"})]})]})})]})}),t.jsx(De,{open:m.mode==="deleting",onOpenChange:n=>!n&&f({type:"close"}),children:t.jsxs(Ie,{children:[t.jsxs(Pe,{children:[t.jsx($e,{children:"Delete Connection?"}),t.jsxs(Ee,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:m.mode==="deleting"&&m.connection.title}),"."]})]}),t.jsxs(Oe,{children:[t.jsx(Le,{children:"Cancel"}),t.jsx(Ve,{onClick:Nt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),t.jsx(De,{open:m.mode==="force-deleting",onOpenChange:n=>!n&&f({type:"close"}),children:t.jsxs(Ie,{children:[t.jsxs(Pe,{children:[t.jsx($e,{children:"Connection Used by Agents"}),t.jsx(Ee,{asChild:!0,children:t.jsxs("div",{children:[t.jsxs("p",{children:["The connection"," ",t.jsx("span",{className:"font-medium text-foreground",children:m.mode==="force-deleting"&&m.connection.title})," ","is currently used by the following agent(s):"," ",t.jsx("span",{className:"font-medium text-foreground",children:m.mode==="force-deleting"&&m.agentNames}),"."]}),t.jsx("p",{className:"mt-2",children:"Deleting this connection will remove it from those agents, which may impact existing workflows that depend on them."})]})})]}),t.jsxs(Oe,{children:[t.jsx(Le,{children:"Cancel"}),t.jsx(Ve,{onClick:_t,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]})]})}),t.jsx(Ln,{open:b,onOpenChange:k,count:v.size,onConfirm:Ct}),t.jsx(On,{open:D,onOpenChange:S,agents:X,onConfirm:St}),t.jsxs(ae.Header,{children:[t.jsx(ae.Header.Left,{children:t.jsx(Jt,{children:t.jsx(Zt,{children:t.jsx(en,{children:t.jsx(tn,{children:"Connections"})})})})}),t.jsxs(ae.Header.Right,{children:[t.jsx(Bt,{sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:G,onChange:n=>q(n||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:Q,onChange:n=>Y(n||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]}]}),Tt]})]}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("div",{children:t.jsx(Rt,{value:d.search,onChange:d.setSearch,placeholder:"Search for a Connection...",onKeyDown:n=>{n.key==="Escape"&&(d.setSearch(""),n.target.blur())}})}),t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border",children:[t.jsx(Ht,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:A,onTabChange:n=>O(n)}),Z.length>0&&t.jsx("div",{className:se(A!=="all"&&"invisible pointer-events-none"),children:t.jsxs(ze,{children:[t.jsx(Fe,{asChild:!0,children:t.jsxs(P,{variant:"outline",size:"sm",className:"h-7 px-2 gap-1.5 text-sm font-normal",children:[(()=>{const n=Z.find(s=>s.id===(ie||Z[0]?.id))??Z[0];return t.jsxs(t.Fragment,{children:[t.jsx(Ae,{icon:n?.icon,name:n?.title??"",size:"2xs",className:"shrink-0 rounded-sm"}),t.jsx("span",{children:n?.title})]})})(),t.jsx(xn,{size:14,className:"text-muted-foreground"})]})}),t.jsx(Me,{align:"end",children:Z.map(n=>t.jsxs(ue,{onClick:()=>xt(n.id),className:se(ie===n.id||!ie&&n.id===Z[0]?.id?"bg-accent":""),children:[t.jsx(Ae,{icon:n.icon,name:n.title,size:"2xs",className:"shrink-0 rounded-sm"}),n.title]},n.id))})]})})]})]}),t.jsx(ae.Content,{children:t.jsx("div",{className:"flex-1 overflow-auto p-5",children:(ee?xe.length===0&&fe.length===0&&z.length===0:A==="all"?xe.length===0&&fe.length===0:z.length===0)?t.jsx(Kt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:d.search?`No Connections match "${d.search}"`:"Create a connection to get started."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[jt.map(n=>{if(n.type==="group")return t.jsx(In,{group:n,onOpen:()=>{o({to:"/$org/$project/mcps/$appSlug",params:{org:i.slug,project:W,appSlug:n.key}})},selectionMode:g,selectedIds:v,onToggleSelect:J},n.key);const s=n.connection,r=v.has(s.id);return t.jsx(be,{connection:s,fallbackIcon:t.jsx(pe,{}),onClick:()=>g?J(s.id):o({to:"/$org/$project/mcps/$appSlug",params:{org:i.slug,project:W,appSlug:oe(s)}}),className:se(r&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[g?t.jsx(ot,{checked:r,onCheckedChange:()=>J(s.id),onClick:u=>u.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:se("overflow-hidden transition-all duration-150 ease-out",g?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(ze,{children:[t.jsx(Fe,{asChild:!0,children:t.jsx(P,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:u=>u.stopPropagation(),children:t.jsx(ut,{size:20})})}),t.jsxs(Me,{align:"end",onClick:u=>u.stopPropagation(),children:[t.jsxs(ue,{onClick:u=>{u.stopPropagation(),o({to:"/$org/$project/mcps/$appSlug",params:{org:i.slug,project:W,appSlug:oe(s)}})},children:[t.jsx(pt,{size:16}),"Open"]}),t.jsxs(ue,{onClick:u=>{u.stopPropagation(),J(s.id)},children:[t.jsx(mn,{size:16}),"Select"]}),t.jsxs(ue,{variant:"destructive",onClick:u=>{u.stopPropagation(),f({type:"delete",connection:s})},children:[t.jsx(mt,{size:16}),"Delete"]})]})]})})]})},s.id)}),A==="all"&&xe.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(hn,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"Verified"}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),xe.map(n=>{const s=n.server?.name||n.name||n.id||"",r=Be.has(s),u=n._meta?.["mcp.mesh"],j=u?.friendlyName||u?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",I=n.server?.description||n.description||null,F=n.server?.icons?.[0]?.src||et(n.server?.repository)||null,_=y.filter(w=>w.connection_type!=="VIRTUAL"&&w.app_name===s);return t.jsx(be,{connection:{title:j,description:I,icon:F},fallbackIcon:t.jsx(pe,{}),onClick:()=>{if(r){const w=_[0];w&&o({to:"/$org/$project/mcps/$appSlug",params:{org:i.slug,project:W,appSlug:oe(w)}})}else He(n)},headerActionsAlwaysVisible:!0,headerActions:r?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):t.jsx(P,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:ge!==null,onClick:w=>{w.stopPropagation(),Ke(n)},children:ge===n.id?t.jsx(Se,{size:14,className:"animate-spin"}):"Connect"})},`catalog-${n.id}`)}),A==="all"&&fe.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"All connections"}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),fe.map(n=>{const s=n.server?.name||n.name||n.id||"",r=Be.has(s),u=n._meta?.["mcp.mesh"],j=u?.friendlyName||u?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",I=n.server?.description||n.description||null,F=n.server?.icons?.[0]?.src||et(n.server?.repository)||null,_=y.filter(w=>w.connection_type!=="VIRTUAL"&&w.app_name===s);return t.jsx(be,{connection:{title:j,description:I,icon:F},fallbackIcon:t.jsx(pe,{}),onClick:()=>{if(r){const w=_[0];w&&o({to:"/$org/$project/mcps/$appSlug",params:{org:i.slug,project:W,appSlug:oe(w)}})}else He(n)},headerActionsAlwaysVisible:!0,headerActions:r?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):t.jsx(P,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:ge!==null,onClick:w=>{w.stopPropagation(),Ke(n)},children:ge===n.id?t.jsx(Se,{size:14,className:"animate-spin"}):"Connect"})},`catalog-${n.id}`)}),(A==="all"||ee)&&_e&&t.jsx("div",{ref:gt,className:"col-span-full h-4"}),(A==="all"||ee)&&re.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(Se,{size:24,className:"animate-spin text-muted-foreground"})})]})})}),g&&t.jsx(En,{count:v.size,total:z.length,onSelectAll:()=>{x(new Set(z.map(n=>n.id)))},onDeselectAll:()=>x(new Set),onDelete:()=>k(!0),onAddToAgent:()=>S(!0),onToggleStatus:bt,onCancel:he})]})})}function Gs(){const i=me.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(wt,{children:t.jsx(K.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Se,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Vn,{})})}),i[0]=e):e=i[0],e}export{Gs as default};
@@ -1 +0,0 @@
1
- import{c as n,j as i,R as g,D as c,F as u,T as m,G as x,H as j,J as N,I as b,ah as D}from"./index-DnJ6a24w.js";import{i as h}from"./X-BT_y3J3a.js";function C(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(N,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(b,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function w(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(u,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function T(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(m,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{C as D,w as a,T as b,B as c,E as d,R as e,k as f};
@@ -1 +0,0 @@
1
- import{c as A,u as W,g as D,f as X,K as Z,j as n,r as q,au as Q,B as ee,Q as te,bf as ne}from"./index-DnJ6a24w.js";import{i as v}from"./Loading01-DQphO9Su.js";import{c as ie}from"./binder-CuBUxi11.js";import{P as $}from"./topbar-portal-DLbOrsQP.js";import{u as se}from"./useQuery-mzOsnjYJ.js";import{b as oe}from"./use-connection-CNeKPAtP.js";import{a as le,u as re,f as ce}from"./constants-D5QZg84_.js";import{t as ae}from"./Settings01-B76KnDHb.js";import{P as E}from"./index-B09Yemt1.js";import"./use-collections-Le9CzDbY.js";import"./useMutation-Betr8yis.js";import"./tooltip-Csc3oeTz.js";import"./index-hCeFdkUk.js";function de(t,e){return t?t.filter(m=>ie(m,e)):[]}function R(t){return{id:t.id,title:t.title,icon:t.icon,description:t.description,app_name:t.app_name,app_id:t.app_id,tools:t.tools,metadata:t.metadata}}function me(t){const e=A.c(35),{binding:m,renderHeader:f,renderEmptyState:i}=t,{org:o,project:l}=W();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const{org:r,project:g,pluginId:u}=D(a),J=oe(),{data:y}=X.useSession();let b;e[1]!==o.id?(b={connectionId:le,orgId:o.id},e[1]=o.id,e[2]=b):b=e[2];const H=re(b);let x;e[3]!==u||e[4]!==l.id?(x=Z.projectPluginConfig(l.id??"",u),e[3]=u,e[4]=l.id,e[5]=x):x=e[5];let p;e[6]!==u||e[7]!==l.id||e[8]!==H?(p=async()=>{const s=await H.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:l.id,pluginId:u}});return s.structuredContent??s},e[6]=u,e[7]=l.id,e[8]=H,e[9]=p):p=e[9];const T=!!l.id&&!!u;let _;e[10]!==x||e[11]!==p||e[12]!==T?(_={queryKey:x,queryFn:p,enabled:T},e[10]=x,e[11]=p,e[12]=T,e[13]=_):_=e[13];const{data:U,isLoading:Y}=se(_),F=de(J,m),K=U?.config?.connectionId,j=K?F.find(s=>s.id===K):null,P=ce({connectionId:j?.id,orgId:o.id}),w=y?.user?{user:{id:y.user.id,name:y.user.name,email:y.user.email,image:y.user.image}}:null,z={id:o.id,slug:o.slug,name:o.name};if(Y){let s;return e[14]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),e[14]=s):s=e[14],s}if(F.length===0){const s={connectionId:null,connection:null,toolCaller:null,org:z,session:w};let c;e[15]!==i?(c=i(),e[15]=i,e[16]=c):c=e[16];let d;return e[17]!==c?(d=n.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:c}),e[17]=c,e[18]=d):d=e[18],n.jsx($,{value:s,children:d})}if(!j){const s={connectionId:null,connection:null,toolCaller:null,org:z,session:w};let c;e[19]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[n.jsx(ae,{size:48,className:"text-muted-foreground mb-2"}),n.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a connection to be configured. Go to project settings to select which integration to use."})]}),e[19]=c):c=e[19];const d=r??o.slug,O=g??l.slug??"";let L;return e[20]!==d||e[21]!==O?(L=n.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:[c,n.jsx(ee,{asChild:!0,children:n.jsx(te,{to:"/$org/$project/settings",params:{org:d,project:O},children:"Go to Project Settings"})})]}),e[20]=d,e[21]=O,e[22]=L):L=e[22],n.jsx($,{value:s,children:L})}let S;e[23]!==P?(S=(s,c)=>P?P.callTool({name:s,arguments:c}).then(fe):Promise.reject(new Error("MCP client is not available")),e[23]=P,e[24]=S):S=e[24];const V={connectionId:j.id,connection:R(j),toolCaller:S,org:z,session:w},B=E,G=E,k=E,M=f({connections:[R(j)],selectedConnectionId:j.id,onConnectionChange:ue});let h;e[25]!==M||e[26]!==k.Header.Left?(h=n.jsx(k.Header.Left,{children:M}),e[25]=M,e[26]=k.Header.Left,e[27]=h):h=e[27];let C;e[28]!==h||e[29]!==G.Header?(C=n.jsx(G.Header,{children:h}),e[28]=h,e[29]=G.Header,e[30]=C):C=e[30];let N;e[31]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(E.Content,{children:n.jsx(q.Suspense,{fallback:n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),children:n.jsx(Q,{})})}),e[31]=N):N=e[31];let I;return e[32]!==B||e[33]!==C?(I=n.jsxs(B,{children:[C,N]}),e[32]=B,e[33]=C,e[34]=I):I=e[34],n.jsx($,{value:V,children:I})}function ue(){}function fe(t){return t.structuredContent??t}function Le(){const t=A.c(12);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{pluginId:m}=D(e);let f;t[1]!==m?(f=ne.find(r=>r.id===m),t[1]=m,t[2]=f):f=t[2];const i=f;if(i?.renderHeader&&i?.renderEmptyState&&i?.binding){let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),t[3]=r):r=t[3];let g;return t[4]!==i.binding||t[5]!==i.renderEmptyState||t[6]!==i.renderHeader?(g=n.jsx(q.Suspense,{fallback:r,children:n.jsx(me,{binding:i.binding,renderHeader:i.renderHeader,renderEmptyState:i.renderEmptyState})}),t[4]=i.binding,t[5]=i.renderEmptyState,t[6]=i.renderHeader,t[7]=g):g=t[7],g}const o=i?.LayoutComponent;if(!o){let r;return t[8]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Q,{}),t[8]=r):r=t[8],r}let l;t[9]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),t[9]=l):l=t[9];let a;return t[10]!==o?(a=n.jsx(q.Suspense,{fallback:l,children:n.jsx(o,{})}),t[10]=o,t[11]=a):a=t[11],a}export{Le as default};
@@ -1,16 +0,0 @@
1
- import{c as R,r as A,D as E,j as t}from"./index-DnJ6a24w.js";import{i as de}from"./AlertCircle-QngH9BVd.js";import{i as ue}from"./CheckCircle-DDKCxiAn.js";import{n as Y}from"./ChevronLeft-BOF7bp9d.js";import{i as me}from"./Loading01-DQphO9Su.js";import{i as fe}from"./use-copy-CR_0d0zs.js";import{s as Z}from"./XClose-C-H07PEn.js";import{c as xe}from"./usage-BW6ztpN6.js";import{I as pe}from"./integration-icon-C9GR_8Ea.js";import{a as he,u as ge}from"./context-CGMT963w.js";function F(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}function ee(s){if(!s)return"—";const e=typeof s=="string"?new Date(s):s;return isNaN(e.getTime())?"—":e.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function be(s){return s?s.replace(/-\d{8}(?:-[a-z0-9]+)*$/i,"").replace(/-/g," "):"—"}function je(s){const e=R.c(4),{items:n}=s;let a;e[0]!==n?(a=n.map(ve),e[0]=n,e[1]=a):a=e[1];let r;return e[2]!==a?(r=t.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-6",children:a}),e[2]=a,e[3]=r):r=e[3],r}function ve(s){return t.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[t.jsx("span",{className:"text-xs text-muted-foreground truncate",children:s.label}),t.jsx("span",{className:"text-sm text-foreground tabular-nums truncate",children:s.value})]},s.label)}function Ne(s){const e=R.c(30),{userTokens:n,assistantTokens:a,otherTokens:r}=s,k=n+a+r,w=k>0?n/k*100:0,o=k>0?a/k*100:0,N=k>0?r/k*100:0;let u;e[0]!==w?(u=w>0&&t.jsx("div",{className:"h-full bg-chart-1",style:{width:`${w}%`}}),e[0]=w,e[1]=u):u=e[1];let g;e[2]!==o?(g=o>0&&t.jsx("div",{className:"h-full bg-chart-2",style:{width:`${o}%`}}),e[2]=o,e[3]=g):g=e[3];let v;e[4]!==N?(v=N>0&&t.jsx("div",{className:"h-full bg-muted-foreground/30",style:{width:`${N}%`}}),e[4]=N,e[5]=v):v=e[5];let h;e[6]!==u||e[7]!==g||e[8]!==v?(h=t.jsxs("div",{className:"flex h-2 w-full overflow-hidden rounded-full bg-muted",children:[u,g,v]}),e[6]=u,e[7]=g,e[8]=v,e[9]=h):h=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-1 shrink-0"}),e[10]=x):x=e[10];let c;e[11]!==w?(c=w.toFixed(1),e[11]=w,e[12]=c):c=e[12];let b;e[13]!==c?(b=t.jsxs("div",{className:"flex items-center gap-1.5",children:[x,t.jsxs("span",{className:"text-xs text-muted-foreground",children:["User ",c,"%"]})]}),e[13]=c,e[14]=b):b=e[14];let d;e[15]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-2 shrink-0"}),e[15]=d):d=e[15];let m;e[16]!==o?(m=o.toFixed(1),e[16]=o,e[17]=m):m=e[17];let f;e[18]!==m?(f=t.jsxs("div",{className:"flex items-center gap-1.5",children:[d,t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Assistant ",m,"%"]})]}),e[18]=m,e[19]=f):f=e[19];let l;e[20]!==N||e[21]!==r?(l=r>0&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-muted-foreground/30 shrink-0"}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Other ",N.toFixed(1),"%"]})]}),e[20]=N,e[21]=r,e[22]=l):l=e[22];let i;e[23]!==f||e[24]!==l||e[25]!==b?(i=t.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[b,f,l]}),e[23]=f,e[24]=l,e[25]=b,e[26]=i):i=e[26];let p;return e[27]!==i||e[28]!==h?(p=t.jsxs("div",{className:"flex flex-col gap-2",children:[h,i]}),e[27]=i,e[28]=h,e[29]=p):p=e[29],p}function Be(s){const e=R.c(61),{onClose:n,back:a,className:r}=s,[k,w]=A.useState(null),{messages:o,tasks:N,activeTaskId:u,model:g,selectedVirtualMcp:v,virtualMcps:h}=he();let x,c,b,d,m,f,l,i;if(e[0]!==u||e[1]!==a||e[2]!==r||e[3]!==o||e[4]!==g||e[5]!==n||e[6]!==k?.id||e[7]!==v?.title||e[8]!==N||e[9]!==h){i=Symbol.for("react.early_return_sentinel");e:{let $;e[18]!==u?($=j=>j.id===u,e[18]=u,e[19]=$):$=e[19];const L=N.find($),S=xe(o),D=g?.limits?.contextWindow??null,Q=D&&D>0?(S.totalTokens/D*100).toFixed(1):null,J=o;let P;e[20]!==J?(P=J.filter(Ce).reduce(_e,0),e[20]=J,e[21]=P):P=e[21];const U=P,V=o;let B;e[22]!==V?(B=V.filter(Se).reduce(Te,0),e[22]=V,e[23]=B):B=e[23];const O=B,H=Math.max(0,S.totalTokens-U-O),te=o[0],se=o.at(-1),ne=te?.metadata?.created_at??L?.created_at,le=se?.metadata?.created_at??L?.updated_at,W=o.filter(we);let K;e[24]!==h?(K=j=>(j.parts??[]).filter(ye).map(y=>{const _=y.input?.agent_id,C=_?h.find(ce=>ce.id===_):null,M=y.state==="input-streaming"||y.state==="input-available"||y.state==="output-available"&&y.preliminary===!0,z=y.state==="output-error",oe=y.state==="approval-requested";return{part:y,agentTitle:C?.title??"Subtask",agentIcon:C?.icon??null,isRunning:M,isError:z,isApproval:oe}}),e[24]=h,e[25]=K):K=e[25];const X=o.flatMap(K),ae=g?.modelId?be(g.modelId):"—",re=v?.title??"Decopilot",ie=[{label:"Session",value:L?.title??"New chat"},{label:"Messages",value:W.length},{label:"Agent",value:re},{label:"Model",value:ae},{label:"Context Limit",value:D?F(D):"—"},{label:"Total Tokens",value:S.totalTokens>0?F(S.totalTokens):"0"},{label:"Usage",value:Q!==null?`${Q}%`:"—"},{label:"Input Tokens",value:S.inputTokens>0?F(S.inputTokens):"0"},{label:"Output Tokens",value:S.outputTokens>0?F(S.outputTokens):"0"},{label:"Reasoning Tokens",value:S.reasoningTokens>0?F(S.reasoningTokens):"0"},{label:"Cost",value:S.cost>0?`$${S.cost<.001?S.cost.toFixed(6):S.cost.toFixed(4)}`:"$0.00"},{label:"Session Created",value:ee(ne)},{label:"Last Activity",value:ee(le)}];if(!L&&W.length===0){let j;e[26]!==r?(j=E("flex flex-col h-full w-full border-l border-border bg-background",r),e[26]=r,e[27]=j):j=e[27];let y;e[28]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Context"}),e[28]=y):y=e[28];let _;e[29]!==a?(_=a?t.jsx(Y,{size:14,className:"text-muted-foreground"}):t.jsx(Z,{size:14,className:"text-muted-foreground"}),e[29]=a,e[30]=_):_=e[30];let C;e[31]!==n||e[32]!==_?(C=t.jsxs("div",{className:"h-11 px-4 flex items-center justify-between shrink-0 border-b border-border/50",children:[y,t.jsx("button",{type:"button",onClick:n,className:"flex size-6 items-center justify-center rounded hover:bg-accent transition-colors",children:_})]}),e[31]=n,e[32]=_,e[33]=C):C=e[33];let M;e[34]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx("div",{className:"flex-1 flex items-center justify-center px-4 text-center",children:t.jsx("p",{className:"text-xs text-muted-foreground",children:"Start a conversation to see context"})}),e[34]=M):M=e[34];let z;e[35]!==j||e[36]!==C?(z=t.jsxs("div",{className:j,children:[C,M]}),e[35]=j,e[36]=C,e[37]=z):z=e[37],i=z;break e}e[38]!==r?(f=E("flex flex-col h-full w-full border-l border-border bg-background overflow-y-auto",r),e[38]=r,e[39]=f):f=e[39];let q;e[40]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Context"}),e[40]=q):q=e[40];let I;e[41]!==a?(I=a?t.jsx(Y,{size:14}):t.jsx(Z,{size:14}),e[41]=a,e[42]=I):I=e[42],e[43]!==n||e[44]!==I?(l=t.jsxs("div",{className:"flex h-11 shrink-0 items-center justify-between border-b border-border/50 px-4",children:[q,t.jsx("button",{type:"button",onClick:n,className:"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:I})]}),e[43]=n,e[44]=I,e[45]=l):l=e[45],x="flex flex-col gap-8 p-6",c=X.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Subtasks"}),t.jsx("div",{className:"flex flex-col gap-1",children:X.map(ke)})]}),b=t.jsx(je,{items:ie});let G;e[46]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx("span",{className:"text-xs text-muted-foreground",children:"Context Breakdown"}),e[46]=G):G=e[46],e[47]!==O||e[48]!==H||e[49]!==U?(d=t.jsxs("div",{className:"flex flex-col gap-3",children:[G,t.jsx(Ne,{userTokens:U,assistantTokens:O,otherTokens:H})]}),e[47]=O,e[48]=H,e[49]=U,e[50]=d):d=e[50],m=W.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Raw messages"}),t.jsx("div",{className:"flex flex-col gap-1",children:W.map(j=>{const y=j.metadata?.created_at,_=k?.id===j.id;return t.jsxs("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[t.jsxs("button",{type:"button",onClick:()=>w(_?null:j),className:"flex items-center justify-between gap-2 px-3 py-2 text-xs hover:bg-accent/50 w-full text-left cursor-pointer",children:[t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("span",{className:E("shrink-0 font-medium",j.role==="user"?"text-chart-1":"text-chart-2"),children:j.role}),t.jsx("span",{className:"text-muted-foreground",children:"•"}),t.jsx("span",{className:"truncate text-muted-foreground font-mono",children:j.id})]}),y&&t.jsx("span",{className:"shrink-0 text-muted-foreground tabular-nums",children:new Date(y).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})})]}),_&&t.jsx("pre",{className:"text-xs font-mono bg-muted px-3 py-2 overflow-auto whitespace-pre-wrap break-all border-t border-border/50 max-h-64",children:JSON.stringify(j,null,2)})]},j.id)})})]})}e[0]=u,e[1]=a,e[2]=r,e[3]=o,e[4]=g,e[5]=n,e[6]=k?.id,e[7]=v?.title,e[8]=N,e[9]=h,e[10]=x,e[11]=c,e[12]=b,e[13]=d,e[14]=m,e[15]=f,e[16]=l,e[17]=i}else x=e[10],c=e[11],b=e[12],d=e[13],m=e[14],f=e[15],l=e[16],i=e[17];if(i!==Symbol.for("react.early_return_sentinel"))return i;let p;e[51]!==x||e[52]!==c||e[53]!==b||e[54]!==d||e[55]!==m?(p=t.jsxs("div",{className:x,children:[c,b,d,m]}),e[51]=x,e[52]=c,e[53]=b,e[54]=d,e[55]=m,e[56]=p):p=e[56];let T;return e[57]!==f||e[58]!==l||e[59]!==p?(T=t.jsxs("div",{className:f,children:[l,p]}),e[57]=f,e[58]=l,e[59]=p,e[60]=T):T=e[60],T}function ke(s,e){return t.jsxs("div",{className:"flex items-center gap-2 text-xs min-w-0",children:[t.jsx(pe,{icon:s.agentIcon,name:s.agentTitle,size:"xs",className:"size-6 rounded-md shrink-0"}),t.jsx("span",{className:E("shrink-0 font-medium",s.isError?"text-destructive":"text-foreground"),children:s.agentTitle}),s.part.input?.prompt&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-muted-foreground/50",children:"·"}),t.jsx("span",{className:"truncate text-muted-foreground",children:s.part.input.prompt})]}),t.jsx("span",{className:"ml-auto shrink-0",children:s.isRunning?t.jsx(me,{size:12,className:"animate-spin text-muted-foreground"}):s.isError?t.jsx(fe,{size:12,className:"text-destructive"}):s.isApproval?t.jsx(de,{size:12,className:"text-warning"}):t.jsx(ue,{size:12,className:"text-emerald-500"})})]},e)}function ye(s){return s.type==="tool-subtask"}function we(s){return s.role!=="system"}function Te(s,e){const n=e.metadata?.usage;return s+(n?.outputTokens??0)}function Se(s){return s.role==="assistant"}function _e(s,e){const n=e.metadata?.usage;return s+(n?.inputTokens??0)}function Ce(s){return s.role==="user"}function $e(s){const e=R.c(22),{text:n,className:a,speed:r}=s,k=a===void 0?"":a,w=r===void 0?30:r,[o,N]=A.useState(!1),u=n.length/w*1e3,g=n.length,v=`${n.length}ch`;let h;e[0]!==u?(h=()=>{N(!1);const $=setTimeout(()=>{N(!0)},u);return()=>clearTimeout($)},e[0]=u,e[1]=h):h=e[1];let x;e[2]!==u||e[3]!==n?(x=[n,u],e[2]=u,e[3]=n,e[4]=x):x=e[4],A.useEffect(h,x);let c;e[5]!==k?(c=E(k,"block overflow-hidden inline-flex"),e[5]=k,e[6]=c):c=e[6];const b=`${u}ms`;let d;e[7]!==v||e[8]!==g||e[9]!==b?(d={"--typewriter-duration":b,"--typewriter-steps":g,"--typewriter-max-width":v},e[7]=v,e[8]=g,e[9]=b,e[10]=d):d=e[10];const m=d,f=o&&"truncate";let l;e[11]!==f?(l=E("typewriter-text",f),e[11]=f,e[12]=l):l=e[12];let i;e[13]!==l||e[14]!==n?(i=t.jsx("span",{className:l,children:n}),e[13]=l,e[14]=n,e[15]=i):i=e[15];let p;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("style",{children:`
2
- .typewriter-text {
3
- display: inline-block;
4
- width: 0;
5
- max-width: 100%;
6
- overflow: hidden;
7
- white-space: nowrap;
8
- animation: typewriter var(--typewriter-duration) steps(var(--typewriter-steps)) forwards;
9
- }
10
-
11
- @keyframes typewriter {
12
- to {
13
- width: min(var(--typewriter-max-width), 100%);
14
- }
15
- }
16
- `}),e[16]=p):p=e[16];let T;return e[17]!==i||e[18]!==c||e[19]!==m||e[20]!==n?(T=t.jsxs("span",{className:c,style:m,children:[i,p]},n),e[17]=i,e[18]=c,e[19]=m,e[20]=n,e[21]=T):T=e[21],T}function Oe(s){const e=R.c(27),{taskId:n,text:a,className:r}=s,[k,w]=A.useState(!1),[o,N]=A.useState(""),{renameTask:u}=ge();let g;e[0]!==a?(g=()=>{N(a),w(!0)},e[0]=a,e[1]=g):g=e[1];const v=g;let h;e[2]!==o||e[3]!==u||e[4]!==n||e[5]!==a?(h=async()=>{const l=o.trim();l&&l!==a&&await u(n,l),w(!1)},e[2]=o,e[3]=u,e[4]=n,e[5]=a,e[6]=h):h=e[6];const x=h;let c;e[7]!==x?(c=l=>{l.key==="Enter"?(l.preventDefault(),x()):l.key==="Escape"&&w(!1)},e[7]=x,e[8]=c):c=e[8];const b=c;if(k){let l;e[9]===Symbol.for("react.memo_cache_sentinel")?(l=$=>N($.target.value),e[9]=l):l=e[9];let i;e[10]!==x?(i=()=>x(),e[10]=x,e[11]=i):i=e[11];let p;e[12]!==r?(p=E(r,"bg-transparent border-b border-foreground/30 focus:border-foreground outline-none pb-0.5 min-w-0"),e[12]=r,e[13]=p):p=e[13];let T;return e[14]!==o||e[15]!==b||e[16]!==i||e[17]!==p?(T=t.jsx("input",{ref:Ee,value:o,onChange:l,onBlur:i,onKeyDown:b,className:p}),e[14]=o,e[15]=b,e[16]=i,e[17]=p,e[18]=T):T=e[18],T}let d;e[19]!==r?(d=E(r,"cursor-pointer truncate text-left"),e[19]=r,e[20]=d):d=e[20];let m;e[21]!==a?(m=t.jsx($e,{text:a}),e[21]=a,e[22]=m):m=e[22];let f;return e[23]!==v||e[24]!==d||e[25]!==m?(f=t.jsx("button",{type:"button",onClick:v,className:d,title:"Click to rename",children:m}),e[23]=v,e[24]=d,e[25]=m,e[26]=f):f=e[26],f}function Ee(s){s&&(s.focus(),s.select())}export{Be as C,Oe as E};
@@ -1 +0,0 @@
1
- import{r as S,c as p,w as P,z as R,D as j,j as f,g as E,at as L,B as D}from"./index-DnJ6a24w.js";import{u as H}from"./useQuery-mzOsnjYJ.js";import{u as I}from"./useMutation-Betr8yis.js";import{a as B,b as A,T as M}from"./tooltip-Csc3oeTz.js";const $=({size:s=24,color:e="currentColor",...t})=>S.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},S.createElement("path",{d:"M8 9.5h4M8 13h7m-3 8a9 9 0 1 0-8.342-5.616c.081.2.122.3.14.381a.907.907 0 0 1 .024.219c0 .083-.015.173-.045.353l-.593 3.558c-.062.373-.093.56-.035.694a.5.5 0 0 0 .262.262c.135.058.321.027.694-.035l3.558-.593c.18-.03.27-.045.353-.045.081 0 .14.006.219.024.08.018.18.059.38.14A8.973 8.973 0 0 0 12 21Z"}));$.displayName="MessageTextCircle02";function Q(s){try{return JSON.parse(s)}catch{return}}function y(s,e){const t=localStorage.getItem(s),o=t?Q(t):void 0,n=typeof e=="function"?e(o):o??e;if(o===void 0||n!==o)try{const l=JSON.stringify(n);localStorage.setItem(s,l)}catch{}return n}function q(s,e){const t=p.c(25),o=P();let n;t[0]!==s?(n=["localStorage",s],t[0]=s,t[1]=n):n=t[1];const l=n;let u,d;t[2]!==e||t[3]!==s?(u=()=>y(s,e),d=()=>y(s,e),t[2]=e,t[3]=s,t[4]=u,t[5]=d):(u=t[4],d=t[5]);let h;t[6]!==l||t[7]!==u||t[8]!==d?(h={queryKey:l,queryFn:u,initialData:d,staleTime:1/0,gcTime:1/0},t[6]=l,t[7]=u,t[8]=d,t[9]=h):h=t[9];const{data:a}=H(h);let r;t[10]!==s?(r=async x=>{const C=JSON.stringify(x);return localStorage.setItem(s,C),x},t[10]=s,t[11]=r):r=t[11];let i;t[12]!==o||t[13]!==l?(i=x=>{o.setQueryData(l,x)},t[12]=o,t[13]=l,t[14]=i):i=t[14];let c;t[15]!==r||t[16]!==i?(c={mutationFn:r,onSuccess:i},t[15]=r,t[16]=i,t[17]=c):c=t[17];const m=I(c);let g;t[18]!==m||t[19]!==o||t[20]!==l?(g=x=>{const C=o.getQueryData(l),w=typeof x=="function"?x(C):x;m.mutate(w)},t[18]=m,t[19]=o,t[20]=l,t[21]=g):g=t[21];const N=g,b=a;let v;return t[22]!==N||t[23]!==b?(v=[b,N],t[22]=N,t[23]=b,t[24]=v):v=t[24],v}function F(){const s=p.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=R.decoChatOpen(),s[0]=e):e=s[0];const[t,o]=q(e,J);let n;return s[1]!==t||s[2]!==o?(n=[t,o],s[1]=t,s[2]=o,s[3]=n):n=s[3],n}function J(s){return!!(s??!0)}function T(s,e){const t=S.Children.toArray(s);for(const o of t)if(S.isValidElement(o)&&o.type===e)return o;return null}function K(){const s=p.c(12),[e,t]=F();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},s[0]=o):o=s[0];const{org:n,project:l}=E(o),{location:u}=L();if(u.pathname===`/${n}/${l}`||u.pathname===`/${n}/${l}/`)return null;const h=e&&"bg-accent text-foreground";let a;s[1]!==h?(a=j("h-7 px-2 gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground",h),s[1]=h,s[2]=a):a=s[2];let r;s[3]!==t?(r=()=>t(G),s[3]=t,s[4]=r):r=s[4];let i;s[5]===Symbol.for("react.memo_cache_sentinel")?(i=f.jsx($,{size:14,className:"text-inherit"}),s[5]=i):i=s[5];let c;s[6]!==a||s[7]!==r?(c=f.jsx(B,{asChild:!0,children:f.jsxs(D,{variant:"ghost",className:a,onClick:r,"aria-label":"Toggle Decopilot",children:[i,"Chat"]})}),s[6]=a,s[7]=r,s[8]=c):c=s[8];let m;s[9]===Symbol.for("react.memo_cache_sentinel")?(m=f.jsx(A,{side:"bottom",children:"Toggle Decopilot"}),s[9]=m):m=s[9];let g;return s[10]!==c?(g=f.jsxs(M,{children:[c,m]}),s[10]=c,s[11]=g):g=s[11],g}function G(s){return!s}function V(s){const e=p.c(5),{children:t,className:o}=s;let n;e[0]!==o?(n=j("flex flex-col h-full bg-background overflow-hidden",o),e[0]=o,e[1]=n):n=e[1];let l;return e[2]!==t||e[3]!==n?(l=f.jsx("div",{className:n,children:t}),e[2]=t,e[3]=n,e[4]=l):l=e[4],l}function W(s){const e=p.c(17),{children:t,className:o,hideSidebarTrigger:n}=s;let l;e[0]!==t?(l=T(t,O),e[0]=t,e[1]=l):l=e[1];const u=l;let d;e[2]!==t?(d=T(t,_),e[2]=t,e[3]=d):d=e[3];const h=d;let a;e[4]!==o?(a=j("shrink-0 w-full border-b border-border/50 h-11 overflow-x-auto","flex items-center justify-between gap-3 pr-2 pl-4 min-w-max",o),e[4]=o,e[5]=a):a=e[5];let r;e[6]!==u?(r=f.jsx("div",{className:"flex items-center gap-1",children:u}),e[6]=u,e[7]=r):r=e[7];let i;e[8]!==n?(i=!n&&f.jsx("div",{className:"flex items-center pl-2 ml-1",children:f.jsx(K,{})}),e[8]=n,e[9]=i):i=e[9];let c;e[10]!==h||e[11]!==i?(c=f.jsxs("div",{className:"flex items-center",children:[h,i]}),e[10]=h,e[11]=i,e[12]=c):c=e[12];let m;return e[13]!==a||e[14]!==r||e[15]!==c?(m=f.jsxs("div",{className:a,children:[r,c]}),e[13]=a,e[14]=r,e[15]=c,e[16]=m):m=e[16],m}function O(s){const e=p.c(5),{children:t,className:o}=s;let n;e[0]!==o?(n=j("flex items-center gap-2 shrink-0 overflow-hidden",o),e[0]=o,e[1]=n):n=e[1];let l;return e[2]!==t||e[3]!==n?(l=f.jsx("div",{className:n,children:t}),e[2]=t,e[3]=n,e[4]=l):l=e[4],l}function _(s){const e=p.c(5),{children:t,className:o}=s;let n;e[0]!==o?(n=j("flex items-center gap-2 shrink-0 overflow-hidden",o),e[0]=o,e[1]=n):n=e[1];let l;return e[2]!==t||e[3]!==n?(l=f.jsx("div",{className:n,children:t}),e[2]=t,e[3]=n,e[4]=l):l=e[4],l}function Y(s){const e=p.c(5),{children:t,className:o}=s;let n;e[0]!==o?(n=j("flex-1 overflow-auto",o),e[0]=o,e[1]=n):n=e[1];let l;return e[2]!==t||e[3]!==n?(l=f.jsx("div",{className:n,children:t}),e[2]=t,e[3]=n,e[4]=l):l=e[4],l}const z=Object.assign(V,{Header:Object.assign(W,{Left:O,Right:_}),Content:Y});export{z as P,F as a,q as u};