decocms 3.29.1 → 3.30.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/dist/client/assets/{AlertCircle-CIkJ_tva.js → AlertCircle-BQLR7I4E.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-DjtsYmlk.js → ArrowUpRight-DSaWSvAP.js} +1 -1
  3. package/dist/client/assets/{Check-DZ5PZYLO.js → Check-DCDpfG7m.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-DyJzuYoS.js → CheckCircle-BBK-3Pzt.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-CGeYjJAK.js → ChevronDown-BD0G-h2k.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-DWiixe45.js → ChevronLeft-DtP_Ayjz.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-Bm_e-tIB.js → ChevronRight-DUzhuedZ.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-BCv26pBY.js → ChevronUp-D5M0geM5.js} +1 -1
  9. package/dist/client/assets/{Container-DNJNU1b4.js → Container-Catp9d2q.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-CqB_Aadi.js → DotsVertical-Dok1GVxI.js} +1 -1
  11. package/dist/client/assets/{Eye-MkeUTfT3.js → Eye-Dmik5hYP.js} +1 -1
  12. package/dist/client/assets/{FilterLines-CfVg89f7.js → FilterLines-C37LaXJ1.js} +1 -1
  13. package/dist/client/assets/{Globe01-xZhhj276.js → Globe01-D1c-3J9t.js} +1 -1
  14. package/dist/client/assets/{HardDrive-CtdIy8yR.js → HardDrive-C1vRZoAn.js} +1 -1
  15. package/dist/client/assets/{Key01-CXIWciFj.js → Key01-CdveS1HN.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-CJ48TbRA.js → LayoutLeft-Bfxz6P9F.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-Bi6In-BW.js → LinkExternal01-CxEkPs1F.js} +1 -1
  18. package/dist/client/assets/{Monitor01-CsSfQSQt.js → Monitor01-Bkoa3Nbe.js} +1 -1
  19. package/dist/client/assets/{Palette-CmO3ZuPu.js → Palette-C74Da44y.js} +1 -1
  20. package/dist/client/assets/{Play-CQ97sIka.js → Play-BERjgeke.js} +1 -1
  21. package/dist/client/assets/{Plus-CTho-g8m.js → Plus-CdvauR8B.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-D1X4YmG3.js → RefreshCcw01-4ELQWtuB.js} +1 -1
  23. package/dist/client/assets/{SearchMd-BVJBwCEd.js → SearchMd-DvX2rzEB.js} +1 -1
  24. package/dist/client/assets/{Settings02-Cqx4N2is.js → Settings02-Cqwfv4FN.js} +1 -1
  25. package/dist/client/assets/{Shield01-D5OMek_B.js → Shield01-6id4oLiZ.js} +1 -1
  26. package/dist/client/assets/{Star01-4yFjK6bh.js → Star01--MeVNqbA.js} +1 -1
  27. package/dist/client/assets/{Stars01-DWbsIFJF.js → Stars01-C2BTpZeS.js} +1 -1
  28. package/dist/client/assets/{Stars02-BLn35DBB.js → Stars02-D6zEAnUT.js} +1 -1
  29. package/dist/client/assets/{Sun-FelsR2hx.js → Sun-BGVsB7Cm.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-Bsjx9paN.js → SwitchHorizontal01-DC97OO23.js} +1 -1
  31. package/dist/client/assets/{Tool01-BxT6lP7E.js → Tool01-DQ4cTbeu.js} +1 -1
  32. package/dist/client/assets/{Trash01-BczIIm5v.js → Trash01-Biurgfq6.js} +1 -1
  33. package/dist/client/assets/{Upload01-nIFiyRcG.js → Upload01-B-0o1yeU.js} +1 -1
  34. package/dist/client/assets/{User01-CamUMrWb.js → User01-CZ5ejYDg.js} +1 -1
  35. package/dist/client/assets/{Users01-CgFieXMp.js → Users01-CKNLJr4G.js} +1 -1
  36. package/dist/client/assets/{Users03-DT_R5tz6.js → Users03-CA9cu5qb.js} +1 -1
  37. package/dist/client/assets/{X-CRg5TH_Y.js → X-DlMQL-XM.js} +1 -1
  38. package/dist/client/assets/{XCircle-DkwGk6Y1.js → XCircle-G0WrPq0g.js} +1 -1
  39. package/dist/client/assets/{XClose-D72Lt3NI.js → XClose-LNW85JIs.js} +1 -1
  40. package/dist/client/assets/{Zap-B-Fg7TEp.js → Zap-CbtV6Vvm.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-BqiIusHB.js → ZapSquare-C9LhFrIW.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-zDFXRspK.js → ZoomOut-CImzlj9g.js} +1 -1
  43. package/dist/client/assets/{access-gate-SfXPQWUj.js → access-gate-DR0BZ9Yv.js} +1 -1
  44. package/dist/client/assets/{accordion-DKdXwYYc.js → accordion-CiWkTYYE.js} +1 -1
  45. package/dist/client/assets/add-section-modal-Dv2cxIh1.js +1 -0
  46. package/dist/client/assets/{agent-capabilities-QxThXvgQ.js → agent-capabilities-l_XcUqX-.js} +1 -1
  47. package/dist/client/assets/{agent-icon-C_8D2J-7.js → agent-icon-CjlB-XbA.js} +1 -1
  48. package/dist/client/assets/{agent-icons-DozoyM-L.js → agent-icons-COjGtXRX.js} +1 -1
  49. package/dist/client/assets/{agents-list-C0ILdC1R.js → agents-list-BbpQy40q.js} +1 -1
  50. package/dist/client/assets/ai-providers-YKtufrsd.js +1 -0
  51. package/dist/client/assets/{alert-Csb33_9v.js → alert-DUOzDLz2.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-CbYM4jmz.js → alert-dialog-ZB1-0uWA.js} +1 -1
  53. package/dist/client/assets/app-editor-CFm4rW9v.js +1 -0
  54. package/dist/client/assets/{auth-catchall-tRl-mCnV.js → auth-catchall-p-9cQrp4.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-CRIa8lnq.js → auth-split-layout-DCQZj1x8.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-DaUVjzEO.js → automation-list-row-1QBzAyda.js} +1 -1
  57. package/dist/client/assets/{automation-runs-ByMFrYpg.js → automation-runs-CbXniThO.js} +1 -1
  58. package/dist/client/assets/{automations-DOHjwNUR.js → automations-DXbm14M-.js} +1 -1
  59. package/dist/client/assets/{avatar-Bf_YMKWh.js → avatar-DdrKHW7Q.js} +1 -1
  60. package/dist/client/assets/{badge-Di1xo__6.js → badge-GxV01_sa.js} +1 -1
  61. package/dist/client/assets/{brand-context-DVFnuzc3.js → brand-context-CckU9jvo.js} +1 -1
  62. package/dist/client/assets/{buckets-BKqAOUQL.js → buckets-BXxpFWbP.js} +1 -1
  63. package/dist/client/assets/{calendar-BvlrJX6s.js → calendar-ndWEDvWe.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-NgXOd2ZO.js → capability-load-error-C1lcmzPk.js} +1 -1
  65. package/dist/client/assets/{card-CWqz0DaV.js → card-B7vNztnP.js} +1 -1
  66. package/dist/client/assets/{chat-context-BoAn6xWM.js → chat-context-Dr8mURNn.js} +1 -1
  67. package/dist/client/assets/{checkbox-C5cEV_DH.js → checkbox-CvlqSsv8.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-Da-trtdE.js → cli-auth-success-DbBnzJkW.js} +1 -1
  69. package/dist/client/assets/collection-detail-dh1JPTkf.js +1 -0
  70. package/dist/client/assets/{collection-display-button-BAYgV8vn.js → collection-display-button-ByiFEfVE.js} +1 -1
  71. package/dist/client/assets/{collection-search-Bk4YcOKu.js → collection-search-B62hBYcH.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-DRe15D6A.js → collection-table-wrapper-p305Tve_.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-CSSbV4je.js → collection-tabs-BoWbncvo.js} +1 -1
  74. package/dist/client/assets/{collections-CG_8shjq.js → collections-BU-b7Qnp.js} +1 -1
  75. package/dist/client/assets/{command-CFpCNmCF.js → command-DeymMKPH.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-BIhfHnnr.js → connect-desktop-dialog-B6fCPmnk.js} +1 -1
  77. package/dist/client/assets/{connection-card-B1-pvTAQ.js → connection-card-BdHs3sI8.js} +1 -1
  78. package/dist/client/assets/{connection-detail-Bh5oWdyn.js → connection-detail-1bfT9skO.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-oVYdKzFk.js → connection-form-helpers-Cl8WE-Wv.js} +1 -1
  80. package/dist/client/assets/{connections-Dp3XGEkZ.js → connections-CQfywKkf.js} +1 -1
  81. package/dist/client/assets/decopilot-sse-pool-TF6jERkV.js +1 -0
  82. package/dist/client/assets/{dialog-DzWL-NrT.js → dialog-Bug5LYvY.js} +1 -1
  83. package/dist/client/assets/{domain-settings-DJD9U4sU.js → domain-settings-CiVW_jUc.js} +1 -1
  84. package/dist/client/assets/{drawer-BLGCEP9S.js → drawer-Ckfnpw8I.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-YzbwHIxx.js → dropdown-menu-CggnBdjt.js} +1 -1
  86. package/dist/client/assets/{dynamic-plugin-layout-BB8gWDVj.js → dynamic-plugin-layout-yS0CT9hK.js} +1 -1
  87. package/dist/client/assets/{empty-state-DfOA7oYG.js → empty-state-C6yeON6c.js} +1 -1
  88. package/dist/client/assets/{empty-state-CEcNMd77.js → empty-state-DtTBbW_W.js} +1 -1
  89. package/dist/client/assets/{extract-connection-data-DzgWcXVA.js → extract-connection-data-BR7VTC2M.js} +1 -1
  90. package/dist/client/assets/{features-CIhQ9FPK.js → features-fQ1ChqbW.js} +1 -1
  91. package/dist/client/assets/file-explorer-Bpe6MxXV.js +2 -0
  92. package/dist/client/assets/{file-type-icon-9WcINLx3.js → file-type-icon-Dg4vNCbL.js} +1 -1
  93. package/dist/client/assets/{files-CfinSi-B.js → files-C7GL35WM.js} +1 -1
  94. package/dist/client/assets/{form-DK41bruw.js → form-Bkkvnz-_.js} +1 -1
  95. package/dist/client/assets/{general-BUSEsa-r.js → general-T2AFh9Ye.js} +1 -1
  96. package/dist/client/assets/{generate-id-DOxNmKSl.js → generate-id-DfnWKozM.js} +1 -1
  97. package/dist/client/assets/github-repo-picker-BKJVsWG6.js +4 -0
  98. package/dist/client/assets/{header-tab-button-BDD5kZQa.js → header-tab-button-CfuW1KOG.js} +1 -1
  99. package/dist/client/assets/{hover-card-C0gmU-KR.js → hover-card-7wnR4X6J.js} +1 -1
  100. package/dist/client/assets/{image-field-CNdkpe4-.js → image-field-DsnvgvCV.js} +1 -1
  101. package/dist/client/assets/{index-4CkRjwqB.js → index-BD68Poau.js} +1 -1
  102. package/dist/client/assets/{index-DzNLTQFE.js → index-BDwe75Ed.js} +2 -2
  103. package/dist/client/assets/{index-DdTSg63X.js → index-BL9vKovB.js} +4 -4
  104. package/dist/client/assets/{index-CpG2_v8p.js → index-BjoOIgbb.js} +3 -3
  105. package/dist/client/assets/{index-D-Er7K2V.js → index-C6AFi5aI.js} +1 -1
  106. package/dist/client/assets/{index-CghQMTVW.js → index-CCldjkHi.js} +1 -1
  107. package/dist/client/assets/{index-rP7Vi9h6.js → index-CV7TX6uY.js} +1 -1
  108. package/dist/client/assets/{index-Bw6dLXGR.js → index-C_NDVGp1.js} +1 -1
  109. package/dist/client/assets/index-CoS-DNLH.js +1 -0
  110. package/dist/client/assets/{index-CH6_c02Q.js → index-CvubZqsl.js} +1 -1
  111. package/dist/client/assets/index-DHXKcvHJ.js +1 -0
  112. package/dist/client/assets/{index-Dd5x1Ugx.js → index-Dow8MSuu.js} +1 -1
  113. package/dist/client/assets/{index-B6yJwY9r.js → index-K-cFrJme.js} +1 -1
  114. package/dist/client/assets/{index-Vm79zSBa.js → index-M8U0QO9V.js} +1 -1
  115. package/dist/client/assets/{index-redirect-B5KfXttx.js → index-redirect-CDKs11B5.js} +1 -1
  116. package/dist/client/assets/{index-CRk3na1v.js → index-uM9cBeAz.js} +1 -1
  117. package/dist/client/assets/{infiniteQueryObserver-DKFzmh7N.js → infiniteQueryObserver-DjRZQa58.js} +1 -1
  118. package/dist/client/assets/{input-BWjbzzQM.js → input-CAytkUdm.js} +1 -1
  119. package/dist/client/assets/{integration-icon-Jhe4mXPc.js → integration-icon-BxZqCPgY.js} +1 -1
  120. package/dist/client/assets/{label-BD30ND7M.js → label-_bcDhrPn.js} +1 -1
  121. package/dist/client/assets/{layout-CshuPuNT.js → layout-D6JyUu-W.js} +1 -1
  122. package/dist/client/assets/{login-xvknfGAE.js → login-D_Y894-5.js} +1 -1
  123. package/dist/client/assets/{members-B-0d8UVK.js → members-BiZDHDwm.js} +1 -1
  124. package/dist/client/assets/{monaco-editor-CO97GxVj.js → monaco-editor-DR1buwuA.js} +1 -1
  125. package/dist/client/assets/{monitoring-stats-row-Cfw3-iQJ.js → monitoring-stats-row-BH1n8Qao.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-OP1K2cBS.js → oauth-callback-Bwrh5dBF.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-ai-provider-AV6p2GPf.js → oauth-callback-ai-provider-DnFWhV-5.js} +1 -1
  128. package/dist/client/assets/{onboarding-BydTnX4J.js → onboarding-0pY55b33.js} +1 -1
  129. package/dist/client/assets/{org-install-By9f70v3.js → org-install-CfS-9owX.js} +1 -1
  130. package/dist/client/assets/{org-layout-Cuv0PXEZ.js → org-layout-WjhxFhVG.js} +1 -1
  131. package/dist/client/assets/{org-plugin-layout-D6ftiJr2.js → org-plugin-layout-CBd88Pps.js} +1 -1
  132. package/dist/client/assets/{page-seo-form-D0J4BsJd.js → page-seo-form-DA-M0CRU.js} +1 -1
  133. package/dist/client/assets/page-seo-sheet-BGJM5zp7.js +1 -0
  134. package/dist/client/assets/pair-rWOsLIRO.js +46 -0
  135. package/dist/client/assets/{plugin-empty-state-CTifOpyh.js → plugin-empty-state-BC-cPjsG.js} +1 -1
  136. package/dist/client/assets/{plugin-header-D63WcJTf.js → plugin-header-CZ1sX2n9.js} +1 -1
  137. package/dist/client/assets/{plugin-layout-DIqP9Bzh.js → plugin-layout-egGFGy3C.js} +1 -1
  138. package/dist/client/assets/{popover-w66kr7qI.js → popover-H1IIsqsO.js} +1 -1
  139. package/dist/client/assets/{post-editor-CcNc2iwJ.js → post-editor-D8Amc377.js} +1 -1
  140. package/dist/client/assets/{primitives-CXAphNCy.js → primitives-DXNs_riQ.js} +1 -1
  141. package/dist/client/assets/{profile-DPgEYebY.js → profile-jQNt2qst.js} +1 -1
  142. package/dist/client/assets/project-app-view-CByPW7cJ.js +1 -0
  143. package/dist/client/assets/record-editor-BoDJjFQA.js +1 -0
  144. package/dist/client/assets/registry-aermVrqm.js +2 -0
  145. package/dist/client/assets/{registry-layout-CpOLAjVd.js → registry-layout-CC29q8fz.js} +1 -1
  146. package/dist/client/assets/{require-capability-BJrX_rPe.js → require-capability-g-UPmpGK.js} +1 -1
  147. package/dist/client/assets/{required-auth-layout-CzrHHdU9.js → required-auth-layout-B5sViZsY.js} +1 -1
  148. package/dist/client/assets/{reset-password-XeANzZ8O.js → reset-password-BC3ZM7w0.js} +1 -1
  149. package/dist/client/assets/{resizable-B8hoAXbl.js → resizable-DaIe2JEk.js} +1 -1
  150. package/dist/client/assets/{roles-CfBRlxaX.js → roles-C5M6mJ4v.js} +1 -1
  151. package/dist/client/assets/save-referenced-block-BLu5E_fA.js +1 -0
  152. package/dist/client/assets/{save-status-Ds8Nwo0Y.js → save-status-DaG-SHKI.js} +1 -1
  153. package/dist/client/assets/{schema-form-914BofiG.js → schema-form-BBSGBJV6.js} +1 -1
  154. package/dist/client/assets/{scroll-area-CFrtCBLi.js → scroll-area-7dB1B4gR.js} +1 -1
  155. package/dist/client/assets/{search-input-BXsljctW.js → search-input-DwwxFJsd.js} +1 -1
  156. package/dist/client/assets/{secrets-Dh_eQg6Y.js → secrets-BVqejBQE.js} +1 -1
  157. package/dist/client/assets/{sections-editor-Cy1_wyqm.js → sections-editor-B1P_XWwE.js} +1 -1
  158. package/dist/client/assets/{select-B0qONt_m.js → select-Dn6Da_1F.js} +1 -1
  159. package/dist/client/assets/{select-model-DV1J8lbW.js → select-model-W59Bilmt.js} +1 -1
  160. package/dist/client/assets/seo-editor-CBSOqlcM.js +1 -0
  161. package/dist/client/assets/settings-layout-DypT7z1u.js +1 -0
  162. package/dist/client/assets/{settings-section-ByFuwsko.js → settings-section-BkgYqxH8.js} +1 -1
  163. package/dist/client/assets/{sheet-BlMfZj2L.js → sheet-CxiAY8T5.js} +1 -1
  164. package/dist/client/assets/{shell-controls-URBQR3Oa.js → shell-controls-rZ6L5v7J.js} +1 -1
  165. package/dist/client/assets/{shell-layout-NuYzN-Gn.js → shell-layout-B5B3hmRp.js} +1 -1
  166. package/dist/client/assets/{shell-route-loading-DCVHDrWy.js → shell-route-loading-BURh1jIH.js} +1 -1
  167. package/dist/client/assets/{sidebar-DceLItg8.js → sidebar-CIJpOENy.js} +1 -1
  168. package/dist/client/assets/{skeleton-07IZijZM.js → skeleton-B0e2OkSv.js} +1 -1
  169. package/dist/client/assets/{sortable.esm-CzY2WOGE.js → sortable.esm-B6-kJBUo.js} +1 -1
  170. package/dist/client/assets/{spinner-B8QiOf4h.js → spinner-C2ljLkNd.js} +1 -1
  171. package/dist/client/assets/{sso-CwWhDCFg.js → sso-DutRn6kP.js} +1 -1
  172. package/dist/client/assets/{store-D9gP4byy.js → store-CuKFTdG_.js} +1 -1
  173. package/dist/client/assets/store-registry-CRmNQ4V9.js +2 -0
  174. package/dist/client/assets/{studio-tools-Cly5ZCG3.js → studio-tools-DfxdEEgB.js} +1 -1
  175. package/dist/client/assets/{switch-BJt48css.js → switch-DDGBJlE2.js} +1 -1
  176. package/dist/client/assets/{tab-id-Cgg9_UqF.js → tab-id-TBSp1YxU.js} +6 -6
  177. package/dist/client/assets/{table-3evUHy3g.js → table-GnXYzms9.js} +1 -1
  178. package/dist/client/assets/{tabs-B1x7Fe-S.js → tabs-BajnAGhM.js} +1 -1
  179. package/dist/client/assets/{task-status-F5X71Or6.js → task-status-fWcsMePP.js} +1 -1
  180. package/dist/client/assets/{textarea-CgmDS1mc.js → textarea-JAS7Y9kw.js} +1 -1
  181. package/dist/client/assets/{toggle-group-DVdH8zGh.js → toggle-group-Bv21I6Mc.js} +1 -1
  182. package/dist/client/assets/{toolbar-CXAxzeUh.js → toolbar-CkGflKXn.js} +1 -1
  183. package/dist/client/assets/{tools-list-B226mv7W.js → tools-list-DKrbt2O-.js} +1 -1
  184. package/dist/client/assets/{tooltip-D5r7nYKO.js → tooltip-CKtclZb-.js} +1 -1
  185. package/dist/client/assets/{types-DIAQ40QE.js → types-2N8PTdbg.js} +1 -1
  186. package/dist/client/assets/{use-ai-providers-BMK8G5pd.js → use-ai-providers-CGLipwx3.js} +1 -1
  187. package/dist/client/assets/{use-automations-CqVVjbv4.js → use-automations-BChOAOA6.js} +1 -1
  188. package/dist/client/assets/{use-capability-Dp-xHWqY.js → use-capability-czp9i90U.js} +1 -1
  189. package/dist/client/assets/{use-clock-tick-Dkz_tj-X.js → use-clock-tick-_Fh5zTFQ.js} +1 -1
  190. package/dist/client/assets/{use-collections-dzWuZTM5.js → use-collections-CrAY0KoX.js} +1 -1
  191. package/dist/client/assets/{use-connection-CbBvGv-y.js → use-connection-NiFefepq.js} +1 -1
  192. package/dist/client/assets/{use-copy-CP7WU0J2.js → use-copy-CQfxrmWX.js} +1 -1
  193. package/dist/client/assets/{use-create-virtual-mcp-Dz02gDB8.js → use-create-virtual-mcp-DwKQGNi1.js} +1 -1
  194. package/dist/client/assets/{use-debounced-autosave-7E-JkkEV.js → use-debounced-autosave-DCM6oAgZ.js} +1 -1
  195. package/dist/client/assets/{use-delete-connection-daNvL5F7.js → use-delete-connection-bIYVec_d.js} +1 -1
  196. package/dist/client/assets/{use-file-configs-CzOp0gY1.js → use-file-configs-CqXWCLQv.js} +1 -1
  197. package/dist/client/assets/{use-infinite-scroll-Dz0Ju18S.js → use-infinite-scroll-CNFLUrB_.js} +1 -1
  198. package/dist/client/assets/{use-list-state-Cf00xLLl.js → use-list-state-DRxXstLB.js} +1 -1
  199. package/dist/client/assets/{use-mcp-client-BDuQ-DKr.js → use-mcp-client-B46VYAN_.js} +1 -1
  200. package/dist/client/assets/{use-mcp-prompts-BfczuqQ1.js → use-mcp-prompts-BfYOND3X.js} +1 -1
  201. package/dist/client/assets/{use-mcp-tools-xqS_ta53.js → use-mcp-tools-wPegb5Xs.js} +1 -1
  202. package/dist/client/assets/{use-members-DH5dae5S.js → use-members-DTpTFucv.js} +1 -1
  203. package/dist/client/assets/{use-navigate-to-agent-CLdhXO-i.js → use-navigate-to-agent-DL0_jMva.js} +1 -1
  204. package/dist/client/assets/{use-org-auth-client-BwDW-s0s.js → use-org-auth-client-DFhI1mXp.js} +1 -1
  205. package/dist/client/assets/{use-org-sso-BO0DGPVQ.js → use-org-sso-B2JHlDcL.js} +1 -1
  206. package/dist/client/assets/{use-organization-roles-ZTYugFdP.js → use-organization-roles-Do917bwO.js} +1 -1
  207. package/dist/client/assets/{use-organization-settings-ofRxNgFR.js → use-organization-settings-CGdaVuD7.js} +1 -1
  208. package/dist/client/assets/{use-registry-connections-Clpq_83P.js → use-registry-connections-B7_YY-15.js} +1 -1
  209. package/dist/client/assets/{use-secrets-CjbHuNwC.js → use-secrets-qOLSEePj.js} +1 -1
  210. package/dist/client/assets/use-status-sounds-EA9ENH60.js +1 -0
  211. package/dist/client/assets/{use-view-mode-CjoQ3b4F.js → use-view-mode-C2K6zcu8.js} +1 -1
  212. package/dist/client/assets/{use-virtual-mcp-BOy7A3-I.js → use-virtual-mcp-DHileccV.js} +1 -1
  213. package/dist/client/assets/useInfiniteQuery-vMxng0_U.js +1 -0
  214. package/dist/client/assets/{useRouterState-BIyanAgq.js → useRouterState-93R-QVdz.js} +1 -1
  215. package/dist/client/assets/useSuspenseInfiniteQuery-_hGeqDYv.js +1 -0
  216. package/dist/client/assets/{user-DjbLcTMi.js → user-T0gsPnBH.js} +1 -1
  217. package/dist/client/assets/{view-mode-toggle-DnMmKH1O.js → view-mode-toggle-BvPi1TV1.js} +1 -1
  218. package/dist/client/assets/watch-sse-pool-BSePGeIN.js +1 -0
  219. package/dist/client/assets/{workflow-D0yr6HGh.js → workflow-aar8VltW.js} +1 -1
  220. package/dist/client/assets/workflow-detail-Cyps73VW.js +1 -0
  221. package/dist/client/index.html +1 -1
  222. package/dist/server/cli.js +499 -417
  223. package/dist/server/server.js +275 -275
  224. package/package.json +1 -1
  225. package/dist/client/assets/add-section-modal-rFZJepGX.js +0 -1
  226. package/dist/client/assets/ai-providers-BQNg7G2z.js +0 -1
  227. package/dist/client/assets/app-editor-D3p9xZvL.js +0 -1
  228. package/dist/client/assets/collection-detail-K9T_V-NT.js +0 -1
  229. package/dist/client/assets/create-sse-subscription-BS5983N4.js +0 -1
  230. package/dist/client/assets/decopilot-sse-pool-CJ_QbSiL.js +0 -1
  231. package/dist/client/assets/file-explorer-Dp5sNAMl.js +0 -2
  232. package/dist/client/assets/github-repo-picker-BJ45Iuw_.js +0 -4
  233. package/dist/client/assets/index-CZ9iD_kA.js +0 -1
  234. package/dist/client/assets/index-PP1_jM4a.js +0 -1
  235. package/dist/client/assets/page-seo-sheet-Q7Y1gsuc.js +0 -1
  236. package/dist/client/assets/pair-D1IR0Baq.js +0 -46
  237. package/dist/client/assets/project-app-view-B73O2qLq.js +0 -1
  238. package/dist/client/assets/record-editor-hFUcPDs2.js +0 -1
  239. package/dist/client/assets/registry-CSai7Qf3.js +0 -2
  240. package/dist/client/assets/save-referenced-block-MdHBsKGI.js +0 -1
  241. package/dist/client/assets/seo-editor-xn4RyB29.js +0 -1
  242. package/dist/client/assets/settings-layout-DagPHYsX.js +0 -1
  243. package/dist/client/assets/store-registry-Bu6pBKfc.js +0 -2
  244. package/dist/client/assets/use-status-sounds-BQhIBN31.js +0 -1
  245. package/dist/client/assets/useInfiniteQuery-BA4Q5DOk.js +0 -1
  246. package/dist/client/assets/useSuspenseInfiniteQuery-PHI3OnKC.js +0 -1
  247. package/dist/client/assets/workflow-detail-BCL21zFy.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decocms",
3
- "version": "3.29.1",
3
+ "version": "3.30.1",
4
4
  "description": "Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- import{e as $,r as g,j as r,c as H}from"./index-CpG2_v8p.js";import{E as _}from"./agent-icon-C_8D2J-7.js";import{i as V}from"./SearchMd-BVJBwCEd.js";import{D as X,a as J,c as K,b as Q}from"./dialog-DzWL-NrT.js";import{I as Y}from"./input-BWjbzzQM.js";import{a4 as Z,a2 as ee,a5 as te,a6 as G,G as re}from"./index-DdTSg63X.js";import"./AlertCircle-CIkJ_tva.js";import"./Tool01-BxT6lP7E.js";import"./SwitchHorizontal01-Bsjx9paN.js";import"./RefreshCcw01-D1X4YmG3.js";import"./XCircle-DkwGk6Y1.js";import"./ArrowUpRight-DjtsYmlk.js";import"./ZapSquare-BqiIusHB.js";import"./Users03-DT_R5tz6.js";import"./CheckCircle-DyJzuYoS.js";import"./Check-DZ5PZYLO.js";import"./ChevronDown-CGeYjJAK.js";import"./ChevronLeft-DWiixe45.js";import"./ChevronRight-Bm_e-tIB.js";import"./ChevronUp-BCv26pBY.js";import"./DotsVertical-CqB_Aadi.js";import"./Container-DNJNU1b4.js";import"./Eye-MkeUTfT3.js";import"./ZoomOut-zDFXRspK.js";import"./Globe01-xZhhj276.js";import"./FilterLines-CfVg89f7.js";import"./Star01-4yFjK6bh.js";import"./Palette-CmO3ZuPu.js";import"./HardDrive-CtdIy8yR.js";import"./Stars02-BLn35DBB.js";import"./Key01-CXIWciFj.js";import"./LayoutLeft-CJ48TbRA.js";import"./LinkExternal01-Bi6In-BW.js";import"./Monitor01-CsSfQSQt.js";import"./Sun-FelsR2hx.js";import"./Play-CQ97sIka.js";import"./Plus-CTho-g8m.js";import"./Settings02-Cqx4N2is.js";import"./Shield01-D5OMek_B.js";import"./Stars01-DWbsIFJF.js";import"./Trash01-BczIIm5v.js";import"./Upload01-nIFiyRcG.js";import"./User01-CamUMrWb.js";import"./Users01-CgFieXMp.js";import"./XClose-D72Lt3NI.js";import"./X-CRg5TH_Y.js";import"./Zap-B-Fg7TEp.js";import"./agent-capabilities-QxThXvgQ.js";import"./chat-context-BoAn6xWM.js";import"./tab-id-Cgg9_UqF.js";import"./use-mcp-client-BDuQ-DKr.js";import"./decopilot-sse-pool-CJ_QbSiL.js";import"./create-sse-subscription-BS5983N4.js";import"./studio-tools-Cly5ZCG3.js";import"./use-virtual-mcp-BOy7A3-I.js";import"./use-collections-dzWuZTM5.js";import"./use-ai-providers-BMK8G5pd.js";import"./use-organization-settings-ofRxNgFR.js";import"./pair-D1IR0Baq.js";import"./use-clock-tick-Dkz_tj-X.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./scroll-area-CFrtCBLi.js";import"./select-B0qONt_m.js";import"./tooltip-D5r7nYKO.js";import"./use-copy-CP7WU0J2.js";import"./file-type-icon-9WcINLx3.js";import"./content-blocks-o63cs2vh.js";import"./types-DIAQ40QE.js";import"./shell-layout-NuYzN-Gn.js";import"./avatar-Bf_YMKWh.js";import"./required-auth-layout-CzrHHdU9.js";import"./useRouterState-BIyanAgq.js";import"./use-org-sso-BO0DGPVQ.js";import"./integration-icon-Jhe4mXPc.js";import"./use-navigate-to-agent-CLdhXO-i.js";import"./use-connection-CbBvGv-y.js";import"./use-mcp-prompts-BfczuqQ1.js";import"./form-DK41bruw.js";import"./label-BD30ND7M.js";import"./spinner-B8QiOf4h.js";import"./drawer-BLGCEP9S.js";import"./collection-search-Bk4YcOKu.js";import"./tabs-B1x7Fe-S.js";import"./toggle-group-DVdH8zGh.js";import"./connect-desktop-dialog-BIhfHnnr.js";import"./agent-icons-DozoyM-L.js";import"./checkbox-C5cEV_DH.js";import"./skeleton-07IZijZM.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-ByFuwsko.js";import"./card-CWqz0DaV.js";import"./popover-w66kr7qI.js";import"./command-CFpCNmCF.js";import"./index-rP7Vi9h6.js";import"./useInfiniteQuery-BA4Q5DOk.js";import"./infiniteQueryObserver-DKFzmh7N.js";import"./sortable.esm-CzY2WOGE.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-B1-pvTAQ.js";import"./use-registry-connections-Clpq_83P.js";import"./extract-connection-data-DzgWcXVA.js";import"./generate-id-DOxNmKSl.js";import"./collections-CG_8shjq.js";import"./collection-tabs-CSSbV4je.js";import"./badge-Di1xo__6.js";import"./textarea-CgmDS1mc.js";import"./connection-form-helpers-oVYdKzFk.js";import"./use-infinite-scroll-Dz0Ju18S.js";import"./useSuspenseInfiniteQuery-PHI3OnKC.js";import"./index-B6yJwY9r.js";import"./dropdown-menu-YzbwHIxx.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-DCVHDrWy.js";import"./sidebar-DceLItg8.js";import"./sheet-BlMfZj2L.js";import"./toolbar-CXAxzeUh.js";import"./use-create-virtual-mcp-Dz02gDB8.js";import"./github-repo-picker-BJ45Iuw_.js";import"./use-mcp-tools-xqS_ta53.js";import"./alert-dialog-CbYM4jmz.js";import"./index-CghQMTVW.js";import"./use-org-auth-client-BwDW-s0s.js";import"./hover-card-C0gmU-KR.js";import"./task-status-F5X71Or6.js";import"./use-status-sounds-BQhIBN31.js";import"./empty-state-CEcNMd77.js";import"./resizable-B8hoAXbl.js";import"./use-capability-Dp-xHWqY.js";import"./header-tab-button-BDD5kZQa.js";import"./index-D-Er7K2V.js";import"./user-DjbLcTMi.js";import"./tools-list-B226mv7W.js";import"./switch-BJt48css.js";import"./use-debounced-autosave-7E-JkkEV.js";import"./index-Vm79zSBa.js";import"./search-input-BXsljctW.js";import"./use-secrets-CjbHuNwC.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-DKdXwYYc.js";import"./view-mode-toggle-DnMmKH1O.js";import"./select-model-DV1J8lbW.js";import"./use-automations-CqVVjbv4.js";import"./monaco-editor-CO97GxVj.js";import"./automation-runs-ByMFrYpg.js";import"./table-3evUHy3g.js";import"./use-members-DH5dae5S.js";import"./automation-list-row-DaUVjzEO.js";const oe=12,E=new Set,D=new Set;function ie(){for(const l of D)l()}function se(l){return E.has(l)?!0:E.size>=oe?!1:(E.add(l),!0)}function F(l){E.delete(l)&&ie()}function le(l){return D.add(l),()=>{D.delete(l)}}function me(l,e){const t=g.useRef(!1),[v,n]=g.useState(!1),m=g.useRef(null),p=g.useRef(null),i=g.useRef(null),o=g.useRef(l);o.current=l;const[x]=g.useState(()=>{const s=()=>{i.current?.(),i.current=null},c=()=>t.current?!0:se(e)?(t.current=!0,n(!0),s(),!0):!1;return f=>{if(p.current=f,m.current&&(m.current.disconnect(),m.current=null),s(),!f){t.current&&(F(e),t.current=!1,n(!1));return}queueMicrotask(()=>{if(p.current!==f)return;const a=new IntersectionObserver(u=>{if(u[0]?.isIntersecting??!1){!c()&&!i.current&&(i.current=le(()=>{p.current===f&&c()}));return}s(),t.current&&(F(e),t.current=!1,n(!1))},{root:o.current.current,rootMargin:"160px 0px"});a.observe(f),m.current=a})}});return{ref:x,iframeActive:v}}function ne(l){const e=$.c(8),{previewUrl:t,title:v,scrollRootRef:n,slotId:m}=l,{ref:p,iframeActive:i}=me(n,m),[o,x]=g.useState(!1);let s;e[0]!==i||e[1]!==o||e[2]!==t||e[3]!==v?(s=i?r.jsxs(r.Fragment,{children:[!o&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:r.jsx(_,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),r.jsx("iframe",{src:t,title:`Preview ${v}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>x(!0)})]}):r.jsx("div",{className:"flex h-full items-center justify-center",children:r.jsx(_,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=i,e[1]=o,e[2]=t,e[3]=v,e[4]=s):s=e[4];let c;return e[5]!==p||e[6]!==s?(c=r.jsx("div",{ref:p,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:s}),e[5]=p,e[6]=s,e[7]=c):c=e[7],c}function pe(l){const e=$.c(26),{entry:t,previewUrl:v,scrollRootRef:n,onSelect:m}=l,p=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let i;e[0]!==p?(i=H("group flex flex-col overflow-hidden rounded-lg border bg-card text-left transition-colors","hover:border-primary/40 hover:bg-accent/30",p),e[0]=p,e[1]=i):i=e[1];let o;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==v||e[5]!==n?(o=r.jsx(ne,{previewUrl:v,title:t.title,scrollRootRef:n,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=v,e[5]=n,e[6]=o):o=e[6];let x;e[7]!==t.isSavedBlock?(x=t.isSavedBlock?{color:re}:void 0,e[7]=t.isSavedBlock,e[8]=x):x=e[8];let s;e[9]!==x?(s=r.jsx(_,{className:"h-4 w-4 shrink-0",style:x}),e[9]=x,e[10]=s):s=e[10];let c;e[11]!==t.title?(c=r.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[11]=t.title,e[12]=c):c=e[12];let f;e[13]!==t.description?(f=t.description&&r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[13]=t.description,e[14]=f):f=e[14];let a;e[15]!==c||e[16]!==f?(a=r.jsxs("div",{className:"min-w-0 flex-1",children:[c,f]}),e[15]=c,e[16]=f,e[17]=a):a=e[17];let u;e[18]!==s||e[19]!==a?(u=r.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[s,a]}),e[18]=s,e[19]=a,e[20]=u):u=e[20];let h;return e[21]!==m||e[22]!==i||e[23]!==o||e[24]!==u?(h=r.jsxs("button",{type:"button",onClick:m,className:i,children:[o,u]}),e[21]=m,e[22]=i,e[23]=o,e[24]=u,e[25]=h):h=e[25],h}function Jr(l){const e=$.c(41),{open:t,onOpenChange:v,meta:n,decofile:m,previewBaseUrl:p,onSelect:i}=l,[o,x]=g.useState(""),[s,c]=g.useState(t),f=g.useRef(null);t!==s&&(c(t),t&&x(""));let a,u,h,b,S,j,N,y,w,R,C;if(e[0]!==m||e[1]!==n||e[2]!==v||e[3]!==i||e[4]!==t||e[5]!==p||e[6]!==o){const U=t&&n&&m?Z(n,m):[],M=n?ee(n):"",z=m?te(m):void 0,W=new Map;if(t&&M)for(const d of U)W.set(d.resolveType,G(p,M,d.previewBlock,z));const A=o.trim().toLowerCase(),q=A?U.filter(d=>d.title.toLowerCase().includes(A)||d.resolveType.toLowerCase().includes(A)||d.description?.toLowerCase().includes(A)):U;u=X,R=t,C=v,a=J,N="top-3 right-3",y="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let O;e[18]===Symbol.for("react.memo_cache_sentinel")?(O=r.jsx(K,{children:"Add section"}),e[18]=O):O=e[18];let k;e[19]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(V,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[19]=k):k=e[19];let B;e[20]===Symbol.for("react.memo_cache_sentinel")?(B=d=>x(d.target.value),e[20]=B):B=e[20],e[21]!==o?(w=r.jsxs(Q,{className:"shrink-0 border-b px-4 py-3 text-left",children:[O,r.jsxs("div",{className:"relative pt-2",children:[k,r.jsx(Y,{value:o,onChange:B,placeholder:"Search sections...",className:"h-9 pl-8"})]})]}),e[21]=o,e[22]=w):w=e[22],S=f,j="min-h-0 flex-1 overflow-y-auto",h="p-4",b=q.length===0?r.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"No sections found."}):r.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:q.map(d=>r.jsx(pe,{entry:d,scrollRootRef:f,previewUrl:W.get(d.resolveType)??G(p,M,d.previewBlock,z),onSelect:()=>i(d)},d.resolveType))}),e[0]=m,e[1]=n,e[2]=v,e[3]=i,e[4]=t,e[5]=p,e[6]=o,e[7]=a,e[8]=u,e[9]=h,e[10]=b,e[11]=S,e[12]=j,e[13]=N,e[14]=y,e[15]=w,e[16]=R,e[17]=C}else a=e[7],u=e[8],h=e[9],b=e[10],S=e[11],j=e[12],N=e[13],y=e[14],w=e[15],R=e[16],C=e[17];let T;e[23]!==h||e[24]!==b?(T=r.jsx("div",{className:h,children:b}),e[23]=h,e[24]=b,e[25]=T):T=e[25];let I;e[26]!==T||e[27]!==S||e[28]!==j?(I=r.jsx("div",{ref:S,className:j,children:T}),e[26]=T,e[27]=S,e[28]=j,e[29]=I):I=e[29];let L;e[30]!==a||e[31]!==I||e[32]!==N||e[33]!==y||e[34]!==w?(L=r.jsxs(a,{closeButtonClassName:N,className:y,children:[w,I]}),e[30]=a,e[31]=I,e[32]=N,e[33]=y,e[34]=w,e[35]=L):L=e[35];let P;return e[36]!==u||e[37]!==L||e[38]!==R||e[39]!==C?(P=r.jsx(u,{open:R,onOpenChange:C,children:L}),e[36]=u,e[37]=L,e[38]=R,e[39]=C,e[40]=P):P=e[40],P}export{Jr as AddSectionModal};
@@ -1 +0,0 @@
1
- import{T as V,W as C,aH as ne,aJ as le,aK as he,aI as xe,ba as me,e as U,I as ge,H as be,r as O,j as s,D as Ee,o as Q,C as ye,q as oe,G as re,a as J,K as B,n as ve,c as ue,B as L,t as je,E as $e}from"./index-CpG2_v8p.js";import{i as Re}from"./AlertCircle-CIkJ_tva.js";import{P as te}from"./index-Vm79zSBa.js";import{S as ae}from"./skeleton-07IZijZM.js";import{b as _e,a as ce,S as de,c as Fe}from"./settings-section-ByFuwsko.js";import{u as X,b as se,c as Se}from"./use-ai-providers-BMK8G5pd.js";import{i as Oe}from"./CheckCircle-DyJzuYoS.js";import{p as Me}from"./chat-context-BoAn6xWM.js";import{e as Te,f as Ue}from"./use-organization-settings-ofRxNgFR.js";import{M as ze}from"./select-model-DV1J8lbW.js";import{u as qe}from"./use-debounced-autosave-7E-JkkEV.js";import{I as ie}from"./input-BWjbzzQM.js";import{a as fe,T as Le}from"./toggle-group-DVdH8zGh.js";import{b as ke,c as Ie,d as Ce,f as Ne,a as Pe,e as we,g as Ae,A as De}from"./alert-dialog-CbYM4jmz.js";import{u as Y}from"./studio-tools-Cly5ZCG3.js";import{s as Ve}from"./Plus-CTho-g8m.js";import{i as Be}from"./Tool01-BxT6lP7E.js";import{s as Ge}from"./Trash01-BczIIm5v.js";import{A as Qe}from"./avatar-Bf_YMKWh.js";import{O as Ke,P as We,c as pe}from"./agent-icons-DozoyM-L.js";import{a as Ye}from"./RefreshCcw01-D1X4YmG3.js";import{s as He}from"./Eye-MkeUTfT3.js";import{d as Je,b as Xe,c as Ze,a as et,D as tt}from"./dialog-DzWL-NrT.js";import{S as st}from"./spinner-B8QiOf4h.js";import{f as it}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as ot}from"./require-capability-BJrX_rPe.js";import"./sidebar-DceLItg8.js";import"./LayoutLeft-CJ48TbRA.js";import"./tooltip-D5r7nYKO.js";import"./sheet-BlMfZj2L.js";import"./X-CRg5TH_Y.js";import"./card-CWqz0DaV.js";import"./ArrowUpRight-DjtsYmlk.js";import"./use-mcp-client-BDuQ-DKr.js";import"./tab-id-Cgg9_UqF.js";import"./decopilot-sse-pool-CJ_QbSiL.js";import"./create-sse-subscription-BS5983N4.js";import"./use-virtual-mcp-BOy7A3-I.js";import"./use-collections-dzWuZTM5.js";import"./drawer-BLGCEP9S.js";import"./User01-CamUMrWb.js";import"./checkbox-C5cEV_DH.js";import"./Check-DZ5PZYLO.js";import"./select-B0qONt_m.js";import"./ChevronDown-CGeYjJAK.js";import"./ChevronUp-BCv26pBY.js";import"./Key01-CXIWciFj.js";import"./SearchMd-BVJBwCEd.js";import"./Settings02-Cqx4N2is.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-CsSfQSQt.js";import"./ChevronRight-Bm_e-tIB.js";import"./connect-desktop-dialog-BIhfHnnr.js";import"./Stars01-DWbsIFJF.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-Dp-xHWqY.js";import"./access-gate-SfXPQWUj.js";import"./capability-load-error-NgXOd2ZO.js";V({title:C(),url:C(),icon:C()});V({registries:le(C(),V({enabled:he()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ne(C()).describe("List of MCP app_name or app_id values to hide from the store.")});const H=V({keyId:C(),modelId:C(),title:C().optional()}).nullable();xe(["fast","smart","thinking","image","web_research"]);xe(["fast","smart","thinking"]);const rt=V({tiers:V({fast:H,smart:H,thinking:H,image:H,web_research:H})});V({ids:ne(C()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});V({id:C().describe("Brand context ID"),name:C().describe("Company name"),domain:C().describe("Company domain (e.g. example.com)"),overview:C().describe("Company overview / description"),logo:C().nullable().optional().describe("Logo URL"),favicon:C().nullable().optional().describe("Favicon URL"),ogImage:C().nullable().optional().describe("OG image URL"),fonts:V({heading:C().optional().describe("Font family for headings"),body:C().optional().describe("Font family for body text"),code:C().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:V({primary:C().optional().describe("Primary brand color (hex)"),secondary:C().optional().describe("Secondary brand color (hex)"),accent:C().optional().describe("Accent / highlight color (hex)"),background:C().optional().describe("Background color (hex)"),foreground:C().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ne(le(C(),me())).nullable().optional().describe("Brand images"),metadata:le(C(),me()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:C().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:he().optional().describe("Whether this is the default brand for the organization")});const lt=e=>e.capabilities?.includes("image")===!0,nt=e=>{if(e.asyncResearch===!0)return!0;const t=e.modelId.toLowerCase().replace(/[^a-z0-9]/g,"");return t.includes("sonar")||t.includes("deepresearch")},at=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:lt},{key:"web_research",label:"Web research",description:"Web search and deep research",filter:nt}];function ct(e){const t=U.c(20),{slot:i,onSlotChange:n,filterModels:o,defaultKeyId:l}=e,r=X(),[x,_]=O.useState(i?.keyId??l);let b;t[0]!==i?(b=()=>{i?.keyId&&_(i.keyId)},t[0]=i,t[1]=b):b=t[1];const d=i?.keyId;let a;t[2]!==d?(a=[d],t[2]=d,t[3]=a):a=t[3],O.useEffect(b,a);const m=x??l;let c;t[4]!==m||t[5]!==r?(c=m?r.find(y=>y.id===m):null,t[4]=m,t[5]=r,t[6]=c):c=t[6];const u=c,{models:g,isLoading:v}=se(o?m??void 0:void 0),j=o?v||g.some(o):!0;let f;t[7]!==i||t[8]!==u?.providerId?(f=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:u?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=u?.providerId,t[9]=f):f=t[9];const k=f;if(o&&!j){let y;return t[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=y):y=t[10],y}let I;t[11]===Symbol.for("react.memo_cache_sentinel")?(I=y=>_(y),t[11]=I):I=t[11];let h;t[12]!==m||t[13]!==n?(h=y=>{const R=y.keyId??m??"";_(R),n({keyId:R,modelId:y.modelId,title:y.title})},t[12]=m,t[13]=n,t[14]=h):h=t[14];let p;return t[15]!==m||t[16]!==o||t[17]!==k||t[18]!==h?(p=s.jsx(ze,{variant:"bordered",placeholder:"Pick model",model:k,credentialId:m,filterModels:o,onCredentialChange:I,onModelChange:h}),t[15]=m,t[16]=o,t[17]=k,t[18]=h,t[19]=p):p=t[19],p}function dt(e){const t=U.c(2),{isPending:i,showSaved:n}=e;if(i){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(ye,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=o):o=t[0],o}if(n){let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Oe,{size:12}),"Saved"]}),t[1]=o):o=t[1],o}return null}function mt(){const e=U.c(42),t=X(),i=Te(),n=t.length>0;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=ge(rt),e[0]=o):o=e[0];let l;e[1]!==i?(l={resolver:o,values:i,mode:"onChange"},e[1]=i,e[2]=l):l=e[2];const r=be(l),{mutate:x,isPending:_,isSuccess:b}=Ue(),d=r.formState.isDirty;let a;e[3]!==r||e[4]!==i||e[5]!==x?(a={delayMs:250,save:async()=>{const S=r.getValues();x(S,{onSuccess:()=>r.reset(S,{keepValues:!0}),onError:w=>{r.reset(i),Q.error(`Failed to save: ${w.message}`)}})}},e[3]=r,e[4]=i,e[5]=x,e[6]=a):a=e[6];const{schedule:m}=qe(a),c=t[0],u=t[1],g=t[2],{models:v}=se(c?.id),{models:j}=se(u?.id),{models:f}=se(g?.id);let k,I;e[7]!==r||e[8]!==n?(k=()=>{n||r.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_research:null}})},I=[n,r],e[7]=r,e[8]=n,e[9]=k,e[10]=I):(k=e[9],I=e[10]),O.useEffect(k,I);let h;e[11]!==t||e[12]!==r||e[13]!==c||e[14]!==u||e[15]!==g||e[16]!==v||e[17]!==j||e[18]!==f?(h=()=>{const S=r.getValues(),w=new Set(t.map(ut)),$={};c?.id&&($[c.id]=v),u?.id&&($[u.id]=j),g?.id&&($[g.id]=f);const P=W=>W!=null&&!w.has(W.keyId),N={fast:P(S.tiers.fast)?null:S.tiers.fast,smart:P(S.tiers.smart)?null:S.tiers.smart,thinking:P(S.tiers.thinking)?null:S.tiers.thinking,image:P(S.tiers.image)?null:S.tiers.image,web_research:P(S.tiers.web_research)?null:S.tiers.web_research},q=!N.fast||!N.smart||!N.thinking||!N.image||!N.web_research,z=N.fast===S.tiers.fast&&N.smart===S.tiers.smart&&N.thinking===S.tiers.thinking&&N.image===S.tiers.image&&N.web_research===S.tiers.web_research;if(!q&&z)return;const G=Me(t,$);r.reset({tiers:{fast:N.fast??G.chat.fast,smart:N.smart??G.chat.smart,thinking:N.thinking??G.chat.thinking,image:N.image??G.image,web_research:N.web_research??G.webResearch}},{keepDirty:!0})},e[11]=t,e[12]=r,e[13]=c,e[14]=u,e[15]=g,e[16]=v,e[17]=j,e[18]=f,e[19]=h):h=e[19];const p=c?.id,y=u?.id,R=g?.id;let M;e[20]!==t||e[21]!==r||e[22]!==v||e[23]!==j||e[24]!==f||e[25]!==p||e[26]!==y||e[27]!==R?(M=[r,t,v,j,f,p,y,R],e[20]=t,e[21]=r,e[22]=v,e[23]=j,e[24]=f,e[25]=p,e[26]=y,e[27]=R,e[28]=M):M=e[28],O.useEffect(h,M);let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=T):T=e[29];const F=b&&!d;let A;e[30]!==_||e[31]!==F?(A=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[T,s.jsx(dt,{isPending:_,showSaved:F})]}),e[30]=_,e[31]=F,e[32]=A):A=e[32];let D;e[33]!==t[0]?.id||e[34]!==r.control||e[35]!==m?(D=at.map(S=>s.jsx(Ee,{control:r.control,name:`tiers.${S.key}`,render:w=>{const{field:$}=w;return s.jsx(_e,{title:S.label,description:S.description,action:s.jsx(ct,{slot:$.value,defaultKeyId:t[0]?.id??null,filterModels:S.filter,onSlotChange:P=>{$.onChange(P),m()}})})}},S.key)),e[33]=t[0]?.id,e[34]=r.control,e[35]=m,e[36]=D):D=e[36];let K;e[37]!==D?(K=s.jsx(ce,{children:D}),e[37]=D,e[38]=K):K=e[38];let E;return e[39]!==A||e[40]!==K?(E=s.jsxs(de,{title:"Default models",headerClassName:"pl-0",children:[A,K]}),e[39]=A,e[40]=K,e[41]=E):E=e[41],E}function ut(e){return e.id}const ft={usd:[10,20,100],brl:[50,100,500]};function pt(){const e=U.c(26),t=Y(),[i,n]=O.useState(!1),{mutate:o,isPending:l}=J({mutationFn:async h=>{const{url:p}=await t.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:h,currency:d});return p},onSuccess:xt,onError:ht}),[r,x]=O.useState(""),[_,b]=O.useState("usd"),d=_,a=parseFloat(r),m=!isNaN(a)&&a>=1,c=d==="brl"?"R$":"$";let u;e[0]!==b?(u=h=>{h&&b(h)},e[0]=b,e[1]=u):u=e[1];let g,v;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(fe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),v=s.jsx(fe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[2]=g,e[3]=v):(g=e[2],v=e[3]);let j;e[4]!==d||e[5]!==u?(j=s.jsxs(Le,{type:"single",variant:"outline",size:"default",value:d,onValueChange:u,children:[g,v]}),e[4]=d,e[5]=u,e[6]=j):j=e[6];let f;e[7]!==d||e[8]!==c||e[9]!==i||e[10]!==l||e[11]!==o?(f=!i&&s.jsxs(s.Fragment,{children:[ft[d].map(h=>s.jsxs(L,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>o(h*100),children:[c,h]},h)),s.jsx(L,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>n(!0),disabled:l,children:"Custom"})]}),e[7]=d,e[8]=c,e[9]=i,e[10]=l,e[11]=o,e[12]=f):f=e[12];let k;e[13]!==c||e[14]!==r||e[15]!==a||e[16]!==i||e[17]!==m||e[18]!==l||e[19]!==x||e[20]!==o?(k=i&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:c}),s.jsx(ie,{type:"number",min:"1",step:"1",placeholder:"50",value:r,onChange:h=>x(h.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(L,{className:"h-10",disabled:!m||l,onClick:()=>o(Math.round(a*100)),children:l?"...":"Add"}),s.jsx(L,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{n(!1),x("")},children:"Cancel"})]}),e[13]=c,e[14]=r,e[15]=a,e[16]=i,e[17]=m,e[18]=l,e[19]=x,e[20]=o,e[21]=k):k=e[21];let I;return e[22]!==j||e[23]!==f||e[24]!==k?(I=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[j,f,k]})}),e[22]=j,e[23]=f,e[24]=k,e[25]=I):I=e[25],I}function ht(e){Q.error(`Top-up failed: ${e.message}`)}function xt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function gt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function bt(){const e=U.c(58),{org:t}=oe(),i=Y(),n=re(),o=X();let l;e[0]!==o?(l=o.find(vt),e[0]=o,e[1]=l):l=e[1];const r=l,[x,_]=O.useState(!1);let b;e[2]!==r||e[3]!==i?(b=async()=>{r&&await i.call("AI_PROVIDER_KEY_DELETE",{keyId:r.id})},e[2]=r,e[3]=i,e[4]=b):b=e[4];let d;e[5]!==t.id||e[6]!==n?(d=()=>{n.invalidateQueries({queryKey:B.aiProviderKeys(t.id)}),n.invalidateQueries({queryKey:B.aiProviders(t.id)}),Q.success("Deco AI Gateway disconnected"),_(!1)},e[5]=t.id,e[6]=n,e[7]=d):d=e[7];let a;e[8]!==b||e[9]!==d?(a={mutationFn:b,onSuccess:d,onError:yt},e[8]=b,e[9]=d,e[10]=a):a=e[10];const{mutate:m,isPending:c}=J(a);let u;e[11]!==t.id?(u=B.aiProviderCredits(t.id,"deco"),e[11]=t.id,e[12]=u):u=e[12];const g=!!r;let v;e[13]!==i?(v=async()=>{try{return await i.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[13]=i,e[14]=v):v=e[14];let j;e[15]!==u||e[16]!==g||e[17]!==v?(j={queryKey:u,enabled:g,staleTime:6e4,queryFn:v},e[15]=u,e[16]=g,e[17]=v,e[18]=j):j=e[18];const{data:f,isLoading:k,refetch:I,isFetching:h}=ve(j);if(!r)return null;const p=f?.balanceCents!=null?f.balanceCents/100:null;let y;e[19]!==p?(y=p!=null?`$${p.toFixed(2)}`:"—",e[19]=p,e[20]=y):y=e[20];const R=y;let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[21]=M):M=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=()=>_(!0),e[22]=T):T=e[22];let F;e[23]!==c?(F=s.jsxs("div",{className:"flex items-center justify-between",children:[M,s.jsx(L,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:T,disabled:c,children:"Disconnect"})]}),e[23]=c,e[24]=F):F=e[24];let A;e[25]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsxs(ke,{children:[s.jsx(Ie,{children:"Disconnect Deco AI Gateway"}),s.jsx(Ce,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[25]=A):A=e[25];let D;e[26]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Ne,{children:"Cancel"}),e[26]=D):D=e[26];let K;e[27]!==m?(K=s.jsxs(Pe,{children:[A,s.jsxs(we,{children:[D,s.jsx(Ae,{onClick:()=>m(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[27]=m,e[28]=K):K=e[28];let E;e[29]!==x||e[30]!==K?(E=s.jsx(De,{open:x,onOpenChange:_,children:K}),e[29]=x,e[30]=K,e[31]=E):E=e[31];let S;e[32]!==p||e[33]!==R||e[34]!==h||e[35]!==k?(S=k||h?s.jsx(ae,{className:"h-9 w-24"}):s.jsx("span",{className:ue("text-3xl font-semibold tabular-nums tracking-tight",p!=null&&gt(p)),children:R}),e[32]=p,e[33]=R,e[34]=h,e[35]=k,e[36]=S):S=e[36];let w;e[37]!==I?(w=()=>I(),e[37]=I,e[38]=w):w=e[38];const $=h&&"animate-spin";let P;e[39]!==$?(P=ue($),e[39]=$,e[40]=P):P=e[40];let N;e[41]!==P?(N=s.jsx(ye,{size:14,className:P}),e[41]=P,e[42]=N):N=e[42];let q;e[43]!==h||e[44]!==w||e[45]!==N?(q=s.jsx("button",{type:"button",onClick:w,disabled:h,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:N}),e[43]=h,e[44]=w,e[45]=N,e[46]=q):q=e[46];let z;e[47]!==S||e[48]!==q?(z=s.jsxs("div",{className:"flex items-baseline gap-2",children:[S,q]}),e[47]=S,e[48]=q,e[49]=z):z=e[49];let G;e[50]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[50]=G):G=e[50];let W;e[51]!==z?(W=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[z,G]}),e[51]=z,e[52]=W):W=e[52];let Z;e[53]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(pt,{})]}),e[53]=Z):Z=e[53];let ee;return e[54]!==F||e[55]!==E||e[56]!==W?(ee=s.jsx(de,{title:"Deco AI Gateway",children:s.jsx(ce,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[F,E,W,Z]})})}),e[54]=F,e[55]=E,e[56]=W,e[57]=ee):ee=e[57],ee}function yt(e){Q.error(`Failed to disconnect: ${e.message}`)}function vt(e){return e.providerId==="deco"}function jt(){const e=U.c(8),{org:t}=oe(),i=Y(),n=re();let o;e[0]!==i?(o=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=o):o=e[1];let l;e[2]!==t||e[3]!==n?(l=()=>{je("ai_provider_provision_succeeded",{provider_id:"deco"}),n.invalidateQueries({queryKey:B.aiProviderKeys(t.id)}),n.invalidateQueries({queryKey:B.aiProviders(t.id)}),Q.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=n,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r={mutationFn:o,onSuccess:l,onError:_t},e[5]=o,e[6]=l,e[7]=r):r=e[7],J(r)}function _t(e){je("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Q.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function St(){const e=U.c(10),{mutate:t,isPending:i}=jt();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:n.join(", ")}}),e[1]=o):o=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=l):l=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=r):r=e[3];let x;e[4]!==t?(x=()=>t(),e[4]=t,e[5]=x):x=e[5];const _=i?"Connecting…":"Connect Deco";let b;return e[6]!==i||e[7]!==x||e[8]!==_?(b=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[o,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[l,r,s.jsx(L,{variant:"outline",disabled:i,onClick:x,children:_})]})]}),e[6]=i,e[7]=x,e[8]=_,e[9]=b):b=e[9],b}const kt=V({label:C().min(1,"Label is required").max(100),apiKey:C().optional(),baseUrl:C().optional()});function It({providerKey:e,provider:t,preset:i,maskedKey:n,currentLabel:o,currentBaseUrl:l,onCancel:r,onSuccess:x}){const{org:_}=oe(),b=Y(),d=re(),[a,m]=O.useState(!1),c=t.id==="openai-compatible",u=t.supportedMethods.includes("api-key"),{register:g,handleSubmit:v,watch:j,formState:{errors:f}}=be({resolver:ge(kt),defaultValues:{label:o,apiKey:"",baseUrl:l??""}}),k=j("apiKey")??"",{mutate:I,isPending:h}=J({mutationFn:async p=>{let y;p.apiKey?c?y=JSON.stringify({baseUrl:p.baseUrl||l||"",apiKey:p.apiKey}):y=p.apiKey:c&&p.baseUrl&&p.baseUrl!==l&&(y=JSON.stringify({baseUrl:p.baseUrl,apiKey:""})),await b.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:p.label,...y!==void 0?{apiKey:y}:{}})},onSuccess:()=>{d.invalidateQueries({queryKey:B.aiProviderKeys(_.id)}),d.invalidateQueries({queryKey:B.aiProviders(_.id)}),Q.success("Provider updated"),x()},onError:p=>Q.error(`Failed to update: ${p.message}`)});return s.jsxs("form",{onSubmit:v(p=>I(p)),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),s.jsx(ie,{placeholder:"e.g. Personal key",...g("label"),className:"h-8 text-sm"}),f.label&&s.jsx("p",{className:"text-xs text-destructive",children:f.label.message})]}),c&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ie,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...g("baseUrl"),className:"h-8 text-sm"})]}),u&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API key"," ",s.jsx("span",{className:"text-muted-foreground/60",children:"(leave blank to keep current)"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(ie,{type:a&&k?"text":"password",placeholder:n,...g("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),k&&s.jsx("button",{type:"button",onClick:()=>m(!a),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:a?s.jsx(Ye,{size:14}):s.jsx(He,{size:14})})]})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(Je,{children:[s.jsx(L,{type:"button",variant:"ghost",size:"sm",onClick:r,disabled:h,children:"Cancel"}),s.jsx(L,{type:"submit",size:"sm",disabled:h,children:h?"Saving...":"Save"})]})]})}function Ct(e){const t=U.c(28),{providerKey:i,provider:n,open:o,onOpenChange:l}=e,r=Y();let x;t[0]!==n.id||t[1]!==i.presetId?(x=n.id==="openai-compatible"&&i.presetId?Ke.find(k=>k.id===i.presetId):void 0,t[0]=n.id,t[1]=i.presetId,t[2]=x):x=t[2];const _=x,b=_?.name??n.name;let d;t[3]!==i.id?(d=B.aiProviderKeyPreview(i.id),t[3]=i.id,t[4]=d):d=t[4];let a;t[5]!==i.id||t[6]!==r?(a=()=>r.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[5]=i.id,t[6]=r,t[7]=a):a=t[7];let m;t[8]!==o||t[9]!==d||t[10]!==a?(m={queryKey:d,queryFn:a,enabled:o,staleTime:0},t[8]=o,t[9]=d,t[10]=a,t[11]=m):m=t[11];const{data:c,isLoading:u}=ve(m);let g;t[12]!==b?(g=s.jsx(Xe,{children:s.jsxs(Ze,{children:["Edit ",b]})}),t[12]=b,t[13]=g):g=t[13];let v;t[14]!==u||t[15]!==l||t[16]!==_||t[17]!==c||t[18]!==n||t[19]!==i?(v=u||!c?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(st,{})}):s.jsx(It,{providerKey:i,provider:n,preset:_,maskedKey:c.maskedKey,currentLabel:c.label,currentBaseUrl:c.baseUrl,onCancel:()=>l(!1),onSuccess:()=>l(!1)}),t[14]=u,t[15]=l,t[16]=_,t[17]=c,t[18]=n,t[19]=i,t[20]=v):v=t[20];let j;t[21]!==g||t[22]!==v?(j=s.jsxs(et,{className:"sm:max-w-md",children:[g,v]}),t[21]=g,t[22]=v,t[23]=j):j=t[23];let f;return t[24]!==l||t[25]!==o||t[26]!==j?(f=s.jsx(tt,{open:o,onOpenChange:l,children:j}),t[24]=l,t[25]=o,t[26]=j,t[27]=f):f=t[27],f}function Nt(e){const t=U.c(48),{providerKey:i,provider:n}=e,{org:o}=oe(),l=Y(),r=re(),[x,_]=O.useState(!1),[b,d]=O.useState(!1),a=n.id==="openai-compatible";let m;t[0]!==a||t[1]!==i.presetId?(m=a&&i.presetId?Ke.find(q=>q.id===i.presetId):void 0,t[0]=a,t[1]=i.presetId,t[2]=m):m=t[2];const c=m,u=c?c.name:a?"Custom OpenAI-compatible":n.name,g=c?.logo??n.logo;let v;e:{if(a){v=i.label;break e}const q=i.label;let z;t[3]!==i.createdAt?(z=it(new Date(i.createdAt)),t[3]=i.createdAt,t[4]=z):z=t[4],v=`${q} · added ${z} ago`}const j=v;let f;t[5]!==i.id||t[6]!==l?(f=async()=>{await l.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=l,t[7]=f):f=t[7];let k;t[8]!==o||t[9]!==i.id||t[10]!==r?(k=()=>{r.invalidateQueries({queryKey:B.aiProviderKeys(o.id)}),r.invalidateQueries({queryKey:B.aiProviders(o.id)}),r.invalidateQueries({queryKey:B.aiProviderModels(o.id,i.id)}),Q.success("Key deleted"),_(!1)},t[8]=o,t[9]=i.id,t[10]=r,t[11]=k):k=t[11];let I;t[12]!==f||t[13]!==k?(I={mutationFn:f,onSuccess:k,onError:Pt},t[12]=f,t[13]=k,t[14]=I):I=t[14];const{mutate:h,isPending:p}=J(I);let y;t[15]!==u||t[16]!==g?(y=g?s.jsx("img",{src:g,alt:u,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Qe,{fallback:u.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[15]=u,t[16]=g,t[17]=y):y=t[17];let R;t[18]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(L,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>d(!0),children:s.jsx(Be,{size:14})}),t[18]=R):R=t[18];let M,T;t[19]===Symbol.for("react.memo_cache_sentinel")?(M=()=>_(!0),T=s.jsx(Ge,{size:14}),t[19]=M,t[20]=T):(M=t[19],T=t[20]);let F;t[21]!==p?(F=s.jsxs("div",{className:"flex items-center gap-0.5",children:[R,s.jsx(L,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:p,onClick:M,children:T})]}),t[21]=p,t[22]=F):F=t[22];let A;t[23]!==j||t[24]!==u||t[25]!==F||t[26]!==y?(A=s.jsx(_e,{icon:y,title:u,description:j,action:F}),t[23]=j,t[24]=u,t[25]=F,t[26]=y,t[27]=A):A=t[27];let D;t[28]!==b||t[29]!==n||t[30]!==i?(D=s.jsx(Ct,{providerKey:i,provider:n,open:b,onOpenChange:d}),t[28]=b,t[29]=n,t[30]=i,t[31]=D):D=t[31];let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ie,{children:"Delete API key"}),t[32]=K):K=t[32];let E;t[33]!==i.label?(E=s.jsxs(ke,{children:[K,s.jsxs(Ce,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[33]=i.label,t[34]=E):E=t[34];let S;t[35]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Ne,{children:"Cancel"}),t[35]=S):S=t[35];let w;t[36]!==h?(w=s.jsxs(we,{children:[S,s.jsx(Ae,{onClick:()=>h(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[36]=h,t[37]=w):w=t[37];let $;t[38]!==E||t[39]!==w?($=s.jsxs(Pe,{children:[E,w]}),t[38]=E,t[39]=w,t[40]=$):$=t[40];let P;t[41]!==x||t[42]!==$?(P=s.jsx(De,{open:x,onOpenChange:_,children:$}),t[41]=x,t[42]=$,t[43]=P):P=t[43];let N;return t[44]!==A||t[45]!==D||t[46]!==P?(N=s.jsxs(s.Fragment,{children:[A,D,P]}),t[44]=A,t[45]=D,t[46]=P,t[47]=N):N=t[47],N}function Pt(e){return Q.error(`Failed to delete key: ${e.message}`)}function wt(e){const t=U.c(11),{onConnectClick:i}=e,n=X(),o=Se();let l;t[0]!==o?.providers?(l=o?.providers??[],t[0]=o?.providers,t[1]=l):l=t[1];const r=l;let x;if(t[2]!==n||t[3]!==i||t[4]!==r){let _;t[6]!==r?(_=m=>({key:m,provider:r.find(c=>c.id===m.providerId)}),t[6]=r,t[7]=_):_=t[7];const b=n.filter(Kt).map(_).filter(Dt);let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ve,{size:14}),t[8]=d):d=t[8];let a;t[9]!==i?(a=s.jsxs(L,{size:"sm",onClick:i,children:[d,"Connect provider"]}),t[9]=i,t[10]=a):a=t[10],x=s.jsx(de,{title:"Connected providers",headerClassName:"px-0",actions:a,children:b.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(ce,{children:b.map(At)})}),t[2]=n,t[3]=i,t[4]=r,t[5]=x}else x=t[5];return x}function At(e){const{key:t,provider:i}=e;return s.jsx(Nt,{providerKey:t,provider:i},t.id)}function Dt(e){return e.provider!==void 0}function Kt(e){return e.providerId!=="deco"}function Et(e){const t=U.c(3),{error:i}=e;let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Re,{size:16}),t[0]=n):n=t[0];let o;return t[1]!==i.message?(o=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[n,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=o):o=t[2],o}function $t(){const e=U.c(23),t=X();let i;e[0]!==t?(i=t.some(Rt),e[0]=t,e[1]=i):i=e[1];const n=i,o=t.length>0,[l,r]=O.useState(!1),[x,_]=O.useState(null),b=Se();let d;e[2]!==b?.providers?(d=b?.providers??[],e[2]=b?.providers,e[3]=d):d=e[3];const a=d;if(!o){let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=()=>r(!0),e[4]=j):j=e[4];let f;e[5]!==a?(f=s.jsx(We,{providers:a,onSelect:_,onShowAll:j}),e[5]=a,e[6]=f):f=e[6];const k=x!==null||l;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=R=>{R||(_(null),r(!1))},e[7]=I):I=e[7];const h=x??void 0;let p;e[8]!==k||e[9]!==h?(p=s.jsx(pe,{open:k,onOpenChange:I,initialProvider:h}),e[8]=k,e[9]=h,e[10]=p):p=e[10];let y;return e[11]!==f||e[12]!==p?(y=s.jsxs(s.Fragment,{children:[f,p]}),e[11]=f,e[12]=p,e[13]=y):y=e[13],y}let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(O.Suspense,{fallback:s.jsx(ae,{className:"h-16 w-full"}),children:s.jsx(mt,{})}),e[14]=m):m=e[14];let c;e[15]!==n?(c=n?s.jsx(bt,{}):s.jsx(St,{}),e[15]=n,e[16]=c):c=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(wt,{onConnectClick:()=>r(!0)}),e[17]=u):u=e[17];let g;e[18]!==l?(g=s.jsx(pe,{open:l,onOpenChange:r}),e[18]=l,e[19]=g):g=e[19];let v;return e[20]!==c||e[21]!==g?(v=s.jsxs(s.Fragment,{children:[m,c,u,g]}),e[20]=c,e[21]=g,e[22]=v):v=e[22],v}function Rt(e){return e.providerId==="deco"}function Ft(){const e=U.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(te.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(te,{children:s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs(Fe,{children:[t,s.jsx($e,{fallback:Ot,children:s.jsx(O.Suspense,{fallback:s.jsx(ae,{className:"h-64 w-full"}),children:s.jsx($t,{})})})]})})})}),e[1]=i):i=e[1],i}function Ot(e){const{error:t}=e;return s.jsx(Et,{error:t??new Error("Failed to load AI providers")})}function qs(){const e=U.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ot,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(Ft,{})}),e[0]=t):t=e[0],t}export{qs as default};
@@ -1 +0,0 @@
1
- import{e as W,r as B,j as e,c as X,l as Y}from"./index-CpG2_v8p.js";import{i as Z}from"./ChevronRight-Bm_e-tIB.js";import{S as tt}from"./scroll-area-CFrtCBLi.js";import{aa as et,ab as rt,e as ot}from"./index-DdTSg63X.js";import{c as it}from"./save-referenced-block-MdHBsKGI.js";import{S as mt}from"./schema-form-914BofiG.js";import{S as pt}from"./save-status-Ds8Nwo0Y.js";import"./select-B0qONt_m.js";import"./tooltip-D5r7nYKO.js";import"./Check-DZ5PZYLO.js";import"./ChevronDown-CGeYjJAK.js";import"./ChevronUp-BCv26pBY.js";import"./agent-capabilities-QxThXvgQ.js";import"./chat-context-BoAn6xWM.js";import"./tab-id-Cgg9_UqF.js";import"./use-mcp-client-BDuQ-DKr.js";import"./decopilot-sse-pool-CJ_QbSiL.js";import"./create-sse-subscription-BS5983N4.js";import"./studio-tools-Cly5ZCG3.js";import"./use-virtual-mcp-BOy7A3-I.js";import"./use-collections-dzWuZTM5.js";import"./use-ai-providers-BMK8G5pd.js";import"./use-organization-settings-ofRxNgFR.js";import"./pair-D1IR0Baq.js";import"./agent-icon-C_8D2J-7.js";import"./AlertCircle-CIkJ_tva.js";import"./Tool01-BxT6lP7E.js";import"./SwitchHorizontal01-Bsjx9paN.js";import"./RefreshCcw01-D1X4YmG3.js";import"./XCircle-DkwGk6Y1.js";import"./ArrowUpRight-DjtsYmlk.js";import"./ZapSquare-BqiIusHB.js";import"./Users03-DT_R5tz6.js";import"./CheckCircle-DyJzuYoS.js";import"./ChevronLeft-DWiixe45.js";import"./DotsVertical-CqB_Aadi.js";import"./Container-DNJNU1b4.js";import"./Eye-MkeUTfT3.js";import"./ZoomOut-zDFXRspK.js";import"./Globe01-xZhhj276.js";import"./FilterLines-CfVg89f7.js";import"./Star01-4yFjK6bh.js";import"./Palette-CmO3ZuPu.js";import"./HardDrive-CtdIy8yR.js";import"./Stars02-BLn35DBB.js";import"./Key01-CXIWciFj.js";import"./LayoutLeft-CJ48TbRA.js";import"./LinkExternal01-Bi6In-BW.js";import"./Monitor01-CsSfQSQt.js";import"./Sun-FelsR2hx.js";import"./Play-CQ97sIka.js";import"./Plus-CTho-g8m.js";import"./SearchMd-BVJBwCEd.js";import"./Settings02-Cqx4N2is.js";import"./Shield01-D5OMek_B.js";import"./Stars01-DWbsIFJF.js";import"./Trash01-BczIIm5v.js";import"./Upload01-nIFiyRcG.js";import"./User01-CamUMrWb.js";import"./Users01-CgFieXMp.js";import"./XClose-D72Lt3NI.js";import"./X-CRg5TH_Y.js";import"./Zap-B-Fg7TEp.js";import"./use-clock-tick-Dkz_tj-X.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CP7WU0J2.js";import"./file-type-icon-9WcINLx3.js";import"./dialog-DzWL-NrT.js";import"./content-blocks-o63cs2vh.js";import"./types-DIAQ40QE.js";import"./shell-layout-NuYzN-Gn.js";import"./avatar-Bf_YMKWh.js";import"./required-auth-layout-CzrHHdU9.js";import"./useRouterState-BIyanAgq.js";import"./use-org-sso-BO0DGPVQ.js";import"./integration-icon-Jhe4mXPc.js";import"./use-navigate-to-agent-CLdhXO-i.js";import"./use-connection-CbBvGv-y.js";import"./use-mcp-prompts-BfczuqQ1.js";import"./form-DK41bruw.js";import"./label-BD30ND7M.js";import"./input-BWjbzzQM.js";import"./spinner-B8QiOf4h.js";import"./drawer-BLGCEP9S.js";import"./collection-search-Bk4YcOKu.js";import"./tabs-B1x7Fe-S.js";import"./toggle-group-DVdH8zGh.js";import"./connect-desktop-dialog-BIhfHnnr.js";import"./agent-icons-DozoyM-L.js";import"./checkbox-C5cEV_DH.js";import"./skeleton-07IZijZM.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-ByFuwsko.js";import"./card-CWqz0DaV.js";import"./popover-w66kr7qI.js";import"./command-CFpCNmCF.js";import"./index-rP7Vi9h6.js";import"./useInfiniteQuery-BA4Q5DOk.js";import"./infiniteQueryObserver-DKFzmh7N.js";import"./sortable.esm-CzY2WOGE.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-B1-pvTAQ.js";import"./use-registry-connections-Clpq_83P.js";import"./extract-connection-data-DzgWcXVA.js";import"./generate-id-DOxNmKSl.js";import"./collections-CG_8shjq.js";import"./collection-tabs-CSSbV4je.js";import"./badge-Di1xo__6.js";import"./textarea-CgmDS1mc.js";import"./connection-form-helpers-oVYdKzFk.js";import"./use-infinite-scroll-Dz0Ju18S.js";import"./useSuspenseInfiniteQuery-PHI3OnKC.js";import"./index-B6yJwY9r.js";import"./dropdown-menu-YzbwHIxx.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-DCVHDrWy.js";import"./sidebar-DceLItg8.js";import"./sheet-BlMfZj2L.js";import"./toolbar-CXAxzeUh.js";import"./use-create-virtual-mcp-Dz02gDB8.js";import"./github-repo-picker-BJ45Iuw_.js";import"./use-mcp-tools-xqS_ta53.js";import"./alert-dialog-CbYM4jmz.js";import"./index-CghQMTVW.js";import"./use-org-auth-client-BwDW-s0s.js";import"./hover-card-C0gmU-KR.js";import"./task-status-F5X71Or6.js";import"./use-status-sounds-BQhIBN31.js";import"./empty-state-CEcNMd77.js";import"./resizable-B8hoAXbl.js";import"./use-capability-Dp-xHWqY.js";import"./header-tab-button-BDD5kZQa.js";import"./index-D-Er7K2V.js";import"./user-DjbLcTMi.js";import"./tools-list-B226mv7W.js";import"./switch-BJt48css.js";import"./use-debounced-autosave-7E-JkkEV.js";import"./index-Vm79zSBa.js";import"./search-input-BXsljctW.js";import"./use-secrets-CjbHuNwC.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-DKdXwYYc.js";import"./view-mode-toggle-DnMmKH1O.js";import"./select-model-DV1J8lbW.js";import"./use-automations-CqVVjbv4.js";import"./monaco-editor-CO97GxVj.js";import"./automation-runs-ByMFrYpg.js";import"./table-3evUHy3g.js";import"./use-members-DH5dae5S.js";import"./automation-list-row-DaUVjzEO.js";import"./calendar-BvlrJX6s.js";import"./image-field-CNdkpe4-.js";import"./use-file-configs-CzOp0gY1.js";function to(E){const t=W.c(51),{orgSlug:R,virtualMcpId:P,branch:$,blockKey:r,block:m,meta:p,decofile:C,title:F,excludeFields:K,schemaPending:M}=E,V=M===void 0?!1:M,a=typeof m?.__resolveType=="string"?m.__resolveType:"";let v;t[0]!==K||t[1]!==p||t[2]!==a?(v=et(a,p,K),t[0]=K,t[1]=p,t[2]=a,t[3]=v):v=t[3];const s=v;let b;t[4]!==s?(b=!!s&&Object.keys(s.properties??{}).length>0,t[4]=s,t[5]=b):b=t[5];const T=b;let g;t[6]!==m||t[7]!==r||t[8]!==p||t[9]!==F?(g=F??(m?rt(r,m,p):r),t[6]=m,t[7]=r,t[8]=p,t[9]=F,t[10]=g):g=t[10];const n=g;let j;t[11]!==$||t[12]!==R||t[13]!==P?(j={orgSlug:R,virtualMcpId:P,branch:$},t[11]=$,t[12]=R,t[13]=P,t[14]=j):j=t[14];const{save:c,isPending:A}=ot(j);let y;t[15]!==c?(y=it((l,i)=>c(l,i)),t[15]=c,t[16]=y):y=t[16];const L=y,[G,H]=B.useState(r),[J,q]=B.useState(null),[z,Q]=B.useState(0);let S;t[17]===Symbol.for("react.memo_cache_sentinel")?(S=[],t[17]=S):S=t[17];const[o,O]=B.useState(S);G!==r&&(H(r),q(null),Q(st),O([]));let N;t[18]!==m?(N=m??{},t[18]=m,t[19]=N):N=t[19];const D=J??N;let k;t[20]!==r||t[21]!==a||t[22]!==c?(k=l=>{const i=l;q(i),c(r,{...i,__resolveType:a})},t[20]=r,t[21]=a,t[22]=c,t[23]=k):k=t[23];const I=k;let _;t[24]!==o||t[25]!==n?(_=o.length>0?[n,...o]:[],t[24]=o,t[25]=n,t[26]=_):_=t[26];const h=_;let d;t[27]!==o||t[28]!==h||t[29]!==n?(d=h.length>0?e.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:h.map((l,i)=>{const U=i===h.length-1;return e.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[i>0&&e.jsx(Z,{className:"size-3 shrink-0 text-muted-foreground/60"}),e.jsx("button",{type:"button",onClick:()=>O(i===0?[]:o.slice(0,i)),title:l,className:X("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",U?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:l})]},`${l}-${i}`)})}):e.jsx("span",{className:"text-sm font-medium",children:n}),t[27]=o,t[28]=h,t[29]=n,t[30]=d):d=t[30];let f;t[31]!==A?(f=e.jsx(pt,{isPending:A,isError:!1}),t[31]=A,t[32]=f):f=t[32];let u;t[33]!==d||t[34]!==f?(u=e.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[d,f]}),t[33]=d,t[34]=f,t[35]=u):u=t[35];let x;t[36]!==r||t[37]!==o||t[38]!==C||t[39]!==D||t[40]!==z||t[41]!==I||t[42]!==T||t[43]!==p||t[44]!==L||t[45]!==s||t[46]!==V?(x=e.jsx(tt,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-6",children:e.jsx("div",{className:"mx-auto max-w-xl",children:T?e.jsx(mt,{schema:s,value:D,onChange:I,basePath:"",breadcrumbPath:o,onBreadcrumbChange:O,decofile:C,meta:p,onSaveReferencedBlock:L},`${r}:${z}`):V?e.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[e.jsx(Y,{size:16,className:"animate-spin"}),"Loading app schema…"]}):e.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[36]=r,t[37]=o,t[38]=C,t[39]=D,t[40]=z,t[41]=I,t[42]=T,t[43]=p,t[44]=L,t[45]=s,t[46]=V,t[47]=x):x=t[47];let w;return t[48]!==u||t[49]!==x?(w=e.jsxs("div",{className:"flex h-full flex-col",children:[u,x]}),t[48]=u,t[49]=x,t[50]=w):w=t[50],w}function st(E){return E+1}export{to as AppEditor};
@@ -1 +0,0 @@
1
- import{T as Ge,W as te,e as C,j as t,E as Pe,r as w,q as ie,H as Qe,c as J,bn as Ye,l as le,d as Xe,P as G,B as W,o as Ze,g as ae,bo as ke}from"./index-CpG2_v8p.js";import{E as Ee}from"./empty-state-CEcNMd77.js";import{u as et,a as Oe}from"./use-collections-dzWuZTM5.js";import{u as ce}from"./use-mcp-client-BDuQ-DKr.js";import{F as se,a as tt,b as de,d as me}from"./form-DK41bruw.js";import{I as ue}from"./input-BWjbzzQM.js";import{T as re}from"./textarea-CgmDS1mc.js";import{a as st,b as ot,V as pe}from"./layout-CshuPuNT.js";import{S as nt,W as rt,a as it}from"./index-DzNLTQFE.js";import{g as lt,M as at,a as be}from"./types-DIAQ40QE.js";import{A as ct,a as dt,b as mt}from"./alert-Csb33_9v.js";import{d as Ne,S as ve,a as Se,b as ye,c as oe}from"./select-B0qONt_m.js";import{c as ut,b as we,T as Ce,a as Ie}from"./tooltip-D5r7nYKO.js";import{i as pt}from"./AlertCircle-CIkJ_tva.js";import{T as xt,R as ft,a7 as ht,O as gt,a8 as jt,G as $e}from"./agent-icon-C_8D2J-7.js";import{a as bt}from"./Eye-MkeUTfT3.js";import{i as Nt}from"./Play-CQ97sIka.js";import{i as vt}from"./ChevronRight-Bm_e-tIB.js";import{O as St,M as yt}from"./index-4CkRjwqB.js";import{g as wt}from"./connection-slug-eyAPH6o3.js";import{u as Ct,T as It}from"./tools-list-B226mv7W.js";import{a as Ae,u as Re}from"./use-connection-CbBvGv-y.js";import{b as $t}from"./use-mcp-tools-xqS_ta53.js";import{c as Tt}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-Jhe4mXPc.js";import{g as Pt,i as kt}from"./chat-context-BoAn6xWM.js";import{u as Et}from"./shell-layout-NuYzN-Gn.js";import{M as Ot}from"./monaco-editor-CO97GxVj.js";import{E as At}from"./empty-state-DfOA7oYG.js";import{n as Rt}from"./Container-DNJNU1b4.js";import"./label-BD30ND7M.js";import"./index-Vm79zSBa.js";import"./sidebar-DceLItg8.js";import"./LayoutLeft-CJ48TbRA.js";import"./sheet-BlMfZj2L.js";import"./X-CRg5TH_Y.js";import"./index-Bw6dLXGR.js";import"./collections-CG_8shjq.js";import"./index-CH6_c02Q.js";import"./use-virtual-mcp-BOy7A3-I.js";import"./resizable-B8hoAXbl.js";import"./ZoomOut-zDFXRspK.js";import"./badge-Di1xo__6.js";import"./spinner-B8QiOf4h.js";import"./view-mode-toggle-DnMmKH1O.js";import"./dialog-DzWL-NrT.js";import"./scroll-area-CFrtCBLi.js";import"./index-B6yJwY9r.js";import"./hover-card-C0gmU-KR.js";import"./dropdown-menu-YzbwHIxx.js";import"./Check-DZ5PZYLO.js";import"./DotsVertical-CqB_Aadi.js";import"./Plus-CTho-g8m.js";import"./Tool01-BxT6lP7E.js";import"./XClose-D72Lt3NI.js";import"./accordion-DKdXwYYc.js";import"./index-CghQMTVW.js";import"./create-sse-subscription-BS5983N4.js";import"./ChevronDown-CGeYjJAK.js";import"./ChevronUp-BCv26pBY.js";import"./SwitchHorizontal01-Bsjx9paN.js";import"./RefreshCcw01-D1X4YmG3.js";import"./XCircle-DkwGk6Y1.js";import"./ArrowUpRight-DjtsYmlk.js";import"./ZapSquare-BqiIusHB.js";import"./Users03-DT_R5tz6.js";import"./CheckCircle-DyJzuYoS.js";import"./ChevronLeft-DWiixe45.js";import"./Globe01-xZhhj276.js";import"./FilterLines-CfVg89f7.js";import"./Star01-4yFjK6bh.js";import"./Palette-CmO3ZuPu.js";import"./HardDrive-CtdIy8yR.js";import"./Stars02-BLn35DBB.js";import"./Key01-CXIWciFj.js";import"./LinkExternal01-Bi6In-BW.js";import"./Monitor01-CsSfQSQt.js";import"./Sun-FelsR2hx.js";import"./SearchMd-BVJBwCEd.js";import"./Settings02-Cqx4N2is.js";import"./Shield01-D5OMek_B.js";import"./Stars01-DWbsIFJF.js";import"./Trash01-BczIIm5v.js";import"./Upload01-nIFiyRcG.js";import"./User01-CamUMrWb.js";import"./Users01-CgFieXMp.js";import"./Zap-B-Fg7TEp.js";import"./extract-connection-data-DzgWcXVA.js";import"./generate-id-DOxNmKSl.js";import"./use-registry-connections-Clpq_83P.js";import"./use-organization-settings-ofRxNgFR.js";import"./index-rP7Vi9h6.js";import"./popover-w66kr7qI.js";import"./use-create-virtual-mcp-Dz02gDB8.js";import"./use-navigate-to-agent-CLdhXO-i.js";import"./tab-id-Cgg9_UqF.js";import"./decopilot-sse-pool-CJ_QbSiL.js";import"./studio-tools-Cly5ZCG3.js";import"./use-ai-providers-BMK8G5pd.js";import"./avatar-Bf_YMKWh.js";import"./required-auth-layout-CzrHHdU9.js";import"./useRouterState-BIyanAgq.js";import"./use-org-sso-BO0DGPVQ.js";import"./index-D-Er7K2V.js";Ge({title:te().min(1),description:te().nullable(),body:te()});function ne(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(o=>o==="mcps"),n=e>=0?s[e+1]:void 0;return n?decodeURIComponent(n):void 0}function Dt(s){const e=C.c(13),{form:n}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=o):o=e[0];let r;e[1]!==n.control?(r=t.jsxs("div",{className:"flex flex-col gap-4",children:[o,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(se,{control:n.control,name:"title",render:zt}),t.jsx(se,{control:n.control,name:"description",render:Ut})]})]}),e[1]=n.control,e[2]=r):r=e[2];let i,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=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]=i,e[4]=a):(i=e[3],a=e[4]);let c;e[5]!==n.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[i,a,t.jsx(se,{control:n.control,name:"body",render:Mt})]}),e[5]=n.control,e[6]=c):c=e[6];let l;e[7]!==r||e[8]!==c?(l=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]=l):l=e[9];let p;return e[10]!==n||e[11]!==l?(p=t.jsx(tt,{...n,children:l}),e[10]=n,e[11]=l,e[12]=p):p=e[12],p}function Mt(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 Ut(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 zt(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 Bt(s){const e=C.c(36),{providerId:n,promptId:o}=s,{org:r}=ie(),i=n||null;let a;e[0]!==r.id||e[1]!==r.slug||e[2]!==i?(a={connectionId:i,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=i,e[3]=a):a=e[3];const c=ce(a),l=et(n,"PROMPT",o,c),p=Oe(n,"PROMPT",c),f=p.update.isPending;let u;e[4]!==l?(u=l?{title:l.title,description:l.description??null,body:ne(l)}:void 0,e[4]=l,e[5]=u):u=e[5];let h;e[6]!==u?(h={values:u},e[6]=u,e[7]=h):h=e[7];const N=Qe(h);let T;e[8]!==N||e[9]!==l?(T=()=>{l&&N.reset({title:l.title,description:l.description??null,body:ne(l)})},e[8]=N,e[9]=l,e[10]=T):T=e[10];const O=T;let A;e[11]!==p.update||e[12]!==N||e[13]!==o?(A=N.handleSubmit(async j=>{const k=await p.update.mutateAsync({id:o,data:{title:j.title,description:j.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:j.body}}]}});N.reset({title:k.title,description:k.description??null,body:ne(k)})}),e[11]=p.update,e[12]=N,e[13]=o,e[14]=A):A=e[14];const R=A;if(!l){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(Ee,{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 y;e[16]!==l.title?(y=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:l.title}),e[16]=l.title,e[17]=y):y=e[17];let P;e[18]!==l.description?(P=l.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:l.description})]}):null,e[18]=l.description,e[19]=P):P=e[19];let I;e[20]!==y||e[21]!==P?(I=t.jsx(ot,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[y,P]})}),e[20]=y,e[21]=P,e[22]=I):I=e[22];let g;e[23]!==R?(g=()=>{R()},e[23]=R,e[24]=g):g=e[24];let v;e[25]!==N.formState.isDirty||e[26]!==f||e[27]!==O||e[28]!==g?(v=t.jsx(st,{children:t.jsx(nt,{onSave:g,onUndo:O,isDirty:N.formState.isDirty,isSaving:f})}),e[25]=N.formState.isDirty,e[26]=f,e[27]=O,e[28]=g,e[29]=v):v=e[29];let S;e[30]!==N?(S=t.jsx("div",{className:"h-full",children:t.jsx(Dt,{form:N})}),e[30]=N,e[31]=S):S=e[31];let $;return e[32]!==v||e[33]!==S||e[34]!==I?($=t.jsxs(pe,{children:[I,v,S]}),e[32]=v,e[33]=S,e[34]=I,e[35]=$):$=e[35],$}function Lt(s){const e=C.c(4),{itemId:n}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=_t(),e[0]=o):o=e[0];const r=o;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(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let i;return e[2]!==n?(i=t.jsx(Pe,{children:t.jsx(w.Suspense,{fallback:null,children:t.jsx(Bt,{providerId:r,promptId:n})})}),e[2]=n,e[3]=i):i=e[3],i}function _e(s){const e=C.c(8);let n,o;e[0]!==s?({className:n,...o}=s,e[0]=s,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let r;e[3]!==n?(r=J("min-w-0 overflow-hidden",n),e[3]=n,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:r,...o}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function De(s){const e=C.c(8);let n,o;e[0]!==s?({className:n,...o}=s,e[0]=s,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let r;e[3]!==n?(r=J("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",n),e[3]=n,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=t.jsx("ol",{"data-slot":"breadcrumb-list",className:r,...o}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function V(s){const e=C.c(8);let n,o;e[0]!==s?({className:n,...o}=s,e[0]=s,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let r;e[3]!==n?(r=J("inline-flex items-center gap-1.5 min-w-0",n),e[3]=n,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=t.jsx("li",{"data-slot":"breadcrumb-item",className:r,...o}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function Q(s){const e=C.c(10);let n,o,r;e[0]!==s?({asChild:n,className:o,...r}=s,e[0]=s,e[1]=n,e[2]=o,e[3]=r):(n=e[1],o=e[2],r=e[3]);const i=n?Ye:"a";let a;e[4]!==o?(a=J("hover:text-foreground transition-colors truncate",o),e[4]=o,e[5]=a):a=e[5];let c;return e[6]!==i||e[7]!==r||e[8]!==a?(c=t.jsx(i,{"data-slot":"breadcrumb-link",className:a,...r}),e[6]=i,e[7]=r,e[8]=a,e[9]=c):c=e[9],c}function Me(s){const e=C.c(8);let n,o;e[0]!==s?({className:n,...o}=s,e[0]=s,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let r;e[3]!==n?(r=J("text-foreground font-medium truncate",n),e[3]=n,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:r,...o}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function Y(s){const e=C.c(12);let n,o,r;e[0]!==s?({children:n,className:o,...r}=s,e[0]=s,e[1]=n,e[2]=o,e[3]=r):(n=e[1],o=e[2],r=e[3]);let i;e[4]!==o?(i=J("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",o),e[4]=o,e[5]=i):i=e[5];let a;e[6]!==n?(a=n??t.jsx(vt,{}),e[6]=n,e[7]=a):a=e[7];let c;return e[8]!==r||e[9]!==i||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:i,...r,children:a}),e[8]=r,e[9]=i,e[10]=a,e[11]=c):c=e[11],c}const Ft=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Vt(s){const e=C.c(11),{toolName:n,connectionId:o,siblings:r,onSelectInstance:i,onBack:a}=s;let c;e[0]!==o?(c={connectionId:o},e[0]=o,e[1]=c):c=e[1];const l=Ct(c);if(!l.isAuthenticated){let u;return e[2]!==l.supportsOAuth||e[3]!==a?(u=t.jsx("div",{className:"flex h-full items-center justify-center",children:l.supportsOAuth?t.jsx(St,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(yt,{hasReadme:!1})}),e[2]=l.supportsOAuth,e[3]=a,e[4]=u):u=e[4],u}const p=`${o}:${n}`;let f;return e[5]!==o||e[6]!==i||e[7]!==r||e[8]!==p||e[9]!==n?(f=t.jsx(Jt,{toolName:n,connectionId:o,siblings:r,onSelectInstance:i},p),e[5]=o,e[6]=i,e[7]=r,e[8]=p,e[9]=n,e[10]=f):f=e[10],f}function Jt({toolName:s,connectionId:e,siblings:n,onSelectInstance:o}){const{replayId:r}=Xe({strict:!1}),i=(()=>{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(!i)return null;const d={};for(const[m,b]of Object.entries(i))b!==null&&typeof b=="object"?d[m]=JSON.stringify(b,null,2):d[m]=b;return d})(),[c,l]=w.useState(a??{}),[p,f]=w.useState(i?JSON.stringify(i,null,2):"{}"),[u,h]=w.useState(null),[N,T]=w.useState(null),[O,A]=w.useState(null),[R,y]=w.useState(null),[P,I]=w.useState(!1),[g,v]=w.useState(null),{org:S}=ie(),$=Ae(e),j=Pt(),k=kt(),{setChatOpen:B}=Et(),U=`${e}:${s}`,_=ce({connectionId:e,orgId:S.id,orgSlug:S.slug}),z=$t({client:_}),x=z.data?.tools?.find(d=>d.name===s),E=lt(x?._meta),F=d=>{if(!j)return;const m=Tt(d.content);m.content.length>0&&(B(!0),j.sendMessage({tiptapDoc:m}))},[D,X]=w.useState("json"),[Ue,ze]=w.useState(!1);E&&!Ue&&(X("ui"),ze(!0));const xe=x?.inputSchema?.properties,fe=xe?Object.keys(xe):[],q=fe.length>0,H={};if(q&&x?.inputSchema?.properties)for(const d of fe)H[d]=x.inputSchema.required?.includes(d)?"":void 0;const Z=d=>Object.prototype.hasOwnProperty.call(c,d),Be=async()=>{I(!0),y(null),h(null),T(null),A(null),v(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const m=q?{...H,...c}:(()=>{const M=p.trim();if(!M)return{};const L=JSON.parse(M);if(L&&typeof L=="object")return L;throw new Error("Raw JSON input must be an object.")})();q&&x?.inputSchema?.properties&&Object.entries(x.inputSchema.properties).forEach(([M,L])=>{if((L.type==="object"||L.type==="array")&&typeof m[M]=="string")try{m[M]=JSON.parse(m[M])}catch{}else if((L.type==="number"||L.type==="integer")&&typeof m[M]=="string"&&m[M]!==""){const je=Number(m[M]);Number.isNaN(je)||(m[M]=je)}});const b=await _.callTool({name:s,arguments:m}),K=b.structuredContent??b,We=performance.now(),He=Math.round(We-d);h(K),T(b),A(m);const Ke=JSON.stringify(K),ge=new TextEncoder().encode(Ke).length;v({duration:`${He}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(m){const b=m instanceof Error?m.message:String(m);y(b||"Unknown error occurred");const K=performance.now();v({duration:`${Math.round(K-d)}ms`})}finally{I(!1)}},ee=(d,m)=>{l(b=>({...b,[d]:m}))},Le=()=>{h(null),T(null),A(null),y(null),v(null)},Fe=x?.name??Ft(s),Ve=t.jsx(_e,{children:t.jsxs(De,{children:[t.jsx(V,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:S.slug},children:"Connections"})})}),t.jsx(Y,{}),$&&t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:S.slug,appSlug:wt($)},search:{tab:"tools"},children:$.title})})}),t.jsx(Y,{})]}),t.jsx(V,{children:t.jsx(Me,{children:Fe})})]})}),he=n.length>1&&t.jsxs(Ne,{value:e,onValueChange:o,children:[t.jsx(ve,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(Se,{})}),t.jsx(ye,{children:n.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=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"}),x?.inputSchema?.required&&x.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:q&&x?.inputSchema?.properties?Object.entries(x.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,x.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(Ne,{value:Z(d)?String(c[d]??""):"",onValueChange:b=>ee(d,b==="true"),children:[t.jsx(ve,{children:t.jsx(Se,{placeholder:"Select true or false..."})}),t.jsxs(ye,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{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)):x?.inputSchema&&!q?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:p,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:P?t.jsxs(W,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Le,children:[t.jsx(xt,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(W,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Be,children:[t.jsx(Nt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=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(ft,{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(ht,{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(gt,{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(ut,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(we,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(W,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("ui"),children:t.jsx(jt,{size:14})})}),t.jsx(Ie,{children:"Interactive view"})]}),t.jsxs(we,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(W,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("json"),children:t.jsx($e,{size:14})})}),t.jsx(Ie,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(ct,{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(pt,{className:"h-4 w-4"}),t.jsx(dt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(mt,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:E&&D==="ui"&&_?t.jsx(w.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:x?{tool:x}:void 0,toolInput:O??void 0,toolResult:N??void 0,displayMode:"fullscreen",minHeight:be.view.minHeight,maxHeight:be.view.maxHeight,client:_,onMessage:F,onUpdateModelContext:d=>k?.setAppContext(U,d),onTeardown:()=>k?.clearAppContext(U),className:"h-full"})}):u?t.jsxs(t.Fragment,{children:[t.jsx(Ot,{code:JSON.stringify(u,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(W,{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(bt,{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($e,{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(pe,{breadcrumb:Ve,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(Te,{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(le,{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(It,{annotations:x?.annotations,_meta:x?._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:x?.description||"No description available"})]}),n.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:Je}),qe]})})]})})}function qt(s){const e=C.c(10),{itemId:n,siblings:o,onBack:r}=s,[i,a]=w.useState(o[0]?.id??"");let c;e[0]!==i||e[1]!==o?(c=o.find(h=>h.id===i)?.id??o[0]?.id??"",e[0]=i,e[1]=o,e[2]=c):c=e[2];const l=c;if(!Ae(l||void 0)||!l){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(le,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=f):f=e[4];let u;return e[5]!==l||e[6]!==r||e[7]!==o||e[8]!==n?(u=t.jsx(w.Suspense,{fallback:f,children:t.jsx(Vt,{toolName:n,connectionId:l,siblings:o,onSelectInstance:a,onBack:r})}),e[5]=l,e[6]=r,e[7]=o,e[8]=n,e[9]=u):u=e[9],u}const Wt={workflow:it,workflow_execution:rt,prompt:Lt};function Ht(){const s=C.c(9),e=ke();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=n):n=s[0];const o=ae(n),r=decodeURIComponent(o.itemId);let i;s[1]!==o.appSlug?(i={slug:o.appSlug},s[1]=o.appSlug,s[2]=i):i=s[2];const a=Re(i);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const l=c,p=Kt;let f;return s[5]!==l||s[6]!==r||s[7]!==a?(f=t.jsx(qt,{itemId:r,siblings:a,onBack:l,onUpdate:p}),s[5]=l,s[6]=r,s[7]=a,s[8]=f):f=s[8],f}async function Kt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=C.c(41),e=ke();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=n):n=s[0];const o=ae(n),r=decodeURIComponent(o.collectionName),i=decodeURIComponent(o.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:l}=ie();let p;s[3]!==o.appSlug?(p={slug:o.appSlug},s[3]=o.appSlug,s[4]=p):p=s[4];const u=Re(p)[0]??null,h=u?.id??"",N=h||"no-connection",T=h??null;let O;s[5]!==l.id||s[6]!==l.slug||s[7]!==T?(O={connectionId:T,orgId:l.id,orgSlug:l.slug},s[5]=l.id,s[6]=l.slug,s[7]=T,s[8]=O):O=s[8];const A=ce(O),R=Oe(N,r,A);let y;s[9]!==R||s[10]!==i?(y=async D=>{i&&await R.update.mutateAsync({id:i,data:D})},s[9]=R,s[10]=i,s[11]=y):y=s[11];const P=y;let I;s[12]!==r?(I=r?.toLowerCase(),s[12]=r,s[13]=I):I=s[13];const g=I,v=g&&Wt[g];let S;s[14]!==r?(S=Gt(r),s[14]=r,s[15]=S):S=s[15];const $=S;let j;s[16]!==l.slug?(j=t.jsx(V,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:l.slug},children:"Connections"})})}),s[16]=l.slug,s[17]=j):j=s[17];let k;s[18]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Y,{}),s[18]=k):k=s[18];let B;s[19]!==r||s[20]!==u||s[21]!==l.slug||s[22]!==o.appSlug?(B=u&&t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:o.appSlug},search:{tab:r},children:u.title})})}),t.jsx(Y,{})]}),s[19]=r,s[20]=u,s[21]=l.slug,s[22]=o.appSlug,s[23]=B):B=s[23];let U;s[24]!==$?(U=t.jsx(V,{children:t.jsx(Me,{children:$})}),s[24]=$,s[25]=U):U=s[25];let _;s[26]!==B||s[27]!==U||s[28]!==j?(_=t.jsx(_e,{children:t.jsxs(De,{children:[j,k,B,U]})}),s[26]=B,s[27]=U,s[28]=j,s[29]=_):_=s[29];const z=_;if(v){let D;return s[30]!==v||s[31]!==c||s[32]!==P||s[33]!==i?(D=t.jsx(v,{itemId:i,onBack:c,onUpdate:P}),s[30]=v,s[31]=c,s[32]=P,s[33]=i,s[34]=D):D=s[34],D}let x;s[35]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Rt,{size:36,className:"text-muted-foreground"}),s[35]=x):x=s[35];let E;s[36]!==c?(E=t.jsx(At,{icon:x,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 F;return s[38]!==z||s[39]!==E?(F=t.jsx(pe,{breadcrumb:z,children:E}),s[38]=z,s[39]=E,s[40]=F):F=s[40],F}function Yt(){const s=C.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 n=ae(e);if(decodeURIComponent(n.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Ht,{}),s[1]=a):a=s[1],a}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Qt,{}),s[2]=i):i=s[2],i}function Go(){const s=C.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(w.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Go as default};
@@ -1 +0,0 @@
1
- function E(f,u,c,o,a){const s=Math.min(f,u*o**c);return(1-a*Math.random())*s}const p=3e4,S=1e3;function C(f){const{buildUrl:u,eventTypes:c}=f,o=new Map;function a(r,e){for(const n of c)for(const t of e)r.addEventListener(n,t)}function s(r,e,n){const t=new EventSource(u(r));t.onopen=()=>{if(e.reconnectAttempt=0,n)for(const i of e.reconnectHandlers)i()},t.onerror=()=>{t.readyState===EventSource.CLOSED&&d(r,e)},e.es=t,a(t,e.handlers)}function d(r,e){if(e.refCount<=0){o.delete(r);return}if(e.reconnectTimer)return;const n=E(p,S,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{if(e.reconnectTimer=null,e.refCount<=0){o.delete(r);return}e.es.close(),s(r,e,!0)},n)}function m(r){let e=o.get(r);return e||(e={es:null,refCount:0,handlers:new Set,reconnectHandlers:new Set,reconnectAttempt:0,reconnectTimer:null},s(r,e,!1),o.set(r,e)),e}return{subscribe(r,e,n){const t=m(r);t.refCount++,t.handlers.add(e),n&&t.reconnectHandlers.add(n);for(const l of c)t.es.addEventListener(l,e);let i=!1;return()=>{if(!i){i=!0;for(const l of c)t.es.removeEventListener(l,e);t.handlers.delete(e),n&&t.reconnectHandlers.delete(n),t.refCount--,t.refCount<=0&&(t.reconnectTimer&&clearTimeout(t.reconnectTimer),t.es.close(),o.delete(r))}}}}}export{C as c,E as e};
@@ -1 +0,0 @@
1
- import"./index-CpG2_v8p.js";import{c as s}from"./create-sse-subscription-BS5983N4.js";const c={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},t=Object.values(c),n=s({buildUrl:o=>{const e=t.join(",");return`/api/${encodeURIComponent(o)}/watch?types=${e}`},eventTypes:[...t]});export{c as D,n as d};
@@ -1,2 +0,0 @@
1
- import{e as Ke,r as l,j as i,l as re,B as fe,c as Ve,G as ut,o as $,K as Te}from"./index-CpG2_v8p.js";import{F as mt,l as pt}from"./index-D-Er7K2V.js";import{_ as ht,ar as xt,as as gt,at as ae,au as yt,H as $e}from"./agent-icon-C_8D2J-7.js";import{a as wt}from"./Tool01-BxT6lP7E.js";import{s as jt}from"./XClose-D72Lt3NI.js";import{S as bt}from"./scroll-area-CFrtCBLi.js";import{b as Re,T as Oe,a as ze}from"./tooltip-D5r7nYKO.js";import{A as vt,a as Ct,b as Nt,c as St,d as Dt,e as kt,f as Ft,g as Lt}from"./alert-dialog-CbYM4jmz.js";import{a as Et}from"./chat-context-BoAn6xWM.js";import{u as Pt}from"./shell-layout-NuYzN-Gn.js";import{a7 as le,a8 as Ae,a9 as Tt}from"./index-DdTSg63X.js";import{c as $t,e as Rt,b as Ot,d as zt,a as At,D as Wt}from"./dialog-DzWL-NrT.js";import{I as We}from"./input-BWjbzzQM.js";import{C as It,c as _,d as Ie,e as Mt,f as Kt}from"./shell-route-loading-DCVHDrWy.js";import{t as Vt}from"./ChevronDown-CGeYjJAK.js";import{i as Bt}from"./ChevronRight-Bm_e-tIB.js";import{i as Gt}from"./ZoomOut-zDFXRspK.js";import{E as qt,q as Me,r as he,s as Qt,t as Ut,v as Ht,w as M,x as ce,g as xe,y as ge,z as Jt,A as Xt,B as ye,C as de,D as we,G as Yt,I as Zt}from"./header-tab-button-BDD5kZQa.js";import"./AlertCircle-CIkJ_tva.js";import"./SwitchHorizontal01-Bsjx9paN.js";import"./RefreshCcw01-D1X4YmG3.js";import"./XCircle-DkwGk6Y1.js";import"./ArrowUpRight-DjtsYmlk.js";import"./ZapSquare-BqiIusHB.js";import"./Users03-DT_R5tz6.js";import"./CheckCircle-DyJzuYoS.js";import"./Check-DZ5PZYLO.js";import"./ChevronLeft-DWiixe45.js";import"./ChevronUp-BCv26pBY.js";import"./DotsVertical-CqB_Aadi.js";import"./Container-DNJNU1b4.js";import"./Eye-MkeUTfT3.js";import"./Globe01-xZhhj276.js";import"./FilterLines-CfVg89f7.js";import"./Star01-4yFjK6bh.js";import"./Palette-CmO3ZuPu.js";import"./HardDrive-CtdIy8yR.js";import"./Stars02-BLn35DBB.js";import"./Key01-CXIWciFj.js";import"./LayoutLeft-CJ48TbRA.js";import"./LinkExternal01-Bi6In-BW.js";import"./Monitor01-CsSfQSQt.js";import"./Sun-FelsR2hx.js";import"./Play-CQ97sIka.js";import"./Plus-CTho-g8m.js";import"./SearchMd-BVJBwCEd.js";import"./Settings02-Cqx4N2is.js";import"./Shield01-D5OMek_B.js";import"./Stars01-DWbsIFJF.js";import"./Trash01-BczIIm5v.js";import"./Upload01-nIFiyRcG.js";import"./User01-CamUMrWb.js";import"./Users01-CgFieXMp.js";import"./X-CRg5TH_Y.js";import"./Zap-B-Fg7TEp.js";import"./select-B0qONt_m.js";import"./tab-id-Cgg9_UqF.js";import"./use-mcp-client-BDuQ-DKr.js";import"./decopilot-sse-pool-CJ_QbSiL.js";import"./create-sse-subscription-BS5983N4.js";import"./studio-tools-Cly5ZCG3.js";import"./use-virtual-mcp-BOy7A3-I.js";import"./use-collections-dzWuZTM5.js";import"./use-ai-providers-BMK8G5pd.js";import"./use-organization-settings-ofRxNgFR.js";import"./avatar-Bf_YMKWh.js";import"./required-auth-layout-CzrHHdU9.js";import"./useRouterState-BIyanAgq.js";import"./use-org-sso-BO0DGPVQ.js";import"./agent-capabilities-QxThXvgQ.js";import"./pair-D1IR0Baq.js";import"./use-clock-tick-Dkz_tj-X.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CP7WU0J2.js";import"./file-type-icon-9WcINLx3.js";import"./content-blocks-o63cs2vh.js";import"./types-DIAQ40QE.js";import"./integration-icon-Jhe4mXPc.js";import"./use-navigate-to-agent-CLdhXO-i.js";import"./use-connection-CbBvGv-y.js";import"./use-mcp-prompts-BfczuqQ1.js";import"./form-DK41bruw.js";import"./label-BD30ND7M.js";import"./spinner-B8QiOf4h.js";import"./drawer-BLGCEP9S.js";import"./collection-search-Bk4YcOKu.js";import"./tabs-B1x7Fe-S.js";import"./toggle-group-DVdH8zGh.js";import"./connect-desktop-dialog-BIhfHnnr.js";import"./agent-icons-DozoyM-L.js";import"./checkbox-C5cEV_DH.js";import"./skeleton-07IZijZM.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-ByFuwsko.js";import"./card-CWqz0DaV.js";import"./popover-w66kr7qI.js";import"./command-CFpCNmCF.js";import"./index-rP7Vi9h6.js";import"./useInfiniteQuery-BA4Q5DOk.js";import"./infiniteQueryObserver-DKFzmh7N.js";import"./sortable.esm-CzY2WOGE.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-B1-pvTAQ.js";import"./use-registry-connections-Clpq_83P.js";import"./extract-connection-data-DzgWcXVA.js";import"./generate-id-DOxNmKSl.js";import"./collections-CG_8shjq.js";import"./collection-tabs-CSSbV4je.js";import"./badge-Di1xo__6.js";import"./textarea-CgmDS1mc.js";import"./connection-form-helpers-oVYdKzFk.js";import"./use-infinite-scroll-Dz0Ju18S.js";import"./useSuspenseInfiniteQuery-PHI3OnKC.js";import"./index-B6yJwY9r.js";import"./dropdown-menu-YzbwHIxx.js";import"./question-004-sINsf4GQ.js";import"./sidebar-DceLItg8.js";import"./sheet-BlMfZj2L.js";import"./use-status-sounds-BQhIBN31.js";import"./empty-state-CEcNMd77.js";import"./toolbar-CXAxzeUh.js";import"./resizable-B8hoAXbl.js";import"./use-mcp-tools-xqS_ta53.js";import"./use-capability-Dp-xHWqY.js";import"./user-DjbLcTMi.js";import"./tools-list-B226mv7W.js";import"./switch-BJt48css.js";import"./use-debounced-autosave-7E-JkkEV.js";import"./index-Vm79zSBa.js";import"./search-input-BXsljctW.js";import"./use-secrets-CjbHuNwC.js";import"./github-repo-picker-BJ45Iuw_.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-DKdXwYYc.js";import"./view-mode-toggle-DnMmKH1O.js";import"./select-model-DV1J8lbW.js";import"./use-automations-CqVVjbv4.js";import"./monaco-editor-CO97GxVj.js";import"./automation-runs-ByMFrYpg.js";import"./table-3evUHy3g.js";import"./use-members-DH5dae5S.js";import"./use-org-auth-client-BwDW-s0s.js";import"./task-status-F5X71Or6.js";import"./automation-list-row-DaUVjzEO.js";import"./use-create-virtual-mcp-Dz02gDB8.js";import"./index-CghQMTVW.js";import"./hover-card-C0gmU-KR.js";const _t={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function en(y){const e=Ke.c(51),{open:c,mode:K,initialName:X,parentLabel:Q,isPending:A,onSubmit:V,onOpenChange:P}=y,W=X===void 0?"":X,o=A===void 0?!1:A,[p,R]=l.useState(W),[I,B]=l.useState(c),f=_t[K];c!==I&&(B(c),c&&R(W));let F;e[0]!==o||e[1]!==P?(F=E=>{!E&&!o&&P(!1)},e[0]=o,e[1]=P,e[2]=F):F=e[2];const U=F;let G;e[3]!==o||e[4]!==p||e[5]!==V?(G=async E=>{E.preventDefault();const z=p.trim();!z||o||await V(z)},e[3]=o,e[4]=p,e[5]=V,e[6]=G):G=e[6];const q=G;let L;e[7]!==f.title?(L=i.jsx($t,{children:f.title}),e[7]=f.title,e[8]=L):L=e[8];let N;e[9]!==f.description?(N=i.jsx(Rt,{children:f.description}),e[9]=f.description,e[10]=N):N=e[10];let O;e[11]!==L||e[12]!==N?(O=i.jsxs(Ot,{children:[L,N]}),e[11]=L,e[12]=N,e[13]=O):O=e[13];let S;e[14]!==Q?(S=Q&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),i.jsx(We,{value:Q,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=Q,e[15]=S):S=e[15];let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=D):D=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=E=>R(E.target.value),e[17]=j):j=e[17];let b;e[18]!==f.placeholder||e[19]!==o||e[20]!==p?(b=i.jsxs("div",{className:"space-y-1.5",children:[D,i.jsx(We,{id:"file-explorer-name",value:p,onChange:j,placeholder:f.placeholder,autoFocus:!0,disabled:o})]}),e[18]=f.placeholder,e[19]=o,e[20]=p,e[21]=b):b=e[21];let h;e[22]!==b||e[23]!==S?(h=i.jsxs("div",{className:"space-y-4 py-4",children:[S,b]}),e[22]=b,e[23]=S,e[24]=h):h=e[24];let x;e[25]!==P?(x=()=>P(!1),e[25]=P,e[26]=x):x=e[26];let v;e[27]!==o||e[28]!==x?(v=i.jsx(fe,{type:"button",variant:"outline",onClick:x,disabled:o,children:"Cancel"}),e[27]=o,e[28]=x,e[29]=v):v=e[29];let C;e[30]!==o||e[31]!==p?(C=!p.trim()||o,e[30]=o,e[31]=p,e[32]=C):C=e[32];let u;e[33]!==f.submit||e[34]!==o?(u=o?i.jsxs(i.Fragment,{children:[i.jsx(re,{size:14,className:"animate-spin"}),"Saving…"]}):f.submit,e[33]=f.submit,e[34]=o,e[35]=u):u=e[35];let k;e[36]!==C||e[37]!==u?(k=i.jsx(fe,{type:"submit",disabled:C,children:u}),e[36]=C,e[37]=u,e[38]=k):k=e[38];let m;e[39]!==v||e[40]!==k?(m=i.jsxs(zt,{children:[v,k]}),e[39]=v,e[40]=k,e[41]=m):m=e[41];let g;e[42]!==q||e[43]!==h||e[44]!==m||e[45]!==O?(g=i.jsx(At,{className:"sm:max-w-md",children:i.jsxs("form",{onSubmit:q,children:[O,h,m]})}),e[42]=q,e[43]=h,e[44]=m,e[45]=O,e[46]=g):g=e[46];let T;return e[47]!==U||e[48]!==c||e[49]!==g?(T=i.jsx(Wt,{open:c,onOpenChange:U,children:g}),e[47]=U,e[48]=c,e[49]=g,e[50]=T):T=e[50],T}const tn="#d9a441";function nn(y){const e=Ke.c(45),{node:c,depth:K,isExpanded:X,isSelected:Q,isLoading:A,fileVisual:V,onOpen:P,onSelect:W,onNewFile:o,onNewFolder:p,onCopyPath:R,onCopyRelativePath:I,onRename:B,onDelete:f}=y,F=A===void 0?!1:A,U=c.kind==="directory",{Icon:G,color:q}=V,L=Q&&"bg-accent";let N;e[0]!==L?(N=Ve("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",L),e[0]=L,e[1]=N):N=e[1];const O=`${K*14+8}px`;let S;e[2]!==O?(S={paddingLeft:O},e[2]=O,e[3]=S):S=e[3];let D;e[4]!==P||e[5]!==W?(D=()=>{W(),P()},e[4]=P,e[5]=W,e[6]=D):D=e[6];let j;e[7]!==G||e[8]!==q||e[9]!==U||e[10]!==X||e[11]!==F?(j=U?i.jsxs(i.Fragment,{children:[F?i.jsx(re,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):X?i.jsx(Vt,{size:14,className:"shrink-0 text-muted-foreground"}):i.jsx(Bt,{size:14,className:"shrink-0 text-muted-foreground"}),i.jsx(Gt,{size:16,className:"shrink-0",style:{color:tn}})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"w-3.5 shrink-0"}),i.jsx(G,{size:16,className:"shrink-0",style:{color:q}})]}),e[7]=G,e[8]=q,e[9]=U,e[10]=X,e[11]=F,e[12]=j):j=e[12];let b;e[13]!==c.name?(b=i.jsx("span",{className:"truncate",children:c.name}),e[13]=c.name,e[14]=b):b=e[14];let h;e[15]!==N||e[16]!==S||e[17]!==D||e[18]!==j||e[19]!==b?(h=i.jsx(It,{asChild:!0,children:i.jsxs("button",{type:"button",className:N,style:S,onClick:D,children:[j,b]})}),e[15]=N,e[16]=S,e[17]=D,e[18]=j,e[19]=b,e[20]=h):h=e[20];let x;e[21]!==o?(x=i.jsx(_,{onSelect:o,children:"New File"}),e[21]=o,e[22]=x):x=e[22];let v;e[23]!==p?(v=i.jsx(_,{onSelect:p,children:"New Folder"}),e[23]=p,e[24]=v):v=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ie,{}),e[25]=C):C=e[25];let u;e[26]!==R?(u=i.jsx(_,{onSelect:R,children:"Copy Path"}),e[26]=R,e[27]=u):u=e[27];let k;e[28]!==I?(k=i.jsx(_,{onSelect:I,children:"Copy Relative Path"}),e[28]=I,e[29]=k):k=e[29];let m;e[30]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ie,{}),e[30]=m):m=e[30];let g;e[31]!==B?(g=i.jsx(_,{onSelect:B,children:"Rename"}),e[31]=B,e[32]=g):g=e[32];let T;e[33]!==f?(T=i.jsx(_,{variant:"destructive",onSelect:f,children:"Delete"}),e[33]=f,e[34]=T):T=e[34];let E;e[35]!==x||e[36]!==v||e[37]!==u||e[38]!==k||e[39]!==g||e[40]!==T?(E=i.jsxs(Mt,{className:"w-52",children:[x,v,C,u,k,m,g,T]}),e[35]=x,e[36]=v,e[37]=u,e[38]=k,e[39]=g,e[40]=T,e[41]=E):E=e[41];let z;return e[42]!==E||e[43]!==h?(z=i.jsxs(Kt,{children:[h,E]}),e[42]=E,e[43]=h,e[44]=z):z=e[44],z}pt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function je(y,e,c,K){return`/api/${y}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(c)}/${K}`}function rn(y){const e=M(y);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const sn="#94a3b8";function on(y){const e=y.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ae,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ae,color:"#d9a441"}:e.endsWith(".json")?{Icon:yt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ae,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ae,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:wt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:$e,color:"#64748b"}:{Icon:$e,color:sn}}function Qi({orgSlug:y,virtualMcpId:e,branch:c,openPath:K}){const[X,Q]=l.useState({files:[],directories:[],truncated:!1}),{files:A,directories:V}=X,[P,W]=l.useState(new Set),[o,p]=l.useState(null),[R,I]=l.useState(null),[B,f]=l.useState([]),[F,U]=l.useState(""),[G,q]=l.useState(!1),[L,N]=l.useState(!1),[,O]=l.useState(new Set),[S,D]=l.useState(new Set),j=l.useRef(0),b=l.useRef(null),h=l.useRef(new Set),x=l.useRef(new Map);function v(t){O(n=>{const r=typeof t=="function"?t(n):t;return h.current=r,r})}const[C,u]=l.useState(new Map),k=l.useRef(null),[m,g]=l.useState(null),{sendMessage:T}=Et(),{setChatOpen:E}=Pt(),z=ut(),[w,H]=l.useState(null),[J,ue]=l.useState(null),[ee,ie]=l.useState(!1);async function te(t,n){const r=await fetch(je(y,e,c,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.error??`Request failed (${r.status})`)}return r.json()}async function se(){z.invalidateQueries({queryKey:Ae(y,e,c)})}function be(t,n){navigator.clipboard.writeText(n).then(()=>$.success(`${t} copied`),()=>$.error(`Failed to copy ${t.toLowerCase()}`))}function Be(t){const n=Yt(t);if(!n)return;const r=`${y}/${e}/${c}`;z.setQueryData(Te.decofile(r),s=>{if(!s)return s;const{[n]:a,...d}=s;return d}),z.invalidateQueries({queryKey:Te.liveMeta(r)})}function Ge(t){const n=t.kind==="file"?[t.path]:A.filter(r=>r.startsWith(".deco/blocks/")).map(r=>ce(r)).filter(r=>r===t.path||r.startsWith(`${t.path}/`));for(const r of n)Be(r)}function qe(t){const n=ce(t);return B.filter(r=>{if(r!==n&&!r.startsWith(`${n}/`))return!1;const s=C.get(r);return!!(s?.loaded&&s.editorValue!==s.savedContent)})}function ve(t){f(n=>n.map(r=>t(r)).filter(r=>r!==null)),p(n=>n&&t(n)),u(n=>{const r=new Map;for(const[s,a]of n){const d=t(s);d&&r.set(d,a)}return r}),I(n=>{if(!n)return n;const r=t(n.path);return r?r===n.path?n:{...n,path:r,name:r.split("/").pop()??r}:null})}function Qe(t){const n=ce(t);I(r=>r&&(r.path===n||r.path.startsWith(`${n}/`)?null:r)),ve(r=>r===n||r.startsWith(`${n}/`)?null:r)}async function Ue(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);await te("write",{path:M(n),content:""}),await ne(),await se(),H(null),me(n)}async function He(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);const r=M(n);await te("mkdir",{path:r}),Q(s=>({...s,directories:s.directories.includes(r)?s.directories:[...s.directories,r]})),await ne(),await se(),H(null),W(s=>{const a=new Set(s);for(const d of he(n))a.add(d);return a.add(n),a}),I({name:t,path:n,kind:"directory",children:[]})}async function Je(t){if(!w)return;const n=w.node.path,r=ye(n),s=de(r,t);if(s===n){H(null);return}if(we(s,A,V))throw new Error(`"${t}" already exists`);await te("rename",{from:M(n),to:M(s)}),ve(a=>a===n?s:a.startsWith(`${n}/`)?de(s,a.slice(n.length+1)):a),await ne(),await se(),H(null)}async function Xe(t){ie(!0);try{await te("unlink",{path:M(t.path),recursive:t.kind==="directory"}),Ge(t),Qe(t.path),await ne(),await se(),ue(null),$.success(`Deleted "${t.name}"`)}catch(n){$.error(n instanceof Error?n.message:"Delete failed")}finally{ie(!1)}}async function Ye(t){const n=Xt(t);if(n){$.error(n);return}ie(!0);try{w?.mode==="new-file"?(await Ue(t),$.success(`Created "${t}"`)):w?.mode==="new-folder"?(await He(t),$.success(`Created folder "${t}"`)):w?.mode==="rename"&&(await Je(t),$.success(`Renamed to "${t}"`))}catch(r){$.error(r instanceof Error?r.message:"Operation failed")}finally{ie(!1)}}const Ce=l.useRef(!1);Ce.current||(Ce.current=!0,b.current=ne());const[Ze,_e]=l.useState(null);if(K&&K!==Ze){_e(K);const t=K;queueMicrotask(()=>{rn(t)&&me(t).catch(n=>{$.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ne(t){const n=await te("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Se(t,n,r){if(r!==j.current)return!1;let s=!1;return Q(a=>{const d=n?Zt(a.files,a.directories,t,a.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return s=!!d.truncated,{files:d.files,directories:d.directories,truncated:s}}),s&&$.warning("File list truncated — some files may be hidden"),s}async function et(t){const n=x.current.get(t);if(n)return n;const r=j.current,s=(async()=>{const a=await Ne({pattern:"**/*",path:M(t),limit:Me}),d=Se(a,!0,r);return!d&&r===j.current&&v(Y=>{const oe=new Set(Y);return oe.add(t),oe}),d})();x.current.set(t,s);try{return await s}finally{x.current.delete(t)}}async function De(t){if(!ge(t,h.current))return!1;D(n=>new Set(n).add(t));try{return await et(t)}finally{D(n=>{const r=new Set(n);return r.delete(t),r})}}async function tt(t){const n=new Set(h.current);for(const r of he(t)){if(!ge(r,n))continue;if(await De(r))throw new Error("Folder listing truncated — expand again to load more");n.add(r)}}async function ne(){const t=++j.current;x.current.clear(),q(!0),v(new Set),W(new Set),D(new Set);try{const n=await Ne({pattern:"**/*",limit:Me,maxDepth:qt});Se(n,!1,t),N(!0)}catch{L&&$.error("Failed to refresh file tree")}finally{q(!1)}}async function ke(t){if(!C.get(t)?.loaded){u(r=>{const s=new Map(r);return s.set(t,{savedContent:"",editorValue:"",loaded:!1}),s});try{const r=await fetch(je(y,e,c,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),full:!0})});if(!r.ok)return;const s=await r.json(),a=Jt(s.content??"");u(d=>{const Y=new Map(d);return Y.set(t,{savedContent:a,editorValue:a,loaded:!0}),Y})}catch{}}}async function nt(t,n){try{const r=await fetch(je(y,e,c,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),content:n})});if(!r.ok){le("file save failed",{path:t,status:r.status});return}le("file saved via sandbox /write",{path:t}),z.invalidateQueries({queryKey:Ae(y,e,c)});try{const s=await Tt(y,e,c);le("git status after save",s)}catch(s){le("git status after save failed",{path:t,error:s instanceof Error?s.message:String(s)})}u(s=>{const a=new Map(s),d=a.get(t);return d&&a.set(t,{...d,savedContent:n}),a})}catch{}}function rt(t){p(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),g(null),B.includes(t)||f(n=>[...n,t]),ke(t)}function it(t){f(n=>{const r=n.filter(s=>s!==t);return o===t&&p(r[r.length-1]??null),r}),u(n=>{const r=new Map(n);return r.delete(t),r})}function Fe(t){W(n=>{const r=new Set(n);return r.has(t)?r.delete(t):r.add(t),r})}async function st(t){if(ge(t,h.current))try{if(await De(t))return}catch(n){$.error(n instanceof Error?n.message:"Failed to load folder");return}Fe(t)}async function ot(t,n){if(n){Fe(t);return}await st(t)}async function me(t){await b.current,await tt(t);const n=he(t);W(r=>{const s=new Set(r);for(const a of n)s.add(a);return s}),rt(t)}function at(){return R?.kind==="directory"?R.path:R?.kind==="file"?ye(R.path):o?ye(o):"/"}function Le(t){const n=at();H({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const lt=Qt(A,V),Ee=Ut(lt,P),Pe=F?Ee.filter(t=>t.node.name.toLowerCase().includes(F.toLowerCase())):Ee,Z=o?C.get(o):null,ct=Z?.loaded&&Z.editorValue!==Z.savedContent,pe=J?qe(J.path):[],dt=(t,n)=>{k.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!o)return;const r=t.getValue();await nt(o,r)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const r=t.getSelection(),s=t.getModel();if(!r||!s||!o)return;const a=s.getValueInRange(r);g({filePath:o,lineStart:r.startLineNumber,lineEnd:r.endLineNumber,selectedCode:a})})};function ft(t){if(!m)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${m.filePath}\``,`**Lines:** ${m.lineStart}–${m.lineEnd}`];if(m.selectedCode){const r=xe(m.filePath),s=m.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+r,s,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),E(!0),T({parts:[{type:"text",text:n.join(`
2
- `)}]}),g(null)}return G&&!L?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[i.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[i.jsxs("div",{className:"relative min-w-0 flex-1",children:[i.jsx(ht,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),i.jsx("input",{type:"text",value:F,onChange:t=>U(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),i.jsxs(Re,{children:[i.jsx(Oe,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:i.jsx(xt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New file"})]}),i.jsxs(Re,{children:[i.jsx(Oe,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:i.jsx(gt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New folder"})]})]}),i.jsx(bt,{className:"flex-1",children:i.jsxs("div",{className:"py-1",children:[Pe.map(t=>{const{node:n,depth:r}=t,s=n.kind==="directory",a=P.has(n.path),d=R?.path===n.path,Y=Ht(n.path,n.kind),oe=s&&S.has(n.path);return i.jsx(nn,{node:n,depth:r,isExpanded:a,isSelected:d,isLoading:oe,fileVisual:on(n.name),onSelect:()=>I(n),onOpen:()=>{s?ot(n.path,a):me(n.path)},onNewFile:()=>H({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>H({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>be("Path",ce(n.path)),onCopyRelativePath:()=>be("Relative path",M(n.path)),onRename:()=>H({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ue(n)},n.path)}),L&&Pe.length===0&&i.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:F?`No files match "${F}"`:"No files found"})]})})]}),i.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[B.length>0&&i.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:B.map(t=>{const n=C.get(t),r=n?.loaded&&n.editorValue!==n.savedContent,s=o===t,a=t.split("/").pop()??t;return i.jsxs("div",{className:Ve("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",s?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{p(t),ke(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":s,children:[i.jsx("span",{className:"truncate max-w-32",children:a}),r&&i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),i.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:d=>{d.stopPropagation(),it(t)},children:i.jsx(jt,{size:12})})]},t)})}),m&&i.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:i.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const r=t.currentTarget.elements.namedItem("askAiInput");r.value.trim()&&ft(r.value)},children:[i.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&g(null)}}),i.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[i.jsx("title",{children:"Send"}),i.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),i.jsx("div",{className:"flex-1 overflow-hidden",children:o&&Z?.loaded?i.jsx(mt,{language:xe(o),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:Z.editorValue,path:o,onChange:t=>{const n=o;n&&u(r=>{const s=new Map(r),a=s.get(n);return a&&s.set(n,{...a,editorValue:t??""}),s})},onMount:dt,loading:i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},o):o&&!Z?.loaded?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),o&&i.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[i.jsx("span",{className:"truncate",children:o}),i.jsxs("span",{children:[ct?"Modified":"Saved"," ·"," ",xe(o)]})]})]}),i.jsx(en,{open:w!==null,mode:w?.mode??"new-file",initialName:w?.mode==="rename"?w.node.name:"",parentLabel:w&&w.mode!=="rename"?w.parentDir==="/"?"/":M(w.parentDir):void 0,isPending:ee,onSubmit:Ye,onOpenChange:t=>{!t&&!ee&&H(null)}}),i.jsx(vt,{open:J!==null,onOpenChange:t=>{!t&&!ee&&ue(null)},children:i.jsxs(Ct,{children:[i.jsxs(Nt,{children:[i.jsxs(St,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),i.jsxs(Dt,{children:["This will permanently delete"," ",i.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",pe.length>0&&i.jsxs(i.Fragment,{children:[" ",pe.length===1?"One open file has unsaved changes that will be lost.":`${pe.length} open files have unsaved changes that will be lost.`]})]})]}),i.jsxs(kt,{children:[i.jsx(Ft,{disabled:ee,children:"Cancel"}),i.jsx(Lt,{disabled:ee||!J,onClick:t=>{t.preventDefault(),J&&Xe(J)},children:"Delete"})]})]})})]})}export{Qi as FileExplorer};
@@ -1,4 +0,0 @@
1
- import{e as $,j as t,q as J,b as he,G as ae,r as L,M as ke,J as Re,R as ie,n as xe,K as U,a as be,t as oe,o as D,B as se,c as V,l as Y,s as Ae,F as Oe}from"./index-CpG2_v8p.js";import{b as Ge}from"./use-virtual-mcp-BOy7A3-I.js";import{k as le}from"./use-navigate-to-agent-CLdhXO-i.js";import{b as Le,u as ye}from"./use-connection-CbBvGv-y.js";import{W as Pe,u as H,a as ce}from"./use-mcp-client-BDuQ-DKr.js";import{D as we,a as Ce,b as Ie,c as Ne,d as $e}from"./dialog-DzWL-NrT.js";import{i as ue}from"./RefreshCcw01-D1X4YmG3.js";import{C as je}from"./collection-search-Bk4YcOKu.js";import{C as pe}from"./checkbox-C5cEV_DH.js";import{n as He}from"./agent-icon-C_8D2J-7.js";import{u as Me}from"./use-mcp-tools-xqS_ta53.js";import{e as De}from"./extract-connection-data-DzgWcXVA.js";const Ue=`<svg width="74" height="84" viewBox="0 0 74 84" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M63.4462 15.3005C63.1414 15.2764 57.2333 15.1845 57.2333 15.1845C57.2333 15.1845 52.2906 10.3849 51.8019 9.89426C51.6127 9.71981 51.3729 9.60981 51.1172 9.58008V83.0253L73.2664 77.5175C73.2664 77.5175 64.2277 16.3953 64.1696 15.9772C64.1417 15.7997 64.055 15.6366 63.9235 15.5139C63.7919 15.3913 63.6255 15.3162 63.4462 15.3005Z" fill="#171717"/>
3
- <path fill-rule="evenodd" clip-rule="evenodd" d="M32.748 0.00356357C34.8334 -0.0568526 36.5759 0.651298 37.9307 2.10122C38.0276 2.20613 38.1209 2.31463 38.2109 2.42544L38.2354 2.42349C38.4434 2.40657 38.6494 2.38638 38.8574 2.38638H38.8672C41.9831 2.3913 44.5571 4.16796 46.3184 7.527C46.8023 8.4621 47.2004 9.43976 47.5068 10.4469L49.9883 9.67837C50.3609 9.56961 51.315 9.42163 51.8037 9.90981L51.9922 82.3883L51.1162 83.0387L0 74.1979C0.0195597 74.0466 6.09952 27.0238 6.3291 25.3629C6.63636 23.1661 6.70922 23.0933 9.03906 22.361L16.957 19.9079C17.4531 16.377 19.1884 11.8165 21.4746 8.18423C24.7237 3.02487 28.7273 0.119714 32.748 0.00356357ZM38.8408 26.7077C38.8133 26.694 36.5926 25.6009 32.2842 25.8747C21.032 26.5853 15.9341 34.4515 16.4229 42.2213C17.0059 51.4485 26.2283 51.1199 26.584 56.734C26.6686 58.0922 25.8271 60.0114 23.4658 60.1588C19.8562 60.3883 15.3438 56.9831 15.3438 56.9831L13.6191 64.3249C13.6191 64.3249 18.1021 69.1296 26.2432 68.6149C33.027 68.1895 37.7351 62.759 37.2344 54.8249C36.5981 44.7397 25.2729 43.7966 25.002 39.4948C24.9512 38.7038 25.0055 35.556 29.9932 35.2418C33.3786 35.0279 36.2354 36.3195 36.2666 36.3336L38.8408 26.7077ZM32.8262 2.6813C26.6181 2.86014 21.2028 12.5587 19.8213 19.0211L26.8311 16.8512C27.6101 12.7476 29.5648 8.48928 32.1221 5.74868C33.0162 4.76667 34.0719 3.94401 35.2432 3.31704H35.2451C34.5654 2.87005 33.7695 2.66203 32.8262 2.6813ZM36.9775 5.46548C35.7921 5.95366 34.7952 6.80972 34.0791 7.57583C32.1608 9.63716 30.5951 12.7807 29.7725 15.9391L38.3057 13.2956C38.3322 11.0721 38.0904 7.7854 36.9775 5.46548ZM39.7568 5.14907C40.7052 7.59721 40.9505 10.4321 40.9795 12.4694L44.9473 11.2389C44.3133 9.17981 42.8075 5.72907 39.7568 5.14907Z" fill="#393939"/>
4
- </svg>`,Fe=`data:image/svg+xml,${encodeURIComponent(Ue)}`,Nt={title:"New Website",description:"Website cloned from a public template",url:"https://github.com/decocms/webapp-template",owner:"decocms",name:"webapp-template"},jt={title:"Shopify Headless Store",description:"Shopify Headless Store cloned from a public template",url:"https://github.com/Shopify/hydrogen-demo-store",owner:"Shopify",name:"hydrogen-demo-store",icon:Fe};function St(){const o=$.c(6),e=Ge(),n=le();let s;o[0]!==e.create||o[1]!==n?(s=async r=>{const f=await e.create.mutateAsync({title:r.title,description:r.description,icon:r.icon??null,status:"active",pinned:!1,connections:[],metadata:{githubRepo:{url:r.url,owner:r.owner,name:r.name},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}}});return f.id&&n(f.id),f},o[0]=e.create,o[1]=n,o[2]=s):s=o[2];const l=s;let i;return o[3]!==e.create.isPending||o[4]!==l?(i={createFromTemplate:l,isCreating:e.create.isPending},o[3]=e.create.isPending,o[4]=l,o[5]=i):i=o[5],i}function F(o){const e=$.c(4),{size:n,className:s}=o;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=l):l=e[0];let i;return e[1]!==s||e[2]!==n?(i=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:s,children:l}),e[1]=s,e[2]=n,e[3]=i):i=e[3],i}function ze(o,e){const n=$.c(12),{org:s}=J();let l;n[0]!==s.id?(l=Pe.REGISTRY(s.id),n[0]=s.id,n[1]=l):l=n[1];const i=l;let r;n[2]!==s.id||n[3]!==s.slug||n[4]!==i?(r={connectionId:i,orgId:s.id,orgSlug:s.slug},n[2]=s.id,n[3]=s.slug,n[4]=i,n[5]=r):r=n[5];const f=H(r);let b;n[6]!==o?(b={name:o},n[6]=o,n[7]=b):b=n[7];const a=e?.enabled??!0;let C;return n[8]!==f||n[9]!==b||n[10]!==a?(C={client:f,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:b,enabled:a,staleTime:3e5,select:qe},n[8]=f,n[9]=b,n[10]=a,n[11]=C):C=n[11],Me(C)}function qe(o){return o.structuredContent?.item??null}const Be="deco/mcp-github";function Se(o){const{org:e}=J(),{data:n}=he.useSession(),s=Le(),l=ae(),[i,r]=L.useState("idle"),[f,b]=L.useState(null),[a,C]=L.useState(null),{data:h,isLoading:m}=ze(Be,{enabled:o.enabled}),x=L.useRef(!1);o.enabled&&h&&!m&&!x.current&&n?.user?.id&&i==="idle"&&(x.current=!0,N());async function N(){if(!(!h||!n?.user?.id||!e))try{r("installing"),b(null);const p=De(h,e.id,n.user.id,{remoteIndex:0});if(!p.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:w}=await s.create.mutateAsync(p);r("authenticating");const j=new URL(`/api/${e.slug}/mcp/${w}`,window.location.origin),d=await ke({url:j.href,token:null,orgId:e.id});if(d.supportsOAuth&&!d.isAuthenticated){const{token:S,tokenInfo:c,error:v}=await Re({connectionId:w,orgSlug:e.slug,scope:"offline_access"});if(v||!S){try{await s.delete.mutateAsync(w)}catch{}throw new Error(v??"No token received from GitHub")}if(c)try{(await fetch(`/api/${e.slug}/connections/${w}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:c.accessToken,refreshToken:c.refreshToken,expiresIn:c.expiresIn,scope:c.scope,clientId:c.clientId,clientSecret:c.clientSecret,tokenEndpoint:c.tokenEndpoint})})).ok||await s.update.mutateAsync({id:w,data:{connection_token:S}})}catch{await s.update.mutateAsync({id:w,data:{connection_token:S}})}}ie(l,e.id),C(p),r("ready")}catch(p){b(p instanceof Error?p.message:String(p)),r("error")}}function y(){r("idle"),b(null),C(null),x.current=!1}return o.enabled&&m&&i==="idle"?{status:"installing",error:null,connection:null,retry:y}:{status:i,error:f,connection:a,retry:y}}const Ve="deco-sites";function Ke(o){if(!o||typeof o!="object")return null;const e=o.github;if(!e||typeof e!="object")return null;const n=e.owner,s=e.repo;return typeof n!="string"||typeof s!="string"||n.length===0||s.length===0?null:{owner:n,repo:s}}function Qe(o,e){const n=e?Ke(e):null,s=n?.owner??Ve,l=n?.repo??o;return{owner:s,name:l,url:`https://github.com/${s}/${l}`}}const K={contents:"write",metadata:"read",pull_requests:"write",issues:"write"};function Je(o){if(!o||typeof o!="object"||Array.isArray(o))return K;const e=o;return Object.values(e).some(n=>typeof n!="string")?K:e}function Ye(o){if(!(typeof o!="number"||!Number.isFinite(o)||!Number.isInteger(o)||o<=0))return o}function We(o){const e=o.metadata?.repoScope;if(!e||typeof e.installationId!="number"||!Number.isFinite(e.installationId)||!Number.isInteger(e.installationId)||e.installationId<=0||typeof e.owner!="string"||typeof e.repo!="string"||e.owner.length===0||e.repo.length===0)return null;const n=Ye(e.repositoryId);return{sourceConnectionId:typeof e.sourceConnectionId=="string"?e.sourceConnectionId:void 0,installationId:e.installationId,repositoryId:n,owner:e.owner,repo:e.repo,permissions:Je(e.permissions),grantProvider:e.grantProvider==="github-mcp"?"github-mcp":void 0}}function ve(o){return o.filter(e=>We(e)===null)}async function Ee(o,e){const s=(await o({name:"GITHUB_LIST_USER_ORGS",arguments:{connectionId:e}})).content?.[0]?.text;if(!s)throw new Error("No response from GITHUB_LIST_USER_ORGS");try{return JSON.parse(s)}catch{throw new Error("Invalid response from GITHUB_LIST_USER_ORGS")}}function Ze(o,e){const n=e.toLowerCase();return o.find(s=>s.login.toLowerCase()===n)}const ge="GitHub MCP did not return refreshable repo grant metadata";function q(o){if(typeof o!="string")return null;const e=o.trim();return e.length>0?e:null}function Xe(o){try{const e=new URL(o);return(e.protocol==="http:"||e.protocol==="https:")&&!e.username&&!e.password}catch{return!1}}function et(o){return typeof o=="number"&&Number.isFinite(o)&&Number.isInteger(o)&&o>0?o:void 0}async function Te(o){const{orgSlug:e,sourceConnection:n,installationId:s,owner:l,repo:i,githubCallTool:r,selfCallTool:f}=o,b=await r({name:"MINT_REPO_TOKEN",arguments:{installationId:s,owner:l,repo:i,permissions:K}}),a=b.structuredContent;if(b.isError||!a?.token){const A=b.content?.find(T=>T.type==="text")?.text;throw new Error(A?`Failed to mint a repo-scoped GitHub token: ${A}`:"Failed to mint a repo-scoped GitHub token")}const C=q(a.refreshToken),h=q(a.tokenEndpoint),m=q(a.clientId);if(!C||!h||!m)throw new Error(ge);if(!Xe(h))throw new Error(ge);const x=q(a.repository?.owner),N=q(a.repository?.name),y="GitHub MCP returned refresh metadata for a different repository";if(a.repository?.owner!==void 0&&(!x||x.toLowerCase()!==l.toLowerCase()))throw new Error(y);if(a.repository?.name!==void 0&&(!N||N.toLowerCase()!==i.toLowerCase()))throw new Error(y);const p=et(a.repository?.id),I=a.expiresAt?Date.parse(a.expiresAt):NaN,w=Number.isFinite(I)?Math.max(0,Math.floor((I-Date.now())/1e3)):null,d=(typeof a.expiresIn=="number"&&Number.isFinite(a.expiresIn)&&Number.isInteger(a.expiresIn)&&a.expiresIn>0?a.expiresIn:null)??w,S=await f({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:{title:`GitHub: ${l}/${i}`,description:`Repo-scoped GitHub access for ${l}/${i}`,icon:n.icon,app_name:n.app_name,app_id:n.app_id,connection_type:n.connection_type,connection_url:n.connection_url,metadata:{repoScope:{installationId:s,repositoryId:p,owner:l,repo:i,permissions:K,grantProvider:"github-mcp"}}}}}),c=S.structuredContent??S,v=c.item?.id??c.id;if(!v)throw new Error("Failed to create the repo-scoped GitHub connection");if(!(await fetch(`/api/${e}/connections/${v}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:a.token,refreshToken:C,expiresIn:d,scope:a.scope??null,clientId:m,tokenEndpoint:h})})).ok)throw await f({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:v,force:!0}}).catch(()=>{}),new Error("Failed to persist the repo-scoped token");return{childConnectionId:v}}function tt(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function nt(o){const e=await fetch(`/api/${o}/deco-sites`);if(!e.ok){const n=await e.json().catch(()=>({}));throw new Error(n.error??`Failed to load sites (${e.status})`)}return e.json()}function vt({open:o,onOpenChange:e,onBack:n}){const{org:s}=J(),l=le(),i=ae(),{data:r}=he.useSession(),[f,b]=L.useState(null),[a,C]=L.useState(null),[h,m]=L.useState(""),x=H({connectionId:ce,orgId:s.id,orgSlug:s.slug}),N=ye({slug:"mcp-github"}),y=ve(N),p=Se({enabled:o&&y.length===0}),I=y.length===1?y[0]??null:a,w=y.length>1&&!I,j=H({connectionId:I?.id??"",orgId:s.id,orgSlug:s.slug}),d=o&&y.length===0&&(p.status==="installing"||p.status==="authenticating"||p.status==="idle"),{data:S,isLoading:c,error:v}=xe({queryKey:U.decoSites(r?.user?.email),queryFn:()=>nt(s.slug),enabled:o&&!!r?.user?.email,staleTime:6e4,retry:!1}),O=S?.sites??[],A=u=>{u||(b(null),C(null),m("")),e(u)},T=O.filter(u=>u.name.toLowerCase().includes(h.toLowerCase())||(u.domains?.[0]?.domain?.toLowerCase().includes(h.toLowerCase())??!1)),g=!f||T.some(u=>u.name===f),k=be({mutationFn:async u=>{if(!I)throw new Error("GitHub is not connected. Complete GitHub setup and try again.");oe("deco_site_import_started",{site_name:u});const{installations:R,appSlug:_}=await Ee(P=>x.callTool(P),I.id),G=O.find(P=>P.name===u);if(!G)throw new Error("Selected site is no longer available");const E=Qe(u,G.metadata),z=Ze(R,E.owner);if(!z){const P=_?`https://github.com/apps/${_}/installations/new`:"https://github.com/settings/installations";throw new Error(`Install the GitHub App on the "${E.owner}" organization to import this site. ${P}`)}let W=null,Z=null,X=null;const _e=async()=>{X&&await x.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:X}}).catch(()=>{}),Z&&await x.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:Z,force:!0}}).catch(()=>{}),W&&await x.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:W,force:!0}}).catch(()=>{})};try{const P=await fetch(`/api/${s.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:u})}),ee=await P.json().catch(()=>({}));if(!P.ok)throw new Error(ee.error??`Failed to create connection (${P.status})`);const M=ee.connId;if(!M)throw new Error("Server did not return a connection ID");W=M;const{childConnectionId:te}=await Te({orgSlug:s.slug,sourceConnection:I,installationId:z.installationId,owner:E.owner,repo:E.name,githubCallTool:ne=>j.callTool(ne),selfCallTool:ne=>x.callTool(ne)});Z=te;const de=ee.icon??null,me=tt(u),fe=await x.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:u,description:"Imported from deco.cx",pinned:!1,icon:de??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],githubRepo:{owner:E.owner,name:E.name,url:E.url,installationId:z.installationId,connectionId:te},ui:{banner:null,bannerColor:"#22C55E",icon:de,themeColor:"#22C55E",slug:me,pinnedViews:[{connectionId:M,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:M,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:M},{connection_id:te}]}}}),B=fe.structuredContent??fe;if(!B.item?.id)throw new Error("Failed to create the imported agent");return X=B.item.id,{slug:me,virtualMcpId:B.item.id,connId:M,item:B.item}}catch(P){throw await _e(),P}},onSuccess:({slug:u,virtualMcpId:R,item:_})=>{oe("deco_site_import_succeeded",{site_name:_.title,virtual_mcp_id:R,slug:u}),i.setQueryData(U.collectionItem(x,s.id,"","VIRTUAL_MCP",R),{item:_}),i.invalidateQueries({predicate:G=>{const E=G.queryKey;return E[1]===s.id&&E[3]==="collection"&&E[4]==="VIRTUAL_MCP"}}),i.invalidateQueries({queryKey:U.projects(s.id)}),D.success(`Imported ${u} from deco.cx`),A(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),l(R)},onError:u=>{oe("deco_site_import_failed",{error:u instanceof Error?u.message:"Unknown error"}),D.error("Import failed: "+(u instanceof Error?u.message:"Unknown error"))}});return t.jsx(we,{open:o,onOpenChange:A,children:t.jsxs(Ce,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[t.jsx(Ie,{className:"sr-only",children:t.jsx(Ne,{children:"Import from deco.cx"})}),t.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[n&&t.jsx("button",{type:"button",onClick:n,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:t.jsx(ue,{size:18})}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"})]}),t.jsx("div",{children:t.jsx(je,{value:h,onChange:m,placeholder:"Search sites...",onKeyDown:u=>{u.key==="Escape"&&m("")}})}),t.jsxs("div",{className:"pb-0 min-h-[300px]",children:[p.status==="error"&&t.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[t.jsx("p",{className:"text-sm text-destructive",children:p.error??"Failed to connect GitHub"}),t.jsx(se,{variant:"outline",size:"sm",onClick:p.retry,children:"Retry GitHub setup"})]}),d&&p.status!=="error"&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Setting up GitHub connection..."}),w&&!d&&p.status!=="error"&&t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-8 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a GitHub connection"})}),y.map(u=>t.jsxs("button",{type:"button",onClick:()=>C(u),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[u.icon?t.jsx("img",{src:u.icon,alt:u.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(F,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:u.title})]},u.id))]}),c&&!d&&p.status!=="error"&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),!c&&!d&&!w&&p.status!=="error"&&!v&&O.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),!c&&!d&&!w&&p.status!=="error"&&O.length>0&&t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[T.length===0&&t.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",h,"”"]}),T.map(u=>{const R=u.domains?.find(G=>G.production)?.domain??u.domains?.[0]?.domain,_=f===u.name;return t.jsxs("button",{type:"button",onClick:()=>b(u.name),className:V("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",_?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[t.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:u.thumb_url?t.jsx("img",{src:u.thumb_url,alt:u.name,className:"w-full h-full object-cover",loading:"lazy"}):t.jsx("div",{className:"w-full h-full bg-muted"})}),t.jsxs("div",{className:"px-4 py-3",children:[t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:u.name}),R&&t.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:R})]})]},u.name)})]})]}),t.jsxs($e,{className:"px-8 py-5 border-t border-border",children:[t.jsx(se,{variant:"outline",onClick:()=>A(!1),disabled:k.isPending,children:"Cancel"}),t.jsx(se,{disabled:!f||!g||k.isPending||c||d||w||!I||p.status==="error",onClick:()=>f&&k.mutate(f),children:k.isPending?"Importing...":"Import"})]})]})})}function ot(o,e){const n=$.c(4),[s,l]=L.useState(o);let i,r;return n[0]!==e||n[1]!==o?(i=()=>{const f=setTimeout(()=>l(o),e);return()=>clearTimeout(f)},r=[o,e],n[0]=e,n[1]=o,n[2]=i,n[3]=r):(i=n[2],r=n[3]),L.useEffect(i,r),s}const Q=[{key:"auto-respond-to-issues",triggerType:"github.issues.opened",nameSuffix:"auto-respond to issues",label:"Auto-respond to new issues",defaultEnabled:!0,instructions:({owner:o,name:e})=>`A new GitHub issue has been opened in ${o}/${e}. Read the issue, explore relevant code, create a branch, implement the fix, and open a PR referencing the issue number.`},{key:"review-incoming-prs",triggerType:"github.pull_request.opened",nameSuffix:"review incoming PRs",label:"Review incoming pull requests",defaultEnabled:!0,instructions:({owner:o,name:e})=>`A pull request was opened in ${o}/${e}. Read the diff, summarize what changed, flag risks (security, perf, breaking changes), and leave a review comment.`},{key:"note-merged-prs",triggerType:"github.pull_request.closed",nameSuffix:"note merged/closed PRs",label:"Note merged or closed PRs",defaultEnabled:!1,instructions:({owner:o,name:e})=>`A pull request was closed in ${o}/${e}. If it was merged, update changelog/release notes as appropriate.`}];function st(o,e){const n=new Set;if(o.paramsSchema)for(const l of Object.keys(o.paramsSchema))n.add(l);if(Array.isArray(o.params))for(const l of o.params)n.add(l.name);else if(o.params&&typeof o.params=="object")for(const l of Object.keys(o.params))n.add(l);if(n.has("repo"))return{repo:`${e.owner}/${e.name}`};const s={};return n.has("owner")&&(s.owner=e.owner),n.has("name")&&(s.name=e.name),n.has("repository")&&(s.repository=`${e.owner}/${e.name}`),s}async function rt({githubCallTool:o,selfCallTool:e,virtualMcpId:n,repo:s,connectionId:l,selectedKeys:i}){const r=await o({name:"TRIGGER_LIST",arguments:{}}),f=r.structuredContent??r,b=new Map((f.triggers??[]).map(m=>[m.type,m])),a=Q.filter(m=>i.has(m.key)),C=await Promise.allSettled(a.map(async m=>{const x=b.get(m.triggerType);if(!x)throw new Error(`Trigger ${m.triggerType} not exposed`);const N=await e({name:"AUTOMATION_CREATE",arguments:{name:`${s.name}: ${m.nameSuffix}`,virtual_mcp_id:n,messages:m.instructions(s),active:!0}}),y=(N.structuredContent??N).id;if(!y)throw new Error(`AUTOMATION_CREATE returned no id for ${m.key}`);await e({name:"AUTOMATION_TRIGGER_ADD",arguments:{automation_id:y,type:"event",connection_id:l,event_type:m.triggerType,params:st(x,s)}})})),h=C.filter(m=>m.status==="rejected").length;return h>0&&console.error("Some GitHub automations failed to set up:",C.filter(m=>m.status==="rejected")),{total:C.length,failed:h}}function Et(o){const e=$.c(22),{open:n,onOpenChange:s,title:l,hideAutoRespondCheckbox:i,onImportComplete:r}=o,f=l===void 0?"Import from GitHub":l,b=i===void 0?!1:i,[a,C]=L.useState(null);let h;e[0]!==f?(h=t.jsx(Ie,{className:"sr-only",children:t.jsx(Ne,{children:f})}),e[0]=f,e[1]=h):h=e[1];let m;e[2]!==a||e[3]!==f?(m=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:a?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>C(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(ue,{size:16})}),t.jsx("img",{src:a.avatarUrl,alt:a.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:a.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(F,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:f})]})}),e[2]=a,e[3]=f,e[4]=m):m=e[4];let x;e[5]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Y,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=x):x=e[5];let N;e[6]!==s?(N=()=>s(!1),e[6]=s,e[7]=N):N=e[7];let y;e[8]!==b||e[9]!==r||e[10]!==n||e[11]!==a||e[12]!==N?(y=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(L.Suspense,{fallback:x,children:t.jsx(it,{open:n,onComplete:N,selectedInstallation:a,onSelectInstallation:C,hideAutoRespondCheckbox:b,onImportComplete:r})})}),e[8]=b,e[9]=r,e[10]=n,e[11]=a,e[12]=N,e[13]=y):y=e[13];let p;e[14]!==h||e[15]!==m||e[16]!==y?(p=t.jsxs(Ce,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[h,m,y]}),e[14]=h,e[15]=m,e[16]=y,e[17]=p):p=e[17];let I;return e[18]!==s||e[19]!==n||e[20]!==p?(I=t.jsx(we,{open:n,onOpenChange:s,children:p}),e[18]=s,e[19]=n,e[20]=p,e[21]=I):I=e[21],I}function it({open:o,onComplete:e,selectedInstallation:n,onSelectInstallation:s,hideAutoRespondCheckbox:l,onImportComplete:i}){const{org:r}=J(),f=ae(),b=le(),[a,C]=L.useState(null),[h,m]=L.useState(!0),[x,N]=L.useState(()=>new Set(Q.filter(g=>g.defaultEnabled).map(g=>g.key))),y=Q.filter(g=>g.defaultEnabled).map(g=>g.key),p=l?new Set(y):h?x:new Set,I=ye({slug:"mcp-github"}),w=ve(I),j=Se({enabled:o&&w.length===0}),d=w.length===1?w[0]??null:a,S=H({connectionId:d?.id??"",orgId:r.id,orgSlug:r.slug}),c=H({connectionId:ce,orgId:r.id,orgSlug:r.slug}),v=async(g,k)=>{try{const R=await S.callTool({name:"get_file_contents",arguments:{owner:g.owner,repo:g.name,path:k}});if(R.isError)return null;const G=R.content?.find(E=>E.type==="resource")?.resource?.text;if(!G)return null;try{const E=JSON.parse(G);return typeof E=="string"?E:JSON.stringify(E)}catch{return G}}catch{return null}},O=(g,k)=>{Promise.all([v(k,"AGENTS.md"),v(k,"CLAUDE.md")]).then(async([u,R])=>{const _=u??R??null;_&&(await c.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:g,data:{metadata:{instructions:_}}}}),ie(f,r.id))}).catch(u=>{console.error("GitHub instructions fetch failed:",u)})},A=async({virtualMcpId:g,repo:k,connectionId:u,selectedKeys:R})=>{const{total:_,failed:G}=await rt({githubCallTool:E=>S.callTool(E),selfCallTool:E=>c.callTool(E),virtualMcpId:g,repo:k,connectionId:u,selectedKeys:R});G>0&&D.warning(`Set up ${_-G}/${_} GitHub automations. Add the rest from the automations view.`)},T=be({mutationFn:async g=>{if(!d||!n)throw new Error("No GitHub connection or installation");const k=n.installationId,{childConnectionId:u}=await Te({orgSlug:r.slug,sourceConnection:d,installationId:k,owner:g.owner,repo:g.name,githubCallTool:_=>S.callTool(_),selfCallTool:_=>c.callTool(_)});let R=null;try{const _=await c.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:g.name,description:g.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:g.owner,name:g.name,url:g.url,installationId:k,connectionId:u},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:u}]}}}),G=_.structuredContent??_,E=G.item?.id;if(!G.item||!E)throw new Error("Failed to create the imported agent");return R=E,p.size>0&&await A({virtualMcpId:E,repo:g,connectionId:u,selectedKeys:p}).catch(z=>{console.error("Failed to set up GitHub automations:",z),D.warning("Imported repo, but failed to set up GitHub automations. You can add triggers manually from the automations view.")}),{virtualMcpId:E,repo:g,connectionId:u,item:G.item}}catch(_){throw R&&await c.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:R}}).catch(()=>{}),await c.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:u,force:!0}}).catch(()=>{}),_}},onSuccess:({virtualMcpId:g,repo:k,connectionId:u,item:R})=>{if(f.setQueryData(U.collectionItem(c,r.id,"","VIRTUAL_MCP",g),{item:R}),ie(f,r.id),O(g,k),i){i({virtualMcpId:g,repo:k,connectionId:u});return}D.success(`Imported ${k.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),b(g)},onError:g=>{D.error("Failed to import repo: "+(g instanceof Error?g.message:"Unknown error"))}});return j.status==="installing"||j.status==="authenticating"?t.jsx(re,{status:j.status,error:null,retry:j.retry}):j.status==="error"?t.jsx(re,{status:"error",error:j.error,retry:j.retry}):w.length===0&&j.status==="idle"?t.jsx(re,{status:"installing",error:null,retry:j.retry}):w.length>1&&!d?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),w.map(g=>t.jsxs("button",{type:"button",onClick:()=>C(g),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[g.icon?t.jsx("img",{src:g.icon,alt:g.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(F,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:g.title})]},g.id))]}):d?n?t.jsx(lt,{connectionId:d.id,orgId:r.id,orgSlug:r.slug,installation:n,onSelectRepo:g=>T.mutate(g),isSaving:T.isPending,autoRespondEnabled:h,onAutoRespondChange:m,selectedAutomationKeys:x,onAutomationKeysChange:N,hideAutoRespondCheckbox:l}):t.jsx(at,{connectionId:d.id,orgId:r.id,orgSlug:r.slug,onSelect:s,showBackButton:w.length>1,onBack:()=>C(null)}):null}function at(o){const e=$.c(31),{connectionId:n,orgId:s,orgSlug:l,onSelect:i,showBackButton:r,onBack:f}=o;let b;e[0]!==s||e[1]!==l?(b={connectionId:ce,orgId:s,orgSlug:l},e[0]=s,e[1]=l,e[2]=b):b=e[2];const a=H(b);let C;e[3]!==n||e[4]!==s?(C=U.githubUserOrgs(s,n),e[3]=n,e[4]=s,e[5]=C):C=e[5];let h;e[6]!==n||e[7]!==a?(h=()=>Ee(c=>a.callTool(c),n),e[6]=n,e[7]=a,e[8]=h):h=e[8];let m;e[9]!==C||e[10]!==h?(m={queryKey:C,queryFn:h},e[9]=C,e[10]=h,e[11]=m):m=e[11];const x=xe(m);if(x.isLoading){let c;return e[12]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Y,{size:18,className:"animate-spin text-muted-foreground"})}),e[12]=c):c=e[12],c}if(x.isError){let c;return e[13]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"})}),e[13]=c):c=e[13],c}const N=x.data;if(!N)return null;let y;e[14]!==f||e[15]!==r?(y=r&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:f,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ue,{size:12}),"Change connection"]})}),e[14]=f,e[15]=r,e[16]=y):y=e[16];let p;if(e[17]!==N.installations||e[18]!==i){let c;e[20]!==i?(c=v=>t.jsxs("button",{type:"button",onClick:()=>i(v),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:v.avatarUrl,alt:v.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:v.login}),v.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},v.installationId),e[20]=i,e[21]=c):c=e[21],p=N.installations.map(c),e[17]=N.installations,e[18]=i,e[19]=p}else p=e[19];let I;e[22]!==p?(I=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:p}),e[22]=p,e[23]=I):I=e[23];const w=N.appSlug?`https://github.com/apps/${N.appSlug}/installations/new`:"https://github.com/settings/installations";let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[24]=j):j=e[24];let d;e[25]!==w?(d=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",j]})}),e[25]=w,e[26]=d):d=e[26];let S;return e[27]!==d||e[28]!==y||e[29]!==I?(S=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[y,I,d]}),e[27]=d,e[28]=y,e[29]=I,e[30]=S):S=e[30],S}function lt(o){const e=$.c(27),{connectionId:n,orgId:s,orgSlug:l,installation:i,onSelectRepo:r,isSaving:f,autoRespondEnabled:b,onAutoRespondChange:a,selectedAutomationKeys:C,onAutomationKeysChange:h,hideAutoRespondCheckbox:m}=o,[x,N]=L.useState(""),y=ot(x,300),p=L.useDeferredValue(y),I=x!==p;let w;e[0]!==I||e[1]!==x?(w=t.jsx(je,{placeholder:"Search repositories...",value:x,onChange:N,isSearching:I}),e[0]=I,e[1]=x,e[2]=w):w=e[2];const j=I?"opacity-40":"opacity-100";let d;e[3]!==j?(d=V("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",j),e[3]=j,e[4]=d):d=e[4];let S;e[5]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Y,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=S):S=e[5];let c;e[6]!==n||e[7]!==p||e[8]!==i||e[9]!==f||e[10]!==r||e[11]!==s||e[12]!==l?(c=t.jsx(L.Suspense,{fallback:S,children:t.jsx(ct,{connectionId:n,orgId:s,orgSlug:l,installation:i,query:p,onSelectRepo:r,isSaving:f})}),e[6]=n,e[7]=p,e[8]=i,e[9]=f,e[10]=r,e[11]=s,e[12]=l,e[13]=c):c=e[13];let v;e[14]!==d||e[15]!==c?(v=t.jsx("div",{className:d,children:c}),e[14]=d,e[15]=c,e[16]=v):v=e[16];let O;e[17]!==b||e[18]!==m||e[19]!==a||e[20]!==h||e[21]!==C?(O=!m&&t.jsxs("div",{className:"border-t border-border shrink-0",children:[t.jsxs("label",{className:"flex items-center gap-2 px-4 py-3 cursor-pointer select-none",children:[t.jsx(pe,{checked:b,onCheckedChange:T=>a(T===!0)}),t.jsx("span",{className:"text-xs text-foreground",children:"Set up GitHub automations for this repo"})]}),b&&t.jsx("div",{className:"px-4 pb-3 pl-9 flex flex-col gap-1.5",children:Q.map(T=>t.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[t.jsx(pe,{checked:C.has(T.key),onCheckedChange:g=>{const k=new Set(C);g===!0?k.add(T.key):k.delete(T.key),h(k)}}),t.jsx("span",{className:"text-xs text-muted-foreground",children:T.label})]},T.key))})]}),e[17]=b,e[18]=m,e[19]=a,e[20]=h,e[21]=C,e[22]=O):O=e[22];let A;return e[23]!==w||e[24]!==v||e[25]!==O?(A=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[w,v,O]}),e[23]=w,e[24]=v,e[25]=O,e[26]=A):A=e[26],A}function ct(o){const e=$.c(29),{connectionId:n,orgId:s,orgSlug:l,installation:i,query:r,onSelectRepo:f,isSaving:b}=o;let a;e[0]!==n||e[1]!==s||e[2]!==l?(a={connectionId:n,orgId:s,orgSlug:l},e[0]=n,e[1]=s,e[2]=l,e[3]=a):a=e[3];const C=H(a),h=i.type==="User"?"user":"org",m=r?`${h}:${i.login} ${r} in:name`:`${h}:${i.login}`;let x;e[4]!==n||e[5]!==i.login||e[6]!==s||e[7]!==r?(x=U.githubOrgRepos(s,n,i.login,r),e[4]=n,e[5]=i.login,e[6]=s,e[7]=r,e[8]=x):x=e[8];let N;e[9]!==C||e[10]!==m?(N=async j=>{const{signal:d}=j,c=(await C.callTool({name:"search_repositories",arguments:{query:m,page:1,perPage:30}},void 0,{signal:d})).content?.[0]?.text;if(!c)throw new Error("No response from search_repositories");return(JSON.parse(c).items??[]).map(ut)},e[9]=C,e[10]=m,e[11]=N):N=e[11];let y;e[12]!==x||e[13]!==N?(y={queryKey:x,queryFn:N},e[12]=x,e[13]=N,e[14]=y):y=e[14];const{data:p}=Ae(y);if(p.length===0){let j;e[15]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=j):j=e[15];let d;e[16]!==r?(d=r&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=r,e[17]=d):d=e[17];let S;return e[18]!==d?(S=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[j,d]}),e[18]=d,e[19]=S):S=e[19],S}let I;if(e[20]!==b||e[21]!==f||e[22]!==p){let j;e[24]!==b||e[25]!==f?(j=d=>t.jsxs("button",{type:"button",onClick:()=>f(d),disabled:b,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(F,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:d.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[d.private?t.jsx(Oe,{size:10}):t.jsx(He,{size:10}),d.private?"Private":"Public"]})]},d.fullName),e[24]=b,e[25]=f,e[26]=j):j=e[26],I=p.map(j),e[20]=b,e[21]=f,e[22]=p,e[23]=I}else I=e[23];let w;return e[27]!==I?(w=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:I}),e[27]=I,e[28]=w):w=e[28],w}function ut(o){return{name:o.name,fullName:o.full_name,owner:o.full_name.split("/")[0]??"",url:o.html_url,private:o.private,description:o.description,updatedAt:o.updated_at}}function re(o){const e=$.c(33),{status:n,error:s,retry:l}=o;if(n==="error"){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(F,{className:"size-5 text-destructive"})}),e[0]=c):c=e[0];let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=v):v=e[1];const O=s??"Something went wrong while connecting to GitHub.";let A;e[2]!==O?(A=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[v,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:O})]}),e[2]=O,e[3]=A):A=e[3];let T;e[4]!==l?(T=t.jsx("button",{type:"button",onClick:l,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=l,e[5]=T):T=e[5];let g;return e[6]!==A||e[7]!==T?(g=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[c,A,T]}),e[6]=A,e[7]=T,e[8]=g):g=e[8],g}const i=n==="authenticating";let r;e[9]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(F,{className:"size-5 text-foreground"})}),e[9]=r):r=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsxs("div",{className:"relative size-10",children:[r,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(Y,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=f):f=e[10];const b=i?"Authenticating with GitHub":"Setting up GitHub";let a;e[11]!==b?(a=t.jsx("p",{className:"text-sm font-medium",children:b}),e[11]=b,e[12]=a):a=e[12];const C=i?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let h;e[13]!==C?(h=t.jsx("p",{className:"text-xs text-muted-foreground",children:C}),e[13]=C,e[14]=h):h=e[14];let m;e[15]!==a||e[16]!==h?(m=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[a,h]}),e[15]=a,e[16]=h,e[17]=m):m=e[17];const x=i?"bg-muted-foreground/30":"bg-foreground animate-pulse";let N;e[18]!==x?(N=V("size-1.5 rounded-full",x),e[18]=x,e[19]=N):N=e[19];let y;e[20]!==N?(y=t.jsx("span",{className:N}),e[20]=N,e[21]=y):y=e[21];const p=i?"bg-foreground animate-pulse":"bg-muted-foreground/30";let I;e[22]!==p?(I=V("size-1.5 rounded-full",p),e[22]=p,e[23]=I):I=e[23];let w;e[24]!==I?(w=t.jsx("span",{className:I}),e[24]=I,e[25]=w):w=e[25];let j;e[26]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=j):j=e[26];let d;e[27]!==y||e[28]!==w?(d=t.jsxs("div",{className:"flex items-center gap-1.5",children:[y,w,j]}),e[27]=y,e[28]=w,e[29]=d):d=e[29];let S;return e[30]!==d||e[31]!==m?(S=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[f,m,d]}),e[30]=d,e[31]=m,e[32]=S):S=e[32],S}export{F as G,jt as H,vt as I,Fe as S,Nt as W,Et as a,St as u};
@@ -1 +0,0 @@
1
- import{e as k,j as o,p as T,r as N,O as D}from"./index-CpG2_v8p.js";import{u as z,S as E,a as I,b as L}from"./sidebar-DceLItg8.js";import{T as M,a as O,b as A,u as P}from"./tooltip-D5r7nYKO.js";import{S as $,a as W,b as B}from"./shell-route-loading-DCVHDrWy.js";import{u as X,C as H}from"./chat-context-BoAn6xWM.js";import{T as F}from"./tab-id-Cgg9_UqF.js";import{i as q}from"./Monitor01-CsSfQSQt.js";import{v as G,C as K}from"./connect-desktop-dialog-BIhfHnnr.js";import{T as Y,a as b}from"./toolbar-CXAxzeUh.js";import{S as U,M as J}from"./shell-controls-URBQR3Oa.js";import"./LayoutLeft-CJ48TbRA.js";import"./sheet-BlMfZj2L.js";import"./X-CRg5TH_Y.js";import"./useRouterState-BIyanAgq.js";import"./ZoomOut-zDFXRspK.js";import"./skeleton-07IZijZM.js";import"./popover-w66kr7qI.js";import"./drawer-BLGCEP9S.js";import"./SearchMd-BVJBwCEd.js";import"./Star01-4yFjK6bh.js";import"./Plus-CTho-g8m.js";import"./use-mcp-client-BDuQ-DKr.js";import"./use-virtual-mcp-BOy7A3-I.js";import"./use-collections-dzWuZTM5.js";import"./use-create-virtual-mcp-Dz02gDB8.js";import"./use-navigate-to-agent-CLdhXO-i.js";import"./github-repo-picker-BJ45Iuw_.js";import"./use-connection-CbBvGv-y.js";import"./dialog-DzWL-NrT.js";import"./RefreshCcw01-D1X4YmG3.js";import"./collection-search-Bk4YcOKu.js";import"./checkbox-C5cEV_DH.js";import"./Check-DZ5PZYLO.js";import"./agent-icon-C_8D2J-7.js";import"./AlertCircle-CIkJ_tva.js";import"./Tool01-BxT6lP7E.js";import"./SwitchHorizontal01-Bsjx9paN.js";import"./XCircle-DkwGk6Y1.js";import"./ArrowUpRight-DjtsYmlk.js";import"./ZapSquare-BqiIusHB.js";import"./Users03-DT_R5tz6.js";import"./CheckCircle-DyJzuYoS.js";import"./ChevronDown-CGeYjJAK.js";import"./ChevronLeft-DWiixe45.js";import"./ChevronRight-Bm_e-tIB.js";import"./ChevronUp-BCv26pBY.js";import"./DotsVertical-CqB_Aadi.js";import"./Container-DNJNU1b4.js";import"./Eye-MkeUTfT3.js";import"./Globe01-xZhhj276.js";import"./FilterLines-CfVg89f7.js";import"./Palette-CmO3ZuPu.js";import"./HardDrive-CtdIy8yR.js";import"./Stars02-BLn35DBB.js";import"./Key01-CXIWciFj.js";import"./LinkExternal01-Bi6In-BW.js";import"./Sun-FelsR2hx.js";import"./Play-CQ97sIka.js";import"./Settings02-Cqx4N2is.js";import"./Shield01-D5OMek_B.js";import"./Stars01-DWbsIFJF.js";import"./Trash01-BczIIm5v.js";import"./Upload01-nIFiyRcG.js";import"./User01-CamUMrWb.js";import"./Users01-CgFieXMp.js";import"./XClose-D72Lt3NI.js";import"./Zap-B-Fg7TEp.js";import"./use-mcp-tools-xqS_ta53.js";import"./extract-connection-data-DzgWcXVA.js";import"./generate-id-DOxNmKSl.js";import"./collections-CG_8shjq.js";import"./shell-layout-NuYzN-Gn.js";import"./avatar-Bf_YMKWh.js";import"./required-auth-layout-CzrHHdU9.js";import"./use-organization-settings-ofRxNgFR.js";import"./use-org-sso-BO0DGPVQ.js";import"./alert-dialog-CbYM4jmz.js";import"./form-DK41bruw.js";import"./label-BD30ND7M.js";import"./input-BWjbzzQM.js";import"./spinner-B8QiOf4h.js";import"./index-CghQMTVW.js";import"./sortable.esm-CzY2WOGE.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-B1-pvTAQ.js";import"./use-registry-connections-Clpq_83P.js";import"./useInfiniteQuery-BA4Q5DOk.js";import"./infiniteQueryObserver-DKFzmh7N.js";import"./card-CWqz0DaV.js";import"./integration-icon-Jhe4mXPc.js";import"./collection-tabs-CSSbV4je.js";import"./badge-Di1xo__6.js";import"./select-B0qONt_m.js";import"./textarea-CgmDS1mc.js";import"./connection-form-helpers-oVYdKzFk.js";import"./use-infinite-scroll-Dz0Ju18S.js";import"./useSuspenseInfiniteQuery-PHI3OnKC.js";import"./use-ai-providers-BMK8G5pd.js";import"./command-CFpCNmCF.js";import"./index-rP7Vi9h6.js";import"./studio-tools-Cly5ZCG3.js";import"./use-org-auth-client-BwDW-s0s.js";import"./hover-card-C0gmU-KR.js";import"./task-status-F5X71Or6.js";import"./use-clock-tick-Dkz_tj-X.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./decopilot-sse-pool-CJ_QbSiL.js";import"./create-sse-subscription-BS5983N4.js";function Q(e){const t=k.c(5),{onPointerDown:r,onDoubleClick:d}=e,{state:f,isMobile:u}=z();if(u||f==="collapsed")return null;let s,n;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={left:"var(--sidebar-width)"},n=o.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),t[0]=s,t[1]=n):(s=t[0],n=t[1]);let i;return t[2]!==d||t[3]!==r?(i=o.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:r,onDoubleClick:d,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:s,children:n}),t[2]=d,t[3]=r,t[4]=i):i=t[4],i}const R=240,V=400,Z="sidebar.width";function _(e){return Math.max(R,Math.min(V,e))}function ee(){const e=k.c(11),[t,r]=T(Z,te),d=N.useRef(null);let f;e[0]!==r||e[1]!==t?(f=a=>{a.preventDefault();const m=a.clientX,p=_(t),c=d.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),h=c?Array.from(c.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const x of h)x.style.transition="none";const j=x=>{const g=_(p+(x.clientX-m));c?.style.setProperty("--sidebar-width",`${g}px`)},S=x=>{const g=_(p+(x.clientX-m));r(g);for(const v of h)v.style.transition="";window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",S),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",j),window.addEventListener("pointerup",S)},e[0]=r,e[1]=t,e[2]=f):f=e[2];const u=f;let s;e[3]!==r?(s=()=>{r(R)},e[3]=r,e[4]=s):s=e[4];const n=s;let i;e[5]!==t?(i=_(t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==u||e[8]!==n||e[9]!==i?(l={width:i,wrapperRef:d,onStartResize:u,resetWidth:n},e[7]=u,e[8]=n,e[9]=i,e[10]=l):l=e[10],l}function te(e){return typeof e=="number"?_(e):R}function oe(){const e=k.c(22),t=X(),[r,d]=N.useState(!1);let f;if(e[0]!==t.capabilities||e[1]!==t.hostname||e[2]!==t.machineId||e[3]!==t.online){const j=G(t.capabilities);f=t.online?o.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[o.jsx("span",{className:"font-medium",children:t.hostname??t.machineId??"Desktop linked"}),o.jsx("span",{className:"text-muted-foreground",children:j.length>0?`Available: ${j.join(", ")}`:"No CLI agents detected"})]}):o.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),e[0]=t.capabilities,e[1]=t.hostname,e[2]=t.machineId,e[3]=t.online,e[4]=f}else f=e[4];const u=f;let s;e[5]===Symbol.for("react.memo_cache_sentinel")?(s=()=>d(!0),e[5]=s):s=e[5];const n=t.online?"Desktop linked":"Connect your desktop";let i;e[6]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(q,{size:16}),e[6]=i):i=e[6];let l;e[7]!==t.online?(l=t.online&&o.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[7]=t.online,e[8]=l):l=e[8];let a;e[9]!==n||e[10]!==l?(a=o.jsx(M,{asChild:!0,children:o.jsxs(Y,{onClick:s,"aria-label":n,children:[i,l]})}),e[9]=n,e[10]=l,e[11]=a):a=e[11];let m;e[12]!==u?(m=o.jsx(O,{side:"bottom",children:u}),e[12]=u,e[13]=m):m=e[13];let p;e[14]!==a||e[15]!==m?(p=o.jsxs(A,{children:[a,m]}),e[14]=a,e[15]=m,e[16]=p):p=e[16];let c;e[17]!==r?(c=o.jsx(K,{open:r,onOpenChange:d}),e[17]=r,e[18]=c):c=e[18];let h;return e[19]!==p||e[20]!==c?(h=o.jsxs(o.Fragment,{children:[p,c]}),e[19]=p,e[20]=c,e[21]=h):h=e[21],h}const ie="sidebar.open";function re(){const e=k.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=o.jsx(B,{}),e[0]=t):t=e[0],t}function no(){const e=k.c(26),t=P(),[r,d]=T(ie,!1),{width:f,wrapperRef:u,onStartResize:s,resetWidth:n}=ee();let i,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(b.LogoLink,{}),l=o.jsx(U,{}),e[0]=i,e[1]=l):(i=e[0],l=e[1]);let a,m;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsxs(b.LeftColumn,{children:[i,l,o.jsx("span",{className:"hidden md:contents",children:o.jsx(b.Nav,{})}),o.jsx(b.TogglesSlot,{}),o.jsx(oe,{})]}),m=o.jsx(b.CenterSlot,{}),e[2]=a,e[3]=m):(a=e[2],m=e[3]);let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsxs(b.Header,{children:[a,m,o.jsxs(b.RightColumn,{children:[o.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end",children:o.jsx(b.TabsSlot,{})}),o.jsx(b.RightSlot,{})]})]}),e[4]=p):p=e[4];const c=`${f}px`;let h;e[5]!==c?(h={"--sidebar-width":c,"--sidebar-width-icon":"3.5rem"},e[5]=c,e[6]=h):h=e[6];const j=h;let S;e[7]!==t||e[8]!==s||e[9]!==n?(S=!t&&o.jsxs(o.Fragment,{children:[o.jsx($,{}),o.jsx(Q,{onPointerDown:s,onDoubleClick:n})]}),e[7]=t,e[8]=s,e[9]=n,e[10]=S):S=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x={background:"transparent",containerType:"inline-size"},e[11]=x):x=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(E,{className:"flex flex-col",style:x,children:o.jsx("div",{className:"flex flex-col h-full min-h-0",children:o.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:o.jsx(N.Suspense,{fallback:o.jsx(re,{}),children:o.jsx(D,{})})})})}),e[12]=g):g=e[12];let v;e[13]!==j||e[14]!==S||e[15]!==u?(v=o.jsxs(I,{ref:u,className:"flex-1 bg-sidebar relative min-h-0",style:j,children:[S,g]}),e[13]=j,e[14]=S,e[15]=u,e[16]=v):v=e[16];let y;e[17]!==t?(y=t&&o.jsx(J,{renderSidebar:se}),e[17]=t,e[18]=y):y=e[18];let w;e[19]!==v||e[20]!==y?(w=o.jsx(H,{children:o.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[p,v,y]})}),e[19]=v,e[20]=y,e[21]=w):w=e[21];let C;return e[22]!==d||e[23]!==r||e[24]!==w?(C=o.jsx(F,{children:o.jsx(b.Provider,{children:o.jsx(L,{open:r,onOpenChange:d,children:w})})}),e[22]=d,e[23]=r,e[24]=w,e[25]=C):C=e[25],C}function se(e){const{onClose:t}=e;return o.jsx("div",{className:"flex h-full",children:o.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:o.jsx(W,{onClose:t})})})}export{no as default};