decocms 3.106.1 → 3.108.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 (225) hide show
  1. package/dist/client/assets/{AlertCircle-Xqr6j1ec.js → AlertCircle-CXfHCFxW.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-JIM5EKmo.js → ArrowUpRight-DrIFBuVF.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-0YWte2gD.js → CheckCircle-V4cMbp7k.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-BynJeIwt.js → ChevronDown-yYhj5xP_.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-DQiHQWQL.js → ChevronLeft-eYxyU36o.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-D9yn8jpR.js → ChevronRight-B69CKZdN.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-Cw2uQynG.js → ChevronUp-BYmO7ni8.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-s-I-SeMs.js → DotsVertical-OVel04b-.js} +1 -1
  9. package/dist/client/assets/{Eye-Dy66amqx.js → Eye-DJDSbP4d.js} +1 -1
  10. package/dist/client/assets/{FilterLines-CKjQJFz5.js → FilterLines-Ch9sNilm.js} +1 -1
  11. package/dist/client/assets/{Globe01-ClbfJyVj.js → Globe01-YUd_dhFu.js} +1 -1
  12. package/dist/client/assets/{Globe04-2CK2mPg1.js → Globe04-Bn_dGrXD.js} +1 -1
  13. package/dist/client/assets/{HardDrive-Dx19OIYm.js → HardDrive-i1NQBY0F.js} +1 -1
  14. package/dist/client/assets/{Key01-CYpto-hP.js → Key01-CzuZ2YNH.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-DfuPk5zB.js → LayoutLeft-DQ4hyaOy.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-BY6pxfcE.js → LinkExternal01-CUaKk4PO.js} +1 -1
  17. package/dist/client/assets/{Monitor01-DIakRasc.js → Monitor01-BMQf5bju.js} +1 -1
  18. package/dist/client/assets/{Palette-BiMvnm3j.js → Palette-DVMpwycK.js} +1 -1
  19. package/dist/client/assets/{Play-RNy-gHCT.js → Play-Da7BpsHX.js} +1 -1
  20. package/dist/client/assets/{Plus-BUzQUcBo.js → Plus-DLu0p3LB.js} +1 -1
  21. package/dist/client/assets/{SearchLg-BrFHn1VQ.js → SearchLg-BG10mFZp.js} +1 -1
  22. package/dist/client/assets/{SearchMd-BCWqgdhj.js → SearchMd-TgGSUo83.js} +1 -1
  23. package/dist/client/assets/{Settings02-e1tD5mMi.js → Settings02-C_i5syXv.js} +1 -1
  24. package/dist/client/assets/{Shield01-CCbPTO_T.js → Shield01-DWhnEyqf.js} +1 -1
  25. package/dist/client/assets/{Star01-K-8uJAnL.js → Star01-DIQdWhPq.js} +1 -1
  26. package/dist/client/assets/{Stars01-DC5B5fh3.js → Stars01-D34hqc6C.js} +1 -1
  27. package/dist/client/assets/{Stars02-D2H5PbBg.js → Stars02-C1ilg1eR.js} +1 -1
  28. package/dist/client/assets/{Sun-BEU2sOPn.js → Sun-DPvbuD5f.js} +1 -1
  29. package/dist/client/assets/{SwitchHorizontal01-CuuAQB1I.js → SwitchHorizontal01-Bp6ZXj5h.js} +1 -1
  30. package/dist/client/assets/{Tool01-CfYPNw_C.js → Tool01--3NfnsTB.js} +1 -1
  31. package/dist/client/assets/{Trash01-mBWH2_eT.js → Trash01-BktfczUu.js} +1 -1
  32. package/dist/client/assets/{Upload01-C5TCL0j-.js → Upload01-BWZGJ0bu.js} +1 -1
  33. package/dist/client/assets/{User01-DLp0deex.js → User01-BE-MaNNT.js} +1 -1
  34. package/dist/client/assets/{Users01-fyeOJNBU.js → Users01-DRAatqmi.js} +1 -1
  35. package/dist/client/assets/{Users03-6gLyEuGv.js → Users03-DNP40ou1.js} +1 -1
  36. package/dist/client/assets/{X-BICfxl5D.js → X-D4V_xKxB.js} +1 -1
  37. package/dist/client/assets/{XCircle-CKou8mpC.js → XCircle-Zk6uYFNc.js} +1 -1
  38. package/dist/client/assets/{XClose-xV2ZQDrx.js → XClose-CJbbgFu-.js} +1 -1
  39. package/dist/client/assets/{Zap-Dc5VDOja.js → Zap-DOCsW5bs.js} +1 -1
  40. package/dist/client/assets/{ZapSquare-O2LJAU94.js → ZapSquare-ZiXXTR85.js} +1 -1
  41. package/dist/client/assets/{ZoomOut-TulSR7oT.js → ZoomOut-CBydRAMI.js} +1 -1
  42. package/dist/client/assets/{access-gate-BgsOEZrK.js → access-gate-Bsc7QUw1.js} +1 -1
  43. package/dist/client/assets/{add-section-modal-BZfRz2dr.js → add-section-modal-DxNRWOxr.js} +1 -1
  44. package/dist/client/assets/{agent-icon-CmJIYKNa.js → agent-icon-Codzh2dR.js} +1 -1
  45. package/dist/client/assets/{agents-list-ClT2kfHF.js → agents-list-D9ga9IUz.js} +1 -1
  46. package/dist/client/assets/{ai-providers-DMmN4ueH.js → ai-providers-BzO5It1w.js} +1 -1
  47. package/dist/client/assets/{alert-BCNR7EVx.js → alert-B08OvpyD.js} +1 -1
  48. package/dist/client/assets/{alert-dialog-ZMN4L58U.js → alert-dialog-Cey7j4CE.js} +1 -1
  49. package/dist/client/assets/app-editor-B_z3STUJ.js +1 -0
  50. package/dist/client/assets/{auth-Ci0maryd.js → auth-D-VB6PXw.js} +1 -1
  51. package/dist/client/assets/{auth-catchall-BZbp3bDE.js → auth-catchall-dvMxAJYZ.js} +1 -1
  52. package/dist/client/assets/{auth-entry-DoyiD20Z.js → auth-entry-Sc8ZEToz.js} +1 -1
  53. package/dist/client/assets/{auth-split-layout-IB7BGkE-.js → auth-split-layout-D1BIRB9g.js} +1 -1
  54. package/dist/client/assets/{authenticate-and-persist-oauth-CZPX5X5k.js → authenticate-and-persist-oauth-CIVGnsAG.js} +1 -1
  55. package/dist/client/assets/{automation-list-row-wzlcI0kv.js → automation-list-row-7n10xHBN.js} +1 -1
  56. package/dist/client/assets/{automation-runs-Cz-auyir.js → automation-runs-DsB-LYLH.js} +1 -1
  57. package/dist/client/assets/{automations-C3n--i43.js → automations-BPKkcs0G.js} +1 -1
  58. package/dist/client/assets/{avatar-Cd0xwXxq.js → avatar-D50rXO9q.js} +1 -1
  59. package/dist/client/assets/{badge-US-X-4MC.js → badge-DuPrh-k9.js} +1 -1
  60. package/dist/client/assets/{block-document-BiB4Wr2c.js → block-document-By66RUPt.js} +1 -1
  61. package/dist/client/assets/{brand-context-BEutrZxI.js → brand-context-4Vmk5sXu.js} +1 -1
  62. package/dist/client/assets/{buckets-DUN5ldCC.js → buckets-aEEOw89Q.js} +1 -1
  63. package/dist/client/assets/{capability-load-error-B8GWHwlL.js → capability-load-error-CKrEiZ0g.js} +1 -1
  64. package/dist/client/assets/{card-B200otkw.js → card-CSk11DrN.js} +1 -1
  65. package/dist/client/assets/category-editor-C8SeZ2oM.js +1 -0
  66. package/dist/client/assets/chat-context-CYJD3lpS.js +28 -0
  67. package/dist/client/assets/{checkbox-DA-oWLyy.js → checkbox-DhghRz0V.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-BLTFgffv.js → cli-auth-success-C7Z3uy0J.js} +1 -1
  69. package/dist/client/assets/{collection-detail-ksU3fola.js → collection-detail-27aQ6HrN.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-CdmxMOBW.js → collection-display-button-BjZ3KkPT.js} +1 -1
  71. package/dist/client/assets/{collection-search-BvmQJq8P.js → collection-search-3g2v_4Ig.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-BLB5SWZa.js → collection-tabs-NH0QHVtb.js} +1 -1
  73. package/dist/client/assets/{command-esgtnpD6.js → command-DuFRSin9.js} +1 -1
  74. package/dist/client/assets/{commerce-onboarding-CmxbKnuZ.js → commerce-onboarding-Fg1zVI63.js} +1 -1
  75. package/dist/client/assets/{connect-desktop-dialog-BBGOPoIq.js → connect-desktop-dialog-C4RGGomP.js} +1 -1
  76. package/dist/client/assets/{connection-card-BH-OGmTu.js → connection-card-Bxwr78j_.js} +1 -1
  77. package/dist/client/assets/{connection-detail-BqcZ4rre.js → connection-detail-CnruFFRa.js} +1 -1
  78. package/dist/client/assets/{connection-form-helpers-Bi2tQByg.js → connection-form-helpers-N3pDB096.js} +1 -1
  79. package/dist/client/assets/{connections-rl2xlhQn.js → connections-C-pSski3.js} +1 -1
  80. package/dist/client/assets/{context-menu-zwWLAMxe.js → context-menu-D_t5y3rp.js} +1 -1
  81. package/dist/client/assets/{decopilot-bUCWwVB7.js → decopilot-D2kjmvQ8.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-IAlPSPK_.js → decopilot-sse-pool-DaS9jANP.js} +1 -1
  83. package/dist/client/assets/{dialog-BxPiF5oN.js → dialog-59pZJLRI.js} +1 -1
  84. package/dist/client/assets/{domain-settings-CeRsMV94.js → domain-settings-B_IJ176N.js} +1 -1
  85. package/dist/client/assets/{drawer-DaarKmto.js → drawer-CardDBvQ.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-CZpb3eYC.js → dropdown-menu-KRYgKsut.js} +1 -1
  87. package/dist/client/assets/{empty-state-CAlFsQdU.js → empty-state-DdjF8vs8.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-Dsj4pa-O.js → extract-connection-data-C3rg-zH0.js} +1 -1
  89. package/dist/client/assets/file-explorer-Dbf1GYee.js +2 -0
  90. package/dist/client/assets/{file-type-icon-BwBw9jgA.js → file-type-icon-DE5lANHh.js} +1 -1
  91. package/dist/client/assets/{files-Ywa5pDAk.js → files-ChV7PLN8.js} +1 -1
  92. package/dist/client/assets/{form-Bf2ApXQo.js → form-D9GCz4p7.js} +1 -1
  93. package/dist/client/assets/{general-C7ye12K0.js → general-Dt3BDK6z.js} +1 -1
  94. package/dist/client/assets/{github-repo-picker--XFvpeLm.js → github-repo-picker-CH_d9yqP.js} +1 -1
  95. package/dist/client/assets/{hooks-B9L41m_Y.js → hooks-DXPWHoBZ.js} +1 -1
  96. package/dist/client/assets/{import-from-deco-dialog-CZYRrcZ4.js → import-from-deco-dialog-CaK-LsBV.js} +1 -1
  97. package/dist/client/assets/index-B0PhVd0n.js +1 -0
  98. package/dist/client/assets/{index-B8k191tl.js → index-BNIB-FKU.js} +1 -1
  99. package/dist/client/assets/{index-DBTxlw_P.js → index-BRTT5sEO.js} +1 -1
  100. package/dist/client/assets/{index-Dxw7KXbh.js → index-BkE4vJGC.js} +1 -1
  101. package/dist/client/assets/{index-DqbKvpBX.js → index-C3LTWsPC.js} +1 -1
  102. package/dist/client/assets/{index-CvGS2PsG.js → index-CU99baeo.js} +12 -12
  103. package/dist/client/assets/{index-Q6pGpUHX.js → index-CUeWfuiR.js} +1 -1
  104. package/dist/client/assets/index-D7FZbpdh.js +3 -0
  105. package/dist/client/assets/{index-PCJmXHv-.js → index-DEb9cZMY.js} +1 -1
  106. package/dist/client/assets/{index-gHhgmmKj.js → index-DHU91und.js} +1 -1
  107. package/dist/client/assets/{index-OO3MJk0K.js → index-DxlSlPki.js} +1 -1
  108. package/dist/client/assets/{index-BWgKDEIC.js → index-K4SWWTMm.js} +5 -5
  109. package/dist/client/assets/{index-D9z3Q7j8.js → index-clvydX21.js} +1 -1
  110. package/dist/client/assets/{index-BSJueg0-.js → index-kan1E63X.js} +4 -4
  111. package/dist/client/assets/{index-redirect-B85UW6J0.js → index-redirect-K7OU_kx0.js} +1 -1
  112. package/dist/client/assets/{input-cp_TKu2Y.js → input-CWK_KDxP.js} +1 -1
  113. package/dist/client/assets/{integration-icon-CmIcxQej.js → integration-icon-C9tNQbt4.js} +1 -1
  114. package/dist/client/assets/{label-Bqc_uyUQ.js → label-CShBo-xr.js} +1 -1
  115. package/dist/client/assets/{login-D-sAQcuc.js → login-CLs68272.js} +1 -1
  116. package/dist/client/assets/{mcp-oauth-C63GAzZt.js → mcp-oauth-CRmn6hwI.js} +1 -1
  117. package/dist/client/assets/{members-Cm4EmLJ1.js → members-CX3tAqjr.js} +1 -1
  118. package/dist/client/assets/{monaco-editor-CpkaOm7i.js → monaco-editor-DCdpc6i0.js} +1 -1
  119. package/dist/client/assets/{monitoring-stats-row-DNfFrBf6.js → monitoring-stats-row-CadxzAo4.js} +1 -1
  120. package/dist/client/assets/{oauth-callback-B6xjzh36.js → oauth-callback-CjuKHJXG.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-ai-provider-C4bzhTUi.js → oauth-callback-ai-provider-BWRJmgDm.js} +1 -1
  122. package/dist/client/assets/{onboarding-BOmFCgNY.js → onboarding-red4rHCD.js} +1 -1
  123. package/dist/client/assets/{org-install-DJi_hBJB.js → org-install-Bsn3y6Z3.js} +1 -1
  124. package/dist/client/assets/{org-layout-Dist7T6X.js → org-layout-al_5BNwo.js} +1 -1
  125. package/dist/client/assets/{organization-choice-COX5rRn1.js → organization-choice-DJNr5D-D.js} +1 -1
  126. package/dist/client/assets/{page-seo-form-DeC7xkG4.js → page-seo-form-BuiEAYj4.js} +1 -1
  127. package/dist/client/assets/page-seo-sheet-CCQj63mK.js +1 -0
  128. package/dist/client/assets/{popover-C5HgpX4x.js → popover-Dhad0x9g.js} +1 -1
  129. package/dist/client/assets/post-editor-BQmK2uFu.js +1 -0
  130. package/dist/client/assets/preview-dialog-BvNzeY3T.js +5 -0
  131. package/dist/client/assets/{primitives-DTGB3Mts.js → primitives-Dr1eHlQS.js} +1 -1
  132. package/dist/client/assets/{profile-B3f7KSDE.js → profile-e6Bm5lWR.js} +1 -1
  133. package/dist/client/assets/project-app-view-DYSfhAgu.js +1 -0
  134. package/dist/client/assets/record-editor-bF_UstVB.js +1 -0
  135. package/dist/client/assets/registry-Dm6eGhVz.js +2 -0
  136. package/dist/client/assets/{registry-layout-BuBeN6w1.js → registry-layout-CymZuomq.js} +1 -1
  137. package/dist/client/assets/{require-capability-Ddee1AmI.js → require-capability-B1rUcboM.js} +1 -1
  138. package/dist/client/assets/{required-auth-layout-C5MLQuQM.js → required-auth-layout-s2Bxat9U.js} +1 -1
  139. package/dist/client/assets/{reset-password-BqewD2Xb.js → reset-password-DY5g84O-.js} +1 -1
  140. package/dist/client/assets/{roles-D2yEgJSq.js → roles-Iy3MXVa3.js} +1 -1
  141. package/dist/client/assets/{scroll-area-DQp5D973.js → scroll-area-Xtfwdb7m.js} +2 -2
  142. package/dist/client/assets/{search-input-Be3BJ5YO.js → search-input-DQ6UrvBE.js} +1 -1
  143. package/dist/client/assets/{secrets-yrIWdsoK.js → secrets-CIe2s2f1.js} +1 -1
  144. package/dist/client/assets/{sections-editor-DqTPco-Q.js → sections-editor-DsFaeF53.js} +2 -2
  145. package/dist/client/assets/{select-DTMty5cI.js → select-Do7P1LSG.js} +1 -1
  146. package/dist/client/assets/{select-model-Cv0Zl4px.js → select-model-DlSLJO4Y.js} +1 -1
  147. package/dist/client/assets/seo-editor-Shj7XB4v.js +1 -0
  148. package/dist/client/assets/{settings-layout-CooyVDE-.js → settings-layout-BEHXbjxx.js} +1 -1
  149. package/dist/client/assets/{settings-section-Czv-RCDl.js → settings-section-ZqpVSrVJ.js} +1 -1
  150. package/dist/client/assets/{sheet-BYUn2G0P.js → sheet-CwpMGMQ9.js} +1 -1
  151. package/dist/client/assets/{shell-controls-aiEu-oNo.js → shell-controls-DROWNa_M.js} +1 -1
  152. package/dist/client/assets/{shell-layout-DlX3hQOg.js → shell-layout-BBvvEdo0.js} +1 -1
  153. package/dist/client/assets/{shell-route-loading-B5fcdA3q.js → shell-route-loading-XVhs5R31.js} +1 -1
  154. package/dist/client/assets/{sidebar-bM2CxBRy.js → sidebar-DS_youLc.js} +1 -1
  155. package/dist/client/assets/{skeleton-DGyuQcWM.js → skeleton-Bvrl2WPh.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-BpfhpFW8.js → sortable.esm-LdSILUfx.js} +1 -1
  157. package/dist/client/assets/{sso-4AoXSWbM.js → sso-c2vK4RMY.js} +1 -1
  158. package/dist/client/assets/{store-Di9pgKIN.js → store-DoxveVdc.js} +1 -1
  159. package/dist/client/assets/store-registry-BNTE3Ckc.js +2 -0
  160. package/dist/client/assets/{studio-tools-FVMOC3DG.js → studio-tools-BMwxp5pS.js} +1 -1
  161. package/dist/client/assets/{switch-RrT6wLYL.js → switch-H7aX0suB.js} +1 -1
  162. package/dist/client/assets/{table-FgURfELI.js → table-qhDDbEpO.js} +1 -1
  163. package/dist/client/assets/{tabs-Dyn89gKO.js → tabs-B6eIa2zt.js} +1 -1
  164. package/dist/client/assets/{task-status-ClaTWvtm.js → task-status-D9utHgZw.js} +1 -1
  165. package/dist/client/assets/{textarea-Sgn1Re8l.js → textarea-PSzbbOkb.js} +1 -1
  166. package/dist/client/assets/{toggle-group-DLGm3J-b.js → toggle-group-Bz1hQE3a.js} +1 -1
  167. package/dist/client/assets/{toolbar-CSosPZ4D.js → toolbar-DCCrTBZW.js} +1 -1
  168. package/dist/client/assets/{tooltip-h0yvcJt8.js → tooltip-Ct27xL12.js} +1 -1
  169. package/dist/client/assets/{types-BRex8hoG.js → types-BwDuw3G9.js} +1 -1
  170. package/dist/client/assets/{use-ai-providers-hvnDjM8p.js → use-ai-providers-DFaFMw_I.js} +1 -1
  171. package/dist/client/assets/{use-automations-BKwvpJAo.js → use-automations-uZj9fR0Z.js} +1 -1
  172. package/dist/client/assets/{use-capability-CFzya3JS.js → use-capability-CSJPfpi0.js} +1 -1
  173. package/dist/client/assets/{use-clock-tick-DMIcMeX9.js → use-clock-tick-uQ0gKwJZ.js} +1 -1
  174. package/dist/client/assets/{use-collections-_UlIpgjP.js → use-collections-B6Y5SE5i.js} +1 -1
  175. package/dist/client/assets/{use-connection-BxSCzh2E.js → use-connection-CCYwDyNR.js} +1 -1
  176. package/dist/client/assets/{use-copy-BvBAqh5C.js → use-copy-Y55SDaZL.js} +1 -1
  177. package/dist/client/assets/{use-create-virtual-mcp-DjQWwvK4.js → use-create-virtual-mcp-CuoNkLte.js} +1 -1
  178. package/dist/client/assets/{use-debounced-autosave-BHDQ7RHW.js → use-debounced-autosave-BL-N3Gnu.js} +1 -1
  179. package/dist/client/assets/{use-debounced-value-BB2O7NbI.js → use-debounced-value-DpZKy_Iw.js} +1 -1
  180. package/dist/client/assets/{use-decopilot-events-CRfiqA6B.js → use-decopilot-events-EyZW0ScP.js} +1 -1
  181. package/dist/client/assets/{use-delete-connection-Pw6IkYwM.js → use-delete-connection-CPSKVnox.js} +1 -1
  182. package/dist/client/assets/{use-file-configs-BasVpNvI.js → use-file-configs-hHuL8QEC.js} +1 -1
  183. package/dist/client/assets/{use-infinite-scroll-BSMoGR4k.js → use-infinite-scroll-BW9P8xBl.js} +1 -1
  184. package/dist/client/assets/{use-join-requests-Df5JF2iE.js → use-join-requests-CTzuXwK-.js} +1 -1
  185. package/dist/client/assets/{use-mcp-client-Bcb6PO24.js → use-mcp-client-B0s_8EVJ.js} +1 -1
  186. package/dist/client/assets/{use-mcp-prompts-AJeQrCqj.js → use-mcp-prompts-C9WyhCpr.js} +1 -1
  187. package/dist/client/assets/{use-mcp-tools-qTvFx3Nb.js → use-mcp-tools-BTQ51TI6.js} +1 -1
  188. package/dist/client/assets/{use-members-zes1mdlJ.js → use-members-Cho9vXKF.js} +1 -1
  189. package/dist/client/assets/{use-mobile-CMJi7yoD.js → use-mobile-CHScOeMy.js} +1 -1
  190. package/dist/client/assets/{use-navigate-to-agent-C83xFoxW.js → use-navigate-to-agent-BLrW4hmi.js} +1 -1
  191. package/dist/client/assets/{use-org-auth-client-DJhVKhdJ.js → use-org-auth-client-T24QkUeZ.js} +1 -1
  192. package/dist/client/assets/use-org-fs-BbjnF7sq.js +1 -0
  193. package/dist/client/assets/{use-org-sso-C1crpljI.js → use-org-sso-CoPgbTky.js} +1 -1
  194. package/dist/client/assets/{use-organization-roles-m3zsO9Ct.js → use-organization-roles-uXtY0vKk.js} +1 -1
  195. package/dist/client/assets/{use-organization-settings-D1Ju0RBO.js → use-organization-settings-BdRr72qh.js} +1 -1
  196. package/dist/client/assets/{use-registry-connections-iyE_-Lc9.js → use-registry-connections-HtzalUOh.js} +1 -1
  197. package/dist/client/assets/{use-secrets-DnspbGKA.js → use-secrets-CnXSg99O.js} +1 -1
  198. package/dist/client/assets/{use-status-sounds-HySek8pC.js → use-status-sounds-CFfhXfZc.js} +1 -1
  199. package/dist/client/assets/{use-view-mode-ZGLIhwLE.js → use-view-mode-1gUAJUA2.js} +1 -1
  200. package/dist/client/assets/{use-virtual-mcp-co7b_FD9.js → use-virtual-mcp-BN8buKcT.js} +1 -1
  201. package/dist/client/assets/useInfiniteQuery-D-FFXkXU.js +1 -0
  202. package/dist/client/assets/useSuspenseInfiniteQuery-BfIitBar.js +1 -0
  203. package/dist/client/assets/{useSuspenseQueries-DnuDPZjI.js → useSuspenseQueries-qD79q_C-.js} +1 -1
  204. package/dist/client/assets/{variant-calendar-DDApZRGI.js → variant-calendar-D0oFAKUu.js} +1 -1
  205. package/dist/client/assets/{view-mode-toggle-BChdPYXY.js → view-mode-toggle-PleSLbFB.js} +1 -1
  206. package/dist/client/index.html +1 -1
  207. package/dist/server/cli.js +361 -361
  208. package/dist/server/server.js +249 -249
  209. package/package.json +1 -1
  210. package/dist/client/assets/app-editor-CnqMwcfe.js +0 -1
  211. package/dist/client/assets/category-editor-DSfTPN75.js +0 -1
  212. package/dist/client/assets/chat-context-GFFBEPEU.js +0 -21
  213. package/dist/client/assets/file-explorer-CQwIfJcQ.js +0 -2
  214. package/dist/client/assets/index-DiptY5jt.js +0 -3
  215. package/dist/client/assets/index-_pdBi5yI.js +0 -1
  216. package/dist/client/assets/page-seo-sheet-F5FfJolP.js +0 -1
  217. package/dist/client/assets/post-editor-DSFBqpu_.js +0 -1
  218. package/dist/client/assets/preview-dialog-BdwQBPGz.js +0 -5
  219. package/dist/client/assets/project-app-view-By8MOEIa.js +0 -1
  220. package/dist/client/assets/record-editor-Bos57gw5.js +0 -1
  221. package/dist/client/assets/registry-DxM4RNob.js +0 -2
  222. package/dist/client/assets/seo-editor-DqNZ_ieG.js +0 -1
  223. package/dist/client/assets/store-registry-D-YwJpzW.js +0 -2
  224. package/dist/client/assets/useInfiniteQuery-CuzY8zzZ.js +0 -1
  225. package/dist/client/assets/useSuspenseInfiniteQuery-BpUXD3KF.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decocms",
3
- "version": "3.106.1",
3
+ "version": "3.108.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 ge,r as w,j as o,l as ye,t as ue,i as Se}from"./index-BSJueg0-.js";import{i as je}from"./ChevronRight-D9yn8jpR.js";import{S as ke}from"./scroll-area-DQp5D973.js";import{A as _e}from"./add-section-modal-BZfRz2dr.js";import{ap as Be,aq as we,ar as Ae,j as Ne,k as Re,as as Ce,Y as Ee,at as Ke,ac as Te}from"./index-CvGS2PsG.js";import"./agent-icon-CmJIYKNa.js";import"./AlertCircle-Xqr6j1ec.js";import"./Tool01-CfYPNw_C.js";import"./SwitchHorizontal01-CuuAQB1I.js";import"./Settings02-e1tD5mMi.js";import"./XCircle-CKou8mpC.js";import"./ArrowUpRight-JIM5EKmo.js";import"./ZapSquare-O2LJAU94.js";import"./Users03-6gLyEuGv.js";import"./CheckCircle-0YWte2gD.js";import"./ChevronUp-Cw2uQynG.js";import"./ChevronDown-BynJeIwt.js";import"./ChevronLeft-DQiHQWQL.js";import"./DotsVertical-s-I-SeMs.js";import"./Stars02-D2H5PbBg.js";import"./Eye-Dy66amqx.js";import"./ZoomOut-TulSR7oT.js";import"./Globe01-ClbfJyVj.js";import"./FilterLines-CKjQJFz5.js";import"./Star01-K-8uJAnL.js";import"./Globe04-2CK2mPg1.js";import"./HardDrive-Dx19OIYm.js";import"./Key01-CYpto-hP.js";import"./LayoutLeft-DfuPk5zB.js";import"./LinkExternal01-BY6pxfcE.js";import"./Monitor01-DIakRasc.js";import"./Sun-BEU2sOPn.js";import"./Palette-BiMvnm3j.js";import"./Play-RNy-gHCT.js";import"./Plus-BUzQUcBo.js";import"./SearchLg-BrFHn1VQ.js";import"./SearchMd-BCWqgdhj.js";import"./Shield01-CCbPTO_T.js";import"./Stars01-DC5B5fh3.js";import"./Trash01-mBWH2_eT.js";import"./Upload01-C5TCL0j-.js";import"./User01-DLp0deex.js";import"./Users01-fyeOJNBU.js";import"./XClose-xV2ZQDrx.js";import"./X-BICfxl5D.js";import"./Zap-Dc5VDOja.js";import"./use-clock-tick-DMIcMeX9.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BvBAqh5C.js";import"./tooltip-h0yvcJt8.js";import"./file-type-icon-BwBw9jgA.js";import"./dialog-BxPiF5oN.js";import"./use-mobile-CMJi7yoD.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-BRex8hoG.js";import"./use-mcp-client-Bcb6PO24.js";import"./auth-Ci0maryd.js";import"./chat-context-GFFBEPEU.js";import"./hooks-B9L41m_Y.js";import"./decopilot-sse-pool-IAlPSPK_.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-co7b_FD9.js";import"./use-collections-_UlIpgjP.js";import"./use-ai-providers-hvnDjM8p.js";import"./studio-tools-FVMOC3DG.js";import"./use-decopilot-events-CRfiqA6B.js";import"./use-organization-settings-D1Ju0RBO.js";import"./shell-layout-DlX3hQOg.js";import"./avatar-Cd0xwXxq.js";import"./required-auth-layout-C5MLQuQM.js";import"./use-org-sso-C1crpljI.js";import"./sheet-BYUn2G0P.js";import"./integration-icon-CmIcxQej.js";import"./use-navigate-to-agent-C83xFoxW.js";import"./use-connection-BxSCzh2E.js";import"./use-mcp-prompts-AJeQrCqj.js";import"./form-Bf2ApXQo.js";import"./label-Bqc_uyUQ.js";import"./input-cp_TKu2Y.js";import"./select-DTMty5cI.js";import"./index-DiptY5jt.js";import"./drawer-DaarKmto.js";import"./collection-search-BvmQJq8P.js";import"./tabs-Dyn89gKO.js";import"./toggle-group-DLGm3J-b.js";import"./sortable.esm-BpfhpFW8.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BH-OGmTu.js";import"./use-registry-connections-iyE_-Lc9.js";import"./useInfiniteQuery-CuzY8zzZ.js";import"./use-infinite-scroll-BSMoGR4k.js";import"./extract-connection-data-Dsj4pa-O.js";import"./card-B200otkw.js";import"./collection-tabs-BLB5SWZa.js";import"./badge-US-X-4MC.js";import"./textarea-Sgn1Re8l.js";import"./connection-form-helpers-Bi2tQByg.js";import"./authenticate-and-persist-oauth-CZPX5X5k.js";import"./mcp-oauth-C63GAzZt.js";import"./useSuspenseInfiniteQuery-BpUXD3KF.js";import"./connect-desktop-dialog-BBGOPoIq.js";import"./decopilot-bUCWwVB7.js";import"./checkbox-DA-oWLyy.js";import"./skeleton-DGyuQcWM.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Czv-RCDl.js";import"./popover-C5HgpX4x.js";import"./command-esgtnpD6.js";import"./index-DBTxlw_P.js";import"./dropdown-menu-CZpb3eYC.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-HySek8pC.js";import"./empty-state-CAlFsQdU.js";import"./toolbar-CSosPZ4D.js";import"./preview-dialog-BdwQBPGz.js";import"./index-gHhgmmKj.js";import"./use-mcp-tools-qTvFx3Nb.js";import"./use-capability-CFzya3JS.js";import"./shell-route-loading-B5fcdA3q.js";import"./index-B8k191tl.js";import"./alert-dialog-ZMN4L58U.js";import"./switch-RrT6wLYL.js";import"./use-debounced-autosave-BHDQ7RHW.js";import"./index-Q6pGpUHX.js";import"./sidebar-bM2CxBRy.js";import"./search-input-Be3BJ5YO.js";import"./github-repo-picker--XFvpeLm.js";import"./use-debounced-value-BB2O7NbI.js";import"./use-secrets-DnspbGKA.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-BChdPYXY.js";import"./automation-runs-Cz-auyir.js";import"./table-FgURfELI.js";import"./use-members-zes1mdlJ.js";import"./use-org-auth-client-DJhVKhdJ.js";import"./task-status-ClaTWvtm.js";import"./use-automations-BKwvpJAo.js";import"./use-file-configs-BasVpNvI.js";import"./monaco-editor-CpkaOm7i.js";import"./select-model-Cv0Zl4px.js";import"./automation-list-row-wzlcI0kv.js";function $e(l,e){const m=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",a=Be(e,f);return{blockKey:a,data:{__resolveType:l.resolveType,name:a}}}function gr(l){const e=ge.c(77),{orgSlug:m,virtualMcpId:f,branch:a,blockKey:i,block:n,meta:s,decofile:c,title:D,excludeFields:H,schemaPending:ae,previewBaseUrl:ne}=l,Y=ae===void 0?!1:ae,u=ne===void 0?null:ne,x=typeof n?.__resolveType=="string"?n.__resolveType:"";let R;e[0]!==H||e[1]!==s||e[2]!==x?(R=we(x,s,H),e[0]=H,e[1]=s,e[2]=x,e[3]=R):R=e[3];const h=R;let C;e[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,e[4]=h,e[5]=C):C=e[5];const G=C;let E;e[6]!==n||e[7]!==i||e[8]!==s||e[9]!==D?(E=D??(n?Ae(i,n,s):i),e[6]=n,e[7]=i,e[8]=s,e[9]=D,e[10]=E):E=e[10];const v=E;let K;e[11]!==a||e[12]!==m||e[13]!==f?(K={orgSlug:m,virtualMcpId:f,branch:a},e[11]=a,e[12]=m,e[13]=f,e[14]=K):K=e[14];const{save:b,flush:J,isPending:Q}=Ne(K);let T;e[15]!==a||e[16]!==m||e[17]!==f?(T={orgSlug:m,virtualMcpId:f,branch:a},e[15]=a,e[16]=m,e[17]=f,e[18]=T):T=e[18];const W=Re(T);let $;e[19]!==b?($=Ee((t,r)=>b(t,r)),e[19]=b,e[20]=$):$=e[20];const X=$,[he,xe]=w.useState(i),[ee,ce]=w.useState(null),[te,de]=w.useState(0);let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=[],e[21]=F):F=e[21];const[p,fe]=w.useState(F),[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 g;e[24]!==ee?(g=ee??{},e[24]=ee,e[25]=g):g=e[25];let q;e[26]!==ie||e[27]!==g?(q={...ie,...g},e[26]=ie,e[27]=g,e[28]=q):q=e[28];const se=q;let z;e[29]!==i||e[30]!==x||e[31]!==b?(z=t=>{const r=t;ce(r),b(i,{...r,__resolveType:x})},e[29]=i,e[30]=x,e[31]=b,e[32]=z):z=e[32];const me=z;let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=t=>{fe(t)},e[33]=L):L=e[33];const pe=L;let V;e[34]!==c||e[35]!==J||e[36]!==W?(V=async(t,r)=>{try{const{blockKey:d,data:N}=$e(t,c);await W.mutateAsync({blockKey:d,data:N}),ue.success(`Created section "${d}"`),r({__resolveType:d}),J()}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]=J,e[36]=W,e[37]=V):V=e[37];const y=V;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]!==y?(U=async t=>{const r=P.current;if(r)try{await y(t,d=>{r(d),re(!1),P.current=null})}catch{}},e[39]=y,e[40]=U):U=e[40];const le=U;let M;e[41]!==p||e[42]!==v?(M=p.length>0?[v,...p]:[],e[41]=p,e[42]=v,e[43]=M):M=e[43];const A=M;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(je,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pe(r===0?[]:Ce(p,r)),de(Fe)},title:t,className:ye("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 j;e[48]!==Q?(j=o.jsx(Ke,{isPending:Q,isError:!1}),e[48]=Q,e[49]=j):j=e[49];let k;e[50]!==S||e[51]!==j?(k=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,j]}),e[50]=S,e[51]=j,e[52]=k):k=e[52];let _;e[53]!==i||e[54]!==p||e[55]!==c||e[56]!==se||e[57]!==te||e[58]!==y||e[59]!==me||e[60]!==G||e[61]!==s||e[62]!==u||e[63]!==X||e[64]!==h||e[65]!==Y?(_=o.jsx(ke,{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:G?o.jsx(Te,{schema:h,value:se,onChange:me,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pe,decofile:c,meta:s,onSaveReferencedBlock:X,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:ve},`${i}:${te}`):Y?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]=se,e[57]=te,e[58]=y,e[59]=me,e[60]=G,e[61]=s,e[62]=u,e[63]=X,e[64]=h,e[65]=Y,e[66]=_):_=e[66];let B;e[67]!==oe||e[68]!==c||e[69]!==le||e[70]!==s||e[71]!==u?(B=u&&o.jsx(_e,{open:oe,onOpenChange:t=>{re(t),t||(P.current=null)},meta:s,decofile:c,previewBaseUrl:u,onSelect:t=>{le(t)}}),e[67]=oe,e[68]=c,e[69]=le,e[70]=s,e[71]=u,e[72]=B):B=e[72];let Z;return e[73]!==k||e[74]!==_||e[75]!==B?(Z=o.jsxs("div",{className:"flex h-full flex-col",children:[k,_,B]}),e[73]=k,e[74]=_,e[75]=B,e[76]=Z):Z=e[76],Z}function Fe(l){return l+1}function Pe(l){return l+1}export{gr as AppEditor};
@@ -1 +0,0 @@
1
- import{c as W,r as S,l as q,j as t,B as U,i as Q,t as I}from"./index-BSJueg0-.js";import{i as X}from"./XCircle-CKou8mpC.js";import{aB as Y,V as T}from"./agent-icon-CmJIYKNa.js";import{n as Z}from"./LinkExternal01-BY6pxfcE.js";import{f as _,a as K,b as tt,c as et,d as ot,e as rt,A as st,g as it}from"./alert-dialog-ZMN4L58U.js";import{I as M}from"./input-cp_TKu2Y.js";import{L}from"./label-Bqc_uyUQ.js";import{au as at,av as nt,aD as mt,at as lt,aw as R,ay as pt,aE as ct}from"./index-CvGS2PsG.js";import{c as dt,B as ut,a as gt}from"./block-document-BiB4Wr2c.js";import{u as xt,s as v,E as ht}from"./primitives-DTGB3Mts.js";import{t as ft}from"./ChevronDown-BynJeIwt.js";import{f as yt,h as jt,e as vt}from"./scroll-area-DQp5D973.js";import"./AlertCircle-Xqr6j1ec.js";import"./Tool01-CfYPNw_C.js";import"./SwitchHorizontal01-CuuAQB1I.js";import"./Settings02-e1tD5mMi.js";import"./ArrowUpRight-JIM5EKmo.js";import"./ZapSquare-O2LJAU94.js";import"./Users03-6gLyEuGv.js";import"./CheckCircle-0YWte2gD.js";import"./ChevronUp-Cw2uQynG.js";import"./ChevronLeft-DQiHQWQL.js";import"./ChevronRight-D9yn8jpR.js";import"./DotsVertical-s-I-SeMs.js";import"./Stars02-D2H5PbBg.js";import"./Eye-Dy66amqx.js";import"./ZoomOut-TulSR7oT.js";import"./Globe01-ClbfJyVj.js";import"./FilterLines-CKjQJFz5.js";import"./Star01-K-8uJAnL.js";import"./Globe04-2CK2mPg1.js";import"./HardDrive-Dx19OIYm.js";import"./Key01-CYpto-hP.js";import"./LayoutLeft-DfuPk5zB.js";import"./Monitor01-DIakRasc.js";import"./Sun-BEU2sOPn.js";import"./Palette-BiMvnm3j.js";import"./Play-RNy-gHCT.js";import"./Plus-BUzQUcBo.js";import"./SearchLg-BrFHn1VQ.js";import"./SearchMd-BCWqgdhj.js";import"./Shield01-CCbPTO_T.js";import"./Stars01-DC5B5fh3.js";import"./Trash01-mBWH2_eT.js";import"./Upload01-C5TCL0j-.js";import"./User01-DLp0deex.js";import"./Users01-fyeOJNBU.js";import"./XClose-xV2ZQDrx.js";import"./X-BICfxl5D.js";import"./Zap-Dc5VDOja.js";import"./index-DiptY5jt.js";import"./chat-context-GFFBEPEU.js";import"./hooks-B9L41m_Y.js";import"./use-mcp-client-Bcb6PO24.js";import"./auth-Ci0maryd.js";import"./decopilot-sse-pool-IAlPSPK_.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-co7b_FD9.js";import"./use-collections-_UlIpgjP.js";import"./use-ai-providers-hvnDjM8p.js";import"./studio-tools-FVMOC3DG.js";import"./use-decopilot-events-CRfiqA6B.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-D1Ju0RBO.js";import"./tooltip-h0yvcJt8.js";import"./dialog-BxPiF5oN.js";import"./drawer-DaarKmto.js";import"./collection-search-BvmQJq8P.js";import"./use-mobile-CMJi7yoD.js";import"./use-mcp-prompts-AJeQrCqj.js";import"./shell-layout-DlX3hQOg.js";import"./avatar-Cd0xwXxq.js";import"./required-auth-layout-C5MLQuQM.js";import"./use-org-sso-C1crpljI.js";import"./form-Bf2ApXQo.js";import"./select-DTMty5cI.js";import"./tabs-Dyn89gKO.js";import"./toggle-group-DLGm3J-b.js";import"./sortable.esm-BpfhpFW8.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BH-OGmTu.js";import"./use-registry-connections-iyE_-Lc9.js";import"./use-connection-BxSCzh2E.js";import"./useInfiniteQuery-CuzY8zzZ.js";import"./use-infinite-scroll-BSMoGR4k.js";import"./extract-connection-data-Dsj4pa-O.js";import"./card-B200otkw.js";import"./integration-icon-CmIcxQej.js";import"./collection-tabs-BLB5SWZa.js";import"./badge-US-X-4MC.js";import"./textarea-Sgn1Re8l.js";import"./connection-form-helpers-Bi2tQByg.js";import"./authenticate-and-persist-oauth-CZPX5X5k.js";import"./mcp-oauth-C63GAzZt.js";import"./useSuspenseInfiniteQuery-BpUXD3KF.js";import"./connect-desktop-dialog-BBGOPoIq.js";import"./decopilot-bUCWwVB7.js";import"./checkbox-DA-oWLyy.js";import"./skeleton-DGyuQcWM.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Czv-RCDl.js";import"./popover-C5HgpX4x.js";import"./command-esgtnpD6.js";import"./index-DBTxlw_P.js";import"./dropdown-menu-CZpb3eYC.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-HySek8pC.js";import"./empty-state-CAlFsQdU.js";import"./toolbar-CSosPZ4D.js";import"./preview-dialog-BdwQBPGz.js";import"./index-gHhgmmKj.js";import"./file-type-icon-BwBw9jgA.js";import"./use-mcp-tools-qTvFx3Nb.js";import"./types-BRex8hoG.js";import"./use-capability-CFzya3JS.js";import"./shell-route-loading-B5fcdA3q.js";import"./index-B8k191tl.js";import"./switch-RrT6wLYL.js";import"./use-debounced-autosave-BHDQ7RHW.js";import"./index-Q6pGpUHX.js";import"./sidebar-bM2CxBRy.js";import"./sheet-BYUn2G0P.js";import"./search-input-Be3BJ5YO.js";import"./github-repo-picker--XFvpeLm.js";import"./use-debounced-value-BB2O7NbI.js";import"./use-navigate-to-agent-C83xFoxW.js";import"./use-secrets-DnspbGKA.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./view-mode-toggle-BChdPYXY.js";import"./automation-runs-Cz-auyir.js";import"./table-FgURfELI.js";import"./use-members-zes1mdlJ.js";import"./use-org-auth-client-DJhVKhdJ.js";import"./task-status-ClaTWvtm.js";import"./use-automations-BKwvpJAo.js";import"./use-file-configs-BasVpNvI.js";import"./monaco-editor-CpkaOm7i.js";import"./select-model-Cv0Zl4px.js";import"./automation-list-row-wzlcI0kv.js";import"./use-clock-tick-DMIcMeX9.js";import"./use-copy-BvBAqh5C.js";import"./content-blocks-o63cs2vh.js";function bt(k){const e=W.c(18),{icon:f,title:m,defaultOpen:b,children:u}=k,D=b===void 0?!1:b,[h,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 s;e[2]!==m?(s=t.jsx("span",{className:"flex-1 text-left",children:m}),e[2]=m,e[3]=s):s=e[3];const y=h&&"rotate-180";let r;e[4]!==y?(r=q("transition-transform",y),e[4]=y,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ft,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==s||e[10]!==p?(c=t.jsx(yt,{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,s,p]})}),e[8]=l,e[9]=s,e[10]=p,e[11]=c):c=e[11];let i;e[12]!==u?(i=t.jsx(jt,{className:"px-2 pt-4",children:u}),e[12]=u,e[13]=i):i=e[13];let g;return e[14]!==h||e[15]!==c||e[16]!==i?(g=t.jsxs(vt,{open:h,onOpenChange:A,className:"mt-4",children:[c,i]}),e[14]=h,e[15]=c,e[16]=i,e[17]=g):g=e[17],g}function ir({orgSlug:k,virtualMcpId:e,branch:f,blockKey:m,block:b,decofile:u,meta:D,onManagePosts:h,onOpenPost:A,previewBaseUrl:l}){const s=at({orgSlug:k,virtualMcpId:e,branch:f}),y=nt(b,"categories"),[r,p,c]=xt(y,o=>{s.mutate({blockKey:m,data:R(m,"categories",o)})}),i=(o,w)=>p({...r,[o]:w}),g=dt({decofile:u,category:r,previewBaseUrl:l}),a=v(r.slug),[B,j]=S.useState(a),[n,C]=S.useState(null),[N,E]=S.useState(!1),$=a?mt(u).filter(o=>o.categorySlugs.includes(a)):[],d=$.length,G=o=>i("slug",o),H=async(o,w)=>{const V=v(r.name);E(!0);try{let x=0;for(const{key:O,payload:P}of pt(u,"posts")){const F=ct(P,o,{name:V,slug:w});F!==P&&(await s.mutateAsync({blockKey:O,data:R(O,"posts",F)}),x+=1)}const z={...r,slug:w};await s.mutateAsync({blockKey:m,data:R(m,"categories",z)}),c(z),I.success(x>0?`Renamed slug and updated ${x} ${x===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(x){j(o),C(null),I.error(x instanceof Error?x.message:"Rename failed")}finally{E(!1)}},J=()=>{const o=B.trim();if(o===a){B!==o&&j(o);return}if(!o){j(a);return}if(d===0){G(o);return}C({oldSlug:a,newSlug:o,count:d})};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:s.isPending,isError:s.isError}),g&&t.jsxs(U,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(g,"_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(ht,{value:v(r.name),onChange:o=>i("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(L,{htmlFor:"category-slug",children:"Slug"}),t.jsx(M,{id:"category-slug",value:B,onChange:o=>j(o.target.value),onBlur:J,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-description",children:"Description"}),t.jsx(M,{id:"category-description",value:v(r.description),onChange:o=>i("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=>i("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:[d," ",d===1?"post":"posts"," in this category"]})]}),t.jsxs(U,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?d===0?"Go to the posts list to add posts to this category":"Jump to the posts list filtered by this category":"Set a slug to manage this category's posts",onClick:()=>h(d===0?"":a),children:[d===0?"Add posts":"Manage posts",t.jsx(X,{size:14})]})]}),d>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:$.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(_,{open:!!n,onOpenChange:o=>{o||N||(j(a),C(null))},children:t.jsxs(K,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:n?`Changing the slug from "${n.oldSlug}" to "${n.newSlug}" will update ${n.count} ${n.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(st,{disabled:N,children:"Cancel"}),t.jsx(it,{onClick:o=>{o.preventDefault(),n&&H(n.oldSlug,n.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(Q,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{ir as CategoryEditor};
@@ -1,21 +0,0 @@
1
- import{c as ue,l as Ge,bF as Xe,j,cv as Ze,I as Ne,m as Le,D as se,K as ge,t as ne,C as le,L as de,b as qe,u as Fe,e as Ye,r as m,v as Je,a as et,J as tt,aJ as nt}from"./index-BSJueg0-.js";import{A as Ue,S as st,a as ot,d as at,e as rt,f as it,u as ct,w as lt}from"./hooks-B9L41m_Y.js";import{a as dt,u as ut,S as pt}from"./use-mcp-client-Bcb6PO24.js";import{a as ft}from"./use-virtual-mcp-co7b_FD9.js";import{u as ht,b as me}from"./use-ai-providers-hvnDjM8p.js";import{u as mt}from"./use-decopilot-events-CRfiqA6B.js";import{n as gt,k as yt}from"./tab-id-BptcWVWa.js";import{d as St}from"./use-organization-settings-D1Ju0RBO.js";const xt={anthropic:["claude-haiku-4-5","claude-haiku"],openrouter:["qwen/qwen3.5-flash","anthropic/claude-haiku-4.5","anthropic/claude-haiku","google/gemini-3-flash"],deco:["qwen/qwen3.5-flash","anthropic/claude-haiku"],llmapi:["claude-haiku-4-5","claude-haiku","gpt-4o-mini"],google:["gemini-2.5-flash","gemini-3-flash"],"claude-code":["claude-code:haiku","claude-code:sonnet"],codex:["codex:gpt-5.4-mini"]},vt={anthropic:["claude-sonnet-5","claude-sonnet"],openrouter:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude-opus-4.8","google/gemini-3-pro"],deco:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude"],llmapi:["claude-sonnet-4-6","claude-sonnet"],google:["gemini-3-pro","gemini-3-flash"],"claude-code":["claude-code:sonnet"],codex:["codex:gpt-5.4"]},It={anthropic:["claude-opus-4-8","claude-sonnet-5","claude-sonnet","claude-fable-5"],openrouter:["anthropic/claude-opus-4.8:extended","anthropic/claude-opus-4.8","anthropic/claude-sonnet-5:extended","anthropic/claude-sonnet-5","google/gemini-3-pro","anthropic/claude-fable-5"],deco:["anthropic/claude-opus","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude-fable"],llmapi:["claude-opus-4-8","claude-opus","claude-sonnet-4-6"],google:["gemini-3-pro"],"claude-code":["claude-code:opus-1m","claude-code:opus","claude-code:sonnet"],codex:["codex:gpt-5.5"]},Ct={openrouter:["openai/gpt-image-1","google/gemini-2.0-flash-image"],deco:["openai/gpt-image-1","google/gemini-2.0-flash-image"],llmapi:["gemini-2.5-flash-image","gpt-image-1"],google:["gemini-2.0-flash-image"]},kt={openrouter:["perplexity/sonar","perplexity/sonar-pro"],deco:["perplexity/sonar","perplexity/sonar-pro"]},bt={openrouter:["perplexity/deep-research","perplexity/sonar-pro"],deco:["perplexity/deep-research","perplexity/sonar-pro"]};function je(t){return t.toLowerCase().replace(/[^a-z0-9]/g,"")}function Mt(t){return je(t).includes("deepresearch")}const Tt=["sonar","searchpreview","online"];function Qe(t){const e=je(t);return e.includes("deepresearch")?!1:Tt.some(n=>e.includes(n))}function Ke(t){return t.asyncResearch!==!0&&Qe(t.modelId)}function Ve(t){return t.asyncResearch===!0||Mt(t.modelId)||Qe(t.modelId)}function ie(t,e,n,s){for(const o of n){const a=t.find(r=>r.modelId===o);if(a)return{keyId:e,modelId:a.modelId,title:a.title}}for(const o of n){const a=t.find(r=>r.modelId.includes(o));if(a)return{keyId:e,modelId:a.modelId,title:a.title}}if(s){const o=t.find(s);if(o)return{keyId:e,modelId:o.modelId,title:o.title}}return null}function wt(t,e){const n={chat:{fast:null,smart:null,thinking:null},image:null,webSearch:null,deepResearch:null};for(const s of t){const o=e[s.id]??[],a=s.providerId;n.chat.fast||(n.chat.fast=ie(o,s.id,xt[a]??[])),n.chat.smart||(n.chat.smart=ie(o,s.id,vt[a]??[])),n.chat.thinking||(n.chat.thinking=ie(o,s.id,It[a]??[])),n.image||(n.image=ie(o,s.id,Ct[a]??[],r=>r.capabilities?.includes("image")===!0)),n.webSearch||(n.webSearch=ie(o,s.id,kt[a]??[],Ke)),n.deepResearch||(n.deepResearch=ie(o,s.id,bt[a]??[],Ve))}return n}const Et=Xe("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",success:"fill-success text-gray-200",special:"fill-special text-background"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function pn(t){const e=ue.c(10),{variant:n,size:s}=t;let o;e[0]!==s||e[1]!==n?(o=Ge(Et({variant:n,size:s})),e[0]=s,e[1]=n,e[2]=o):o=e[2];let a,r;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=j.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),r=j.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=a,e[4]=r):(a=e[3],r=e[4]);let l;e[5]!==o?(l=j.jsxs("svg",{"aria-hidden":"true",className:o,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a,r]}),e[5]=o,e[6]=l):l=e[6];let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=j.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=g):g=e[7];let y;return e[8]!==l?(y=j.jsxs("div",{role:"status",children:[l,g]}),e[8]=l,e[9]=y):y=e[9],y}function At(t,e=[]){return t==="stop"?e.filter(o=>o.type==="text"&&o.text).map(o=>o.text).join(`
2
- `).replace(/https?:\/\/[^\s)>\]]+/g,"").includes("?")?"requires_action":"completed":t==="tool-calls"?e.some(s=>s.type==="tool-user_ask"&&s.state==="input-available"||s.state==="approval-requested")?"requires_action":"completed":"failed"}const Me={decopilot:{harness:"decopilot",sandbox:"agent-sandbox"},"decopilot-desktop":{harness:"decopilot",sandbox:"user-desktop"},"claude-code-desktop":{harness:"claude-code",sandbox:"user-desktop"},"codex-desktop":{harness:"codex",sandbox:"user-desktop"}};function Rt(t,e){if(!t)return null;const n=e?Ze(e):null;if(t==="decopilot"&&n===null)return"decopilot";for(const[s,o]of Object.entries(Me))if(o.harness===t&&o.sandbox===n)return s;return null}function _t(t){return t.thread?.harness_id!=null?{}:{harnessId:t.globals.harnessId,sandboxProviderKind:t.globals.sandboxProviderKind,branch:t.globals.branch??null}}function Pt(t){const e=ue.c(10);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},e[0]=n):n=e[0];const s=Ne(n);let o;if(e[1]!==s?.params.appSlug||e[2]!==s?.params.collectionName||e[3]!==s?.params.itemId||e[4]!==t){o=[],t&&o.push(`### Selected Agent
3
- - ID: ${t}`);let a;e[6]!==s?.params.appSlug||e[7]!==s?.params.collectionName||e[8]!==s?.params.itemId?(a=[],s?.params.appSlug&&a.push(`- Connection ID: ${s?.params.appSlug}`),s?.params.collectionName&&a.push(`- Collection: ${s?.params.collectionName}`),s?.params.itemId&&a.push(`- Item ID: ${s?.params.itemId}`),e[6]=s?.params.appSlug,e[7]=s?.params.collectionName,e[8]=s?.params.itemId,e[9]=a):a=e[9],a.length>0&&o.push(`### Current Resource
4
- The user is viewing the following resource:
5
- ${a.join(`
6
- `)}
7
-
8
- Help the user understand and work with this resource.`),e[1]=s?.params.appSlug,e[2]=s?.params.collectionName,e[3]=s?.params.itemId,e[4]=t,e[5]=o}else o=e[5];return o.join(`
9
-
10
- `)}function $t(){const t=ue.c(5),e=Le(),{org:n}=se();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},t[0]=s):s=t[0];const o=Ne(s);let a;return t[1]!==o?.params||t[2]!==n||t[3]!==e?(a=r=>{const g=r.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!g||!g[1])return;const y=g[1],I=o?.params.appSlug;if(!I)return;e.invalidateQueries({queryKey:ge.collection(n.slug,I,y)});const T=y.toLowerCase().replace(/_/g," ");ne.success(`${T} updated`)},t[1]=o?.params,t[2]=n,t[3]=e,t[4]=a):a=t[4],a}function Dt(){const t=ue.c(4),{org:e,project:n}=se(),s=`${e.id}/${n.id}`;let o;t[0]!==s?(o=de.taskLastViewed(s),t[0]=s,t[1]=o):o=t[1];const[,a]=le(o,Ot);let r;return t[2]!==a?(r={markTaskRead:g=>{a(y=>({...y,[g]:new Date().toISOString()}))}},t[2]=a,t[3]=r):r=t[3],r}function Ot(t){return t??{}}function We(){const t=qe(),{org:e}=se(),n=Fe({strict:!1}),s=Ye({strict:!1}),o=n.virtualmcpid??dt(e.id).id,a=(g,y)=>{t({to:"/$org/$taskId",params:{org:e.slug,taskId:g},search:I=>{const T={},q=y?.virtualMcpId??I.virtualmcpid;q&&(T.virtualmcpid=q);const p=I.main;return p&&typeof p=="string"&&!gt(p)&&(T.main=p),I.chat&&(T.chat=I.chat),y?.autosend&&(T.autosend=Ue),T}})},r=m.useRef(crypto.randomUUID()),l=s.taskId??r.current;return{virtualMcpId:o,taskId:l,navigateToTask:a}}function Nt(t,e){const{mimeType:n,data:s}=t;if(n.startsWith("text/"))try{const o=new TextDecoder().decode(Uint8Array.from(atob(s),a=>a.charCodeAt(0)));return[{type:"text",text:`${e}
11
- ${o}`}]}catch(o){console.error("Failed to decode text file:",o)}return[{type:"file",url:`data:${n};base64,${s}`,filename:e,mediaType:n}]}function Pe(t,e){const n=[];for(const s of t)"text"in s&&s.text?n.push({type:"text",text:`[${e}]
12
- ${s.text}`}):"blob"in s&&s.blob&&s.mimeType&&n.push({type:"file",url:`data:${s.mimeType};base64,${s.blob}`,filename:String(s.uri),mediaType:String(s.mimeType)});return n}function Lt(t,e){const n=[];for(const s of t){if(s.role!=="user"||!s.content)continue;const o=Array.isArray(s.content)?s.content:[s.content];for(const a of o)switch(a.type){case"text":{const r=a.text?.trim();if(!r)continue;n.push({type:"text",text:`[${e}]
13
- ${r}`});break}case"image":case"audio":{if(!a.data||!a.mimeType)continue;n.push({type:"file",url:`data:${a.mimeType};base64,${a.data}`,mediaType:a.mimeType});break}case"resource":{const r=a.resource;if(!r||!r.mimeType)continue;r&&("text"in r&&r.text?n.push({type:"text",text:`[${e}]
14
- ${r.text}`}):"blob"in r&&r.blob&&r.mimeType&&n.push({type:"file",url:`data:${r.mimeType};base64,${r.blob}`,filename:String(r.uri),mediaType:String(r.mimeType)}));break}}}return n}function Be(t){if(!t)return[];const e=[];let n="";const s=o=>{if(o){if(o.type==="text"&&"text"in o&&typeof o.text=="string")n+=o.text;else if(o.type==="mention"&&o.attrs){const a=o.attrs.char??"/",r=`${a}${o.attrs.name}`;if(n+=r,a==="@"){const l=o.attrs.metadata;l&&!Array.isArray(l)&&"agentId"in l?e.push({type:"text",text:`[DELEGATE TO AGENT: ${l.title??o.attrs.name} (agent_id: ${l.agentId})]
15
- Use the subtask tool to delegate this task to the agent above. Include the full relevant context from this conversation in the prompt field — the subagent has no conversation history.`}):Array.isArray(l)&&e.push(...Pe(l,r))}else{const l=o.attrs.metadata||o.attrs.prompts||[];Array.isArray(l)&&l.length>0&&"role"in l[0]?e.push(...Lt(l,r)):Array.isArray(l)&&e.push(...Pe(l,r))}}else if(o.type==="file"&&o.attrs){const a=o.attrs,r=`[file:://${encodeURIComponent(a.name)}]`;n+=r,e.push(...Nt(a,r))}if("content"in o&&Array.isArray(o.content))for(const a of o.content)s(a)}};return s(t),n.trim()&&e.unshift({type:"text",text:n.trim()}),e}function fn(t){const e=Be(t);return e.length===0?[]:[{id:crypto.randomUUID(),role:"user",parts:e,metadata:{tiptapDoc:t}}]}function hn(t){return new Set(t.filter(e=>e.status==="queued").map(e=>e.messageId))}function qt(t){return(t??[]).map(e=>e?.type==="text"&&typeof e.text=="string"?e.text:"").join("").trim()}function mn(t){return t.filter(e=>e.status==="queued").sort((e,n)=>e.enqueuedAt-n.enqueuedAt)}function Ft(t,e){return t.some(n=>n.messageId===e.messageId)?t:[...t,e]}function Ut(t,e){return t.filter(n=>n.messageId!==e)}const $e=new Map,we=new Set;function jt(t){we.add(t)}function Qt(t){return we.has(t)}function Kt(t){we.delete(t)}function ye(t){let e=$e.get(t);return e||(e=new st([]),$e.set(t,e)),e}function He(t,e){ye(t).update(n=>Ft(n,e))}function Te(t,e){ye(t).update(n=>Ut(n,e))}function Vt(t,e){ye(t).set(e)}const Ie=new Map;function Wt(t,e){Ie.set(`${t}:${e.id}`,e)}function Bt(t,e){const n=`${t}:${e}`,s=Ie.get(n);return Ie.delete(n),s}function De(t,e){Ie.delete(`${t}:${e}`)}async function X(t,e){try{const n=await fetch(`/api/${encodeURIComponent(t)}/decopilot/queue/${encodeURIComponent(e)}`,{credentials:"include"});if(!n.ok)return;const s=await n.json();Vt(e,s.items??[])}catch{}}function gn(t){const e=ue.c(2);let n;e[0]!==t?(n=ye(t),e[0]=t,e[1]=n):n=e[1];const s=n;return m.useSyncExternalStore(s.subscribe,s.get,s.get)}function Ht(){const{org:t}=se();return{enqueue:He,refresh:e=>X(t.slug,e),cancel:async(e,n)=>{const s=`thread-run:${e}:${n}`;Te(e,n);try{const o=await fetch(`/api/${encodeURIComponent(t.slug)}/decopilot/queue/${encodeURIComponent(e)}/cancel/${encodeURIComponent(s)}`,{method:"POST",credentials:"include"});if(!o.ok&&o.status!==404)throw new Error(`Cancel failed: ${o.status}`);return!0}catch(o){return ne.error(o instanceof Error?o.message:"Failed to cancel"),!1}finally{await X(t.slug,e)}}}}const Oe=new Set,ee=new Set;function ce(t){return m.useSyncExternalStore(t.subscribe,t.get,t.get)}function zt(t){return t.kind==="loading"?"ready":t.kind}function te(t,e,n,s){if(!t)return null;const o=e.find(r=>r.id===t.keyId);if(!o)return null;const a=n.find(r=>r.modelId===t.modelId);return a?{...a,keyId:t.keyId}:{modelId:t.modelId,title:s??t.modelId,keyId:t.keyId,providerId:o.providerId,description:null,logo:null,capabilities:[],limits:null,costs:null}}function Gt(t){return t==="fast"||t==="smart"||t==="thinking"?t:"smart"}function Xt(t,e,n,s){if(!n||s.length===0)return null;const o=e.find(g=>g.id===n);if(!o)return null;const a=wt([o],{[n]:s}),r=t==="fast"?a.chat.fast:t==="thinking"?a.chat.thinking:a.chat.smart;if(!r)return null;const l=s.find(g=>g.modelId===r.modelId);return l?{...l,keyId:n}:null}const Zt=1e4,Yt=10,Ee=m.createContext(null),Ae=m.createContext(null),Re=m.createContext(null),ze=m.createContext(null);function Jt({children:t}){const{locator:e}=se(),{virtualMcpId:n}=We(),[s,o]=le(de.chatSelectedImageModel(e),null),[a,r]=le(de.chatSelectedWebSearchModel(e),null),[l,g]=le(de.chatSelectedDeepResearchModel(e),null),[y,I]=m.useState(null),[T,q]=m.useState("default"),p=St(),[R,Q]=le(de.chatSimpleModeTier(e),null),$=Gt(R),C=ht(),k=p.tiers[$],_=y&&C.some(i=>i.id===y)?y:k?.keyId??C[0]?.id??null,{models:S,isLoading:K}=me(_??void 0),{models:H}=me(k?.keyId),{models:Z}=me(p.tiers.image?.keyId),{models:M}=me(p.tiers.web_search?.keyId),{models:V}=me(p.tiers.deep_research?.keyId),z=te(k,C,H,k?.title)??Xt($,C,_,S),W=K,B=S.filter(i=>i.capabilities?.includes("image")),F=te(s,C,B),u=te(p.tiers.image,C,Z,p.tiers.image?.title)??F??B[0]??null,E=S.filter(Ke),N=te(a,C,E),Y=E.find(i=>i.modelId==="perplexity/sonar")??E[0]??null,U=te(p.tiers.web_search,C,M,p.tiers.web_search?.title)??N??Y,L=S.filter(Ve),b=te(l,C,L),x=L.find(i=>i.modelId==="perplexity/deep-research")??L.find(i=>i.asyncResearch===!0)??L[0]??null,G=te(p.tiers.deep_research,C,V,p.tiers.deep_research?.title)??b??x,Se=ft(n)??{id:n,title:"",description:null,icon:null},[Ce,fe]=m.useState({}),xe=(i,h)=>{const D=[];for(const O of h.content??[])O.type==="text"&&O.text?.trim()&&D.push(O.text.trim());const v=D.join(`
16
- `);if(!v){he(i);return}new TextEncoder().encode(v).length>Zt||fe(O=>Object.keys(O).length>=Yt&&!(i in O)?O:{...O,[i]:v})},he=i=>{fe(h=>{const{[i]:D,...v}=h;return v})},[oe,ke]=le(de.chatLastAgentOption(e),i=>i&&i in Me?i:null),J=nn(),be=J?.isThreadLocked&&J.lockedHarness!=null?Rt(J.lockedHarness,J.lockedSandbox):null,_e=oe,ae=J?.isThreadLocked?be:_e,ve=ae?Me[ae]:null,c=ve?.harness??null,d=ve?.sandbox??null,[w,A]=m.useState(void 0),f=m.useRef(w);f.current=w;const P={selectedModel:z,setModel:()=>{},credentialId:_,setCredentialId:I,allModelsConnections:C,isModelsLoading:W,selectedVirtualMcp:Se,imageModel:u,setImageModel:i=>{o(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},webSearchModel:U,setWebSearchModel:i=>{r(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},deepResearchModel:G,setDeepResearchModel:i=>{g(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},chatMode:T,setChatMode:q,appContexts:Ce,setAppContext:xe,clearAppContext:he,tiptapDoc:w,setTiptapDoc:A,tiptapDocRef:f,resetInteraction:()=>{},simpleModeTier:$,setSimpleModeTier:i=>Q(i),pendingAgentOption:ae,setPendingAgentOption:ke,pendingHarnessId:c,pendingSandboxProviderKind:d};return j.jsx(Re.Provider,{value:P,children:t})}function yn(t){const e=ue.c(41),{virtualMcpId:n,task:s,children:o}=t,{locator:a}=se(),{data:r}=et.useSession(),l=r?.user??null,{taskId:g,virtualMcpId:y,navigateToTask:I}=We(),[T]=tt(),{markTaskRead:q}=Dt(),p=ct(),R=g,Q=y,$=Pt(Q);let C;e[0]!==q||e[1]!==I?(C=(b,x)=>{q(b),I(b,{virtualMcpId:x?.virtualMcpId,autosend:x?.autosend})},e[0]=q,e[1]=I,e[2]=C):C=e[2];const k=C,_=R&&s?.id===R?s:null,S=_?.harness_id??null,K=_?.sandbox_provider_kind??null,H=_?.branch??null,Z=S!=null,M=H;let V;e[3]!==M||e[4]!==k||e[5]!==p||e[6]!==n?(V=()=>{const b=crypto.randomUUID();return p.create({id:b,virtual_mcp_id:n,...M?{branch:M}:{}}).then(()=>k(b)).catch(()=>{k(b)}),b},e[3]=M,e[4]=k,e[5]=p,e[6]=n,e[7]=V):V=e[7];const z=V;let W;e[8]!==M||e[9]!==a||e[10]!==k||e[11]!==p||e[12]!==n?(W=b=>{const x=crypto.randomUUID(),G=b.virtualMcpId??n,pe=G===n?M:null;lt(sessionStorage,a,x,b.message),p.create({id:x,virtual_mcp_id:G,...pe?{branch:pe}:{}}).then(()=>k(x,{virtualMcpId:b.virtualMcpId,autosend:!0})).catch(()=>{k(x,{virtualMcpId:b.virtualMcpId,autosend:!0})})},e[8]=M,e[9]=a,e[10]=k,e[11]=p,e[12]=n,e[13]=W):W=e[13];const B=W;let F;e[14]!==R||e[15]!==p?(F=b=>{R&&p.setBranch(R,b)},e[14]=R,e[15]=p,e[16]=F):F=e[16];let u;e[17]!==_||e[18]!==z||e[19]!==B||e[20]!==M||e[21]!==R||e[22]!==Q||e[23]!==Z||e[24]!==H||e[25]!==S||e[26]!==K||e[27]!==k||e[28]!==F?(u={virtualMcpId:Q,taskId:R,openTask:k,createTask:z,createTaskWithMessage:B,activeTask:_,isThreadLocked:Z,lockedHarness:S,lockedSandbox:K,lockedBranch:H,currentBranch:M,setCurrentTaskBranch:F},e[17]=_,e[18]=z,e[19]=B,e[20]=M,e[21]=R,e[22]=Q,e[23]=Z,e[24]=H,e[25]=S,e[26]=K,e[27]=k,e[28]=F,e[29]=u):u=e[29];const E=u;let N;e[30]!==$||e[31]!==T||e[32]!==I||e[33]!==l?(N={user:l,contextPrompt:$,preferences:T,rawNavigateToTask:I},e[30]=$,e[31]=T,e[32]=I,e[33]=l,e[34]=N):N=e[34];const Y=N;let U;e[35]!==o||e[36]!==Y?(U=j.jsx(Jt,{children:j.jsx(ze.Provider,{value:Y,children:o})}),e[35]=o,e[36]=Y,e[37]=U):U=e[37];let L;return e[38]!==U||e[39]!==E?(L=j.jsx(Ae.Provider,{value:E,children:U}),e[38]=U,e[39]=E,e[40]=L):L=e[40],L}function Sn({taskId:t,children:e}){const{virtualMcpId:n,activeTask:s,currentBranch:o}=en();t&&!Oe.has(t)&&(Oe.add(t),Je("chat_opened",{thread_id:t}));const{imageModel:a,webSearchModel:r,deepResearchModel:l,chatMode:g,setChatMode:y,appContexts:I,setTiptapDoc:T,simpleModeTier:q,pendingSandboxProviderKind:p,pendingHarnessId:R}=tn(),Q=m.useContext(ze);if(!Q)throw new Error("ActiveTaskProvider must be used within ChatContextProvider");const{user:$,contextPrompt:C,preferences:k,rawNavigateToTask:_}=Q,{org:S,locator:K}=se(),H=Ht(),[Z,M]=m.useState(null),V=$t(),z=Le(),W=ot(),B=qe(),F=ut({connectionId:pt,orgId:S.id,orgSlug:S.slug}),u=at(S.slug,t,{client:F});m.use(u.ready);const E=ce(u.messages),N=ce(u.status),Y=ce(u.finishReason),U=ce(u.runStatusStage),L=ce(u.hasMoreOlder),b=ce(u.isFetchingOlder),x=m.useRef({onToolCall:V,queryClient:z,rawNavigateToTask:_,taskId:t,manager:W,navigate:B,orgId:S.id,orgSlug:S.slug});x.current={onToolCall:V,queryClient:z,rawNavigateToTask:_,taskId:t,manager:W,navigate:B,orgId:S.id,orgSlug:S.slug},mt({orgSlug:S.slug,taskId:t,onTaskStatus:c=>{const d=x.current,w=c.data.message_id;if(c.data.status==="in_progress"&&w){Te(d.taskId,w);const A=Bt(d.taskId,w);A&&u.applyLocalMessage(A),X(d.orgSlug,d.taskId)}Qt(d.taskId)&&(async()=>(await X(d.orgSlug,d.taskId),await u.reconcileFromServer()&&ye(d.taskId).get().length===0&&Kt(d.taskId)))()}}),m.useEffect(()=>{const c={onData:f=>{if(f.type==="data-thread-title"){const P=f.data;if(!P?.title)return;const i=x.current;if(!i.taskId)return;i.manager.patchThread({id:i.taskId,title:P.title,updated_at:new Date().toISOString()});return}if(f.type==="data-deck-updated"){const P=f.data;if(!P?.path)return;const i=P.path,h=x.current;h.queryClient.invalidateQueries({queryKey:ge.orgFsStat(h.orgId,"home",i)}),h.queryClient.invalidateQueries({queryKey:ge.orgFsRecent(h.orgId)}),h.navigate({to:".",search:D=>({...D,main:yt(i)}),replace:!0});return}},onFinish:(f,P,i)=>{const h=x.current;h.taskId&&X(h.orgSlug,h.taskId),h.taskId&&h.manager.patchThread({id:h.taskId,status:At(i,f.parts),updated_at:new Date().toISOString()});const D=f.parts?.some(O=>{const re=O;return(re.type==="tool-share_with_user"||re.type==="tool-bash"||re.type==="tool-write")&&re.state==="output-available"});if(h.taskId&&D){const O=ge.threadOutputs(h.taskId);for(const re of[0,1500,3e3,6e3,12e3,25e3])setTimeout(()=>{h.queryClient.invalidateQueries({queryKey:O})},re)}h.queryClient.invalidateQueries({queryKey:ge.homeNextActions(h.orgSlug)});const v=f.metadata?.thread_id;v&&v!==h.taskId&&h.rawNavigateToTask(v)},onError:f=>{M(f),console.error("[chat] Error",f)},onToolCall:f=>x.current.onToolCall(f)};u.observer=c,X(x.current.orgSlug,x.current.taskId);const d=f=>f==="submitted"||f==="streaming";let w=d(u.status.get().kind);const A=u.status.subscribe(()=>{const f=d(u.status.get().kind);if(f===w)return;w=f;const P=x.current;X(P.orgSlug,P.taskId)});return()=>{u.observer===c&&(u.observer=null),A()}},[u]);const G=N.kind==="submitted"||N.kind==="streaming",pe=E.length===0,Se=E.at(-1),Ce=!G&&Se?.role==="assistant"&&Se.parts.some(c=>"state"in c&&c.state==="approval-requested"),fe=s,xe=(fe?.status==="in_progress"||fe?.status==="expired")&&N.kind==="ready"&&E.length>0;async function he(c){const d=t,w=n,A=Object.entries(I),f=A.length>0?A.map(([D,v])=>`### App Context: ${D}
17
- ${v}`).join(`
18
-
19
- `):"",P=[C,f].filter(Boolean).join(`
20
-
21
- `);let i=g;i==="gen-image"&&!a&&(i="default"),i==="web-search"&&!r&&(i="default"),i==="deep-research"&&!l&&(i="default"),(i==="web-search"||i==="deep-research")&&y("default");const h={tier:q,mode:i,toolApprovalLevel:k.toolApprovalLevel??nt(),system:P||void 0,agent:{id:w},thread_id:d,..._t({thread:s?{harness_id:s.harness_id??null,sandbox_provider_kind:s.sandbox_provider_kind??null,branch:s.branch??null}:null,globals:{harnessId:R??void 0,sandboxProviderKind:p??void 0,branch:o}})};try{if(G||xe){let D=!0;try{Wt(d,c),await u.enqueue(c,h),He(d,{workflowId:`thread-run:${d}:${c.id}`,messageId:c.id,text:qt(c.parts),hasAttachments:c.parts.some(v=>v.type==="file"),status:"queued",enqueuedAt:Date.now(),optimistic:!0}),jt(d)}catch(v){D=!1,De(d,c.id),Te(d,c.id),M(v instanceof Error?v:new Error(String(v))),ne.error(v instanceof Error?v.message:"Failed to queue message")}return X(S.slug,d),D}return await u.submit({kind:"message",message:c},h),!0}finally{ee.delete(d)}}async function oe(c){const d=c.parts??Be(c.tiptapDoc);if(d.length===0||ee.has(t))return;ee.add(t),M(null),T(void 0);const w={tiptapDoc:c.tiptapDoc,created_at:new Date().toISOString(),user:{avatar:$?.image??void 0,name:$?.name??"you"}},A={id:crypto.randomUUID(),role:"user",parts:d,metadata:w};await he(A)}async function ke(c,d){if(ee.has(t))return ne.info("Still sending your previous message — try again in a moment"),!1;if(ee.add(t),!await H.cancel(t,c))return ee.delete(t),ne.error("Couldn't remove the original message"),!1;De(t,c),u.removeLocalMessage(c);const A={id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:d}],metadata:{created_at:new Date().toISOString(),user:{avatar:$?.image??void 0,name:$?.name??"you"}}};try{return await he(A)}catch(f){return ne.error(f instanceof Error?f.message:"Failed to send edited message"),!1}}const J=async()=>{u.stop();try{const c=await fetch(`/api/${S.slug}/decopilot/cancel/${t}`,{method:"POST",credentials:"include"});if(c.status===404)return;if(!c.ok){const d=await c.json().catch(()=>({}));throw new Error(d.message??`Cancel failed: ${c.status}`)}}catch(c){const d=c instanceof Error?c.message:"Failed to cancel";ne.error(d),console.error("[chat] cancelRun",c)}},be=c=>c&&typeof c=="object"&&"type"in c?oe({tiptapDoc:c}):oe(c),ae=Fe({strict:!1}).autosend===Ue;m.useEffect(()=>{if(!ae||E.length>0)return;const c=rt(sessionStorage,K,t);c&&oe(c.message).then(()=>{it(sessionStorage,K,t)})},[ae,E.length,K,t,oe]);const ve={messages:E,status:zt(N),sendMessage:be,editQueuedMessage:ke,stop:()=>{J()},submit:(c,d)=>u.submit(c,d),removeLocalMessage:c=>u.removeLocalMessage(c),isSendInFlight:()=>ee.has(t),error:Z,clearError:()=>M(null),finishReason:Y,runStatusStage:U,clearFinishReason:()=>u.finishReason.set(null),isStreaming:G,isChatEmpty:pe,isWaitingForApprovals:Ce??!1,isRunInProgress:xe,hasMoreOlder:L,isFetchingOlder:b,fetchOlderMessages:u.fetchOlderMessages.bind(u)};return j.jsx(Ee.Provider,{value:ve,children:e})}function xn(){const t=m.useContext(Ee);if(!t)throw new Error("useChatStream must be used within ActiveTaskProvider");return t}function vn(){return m.useContext(Ee)}function en(){const t=m.useContext(Ae);if(!t)throw new Error("useChatTask must be used within ChatContextProvider");return t}function tn(){const t=m.useContext(Re);if(!t)throw new Error("useChatPrefs must be used within ChatContextProvider");return t}function In(){return m.useContext(Re)}function nn(){return m.useContext(Ae)}export{Sn as A,Jt as C,pn as S,en as a,tn as b,nn as c,Be as d,gn as e,Ht as f,De as g,Rt as h,vn as i,yn as j,hn as k,In as l,Ke as m,Ve as n,wt as p,mn as s,fn as t,xn as u};
@@ -1,2 +0,0 @@
1
- import{c as Ke,r as l,j as i,i as re,B as fe,l as Ve,m as ut,t as $,K as Te}from"./index-BSJueg0-.js";import{F as mt,l as pt}from"./index-gHhgmmKj.js";import{i as ht,ax as xt,ay as gt,az as ae,aA as yt,V as $e}from"./agent-icon-CmJIYKNa.js";import{a as wt}from"./Tool01-CfYPNw_C.js";import{s as jt}from"./XClose-xV2ZQDrx.js";import{S as bt}from"./scroll-area-DQp5D973.js";import{T as Oe,a as Re,b as ze}from"./tooltip-h0yvcJt8.js";import{f as Ct,a as vt,b as Nt,c as St,d as Dt,e as kt,A as Ft,g as Lt}from"./alert-dialog-ZMN4L58U.js";import{u as Et}from"./chat-context-GFFBEPEU.js";import{b as Pt}from"./shell-layout-DlX3hQOg.js";import{am as le,an as Ae,ao as Tt}from"./index-CvGS2PsG.js";import{a as $t,b as Ot,c as Rt,D as zt,d as At,e as Wt}from"./dialog-BxPiF5oN.js";import{I as We}from"./input-cp_TKu2Y.js";import{b as It,C as _,a as Ie,c as Mt,d as Kt}from"./context-menu-zwWLAMxe.js";import{t as Vt}from"./ChevronDown-BynJeIwt.js";import{i as Bt}from"./ChevronRight-D9yn8jpR.js";import{a as Gt}from"./ZoomOut-TulSR7oT.js";import{E as qt,C as Me,D as he,G as Qt,I as Ut,J as Jt,K as M,M as ce,g as xe,N as ge,O as Ht,P as Xt,Q as ye,U as de,V as we,W as Yt,X as Zt}from"./preview-dialog-BdwQBPGz.js";import"./AlertCircle-Xqr6j1ec.js";import"./SwitchHorizontal01-CuuAQB1I.js";import"./Settings02-e1tD5mMi.js";import"./XCircle-CKou8mpC.js";import"./ArrowUpRight-JIM5EKmo.js";import"./ZapSquare-O2LJAU94.js";import"./Users03-6gLyEuGv.js";import"./CheckCircle-0YWte2gD.js";import"./ChevronUp-Cw2uQynG.js";import"./ChevronLeft-DQiHQWQL.js";import"./DotsVertical-s-I-SeMs.js";import"./Stars02-D2H5PbBg.js";import"./Eye-Dy66amqx.js";import"./Globe01-ClbfJyVj.js";import"./FilterLines-CKjQJFz5.js";import"./Star01-K-8uJAnL.js";import"./Globe04-2CK2mPg1.js";import"./HardDrive-Dx19OIYm.js";import"./Key01-CYpto-hP.js";import"./LayoutLeft-DfuPk5zB.js";import"./LinkExternal01-BY6pxfcE.js";import"./Monitor01-DIakRasc.js";import"./Sun-BEU2sOPn.js";import"./Palette-BiMvnm3j.js";import"./Play-RNy-gHCT.js";import"./Plus-BUzQUcBo.js";import"./SearchLg-BrFHn1VQ.js";import"./SearchMd-BCWqgdhj.js";import"./Shield01-CCbPTO_T.js";import"./Stars01-DC5B5fh3.js";import"./Trash01-mBWH2_eT.js";import"./Upload01-C5TCL0j-.js";import"./User01-DLp0deex.js";import"./Users01-fyeOJNBU.js";import"./X-BICfxl5D.js";import"./Zap-Dc5VDOja.js";import"./use-clock-tick-DMIcMeX9.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BvBAqh5C.js";import"./file-type-icon-BwBw9jgA.js";import"./use-mobile-CMJi7yoD.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-BRex8hoG.js";import"./use-mcp-client-Bcb6PO24.js";import"./auth-Ci0maryd.js";import"./hooks-B9L41m_Y.js";import"./decopilot-sse-pool-IAlPSPK_.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-FVMOC3DG.js";import"./sheet-BYUn2G0P.js";import"./integration-icon-CmIcxQej.js";import"./use-virtual-mcp-co7b_FD9.js";import"./use-collections-_UlIpgjP.js";import"./use-navigate-to-agent-C83xFoxW.js";import"./use-connection-BxSCzh2E.js";import"./use-mcp-prompts-AJeQrCqj.js";import"./form-Bf2ApXQo.js";import"./label-Bqc_uyUQ.js";import"./select-DTMty5cI.js";import"./use-ai-providers-hvnDjM8p.js";import"./use-decopilot-events-CRfiqA6B.js";import"./use-organization-settings-D1Ju0RBO.js";import"./avatar-Cd0xwXxq.js";import"./required-auth-layout-C5MLQuQM.js";import"./use-org-sso-C1crpljI.js";import"./index-DiptY5jt.js";import"./drawer-DaarKmto.js";import"./collection-search-BvmQJq8P.js";import"./tabs-Dyn89gKO.js";import"./toggle-group-DLGm3J-b.js";import"./sortable.esm-BpfhpFW8.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BH-OGmTu.js";import"./use-registry-connections-iyE_-Lc9.js";import"./useInfiniteQuery-CuzY8zzZ.js";import"./use-infinite-scroll-BSMoGR4k.js";import"./extract-connection-data-Dsj4pa-O.js";import"./card-B200otkw.js";import"./collection-tabs-BLB5SWZa.js";import"./badge-US-X-4MC.js";import"./textarea-Sgn1Re8l.js";import"./connection-form-helpers-Bi2tQByg.js";import"./authenticate-and-persist-oauth-CZPX5X5k.js";import"./mcp-oauth-C63GAzZt.js";import"./useSuspenseInfiniteQuery-BpUXD3KF.js";import"./connect-desktop-dialog-BBGOPoIq.js";import"./decopilot-bUCWwVB7.js";import"./checkbox-DA-oWLyy.js";import"./skeleton-DGyuQcWM.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Czv-RCDl.js";import"./popover-C5HgpX4x.js";import"./command-esgtnpD6.js";import"./index-DBTxlw_P.js";import"./dropdown-menu-CZpb3eYC.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-HySek8pC.js";import"./empty-state-CAlFsQdU.js";import"./toolbar-CSosPZ4D.js";import"./use-mcp-tools-qTvFx3Nb.js";import"./use-capability-CFzya3JS.js";import"./shell-route-loading-B5fcdA3q.js";import"./index-B8k191tl.js";import"./switch-RrT6wLYL.js";import"./use-debounced-autosave-BHDQ7RHW.js";import"./index-Q6pGpUHX.js";import"./sidebar-bM2CxBRy.js";import"./search-input-Be3BJ5YO.js";import"./github-repo-picker--XFvpeLm.js";import"./use-debounced-value-BB2O7NbI.js";import"./use-secrets-DnspbGKA.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-BChdPYXY.js";import"./automation-runs-Cz-auyir.js";import"./table-FgURfELI.js";import"./use-members-zes1mdlJ.js";import"./use-org-auth-client-DJhVKhdJ.js";import"./task-status-ClaTWvtm.js";import"./use-automations-BKwvpJAo.js";import"./use-file-configs-BasVpNvI.js";import"./monaco-editor-CpkaOm7i.js";import"./select-model-Cv0Zl4px.js";import"./automation-list-row-wzlcI0kv.js";const _t={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function en(y){const e=Ke.c(51),{open:c,mode:K,initialName:X,parentLabel:Q,isPending:A,onSubmit:V,onOpenChange:P}=y,W=X===void 0?"":X,o=A===void 0?!1:A,[p,O]=l.useState(W),[I,B]=l.useState(c),f=_t[K];c!==I&&(B(c),c&&O(W));let F;e[0]!==o||e[1]!==P?(F=E=>{!E&&!o&&P(!1)},e[0]=o,e[1]=P,e[2]=F):F=e[2];const U=F;let G;e[3]!==o||e[4]!==p||e[5]!==V?(G=async E=>{E.preventDefault();const z=p.trim();!z||o||await V(z)},e[3]=o,e[4]=p,e[5]=V,e[6]=G):G=e[6];const q=G;let L;e[7]!==f.title?(L=i.jsx($t,{children:f.title}),e[7]=f.title,e[8]=L):L=e[8];let N;e[9]!==f.description?(N=i.jsx(Ot,{children:f.description}),e[9]=f.description,e[10]=N):N=e[10];let R;e[11]!==L||e[12]!==N?(R=i.jsxs(Rt,{children:[L,N]}),e[11]=L,e[12]=N,e[13]=R):R=e[13];let S;e[14]!==Q?(S=Q&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),i.jsx(We,{value:Q,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=Q,e[15]=S):S=e[15];let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=D):D=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=E=>O(E.target.value),e[17]=j):j=e[17];let b;e[18]!==f.placeholder||e[19]!==o||e[20]!==p?(b=i.jsxs("div",{className:"space-y-1.5",children:[D,i.jsx(We,{id:"file-explorer-name",value:p,onChange:j,placeholder:f.placeholder,autoFocus:!0,disabled:o})]}),e[18]=f.placeholder,e[19]=o,e[20]=p,e[21]=b):b=e[21];let h;e[22]!==b||e[23]!==S?(h=i.jsxs("div",{className:"space-y-4 py-4",children:[S,b]}),e[22]=b,e[23]=S,e[24]=h):h=e[24];let x;e[25]!==P?(x=()=>P(!1),e[25]=P,e[26]=x):x=e[26];let C;e[27]!==o||e[28]!==x?(C=i.jsx(fe,{type:"button",variant:"outline",onClick:x,disabled:o,children:"Cancel"}),e[27]=o,e[28]=x,e[29]=C):C=e[29];let v;e[30]!==o||e[31]!==p?(v=!p.trim()||o,e[30]=o,e[31]=p,e[32]=v):v=e[32];let u;e[33]!==f.submit||e[34]!==o?(u=o?i.jsxs(i.Fragment,{children:[i.jsx(re,{size:14,className:"animate-spin"}),"Saving…"]}):f.submit,e[33]=f.submit,e[34]=o,e[35]=u):u=e[35];let k;e[36]!==v||e[37]!==u?(k=i.jsx(fe,{type:"submit",disabled:v,children:u}),e[36]=v,e[37]=u,e[38]=k):k=e[38];let m;e[39]!==C||e[40]!==k?(m=i.jsxs(zt,{children:[C,k]}),e[39]=C,e[40]=k,e[41]=m):m=e[41];let g;e[42]!==q||e[43]!==h||e[44]!==m||e[45]!==R?(g=i.jsx(At,{className:"sm:max-w-md",children:i.jsxs("form",{onSubmit:q,children:[R,h,m]})}),e[42]=q,e[43]=h,e[44]=m,e[45]=R,e[46]=g):g=e[46];let T;return e[47]!==U||e[48]!==c||e[49]!==g?(T=i.jsx(Wt,{open:c,onOpenChange:U,children:g}),e[47]=U,e[48]=c,e[49]=g,e[50]=T):T=e[50],T}const tn="#d9a441";function nn(y){const e=Ke.c(45),{node:c,depth:K,isExpanded:X,isSelected:Q,isLoading:A,fileVisual:V,onOpen:P,onSelect:W,onNewFile:o,onNewFolder:p,onCopyPath:O,onCopyRelativePath:I,onRename:B,onDelete:f}=y,F=A===void 0?!1:A,U=c.kind==="directory",{Icon:G,color:q}=V,L=Q&&"bg-accent";let N;e[0]!==L?(N=Ve("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",L),e[0]=L,e[1]=N):N=e[1];const R=`${K*14+8}px`;let S;e[2]!==R?(S={paddingLeft:R},e[2]=R,e[3]=S):S=e[3];let D;e[4]!==P||e[5]!==W?(D=()=>{W(),P()},e[4]=P,e[5]=W,e[6]=D):D=e[6];let j;e[7]!==G||e[8]!==q||e[9]!==U||e[10]!==X||e[11]!==F?(j=U?i.jsxs(i.Fragment,{children:[F?i.jsx(re,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):X?i.jsx(Vt,{size:14,className:"shrink-0 text-muted-foreground"}):i.jsx(Bt,{size:14,className:"shrink-0 text-muted-foreground"}),i.jsx(Gt,{size:16,className:"shrink-0",style:{color:tn}})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"w-3.5 shrink-0"}),i.jsx(G,{size:16,className:"shrink-0",style:{color:q}})]}),e[7]=G,e[8]=q,e[9]=U,e[10]=X,e[11]=F,e[12]=j):j=e[12];let b;e[13]!==c.name?(b=i.jsx("span",{className:"truncate",children:c.name}),e[13]=c.name,e[14]=b):b=e[14];let h;e[15]!==N||e[16]!==S||e[17]!==D||e[18]!==j||e[19]!==b?(h=i.jsx(It,{asChild:!0,children:i.jsxs("button",{type:"button",className:N,style:S,onClick:D,children:[j,b]})}),e[15]=N,e[16]=S,e[17]=D,e[18]=j,e[19]=b,e[20]=h):h=e[20];let x;e[21]!==o?(x=i.jsx(_,{onSelect:o,children:"New File"}),e[21]=o,e[22]=x):x=e[22];let C;e[23]!==p?(C=i.jsx(_,{onSelect:p,children:"New Folder"}),e[23]=p,e[24]=C):C=e[24];let v;e[25]===Symbol.for("react.memo_cache_sentinel")?(v=i.jsx(Ie,{}),e[25]=v):v=e[25];let u;e[26]!==O?(u=i.jsx(_,{onSelect:O,children:"Copy Path"}),e[26]=O,e[27]=u):u=e[27];let k;e[28]!==I?(k=i.jsx(_,{onSelect:I,children:"Copy Relative Path"}),e[28]=I,e[29]=k):k=e[29];let m;e[30]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ie,{}),e[30]=m):m=e[30];let g;e[31]!==B?(g=i.jsx(_,{onSelect:B,children:"Rename"}),e[31]=B,e[32]=g):g=e[32];let T;e[33]!==f?(T=i.jsx(_,{variant:"destructive",onSelect:f,children:"Delete"}),e[33]=f,e[34]=T):T=e[34];let E;e[35]!==x||e[36]!==C||e[37]!==u||e[38]!==k||e[39]!==g||e[40]!==T?(E=i.jsxs(Mt,{className:"w-52",children:[x,C,v,u,k,m,g,T]}),e[35]=x,e[36]=C,e[37]=u,e[38]=k,e[39]=g,e[40]=T,e[41]=E):E=e[41];let z;return e[42]!==E||e[43]!==h?(z=i.jsxs(Kt,{children:[h,E]}),e[42]=E,e[43]=h,e[44]=z):z=e[44],z}pt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function je(y,e,c,K){return`/api/${y}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(c)}/${K}`}function rn(y){const e=M(y);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const sn="#94a3b8";function on(y){const e=y.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ae,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ae,color:"#d9a441"}:e.endsWith(".json")?{Icon:yt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ae,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ae,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:wt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:$e,color:"#64748b"}:{Icon:$e,color:sn}}function Vi({orgSlug:y,virtualMcpId:e,branch:c,openPath:K}){const[X,Q]=l.useState({files:[],directories:[],truncated:!1}),{files:A,directories:V}=X,[P,W]=l.useState(new Set),[o,p]=l.useState(null),[O,I]=l.useState(null),[B,f]=l.useState([]),[F,U]=l.useState(""),[G,q]=l.useState(!1),[L,N]=l.useState(!1),[,R]=l.useState(new Set),[S,D]=l.useState(new Set),j=l.useRef(0),b=l.useRef(null),h=l.useRef(new Set),x=l.useRef(new Map);function C(t){R(n=>{const r=typeof t=="function"?t(n):t;return h.current=r,r})}const[v,u]=l.useState(new Map),k=l.useRef(null),[m,g]=l.useState(null),{sendMessage:T}=Et(),{setChatOpen:E}=Pt(),z=ut(),[w,J]=l.useState(null),[H,ue]=l.useState(null),[ee,ie]=l.useState(!1);async function te(t,n){const r=await fetch(je(y,e,c,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.error??`Request failed (${r.status})`)}return r.json()}async function se(){z.invalidateQueries({queryKey:Ae(y,e,c)})}function be(t,n){navigator.clipboard.writeText(n).then(()=>$.success(`${t} copied`),()=>$.error(`Failed to copy ${t.toLowerCase()}`))}function Be(t){const n=Yt(t);if(!n)return;const r=`${y}/${e}/${c}`;z.setQueryData(Te.decofile(r),s=>{if(!s)return s;const{[n]:a,...d}=s;return d}),z.invalidateQueries({queryKey:Te.liveMeta(r)})}function Ge(t){const n=t.kind==="file"?[t.path]:A.filter(r=>r.startsWith(".deco/blocks/")).map(r=>ce(r)).filter(r=>r===t.path||r.startsWith(`${t.path}/`));for(const r of n)Be(r)}function qe(t){const n=ce(t);return B.filter(r=>{if(r!==n&&!r.startsWith(`${n}/`))return!1;const s=v.get(r);return!!(s?.loaded&&s.editorValue!==s.savedContent)})}function Ce(t){f(n=>n.map(r=>t(r)).filter(r=>r!==null)),p(n=>n&&t(n)),u(n=>{const r=new Map;for(const[s,a]of n){const d=t(s);d&&r.set(d,a)}return r}),I(n=>{if(!n)return n;const r=t(n.path);return r?r===n.path?n:{...n,path:r,name:r.split("/").pop()??r}:null})}function Qe(t){const n=ce(t);I(r=>r&&(r.path===n||r.path.startsWith(`${n}/`)?null:r)),Ce(r=>r===n||r.startsWith(`${n}/`)?null:r)}async function Ue(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);await te("write",{path:M(n),content:""}),await ne(),await se(),J(null),me(n)}async function Je(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);const r=M(n);await te("mkdir",{path:r}),Q(s=>({...s,directories:s.directories.includes(r)?s.directories:[...s.directories,r]})),await ne(),await se(),J(null),W(s=>{const a=new Set(s);for(const d of he(n))a.add(d);return a.add(n),a}),I({name:t,path:n,kind:"directory",children:[]})}async function He(t){if(!w)return;const n=w.node.path,r=ye(n),s=de(r,t);if(s===n){J(null);return}if(we(s,A,V))throw new Error(`"${t}" already exists`);await te("rename",{from:M(n),to:M(s)}),Ce(a=>a===n?s:a.startsWith(`${n}/`)?de(s,a.slice(n.length+1)):a),await ne(),await se(),J(null)}async function Xe(t){ie(!0);try{await te("unlink",{path:M(t.path),recursive:t.kind==="directory"}),Ge(t),Qe(t.path),await ne(),await se(),ue(null),$.success(`Deleted "${t.name}"`)}catch(n){$.error(n instanceof Error?n.message:"Delete failed")}finally{ie(!1)}}async function Ye(t){const n=Xt(t);if(n){$.error(n);return}ie(!0);try{w?.mode==="new-file"?(await Ue(t),$.success(`Created "${t}"`)):w?.mode==="new-folder"?(await Je(t),$.success(`Created folder "${t}"`)):w?.mode==="rename"&&(await He(t),$.success(`Renamed to "${t}"`))}catch(r){$.error(r instanceof Error?r.message:"Operation failed")}finally{ie(!1)}}const ve=l.useRef(!1);ve.current||(ve.current=!0,b.current=ne());const[Ze,_e]=l.useState(null);if(K&&K!==Ze){_e(K);const t=K;queueMicrotask(()=>{rn(t)&&me(t).catch(n=>{$.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ne(t){const n=await te("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Se(t,n,r){if(r!==j.current)return!1;let s=!1;return Q(a=>{const d=n?Zt(a.files,a.directories,t,a.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return s=!!d.truncated,{files:d.files,directories:d.directories,truncated:s}}),s&&$.warning("File list truncated — some files may be hidden"),s}async function et(t){const n=x.current.get(t);if(n)return n;const r=j.current,s=(async()=>{const a=await Ne({pattern:"**/*",path:M(t),limit:Me}),d=Se(a,!0,r);return!d&&r===j.current&&C(Y=>{const oe=new Set(Y);return oe.add(t),oe}),d})();x.current.set(t,s);try{return await s}finally{x.current.delete(t)}}async function De(t){if(!ge(t,h.current))return!1;D(n=>new Set(n).add(t));try{return await et(t)}finally{D(n=>{const r=new Set(n);return r.delete(t),r})}}async function tt(t){const n=new Set(h.current);for(const r of he(t)){if(!ge(r,n))continue;if(await De(r))throw new Error("Folder listing truncated — expand again to load more");n.add(r)}}async function ne(){const t=++j.current;x.current.clear(),q(!0),C(new Set),W(new Set),D(new Set);try{const n=await Ne({pattern:"**/*",limit:Me,maxDepth:qt});Se(n,!1,t),N(!0)}catch{L&&$.error("Failed to refresh file tree")}finally{q(!1)}}async function ke(t){if(!v.get(t)?.loaded){u(r=>{const s=new Map(r);return s.set(t,{savedContent:"",editorValue:"",loaded:!1}),s});try{const r=await fetch(je(y,e,c,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),full:!0})});if(!r.ok)return;const s=await r.json(),a=Ht(s.content??"");u(d=>{const Y=new Map(d);return Y.set(t,{savedContent:a,editorValue:a,loaded:!0}),Y})}catch{}}}async function nt(t,n){try{const r=await fetch(je(y,e,c,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),content:n})});if(!r.ok){le("file save failed",{path:t,status:r.status});return}le("file saved via sandbox /write",{path:t}),z.invalidateQueries({queryKey:Ae(y,e,c)});try{const s=await Tt(y,e,c);le("git status after save",s)}catch(s){le("git status after save failed",{path:t,error:s instanceof Error?s.message:String(s)})}u(s=>{const a=new Map(s),d=a.get(t);return d&&a.set(t,{...d,savedContent:n}),a})}catch{}}function rt(t){p(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),g(null),B.includes(t)||f(n=>[...n,t]),ke(t)}function it(t){f(n=>{const r=n.filter(s=>s!==t);return o===t&&p(r[r.length-1]??null),r}),u(n=>{const r=new Map(n);return r.delete(t),r})}function Fe(t){W(n=>{const r=new Set(n);return r.has(t)?r.delete(t):r.add(t),r})}async function st(t){if(ge(t,h.current))try{if(await De(t))return}catch(n){$.error(n instanceof Error?n.message:"Failed to load folder");return}Fe(t)}async function ot(t,n){if(n){Fe(t);return}await st(t)}async function me(t){await b.current,await tt(t);const n=he(t);W(r=>{const s=new Set(r);for(const a of n)s.add(a);return s}),rt(t)}function at(){return O?.kind==="directory"?O.path:O?.kind==="file"?ye(O.path):o?ye(o):"/"}function Le(t){const n=at();J({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const lt=Qt(A,V),Ee=Ut(lt,P),Pe=F?Ee.filter(t=>t.node.name.toLowerCase().includes(F.toLowerCase())):Ee,Z=o?v.get(o):null,ct=Z?.loaded&&Z.editorValue!==Z.savedContent,pe=H?qe(H.path):[],dt=(t,n)=>{k.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!o)return;const r=t.getValue();await nt(o,r)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const r=t.getSelection(),s=t.getModel();if(!r||!s||!o)return;const a=s.getValueInRange(r);g({filePath:o,lineStart:r.startLineNumber,lineEnd:r.endLineNumber,selectedCode:a})})};function ft(t){if(!m)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${m.filePath}\``,`**Lines:** ${m.lineStart}–${m.lineEnd}`];if(m.selectedCode){const r=xe(m.filePath),s=m.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+r,s,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),E(!0),T({parts:[{type:"text",text:n.join(`
2
- `)}]}),g(null)}return G&&!L?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[i.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[i.jsxs("div",{className:"relative min-w-0 flex-1",children:[i.jsx(ht,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),i.jsx("input",{type:"text",value:F,onChange:t=>U(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),i.jsxs(Oe,{children:[i.jsx(Re,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:i.jsx(xt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New file"})]}),i.jsxs(Oe,{children:[i.jsx(Re,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:i.jsx(gt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New folder"})]})]}),i.jsx(bt,{className:"flex-1",children:i.jsxs("div",{className:"py-1",children:[Pe.map(t=>{const{node:n,depth:r}=t,s=n.kind==="directory",a=P.has(n.path),d=O?.path===n.path,Y=Jt(n.path,n.kind),oe=s&&S.has(n.path);return i.jsx(nn,{node:n,depth:r,isExpanded:a,isSelected:d,isLoading:oe,fileVisual:on(n.name),onSelect:()=>I(n),onOpen:()=>{s?ot(n.path,a):me(n.path)},onNewFile:()=>J({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>J({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>be("Path",ce(n.path)),onCopyRelativePath:()=>be("Relative path",M(n.path)),onRename:()=>J({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ue(n)},n.path)}),L&&Pe.length===0&&i.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:F?`No files match "${F}"`:"No files found"})]})})]}),i.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[B.length>0&&i.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:B.map(t=>{const n=v.get(t),r=n?.loaded&&n.editorValue!==n.savedContent,s=o===t,a=t.split("/").pop()??t;return i.jsxs("div",{className:Ve("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",s?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{p(t),ke(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":s,children:[i.jsx("span",{className:"truncate max-w-32",children:a}),r&&i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),i.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:d=>{d.stopPropagation(),it(t)},children:i.jsx(jt,{size:12})})]},t)})}),m&&i.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:i.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const r=t.currentTarget.elements.namedItem("askAiInput");r.value.trim()&&ft(r.value)},children:[i.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&g(null)}}),i.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[i.jsx("title",{children:"Send"}),i.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),i.jsx("div",{className:"flex-1 overflow-hidden",children:o&&Z?.loaded?i.jsx(mt,{language:xe(o),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:Z.editorValue,path:o,onChange:t=>{const n=o;n&&u(r=>{const s=new Map(r),a=s.get(n);return a&&s.set(n,{...a,editorValue:t??""}),s})},onMount:dt,loading:i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},o):o&&!Z?.loaded?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),o&&i.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[i.jsx("span",{className:"truncate",children:o}),i.jsxs("span",{children:[ct?"Modified":"Saved"," ·"," ",xe(o)]})]})]}),i.jsx(en,{open:w!==null,mode:w?.mode??"new-file",initialName:w?.mode==="rename"?w.node.name:"",parentLabel:w&&w.mode!=="rename"?w.parentDir==="/"?"/":M(w.parentDir):void 0,isPending:ee,onSubmit:Ye,onOpenChange:t=>{!t&&!ee&&J(null)}}),i.jsx(Ct,{open:H!==null,onOpenChange:t=>{!t&&!ee&&ue(null)},children:i.jsxs(vt,{children:[i.jsxs(Nt,{children:[i.jsxs(St,{children:["Delete ",H?.kind==="directory"?"folder":"file","?"]}),i.jsxs(Dt,{children:["This will permanently delete"," ",i.jsx("span",{className:"font-mono",children:H?.name}),H?.kind==="directory"?" and everything inside it.":".",pe.length>0&&i.jsxs(i.Fragment,{children:[" ",pe.length===1?"One open file has unsaved changes that will be lost.":`${pe.length} open files have unsaved changes that will be lost.`]})]})]}),i.jsxs(kt,{children:[i.jsx(Ft,{disabled:ee,children:"Cancel"}),i.jsx(Lt,{disabled:ee||!H,onClick:t=>{t.preventDefault(),H&&Xe(H)},children:"Delete"})]})]})})]})}export{Vi as FileExplorer};