decocms 2.311.1 → 2.311.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 (370) hide show
  1. package/dist/client/assets/{AlertCircle-GVxuU95v.js → AlertCircle-Djr0yelP.js} +1 -1
  2. package/dist/client/assets/Archive-B6lPEYxi.js +1 -0
  3. package/dist/client/assets/{ArrowNarrowLeft-CZSxj8rY.js → ArrowNarrowLeft-B291p1AJ.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-C9_9n6RS.js → ArrowUpRight-D7KqTERk.js} +1 -1
  5. package/dist/client/assets/{Check-B7RZVj2P.js → Check-D_Sk8fW_.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-CpSCTcKF.js → CheckCircle-D__FA05W.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-PN1FfGGP.js → ChevronDown-BHCo5V9J.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-B87-4gCD.js → ChevronRight-CRGY6QAO.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-DXZ6bMcP.js → ChevronUp-Dh2SiOy7.js} +1 -1
  10. package/dist/client/assets/{Container-Bn1bP0Yi.js → Container-AP8CnyxW.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-0NEZeBK_.js → DotsVertical-UTS9GjI-.js} +1 -1
  12. package/dist/client/assets/{LinkExternal01-Cl6M9_6y.js → LinkExternal01-Cc9uLqLU.js} +1 -1
  13. package/dist/client/assets/{Lock01-BNDVtNp3.js → Lock01-BInejH64.js} +1 -1
  14. package/dist/client/assets/{Palette-BgYWS9GS.js → Palette-Cec1fhMz.js} +1 -1
  15. package/dist/client/assets/{Play-jAQMD8Zy.js → Play-CD_ssz5Z.js} +1 -1
  16. package/dist/client/assets/{Plus-Decn041v.js → Plus-B4euBFog.js} +1 -1
  17. package/dist/client/assets/{RefreshCcw01-2tEGwXNO.js → RefreshCcw01-Si3lBRwB.js} +1 -1
  18. package/dist/client/assets/{SearchMd-xzJx66s8.js → SearchMd-BTCLJcfn.js} +1 -1
  19. package/dist/client/assets/{Settings02-I39qsUEU.js → Settings02-sgH7ThhT.js} +1 -1
  20. package/dist/client/assets/{Shield01-DJsSZNak.js → Shield01-D8ZeQllE.js} +1 -1
  21. package/dist/client/assets/{Star01-VbAdZ1nM.js → Star01-PFBfwZmt.js} +1 -1
  22. package/dist/client/assets/{Sun-qACU13Q-.js → Sun-Dmea943O.js} +1 -1
  23. package/dist/client/assets/{Tool01-BqlBf1k7.js → Tool01-BbF2IYpq.js} +1 -1
  24. package/dist/client/assets/{Trash01-BqSCZqrj.js → Trash01-BnzFHXhZ.js} +1 -1
  25. package/dist/client/assets/{User01-w8zyOHhj.js → User01-zskaKHnK.js} +1 -1
  26. package/dist/client/assets/{Users03-n9zzJAad.js → Users03-CAzWDWnm.js} +1 -1
  27. package/dist/client/assets/{X-Cwv9W6IH.js → X-BUuYjVOr.js} +1 -1
  28. package/dist/client/assets/{XCircle-VMAL-xhy.js → XCircle-Cpz3G2Fy.js} +1 -1
  29. package/dist/client/assets/{XClose-GzEq-HU9.js → XClose-CxVVWp02.js} +1 -1
  30. package/dist/client/assets/{Zap-D93qKeqm.js → Zap-DFgntoN3.js} +1 -1
  31. package/dist/client/assets/{ZapSquare-CGJC1mww.js → ZapSquare-Wx3jz5Tc.js} +1 -1
  32. package/dist/client/assets/{accordion-ZNyW-Q9t.js → accordion-BYb7H8aV.js} +1 -1
  33. package/dist/client/assets/agent-icon-DaRK55X4.js +1 -0
  34. package/dist/client/assets/agents-list-Njc6Ihfs.js +1 -0
  35. package/dist/client/assets/ai-providers-DG6unL_s.js +1 -0
  36. package/dist/client/assets/{alert-dialog-7vNv5N4P.js → alert-dialog-YgpjeFBi.js} +1 -1
  37. package/dist/client/assets/{auth-catchall-DnPh1GEo.js → auth-catchall-Baccjd7f.js} +1 -1
  38. package/dist/client/assets/{automation-list-row-Cu-q04m4.js → automation-list-row-BgjnRst-.js} +1 -1
  39. package/dist/client/assets/automations-qM7fZ2dj.js +1 -0
  40. package/dist/client/assets/{avatar-Dda8SxzC.js → avatar-hRilkYOJ.js} +1 -1
  41. package/dist/client/assets/{badge-C_Ey5yTa.js → badge-iirFQ7GR.js} +1 -1
  42. package/dist/client/assets/{brand-context-pyqxXmJT.js → brand-context-hd8DfZZU.js} +1 -1
  43. package/dist/client/assets/{card-BqDVz8rB.js → card-cHMjszpI.js} +1 -1
  44. package/dist/client/assets/{chat-context-B6Fg09sU.js → chat-context-Cy40hP4t.js} +1 -1
  45. package/dist/client/assets/{checkbox-CwdZbdGd.js → checkbox-CPHwkQHL.js} +1 -1
  46. package/dist/client/assets/collection-detail-FxMRS6mC.js +1 -0
  47. package/dist/client/assets/{collection-display-button-QyBcFXO8.js → collection-display-button-CPoat98b.js} +1 -1
  48. package/dist/client/assets/{collection-search-FuJrX0DL.js → collection-search-CIGPBaze.js} +1 -1
  49. package/dist/client/assets/{collection-search-BPpIzKqG.js → collection-search-CR78v4di.js} +1 -1
  50. package/dist/client/assets/{collection-table-wrapper-k2i9yb0q.js → collection-table-wrapper-CL80nO8c.js} +1 -1
  51. package/dist/client/assets/{collection-tabs-Bbxi3Lhu.js → collection-tabs-C8ox2neK.js} +1 -1
  52. package/dist/client/assets/{collections-BXMI7Hvf.js → collections-DR6QX0g8.js} +1 -1
  53. package/dist/client/assets/{command-CcKs3phr.js → command-DYSstTLW.js} +1 -1
  54. package/dist/client/assets/{connection-card-C9ObrVFa.js → connection-card-DsBbhPLN.js} +1 -1
  55. package/dist/client/assets/connection-detail-C6Ik3Wf9.js +1 -0
  56. package/dist/client/assets/{connection-form-helpers-CLWU-iGL.js → connection-form-helpers-DMG8tqrx.js} +1 -1
  57. package/dist/client/assets/connections-BW8j-u1P.js +1 -0
  58. package/dist/client/assets/{constants-DNYERMOq.js → constants--Kj7N7Rc.js} +1 -1
  59. package/dist/client/assets/{constants-Bad0DdgK.js → constants-DLNEkVVr.js} +1 -1
  60. package/dist/client/assets/{dialog-BcmogFZk.js → dialog-Dp6SjScf.js} +1 -1
  61. package/dist/client/assets/{domain-settings-QGlFO294.js → domain-settings-B3U_rk2M.js} +1 -1
  62. package/dist/client/assets/{drawer-CFDUaOVL.js → drawer-Dj1GMxa5.js} +1 -1
  63. package/dist/client/assets/{dropdown-menu-NvUf9a-j.js → dropdown-menu-BDd-gW8V.js} +1 -1
  64. package/dist/client/assets/{dynamic-plugin-layout-CNm9aSBE.js → dynamic-plugin-layout-BodVTgJQ.js} +1 -1
  65. package/dist/client/assets/{empty-state-Dg7DOfxH.js → empty-state-AMhKur12.js} +1 -1
  66. package/dist/client/assets/{empty-state-CYPi3AWF.js → empty-state-DxvERlOW.js} +1 -1
  67. package/dist/client/assets/{extract-connection-data-Crk93y-a.js → extract-connection-data-VXHFUQo9.js} +1 -1
  68. package/dist/client/assets/{features-c-yBM4_h.js → features-DH1UiJjP.js} +1 -1
  69. package/dist/client/assets/{form-BbDiaTsN.js → form-BRvMkkP1.js} +1 -1
  70. package/dist/client/assets/general-CycS6aGM.js +1 -0
  71. package/dist/client/assets/index-B-nub_pG.js +1 -0
  72. package/dist/client/assets/index-BKx3kD7f.js +1 -0
  73. package/dist/client/assets/{index--qrsfEvC.js → index-BLv-cdPp.js} +1 -1
  74. package/dist/client/assets/{index-D-aGIpWM.js → index-BPQPyblE.js} +1 -1
  75. package/dist/client/assets/{index-D3w8D7D3.js → index-BQnGdGlJ.js} +1 -1
  76. package/dist/client/assets/{index-CvwiLDhg.js → index-BaDn_qVG.js} +1 -1
  77. package/dist/client/assets/{index-D5c2Coqp.js → index-BrSAblDg.js} +3 -3
  78. package/dist/client/assets/{index-C3btaY0r.js → index-BwedVtm-.js} +1 -1
  79. package/dist/client/assets/index-COdHP6Q3.js +1 -0
  80. package/dist/client/assets/{index-Bom1zwxj.js → index-Co3saKmd.js} +1 -1
  81. package/dist/client/assets/{index-CLSBe_a4.js → index-Csxq5TaF.js} +3 -3
  82. package/dist/client/assets/{index-Dl4CZy6K.js → index-DO-glgQy.js} +1 -1
  83. package/dist/client/assets/{index-DDUZQ_xH.js → index-DOA4SrfQ.js} +1 -1
  84. package/dist/client/assets/{index-BEwswwod.js → index-DPJfdHEd.js} +1 -1
  85. package/dist/client/assets/{index-DmMHdsYF.js → index-DX8mbjh7.js} +1 -1
  86. package/dist/client/assets/{index-B3GjV7OW.js → index-bRd2N9NF.js} +2 -2
  87. package/dist/client/assets/{infiniteQueryObserver-RMKX6Nq0.js → infiniteQueryObserver-CnJpGer_.js} +1 -1
  88. package/dist/client/assets/{input-bkK8ZE7l.js → input-BTQWcFvQ.js} +1 -1
  89. package/dist/client/assets/{integration-icon-dKiJ5-c6.js → integration-icon-WB0OmEvR.js} +1 -1
  90. package/dist/client/assets/{label-DTMz5O44.js → label-CPA2JEF_.js} +1 -1
  91. package/dist/client/assets/{layout-LMk5O_ZK.js → layout-C5KSdgqD.js} +1 -1
  92. package/dist/client/assets/{lean-canvas-recruit-modal-BAnvgszw.js → lean-canvas-recruit-modal-ZidRtiZv.js} +1 -1
  93. package/dist/client/assets/{login-DL4UCCOO.js → login-0DiwXQ07.js} +1 -1
  94. package/dist/client/assets/{members-xgiddo21.js → members-CGEe_jgB.js} +1 -1
  95. package/dist/client/assets/{monaco-editor-C2N0lO8-.js → monaco-editor-CUE47pML.js} +1 -1
  96. package/dist/client/assets/{monitoring-stats-row-B1WEuAdI.js → monitoring-stats-row-BUjCCtKk.js} +1 -1
  97. package/dist/client/assets/{oauth-callback-CEDkVwJ-.js → oauth-callback-C-ARMuSr.js} +1 -1
  98. package/dist/client/assets/{oauth-callback-ai-provider-Dg9MI2Au.js → oauth-callback-ai-provider-DjFgFE3U.js} +1 -1
  99. package/dist/client/assets/{onboarding-DkXotH-C.js → onboarding-k_gmP2Yu.js} +1 -1
  100. package/dist/client/assets/{org-layout-BZIyzExD.js → org-layout-Dvh2ntLI.js} +1 -1
  101. package/dist/client/assets/{org-plugin-layout-DMO9tynz.js → org-plugin-layout-DzCMBblD.js} +1 -1
  102. package/dist/client/assets/{pair-Cbmyley2.js → pair-D6rD7fr2.js} +1 -1
  103. package/dist/client/assets/{plugin-empty-state-9QQH63Km.js → plugin-empty-state-BqXWLtpY.js} +1 -1
  104. package/dist/client/assets/{plugin-header-Ca6fhiCD.js → plugin-header-BdbZaEVL.js} +1 -1
  105. package/dist/client/assets/{plugin-layout-CL9tTgtN.js → plugin-layout-Bl3EIv-G.js} +1 -1
  106. package/dist/client/assets/{popover-a3tMurU4.js → popover-C3FfRLrj.js} +1 -1
  107. package/dist/client/assets/{profile-D7pjioBj.js → profile-CPBbsaIb.js} +1 -1
  108. package/dist/client/assets/project-app-view-DTxderr7.js +1 -0
  109. package/dist/client/assets/registry-BBi9tAZj.js +2 -0
  110. package/dist/client/assets/{registry-layout-BaWcD2qA.js → registry-layout-DVg-9Eqy.js} +1 -1
  111. package/dist/client/assets/{required-auth-layout-CnaH9rpW.js → required-auth-layout-C9lzuc8k.js} +1 -1
  112. package/dist/client/assets/{reset-password-vwj49aZP.js → reset-password-DLrTOlbf.js} +1 -1
  113. package/dist/client/assets/roles-Bnz4P9Nd.js +1 -0
  114. package/dist/client/assets/{scroll-area-DqbokeCV.js → scroll-area-O5xhqGH1.js} +1 -1
  115. package/dist/client/assets/{search-input-DAsaTE5l.js → search-input-DuGXmYx0.js} +1 -1
  116. package/dist/client/assets/{select-Dli7sWvO.js → select-AY7V13tM.js} +1 -1
  117. package/dist/client/assets/{select-model-BaOTlcuq.js → select-model-BLwMpS9o.js} +1 -1
  118. package/dist/client/assets/{settings-layout-CjXYIm0R.js → settings-layout-D1OyozIx.js} +1 -1
  119. package/dist/client/assets/{settings-section-DBJaYBiY.js → settings-section-DGvq5eIp.js} +1 -1
  120. package/dist/client/assets/shell-layout-DRaEFGZF.js +1 -0
  121. package/dist/client/assets/{skeleton-H0I9mnBy.js → skeleton-ChSm4-0Y.js} +1 -1
  122. package/dist/client/assets/{sso-DYCaqBsm.js → sso-DLh4eigD.js} +1 -1
  123. package/dist/client/assets/{store-uDsU3GrB.js → store-CD5Y3l5z.js} +1 -1
  124. package/dist/client/assets/store-registry-Bx4Ds4sC.js +2 -0
  125. package/dist/client/assets/{switch-BdqZBTdM.js → switch-CX4qY3Ex.js} +1 -1
  126. package/dist/client/assets/{table-DK414n0F.js → table-Ddn8Rk3D.js} +1 -1
  127. package/dist/client/assets/{tabs-CeGpUpHP.js → tabs-D_nT4WLa.js} +1 -1
  128. package/dist/client/assets/{task-status-CqDAnW9H.js → task-status-PH7-Db6I.js} +1 -1
  129. package/dist/client/assets/{textarea-DYbvm35p.js → textarea-DTqKy4Qo.js} +1 -1
  130. package/dist/client/assets/{toggle-group-DXYK5Kmg.js → toggle-group-BsH3LUCe.js} +1 -1
  131. package/dist/client/assets/{tools-list-DQqEXfVG.js → tools-list-D2J7xK-u.js} +1 -1
  132. package/dist/client/assets/{tooltip-M7OSSLPB.js → tooltip-C4ZEvlyV.js} +1 -1
  133. package/dist/client/assets/{types-aUaKAv-0.js → types-PLyAutgi.js} +1 -1
  134. package/dist/client/assets/{use-ai-providers-CmHinIUs.js → use-ai-providers-D3jfy3JG.js} +1 -1
  135. package/dist/client/assets/{use-collections-Cy_Omosv.js → use-collections-BjgqvYm5.js} +1 -1
  136. package/dist/client/assets/{use-connection-BTNmhjS_.js → use-connection-CnyB1HmP.js} +1 -1
  137. package/dist/client/assets/{use-copy-CkkAJAvS.js → use-copy-LWIhILMp.js} +1 -1
  138. package/dist/client/assets/{use-create-virtual-mcp-BuaKZJs7.js → use-create-virtual-mcp-BpvlQZOX.js} +1 -1
  139. package/dist/client/assets/{use-debounced-autosave-CO57B6nX.js → use-debounced-autosave-CUv7GNdN.js} +1 -1
  140. package/dist/client/assets/{use-decopilot-events-CQ1IkvCh.js → use-decopilot-events-ChvTdIEw.js} +1 -1
  141. package/dist/client/assets/{use-delete-connection-6dZbEpz0.js → use-delete-connection-B_f0W-1P.js} +1 -1
  142. package/dist/client/assets/{use-infinite-scroll-ZPBLdFp5.js → use-infinite-scroll-DWQh3C6u.js} +1 -1
  143. package/dist/client/assets/{use-list-state-C6g9hGA4.js → use-list-state-CMD-drLp.js} +1 -1
  144. package/dist/client/assets/{use-mcp-tools-BxVuuTSL.js → use-mcp-tools-DlRwbAwV.js} +1 -1
  145. package/dist/client/assets/{use-members-Bi_cxyIQ.js → use-members-CeKeJ90-.js} +1 -1
  146. package/dist/client/assets/{use-navigate-to-agent-CSPyzm0t.js → use-navigate-to-agent-Bt6KkuQa.js} +1 -1
  147. package/dist/client/assets/{use-org-auth-client-C0e9yR_n.js → use-org-auth-client-CzTb1zcb.js} +1 -1
  148. package/dist/client/assets/{use-org-sso-BBRAkASE.js → use-org-sso-BMiHKoas.js} +1 -1
  149. package/dist/client/assets/{use-organization-roles-C1ELHN87.js → use-organization-roles-DlEsf5iu.js} +1 -1
  150. package/dist/client/assets/{use-organization-settings-DTcFJGZh.js → use-organization-settings-Bf-vFUZQ.js} +1 -1
  151. package/dist/client/assets/{use-registry-connections-BTwHNugi.js → use-registry-connections-DRem4U8m.js} +1 -1
  152. package/dist/client/assets/{use-status-sounds-DtamCVeq.js → use-status-sounds-BC1BnHmH.js} +1 -1
  153. package/dist/client/assets/{use-tasks-B6YSkeM5.js → use-tasks-BjbhO8fX.js} +1 -1
  154. package/dist/client/assets/{use-view-mode-BT7njn-W.js → use-view-mode-oJ3yWL7K.js} +1 -1
  155. package/dist/client/assets/{use-virtual-mcp-CSMhsIFC.js → use-virtual-mcp-Btinsi9b.js} +1 -1
  156. package/dist/client/assets/useInfiniteQuery-C4SiH59h.js +1 -0
  157. package/dist/client/assets/useSuspenseInfiniteQuery-Bt_Lb_HW.js +1 -0
  158. package/dist/client/assets/{user-D3wZendk.js → user-CNjw2T7L.js} +1 -1
  159. package/dist/client/assets/{view-mode-toggle-DrXoiKTK.js → view-mode-toggle-CXuPC9E_.js} +1 -1
  160. package/dist/client/assets/workflow-DJA0XTVK.js +1 -0
  161. package/dist/client/assets/workflow-detail-C4-Dradv.js +1 -0
  162. package/dist/client/index.html +1 -1
  163. package/dist/server/cli.js +8 -4
  164. package/dist/server/node_modules/ansi-styles/index.d.ts +236 -0
  165. package/dist/server/node_modules/ansi-styles/index.js +223 -0
  166. package/dist/server/node_modules/ansi-styles/license +9 -0
  167. package/dist/server/node_modules/ansi-styles/package.json +54 -0
  168. package/dist/server/node_modules/ansi-styles/readme.md +173 -0
  169. package/dist/server/node_modules/convert-to-spaces/dist/index.d.ts +2 -0
  170. package/dist/server/node_modules/convert-to-spaces/dist/index.js +4 -0
  171. package/dist/server/node_modules/convert-to-spaces/license +21 -0
  172. package/dist/server/node_modules/convert-to-spaces/package.json +40 -0
  173. package/dist/server/node_modules/convert-to-spaces/readme.md +39 -0
  174. package/dist/server/node_modules/environment/index.d.ts +74 -0
  175. package/dist/server/node_modules/environment/index.js +47 -0
  176. package/dist/server/node_modules/environment/license +9 -0
  177. package/dist/server/node_modules/environment/package.json +74 -0
  178. package/dist/server/node_modules/environment/readme.md +94 -0
  179. package/dist/server/node_modules/escape-string-regexp/index.d.ts +18 -0
  180. package/dist/server/node_modules/escape-string-regexp/index.js +11 -0
  181. package/dist/server/node_modules/escape-string-regexp/license +9 -0
  182. package/dist/server/node_modules/escape-string-regexp/package.json +43 -0
  183. package/dist/server/node_modules/escape-string-regexp/readme.md +29 -0
  184. package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
  185. package/dist/server/node_modules/is-fullwidth-code-point/index.js +12 -0
  186. package/dist/server/node_modules/is-fullwidth-code-point/license +9 -0
  187. package/dist/server/node_modules/is-fullwidth-code-point/package.json +53 -0
  188. package/dist/server/node_modules/is-fullwidth-code-point/readme.md +31 -0
  189. package/dist/server/node_modules/is-unicode-supported/index.d.ts +12 -0
  190. package/dist/server/node_modules/is-unicode-supported/index.js +21 -0
  191. package/dist/server/node_modules/is-unicode-supported/license +9 -0
  192. package/dist/server/node_modules/is-unicode-supported/package.json +47 -0
  193. package/dist/server/node_modules/is-unicode-supported/readme.md +35 -0
  194. package/dist/server/node_modules/mimic-fn/index.d.ts +54 -0
  195. package/dist/server/node_modules/mimic-fn/index.js +13 -0
  196. package/dist/server/node_modules/mimic-fn/license +9 -0
  197. package/dist/server/node_modules/mimic-fn/package.json +42 -0
  198. package/dist/server/node_modules/mimic-fn/readme.md +69 -0
  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-int8/LICENSE +13 -0
  218. package/dist/server/node_modules/pg-int8/README.md +16 -0
  219. package/dist/server/node_modules/pg-int8/index.js +100 -0
  220. package/dist/server/node_modules/pg-int8/package.json +24 -0
  221. package/dist/server/node_modules/pg-pool/LICENSE +21 -0
  222. package/dist/server/node_modules/pg-pool/README.md +357 -0
  223. package/dist/server/node_modules/pg-pool/esm/index.mjs +5 -0
  224. package/dist/server/node_modules/pg-pool/index.js +517 -0
  225. package/dist/server/node_modules/pg-pool/package.json +51 -0
  226. package/dist/server/node_modules/pg-protocol/LICENSE +21 -0
  227. package/dist/server/node_modules/pg-protocol/README.md +3 -0
  228. package/dist/server/node_modules/pg-protocol/dist/b.d.ts +1 -0
  229. package/dist/server/node_modules/pg-protocol/dist/b.js +23 -0
  230. package/dist/server/node_modules/pg-protocol/dist/b.js.map +1 -0
  231. package/dist/server/node_modules/pg-protocol/dist/buffer-reader.d.ts +15 -0
  232. package/dist/server/node_modules/pg-protocol/dist/buffer-reader.js +55 -0
  233. package/dist/server/node_modules/pg-protocol/dist/buffer-reader.js.map +1 -0
  234. package/dist/server/node_modules/pg-protocol/dist/buffer-writer.d.ts +16 -0
  235. package/dist/server/node_modules/pg-protocol/dist/buffer-writer.js +81 -0
  236. package/dist/server/node_modules/pg-protocol/dist/buffer-writer.js.map +1 -0
  237. package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.d.ts +1 -0
  238. package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.js +530 -0
  239. package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.js.map +1 -0
  240. package/dist/server/node_modules/pg-protocol/dist/index.d.ts +6 -0
  241. package/dist/server/node_modules/pg-protocol/dist/index.js +15 -0
  242. package/dist/server/node_modules/pg-protocol/dist/index.js.map +1 -0
  243. package/dist/server/node_modules/pg-protocol/dist/messages.d.ts +162 -0
  244. package/dist/server/node_modules/pg-protocol/dist/messages.js +160 -0
  245. package/dist/server/node_modules/pg-protocol/dist/messages.js.map +1 -0
  246. package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.d.ts +1 -0
  247. package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.js +252 -0
  248. package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.js.map +1 -0
  249. package/dist/server/node_modules/pg-protocol/dist/parser.d.ts +24 -0
  250. package/dist/server/node_modules/pg-protocol/dist/parser.js +324 -0
  251. package/dist/server/node_modules/pg-protocol/dist/parser.js.map +1 -0
  252. package/dist/server/node_modules/pg-protocol/dist/serializer.d.ts +42 -0
  253. package/dist/server/node_modules/pg-protocol/dist/serializer.js +189 -0
  254. package/dist/server/node_modules/pg-protocol/dist/serializer.js.map +1 -0
  255. package/dist/server/node_modules/pg-protocol/esm/index.js +11 -0
  256. package/dist/server/node_modules/pg-protocol/package.json +45 -0
  257. package/dist/server/node_modules/pg-protocol/src/b.ts +25 -0
  258. package/dist/server/node_modules/pg-protocol/src/buffer-reader.ts +58 -0
  259. package/dist/server/node_modules/pg-protocol/src/buffer-writer.ts +85 -0
  260. package/dist/server/node_modules/pg-protocol/src/inbound-parser.test.ts +575 -0
  261. package/dist/server/node_modules/pg-protocol/src/index.ts +11 -0
  262. package/dist/server/node_modules/pg-protocol/src/messages.ts +262 -0
  263. package/dist/server/node_modules/pg-protocol/src/outbound-serializer.test.ts +276 -0
  264. package/dist/server/node_modules/pg-protocol/src/parser.ts +413 -0
  265. package/dist/server/node_modules/pg-protocol/src/serializer.ts +274 -0
  266. package/dist/server/node_modules/pg-protocol/src/testing/buffer-list.ts +67 -0
  267. package/dist/server/node_modules/pg-protocol/src/testing/test-buffers.ts +166 -0
  268. package/dist/server/node_modules/pg-protocol/src/types/chunky.d.ts +1 -0
  269. package/dist/server/node_modules/pg-types/.travis.yml +7 -0
  270. package/dist/server/node_modules/pg-types/Makefile +14 -0
  271. package/dist/server/node_modules/pg-types/README.md +75 -0
  272. package/dist/server/node_modules/pg-types/index.d.ts +137 -0
  273. package/dist/server/node_modules/pg-types/index.js +47 -0
  274. package/dist/server/node_modules/pg-types/index.test-d.ts +21 -0
  275. package/dist/server/node_modules/pg-types/lib/arrayParser.js +11 -0
  276. package/dist/server/node_modules/pg-types/lib/binaryParsers.js +257 -0
  277. package/dist/server/node_modules/pg-types/lib/builtins.js +73 -0
  278. package/dist/server/node_modules/pg-types/lib/textParsers.js +215 -0
  279. package/dist/server/node_modules/pg-types/package.json +42 -0
  280. package/dist/server/node_modules/pg-types/test/index.js +24 -0
  281. package/dist/server/node_modules/pg-types/test/types.js +597 -0
  282. package/dist/server/node_modules/pgpass/README.md +74 -0
  283. package/dist/server/node_modules/pgpass/lib/helper.js +233 -0
  284. package/dist/server/node_modules/pgpass/lib/index.js +23 -0
  285. package/dist/server/node_modules/pgpass/package.json +41 -0
  286. package/dist/server/node_modules/postgres-array/index.d.ts +4 -0
  287. package/dist/server/node_modules/postgres-array/index.js +97 -0
  288. package/dist/server/node_modules/postgres-array/license +21 -0
  289. package/dist/server/node_modules/postgres-array/package.json +35 -0
  290. package/dist/server/node_modules/postgres-array/readme.md +43 -0
  291. package/dist/server/node_modules/postgres-bytea/index.js +33 -0
  292. package/dist/server/node_modules/postgres-bytea/license +21 -0
  293. package/dist/server/node_modules/postgres-bytea/package.json +34 -0
  294. package/dist/server/node_modules/postgres-bytea/readme.md +34 -0
  295. package/dist/server/node_modules/postgres-date/index.js +116 -0
  296. package/dist/server/node_modules/postgres-date/license +21 -0
  297. package/dist/server/node_modules/postgres-date/package.json +33 -0
  298. package/dist/server/node_modules/postgres-date/readme.md +49 -0
  299. package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
  300. package/dist/server/node_modules/postgres-interval/index.js +125 -0
  301. package/dist/server/node_modules/postgres-interval/license +21 -0
  302. package/dist/server/node_modules/postgres-interval/package.json +36 -0
  303. package/dist/server/node_modules/postgres-interval/readme.md +48 -0
  304. package/dist/server/node_modules/restore-cursor/index.d.ts +11 -0
  305. package/dist/server/node_modules/restore-cursor/index.js +11 -0
  306. package/dist/server/node_modules/restore-cursor/license +9 -0
  307. package/dist/server/node_modules/restore-cursor/package.json +55 -0
  308. package/dist/server/node_modules/restore-cursor/readme.md +31 -0
  309. package/dist/server/node_modules/split2/LICENSE +13 -0
  310. package/dist/server/node_modules/split2/README.md +85 -0
  311. package/dist/server/node_modules/split2/bench.js +27 -0
  312. package/dist/server/node_modules/split2/index.js +141 -0
  313. package/dist/server/node_modules/split2/package.json +39 -0
  314. package/dist/server/node_modules/split2/test.js +409 -0
  315. package/dist/server/node_modules/string-width/index.d.ts +39 -0
  316. package/dist/server/node_modules/string-width/index.js +82 -0
  317. package/dist/server/node_modules/string-width/license +9 -0
  318. package/dist/server/node_modules/string-width/package.json +64 -0
  319. package/dist/server/node_modules/string-width/readme.md +66 -0
  320. package/dist/server/node_modules/xtend/.jshintrc +30 -0
  321. package/dist/server/node_modules/xtend/LICENSE +20 -0
  322. package/dist/server/node_modules/xtend/README.md +32 -0
  323. package/dist/server/node_modules/xtend/immutable.js +19 -0
  324. package/dist/server/node_modules/xtend/mutable.js +17 -0
  325. package/dist/server/node_modules/xtend/package.json +55 -0
  326. package/dist/server/node_modules/xtend/test.js +103 -0
  327. package/dist/server/server.js +203 -199
  328. package/package.json +1 -1
  329. package/dist/client/assets/agent-icon-zc2fqM1k.js +0 -1
  330. package/dist/client/assets/agents-list-UtLvJq-k.js +0 -1
  331. package/dist/client/assets/ai-providers-CfDd4KX1.js +0 -1
  332. package/dist/client/assets/automations-CU2EtM_4.js +0 -1
  333. package/dist/client/assets/collection-detail-WOE1iHbK.js +0 -1
  334. package/dist/client/assets/connection-detail-DXmyznni.js +0 -1
  335. package/dist/client/assets/connections-EFejJy4T.js +0 -1
  336. package/dist/client/assets/general-BxBx3E8g.js +0 -1
  337. package/dist/client/assets/index-BVe-IL8_.js +0 -1
  338. package/dist/client/assets/index-bUNQ5NEg.js +0 -1
  339. package/dist/client/assets/index-rnnpRGp3.js +0 -1
  340. package/dist/client/assets/project-app-view-BhV2wKdY.js +0 -1
  341. package/dist/client/assets/registry-CWfZJmtj.js +0 -2
  342. package/dist/client/assets/roles-DphWxHYt.js +0 -1
  343. package/dist/client/assets/shell-layout-BMRtkmni.js +0 -1
  344. package/dist/client/assets/store-registry-CBTBvJpl.js +0 -2
  345. package/dist/client/assets/useInfiniteQuery-96c4mtDU.js +0 -1
  346. package/dist/client/assets/useSuspenseInfiniteQuery-HyWQwfY6.js +0 -1
  347. package/dist/client/assets/workflow-BfcwUbw-.js +0 -1
  348. package/dist/client/assets/workflow-detail-C0BgSrtB.js +0 -1
  349. package/dist/server/node_modules/pg/README.md +0 -95
  350. package/dist/server/node_modules/pg/esm/index.mjs +0 -20
  351. package/dist/server/node_modules/pg/lib/client.js +0 -743
  352. package/dist/server/node_modules/pg/lib/connection-parameters.js +0 -171
  353. package/dist/server/node_modules/pg/lib/connection.js +0 -221
  354. package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +0 -122
  355. package/dist/server/node_modules/pg/lib/crypto/sasl.js +0 -212
  356. package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +0 -43
  357. package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +0 -89
  358. package/dist/server/node_modules/pg/lib/crypto/utils.js +0 -9
  359. package/dist/server/node_modules/pg/lib/defaults.js +0 -91
  360. package/dist/server/node_modules/pg/lib/index.js +0 -73
  361. package/dist/server/node_modules/pg/lib/native/client.js +0 -323
  362. package/dist/server/node_modules/pg/lib/native/index.js +0 -2
  363. package/dist/server/node_modules/pg/lib/native/query.js +0 -165
  364. package/dist/server/node_modules/pg/lib/query.js +0 -252
  365. package/dist/server/node_modules/pg/lib/result.js +0 -109
  366. package/dist/server/node_modules/pg/lib/stream.js +0 -83
  367. package/dist/server/node_modules/pg/lib/type-overrides.js +0 -35
  368. package/dist/server/node_modules/pg/lib/utils.js +0 -217
  369. package/dist/server/node_modules/pg/package.json +0 -76
  370. /package/dist/server/node_modules/{pg → pg-cloudflare}/LICENSE +0 -0
@@ -1 +0,0 @@
1
- import{e as ge,P as ke,j as s,B as pe,s as Ae,r as P,t as w,x as we}from"./index-B3GjV7OW.js";import{c as U,b as Ce,a as ue,D as xe}from"./dropdown-menu-NvUf9a-j.js";import{a as Pe}from"./Users03-n9zzJAad.js";import{G as Te,a as Me,I as Oe,S as ze,L as Le,b as Ie}from"./lean-canvas-recruit-modal-BAnvgszw.js";import{W as Ee,b as Ge}from"./constants-Bad0DdgK.js";import{b as Be,a as He}from"./use-virtual-mcp-CSMhsIFC.js";import{P as ne}from"./index-Bom1zwxj.js";import{i as $e}from"./DotsVertical-0NEZeBK_.js";import{a as Re}from"./Settings02-I39qsUEU.js";import{s as Fe}from"./Trash01-BqSCZqrj.js";import{A as ve,ah as Ve}from"./agent-icon-zc2fqM1k.js";import{a as be}from"./use-navigate-to-agent-CSPyzm0t.js";import{C as Ne}from"./card-BqDVz8rB.js";import{f as We}from"./formatDistanceToNow-Cb2QZZJn.js";import{E as Ke}from"./empty-state-CYPi3AWF.js";import{u as qe}from"./use-create-virtual-mcp-BuaKZJs7.js";import{c as Je,b as Qe,d as Ue,f as Xe,e as Ye,g as Ze,a as et,A as tt}from"./alert-dialog-7vNv5N4P.js";import{S as st}from"./search-input-DAsaTE5l.js";import{s as je}from"./Plus-Decn041v.js";import"./Check-B7RZVj2P.js";import"./ChevronRight-B87-4gCD.js";import"./dialog-BcmogFZk.js";import"./X-Cwv9W6IH.js";import"./RefreshCcw01-2tEGwXNO.js";import"./collection-search-FuJrX0DL.js";import"./SearchMd-xzJx66s8.js";import"./checkbox-CwdZbdGd.js";import"./use-connection-BTNmhjS_.js";import"./use-collections-Cy_Omosv.js";import"./Lock01-BNDVtNp3.js";import"./extract-connection-data-Crk93y-a.js";import"./constants-DNYERMOq.js";import"./collections-BXMI7Hvf.js";import"./drawer-CFDUaOVL.js";import"./tooltip-M7OSSLPB.js";import"./integration-icon-dKiJ5-c6.js";import"./Container-Bn1bP0Yi.js";import"./use-mcp-tools-BxVuuTSL.js";import"./AlertCircle-GVxuU95v.js";import"./Tool01-BqlBf1k7.js";import"./XClose-GzEq-HU9.js";import"./ArrowNarrowLeft-CZSxj8rY.js";import"./XCircle-VMAL-xhy.js";import"./ArrowUpRight-C9_9n6RS.js";import"./ZapSquare-CGJC1mww.js";import"./CheckCircle-CpSCTcKF.js";import"./ChevronDown-PN1FfGGP.js";import"./ChevronUp-DXZ6bMcP.js";import"./Star01-VbAdZ1nM.js";import"./Palette-BgYWS9GS.js";import"./LinkExternal01-Cl6M9_6y.js";import"./Sun-qACU13Q-.js";import"./Play-jAQMD8Zy.js";import"./Shield01-DJsSZNak.js";import"./User01-w8zyOHhj.js";import"./Zap-D93qKeqm.js";import"./differenceInSeconds-NQ4PDo0z.js";function _e(e){const t=ge.c(17),{onCreateFromScratch:i,onImportGitHub:g,onImportDeco:d,isCreating:o,align:j,side:f,showBetaBadge:p}=e,a=j===void 0?"end":j,[n]=ke();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Pe,{size:14}),t[0]=u):u=t[0];let c;t[1]!==o||t[2]!==i?(c=s.jsxs(U,{disabled:o,onClick:i,children:[u,"Create from scratch"]}),t[1]=o,t[2]=i,t[3]=c):c=t[3];let r;t[4]!==g||t[5]!==n.experimental_vibecode||t[6]!==p?(r=n.experimental_vibecode&&s.jsxs(U,{onClick:g,children:[s.jsx(Te,{className:"size-3.5"}),"Import from GitHub",p&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"})]}),t[4]=g,t[5]=n.experimental_vibecode,t[6]=p,t[7]=r):r=t[7];let x;t[8]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),t[8]=x):x=t[8];let m;t[9]!==d?(m=s.jsxs(U,{onClick:d,children:[x,"Import from deco.cx"]}),t[9]=d,t[10]=m):m=t[10];let _;return t[11]!==a||t[12]!==f||t[13]!==c||t[14]!==r||t[15]!==m?(_=s.jsxs(Ce,{side:f,align:a,className:"w-48",children:[c,r,m]}),t[11]=a,t[12]=f,t[13]=c,t[14]=r,t[15]=m,t[16]=_):_=t[16],_}function it(e){const t=ge.c(44),{project:i,onDeleteClick:g}=e,d=be();let o;t[0]!==d||t[1]!==i.id?(o=()=>d(i.id),t[0]=d,t[1]=i.id,t[2]=o):o=t[2];let j;t[3]!==i.title||t[4]!==o?(j=s.jsx("button",{type:"button",onClick:o,className:"absolute inset-0 z-0","aria-label":i.title}),t[3]=i.title,t[4]=o,t[5]=j):j=t[5];let f;t[6]!==i.icon||t[7]!==i.title?(f=s.jsx(ve,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),t[6]=i.icon,t[7]=i.title,t[8]=f):f=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ue,{asChild:!0,children:s.jsx(pe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx($e,{size:20})})}),t[9]=p):p=t[9];let a;t[10]!==d||t[11]!==i.id?(a=()=>d(i.id,{search:{main:"settings"}}),t[10]=d,t[11]=i.id,t[12]=a):a=t[12];let n;t[13]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Re,{size:16}),t[13]=n):n=t[13];let u;t[14]!==a?(u=s.jsxs(U,{onClick:a,children:[n,"Settings"]}),t[14]=a,t[15]=u):u=t[15];let c;t[16]!==g?(c=g&&s.jsxs(U,{variant:"destructive",onClick:y=>{y.stopPropagation(),g(y)},children:[s.jsx(Fe,{size:16}),"Delete"]}),t[16]=g,t[17]=c):c=t[17];let r;t[18]!==u||t[19]!==c?(r=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(xe,{children:[p,s.jsxs(Ce,{align:"end",children:[u,c]})]})}),t[18]=u,t[19]=c,t[20]=r):r=t[20];let x;t[21]!==f||t[22]!==r?(x=s.jsxs("div",{className:"flex items-start justify-between",children:[f,r]}),t[21]=f,t[22]=r,t[23]=x):x=t[23];let m;t[24]!==i.title?(m=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),t[24]=i.title,t[25]=m):m=t[25];const _=i.description||"No description";let N;t[26]!==_?(N=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:_}),t[26]=_,t[27]=N):N=t[27];let v;t[28]!==m||t[29]!==N?(v=s.jsxs("div",{className:"flex flex-col gap-1",children:[m,N]}),t[28]=m,t[29]=N,t[30]=v):v=t[30];let D;t[31]!==x||t[32]!==v?(D=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[x,v]}),t[31]=x,t[32]=v,t[33]=D):D=t[33];let b;t[34]!==i.updated_at?(b=We(new Date(i.updated_at),{addSuffix:!0}),t[34]=i.updated_at,t[35]=b):b=t[35];let S;t[36]!==b?(S=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:b})})}),t[36]=b,t[37]=S):S=t[37];let h;t[38]!==D||t[39]!==S?(h=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[D,S]}),t[38]=D,t[39]=S,t[40]=h):h=t[40];let C;return t[41]!==h||t[42]!==j?(C=s.jsxs(Ne,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[j,h]}),t[41]=h,t[42]=j,t[43]=C):C=t[43],C}function ms(){const e=ge.c(80),{org:t}=Ae(),i=Be(),g=He(),d=be(),[o,j]=P.useState("");let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},e[0]=f):f=e[0];const{createVirtualMCP:p,isCreating:a}=qe(f),[n,u]=P.useState(null),[c,r]=P.useState(!1),[x,m]=P.useState(!1),[_,N]=P.useState(!1),[v,D]=P.useState(!1),[b,S]=P.useState(!1);let h,C,y,T,k,A,M,O,z;if(e[1]!==g||e[2]!==i||e[3]!==p||e[4]!==n||e[5]!==a||e[6]!==d||e[7]!==t||e[8]!==o){const Q=o.toLowerCase(),de=i.filter(l=>l.id!==t.id&&(l.title.toLowerCase().includes(Q)||l.description?.toLowerCase().includes(Q)));let te;e[18]!==i?(te=i.some(rt),e[18]=i,e[19]=te):te=e[19];const De=te,fe=Ee.filter(l=>(!o||l.title.toLowerCase().includes(Q))&&!(l.id==="studio-pack"&&De)),he=i.find(ot);k=i.find(lt);const Se=l=>{w("agents_list_template_clicked",{template_id:l}),l==="site-editor"?r(!0):l==="site-diagnostics"?he?d(he.id):N(!0):l==="lean-canvas"?k?d(k.id):S(!0):l==="studio-pack"&&D(!0)};let se;e[20]!==g||e[21]!==n?(se=async()=>{if(!n)return;const{id:l,title:ye}=n;u(null);try{await g.delete.mutateAsync(l),w("agent_deleted",{agent_id:l,source:"agents_list"}),we.success(`Deleted "${ye}"`)}catch{}},e[20]=g,e[21]=n,e[22]=se):se=e[22],T=se,y=ne,C=ne.Content,h=ne.Body;let ie;e[23]===Symbol.for("react.memo_cache_sentinel")?(ie=s.jsx(ne.Title,{children:"Agents"}),e[23]=ie):ie=e[23];let le;e[24]===Symbol.for("react.memo_cache_sentinel")?(le=l=>{l.key==="Escape"&&(j(""),l.target.blur())},e[24]=le):le=e[24];let K;e[25]!==o?(K=s.jsx(st,{value:o,onChange:j,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:le}),e[25]=o,e[26]=K):K=e[26];let oe;e[27]===Symbol.for("react.memo_cache_sentinel")?(oe=s.jsx(ue,{asChild:!0,children:s.jsxs(pe,{size:"sm",children:[s.jsx(je,{size:14}),"Create Agent"]})}),e[27]=oe):oe=e[27];let q;e[28]!==p?(q=()=>{w("agent_create_clicked",{source:"agents_list",method:"scratch"}),p()},e[28]=p,e[29]=q):q=e[29];let re,ae;e[30]===Symbol.for("react.memo_cache_sentinel")?(re=()=>{w("agent_create_clicked",{source:"agents_list",method:"github"}),m(!0)},ae=()=>{w("agent_create_clicked",{source:"agents_list",method:"deco"}),r(!0)},e[30]=re,e[31]=ae):(re=e[30],ae=e[31]);let J;e[32]!==a||e[33]!==q?(J=s.jsxs(xe,{children:[oe,s.jsx(_e,{onCreateFromScratch:q,onImportGitHub:re,onImportDeco:ae,isCreating:a,align:"end"})]}),e[32]=a,e[33]=q,e[34]=J):J=e[34],e[35]!==J||e[36]!==K?(A=s.jsxs("div",{className:"flex flex-col gap-6",children:[ie,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[K,J]})]}),e[35]=J,e[36]=K,e[37]=A):A=e[37],M=de.length===0&&fe.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Ke,{image:s.jsx(Ve,{size:48,className:"text-muted-foreground"}),title:o?"No agents found":"No agents yet",description:o?`No agents match "${o}"`:"Create an agent to get started.",actions:!o&&s.jsxs(xe,{children:[s.jsx(ue,{asChild:!0,children:s.jsxs(pe,{size:"sm",children:[s.jsx(je,{size:14}),"Create Agent"]})}),s.jsx(_e,{onCreateFromScratch:()=>{w("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),p()},onImportGitHub:()=>{w("agent_create_clicked",{source:"agents_list_empty",method:"github"}),m(!0)},onImportDeco:()=>{w("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),r(!0)},isCreating:a,align:"center",showBetaBadge:!0})]})})}),O=de.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:de.map(l=>s.jsx(it,{project:l,onDeleteClick:()=>u({id:l.id,title:l.title})},l.id))})]}),z=fe.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agent Templates"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:fe.map(l=>s.jsx(Ne,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50 cursor-pointer",onClick:()=>Se(l.id),children:s.jsx("div",{className:"flex flex-col flex-1",children:s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[s.jsx(ve,{icon:l.icon,name:l.title,size:"sm",className:"shrink-0 shadow-sm"}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:l.title}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Click to set up"})]})]})})},l.id))})]}),e[1]=g,e[2]=i,e[3]=p,e[4]=n,e[5]=a,e[6]=d,e[7]=t,e[8]=o,e[9]=h,e[10]=C,e[11]=y,e[12]=T,e[13]=k,e[14]=A,e[15]=M,e[16]=O,e[17]=z}else h=e[9],C=e[10],y=e[11],T=e[12],k=e[13],A=e[14],M=e[15],O=e[16],z=e[17];let L;e[38]!==h||e[39]!==A||e[40]!==M||e[41]!==O||e[42]!==z?(L=s.jsxs(h,{children:[A,M,O,z]}),e[38]=h,e[39]=A,e[40]=M,e[41]=O,e[42]=z,e[43]=L):L=e[43];let I;e[44]!==C||e[45]!==L?(I=s.jsx(C,{children:L}),e[44]=C,e[45]=L,e[46]=I):I=e[46];let E;e[47]!==x?(E=s.jsx(Me,{open:x,onOpenChange:m}),e[47]=x,e[48]=E):E=e[48];let G;e[49]!==c?(G=s.jsx(Oe,{open:c,onOpenChange:r}),e[49]=c,e[50]=G):G=e[50];let B;e[51]!==_?(B=s.jsx(ze,{open:_,onOpenChange:N}),e[51]=_,e[52]=B):B=e[52];let H;e[53]!==k||e[54]!==b?(H=s.jsx(Le,{open:b,onOpenChange:S,existingAgent:k}),e[53]=k,e[54]=b,e[55]=H):H=e[55];let $;e[56]!==v?($=s.jsx(Ie,{open:v,onOpenChange:D}),e[56]=v,e[57]=$):$=e[57];const ce=!!n;let X;e[58]===Symbol.for("react.memo_cache_sentinel")?(X=Q=>!Q&&u(null),e[58]=X):X=e[58];let Y;e[59]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx(Je,{children:"Delete Agent?"}),e[59]=Y):Y=e[59];const me=n?.title;let R;e[60]!==me?(R=s.jsxs(Qe,{children:[Y,s.jsxs(Ue,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:me}),"."]})]}),e[60]=me,e[61]=R):R=e[61];let Z;e[62]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx(Xe,{children:"Cancel"}),e[62]=Z):Z=e[62];let F;e[63]!==T?(F=s.jsxs(Ye,{children:[Z,s.jsx(Ze,{onClick:T,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[63]=T,e[64]=F):F=e[64];let V;e[65]!==R||e[66]!==F?(V=s.jsxs(et,{children:[R,F]}),e[65]=R,e[66]=F,e[67]=V):V=e[67];let W;e[68]!==ce||e[69]!==V?(W=s.jsx(tt,{open:ce,onOpenChange:X,children:V}),e[68]=ce,e[69]=V,e[70]=W):W=e[70];let ee;return e[71]!==y||e[72]!==H||e[73]!==$||e[74]!==W||e[75]!==I||e[76]!==E||e[77]!==G||e[78]!==B?(ee=s.jsxs(y,{children:[I,E,G,B,H,$,W]}),e[71]=y,e[72]=H,e[73]=$,e[74]=W,e[75]=I,e[76]=E,e[77]=G,e[78]=B,e[79]=ee):ee=e[79],ee}function lt(e){return e.metadata?.type==="lean-canvas"}function ot(e){return e.metadata?.type==="site-diagnostics"}function rt(e){return Ge(e.id)}export{ms as default};
@@ -1 +0,0 @@
1
- import{e as t,j as i}from"./index-B3GjV7OW.js";import{O as m}from"./select-model-BaOTlcuq.js";import"./checkbox-CwdZbdGd.js";import"./Check-B7RZVj2P.js";import"./input-bkK8ZE7l.js";import"./dialog-BcmogFZk.js";import"./X-Cwv9W6IH.js";import"./drawer-CFDUaOVL.js";import"./tooltip-M7OSSLPB.js";import"./select-Dli7sWvO.js";import"./ChevronDown-PN1FfGGP.js";import"./ChevronUp-DXZ6bMcP.js";import"./skeleton-H0I9mnBy.js";import"./Tool01-BqlBf1k7.js";import"./RefreshCcw01-2tEGwXNO.js";import"./SearchMd-xzJx66s8.js";import"./Settings02-I39qsUEU.js";import"./use-ai-providers-CmHinIUs.js";import"./constants-Bad0DdgK.js";import"./chat-context-B6Fg09sU.js";import"./use-virtual-mcp-CSMhsIFC.js";import"./use-collections-Cy_Omosv.js";import"./use-decopilot-events-CQ1IkvCh.js";import"./create-sse-subscription-CxkOgzKf.js";import"./use-tasks-B6YSkeM5.js";import"./use-organization-settings-DTcFJGZh.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Zap-D93qKeqm.js";import"./use-debounced-autosave-CO57B6nX.js";import"./AlertCircle-GVxuU95v.js";import"./CheckCircle-CpSCTcKF.js";import"./Trash01-BqSCZqrj.js";import"./index-Bom1zwxj.js";import"./settings-section-DBJaYBiY.js";import"./card-BqDVz8rB.js";import"./ArrowUpRight-C9_9n6RS.js";import"./switch-BdqZBTdM.js";import"./toggle-group-DXYK5Kmg.js";import"./avatar-Dda8SxzC.js";import"./User01-w8zyOHhj.js";import"./alert-dialog-7vNv5N4P.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./unwrap-tool-result-BYXdCQMg.js";function V(){const o=t.c(1);let r;return o[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(m,{}),o[0]=r):r=o[0],r}export{V as default};
@@ -1 +0,0 @@
1
- import{e as L,s as R,f as T,r as M,j as e,B as $,t as A}from"./index-B3GjV7OW.js";import{s as D}from"./Plus-Decn041v.js";import{i as S}from"./Zap-D93qKeqm.js";import{S as O}from"./search-input-DAsaTE5l.js";import{P as p}from"./index-Bom1zwxj.js";import{E as b}from"./empty-state-CYPi3AWF.js";import{c as V,A as q}from"./automation-list-row-Cu-q04m4.js";import{a as F}from"./use-navigate-to-agent-CSPyzm0t.js";import{e as G}from"./constants-Bad0DdgK.js";import{b as H}from"./use-virtual-mcp-CSMhsIFC.js";import"./SearchMd-xzJx66s8.js";import"./tooltip-M7OSSLPB.js";import"./X-Cwv9W6IH.js";import"./alert-dialog-7vNv5N4P.js";import"./dropdown-menu-NvUf9a-j.js";import"./Check-B7RZVj2P.js";import"./ChevronRight-B87-4gCD.js";import"./DotsVertical-0NEZeBK_.js";import"./agent-icon-zc2fqM1k.js";import"./AlertCircle-GVxuU95v.js";import"./Tool01-BqlBf1k7.js";import"./XClose-GzEq-HU9.js";import"./RefreshCcw01-2tEGwXNO.js";import"./ArrowNarrowLeft-CZSxj8rY.js";import"./XCircle-VMAL-xhy.js";import"./ArrowUpRight-C9_9n6RS.js";import"./ZapSquare-CGJC1mww.js";import"./Users03-n9zzJAad.js";import"./CheckCircle-CpSCTcKF.js";import"./ChevronDown-PN1FfGGP.js";import"./ChevronUp-DXZ6bMcP.js";import"./Container-Bn1bP0Yi.js";import"./Star01-VbAdZ1nM.js";import"./Palette-BgYWS9GS.js";import"./LinkExternal01-Cl6M9_6y.js";import"./Lock01-BNDVtNp3.js";import"./Sun-qACU13Q-.js";import"./Play-jAQMD8Zy.js";import"./Settings02-I39qsUEU.js";import"./Shield01-DJsSZNak.js";import"./Trash01-BqSCZqrj.js";import"./User01-w8zyOHhj.js";import"./use-collections-Cy_Omosv.js";function Tt(){const t=L.c(16),{org:n}=R(),{data:_}=V(void 0),u=_===void 0?[]:_,B=H(),k=F(),d=T(),[f,E]=M.useState(""),g=f.toLowerCase(),C=new Map(B.map(I)),N=u.filter(o=>{if(!g||o.name.toLowerCase().includes(g))return!0;const a=C.get(o.virtual_mcp_id);return!!(a&&a.title.toLowerCase().includes(g))}),P=(o,a)=>{const y=C.has(a)?a:G(n.id);A("automations_list_row_clicked",{automation_id:o,agent_id:y,source:"settings_automations"}),k(y,{search:{main:"automation:"+o}})};let m;t[0]!==d||t[1]!==n.slug?(m=()=>{A("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:n.slug}})},t[0]=d,t[1]=n.slug,t[2]=m):m=t[2];const z=m,x=p,h=p,j=p;let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsx(p.Title,{children:"Automations"}),t[3]=c):c=t[3];const w=u.length>0&&e.jsx(O,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let s;t[4]!==w?(s=e.jsxs("div",{className:"flex flex-col gap-6",children:[c,w]}),t[4]=w,t[5]=s):s=t[5];const v=u.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(b,{image:e.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:e.jsxs($,{size:"sm",onClick:z,children:[e.jsx(D,{size:14}),"Browse agents"]})})}):N.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(b,{image:e.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):e.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:N.map(o=>e.jsx(q,{automation:o,showAgent:!0,onClick:()=>P(o.id,o.virtual_mcp_id)},o.id))});let i;t[6]!==j.Body||t[7]!==s||t[8]!==v?(i=e.jsxs(j.Body,{children:[s,v]}),t[6]=j.Body,t[7]=s,t[8]=v,t[9]=i):i=t[9];let r;t[10]!==h.Content||t[11]!==i?(r=e.jsx(h.Content,{children:i}),t[10]=h.Content,t[11]=i,t[12]=r):r=t[12];let l;return t[13]!==x||t[14]!==r?(l=e.jsx(x,{children:r}),t[13]=x,t[14]=r,t[15]=l):l=t[15],l}function I(t){return[t.id,t]}export{Tt as default};
@@ -1 +0,0 @@
1
- import{H as Ke,J as te,e as N,j as t,E as Te,r as C,s as le,z as Ge,c as U,aX as Qe,aY as Ye,l as ie,d as Xe,L as G,B as q,x as Ze,g as ae,aZ as ke}from"./index-B3GjV7OW.js";import{E as Pe}from"./empty-state-CYPi3AWF.js";import{u as et,a as Ee}from"./use-collections-Cy_Omosv.js";import{u as ce}from"./constants-Bad0DdgK.js";import{F as se,a as tt,b as de,d as me}from"./form-BbDiaTsN.js";import{I as ue}from"./input-bkK8ZE7l.js";import{T as re}from"./textarea-DYbvm35p.js";import{a as st,b as nt,V as xe}from"./layout-LMk5O_ZK.js";import{S as ot,W as rt,a as lt}from"./index-DDUZQ_xH.js";import{g as it,M as at,b as je}from"./types-aUaKAv-0.js";import{S as be,a as Ne,b as ve,c as Se,d as ne}from"./select-Dli7sWvO.js";import{c as ct,T as ye,a as we,b as Ce}from"./tooltip-M7OSSLPB.js";import{i as dt}from"./AlertCircle-GVxuU95v.js";import{v as mt,x as ut,T as xt,U as pt,V as ft,W as Ie}from"./agent-icon-zc2fqM1k.js";import{c as ht}from"./XCircle-VMAL-xhy.js";import{i as gt}from"./Play-jAQMD8Zy.js";import{i as jt}from"./ChevronRight-B87-4gCD.js";import{O as bt,M as Nt}from"./index--qrsfEvC.js";import{g as vt}from"./connection-slug-eyAPH6o3.js";import{u as St,T as yt}from"./tools-list-DQqEXfVG.js";import{a as _e,u as Oe}from"./use-connection-BTNmhjS_.js";import{b as wt}from"./use-mcp-tools-BxVuuTSL.js";import{c as Ct}from"./content-blocks-o63cs2vh.js";import{I as $e}from"./integration-icon-dKiJ5-c6.js";import{g as It,k as $t}from"./chat-context-B6Fg09sU.js";import{u as Tt}from"./shell-layout-BMRtkmni.js";import{M as kt}from"./monaco-editor-C2N0lO8-.js";import{E as Pt}from"./empty-state-Dg7DOfxH.js";import{n as Et}from"./Container-Bn1bP0Yi.js";import"./label-DTMz5O44.js";import"./index-Bom1zwxj.js";import"./X-Cwv9W6IH.js";import"./index-D3w8D7D3.js";import"./collections-BXMI7Hvf.js";import"./index-Dl4CZy6K.js";import"./use-virtual-mcp-CSMhsIFC.js";import"./accordion-ZNyW-Q9t.js";import"./index-BEwswwod.js";import"./badge-C_Ey5yTa.js";import"./view-mode-toggle-DrXoiKTK.js";import"./dialog-BcmogFZk.js";import"./index-CvwiLDhg.js";import"./dropdown-menu-NvUf9a-j.js";import"./Check-B7RZVj2P.js";import"./DotsVertical-0NEZeBK_.js";import"./Plus-Decn041v.js";import"./Tool01-BqlBf1k7.js";import"./XClose-GzEq-HU9.js";import"./scroll-area-DqbokeCV.js";import"./index-C3btaY0r.js";import"./create-sse-subscription-CxkOgzKf.js";import"./ChevronDown-PN1FfGGP.js";import"./ChevronUp-DXZ6bMcP.js";import"./RefreshCcw01-2tEGwXNO.js";import"./ArrowNarrowLeft-CZSxj8rY.js";import"./ArrowUpRight-C9_9n6RS.js";import"./ZapSquare-CGJC1mww.js";import"./Users03-n9zzJAad.js";import"./CheckCircle-CpSCTcKF.js";import"./Star01-VbAdZ1nM.js";import"./Palette-BgYWS9GS.js";import"./SearchMd-xzJx66s8.js";import"./LinkExternal01-Cl6M9_6y.js";import"./Lock01-BNDVtNp3.js";import"./Sun-qACU13Q-.js";import"./Settings02-I39qsUEU.js";import"./Shield01-DJsSZNak.js";import"./Trash01-BqSCZqrj.js";import"./User01-w8zyOHhj.js";import"./Zap-D93qKeqm.js";import"./extract-connection-data-Crk93y-a.js";import"./constants-DNYERMOq.js";import"./use-registry-connections-BTwHNugi.js";import"./use-organization-settings-DTcFJGZh.js";import"./index-D-aGIpWM.js";import"./popover-a3tMurU4.js";import"./use-create-virtual-mcp-BuaKZJs7.js";import"./use-navigate-to-agent-CSPyzm0t.js";import"./use-ai-providers-CmHinIUs.js";import"./use-decopilot-events-CQ1IkvCh.js";import"./use-tasks-B6YSkeM5.js";import"./required-auth-layout-CnaH9rpW.js";import"./use-org-sso-BBRAkASE.js";Ke({title:te().min(1),description:te().nullable(),body:te()});function oe(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function _t(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function Ot(s){const e=N.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let r;e[1]!==o.control?(r=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(se,{control:o.control,name:"title",render:Dt}),t.jsx(se,{control:o.control,name:"description",render:Rt})]})]}),e[1]=o.control,e[2]=r):r=e[2];let l,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=l,e[4]=a):(l=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[l,a,t.jsx(se,{control:o.control,name:"body",render:At})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==r||e[8]!==c?(i=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[r,c]}),e[7]=r,e[8]=c,e[9]=i):i=e[9];let x;return e[10]!==o||e[11]!==i?(x=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=x):x=e[12],x}function At(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Rt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Mt(s){const e=N.c(36),{providerId:o,promptId:n}=s,{org:r}=le(),l=o||null;let a;e[0]!==r.id||e[1]!==r.slug||e[2]!==l?(a={connectionId:l,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=l,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),x=Ee(o,"PROMPT",c),f=x.update.isPending;let u;e[4]!==i?(u=i?{title:i.title,description:i.description??null,body:oe(i)}:void 0,e[4]=i,e[5]=u):u=e[5];let h;e[6]!==u?(h={values:u},e[6]=u,e[7]=h):h=e[7];const v=Ge(h);let T;e[8]!==v||e[9]!==i?(T=()=>{i&&v.reset({title:i.title,description:i.description??null,body:oe(i)})},e[8]=v,e[9]=i,e[10]=T):T=e[10];const _=T;let O;e[11]!==x.update||e[12]!==v||e[13]!==n?(O=v.handleSubmit(async j=>{const P=await x.update.mutateAsync({id:n,data:{title:j.title,description:j.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:j.body}}]}});v.reset({title:P.title,description:P.description??null,body:oe(P)})}),e[11]=x.update,e[12]=v,e[13]=n,e[14]=O):O=e[14];const A=O;if(!i){let j;return e[15]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Pe,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=j):j=e[15],j}let w;e[16]!==i.title?(w=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=w):w=e[17];let k;e[18]!==i.description?(k=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=k):k=e[19];let I;e[20]!==w||e[21]!==k?(I=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[w,k]})}),e[20]=w,e[21]=k,e[22]=I):I=e[22];let g;e[23]!==A?(g=()=>{A()},e[23]=A,e[24]=g):g=e[24];let S;e[25]!==v.formState.isDirty||e[26]!==f||e[27]!==_||e[28]!==g?(S=t.jsx(st,{children:t.jsx(ot,{onSave:g,onUndo:_,isDirty:v.formState.isDirty,isSaving:f})}),e[25]=v.formState.isDirty,e[26]=f,e[27]=_,e[28]=g,e[29]=S):S=e[29];let y;e[30]!==v?(y=t.jsx("div",{className:"h-full",children:t.jsx(Ot,{form:v})}),e[30]=v,e[31]=y):y=e[31];let $;return e[32]!==S||e[33]!==y||e[34]!==I?($=t.jsxs(xe,{children:[I,S,y]}),e[32]=S,e[33]=y,e[34]=I,e[35]=$):$=e[35],$}function zt(s){const e=N.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=_t(),e[0]=n):n=e[0];const r=n;if(!r){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Pe,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let l;return e[2]!==o?(l=t.jsx(Te,{children:t.jsx(C.Suspense,{fallback:null,children:t.jsx(Mt,{providerId:r,promptId:o})})}),e[2]=o,e[3]=l):l=e[3],l}const Ut=Qe("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function Lt(s){const e=N.c(10);let o,n,r;e[0]!==s?({className:o,variant:r,...n}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=r):(o=e[1],n=e[2],r=e[3]);let l;e[4]!==o||e[5]!==r?(l=U(Ut({variant:r}),o),e[4]=o,e[5]=r,e[6]=l):l=e[6];let a;return e[7]!==n||e[8]!==l?(a=t.jsx("div",{"data-slot":"alert",role:"alert",className:l,...n}),e[7]=n,e[8]=l,e[9]=a):a=e[9],a}function Vt(s){const e=N.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=U("line-clamp-1 min-h-4 font-medium tracking-tight",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("div",{"data-slot":"alert-title",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Bt(s){const e=N.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=U("text-muted-foreground leading-relaxed",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("div",{"data-slot":"alert-description",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Ae(s){const e=N.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=U("min-w-0 overflow-hidden",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Re(s){const e=N.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=U("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("ol",{"data-slot":"breadcrumb-list",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function J(s){const e=N.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=U("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("li",{"data-slot":"breadcrumb-item",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Q(s){const e=N.c(10);let o,n,r;e[0]!==s?({asChild:o,className:n,...r}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=r):(o=e[1],n=e[2],r=e[3]);const l=o?Ye:"a";let a;e[4]!==n?(a=U("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==l||e[7]!==r||e[8]!==a?(c=t.jsx(l,{"data-slot":"breadcrumb-link",className:a,...r}),e[6]=l,e[7]=r,e[8]=a,e[9]=c):c=e[9],c}function De(s){const e=N.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=U("text-foreground font-medium truncate",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Y(s){const e=N.c(12);let o,n,r;e[0]!==s?({children:o,className:n,...r}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=r):(o=e[1],n=e[2],r=e[3]);let l;e[4]!==n?(l=U("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=l):l=e[5];let a;e[6]!==o?(a=o??t.jsx(jt,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==r||e[9]!==l||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l,...r,children:a}),e[8]=r,e[9]=l,e[10]=a,e[11]=c):c=e[11],c}const Ft=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Jt(s){const e=N.c(11),{toolName:o,connectionId:n,siblings:r,onSelectInstance:l,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=St(c);if(!i.isAuthenticated){let u;return e[2]!==i.supportsOAuth||e[3]!==a?(u=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(bt,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(Nt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=u):u=e[4],u}const x=`${n}:${o}`;let f;return e[5]!==n||e[6]!==l||e[7]!==r||e[8]!==x||e[9]!==o?(f=t.jsx(Wt,{toolName:o,connectionId:n,siblings:r,onSelectInstance:l},x),e[5]=n,e[6]=l,e[7]=r,e[8]=x,e[9]=o,e[10]=f):f=e[10],f}function Wt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:r}=Xe({strict:!1}),l=(()=>{if(!r)return null;const d=`replay-${r}`,m=sessionStorage.getItem(d);if(!m)return null;sessionStorage.removeItem(d);try{return JSON.parse(m)}catch{return null}})(),a=(()=>{if(!l)return null;const d={};for(const[m,b]of Object.entries(l))b!==null&&typeof b=="object"?d[m]=JSON.stringify(b,null,2):d[m]=b;return d})(),[c,i]=C.useState(a??{}),[x,f]=C.useState(l?JSON.stringify(l,null,2):"{}"),[u,h]=C.useState(null),[v,T]=C.useState(null),[_,O]=C.useState(null),[A,w]=C.useState(null),[k,I]=C.useState(!1),[g,S]=C.useState(null),{org:y}=le(),$=_e(e),j=It(),P=$t(),{setChatOpen:L}=Tt(),M=`${e}:${s}`,R=ce({connectionId:e,orgId:y.id,orgSlug:y.slug}),z=wt({client:R}),p=z.data?.tools?.find(d=>d.name===s),E=it(p?._meta),V=d=>{if(!j)return;const m=Ct(d.content);m.content.length>0&&(L(!0),j.sendMessage({tiptapDoc:m}))},[D,X]=C.useState("json"),[Me,ze]=C.useState(!1);E&&!Me&&(X("ui"),ze(!0));const pe=p?.inputSchema?.properties,fe=pe?Object.keys(pe):[],W=fe.length>0,H={};if(W&&p?.inputSchema?.properties)for(const d of fe)H[d]=p.inputSchema.required?.includes(d)?"":void 0;const Z=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{I(!0),w(null),h(null),T(null),O(null),S(null);const d=performance.now();try{if(!R)throw new Error("MCP client is not available");const m=W?{...H,...c}:(()=>{const B=x.trim();if(!B)return{};const F=JSON.parse(B);if(F&&typeof F=="object")return F;throw new Error("Raw JSON input must be an object.")})();W&&p?.inputSchema?.properties&&Object.entries(p.inputSchema.properties).forEach(([B,F])=>{if((F.type==="object"||F.type==="array")&&typeof m[B]=="string")try{m[B]=JSON.parse(m[B])}catch{}});const b=await R.callTool({name:s,arguments:m}),K=b.structuredContent??b,We=performance.now(),qe=Math.round(We-d);h(K),T(b),O(m);const He=JSON.stringify(K),ge=new TextEncoder().encode(He).length;S({duration:`${qe}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(m){const b=m instanceof Error?m.message:String(m);w(b||"Unknown error occurred");const K=performance.now();S({duration:`${Math.round(K-d)}ms`})}finally{I(!1)}},ee=(d,m)=>{i(b=>({...b,[d]:m}))},Le=()=>{h(null),T(null),O(null),w(null),S(null)},Ve=p?.name??Ft(s),Be=t.jsx(Ae,{children:t.jsxs(Re,{children:[t.jsx(J,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:y.slug},children:"Connections"})})}),t.jsx(Y,{}),$&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:y.slug,appSlug:vt($)},search:{tab:"tools"},children:$.title})})}),t.jsx(Y,{})]}),t.jsx(J,{children:t.jsx(De,{children:Ve})})]})}),he=o.length>1&&t.jsxs(be,{value:e,onValueChange:n,children:[t.jsx(Ne,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ve,{})}),t.jsx(Se,{children:o.map(d=>t.jsx(ne,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx($e,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Fe=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),p?.inputSchema?.required&&p.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:W&&p?.inputSchema?.properties?Object.entries(p.inputSchema.properties).map(([d,m])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,p.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:m.type})]}),m.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:m.description}),m.type==="object"||m.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:Z(d)?c[d]??"":H[d]??"",onChange:b=>ee(d,b.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):m.type==="boolean"?t.jsxs(be,{value:Z(d)?String(c[d]??""):"",onValueChange:b=>ee(d,b==="true"),children:[t.jsx(Ne,{children:t.jsx(ve,{placeholder:"Select true or false..."})}),t.jsxs(Se,{children:[t.jsx(ne,{value:"true",children:"true"}),t.jsx(ne,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:Z(d)?c[d]??"":H[d]??"",onChange:b=>ee(d,b.target.value),placeholder:`Enter ${d}...`})]},d)):p?.inputSchema&&!W?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:x,onChange:d=>f(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:k?t.jsxs(q,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Le,children:[t.jsx(mt,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(q,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(gt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),Je=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[g&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ut,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:g.duration})]}),g.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(xt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:g.tokens})]}),g.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(pt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:g.bytes})]}),g.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:g.cost})})]}),E&&t.jsx(ct,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(ye,{children:[t.jsx(we,{asChild:!0,children:t.jsx(q,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("ui"),children:t.jsx(ft,{size:14})})}),t.jsx(Ce,{children:"Interactive view"})]}),t.jsxs(ye,{children:[t.jsx(we,{asChild:!0,children:t.jsx(q,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("json"),children:t.jsx(Ie,{size:14})})}),t.jsx(Ce,{children:"JSON view"})]})]})})]})]}),A&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(Lt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(dt,{className:"h-4 w-4"}),t.jsx(Vt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(Bt,{className:"text-xs text-destructive",children:A})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:E&&D==="ui"&&R?t.jsx(C.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(at,{resourceURI:E,toolInfo:p?{tool:p}:void 0,toolInput:_??void 0,toolResult:v??void 0,displayMode:"fullscreen",minHeight:je.view.minHeight,maxHeight:je.view.maxHeight,client:R,onMessage:V,onUpdateModelContext:d=>P?.setAppContext(M,d),onTeardown:()=>P?.clearAppContext(M),className:"h-full"})}):u?t.jsxs(t.Fragment,{children:[t.jsx(kt,{code:JSON.stringify(u,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(q,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(u,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(ht,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(Ie,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Be,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx($e,{icon:$?.icon||null,name:$?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[z.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):z.isLoading?t.jsx(ie,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:z.isSuccess?"ready":z.isLoading?"connecting":"error"})]}),t.jsx(yt,{annotations:p?.annotations,_meta:p?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:p?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Fe}),Je]})})]})})}function qt(s){const e=N.c(10),{itemId:o,siblings:n,onBack:r}=s,[l,a]=C.useState(n[0]?.id??"");let c;e[0]!==l||e[1]!==n?(c=n.find(h=>h.id===l)?.id??n[0]?.id??"",e[0]=l,e[1]=n,e[2]=c):c=e[2];const i=c;if(!_e(i||void 0)||!i){let h;return e[3]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=h):h=e[3],h}let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ie,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=f):f=e[4];let u;return e[5]!==i||e[6]!==r||e[7]!==n||e[8]!==o?(u=t.jsx(C.Suspense,{fallback:f,children:t.jsx(Jt,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:r})}),e[5]=i,e[6]=r,e[7]=n,e[8]=o,e[9]=u):u=e[9],u}const Ht={workflow:lt,workflow_execution:rt,prompt:zt};function Kt(){const s=N.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),r=decodeURIComponent(n.itemId);let l;s[1]!==n.appSlug?(l={slug:n.appSlug},s[1]=n.appSlug,s[2]=l):l=s[2];const a=Oe(l);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,x=Gt;let f;return s[5]!==i||s[6]!==r||s[7]!==a?(f=t.jsx(qt,{itemId:r,siblings:a,onBack:i,onUpdate:x}),s[5]=i,s[6]=r,s[7]=a,s[8]=f):f=s[8],f}async function Gt(s){return Promise.resolve()}function Qt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Yt(){const s=N.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),r=decodeURIComponent(n.collectionName),l=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=le();let x;s[3]!==n.appSlug?(x={slug:n.appSlug},s[3]=n.appSlug,s[4]=x):x=s[4];const u=Oe(x)[0]??null,h=u?.id??"",v=h||"no-connection",T=h??null;let _;s[5]!==i.id||s[6]!==i.slug||s[7]!==T?(_={connectionId:T,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=T,s[8]=_):_=s[8];const O=ce(_),A=Ee(v,r,O);let w;s[9]!==A||s[10]!==l?(w=async D=>{l&&await A.update.mutateAsync({id:l,data:D})},s[9]=A,s[10]=l,s[11]=w):w=s[11];const k=w;let I;s[12]!==r?(I=r?.toLowerCase(),s[12]=r,s[13]=I):I=s[13];const g=I,S=g&&Ht[g];let y;s[14]!==r?(y=Qt(r),s[14]=r,s[15]=y):y=s[15];const $=y;let j;s[16]!==i.slug?(j=t.jsx(J,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=j):j=s[17];let P;s[18]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Y,{}),s[18]=P):P=s[18];let L;s[19]!==r||s[20]!==u||s[21]!==i.slug||s[22]!==n.appSlug?(L=u&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:r},children:u.title})})}),t.jsx(Y,{})]}),s[19]=r,s[20]=u,s[21]=i.slug,s[22]=n.appSlug,s[23]=L):L=s[23];let M;s[24]!==$?(M=t.jsx(J,{children:t.jsx(De,{children:$})}),s[24]=$,s[25]=M):M=s[25];let R;s[26]!==L||s[27]!==M||s[28]!==j?(R=t.jsx(Ae,{children:t.jsxs(Re,{children:[j,P,L,M]})}),s[26]=L,s[27]=M,s[28]=j,s[29]=R):R=s[29];const z=R;if(S){let D;return s[30]!==S||s[31]!==c||s[32]!==k||s[33]!==l?(D=t.jsx(S,{itemId:l,onBack:c,onUpdate:k}),s[30]=S,s[31]=c,s[32]=k,s[33]=l,s[34]=D):D=s[34],D}let p;s[35]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Et,{size:36,className:"text-muted-foreground"}),s[35]=p):p=s[35];let E;s[36]!==c?(E=t.jsx(Pt,{icon:p,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=E):E=s[37];let V;return s[38]!==z||s[39]!==E?(V=t.jsx(xe,{breadcrumb:z,children:E}),s[38]=z,s[39]=E,s[40]=V):V=s[40],V}function Xt(){const s=N.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let l;return s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Yt,{}),s[2]=l):l=s[2],l}function kn(){const s=N.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Te,{children:t.jsx(C.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ie,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Xt,{})})}),s[0]=e):e=s[0],e}export{kn as default};
@@ -1 +0,0 @@
1
- import{H as ge,aI as Ie,aJ as Ae,J as ce,aK as $e,e as P,j as t,l as je,B as G,r as X,c as ve,s as J,w as De,K as ie,f as Y,aL as de,u as Pe,aM as Oe,E as Me,g as ze,o as Ve,z as Ee,C as Ue,G as Fe,aN as Le,x as Q,F as Re}from"./index-B3GjV7OW.js";import{g as He}from"./constants-DNYERMOq.js";import{E as be}from"./empty-state-CYPi3AWF.js";import{E as Be,c as Ge,r as We,b as Xe,d as Ke}from"./connection-form-helpers-CLWU-iGL.js";import{c as qe,S as Qe}from"./index--qrsfEvC.js";import{u as Ne,T as Je}from"./tools-list-DQqEXfVG.js";import{u as Ye}from"./use-members-Bi_cxyIQ.js";import{A as Ze}from"./avatar-Dda8SxzC.js";import{a as ye,b as _e,u as et}from"./use-connection-BTNmhjS_.js";import{u as ae,S as tt}from"./constants-Bad0DdgK.js";import{b as st}from"./use-mcp-tools-BxVuuTSL.js";import{g as re,M as nt,a as ot}from"./types-aUaKAv-0.js";import{T as ee,b as it,c as te,a as at,d as rt}from"./tabs-CeGpUpHP.js";import{I as ne}from"./integration-icon-dKiJ5-c6.js";import{s as lt}from"./Plus-Decn041v.js";import{a as Se}from"./Settings02-I39qsUEU.js";import{s as le}from"./Trash01-BqSCZqrj.js";import{e as ct,d as dt,r as mt,c as ut,s as xt}from"./index-Bom1zwxj.js";import{F as L,b as R,c as H,d as V,f as B,e as pt,a as ft}from"./form-BbDiaTsN.js";import{I as W}from"./input-bkK8ZE7l.js";import{u as ht,D as gt}from"./use-delete-connection-6dZbEpz0.js";import{V as jt}from"./layout-LMk5O_ZK.js";import{c as vt,C as bt,B as Nt,a as yt,b as _t,d as St,e as Ct}from"./monitoring-stats-row-B1WEuAdI.js";import{b as wt}from"./use-virtual-mcp-CSMhsIFC.js";import{i as Ce}from"./ChevronRight-B87-4gCD.js";import{a as we}from"./Users03-n9zzJAad.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{c as kt}from"./ZapSquare-CGJC1mww.js";import{S as Tt,a as It}from"./agent-icon-zc2fqM1k.js";import{b as At}from"./Tool01-BqlBf1k7.js";import{C as $t}from"./collection-search-FuJrX0DL.js";import{C as Dt}from"./card-BqDVz8rB.js";import{B as Pt}from"./badge-C_Ey5yTa.js";import{D as Ot,a as Mt,b as zt,c as me}from"./dropdown-menu-NvUf9a-j.js";import{S as ue,a as xe,b as pe,c as fe,d as F}from"./select-Dli7sWvO.js";import{i as Vt}from"./CheckCircle-CpSCTcKF.js";import{t as Et}from"./ChevronDown-PN1FfGGP.js";import{n as Ut}from"./Container-Bn1bP0Yi.js";import{s as se}from"./Star01-VbAdZ1nM.js";import{a as Ft}from"./RefreshCcw01-2tEGwXNO.js";import{s as Lt}from"./XClose-GzEq-HU9.js";import"./collections-BXMI7Hvf.js";import"./SearchMd-xzJx66s8.js";import"./index-D3w8D7D3.js";import"./index-Dl4CZy6K.js";import"./extract-connection-data-Crk93y-a.js";import"./use-registry-connections-BTwHNugi.js";import"./use-organization-settings-DTcFJGZh.js";import"./index-D-aGIpWM.js";import"./popover-a3tMurU4.js";import"./tooltip-M7OSSLPB.js";import"./Check-B7RZVj2P.js";import"./use-create-virtual-mcp-BuaKZJs7.js";import"./use-navigate-to-agent-CSPyzm0t.js";import"./use-org-auth-client-C0e9yR_n.js";import"./User01-w8zyOHhj.js";import"./use-collections-Cy_Omosv.js";import"./X-Cwv9W6IH.js";import"./label-DTMz5O44.js";import"./alert-dialog-7vNv5N4P.js";import"./AlertCircle-GVxuU95v.js";import"./ArrowNarrowLeft-CZSxj8rY.js";import"./XCircle-VMAL-xhy.js";import"./ArrowUpRight-C9_9n6RS.js";import"./ChevronUp-DXZ6bMcP.js";import"./DotsVertical-0NEZeBK_.js";import"./Palette-BgYWS9GS.js";import"./LinkExternal01-Cl6M9_6y.js";import"./Lock01-BNDVtNp3.js";import"./Sun-qACU13Q-.js";import"./Play-jAQMD8Zy.js";import"./Shield01-DJsSZNak.js";import"./Zap-D93qKeqm.js";const Rt=ge({scopes:$e(ce()).describe("List of scopes available"),stateSchema:Ie(ce(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Ht=[{name:"MCP_CONFIGURATION",inputSchema:ge({}),outputSchema:Rt}];function Bt(s){const e=P.c(39),{instance:n,onConfigure:i,onAuthenticate:r,onDelete:o}=s;let a;e[0]!==n.id?(a={connectionId:n.id},e[0]=n.id,e[1]=a):a=e[1];const c=Ne(a),d=!(n.connection_type==="VIRTUAL")&&c.supportsOAuth&&!c.isAuthenticated,u=d?"border-destructive/50 bg-destructive/5":"border-transparent";let p;e[2]!==u?(p=ve("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=p):p=e[3];let l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(ne,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=l):l=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 g;e[9]!==d?(g=d&&t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}),e[9]=d,e[10]=g):g=e[10];let v;e[11]!==f||e[12]!==g?(v=t.jsxs("div",{className:"flex-1 min-w-0",children:[f,g]}),e[11]=f,e[12]=g,e[13]=v):v=e[13];let b;e[14]!==n||e[15]!==d||e[16]!==r?(b=d&&t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[14]=n,e[15]=d,e[16]=r,e[17]=b):b=e[17];let j;e[18]!==n||e[19]!==i?(j=()=>i(n),e[18]=n,e[19]=i,e[20]=j):j=e[20];let _;e[21]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Se,{size:13}),e[21]=_):_=e[21];let w;e[22]!==j?(w=t.jsx(G,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,title:"Configure",children:_}),e[22]=j,e[23]=w):w=e[23];let S;e[24]!==n||e[25]!==o?(S=()=>o(n),e[24]=n,e[25]=o,e[26]=S):S=e[26];let N;e[27]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(le,{size:13}),e[27]=N):N=e[27];let k;e[28]!==S?(k=t.jsx(G,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:S,title:"Delete",children:N}),e[28]=S,e[29]=k):k=e[29];let y;e[30]!==w||e[31]!==k||e[32]!==b?(y=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[b,w,k]}),e[30]=w,e[31]=k,e[32]=b,e[33]=y):y=e[33];let C;return e[34]!==y||e[35]!==p||e[36]!==l||e[37]!==v?(C=t.jsxs("div",{className:p,children:[l,v,y]}),e[34]=y,e[35]=p,e[36]=l,e[37]=v,e[38]=C):C=e[38],C}function Gt(s){const e=P.c(15),{instance:n,onConfigure:i}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(ne,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=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 a;e[5]!==n||e[6]!==i?(a=()=>i(n),e[5]=n,e[6]=i,e[7]=a):a=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Se,{size:13}),e[8]=c):c=e[8];let m;e[9]!==a?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(G,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:a,title:"Configure",children:c})}),e[9]=a,e[10]=m):m=e[10];let d;return e[11]!==r||e[12]!==o||e[13]!==m?(d=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,m]}),e[11]=r,e[12]=o,e[13]=m,e[14]=d):d=e[14],d}function Wt(s){const e=P.c(25),{instances:n,onConfigure:i,onAuthenticate:r,onDelete:o,onAdd:a,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 u;e[2]!==c?(u=c?t.jsx(je,{size:13,className:"animate-spin"}):t.jsx(lt,{size:13}),e[2]=c,e[3]=u):u=e[3];let p;e[4]!==c||e[5]!==a||e[6]!==u?(p=t.jsxs(G,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:a,disabled:c,children:[u,"Add instance"]}),e[4]=c,e[5]=a,e[6]=u,e[7]=p):p=e[7];let l;e[8]!==d||e[9]!==p?(l=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[d,p]}),e[8]=d,e[9]=p,e[10]=l):l=e[10];let f;if(e[11]!==n||e[12]!==r||e[13]!==i||e[14]!==o){let b;e[16]!==r||e[17]!==i||e[18]!==o?(b=j=>t.jsx(X.Suspense,{fallback:t.jsx(Gt,{instance:j,onConfigure:i}),children:t.jsx(Bt,{instance:j,onConfigure:i,onAuthenticate:r,onDelete:o})},j.id),e[16]=r,e[17]=i,e[18]=o,e[19]=b):b=e[19],f=n.map(b),e[11]=n,e[12]=r,e[13]=i,e[14]=o,e[15]=f}else f=e[15];let g;e[20]!==f?(g=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:f}),e[20]=f,e[21]=g):g=e[21];let v;return e[22]!==l||e[23]!==g?(v=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,g]}),e[22]=l,e[23]=g,e[24]=v):v=e[24],v}const Xt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Kt(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 qt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Qt(s){const e=P.c(4),{connectionId:n,orgId:i,orgSlug:r,timeframe:o}=s;let a;e[0]!==i||e[1]!==r?(a={connectionId:tt,orgId:i,orgSlug:r},e[0]=i,e[1]=r,e[2]=a):a=e[2];const c=ae(a),m=Kt(o),{data:d}=De({queryKey:ie.connectionActivity(n,o,i),queryFn:async()=>{const g=await c.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:m.startDate.toISOString(),endDate:m.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return g.structuredContent??g},staleTime:3e5}),u=vt(d?.logs??[],m),p=u.data,l=u.totalCalls>0;let f;return e[3]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[3]=f):f=e[3],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:u.totalCalls.toLocaleString()}),f]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),l?t.jsxs("div",{children:[t.jsx(bt,{config:qt,className:"h-16 w-full",children:t.jsxs(Nt,{data:p,barCategoryGap:"4%",children:[t.jsx(yt,{content:t.jsx(_t,{labelFormatter:Yt}),cursor:{fill:"var(--muted)"}}),t.jsx(St,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:p.map(Jt)})]})}),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 Jt(s,e){return t.jsx(Ct,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function Yt(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function Zt(){const s=P.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 es(s){const e=P.c(14),{connectionId:n}=s,[i,r]=X.useState("14d"),{org:o}=J();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=a):a=e[0];let c;e[1]!==i?(c=Xt.map(l=>t.jsx("button",{type:"button",onClick:()=>r(l.value),className:ve("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",i===l.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:l.label},l.value)),e[1]=i,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:[a,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(Zt,{}),e[5]=d):d=e[5];let u;e[6]!==n||e[7]!==o.id||e[8]!==o.slug||e[9]!==i?(u=t.jsx(X.Suspense,{fallback:d,children:t.jsx(Qt,{connectionId:n,orgId:o.id,orgSlug:o.slug,timeframe:i})}),e[6]=n,e[7]=o.id,e[8]=o.slug,e[9]=i,e[10]=u):u=e[10];let p;return e[11]!==m||e[12]!==u?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,u]}),e[11]=m,e[12]=u,e[13]=p):p=e[13],p}function ts(s){const e=P.c(15),{virtualMcp:n,org:i}=s,r=Y();let o;e[0]!==r||e[1]!==i||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:i,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=i,e[2]=n.id,e[3]=o):o=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(we,{size:16}),e[4]=a):a=e[4];let c;e[5]!==n.icon||e[6]!==n.title?(c=t.jsx(ne,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[5]=n.icon,e[6]=n.title,e[7]=c):c=e[7];let m;e[8]!==n.title?(m=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=m):m=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==o||e[12]!==c||e[13]!==m?(u=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[c,m,d]}),e[11]=o,e[12]=c,e[13]=m,e[14]=u):u=e[14],u}function ss(s){const e=P.c(7),{virtualMcps:n,org:i}=s;let r;if(e[0]!==i||e[1]!==n){let a;e[3]!==i?(a=c=>t.jsx(ts,{virtualMcp:c,org:i},c.id),e[3]=i,e[4]=a):a=e[4],r=n.map(a),e[0]=i,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function ns(s){const e=P.c(7),{connection:n}=s,{org:i}=J();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=wt(r);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]!==i.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(ss,{virtualMcps:o,org:i.slug})})]}),e[4]=i.slug,e[5]=o,e[6]=m):m=e[6],m}function os(s){const e=P.c(31),{tools:n,connectionId:i,org:r}=s,o=Y(),{org:a}=J();let c;e[0]!==i||e[1]!==a.id||e[2]!==a.slug?(c={connectionId:i,orgId:a.id,orgSlug:a.slug},e[0]=i,e[1]=a.id,e[2]=a.slug,e[3]=c):c=e[3];const m=ae(c),d=ye(i);let u;e[4]!==d||e[5]!==i?(u=d?ke(d):i,e[4]=d,e[5]=i,e[6]=u):u=e[6];const p=u,[l,f]=X.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==m||e[9]!==o||e[10]!==r||e[11]!==l||e[12]!==n){const S=(n??[]).filter(is),N=l.toLowerCase().trim(),k=N?S.filter(h=>h.name.toLowerCase().includes(N)||h.description&&h.description.toLowerCase().includes(N)):S;let y;e[17]!==p||e[18]!==o||e[19]!==r?(y=h=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(h.name)}})},e[17]=p,e[18]=o,e[19]=r,e[20]=y):y=e[20];const C=y;b="flex flex-col h-full overflow-hidden";let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[21]=I):I=e[21],e[22]!==l?(j=t.jsx($t,{value:l,onChange:f,placeholder:"Search apps...",onKeyDown:I}),e[22]=l,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=k.length===0?t.jsx(be,{image:null,title:l?"No apps found":"No apps available",description:l?"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:k.map(h=>{const A=re(h._meta);return t.jsxs(Dt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>C(h),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(nt,{resourceURI:A,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(Je,{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[7]=p,e[8]=m,e[9]=o,e[10]=r,e[11]=l,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let _;e[24]!==g||e[25]!==v?(_=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=_):_=e[26];let w;return e[27]!==b||e[28]!==j||e[29]!==_?(w=t.jsxs("div",{className:b,children:[j,_]}),e[27]=b,e[28]=j,e[29]=_,e[30]=w):w=e[30],w}function is(s){return!!re(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=a=>a.charAt(0).toUpperCase()+a.slice(1),i=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&i.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function oe(s){const e=P.c(2),{label:n}=s;let i;return e[0]!==n?(i=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]=i):i=e[1],i}function as(s){const e=P.c(50),{tools:n,prompts:i,resources:r,connectionId:o,org:a}=s;let c;e[0]!==i?(c=i===void 0?[]:i,e[0]=i,e[1]=c):c=e[1];const m=c;let d;e[2]!==r?(d=r===void 0?[]:r,e[2]=r,e[3]=d):d=e[3];const u=d,p=Y(),l=ye(o??"");let f;e[4]!==l||e[5]!==o?(f=l?ke(l):o,e[4]=l,e[5]=o,e[6]=f):f=e[6];const g=f;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==a?(v=function($){!o||!a||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:g,collectionName:"tools",itemId:encodeURIComponent($)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=a,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==a||e[14]!==n?(j=o&&a&&n.some(cs),e[12]=o,e[13]=a,e[14]=n,e[15]=j):j=e[15];const _=j;if(n.length+m.length+u.length===0){let x;return e[16]===Symbol.for("react.memo_cache_sentinel")?(x=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]=x):x=e[16],x}let S;e[17]!==n.length?(S=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=S):S=e[18];let N;e[19]!==_?(N=_&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=_,e[20]=N):N=e[20];let k,y;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),y=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=k,e[22]=y):(k=e[21],y=e[22]);let C;e[23]!==S||e[24]!==N?(C=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(it,{variant:"underline",className:"gap-1",children:[S,N,k,y]})}),e[23]=S,e[24]=N,e[25]=C):C=e[25];let I;e[26]!==b||e[27]!==n?(I=n.length>0?n.map(x=>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:()=>b(x.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(At,{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:Te(x.name)}),x.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:x.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},x.name)):t.jsx(oe,{label:"tools"}),e[26]=b,e[27]=n,e[28]=I):I=e[28];let h;e[29]!==I?(h=t.jsx(te,{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 A;e[31]!==o||e[32]!==_||e[33]!==a||e[34]!==n?(A=_&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(os,{tools:n,connectionId:o,org:a})}),e[31]=o,e[32]=_,e[33]=a,e[34]=n,e[35]=A):A=e[35];let M;e[36]!==m?(M=m.length>0?m.map(ls):t.jsx(oe,{label:"prompts"}),e[36]=m,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let T;e[40]!==u?(T=u.length>0?u.map(rs):t.jsx(oe,{label:"resources"}),e[40]=u,e[41]=T):T=e[41];let z;e[42]!==T?(z=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:T})}),e[42]=T,e[43]=z):z=e[43];let E;return e[44]!==C||e[45]!==h||e[46]!==A||e[47]!==O||e[48]!==z?(E=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(at,{defaultValue:"tools",variant:"underline",children:[C,h,A,O,z]})}),e[44]=C,e[45]=h,e[46]=A,e[47]=O,e[48]=z,e[49]=E):E=e[49],E}function rs(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(Tt,{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 ls(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(kt,{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:Te(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 cs(s){return re(s._meta)}function ds(s){const e=P.c(13),{connection:n,displayTitle:i}=s,r=i??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(ne,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let a;e[3]!==r?(a=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=a):a=e[4];let c;e[5]!==n.description?(c=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=c):c=e[6];let m;e[7]!==a||e[8]!==c?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,c]}),e[7]=a,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-4 md:gap-6 py-5 md:py-7 px-4 md: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 ms({form:s,connection:e,hasOAuthToken:n,onReauthenticate:i,onRemoveOAuth:r}){const o=de({control:s.control,name:"ui_type"}),a=de({control:s.control,name:"connection_url"}),{stdioEnabled:c}=Pe(),m=(()=>{if(typeof a!="string"||!a)return!1;try{const l=new URL(a);return l.hostname==="api.githubcopilot.com"&&l.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),d=c||e.connection_type==="STDIO",u=e.connection_type==="VIRTUAL",p=u?Oe(e.connection_url):null;return u?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(we,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(L,{control:s.control,name:"ui_type",render:({field:l})=>t.jsxs(R,{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(ue,{value:l.value,onValueChange:l.onChange,children:[t.jsx(V,{children:t.jsxs(xe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(pe,{})]})}),t.jsxs(fe,{children:[t.jsx(F,{value:"HTTP",children:"HTTP"}),t.jsx(F,{value:"SSE",children:"SSE"}),t.jsx(F,{value:"Websocket",children:"Websocket"}),d&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:"NPX Package"}),t.jsx(F,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:f})=>t.jsx(R,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(W,{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(ue,{value:l.value,onValueChange:l.onChange,children:[t.jsx(V,{children:t.jsx(xe,{className:"h-10",children:t.jsx(pe,{})})}),t.jsxs(fe,{children:[t.jsx(F,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(F,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(F,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),d&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(F,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(It,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(B,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(V,{children:t.jsx(W,{placeholder:"@perplexity-ai/mcp-server",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(V,{children:t.jsx(W,{placeholder:"node, bun, python...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(V,{children:t.jsx(W,{placeholder:"arg1 arg2 --flag value",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(B,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(V,{children:t.jsx(W,{placeholder:"/path/to/project (optional)",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(V,{children:t.jsx(Be,{value:l.value??[],onChange:l.onChange})}),t.jsx(B,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:l})=>t.jsxs(R,{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(Ot,{children:[t.jsx(Mt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Pt,{variant:"success",className:"gap-1.5",children:[t.jsx(Vt,{size:12}),"Authenticated via OAuth",t.jsx(Et,{size:12})]})})}),t.jsxs(zt,{align:"start",children:[t.jsxs(me,{onClick:i,children:[t.jsx(Ft,{size:16}),"Re-authenticate"]}),t.jsxs(me,{variant:"destructive",onClick:r,children:[t.jsx(le,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&l.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:()=>l.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(Lt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(W,{type:"password",placeholder:m?"Paste your GitHub PAT":"Enter access token...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(pt,{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(B,{})]})})]})}function us(s){return s.command==="npx"}function xs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function ps(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function he(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"&&Le(s.connection_headers)){const i=s.connection_headers,r=We(i.envVars);if(us(i)){const a=xs(i);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=ps(i);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:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function fs(s){let e,n=null,i=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Xe(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Ke(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",i=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...i&&{connection_token:i},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function hs({connection:s,connectionId:e,org:n,isUpdating:i,tools:r,prompts:o,resources:a,siblings:c}){const m=Y({from:"/$org/settings/connections/$appSlug"}),d=Ve(),u=_e(),{org:p}=J(),l=ht({onSuccess:()=>{c.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[f,g]=X.useState(null),[v,b]=X.useState(!1),j=Ne({connectionId:e}),{data:_}=Ye(),w=_?.data?.members??[],S=f??s,N=w.find(x=>x.userId===S.created_by),y=s?.connection_type==="VIRTUAL"||j.isAuthenticated,C={...s,tools:r},I=qe(C,Ht),h=Ee({resolver:Ue(Ge),values:he(f??s)}),A=h.formState.isDirty,M=async()=>{if(!await h.trigger())return;const $=h.getValues(),D=fs($),U=f?.id??e;await u.update.mutateAsync({id:U,data:D}),h.reset($)},O=()=>{h.reset(he(f??s))},T=async x=>{const{token:$,tokenInfo:D,error:U}=await Re({connectionId:x,orgSlug:p.slug,scope:"offline_access"});if(U||!$){Q.error(`Authentication failed: ${U}`);return}if(D)try{const K=await fetch(`/api/${p.slug}/connections/${x}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await u.update.mutateAsync({id:x,data:{connection_token:$}});else try{await u.update.mutateAsync({id:x,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(K){console.error("Error saving OAuth token:",K),await u.update.mutateAsync({id:x,data:{connection_token:$}})}else await u.update.mutateAsync({id:x,data:{connection_token:$}});const q=new URL(`/api/${p.slug}/mcp/${x}`,window.location.origin);await d.invalidateQueries({queryKey:ie.isMCPAuthenticated(q.href,null)}),Q.success("Authentication successful")},z=()=>T(s.id),E=async()=>{try{const x=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!x.ok){const D=await x.text();Q.error(`Failed to remove OAuth: ${D}`);return}const $=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await d.invalidateQueries({queryKey:ie.isMCPAuthenticated($.href,null)}),Q.success("OAuth removed. You can now re-authenticate with a different account.")}catch(x){console.error("Error removing OAuth token:",x),Q.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(gt,{...l}),t.jsx(ct,{open:f!==null,onOpenChange:x=>{x||g(null)},children:t.jsxs(dt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(mt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(ut,{className:"text-base",children:f?.title??s.title}),t.jsx(xt,{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(ft,{...h,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(L,{control:h.control,name:"title",render:({field:x})=>t.jsxs(R,{children:[t.jsx(H,{children:"Name"}),t.jsx(V,{children:t.jsx(W,{...x})}),t.jsx(B,{})]})}),t.jsx(L,{control:h.control,name:"description",render:({field:x})=>t.jsxs(R,{children:[t.jsx(H,{children:"Description"}),t.jsx(V,{children:t.jsx(W,{...x,value:x.value||""})}),t.jsx(B,{})]})})]}),t.jsx(ms,{form:h,connection:f??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:z,onRemoveOAuth:E}),t.jsx(Qe,{connection:f??s,form:h,hasMcpBinding:I,isMCPAuthenticated:y,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:z,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(G,{onClick:M,disabled:!A||i,className:"flex-1",children:i?"Saving…":"Save changes"}),A&&t.jsx(G,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(G,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const x=f??s;g(null),l.requestDelete(x)},children:[t.jsx(le,{size:15}),"Delete"]})]})]},f?.id??s.id)]})}),t.jsx(jt,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(ds,{connection:s,displayTitle:(()=>{const x=c[0]??s;return x.app_name?x.title.replace(/\s*\(\d+\)\s*$/,""):x.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(es,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Wt,{instances:c,onConfigure:x=>g(x),onAuthenticate:x=>T(x.id),onDelete:x=>l.requestDelete(x),isAdding:v,onAdd:async()=>{b(!0);try{const x=c[0]??s,$=x.title.replace(/\s*\(\d+\)\s*$/,""),D=c.length+1,U=`${$} (${D})`,q=He("conn");await u.create.mutateAsync({id:q,title:U,description:x.description??null,connection_type:x.connection_type,connection_url:x.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:x.created_by,organization_id:x.organization_id,icon:x.icon??null,app_name:x.app_name??null,app_id:x.app_id??null,connection_headers:x.connection_headers??null,oauth_config:null,configuration_state:x.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/api/${p.slug}/mcp/${q}`,window.location.origin),Z=await Fe({url:K.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await T(q)}finally{b(!1)}}}),t.jsx(ns,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(as,{tools:r,prompts:o,resources:a,connectionId:e,org:n})})]})})]})})]})}function gs(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);let i;s[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/settings/connections/$appSlug"},s[1]=i):i=s[1];const{appSlug:r,org:o}=ze(i),{org:a}=J(),c=_e();let m;s[2]!==r?(m={slug:r},s[2]=r,s[3]=m):m=s[3];const d=et(m),u=d[0]??null,p=u?.id??"",l=p||null;let f;s[4]!==a.id||s[5]!==a.slug||s[6]!==l?(f={connectionId:l,orgId:a.id,orgSlug:a.slug},s[4]=a.id,s[5]=a.slug,s[6]=l,s[7]=f):f=s[7];const g=ae(f);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=st(v);let j;if(s[10]!==u?.tools||s[11]!==p||s[12]!==d||s[13]!==b){const T=b?b.tools.map(_s):(u?.tools??[]).map(ys);e:{if(d.length<=1){j=T;break e}const z=new Set,E=[],x=bs;for(const $ of d){const D=$.id===p?T:x($.tools);for(const U of D)z.has(U.name)||(z.add(U.name),E.push(U))}j=E.length>0?E:T}s[10]=u?.tools,s[11]=p,s[12]=d,s[13]=b,s[14]=j}else j=s[14];const _=j;let w;s[15]!==g?(w={client:g},s[15]=g,s[16]=w):w=s[16];const{data:S}=rt(w);let N;s[17]!==g?(N={client:g},s[17]=g,s[18]=N):N=s[18];const{data:k}=ot(N);let y;s[19]!==S?.prompts?(y=S?.prompts??[],s[19]=S?.prompts,s[20]=y):y=s[20];let C;s[21]!==y?(C=y.map(vs),s[21]=y,s[22]=C):C=s[22];const I=C;let h;s[23]!==k?.resources?(h=k?.resources??[],s[23]=k?.resources,s[24]=h):h=s[24];let A;s[25]!==h?(A=h.map(js),s[25]=h,s[26]=A):A=s[26];const M=A;if(!u){let T;return s[27]!==n||s[28]!==o?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(be,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(G,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=T):T=s[29],T}let O;return s[30]!==c.update.isPending||s[31]!==_||s[32]!==u||s[33]!==p||s[34]!==o||s[35]!==I||s[36]!==M||s[37]!==d?(O=t.jsx(hs,{org:o,connection:u,connectionId:p,isUpdating:c.update.isPending,tools:_,prompts:I,resources:M,siblings:d}),s[30]=c.update.isPending,s[31]=_,s[32]=u,s[33]=p,s[34]=o,s[35]=I,s[36]=M,s[37]=d,s[38]=O):O=s[38],O}function js(s){return{name:s.name,description:s.description,uri:s.uri}}function vs(s){return{name:s.name,description:s.description}}function bs(s){return(s??[]).map(Ns)}function Ns(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ys(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function _s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ss(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Me,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(gs,{})})}),s[0]=e):e=s[0],e}function Gn(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ss,{}),s[0]=e):e=s[0],e}export{Gn as default};
@@ -1 +0,0 @@
1
- import{e as ie,j as t,E as Ye,r as W,l as ce,s as _e,f as Se,d as Je,b as be,u as Ze,Q as et,R as tt,z as nt,C as st,B,t as te,o as ot,c as re,x as G,G as it,F as lt,K as ct}from"./index-B3GjV7OW.js";import{g as rt}from"./constants-DNYERMOq.js";import{C as at}from"./collection-display-button-QyBcFXO8.js";import{S as dt}from"./search-input-DAsaTE5l.js";import{C as mt}from"./collection-tabs-Bbxi3Lhu.js";import{u as ut,a as Ne,g as pt,C as fe}from"./connection-card-C9ObrVFa.js";import{E as ht}from"./empty-state-CYPi3AWF.js";import{I as xt}from"./integration-icon-dKiJ5-c6.js";import{P as de}from"./index-Bom1zwxj.js";import{u as gt,D as ft}from"./use-delete-connection-6dZbEpz0.js";import{u as jt}from"./use-infinite-scroll-ZPBLdFp5.js";import{u as yt}from"./use-list-state-C6g9hGA4.js";import{g as ke,a as Ct,e as vt}from"./extract-connection-data-Crk93y-a.js";import{g as ue}from"./connection-slug-eyAPH6o3.js";import{c as De,d as Ae,b as we,f as Te,e as Ie,g as Pe,a as Le,A as Oe}from"./alert-dialog-7vNv5N4P.js";import{C as $e}from"./checkbox-CwdZbdGd.js";import{b as Ee,a as ze,c as Fe,d as Me,e as Ve,D as Be}from"./dialog-BcmogFZk.js";import{b as _t,a as St,c as bt,D as Nt,d as kt,e as Dt,f as At}from"./drawer-CFDUaOVL.js";import{u as wt}from"./tooltip-M7OSSLPB.js";import{D as Re,a as Ue,b as He,c as pe}from"./dropdown-menu-NvUf9a-j.js";import{F as Q,b as Y,c as J,d as Z,f as ee,a as Ce}from"./form-BbDiaTsN.js";import{I as oe}from"./input-bkK8ZE7l.js";import{S as Tt,a as It,b as Pt,c as Lt,d as le}from"./select-Dli7sWvO.js";import{T as Ot}from"./textarea-DYbvm35p.js";import{b as Ke,u as $t}from"./use-connection-BTNmhjS_.js";import{u as Et,S as zt}from"./constants-Bad0DdgK.js";import{b as Ft}from"./use-virtual-mcp-CSMhsIFC.js";import{a as Mt,R as Vt}from"./agent-icon-zc2fqM1k.js";import{n as he}from"./Container-Bn1bP0Yi.js";import{i as We}from"./DotsVertical-0NEZeBK_.js";import{s as Xe}from"./RefreshCcw01-2tEGwXNO.js";import{s as ge}from"./Star01-VbAdZ1nM.js";import{s as qe}from"./Plus-Decn041v.js";import{s as Ge}from"./Trash01-BqSCZqrj.js";import{s as Qe}from"./XClose-GzEq-HU9.js";import{i as me,a as ve,E as Bt,c as Rt,p as Ut,b as Ht,d as Kt}from"./connection-form-helpers-CLWU-iGL.js";import"./collections-BXMI7Hvf.js";import"./Check-B7RZVj2P.js";import"./view-mode-toggle-DrXoiKTK.js";import"./badge-C_Ey5yTa.js";import"./SearchMd-xzJx66s8.js";import"./use-registry-connections-BTwHNugi.js";import"./use-organization-settings-DTcFJGZh.js";import"./useInfiniteQuery-96c4mtDU.js";import"./infiniteQueryObserver-RMKX6Nq0.js";import"./card-BqDVz8rB.js";import"./X-Cwv9W6IH.js";import"./use-view-mode-BT7njn-W.js";import"./ChevronRight-B87-4gCD.js";import"./label-DTMz5O44.js";import"./ChevronDown-PN1FfGGP.js";import"./ChevronUp-DXZ6bMcP.js";import"./use-collections-Cy_Omosv.js";import"./AlertCircle-GVxuU95v.js";import"./Tool01-BqlBf1k7.js";import"./ArrowNarrowLeft-CZSxj8rY.js";import"./XCircle-VMAL-xhy.js";import"./ArrowUpRight-C9_9n6RS.js";import"./ZapSquare-CGJC1mww.js";import"./Users03-n9zzJAad.js";import"./CheckCircle-CpSCTcKF.js";import"./Palette-BgYWS9GS.js";import"./LinkExternal01-Cl6M9_6y.js";import"./Lock01-BNDVtNp3.js";import"./Sun-qACU13Q-.js";import"./Play-jAQMD8Zy.js";import"./Settings02-I39qsUEU.js";import"./Shield01-DJsSZNak.js";import"./User01-w8zyOHhj.js";import"./Zap-D93qKeqm.js";function Wt(y){const e=ie.c(51),{group:n,onOpen:g,selectionMode:m,selectedIds:d,onToggleSelect:o}=y;let v;if(e[0]!==n.connections||e[1]!==d){let j;e[3]!==d?(j=R=>d.has(R.id),e[3]=d,e[4]=j):j=e[4],v=n.connections.every(j),e[0]=n.connections,e[1]=d,e[2]=v}else v=e[2];const h=v;let _;if(e[5]!==n.connections||e[6]!==d){let j;e[8]!==d?(j=R=>d.has(R.id),e[8]=d,e[9]=j):j=e[9],_=n.connections.some(j),e[5]=n.connections,e[6]=d,e[7]=_}else _=e[7];const u=_,S=`${n.connections.length} instances`;let x;e[10]!==n.icon||e[11]!==n.title||e[12]!==S?(x={title:n.title,icon:n.icon,description:S},e[10]=n.icon,e[11]=n.title,e[12]=S,e[13]=x):x=e[13];let a;e[14]!==h||e[15]!==n.connections||e[16]!==g||e[17]!==o||e[18]!==d||e[19]!==m?(a=()=>m?(()=>{for(const j of n.connections)h?d.has(j.id)&&o(j.id):d.has(j.id)||o(j.id)})():g(),e[14]=h,e[15]=n.connections,e[16]=g,e[17]=o,e[18]=d,e[19]=m,e[20]=a):a=e[20];const p=m&&h&&"ring-2 ring-primary",f=m&&u&&!h&&"ring-1 ring-primary/50";let k;e[21]!==p||e[22]!==f?(k=re(p,f),e[21]=p,e[22]=f,e[23]=k):k=e[23];let A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(he,{}),e[24]=A):A=e[24];let N;e[25]!==h||e[26]!==n.connections||e[27]!==o||e[28]!==d||e[29]!==m||e[30]!==u?(N=m?t.jsx($e,{checked:h?!0:u?"indeterminate":!1,onCheckedChange:()=>{for(const j of n.connections)h?d.has(j.id)&&o(j.id):d.has(j.id)||o(j.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",n.connections.length]})]}),e[25]=h,e[26]=n.connections,e[27]=o,e[28]=d,e[29]=m,e[30]=u,e[31]=N):N=e[31];const I=m?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let s;e[32]!==I?(s=re("overflow-hidden transition-all duration-150 ease-out",I),e[32]=I,e[33]=s):s=e[33];let D;e[34]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(Ue,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qt,children:t.jsx(We,{size:20})})}),e[34]=D):D=e[34];let M;e[35]!==g?(M=j=>{j.stopPropagation(),g()},e[35]=g,e[36]=M):M=e[36];let $;e[37]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Xe,{size:16}),e[37]=$):$=e[37];let P;e[38]!==M?(P=t.jsxs(Re,{children:[D,t.jsx(He,{align:"end",onClick:Xt,children:t.jsxs(pe,{onClick:M,children:[$,"Open"]})})]}),e[38]=M,e[39]=P):P=e[39];let T;e[40]!==s||e[41]!==P?(T=t.jsx("div",{className:s,children:P}),e[40]=s,e[41]=P,e[42]=T):T=e[42];let z;e[43]!==N||e[44]!==T?(z=t.jsxs("div",{className:"flex items-center gap-1",children:[N,T]}),e[43]=N,e[44]=T,e[45]=z):z=e[45];let F;return e[46]!==z||e[47]!==x||e[48]!==a||e[49]!==k?(F=t.jsx(t.Fragment,{children:t.jsx(fe,{connection:x,onClick:a,className:k,fallbackIcon:A,headerActionsAlwaysVisible:!0,headerActions:z})}),e[46]=z,e[47]=x,e[48]=a,e[49]=k,e[50]=F):F=e[50],F}function Xt(y){return y.stopPropagation()}function qt(y){return y.stopPropagation()}function Gt(y){const e=ie.c(28),{count:n,total:g,onSelectAll:m,onDeselectAll:d,onDelete:o,onAddToAgent:v,onToggleStatus:h,onCancel:_}=y;if(n===0)return null;let u;e[0]!==n?(u=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=u):u=e[1];let S;e[2]!==n||e[3]!==d||e[4]!==m||e[5]!==g?(S=n<g?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:["Select all (",g,")"]}):t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:"Clear selection"}),e[2]=n,e[3]=d,e[4]=m,e[5]=g,e[6]=S):S=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(qe,{size:13}),e[7]=x):x=e[7];let a;e[8]!==v?(a=t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:v,children:[x,"Add to Agent"]}),e[8]=v,e[9]=a):a=e[9];let p;e[10]!==h?(p=t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>h("active"),children:"Enable"}),e[10]=h,e[11]=p):p=e[11];let f;e[12]!==h?(f=t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>h("inactive"),children:"Disable"}),e[12]=h,e[13]=f):f=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ge,{size:13}),e[14]=k):k=e[14];let A;e[15]!==o?(A=t.jsxs(B,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:o,children:[k,"Delete"]}),e[15]=o,e[16]=A):A=e[16];let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Qe,{size:13}),e[17]=N):N=e[17];let I;e[18]!==_?(I=t.jsx(B,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:_,children:N}),e[18]=_,e[19]=I):I=e[19];let s;return e[20]!==u||e[21]!==I||e[22]!==S||e[23]!==a||e[24]!==p||e[25]!==f||e[26]!==A?(s=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:[u,S,a,p,f,A,I]})}),e[20]=u,e[21]=I,e[22]=S,e[23]=a,e[24]=p,e[25]=f,e[26]=A,e[27]=s):s=e[27],s}function Qt(y){const e=ie.c(25),{open:n,onOpenChange:g,agents:m,onConfirm:d}=y,[o,v]=W.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs(Fe,{children:[t.jsx(Me,{children:"Add to Agent"}),t.jsx(Ve,{children:"Select an agent to add the selected connections to."})]}),e[0]=h):h=e[0];let _;e[1]!==m||e[2]!==o?(_=m.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):m.map(N=>t.jsxs("button",{type:"button",onClick:()=>v(N.id),className:re("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",o===N.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(xt,{icon:N.icon,name:N.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:N.title}),N.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:N.description})]})]},N.id)),e[1]=m,e[2]=o,e[3]=_):_=e[3];let u;e[4]!==_?(u=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:_}),e[4]=_,e[5]=u):u=e[5];let S;e[6]!==g?(S=t.jsx(B,{variant:"outline",onClick:()=>g(!1),children:"Cancel"}),e[6]=g,e[7]=S):S=e[7];const x=!o;let a;e[8]!==d||e[9]!==g||e[10]!==o?(a=()=>{o&&(d(o),g(!1),v(null))},e[8]=d,e[9]=g,e[10]=o,e[11]=a):a=e[11];let p;e[12]!==x||e[13]!==a?(p=t.jsx(B,{disabled:x,onClick:a,children:"Add"}),e[12]=x,e[13]=a,e[14]=p):p=e[14];let f;e[15]!==S||e[16]!==p?(f=t.jsxs(Be,{children:[S,p]}),e[15]=S,e[16]=p,e[17]=f):f=e[17];let k;e[18]!==u||e[19]!==f?(k=t.jsxs(ze,{className:"sm:max-w-[400px]",children:[h,u,f]}),e[18]=u,e[19]=f,e[20]=k):k=e[20];let A;return e[21]!==g||e[22]!==n||e[23]!==k?(A=t.jsx(Ee,{open:n,onOpenChange:g,children:k}),e[21]=g,e[22]=n,e[23]=k,e[24]=A):A=e[24],A}function Yt(y){const e=ie.c(20),{open:n,onOpenChange:g,count:m,onConfirm:d}=y,o=m!==1?"s":"";let v;e[0]!==m||e[1]!==o?(v=t.jsxs(De,{children:["Delete ",m," connection",o,"?"]}),e[0]=m,e[1]=o,e[2]=v):v=e[2];const h=m!==1?"s":"";let _;e[3]!==h?(_=t.jsxs(Ae,{children:["This will permanently delete the selected connection",h,". This action cannot be undone."]}),e[3]=h,e[4]=_):_=e[4];let u;e[5]!==v||e[6]!==_?(u=t.jsxs(we,{children:[v,_]}),e[5]=v,e[6]=_,e[7]=u):u=e[7];let S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Te,{children:"Cancel"}),e[8]=S):S=e[8];const x=m!==1?"s":"";let a;e[9]!==m||e[10]!==d||e[11]!==x?(a=t.jsxs(Ie,{children:[S,t.jsxs(Pe,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",m," connection",x]})]}),e[9]=m,e[10]=d,e[11]=x,e[12]=a):a=e[12];let p;e[13]!==u||e[14]!==a?(p=t.jsxs(Le,{children:[u,a]}),e[13]=u,e[14]=a,e[15]=p):p=e[15];let f;return e[16]!==g||e[17]!==n||e[18]!==p?(f=t.jsx(Oe,{open:n,onOpenChange:g,children:p}),e[16]=g,e[17]=n,e[18]=p,e[19]=f):f=e[19],f}function Jt(y){return y._registryId?.includes("community-registry")===!0}function Zt(y){const e=ie.c(56),{item:n,allConnections:g,connectedAppNames:m,connectingItemId:d,onNavigateConnected:o,onConnect:v}=y,[h,_]=W.useState(!1),[u,S]=W.useState(null);let x,a;e[0]!==m||e[1]!==n?(x=ke(n)??"",a=m.has(x),e[0]=m,e[1]=n,e[2]=x,e[3]=a):(x=e[2],a=e[3]);const p=a,f=n._meta?.["mcp.mesh"],k=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",A=n.server?.description||n.description||null;let N;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(N=n.server?.icons?.[0]?.src||Ct(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=N):N=e[6];const I=N;let s;if(e[7]!==g||e[8]!==x){let b;e[10]!==x?(b=se=>se.connection_type!=="VIRTUAL"&&se.app_name===x,e[10]=x,e[11]=b):b=e[11],s=g.filter(b),e[7]=g,e[8]=x,e[9]=s}else s=e[9];const D=s;let M;e[12]!==n?(M=Jt(n),e[12]=n,e[13]=M):M=e[13];const $=M;let P,T;e[14]!==D||e[15]!==$||e[16]!==p||e[17]!==n||e[18]!==v||e[19]!==o?(P=()=>{if(p){const b=D[0];b&&o(b);return}T()},T=()=>{$?(S("connect"),_(!0)):v(n)},e[14]=D,e[15]=$,e[16]=p,e[17]=n,e[18]=v,e[19]=o,e[20]=P,e[21]=T):(P=e[20],T=e[21]);let z;e[22]!==n||e[23]!==v||e[24]!==u?(z=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),_(!1),u==="connect"&&v(n),S(null)},e[22]=n,e[23]=v,e[24]=u,e[25]=z):z=e[25];const F=z;let j;e[26]!==A||e[27]!==I||e[28]!==k?(j={title:k,description:A,icon:I},e[26]=A,e[27]=I,e[28]=k,e[29]=j):j=e[29];let R;e[30]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(he,{}),e[30]=R):R=e[30];let U;e[31]!==$||e[32]!==n._sourceIcon?(U=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[31]=$,e[32]=n._sourceIcon,e[33]=U):U=e[33];let X;e[34]!==d||e[35]!==T||e[36]!==p||e[37]!==n.id?(X=p?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):t.jsx(B,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:d!==null,onClick:b=>{b.stopPropagation(),T()},children:d===n.id?t.jsx(ce,{size:14,className:"animate-spin"}):"Connect"}),e[34]=d,e[35]=T,e[36]=p,e[37]=n.id,e[38]=X):X=e[38];let i;e[39]!==U||e[40]!==X?(i=t.jsxs("div",{className:"flex items-center gap-2",children:[U,X]}),e[39]=U,e[40]=X,e[41]=i):i=e[41];let C;e[42]!==P||e[43]!==i||e[44]!==j?(C=t.jsx(fe,{connection:j,fallbackIcon:R,onClick:P,headerActionsAlwaysVisible:!0,headerActions:i}),e[42]=P,e[43]=i,e[44]=j,e[45]=C):C=e[45];let V;e[46]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs(we,{children:[t.jsx(De,{children:"Community MCP Server"}),t.jsx(Ae,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[46]=V):V=e[46];let H;e[47]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Te,{children:"Cancel"}),e[47]=H):H=e[47];let E;e[48]!==F?(E=t.jsxs(Le,{children:[V,t.jsxs(Ie,{children:[H,t.jsx(Pe,{onClick:F,children:"Continue"})]})]}),e[48]=F,e[49]=E):E=e[49];let l;e[50]!==h||e[51]!==E?(l=t.jsx(Oe,{open:h,onOpenChange:_,children:E}),e[50]=h,e[51]=E,e[52]=l):l=e[52];let O;return e[53]!==C||e[54]!==l?(O=t.jsxs(t.Fragment,{children:[C,l]}),e[53]=C,e[54]=l,e[55]=O):O=e[55],O}function en({listState:y,activeTab:e,typeFilter:n,statusFilter:g,registryFilter:m,enabledRegistries:d}){const{org:o}=_e(),v=ot(),h=Se(),{data:_}=be.useSession(),u=Ke(),S=$t(y),x=gt(),[a,p]=W.useState(new Set),f=a.size>0,[k,A]=W.useState(!1),[N,I]=W.useState(!1),[s,D]=W.useState(null),M=Ft(),$=S.filter(c=>!(n!=="ALL"&&c.connection_type!==n||g!=="ALL"&&c.status!==g)),P=pt($),T=c=>{p(r=>{const w=new Set(r);return w.has(c)?w.delete(c):w.add(c),w})},z=()=>{p(new Set)},F=Ne(d,y.searchTerm),j=F.items,R=jt(F.loadMore,F.hasMore,F.isLoadingMore),U=new Set(S.filter(c=>c.app_name).map(c=>c.app_name)),X=m==="ALL"||d.some(c=>c.id===m)?m:"ALL",i=y.search.length>0,C=e==="all"||i?j.filter(c=>{if(X!=="ALL"&&c._registryId!==X)return!1;if(i){const r=ke(c);if(r&&U.has(r))return!1}return!0}):[],V=e==="connected"||i?P:[],H=async c=>{if(!(!o||!_?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:c.id,source:"connections_page"}),D(c.id);try{const r=vt(c,o.id,_.user.id,{remoteIndex:0}),w=r.connection_type==="STDIO",L=!!r.connection_url,q=w&&r.connection_headers&&typeof r.connection_headers=="object"&&"command"in r.connection_headers;if(!L&&!q){G.error("This MCP Server cannot be connected: no connection method available"),D(null);return}const{id:K}=await u.create.mutateAsync(r),je=new URL(`/api/${o.slug}/mcp/${K}`,window.location.origin),ye=await it({url:je.href,token:null,orgId:o.id});if(ye.supportsOAuth&&!ye.isAuthenticated){const{token:ae,tokenInfo:ne,error:xe}=await lt({connectionId:K,orgSlug:o.slug,scope:"offline_access"});if(xe||!ae){te("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:xe??"no_token"}),G.error(`Authentication failed: ${xe??"no token received"}`);return}else{if(te("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),ne)try{(await fetch(`/api/${o.slug}/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:ne.accessToken,refreshToken:ne.refreshToken,expiresIn:ne.expiresIn,scope:ne.scope,clientId:ne.clientId,clientSecret:ne.clientSecret,tokenEndpoint:ne.tokenEndpoint})})).ok?await u.update.mutateAsync({id:K,data:{}}):await u.update.mutateAsync({id:K,data:{connection_token:ae}})}catch{await u.update.mutateAsync({id:K,data:{connection_token:ae}})}else await u.update.mutateAsync({id:K,data:{connection_token:ae}});await v.invalidateQueries({queryKey:ct.isMCPAuthenticated(je.href,null)}),G.success("Authentication successful")}}G.success("Connected successfully")}catch(r){G.error(`Failed to connect: ${r instanceof Error?r.message:String(r)}`)}finally{D(null)}}},E=Et({connectionId:zt,orgId:o.id,orgSlug:o.slug}),l=()=>{v.invalidateQueries({predicate:c=>{const r=c.queryKey;return r[1]===o.id&&r[3]==="collection"&&r[4]==="CONNECTIONS"}})},O=async()=>{A(!1);const c=[...a];te("connections_bulk_delete",{count:c.length});let r=0;for(const w of c)try{(await E.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:w,force:!0}})).isError||r++}catch{}l(),G.success(`Deleted ${r} connection${r!==1?"s":""}`),z()},b=async c=>{const r=[...a];te("connections_bulk_status_toggled",{count:r.length,to_status:c});let w=0;for(const L of r)try{await u.update.mutateAsync({id:L,data:{status:c}}),w++}catch{}l(),G.success(`${c==="active"?"Enabled":"Disabled"} ${w} connection${w!==1?"s":""}`),z()},se=async c=>{const r=M.find(q=>q.id===c);if(!r||!E)return;te("connections_bulk_add_to_agent",{agent_id:c,count:a.size});const w=new Set(r.connections.map(q=>q.connection_id)),L=[...a].filter(q=>!w.has(q)).map(q=>({connection_id:q,selected_tools:null,selected_resources:null,selected_prompts:null}));if(L.length===0){G.info("All selected connections are already in that agent");return}try{await E.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:c,data:{connections:[...r.connections,...L]}}}),v.invalidateQueries({predicate:q=>{const K=q.queryKey;return K[1]===o.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),G.success(`Added ${L.length} connection${L.length!==1?"s":""} to "${r.title}"`),z()}catch{G.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(ft,{...x}),t.jsx(Yt,{open:k,onOpenChange:A,count:a.size,onConfirm:O}),t.jsx(Qt,{open:N,onOpenChange:I,agents:M,onConfirm:se}),F.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(i?C.length===0&&$.length===0:e==="all"?C.length===0:$.length===0)?t.jsx(ht,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:y.search?`No Connections match "${y.search}"`:"Create a connection to get started."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[V.map(c=>{if(c.type==="group")return t.jsx(Wt,{group:c,onOpen:()=>{h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:c.key}})},selectionMode:f,selectedIds:a,onToggleSelect:T},c.key);const r=c.connection,w=a.has(r.id);return t.jsx(fe,{connection:r,fallbackIcon:t.jsx(he,{}),onClick:()=>f?T(r.id):h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(r)}}),className:re(w&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[f?t.jsx($e,{checked:w,onCheckedChange:()=>T(r.id),onClick:L=>L.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:re("overflow-hidden transition-all duration-150 ease-out",f?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(Re,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:L=>L.stopPropagation(),children:t.jsx(We,{size:20})})}),t.jsxs(He,{align:"end",onClick:L=>L.stopPropagation(),children:[t.jsxs(pe,{onClick:L=>{L.stopPropagation(),h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(r)}})},children:[t.jsx(Xe,{size:16}),"Open"]}),t.jsxs(pe,{onClick:L=>{L.stopPropagation(),T(r.id)},children:[t.jsx(Vt,{size:16}),"Select"]}),t.jsxs(pe,{variant:"destructive",onClick:L=>{L.stopPropagation(),x.requestDelete(r)},children:[t.jsx(Ge,{size:16}),"Delete"]})]})]})})]})},r.id)}),C.map(c=>t.jsx(Zt,{item:c,allConnections:S,connectedAppNames:U,connectingItemId:s,onNavigateConnected:r=>h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(r)}}),onConnect:H},`catalog-${c._registryId}:${c.id}`)),(e==="all"||i)&&d.length>0&&t.jsx("div",{ref:R,className:"col-span-full h-4"}),(e==="all"||i)&&F.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ce,{size:24,className:"animate-spin text-muted-foreground"})})]})}),f&&t.jsx(Gt,{count:a.size,total:$.length,onSelectAll:()=>{p(new Set($.map(c=>c.id)))},onDeselectAll:()=>p(new Set),onDelete:()=>A(!0),onAddToAgent:()=>I(!0),onToggleStatus:b,onCancel:z})]})}function tn(){const{org:y}=_e(),e=Se(),n=Je({strict:!1}),{data:g}=be.useSession(),{stdioEnabled:m}=Ze(),d=wt(),o=yt({namespace:y.slug,resource:"connections"}),v=Ke(),[h,_]=et(tt.connectionsTab(y.slug),i=>n.tab==="all"||n.tab==="connected"?n.tab:i??"all"),[u,S]=W.useState("ALL"),[x,a]=W.useState("ALL"),[p,f]=W.useState("ALL"),k=ut(),N=Ne(k,o.searchTerm).items,I=o.search!==o.searchTerm,s=nt({resolver:st(Rt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),D=s.watch("ui_type"),M=s.watch("connection_url"),$=s.watch("npx_package"),P=me({uiType:D,connectionUrl:M??"",npxPackage:$??""})??ve({uiType:D,connectionUrl:M??"",registryItems:N}),T=n.action==="create",z=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:y.slug},search:{action:"create"}})},F=()=>{e({to:"/$org/settings/connections",params:{org:y.slug},search:{}})},j=async i=>{let C,V=null,H=null,E=null;i.ui_type==="NPX"?(C="STDIO",V="",E=Ht(i.npx_package||"",i.env_vars||[])):i.ui_type==="STDIO"?(C="STDIO",V="",E=Kt(i.stdio_command||"",i.stdio_args||"",i.stdio_cwd,i.env_vars||[])):(C=i.ui_type,V=i.connection_url||"",H=i.connection_token||null);const l=rt("conn");te("connection_custom_created",{connection_type:C,ui_type:i.ui_type}),await v.create.mutateAsync({id:l,title:i.title,description:i.description||null,connection_type:C,connection_url:V,connection_token:H,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:g?.user?.id||"system",organization_id:y.id,icon:i.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),F(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:y.slug,appSlug:ue({app_name:null,connection_url:V,title:i.title,id:l})}})},R=i=>{i||(T&&F(),s.reset())},U=i=>{const C=i.trim();if(!C)return;const V=!!s.formState.dirtyFields.title,H=!!s.formState.dirtyFields.description,E=!!s.formState.dirtyFields.env_vars,l=b=>{if(b&&(!V&&!s.getValues("title").trim()&&b.title&&s.setValue("title",b.title,{shouldDirty:!1}),!H&&!(s.getValues("description")??"").trim()&&b.description&&s.setValue("description",b.description,{shouldDirty:!1}),!E&&b.envVarKeys?.length)){const se=s.getValues("env_vars")??[],c=new Set(se.map(w=>w.key)),r=b.envVarKeys.filter(w=>!c.has(w));r.length>0&&s.setValue("env_vars",[...se,...r.map(w=>({key:w,value:""}))],{shouldDirty:!0})}},O=Ut(C);if(O&&m){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",O.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),l(me({uiType:"NPX",npxPackage:O.packageName}));return}if(C.startsWith("http://")||C.startsWith("https://")){const b=D==="HTTP"||D==="SSE"||D==="Websocket"?D:"HTTP";s.setValue("ui_type",b,{shouldDirty:!0}),s.setValue("connection_url",C,{shouldDirty:!0}),l(me({uiType:b,connectionUrl:C})??ve({uiType:b,connectionUrl:C,registryItems:N}));return}D==="NPX"&&l(me({uiType:"NPX",npxPackage:C}))},X=t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(B,{variant:"outline",onClick:z,children:[t.jsx(qe,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})});return t.jsx(t.Fragment,{children:t.jsxs(de,{children:[(()=>{const i="Create Connection",C="Create a custom connection in your organization. Fill in the details below.",V=s.formState.isSubmitting?"Saving...":"Create Connection",H=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:s.control,name:"ui_type",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Type *"}),t.jsxs(Tt,{value:l.value,onValueChange:l.onChange,children:[t.jsx(Z,{children:t.jsx(It,{children:t.jsx(Pt,{})})}),t.jsxs(Lt,{children:[t.jsx(le,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(le,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(le,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"Websocket"]})}),m&&t.jsxs(t.Fragment,{children:[t.jsx(le,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(he,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(le,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Mt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),D==="NPX"&&t.jsx(Q,{control:s.control,name:"npx_package",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"@perplexity-ai/mcp-server",...l,value:l.value??"",onPaste:O=>{const b=O.clipboardData.getData("text");b&&(O.preventDefault(),s.setValue("npx_package",b.trim(),{shouldDirty:!0}),U(b))},onBlur:O=>{U(O.target.value),l.onBlur()}})}),t.jsx(ee,{})]})}),D==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:s.control,name:"stdio_command",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Command *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"node, bun, python...",...l,value:l.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"stdio_args",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"arg1 arg2 --flag value",...l,value:l.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"stdio_cwd",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"/path/to/project (optional)",...l,value:l.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(D==="NPX"||D==="STDIO")&&t.jsx(Q,{control:s.control,name:"env_vars",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Bt,{value:l.value??[],onChange:l.onChange})}),t.jsx(ee,{})]})}),D!=="NPX"&&D!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:s.control,name:"connection_url",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"URL *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"https://example.com/mcp",...l,value:l.value??"",onPaste:O=>{const b=O.clipboardData.getData("text");b&&(O.preventDefault(),s.setValue("connection_url",b.trim(),{shouldDirty:!0}),U(b))},onBlur:O=>{U(O.target.value),l.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"connection_token",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:P?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(oe,{type:"password",placeholder:P?.token?.placeholder??"Bearer token or API key",...l,value:l.value??""})}),P?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.token.helperText,P.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(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"title",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Name *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"My Connection",...l})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"description",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Description"}),t.jsx(Z,{children:t.jsx(Ot,{placeholder:"A brief description of this connection",rows:3,...l,value:l.value??""})}),t.jsx(ee,{})]})})]}),E=T;return d?t.jsx(_t,{open:E,onOpenChange:R,children:t.jsxs(St,{className:"max-h-[90vh]",children:[t.jsx(bt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Nt,{children:i}),t.jsx(kt,{className:"mt-1",children:C})]}),t.jsx(Dt,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Qe,{size:16})})})]})}),t.jsx(Ce,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(j),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:H}),t.jsx(At,{children:t.jsx(B,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(Ee,{open:E,onOpenChange:R,children:t.jsxs(ze,{className:"sm:max-w-[525px]",children:[t.jsxs(Fe,{children:[t.jsx(Me,{children:i}),t.jsx(Ve,{children:C})]}),t.jsx(Ce,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(j),children:[t.jsx("div",{className:"py-4",children:H}),t.jsxs(Be,{children:[t.jsx(B,{type:"button",variant:"outline",onClick:()=>R(!1),children:"Cancel"}),t.jsx(B,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),t.jsx(de.Content,{children:t.jsx(de.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(de.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(dt,{value:o.search,onChange:o.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(o.setSearch(""),i.target.blur())}}),t.jsx(at,{sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.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:u,onChange:i=>S(i||"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:x,onChange:i=>a(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},...k.length>1?[{label:"Registry",value:p,onChange:i=>f(i||"ALL"),options:[{id:"ALL",label:"All registries"},...k.map(i=>({id:i.id,label:i.id.includes("community-registry")?"Community MCP Registry":i.title}))]}]:[]]})]}),X]}),t.jsx(mt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:h,onTabChange:i=>{const C=i;C!==h&&te("connections_page_tab_changed",{to_tab:C}),_(C)}}),t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:I?.5:1,transition:I?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:I?"none":"auto"},children:t.jsx(en,{listState:o,activeTab:h,typeFilter:u,statusFilter:x,registryFilter:p,enabledRegistries:k})})})]})})})]})})}function Cs(){const y=ie.c(1);let e;return y[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(tn,{})})}),y[0]=e):e=y[0],e}export{Cs as default};
@@ -1 +0,0 @@
1
- import{f as re,s as ce,o as de,z as me,C as ue,a as fe,t as Y,x as V,K as te,j as s,D as se,H as ge,J as W,e as L,r as H,B as G,c as xe,M as pe}from"./index-B3GjV7OW.js";import{P as q}from"./index-Bom1zwxj.js";import{u as he}from"./use-org-auth-client-C0e9yR_n.js";import{u as je}from"./use-debounced-autosave-CO57B6nX.js";import{A as ve}from"./avatar-Dda8SxzC.js";import{I as be}from"./input-bkK8ZE7l.js";import{S as X,a as Z,b as Q,c as ye,d as Se}from"./settings-section-DBJaYBiY.js";import{D as Ne}from"./domain-settings-QGlFO294.js";import{u as Ce,a as ne,D as we,c as _e,S as ze,v as De,K as Ae,P as ke,d as Pe,C as Ie,s as Ee,b as Oe,e as Te}from"./collection-search-BPpIzKqG.js";import{W as ee,i as Re}from"./constants-Bad0DdgK.js";import{b as le}from"./use-virtual-mcp-CSMhsIFC.js";import{b as Fe,P as Le,a as $e}from"./popover-a3tMurU4.js";import{S as Me}from"./skeleton-H0I9mnBy.js";import{y as Be}from"./agent-icon-zc2fqM1k.js";import{s as Ve}from"./Plus-Decn041v.js";import{a as ae}from"./Users03-n9zzJAad.js";import{i as He}from"./X-Cwv9W6IH.js";import{I as J}from"./integration-icon-dKiJ5-c6.js";import{a as Ke,d as Ue}from"./use-organization-settings-DTcFJGZh.js";import"./tooltip-M7OSSLPB.js";import"./User01-w8zyOHhj.js";import"./card-BqDVz8rB.js";import"./ArrowUpRight-C9_9n6RS.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./switch-BdqZBTdM.js";import"./SearchMd-xzJx66s8.js";import"./use-collections-Cy_Omosv.js";import"./AlertCircle-GVxuU95v.js";import"./Tool01-BqlBf1k7.js";import"./XClose-GzEq-HU9.js";import"./RefreshCcw01-2tEGwXNO.js";import"./ArrowNarrowLeft-CZSxj8rY.js";import"./XCircle-VMAL-xhy.js";import"./ZapSquare-CGJC1mww.js";import"./CheckCircle-CpSCTcKF.js";import"./Check-B7RZVj2P.js";import"./ChevronDown-PN1FfGGP.js";import"./ChevronRight-B87-4gCD.js";import"./ChevronUp-DXZ6bMcP.js";import"./DotsVertical-0NEZeBK_.js";import"./Container-Bn1bP0Yi.js";import"./Star01-VbAdZ1nM.js";import"./Palette-BgYWS9GS.js";import"./LinkExternal01-Cl6M9_6y.js";import"./Lock01-BNDVtNp3.js";import"./Sun-qACU13Q-.js";import"./Play-jAQMD8Zy.js";import"./Settings02-I39qsUEU.js";import"./Shield01-DJsSZNak.js";import"./Trash01-BqSCZqrj.js";import"./Zap-D93qKeqm.js";const qe=ge({name:W().min(1,"Name is required").max(255,"Name is too long"),slug:W().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:W().optional()});function Ge(t){const e=L.c(13),{value:r,onChange:l,name:a,disabled:d}=t,n=H.useRef(null);let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=()=>n.current?.click(),e[0]=j):j=e[0];const u=j;let v;e[1]!==l?(v=z=>{const p=z.target.files?.[0];if(!p)return;if(p.size>2097152){V.error("Image must be smaller than 2MB");return}const b=new FileReader;b.onerror=We,b.onloadend=()=>{b.result&&l(b.result),n.current&&(n.current.value="")},b.readAsDataURL(p)},e[1]=l,e[2]=v):v=e[2];const o=v;let i;e[3]!==d||e[4]!==o?(i=s.jsx("input",{ref:n,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:d}),e[3]=d,e[4]=o,e[5]=i):i=e[5];const m=r||void 0,g=a??"?";let f;e[6]!==m||e[7]!==g?(f=s.jsx(ve,{url:m,fallback:g,shape:"square",size:"base"}),e[6]=m,e[7]=g,e[8]=f):f=e[8];let x;return e[9]!==d||e[10]!==i||e[11]!==f?(x=s.jsxs("button",{type:"button",onClick:u,disabled:d,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[i,f]}),e[9]=d,e[10]=i,e[11]=f,e[12]=x):x=e[12],x}function We(){return V.error("Failed to read image")}function Qe(){const t=re(),{org:e}=ce(),r=he(),l=de(),a=me({resolver:ue(qe),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),d=fe({mutationFn:async o=>{const i={name:o.name,slug:o.slug};o.logo&&(i.logo=o.logo);const m=await r.organization.update({data:i});if(m?.error)throw new Error(m.error.message||"Failed to update organization");return m},onSuccess:(o,i)=>{Y("organization_settings_updated",{organization_id:e.id,fields:Object.keys(i)}),l.invalidateQueries({queryKey:te.organizations()}),l.invalidateQueries({queryKey:te.activeOrganization(e.slug)}),V.success("Organization updated successfully"),o?.data?.slug&&o.data.slug!==e.slug&&t({to:"/$org/settings/general",params:{org:o.data.slug}})},onError:(o,i)=>{Y("organization_settings_update_failed",{organization_id:e.id,fields:Object.keys(i),error:o instanceof Error?o.message:String(o)}),V.error(o instanceof Error?o.message:"Failed to update organization")}}),{schedule:n,flush:j}=je({save:async()=>{const o=a.control._formState.dirtyFields;if(Object.keys(o).length===0||!await a.trigger())return;const m=a.getValues(),g=a.control._defaultValues;a.reset(m,{keepValues:!0});try{await d.mutateAsync(m)}catch{a.reset(g,{keepValues:!0})}}}),u=a.formState.errors,v=typeof window<"u"?`${window.location.host}/`:"";return s.jsx(X,{children:s.jsxs(Z,{children:[s.jsx(Q,{title:"Logo",description:"Recommended size is 256x256px",action:s.jsx(Ge,{value:a.watch("logo"),onChange:o=>{a.setValue("logo",o??"",{shouldDirty:!0}),j()},name:a.watch("name")})}),s.jsx(Q,{title:"Name",action:s.jsx(se,{control:a.control,name:"name",render:({field:o})=>s.jsx(be,{id:"org-name",...o,onChange:i=>{o.onChange(i),n()},onBlur:()=>{o.onBlur(),j()},placeholder:"Organization name",className:"w-[280px]"})})}),s.jsx(Q,{title:"URL",action:s.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[v&&s.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:v}),s.jsx(se,{control:a.control,name:"slug",render:({field:o})=>s.jsx("input",{id:"org-slug",value:o.value??"",name:o.name,ref:o.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:i=>{const m=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");a.setValue("slug",m,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),n()},onBlur:()=>{o.onBlur(),j()}})})]})}),(u.name||u.slug||u.logo)&&s.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[u.name&&s.jsx("p",{className:"text-xs text-destructive",children:u.name.message}),u.slug&&s.jsx("p",{className:"text-xs text-destructive",children:u.slug.message}),u.logo&&s.jsx("p",{className:"text-xs text-destructive",children:u.logo.message})]})]})})}const oe=["site-editor","site-diagnostics","ai-image","ai-research"],ie=8;function Ye(t,e,r){const l=e.find(d=>d.id===t);if(l)return{id:l.id,title:l.title,icon:l.icon,kind:"template"};const a=r.find(d=>d.id===t);return a?{id:t,title:a.title,icon:a.icon??null,kind:"custom"}:{id:t,title:t,icon:null,kind:"missing"}}function Je(t){const e=L.c(39),{agent:r,onRemove:l}=t;let a;e[0]!==r.id?(a={id:r.id},e[0]=r.id,e[1]=a):a=e[1];const{attributes:d,listeners:n,setNodeRef:j,transform:u,transition:v,isDragging:o}=Pe(a);let i;e[2]!==u?(i=Ie.Transform.toString(u),e[2]=u,e[3]=i):i=e[3];const m=o?.5:void 0,g=o?100:void 0;let f;e[4]!==i||e[5]!==m||e[6]!==g||e[7]!==v?(f={transform:i,transition:v,opacity:m,zIndex:g},e[4]=i,e[5]=m,e[6]=g,e[7]=v,e[8]=f):f=e[8];const x=f,z=o&&"shadow-lg";let p;e[9]!==z?(p=xe("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",z),e[9]=z,e[10]=p):p=e[10];const b=`Drag to reorder ${r.title}`;let D;e[11]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Be,{size:14}),e[11]=D):D=e[11];let P;e[12]!==d||e[13]!==n||e[14]!==b?(P=s.jsx("button",{type:"button",...d,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":b,children:D}),e[12]=d,e[13]=n,e[14]=b,e[15]=P):P=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ae,{size:14}),e[16]=N):N=e[16];let w;e[17]!==r.icon||e[18]!==r.title?(w=s.jsx(J,{icon:r.icon,name:r.title,size:"xs",fallbackIcon:N}),e[17]=r.icon,e[18]=r.title,e[19]=w):w=e[19];let y;e[20]!==r.title?(y=s.jsx("span",{className:"text-sm text-foreground truncate",children:r.title}),e[20]=r.title,e[21]=y):y=e[21];const _=r.kind==="template"?"Template":r.kind==="custom"?"Custom agent":"Unavailable";let h;e[22]!==_?(h=s.jsx("span",{className:"text-xs text-muted-foreground",children:_}),e[22]=_,e[23]=h):h=e[23];let S;e[24]!==y||e[25]!==h?(S=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[y,h]}),e[24]=y,e[25]=h,e[26]=S):S=e[26];const I=`Remove ${r.title}`;let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(He,{size:14}),e[27]=A):A=e[27];let C;e[28]!==l||e[29]!==I?(C=s.jsx("button",{type:"button",onClick:l,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":I,children:A}),e[28]=l,e[29]=I,e[30]=C):C=e[30];let k;return e[31]!==j||e[32]!==x||e[33]!==P||e[34]!==w||e[35]!==S||e[36]!==C||e[37]!==p?(k=s.jsxs("div",{ref:j,style:x,className:p,children:[P,w,S,C]}),e[31]=j,e[32]=x,e[33]=P,e[34]=w,e[35]=S,e[36]=C,e[37]=p,e[38]=k):k=e[38],k}function Xe(t){const e=L.c(48),{selectedIds:r,onAdd:l}=t,[a,d]=H.useState(!1),[n,j]=H.useState(""),u=le();let v;e[0]!==r?(v=new Set(r),e[0]=r,e[1]=v):v=e[1];const o=v;let i,m,g,f,x,z,p,b,D,P,N,w,y;if(e[2]!==u||e[3]!==l||e[4]!==a||e[5]!==n||e[6]!==o){const A=n.toLowerCase();f=ee.filter(c=>!o.has(c.id)&&(!n||c.title.toLowerCase().includes(A)));let C;e[20]!==o?(C=c=>c.id!==null&&!Re(c.id)&&!o.has(c.id),e[20]=o,e[21]=C):C=e[21],g=u.filter(C).filter(c=>!n||c.title.toLowerCase().includes(A));let k;e[22]!==l?(k=c=>{l(c),d(!1),j("")},e[22]=l,e[23]=k):k=e[23];const O=k;m=Fe,w=a,y=d,e[24]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Le,{asChild:!0,children:s.jsxs(G,{type:"button",variant:"outline",size:"sm",children:[s.jsx(Ve,{size:14}),"Add agent"]})}),e[24]=x):x=e[24],i=$e,D="w-[320px] p-0 overflow-hidden",P="start",e[25]!==n?(N=s.jsx(Te,{value:n,onChange:j,placeholder:"Search agents..."}),e[25]=n,e[26]=N):N=e[26],z="max-h-[320px] overflow-y-auto p-2 flex flex-col gap-3",p=f.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Templates"}),f.map(c=>s.jsxs("button",{type:"button",onClick:()=>O(c.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(J,{icon:c.icon,name:c.title,size:"xs"}),s.jsx("span",{className:"text-sm truncate",children:c.title})]},c.id))]}),b=g.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Custom agents"}),g.map(c=>s.jsxs("button",{type:"button",onClick:()=>O(c.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(J,{icon:c.icon,name:c.title,size:"xs",fallbackIcon:s.jsx(ae,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:c.title})]},c.id))]}),e[2]=u,e[3]=l,e[4]=a,e[5]=n,e[6]=o,e[7]=i,e[8]=m,e[9]=g,e[10]=f,e[11]=x,e[12]=z,e[13]=p,e[14]=b,e[15]=D,e[16]=P,e[17]=N,e[18]=w,e[19]=y}else i=e[7],m=e[8],g=e[9],f=e[10],x=e[11],z=e[12],p=e[13],b=e[14],D=e[15],P=e[16],N=e[17],w=e[18],y=e[19];let _;e[27]!==g||e[28]!==f.length||e[29]!==n?(_=f.length===0&&g.length===0&&s.jsx("div",{className:"text-xs text-muted-foreground text-center py-6",children:n?"No agents found":"All agents are already added"}),e[27]=g,e[28]=f.length,e[29]=n,e[30]=_):_=e[30];let h;e[31]!==_||e[32]!==z||e[33]!==p||e[34]!==b?(h=s.jsxs("div",{className:z,children:[p,b,_]}),e[31]=_,e[32]=z,e[33]=p,e[34]=b,e[35]=h):h=e[35];let S;e[36]!==i||e[37]!==h||e[38]!==D||e[39]!==P||e[40]!==N?(S=s.jsxs(i,{className:D,align:P,children:[N,h]}),e[36]=i,e[37]=h,e[38]=D,e[39]=P,e[40]=N,e[41]=S):S=e[41];let I;return e[42]!==m||e[43]!==x||e[44]!==S||e[45]!==w||e[46]!==y?(I=s.jsxs(m,{open:w,onOpenChange:y,children:[x,S]}),e[42]=m,e[43]=x,e[44]=S,e[45]=w,e[46]=y,e[47]=I):I=e[47],I}function Ze(){const t=L.c(61),e=Ke(),r=le(),l=Ue();let a;t[0]!==e?.ids?(a=e?.ids??[...oe],t[0]=e?.ids,t[1]=a):a=t[1];const d=a,[n,j]=H.useState(d);let u;t[2]!==n||t[3]!==d?(u=n.length!==d.length||n.some((E,T)=>E!==d[T]),t[2]=n,t[3]=d,t[4]=u):u=t[4];const v=u;let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o={activationConstraint:{distance:5}},t[5]=o):o=t[5];let i;t[6]===Symbol.for("react.memo_cache_sentinel")?(i={coordinateGetter:Ee},t[6]=i):i=t[6];const m=Ce(ne(ke,o),ne(Ae,i));let g;t[7]!==n?(g=E=>{const{active:T,over:R}=E;if(!R||T.id===R.id)return;const F=n.indexOf(T.id),U=n.indexOf(R.id);F===-1||U===-1||j(Oe([...n],F,U))},t[7]=n,t[8]=g):g=t[8];const f=g;let x;t[9]!==n?(x=E=>{n.includes(E)||j([...n,E])},t[9]=n,t[10]=x):x=t[10];const z=x;let p;t[11]!==n?(p=E=>{j(n.filter(T=>T!==E))},t[11]=n,t[12]=p):p=t[12];const b=p;let D;t[13]===Symbol.for("react.memo_cache_sentinel")?(D=()=>{j([...oe])},t[13]=D):D=t[13];const P=D;let N;t[14]!==n||t[15]!==l?(N=()=>{l.mutate({ids:n},{onSuccess:()=>{Y("default_home_agents_updated",{count:n.length,template_count:n.filter(tt).length}),V.success("Default home agents updated")},onError:et})},t[14]=n,t[15]=l,t[16]=N):N=t[16];const w=N;let y,_,h,S,I,A,C;if(t[17]!==r||t[18]!==n||t[19]!==f||t[20]!==b||t[21]!==m||t[22]!==l.isPending){let E;t[30]!==r?(E=F=>Ye(F,ee,r),t[30]=r,t[31]=E):E=t[31];const T=n.map(E);h=Math.max(0,n.length-ie),_=X,I="Default home agents";let R;t[32]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(pe,{size:14}),t[32]=R):R=t[32],t[33]!==l.isPending?(A=s.jsxs(G,{type:"button",variant:"ghost",size:"sm",onClick:P,disabled:l.isPending,children:[R,"Reset defaults"]}),t[33]=l.isPending,t[34]=A):A=t[34],y=Z,C="px-5 py-5 flex flex-col gap-3",S=T.length===0?s.jsx("div",{className:"rounded-lg border border-dashed border-border p-6 text-center text-xs text-muted-foreground",children:'No agents selected. The home view will only show "Create agent".'}):s.jsx(we,{sensors:m,collisionDetection:_e,onDragEnd:f,children:s.jsx(ze,{items:n,strategy:De,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:T.map((F,U)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[U===ie&&s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1 text-xs text-muted-foreground",children:[s.jsx("div",{className:"flex-1 h-px bg-border"}),s.jsx("span",{children:"Below this line is hidden on the home view"}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),s.jsx(Je,{agent:F,onRemove:()=>b(F.id)})]},F.id))})})}),t[17]=r,t[18]=n,t[19]=f,t[20]=b,t[21]=m,t[22]=l.isPending,t[23]=y,t[24]=_,t[25]=h,t[26]=S,t[27]=I,t[28]=A,t[29]=C}else y=t[23],_=t[24],h=t[25],S=t[26],I=t[27],A=t[28],C=t[29];let k;t[35]!==n||t[36]!==z?(k=s.jsx(Xe,{selectedIds:n,onAdd:z}),t[35]=n,t[36]=z,t[37]=k):k=t[37];let O;t[38]!==h?(O=h>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[h," agent",h===1?"":"s"," won't fit on the home view"]}),t[38]=h,t[39]=O):O=t[39];let c;t[40]!==k||t[41]!==O?(c=s.jsxs("div",{className:"flex items-center justify-between",children:[k,O]}),t[40]=k,t[41]=O,t[42]=c):c=t[42];let $;t[43]!==S||t[44]!==c||t[45]!==C?($=s.jsxs("div",{className:C,children:[S,c]}),t[43]=S,t[44]=c,t[45]=C,t[46]=$):$=t[46];let M;t[47]!==w||t[48]!==d||t[49]!==v||t[50]!==l.isPending?(M=v&&s.jsxs(ye,{children:[s.jsx(G,{type:"button",variant:"outline",onClick:()=>j(d),disabled:l.isPending,children:"Cancel"}),s.jsx(G,{type:"button",onClick:w,disabled:l.isPending,children:l.isPending?"Saving…":"Save"})]}),t[47]=w,t[48]=d,t[49]=v,t[50]=l.isPending,t[51]=M):M=t[51];let B;t[52]!==y||t[53]!==$||t[54]!==M?(B=s.jsxs(y,{children:[$,M]}),t[52]=y,t[53]=$,t[54]=M,t[55]=B):B=t[55];let K;return t[56]!==_||t[57]!==I||t[58]!==A||t[59]!==B?(K=s.jsx(_,{title:I,actions:A,children:B}),t[56]=_,t[57]=I,t[58]=A,t[59]=B,t[60]=K):K=t[60],K}function et(t){V.error(t instanceof Error?t.message:"Failed to update default home agents")}function tt(t){return ee.some(e=>e.id===t)}function st(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(X,{title:"Default home agents",children:s.jsx(Z,{children:s.jsx("div",{className:"px-5 py-5 flex flex-col gap-2",children:Array.from({length:4}).map(nt)})})}),t[0]=e):e=t[0],e}function nt(t,e){return s.jsx(Me,{className:"h-12 w-full rounded-lg"},e)}function ot(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(H.Suspense,{fallback:s.jsx(st,{}),children:s.jsx(Ze,{})}),t[0]=e):e=t[0],e}function it(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(q,{children:s.jsx(q.Content,{children:s.jsx(q.Body,{children:s.jsxs(Se,{children:[s.jsx(q.Title,{children:"Organization"}),s.jsx(Qe,{}),s.jsx(Ne,{}),s.jsx(ot,{})]})})})}),t[0]=e):e=t[0],e}function ns(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(it,{}),t[0]=e):e=t[0],e}export{ns as default};
@@ -1 +0,0 @@
1
- import{e as f,j as t,r as h,g as S,O as u,l as _}from"./index-B3GjV7OW.js";import{S as g,a as v,b as y,u as k,c as N,d as T,e as w}from"./index-Bom1zwxj.js";import{u as C}from"./tooltip-M7OSSLPB.js";import{n as P}from"./ZapSquare-CGJC1mww.js";import{u as O,T as j,a as M,b as p,S as R,c as $}from"./index-bUNQ5NEg.js";import{C as I}from"./chat-context-B6Fg09sU.js";import"./X-Cwv9W6IH.js";import"./agent-icon-zc2fqM1k.js";import"./AlertCircle-GVxuU95v.js";import"./Tool01-BqlBf1k7.js";import"./XClose-GzEq-HU9.js";import"./RefreshCcw01-2tEGwXNO.js";import"./ArrowNarrowLeft-CZSxj8rY.js";import"./XCircle-VMAL-xhy.js";import"./ArrowUpRight-C9_9n6RS.js";import"./Users03-n9zzJAad.js";import"./CheckCircle-CpSCTcKF.js";import"./Check-B7RZVj2P.js";import"./ChevronDown-PN1FfGGP.js";import"./ChevronRight-B87-4gCD.js";import"./ChevronUp-DXZ6bMcP.js";import"./DotsVertical-0NEZeBK_.js";import"./Container-Bn1bP0Yi.js";import"./Star01-VbAdZ1nM.js";import"./Palette-BgYWS9GS.js";import"./SearchMd-xzJx66s8.js";import"./LinkExternal01-Cl6M9_6y.js";import"./Lock01-BNDVtNp3.js";import"./Sun-qACU13Q-.js";import"./Play-jAQMD8Zy.js";import"./Plus-Decn041v.js";import"./Settings02-I39qsUEU.js";import"./Shield01-DJsSZNak.js";import"./Trash01-BqSCZqrj.js";import"./User01-w8zyOHhj.js";import"./Zap-D93qKeqm.js";import"./shell-layout-BMRtkmni.js";import"./dialog-BcmogFZk.js";import"./required-auth-layout-CnaH9rpW.js";import"./use-tasks-B6YSkeM5.js";import"./use-collections-Cy_Omosv.js";import"./constants-Bad0DdgK.js";import"./use-organization-settings-DTcFJGZh.js";import"./use-org-sso-BBRAkASE.js";import"./pair-Cbmyley2.js";import"./index-BEwswwod.js";import"./use-copy-CkkAJAvS.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./content-blocks-o63cs2vh.js";import"./types-aUaKAv-0.js";import"./integration-icon-dKiJ5-c6.js";import"./use-virtual-mcp-CSMhsIFC.js";import"./skeleton-H0I9mnBy.js";import"./popover-a3tMurU4.js";import"./drawer-CFDUaOVL.js";import"./avatar-Dda8SxzC.js";import"./alert-dialog-7vNv5N4P.js";import"./form-BbDiaTsN.js";import"./label-DTMz5O44.js";import"./input-bkK8ZE7l.js";import"./index-C3btaY0r.js";import"./use-mcp-tools-BxVuuTSL.js";import"./use-ai-providers-CmHinIUs.js";import"./index-DmMHdsYF.js";import"./switch-BdqZBTdM.js";import"./use-connection-BTNmhjS_.js";import"./lean-canvas-recruit-modal-BAnvgszw.js";import"./use-navigate-to-agent-CSPyzm0t.js";import"./collection-search-FuJrX0DL.js";import"./checkbox-CwdZbdGd.js";import"./extract-connection-data-Crk93y-a.js";import"./constants-DNYERMOq.js";import"./collections-BXMI7Hvf.js";import"./tabs-CeGpUpHP.js";import"./select-Dli7sWvO.js";import"./toggle-group-DXYK5Kmg.js";import"./select-model-BaOTlcuq.js";import"./ai-providers-logos-DD3qZ33J.js";import"./use-debounced-autosave-CO57B6nX.js";import"./settings-section-DBJaYBiY.js";import"./card-BqDVz8rB.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./dropdown-menu-NvUf9a-j.js";import"./index-CvwiLDhg.js";import"./question-004-sINsf4GQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-C9ObrVFa.js";import"./use-registry-connections-BTwHNugi.js";import"./useInfiniteQuery-96c4mtDU.js";import"./infiniteQueryObserver-RMKX6Nq0.js";import"./collection-tabs-Bbxi3Lhu.js";import"./badge-C_Ey5yTa.js";import"./textarea-DYbvm35p.js";import"./connection-form-helpers-CLWU-iGL.js";import"./use-infinite-scroll-ZPBLdFp5.js";import"./useSuspenseInfiniteQuery-HyWQwfY6.js";import"./collection-search-BPpIzKqG.js";import"./use-create-virtual-mcp-BuaKZJs7.js";import"./empty-state-CYPi3AWF.js";import"./use-decopilot-events-CQ1IkvCh.js";import"./create-sse-subscription-CxkOgzKf.js";import"./task-status-CqDAnW9H.js";const z=280;function L(){const e=f.c(2),{tasksOpen:r}=O();if(!r)return null;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={width:`${z}px`},e[0]=o):o=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("aside",{className:"shrink-0 h-full bg-sidebar pb-1",style:o,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"h-full bg-background rounded-[0.75rem] overflow-hidden card-shadow",children:t.jsx(j,{})})})}),e[1]=i):i=e[1],i}function E(){const e=f.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(h.Suspense,{fallback:null,children:t.jsx(L,{})}),e[0]=r):r=e[0],r}function b(){const e=f.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(_,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=r):r=e[0],r}function F(){const e=f.c(18),{setOpenMobile:r,openMobile:o}=k();let i;e[0]!==r?(i=()=>r(!0),e[0]=r,e[1]=i):i=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(P,{size:20}),e[2]=m):m=e[2];let s;e[3]!==i?(s=t.jsx("div",{className:"shrink-0 flex items-center px-2 h-12 bg-background border-b border-border",children:t.jsx("button",{type:"button",onClick:i,className:"flex size-8 shrink-0 items-center justify-center rounded-md text-foreground/60 hover:bg-accent hover:text-foreground transition-colors","aria-label":"Open menu",children:m})}),e[3]=i,e[4]=s):s=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(N,{className:"sr-only",children:"Navigation"}),e[5]=a):a=e[5];let l;e[6]!==r?(l=t.jsx("div",{className:"w-14 shrink-0 bg-sidebar flex flex-col items-center border-r border-border overflow-y-auto group/sidebar","data-state":"collapsed",children:t.jsx($,{onClose:()=>r(!1)})}),e[6]=r,e[7]=l):l=e[7];let n;e[8]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:t.jsx(j,{})}),e[8]=n):n=e[8];let c;e[9]!==l?(c=t.jsxs(T,{side:"left",hideCloseButton:!0,className:"w-[calc(100vw-3rem)] sm:max-w-md! p-0",children:[a,t.jsxs("div",{className:"flex h-full",children:[l,n]})]}),e[9]=l,e[10]=c):c=e[10];let d;e[11]!==o||e[12]!==r||e[13]!==c?(d=t.jsx(w,{open:o,onOpenChange:r,children:c}),e[11]=o,e[12]=r,e[13]=c,e[14]=d):d=e[14];let x;return e[15]!==s||e[16]!==d?(x=t.jsxs(t.Fragment,{children:[s,d]}),e[15]=s,e[16]=d,e[17]=x):x=e[17],x}function It(){const e=f.c(7),r=C();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const m=!!S(o).taskId;let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={"--sidebar-width-icon":"3.5rem"},e[1]=s):s=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(R,{}),e[2]=a):a=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l={background:"transparent",containerType:"inline-size"},e[3]=l):l=e[3];let n;return e[4]!==m||e[5]!==r?(n=t.jsx(g,{defaultOpen:!1,children:t.jsx("div",{className:"flex flex-col h-dvh overflow-hidden",children:t.jsxs(v,{className:"flex-1 bg-sidebar",style:s,children:[a,t.jsx(y,{className:"flex flex-col",style:l,children:t.jsx(I,{children:t.jsx(M,{children:r?t.jsxs(t.Fragment,{children:[!m&&t.jsx(F,{}),t.jsx(h.Suspense,{fallback:t.jsx(b,{}),children:t.jsx(u,{})})]}):t.jsxs(p,{children:[t.jsxs(p.Header,{children:[t.jsxs(p.LeftColumn,{children:[t.jsx(p.Nav,{}),t.jsx(p.TogglesSlot,{})]}),t.jsx(p.CenterSlot,{}),t.jsxs(p.RightColumn,{children:[t.jsx(p.TabsSlot,{}),t.jsx(p.RightSlot,{})]})]}),t.jsxs("div",{className:"flex-1 min-h-0 flex flex-row",children:[m&&t.jsx(E,{}),t.jsx(h.Suspense,{fallback:t.jsx(b,{}),children:t.jsx(u,{})})]})]})})})})]})})}),e[4]=m,e[5]=r,e[6]=n):n=e[6],n}export{It as default};