decocms 4.31.0 → 4.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/dist/client/assets/{AlertCircle-DDN3VPgH.js → AlertCircle-Db_5w_pO.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-BABdYIhs.js → ArrowUpRight-B2VxdxbH.js} +1 -1
  3. package/dist/client/assets/{Check-D9pD98TC.js → Check-VVh423TU.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-eA_D0se8.js → CheckCircle-auAoHYRc.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-CEttVXzH.js → ChevronDown-mDFyCzyV.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-CBhPLqlW.js → ChevronRight-Ceh-WF7H.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-DB19PJr3.js → ChevronUp-D03XJ0vS.js} +1 -1
  8. package/dist/client/assets/{Circle-C_Uwaadc.js → Circle-DNMct17O.js} +1 -1
  9. package/dist/client/assets/{Copy01-BqSpo14R.js → Copy01-CuSfBG1R.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-CZx_5q44.js → DotsVertical-Cr4sUrn_.js} +1 -1
  11. package/dist/client/assets/{Eye-2veooEq8.js → Eye-aR-oC6dj.js} +1 -1
  12. package/dist/client/assets/{FilterLines-Bhsdw1Jp.js → FilterLines-Cr2IL8ug.js} +1 -1
  13. package/dist/client/assets/{Globe01-iaaiJTp8.js → Globe01-DkdmhUM8.js} +1 -1
  14. package/dist/client/assets/{Globe04-Pp6spg9P.js → Globe04-TuZvt3ov.js} +1 -1
  15. package/dist/client/assets/{HardDrive-Bc5tB9pN.js → HardDrive-CrxPr3va.js} +1 -1
  16. package/dist/client/assets/{Key01-gZ5RTwBh.js → Key01-CfvrTjDF.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-BSrZgTU6.js → LayoutLeft-Cog6SqwZ.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-DkCU3S9w.js → LinkExternal01-BYpL3ACE.js} +1 -1
  19. package/dist/client/assets/{List-CNqrF6eE.js → List-D5svP-6k.js} +1 -1
  20. package/dist/client/assets/{Loading02-J8un_7vB.js → Loading02-D2Hh17zb.js} +1 -1
  21. package/dist/client/assets/{Monitor01-CgzOVFpb.js → Monitor01-cNkbuWdj.js} +1 -1
  22. package/dist/client/assets/{Palette-BAAsFrJa.js → Palette-Dz_ldMx7.js} +1 -1
  23. package/dist/client/assets/{Play-B5Yd6Z0i.js → Play-CVarwVeR.js} +1 -1
  24. package/dist/client/assets/{Plus-Cn5an5hF.js → Plus-DNCXili3.js} +1 -1
  25. package/dist/client/assets/{SearchLg-lz9lYchG.js → SearchLg-DvsDitCO.js} +1 -1
  26. package/dist/client/assets/{SearchMd-BELaZlqe.js → SearchMd-87dvi4KF.js} +1 -1
  27. package/dist/client/assets/{Settings02-C66CP-6J.js → Settings02-D7asukv0.js} +1 -1
  28. package/dist/client/assets/{Shield01-JdRvk1Dm.js → Shield01-BT2HQXan.js} +1 -1
  29. package/dist/client/assets/{Star01-CI0kjjiv.js → Star01-B90wIaBV.js} +1 -1
  30. package/dist/client/assets/{Stars01-Bu7Nhnx4.js → Stars01-D1lDEQh2.js} +1 -1
  31. package/dist/client/assets/{Stars02-BgcXdOF8.js → Stars02-LnA0-zz4.js} +1 -1
  32. package/dist/client/assets/{Sun-CWVJFGYw.js → Sun-DLqplG3r.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-BR_j_D1S.js → SwitchHorizontal01-C9ua90Hw.js} +1 -1
  34. package/dist/client/assets/{Tool01-BAkx1ZdU.js → Tool01-dGPltLKJ.js} +1 -1
  35. package/dist/client/assets/{Trash01-CVVInA2O.js → Trash01-BJe3gUZc.js} +1 -1
  36. package/dist/client/assets/{Upload01-ByUZD5Uy.js → Upload01-DIYVb8n9.js} +1 -1
  37. package/dist/client/assets/{User01-7q5NgTw9.js → User01-DcNAHFa-.js} +1 -1
  38. package/dist/client/assets/{Users01-BX9kMyjx.js → Users01-q9IKnEsX.js} +1 -1
  39. package/dist/client/assets/{Users03-B6ET39UJ.js → Users03-BMw5o14D.js} +1 -1
  40. package/dist/client/assets/{X-BH6rGAp7.js → X-CYIGv8wX.js} +1 -1
  41. package/dist/client/assets/{XCircle-C44kYn0r.js → XCircle-29rFa-09.js} +1 -1
  42. package/dist/client/assets/{XClose-DjOcr3WE.js → XClose-DT64mUwh.js} +1 -1
  43. package/dist/client/assets/{Zap-kOKl7dUI.js → Zap-Br_Hg1wB.js} +1 -1
  44. package/dist/client/assets/{ZapSquare-ddNKzQhO.js → ZapSquare-0BsdXZY9.js} +1 -1
  45. package/dist/client/assets/{ZoomOut-DJV4-7Wr.js → ZoomOut-Dqj1q_yU.js} +1 -1
  46. package/dist/client/assets/{access-gate-CowGDaFA.js → access-gate-033kBvzX.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-zsBozNm7.js → add-section-modal-DRg-YhLT.js} +1 -1
  48. package/dist/client/assets/{agent-capabilities-jSKruONI.js → agent-capabilities-CRvnIg9m.js} +1 -1
  49. package/dist/client/assets/{agent-icon-DMnz6o4Z.js → agent-icon-EdtPDJXM.js} +1 -1
  50. package/dist/client/assets/{agents-list-B9y6dbW5.js → agents-list-COIOrWTd.js} +1 -1
  51. package/dist/client/assets/{ai-providers-vr0VjD3P.js → ai-providers--C84J8bO.js} +1 -1
  52. package/dist/client/assets/{alert-BDbpZ2FA.js → alert-BG1upMQ5.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-Bp9SnoCg.js → alert-dialog-BbHr6pLd.js} +1 -1
  54. package/dist/client/assets/app-editor-DFt6eACm.js +1 -0
  55. package/dist/client/assets/{auth-Di_P-iCF.js → auth-BEQgA40y.js} +1 -1
  56. package/dist/client/assets/{auth-catchall-BRasVk3i.js → auth-catchall-CfZrCH1R.js} +1 -1
  57. package/dist/client/assets/{auth-entry-BINExPhp.js → auth-entry-Cr25LD_X.js} +1 -1
  58. package/dist/client/assets/{auth-split-layout-D7ralijw.js → auth-split-layout-DSPfwaoV.js} +1 -1
  59. package/dist/client/assets/{authenticate-and-persist-oauth-BFF6bv-w.js → authenticate-and-persist-oauth-nkmQY5vG.js} +1 -1
  60. package/dist/client/assets/{automation-list-row-Bu1WzUZ2.js → automation-list-row-xAynmOqb.js} +1 -1
  61. package/dist/client/assets/{automation-runs-x80BWaX2.js → automation-runs-D98OdVC5.js} +1 -1
  62. package/dist/client/assets/{automations-DzmU3FWb.js → automations-DVf2_2C_.js} +1 -1
  63. package/dist/client/assets/{autosend-LAVMz_8m.js → autosend-REHFoRRR.js} +1 -1
  64. package/dist/client/assets/{avatar-jxHzinps.js → avatar-B2d04wRu.js} +1 -1
  65. package/dist/client/assets/{badge-DWJF1rj3.js → badge-DiKw8RbW.js} +1 -1
  66. package/dist/client/assets/{block-document-zR9sT0LV.js → block-document-CPFtVEpa.js} +1 -1
  67. package/dist/client/assets/{brand-context-CYi6YD9v.js → brand-context-DHN-dSvf.js} +1 -1
  68. package/dist/client/assets/{breadcrumb-CID4x2nt.js → breadcrumb-CC9Gfd5p.js} +1 -1
  69. package/dist/client/assets/{buckets-D6nMzOmj.js → buckets-CKM582z_.js} +1 -1
  70. package/dist/client/assets/{bulk-category-panel-CEKcOqhA.js → bulk-category-panel-B4j7bMVg.js} +1 -1
  71. package/dist/client/assets/{calendar-Chv9-zN_.js → calendar-Dh7ySVQi.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-NwvZgiL0.js → capability-load-error-Dg3eOVDS.js} +1 -1
  73. package/dist/client/assets/{card-CBmF5m-m.js → card-D5CauofV.js} +1 -1
  74. package/dist/client/assets/category-editor-SUwhv1rI.js +1 -0
  75. package/dist/client/assets/{chat-context-ISwsXKv9.js → chat-context-BsRUICZs.js} +1 -1
  76. package/dist/client/assets/{checkbox-DBlqT1WL.js → checkbox-DhHH_mmR.js} +1 -1
  77. package/dist/client/assets/{cli-auth-success-DfURWM00.js → cli-auth-success-NNi-TvQO.js} +1 -1
  78. package/dist/client/assets/collection-detail-L5hLAtjn.js +1 -0
  79. package/dist/client/assets/{collection-display-button-CUzx5aOk.js → collection-display-button-D5THp447.js} +1 -1
  80. package/dist/client/assets/{collection-search-DfEE2GsK.js → collection-search-BgFXdSC0.js} +1 -1
  81. package/dist/client/assets/{collection-table-wrapper-J7LDDNaQ.js → collection-table-wrapper-328T8nSg.js} +1 -1
  82. package/dist/client/assets/{collection-tabs-CrxdsgPv.js → collection-tabs-Cxl16cFM.js} +1 -1
  83. package/dist/client/assets/{command-B6K8iBEi.js → command-Cx8bKs7m.js} +1 -1
  84. package/dist/client/assets/{commerce-onboarding-DVM5ZiJ9.js → commerce-onboarding-DmVh_p0A.js} +1 -1
  85. package/dist/client/assets/config-ByOdiANb.js +1 -0
  86. package/dist/client/assets/{connect-desktop-dialog-C5gWxTfZ.js → connect-desktop-dialog-BWEylyh-.js} +1 -1
  87. package/dist/client/assets/{connection-card-CZxKCMQN.js → connection-card-CmLZ3i0M.js} +1 -1
  88. package/dist/client/assets/{connection-detail-BMQJ5Wiz.js → connection-detail-tk24zTUu.js} +1 -1
  89. package/dist/client/assets/{connection-form-helpers-EFv1AB2t.js → connection-form-helpers-C1s-KSGU.js} +1 -1
  90. package/dist/client/assets/{connections-CDjH9JlJ.js → connections-qp5myPzL.js} +1 -1
  91. package/dist/client/assets/{decopilot-sse-pool-CuiGv1QM.js → decopilot-sse-pool-CiyJzTNT.js} +1 -1
  92. package/dist/client/assets/{dialog-BQdZemDY.js → dialog-BFPr54WG.js} +1 -1
  93. package/dist/client/assets/{domain-settings-WYiwjkZ2.js → domain-settings-DHynySRj.js} +1 -1
  94. package/dist/client/assets/{drawer-CGC9vUmu.js → drawer-DcfPm_vi.js} +1 -1
  95. package/dist/client/assets/{dropdown-menu-p-OE20Zw.js → dropdown-menu-BlfYJTRx.js} +1 -1
  96. package/dist/client/assets/{empty-state-Ccota3IC.js → empty-state-CeXPb2VU.js} +1 -1
  97. package/dist/client/assets/{extract-connection-data-CdJ1S70n.js → extract-connection-data-5BWVDciX.js} +1 -1
  98. package/dist/client/assets/file-explorer-CwWWlUiZ.js +2 -0
  99. package/dist/client/assets/{file-type-icon-DqiLifA7.js → file-type-icon-D2xX1xnm.js} +1 -1
  100. package/dist/client/assets/{files-Bah_SCfU.js → files-Bzd-uxW7.js} +1 -1
  101. package/dist/client/assets/{form-DfINtBPW.js → form-Trt6kqr0.js} +1 -1
  102. package/dist/client/assets/{general-DmA99jX8.js → general-C_FzX3UD.js} +1 -1
  103. package/dist/client/assets/github-repo-picker-CTMAbHxR.js +1 -0
  104. package/dist/client/assets/{hooks-D2FVCNXX.js → hooks-BSiz_AKB.js} +1 -1
  105. package/dist/client/assets/{index-Bcenb0s5.js → index-35Tak7qk.js} +1 -1
  106. package/dist/client/assets/{index-CCgql0MU.js → index-BMxNGICG.js} +1 -1
  107. package/dist/client/assets/{index-l6j2xqWS.js → index-C8Vaq4GI.js} +1 -1
  108. package/dist/client/assets/{index-BahpiC2M.js → index-CLj_5r89.js} +18 -18
  109. package/dist/client/assets/{index-DPa2Fjxz.js → index-CPelPFhM.js} +1 -1
  110. package/dist/client/assets/{index-Ba398iyy.js → index-CfigvylE.js} +1 -1
  111. package/dist/client/assets/{index-CbL4CdsD.js → index-CqLJnBFj.js} +1 -1
  112. package/dist/client/assets/{index-CLnnofn-.js → index-CsAnNpRc.js} +1 -1
  113. package/dist/client/assets/index-Cwk7SIrW.js +1 -0
  114. package/dist/client/assets/{index-tBxjvT4Q.js → index-DtEv5T2k.js} +1 -1
  115. package/dist/client/assets/{index-C0bkN5At.js → index-GJfKnZn_.js} +1 -1
  116. package/dist/client/assets/index-dPmP2Tp4.css +1 -0
  117. package/dist/client/assets/index-g8i--Kvx.js +1 -0
  118. package/dist/client/assets/index-gz1tAOXr.js +519 -0
  119. package/dist/client/assets/{index-redirect-D0g34ndU.js → index-redirect-DDeVol4f.js} +1 -1
  120. package/dist/client/assets/{index-khEoYm7s.js → index-uAuiYVKB.js} +1 -1
  121. package/dist/client/assets/{input-DCvWYNIA.js → input-BdpM0TEL.js} +1 -1
  122. package/dist/client/assets/{integration-icon-BnLYSlPi.js → integration-icon-Bf1Nt7-n.js} +1 -1
  123. package/dist/client/assets/{invite-member-dialog-C9EZLVmA.js → invite-member-dialog-BPpBeslC.js} +1 -1
  124. package/dist/client/assets/{label-B9OlPCFU.js → label-DjarSga4.js} +1 -1
  125. package/dist/client/assets/{login-DBQzDD9i.js → login-DoEfLmln.js} +1 -1
  126. package/dist/client/assets/{mcp-oauth-D6cRXUdj.js → mcp-oauth-DWePFULn.js} +1 -1
  127. package/dist/client/assets/{members-o2e_prd5.js → members-B3B7IloN.js} +1 -1
  128. package/dist/client/assets/{monaco-editor-uei6eymP.js → monaco-editor-D4hwKq5W.js} +1 -1
  129. package/dist/client/assets/{monitoring-stats-row-C_bnkbSi.js → monitoring-stats-row-B7f4HN3G.js} +1 -1
  130. package/dist/client/assets/{oauth-callback-C1JCb0s-.js → oauth-callback-BoH2P_bn.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-ai-provider-D401bSS4.js → oauth-callback-ai-provider-CuMMS3lP.js} +1 -1
  132. package/dist/client/assets/{onboarding-B4W2rpI5.js → onboarding-wUH-DGeU.js} +1 -1
  133. package/dist/client/assets/{org-install-BpJQvOCj.js → org-install-DXT9J0I8.js} +1 -1
  134. package/dist/client/assets/{org-layout-DrOqQxU3.js → org-layout-BrLrP4eq.js} +1 -1
  135. package/dist/client/assets/{organization-choice-v8VQ90gJ.js → organization-choice-C6lztIt3.js} +1 -1
  136. package/dist/client/assets/{page-seo-form-BbHa2hSM.js → page-seo-form-DQA0wg3R.js} +1 -1
  137. package/dist/client/assets/page-seo-sheet-DurRfIZb.js +1 -0
  138. package/dist/client/assets/{popover-BLU6o9-K.js → popover-CKlhZKOG.js} +1 -1
  139. package/dist/client/assets/post-editor--rN0Vw5m.js +1 -0
  140. package/dist/client/assets/{primitives-Bl_VoSyu.js → primitives-CAgzIvjA.js} +1 -1
  141. package/dist/client/assets/{profile-BMYDl9Kt.js → profile-CY7AQM7b.js} +1 -1
  142. package/dist/client/assets/project-app-view-CHytmdja.js +1 -0
  143. package/dist/client/assets/record-editor-CNuCZ1ZI.js +1 -0
  144. package/dist/client/assets/registry-BZBmEaE-.js +2 -0
  145. package/dist/client/assets/{registry-layout-CvG6sX0m.js → registry-layout-D25VdidL.js} +1 -1
  146. package/dist/client/assets/{require-capability-CKJDNzAw.js → require-capability-CYDVRBkW.js} +1 -1
  147. package/dist/client/assets/{required-auth-layout-D3BZEQrv.js → required-auth-layout-DGQr874S.js} +1 -1
  148. package/dist/client/assets/{reset-password-BFuPgFz_.js → reset-password-Ci3XAz4n.js} +1 -1
  149. package/dist/client/assets/{roles-4ANLB4UB.js → roles-oTvdi6Hw.js} +1 -1
  150. package/dist/client/assets/{search-input-CTSKqHHp.js → search-input-DJ05ViVl.js} +1 -1
  151. package/dist/client/assets/{secrets-BCo67r-R.js → secrets-HOer9kv3.js} +1 -1
  152. package/dist/client/assets/{sections-editor-DPcDwqoS.js → sections-editor-5ju1cxyx.js} +2 -2
  153. package/dist/client/assets/{select-Bvp0qEbr.js → select-CeXH3gjW.js} +1 -1
  154. package/dist/client/assets/{select-model-DVM5M8H6.js → select-model-DYpThBVD.js} +1 -1
  155. package/dist/client/assets/seo-editor-BIKFI9Fl.js +1 -0
  156. package/dist/client/assets/{settings-layout-QuIh1KuT.js → settings-layout-kdDgoGQC.js} +1 -1
  157. package/dist/client/assets/{settings-section-B2ndiHlo.js → settings-section-CyBwf4qC.js} +1 -1
  158. package/dist/client/assets/{shell-controls-Z5l-bd1U.js → shell-controls-CD6bdY9w.js} +1 -1
  159. package/dist/client/assets/{shell-layout-C6qLFIpM.js → shell-layout-IYwmwgpp.js} +1 -1
  160. package/dist/client/assets/{sidebar-ChHxgM9m.js → sidebar-B_c4VYke.js} +1 -1
  161. package/dist/client/assets/{skeleton-v_XZSYYc.js → skeleton-Dl1AhqdL.js} +1 -1
  162. package/dist/client/assets/{sso-BGRu6zvV.js → sso-1rsjb8hb.js} +1 -1
  163. package/dist/client/assets/{store-CAKjNWnW.js → store-BHrgdJmn.js} +1 -1
  164. package/dist/client/assets/store-registry-B0GhK-Yr.js +2 -0
  165. package/dist/client/assets/{studio-tools-CWpmP6KM.js → studio-tools-F5G0urN7.js} +1 -1
  166. package/dist/client/assets/{switch-yI9gdvWp.js → switch-B9wSH4oe.js} +1 -1
  167. package/dist/client/assets/{tab-id-yjGvxWDL.js → tab-id-DznSzCvK.js} +1 -1
  168. package/dist/client/assets/{table-YAS6wtBG.js → table-C2Aqsz0m.js} +1 -1
  169. package/dist/client/assets/{tabs-Dt4ufEhX.js → tabs-W14caGou.js} +1 -1
  170. package/dist/client/assets/{textarea-DCN5TwaT.js → textarea-ConjZ7fN.js} +1 -1
  171. package/dist/client/assets/{toggle-group-CnMNmD9w.js → toggle-group-CYFywiUW.js} +1 -1
  172. package/dist/client/assets/{toolbar-Bw9zu9WL.js → toolbar-DR2I0_KA.js} +1 -1
  173. package/dist/client/assets/{toolbar-icon-button-D-LZYEgI.js → toolbar-icon-button-Cf6OwFTU.js} +1 -1
  174. package/dist/client/assets/{tools-list-D9OxMY8P.js → tools-list-DL49NRaT.js} +1 -1
  175. package/dist/client/assets/{tooltip-s6_x3f9a.js → tooltip-C51X6QKO.js} +1 -1
  176. package/dist/client/assets/{types-uVqvyouI.js → types-C0d4Ohpx.js} +1 -1
  177. package/dist/client/assets/{use-ai-providers-B2zGkuJg.js → use-ai-providers-BqQDQsEQ.js} +1 -1
  178. package/dist/client/assets/{use-automations-B6grDoMr.js → use-automations-tqGwPES0.js} +1 -1
  179. package/dist/client/assets/{use-capability-B-obK3ST.js → use-capability-CqEMs0z_.js} +1 -1
  180. package/dist/client/assets/{use-clock-tick-zj_1xbt5.js → use-clock-tick-Bz8Z9860.js} +1 -1
  181. package/dist/client/assets/{use-collections-Dd1RRH7k.js → use-collections-Y12o4qWE.js} +1 -1
  182. package/dist/client/assets/{use-connection-C-rUOOpn.js → use-connection-D5Vs5qOp.js} +1 -1
  183. package/dist/client/assets/{use-copy-CsNZH-9d.js → use-copy-Dc9VZjfD.js} +1 -1
  184. package/dist/client/assets/use-create-virtual-mcp-fbAeF2Sf.js +1 -0
  185. package/dist/client/assets/{use-debounced-autosave-Cp27TV8M.js → use-debounced-autosave-BPwP00mx.js} +1 -1
  186. package/dist/client/assets/{use-debounced-value-96swwTPW.js → use-debounced-value-DfUpwXh9.js} +1 -1
  187. package/dist/client/assets/{use-decopilot-events-CWlF2oHq.js → use-decopilot-events-C70DCxcq.js} +1 -1
  188. package/dist/client/assets/{use-delete-connection-CzdQPkHs.js → use-delete-connection-BBFdYZGQ.js} +1 -1
  189. package/dist/client/assets/{use-file-configs-DvpZmtIS.js → use-file-configs-DGZxsbJi.js} +1 -1
  190. package/dist/client/assets/{use-infinite-scroll-DxHNeSQt.js → use-infinite-scroll-BU44dmI-.js} +1 -1
  191. package/dist/client/assets/{use-join-requests-Dmnq5J5S.js → use-join-requests-DyX59dkl.js} +1 -1
  192. package/dist/client/assets/{use-mcp-client-B6zu078q.js → use-mcp-client-3hG4jk-y.js} +1 -1
  193. package/dist/client/assets/{use-mcp-prompts-DV4jud7n.js → use-mcp-prompts-K_jp9fAb.js} +1 -1
  194. package/dist/client/assets/{use-mcp-tools-Doyc2jlq.js → use-mcp-tools-DkI8MzuJ.js} +1 -1
  195. package/dist/client/assets/{use-members-XIoSlR3f.js → use-members-CcCdz_hQ.js} +1 -1
  196. package/dist/client/assets/{use-mobile-BXNoK8fo.js → use-mobile-BJ6No951.js} +1 -1
  197. package/dist/client/assets/use-navigate-to-agent-CZiiGkPG.js +1 -0
  198. package/dist/client/assets/{use-org-auth-client-CIP8sPzJ.js → use-org-auth-client-B7yAA88H.js} +1 -1
  199. package/dist/client/assets/{use-org-sso-CgrmSiGq.js → use-org-sso-DcXTIOxB.js} +1 -1
  200. package/dist/client/assets/{use-organization-roles-B67g_vGt.js → use-organization-roles-C6Eyg5qk.js} +1 -1
  201. package/dist/client/assets/{use-organization-settings-BLQXB5iH.js → use-organization-settings-BzhOQtxD.js} +1 -1
  202. package/dist/client/assets/{use-registry-connections-6rDSDO_p.js → use-registry-connections-DnT_Dh3O.js} +1 -1
  203. package/dist/client/assets/{use-secrets-OrnCuWHl.js → use-secrets-BBj5PT7D.js} +1 -1
  204. package/dist/client/assets/{use-status-sounds-B8zqs89p.js → use-status-sounds-B0huGKlG.js} +1 -1
  205. package/dist/client/assets/{use-view-mode-DTiLjVq5.js → use-view-mode-BL1OAyYV.js} +1 -1
  206. package/dist/client/assets/{use-virtual-mcp-Yg3Ni3JK.js → use-virtual-mcp-D3UxifiP.js} +1 -1
  207. package/dist/client/assets/useInfiniteQuery-8DjDwhQn.js +1 -0
  208. package/dist/client/assets/useSuspenseInfiniteQuery-BYjapKbe.js +1 -0
  209. package/dist/client/assets/{variant-calendar-BTQM7z3g.js → variant-calendar-Dx_VP5De.js} +1 -1
  210. package/dist/client/assets/{view-mode-toggle-B7w106-1.js → view-mode-toggle-DFM8ec78.js} +1 -1
  211. package/dist/client/index.html +2 -2
  212. package/dist/server/cli.js +1 -1
  213. package/dist/server/server.js +1 -1
  214. package/package.json +1 -1
  215. package/dist/client/assets/app-editor-BSFhGDxE.js +0 -1
  216. package/dist/client/assets/category-editor-D6BSL4oe.js +0 -1
  217. package/dist/client/assets/collection-detail-CNqIpkN1.js +0 -1
  218. package/dist/client/assets/file-explorer-BOc6SGhJ.js +0 -2
  219. package/dist/client/assets/github-repo-picker-DwvAhon6.js +0 -1
  220. package/dist/client/assets/index-BYSbf1og.css +0 -1
  221. package/dist/client/assets/index-BvtQ5hoD.js +0 -519
  222. package/dist/client/assets/index-DY0If5q0.js +0 -1
  223. package/dist/client/assets/index-Du1UcWzl.js +0 -1
  224. package/dist/client/assets/page-seo-sheet-ie-UStog.js +0 -1
  225. package/dist/client/assets/post-editor-BMz2I1ZM.js +0 -1
  226. package/dist/client/assets/project-app-view-ZWbZ9H90.js +0 -1
  227. package/dist/client/assets/record-editor-Dvckn3c6.js +0 -1
  228. package/dist/client/assets/registry-OZ9XyjaI.js +0 -2
  229. package/dist/client/assets/seo-editor-DR7IbWtS.js +0 -1
  230. package/dist/client/assets/store-registry-E_hI4lyR.js +0 -2
  231. package/dist/client/assets/use-create-virtual-mcp-Bb67U94y.js +0 -1
  232. package/dist/client/assets/use-navigate-to-agent-DMVkXcE5.js +0 -1
  233. package/dist/client/assets/useInfiniteQuery-CsANrC6N.js +0 -1
  234. package/dist/client/assets/useSuspenseInfiniteQuery-dATP5Fxl.js +0 -1
@@ -1 +1 @@
1
- import{Z as Ie,a as en,W as un,J as mn,I as pn,j as n,B as Y,t as H,r as re,p as hn,b as fn,i as we,M as C,K as me,c as xn,Y as gn,V as jn,l as vn,k as yn}from"./index-BahpiC2M.js";import{g as _n}from"./connection-slug-eyAPH6o3.js";import{u as nn,a as tn,g as Cn,C as Le}from"./connection-card-CZxKCMQN.js";import{C as bn}from"./collection-search-DfEE2GsK.js";import{C as Nn}from"./collection-tabs-CrxdsgPv.js";import{a as wn,b as Sn,e as In,g as kn}from"./extract-connection-data-CdJ1S70n.js";import{e as sn,d as on,c as an,a as cn,b as An,D as Dn}from"./dialog-BQdZemDY.js";import{D as Pn,a as Tn,c as Fn,b as Vn,d as Mn,e as Bn,f as On}from"./drawer-CGC9vUmu.js";import{u as Ln}from"./use-mobile-BXNoK8fo.js";import{F as M,b as B,c as O,d as L,e as $,a as Qe}from"./form-DfINtBPW.js";import{I as W}from"./input-DCvWYNIA.js";import{a as $n,c as En,d as Rn,S as zn,b as ue}from"./select-Bvp0qEbr.js";import{T as Kn}from"./textarea-DCN5TwaT.js";import{b as rn}from"./use-connection-C-rUOOpn.js";import{n as Se,c as $e}from"./XCircle-C44kYn0r.js";import{s as Ee}from"./Star01-CI0kjjiv.js";import{al as Hn}from"./agent-icon-DMnz6o4Z.js";import{s as Un}from"./XClose-DjOcr3WE.js";import{c as Xn,i as be,a as We,E as qn,p as Gn,b as Qn,d as Wn}from"./connection-form-helpers-EFv1AB2t.js";import{u as Ye}from"./use-infinite-scroll-DxHNeSQt.js";import{a as Re}from"./authenticate-and-persist-oauth-BFF6bv-w.js";import{B as Ne}from"./badge-DWJF1rj3.js";import{T as ze,a as Ke,b as He}from"./tooltip-s6_x3f9a.js";import{u as Yn}from"./useSuspenseInfiniteQuery-dATP5Fxl.js";import{u as Jn}from"./use-mcp-client-B6zu078q.js";import{S as Zn}from"./constants-B72Xmt_K.js";import{i as Je}from"./Check-D9pD98TC.js";import{s as et}from"./Plus-Cn5an5hF.js";import{u as nt}from"./studio-tools-CWpmP6KM.js";import{u as tt}from"./use-ai-providers-B2zGkuJg.js";function st({open:a,onOpenChange:e,onCreated:m}){const{org:v}=Ie(),{data:h}=en.useSession(),{stdioEnabled:w}=un(),D=Ln(),E=rn(),d=nn(),R=tn(d,"").items,o=mn({resolver:pn(Xn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),x=o.watch("ui_type"),S=o.watch("connection_url"),F=o.watch("npx_package"),f=be({uiType:x,connectionUrl:S??"",npxPackage:F??""})??We({uiType:x,connectionUrl:S??"",registryItems:R}),r=t=>{const u=t.trim();if(!u)return;const s=!!o.formState.dirtyFields.title,c=!!o.formState.dirtyFields.description,j=!!o.formState.dirtyFields.env_vars,y=l=>{if(l&&(!s&&!o.getValues("title").trim()&&l.title&&o.setValue("title",l.title,{shouldDirty:!1}),!c&&!(o.getValues("description")??"").trim()&&l.description&&o.setValue("description",l.description,{shouldDirty:!1}),!j&&l.envVarKeys?.length)){const N=o.getValues("env_vars")??[],q=new Set(N.map(V=>V.key)),pe=l.envVarKeys.filter(V=>!q.has(V));pe.length>0&&o.setValue("env_vars",[...N,...pe.map(V=>({key:V,value:""}))],{shouldDirty:!0})}},g=Gn(u);if(g&&w){o.setValue("ui_type","NPX",{shouldDirty:!0}),o.setValue("npx_package",g.packageName,{shouldDirty:!0}),o.setValue("connection_url","",{shouldDirty:!0}),o.setValue("connection_token",null,{shouldDirty:!0}),y(be({uiType:"NPX",npxPackage:g.packageName}));return}if(u.startsWith("http://")||u.startsWith("https://")){const l=x==="HTTP"||x==="SSE"||x==="Websocket"?x:"HTTP";o.setValue("ui_type",l,{shouldDirty:!0}),o.setValue("connection_url",u,{shouldDirty:!0}),y(be({uiType:l,connectionUrl:u})??We({uiType:l,connectionUrl:u,registryItems:R}));return}x==="NPX"&&y(be({uiType:"NPX",npxPackage:u}))},z=t=>{t||o.reset(),e(t)},b=async t=>{let u,s=null,c=null,j=null;t.ui_type==="NPX"?(u="STDIO",s="",j=Qn(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(u="STDIO",s="",j=Wn(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(u=t.ui_type,s=t.connection_url||"",c=t.connection_token||null);const y=wn("conn");try{await E.create.mutateAsync({id:y,title:t.title,description:t.description||null,connection_type:u,connection_url:s,connection_token:c,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:h?.user?.id||"system",organization_id:v.id,icon:t.icon??null,app_name:null,app_id:null,connection_headers:j,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),o.reset(),e(!1),m?.(y)}catch{H.error("Failed to create connection")}},k="Create Connection",I="Create a custom connection in your organization. Fill in the details below.",U=o.formState.isSubmitting?"Saving...":"Create Connection",P=n.jsxs("div",{className:"grid gap-4",children:[n.jsx(M,{control:o.control,name:"ui_type",render:({field:t})=>n.jsxs(B,{children:[n.jsx(O,{children:"Type *"}),n.jsxs($n,{value:t.value,onValueChange:t.onChange,children:[n.jsx(L,{children:n.jsx(En,{children:n.jsx(Rn,{})})}),n.jsxs(zn,{children:[n.jsx(ue,{value:"HTTP",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ee,{className:"w-4 h-4"}),"HTTP"]})}),n.jsx(ue,{value:"SSE",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ee,{className:"w-4 h-4"}),"SSE"]})}),n.jsx(ue,{value:"Websocket",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ee,{className:"w-4 h-4"}),"Websocket"]})}),w&&n.jsxs(n.Fragment,{children:[n.jsx(ue,{value:"NPX",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Se,{className:"w-4 h-4"}),"NPX Package"]})}),n.jsx(ue,{value:"STDIO",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Hn,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),n.jsx($,{})]})}),x==="NPX"&&n.jsx(M,{control:o.control,name:"npx_package",render:({field:t})=>n.jsxs(B,{children:[n.jsx(O,{children:"NPM Package *"}),n.jsx(L,{children:n.jsx(W,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:u=>{const s=u.clipboardData.getData("text");s&&(u.preventDefault(),o.setValue("npx_package",s.trim(),{shouldDirty:!0}),r(s))},onBlur:u=>{r(u.target.value),t.onBlur()}})}),n.jsx($,{})]})}),x==="STDIO"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[n.jsx(M,{control:o.control,name:"stdio_command",render:({field:t})=>n.jsxs(B,{children:[n.jsx(O,{children:"Command *"}),n.jsx(L,{children:n.jsx(W,{placeholder:"node, bun, python...",...t,value:t.value??""})}),n.jsx($,{})]})}),n.jsx(M,{control:o.control,name:"stdio_args",render:({field:t})=>n.jsxs(B,{children:[n.jsx(O,{children:"Arguments"}),n.jsx(L,{children:n.jsx(W,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),n.jsx($,{})]})})]}),n.jsx(M,{control:o.control,name:"stdio_cwd",render:({field:t})=>n.jsxs(B,{children:[n.jsx(O,{children:"Working Directory"}),n.jsx(L,{children:n.jsx(W,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),n.jsx($,{})]})})]}),(x==="NPX"||x==="STDIO")&&n.jsx(M,{control:o.control,name:"env_vars",render:({field:t})=>n.jsxs(B,{children:[n.jsx(O,{children:"Environment Variables"}),n.jsx(L,{children:n.jsx(qn,{value:t.value??[],onChange:t.onChange})}),n.jsx($,{})]})}),x!=="NPX"&&x!=="STDIO"&&n.jsxs(n.Fragment,{children:[n.jsx(M,{control:o.control,name:"connection_url",render:({field:t})=>n.jsxs(B,{children:[n.jsx(O,{children:"URL *"}),n.jsx(L,{children:n.jsx(W,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:u=>{const s=u.clipboardData.getData("text");s&&(u.preventDefault(),o.setValue("connection_url",s.trim(),{shouldDirty:!0}),r(s))},onBlur:u=>{r(u.target.value),t.onBlur()}})}),n.jsx($,{})]})}),n.jsx(M,{control:o.control,name:"connection_token",render:({field:t})=>n.jsxs(B,{children:[n.jsx(O,{children:f?.token?.label??"Token (optional)"}),n.jsx(L,{children:n.jsx(W,{type:"password",placeholder:f?.token?.placeholder??"Bearer token or API key",className:"ph-no-capture",...t,value:t.value??""})}),f?.token?.helperText&&n.jsxs("p",{className:"text-xs text-muted-foreground",children:[f.token.helperText,f.id==="github"&&n.jsxs(n.Fragment,{children:[" ","·"," ",n.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"})]})]}),n.jsx($,{})]})})]}),n.jsx(M,{control:o.control,name:"title",render:({field:t})=>n.jsxs(B,{children:[n.jsx(O,{children:"Name *"}),n.jsx(L,{children:n.jsx(W,{placeholder:"My Connection",...t})}),n.jsx($,{})]})}),n.jsx(M,{control:o.control,name:"description",render:({field:t})=>n.jsxs(B,{children:[n.jsx(O,{children:"Description"}),n.jsx(L,{children:n.jsx(Kn,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),n.jsx($,{})]})})]});return D?n.jsx(Pn,{open:a,onOpenChange:z,children:n.jsxs(Tn,{className:"max-h-[90vh]",children:[n.jsx(Fn,{className:"pb-2",children:n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{className:"flex-1 text-left",children:[n.jsx(Vn,{children:k}),n.jsx(Mn,{className:"mt-1",children:I})]}),n.jsx(Bn,{asChild:!0,children:n.jsx(Y,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:n.jsx(Un,{size:16})})})]})}),n.jsx(Qe,{...o,children:n.jsxs("form",{onSubmit:o.handleSubmit(b),children:[n.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:P}),n.jsx(On,{children:n.jsx(Y,{type:"submit",disabled:o.formState.isSubmitting,className:"w-full",children:U})})]})})]})}):n.jsx(sn,{open:a,onOpenChange:z,children:n.jsxs(on,{className:"sm:max-w-[525px]",children:[n.jsxs(an,{children:[n.jsx(cn,{children:k}),n.jsx(An,{children:I})]}),n.jsx(Qe,{...o,children:n.jsxs("form",{onSubmit:o.handleSubmit(b),children:[n.jsx("div",{className:"py-4",children:P}),n.jsxs(Dn,{children:[n.jsx(Y,{type:"button",variant:"outline",onClick:()=>z(!1),children:"Cancel"}),n.jsx(Y,{type:"submit",disabled:o.formState.isSubmitting,className:"min-w-40",children:U})]})]})})]})})}function ot(a){const e=xn.c(73),{mode:m,agentId:v,addedConnectionIds:h,onAdd:w,onCloneAndAdd:D,onConnectAndAdd:E,connectingItemId:d,search:_,onCreateConnection:R,onBrowseNavigate:o,defaultTab:x}=a,S=m===void 0?"add":m,F=x===void 0?"connected":x,{org:f}=Ie(),r=re.useDeferredValue(_),z=_!==r,b=r.trim().toLowerCase();let k;e[0]!==F?(k=i=>i??F,e[0]=F,e[1]=k):k=e[1];const[I,U]=gn(jn.connectionsTab(f.slug)+(F==="all"?":home-modal":":agent-modal"),k);let P;e[2]!==I||e[3]!==U?(P=i=>{i!==I&&C("connections_dialog_tab_changed",{to_tab:i}),U(i)},e[2]=I,e[3]=U,e[4]=P):P=e[4];const t=P;let u;e[5]!==f.id||e[6]!==f.slug?(u={connectionId:Zn,orgId:f.id,orgSlug:f.slug},e[5]=f.id,e[6]=f.slug,e[7]=u):u=e[7];const s=Jn(u);let c,j,y;if(e[8]!==s||e[9]!==r||e[10]!==f.id){y=r?.trim()?{operator:"or",conditions:[{field:["title"],operator:"contains",value:r.trim()},{field:["description"],operator:"contains",value:r.trim()}]}:void 0;const i={...y&&{where:y},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},p=JSON.stringify(i);j=Yn,c=me.collectionListInfinite(s,f.id,"","CONNECTIONS",p),e[8]=s,e[9]=r,e[10]=f.id,e[11]=c,e[12]=j,e[13]=y}else c=e[11],j=e[12],y=e[13];let g;e[14]!==s||e[15]!==y?(g=async i=>{const{pageParam:p}=i,K=p===void 0?0:p;return(await s.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...y&&{where:y},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:K}})).structuredContent},e[14]=s,e[15]=y,e[16]=g):g=e[16];let l;e[17]!==c||e[18]!==g?(l={queryKey:c,queryFn:g,initialPageParam:0,getNextPageParam:dt,staleTime:3e4},e[17]=c,e[18]=g,e[19]=l):l=e[19];const{data:N,fetchNextPage:q,hasNextPage:pe,isFetchingNextPage:V}=j(l),Xe=N?.pages.flatMap(lt)??[],he=Cn(Xe),ln=new Set(Xe.filter(rt).map(ct)),fe=nn(),G=tn(fe,r),ke=Ye(G.loadMore,G.hasMore,G.isLoadingMore),Ae=Ye(q,pe??!1,V),T=I==="all"||!!b,qe=T?G.items.filter(i=>{const p=Sn(i);if(p&&ln.has(p))return!1;if(!b)return!0;const K=i._meta?.["mcp.mesh"];return[i.title,i.description,i.name,i.server?.title,i.server?.description,i.server?.name,K?.friendly_name,K?.friendlyName].filter(Boolean).join(" ").toLowerCase().includes(b)}):[],le=qe.filter(it),de=qe.filter(at);let xe;e[20]!==h?(xe=i=>i.some(p=>h.has(p.id)),e[20]=h,e[21]=xe):xe=e[21];const De=xe;let ge;e[22]!==h||e[23]!==v||e[24]!==d||e[25]!==De||e[26]!==S||e[27]!==w||e[28]!==o||e[29]!==D?(ge=(i,p,K,ie,X)=>{const Ce=De(X),ce=X.find(Q=>!h.has(Q.id)),A=X[0];if(S==="browse"){const Q=_n(A);return n.jsx(Le,{connection:{title:p,icon:K,description:X.length>1?`${X.length} instances`:ie??void 0},fallbackIcon:n.jsx(Se,{}),headerActionsAlwaysVisible:!0,headerActions:n.jsxs(Ne,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[n.jsx(Je,{size:11})," Connected"]}),onClick:()=>{C("connection_browse_clicked",{app_name:A.app_name??null,connection_id:A.id,instances_count:X.length}),o?.(Q)}},i)}return n.jsx(Le,{connection:{title:p,icon:K,description:ie},fallbackIcon:n.jsx(Se,{}),headerActionsAlwaysVisible:!0,headerActions:n.jsxs("div",{className:"flex items-center gap-1.5",children:[Ce&&n.jsxs(Ne,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[n.jsx(Je,{size:11})," Added"]}),n.jsx(Y,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:Q=>{Q.stopPropagation(),ce?(C("connection_add_clicked",{action:"use_existing",app_name:A.app_name??null,connection_id:ce.id}),v&&C("agent_connection_attached",{agent_id:v,connection_id:ce.id,app_name:A.app_name??null,mode:"existing"}),w(ce.id)):(C("connection_add_clicked",{action:"clone",app_name:A.app_name??null,base_connection_id:A.id}),D(A))},children:"Add"})]})},i)},e[22]=h,e[23]=v,e[24]=d,e[25]=De,e[26]=S,e[27]=w,e[28]=o,e[29]=D,e[30]=ge):ge=e[30];const je=ge;let ve;e[31]!==d||e[32]!==S||e[33]!==E?(ve=i=>{const p=i._meta?.["mcp.mesh"],K=p?.friendlyName||p?.friendly_name||i.server?.title||i.title||i.server?.name||i.name||i.id||"",ie=i.server?.description||i.description||null,X=i.server?.icons?.[0]?.src||kn(i.server?.repository)||null,Ce=p?.official===!0,ce=p?.verified===!0,A=p?.owner==="deco";return n.jsx(Le,{connection:{title:K,description:ie,icon:X},fallbackIcon:n.jsx(Se,{}),headerActionsAlwaysVisible:!0,headerActions:n.jsxs("div",{className:"flex items-center gap-1.5",children:[A&&n.jsxs(ze,{children:[n.jsx(Ke,{asChild:!0,children:n.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:n.jsx("img",{src:"/logos/deco logo.svg",alt:"Made by Deco",className:"size-3"})})}),n.jsx(He,{children:"Built and maintained by Deco"})]}),!A&&Ce&&n.jsxs(ze,{children:[n.jsx(Ke,{asChild:!0,children:n.jsx(Ne,{variant:"outline",size:"icon",children:n.jsx($e,{})})}),n.jsx(He,{children:"Built and maintained by the official vendor"})]}),!A&&!Ce&&ce&&n.jsxs(ze,{children:[n.jsx(Ke,{asChild:!0,children:n.jsx(Ne,{variant:"outline",size:"icon",children:n.jsx($e,{})})}),n.jsx(He,{children:"Verified by the Deco team"})]}),n.jsx(Y,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:Q=>{Q.stopPropagation(),C("connection_add_clicked",{action:"connect_new",registry_item_id:i.id,app_name:p?.friendlyName||i.server?.name||i.name||null}),E(i)},children:d===i.id?n.jsx(we,{size:14,className:"animate-spin"}):S==="browse"?"Connect":"Add"})]})},`catalog-${i.id}`)},e[31]=d,e[32]=S,e[33]=E,e[34]=ve):ve=e[34];const Ge=ve,Pe=!b&&n.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[n.jsx(Nn,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:I,onTabChange:i=>t(i)}),n.jsxs(Y,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{C("connections_dialog_custom_clicked"),R()},children:[n.jsx(et,{size:12}),"Custom Connection"]})]}),Te=z&&"opacity-50 pointer-events-none";let J;e[35]!==Te?(J=vn("flex-1 overflow-auto p-5 transition-opacity duration-150",Te),e[35]=Te,e[36]=J):J=e[36];const dn="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let ye;e[37]!==je?(ye=i=>{if(i.type==="group")return je(i.key,i.title,i.icon,null,i.connections);const p=i.connection;return je(p.id,p.title,p.icon,p.description??null,[p])},e[37]=je,e[38]=ye):ye=e[38];const Fe=he.map(ye);let Z;e[39]!==Ae?(Z=n.jsx("div",{ref:Ae,className:"col-span-full h-1"}),e[39]=Ae,e[40]=Z):Z=e[40];let ee;e[41]!==V?(ee=V&&n.jsx("div",{className:"col-span-full flex justify-center py-6",children:n.jsx(we,{size:24,className:"animate-spin text-muted-foreground"})}),e[41]=V,e[42]=ee):ee=e[42];const Ve=T&&le.length>0&&n.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[n.jsx($e,{size:13,className:"text-muted-foreground shrink-0"}),n.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"Verified"}),n.jsx("div",{className:"flex-1 h-px bg-border"})]}),Me=T&&le.map(Ge),Be=T&&de.length>0&&n.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[n.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"All connections"}),n.jsx("div",{className:"flex-1 h-px bg-border"})]}),Oe=T&&de.map(Ge);let ne;e[43]!==ke||e[44]!==fe||e[45]!==T?(ne=T&&fe.length>0&&n.jsx("div",{ref:ke,className:"col-span-full h-1"}),e[43]=ke,e[44]=fe,e[45]=T,e[46]=ne):ne=e[46];let te;e[47]!==G.isLoadingMore||e[48]!==T?(te=T&&G.isLoadingMore&&n.jsx("div",{className:"col-span-full flex justify-center py-6",children:n.jsx(we,{size:24,className:"animate-spin text-muted-foreground"})}),e[47]=G.isLoadingMore,e[48]=T,e[49]=te):te=e[49];let se;e[50]!==Fe||e[51]!==Z||e[52]!==ee||e[53]!==Ve||e[54]!==Me||e[55]!==Be||e[56]!==Oe||e[57]!==ne||e[58]!==te?(se=n.jsxs("div",{className:dn,children:[Fe,Z,ee,Ve,Me,Be,Oe,ne,te]}),e[50]=Fe,e[51]=Z,e[52]=ee,e[53]=Ve,e[54]=Me,e[55]=Be,e[56]=Oe,e[57]=ne,e[58]=te,e[59]=se):se=e[59];let oe;e[60]!==I||e[61]!==he.length||e[62]!==de||e[63]!==_||e[64]!==le?(oe=he.length===0&&le.length===0&&de.length===0&&n.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:_?`No connections match "${_}"`:I==="connected"?"No connections yet":"No connections available"}),e[60]=I,e[61]=he.length,e[62]=de,e[63]=_,e[64]=le,e[65]=oe):oe=e[65];let ae;e[66]!==J||e[67]!==se||e[68]!==oe?(ae=n.jsxs("div",{className:J,children:[se,oe]}),e[66]=J,e[67]=se,e[68]=oe,e[69]=ae):ae=e[69];let _e;return e[70]!==Pe||e[71]!==ae?(_e=n.jsxs(n.Fragment,{children:[Pe,ae]}),e[70]=Pe,e[71]=ae,e[72]=_e):_e=e[72],_e}function at(a){return!a.verified&&!a._meta?.["mcp.mesh"]?.verified&&!a.meta?.verified}function it(a){return a.verified||a._meta?.["mcp.mesh"]?.verified||a.meta?.verified}function ct(a){return a.app_name}function rt(a){return a.app_name}function lt(a){return a?.items??[]}function dt(a,e){if(a?.hasMore)return e.reduce(ut,0)}function ut(a,e){return a+(e?.items?.length??0)}function zt({open:a,onOpenChange:e,defaultTab:m,initialSearch:v="",...h}){const w=h.mode??"add",D="agentId"in h?h.agentId:void 0,E="addedConnectionIds"in h?h.addedConnectionIds??new Set:new Set,d="onAdd"in h&&h.onAdd?h.onAdd:s=>{},_=(s,c,j)=>{D&&C("agent_connection_attached",{agent_id:D,connection_id:s,app_name:c,mode:j})},[R,o]=re.useState(null),[x,S]=re.useState(v),[F,f]=re.useState(!1),{org:r}=Ie(),{data:z}=en.useSession(),b=rn(),k=hn(),I=fn(),U=s=>{e(!1),I({to:"/$org/settings/connections/$appSlug",params:{org:r.slug,appSlug:s}})},P=()=>{k.invalidateQueries({predicate:s=>{const c=s.queryKey;return c[1]===r.id&&c[3]==="collection"&&c[4]==="CONNECTIONS"}})},t=async s=>{o(s.app_name??s.id);try{const j=`${s.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,g=(await b.create.mutateAsync({title:j,description:s.description??null,connection_type:s.connection_type,connection_url:s.connection_url??null,connection_token:null,icon:s.icon??null,app_name:s.app_name??null,app_id:s.app_id??null,connection_headers:s.connection_headers??null})).id,l=await Re({connectionId:g,orgId:r.id,orgSlug:r.slug,persistFallback:N=>b.update.mutateAsync({id:g,data:{connection_token:N}}).then(()=>{})});if(l.ran&&!l.ok){C("connection_oauth_failed",{connection_id:g,flow:"clone",error:l.error??"no_token"}),H.error(`Authentication failed: ${l.error??"no token received"}`),await b.delete.mutateAsync(g);return}if(l.ran){C("connection_oauth_succeeded",{connection_id:g,flow:"clone"});const N=new URL(`/api/${r.slug}/mcp/${g}`,window.location.origin);await k.invalidateQueries({queryKey:me.isMCPAuthenticated(N.href,null)}),P()}_(g,s.app_name??null,"clone"),d(g)}catch(c){console.error("Failed to add connection:",c),H.error("Failed to add connection")}finally{o(null)}},u=async s=>{if(!(!r||!z?.user?.id)){o(s.id);try{const c=In(s,r.id,z.user.id,{remoteIndex:0}),j=c.connection_type==="STDIO",y=!!c.connection_url,g=j&&c.connection_headers&&typeof c.connection_headers=="object"&&"command"in c.connection_headers;if(!y&&!g){H.error("This MCP Server cannot be connected: no connection method available"),o(null);return}const{id:l}=await b.create.mutateAsync(c),N=await Re({connectionId:l,orgId:r.id,orgSlug:r.slug,persistFallback:q=>b.update.mutateAsync({id:l,data:{connection_token:q}}).then(()=>{})});if(N.ran&&!N.ok){C("connection_oauth_failed",{connection_id:l,flow:"connect_new",error:N.error??"no_token"}),H.warning("Couldn't sign in to this connection",{description:`It was added to your agent, but its sign-in setup looks off. You can try authenticating again later from the connection's settings. (${N.error??"no token received"})`}),_(l,c.app_name??null,"new"),d(l);return}if(N.ran){C("connection_oauth_succeeded",{connection_id:l,flow:"connect_new"});const q=new URL(`/api/${r.slug}/mcp/${l}`,window.location.origin);await k.invalidateQueries({queryKey:me.isMCPAuthenticated(q.href,null)}),P(),H.success("Connected and authenticated")}else H.success("Connected");_(l,c.app_name??null,"new"),d(l)}catch(c){console.error("Failed to connect:",c),H.error("Failed to connect")}finally{o(null)}}};return n.jsxs(sn,{open:a,onOpenChange:e,children:[n.jsxs(on,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[n.jsx(an,{className:"px-6 pt-5 pb-0 shrink-0",children:n.jsx(cn,{className:"text-base font-semibold",children:w==="browse"?"Connections":"Add Connection"})}),n.jsx("div",{className:"pt-3 shrink-0",children:n.jsx(bn,{value:x,onChange:S,placeholder:"Search connections..."})}),n.jsx(re.Suspense,{fallback:n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(we,{size:24,className:"animate-spin text-muted-foreground"})}),children:n.jsx(ot,{mode:w,agentId:D,addedConnectionIds:E,onAdd:d,onCloneAndAdd:t,onConnectAndAdd:u,connectingItemId:R,search:x,onCreateConnection:()=>f(!0),onBrowseNavigate:U,defaultTab:m})})]}),n.jsx(st,{open:F,onOpenChange:f,onCreated:async s=>{f(!1);const c=await Re({connectionId:s,orgId:r.id,orgSlug:r.slug,persistFallback:j=>b.update.mutateAsync({id:s,data:{connection_token:j}}).then(()=>{})});if(c.ran&&!c.ok){C("connection_oauth_failed",{connection_id:s,flow:"custom_create",error:c.error??"no_token"}),H.warning("Couldn't sign in to this connection",{description:`It was added to your agent, but its sign-in setup looks off. You can try authenticating again later from the connection's settings. (${c.error??"no token received"})`}),_(s,null,"custom"),d(s),e(!1);return}if(c.ran){C("connection_oauth_succeeded",{connection_id:s,flow:"custom_create"});const j=new URL(`/api/${r.slug}/mcp/${s}`,window.location.origin);await k.invalidateQueries({queryKey:me.isMCPAuthenticated(j.href,null)}),P()}_(s,null,"custom"),d(s),e(!1)}})]})}const Ze=new Map;function Kt(){const{org:a}=Ie(),e=nt(),m=tt(),v=m.find(r=>r.providerId==="deco"),{data:h,isLoading:w,refetch:D,isFetching:E}=yn({queryKey:me.aiProviderCredits(a.id,"deco"),enabled:!!v,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),d=h?.balanceCents??null,_=d!=null?d/100:null,R=re.useRef(new Map);if(d!=null){const r=Ze.get(a.id);R.current.get(a.id)&&r!=null&&d>r&&C("credits_topped_up_detected",{organization_id:a.id,delta_cents:d-r,previous_balance_cents:r,new_balance_cents:d}),Ze.set(a.id,d),R.current.set(a.id,!0)}const o=!!v,x=d!=null&&d>0,S=d!=null&&d===0,F=d!=null&&d===200,f=m.length>0&&m.every(r=>r.providerId==="deco");return{hasDecoKey:o,decoKeyId:v?.id??null,balanceCents:d,balanceDollars:_,hasCredits:x,isZeroBalance:S,isInitialFreeCredit:F,hasOnlyDecoProvider:f,isLoading:w,isFetching:E,refetch:D}}function Ue(a){const e=a?.metadata?.githubRepo;if(!e?.url)return{status:"none"};const m=e.connectionId;return!!m&&!!a?.connections?.some(w=>w.connection_id===m)?{status:"attached",repo:e,connectionId:m}:!!m||e.installationId!=null?{status:"detached",repo:e}:{status:"public-clone",repo:e}}function Ht(a){const e=Ue(a);return e.status==="attached"||e.status==="public-clone"?e.repo:null}function Ut(a){if(typeof a!="object"||a===null)return!1;const m=a.githubRepo?.url;return typeof m=="string"&&m.length>0}function Xt(a){return Ue(a).status==="attached"}function qt(a){const e=Ue(a).status;return e==="attached"||e==="detached"}function Gt(a){const e=new Set;for(const m of a??[]){const v=m.metadata?.liveAgentId;typeof v=="string"&&v&&e.add(m.id)}return e}function Qt(a,e){if(!a)return null;const m=a.metadata?.liveAgentId;if(typeof m=="string"&&m)return{mode:"dev",targetId:m};const v=(e??[]).find(h=>h.metadata?.liveAgentId===a.id);return v?{mode:"live",targetId:v.id}:null}export{zt as A,Gt as a,Xt as b,Ut as c,qt as d,Qt as f,Ht as g,Ue as r,Kt as u};
1
+ import{Z as Ie,a as en,W as un,J as mn,I as pn,j as n,B as Y,t as H,r as re,p as hn,b as fn,i as we,M as C,K as me,c as xn,Y as gn,V as jn,l as vn,k as yn}from"./index-CLj_5r89.js";import{g as _n}from"./connection-slug-eyAPH6o3.js";import{u as nn,a as tn,g as Cn,C as Le}from"./connection-card-CmLZ3i0M.js";import{C as bn}from"./collection-search-BgFXdSC0.js";import{C as Nn}from"./collection-tabs-Cxl16cFM.js";import{a as wn,b as Sn,e as In,g as kn}from"./extract-connection-data-5BWVDciX.js";import{e as sn,d as on,c as an,a as cn,b as An,D as Dn}from"./dialog-BFPr54WG.js";import{D as Pn,a as Tn,c as Fn,b as Vn,d as Mn,e as Bn,f as On}from"./drawer-DcfPm_vi.js";import{u as Ln}from"./use-mobile-BJ6No951.js";import{F as M,b as B,c as O,d as L,e as $,a as Qe}from"./form-Trt6kqr0.js";import{I as W}from"./input-BdpM0TEL.js";import{a as $n,c as En,d as Rn,S as zn,b as ue}from"./select-CeXH3gjW.js";import{T as Kn}from"./textarea-ConjZ7fN.js";import{b as rn}from"./use-connection-D5Vs5qOp.js";import{n as Se,c as $e}from"./XCircle-29rFa-09.js";import{s as Ee}from"./Star01-B90wIaBV.js";import{al as Hn}from"./agent-icon-EdtPDJXM.js";import{s as Un}from"./XClose-DT64mUwh.js";import{c as Xn,i as be,a as We,E as qn,p as Gn,b as Qn,d as Wn}from"./connection-form-helpers-C1s-KSGU.js";import{u as Ye}from"./use-infinite-scroll-BU44dmI-.js";import{a as Re}from"./authenticate-and-persist-oauth-nkmQY5vG.js";import{B as Ne}from"./badge-DiKw8RbW.js";import{T as ze,a as Ke,b as He}from"./tooltip-C51X6QKO.js";import{u as Yn}from"./useSuspenseInfiniteQuery-BYjapKbe.js";import{u as Jn}from"./use-mcp-client-3hG4jk-y.js";import{S as Zn}from"./constants-B72Xmt_K.js";import{i as Je}from"./Check-VVh423TU.js";import{s as et}from"./Plus-DNCXili3.js";import{u as nt}from"./studio-tools-F5G0urN7.js";import{u as tt}from"./use-ai-providers-BqQDQsEQ.js";function st({open:a,onOpenChange:e,onCreated:m}){const{org:v}=Ie(),{data:h}=en.useSession(),{stdioEnabled:w}=un(),D=Ln(),E=rn(),d=nn(),R=tn(d,"").items,o=mn({resolver:pn(Xn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),x=o.watch("ui_type"),S=o.watch("connection_url"),F=o.watch("npx_package"),f=be({uiType:x,connectionUrl:S??"",npxPackage:F??""})??We({uiType:x,connectionUrl:S??"",registryItems:R}),r=t=>{const u=t.trim();if(!u)return;const s=!!o.formState.dirtyFields.title,c=!!o.formState.dirtyFields.description,j=!!o.formState.dirtyFields.env_vars,y=l=>{if(l&&(!s&&!o.getValues("title").trim()&&l.title&&o.setValue("title",l.title,{shouldDirty:!1}),!c&&!(o.getValues("description")??"").trim()&&l.description&&o.setValue("description",l.description,{shouldDirty:!1}),!j&&l.envVarKeys?.length)){const N=o.getValues("env_vars")??[],q=new Set(N.map(V=>V.key)),pe=l.envVarKeys.filter(V=>!q.has(V));pe.length>0&&o.setValue("env_vars",[...N,...pe.map(V=>({key:V,value:""}))],{shouldDirty:!0})}},g=Gn(u);if(g&&w){o.setValue("ui_type","NPX",{shouldDirty:!0}),o.setValue("npx_package",g.packageName,{shouldDirty:!0}),o.setValue("connection_url","",{shouldDirty:!0}),o.setValue("connection_token",null,{shouldDirty:!0}),y(be({uiType:"NPX",npxPackage:g.packageName}));return}if(u.startsWith("http://")||u.startsWith("https://")){const l=x==="HTTP"||x==="SSE"||x==="Websocket"?x:"HTTP";o.setValue("ui_type",l,{shouldDirty:!0}),o.setValue("connection_url",u,{shouldDirty:!0}),y(be({uiType:l,connectionUrl:u})??We({uiType:l,connectionUrl:u,registryItems:R}));return}x==="NPX"&&y(be({uiType:"NPX",npxPackage:u}))},z=t=>{t||o.reset(),e(t)},b=async t=>{let u,s=null,c=null,j=null;t.ui_type==="NPX"?(u="STDIO",s="",j=Qn(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(u="STDIO",s="",j=Wn(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(u=t.ui_type,s=t.connection_url||"",c=t.connection_token||null);const y=wn("conn");try{await E.create.mutateAsync({id:y,title:t.title,description:t.description||null,connection_type:u,connection_url:s,connection_token:c,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:h?.user?.id||"system",organization_id:v.id,icon:t.icon??null,app_name:null,app_id:null,connection_headers:j,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),o.reset(),e(!1),m?.(y)}catch{H.error("Failed to create connection")}},k="Create Connection",I="Create a custom connection in your organization. Fill in the details below.",U=o.formState.isSubmitting?"Saving...":"Create Connection",P=n.jsxs("div",{className:"grid gap-4",children:[n.jsx(M,{control:o.control,name:"ui_type",render:({field:t})=>n.jsxs(B,{children:[n.jsx(O,{children:"Type *"}),n.jsxs($n,{value:t.value,onValueChange:t.onChange,children:[n.jsx(L,{children:n.jsx(En,{children:n.jsx(Rn,{})})}),n.jsxs(zn,{children:[n.jsx(ue,{value:"HTTP",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ee,{className:"w-4 h-4"}),"HTTP"]})}),n.jsx(ue,{value:"SSE",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ee,{className:"w-4 h-4"}),"SSE"]})}),n.jsx(ue,{value:"Websocket",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ee,{className:"w-4 h-4"}),"Websocket"]})}),w&&n.jsxs(n.Fragment,{children:[n.jsx(ue,{value:"NPX",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Se,{className:"w-4 h-4"}),"NPX Package"]})}),n.jsx(ue,{value:"STDIO",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Hn,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),n.jsx($,{})]})}),x==="NPX"&&n.jsx(M,{control:o.control,name:"npx_package",render:({field:t})=>n.jsxs(B,{children:[n.jsx(O,{children:"NPM Package *"}),n.jsx(L,{children:n.jsx(W,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:u=>{const s=u.clipboardData.getData("text");s&&(u.preventDefault(),o.setValue("npx_package",s.trim(),{shouldDirty:!0}),r(s))},onBlur:u=>{r(u.target.value),t.onBlur()}})}),n.jsx($,{})]})}),x==="STDIO"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[n.jsx(M,{control:o.control,name:"stdio_command",render:({field:t})=>n.jsxs(B,{children:[n.jsx(O,{children:"Command *"}),n.jsx(L,{children:n.jsx(W,{placeholder:"node, bun, python...",...t,value:t.value??""})}),n.jsx($,{})]})}),n.jsx(M,{control:o.control,name:"stdio_args",render:({field:t})=>n.jsxs(B,{children:[n.jsx(O,{children:"Arguments"}),n.jsx(L,{children:n.jsx(W,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),n.jsx($,{})]})})]}),n.jsx(M,{control:o.control,name:"stdio_cwd",render:({field:t})=>n.jsxs(B,{children:[n.jsx(O,{children:"Working Directory"}),n.jsx(L,{children:n.jsx(W,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),n.jsx($,{})]})})]}),(x==="NPX"||x==="STDIO")&&n.jsx(M,{control:o.control,name:"env_vars",render:({field:t})=>n.jsxs(B,{children:[n.jsx(O,{children:"Environment Variables"}),n.jsx(L,{children:n.jsx(qn,{value:t.value??[],onChange:t.onChange})}),n.jsx($,{})]})}),x!=="NPX"&&x!=="STDIO"&&n.jsxs(n.Fragment,{children:[n.jsx(M,{control:o.control,name:"connection_url",render:({field:t})=>n.jsxs(B,{children:[n.jsx(O,{children:"URL *"}),n.jsx(L,{children:n.jsx(W,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:u=>{const s=u.clipboardData.getData("text");s&&(u.preventDefault(),o.setValue("connection_url",s.trim(),{shouldDirty:!0}),r(s))},onBlur:u=>{r(u.target.value),t.onBlur()}})}),n.jsx($,{})]})}),n.jsx(M,{control:o.control,name:"connection_token",render:({field:t})=>n.jsxs(B,{children:[n.jsx(O,{children:f?.token?.label??"Token (optional)"}),n.jsx(L,{children:n.jsx(W,{type:"password",placeholder:f?.token?.placeholder??"Bearer token or API key",className:"ph-no-capture",...t,value:t.value??""})}),f?.token?.helperText&&n.jsxs("p",{className:"text-xs text-muted-foreground",children:[f.token.helperText,f.id==="github"&&n.jsxs(n.Fragment,{children:[" ","·"," ",n.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"})]})]}),n.jsx($,{})]})})]}),n.jsx(M,{control:o.control,name:"title",render:({field:t})=>n.jsxs(B,{children:[n.jsx(O,{children:"Name *"}),n.jsx(L,{children:n.jsx(W,{placeholder:"My Connection",...t})}),n.jsx($,{})]})}),n.jsx(M,{control:o.control,name:"description",render:({field:t})=>n.jsxs(B,{children:[n.jsx(O,{children:"Description"}),n.jsx(L,{children:n.jsx(Kn,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),n.jsx($,{})]})})]});return D?n.jsx(Pn,{open:a,onOpenChange:z,children:n.jsxs(Tn,{className:"max-h-[90vh]",children:[n.jsx(Fn,{className:"pb-2",children:n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{className:"flex-1 text-left",children:[n.jsx(Vn,{children:k}),n.jsx(Mn,{className:"mt-1",children:I})]}),n.jsx(Bn,{asChild:!0,children:n.jsx(Y,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:n.jsx(Un,{size:16})})})]})}),n.jsx(Qe,{...o,children:n.jsxs("form",{onSubmit:o.handleSubmit(b),children:[n.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:P}),n.jsx(On,{children:n.jsx(Y,{type:"submit",disabled:o.formState.isSubmitting,className:"w-full",children:U})})]})})]})}):n.jsx(sn,{open:a,onOpenChange:z,children:n.jsxs(on,{className:"sm:max-w-[525px]",children:[n.jsxs(an,{children:[n.jsx(cn,{children:k}),n.jsx(An,{children:I})]}),n.jsx(Qe,{...o,children:n.jsxs("form",{onSubmit:o.handleSubmit(b),children:[n.jsx("div",{className:"py-4",children:P}),n.jsxs(Dn,{children:[n.jsx(Y,{type:"button",variant:"outline",onClick:()=>z(!1),children:"Cancel"}),n.jsx(Y,{type:"submit",disabled:o.formState.isSubmitting,className:"min-w-40",children:U})]})]})})]})})}function ot(a){const e=xn.c(73),{mode:m,agentId:v,addedConnectionIds:h,onAdd:w,onCloneAndAdd:D,onConnectAndAdd:E,connectingItemId:d,search:_,onCreateConnection:R,onBrowseNavigate:o,defaultTab:x}=a,S=m===void 0?"add":m,F=x===void 0?"connected":x,{org:f}=Ie(),r=re.useDeferredValue(_),z=_!==r,b=r.trim().toLowerCase();let k;e[0]!==F?(k=i=>i??F,e[0]=F,e[1]=k):k=e[1];const[I,U]=gn(jn.connectionsTab(f.slug)+(F==="all"?":home-modal":":agent-modal"),k);let P;e[2]!==I||e[3]!==U?(P=i=>{i!==I&&C("connections_dialog_tab_changed",{to_tab:i}),U(i)},e[2]=I,e[3]=U,e[4]=P):P=e[4];const t=P;let u;e[5]!==f.id||e[6]!==f.slug?(u={connectionId:Zn,orgId:f.id,orgSlug:f.slug},e[5]=f.id,e[6]=f.slug,e[7]=u):u=e[7];const s=Jn(u);let c,j,y;if(e[8]!==s||e[9]!==r||e[10]!==f.id){y=r?.trim()?{operator:"or",conditions:[{field:["title"],operator:"contains",value:r.trim()},{field:["description"],operator:"contains",value:r.trim()}]}:void 0;const i={...y&&{where:y},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},p=JSON.stringify(i);j=Yn,c=me.collectionListInfinite(s,f.id,"","CONNECTIONS",p),e[8]=s,e[9]=r,e[10]=f.id,e[11]=c,e[12]=j,e[13]=y}else c=e[11],j=e[12],y=e[13];let g;e[14]!==s||e[15]!==y?(g=async i=>{const{pageParam:p}=i,K=p===void 0?0:p;return(await s.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...y&&{where:y},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:K}})).structuredContent},e[14]=s,e[15]=y,e[16]=g):g=e[16];let l;e[17]!==c||e[18]!==g?(l={queryKey:c,queryFn:g,initialPageParam:0,getNextPageParam:dt,staleTime:3e4},e[17]=c,e[18]=g,e[19]=l):l=e[19];const{data:N,fetchNextPage:q,hasNextPage:pe,isFetchingNextPage:V}=j(l),Xe=N?.pages.flatMap(lt)??[],he=Cn(Xe),ln=new Set(Xe.filter(rt).map(ct)),fe=nn(),G=tn(fe,r),ke=Ye(G.loadMore,G.hasMore,G.isLoadingMore),Ae=Ye(q,pe??!1,V),T=I==="all"||!!b,qe=T?G.items.filter(i=>{const p=Sn(i);if(p&&ln.has(p))return!1;if(!b)return!0;const K=i._meta?.["mcp.mesh"];return[i.title,i.description,i.name,i.server?.title,i.server?.description,i.server?.name,K?.friendly_name,K?.friendlyName].filter(Boolean).join(" ").toLowerCase().includes(b)}):[],le=qe.filter(it),de=qe.filter(at);let xe;e[20]!==h?(xe=i=>i.some(p=>h.has(p.id)),e[20]=h,e[21]=xe):xe=e[21];const De=xe;let ge;e[22]!==h||e[23]!==v||e[24]!==d||e[25]!==De||e[26]!==S||e[27]!==w||e[28]!==o||e[29]!==D?(ge=(i,p,K,ie,X)=>{const Ce=De(X),ce=X.find(Q=>!h.has(Q.id)),A=X[0];if(S==="browse"){const Q=_n(A);return n.jsx(Le,{connection:{title:p,icon:K,description:X.length>1?`${X.length} instances`:ie??void 0},fallbackIcon:n.jsx(Se,{}),headerActionsAlwaysVisible:!0,headerActions:n.jsxs(Ne,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[n.jsx(Je,{size:11})," Connected"]}),onClick:()=>{C("connection_browse_clicked",{app_name:A.app_name??null,connection_id:A.id,instances_count:X.length}),o?.(Q)}},i)}return n.jsx(Le,{connection:{title:p,icon:K,description:ie},fallbackIcon:n.jsx(Se,{}),headerActionsAlwaysVisible:!0,headerActions:n.jsxs("div",{className:"flex items-center gap-1.5",children:[Ce&&n.jsxs(Ne,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[n.jsx(Je,{size:11})," Added"]}),n.jsx(Y,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:Q=>{Q.stopPropagation(),ce?(C("connection_add_clicked",{action:"use_existing",app_name:A.app_name??null,connection_id:ce.id}),v&&C("agent_connection_attached",{agent_id:v,connection_id:ce.id,app_name:A.app_name??null,mode:"existing"}),w(ce.id)):(C("connection_add_clicked",{action:"clone",app_name:A.app_name??null,base_connection_id:A.id}),D(A))},children:"Add"})]})},i)},e[22]=h,e[23]=v,e[24]=d,e[25]=De,e[26]=S,e[27]=w,e[28]=o,e[29]=D,e[30]=ge):ge=e[30];const je=ge;let ve;e[31]!==d||e[32]!==S||e[33]!==E?(ve=i=>{const p=i._meta?.["mcp.mesh"],K=p?.friendlyName||p?.friendly_name||i.server?.title||i.title||i.server?.name||i.name||i.id||"",ie=i.server?.description||i.description||null,X=i.server?.icons?.[0]?.src||kn(i.server?.repository)||null,Ce=p?.official===!0,ce=p?.verified===!0,A=p?.owner==="deco";return n.jsx(Le,{connection:{title:K,description:ie,icon:X},fallbackIcon:n.jsx(Se,{}),headerActionsAlwaysVisible:!0,headerActions:n.jsxs("div",{className:"flex items-center gap-1.5",children:[A&&n.jsxs(ze,{children:[n.jsx(Ke,{asChild:!0,children:n.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:n.jsx("img",{src:"/logos/deco logo.svg",alt:"Made by Deco",className:"size-3"})})}),n.jsx(He,{children:"Built and maintained by Deco"})]}),!A&&Ce&&n.jsxs(ze,{children:[n.jsx(Ke,{asChild:!0,children:n.jsx(Ne,{variant:"outline",size:"icon",children:n.jsx($e,{})})}),n.jsx(He,{children:"Built and maintained by the official vendor"})]}),!A&&!Ce&&ce&&n.jsxs(ze,{children:[n.jsx(Ke,{asChild:!0,children:n.jsx(Ne,{variant:"outline",size:"icon",children:n.jsx($e,{})})}),n.jsx(He,{children:"Verified by the Deco team"})]}),n.jsx(Y,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:Q=>{Q.stopPropagation(),C("connection_add_clicked",{action:"connect_new",registry_item_id:i.id,app_name:p?.friendlyName||i.server?.name||i.name||null}),E(i)},children:d===i.id?n.jsx(we,{size:14,className:"animate-spin"}):S==="browse"?"Connect":"Add"})]})},`catalog-${i.id}`)},e[31]=d,e[32]=S,e[33]=E,e[34]=ve):ve=e[34];const Ge=ve,Pe=!b&&n.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[n.jsx(Nn,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:I,onTabChange:i=>t(i)}),n.jsxs(Y,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{C("connections_dialog_custom_clicked"),R()},children:[n.jsx(et,{size:12}),"Custom Connection"]})]}),Te=z&&"opacity-50 pointer-events-none";let J;e[35]!==Te?(J=vn("flex-1 overflow-auto p-5 transition-opacity duration-150",Te),e[35]=Te,e[36]=J):J=e[36];const dn="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let ye;e[37]!==je?(ye=i=>{if(i.type==="group")return je(i.key,i.title,i.icon,null,i.connections);const p=i.connection;return je(p.id,p.title,p.icon,p.description??null,[p])},e[37]=je,e[38]=ye):ye=e[38];const Fe=he.map(ye);let Z;e[39]!==Ae?(Z=n.jsx("div",{ref:Ae,className:"col-span-full h-1"}),e[39]=Ae,e[40]=Z):Z=e[40];let ee;e[41]!==V?(ee=V&&n.jsx("div",{className:"col-span-full flex justify-center py-6",children:n.jsx(we,{size:24,className:"animate-spin text-muted-foreground"})}),e[41]=V,e[42]=ee):ee=e[42];const Ve=T&&le.length>0&&n.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[n.jsx($e,{size:13,className:"text-muted-foreground shrink-0"}),n.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"Verified"}),n.jsx("div",{className:"flex-1 h-px bg-border"})]}),Me=T&&le.map(Ge),Be=T&&de.length>0&&n.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[n.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"All connections"}),n.jsx("div",{className:"flex-1 h-px bg-border"})]}),Oe=T&&de.map(Ge);let ne;e[43]!==ke||e[44]!==fe||e[45]!==T?(ne=T&&fe.length>0&&n.jsx("div",{ref:ke,className:"col-span-full h-1"}),e[43]=ke,e[44]=fe,e[45]=T,e[46]=ne):ne=e[46];let te;e[47]!==G.isLoadingMore||e[48]!==T?(te=T&&G.isLoadingMore&&n.jsx("div",{className:"col-span-full flex justify-center py-6",children:n.jsx(we,{size:24,className:"animate-spin text-muted-foreground"})}),e[47]=G.isLoadingMore,e[48]=T,e[49]=te):te=e[49];let se;e[50]!==Fe||e[51]!==Z||e[52]!==ee||e[53]!==Ve||e[54]!==Me||e[55]!==Be||e[56]!==Oe||e[57]!==ne||e[58]!==te?(se=n.jsxs("div",{className:dn,children:[Fe,Z,ee,Ve,Me,Be,Oe,ne,te]}),e[50]=Fe,e[51]=Z,e[52]=ee,e[53]=Ve,e[54]=Me,e[55]=Be,e[56]=Oe,e[57]=ne,e[58]=te,e[59]=se):se=e[59];let oe;e[60]!==I||e[61]!==he.length||e[62]!==de||e[63]!==_||e[64]!==le?(oe=he.length===0&&le.length===0&&de.length===0&&n.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:_?`No connections match "${_}"`:I==="connected"?"No connections yet":"No connections available"}),e[60]=I,e[61]=he.length,e[62]=de,e[63]=_,e[64]=le,e[65]=oe):oe=e[65];let ae;e[66]!==J||e[67]!==se||e[68]!==oe?(ae=n.jsxs("div",{className:J,children:[se,oe]}),e[66]=J,e[67]=se,e[68]=oe,e[69]=ae):ae=e[69];let _e;return e[70]!==Pe||e[71]!==ae?(_e=n.jsxs(n.Fragment,{children:[Pe,ae]}),e[70]=Pe,e[71]=ae,e[72]=_e):_e=e[72],_e}function at(a){return!a.verified&&!a._meta?.["mcp.mesh"]?.verified&&!a.meta?.verified}function it(a){return a.verified||a._meta?.["mcp.mesh"]?.verified||a.meta?.verified}function ct(a){return a.app_name}function rt(a){return a.app_name}function lt(a){return a?.items??[]}function dt(a,e){if(a?.hasMore)return e.reduce(ut,0)}function ut(a,e){return a+(e?.items?.length??0)}function zt({open:a,onOpenChange:e,defaultTab:m,initialSearch:v="",...h}){const w=h.mode??"add",D="agentId"in h?h.agentId:void 0,E="addedConnectionIds"in h?h.addedConnectionIds??new Set:new Set,d="onAdd"in h&&h.onAdd?h.onAdd:s=>{},_=(s,c,j)=>{D&&C("agent_connection_attached",{agent_id:D,connection_id:s,app_name:c,mode:j})},[R,o]=re.useState(null),[x,S]=re.useState(v),[F,f]=re.useState(!1),{org:r}=Ie(),{data:z}=en.useSession(),b=rn(),k=hn(),I=fn(),U=s=>{e(!1),I({to:"/$org/settings/connections/$appSlug",params:{org:r.slug,appSlug:s}})},P=()=>{k.invalidateQueries({predicate:s=>{const c=s.queryKey;return c[1]===r.id&&c[3]==="collection"&&c[4]==="CONNECTIONS"}})},t=async s=>{o(s.app_name??s.id);try{const j=`${s.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,g=(await b.create.mutateAsync({title:j,description:s.description??null,connection_type:s.connection_type,connection_url:s.connection_url??null,connection_token:null,icon:s.icon??null,app_name:s.app_name??null,app_id:s.app_id??null,connection_headers:s.connection_headers??null})).id,l=await Re({connectionId:g,orgId:r.id,orgSlug:r.slug,persistFallback:N=>b.update.mutateAsync({id:g,data:{connection_token:N}}).then(()=>{})});if(l.ran&&!l.ok){C("connection_oauth_failed",{connection_id:g,flow:"clone",error:l.error??"no_token"}),H.error(`Authentication failed: ${l.error??"no token received"}`),await b.delete.mutateAsync(g);return}if(l.ran){C("connection_oauth_succeeded",{connection_id:g,flow:"clone"});const N=new URL(`/api/${r.slug}/mcp/${g}`,window.location.origin);await k.invalidateQueries({queryKey:me.isMCPAuthenticated(N.href,null)}),P()}_(g,s.app_name??null,"clone"),d(g)}catch(c){console.error("Failed to add connection:",c),H.error("Failed to add connection")}finally{o(null)}},u=async s=>{if(!(!r||!z?.user?.id)){o(s.id);try{const c=In(s,r.id,z.user.id,{remoteIndex:0}),j=c.connection_type==="STDIO",y=!!c.connection_url,g=j&&c.connection_headers&&typeof c.connection_headers=="object"&&"command"in c.connection_headers;if(!y&&!g){H.error("This MCP Server cannot be connected: no connection method available"),o(null);return}const{id:l}=await b.create.mutateAsync(c),N=await Re({connectionId:l,orgId:r.id,orgSlug:r.slug,persistFallback:q=>b.update.mutateAsync({id:l,data:{connection_token:q}}).then(()=>{})});if(N.ran&&!N.ok){C("connection_oauth_failed",{connection_id:l,flow:"connect_new",error:N.error??"no_token"}),H.warning("Couldn't sign in to this connection",{description:`It was added to your agent, but its sign-in setup looks off. You can try authenticating again later from the connection's settings. (${N.error??"no token received"})`}),_(l,c.app_name??null,"new"),d(l);return}if(N.ran){C("connection_oauth_succeeded",{connection_id:l,flow:"connect_new"});const q=new URL(`/api/${r.slug}/mcp/${l}`,window.location.origin);await k.invalidateQueries({queryKey:me.isMCPAuthenticated(q.href,null)}),P(),H.success("Connected and authenticated")}else H.success("Connected");_(l,c.app_name??null,"new"),d(l)}catch(c){console.error("Failed to connect:",c),H.error("Failed to connect")}finally{o(null)}}};return n.jsxs(sn,{open:a,onOpenChange:e,children:[n.jsxs(on,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[n.jsx(an,{className:"px-6 pt-5 pb-0 shrink-0",children:n.jsx(cn,{className:"text-base font-semibold",children:w==="browse"?"Connections":"Add Connection"})}),n.jsx("div",{className:"pt-3 shrink-0",children:n.jsx(bn,{value:x,onChange:S,placeholder:"Search connections..."})}),n.jsx(re.Suspense,{fallback:n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(we,{size:24,className:"animate-spin text-muted-foreground"})}),children:n.jsx(ot,{mode:w,agentId:D,addedConnectionIds:E,onAdd:d,onCloneAndAdd:t,onConnectAndAdd:u,connectingItemId:R,search:x,onCreateConnection:()=>f(!0),onBrowseNavigate:U,defaultTab:m})})]}),n.jsx(st,{open:F,onOpenChange:f,onCreated:async s=>{f(!1);const c=await Re({connectionId:s,orgId:r.id,orgSlug:r.slug,persistFallback:j=>b.update.mutateAsync({id:s,data:{connection_token:j}}).then(()=>{})});if(c.ran&&!c.ok){C("connection_oauth_failed",{connection_id:s,flow:"custom_create",error:c.error??"no_token"}),H.warning("Couldn't sign in to this connection",{description:`It was added to your agent, but its sign-in setup looks off. You can try authenticating again later from the connection's settings. (${c.error??"no token received"})`}),_(s,null,"custom"),d(s),e(!1);return}if(c.ran){C("connection_oauth_succeeded",{connection_id:s,flow:"custom_create"});const j=new URL(`/api/${r.slug}/mcp/${s}`,window.location.origin);await k.invalidateQueries({queryKey:me.isMCPAuthenticated(j.href,null)}),P()}_(s,null,"custom"),d(s),e(!1)}})]})}const Ze=new Map;function Kt(){const{org:a}=Ie(),e=nt(),m=tt(),v=m.find(r=>r.providerId==="deco"),{data:h,isLoading:w,refetch:D,isFetching:E}=yn({queryKey:me.aiProviderCredits(a.id,"deco"),enabled:!!v,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),d=h?.balanceCents??null,_=d!=null?d/100:null,R=re.useRef(new Map);if(d!=null){const r=Ze.get(a.id);R.current.get(a.id)&&r!=null&&d>r&&C("credits_topped_up_detected",{organization_id:a.id,delta_cents:d-r,previous_balance_cents:r,new_balance_cents:d}),Ze.set(a.id,d),R.current.set(a.id,!0)}const o=!!v,x=d!=null&&d>0,S=d!=null&&d===0,F=d!=null&&d===200,f=m.length>0&&m.every(r=>r.providerId==="deco");return{hasDecoKey:o,decoKeyId:v?.id??null,balanceCents:d,balanceDollars:_,hasCredits:x,isZeroBalance:S,isInitialFreeCredit:F,hasOnlyDecoProvider:f,isLoading:w,isFetching:E,refetch:D}}function Ue(a){const e=a?.metadata?.githubRepo;if(!e?.url)return{status:"none"};const m=e.connectionId;return!!m&&!!a?.connections?.some(w=>w.connection_id===m)?{status:"attached",repo:e,connectionId:m}:!!m||e.installationId!=null?{status:"detached",repo:e}:{status:"public-clone",repo:e}}function Ht(a){const e=Ue(a);return e.status==="attached"||e.status==="public-clone"?e.repo:null}function Ut(a){if(typeof a!="object"||a===null)return!1;const m=a.githubRepo?.url;return typeof m=="string"&&m.length>0}function Xt(a){return Ue(a).status==="attached"}function qt(a){const e=Ue(a).status;return e==="attached"||e==="detached"}function Gt(a){const e=new Set;for(const m of a??[]){const v=m.metadata?.liveAgentId;typeof v=="string"&&v&&e.add(m.id)}return e}function Qt(a,e){if(!a)return null;const m=a.metadata?.liveAgentId;if(typeof m=="string"&&m)return{mode:"dev",targetId:m};const v=(e??[]).find(h=>h.metadata?.liveAgentId===a.id);return v?{mode:"live",targetId:v.id}:null}export{zt as A,Gt as a,Ut as b,Xt as c,qt as d,Qt as f,Ht as g,Ue as r,Kt as u};