decocms 4.31.0 → 4.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/dist/client/assets/{AlertCircle-DDN3VPgH.js → AlertCircle-Db_5w_pO.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-BABdYIhs.js → ArrowUpRight-B2VxdxbH.js} +1 -1
  3. package/dist/client/assets/{Check-D9pD98TC.js → Check-VVh423TU.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-eA_D0se8.js → CheckCircle-auAoHYRc.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-CEttVXzH.js → ChevronDown-mDFyCzyV.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-CBhPLqlW.js → ChevronRight-Ceh-WF7H.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-DB19PJr3.js → ChevronUp-D03XJ0vS.js} +1 -1
  8. package/dist/client/assets/{Circle-C_Uwaadc.js → Circle-DNMct17O.js} +1 -1
  9. package/dist/client/assets/{Copy01-BqSpo14R.js → Copy01-CuSfBG1R.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-CZx_5q44.js → DotsVertical-Cr4sUrn_.js} +1 -1
  11. package/dist/client/assets/{Eye-2veooEq8.js → Eye-aR-oC6dj.js} +1 -1
  12. package/dist/client/assets/{FilterLines-Bhsdw1Jp.js → FilterLines-Cr2IL8ug.js} +1 -1
  13. package/dist/client/assets/{Globe01-iaaiJTp8.js → Globe01-DkdmhUM8.js} +1 -1
  14. package/dist/client/assets/{Globe04-Pp6spg9P.js → Globe04-TuZvt3ov.js} +1 -1
  15. package/dist/client/assets/{HardDrive-Bc5tB9pN.js → HardDrive-CrxPr3va.js} +1 -1
  16. package/dist/client/assets/{Key01-gZ5RTwBh.js → Key01-CfvrTjDF.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-BSrZgTU6.js → LayoutLeft-Cog6SqwZ.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-DkCU3S9w.js → LinkExternal01-BYpL3ACE.js} +1 -1
  19. package/dist/client/assets/{List-CNqrF6eE.js → List-D5svP-6k.js} +1 -1
  20. package/dist/client/assets/{Loading02-J8un_7vB.js → Loading02-D2Hh17zb.js} +1 -1
  21. package/dist/client/assets/{Monitor01-CgzOVFpb.js → Monitor01-cNkbuWdj.js} +1 -1
  22. package/dist/client/assets/{Palette-BAAsFrJa.js → Palette-Dz_ldMx7.js} +1 -1
  23. package/dist/client/assets/{Play-B5Yd6Z0i.js → Play-CVarwVeR.js} +1 -1
  24. package/dist/client/assets/{Plus-Cn5an5hF.js → Plus-DNCXili3.js} +1 -1
  25. package/dist/client/assets/{SearchLg-lz9lYchG.js → SearchLg-DvsDitCO.js} +1 -1
  26. package/dist/client/assets/{SearchMd-BELaZlqe.js → SearchMd-87dvi4KF.js} +1 -1
  27. package/dist/client/assets/{Settings02-C66CP-6J.js → Settings02-D7asukv0.js} +1 -1
  28. package/dist/client/assets/{Shield01-JdRvk1Dm.js → Shield01-BT2HQXan.js} +1 -1
  29. package/dist/client/assets/{Star01-CI0kjjiv.js → Star01-B90wIaBV.js} +1 -1
  30. package/dist/client/assets/{Stars01-Bu7Nhnx4.js → Stars01-D1lDEQh2.js} +1 -1
  31. package/dist/client/assets/{Stars02-BgcXdOF8.js → Stars02-LnA0-zz4.js} +1 -1
  32. package/dist/client/assets/{Sun-CWVJFGYw.js → Sun-DLqplG3r.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-BR_j_D1S.js → SwitchHorizontal01-C9ua90Hw.js} +1 -1
  34. package/dist/client/assets/{Tool01-BAkx1ZdU.js → Tool01-dGPltLKJ.js} +1 -1
  35. package/dist/client/assets/{Trash01-CVVInA2O.js → Trash01-BJe3gUZc.js} +1 -1
  36. package/dist/client/assets/{Upload01-ByUZD5Uy.js → Upload01-DIYVb8n9.js} +1 -1
  37. package/dist/client/assets/{User01-7q5NgTw9.js → User01-DcNAHFa-.js} +1 -1
  38. package/dist/client/assets/{Users01-BX9kMyjx.js → Users01-q9IKnEsX.js} +1 -1
  39. package/dist/client/assets/{Users03-B6ET39UJ.js → Users03-BMw5o14D.js} +1 -1
  40. package/dist/client/assets/{X-BH6rGAp7.js → X-CYIGv8wX.js} +1 -1
  41. package/dist/client/assets/{XCircle-C44kYn0r.js → XCircle-29rFa-09.js} +1 -1
  42. package/dist/client/assets/{XClose-DjOcr3WE.js → XClose-DT64mUwh.js} +1 -1
  43. package/dist/client/assets/{Zap-kOKl7dUI.js → Zap-Br_Hg1wB.js} +1 -1
  44. package/dist/client/assets/{ZapSquare-ddNKzQhO.js → ZapSquare-0BsdXZY9.js} +1 -1
  45. package/dist/client/assets/{ZoomOut-DJV4-7Wr.js → ZoomOut-Dqj1q_yU.js} +1 -1
  46. package/dist/client/assets/{access-gate-CowGDaFA.js → access-gate-033kBvzX.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-zsBozNm7.js → add-section-modal-DRg-YhLT.js} +1 -1
  48. package/dist/client/assets/{agent-capabilities-jSKruONI.js → agent-capabilities-CRvnIg9m.js} +1 -1
  49. package/dist/client/assets/{agent-icon-DMnz6o4Z.js → agent-icon-EdtPDJXM.js} +1 -1
  50. package/dist/client/assets/{agents-list-B9y6dbW5.js → agents-list-COIOrWTd.js} +1 -1
  51. package/dist/client/assets/{ai-providers-vr0VjD3P.js → ai-providers--C84J8bO.js} +1 -1
  52. package/dist/client/assets/{alert-BDbpZ2FA.js → alert-BG1upMQ5.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-Bp9SnoCg.js → alert-dialog-BbHr6pLd.js} +1 -1
  54. package/dist/client/assets/app-editor-DFt6eACm.js +1 -0
  55. package/dist/client/assets/{auth-Di_P-iCF.js → auth-BEQgA40y.js} +1 -1
  56. package/dist/client/assets/{auth-catchall-BRasVk3i.js → auth-catchall-CfZrCH1R.js} +1 -1
  57. package/dist/client/assets/{auth-entry-BINExPhp.js → auth-entry-Cr25LD_X.js} +1 -1
  58. package/dist/client/assets/{auth-split-layout-D7ralijw.js → auth-split-layout-DSPfwaoV.js} +1 -1
  59. package/dist/client/assets/{authenticate-and-persist-oauth-BFF6bv-w.js → authenticate-and-persist-oauth-nkmQY5vG.js} +1 -1
  60. package/dist/client/assets/{automation-list-row-Bu1WzUZ2.js → automation-list-row-xAynmOqb.js} +1 -1
  61. package/dist/client/assets/{automation-runs-x80BWaX2.js → automation-runs-D98OdVC5.js} +1 -1
  62. package/dist/client/assets/{automations-DzmU3FWb.js → automations-DVf2_2C_.js} +1 -1
  63. package/dist/client/assets/{autosend-LAVMz_8m.js → autosend-REHFoRRR.js} +1 -1
  64. package/dist/client/assets/{avatar-jxHzinps.js → avatar-B2d04wRu.js} +1 -1
  65. package/dist/client/assets/{badge-DWJF1rj3.js → badge-DiKw8RbW.js} +1 -1
  66. package/dist/client/assets/{block-document-zR9sT0LV.js → block-document-CPFtVEpa.js} +1 -1
  67. package/dist/client/assets/{brand-context-CYi6YD9v.js → brand-context-DHN-dSvf.js} +1 -1
  68. package/dist/client/assets/{breadcrumb-CID4x2nt.js → breadcrumb-CC9Gfd5p.js} +1 -1
  69. package/dist/client/assets/{buckets-D6nMzOmj.js → buckets-CKM582z_.js} +1 -1
  70. package/dist/client/assets/{bulk-category-panel-CEKcOqhA.js → bulk-category-panel-B4j7bMVg.js} +1 -1
  71. package/dist/client/assets/{calendar-Chv9-zN_.js → calendar-Dh7ySVQi.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-NwvZgiL0.js → capability-load-error-Dg3eOVDS.js} +1 -1
  73. package/dist/client/assets/{card-CBmF5m-m.js → card-D5CauofV.js} +1 -1
  74. package/dist/client/assets/category-editor-SUwhv1rI.js +1 -0
  75. package/dist/client/assets/{chat-context-ISwsXKv9.js → chat-context-BsRUICZs.js} +1 -1
  76. package/dist/client/assets/{checkbox-DBlqT1WL.js → checkbox-DhHH_mmR.js} +1 -1
  77. package/dist/client/assets/{cli-auth-success-DfURWM00.js → cli-auth-success-NNi-TvQO.js} +1 -1
  78. package/dist/client/assets/collection-detail-L5hLAtjn.js +1 -0
  79. package/dist/client/assets/{collection-display-button-CUzx5aOk.js → collection-display-button-D5THp447.js} +1 -1
  80. package/dist/client/assets/{collection-search-DfEE2GsK.js → collection-search-BgFXdSC0.js} +1 -1
  81. package/dist/client/assets/{collection-table-wrapper-J7LDDNaQ.js → collection-table-wrapper-328T8nSg.js} +1 -1
  82. package/dist/client/assets/{collection-tabs-CrxdsgPv.js → collection-tabs-Cxl16cFM.js} +1 -1
  83. package/dist/client/assets/{command-B6K8iBEi.js → command-Cx8bKs7m.js} +1 -1
  84. package/dist/client/assets/{commerce-onboarding-DVM5ZiJ9.js → commerce-onboarding-DmVh_p0A.js} +1 -1
  85. package/dist/client/assets/config-ByOdiANb.js +1 -0
  86. package/dist/client/assets/{connect-desktop-dialog-C5gWxTfZ.js → connect-desktop-dialog-BWEylyh-.js} +1 -1
  87. package/dist/client/assets/{connection-card-CZxKCMQN.js → connection-card-CmLZ3i0M.js} +1 -1
  88. package/dist/client/assets/{connection-detail-BMQJ5Wiz.js → connection-detail-tk24zTUu.js} +1 -1
  89. package/dist/client/assets/{connection-form-helpers-EFv1AB2t.js → connection-form-helpers-C1s-KSGU.js} +1 -1
  90. package/dist/client/assets/{connections-CDjH9JlJ.js → connections-qp5myPzL.js} +1 -1
  91. package/dist/client/assets/{decopilot-sse-pool-CuiGv1QM.js → decopilot-sse-pool-CiyJzTNT.js} +1 -1
  92. package/dist/client/assets/{dialog-BQdZemDY.js → dialog-BFPr54WG.js} +1 -1
  93. package/dist/client/assets/{domain-settings-WYiwjkZ2.js → domain-settings-DHynySRj.js} +1 -1
  94. package/dist/client/assets/{drawer-CGC9vUmu.js → drawer-DcfPm_vi.js} +1 -1
  95. package/dist/client/assets/{dropdown-menu-p-OE20Zw.js → dropdown-menu-BlfYJTRx.js} +1 -1
  96. package/dist/client/assets/{empty-state-Ccota3IC.js → empty-state-CeXPb2VU.js} +1 -1
  97. package/dist/client/assets/{extract-connection-data-CdJ1S70n.js → extract-connection-data-5BWVDciX.js} +1 -1
  98. package/dist/client/assets/file-explorer-CwWWlUiZ.js +2 -0
  99. package/dist/client/assets/{file-type-icon-DqiLifA7.js → file-type-icon-D2xX1xnm.js} +1 -1
  100. package/dist/client/assets/{files-Bah_SCfU.js → files-Bzd-uxW7.js} +1 -1
  101. package/dist/client/assets/{form-DfINtBPW.js → form-Trt6kqr0.js} +1 -1
  102. package/dist/client/assets/{general-DmA99jX8.js → general-C_FzX3UD.js} +1 -1
  103. package/dist/client/assets/github-repo-picker-CTMAbHxR.js +1 -0
  104. package/dist/client/assets/{hooks-D2FVCNXX.js → hooks-BSiz_AKB.js} +1 -1
  105. package/dist/client/assets/{index-Bcenb0s5.js → index-35Tak7qk.js} +1 -1
  106. package/dist/client/assets/{index-CCgql0MU.js → index-BMxNGICG.js} +1 -1
  107. package/dist/client/assets/{index-l6j2xqWS.js → index-C8Vaq4GI.js} +1 -1
  108. package/dist/client/assets/{index-BahpiC2M.js → index-CLj_5r89.js} +18 -18
  109. package/dist/client/assets/{index-DPa2Fjxz.js → index-CPelPFhM.js} +1 -1
  110. package/dist/client/assets/{index-Ba398iyy.js → index-CfigvylE.js} +1 -1
  111. package/dist/client/assets/{index-CbL4CdsD.js → index-CqLJnBFj.js} +1 -1
  112. package/dist/client/assets/{index-CLnnofn-.js → index-CsAnNpRc.js} +1 -1
  113. package/dist/client/assets/index-Cwk7SIrW.js +1 -0
  114. package/dist/client/assets/{index-tBxjvT4Q.js → index-DtEv5T2k.js} +1 -1
  115. package/dist/client/assets/{index-C0bkN5At.js → index-GJfKnZn_.js} +1 -1
  116. package/dist/client/assets/index-dPmP2Tp4.css +1 -0
  117. package/dist/client/assets/index-g8i--Kvx.js +1 -0
  118. package/dist/client/assets/index-gz1tAOXr.js +519 -0
  119. package/dist/client/assets/{index-redirect-D0g34ndU.js → index-redirect-DDeVol4f.js} +1 -1
  120. package/dist/client/assets/{index-khEoYm7s.js → index-uAuiYVKB.js} +1 -1
  121. package/dist/client/assets/{input-DCvWYNIA.js → input-BdpM0TEL.js} +1 -1
  122. package/dist/client/assets/{integration-icon-BnLYSlPi.js → integration-icon-Bf1Nt7-n.js} +1 -1
  123. package/dist/client/assets/{invite-member-dialog-C9EZLVmA.js → invite-member-dialog-BPpBeslC.js} +1 -1
  124. package/dist/client/assets/{label-B9OlPCFU.js → label-DjarSga4.js} +1 -1
  125. package/dist/client/assets/{login-DBQzDD9i.js → login-DoEfLmln.js} +1 -1
  126. package/dist/client/assets/{mcp-oauth-D6cRXUdj.js → mcp-oauth-DWePFULn.js} +1 -1
  127. package/dist/client/assets/{members-o2e_prd5.js → members-B3B7IloN.js} +1 -1
  128. package/dist/client/assets/{monaco-editor-uei6eymP.js → monaco-editor-D4hwKq5W.js} +1 -1
  129. package/dist/client/assets/{monitoring-stats-row-C_bnkbSi.js → monitoring-stats-row-B7f4HN3G.js} +1 -1
  130. package/dist/client/assets/{oauth-callback-C1JCb0s-.js → oauth-callback-BoH2P_bn.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-ai-provider-D401bSS4.js → oauth-callback-ai-provider-CuMMS3lP.js} +1 -1
  132. package/dist/client/assets/{onboarding-B4W2rpI5.js → onboarding-wUH-DGeU.js} +1 -1
  133. package/dist/client/assets/{org-install-BpJQvOCj.js → org-install-DXT9J0I8.js} +1 -1
  134. package/dist/client/assets/{org-layout-DrOqQxU3.js → org-layout-BrLrP4eq.js} +1 -1
  135. package/dist/client/assets/{organization-choice-v8VQ90gJ.js → organization-choice-C6lztIt3.js} +1 -1
  136. package/dist/client/assets/{page-seo-form-BbHa2hSM.js → page-seo-form-DQA0wg3R.js} +1 -1
  137. package/dist/client/assets/page-seo-sheet-DurRfIZb.js +1 -0
  138. package/dist/client/assets/{popover-BLU6o9-K.js → popover-CKlhZKOG.js} +1 -1
  139. package/dist/client/assets/post-editor--rN0Vw5m.js +1 -0
  140. package/dist/client/assets/{primitives-Bl_VoSyu.js → primitives-CAgzIvjA.js} +1 -1
  141. package/dist/client/assets/{profile-BMYDl9Kt.js → profile-CY7AQM7b.js} +1 -1
  142. package/dist/client/assets/project-app-view-CHytmdja.js +1 -0
  143. package/dist/client/assets/record-editor-CNuCZ1ZI.js +1 -0
  144. package/dist/client/assets/registry-BZBmEaE-.js +2 -0
  145. package/dist/client/assets/{registry-layout-CvG6sX0m.js → registry-layout-D25VdidL.js} +1 -1
  146. package/dist/client/assets/{require-capability-CKJDNzAw.js → require-capability-CYDVRBkW.js} +1 -1
  147. package/dist/client/assets/{required-auth-layout-D3BZEQrv.js → required-auth-layout-DGQr874S.js} +1 -1
  148. package/dist/client/assets/{reset-password-BFuPgFz_.js → reset-password-Ci3XAz4n.js} +1 -1
  149. package/dist/client/assets/{roles-4ANLB4UB.js → roles-oTvdi6Hw.js} +1 -1
  150. package/dist/client/assets/{search-input-CTSKqHHp.js → search-input-DJ05ViVl.js} +1 -1
  151. package/dist/client/assets/{secrets-BCo67r-R.js → secrets-HOer9kv3.js} +1 -1
  152. package/dist/client/assets/{sections-editor-DPcDwqoS.js → sections-editor-5ju1cxyx.js} +2 -2
  153. package/dist/client/assets/{select-Bvp0qEbr.js → select-CeXH3gjW.js} +1 -1
  154. package/dist/client/assets/{select-model-DVM5M8H6.js → select-model-DYpThBVD.js} +1 -1
  155. package/dist/client/assets/seo-editor-BIKFI9Fl.js +1 -0
  156. package/dist/client/assets/{settings-layout-QuIh1KuT.js → settings-layout-kdDgoGQC.js} +1 -1
  157. package/dist/client/assets/{settings-section-B2ndiHlo.js → settings-section-CyBwf4qC.js} +1 -1
  158. package/dist/client/assets/{shell-controls-Z5l-bd1U.js → shell-controls-CD6bdY9w.js} +1 -1
  159. package/dist/client/assets/{shell-layout-C6qLFIpM.js → shell-layout-IYwmwgpp.js} +1 -1
  160. package/dist/client/assets/{sidebar-ChHxgM9m.js → sidebar-B_c4VYke.js} +1 -1
  161. package/dist/client/assets/{skeleton-v_XZSYYc.js → skeleton-Dl1AhqdL.js} +1 -1
  162. package/dist/client/assets/{sso-BGRu6zvV.js → sso-1rsjb8hb.js} +1 -1
  163. package/dist/client/assets/{store-CAKjNWnW.js → store-BHrgdJmn.js} +1 -1
  164. package/dist/client/assets/store-registry-B0GhK-Yr.js +2 -0
  165. package/dist/client/assets/{studio-tools-CWpmP6KM.js → studio-tools-F5G0urN7.js} +1 -1
  166. package/dist/client/assets/{switch-yI9gdvWp.js → switch-B9wSH4oe.js} +1 -1
  167. package/dist/client/assets/{tab-id-yjGvxWDL.js → tab-id-DznSzCvK.js} +1 -1
  168. package/dist/client/assets/{table-YAS6wtBG.js → table-C2Aqsz0m.js} +1 -1
  169. package/dist/client/assets/{tabs-Dt4ufEhX.js → tabs-W14caGou.js} +1 -1
  170. package/dist/client/assets/{textarea-DCN5TwaT.js → textarea-ConjZ7fN.js} +1 -1
  171. package/dist/client/assets/{toggle-group-CnMNmD9w.js → toggle-group-CYFywiUW.js} +1 -1
  172. package/dist/client/assets/{toolbar-Bw9zu9WL.js → toolbar-DR2I0_KA.js} +1 -1
  173. package/dist/client/assets/{toolbar-icon-button-D-LZYEgI.js → toolbar-icon-button-Cf6OwFTU.js} +1 -1
  174. package/dist/client/assets/{tools-list-D9OxMY8P.js → tools-list-DL49NRaT.js} +1 -1
  175. package/dist/client/assets/{tooltip-s6_x3f9a.js → tooltip-C51X6QKO.js} +1 -1
  176. package/dist/client/assets/{types-uVqvyouI.js → types-C0d4Ohpx.js} +1 -1
  177. package/dist/client/assets/{use-ai-providers-B2zGkuJg.js → use-ai-providers-BqQDQsEQ.js} +1 -1
  178. package/dist/client/assets/{use-automations-B6grDoMr.js → use-automations-tqGwPES0.js} +1 -1
  179. package/dist/client/assets/{use-capability-B-obK3ST.js → use-capability-CqEMs0z_.js} +1 -1
  180. package/dist/client/assets/{use-clock-tick-zj_1xbt5.js → use-clock-tick-Bz8Z9860.js} +1 -1
  181. package/dist/client/assets/{use-collections-Dd1RRH7k.js → use-collections-Y12o4qWE.js} +1 -1
  182. package/dist/client/assets/{use-connection-C-rUOOpn.js → use-connection-D5Vs5qOp.js} +1 -1
  183. package/dist/client/assets/{use-copy-CsNZH-9d.js → use-copy-Dc9VZjfD.js} +1 -1
  184. package/dist/client/assets/use-create-virtual-mcp-fbAeF2Sf.js +1 -0
  185. package/dist/client/assets/{use-debounced-autosave-Cp27TV8M.js → use-debounced-autosave-BPwP00mx.js} +1 -1
  186. package/dist/client/assets/{use-debounced-value-96swwTPW.js → use-debounced-value-DfUpwXh9.js} +1 -1
  187. package/dist/client/assets/{use-decopilot-events-CWlF2oHq.js → use-decopilot-events-C70DCxcq.js} +1 -1
  188. package/dist/client/assets/{use-delete-connection-CzdQPkHs.js → use-delete-connection-BBFdYZGQ.js} +1 -1
  189. package/dist/client/assets/{use-file-configs-DvpZmtIS.js → use-file-configs-DGZxsbJi.js} +1 -1
  190. package/dist/client/assets/{use-infinite-scroll-DxHNeSQt.js → use-infinite-scroll-BU44dmI-.js} +1 -1
  191. package/dist/client/assets/{use-join-requests-Dmnq5J5S.js → use-join-requests-DyX59dkl.js} +1 -1
  192. package/dist/client/assets/{use-mcp-client-B6zu078q.js → use-mcp-client-3hG4jk-y.js} +1 -1
  193. package/dist/client/assets/{use-mcp-prompts-DV4jud7n.js → use-mcp-prompts-K_jp9fAb.js} +1 -1
  194. package/dist/client/assets/{use-mcp-tools-Doyc2jlq.js → use-mcp-tools-DkI8MzuJ.js} +1 -1
  195. package/dist/client/assets/{use-members-XIoSlR3f.js → use-members-CcCdz_hQ.js} +1 -1
  196. package/dist/client/assets/{use-mobile-BXNoK8fo.js → use-mobile-BJ6No951.js} +1 -1
  197. package/dist/client/assets/use-navigate-to-agent-CZiiGkPG.js +1 -0
  198. package/dist/client/assets/{use-org-auth-client-CIP8sPzJ.js → use-org-auth-client-B7yAA88H.js} +1 -1
  199. package/dist/client/assets/{use-org-sso-CgrmSiGq.js → use-org-sso-DcXTIOxB.js} +1 -1
  200. package/dist/client/assets/{use-organization-roles-B67g_vGt.js → use-organization-roles-C6Eyg5qk.js} +1 -1
  201. package/dist/client/assets/{use-organization-settings-BLQXB5iH.js → use-organization-settings-BzhOQtxD.js} +1 -1
  202. package/dist/client/assets/{use-registry-connections-6rDSDO_p.js → use-registry-connections-DnT_Dh3O.js} +1 -1
  203. package/dist/client/assets/{use-secrets-OrnCuWHl.js → use-secrets-BBj5PT7D.js} +1 -1
  204. package/dist/client/assets/{use-status-sounds-B8zqs89p.js → use-status-sounds-B0huGKlG.js} +1 -1
  205. package/dist/client/assets/{use-view-mode-DTiLjVq5.js → use-view-mode-BL1OAyYV.js} +1 -1
  206. package/dist/client/assets/{use-virtual-mcp-Yg3Ni3JK.js → use-virtual-mcp-D3UxifiP.js} +1 -1
  207. package/dist/client/assets/useInfiniteQuery-8DjDwhQn.js +1 -0
  208. package/dist/client/assets/useSuspenseInfiniteQuery-BYjapKbe.js +1 -0
  209. package/dist/client/assets/{variant-calendar-BTQM7z3g.js → variant-calendar-Dx_VP5De.js} +1 -1
  210. package/dist/client/assets/{view-mode-toggle-B7w106-1.js → view-mode-toggle-DFM8ec78.js} +1 -1
  211. package/dist/client/index.html +2 -2
  212. package/dist/server/cli.js +1 -1
  213. package/dist/server/server.js +1 -1
  214. package/package.json +1 -1
  215. package/dist/client/assets/app-editor-BSFhGDxE.js +0 -1
  216. package/dist/client/assets/category-editor-D6BSL4oe.js +0 -1
  217. package/dist/client/assets/collection-detail-CNqIpkN1.js +0 -1
  218. package/dist/client/assets/file-explorer-BOc6SGhJ.js +0 -2
  219. package/dist/client/assets/github-repo-picker-DwvAhon6.js +0 -1
  220. package/dist/client/assets/index-BYSbf1og.css +0 -1
  221. package/dist/client/assets/index-BvtQ5hoD.js +0 -519
  222. package/dist/client/assets/index-DY0If5q0.js +0 -1
  223. package/dist/client/assets/index-Du1UcWzl.js +0 -1
  224. package/dist/client/assets/page-seo-sheet-ie-UStog.js +0 -1
  225. package/dist/client/assets/post-editor-BMz2I1ZM.js +0 -1
  226. package/dist/client/assets/project-app-view-ZWbZ9H90.js +0 -1
  227. package/dist/client/assets/record-editor-Dvckn3c6.js +0 -1
  228. package/dist/client/assets/registry-OZ9XyjaI.js +0 -2
  229. package/dist/client/assets/seo-editor-DR7IbWtS.js +0 -1
  230. package/dist/client/assets/store-registry-E_hI4lyR.js +0 -2
  231. package/dist/client/assets/use-create-virtual-mcp-Bb67U94y.js +0 -1
  232. package/dist/client/assets/use-navigate-to-agent-DMVkXcE5.js +0 -1
  233. package/dist/client/assets/useInfiniteQuery-CsANrC6N.js +0 -1
  234. package/dist/client/assets/useSuspenseInfiniteQuery-dATP5Fxl.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decocms",
3
- "version": "4.31.0",
3
+ "version": "4.32.0",
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{c as ye,r as w,j as o,l as ge,t as ue,i as Se}from"./index-BahpiC2M.js";import{i as _e}from"./ChevronRight-CBhPLqlW.js";import{A as je}from"./automation-runs-x80BWaX2.js";import{A as ke}from"./add-section-modal-zsBozNm7.js";import{aC as Be,aD as we,aE as Ae,x as Ne,y as Ce,aF as Re,ac as Ee,aG as Ke,as as Fe}from"./index-BvtQ5hoD.js";import"./select-Bvp0qEbr.js";import"./tooltip-s6_x3f9a.js";import"./Check-D9pD98TC.js";import"./ChevronDown-CEttVXzH.js";import"./ChevronUp-DB19PJr3.js";import"./useInfiniteQuery-CsANrC6N.js";import"./use-infinite-scroll-DxHNeSQt.js";import"./use-connection-C-rUOOpn.js";import"./use-collections-Dd1RRH7k.js";import"./use-mcp-client-B6zu078q.js";import"./constants-B72Xmt_K.js";import"./auth-Di_P-iCF.js";import"./use-virtual-mcp-Yg3Ni3JK.js";import"./card-CBmF5m-m.js";import"./sidebar-ChHxgM9m.js";import"./LayoutLeft-BSrZgTU6.js";import"./use-mobile-BXNoK8fo.js";import"./X-BH6rGAp7.js";import"./table-YAS6wtBG.js";import"./empty-state-Ccota3IC.js";import"./use-members-XIoSlR3f.js";import"./use-org-auth-client-CIP8sPzJ.js";import"./use-clock-tick-zj_1xbt5.js";import"./AlertCircle-DDN3VPgH.js";import"./CheckCircle-eA_D0se8.js";import"./Circle-C_Uwaadc.js";import"./agent-icon-DMnz6o4Z.js";import"./Tool01-BAkx1ZdU.js";import"./SwitchHorizontal01-BR_j_D1S.js";import"./Settings02-C66CP-6J.js";import"./XCircle-C44kYn0r.js";import"./ArrowUpRight-BABdYIhs.js";import"./ZapSquare-ddNKzQhO.js";import"./Users03-B6ET39UJ.js";import"./Loading02-J8un_7vB.js";import"./Stars02-BgcXdOF8.js";import"./Copy01-BqSpo14R.js";import"./ZoomOut-DJV4-7Wr.js";import"./DotsVertical-CZx_5q44.js";import"./Globe01-iaaiJTp8.js";import"./Eye-2veooEq8.js";import"./FilterLines-Bhsdw1Jp.js";import"./Star01-CI0kjjiv.js";import"./Globe04-Pp6spg9P.js";import"./HardDrive-Bc5tB9pN.js";import"./Key01-gZ5RTwBh.js";import"./LinkExternal01-DkCU3S9w.js";import"./List-CNqrF6eE.js";import"./Monitor01-CgzOVFpb.js";import"./Sun-CWVJFGYw.js";import"./Palette-BAAsFrJa.js";import"./Play-B5Yd6Z0i.js";import"./Plus-Cn5an5hF.js";import"./SearchLg-lz9lYchG.js";import"./SearchMd-BELaZlqe.js";import"./Shield01-JdRvk1Dm.js";import"./Stars01-Bu7Nhnx4.js";import"./Trash01-CVVInA2O.js";import"./Upload01-ByUZD5Uy.js";import"./User01-7q5NgTw9.js";import"./Users01-BX9kMyjx.js";import"./XClose-DjOcr3WE.js";import"./Zap-kOKl7dUI.js";import"./use-automations-B6grDoMr.js";import"./studio-tools-CWpmP6KM.js";import"./useSuspenseInfiniteQuery-dATP5Fxl.js";import"./badge-DWJF1rj3.js";import"./checkbox-DBlqT1WL.js";import"./command-B6K8iBEi.js";import"./index-DPa2Fjxz.js";import"./dialog-BQdZemDY.js";import"./popover-BLU6o9-K.js";import"./avatar-jxHzinps.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CsNZH-9d.js";import"./file-type-icon-DqiLifA7.js";import"./tab-id-yjGvxWDL.js";import"./monaco-editor-uei6eymP.js";import"./index-Ba398iyy.js";import"./chat-context-ISwsXKv9.js";import"./autosend-LAVMz_8m.js";import"./hooks-D2FVCNXX.js";import"./decopilot-sse-pool-CuiGv1QM.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-B2zGkuJg.js";import"./use-decopilot-events-CWlF2oHq.js";import"./use-organization-settings-BLQXB5iH.js";import"./types-uVqvyouI.js";import"./shell-layout-C6qLFIpM.js";import"./alert-dialog-Bp9SnoCg.js";import"./required-auth-layout-D3BZEQrv.js";import"./use-org-sso-CgrmSiGq.js";import"./integration-icon-BnLYSlPi.js";import"./use-navigate-to-agent-DMVkXcE5.js";import"./reusable-new-chat-qqWu133U.js";import"./use-mcp-prompts-DV4jud7n.js";import"./form-DfINtBPW.js";import"./label-B9OlPCFU.js";import"./input-DCvWYNIA.js";import"./drawer-CGC9vUmu.js";import"./collection-search-DfEE2GsK.js";import"./tabs-Dt4ufEhX.js";import"./toggle-group-CnMNmD9w.js";import"./agent-capabilities-jSKruONI.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CZxKCMQN.js";import"./use-registry-connections-6rDSDO_p.js";import"./extract-connection-data-CdJ1S70n.js";import"./collection-tabs-CrxdsgPv.js";import"./textarea-DCN5TwaT.js";import"./connection-form-helpers-EFv1AB2t.js";import"./authenticate-and-persist-oauth-BFF6bv-w.js";import"./mcp-oauth-D6cRXUdj.js";import"./connect-desktop-dialog-C5gWxTfZ.js";import"./select-model-DVM5M8H6.js";import"./skeleton-v_XZSYYc.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B2ndiHlo.js";import"./dropdown-menu-p-OE20Zw.js";import"./index-CLnnofn-.js";import"./toolbar-Bw9zu9WL.js";import"./use-debounced-value-96swwTPW.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-B8zqs89p.js";import"./use-mcp-tools-Doyc2jlq.js";import"./use-capability-B-obK3ST.js";import"./tools-list-D9OxMY8P.js";import"./switch-yI9gdvWp.js";import"./use-debounced-autosave-Cp27TV8M.js";import"./index-CCgql0MU.js";import"./search-input-CTSKqHHp.js";import"./github-repo-picker-DwvAhon6.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-OrnCuWHl.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./toolbar-icon-button-D-LZYEgI.js";import"./calendar-Chv9-zN_.js";import"./use-file-configs-DvpZmtIS.js";import"./automation-list-row-Bu1WzUZ2.js";function Te(l,e){const s=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",a=Be(e,f);return{blockKey:a,data:{__resolveType:l.resolveType,name:a}}}function _r(l){const e=ye.c(77),{orgSlug:s,virtualMcpId:f,branch:a,blockKey:i,block:n,meta:m,decofile:c,title:Z,excludeFields:G,schemaPending:ae,previewBaseUrl:ne}=l,H=ae===void 0?!1:ae,u=ne===void 0?null:ne,x=typeof n?.__resolveType=="string"?n.__resolveType:"";let C;e[0]!==G||e[1]!==m||e[2]!==x?(C=we(x,m,G),e[0]=G,e[1]=m,e[2]=x,e[3]=C):C=e[3];const h=C;let R;e[4]!==h?(R=!!h&&Object.keys(h.properties??{}).length>0,e[4]=h,e[5]=R):R=e[5];const J=R;let E;e[6]!==n||e[7]!==i||e[8]!==m||e[9]!==Z?(E=Z??(n?Ae(i,n,m):i),e[6]=n,e[7]=i,e[8]=m,e[9]=Z,e[10]=E):E=e[10];const v=E;let K;e[11]!==a||e[12]!==s||e[13]!==f?(K={orgSlug:s,virtualMcpId:f,branch:a},e[11]=a,e[12]=s,e[13]=f,e[14]=K):K=e[14];const{save:b,flush:Q,isPending:W}=Ne(K);let F;e[15]!==a||e[16]!==s||e[17]!==f?(F={orgSlug:s,virtualMcpId:f,branch:a},e[15]=a,e[16]=s,e[17]=f,e[18]=F):F=e[18];const X=Ce(F);let T;e[19]!==b?(T=Ee((t,r)=>b(t,r)),e[19]=b,e[20]=T):T=e[20];const Y=T,[he,xe]=w.useState(i),[ee,ce]=w.useState(null),[te,de]=w.useState(0);let $;e[21]===Symbol.for("react.memo_cache_sentinel")?($=[],e[21]=$):$=e[21];const[p,fe]=w.useState($),[oe,re]=w.useState(!1),P=w.useRef(null);he!==i&&(xe(i),ce(null),de(Pe),fe([]));let O;e[22]!==n?(O=n??{},e[22]=n,e[23]=O):O=e[23];const ie=O;let y;e[24]!==ee?(y=ee??{},e[24]=ee,e[25]=y):y=e[25];let z;e[26]!==ie||e[27]!==y?(z={...ie,...y},e[26]=ie,e[27]=y,e[28]=z):z=e[28];const me=z;let L;e[29]!==i||e[30]!==x||e[31]!==b?(L=t=>{const r=t;ce(r),b(i,{...r,__resolveType:x})},e[29]=i,e[30]=x,e[31]=b,e[32]=L):L=e[32];const se=L;let V;e[33]===Symbol.for("react.memo_cache_sentinel")?(V=t=>{fe(t)},e[33]=V):V=e[33];const pe=V;let q;e[34]!==c||e[35]!==Q||e[36]!==X?(q=async(t,r)=>{try{const{blockKey:d,data:N}=Te(t,c);await X.mutateAsync({blockKey:d,data:N}),ue.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,be=N instanceof Error?N.message:"Could not add section";throw ue.error(be),N}},e[34]=c,e[35]=Q,e[36]=X,e[37]=q):q=e[37];const g=q;let I;e[38]===Symbol.for("react.memo_cache_sentinel")?(I=t=>{P.current=t.append,re(!0)},e[38]=I):I=e[38];const ve=I;let U;e[39]!==g?(U=async t=>{const r=P.current;if(r)try{await g(t,d=>{r(d),re(!1),P.current=null})}catch{}},e[39]=g,e[40]=U):U=e[40];const le=U;let D;e[41]!==p||e[42]!==v?(D=p.length>0?[v,...p]:[],e[41]=p,e[42]=v,e[43]=D):D=e[43];const A=D;let S;e[44]!==p||e[45]!==A||e[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((t,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(_e,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pe(r===0?[]:Re(p,r)),de($e)},title:t,className:ge("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),e[44]=p,e[45]=A,e[46]=v,e[47]=S):S=e[47];let _;e[48]!==W?(_=o.jsx(Ke,{isPending:W,isError:!1}),e[48]=W,e[49]=_):_=e[49];let j;e[50]!==S||e[51]!==_?(j=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,_]}),e[50]=S,e[51]=_,e[52]=j):j=e[52];let k;e[53]!==i||e[54]!==p||e[55]!==c||e[56]!==me||e[57]!==te||e[58]!==g||e[59]!==se||e[60]!==J||e[61]!==m||e[62]!==u||e[63]!==Y||e[64]!==h||e[65]!==H?(k=o.jsx(je,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(Fe,{schema:h,value:me,onChange:se,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pe,decofile:c,meta:m,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:g,onRequestAddSection:ve},`${i}:${te}`):H?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(Se,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),e[53]=i,e[54]=p,e[55]=c,e[56]=me,e[57]=te,e[58]=g,e[59]=se,e[60]=J,e[61]=m,e[62]=u,e[63]=Y,e[64]=h,e[65]=H,e[66]=k):k=e[66];let B;e[67]!==oe||e[68]!==c||e[69]!==le||e[70]!==m||e[71]!==u?(B=u&&o.jsx(ke,{open:oe,onOpenChange:t=>{re(t),t||(P.current=null)},meta:m,decofile:c,previewBaseUrl:u,onSelect:t=>{le(t)}}),e[67]=oe,e[68]=c,e[69]=le,e[70]=m,e[71]=u,e[72]=B):B=e[72];let M;return e[73]!==j||e[74]!==k||e[75]!==B?(M=o.jsxs("div",{className:"flex h-full flex-col",children:[j,k,B]}),e[73]=j,e[74]=k,e[75]=B,e[76]=M):M=e[76],M}function $e(l){return l+1}function Pe(l){return l+1}export{_r as AppEditor};
@@ -1 +0,0 @@
1
- import{c as q,r as S,l as Q,j as t,B as I,i as V,t as U}from"./index-BahpiC2M.js";import{i as X}from"./XCircle-C44kYn0r.js";import{aG as Y,a9 as T}from"./agent-icon-DMnz6o4Z.js";import{n as Z}from"./LinkExternal01-DkCU3S9w.js";import{f as K,a as _,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-Bp9SnoCg.js";import{I as L}from"./input-DCvWYNIA.js";import{L as G}from"./label-B9OlPCFU.js";import{aH as at,aI as mt,aR as nt,aG as lt,aJ as B,aL as pt,aS as ct}from"./index-BvtQ5hoD.js";import{c as dt,B as ut,a as gt}from"./block-document-zR9sT0LV.js";import{u as xt,s as v,E as ft}from"./primitives-Bl_VoSyu.js";import{t as ht}from"./ChevronDown-CEttVXzH.js";import{J as jt,K as yt,I as vt}from"./automation-runs-x80BWaX2.js";import"./AlertCircle-DDN3VPgH.js";import"./Tool01-BAkx1ZdU.js";import"./SwitchHorizontal01-BR_j_D1S.js";import"./Settings02-C66CP-6J.js";import"./ArrowUpRight-BABdYIhs.js";import"./ZapSquare-ddNKzQhO.js";import"./Users03-B6ET39UJ.js";import"./Loading02-J8un_7vB.js";import"./CheckCircle-eA_D0se8.js";import"./Check-D9pD98TC.js";import"./ChevronRight-CBhPLqlW.js";import"./ChevronUp-DB19PJr3.js";import"./Circle-C_Uwaadc.js";import"./Stars02-BgcXdOF8.js";import"./Copy01-BqSpo14R.js";import"./ZoomOut-DJV4-7Wr.js";import"./DotsVertical-CZx_5q44.js";import"./Globe01-iaaiJTp8.js";import"./Eye-2veooEq8.js";import"./FilterLines-Bhsdw1Jp.js";import"./Star01-CI0kjjiv.js";import"./Globe04-Pp6spg9P.js";import"./HardDrive-Bc5tB9pN.js";import"./Key01-gZ5RTwBh.js";import"./LayoutLeft-BSrZgTU6.js";import"./List-CNqrF6eE.js";import"./Monitor01-CgzOVFpb.js";import"./Sun-CWVJFGYw.js";import"./Palette-BAAsFrJa.js";import"./Play-B5Yd6Z0i.js";import"./Plus-Cn5an5hF.js";import"./SearchLg-lz9lYchG.js";import"./SearchMd-BELaZlqe.js";import"./Shield01-JdRvk1Dm.js";import"./Stars01-Bu7Nhnx4.js";import"./Trash01-CVVInA2O.js";import"./Upload01-ByUZD5Uy.js";import"./User01-7q5NgTw9.js";import"./Users01-BX9kMyjx.js";import"./XClose-DjOcr3WE.js";import"./X-BH6rGAp7.js";import"./Zap-kOKl7dUI.js";import"./chat-context-ISwsXKv9.js";import"./autosend-LAVMz_8m.js";import"./hooks-D2FVCNXX.js";import"./use-mcp-client-B6zu078q.js";import"./constants-B72Xmt_K.js";import"./auth-Di_P-iCF.js";import"./decopilot-sse-pool-CuiGv1QM.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-Yg3Ni3JK.js";import"./use-collections-Dd1RRH7k.js";import"./use-ai-providers-B2zGkuJg.js";import"./studio-tools-CWpmP6KM.js";import"./use-decopilot-events-CWlF2oHq.js";import"./tab-id-yjGvxWDL.js";import"./use-organization-settings-BLQXB5iH.js";import"./tooltip-s6_x3f9a.js";import"./dialog-BQdZemDY.js";import"./drawer-CGC9vUmu.js";import"./collection-search-DfEE2GsK.js";import"./use-mobile-BXNoK8fo.js";import"./use-mcp-prompts-DV4jud7n.js";import"./shell-layout-C6qLFIpM.js";import"./avatar-jxHzinps.js";import"./required-auth-layout-D3BZEQrv.js";import"./use-org-sso-CgrmSiGq.js";import"./form-DfINtBPW.js";import"./select-Bvp0qEbr.js";import"./tabs-Dt4ufEhX.js";import"./toggle-group-CnMNmD9w.js";import"./agent-capabilities-jSKruONI.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CZxKCMQN.js";import"./use-registry-connections-6rDSDO_p.js";import"./use-connection-C-rUOOpn.js";import"./useInfiniteQuery-CsANrC6N.js";import"./use-infinite-scroll-DxHNeSQt.js";import"./extract-connection-data-CdJ1S70n.js";import"./card-CBmF5m-m.js";import"./integration-icon-BnLYSlPi.js";import"./collection-tabs-CrxdsgPv.js";import"./badge-DWJF1rj3.js";import"./textarea-DCN5TwaT.js";import"./connection-form-helpers-EFv1AB2t.js";import"./authenticate-and-persist-oauth-BFF6bv-w.js";import"./mcp-oauth-D6cRXUdj.js";import"./useSuspenseInfiniteQuery-dATP5Fxl.js";import"./connect-desktop-dialog-C5gWxTfZ.js";import"./select-model-DVM5M8H6.js";import"./checkbox-DBlqT1WL.js";import"./skeleton-v_XZSYYc.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B2ndiHlo.js";import"./command-B6K8iBEi.js";import"./index-DPa2Fjxz.js";import"./popover-BLU6o9-K.js";import"./dropdown-menu-p-OE20Zw.js";import"./index-CLnnofn-.js";import"./file-type-icon-DqiLifA7.js";import"./toolbar-Bw9zu9WL.js";import"./use-debounced-value-96swwTPW.js";import"./index-Ba398iyy.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-B8zqs89p.js";import"./empty-state-Ccota3IC.js";import"./use-mcp-tools-Doyc2jlq.js";import"./types-uVqvyouI.js";import"./use-capability-B-obK3ST.js";import"./tools-list-D9OxMY8P.js";import"./switch-yI9gdvWp.js";import"./use-debounced-autosave-Cp27TV8M.js";import"./index-CCgql0MU.js";import"./sidebar-ChHxgM9m.js";import"./search-input-CTSKqHHp.js";import"./github-repo-picker-DwvAhon6.js";import"./use-navigate-to-agent-DMVkXcE5.js";import"./reusable-new-chat-qqWu133U.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-OrnCuWHl.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-members-XIoSlR3f.js";import"./use-org-auth-client-CIP8sPzJ.js";import"./toolbar-icon-button-D-LZYEgI.js";import"./calendar-Chv9-zN_.js";import"./use-file-configs-DvpZmtIS.js";import"./monaco-editor-uei6eymP.js";import"./use-automations-B6grDoMr.js";import"./automation-list-row-Bu1WzUZ2.js";import"./table-YAS6wtBG.js";import"./use-clock-tick-zj_1xbt5.js";import"./format-time-Cy7tTmZp.js";import"./use-copy-CsNZH-9d.js";function bt(k){const e=q.c(18),{icon:f,title:n,defaultOpen:b,children:d}=k,D=b===void 0?!1:b,[x,A]=S.useState(D);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=Q("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(jt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(yt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:x,onOpenChange:A,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function nr({orgSlug:k,virtualMcpId:e,branch:f,blockKey:n,block:b,decofile:d,meta:D,onManagePosts:x,onOpenPost:A,previewBaseUrl:l}){const i=at({orgSlug:k,virtualMcpId:e,branch:f}),h=mt(b,"categories"),[r,p,c]=xt(h,o=>{i.mutate({blockKey:n,data:B(n,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=dt({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[R,j]=S.useState(a),[m,C]=S.useState(null),[N,$]=S.useState(!1),z=a?nt(d).filter(o=>o.categorySlugs.includes(a)):[],y=z.length,H=o=>s("slug",o),J=async(o,w)=>{const W=v(r.name);$(!0);try{let g=0;for(const{key:P,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:W,slug:w});F!==O&&(await i.mutateAsync({blockKey:P,data:B(P,"posts",F)}),g+=1)}const E={...r,slug:w};await i.mutateAsync({blockKey:n,data:B(n,"categories",E)}),c(E),U.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){j(o),C(null),U.error(g instanceof Error?g.message:"Rename failed")}finally{$(!1)}},M=()=>{const o=R.trim();if(o===a){R!==o&&j(o);return}if(!o){j(a);return}if(y===0){H(o);return}C({oldSlug:a,newSlug:o,count:y})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(I,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(ft,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(G,{htmlFor:"category-slug",children:"Slug"}),t.jsx(L,{id:"category-slug",value:R,onChange:o=>j(o.target.value),onBlur:M,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(G,{htmlFor:"category-description",children:"Description"}),t.jsx(L,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(bt,{icon:Y,title:"Content",defaultOpen:!0,children:t.jsx(ut,{value:gt(r.sections),onChange:o=>s("sections",o),meta:D,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[y," ",y===1?"post":"posts"," in this category"]})]}),t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(a),children:["Add posts",t.jsx(X,{size:14})]})]}),y>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:z.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(K,{open:!!m,onOpenChange:o=>{o||N||(j(a),C(null))},children:t.jsxs(_,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&J(m.oldSlug,m.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(V,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{nr as CategoryEditor};
@@ -1 +0,0 @@
1
- import{c as O,j as t,B as F,i as Y,G as Ge,H as te,P as Pe,r as $,Z as re,J as Qe,u as Ye,a7 as K,t as Ze,l as je,e as le,aW as ke}from"./index-BahpiC2M.js";import{E as Ae}from"./empty-state-Ccota3IC.js";import{u as Xe,a as Ee}from"./use-collections-Dd1RRH7k.js";import{u as ae}from"./use-mcp-client-B6zu078q.js";import{F as se,a as et,b as ce,d as de}from"./form-DfINtBPW.js";import{I as me}from"./input-DCvWYNIA.js";import{T as ie}from"./textarea-DCN5TwaT.js";import{a as tt,b as st,V as ue,O as nt,M as ot}from"./index-l6j2xqWS.js";import{aq as it,L as rt,am as lt,$ as at,ac as ct,ar as dt,V as be}from"./agent-icon-DMnz6o4Z.js";import{g as mt,M as ut,a as Ne}from"./types-uVqvyouI.js";import{A as xt,a as pt,b as ft}from"./alert-BDbpZ2FA.js";import{a as ve,c as Se,d as ye,S as we,b as ne}from"./select-Bvp0qEbr.js";import{c as ht,T as Ce,a as Ie,b as $e}from"./tooltip-s6_x3f9a.js";import{i as gt}from"./AlertCircle-DDN3VPgH.js";import{s as jt}from"./Stars02-BgcXdOF8.js";import{a as bt}from"./Copy01-BqSpo14R.js";import{i as Nt}from"./Play-B5Yd6Z0i.js";import{a as Oe,b as Re,B as J,c as G,d as Q,e as _e}from"./breadcrumb-CID4x2nt.js";import{g as vt}from"./connection-slug-eyAPH6o3.js";import{u as St,T as yt}from"./tools-list-D9OxMY8P.js";import{a as De,u as Me}from"./use-connection-C-rUOOpn.js";import{a as wt}from"./use-mcp-tools-Doyc2jlq.js";import{M as Ct,c as It}from"./monaco-editor-uei6eymP.js";import{I as Te}from"./integration-icon-BnLYSlPi.js";import{g as $t,l as Tt}from"./chat-context-ISwsXKv9.js";import{u as Pt}from"./shell-layout-C6qLFIpM.js";import{n as kt}from"./XCircle-C44kYn0r.js";import"./constants-B72Xmt_K.js";import"./auth-Di_P-iCF.js";import"./label-B9OlPCFU.js";import"./index-CCgql0MU.js";import"./sidebar-ChHxgM9m.js";import"./LayoutLeft-BSrZgTU6.js";import"./use-mobile-BXNoK8fo.js";import"./X-BH6rGAp7.js";import"./ZoomOut-DJV4-7Wr.js";import"./Key01-gZ5RTwBh.js";import"./extract-connection-data-CdJ1S70n.js";import"./use-registry-connections-6rDSDO_p.js";import"./use-organization-settings-BLQXB5iH.js";import"./studio-tools-CWpmP6KM.js";import"./Plus-Cn5an5hF.js";import"./index-Bcenb0s5.js";import"./index-tBxjvT4Q.js";import"./index-DPa2Fjxz.js";import"./popover-BLU6o9-K.js";import"./use-virtual-mcp-Yg3Ni3JK.js";import"./Check-D9pD98TC.js";import"./SearchMd-BELaZlqe.js";import"./Users03-B6ET39UJ.js";import"./use-create-virtual-mcp-Bb67U94y.js";import"./use-navigate-to-agent-DMVkXcE5.js";import"./hooks-D2FVCNXX.js";import"./decopilot-sse-pool-CuiGv1QM.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-qqWu133U.js";import"./Tool01-BAkx1ZdU.js";import"./SwitchHorizontal01-BR_j_D1S.js";import"./Settings02-C66CP-6J.js";import"./ArrowUpRight-BABdYIhs.js";import"./ZapSquare-ddNKzQhO.js";import"./Loading02-J8un_7vB.js";import"./CheckCircle-eA_D0se8.js";import"./ChevronDown-CEttVXzH.js";import"./ChevronRight-CBhPLqlW.js";import"./ChevronUp-DB19PJr3.js";import"./Circle-C_Uwaadc.js";import"./DotsVertical-CZx_5q44.js";import"./Globe01-iaaiJTp8.js";import"./Eye-2veooEq8.js";import"./FilterLines-Bhsdw1Jp.js";import"./Star01-CI0kjjiv.js";import"./Globe04-Pp6spg9P.js";import"./HardDrive-Bc5tB9pN.js";import"./LinkExternal01-DkCU3S9w.js";import"./List-CNqrF6eE.js";import"./Monitor01-CgzOVFpb.js";import"./Sun-CWVJFGYw.js";import"./Palette-BAAsFrJa.js";import"./SearchLg-lz9lYchG.js";import"./Shield01-JdRvk1Dm.js";import"./Stars01-Bu7Nhnx4.js";import"./Trash01-CVVInA2O.js";import"./Upload01-ByUZD5Uy.js";import"./User01-7q5NgTw9.js";import"./Users01-BX9kMyjx.js";import"./XClose-DjOcr3WE.js";import"./Zap-kOKl7dUI.js";import"./mcp-oauth-D6cRXUdj.js";import"./badge-DWJF1rj3.js";import"./index-Ba398iyy.js";import"./autosend-LAVMz_8m.js";import"./use-ai-providers-B2zGkuJg.js";import"./use-decopilot-events-CWlF2oHq.js";import"./tab-id-yjGvxWDL.js";import"./avatar-jxHzinps.js";import"./dialog-BQdZemDY.js";import"./alert-dialog-Bp9SnoCg.js";import"./required-auth-layout-D3BZEQrv.js";import"./use-org-sso-CgrmSiGq.js";function At(s){const e=O.c(15),{onSave:r,onUndo:o,isDirty:l,isSaving:i,saveLabel:c,undoLabel:d}=s,n=c===void 0?"Save":c,u=d===void 0?"Undo":d;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(it,{size:14}),e[0]=x):x=e[0];let m;e[1]!==i||e[2]!==o||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:o,disabled:i,"aria-label":u,children:[x,u]}),e[1]=i,e[2]=o,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==i?(p=i?t.jsx(Y,{size:14,className:"animate-spin"}):t.jsx(rt,{size:14}),e[5]=i,e[6]=p):p=e[6];let f;e[7]!==i||e[8]!==r||e[9]!==n||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:r,disabled:i,"aria-label":n,children:[p,n]}),e[7]=i,e[8]=r,e[9]=n,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:te().min(1),description:te().nullable(),body:te()});function oe(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Et(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(o=>o==="mcps"),r=e>=0?s[e+1]:void 0;return r?decodeURIComponent(r):void 0}function Ot(s){const e=O.c(13),{form:r}=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 l;e[1]!==r.control?(l=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:r.control,name:"title",render:Dt}),t.jsx(se,{control:r.control,name:"description",render:_t})]})]}),e[1]=r.control,e[2]=l):l=e[2];let i,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),c=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=i,e[4]=c):(i=e[3],c=e[4]);let d;e[5]!==r.control?(d=t.jsxs("div",{className:"flex flex-col gap-2",children:[i,c,t.jsx(se,{control:r.control,name:"body",render:Rt})]}),e[5]=r.control,e[6]=d):d=e[6];let n;e[7]!==l||e[8]!==d?(n=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:[l,d]}),e[7]=l,e[8]=d,e[9]=n):n=e[9];let u;return e[10]!==r||e[11]!==n?(u=t.jsx(et,{...r,children:n}),e[10]=r,e[11]=n,e[12]=u):u=e[12],u}function Rt(s){const{field:e}=s;return t.jsx(ce,{children:t.jsx(de,{children:t.jsx(ie,{...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 _t(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(de,{children:t.jsx(me,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(de,{children:t.jsx(me,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Mt(s){const e=O.c(36),{providerId:r,promptId:o}=s,{org:l}=re(),i=r||null;let c;e[0]!==l.id||e[1]!==l.slug||e[2]!==i?(c={connectionId:i,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=i,e[3]=c):c=e[3];const d=ae(c),n=Xe(r,"PROMPT",o,d),u=Ee(r,"PROMPT",d),x=u.update.isPending;let m;e[4]!==n?(m=n?{title:n.title,description:n.description??null,body:oe(n)}:void 0,e[4]=n,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==n?(g=()=>{n&&f.reset({title:n.title,description:n.description??null,body:oe(n)})},e[8]=f,e[9]=n,e[10]=g):g=e[10];const S=g;let C;e[11]!==u.update||e[12]!==f||e[13]!==o?(C=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:o,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:oe(A)})}),e[11]=u.update,e[12]=f,e[13]=o,e[14]=C):C=e[14];const R=C;if(!n){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let I;e[16]!==n.title?(I=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[16]=n.title,e[17]=I):I=e[17];let k;e[18]!==n.description?(k=n.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:n.description})]}):null,e[18]=n.description,e[19]=k):k=e[19];let T;e[20]!==I||e[21]!==k?(T=t.jsx(st,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I,k]})}),e[20]=I,e[21]=k,e[22]=T):T=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let y;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(y=t.jsx(tt,{children:t.jsx(At,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=y):y=e[29];let w;e[30]!==f?(w=t.jsx("div",{className:"h-full",children:t.jsx(Ot,{form:f})}),e[30]=f,e[31]=w):w=e[31];let P;return e[32]!==y||e[33]!==w||e[34]!==T?(P=t.jsxs(ue,{children:[T,y,w]}),e[32]=y,e[33]=w,e[34]=T,e[35]=P):P=e[35],P}function zt(s){const e=O.c(4),{itemId:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Et(),e[0]=o):o=e[0];const l=o;if(!l){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=c):c=e[1],c}let i;return e[2]!==r?(i=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:null,children:t.jsx(Mt,{providerId:l,promptId:r})})}),e[2]=r,e[3]=i):i=e[3],i}const Lt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ut(s){const e=O.c(11),{toolName:r,connectionId:o,siblings:l,onSelectInstance:i,onBack:c}=s;let d;e[0]!==o?(d={connectionId:o},e[0]=o,e[1]=d):d=e[1];const n=St(d);if(!n.isAuthenticated){let m;return e[2]!==n.supportsOAuth||e[3]!==c?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:n.supportsOAuth?t.jsx(nt,{onAuthenticate:()=>c(),buttonText:"Go back to authenticate"}):t.jsx(ot,{hasReadme:!1})}),e[2]=n.supportsOAuth,e[3]=c,e[4]=m):m=e[4],m}const u=`${o}:${r}`;let x;return e[5]!==o||e[6]!==i||e[7]!==l||e[8]!==u||e[9]!==r?(x=t.jsx(Bt,{toolName:r,connectionId:o,siblings:l,onSelectInstance:i},u),e[5]=o,e[6]=i,e[7]=l,e[8]=u,e[9]=r,e[10]=x):x=e[10],x}function Bt({toolName:s,connectionId:e,siblings:r,onSelectInstance:o}){const{replayId:l}=Ye({strict:!1}),i=(()=>{if(!l)return null;const a=`replay-${l}`,h=sessionStorage.getItem(a);if(!h)return null;sessionStorage.removeItem(a);try{return JSON.parse(h)}catch{return null}})(),c=(()=>{if(!i)return null;const a={};for(const[h,v]of Object.entries(i))v!==null&&typeof v=="object"?a[h]=JSON.stringify(v,null,2):a[h]=v;return a})(),[d,n]=$.useState(c??{}),[u,x]=$.useState(i?JSON.stringify(i,null,2):"{}"),[m,p]=$.useState(null),[f,g]=$.useState(null),[S,C]=$.useState(null),[R,I]=$.useState(null),[k,T]=$.useState(!1),[b,y]=$.useState(null),{org:w}=re(),P=De(e),N=$t(),A=Tt(),{setChatOpen:U}=Pt(),z=`${e}:${s}`,_=ae({connectionId:e,orgId:w.id,orgSlug:w.slug}),L=wt({client:_}),j=L.data?.tools?.find(a=>a.name===s),E=mt(j?._meta),V=a=>{if(!N)return;const h=It(a.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[D,Z]=$.useState("json"),[ze,Le]=$.useState(!1);E&&!ze&&(Z("ui"),Le(!0));const xe=j?.inputSchema?.properties,pe=xe?Object.keys(xe):[],q=pe.length>0,H={};if(q&&j?.inputSchema?.properties)for(const a of pe)H[a]=j.inputSchema.required?.includes(a)?"":void 0;const X=a=>Object.prototype.hasOwnProperty.call(d,a),Ue=async()=>{T(!0),I(null),p(null),g(null),C(null),y(null);const a=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=q?{...H,...d}:(()=>{const M=u.trim();if(!M)return{};const B=JSON.parse(M);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();q&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([M,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[M]=="string")try{h[M]=JSON.parse(h[M])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[M]=="string"&&h[M]!==""){const ge=Number(h[M]);Number.isNaN(ge)||(h[M]=ge)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),We=Math.round(He-a);p(W),g(v),C(h);const Ke=JSON.stringify(W),he=new TextEncoder().encode(Ke).length;y({duration:`${We}ms`,bytes:`${he} bytes`,tokens:`~${Math.ceil(he/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);I(v||"Unknown error occurred");const W=performance.now();y({duration:`${Math.round(W-a)}ms`})}finally{T(!1)}},ee=(a,h)=>{n(v=>({...v,[a]:h}))},Be=()=>{p(null),g(null),C(null),I(null),y(null)},Fe=j?.name??Lt(s),Ve=t.jsx(Oe,{children:t.jsxs(Re,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections",params:{org:w.slug},children:"Connections"})})}),t.jsx(Q,{}),P&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections/$appSlug",params:{org:w.slug,appSlug:vt(P)},search:{tab:"tools"},children:P.title})})}),t.jsx(Q,{})]}),t.jsx(J,{children:t.jsx(_e,{children:Fe})})]})}),fe=r.length>1&&t.jsxs(ve,{value:e,onValueChange:o,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:r.map(a=>t.jsx(ne,{value:a.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:a.icon,name:a.title,size:"xs",className:"shrink-0"}),a.title]})},a.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"}),j?.inputSchema?.required&&j.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&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([a,h])=>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:[a,j.inputSchema?.required?.includes(a)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(ie,{className:"font-mono text-xs",value:X(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:X(a)?String(d[a]??""):"",onValueChange:v=>ee(a,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(ne,{value:"true",children:"true"}),t.jsx(ne,{value:"false",children:"false"})]})]}):t.jsx(me,{value:X(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a}...`})]},a)):j?.inputSchema&&!q?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(ie,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:a=>x(a.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:k?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(lt,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,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:[b&&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(jt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(at,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),E&&t.jsx(ht,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(dt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(xt,{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(gt,{className:"h-4 w-4"}),t.jsx(pt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ft,{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($.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(ut,{resourceURI:E,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:V,onUpdateModelContext:a=>A?.setAppContext(z,a),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Ct,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{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(m,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(be,{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(ue,{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:P?.icon||null,name:P?.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:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(Y,{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:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(yt,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:fe})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),r.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"}),fe]}),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 Ft(s){const e=O.c(10),{itemId:r,siblings:o,onBack:l}=s,[i,c]=$.useState(o[0]?.id??"");let d;e[0]!==i||e[1]!==o?(d=o.find(p=>p.id===i)?.id??o[0]?.id??"",e[0]=i,e[1]=o,e[2]=d):d=e[2];const n=d;if(!De(n||void 0)||!n){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=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]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==n||e[6]!==l||e[7]!==o||e[8]!==r?(m=t.jsx($.Suspense,{fallback:x,children:t.jsx(Ut,{toolName:r,connectionId:n,siblings:o,onSelectInstance:c,onBack:l})}),e[5]=n,e[6]=l,e[7]=o,e[8]=r,e[9]=m):m=e[9],m}function Vt(s){const e=O.c(21),{icon:r,illustration:o,title:l,description:i,buttonProps:c,buttonComponent:d,className:n,children:u}=s;let x;e[0]!==n?(x=je("flex flex-col items-center justify-center py-16 text-center",n),e[0]=n,e[1]=x):x=e[1];let m;e[2]!==r||e[3]!==o?(m=o?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:o}):r?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:r}):null,e[2]=r,e[3]=o,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==i?(f=i&&t.jsx("div",{className:"text-sm text-muted-foreground",children:i}),e[7]=i,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==d||e[13]!==c?(S=(d??c)&&t.jsx("div",{className:"mt-4",children:d??(c&&t.jsx(F,{size:"sm",className:je(c?.className),...c}))}),e[12]=d,e[13]=c,e[14]=S):S=e[14];let C;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(C=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=C):C=e[20],C}const Jt={prompt:zt};function qt(){const s=O.c(9),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.itemId);let i;s[1]!==o.appSlug?(i={slug:o.appSlug},s[1]=o.appSlug,s[2]=i):i=s[2];const c=Me(i);let d;s[3]!==e.history?(d=()=>{e.history.back()},s[3]=e.history,s[4]=d):d=s[4];const n=d,u=Ht;let x;return s[5]!==n||s[6]!==l||s[7]!==c?(x=t.jsx(Ft,{itemId:l,siblings:c,onBack:n,onUpdate:u}),s[5]=n,s[6]=l,s[7]=c,s[8]=x):x=s[8],x}async function Ht(s){return Promise.resolve()}function Wt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Kt(){const s=O.c(41),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.collectionName),i=decodeURIComponent(o.itemId);let c;s[1]!==e.history?(c=()=>{e.history.back()},s[1]=e.history,s[2]=c):c=s[2];const d=c,{org:n}=re();let u;s[3]!==o.appSlug?(u={slug:o.appSlug},s[3]=o.appSlug,s[4]=u):u=s[4];const m=Me(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==n.id||s[6]!==n.slug||s[7]!==g?(S={connectionId:g,orgId:n.id,orgSlug:n.slug},s[5]=n.id,s[6]=n.slug,s[7]=g,s[8]=S):S=s[8];const C=ae(S),R=Ee(f,l,C);let I;s[9]!==R||s[10]!==i?(I=async D=>{i&&await R.update.mutateAsync({id:i,data:D})},s[9]=R,s[10]=i,s[11]=I):I=s[11];const k=I;let T;s[12]!==l?(T=l?.toLowerCase(),s[12]=l,s[13]=T):T=s[13];const b=T,y=b&&Jt[b];let w;s[14]!==l?(w=Wt(l),s[14]=l,s[15]=w):w=s[15];const P=w;let N;s[16]!==n.slug?(N=t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections",params:{org:n.slug},children:"Connections"})})}),s[16]=n.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Q,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==n.slug||s[22]!==o.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:o.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Q,{})]}),s[19]=l,s[20]=m,s[21]=n.slug,s[22]=o.appSlug,s[23]=U):U=s[23];let z;s[24]!==P?(z=t.jsx(J,{children:t.jsx(_e,{children:P})}),s[24]=P,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(Oe,{children:t.jsxs(Re,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(y){let D;return s[30]!==y||s[31]!==d||s[32]!==k||s[33]!==i?(D=t.jsx(y,{itemId:i,onBack:d,onUpdate:k}),s[30]=y,s[31]=d,s[32]=k,s[33]=i,s[34]=D):D=s[34],D}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(kt,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let E;s[36]!==d?(E=t.jsx(Vt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:d,children:"Go back"}}),s[36]=d,s[37]=E):E=s[37];let V;return s[38]!==L||s[39]!==E?(V=t.jsx(ue,{breadcrumb:L,children:E}),s[38]=L,s[39]=E,s[40]=V):V=s[40],V}function Gt(){const s=O.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 r=le(e);if(decodeURIComponent(r.collectionName)==="tools"){let c;return s[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(qt,{}),s[1]=c):c=s[1],c}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Kt,{}),s[2]=i):i=s[2],i}function Jn(){const s=O.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Gt,{})})}),s[0]=e):e=s[0],e}export{Jn as default};
@@ -1,2 +0,0 @@
1
- import{c as Z,r as u,j as r,i as ie,B as he,dZ as Mt,aL as Dt,aR as se,d_ as Rt,d$ as Pt,e0 as Et,e1 as kt,bK as Tt,e2 as Ot,e3 as qe,aN as At,e4 as Lt,e5 as Ft,e6 as It,e7 as $t,e8 as _t,e9 as zt,ea as Wt,eb as Gt,ec as Kt,l as ae,p as Bt,t as W,K as $e}from"./index-BahpiC2M.js";import{F as Vt,l as Ut}from"./index-Ba398iyy.js";import{i as qt,aC as Qt,aD as Ht,aE as ue,aF as Xt,a9 as _e}from"./agent-icon-DMnz6o4Z.js";import{a as Jt}from"./Tool01-BAkx1ZdU.js";import{s as Yt}from"./XClose-DjOcr3WE.js";import{A as Zt}from"./automation-runs-x80BWaX2.js";import{T as ze,a as We,b as Ge}from"./tooltip-s6_x3f9a.js";import{f as en,a as tn,b as nn,c as rn,d as on,e as sn,A as an,g as ln}from"./alert-dialog-Bp9SnoCg.js";import{a as cn}from"./chat-context-ISwsXKv9.js";import{u as dn}from"./shell-layout-C6qLFIpM.js";import{s as fe,a as Ke,f as un}from"./index-BvtQ5hoD.js";import{a as fn,b as mn,c as pn,D as xn,d as hn,e as gn}from"./dialog-BQdZemDY.js";import{I as Be}from"./input-DCvWYNIA.js";import{t as vn}from"./ChevronDown-CEttVXzH.js";import{i as yn}from"./ChevronRight-CBhPLqlW.js";import{a as Cn}from"./ZoomOut-DJV4-7Wr.js";import{E as wn,v as Ve,w as Ce,x as bn,y as jn,z as Nn,A as V,C as me,g as we,D as be,G as Sn,I as Mn,J as je,K as pe,M as Ne,N as Dn,O as Rn}from"./index-CLnnofn-.js";import"./AlertCircle-DDN3VPgH.js";import"./SwitchHorizontal01-BR_j_D1S.js";import"./Settings02-C66CP-6J.js";import"./XCircle-C44kYn0r.js";import"./ArrowUpRight-BABdYIhs.js";import"./ZapSquare-ddNKzQhO.js";import"./Users03-B6ET39UJ.js";import"./Loading02-J8un_7vB.js";import"./CheckCircle-eA_D0se8.js";import"./Check-D9pD98TC.js";import"./ChevronUp-DB19PJr3.js";import"./Circle-C_Uwaadc.js";import"./Stars02-BgcXdOF8.js";import"./Copy01-BqSpo14R.js";import"./DotsVertical-CZx_5q44.js";import"./Globe01-iaaiJTp8.js";import"./Eye-2veooEq8.js";import"./FilterLines-Bhsdw1Jp.js";import"./Star01-CI0kjjiv.js";import"./Globe04-Pp6spg9P.js";import"./HardDrive-Bc5tB9pN.js";import"./Key01-gZ5RTwBh.js";import"./LayoutLeft-BSrZgTU6.js";import"./LinkExternal01-DkCU3S9w.js";import"./List-CNqrF6eE.js";import"./Monitor01-CgzOVFpb.js";import"./Sun-CWVJFGYw.js";import"./Palette-BAAsFrJa.js";import"./Play-B5Yd6Z0i.js";import"./Plus-Cn5an5hF.js";import"./SearchLg-lz9lYchG.js";import"./SearchMd-BELaZlqe.js";import"./Shield01-JdRvk1Dm.js";import"./Stars01-Bu7Nhnx4.js";import"./Trash01-CVVInA2O.js";import"./Upload01-ByUZD5Uy.js";import"./User01-7q5NgTw9.js";import"./Users01-BX9kMyjx.js";import"./X-BH6rGAp7.js";import"./Zap-kOKl7dUI.js";import"./select-Bvp0qEbr.js";import"./useInfiniteQuery-CsANrC6N.js";import"./use-infinite-scroll-DxHNeSQt.js";import"./use-connection-C-rUOOpn.js";import"./use-collections-Dd1RRH7k.js";import"./use-mcp-client-B6zu078q.js";import"./constants-B72Xmt_K.js";import"./auth-Di_P-iCF.js";import"./use-virtual-mcp-Yg3Ni3JK.js";import"./card-CBmF5m-m.js";import"./sidebar-ChHxgM9m.js";import"./use-mobile-BXNoK8fo.js";import"./table-YAS6wtBG.js";import"./empty-state-Ccota3IC.js";import"./use-members-XIoSlR3f.js";import"./use-org-auth-client-CIP8sPzJ.js";import"./use-clock-tick-zj_1xbt5.js";import"./use-automations-B6grDoMr.js";import"./studio-tools-CWpmP6KM.js";import"./useSuspenseInfiniteQuery-dATP5Fxl.js";import"./badge-DWJF1rj3.js";import"./checkbox-DBlqT1WL.js";import"./command-B6K8iBEi.js";import"./index-DPa2Fjxz.js";import"./popover-BLU6o9-K.js";import"./avatar-jxHzinps.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CsNZH-9d.js";import"./file-type-icon-DqiLifA7.js";import"./tab-id-yjGvxWDL.js";import"./monaco-editor-uei6eymP.js";import"./delay-CnY5UFtP.js";import"./types-uVqvyouI.js";import"./hooks-D2FVCNXX.js";import"./decopilot-sse-pool-CuiGv1QM.js";import"./backoff-CrEUbyZT.js";import"./integration-icon-BnLYSlPi.js";import"./use-navigate-to-agent-DMVkXcE5.js";import"./reusable-new-chat-qqWu133U.js";import"./use-mcp-prompts-DV4jud7n.js";import"./form-DfINtBPW.js";import"./label-B9OlPCFU.js";import"./autosend-LAVMz_8m.js";import"./use-ai-providers-B2zGkuJg.js";import"./use-decopilot-events-CWlF2oHq.js";import"./use-organization-settings-BLQXB5iH.js";import"./required-auth-layout-D3BZEQrv.js";import"./use-org-sso-CgrmSiGq.js";import"./drawer-CGC9vUmu.js";import"./collection-search-DfEE2GsK.js";import"./tabs-Dt4ufEhX.js";import"./toggle-group-CnMNmD9w.js";import"./agent-capabilities-jSKruONI.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CZxKCMQN.js";import"./use-registry-connections-6rDSDO_p.js";import"./extract-connection-data-CdJ1S70n.js";import"./collection-tabs-CrxdsgPv.js";import"./textarea-DCN5TwaT.js";import"./connection-form-helpers-EFv1AB2t.js";import"./authenticate-and-persist-oauth-BFF6bv-w.js";import"./mcp-oauth-D6cRXUdj.js";import"./connect-desktop-dialog-C5gWxTfZ.js";import"./select-model-DVM5M8H6.js";import"./skeleton-v_XZSYYc.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B2ndiHlo.js";import"./dropdown-menu-p-OE20Zw.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-B8zqs89p.js";import"./toolbar-Bw9zu9WL.js";import"./use-mcp-tools-Doyc2jlq.js";import"./use-capability-B-obK3ST.js";import"./tools-list-D9OxMY8P.js";import"./switch-yI9gdvWp.js";import"./use-debounced-autosave-Cp27TV8M.js";import"./index-CCgql0MU.js";import"./search-input-CTSKqHHp.js";import"./github-repo-picker-DwvAhon6.js";import"./use-debounced-value-96swwTPW.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-OrnCuWHl.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./toolbar-icon-button-D-LZYEgI.js";import"./calendar-Chv9-zN_.js";import"./use-file-configs-DvpZmtIS.js";import"./automation-list-row-Bu1WzUZ2.js";const Pn={"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(i){const e=Z.c(51),{open:s,mode:a,initialName:c,parentLabel:m,isPending:x,onSubmit:p,onOpenChange:g}=i,M=c===void 0?"":c,d=x===void 0?!1:x,[h,y]=u.useState(M),[B,U]=u.useState(s),C=Pn[a];s!==B&&(U(s),s&&y(M));let I;e[0]!==d||e[1]!==g?(I=_=>{!_&&!d&&g(!1)},e[0]=d,e[1]=g,e[2]=I):I=e[2];const H=I;let q;e[3]!==d||e[4]!==h||e[5]!==p?(q=async _=>{_.preventDefault();const K=h.trim();!K||d||await p(K)},e[3]=d,e[4]=h,e[5]=p,e[6]=q):q=e[6];const Q=q;let $;e[7]!==C.title?($=r.jsx(fn,{children:C.title}),e[7]=C.title,e[8]=$):$=e[8];let T;e[9]!==C.description?(T=r.jsx(mn,{children:C.description}),e[9]=C.description,e[10]=T):T=e[10];let G;e[11]!==$||e[12]!==T?(G=r.jsxs(pn,{children:[$,T]}),e[11]=$,e[12]=T,e[13]=G):G=e[13];let O;e[14]!==m?(O=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(Be,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=m,e[15]=O):O=e[15];let A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=A):A=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R=_=>y(_.target.value),e[17]=R):R=e[17];let P;e[18]!==C.placeholder||e[19]!==d||e[20]!==h?(P=r.jsxs("div",{className:"space-y-1.5",children:[A,r.jsx(Be,{id:"file-explorer-name",value:h,onChange:R,placeholder:C.placeholder,autoFocus:!0,disabled:d})]}),e[18]=C.placeholder,e[19]=d,e[20]=h,e[21]=P):P=e[21];let j;e[22]!==P||e[23]!==O?(j=r.jsxs("div",{className:"space-y-4 py-4",children:[O,P]}),e[22]=P,e[23]=O,e[24]=j):j=e[24];let N;e[25]!==g?(N=()=>g(!1),e[25]=g,e[26]=N):N=e[26];let E;e[27]!==d||e[28]!==N?(E=r.jsx(he,{type:"button",variant:"outline",onClick:N,disabled:d,children:"Cancel"}),e[27]=d,e[28]=N,e[29]=E):E=e[29];let k;e[30]!==d||e[31]!==h?(k=!h.trim()||d,e[30]=d,e[31]=h,e[32]=k):k=e[32];let w;e[33]!==C.submit||e[34]!==d?(w=d?r.jsxs(r.Fragment,{children:[r.jsx(ie,{size:14,className:"animate-spin"}),"Saving…"]}):C.submit,e[33]=C.submit,e[34]=d,e[35]=w):w=e[35];let L;e[36]!==k||e[37]!==w?(L=r.jsx(he,{type:"submit",disabled:k,children:w}),e[36]=k,e[37]=w,e[38]=L):L=e[38];let b;e[39]!==E||e[40]!==L?(b=r.jsxs(xn,{children:[E,L]}),e[39]=E,e[40]=L,e[41]=b):b=e[41];let S;e[42]!==Q||e[43]!==j||e[44]!==b||e[45]!==G?(S=r.jsx(hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:Q,children:[G,j,b]})}),e[42]=Q,e[43]=j,e[44]=b,e[45]=G,e[46]=S):S=e[46];let z;return e[47]!==H||e[48]!==s||e[49]!==S?(z=r.jsx(gn,{open:s,onOpenChange:H,children:S}),e[47]=H,e[48]=s,e[49]=S,e[50]=z):z=e[50],z}var Me="ContextMenu",[kn]=At(Me,[qe]),F=qe(),[Tn,Qe]=kn(Me),He=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:c,modal:m=!0}=i,[x,p]=u.useState(!1),g=F(e),M=Tt(a),d=u.useCallback(h=>{p(h),M(h)},[M]);return r.jsx(Tn,{scope:e,open:x,onOpenChange:d,modal:m,children:r.jsx(Ot,{...g,dir:c,open:x,onOpenChange:d,modal:m,children:s})})};He.displayName=Me;var Xe="ContextMenuTrigger",Je=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...c}=i,m=Qe(Xe,s),x=F(s),p=u.useRef({x:0,y:0}),g=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),M=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(M.current),[]),h=y=>{p.current={x:y.clientX,y:y.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Mt,{...x,virtualRef:g}),r.jsx(Dt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:se(i.onContextMenu,y=>{d(),h(y),y.preventDefault()}),onPointerDown:a?i.onPointerDown:se(i.onPointerDown,xe(y=>{d(),M.current=window.setTimeout(()=>h(y),700)})),onPointerMove:a?i.onPointerMove:se(i.onPointerMove,xe(d)),onPointerCancel:a?i.onPointerCancel:se(i.onPointerCancel,xe(d)),onPointerUp:a?i.onPointerUp:se(i.onPointerUp,xe(d))})]})});Je.displayName=Xe;var On="ContextMenuPortal",Ye=i=>{const{__scopeContextMenu:e,...s}=i,a=F(e);return r.jsx(Et,{...a,...s})};Ye.displayName=On;var Ze="ContextMenuContent",et=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=Qe(Ze,s),m=F(s),x=u.useRef(!1);return r.jsx(kt,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{i.onCloseAutoFocus?.(p),!p.defaultPrevented&&x.current&&p.preventDefault(),x.current=!1},onInteractOutside:p=>{i.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(x.current=!0)},style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});et.displayName=Ze;var An="ContextMenuGroup",Ln=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Lt,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuLabel",In=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Ft,{...c,...a,ref:e})});In.displayName=Fn;var $n="ContextMenuItem",tt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Rt,{...c,...a,ref:e})});tt.displayName=$n;var _n="ContextMenuCheckboxItem",zn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(It,{...c,...a,ref:e})});zn.displayName=_n;var Wn="ContextMenuRadioGroup",Gn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx($t,{...c,...a,ref:e})});Gn.displayName=Wn;var Kn="ContextMenuRadioItem",Bn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(_t,{...c,...a,ref:e})});Bn.displayName=Kn;var Vn="ContextMenuItemIndicator",Un=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(zt,{...c,...a,ref:e})});Un.displayName=Vn;var qn="ContextMenuSeparator",nt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Pt,{...c,...a,ref:e})});nt.displayName=qn;var Qn="ContextMenuArrow",Hn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Wt,{...c,...a,ref:e})});Hn.displayName=Qn;var Xn="ContextMenuSubTrigger",Jn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Gt,{...c,...a,ref:e})});Jn.displayName=Xn;var Yn="ContextMenuSubContent",Zn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Kt,{...c,...a,ref:e,style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Zn.displayName=Yn;function xe(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var er=He,tr=Je,nr=Ye,rr=et,or=tt,sr=nt;function ir(i){const e=Z.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(er,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function ar(i){const e=Z.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(tr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function lr(i){const e=Z.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let c;e[3]!==s?(c=ae("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(nr,{children:r.jsx(rr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}function te(i){const e=Z.c(12);let s,a,c,m;e[0]!==i?({className:s,inset:a,variant:m,...c}=i,e[0]=i,e[1]=s,e[2]=a,e[3]=c,e[4]=m):(s=e[1],a=e[2],c=e[3],m=e[4]);const x=m===void 0?"default":m;let p;e[5]!==s?(p=ae("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==x?(g=r.jsx(or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":x,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=x,e[11]=g):g=e[11],g}function Ue(i){const e=Z.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let c;e[3]!==s?(c=ae("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(sr,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}const cr="#d9a441";function dr(i){const e=Z.c(45),{node:s,depth:a,isExpanded:c,isSelected:m,isLoading:x,fileVisual:p,onOpen:g,onSelect:M,onNewFile:d,onNewFolder:h,onCopyPath:y,onCopyRelativePath:B,onRename:U,onDelete:C}=i,I=x===void 0?!1:x,H=s.kind==="directory",{Icon:q,color:Q}=p,$=m&&"bg-accent";let T;e[0]!==$?(T=ae("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",$),e[0]=$,e[1]=T):T=e[1];const G=`${a*14+8}px`;let O;e[2]!==G?(O={paddingLeft:G},e[2]=G,e[3]=O):O=e[3];let A;e[4]!==g||e[5]!==M?(A=()=>{M(),g()},e[4]=g,e[5]=M,e[6]=A):A=e[6];let R;e[7]!==q||e[8]!==Q||e[9]!==H||e[10]!==c||e[11]!==I?(R=H?r.jsxs(r.Fragment,{children:[I?r.jsx(ie,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(yn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(Cn,{size:16,className:"shrink-0",style:{color:cr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(q,{size:16,className:"shrink-0",style:{color:Q}})]}),e[7]=q,e[8]=Q,e[9]=H,e[10]=c,e[11]=I,e[12]=R):R=e[12];let P;e[13]!==s.name?(P=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=P):P=e[14];let j;e[15]!==T||e[16]!==O||e[17]!==A||e[18]!==R||e[19]!==P?(j=r.jsx(ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:T,style:O,onClick:A,children:[R,P]})}),e[15]=T,e[16]=O,e[17]=A,e[18]=R,e[19]=P,e[20]=j):j=e[20];let N;e[21]!==d?(N=r.jsx(te,{onSelect:d,children:"New File"}),e[21]=d,e[22]=N):N=e[22];let E;e[23]!==h?(E=r.jsx(te,{onSelect:h,children:"New Folder"}),e[23]=h,e[24]=E):E=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ue,{}),e[25]=k):k=e[25];let w;e[26]!==y?(w=r.jsx(te,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=w):w=e[27];let L;e[28]!==B?(L=r.jsx(te,{onSelect:B,children:"Copy Relative Path"}),e[28]=B,e[29]=L):L=e[29];let b;e[30]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(Ue,{}),e[30]=b):b=e[30];let S;e[31]!==U?(S=r.jsx(te,{onSelect:U,children:"Rename"}),e[31]=U,e[32]=S):S=e[32];let z;e[33]!==C?(z=r.jsx(te,{variant:"destructive",onSelect:C,children:"Delete"}),e[33]=C,e[34]=z):z=e[34];let _;e[35]!==N||e[36]!==E||e[37]!==w||e[38]!==L||e[39]!==S||e[40]!==z?(_=r.jsxs(lr,{className:"w-52",children:[N,E,k,w,L,b,S,z]}),e[35]=N,e[36]=E,e[37]=w,e[38]=L,e[39]=S,e[40]=z,e[41]=_):_=e[41];let K;return e[42]!==_||e[43]!==j?(K=r.jsxs(ir,{children:[j,_]}),e[42]=_,e[43]=j,e[44]=K):K=e[44],K}Ut.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Se(i,e,s,a){return`/api/${i}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/${a}`}function ur(i){const e=V(i);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const fr="#94a3b8";function mr(i){const e=i.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ue,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ue,color:"#d9a441"}:e.endsWith(".json")?{Icon:Xt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ue,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ue,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:Jt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:_e,color:"#64748b"}:{Icon:_e,color:fr}}function Ys({orgSlug:i,virtualMcpId:e,branch:s,openPath:a}){const[c,m]=u.useState({files:[],directories:[],truncated:!1}),{files:x,directories:p}=c,[g,M]=u.useState(new Set),[d,h]=u.useState(null),[y,B]=u.useState(null),[U,C]=u.useState([]),[I,H]=u.useState(""),[q,Q]=u.useState(!1),[$,T]=u.useState(!1),[,G]=u.useState(new Set),[O,A]=u.useState(new Set),R=u.useRef(0),P=u.useRef(null),j=u.useRef(new Set),N=u.useRef(new Map);function E(t){G(n=>{const o=typeof t=="function"?t(n):t;return j.current=o,o})}const[k,w]=u.useState(new Map),L=u.useRef(null),[b,S]=u.useState(null),{sendMessage:z}=cn(),{setChatOpen:_}=dn(),K=Bt(),[D,X]=u.useState(null),[J,ge]=u.useState(null),[ne,le]=u.useState(!1);async function re(t,n){const o=await fetch(Se(i,e,s,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function ce(){K.invalidateQueries({queryKey:Ke(i,e,s)})}function De(t,n){navigator.clipboard.writeText(n).then(()=>W.success(`${t} copied`),()=>W.error(`Failed to copy ${t.toLowerCase()}`))}function rt(t){const n=Dn(t);if(!n)return;const o=`${i}/${e}/${s}`;K.setQueryData($e.decofile(o),l=>{if(!l)return l;const{[n]:f,...v}=l;return v}),K.invalidateQueries({queryKey:$e.liveMeta(o)})}function ot(t){const n=t.kind==="file"?[t.path]:x.filter(o=>o.startsWith(".deco/blocks/")).map(o=>me(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)rt(o)}function st(t){const n=me(t);return U.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=k.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Re(t){C(n=>n.map(o=>t(o)).filter(o=>o!==null)),h(n=>n&&t(n)),w(n=>{const o=new Map;for(const[l,f]of n){const v=t(l);v&&o.set(v,f)}return o}),B(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function it(t){const n=me(t);B(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Re(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function at(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);await re("write",{path:V(n),content:""}),await oe(),await ce(),X(null),ve(n)}async function lt(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);const o=V(n);await re("mkdir",{path:o}),m(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await oe(),await ce(),X(null),M(l=>{const f=new Set(l);for(const v of Ce(n))f.add(v);return f.add(n),f}),B({name:t,path:n,kind:"directory",children:[]})}async function ct(t){if(!D)return;const n=D.node.path,o=je(n),l=pe(o,t);if(l===n){X(null);return}if(Ne(l,x,p))throw new Error(`"${t}" already exists`);await re("rename",{from:V(n),to:V(l)}),Re(f=>f===n?l:f.startsWith(`${n}/`)?pe(l,f.slice(n.length+1)):f),await oe(),await ce(),X(null)}async function dt(t){le(!0);try{await re("unlink",{path:V(t.path),recursive:t.kind==="directory"}),ot(t),it(t.path),await oe(),await ce(),ge(null),W.success(`Deleted "${t.name}"`)}catch(n){W.error(n instanceof Error?n.message:"Delete failed")}finally{le(!1)}}async function ut(t){const n=Mn(t);if(n){W.error(n);return}le(!0);try{D?.mode==="new-file"?(await at(t),W.success(`Created "${t}"`)):D?.mode==="new-folder"?(await lt(t),W.success(`Created folder "${t}"`)):D?.mode==="rename"&&(await ct(t),W.success(`Renamed to "${t}"`))}catch(o){W.error(o instanceof Error?o.message:"Operation failed")}finally{le(!1)}}const Pe=u.useRef(!1);Pe.current||(Pe.current=!0,P.current=oe());const[ft,mt]=u.useState(null);if(a&&a!==ft){mt(a);const t=a;queueMicrotask(()=>{ur(t)&&ve(t).catch(n=>{W.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ee(t){const n=await re("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function ke(t,n,o){if(o!==R.current)return!1;let l=!1;return m(f=>{const v=n?Rn(f.files,f.directories,t,f.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!v.truncated,{files:v.files,directories:v.directories,truncated:l}}),l&&W.warning("File list truncated — some files may be hidden"),l}async function pt(t){const n=N.current.get(t);if(n)return n;const o=R.current,l=(async()=>{const f=await Ee({pattern:"**/*",path:V(t),limit:Ve}),v=ke(f,!0,o);return!v&&o===R.current&&E(Y=>{const de=new Set(Y);return de.add(t),de}),v})();N.current.set(t,l);try{return await l}finally{N.current.delete(t)}}async function Te(t){if(!be(t,j.current))return!1;A(n=>new Set(n).add(t));try{return await pt(t)}finally{A(n=>{const o=new Set(n);return o.delete(t),o})}}async function xt(t){const n=new Set(j.current);for(const o of Ce(t)){if(!be(o,n))continue;if(await Te(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function oe(){const t=++R.current;N.current.clear(),Q(!0),E(new Set),M(new Set),A(new Set);try{const n=await Ee({pattern:"**/*",limit:Ve,maxDepth:wn});ke(n,!1,t),T(!0)}catch{$&&W.error("Failed to refresh file tree")}finally{Q(!1)}}async function Oe(t){if(!k.get(t)?.loaded){w(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await fetch(Se(i,e,s,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:V(t),full:!0})});if(!o.ok)return;const l=await o.json(),f=Sn(l.content??"");w(v=>{const Y=new Map(v);return Y.set(t,{savedContent:f,editorValue:f,loaded:!0}),Y})}catch{}}}async function ht(t,n){try{const o=await fetch(Se(i,e,s,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:V(t),content:n})});if(!o.ok){fe("file save failed",{path:t,status:o.status});return}fe("file saved via sandbox /write",{path:t}),K.invalidateQueries({queryKey:Ke(i,e,s)});try{const l=await un(i,e,s);fe("git status after save",l)}catch(l){fe("git status after save failed",{path:t,error:l instanceof Error?l.message:String(l)})}w(l=>{const f=new Map(l),v=f.get(t);return v&&f.set(t,{...v,savedContent:n}),f})}catch{}}function gt(t){h(t),B({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),S(null),U.includes(t)||C(n=>[...n,t]),Oe(t)}function vt(t){C(n=>{const o=n.filter(l=>l!==t);return d===t&&h(o[o.length-1]??null),o}),w(n=>{const o=new Map(n);return o.delete(t),o})}function Ae(t){M(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function yt(t){if(be(t,j.current))try{if(await Te(t))return}catch(n){W.error(n instanceof Error?n.message:"Failed to load folder");return}Ae(t)}async function Ct(t,n){if(n){Ae(t);return}await yt(t)}async function ve(t){await P.current,await xt(t);const n=Ce(t);M(o=>{const l=new Set(o);for(const f of n)l.add(f);return l}),gt(t)}function wt(){return y?.kind==="directory"?y.path:y?.kind==="file"?je(y.path):d?je(d):"/"}function Le(t){const n=wt();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const bt=bn(x,p),Fe=jn(bt,g),Ie=I?Fe.filter(t=>t.node.name.toLowerCase().includes(I.toLowerCase())):Fe,ee=d?k.get(d):null,jt=ee?.loaded&&ee.editorValue!==ee.savedContent,ye=J?st(J.path):[],Nt=(t,n)=>{L.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ht(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const f=l.getValueInRange(o);S({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:f})})};function St(t){if(!b)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${b.filePath}\``,`**Lines:** ${b.lineStart}–${b.lineEnd}`];if(b.selectedCode){const o=we(b.filePath),l=b.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),_(!0),z({parts:[{type:"text",text:n.join(`
2
- `)}]}),S(null)}return q&&!$?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(ie,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(qt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:I,onChange:t=>H(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"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:r.jsx(Qt,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New file"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:r.jsx(Ht,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New folder"})]})]}),r.jsx(Zt,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[Ie.map(t=>{const{node:n,depth:o}=t,l=n.kind==="directory",f=g.has(n.path),v=y?.path===n.path,Y=Nn(n.path,n.kind),de=l&&O.has(n.path);return r.jsx(dr,{node:n,depth:o,isExpanded:f,isSelected:v,isLoading:de,fileVisual:mr(n.name),onSelect:()=>B(n),onOpen:()=>{l?Ct(n.path,f):ve(n.path)},onNewFile:()=>X({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>X({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>De("Path",me(n.path)),onCopyRelativePath:()=>De("Relative path",V(n.path)),onRename:()=>X({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ge(n)},n.path)}),$&&Ie.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:I?`No files match "${I}"`:"No files found"})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[U.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:U.map(t=>{const n=k.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,l=d===t,f=t.split("/").pop()??t;return r.jsxs("div",{className:ae("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",l?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{h(t),Oe(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":l,children:[r.jsx("span",{className:"truncate max-w-32",children:f}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:v=>{v.stopPropagation(),vt(t)},children:r.jsx(Yt,{size:12})})]},t)})}),b&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.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 o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&St(o.value)},children:[r.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"&&S(null)}}),r.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:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:"Send"}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&ee?.loaded?r.jsx(Vt,{language:we(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:ee.editorValue,path:d,onChange:t=>{const n=d;n&&w(o=>{const l=new Map(o),f=l.get(n);return f&&l.set(n,{...f,editorValue:t??""}),l})},onMount:Nt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(ie,{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}}},d):d&&!ee?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(ie,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[jt?"Modified":"Saved"," ·"," ",we(d)]})]})]}),r.jsx(En,{open:D!==null,mode:D?.mode??"new-file",initialName:D?.mode==="rename"?D.node.name:"",parentLabel:D&&D.mode!=="rename"?D.parentDir==="/"?"/":V(D.parentDir):void 0,isPending:ne,onSubmit:ut,onOpenChange:t=>{!t&&!ne&&X(null)}}),r.jsx(en,{open:J!==null,onOpenChange:t=>{!t&&!ne&&ge(null)},children:r.jsxs(tn,{children:[r.jsxs(nn,{children:[r.jsxs(rn,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),r.jsxs(on,{children:["This will permanently delete"," ",r.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",ye.length>0&&r.jsxs(r.Fragment,{children:[" ",ye.length===1?"One open file has unsaved changes that will be lost.":`${ye.length} open files have unsaved changes that will be lost.`]})]})]}),r.jsxs(sn,{children:[r.jsx(an,{disabled:ne,children:"Cancel"}),r.jsx(ln,{disabled:ne||!J,onClick:t=>{t.preventDefault(),J&&dt(J)},children:"Delete"})]})]})})]})}export{Ys as FileExplorer};
@@ -1 +0,0 @@
1
- import{c as H,j as t,Z as J,a as ie,p as Y,r as $,a4 as q,i as U,d as ee,t as L,dV as ae,K as F,k as le,B as ce,l as V,L as ue,ak as de}from"./index-BahpiC2M.js";import{c as me,a as fe,d as pe,e as ge}from"./dialog-BQdZemDY.js";import{C as W}from"./checkbox-DBlqT1WL.js";import{C as xe}from"./collection-search-DfEE2GsK.js";import{u as he}from"./use-debounced-value-96swwTPW.js";import{b as te,u as ye}from"./use-connection-C-rUOOpn.js";import{u as D}from"./use-mcp-client-B6zu078q.js";import{W as be,S as ne}from"./constants-B72Xmt_K.js";import{a as se}from"./authenticate-and-persist-oauth-BFF6bv-w.js";import{b as oe}from"./Settings02-C66CP-6J.js";import{K as we}from"./agent-icon-DMnz6o4Z.js";import{u as Ne}from"./use-mcp-tools-Doyc2jlq.js";import{e as Ce}from"./extract-connection-data-CdJ1S70n.js";import{u as je}from"./use-navigate-to-agent-DMVkXcE5.js";import{f as Ie}from"./github-installations-DzN1UQ4x.js";const K={contents:"write",metadata:"read",pull_requests:"write",issues:"write"};function Se(s){if(!s||typeof s!="object"||Array.isArray(s))return K;const e=s;return Object.values(e).some(n=>typeof n!="string")?K:e}function ve(s){if(!(typeof s!="number"||!Number.isFinite(s)||!Number.isInteger(s)||s<=0))return s}function Ee(s){const e=s.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=ve(e.repositoryId);return{sourceConnectionId:typeof e.sourceConnectionId=="string"?e.sourceConnectionId:void 0,installationId:e.installationId,repositoryId:n,owner:e.owner,repo:e.repo,permissions:Se(e.permissions),grantProvider:e.grantProvider==="github-mcp"?"github-mcp":void 0}}function Te(s){return(s??[]).filter(e=>Ee(e)===null)}function rt(s){return s.metadata?.orgShared===!0}function z(s){const e=H.c(4),{size:n,className:o}=s;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 d;return e[1]!==o||e[2]!==n?(d=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:o,children:l}),e[1]=o,e[2]=n,e[3]=d):d=e[3],d}function ke(s,e){const n=H.c(12),{org:o}=J();let l;n[0]!==o.id?(l=be.REGISTRY(o.id),n[0]=o.id,n[1]=l):l=n[1];const d=l;let f;n[2]!==o.id||n[3]!==o.slug||n[4]!==d?(f={connectionId:d,orgId:o.id,orgSlug:o.slug},n[2]=o.id,n[3]=o.slug,n[4]=d,n[5]=f):f=n[5];const m=D(f);let p;n[6]!==s?(p={name:s},n[6]=s,n[7]=p):p=n[7];const b=e?.enabled??!0;let i;return n[8]!==m||n[9]!==p||n[10]!==b?(i={client:m,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:p,enabled:b,staleTime:3e5,select:_e},n[8]=m,n[9]=p,n[10]=b,n[11]=i):i=n[11],Ne(i)}function _e(s){return s.structuredContent?.item??null}const Ae="deco/mcp-github";function Re(s){const{org:e}=J(),{data:n}=ie.useSession(),o=te(),l=Y(),[d,f]=$.useState("idle"),[m,p]=$.useState(null),[b,i]=$.useState(null),{data:h,isLoading:c}=ke(Ae,{enabled:s.enabled}),g=$.useRef(!1);s.enabled&&h&&!c&&!g.current&&n?.user?.id&&d==="idle"&&(g.current=!0,w());async function w(){if(!(!h||!n?.user?.id||!e))try{f("installing"),p(null);const N=Ce(h,e.id,n.user.id,{remoteIndex:0});if(!N.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:x}=await o.create.mutateAsync(N);f("authenticating");const u=await se({connectionId:x,orgId:e.id,orgSlug:e.slug,persistFallback:a=>o.update.mutateAsync({id:x,data:{connection_token:a}}).then(()=>{})});if(u.ran&&!u.ok){try{await o.delete.mutateAsync(x)}catch{}throw new Error(u.error&&u.error!=="no token received"?u.error:"No token received from GitHub")}q(l,e.id),i(N),f("ready")}catch(N){p(N instanceof Error?N.message:String(N)),f("error")}}function j(){f("idle"),p(null),i(null),g.current=!1}return s.enabled&&c&&d==="idle"?{status:"installing",error:null,connection:null,retry:j}:{status:d,error:m,connection:b,retry:j}}const B=[{key:"auto-respond-to-issues",triggerType:"github.issues.opened",nameSuffix:"auto-respond to issues",label:"Auto-respond to new issues",defaultEnabled:!0,instructions:({owner:s,name:e})=>`A new GitHub issue has been opened in ${s}/${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:s,name:e})=>`A pull request was opened in ${s}/${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:s,name:e})=>`A pull request was closed in ${s}/${e}. If it was merged, update changelog/release notes as appropriate.`}];function Oe(s,e){const n=new Set;if(s.paramsSchema)for(const l of Object.keys(s.paramsSchema))n.add(l);if(Array.isArray(s.params))for(const l of s.params)n.add(l.name);else if(s.params&&typeof s.params=="object")for(const l of Object.keys(s.params))n.add(l);if(n.has("repo"))return{repo:`${e.owner}/${e.name}`};const o={};return n.has("owner")&&(o.owner=e.owner),n.has("name")&&(o.name=e.name),n.has("repository")&&(o.repository=`${e.owner}/${e.name}`),o}async function Ge({githubCallTool:s,selfCallTool:e,virtualMcpId:n,repo:o,connectionId:l,selectedKeys:d}){const f=await s({name:"TRIGGER_LIST",arguments:{}}),m=f.structuredContent??f,p=new Map((m.triggers??[]).map(c=>[c.type,c])),b=B.filter(c=>d.has(c.key)),i=await Promise.allSettled(b.map(async c=>{const g=p.get(c.triggerType);if(!g)throw new Error(`Trigger ${c.triggerType} not exposed`);const w=await e({name:"AUTOMATION_CREATE",arguments:{name:`${o.name}: ${c.nameSuffix}`,virtual_mcp_id:n,messages:c.instructions(o),active:!0}}),j=(w.structuredContent??w).id;if(!j)throw new Error(`AUTOMATION_CREATE returned no id for ${c.key}`);await e({name:"AUTOMATION_TRIGGER_ADD",arguments:{automation_id:j,type:"event",connection_id:l,event_type:c.triggerType,params:Oe(g,o)}})})),h=i.filter(c=>c.status==="rejected").length;return h>0&&console.error("Some GitHub automations failed to set up:",i.filter(c=>c.status==="rejected")),{total:i.length,failed:h}}const Z="GitHub MCP did not return refreshable repo grant metadata";function M(s){if(typeof s!="string")return null;const e=s.trim();return e.length>0?e:null}function Pe(s){try{const e=new URL(s);return(e.protocol==="http:"||e.protocol==="https:")&&!e.username&&!e.password}catch{return!1}}function $e(s){return typeof s=="number"&&Number.isFinite(s)&&Number.isInteger(s)&&s>0?s:void 0}async function X(s){const{orgSlug:e,sourceConnection:n,installationId:o,owner:l,repo:d,githubCallTool:f,selfCallTool:m,orgShared:p}=s,b=await f({name:"MINT_REPO_TOKEN",arguments:{installationId:o,owner:l,repo:d,permissions:K}}),i=b.structuredContent;if(b.isError||!i?.token){const y=b.content?.find(T=>T.type==="text")?.text;throw new Error(y?`Failed to mint a repo-scoped GitHub token: ${y}`:"Failed to mint a repo-scoped GitHub token")}const h=M(i.refreshToken),c=M(i.tokenEndpoint),g=M(i.clientId);if(!h||!c||!g)throw new Error(Z);if(!Pe(c))throw new Error(Z);const w=M(i.repository?.owner),j=M(i.repository?.name),N="GitHub MCP returned refresh metadata for a different repository";if(i.repository?.owner!==void 0&&(!w||w.toLowerCase()!==l.toLowerCase()))throw new Error(N);if(i.repository?.name!==void 0&&(!j||j.toLowerCase()!==d.toLowerCase()))throw new Error(N);const C=$e(i.repository?.id),x=i.expiresAt?Date.parse(i.expiresAt):NaN,u=Number.isFinite(x)?Math.max(0,Math.floor((x-Date.now())/1e3)):null,I=(typeof i.expiresIn=="number"&&Number.isFinite(i.expiresIn)&&Number.isInteger(i.expiresIn)&&i.expiresIn>0?i.expiresIn:null)??u,v=await m({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:{title:`GitHub: ${l}/${d}`,description:`Repo-scoped GitHub access for ${l}/${d}`,icon:n.icon,app_name:n.app_name,app_id:n.app_id,connection_type:n.connection_type,connection_url:n.connection_url,metadata:{...p?{orgShared:!0}:{},repoScope:{installationId:o,repositoryId:C,owner:l,repo:d,permissions:K,grantProvider:"github-mcp"}}}}}),S=v.structuredContent??v,E=S.item?.id??S.id;if(!E)throw new Error("Failed to create the repo-scoped GitHub connection");if(!(await fetch(`/api/${e}/connections/${E}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:i.token,refreshToken:h,expiresIn:I,scope:i.scope??null,clientId:g,tokenEndpoint:c})})).ok)throw await m({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:E,force:!0}}).catch(()=>{}),new Error("Failed to persist the repo-scoped token");return{childConnectionId:E}}function it(s){const e=H.c(23),{open:n,onOpenChange:o,title:l,hideAutoRespondCheckbox:d,onImportComplete:f,mode:m}=s,p=d===void 0?!1:d,b=m===void 0?"agent":m,i=l??(b==="connection"?"Add repo":"Import from GitHub"),[h,c]=$.useState(null);let g;e[0]!==i?(g=t.jsx(me,{className:"sr-only",children:t.jsx(fe,{children:i})}),e[0]=i,e[1]=g):g=e[1];let w;e[2]!==i||e[3]!==h?(w=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:h?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(oe,{size:16})}),t.jsx("img",{src:h.avatarUrl,alt:h.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:h.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(z,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:i})]})}),e[2]=i,e[3]=h,e[4]=w):w=e[4];let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(U,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=j):j=e[5];let N;e[6]!==o?(N=()=>o(!1),e[6]=o,e[7]=N):N=e[7];const C=p||b==="connection";let x;e[8]!==b||e[9]!==f||e[10]!==n||e[11]!==h||e[12]!==N||e[13]!==C?(x=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx($.Suspense,{fallback:j,children:t.jsx(He,{open:n,onComplete:N,selectedInstallation:h,onSelectInstallation:c,hideAutoRespondCheckbox:C,onImportComplete:f,mode:b})})}),e[8]=b,e[9]=f,e[10]=n,e[11]=h,e[12]=N,e[13]=C,e[14]=x):x=e[14];let u;e[15]!==g||e[16]!==w||e[17]!==x?(u=t.jsxs(pe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[g,w,x]}),e[15]=g,e[16]=w,e[17]=x,e[18]=u):u=e[18];let a;return e[19]!==o||e[20]!==n||e[21]!==u?(a=t.jsx(ge,{open:n,onOpenChange:o,children:u}),e[19]=o,e[20]=n,e[21]=u,e[22]=a):a=e[22],a}function He({open:s,onComplete:e,selectedInstallation:n,onSelectInstallation:o,hideAutoRespondCheckbox:l,onImportComplete:d,mode:f="agent"}){const{org:m}=J(),p=Y(),b=je(),[i,h]=$.useState(null),[c,g]=$.useState(!0),[w,j]=$.useState(()=>new Set(B.filter(r=>r.defaultEnabled).map(r=>r.key))),N=B.filter(r=>r.defaultEnabled).map(r=>r.key),C=l?new Set(N):c?w:new Set,x=ye({slug:"mcp-github"}),u=Te(x),a=Re({enabled:s&&u.length===0}),I=u.length===1?u[0]??null:i,v=D({connectionId:I?.id??"",orgId:m.id,orgSlug:m.slug}),S=D({connectionId:ne,orgId:m.id,orgSlug:m.slug}),E=async(r,k)=>{try{const P=await v.callTool({name:"get_file_contents",arguments:{owner:r.owner,repo:r.name,path:k}});if(P.isError)return null;const O=P.content?.find(G=>G.type==="resource")?.resource?.text;if(!O)return null;try{const G=JSON.parse(O);return typeof G=="string"?G:JSON.stringify(G)}catch{return O}}catch{return null}},_=(r,k)=>{Promise.all([E(k,"AGENTS.md"),E(k,"CLAUDE.md")]).then(async([A,P])=>{const R=A??P??null;R&&(await S.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:r,data:{metadata:{instructions:R}}}}),q(p,m.id))}).catch(A=>{console.error("GitHub instructions fetch failed:",A)})},y=async({virtualMcpId:r,repo:k,connectionId:A,selectedKeys:P})=>{const{total:R,failed:O}=await Ge({githubCallTool:G=>v.callTool(G),selfCallTool:G=>S.callTool(G),virtualMcpId:r,repo:k,connectionId:A,selectedKeys:P});O>0&&L.warning(`Set up ${R-O}/${R} GitHub automations. Add the rest from the automations view.`)},T=ee({mutationFn:async r=>{if(!I||!n)throw new Error("No GitHub connection or installation");const k=n.installationId;if(f==="connection"){const{childConnectionId:R}=await X({orgSlug:m.slug,sourceConnection:I,installationId:k,owner:r.owner,repo:r.name,githubCallTool:O=>v.callTool(O),selfCallTool:O=>S.callTool(O),orgShared:!0});return{virtualMcpId:null,repo:r,connectionId:R,item:null}}const{childConnectionId:A}=await X({orgSlug:m.slug,sourceConnection:I,installationId:k,owner:r.owner,repo:r.name,githubCallTool:R=>v.callTool(R),selfCallTool:R=>S.callTool(R)});let P=null;try{const R=await S.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:r.name,description:r.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:r.owner,name:r.name,url:r.url,installationId:k,connectionId:A},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:A}]}}}),O=R.structuredContent??R,G=O.item?.id;if(!O.item||!G)throw new Error("Failed to create the imported agent");return P=G,C.size>0&&await y({virtualMcpId:G,repo:r,connectionId:A,selectedKeys:C}).catch(re=>{console.error("Failed to set up GitHub automations:",re),L.warning("Imported repo, but failed to set up GitHub automations. You can add triggers manually from the automations view.")}),{virtualMcpId:G,repo:r,connectionId:A,item:O.item}}catch(R){throw P&&await S.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:P}}).catch(()=>{}),await S.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:A,force:!0}}).catch(()=>{}),R}},onSuccess:({virtualMcpId:r,repo:k,connectionId:A,item:P})=>{if(f==="connection"||!r||!P){q(p,m.id),ae(p,m.id),L.success(`Added ${k.name}`),e();return}if(p.setQueryData(F.collectionItem(S,m.id,"","VIRTUAL_MCP",r),{item:P}),q(p,m.id),_(r,k),d){d({virtualMcpId:r,repo:k,connectionId:A});return}L.success(`Imported ${k.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),b(r)},onError:r=>{L.error("Failed to import repo: "+(r instanceof Error?r.message:"Unknown error"))}});return a.status==="installing"||a.status==="authenticating"?t.jsx(Q,{status:a.status,error:null,retry:a.retry}):a.status==="error"?t.jsx(Q,{status:"error",error:a.error,retry:a.retry}):u.length===0&&a.status==="idle"?t.jsx(Q,{status:"installing",error:null,retry:a.retry}):u.length>1&&!I?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"})}),u.map(r=>t.jsxs("button",{type:"button",onClick:()=>h(r),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[r.icon?t.jsx("img",{src:r.icon,alt:r.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(z,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:r.title})]},r.id))]}):I?n?t.jsx(Fe,{connectionId:I.id,orgId:m.id,orgSlug:m.slug,installation:n,onSelectRepo:r=>T.mutate(r),isSaving:T.isPending,autoRespondEnabled:c,onAutoRespondChange:g,selectedAutomationKeys:w,onAutomationKeysChange:j,hideAutoRespondCheckbox:l}):t.jsx(Le,{connectionId:I.id,orgId:m.id,orgSlug:m.slug,onSelect:o,showBackButton:u.length>1,onBack:()=>h(null)}):null}function Le(s){const e=H.c(47),{connectionId:n,orgId:o,orgSlug:l,onSelect:d,showBackButton:f,onBack:m}=s;let p;e[0]!==o||e[1]!==l?(p={connectionId:ne,orgId:o,orgSlug:l},e[0]=o,e[1]=l,e[2]=p):p=e[2];const b=D(p),i=Y(),h=te();let c;e[3]!==n||e[4]!==o?(c=F.githubUserOrgs(o,n),e[3]=n,e[4]=o,e[5]=c):c=e[5];let g;e[6]!==n||e[7]!==b?(g=()=>Ie(y=>b.callTool(y),n),e[6]=n,e[7]=b,e[8]=g):g=e[8];let w;e[9]!==c||e[10]!==g?(w={queryKey:c,queryFn:g},e[9]=c,e[10]=g,e[11]=w):w=e[11];const j=le(w);let N;e[12]!==h||e[13]!==n||e[14]!==j||e[15]!==o||e[16]!==l||e[17]!==i?(N={mutationFn:async()=>{const y=await se({connectionId:n,orgId:o,orgSlug:l,persistFallback:r=>h.update.mutateAsync({id:n,data:{connection_token:r}}).then(Me)});if(y.ran&&!y.ok)throw new Error(y.error??"no token received");const T=new URL(`/api/${l}/mcp/${n}`,window.location.origin);await i.invalidateQueries({queryKey:F.isMCPAuthenticated(T.href,null)}),await i.invalidateQueries({queryKey:F.mcpClientPrefix()}),await j.refetch()},onError:ze},e[12]=h,e[13]=n,e[14]=j,e[15]=o,e[16]=l,e[17]=i,e[18]=N):N=e[18];const C=ee(N);if(j.isLoading){let y;return e[19]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(U,{size:18,className:"animate-spin text-muted-foreground"})}),e[19]=y):y=e[19],y}if(j.isError){let y,T;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"}),T=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:"Your GitHub connection may have expired. Reconnect to restore access."}),e[20]=y,e[21]=T):(y=e[20],T=e[21]);let r;e[22]!==C?(r=()=>C.mutate(),e[22]=C,e[23]=r):r=e[23];let k;e[24]!==C.isPending?(k=C.isPending?t.jsx(U,{size:14,className:"animate-spin"}):t.jsx(z,{className:"size-3.5"}),e[24]=C.isPending,e[25]=k):k=e[25];let A;return e[26]!==C.isPending||e[27]!==r||e[28]!==k?(A=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[y,T,t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:r,disabled:C.isPending,children:[k,"Reconnect GitHub"]})]}),e[26]=C.isPending,e[27]=r,e[28]=k,e[29]=A):A=e[29],A}const x=j.data;if(!x)return null;let u;e[30]!==m||e[31]!==f?(u=f&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:m,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(oe,{size:12}),"Change connection"]})}),e[30]=m,e[31]=f,e[32]=u):u=e[32];let a;if(e[33]!==x.installations||e[34]!==d){let y;e[36]!==d?(y=T=>t.jsxs("button",{type:"button",onClick:()=>d(T),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:T.avatarUrl,alt:T.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:T.login}),T.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 →"})]},T.installationId),e[36]=d,e[37]=y):y=e[37],a=x.installations.map(y),e[33]=x.installations,e[34]=d,e[35]=a}else a=e[35];let I;e[38]!==a?(I=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:a}),e[38]=a,e[39]=I):I=e[39];const v=x.appSlug?`https://github.com/apps/${x.appSlug}/installations/new`:"https://github.com/settings/installations";let S;e[40]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[40]=S):S=e[40];let E;e[41]!==v?(E=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:v,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",S]})}),e[41]=v,e[42]=E):E=e[42];let _;return e[43]!==E||e[44]!==u||e[45]!==I?(_=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[u,I,E]}),e[43]=E,e[44]=u,e[45]=I,e[46]=_):_=e[46],_}function ze(s){L.error("Failed to reconnect GitHub: "+(s instanceof Error?s.message:"Unknown error"))}function Me(){}function Fe(s){const e=H.c(27),{connectionId:n,orgId:o,orgSlug:l,installation:d,onSelectRepo:f,isSaving:m,autoRespondEnabled:p,onAutoRespondChange:b,selectedAutomationKeys:i,onAutomationKeysChange:h,hideAutoRespondCheckbox:c}=s,[g,w]=$.useState(""),j=he(g,300),N=$.useDeferredValue(j),C=g!==N;let x;e[0]!==C||e[1]!==g?(x=t.jsx(xe,{placeholder:"Search repositories...",value:g,onChange:w,isSearching:C}),e[0]=C,e[1]=g,e[2]=x):x=e[2];const u=C?"opacity-40":"opacity-100";let a;e[3]!==u?(a=V("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",u),e[3]=u,e[4]=a):a=e[4];let I;e[5]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(U,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=I):I=e[5];let v;e[6]!==n||e[7]!==N||e[8]!==d||e[9]!==m||e[10]!==f||e[11]!==o||e[12]!==l?(v=t.jsx($.Suspense,{fallback:I,children:t.jsx(Ue,{connectionId:n,orgId:o,orgSlug:l,installation:d,query:N,onSelectRepo:f,isSaving:m})}),e[6]=n,e[7]=N,e[8]=d,e[9]=m,e[10]=f,e[11]=o,e[12]=l,e[13]=v):v=e[13];let S;e[14]!==a||e[15]!==v?(S=t.jsx("div",{className:a,children:v}),e[14]=a,e[15]=v,e[16]=S):S=e[16];let E;e[17]!==p||e[18]!==c||e[19]!==b||e[20]!==h||e[21]!==i?(E=!c&&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(W,{checked:p,onCheckedChange:y=>b(y===!0)}),t.jsx("span",{className:"text-xs text-foreground",children:"Set up GitHub automations for this repo"})]}),p&&t.jsx("div",{className:"px-4 pb-3 pl-9 flex flex-col gap-1.5",children:B.map(y=>t.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[t.jsx(W,{checked:i.has(y.key),onCheckedChange:T=>{const r=new Set(i);T===!0?r.add(y.key):r.delete(y.key),h(r)}}),t.jsx("span",{className:"text-xs text-muted-foreground",children:y.label})]},y.key))})]}),e[17]=p,e[18]=c,e[19]=b,e[20]=h,e[21]=i,e[22]=E):E=e[22];let _;return e[23]!==x||e[24]!==S||e[25]!==E?(_=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[x,S,E]}),e[23]=x,e[24]=S,e[25]=E,e[26]=_):_=e[26],_}function Ue(s){const e=H.c(29),{connectionId:n,orgId:o,orgSlug:l,installation:d,query:f,onSelectRepo:m,isSaving:p}=s;let b;e[0]!==n||e[1]!==o||e[2]!==l?(b={connectionId:n,orgId:o,orgSlug:l},e[0]=n,e[1]=o,e[2]=l,e[3]=b):b=e[3];const i=D(b),h=d.type==="User"?"user":"org",c=f?`${h}:${d.login} ${f} in:name`:`${h}:${d.login}`;let g;e[4]!==n||e[5]!==d.login||e[6]!==o||e[7]!==f?(g=F.githubOrgRepos(o,n,d.login,f),e[4]=n,e[5]=d.login,e[6]=o,e[7]=f,e[8]=g):g=e[8];let w;e[9]!==i||e[10]!==c?(w=async u=>{const{signal:a}=u,v=(await i.callTool({name:"search_repositories",arguments:{query:c,page:1,perPage:30}},void 0,{signal:a})).content?.[0]?.text;if(!v)throw new Error("No response from search_repositories");return(JSON.parse(v).items??[]).map(De)},e[9]=i,e[10]=c,e[11]=w):w=e[11];let j;e[12]!==g||e[13]!==w?(j={queryKey:g,queryFn:w},e[12]=g,e[13]=w,e[14]=j):j=e[14];const{data:N}=ue(j);if(N.length===0){let u;e[15]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=u):u=e[15];let a;e[16]!==f?(a=f&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=f,e[17]=a):a=e[17];let I;return e[18]!==a?(I=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[u,a]}),e[18]=a,e[19]=I):I=e[19],I}let C;if(e[20]!==p||e[21]!==m||e[22]!==N){let u;e[24]!==p||e[25]!==m?(u=a=>t.jsxs("button",{type:"button",onClick:()=>m(a),disabled:p,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(z,{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:a.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:[a.private?t.jsx(de,{size:10}):t.jsx(we,{size:10}),a.private?"Private":"Public"]})]},a.fullName),e[24]=p,e[25]=m,e[26]=u):u=e[26],C=N.map(u),e[20]=p,e[21]=m,e[22]=N,e[23]=C}else C=e[23];let x;return e[27]!==C?(x=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:C}),e[27]=C,e[28]=x):x=e[28],x}function De(s){return{name:s.name,fullName:s.full_name,owner:s.full_name.split("/")[0]??"",url:s.html_url,private:s.private,description:s.description,updatedAt:s.updated_at}}function Q(s){const e=H.c(33),{status:n,error:o,retry:l}=s;if(n==="error"){let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(z,{className:"size-5 text-destructive"})}),e[0]=v):v=e[0];let S;e[1]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=S):S=e[1];const E=o??"Something went wrong while connecting to GitHub.";let _;e[2]!==E?(_=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[S,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:E})]}),e[2]=E,e[3]=_):_=e[3];let y;e[4]!==l?(y=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]=y):y=e[5];let T;return e[6]!==_||e[7]!==y?(T=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[v,_,y]}),e[6]=_,e[7]=y,e[8]=T):T=e[8],T}const d=n==="authenticating";let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(z,{className:"size-5 text-foreground"})}),e[9]=f):f=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"relative size-10",children:[f,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(U,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=m):m=e[10];const p=d?"Authenticating with GitHub":"Setting up GitHub";let b;e[11]!==p?(b=t.jsx("p",{className:"text-sm font-medium",children:p}),e[11]=p,e[12]=b):b=e[12];const i=d?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let h;e[13]!==i?(h=t.jsx("p",{className:"text-xs text-muted-foreground",children:i}),e[13]=i,e[14]=h):h=e[14];let c;e[15]!==b||e[16]!==h?(c=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[b,h]}),e[15]=b,e[16]=h,e[17]=c):c=e[17];const g=d?"bg-muted-foreground/30":"bg-foreground animate-pulse";let w;e[18]!==g?(w=V("size-1.5 rounded-full",g),e[18]=g,e[19]=w):w=e[19];let j;e[20]!==w?(j=t.jsx("span",{className:w}),e[20]=w,e[21]=j):j=e[21];const N=d?"bg-foreground animate-pulse":"bg-muted-foreground/30";let C;e[22]!==N?(C=V("size-1.5 rounded-full",N),e[22]=N,e[23]=C):C=e[23];let x;e[24]!==C?(x=t.jsx("span",{className:C}),e[24]=C,e[25]=x):x=e[25];let u;e[26]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=u):u=e[26];let a;e[27]!==j||e[28]!==x?(a=t.jsxs("div",{className:"flex items-center gap-1.5",children:[j,x,u]}),e[27]=j,e[28]=x,e[29]=a):a=e[29];let I;return e[30]!==a||e[31]!==c?(I=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[m,c,a]}),e[30]=a,e[31]=c,e[32]=I):I=e[32],I}export{it as G,z as a,Te as b,Ee as g,rt as i,X as p,Re as u};